@readmagic/workmate 0.0.1
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-BSLHrjbt.js +1 -0
- package/dist/chunks/App-DY5O6IKw.js +1 -0
- package/dist/chunks/ApproveApiKey-BEzfC6r3.js +1 -0
- package/dist/chunks/ApproveApiKey-DfAPwDix.js +1 -0
- package/dist/chunks/AssistantSessionChooser-Ce3PraaD.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-B68V1bCq.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CTWhpIm8.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +1 -0
- package/dist/chunks/DesktopHandoff-BRbU4is4.js +1 -0
- package/dist/chunks/Dialog-vfLXEPed.js +1 -0
- package/dist/chunks/DiffDialog-CBluIK-x.js +6 -0
- package/dist/chunks/Doctor-B0CRtxi2.js +1 -0
- package/dist/chunks/Doctor-WxNv49HC.js +3 -0
- package/dist/chunks/ExitFlow-CRPgptCN.js +2 -0
- package/dist/chunks/Feedback-CEtzaLr3.js +2 -0
- package/dist/chunks/Grove--kttLxvs.js +11 -0
- package/dist/chunks/Grove-CelgLWH4.js +1 -0
- package/dist/chunks/HybridTransport-BgV5_7Az.js +4 -0
- package/dist/chunks/InvalidConfigDialog-DCGwXW_p.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-jTwsdXWr.js +1 -0
- package/dist/chunks/ListItem-vfLXEPed.js +1 -0
- package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +1 -0
- package/dist/chunks/McpParsingWarnings-WQrWJeWP.js +1 -0
- package/dist/chunks/MessageSelector-_UZB8cGb.js +3 -0
- package/dist/chunks/Messages-jCoW_1Rr.js +11 -0
- package/dist/chunks/Onboarding-BoIVNCgc.js +1 -0
- package/dist/chunks/OverageCreditUpsell-1FCN8bH3.js +1 -0
- package/dist/chunks/PermissionDialog-0ya1CU5k.js +1 -0
- package/dist/chunks/PluginSettings-BD9JLV9-.js +17 -0
- package/dist/chunks/PressEnterToContinue-Dl9Hg9Mf.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-CrGST0Cq.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-B2TDpbpw.js +1 -0
- package/dist/chunks/QueryEngine-D2HUnwmU.js +1 -0
- package/dist/chunks/REPL-BV4WyYMg.js +142 -0
- package/dist/chunks/REPL-DcpN3MRC.js +1 -0
- package/dist/chunks/RemoteCallout-DS_EV6Fh.js +1 -0
- package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +2 -0
- package/dist/chunks/ResumeConversation-Cw3vP4G8.js +1 -0
- package/dist/chunks/SSETransport-BXiEBMpb.js +4 -0
- package/dist/chunks/SearchBox-vfLXEPed.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +1 -0
- package/dist/chunks/Settings-ns6mRsDc.js +2 -0
- package/dist/chunks/TeleportProgress-CcDzMC5L.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DZbxl4sD.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-EowJO5nm.js +1 -0
- package/dist/chunks/ThemePicker-BYbChJpu.js +1 -0
- package/dist/chunks/TrustDialog-DA3YTk_k.js +1 -0
- package/dist/chunks/TungstenTool-Cb7gJvq4.js +1 -0
- package/dist/chunks/TungstenTool-CxMQVCuF.js +1 -0
- package/dist/chunks/ValidationErrorsList-Cx-hoRwG.js +2 -0
- package/dist/chunks/WelcomeV2-BTfttGcv.js +1 -0
- package/dist/chunks/add-dir-CWt69NAZ.js +1 -0
- package/dist/chunks/agentDisplay-CQ4mZWFH.js +1 -0
- package/dist/chunks/agents-C6jzKOit.js +2 -0
- package/dist/chunks/agents-D4clhuCl.js +103 -0
- package/dist/chunks/ajv-5vMo9UcX.js +8 -0
- package/dist/chunks/allErrors-HMPqE0jK.js +1 -0
- package/dist/chunks/analytics-BotDBGh0.js +1 -0
- package/dist/chunks/ant-9Z5bppVC.js +1 -0
- package/dist/chunks/api-L2IgleTV.js +1 -0
- package/dist/chunks/api-TgV7fl9V.js +1 -0
- package/dist/chunks/asciicast-DYbkzGCN.js +1 -0
- package/dist/chunks/asciicast-n-BBfgDq.js +4 -0
- package/dist/chunks/assistant-BA9_Mo9U.js +1 -0
- package/dist/chunks/assistant-BiNOSla3.js +1 -0
- package/dist/chunks/assistant-YvbVKjVh.js +1 -0
- package/dist/chunks/attributionHooks-CUAoGkU6.js +1 -0
- package/dist/chunks/attributionTrailer-oKKrF3z8.js +1 -0
- package/dist/chunks/auth-CEig4Gxp.js +1 -0
- package/dist/chunks/auth-CbGDlhyO.js +1 -0
- package/dist/chunks/auth-DHyCIxCk.js +15 -0
- package/dist/chunks/autoMode-Db4QrgFr.js +45 -0
- package/dist/chunks/autoModeDenials-BxNzGJdR.js +1 -0
- package/dist/chunks/autonomy-BkAMA7du.js +1 -0
- package/dist/chunks/autonomy-D4Vy-RPQ.js +15 -0
- package/dist/chunks/autonomyPanel-EjfO8jvg.js +1 -0
- package/dist/chunks/axios-BHBm_hhU.js +1 -0
- package/dist/chunks/axios-DaWTGg7G.js +16 -0
- package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +1 -0
- package/dist/chunks/backgroundHousekeeping-hDDE8mJC.js +17 -0
- package/dist/chunks/banner-hD6wZygx.js +2 -0
- package/dist/chunks/base64-js-0wLHn8zB.js +1 -0
- package/dist/chunks/bedrockClient-DxE_mHFI.js +15 -0
- package/dist/chunks/bg-BzG63WOm.js +1 -0
- package/dist/chunks/bg-DQ0Q3Qv-.js +9 -0
- package/dist/chunks/branch-CeQ9IyZk.js +3 -0
- package/dist/chunks/break-cache-Bd0clV2N.js +8 -0
- package/dist/chunks/bridge-yerAiaK2.js +2 -0
- package/dist/chunks/bridgeConfig-CCtXe8ak.js +1 -0
- package/dist/chunks/bridgeConfig-D5dB38xD.js +1 -0
- package/dist/chunks/bridgeEnabled--F-6TUi4.js +1 -0
- package/dist/chunks/bridgeEnabled-DKX8-T_H.js +1 -0
- package/dist/chunks/bridgeMain--R1HFbOv.js +68 -0
- package/dist/chunks/bridgeMain-d06JByZn.js +1 -0
- package/dist/chunks/bridgeMessaging-CqbLTDcx.js +1 -0
- package/dist/chunks/bridgePointer-W_jdQ8zf.js +1 -0
- package/dist/chunks/browser-Bd7GeBH1.js +1 -0
- package/dist/chunks/btw-CVGRmL9a.js +1 -0
- package/dist/chunks/bundledMode--fG1S62b.js +1 -0
- package/dist/chunks/caches-BtmAri4e.js +3 -0
- package/dist/chunks/caches-BuTIAOtY.js +1 -0
- package/dist/chunks/capacityWake-CV_x9H8j.js +1 -0
- package/dist/chunks/ccrClient-HqMi5Kfu.js +1 -0
- package/dist/chunks/checksum-DgbnMdM-.js +1 -0
- package/dist/chunks/classPrivateFieldSet2-D4U5K-I3.js +1 -0
- package/dist/chunks/classPrivateMethodInitSpec-BXQD0Vh4.js +1 -0
- package/dist/chunks/claudeDesktop-aUMx06RK.js +1 -0
- package/dist/chunks/clear-C6nRzIQE.js +1 -0
- package/dist/chunks/cliLaunch-2AUoMnqx.js +1 -0
- package/dist/chunks/client-BeET1hnC.js +1 -0
- package/dist/chunks/client-DchQnIJD.js +36 -0
- package/dist/chunks/client-DvAL7lY8.js +8 -0
- package/dist/chunks/color-DXI_4ibU.js +1 -0
- package/dist/chunks/color-convert-p91EwGT7.js +1 -0
- package/dist/chunks/commands-VjcG4qFq.js +1 -0
- package/dist/chunks/commitAttribution-Cm40fdNU.js +2 -0
- package/dist/chunks/commitAttribution-Lb3qUlAR.js +1 -0
- package/dist/chunks/compact-DPTVpJ4D.js +2 -0
- package/dist/chunks/completionCache-BQaLkB4d.js +4 -0
- package/dist/chunks/completionCache-CW8lKIgy.js +1 -0
- package/dist/chunks/config-0cRberzR.js +1 -0
- package/dist/chunks/config-BSXLgwpD.js +1 -0
- package/dist/chunks/config-BrxKpHpR.js +1 -0
- package/dist/chunks/config-C7YHKCPV.js +3 -0
- package/dist/chunks/config-CLmFk-5V.js +1 -0
- package/dist/chunks/connectHeadless-CqRoEtrg.js +1 -0
- package/dist/chunks/context-C_cKrBUn.js +1 -0
- package/dist/chunks/context-noninteractive-DnH6Q9Lu.js +54 -0
- package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +1 -0
- package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +1 -0
- package/dist/chunks/conversation-GJxfkr6M.js +1 -0
- package/dist/chunks/conversation-oK3aFzqO.js +1 -0
- package/dist/chunks/createSSHSession--bWmmIk9.js +6 -0
- package/dist/chunks/createSession-DIr4sUp6.js +1 -0
- package/dist/chunks/createSession-DM4acqaC.js +1 -0
- package/dist/chunks/cron-3LntnnhJ.js +1 -0
- package/dist/chunks/crossProjectResume-DKrtjTpm.js +40 -0
- package/dist/chunks/cwd-BuJhkTrc.js +1 -0
- package/dist/chunks/cwd-D-tY2NKc.js +1 -0
- package/dist/chunks/daemon-B9lBPdBJ.js +2 -0
- package/dist/chunks/dangerousBackend-DwcP0P08.js +1 -0
- package/dist/chunks/datadog-ByS7LGGa.js +1 -0
- package/dist/chunks/datadog-DNCsyfSO.js +1 -0
- package/dist/chunks/debug-DzZUT2Wv.js +1 -0
- package/dist/chunks/debug-IKW-jE7K.js +39 -0
- package/dist/chunks/debugUtils-D2981c0Z.js +1 -0
- package/dist/chunks/defineProperty-C-QyHrDq.js +1 -0
- package/dist/chunks/desktop-B5cvrcOQ.js +1 -0
- package/dist/chunks/detached-rfIUyc-B.js +5 -0
- package/dist/chunks/detect-libc-CxbBtWJu.js +1 -0
- package/dist/chunks/detectRepository-6nw-Aw3v.js +1 -0
- package/dist/chunks/detectRepository-ReZ0Fz8Z.js +1 -0
- package/dist/chunks/diff-cXAp9cNN.js +1 -0
- package/dist/chunks/directoryCompletion-DBM2o5kx.js +1 -0
- package/dist/chunks/dist-CXlEpGqr.js +20 -0
- package/dist/chunks/dist-DESLAofA.js +1 -0
- package/dist/chunks/dist-DIee4wq1.js +29 -0
- package/dist/chunks/dist-Dopnn8wS.js +5 -0
- package/dist/chunks/dist-es-5t7v8oaj.js +1 -0
- package/dist/chunks/dist-es-BF6bR-Ik.js +2 -0
- package/dist/chunks/dist-es-BIjDeceU.js +1 -0
- package/dist/chunks/dist-es-BOPBJQo3.js +1 -0
- package/dist/chunks/dist-es-Bfr4TzQe.js +3 -0
- package/dist/chunks/dist-es-Byxccz_-.js +1 -0
- package/dist/chunks/dist-es-C-OjW2Ao.js +1 -0
- package/dist/chunks/dist-es-C3reqy7X.js +1 -0
- package/dist/chunks/dist-es-C7vygWzp.js +1 -0
- package/dist/chunks/dist-es-CEk66gUu.js +1 -0
- package/dist/chunks/dist-es-CIULjvtA2.js +1 -0
- package/dist/chunks/dist-es-CMtO44xC.js +1 -0
- package/dist/chunks/dist-es-CQMt6zRM.js +1 -0
- package/dist/chunks/dist-es-CYPVg66r.js +9 -0
- package/dist/chunks/dist-es-Cd_AeqMK.js +6 -0
- package/dist/chunks/dist-es-Cgsa8pb82.js +1 -0
- package/dist/chunks/dist-es-Cwru7c2B2.js +1 -0
- package/dist/chunks/dist-es-D1Y8zSMI.js +1 -0
- package/dist/chunks/dist-es-D1wHe_zh.js +1 -0
- package/dist/chunks/dist-es-DKFm0FJ7.js +1 -0
- package/dist/chunks/dist-es-DKIwwJME.js +1 -0
- package/dist/chunks/dist-es-DNFTCbrP.js +1 -0
- package/dist/chunks/dist-es-DXIR5NLi2.js +1 -0
- package/dist/chunks/dist-es-DelBIxNM.js +1 -0
- package/dist/chunks/dist-es-DmdZmEJ-.js +1 -0
- package/dist/chunks/dist-es-Gt_DpXlP.js +1 -0
- package/dist/chunks/dist-es-gUzZ_7Vf.js +1 -0
- package/dist/chunks/dist-es-kj-F5A132.js +1 -0
- package/dist/chunks/dist-es-yHGBqhBe.js +1 -0
- package/dist/chunks/doctor-CTMHXZvQ.js +1 -0
- package/dist/chunks/earlyInput-BTC_Wucv.js +2 -0
- package/dist/chunks/earlyInput-xcoTbKQn.js +1 -0
- package/dist/chunks/effort-Br8KKHdx.js +9 -0
- package/dist/chunks/entry-4lIRMrLI.js +14 -0
- package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +1 -0
- package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +1 -0
- package/dist/chunks/envUtils-DSxRz_kt.js +1 -0
- package/dist/chunks/esm-BYnFh4pG.js +1 -0
- package/dist/chunks/esm-Bx6rTxIs.js +1 -0
- package/dist/chunks/esm-C367Cyo-.js +1 -0
- package/dist/chunks/esm-C8Zkk1Ux.js +1 -0
- package/dist/chunks/esm-CGx9qY3q.js +56 -0
- package/dist/chunks/esm-CXM9jqO_.js +1 -0
- package/dist/chunks/esm-CXczu_-W.js +1 -0
- package/dist/chunks/esm-CXt5K8Xt.js +1 -0
- package/dist/chunks/esm-Cb-L4oAk.js +1 -0
- package/dist/chunks/esm-D6ZZCdtk.js +1 -0
- package/dist/chunks/esm-DhRjocaU.js +1 -0
- package/dist/chunks/esm-DklLYEuz.js +1 -0
- package/dist/chunks/esm-IYgGg4wR.js +1 -0
- package/dist/chunks/esm-lWlUmoUA.js +1 -0
- package/dist/chunks/esm-lyfry1WB.js +10 -0
- package/dist/chunks/esm-wGnzjq4Z.js +1 -0
- package/dist/chunks/event-streams-C0Zy0Uqv.js +1 -0
- package/dist/chunks/event-streams-DoqJmjFN.js +1 -0
- package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +1 -0
- package/dist/chunks/execAsync-Bv2yxuGe.js +1 -0
- package/dist/chunks/execFileNoThrow-COKYqVQj.js +34 -0
- package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +1 -0
- package/dist/chunks/exit-BOhGfSlm.js +2 -0
- package/dist/chunks/exit-Z9oWrqE4.js +1 -0
- package/dist/chunks/extra-usage-BS4aVOt5.js +1 -0
- package/dist/chunks/extra-usage-DtAIhW74.js +1 -0
- package/dist/chunks/extra-usage-core-CdL1ltqq.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-DxxRI0Yx.js +1 -0
- package/dist/chunks/extraUsage-BYZdi44Y.js +1 -0
- package/dist/chunks/extractMemories-C4f9JWuI.js +1 -0
- package/dist/chunks/fast-B0OB4x7K.js +1 -0
- package/dist/chunks/fast-DKqiojzf.js +1 -0
- package/dist/chunks/featureCheck-CrJeuheQ.js +1 -0
- package/dist/chunks/featureCheck-HslM03dr.js +1 -0
- package/dist/chunks/feedback-yB19xph5.js +1 -0
- package/dist/chunks/figures-5ThXQEtq.js +1 -0
- package/dist/chunks/file-D1cN3LMK.js +12 -0
- package/dist/chunks/fileStateCache-DDW5toIs.js +1 -0
- package/dist/chunks/files-DAzGtmzz.js +2 -0
- package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +1 -0
- package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +5 -0
- package/dist/chunks/flushGate-ZFr8yv7F.js +1 -0
- package/dist/chunks/foundry-sdk-BdeF2aBu.js +1 -0
- package/dist/chunks/fpsMetrics-Cf_hdtiJ.js +1 -0
- package/dist/chunks/from-CgDRRLiX.js +4 -0
- package/dist/chunks/gemini-DqAv8_GY.js +1 -0
- package/dist/chunks/generateRecap-lO2PDlx8.js +1 -0
- package/dist/chunks/generateSessionName-48veu5dv.js +1 -0
- package/dist/chunks/genericProcessUtils-F1Qcb1sO.js +23 -0
- package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +1 -0
- package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +2 -0
- package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +1 -0
- package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +1 -0
- package/dist/chunks/getMachineId-win-DamF2CH_.js +1 -0
- package/dist/chunks/git-BE_FiJZp.js +1 -0
- package/dist/chunks/git-tyaWOgRL.js +6 -0
- package/dist/chunks/githubRepoPathMapping-BlR0BphY.js +1 -0
- package/dist/chunks/goal-Bn8Kz2Dp.js +3 -0
- package/dist/chunks/graceful-fs-DDVg0cja.js +2 -0
- package/dist/chunks/grok-DhnO_KDC.js +1 -0
- package/dist/chunks/grove-DotW04-v.js +7 -0
- package/dist/chunks/hash-Tu-My5Vp.js +1 -0
- package/dist/chunks/heapdump-DkZSKNbp.js +5 -0
- package/dist/chunks/help-DU_BcZtU.js +1 -0
- package/dist/chunks/hooks-BTMWE5Qx.js +79 -0
- package/dist/chunks/hooks-DONAb_nq.js +1 -0
- package/dist/chunks/hostGuard-Dh296c6q.js +1 -0
- package/dist/chunks/inboundAttachments-BcEgi49j.js +1 -0
- package/dist/chunks/inboundAttachments-DVs3_m48.js +1 -0
- package/dist/chunks/index.min-D75yiGLN.js +1 -0
- package/dist/chunks/initReplBridge-D0Xec8S-.js +1 -0
- package/dist/chunks/install-BkfXeXpv.js +1 -0
- package/dist/chunks/instinctParser-Dt-lqnDe.js +1 -0
- package/dist/chunks/instrumentation-H0XRS1yG.js +21 -0
- package/dist/chunks/intl-cKc-V6Mq.js +1 -0
- package/dist/chunks/isObject-C6qM3WEW.js +1 -0
- package/dist/chunks/isSymbol-BO6cdPI7.js +1 -0
- package/dist/chunks/job-DKtLkF8V.js +2 -0
- package/dist/chunks/json-bigint-bonnP-Hz.js +8 -0
- package/dist/chunks/jsx-runtime-Bb4Xn-E0.js +1 -0
- package/dist/chunks/jws-BscXOT9I.js +3 -0
- package/dist/chunks/jwtUtils-C-ojmb8W.js +1 -0
- package/dist/chunks/keybindings-ez51eHHp.js +2 -0
- package/dist/chunks/language-BuRSO2sR.js +1 -0
- package/dist/chunks/language-Da4KNbjm.js +1 -0
- package/dist/chunks/launchAgentsPlatform-BQyPdrHp.js +1 -0
- package/dist/chunks/launchCommand-1qkTCKpf.js +1 -0
- package/dist/chunks/launchLocalMemory-CWHAj7CX.js +3 -0
- package/dist/chunks/launchLocalVault-D8iJdtsP.js +3 -0
- package/dist/chunks/launchMemoryStores-W7jWG2uH.js +1 -0
- package/dist/chunks/launchOnboarding-q__LaLy1.js +8 -0
- package/dist/chunks/launchSchedule-BWi9F5vh.js +1 -0
- package/dist/chunks/launchSkillStore-4wd4MQBc.js +1 -0
- package/dist/chunks/launchTeleport-BlCf2QM_.js +3 -0
- package/dist/chunks/launchVault-C7u7LZV7.js +1 -0
- package/dist/chunks/lazySchema-uxlVVNM1.js +1 -0
- package/dist/chunks/lib-BSzUGQb_.js +2 -0
- package/dist/chunks/lib-BlVGipXx.js +14 -0
- package/dist/chunks/lib-rQZENxQg.js +8 -0
- package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +1 -0
- package/dist/chunks/loadAgentsDir-nzr38hai.js +3990 -0
- package/dist/chunks/loadPluginHooks-z1-zvBLw.js +1 -0
- package/dist/chunks/loadSso-DSxfVpgX.js +1 -0
- package/dist/chunks/localSearch-B-L_ldos.js +1 -0
- package/dist/chunks/localSearch-D-FprOMr.js +1 -0
- package/dist/chunks/lockfile-D5-j7HOZ.js +1 -0
- package/dist/chunks/log-B3eB4EFv.js +1 -0
- package/dist/chunks/logoV2Utils-RQ160dI2.js +1 -0
- package/dist/chunks/magicDocs-BqZ0GewA.js +57 -0
- package/dist/chunks/main-DeFMhaFE.js +31 -0
- package/dist/chunks/main-y7LJ5qUc.js +1243 -0
- package/dist/chunks/mappers-CWykjGfP.js +1 -0
- package/dist/chunks/mcp-CSFPAfaW.js +2 -0
- package/dist/chunks/mcp-DBwT4pa9.js +6 -0
- package/dist/chunks/mcp-DvZTaHZE.js +1 -0
- package/dist/chunks/memoize-BK3gG5ob.js +1 -0
- package/dist/chunks/memoize-BO31Ws9Q.js +1 -0
- package/dist/chunks/memory-DcpPpYN0.js +1 -0
- package/dist/chunks/metadata-BRLJvh61.js +1 -0
- package/dist/chunks/modalContext-DFjKLCB6.js +1 -0
- package/dist/chunks/mode-BkViT_0o.js +2 -0
- package/dist/chunks/model--z4Di9QO.js +1 -0
- package/dist/chunks/model-CZktWw6o.js +1 -0
- package/dist/chunks/model-DfFA3qMO.js +1 -0
- package/dist/chunks/multipart-parser-DDLYsngd.js +2 -0
- package/dist/chunks/nativeInstaller-GcIk7G2Y.js +1 -0
- package/dist/chunks/oauth-BqJqV-2M.js +1 -0
- package/dist/chunks/oauth-C8X_p8Gc.js +1 -0
- package/dist/chunks/observationStore-DzCdXq8U.js +4 -0
- package/dist/chunks/onChangeAppState-DwGVi-BC.js +1 -0
- package/dist/chunks/open-BtQHzzL9.js +1 -0
- package/dist/chunks/openai-B2wxZDQx.js +10 -0
- package/dist/chunks/openaiShared-G2-w4gJt.js +1 -0
- package/dist/chunks/output-style-BM3qAHLA.js +1 -0
- package/dist/chunks/overageCreditGrant-CjK49axw.js +1 -0
- package/dist/chunks/p-map-B1EeBuI8.js +1 -0
- package/dist/chunks/p-map-HKDr3iDo.js +1 -0
- package/dist/chunks/package-BC0bllK8.js +1 -0
- package/dist/chunks/panel-B-nrcHpm.js +1 -0
- package/dist/chunks/panel-R4ue6pSW.js +1 -0
- package/dist/chunks/panelCall-I_fbgub5.js +1 -0
- package/dist/chunks/parseConnectUrl-BiyKR5-x.js +1 -0
- package/dist/chunks/parser-BlM_Fk4J.js +1 -0
- package/dist/chunks/parser-CQrasoUB.js +1 -0
- package/dist/chunks/partition-CxRF7T-f.js +1 -0
- package/dist/chunks/passes-U_h-hNu-.js +1 -0
- package/dist/chunks/path-BCSE0S-c.js +1 -0
- package/dist/chunks/permissions-B8epy16o.js +3 -0
- package/dist/chunks/permissions-CeYKbtSC.js +1 -0
- package/dist/chunks/permissions-Cn_6f8CB.js +1 -0
- package/dist/chunks/pidLock-CBJDnBG_.js +3 -0
- package/dist/chunks/pipeTransport-D3Qx9v1V.js +1 -0
- package/dist/chunks/plan-BAhStVci.js +1 -0
- package/dist/chunks/platform-EtecGacO.js +2 -0
- package/dist/chunks/plist-Bzo2VMe9.js +6 -0
- package/dist/chunks/plugin-D9huNnv6.js +1 -0
- package/dist/chunks/pluginAutoupdate-BfmyxR5g.js +1 -0
- package/dist/chunks/pluginBlocklist-03sZaZa6.js +1 -0
- package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +1 -0
- package/dist/chunks/pluginFlagging-BVy7Xv_0.js +1 -0
- package/dist/chunks/pluginOperations-Cz37qcjF.js +2 -0
- package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +1 -0
- package/dist/chunks/pluginStartupCheck-w24D-wwk.js +1 -0
- package/dist/chunks/plugins-B0hiIN4q.js +4 -0
- package/dist/chunks/policyLimits-Dem-XJ_h.js +1 -0
- package/dist/chunks/pollConfig-C2Ac8WMU.js +1 -0
- package/dist/chunks/poller-CpLBoB-N.js +1 -0
- package/dist/chunks/poor-CfbMKZNJ.js +1 -0
- package/dist/chunks/poorMode-Bsw2V-V_.js +1 -0
- package/dist/chunks/poorMode-jvImnkty.js +1 -0
- package/dist/chunks/postCommitAttribution-DoSP9wZD.js +1 -0
- package/dist/chunks/print-ozjC0Mhg.js +23 -0
- package/dist/chunks/privacy-settings-DeGoBRrZ.js +1 -0
- package/dist/chunks/process-CNfq37LF.js +1 -0
- package/dist/chunks/process-gEbdy6uY.js +1 -0
- package/dist/chunks/processBashCommand-loWZ8MSE.js +1 -0
- package/dist/chunks/processSlashCommand-BdouajZb.js +5 -0
- package/dist/chunks/projectContext-BaDZBAoK.js +1 -0
- package/dist/chunks/projectContext-D9MDwJUF.js +1 -0
- package/dist/chunks/prompt-Bef63FhB.js +132 -0
- package/dist/chunks/prompt-C7wd1H_i.js +1 -0
- package/dist/chunks/prompt-DIoNqZvO.js +1 -0
- package/dist/chunks/promptEditor-foiayhdY.js +4 -0
- package/dist/chunks/protocolHandler-BsiB1oW_.js +13 -0
- package/dist/chunks/protocols-CCsohXid.js +18 -0
- package/dist/chunks/protocols-CnYQjBlj.js +2 -0
- package/dist/chunks/proxy-Cn2YwITp.js +99 -0
- package/dist/chunks/rate-limit-options-DTJPDcTr.js +1 -0
- package/dist/chunks/rcDebugLog-BUuD-X1D.js +11 -0
- package/dist/chunks/reconciler-DqXTmV3J.js +4 -0
- package/dist/chunks/referral-DP_GshTS.js +1 -0
- package/dist/chunks/refresh-CNzXPAFw.js +1 -0
- package/dist/chunks/registerProtocol-CjxlFsKw.js +36 -0
- package/dist/chunks/release-notes-BxgK8zWO.js +4 -0
- package/dist/chunks/releaseNotes-CbSktIJW.js +2 -0
- package/dist/chunks/reload-plugins-CDu6yU5-.js +1 -0
- package/dist/chunks/remote-env-B4HnhISc.js +1 -0
- package/dist/chunks/remoteBridgeCore-D-wG5jau.js +1 -0
- package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +1 -0
- package/dist/chunks/rename-DlbMb24l.js +1 -0
- package/dist/chunks/renderOptions-5kWQpVr2.js +1 -0
- package/dist/chunks/resume-BB5iBogS.js +2 -0
- package/dist/chunks/rewind-D12hCfZD.js +1 -0
- package/dist/chunks/ripgrep-BQgJ02F9.js +1 -0
- package/dist/chunks/ripgrep-BvDwiKJ3.js +5 -0
- package/dist/chunks/rollback-BPWRKlIZ.js +11 -0
- package/dist/chunks/rolldown-runtime-DaDcL9Zw.js +1 -0
- package/dist/chunks/runtimeObserver-BNH2WGE3.js +1 -0
- package/dist/chunks/runtimeObserver-Ci-5gvYg.js +10 -0
- package/dist/chunks/sandbox-adapter-Coe1GDAE.js +1 -0
- package/dist/chunks/sandbox-toggle-B2Yk4y2V.js +1 -0
- package/dist/chunks/sanitization-DV-94a9Z.js +1 -0
- package/dist/chunks/satisfies-DQJHNtpQ.js +1 -0
- package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +1 -0
- package/dist/chunks/searchExtraTools-BnWZ9roi.js +1 -0
- package/dist/chunks/semver-BMRJYn3q.js +1 -0
- package/dist/chunks/semver-DQo45qGo.js +1 -0
- package/dist/chunks/serde-f76bObzR.js +4 -0
- package/dist/chunks/server-LdbAb0sV.js +1 -0
- package/dist/chunks/serverBanner-BdExKFHT.js +1 -0
- package/dist/chunks/serverLog-BFmvyJ93.js +1 -0
- package/dist/chunks/session-Bmx7L3Mt.js +2 -0
- package/dist/chunks/sessionDataUploader-CaCjwsA2.js +1 -0
- package/dist/chunks/sessionDiscovery-DcEAr5vJ.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +1 -0
- package/dist/chunks/sessionManager-CPa049BO.js +1 -0
- package/dist/chunks/sessionMemory-Bsg2unYX.js +1 -0
- package/dist/chunks/sessionMemory-CIbCojm-.js +1 -0
- package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +1 -0
- package/dist/chunks/sessionObserver-CRU1qWnP.js +1 -0
- package/dist/chunks/sessionObserver-DQwHsDrM.js +20 -0
- package/dist/chunks/sessionStorage-BxDN8qRc.js +1 -0
- package/dist/chunks/sessionStoragePortable-Cx6JQ5Ye.js +3 -0
- package/dist/chunks/sessionTitle-B8jcexkQ.js +14 -0
- package/dist/chunks/sessionTracing-BuLsL6qA.js +11 -0
- package/dist/chunks/settings-5PQdphqC.js +19 -0
- package/dist/chunks/settingsSync-BDeuErb5.js +1 -0
- package/dist/chunks/setup-BKEnSLR9.js +3 -0
- package/dist/chunks/shadowedRuleDetection-7Z8ezTKF.js +1 -0
- package/dist/chunks/shellQuote-fB02N16J.js +4 -0
- package/dist/chunks/sideQuestion-CYdNATPW.js +20 -0
- package/dist/chunks/signin-CPaEtsnK.js +1 -0
- package/dist/chunks/sink-DjKoYMsA.js +1 -0
- package/dist/chunks/sink-iYxWapbU.js +1 -0
- package/dist/chunks/sinks-GryGVRT8.js +2 -0
- package/dist/chunks/sinks-jfaIjsRJ.js +1 -0
- package/dist/chunks/skill-learning-E8tQed-Q.js +5 -0
- package/dist/chunks/skillChangeDetector-A8SAuyo9.js +1 -0
- package/dist/chunks/skillGapStore-B5rl12bV.js +1 -0
- package/dist/chunks/skillGapStore-CjJrxxjk.js +5 -0
- package/dist/chunks/skillGenerator-BDR_z3-X.js +8 -0
- package/dist/chunks/skillLearning-BQtfFE0g.js +1 -0
- package/dist/chunks/skillLearning-C8ihdryM.js +1 -0
- package/dist/chunks/skillPanel-yR8Oi-mO.js +28 -0
- package/dist/chunks/skillSearchPanel-DUQQUCUS.js +21 -0
- package/dist/chunks/skills-NAZQ3j-t.js +1 -0
- package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +1 -0
- package/dist/chunks/src-CDCSSo0U2.js +53 -0
- package/dist/chunks/src-CHw1lvBc.js +3 -0
- package/dist/chunks/src-CST_jFnT.js +1 -0
- package/dist/chunks/src-CgZmCiiH.js +2 -0
- package/dist/chunks/src-CiJCsqUl.js +9 -0
- package/dist/chunks/src-D06Xyj4g.js +2 -0
- package/dist/chunks/src-DCUgdrYl.js +5 -0
- package/dist/chunks/src-DLz3FZm1.js +1 -0
- package/dist/chunks/src-DPUAq5Ty.js +1 -0
- package/dist/chunks/src-DQOX_xI1.js +1 -0
- package/dist/chunks/src-Dt5IJd3C.js +1 -0
- package/dist/chunks/src-Dvp6-vB7.js +19 -0
- package/dist/chunks/src-PM8NIIu_.js +1 -0
- package/dist/chunks/src-l6_O0K-a.js +1 -0
- package/dist/chunks/src-xRRBgNzF.js +25 -0
- package/dist/chunks/sso-oidc-DFJ7SBvI.js +1 -0
- package/dist/chunks/startupProfiler-B0m6crkd.js +1 -0
- package/dist/chunks/startupProfiler-DxRQteII.js +3 -0
- package/dist/chunks/state-4KQ3kaqz.js +1 -0
- package/dist/chunks/state-53JDbNQM.js +1 -0
- package/dist/chunks/state-Cn_m2NOf.js +1 -0
- package/dist/chunks/staticRender-BIxpgNUq.js +1 -0
- package/dist/chunks/stats-h4yu84Q-.js +1 -0
- package/dist/chunks/status-BbdeubJG.js +1 -0
- package/dist/chunks/status-is_Bg_IB.js +2 -0
- package/dist/chunks/statusNoticeHelpers-CQ7CUugR.js +1 -0
- package/dist/chunks/stdio-4S7b8Uhx.js +1 -0
- package/dist/chunks/stdio-W_Kokrkh.js +3 -0
- package/dist/chunks/stickers-qJoNhPk4.js +1 -0
- package/dist/chunks/store-Z8rTjDHe.js +1 -0
- package/dist/chunks/stringUtils-CvXbHQRH.js +4 -0
- package/dist/chunks/sts-C2Gf2WYN.js +1 -0
- package/dist/chunks/subprocessEnv-BSQSomcK.js +1 -0
- package/dist/chunks/subprocessEnv-vrwzMgKn.js +1 -0
- package/dist/chunks/supports-color-uJ1LqA-P.js +1 -0
- package/dist/chunks/systemPromptSections-CgpggIYX.js +1 -0
- package/dist/chunks/systemPromptSections-IePG5K8r.js +1 -0
- package/dist/chunks/systemTheme-Ceakddth.js +1 -0
- package/dist/chunks/tag-i3HZ4lhj.js +11 -0
- package/dist/chunks/tasks-HzsYNTZ1.js +1 -0
- package/dist/chunks/teleport-hN3cAbYC.js +1 -0
- package/dist/chunks/templateJobs-CIv_ysje.js +12 -0
- package/dist/chunks/terminalSetup-C0PF87iu.js +33 -0
- package/dist/chunks/terminalSetup-CxniwSF-.js +1 -0
- package/dist/chunks/theme-BKIHX_Dx.js +1 -0
- package/dist/chunks/thinkback-BA4cMz4D.js +1 -0
- package/dist/chunks/thinkback-mT-8FIT-.js +1 -0
- package/dist/chunks/thinkback-play-Cfk49mvF.js +1 -0
- package/dist/chunks/tmux-CbsW-VDJ.js +1 -0
- package/dist/chunks/toolEventObserver-8FQtxeVv.js +1 -0
- package/dist/chunks/toolEventObserver-B1xvyKdE.js +1 -0
- package/dist/chunks/toolPool-CHVDZqh7.js +1 -0
- package/dist/chunks/trustedDevice-BYCh1ff7.js +1 -0
- package/dist/chunks/trustedDevice-DnIWErCt.js +1 -0
- package/dist/chunks/tui-fTa_pzdA.js +6 -0
- package/dist/chunks/types-BUyOCzUt.js +1 -0
- package/dist/chunks/types-Czs-_G1S.js +3 -0
- package/dist/chunks/types-a7X-tJpJ.js +17 -0
- package/dist/chunks/udsClient-Cg9bBD0p.js +1 -0
- package/dist/chunks/ultrareviewCommand-DCFRZsKp.js +3 -0
- package/dist/chunks/undercover-B-kKUWtK.js +1 -0
- package/dist/chunks/undercover-CsLPQb-a.js +31 -0
- package/dist/chunks/up-dO5BcPaq.js +12 -0
- package/dist/chunks/updateCCB-CfUnkOLT.js +11 -0
- package/dist/chunks/upgrade-CngUwvY4.js +1 -0
- package/dist/chunks/upgrade-kpttjebY.js +1 -0
- package/dist/chunks/upload-DDhQqV8n.js +1 -0
- package/dist/chunks/upstreamproxy-CvcjNY7J.js +11 -0
- package/dist/chunks/usage-CJ5w0907.js +1 -0
- package/dist/chunks/usage-eZRwLa77.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-yAroCqu4.js +1 -0
- package/dist/chunks/useMainLoopModel-BNFW-g8E.js +1 -0
- package/dist/chunks/useManagePlugins-CTtPaQRP.js +1 -0
- package/dist/chunks/useMergedTools-CZJffsmf.js +1 -0
- package/dist/chunks/useSearchInput-C-CqUK6w.js +1 -0
- package/dist/chunks/useSettingsErrors-BWlJCgYF.js +1 -0
- package/dist/chunks/util-DJV0joAW.js +1 -0
- package/dist/chunks/v4-jw6qOKwQ.js +65 -0
- package/dist/chunks/validatePlugin-CRmpIGLV.js +1 -0
- package/dist/chunks/vertex-sdk-DjXcZ2J7.js +9 -0
- package/dist/chunks/vim-n8-UT5w-.js +1 -0
- package/dist/chunks/which-BBCjXfI2.js +1 -0
- package/dist/chunks/windowsPaths-D6T_3XaU.js +1 -0
- package/dist/chunks/windowsPaths-DUKTzBck.js +1 -0
- package/dist/chunks/workSecret-C_lv0dRh.js +1 -0
- package/dist/chunks/workerRegistry-BdHi7_sN.js +1 -0
- package/dist/chunks/worktree-YDeHMlHZ.js +1 -0
- package/dist/chunks/worktreeModeEnabled-BFOYTTTr.js +1 -0
- package/dist/chunks/worktreeModeEnabled-D68iEHpC.js +1 -0
- package/dist/chunks/wrapper-K8ZapJVu.js +6 -0
- package/dist/chunks/xdg-DcF9ejUM.js +1 -0
- package/dist/chunks/zod-CuNujUwx.js +1 -0
- package/dist/cli-bun.js +2 -0
- package/dist/cli-node.js +2 -0
- package/dist/cli.js +2 -0
- package/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/package.json +218 -0
- package/scripts/postinstall.cjs +389 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./esm-CXt5K8Xt.js";import{t as i}from"./src-Dvp6-vB7.js";import{n as a,t as o}from"./esm-C367Cyo-.js";var s=t((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OTLPMetricExporter=void 0;var s=(a(),e(o)),c=i(),l=(n(),e(r));t.OTLPMetricExporter=class extends s.OTLPMetricExporterBase{constructor(e){super((0,c.createOtlpGrpcExportDelegate)((0,c.convertLegacyOtlpGrpcOptions)(e??{},`METRICS`),l.ProtobufMetricsSerializer,`MetricsExportService`,`/opentelemetry.proto.collector.metrics.v1.MetricsService/Export`),e)}}})),c=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=s();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})}));export default c();export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";var n=t({isModifierPressed:()=>a,prewarm:()=>i});async function r(){if(!(l||process.platform!==`darwin`)){l=!0;try{let e=await import(`bun:ffi`),t=e.dlopen(`/System/Library/Frameworks/Carbon.framework/Carbon`,{CGEventSourceFlagsState:{args:[e.FFIType.i32],returns:e.FFIType.u64}});c=e=>Number(t.symbols.CGEventSourceFlagsState(e))}catch{c=null}}}async function i(){await r()}function a(e){if(process.platform!==`darwin`||c===null)return!1;let t=o[e];return t!==void 0&&(c(s)&t)!==0}var o,s,c,l,u=e((()=>{o={shift:131072,control:262144,option:524288,command:1048576},s=0,c=null,l=!1}));export{n as i,a as n,i as r,u as t};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{I as e,K as t,f as n}from"./stdio-W_Kokrkh.js";import{t as r}from"./lib-BlVGipXx.js";import{n as i,t as a}from"./stdio-4S7b8Uhx.js";import{basename as o,extname as s,join as c}from"node:path";import{chmodSync as l,existsSync as u,mkdirSync as d,readFileSync as f,unlinkSync as ee,writeFileSync as p}from"node:fs";import{homedir as te,tmpdir as m}from"node:os";import{createCipheriv as ne,createDecipheriv as h,createHash as re,randomBytes as g,randomUUID as _}from"node:crypto";var v={NONE:0,USER:1,BOT:2},y={NONE:0,TEXT:1,IMAGE:2,VOICE:3,FILE:4,VIDEO:5},b={NEW:0,GENERATING:1,FINISH:2},x={IMAGE:1,VIDEO:2,FILE:3,VOICE:4},S={TYPING:1,CANCEL:2},ie=`0.1.0`;function C(){return{channel_version:ie}}function ae(){return g(4).toString(`base64`)}function oe(e){let t={"Content-Type":`application/json`,"X-WECHAT-UIN":ae()};return e&&(t.AuthorizationType=`ilink_bot_token`,t.Authorization=`Bearer ${e}`),t}async function w(e,t,n,r,i=4e4,a){let o=new AbortController,s=setTimeout(()=>o.abort(),i);a&&a.addEventListener(`abort`,()=>o.abort(),{once:!0});try{let i=await fetch(`${e}${t}`,{method:`POST`,headers:oe(r),body:JSON.stringify(n),signal:o.signal});if(!i.ok)throw Error(`HTTP ${i.status}: ${i.statusText}`);return await i.json()}finally{clearTimeout(s)}}async function T(e,t,n,r){let i={get_updates_buf:n,base_info:C()};try{return await w(e,`/ilink/bot/getupdates`,i,t,4e4,r)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return{ret:0,msgs:[],get_updates_buf:n};throw e}}async function E(e,t,n){await w(e,`/ilink/bot/sendmessage`,{msg:n,base_info:C()},t)}async function D(e,t,n){return w(e,`/ilink/bot/getuploadurl`,{...n,base_info:C()},t)}async function O(e,t,n,r){return w(e,`/ilink/bot/getconfig`,{ilink_user_id:n,context_token:r,base_info:C()},t)}async function k(e,t,n){return w(e,`/ilink/bot/sendtyping`,{...n,base_info:C()},t)}var A=`https://ilinkai.weixin.qq.com`,j=`https://novac2c.cdn.weixin.qq.com/c2c`;function M(){let e=process.env.WEIXIN_STATE_DIR||c(te(),`.claude`,`channels`,`weixin`);return u(e)||d(e,{recursive:!0}),e}function N(){return c(M(),`account.json`)}function P(){let e=N();if(!u(e))return null;try{return JSON.parse(f(e,`utf-8`))}catch{return null}}function se(e){let t=N();p(t,JSON.stringify(e,null,2),`utf-8`),l(t,384)}function F(){let e=N();u(e)&&ee(e)}var I=r();async function L(e){let t=await(0,I.toString)(e,{type:`terminal`,errorCorrectionLevel:`L`,small:!0});process.stderr.write(`${t}\n`)}async function R(e){let t=await fetch(`${e}/ilink/bot/get_bot_qrcode?bot_type=3`);if(!t.ok)throw Error(`Failed to get QR code: HTTP ${t.status}`);let n=await t.json();if(!n.qrcode)throw Error(`No qrcode in response`);let r=n.qrcode_img_content||``;return r&&await L(r),{qrcodeUrl:r,qrcodeId:n.qrcode,message:`Scan the QR code with WeChat to connect.`}}async function z(e){let{qrcodeId:t,apiBaseUrl:n,timeoutMs:r=48e4,maxRetries:i=3}=e,a=Date.now()+r,o=t,s=0;for(;Date.now()<a;){try{let e=new AbortController,t=setTimeout(()=>e.abort(),6e4),r=await fetch(`${n}/ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(o)}`,{headers:{"iLink-App-ClientVersion":`1`},signal:e.signal});if(clearTimeout(t),!r.ok)throw Error(`HTTP ${r.status}`);let a=await r.json();switch(a.status){case`confirmed`:return{connected:!0,token:a.bot_token,accountId:a.ilink_bot_id,baseUrl:a.baseurl,userId:a.ilink_user_id,message:`Connected to WeChat successfully!`};case`scaned`:process.stderr.write(`QR code scanned, waiting for confirmation...
|
|
2
|
+
`);break;case`expired`:if(s+=1,s>=i)return{connected:!1,message:`QR code expired after maximum retries.`};process.stderr.write(`QR code expired, refreshing...
|
|
3
|
+
`),o=(await R(n)).qrcodeId;break;default:break}}catch(e){if(e instanceof Error&&e.name===`AbortError`)continue;throw e}await new Promise(e=>setTimeout(e,1e3))}return{connected:!1,message:`Login timed out.`}}function B(){return c(M(),`access.json`)}function V(){return c(M(),`pending-pairings.json`)}function H(){let e=V();if(!u(e))return{};try{return JSON.parse(f(e,`utf-8`))}catch{return{}}}function U(e){p(V(),JSON.stringify(e,null,2),`utf-8`)}function W(){let e=B();if(!u(e))return{policy:`pairing`,allowFrom:[]};try{return JSON.parse(f(e,`utf-8`))}catch{return{policy:`pairing`,allowFrom:[]}}}function G(e){p(B(),JSON.stringify(e,null,2),`utf-8`)}function K(e){let t=W();return t.policy===`disabled`||t.allowFrom.includes(e)}function ce(e){let t=H(),n=Date.now();for(let e of Object.keys(t))t[e].expiresAt<n&&delete t[e];for(let[n,r]of Object.entries(t))if(r.userId===e)return U(t),n;let r=String(Math.floor(1e5+Math.random()*9e5));return t[r]={userId:e,expiresAt:n+600*1e3},U(t),r}function le(e){let t=H(),n=t[e];if(!n||n.expiresAt<Date.now())return delete t[e],U(t),null;delete t[e],U(t);let r=W();return r.allowFrom.includes(n.userId)||(r.allowFrom.push(n.userId),G(r)),n.userId}function ue(e,t){let n=ne(`aes-128-ecb`,t,null);return Buffer.concat([n.update(e),n.final()])}function de(e,t){let n=h(`aes-128-ecb`,t,null);return Buffer.concat([n.update(e),n.final()])}function fe(e,t){return`${t}/download?encrypted_query_param=${encodeURIComponent(e)}`}function pe(e,t,n){return`${e}/upload?encrypted_query_param=${encodeURIComponent(t)}&filekey=${encodeURIComponent(n)}`}function me(e){let t=Buffer.from(e,`base64`);if(t.length===16)return t;if(t.length===32&&/^[0-9a-fA-F]{32}$/.test(t.toString(`ascii`)))return Buffer.from(t.toString(`ascii`),`hex`);throw Error(`Invalid aes_key: expected 16 raw bytes or 32 hex chars, got ${t.length} bytes`)}async function he(e){let t=fe(e.encryptQueryParam,e.cdnBaseUrl),n=await fetch(t);if(!n.ok)throw Error(`CDN download failed: HTTP ${n.status}`);return de(Buffer.from(await n.arrayBuffer()),me(e.aesKey))}async function ge(e){let t=f(e.filePath),n=t.length,r=re(`md5`).update(t).digest(`hex`),i=g(16),a=g(16).toString(`hex`),s=ue(t,i),c=s.length,l=await D(e.apiBaseUrl,e.token,{filekey:a,media_type:e.mediaType,to_user_id:e.toUserId,rawsize:n,rawfilemd5:r,filesize:c,no_need_thumb:!0,aeskey:i.toString(`hex`)});if(!l.upload_param)throw Error(`No upload_param in response`);let u=pe(e.cdnBaseUrl,l.upload_param,a),d=await fetch(u,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:new Uint8Array(s)});if(!d.ok)throw Error(`CDN upload failed: HTTP ${d.status}`);return{encryptQueryParam:d.headers.get(`x-encrypted-param`)||``,aesKey:Buffer.from(i.toString(`hex`)).toString(`base64`),fileSize:c,rawSize:n,fileName:o(e.filePath)}}function _e(e){let t=s(e).toLowerCase();return[`.jpg`,`.jpeg`,`.png`,`.gif`,`.bmp`,`.webp`,`.heic`].includes(t)?x.IMAGE:[`.mp4`,`.mov`,`.avi`,`.mkv`,`.webm`].includes(t)?x.VIDEO:x.FILE}function ve(e){let t=``,n=0;for(;n<e.length;)if(e.startsWith("```",n)){let r=n+3;for(;r<e.length&&e[r]!==`
|
|
4
|
+
`;)r++;r<e.length&&r++;let i=r;for(;r<e.length;){if(e.startsWith("```",r)){for(t+=e.slice(i,r),r+=3;r<e.length&&e[r]!==`
|
|
5
|
+
`;)r++;r<e.length&&r++;break}r++}r>=e.length&&!e.startsWith("```",r-3)&&(t+=e.slice(n)),n=r}else t+=e[n],n++;return t}function q(e){return ve(e).replace(/`([^`]+)`/g,`$1`).replace(/\*\*\*(.+?)\*\*\*/g,`$1`).replace(/\*\*(.+?)\*\*/g,`$1`).replace(/\*(.+?)\*/g,`$1`).replace(/___(.+?)___/g,`$1`).replace(/__(.+?)__/g,`$1`).replace(/_(.+?)_/g,`$1`).replace(/~~(.+?)~~/g,`$1`).replace(/^#{1,6}\s+/gm,``).replace(/\[([^\]]+)\]\(([^)]+)\)/g,`$1 ($2)`).replace(/!\[([^\]]*)\]\([^)]+\)/g,`[$1]`).replace(/^>\s+/gm,``).replace(/^[-*_]{3,}$/gm,`---`).replace(/^[\s]*[-*+]\s+/gm,`- `).replace(/^[\s]*(\d+)\.\s+/gm,`$1. `).replace(/\n{3,}/g,`
|
|
6
|
+
|
|
7
|
+
`).trim()}async function J(e){let t=_();return await E(e.baseUrl,e.token,{to_user_id:e.to,from_user_id:``,client_id:t,message_type:v.BOT,message_state:b.FINISH,context_token:e.contextToken,item_list:[{type:y.TEXT,text_item:{text:q(e.text)}}]}),{messageId:t}}async function ye(e){let t=``;for(let n of e.items)t=_(),await E(e.baseUrl,e.token,{to_user_id:e.to,from_user_id:``,client_id:t,message_type:v.BOT,message_state:b.FINISH,context_token:e.contextToken,item_list:[n]});return t}async function be(e){let t=_e(e.filePath),n=await ge({filePath:e.filePath,toUserId:e.to,mediaType:t,apiBaseUrl:e.baseUrl,token:e.token,cdnBaseUrl:e.cdnBaseUrl}),r={encrypt_query_param:n.encryptQueryParam,aes_key:n.aesKey,encrypt_type:1},i=[];switch(e.text&&i.push({type:y.TEXT,text_item:{text:q(e.text)}}),t){case 1:i.push({type:y.IMAGE,image_item:{media:r,mid_size:n.fileSize}});break;case 2:i.push({type:y.VIDEO,video_item:{media:r,video_size:n.fileSize}});break;default:i.push({type:y.FILE,file_item:{media:r,file_name:n.fileName,len:String(n.rawSize)}});break}return{messageId:await ye({items:i,to:e.to,baseUrl:e.baseUrl,token:e.token,contextToken:e.contextToken})}}var Y=new Map;function xe(e=Date.now()){for(let[t,n]of Y.entries())n.expiresAt<=e&&Y.delete(t)}function Se(e,t){xe();let n=e.toLowerCase(),r=Y.get(n);return!r||r.chatId!==t?null:(Y.delete(n),r)}var Ce=/^\s*(y|yes|n|no)\s+([a-km-z]{5})\s*$/i,X=new Map;function Z(e){return X.get(e)}function Q(){return c(M(),`cursor.txt`)}function we(){let e=Q();return u(e)?f(e,`utf-8`).trim():``}function Te(e){p(Q(),e,`utf-8`)}async function Ee(e,t){let n,r,i=``,a=``;switch(e.type){case y.IMAGE:n=e.image_item?.media?.encrypt_query_param,r=e.image_item?.aeskey?Buffer.from(e.image_item.aeskey,`hex`).toString(`base64`):e.image_item?.media?.aes_key,i=`.jpg`,a=`image`;break;case y.VOICE:n=e.voice_item?.media?.encrypt_query_param,r=e.voice_item?.media?.aes_key,i=`.silk`,a=`voice`;break;case y.FILE:n=e.file_item?.media?.encrypt_query_param,r=e.file_item?.media?.aes_key,i=e.file_item?.file_name?`.${e.file_item.file_name.split(`.`).pop()}`:``,a=`file`;break;case y.VIDEO:n=e.video_item?.media?.encrypt_query_param,r=e.video_item?.media?.aes_key,i=`.mp4`,a=`video`;break;default:return null}if(!n||!r)return null;try{let s=await he({encryptQueryParam:n,aesKey:r,cdnBaseUrl:t}),l=c(m(),`weixin-media`);u(l)||d(l,{recursive:!0});let f=c(l,o(e.file_item?.file_name||`${Date.now()}${i}`));return p(f,s),{path:f,type:a}}catch(e){return process.stderr.write(`[weixin] Failed to download media: ${e}\n`),null}}function De(e){let t=e.match(Ce);if(!t)return null;let n=t[1]?.toLowerCase().startsWith(`y`)?`allow`:`deny`,r=t[2]?.toLowerCase();return r?{requestId:r,behavior:n}:null}async function Oe(e){let{baseUrl:t,cdnBaseUrl:n,token:r,onMessage:i,onPermissionResponse:a,abortSignal:o}=e,s=we(),c=0;for(process.stderr.write(`[weixin] Starting message poll loop...
|
|
8
|
+
`);!o.aborted;)try{let e=await T(t,r,s,o);if(e.errcode===-14){process.stderr.write(`[weixin] Session expired (errcode -14). Pausing for 30s...
|
|
9
|
+
`),await new Promise(e=>setTimeout(e,3e4));continue}if(e.ret!==0&&e.ret!==void 0)throw Error(`getUpdates error: ret=${e.ret} errcode=${e.errcode} ${e.errmsg}`);if(c=0,e.get_updates_buf&&(s=e.get_updates_buf,Te(s)),e.msgs&&e.msgs.length>0)for(let o of e.msgs)await ke(o,{baseUrl:t,cdnBaseUrl:n,token:r,onMessage:i,onPermissionResponse:a})}catch(e){if(o.aborted)break;c+=1,process.stderr.write(`[weixin] Poll error (${c}): ${e instanceof Error?e.message:String(e)}\n`),c>=3?(process.stderr.write(`[weixin] Too many consecutive errors, backing off 30s...
|
|
10
|
+
`),await new Promise(e=>setTimeout(e,3e4)),c=0):await new Promise(e=>setTimeout(e,2e3))}process.stderr.write(`[weixin] Poll loop stopped.
|
|
11
|
+
`)}async function ke(e,t){if(e.message_type!==v.USER)return;let n=e.from_user_id;if(!n)return;if(e.context_token&&X.set(n,e.context_token),!K(n)){let r=ce(n);try{await J({to:n,text:`Your pairing code is: ${r}\n\nAsk the operator to confirm:\nccb weixin access pair ${r}`,baseUrl:t.baseUrl,token:t.token,contextToken:e.context_token||``})}catch(e){process.stderr.write(`[weixin] Failed to send pairing code: ${e}\n`)}return}e.context_token;let r=``,i,a;if(e.item_list){for(let n of e.item_list)if(n.type===y.TEXT&&n.text_item?.text)r+=`${r?`
|
|
12
|
+
`:``}${n.text_item.text}`;else if(n.type===y.IMAGE||n.type===y.VOICE||n.type===y.FILE||n.type===y.VIDEO){let e=await Ee(n,t.cdnBaseUrl);e&&(i=e.path,a=e.type),n.type===y.VOICE&&n.voice_item?.text&&(r+=`${r?`
|
|
13
|
+
`:``}[Voice transcription]: ${n.voice_item.text}`)}}if(!(!r&&!i)){if(r&&t.onPermissionResponse){let e=De(r);if(e){let r=Se(e.requestId,n);if(r){await t.onPermissionResponse({requestId:r.request_id,behavior:e.behavior,fromUserId:n});return}}}await t.onMessage({fromUserId:n,messageId:String(e.message_id||``),text:r||`(media attachment)`,attachmentPath:i,attachmentType:a})}}t();function Ae(t){let r=new i({name:`weixin`,version:t},{capabilities:{experimental:{"claude/channel":{}},tools:{}},instructions:`Messages from WeChat arrive as <channel source="plugin:weixin:weixin" chat_id="..." sender_id="...">. Reply using the reply tool with the chat_id from the channel tag. Use absolute paths for file attachments.`});return r.setRequestHandler(e,async()=>({tools:[{name:`reply`,description:`Reply to a WeChat message. Pass the chat_id from the channel tag.`,inputSchema:{type:`object`,properties:{chat_id:{type:`string`,description:`The chat_id from the channel notification`},text:{type:`string`,description:`The reply text`},files:{type:`array`,items:{type:`string`},description:`Optional absolute file paths to attach`}},required:[`chat_id`,`text`]}},{name:`send_typing`,description:`Send a typing indicator to a WeChat user.`,inputSchema:{type:`object`,properties:{chat_id:{type:`string`,description:`The chat_id (user ID)`}},required:[`chat_id`]}}]})),r.setRequestHandler(n,async e=>{let{name:t,arguments:n}=e.params,r=P();if(!r)return{content:[{type:`text`,text:"WeChat not connected. Run `ccb weixin login` first."}],isError:!0};let i=r.baseUrl||`https://ilinkai.weixin.qq.com`,a=j;switch(t){case`reply`:{let e=typeof n?.chat_id==`string`?n.chat_id:``,t=typeof n?.text==`string`?n.text:``,o=Array.isArray(n?.files)?n.files.filter(e=>typeof e==`string`):void 0;if(!e||!t)return{content:[{type:`text`,text:`Missing chat_id or text parameter.`}],isError:!0};let s=Z(e)||``;try{if(o&&o.length>0){for(let[n,c]of o.entries()){if(!u(c))return{content:[{type:`text`,text:`File not found: ${c}`}],isError:!0};await be({filePath:c,to:e,text:n===0?t:``,baseUrl:i,token:r.token,contextToken:s,cdnBaseUrl:a})}return{content:[{type:`text`,text:`Message sent with attachments.`}]}}return await J({to:e,text:t,baseUrl:i,token:r.token,contextToken:s}),{content:[{type:`text`,text:`Message sent.`}]}}catch(e){return{content:[{type:`text`,text:`Failed to send: ${e}`}],isError:!0}}}case`send_typing`:{let e=typeof n?.chat_id==`string`?n.chat_id:``;if(!e)return{content:[{type:`text`,text:`Missing chat_id parameter.`}],isError:!0};try{let t=Z(e),n=await O(i,r.token,e,t);return n.typing_ticket&&await k(i,r.token,{ilink_user_id:e,typing_ticket:n.typing_ticket,status:S.TYPING}),{content:[{type:`text`,text:`Typing indicator sent.`}]}}catch(e){return{content:[{type:`text`,text:`Failed to send typing: ${e}`}],isError:!0}}}default:return{content:[{type:`text`,text:`Unknown tool: ${t}`}],isError:!0}}}),r}async function je(e,t){t.enableConfigs(),t.initializeAnalyticsSink();let n=P();n||(process.stderr.write("[weixin] No account configured. Run `ccb weixin login` to connect your WeChat account.\n"),await Promise.all([t.shutdown1PEventLogging(),t.shutdownDatadog()]),process.exit(1));let r=Ae(e),i=new a;await r.connect(i);let o=n.baseUrl||`https://ilinkai.weixin.qq.com`,s=new AbortController,c=!1,l=async()=>{c||(c=!0,s.signal.aborted||s.abort(),await Promise.all([t.shutdown1PEventLogging(),t.shutdownDatadog()]),process.exit(0))};process.stdin.on(`end`,()=>void l()),process.stdin.on(`error`,()=>void l()),process.on(`SIGINT`,()=>void l()),process.on(`SIGTERM`,()=>void l()),process.on(`SIGHUP`,()=>void l());let u=process.ppid,d=setInterval(()=>{try{process.kill(u,0)}catch{process.stderr.write(`[weixin] Parent process exited, shutting down...
|
|
14
|
+
`),clearInterval(d),l()}},5e3);t.logForDebugging(`[Weixin MCP] Starting poll loop`),await Oe({baseUrl:o,cdnBaseUrl:j,token:n.token,onMessage:async e=>{await r.notification({method:`notifications/claude/channel`,params:{content:e.text,meta:{chat_id:e.fromUserId,sender_id:e.fromUserId,message_id:e.messageId,...e.attachmentPath&&{attachment_path:e.attachmentPath},...e.attachmentType&&{attachment_type:e.attachmentType}}}})},onPermissionResponse:async e=>{await r.notification({method:`notifications/claude/channel/permission`,params:{request_id:e.requestId,behavior:e.behavior}})},abortSignal:s.signal}),clearInterval(d),await l()}function $(){process.stdout.write([`Usage:`,` ccb weixin serve`,` ccb weixin login`,` ccb weixin login clear`,` ccb weixin access pair <code>`,``,`Session enablement:`,` ccb --channels plugin:weixin@builtin`].join(`
|
|
15
|
+
`)+`
|
|
16
|
+
`)}async function Me(e=!1){if(e){F(),process.stdout.write(`WeChat account cleared.
|
|
17
|
+
`);return}let t=P();if(t){process.stdout.write([`Already connected:`,` User ID: ${t.userId||`unknown`}`,` Connected since: ${t.savedAt}`,``,"Run `ccb weixin login clear` to disconnect.",`Restart Claude Code with:`,` ccb --channels plugin:weixin@builtin`].join(`
|
|
18
|
+
`)+`
|
|
19
|
+
`);return}process.stdout.write(`Starting WeChat QR login...
|
|
20
|
+
|
|
21
|
+
`);let n=await R(A);process.stdout.write(`\nScan the QR code above with WeChat, or open this URL:\n${n.qrcodeUrl||``}\n\n`);let r=await z({qrcodeId:n.qrcodeId,apiBaseUrl:A});(!r.connected||!r.token)&&(process.stderr.write(`Login failed: ${r.message}\n`),process.exit(1)),se({token:r.token,baseUrl:r.baseUrl||`https://ilinkai.weixin.qq.com`,userId:r.userId,savedAt:new Date().toISOString()}),process.stdout.write([`Connected successfully!`,` User ID: ${r.userId||`unknown`}`,` Base URL: ${r.baseUrl||`https://ilinkai.weixin.qq.com`}`,``,`Restart Claude Code with:`,` ccb --channels plugin:weixin@builtin`].join(`
|
|
22
|
+
`)+`
|
|
23
|
+
`)}function Ne(e){(e[0]!==`pair`||!e[1])&&($(),process.exit(1));let t=le(e[1]);t||(process.stderr.write(`Invalid or expired pairing code.
|
|
24
|
+
`),process.exit(1)),process.stdout.write(`Paired successfully: ${t}\n`)}async function Pe(e,t,n){let[r,...i]=e;switch(r){case`serve`:t||(process.stderr.write(`[weixin] serve handler not available in this context.
|
|
25
|
+
`),process.exit(1)),await je(n??`0.0.0`,t);return;case`login`:await Me(i[0]===`clear`);return;case`access`:Ne(i);return;default:$()}}export{Pe as handleWeixinCli};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{C as r,D as i,E as ee,F as a,I as te,L as ne,M as re,O as ie,P as ae,U as oe,V as se,X as ce,Y as le,_ as ue,d as de,et as fe,g as pe,i as me,j as he,k as ge,l as _e,mt as ve,n as ye,nt as be,ot as xe,p as Se,q as o,rt as Ce,s as we,st as Te,t as s,vt as Ee,x as De,y as Oe,z as ke}from"./client-DvAL7lY8.js";import{B as Ae,D as c,H as l,M as je,O as u,Y as Me,c as Ne,o as Pe,t as d,u as Fe}from"./protocols-CnYQjBlj.js";import{B as Ie,H as Le,L as Re,c as ze,d as Be,r as f,z as Ve}from"./serde-f76bObzR.js";import{a as He,d as Ue,l as We,m as p,o as Ge,r as Ke,s as qe,t as m}from"./config-BSXLgwpD.js";import{C as Je,c as Ye,f as Xe,t as h,v as Ze}from"./dist-es-BF6bR-Ik.js";import{n as Qe,t as $e}from"./checksum-DgbnMdM-.js";import{C as et,_ as tt,c as nt,i as rt,o as g,t as it}from"./protocols-CCsohXid.js";import{a as at,t as ot}from"./dist-es-Bfr4TzQe.js";import{n as st,t as ct}from"./package-BC0bllK8.js";function lt(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sso-oauth`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function ut(e){return{schemeId:`smithy.api#noAuth`}}var _,v,y,b=e((()=>{g(),o(),_=async(e,t,n)=>({operation:Me(t).operation,region:await l(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),v=e=>{let t=[];switch(e.operation){case`CreateToken`:t.push(ut(e));break;default:t.push(lt(e))}return t},y=e=>{let t=nt(e);return Object.assign(t,{authSchemePreference:l(e.authSchemePreference??[])})}})),x,S,C=e((()=>{x=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`sso-oauth`}),S={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,dt=e((()=>{a(),w=`ref`,T=-1,E=!0,D=`isSet`,O=`PartitionResult`,k=`booleanEquals`,A=`getAttr`,j={[w]:`Endpoint`},M={[w]:O},N={},P=[{[w]:`Region`}],F={conditions:[[D,[j]],[D,P],[`aws.partition`,P,O],[k,[{[w]:`UseFIPS`},E]],[k,[{[w]:`UseDualStack`},E]],[k,[{fn:A,argv:[M,`supportsDualStack`]},E]],[k,[{fn:A,argv:[M,`supportsFIPS`]},E]],[`stringEquals`,[{fn:A,argv:[M,`name`]},`aws-us-gov`]]],results:[[T],[T,`Invalid Configuration: FIPS and custom endpoint are not supported`],[T,`Invalid Configuration: Dualstack and custom endpoint are not supported`],[j,N],[`https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,N],[T,`FIPS and DualStack are enabled, but this partition does not support one or both`],[`https://oidc.{Region}.amazonaws.com`,N],[`https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}`,N],[T,`FIPS is enabled but this partition does not support FIPS`],[`https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}`,N],[T,`DualStack is enabled but this partition does not support DualStack`],[`https://oidc.{Region}.{PartitionResult#dnsSuffix}`,N],[T,`Invalid Configuration: Missing Region`]]},I=2,L=new Int32Array([-1,1,-1,0,13,3,1,4,100000012,2,5,100000012,3,8,6,4,7,100000011,5,100000009,100000010,4,11,9,6,10,100000008,7,100000006,100000007,5,12,100000005,6,100000004,100000005,3,100000001,14,4,100000002,100000003]),R=oe.from(L,I,F.conditions,F.results)})),ft,pt,mt=e((()=>{s(),a(),dt(),ft=new se({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),pt=(e,t={})=>ft.get(e,()=>ne(R,{endpointParams:e,logger:t.logger})),ke.aws=we})),z,B=e((()=>{o(),z=class e extends Te{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),ht,gt,_t,vt,yt,bt,V,xt,St,Ct,wt,Tt=e((()=>{B(),t(),ht=class e extends z{constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),n(this,`name`,`AccessDeniedException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`reason`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},gt=class e extends z{constructor(t){super({name:`AuthorizationPendingException`,$fault:`client`,...t}),n(this,`name`,`AuthorizationPendingException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},_t=class e extends z{constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),n(this,`name`,`ExpiredTokenException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},vt=class e extends z{constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),n(this,`name`,`InternalServerException`),n(this,`$fault`,`server`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},yt=class e extends z{constructor(t){super({name:`InvalidClientException`,$fault:`client`,...t}),n(this,`name`,`InvalidClientException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},bt=class e extends z{constructor(t){super({name:`InvalidGrantException`,$fault:`client`,...t}),n(this,`name`,`InvalidGrantException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},V=class e extends z{constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),n(this,`name`,`InvalidRequestException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`reason`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},xt=class e extends z{constructor(t){super({name:`InvalidScopeException`,$fault:`client`,...t}),n(this,`name`,`InvalidScopeException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},St=class e extends z{constructor(t){super({name:`SlowDownException`,$fault:`client`,...t}),n(this,`name`,`SlowDownException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},Ct=class e extends z{constructor(t){super({name:`UnauthorizedClientException`,$fault:`client`,...t}),n(this,`name`,`UnauthorizedClientException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},wt=class e extends z{constructor(t){super({name:`UnsupportedGrantTypeException`,$fault:`client`,...t}),n(this,`name`,`UnsupportedGrantTypeException`),n(this,`$fault`,`client`),n(this,`error`,void 0),n(this,`error_description`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}}})),Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,H,Kt,qt,Jt,Yt,Xt,U,Zt,W,Qt,$t,G,en,K,q,tn,J,nn,rn,an,Y,X,on,Z,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Q,Cn,wn,Tn,$=e((()=>{c(),Tt(),B(),Et=`AccessDeniedException`,Dt=`AuthorizationPendingException`,Ot=`AccessToken`,kt=`ClientSecret`,At=`CreateToken`,jt=`CreateTokenRequest`,Mt=`CreateTokenResponse`,Nt=`CodeVerifier`,Pt=`ExpiredTokenException`,Ft=`InvalidClientException`,It=`InvalidGrantException`,Lt=`InvalidRequestException`,Rt=`InternalServerException`,zt=`InvalidScopeException`,Bt=`IdToken`,Vt=`RefreshToken`,Ht=`SlowDownException`,Ut=`UnauthorizedClientException`,Wt=`UnsupportedGrantTypeException`,Gt=`accessToken`,H=`client`,Kt=`clientId`,qt=`clientSecret`,Jt=`codeVerifier`,Yt=`code`,Xt=`deviceCode`,U=`error`,Zt=`expiresIn`,W=`error_description`,Qt=`grantType`,$t=`http`,G=`httpError`,en=`idToken`,K=`reason`,q=`refreshToken`,tn=`redirectUri`,J=`smithy.ts.sdk.synthetic.com.amazonaws.ssooidc`,nn=`scope`,rn=`server`,an=`tokenType`,Y=`com.amazonaws.ssooidc`,X=u.for(J),on=[-3,J,`SSOOIDCServiceException`,0,[],[]],X.registerError(on,z),Z=u.for(Y),sn=[-3,Y,Et,{[U]:H,[G]:400},[U,K,W],[0,0,0]],Z.registerError(sn,ht),cn=[-3,Y,Dt,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(cn,gt),ln=[-3,Y,Pt,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(ln,_t),un=[-3,Y,Rt,{[U]:rn,[G]:500},[U,W],[0,0]],Z.registerError(un,vt),dn=[-3,Y,Ft,{[U]:H,[G]:401},[U,W],[0,0]],Z.registerError(dn,yt),fn=[-3,Y,It,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(fn,bt),pn=[-3,Y,Lt,{[U]:H,[G]:400},[U,K,W],[0,0,0]],Z.registerError(pn,V),mn=[-3,Y,zt,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(mn,xt),hn=[-3,Y,Ht,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(hn,St),gn=[-3,Y,Ut,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(gn,Ct),_n=[-3,Y,Wt,{[U]:H,[G]:400},[U,W],[0,0]],Z.registerError(_n,wt),vn=[X,Z],yn=[0,Y,Ot,8,0],bn=[0,Y,kt,8,0],xn=[0,Y,Nt,8,0],Sn=[0,Y,Bt,8,0],Q=[0,Y,Vt,8,0],Cn=[3,Y,jt,0,[Kt,qt,Qt,Xt,Yt,q,nn,tn,Jt],[0,[()=>bn,0],0,0,0,[()=>Q,0],64,0,[()=>xn,0]],3],wn=[3,Y,Mt,0,[Gt,an,Zt,q,en],[[()=>yn,0],0,1,[()=>Q,0],[()=>Sn,0]]],Tn=[9,Y,At,{[$t]:[`POST`,`/token`,200]},()=>Cn,()=>wn]})),En,Dn=e((()=>{g(),it(),h(),$e(),o(),d(),f(),b(),mt(),$(),En=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??Le,base64Encoder:e?.base64Encoder??Ve,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??pt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??v,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new et},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Ye}],logger:e?.logger??new ce,protocol:e?.protocol??rt,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.ssooidc`,errorTypeRegistries:vn,version:`2019-06-10`,serviceTarget:`AWSSSOOIDCService`},serviceId:e?.serviceId??`SSO OIDC`,sha256:e?.sha256??Qe,urlParser:e?.urlParser??Ae,utf8Decoder:e?.utf8Decoder??Ie,utf8Encoder:e?.utf8Encoder??Re})})),On,kn=e((()=>{ct(),s(),g(),o(),m(),i(),f(),ot(),Dn(),On=e=>{Ce(process.version);let t=Ke(e),n=()=>t().then(xe),r=En(e);Ee(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??p(tt,i),bodyLengthChecker:e?.bodyLengthChecker??Be,defaultUserAgentProvider:e?.defaultUserAgentProvider??de({serviceId:r.serviceId,clientVersion:st.version}),maxAttempts:e?.maxAttempts??p(ie,e),region:e?.region??p(qe,{...Ge,...i}),requestHandler:at.create(e?.requestHandler??n),retryMode:e?.retryMode??p({...ge,default:async()=>(await n()).retryMode||re},e),streamCollector:e?.streamCollector??ze,useDualstackEndpoint:e?.useDualstackEndpoint??p(Ue,i),useFipsEndpoint:e?.useFipsEndpoint??p(We,i),userAgentAppId:e?.userAgentAppId??p(_e,i)}}})),An,jn,Mn=e((()=>{An=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},jn=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),Nn,Pn=e((()=>{s(),o(),d(),Mn(),Nn=(e,t)=>{let n=Object.assign(ye(e),fe(e),Ne(e),An(e));return t.forEach(e=>e.configure(n)),Object.assign(e,me(n),be(n),Fe(n),jn(n))}})),Fn,In=e((()=>{s(),h(),o(),m(),a(),d(),i(),c(),b(),C(),kn(),Pn(),t(),Fn=class extends ve{constructor(...[e]){let t=On(e||{});super(t),n(this,`config`,void 0),this.initConfig=t;let i=Nn(y(te(r(He(he(pe(x(t))))))),e?.extensions||[]);this.config=i,this.middlewareStack.use(je(this.config)),this.middlewareStack.use(Se(this.config)),this.middlewareStack.use(ee(this.config)),this.middlewareStack.use(Pe(this.config)),this.middlewareStack.use(De(this.config)),this.middlewareStack.use(Oe(this.config)),this.middlewareStack.use(ue(this.config)),this.middlewareStack.use(Je(this.config,{httpAuthSchemeParametersProvider:_,identityProviderConfigProvider:async e=>new Xe({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(Ze(this.config))}destroy(){super.destroy()}}})),Ln,Rn,zn,Bn=e((()=>{o(),a(),C(),Ln=le(S,`AWSSSOOIDCService`,`SSOOIDCClient`,ae),Rn={},zn=(e,t,n,r)=>[]})),Vn,Hn=e((()=>{Bn(),$(),Vn=class extends Ln(Rn,zn,`CreateToken`,Tn){}})),Un=e((()=>{})),Wn=e((()=>{Hn()})),Gn=e((()=>{})),Kn=e((()=>{}));e((()=>{In(),Un(),Wn(),$(),Gn(),Tt(),Kn(),B()}))();export{Vn as CreateTokenCommand,Fn as SSOOIDCClient};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./startupProfiler-DxRQteII.js";t();export{e as profileCheckpoint};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-CDCSSo0U2.js";import{en as ee,ht as c}from"./state-4KQ3kaqz.js";import{A as te,E as l,_ as u,h as ne,l as re,p as d}from"./debug-IKW-jE7K.js";import{n as f,r as p}from"./analytics-BotDBGh0.js";import{a as m,n as h,r as g,s as _}from"./intl-cKc-V6Mq.js";import{dirname as ie,join as v}from"path";function y(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return b(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return x(e,t);let s=t-1-a;return s<=0?x(r,t):S(i,s)+`…`+r}function b(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of h().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return r+`…`}function x(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...h().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function S(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of h().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function C(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
|
|
2
|
+
`);if(n!==-1)return r=e.substring(0,n),o(r)+1>t?b(r,t):`${r}…`}return o(r)<=t?r:b(r,t)}var w=e((()=>{s(),_()}));function T(e){let t=e/1024;if(t<1)return`${e} bytes`;if(t<1024)return`${t.toFixed(1).replace(/\.0$/,``)}KB`;let n=t/1024;return n<1024?`${n.toFixed(1).replace(/\.0$/,``)}MB`:`${(n/1024).toFixed(1).replace(/\.0$/,``)}GB`}function E(e){return`${(e/1e3).toFixed(1)}s`}function D(e,t){if(e<6e4)return e===0?`0s`:e<1?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/1e3).toString()}s`;let n=Math.floor(e/864e5),r=Math.floor(e%864e5/36e5),i=Math.floor(e%36e5/6e4),a=Math.round(e%6e4/1e3);a===60&&(a=0,i++),i===60&&(i=0,r++),r===24&&(r=0,n++);let o=t?.hideTrailingZeros;return t?.mostSignificantOnly?n>0?`${n}d`:r>0?`${r}h`:i>0?`${i}m`:`${a}s`:n>0?o&&r===0&&i===0?`${n}d`:o&&i===0?`${n}d ${r}h`:`${n}d ${r}h ${i}m`:r>0?o&&i===0&&a===0?`${r}h`:o&&a===0?`${r}h ${i}m`:`${r}h ${i}m ${a}s`:i>0?o&&a===0?`${i}m`:`${i}m ${a}s`:`${a}s`}function O(e){return F(e>=1e3).format(e).toLowerCase()}function k(e){return O(e).replace(`.0`,``)}function A(e,t={}){let{style:n=`narrow`,numeric:r=`always`,now:i=new Date}=t,a=e.getTime()-i.getTime(),o=Math.trunc(a/1e3);for(let{unit:e,seconds:t,shortUnit:i}of[{unit:`year`,seconds:31536e3,shortUnit:`y`},{unit:`month`,seconds:2592e3,shortUnit:`mo`},{unit:`week`,seconds:604800,shortUnit:`w`},{unit:`day`,seconds:86400,shortUnit:`d`},{unit:`hour`,seconds:3600,shortUnit:`h`},{unit:`minute`,seconds:60,shortUnit:`m`},{unit:`second`,seconds:1,shortUnit:`s`}])if(Math.abs(o)>=t){let a=Math.trunc(o/t);return n===`narrow`?o<0?`${Math.abs(a)}${i} ago`:`in ${a}${i}`:g(`long`,r).format(a,e)}return n===`narrow`?o<=0?`0s ago`:`in 0s`:g(n,r).format(0,`second`)}function j(e,t={}){let{now:n=new Date,...r}=t;return e>n?A(e,{...r,now:n}):A(e,{...r,numeric:`always`,now:n})}function ae(e){let t=e.fileSize===void 0?`${e.messageCount} messages`:T(e.fileSize),n=[j(e.modified,{style:`short`}),...e.gitBranch?[e.gitBranch]:[],t];return e.tag&&n.push(`#${e.tag}`),e.agentSetting&&n.push(`@${e.agentSetting}`),e.prNumber&&n.push(e.prRepository?`${e.prRepository}#${e.prNumber}`:`#${e.prNumber}`),n.join(` · `)}function M(e,t=!1,n=!0){if(!e)return;let r=new Date(e*1e3),i=new Date,a=r.getMinutes();if((r.getTime()-i.getTime())/(1e3*60*60)>24){let e={month:`short`,day:`numeric`,hour:n?`numeric`:void 0,minute:!n||a===0?void 0:`2-digit`,hour12:n?!0:void 0};return r.getFullYear()!==i.getFullYear()&&(e.year=`numeric`),r.toLocaleString(`en-US`,e).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${m()})`:``)}return r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:a===0?void 0:`2-digit`,hour12:!0}).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${m()})`:``)}function oe(e,t=!1,n=!0){let r=new Date(e);return`${M(Math.floor(r.getTime()/1e3),t,n)}`}var N,P,F,I=e((()=>{_(),w(),N=null,P=null,F=e=>e?(N||(N=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:1})),N):(P||(P=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:0})),P)}));function L(){return V}function R(e){return e.toFixed(3)}function z(e,t,n,r,i,a,o=``){let s=r?` | RSS: ${T(r.rss)}, Heap: ${T(r.heapUsed)}`:``;return`[+${R(e).padStart(i)}ms] (+${R(t).padStart(a)}ms) ${n}${o}${s}`}var B,V,H=e((()=>{I(),i(),B=class{constructor(){a(this,`marks`,new Map),a(this,`_origin`,void 0),this._origin=Number(process.hrtime.bigint()/1000n)/1e3}mark(e){this.marks.set(e,this.now())}getEntriesByType(e){if(e!==`mark`)return[];let t=[];for(let[e,n]of this.marks)t.push({name:e,startTime:n,entryType:`mark`});return t}clearMarks(e){e===void 0?this.marks.clear():this.marks.delete(e)}now(){return Number(process.hrtime.bigint()/1000n)/1e3-this._origin}},V=new B}));function U(e){X&&(L().mark(e),J&&Z.push(process.memoryUsage()))}function W(){if(!J)return`Startup profiling not enabled`;let e=L().getEntriesByType(`mark`);if(e.length===0)return`No profiling checkpoints recorded`;let t=[];t.push(`=`.repeat(80)),t.push(`STARTUP PROFILING REPORT`),t.push(`=`.repeat(80)),t.push(``);let n=0;for(let[r,i]of e.entries())t.push(z(i.startTime,i.startTime-n,i.name,Z[r],8,7)),n=i.startTime;let r=e[e.length-1];return t.push(``),t.push(`Total startup time: ${R(r?.startTime??0)}ms`),t.push(`=`.repeat(80)),t.join(`
|
|
3
|
+
`)}function G(){if(!$){if($=!0,se(),J){let e=q(),t=ie(e);ne().mkdirSync(t),te(e,W(),{encoding:`utf8`,flush:!0}),d(`Startup profiling report:`),d(W())}L().clearMarks(),Z.length=0}}function K(){return J}function q(){return v(n(),`startup-perf`,`${c()}.txt`)}function se(){if(!Y)return;let e=L().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length,p(`tengu_startup_perf`,n)}var J,Y,X,Z,Q,$,ce=e((()=>{ee(),f(),re(),r(),u(),H(),l(),J=t(process.env.CLAUDE_CODE_PROFILE_STARTUP),Y=process.env.USER_TYPE===`ant`||Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&U(`profiler_initialized`),$=!1}));export{y as C,S as E,C as S,b as T,M as _,G as a,I as b,L as c,T as d,ae as f,oe as g,j as h,U as i,H as l,A as m,ce as n,R as o,O as p,K as r,z as s,q as t,D as u,E as v,x as w,w as x,k as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./isObject-C6qM3WEW.js";import{a as d,c as f,d as p,f as m,g as h,h as g,i as _,l as v,m as y,n as ee,o as te,p as ne,r as re,s as ie,t as ae,u as oe}from"./memoize-BK3gG5ob.js";import{i as b,n as se,r as x,t as ce}from"./isSymbol-BO6cdPI7.js";import{realpathSync as le}from"fs";import{randomUUID as ue}from"crypto";import{cwd as de}from"process";function fe(){this.__data__=new ie,this.size=0}var pe=e((()=>{f()}));function me(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var he=e((()=>{}));function ge(e){return this.__data__.get(e)}var _e=e((()=>{}));function ve(e){return this.__data__.has(e)}var ye=e((()=>{}));function be(e,t){var n=this.__data__;if(n instanceof ie){var r=n.__data__;if(!d||r.length<xe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new re(r)}return n.set(e,t),this.size=n.size,this}var xe,Se=e((()=>{f(),te(),_(),xe=200}));function S(e){var t=this.__data__=new ie(e);this.size=t.size}var Ce=e((()=>{f(),pe(),he(),_e(),ye(),Se(),S.prototype.clear=fe,S.prototype.delete=me,S.prototype.get=ge,S.prototype.has=ve,S.prototype.set=be}));function we(e){return this.__data__.set(e,Te),this}var Te,Ee=e((()=>{Te=`__lodash_hash_undefined__`}));function De(e){return this.__data__.has(e)}var Oe=e((()=>{}));function C(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new re;++t<n;)this.add(e[t])}var ke=e((()=>{_(),Ee(),Oe(),C.prototype.add=C.prototype.push=we,C.prototype.has=De}));function Ae(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var je=e((()=>{}));function Me(e,t){return e.has(t)}var Ne=e((()=>{}));function Pe(e,t,n,r,i,a){var o=n&Fe,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Ie?new C:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Ae(t,function(e,t){if(!Me(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}var Fe,Ie,Le=e((()=>{ke(),je(),Ne(),Fe=1,Ie=2})),w,Re=e((()=>{c(),w=n.Uint8Array}));function ze(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}var Be=e((()=>{}));function Ve(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var He=e((()=>{}));function Ue(e,t,n,r,i,a,o){switch(n){case nt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case tt:return!(e.byteLength!=t.byteLength||!a(new w(e),new w(t)));case Ke:case qe:case Xe:return v(+e,+t);case Je:return e.name==t.name&&e.message==t.message;case Ze:case $e:return e==t+``;case Ye:var s=ze;case Qe:var c=r&We;if(s||(s=Ve),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Ge,o.set(e,t);var u=Pe(s(e),s(t),r,i,a,o);return o.delete(e),u;case et:if(T)return T.call(e)==T.call(t)}return!1}var We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,T,it=e((()=>{o(),Re(),oe(),Le(),Be(),He(),We=1,Ge=2,Ke=`[object Boolean]`,qe=`[object Date]`,Je=`[object Error]`,Ye=`[object Map]`,Xe=`[object Number]`,Ze=`[object RegExp]`,Qe=`[object Set]`,$e=`[object String]`,et=`[object Symbol]`,tt=`[object ArrayBuffer]`,nt=`[object DataView]`,rt=t?t.prototype:void 0,T=rt?rt.valueOf:void 0}));function at(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ot=e((()=>{})),E,D=e((()=>{E=Array.isArray}));function st(e,t,n){var r=t(e);return E(e)?r:at(r,n(e))}var ct=e((()=>{ot(),D()}));function lt(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var ut=e((()=>{}));function dt(){return[]}var ft=e((()=>{})),pt,mt,ht,gt=e((()=>{ut(),ft(),pt=Object.prototype.propertyIsEnumerable,mt=Object.getOwnPropertySymbols,ht=mt?function(e){return e==null?[]:(e=Object(e),lt(mt(e),function(t){return pt.call(e,t)}))}:dt}));function _t(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var vt=e((()=>{}));function yt(e){return b(e)&&s(e)==bt}var bt,xt=e((()=>{r(),x(),bt=`[object Arguments]`})),St,Ct,wt,O,Tt=e((()=>{xt(),x(),St=Object.prototype,Ct=St.hasOwnProperty,wt=St.propertyIsEnumerable,O=yt(function(){return arguments}())?yt:function(e){return b(e)&&Ct.call(e,`callee`)&&!wt.call(e,`callee`)}}));function Et(){return!1}var Dt=e((()=>{})),Ot,kt,At,k,jt=e((()=>{c(),Dt(),Ot=typeof exports==`object`&&exports&&!exports.nodeType&&exports,kt=Ot&&typeof module==`object`&&module&&!module.nodeType&&module,At=kt&&kt.exports===Ot?n.Buffer:void 0,k=(At?At.isBuffer:void 0)||Et}));function Mt(e,t){var n=typeof e;return t=t??Nt,!!t&&(n==`number`||n!=`symbol`&&Pt.test(e))&&e>-1&&e%1==0&&e<t}var Nt,Pt,Ft=e((()=>{Nt=9007199254740991,Pt=/^(?:0|[1-9]\d*)$/}));function It(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Lt}var Lt,Rt=e((()=>{Lt=9007199254740991}));function zt(e){return b(e)&&It(e.length)&&!!A[s(e)]}var Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,A,dn=e((()=>{r(),Rt(),x(),Bt=`[object Arguments]`,Vt=`[object Array]`,Ht=`[object Boolean]`,Ut=`[object Date]`,Wt=`[object Error]`,Gt=`[object Function]`,Kt=`[object Map]`,qt=`[object Number]`,Jt=`[object Object]`,Yt=`[object RegExp]`,Xt=`[object Set]`,Zt=`[object String]`,Qt=`[object WeakMap]`,$t=`[object ArrayBuffer]`,en=`[object DataView]`,tn=`[object Float32Array]`,nn=`[object Float64Array]`,rn=`[object Int8Array]`,an=`[object Int16Array]`,on=`[object Int32Array]`,sn=`[object Uint8Array]`,cn=`[object Uint8ClampedArray]`,ln=`[object Uint16Array]`,un=`[object Uint32Array]`,A={},A[tn]=A[nn]=A[rn]=A[an]=A[on]=A[sn]=A[cn]=A[ln]=A[un]=!0,A[Bt]=A[Vt]=A[$t]=A[Ht]=A[en]=A[Ut]=A[Wt]=A[Gt]=A[Kt]=A[qt]=A[Jt]=A[Yt]=A[Xt]=A[Zt]=A[Qt]=!1}));function fn(e){return function(t){return e(t)}}var pn=e((()=>{})),mn,j,M,N,hn=e((()=>{u(),mn=typeof exports==`object`&&exports&&!exports.nodeType&&exports,j=mn&&typeof module==`object`&&module&&!module.nodeType&&module,M=j&&j.exports===mn&&i.process,N=function(){try{return j&&j.require&&j.require(`util`).types||M&&M.binding&&M.binding(`util`)}catch{}}()})),gn,P,F=e((()=>{dn(),pn(),hn(),gn=N&&N.isTypedArray,P=gn?fn(gn):zt}));function _n(e,t){var n=E(e),r=!n&&O(e),i=!n&&!r&&k(e),a=!n&&!r&&!i&&P(e),o=n||r||i||a,s=o?_t(e.length,String):[],c=s.length;for(var l in e)(t||vn.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Mt(l,c)))&&s.push(l);return s}var vn,yn=e((()=>{vt(),Tt(),D(),jt(),Ft(),F(),vn=Object.prototype.hasOwnProperty}));function bn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||xn)}var xn,Sn=e((()=>{xn=Object.prototype}));function Cn(e,t){return function(n){return e(t(n))}}var wn=e((()=>{})),Tn,En=e((()=>{wn(),Tn=Cn(Object.keys,Object)}));function Dn(e){if(!bn(e))return Tn(e);var t=[];for(var n in Object(e))On.call(e,n)&&n!=`constructor`&&t.push(n);return t}var On,kn=e((()=>{Sn(),En(),On=Object.prototype.hasOwnProperty}));function An(e){return e!=null&&It(e.length)&&!h(e)}var jn=e((()=>{g(),Rt()}));function I(e){return An(e)?_n(e):Dn(e)}var Mn=e((()=>{yn(),kn(),jn()}));function Nn(e){return st(e,I,ht)}var Pn=e((()=>{ct(),gt(),Mn()}));function Fn(e,t,n,r,i,a){var o=n&In,s=Nn(e),c=s.length;if(c!=Nn(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Ln.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||(m=u==`constructor`)}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var In,Ln,Rn=e((()=>{Pn(),In=1,Ln=Object.prototype.hasOwnProperty})),L,zn=e((()=>{m(),c(),L=p(n,`DataView`)})),R,Bn=e((()=>{m(),c(),R=p(n,`Promise`)})),z,Vn=e((()=>{m(),c(),z=p(n,`Set`)})),B,Hn=e((()=>{m(),c(),B=p(n,`WeakMap`)})),Un,Wn,Gn,Kn,V,qn,Jn,Yn,Xn,Zn,Qn,H,U,$n=e((()=>{zn(),te(),Bn(),Vn(),Hn(),r(),ne(),Un=`[object Map]`,Wn=`[object Object]`,Gn=`[object Promise]`,Kn=`[object Set]`,V=`[object WeakMap]`,qn=`[object DataView]`,Jn=y(L),Yn=y(d),Xn=y(R),Zn=y(z),Qn=y(B),H=s,(L&&H(new L(new ArrayBuffer(1)))!=qn||d&&H(new d)!=Un||R&&H(R.resolve())!=Gn||z&&H(new z)!=Kn||B&&H(new B)!=V)&&(H=function(e){var t=s(e),n=t==Wn?e.constructor:void 0,r=n?y(n):``;if(r)switch(r){case Jn:return qn;case Yn:return Un;case Xn:return Gn;case Zn:return Kn;case Qn:return V}return t}),U=H}));function er(e,t,n,r,i,a){var o=E(e),s=E(t),c=o?rr:U(e),l=s?rr:U(t);c=c==nr?W:c,l=l==nr?W:l;var u=c==W,d=l==W,f=c==l;if(f&&k(e)){if(!k(t))return!1;o=!0,u=!1}if(f&&!u)return a||(a=new S),o||P(e)?Pe(e,t,n,r,i,a):Ue(e,t,c,n,r,i,a);if(!(n&tr)){var p=u&&ir.call(e,`__wrapped__`),m=d&&ir.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||(a=new S),i(h,g,n,r,a)}}return f?(a||(a=new S),Fn(e,t,n,r,i,a)):!1}var tr,nr,rr,W,ir,ar=e((()=>{Ce(),Le(),it(),Rn(),$n(),D(),jt(),F(),tr=1,nr=`[object Arguments]`,rr=`[object Array]`,W=`[object Object]`,ir=Object.prototype.hasOwnProperty}));function G(e,t,n,r,i){return e===t?!0:e==null||t==null||!b(e)&&!b(t)?e!==e&&t!==t:er(e,t,n,r,G,i)}var or=e((()=>{ar(),x()}));function sr(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new S;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?G(u,l,cr|lr,r,d):f))return!1}}return!0}var cr,lr,ur=e((()=>{Ce(),or(),cr=1,lr=2}));function dr(e){return e===e&&!a(e)}var fr=e((()=>{l()}));function pr(e){for(var t=I(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,dr(i)]}return t}var mr=e((()=>{fr(),Mn()}));function hr(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}var gr=e((()=>{}));function _r(e){var t=pr(e);return t.length==1&&t[0][2]?hr(t[0][0],t[0][1]):function(n){return n===e||sr(n,e,t)}}var vr=e((()=>{ur(),mr(),gr()}));function yr(e,t){if(E(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||se(e)?!0:xr.test(e)||!br.test(e)||t!=null&&e in Object(t)}var br,xr,Sr=e((()=>{D(),ce(),br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xr=/^\w*$/}));function Cr(e){var t=ee(e,function(e){return n.size===wr&&n.clear(),e}),n=t.cache;return t}var wr,Tr=e((()=>{ae(),wr=500})),Er,Dr,Or,kr=e((()=>{Tr(),Er=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Or=Cr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Er,function(e,n,r,i){t.push(r?i.replace(Dr,`$1`):n||e)}),t})}));function Ar(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var jr=e((()=>{}));function Mr(e){if(typeof e==`string`)return e;if(E(e))return Ar(e,Mr)+``;if(se(e))return Fr?Fr.call(e):``;var t=e+``;return t==`0`&&1/e==-Nr?`-0`:t}var Nr,Pr,Fr,Ir=e((()=>{o(),jr(),D(),ce(),Nr=1/0,Pr=t?t.prototype:void 0,Fr=Pr?Pr.toString:void 0}));function Lr(e){return e==null?``:Mr(e)}var Rr=e((()=>{Ir()}));function zr(e,t){return E(e)?e:yr(e,t)?[e]:Or(Lr(e))}var Br=e((()=>{D(),Sr(),kr(),Rr()}));function K(e){if(typeof e==`string`||se(e))return e;var t=e+``;return t==`0`&&1/e==-Vr?`-0`:t}var Vr,q=e((()=>{ce(),Vr=1/0}));function Hr(e,t){t=zr(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[K(t[n++])];return n&&n==r?e:void 0}var Ur=e((()=>{Br(),q()}));function Wr(e,t,n){var r=e==null?void 0:Hr(e,t);return r===void 0?n:r}var Gr=e((()=>{Ur()}));function Kr(e,t){return e!=null&&t in Object(e)}var qr=e((()=>{}));function Jr(e,t,n){t=zr(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=K(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&It(i)&&Mt(o,i)&&(E(e)||O(e)))}var Yr=e((()=>{Br(),Tt(),D(),Ft(),Rt(),q()}));function Xr(e,t){return e!=null&&Jr(e,t,Kr)}var Zr=e((()=>{qr(),Yr()}));function Qr(e,t){return yr(e)&&dr(t)?hr(K(e),t):function(n){var r=Wr(n,e);return r===void 0&&r===t?Xr(n,e):G(t,r,$r|ei)}}var $r,ei,ti=e((()=>{or(),Gr(),Zr(),Sr(),fr(),gr(),q(),$r=1,ei=2}));function ni(e){return e}var ri=e((()=>{}));function ii(e){return function(t){return t?.[e]}}var ai=e((()=>{}));function oi(e){return function(t){return Hr(t,e)}}var si=e((()=>{Ur()}));function ci(e){return yr(e)?ii(K(e)):oi(e)}var li=e((()=>{ai(),si(),Sr(),q()}));function ui(e){return typeof e==`function`?e:e==null?ni:typeof e==`object`?E(e)?Qr(e[0],e[1]):_r(e):ci(e)}var di=e((()=>{vr(),ti(),ri(),D(),li()}));function fi(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==void 0&&(n=n===void 0?a:n+a)}return n}var pi=e((()=>{}));function J(e,t){return e&&e.length?fi(e,ui(t,2)):0}var mi=e((()=>{di(),pi()})),hi=e((()=>{}));function gi(){return Y}function _i(e){Y=e}function vi(e){return X.has(e)?X.get(e):void 0}function yi(e,t){X.set(e,t)}function bi(e){return Z.get(e)}function xi(e,t){Z.set(e,t)}function Si(){Y=null,X.clear(),Z.clear()}function Ci(){return Ei}function wi(e){Ei=e}function Ti(){Ei=void 0}var Y,X,Z,Ei,Di=e((()=>{Y=null,X=new Map,Z=new Map}));function Oi(){let e=new Set;return{subscribe(t){return e.add(t),()=>{e.delete(t)}},emit(...t){for(let n of e)n(...t)},clear(){e.clear()}}}var ki=e((()=>{}));function Ai(){let e=``;if(typeof process<`u`&&typeof process.cwd==`function`&&typeof le==`function`){let t=de();try{e=le(t).normalize(`NFC`)}catch{e=t.normalize(`NFC`)}}return{originalCwd:e,projectRoot:e,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,turnHookDurationMs:0,turnToolDurationMs:0,turnClassifierDurationMs:0,turnToolCount:0,turnHookCount:0,turnClassifierCount:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:e,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,kairosActive:!1,strictToolResultPairing:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:`cli`,sessionSource:void 0,questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,allowedSettingSources:[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:ue(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,...process.env.USER_TYPE===`ant`?{replBridgeActive:!1}:{},directConnectServerUrl:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],sessionProjectDir:null,promptCache1hAllowlist:null,promptCache1hEligible:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,promptId:null,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}function ji(){return Q.sessionId}function Mi(e={}){return e.setCurrentAsParent&&(Q.parentSessionId=Q.sessionId),Q.planSlugCache.delete(Q.sessionId),Q.sessionId=ue(),Q.sessionProjectDir=null,Q.sessionId}function Ni(){return Q.parentSessionId}function Pi(e,t=null){Q.planSlugCache.delete(Q.sessionId),Q.sessionId=e,Q.sessionProjectDir=t,Zs.emit(e)}function Fi(){return Q.sessionProjectDir}function Ii(){return Q.originalCwd}function Li(){return Q.projectRoot}function Ri(e){Q.originalCwd=e.normalize(`NFC`)}function zi(e){Q.projectRoot=e.normalize(`NFC`)}function Bi(){return Q.cwd}function Vi(e){Q.cwd=e.normalize(`NFC`)}function Hi(){return Q.directConnectServerUrl}function Ui(e){Q.directConnectServerUrl=e}function Wi(e,t){Q.totalAPIDuration+=e,Q.totalAPIDurationWithoutRetries+=t}function Gi(e,t,n){Q.modelUsage[n]=t,Q.totalCostUSD+=e}function Ki(){return Q.totalCostUSD}function qi(){return Q.totalAPIDuration}function Ji(){return Date.now()-Q.startTime}function Yi(){return Q.totalAPIDurationWithoutRetries}function Xi(){return Q.totalToolDuration}function Zi(e){Q.totalToolDuration+=e,Q.turnToolDurationMs+=e,Q.turnToolCount++}function Qi(){return Q.turnHookDurationMs}function $i(e){Q.turnHookDurationMs+=e,Q.turnHookCount++}function ea(){Q.turnHookDurationMs=0,Q.turnHookCount=0}function ta(){return Q.turnHookCount}function na(){return Q.turnToolDurationMs}function ra(){Q.turnToolDurationMs=0,Q.turnToolCount=0}function ia(){return Q.turnToolCount}function aa(){return Q.turnClassifierDurationMs}function oa(e){Q.turnClassifierDurationMs+=e,Q.turnClassifierCount++}function sa(){Q.turnClassifierDurationMs=0,Q.turnClassifierCount=0}function ca(){return Q.turnClassifierCount}function la(){return Q.statsStore}function ua(e){Q.statsStore=e}function da(e){e?fa():$s=!0}function fa(){Q.lastInteractionTime=Date.now(),$s=!1}function pa(e,t){Q.totalLinesAdded+=e,Q.totalLinesRemoved+=t}function ma(){return Q.totalLinesAdded}function ha(){return Q.totalLinesRemoved}function ga(){return J(Object.values(Q.modelUsage),`inputTokens`)}function _a(){return J(Object.values(Q.modelUsage),`outputTokens`)}function va(){return J(Object.values(Q.modelUsage),`cacheReadInputTokens`)}function ya(){return J(Object.values(Q.modelUsage),`cacheCreationInputTokens`)}function ba(){return J(Object.values(Q.modelUsage),`webSearchRequests`)}function xa(){return _a()-ec}function Sa(){return tc}function Ca(e){ec=_a(),tc=e,$=0}function wa(){return $}function Ta(){$++}function Ea(){Q.hasUnknownModelCost=!0}function Da(){return Q.hasUnknownModelCost}function Oa(){return Q.lastMainRequestId}function ka(e){Q.lastMainRequestId=e}function Aa(){return Q.lastApiCompletionTimestamp}function ja(e){Q.lastApiCompletionTimestamp=e}function Ma(){Q.pendingPostCompaction=!0}function Na(){let e=Q.pendingPostCompaction;return Q.pendingPostCompaction=!1,e}function Pa(){return Q.lastInteractionTime}function Fa(){return nc}async function Ia(){for(;nc;)await new Promise(e=>setTimeout(e,rc).unref?.())}function La(){return Q.modelUsage}function Ra(e){return Q.modelUsage[e]}function za(){return Q.mainLoopModelOverride}function Ba(){return Q.initialMainLoopModel}function Va(e){Q.mainLoopModelOverride=e}function Ha(e){Q.initialMainLoopModel=e}function Ua(){return Q.sdkBetas}function Wa(e){Q.sdkBetas=e}function Ga(){Q.totalCostUSD=0,Q.totalAPIDuration=0,Q.totalAPIDurationWithoutRetries=0,Q.totalToolDuration=0,Q.startTime=Date.now(),Q.totalLinesAdded=0,Q.totalLinesRemoved=0,Q.hasUnknownModelCost=!1,Q.modelUsage={},Q.promptId=null}function Ka({totalCostUSD:e,totalAPIDuration:t,totalAPIDurationWithoutRetries:n,totalToolDuration:r,totalLinesAdded:i,totalLinesRemoved:a,lastDuration:o,modelUsage:s}){Q.totalCostUSD=e,Q.totalAPIDuration=t,Q.totalAPIDurationWithoutRetries=n,Q.totalToolDuration=r,Q.totalLinesAdded=i,Q.totalLinesRemoved=a,s&&(Q.modelUsage=s),o&&(Q.startTime=Date.now()-o)}function qa(){return Q.modelStrings}function Ja(e){Q.modelStrings=e}function Ya(e,t){Q.meter=e,Q.sessionCounter=t(`claude_code.session.count`,{description:`Count of CLI sessions started`}),Q.locCounter=t(`claude_code.lines_of_code.count`,{description:`Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed`}),Q.prCounter=t(`claude_code.pull_request.count`,{description:`Number of pull requests created`}),Q.commitCounter=t(`claude_code.commit.count`,{description:`Number of git commits created`}),Q.costCounter=t(`claude_code.cost.usage`,{description:`Cost of the Claude Code session`,unit:`USD`}),Q.tokenCounter=t(`claude_code.token.usage`,{description:`Number of tokens used`,unit:`tokens`}),Q.codeEditToolDecisionCounter=t(`claude_code.code_edit_tool.decision`,{description:`Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools`}),Q.activeTimeCounter=t(`claude_code.active_time.total`,{description:`Total active time in seconds`,unit:`s`})}function Xa(){return Q.sessionCounter}function Za(){return Q.locCounter}function Qa(){return Q.prCounter}function $a(){return Q.commitCounter}function eo(){return Q.costCounter}function to(){return Q.tokenCounter}function no(){return Q.codeEditToolDecisionCounter}function ro(){return Q.activeTimeCounter}function io(){return Q.loggerProvider}function ao(e){Q.loggerProvider=e}function oo(){return Q.eventLogger}function so(e){Q.eventLogger=e}function co(){return Q.meterProvider}function lo(e){Q.meterProvider=e}function uo(){return Q.tracerProvider}function fo(e){Q.tracerProvider=e}function po(){return!Q.isInteractive}function mo(){return Q.isInteractive}function ho(e){Q.isInteractive=e}function go(){return Q.clientType}function _o(e){Q.clientType=e}function vo(){return Q.sdkAgentProgressSummariesEnabled}function yo(e){Q.sdkAgentProgressSummariesEnabled=e}function bo(){return Q.kairosActive}function xo(e){Q.kairosActive=e}function So(){return Q.strictToolResultPairing}function Co(){return Q.userMsgOptIn}function wo(e){Q.userMsgOptIn=e}function To(e){Q.sessionSource=e}function Eo(){return Q.questionPreviewFormat}function Do(e){Q.questionPreviewFormat=e}function Oo(){return Q.agentColorMap}function ko(){return Q.flagSettingsPath}function Ao(e){Q.flagSettingsPath=e}function jo(){return Q.flagSettingsInline}function Mo(e){Q.flagSettingsInline=e}function No(){return Q.sessionIngressToken}function Po(e){Q.sessionIngressToken=e}function Fo(){return Q.oauthTokenFromFd}function Io(e){Q.oauthTokenFromFd=e}function Lo(){return Q.apiKeyFromFd}function Ro(e){Q.apiKeyFromFd=e}function zo(e){Q.lastAPIRequest=e}function Bo(){return Q.lastAPIRequest}function Vo(e){Q.lastAPIRequestMessages=e}function Ho(e){Q.lastClassifierRequests=e}function Uo(e){Q.cachedClaudeMdContent=e}function Wo(){return Q.cachedClaudeMdContent}function Go(){return Q.allowedSettingSources}function Ko(e){Q.allowedSettingSources=e}function qo(){return po()&&Q.clientType!==`claude-vscode`}function Jo(e){Q.inlinePlugins=e}function Yo(){return Q.inlinePlugins}function Xo(e){Q.useCoworkPlugins=e,Si()}function Zo(){return Q.useCoworkPlugins}function Qo(e){Q.sessionBypassPermissionsMode=e}function $o(e){Q.sessionTrustAccepted=e}function es(){return Q.sessionTrustAccepted}function ts(e){Q.sessionPersistenceDisabled=e}function ns(){return Q.sessionPersistenceDisabled}function rs(){return Q.hasExitedPlanMode}function is(e){Q.hasExitedPlanMode=e}function as(){return Q.needsPlanModeExitAttachment}function os(e){Q.needsPlanModeExitAttachment=e}function ss(e,t){t===`plan`&&e!==`plan`&&(Q.needsPlanModeExitAttachment=!1),e===`plan`&&t!==`plan`&&(Q.needsPlanModeExitAttachment=!0)}function cs(){return Q.needsAutoModeExitAttachment}function ls(e){Q.needsAutoModeExitAttachment=e}function us(e,t){if(e===`auto`&&t===`plan`||e===`plan`&&t===`auto`)return;let n=e===`auto`,r=t===`auto`;r&&!n&&(Q.needsAutoModeExitAttachment=!1),n&&!r&&(Q.needsAutoModeExitAttachment=!0)}function ds(){return Q.lspRecommendationShownThisSession}function fs(e){Q.lspRecommendationShownThisSession=e}function ps(e){Q.initJsonSchema=e}function ms(){return Q.initJsonSchema}function hs(e){Q.registeredHooks||(Q.registeredHooks={});for(let[t,n]of Object.entries(e)){let e=t;Q.registeredHooks[e]||(Q.registeredHooks[e]=[]),Q.registeredHooks[e].push(...n??[])}}function gs(){return Q.registeredHooks}function _s(){if(!Q.registeredHooks)return;let e={};for(let[t,n]of Object.entries(Q.registeredHooks)){let r=(n??[]).filter(e=>!(`pluginRoot`in e));r.length>0&&(e[t]=r)}Q.registeredHooks=Object.keys(e).length>0?e:null}function vs(){return Q.planSlugCache}function ys(e,t){if(Q.planSlugCache.size>=50){let e=Q.planSlugCache.keys().next().value;e!==void 0&&Q.planSlugCache.delete(e)}Q.planSlugCache.set(e,t)}function bs(e){Q.teleportedSessionInfo={isTeleported:!0,hasLoggedFirstMessage:!1,sessionId:e.sessionId}}function xs(){return Q.teleportedSessionInfo}function Ss(){Q.teleportedSessionInfo&&(Q.teleportedSessionInfo.hasLoggedFirstMessage=!0)}function Cs(e,t,n,r=null){let i=`${r??``}:${e}`;Q.invokedSkills.set(i,{skillName:e,skillPath:t,content:n,invokedAt:Date.now(),agentId:r})}function ws(e){let t=e??null,n=new Map;for(let[e,r]of Q.invokedSkills)r.agentId===t&&n.set(e,r);return n}function Ts(e){if(!e||e.size===0){Q.invokedSkills.clear();return}for(let[t,n]of Q.invokedSkills)(n.agentId===null||!e.has(n.agentId))&&Q.invokedSkills.delete(t)}function Es(e){for(let[t,n]of Q.invokedSkills)n.agentId===e&&Q.invokedSkills.delete(t)}function Ds(){if(Q.slowOperations.length===0)return ac;let e=Date.now();return Q.slowOperations.some(t=>e-t.timestamp>=ic)&&(Q.slowOperations=Q.slowOperations.filter(t=>e-t.timestamp<ic),Q.slowOperations.length===0)?ac:Q.slowOperations}function Os(){return Q.mainThreadAgentType}function ks(e){Q.mainThreadAgentType=e}function As(){return Q.isRemoteMode}function js(e){Q.isRemoteMode=e}function Ms(){return Q.systemPromptSectionCache}function Ns(e,t){if(Q.systemPromptSectionCache.size>=100){let e=Q.systemPromptSectionCache.keys().next().value;e!==void 0&&Q.systemPromptSectionCache.delete(e)}Q.systemPromptSectionCache.set(e,t)}function Ps(){Q.systemPromptSectionCache.clear()}function Fs(){return Q.lastEmittedDate}function Is(e){Q.lastEmittedDate=e}function Ls(){return Q.additionalDirectoriesForClaudeMd}function Rs(e){Q.additionalDirectoriesForClaudeMd=e}function zs(){return Q.promptCache1hAllowlist}function Bs(e){Q.promptCache1hAllowlist=e}function Vs(){return Q.promptCache1hEligible}function Hs(e){Q.promptCache1hEligible=e}function Us(){return Q.afkModeHeaderLatched}function Ws(e){Q.afkModeHeaderLatched=e}function Gs(){return Q.fastModeHeaderLatched}function Ks(e){Q.fastModeHeaderLatched=e}function qs(){return Q.cacheEditingHeaderLatched}function Js(){Q.afkModeHeaderLatched=null,Q.fastModeHeaderLatched=null,Q.cacheEditingHeaderLatched=null}function Ys(){return Q.promptId}function Xs(e){Q.promptId=e}var Q,Zs,Qs,$s,ec,tc,$,nc,rc,ic,ac,oc=e((()=>{mi(),hi(),Di(),ki(),Q=Ai(),Zs=Oi(),Qs=Zs.subscribe,ec=0,tc=null,$=0,nc=!1,rc=150,ic=1e4,ac=[]}));export{qa as $,zi as $n,Vn as $r,Ta as $t,oo as A,st as Ai,Ha as An,xi as Ar,Ji as At,As as B,Me as Bi,ka as Bn,q as Br,ta as Bt,go as C,O as Ci,so as Cn,Ti as Cr,xs as Ct,Sa as D,dt as Di,is as Dn,gi as Dr,ya as Dt,eo as E,ft as Ei,Ao as En,Ci as Er,Yi as Et,Ba as F,ot as Fi,zo as Fn,di as Fr,Xi as Ft,Fs as G,Ce as Gi,Ya as Gn,Lr as Gr,Ra as Gt,bo as H,C as Hi,fs as Hn,zr as Hr,xa as Ht,Yo as I,He as Ii,Vo as In,ni as Ir,ba as It,Za as J,ls as Jn,G as Jr,us as Jt,Pa as K,lo as Kn,Ar as Kr,Zo as Kt,ws as L,Ve as Li,ja as Ln,ri as Lr,uo as Lt,jo as M,D as Mi,ho as Mn,wi as Mr,ma as Mt,ko as N,E as Ni,js as Nn,_i as Nr,ha as Nt,Bi as O,lt as Oi,Ea as On,Di as Or,va as Ot,ms as P,at as Pi,xo as Pn,ui as Pr,_a as Pt,co as Q,ys as Qn,z as Qr,Da as Qt,mo as R,w as Ri,Ho as Rn,Hr as Rr,ca as Rt,Wo as S,Tt as Si,Ui as Sn,ki as Sr,Ms as St,$a as T,gt as Ti,Mo as Tn,vi as Tr,qi as Tt,Bo as U,ke as Ui,Va as Un,Br as Ur,ia as Ut,Fa as V,Ne as Vi,ao as Vn,K as Vr,Qi as Vt,Aa as W,S as Wi,ks as Wn,Rr as Wr,na as Wt,za as X,Io as Xn,U as Xr,rs as Xt,io as Y,os as Yn,or as Yr,ss as Yt,Os as Z,Ri as Zn,$n as Zr,ds as Zt,Oo as _,pn as _i,Ro as _n,Ca as _r,Fi as _t,pa as a,An as ai,as as an,Wa as ar,Qa as at,wa as b,jt as bi,Ka as bn,Ia as br,la as bt,Js as c,Sn as ci,Mi as cn,ts as cr,Vs as ct,_s as d,yn as di,sa as dn,ua as dr,gs as dt,Nn as ei,oc as en,Bs as er,La as et,Ps as f,F as fi,ea as fn,Ns as fr,vo as ft,Us as g,fn as gi,Ko as gn,wo as gr,No as gt,Ls as h,N as hi,Ws as hn,Xo as hr,ji as ht,Wi as i,jn as ii,cs as in,yo as ir,vs as it,Gs as j,ct as ji,Jo as jn,yi as jr,ga as jt,Hi as k,ut as ki,ps as kn,Si as kr,Ki as kt,Ts as l,bn as li,hs as ln,To as lr,Ys as lt,ro as m,hn as mi,Rs as mn,fo as mr,Xa as mt,Zi as n,Mn as ni,Ss as nn,Xs as nr,Ii as nt,oa as o,wn as oi,Qs as on,Qo as or,Li as ot,Na as p,P as pi,ra as pn,bs as pr,Ua as pt,Oa as q,Ja as qn,jr as qr,Co as qt,Gi as r,I as ri,Ma as rn,Do as rr,Ni as rt,$i as s,Cn as si,qo as sn,Po as sr,zs as st,Cs as t,Pn as ti,ns as tn,Hs as tr,Fo as tt,Es as u,_n as ui,Ga as un,$o as ur,Eo as ut,Go as v,Ft as vi,Uo as vn,Pi as vr,es as vt,no as w,ht as wi,Ks as wn,bi as wr,to as wt,qs as x,k as xi,Vi as xn,Oi as xr,So as xt,Lo as y,Mt as yi,_o as yn,da as yr,Ds as yt,po as z,Re as zi,Is as zn,Ur as zr,aa as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Zn as e,en as t,ht as n,t as r,xn as i}from"./state-4KQ3kaqz.js";t();export{r as addInvokedSkill,n as getSessionId,i as setCwdState,e as setOriginalCwd};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{dirname as r,join as i}from"path";import{mkdirSync as a,readFileSync as o,unlinkSync as s,writeFileSync as c}from"fs";function l(e=`remote-control`){return i(t(),`daemon`,`${e}.json`)}function u(e,t=`remote-control`){let n=l(t);a(r(n),{recursive:!0}),c(n,JSON.stringify(e,null,2),`utf-8`)}function d(e=`remote-control`){let t=l(e);try{let e=o(t,`utf-8`);return JSON.parse(e)}catch{return null}}function f(e=`remote-control`){let t=l(e);try{s(t)}catch{}}function p(e){try{return process.kill(e,0),!0}catch{return!1}}function m(e=`remote-control`){let t=d(e);return t?p(t.pid)?{status:`running`,state:t}:(f(e),{status:`stale`}):{status:`stopped`}}async function h(e=`remote-control`,t=1e4){let n=d(e);if(!n)return!1;let{pid:r}=n;if(!p(r))return f(e),!1;try{process.kill(r,`SIGTERM`)}catch{return f(e),!1}let i=Date.now()+t;for(;Date.now()<i;){if(!p(r))return f(e),!0;await new Promise(e=>setTimeout(e,200))}try{process.kill(r,`SIGKILL`)}catch{}return await new Promise(e=>setTimeout(e,500)),f(e),!0}var g=e((()=>{n()}));export{u as a,h as i,m as n,f as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Kr as n,fi as r,kn as i,qr as a,t as o,vt as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{PassThrough as l}from"stream";function u({children:e}){let{exit:t}=s();return(0,m.useLayoutEffect)(()=>{let e=setTimeout(t,0);return()=>clearTimeout(e)},[t]),(0,h.jsx)(h.Fragment,{children:e})}function d(e){let t=e.indexOf(g);if(t===-1)return e;let n=t+8,r=e.indexOf(_,n);return r===-1?e:e.slice(n,r)}async function f(e,t){let n=``,r=new l;return t!==void 0&&(r.columns=t),r.on(`data`,e=>{n+=e.toString()}),await(await i((0,h.jsx)(u,{children:e}),{stdout:r,patchConsole:!1})).waitUntilExit(),d(n)}async function p(e,t){return a(await f(e,t))}var m,h,g,_,v=e((()=>{r(),m=t(r(),1),n(),o(),h=c(),g=`\x1B[?2026h`,_=`\x1B[?2026l`}));export{f as n,p as r,v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{g as r,y as i}from"./config-C7YHKCPV.js";var a=e(t(),1);r();var o=n();function s(e,t){let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);return r===i?e[r]:e[r]+(e[i]-e[r])*(n-r)}var c=1024;function l(){let e=new Map,t=new Map,n=new Map;return{increment(t,n=1){e.set(t,(e.get(t)??0)+n)},set(t,n){e.set(t,n)},observe(e,n){let r=t.get(e);if(r||(r={reservoir:[],count:0,sum:0,min:n,max:n},t.set(e,r)),r.count++,r.sum+=n,n<r.min&&(r.min=n),n>r.max&&(r.max=n),r.reservoir.length<c)r.reservoir.push(n);else{let e=Math.floor(Math.random()*r.count);e<c&&(r.reservoir[e]=n)}},add(e,t){let r=n.get(e);r||(r=new Set,n.set(e,r)),r.add(t)},getAll(){let r=Object.fromEntries(e);for(let[e,n]of t){if(n.count===0)continue;r[`${e}_count`]=n.count,r[`${e}_min`]=n.min,r[`${e}_max`]=n.max,r[`${e}_avg`]=n.sum/n.count;let t=[...n.reservoir].sort((e,t)=>e-t);r[`${e}_p50`]=s(t,50),r[`${e}_p95`]=s(t,95),r[`${e}_p99`]=s(t,99)}for(let[e,t]of n)r[e]=t.size;return r}}}var u=(0,a.createContext)(null);function d({store:e,children:t}){let n=(0,a.useMemo)(()=>l(),[]),r=e??n;return(0,a.useEffect)(()=>{let e=()=>{let e=r.getAll();Object.keys(e).length>0&&i(t=>({...t,lastSessionMetrics:e}))};return process.on(`exit`,e),()=>{process.off(`exit`,e)}},[r]),(0,o.jsx)(u.Provider,{value:r,children:t})}export{l as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./Settings-ns6mRsDc.js";async function a(e,t){return(0,o.jsx)(i,{onClose:e,context:t,defaultTab:`Status`})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,r,t as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{P as ee,di as s,fi as te,j as c,t as l,ui as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{$T as f,IE as p,Lg as m,NE as h,Og as g,QT as _,YT as v,jg as y,tE as b,wg as x}from"./loadAgentsDir-nzr38hai.js";import{a as S,c as C,dn as w,g as T,on as E,r as D,sn as O}from"./settings-5PQdphqC.js";import{f as k,l as A}from"./file-D1cN3LMK.js";import{b as j,p as M}from"./startupProfiler-DxRQteII.js";import{Kt as ne,Vt as N,_ as P,fi as F,i as I,mi as L,x as R,xt as z}from"./model-DfFA3qMO.js";import{h as B,l as V,o as H,p as U}from"./proxy-Cn2YwITp.js";import{d as W,u as G}from"./pidLock-CBJDnBG_.js";import{n as K,t as q}from"./nativeInstaller-GcIk7G2Y.js";import{n as J,t as Y}from"./allErrors-HMPqE0jK.js";function X(){return process.env.USER_TYPE===`ant`?[{label:`Bash Sandbox`,value:h.isSandboxingEnabled()?`Enabled`:`Disabled`}]:[]}function Z(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=m(t.ideType),i=y(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(ee,{children:[c(`error`,n)(o.cross),` Error installing `,e,` `,i,`:`,` `,t.error,`
|
|
2
|
+
`,`Please restart your IDE and try again.`]})}];if(t.installed)return r&&r.type===`connected`?t.installedVersion===r.serverInfo?.version?[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion}`}]:[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion} (server version: ${r.serverInfo?.version})`}]:[{label:`IDE`,value:`Installed ${e} ${i}`}]}else if(r){let e=x(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${c(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function re(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(c(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(c(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(c(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(c(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${c(`inactive`,t)(`· /mcp`)}`}]}async function ie(){let e=_(await f()),t=[];return e.forEach(e=>{let n=A(e.path);t.push(`Large ${n} will impact performance (${M(e.content.length)} chars > ${M(v)})`)}),t}function ae(){return[{label:`Setting sources`,value:E().filter(e=>{let t=C(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=S();if(e===null)return null;switch(e){case`remote`:return`Enterprise managed settings (remote)`;case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=D();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return O(e)}).filter(e=>e!==null)}]}async function oe(){return(await K()).map(e=>e.message)}async function se(){let e=await G(),t=[],{errors:n}=Y();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function Q(){let e=z();if(!e)return[];let t=[];return e.subscription&&t.push({label:`Login method`,value:`${e.subscription} Account`}),e.tokenSource&&t.push({label:`Auth token`,value:e.tokenSource}),e.apiKeySource&&t.push({label:`API key`,value:e.apiKeySource}),e.organization&&!process.env.IS_DEMO&&t.push({label:`Organization`,value:e.organization}),e.email&&!process.env.IS_DEMO&&t.push({label:`Email`,value:e.email}),t}function ce(){let e=F(),n=[];if(e!==`firstParty`){let t={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];n.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&n.push({label:`Anthropic base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&n.push({label:`Bedrock base URL`,value:e}),n.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&n.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&n.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&n.push({label:`GCP project`,value:i}),n.push({label:`Default region`,value:r()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&n.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&n.push({label:`Microsoft Foundry base URL`,value:e});let r=process.env.ANTHROPIC_FOUNDRY_RESOURCE;r&&n.push({label:`Microsoft Foundry resource`,value:r}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&n.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;n.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;n.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;n.push({label:`OpenAI base URL`,value:e})}let a=H();a&&n.push({label:`Proxy`,value:a});let o=U();return process.env.NODE_EXTRA_CA_CERTS&&n.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&n.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&n.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),n}function le(e){let t=R(e);if(e===null&&ne()){let e=I();t=`${u.bold(`Default`)} ${e}`}return t}var $,ue=e((()=>{s(),a(),te(),l(),N(),b(),W(),n(),k(),j(),g(),P(),L(),B(),q(),V(),p(),J(),w(),T(),$=d()}));export{se as a,X as c,ue as d,oe as i,ae as l,Q as n,re as o,Z as r,ie as s,ce as t,le as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Uc as t,Wc as n}from"./loadAgentsDir-nzr38hai.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,t)=>e+n(`${t.agentType}: ${t.whenToUse}`),0):0}var i,a=e((()=>{t(),i=15e3}));export{r as n,a as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,C as t,D as n,F as r,K as i,Q as a,R as o,S as s,T as c,U as l,W as u,X as d,Z as f,_ as p,a as m,b as h,c as g,d as _,f as v,g as y,i as b,k as x,l as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,z as j}from"./stdio-W_Kokrkh.js";import M from"node:process";f(),k(),g(),i();var N=class{constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return this.requestStream({method:`sampling/createMessage`,params:e},y,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),r=e.mode??`form`;switch(r){case`url`:if(!n?.elicitation?.url)throw Error(`Client does not support url elicitation.`);break;case`form`:if(!n?.elicitation?.form)throw Error(`Client does not support form elicitation.`);break}let i=r===`form`&&e.mode===void 0?{...e,mode:`form`}:e;return this.requestStream({method:`elicitation/create`,params:i},h,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}};i(),w();var P=class extends S{constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(o.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{let n=this._loggingLevels.get(t);return n?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new D,this.setRequestHandler(c,e=>this._oninitialize(e)),this.setNotificationHandler(n,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(u,async(e,t)=>{let n=t.sessionId||t.requestInfo?.headers[`mcp-session-id`]||void 0,{level:r}=e.params,i=o.safeParse(r);return i.success&&this._loggingLevels.set(n,i.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new N(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=_(this._capabilities,e)}setRequestHandler(n,r){let i=d(n)?.method;if(!i)throw Error(`Schema is missing a method literal`);let o;if(a(i)){let e=i;o=e._zod?.def?.value??e.value}else{let e=i;o=e._def?.value??e.value}if(typeof o!=`string`)throw Error(`Schema method literal must be a string`);return o===`tools/call`?super.setRequestHandler(n,async(n,i)=>{let a=e(v,n);if(!a.success){let e=a.error instanceof Error?a.error.message:String(a.error);throw new j(t.InvalidParams,`Invalid tools/call request: ${e}`)}let{params:o}=a.data,s=await Promise.resolve(r(n,i));if(o.task){let n=e(A,s);if(!n.success){let e=n.error instanceof Error?n.error.message:String(n.error);throw new j(t.InvalidParams,`Invalid task creation result: ${e}`)}return n.data}let c=e(T,s);if(!c.success){let e=c.error instanceof Error?c.error.message:String(c.error);throw new j(t.InvalidParams,`Invalid tools/call result: ${e}`)}return c.data}):super.setRequestHandler(n,r)}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case`elicitation/create`:if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case`roots/list`:if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/message`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`notifications/resources/updated`:case`notifications/resources/list_changed`:if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case`notifications/tools/list_changed`:if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case`notifications/prompts/list_changed`:if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case`notifications/elicitation/complete`:if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case`completion/complete`:if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case`logging/setLevel`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case`tasks/get`:case`tasks/list`:case`tasks/result`:case`tasks/cancel`:if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case`ping`:case`initialize`:break}}assertTaskCapability(e){b(this._clientCapabilities?.tasks?.requests,e,`Client`)}assertTaskHandlerCapability(e){this._capabilities&&m(this._capabilities.tasks?.requests,e,`Server`)}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:l.includes(t)?t:x,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:`ping`},s)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return e.tools?this.request({method:`sampling/createMessage`,params:e},p,t):this.request({method:`sampling/createMessage`,params:e},y,t)}async elicitInput(e,n){switch(e.mode??`form`){case`url`:{if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support url elicitation.`);let t=e;return this.request({method:`elicitation/create`,params:t},h,n)}case`form`:{if(!this._clientCapabilities?.elicitation?.form)throw Error(`Client does not support form elicitation.`);let r=e.mode===`form`?e:{...e,mode:`form`},i=await this.request({method:`elicitation/create`,params:r},h,n);if(i.action===`accept`&&i.content&&r.requestedSchema)try{let e=this._jsonSchemaValidator.getValidator(r.requestedSchema)(i.content);if(!e.valid)throw new j(t.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){throw e instanceof j?e:new j(t.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for notifications/elicitation/complete)`);return()=>this.notification({method:`notifications/elicitation/complete`,params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:`roots/list`,params:e},r,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:`notifications/message`,params:e})}async sendResourceUpdated(e){return this.notification({method:`notifications/resources/updated`,params:e})}async sendResourceListChanged(){return this.notification({method:`notifications/resources/list_changed`})}async sendToolListChanged(){return this.notification({method:`notifications/tools/list_changed`})}async sendPromptListChanged(){return this.notification({method:`notifications/prompts/list_changed`})}};C();var F=class{constructor(e=M.stdin,t=M.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new O,this._started=!1,this._ondata=e=>{this._readBuffer.append(e),this.processReadBuffer()},this._onerror=e=>{this.onerror?.(e)}}async start(){if(this._started)throw Error(`StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.`);this._started=!0,this._stdin.on(`data`,this._ondata),this._stdin.on(`error`,this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off(`data`,this._ondata),this._stdin.off(`error`,this._onerror),this._stdin.listenerCount(`data`)===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(t=>{let n=E(e);this._stdout.write(n)?t():this._stdout.once(`drain`,t)})}};export{P as n,F as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{A as r,C as i,D as a,H as o,I as s,M as c,O as l,R as u,T as d,b as f,g as p,h as m,j as h,l as g,m as _,p as v,t as ee,u as te,v as ne,w as y,x as b}from"./v4-jw6qOKwQ.js";import{n as x,t as re}from"./ajv-5vMo9UcX.js";var ie=e((()=>{u()})),ae=e((()=>{})),oe=e((()=>{})),se=e((()=>{ie(),ae(),oe(),ae()})),ce=e((()=>{se()}));function S(e){return!!e._zod}function le(e,t){return S(e)?o(e,t):e.safeParse(t)}function ue(e){if(!e)return;let t;if(t=S(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function de(e){if(S(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var fe=e((()=>{ce()})),pe,me,C,w,he,ge,_e,ve,T,E,D,ye,O,k,A,j,M,be,xe,Se,Ce,N,P,F,we,Te,Ee,I,De,L,Oe,R,z,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,B,ze,V,Be,Ve,H,He,U,W,Ue,G,K,We,q,J,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,Y,X,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,Z,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Q,Pn,Fn=e((()=>{ee(),pe=`2025-11-25`,me=[pe,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],C=`io.modelcontextprotocol/related-task`,w=m(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),he=h([r(),i().int()]),ge=r(),b({ttl:i().optional(),pollInterval:i().optional()}),_e=y({ttl:i().optional()}),ve=y({taskId:r()}),T=b({progressToken:he.optional(),[C]:ve.optional()}),E=y({_meta:T.optional()}),D=E.extend({task:_e.optional()}),ye=e=>D.safeParse(e).success,O=y({method:r(),params:E.loose().optional()}),k=y({_meta:T.optional()}),A=y({method:r(),params:k.loose().optional()}),j=b({_meta:T.optional()}),M=h([r(),i().int()]),be=y({jsonrpc:f(`2.0`),id:M,...O.shape}).strict(),xe=e=>be.safeParse(e).success,Se=y({jsonrpc:f(`2.0`),...A.shape}).strict(),Ce=e=>Se.safeParse(e).success,N=y({jsonrpc:f(`2.0`),id:M,result:j}).strict(),P=e=>N.safeParse(e).success,(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(F||(F={})),we=y({jsonrpc:f(`2.0`),id:M.optional(),error:y({code:i().int(),message:r(),data:c().optional()})}).strict(),Te=e=>we.safeParse(e).success,Ee=h([be,Se,N,we]),h([N,we]),I=j.strict(),De=k.extend({requestId:M.optional(),reason:r().optional()}),L=A.extend({method:f(`notifications/cancelled`),params:De}),Oe=y({src:r(),mimeType:r().optional(),sizes:v(r()).optional(),theme:g([`light`,`dark`]).optional()}),R=y({icons:v(Oe).optional()}),z=y({name:r(),title:r().optional()}),ke=z.extend({...z.shape,...R.shape,version:r(),websiteUrl:r().optional(),description:r().optional()}),Ae=ne(y({applyDefaults:_().optional()}),l(r(),c())),je=a(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(y({form:Ae.optional(),url:w.optional()}),l(r(),c()).optional())),Me=b({list:w.optional(),cancel:w.optional(),requests:b({sampling:b({createMessage:w.optional()}).optional(),elicitation:b({create:w.optional()}).optional()}).optional()}),Ne=b({list:w.optional(),cancel:w.optional(),requests:b({tools:b({call:w.optional()}).optional()}).optional()}),Pe=y({experimental:l(r(),w).optional(),sampling:y({context:w.optional(),tools:w.optional()}).optional(),elicitation:je.optional(),roots:y({listChanged:_().optional()}).optional(),tasks:Me.optional(),extensions:l(r(),w).optional()}),Fe=E.extend({protocolVersion:r(),capabilities:Pe,clientInfo:ke}),Ie=O.extend({method:f(`initialize`),params:Fe}),Le=y({experimental:l(r(),w).optional(),logging:w.optional(),completions:w.optional(),prompts:y({listChanged:_().optional()}).optional(),resources:y({subscribe:_().optional(),listChanged:_().optional()}).optional(),tools:y({listChanged:_().optional()}).optional(),tasks:Ne.optional(),extensions:l(r(),w).optional()}),Re=j.extend({protocolVersion:r(),capabilities:Le,serverInfo:ke,instructions:r().optional()}),B=A.extend({method:f(`notifications/initialized`),params:k.optional()}),ze=e=>B.safeParse(e).success,V=O.extend({method:f(`ping`),params:E.optional()}),Be=y({progress:i(),total:d(i()),message:d(r())}),Ve=y({...k.shape,...Be.shape,progressToken:he}),H=A.extend({method:f(`notifications/progress`),params:Ve}),He=E.extend({cursor:ge.optional()}),U=O.extend({params:He.optional()}),W=j.extend({nextCursor:ge.optional()}),Ue=g([`working`,`input_required`,`completed`,`failed`,`cancelled`]),G=y({taskId:r(),status:Ue,ttl:h([i(),te()]),createdAt:r(),lastUpdatedAt:r(),pollInterval:d(i()),statusMessage:d(r())}),K=j.extend({task:G}),We=k.merge(G),q=A.extend({method:f(`notifications/tasks/status`),params:We}),J=O.extend({method:f(`tasks/get`),params:E.extend({taskId:r()})}),Ge=j.merge(G),Ke=O.extend({method:f(`tasks/result`),params:E.extend({taskId:r()})}),j.loose(),qe=U.extend({method:f(`tasks/list`)}),Je=W.extend({tasks:v(G)}),Ye=O.extend({method:f(`tasks/cancel`),params:E.extend({taskId:r()})}),Xe=j.merge(G),Ze=y({uri:r(),mimeType:d(r()),_meta:l(r(),c()).optional()}),Qe=Ze.extend({text:r()}),$e=r().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),et=Ze.extend({blob:$e}),Y=g([`user`,`assistant`]),X=y({audience:v(Y).optional(),priority:i().min(0).max(1).optional(),lastModified:s({offset:!0}).optional()}),tt=y({...z.shape,...R.shape,uri:r(),description:d(r()),mimeType:d(r()),size:d(i()),annotations:X.optional(),_meta:d(b({}))}),nt=y({...z.shape,...R.shape,uriTemplate:r(),description:d(r()),mimeType:d(r()),annotations:X.optional(),_meta:d(b({}))}),rt=U.extend({method:f(`resources/list`)}),it=W.extend({resources:v(tt)}),at=U.extend({method:f(`resources/templates/list`)}),ot=W.extend({resourceTemplates:v(nt)}),st=E.extend({uri:r()}),ct=st,lt=O.extend({method:f(`resources/read`),params:ct}),ut=j.extend({contents:v(h([Qe,et]))}),dt=A.extend({method:f(`notifications/resources/list_changed`),params:k.optional()}),ft=st,pt=O.extend({method:f(`resources/subscribe`),params:ft}),mt=st,ht=O.extend({method:f(`resources/unsubscribe`),params:mt}),gt=k.extend({uri:r()}),_t=A.extend({method:f(`notifications/resources/updated`),params:gt}),vt=y({name:r(),description:d(r()),required:d(_())}),yt=y({...z.shape,...R.shape,description:d(r()),arguments:d(v(vt)),_meta:d(b({}))}),bt=U.extend({method:f(`prompts/list`)}),xt=W.extend({prompts:v(yt)}),St=E.extend({name:r(),arguments:l(r(),r()).optional()}),Ct=O.extend({method:f(`prompts/get`),params:St}),wt=y({type:f(`text`),text:r(),annotations:X.optional(),_meta:l(r(),c()).optional()}),Tt=y({type:f(`image`),data:$e,mimeType:r(),annotations:X.optional(),_meta:l(r(),c()).optional()}),Et=y({type:f(`audio`),data:$e,mimeType:r(),annotations:X.optional(),_meta:l(r(),c()).optional()}),Dt=y({type:f(`tool_use`),name:r(),id:r(),input:l(r(),c()),_meta:l(r(),c()).optional()}),Ot=y({type:f(`resource`),resource:h([Qe,et]),annotations:X.optional(),_meta:l(r(),c()).optional()}),kt=tt.extend({type:f(`resource_link`)}),At=h([wt,Tt,Et,kt,Ot]),jt=y({role:Y,content:At}),Mt=j.extend({description:r().optional(),messages:v(jt)}),Nt=A.extend({method:f(`notifications/prompts/list_changed`),params:k.optional()}),Pt=y({title:r().optional(),readOnlyHint:_().optional(),destructiveHint:_().optional(),idempotentHint:_().optional(),openWorldHint:_().optional()}),Ft=y({taskSupport:g([`required`,`optional`,`forbidden`]).optional()}),It=y({...z.shape,...R.shape,description:r().optional(),inputSchema:y({type:f(`object`),properties:l(r(),w).optional(),required:v(r()).optional()}).catchall(c()),outputSchema:y({type:f(`object`),properties:l(r(),w).optional(),required:v(r()).optional()}).catchall(c()).optional(),annotations:Pt.optional(),execution:Ft.optional(),_meta:l(r(),c()).optional()}),Lt=U.extend({method:f(`tools/list`)}),Rt=W.extend({tools:v(It)}),zt=j.extend({content:v(At).default([]),structuredContent:l(r(),c()).optional(),isError:_().optional()}),zt.or(j.extend({toolResult:c()})),Bt=D.extend({name:r(),arguments:l(r(),c()).optional()}),Vt=O.extend({method:f(`tools/call`),params:Bt}),Ht=A.extend({method:f(`notifications/tools/list_changed`),params:k.optional()}),Ut=y({autoRefresh:_().default(!0),debounceMs:i().int().nonnegative().default(300)}),Wt=g([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Gt=E.extend({level:Wt}),Kt=O.extend({method:f(`logging/setLevel`),params:Gt}),qt=k.extend({level:Wt,logger:r().optional(),data:c()}),Jt=A.extend({method:f(`notifications/message`),params:qt}),Yt=y({name:r().optional()}),Xt=y({hints:v(Yt).optional(),costPriority:i().min(0).max(1).optional(),speedPriority:i().min(0).max(1).optional(),intelligencePriority:i().min(0).max(1).optional()}),Zt=y({mode:g([`auto`,`required`,`none`]).optional()}),Qt=y({type:f(`tool_result`),toolUseId:r().describe(`The unique identifier for the corresponding tool call.`),content:v(At).default([]),structuredContent:y({}).loose().optional(),isError:_().optional(),_meta:l(r(),c()).optional()}),$t=p(`type`,[wt,Tt,Et]),Z=p(`type`,[wt,Tt,Et,Dt,Qt]),en=y({role:Y,content:h([Z,v(Z)]),_meta:l(r(),c()).optional()}),tn=D.extend({messages:v(en),modelPreferences:Xt.optional(),systemPrompt:r().optional(),includeContext:g([`none`,`thisServer`,`allServers`]).optional(),temperature:i().optional(),maxTokens:i().int(),stopSequences:v(r()).optional(),metadata:w.optional(),tools:v(It).optional(),toolChoice:Zt.optional()}),nn=O.extend({method:f(`sampling/createMessage`),params:tn}),rn=j.extend({model:r(),stopReason:d(g([`endTurn`,`stopSequence`,`maxTokens`]).or(r())),role:Y,content:$t}),an=j.extend({model:r(),stopReason:d(g([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(r())),role:Y,content:h([Z,v(Z)])}),on=y({type:f(`boolean`),title:r().optional(),description:r().optional(),default:_().optional()}),sn=y({type:f(`string`),title:r().optional(),description:r().optional(),minLength:i().optional(),maxLength:i().optional(),format:g([`email`,`uri`,`date`,`date-time`]).optional(),default:r().optional()}),cn=y({type:g([`number`,`integer`]),title:r().optional(),description:r().optional(),minimum:i().optional(),maximum:i().optional(),default:i().optional()}),ln=y({type:f(`string`),title:r().optional(),description:r().optional(),enum:v(r()),default:r().optional()}),un=y({type:f(`string`),title:r().optional(),description:r().optional(),oneOf:v(y({const:r(),title:r()})),default:r().optional()}),dn=y({type:f(`string`),title:r().optional(),description:r().optional(),enum:v(r()),enumNames:v(r()).optional(),default:r().optional()}),fn=h([ln,un]),pn=y({type:f(`array`),title:r().optional(),description:r().optional(),minItems:i().optional(),maxItems:i().optional(),items:y({type:f(`string`),enum:v(r())}),default:v(r()).optional()}),mn=y({type:f(`array`),title:r().optional(),description:r().optional(),minItems:i().optional(),maxItems:i().optional(),items:y({anyOf:v(y({const:r(),title:r()}))}),default:v(r()).optional()}),hn=h([pn,mn]),gn=h([dn,fn,hn]),_n=h([gn,on,sn,cn]),vn=D.extend({mode:f(`form`).optional(),message:r(),requestedSchema:y({type:f(`object`),properties:l(r(),_n),required:v(r()).optional()})}),yn=D.extend({mode:f(`url`),message:r(),elicitationId:r(),url:r().url()}),bn=h([vn,yn]),xn=O.extend({method:f(`elicitation/create`),params:bn}),Sn=k.extend({elicitationId:r()}),Cn=A.extend({method:f(`notifications/elicitation/complete`),params:Sn}),wn=j.extend({action:g([`accept`,`decline`,`cancel`]),content:a(e=>e===null?void 0:e,l(r(),h([r(),i(),_(),v(r())])).optional())}),Tn=y({type:f(`ref/resource`),uri:r()}),En=y({type:f(`ref/prompt`),name:r()}),Dn=E.extend({ref:h([En,Tn]),argument:y({name:r(),value:r()}),context:y({arguments:l(r(),r()).optional()}).optional()}),On=O.extend({method:f(`completion/complete`),params:Dn}),kn=j.extend({completion:b({values:v(r()).max(100),total:d(i().int()),hasMore:d(_())})}),An=y({uri:r().startsWith(`file://`),name:r().optional(),_meta:l(r(),c()).optional()}),jn=O.extend({method:f(`roots/list`),params:E.optional()}),Mn=j.extend({roots:v(An)}),Nn=A.extend({method:f(`notifications/roots/list_changed`),params:k.optional()}),h([V,Ie,On,Kt,Ct,bt,rt,at,lt,pt,ht,Vt,Lt,J,Ke,qe,Ye]),h([L,H,B,Nn,q]),h([I,rn,an,wn,Mn,Ge,Je,K]),h([V,nn,xn,jn,J,Ke,qe,Ye]),h([L,H,Jt,_t,dt,Ht,Nt,q,Cn]),h([I,Re,kn,Mt,xt,it,ot,ut,zt,Rt,Ge,Je,K]),Q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===F.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Pn(e.elicitations,n)}return new e(t,n,r)}},Pn=class extends Q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(F.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}}));function $(e){return e===`completed`||e===`failed`||e===`cancelled`}var In=e((()=>{})),Ln=e((()=>{})),Rn=e((()=>{})),zn=e((()=>{})),Bn=e((()=>{})),Vn=e((()=>{})),Hn=e((()=>{})),Un=e((()=>{})),Wn=e((()=>{})),Gn=e((()=>{})),Kn=e((()=>{})),qn=e((()=>{})),Jn=e((()=>{})),Yn=e((()=>{})),Xn=e((()=>{})),Zn=e((()=>{})),Qn=e((()=>{})),$n=e((()=>{})),er=e((()=>{})),tr=e((()=>{})),nr=e((()=>{})),rr=e((()=>{})),ir=e((()=>{})),ar=e((()=>{})),or=e((()=>{})),sr=e((()=>{})),cr=e((()=>{})),lr=e((()=>{})),ur=e((()=>{})),dr=e((()=>{})),fr=e((()=>{})),pr=e((()=>{})),mr=e((()=>{})),hr=e((()=>{})),gr=e((()=>{})),_r=e((()=>{})),vr=e((()=>{})),yr=e((()=>{})),br=e((()=>{})),xr=e((()=>{Ln(),Rn(),zn(),Bn(),vr(),yr(),Vn(),Hn(),Un(),Wn(),Gn(),Kn(),qn(),Jn(),Yn(),Xn(),Zn(),Qn(),tr(),nr(),rr(),ir(),or(),sr(),cr(),lr(),ur(),dr(),gr(),er(),fr(),$n(),pr(),mr(),ar(),hr(),_r(),br()}));function Sr(e){let t=ue(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=de(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function Cr(e,t){let n=le(e,t);if(!n.success)throw n.error;return n.data}var wr=e((()=>{fe(),xr()}));function Tr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Er(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];Tr(a)&&Tr(i)?n[r]={...a,...i}:n[r]=i}return n}var Dr,Or=e((()=>{fe(),Fn(),In(),wr(),Dr=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(L,e=>{this._oncancel(e)}),this.setNotificationHandler(H,e=>{this._onprogress(e)}),this.setRequestHandler(V,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(J,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(F.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(Ke,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new Q(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new Q(F.InvalidParams,`Task not found: ${r}`);if(!$(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if($(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[C]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(qe,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new Q(F.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Ye,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(F.InvalidParams,`Task not found: ${e.params.taskId}`);if($(n.status))throw new Q(F.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new Q(F.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof Q?e:new Q(F.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Q.fromError(F.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),P(e)||Te(e)?this._onresponse(e):xe(e)?this._onrequest(e,t):Ce(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=Q.fromError(F.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[C]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:F.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=ye(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new Q(F.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:F.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),P(e)?n(e):n(new Q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(P(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),P(e)?r(e):r(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(F.InternalError,String(e))}}return}let i;try{let r=await this.request(e,K,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new Q(F.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},$(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new Q(F.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new Q(F.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(F.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[C]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof Q?e:new Q(F.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=le(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(Q.fromError(F.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Ge,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},Je,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Xe,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[C]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[C]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[C]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Sr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=Cr(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=Sr(e);this._notificationHandlers.set(n,n=>{let r=Cr(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&xe(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new Q(F.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new Q(F.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new Q(F.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new Q(F.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=q.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),$(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new Q(F.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if($(a.status))throw new Q(F.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=q.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),$(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}}})),kr=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ie,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:ee,int32:{type:`number`,validate:y},int64:{type:`number`,validate:b},float:{type:`number`,validate:x},double:{type:`number`,validate:x},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function ee(e){return v.lastIndex=0,v.test(e)}var te=-(2**31),ne=2**31-1;function y(e){return Number.isInteger(e)&&e<=ne&&e>=te}function b(e){return Number.isInteger(e)}function x(){return!0}var re=/[^\\]\\Z/;function ie(e){if(re.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),Ar=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;var t=re(),n=x(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),jr=n(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=kr(),r=Ar(),i=x(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}));function Mr(){let e=new Nr.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Pr.default)(e),e}var Nr,Pr,Fr,Ir=e((()=>{Nr=t(re(),1),Pr=t(jr(),1),Fr=class{constructor(e){this._ajv=e??Mr()}getValidator(e){let t=`$id`in e&&typeof e.$id==`string`?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}));function Lr(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`tools/call`:if(!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Rr(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`sampling/createMessage`:if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case`elicitation/create`:if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var zr=e((()=>{}));function Br(e){return Ee.parse(JSON.parse(e))}function Vr(e){return JSON.stringify(e)+`
|
|
2
|
+
`}var Hr,Ur=e((()=>{Fn(),Hr=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
3
|
+
`);if(e===-1)return null;let t=this._buffer.toString(`utf8`,0,e).replace(/\r$/,``);return this._buffer=this._buffer.subarray(e+1),Br(t)}clear(){this._buffer=void 0}}}));export{le as $,Ut as A,Nt as B,F as C,B as D,Re as E,Mn as F,Ht as G,dt as H,Lt as I,xe as J,Fn as K,Rt as L,ot as M,it as N,Ee as O,jn as P,S as Q,Wt as R,I as S,Ie as T,me as U,ut as V,Kt as W,ue as X,P as Y,fe as Z,an as _,Lr as a,wn as b,Ir as c,Er as d,Vt as f,rn as g,nn as h,Rr as i,xt as j,pe as k,Dr as l,kn as m,Ur as n,zr as o,zt as p,ze as q,Vr as r,Fr as s,Hr as t,Or as u,K as v,Mt as w,Cn as x,xn as y,Q as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./browser-Bd7GeBH1.js";async function r(){let e=`https://www.stickermule.com/claudecode`;return await t(e)?{type:`text`,value:`Opening sticker page in browser…`}:{type:`text`,value:`Failed to open browser. Visit: ${e}`}}e((()=>{n()}))();export{r as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(e,t){i={...i,providerId:e,buckets:t},r()}function n(e,t){i={...i,providerId:e,...t===null?{balance:void 0}:{balance:t}},r()}function r(){for(let e of a)try{e(i)}catch{}}var i,a,o=e((()=>{i={providerId:`unknown`,buckets:[]},a=new Set}));export{n,t as r,o as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./which-BBCjXfI2.js";function a(e,t){return{cmd:r(e)??e,args:t}}var o=e((()=>{i()}));function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t,n=t+`s`){return e===1?t:n}function u(e){let t=e.indexOf(`
|
|
2
|
+
`);return t===-1?e:e.slice(0,t)}function d(e,t,n=0){let r=0,i=e.indexOf(t,n);for(;i!==-1;)r++,i=e.indexOf(t,i+1);return r}function f(e){return e.replace(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function p(e){return e.replace(/\u3000/g,` `)}function m(e,t=`,`,n=g){let r=`...[truncated]`,i=``;for(let a of e){let e=i?t:``,o=e+a;if(i.length+o.length<=n)i+=o;else{let t=n-i.length-e.length-14;return t>0?i+=e+a.slice(0,t)+r:i+=r,i}}return i}function h(e,t){let n=e.split(`
|
|
3
|
+
`);return n.length<=t?e:n.slice(0,t).join(`
|
|
4
|
+
`)+`…`}var g,_,v=e((()=>{t(),g=2**21,_=class{constructor(e=g){n(this,`maxSize`,void 0),n(this,`content`,``),n(this,`isTruncated`,!1),n(this,`totalBytesReceived`,0),this.maxSize=e}append(e){let t=typeof e==`string`?e:e.toString();if(this.totalBytesReceived+=t.length,!(this.isTruncated&&this.content.length>=this.maxSize))if(this.content.length+t.length>this.maxSize){let e=this.maxSize-this.content.length;e>0&&(this.content+=t.slice(0,e)),this.isTruncated=!0}else this.content+=t}toString(){if(!this.isTruncated)return this.content;let e=this.totalBytesReceived-this.maxSize,t=Math.round(e/1024);return this.content+`\n... [output truncated - ${t}KB removed]`}clear(){this.content=``,this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}}));export{u as a,p as c,h as d,a as f,s as i,l,c as n,v as o,o as p,d as r,f as s,_ as t,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{C as r,D as i,E as a,F as o,I as s,K as c,L as l,M as u,O as d,P as ee,U as te,V as ne,X as re,Y as ie,_ as ae,_t as f,d as oe,et as se,g as ce,i as le,j as ue,k as de,l as fe,mt as pe,n as me,nt as he,o as ge,ot as _e,p as ve,q as p,rt as ye,s as be,st as xe,t as m,vt as Se,x as Ce,y as we,z as Te}from"./client-DvAL7lY8.js";import{B as Ee,D as De,H as Oe,M as ke,O as Ae,Y as je,c as Me,o as Ne,t as h,u as Pe}from"./protocols-CnYQjBlj.js";import{B as Fe,H as Ie,L as Le,c as Re,d as ze,r as Be,z as Ve}from"./serde-f76bObzR.js";import{a as He,d as Ue,l as We,m as g,o as Ge,r as Ke,s as qe,t as Je}from"./config-BSXLgwpD.js";import{C as Ye,c as Xe,f as Ze,t as Qe,v as $e}from"./dist-es-BF6bR-Ik.js";import{n as et,t as tt}from"./checksum-DgbnMdM-.js";import{C as nt,_ as rt,c as it,g as at,m as ot,n as st,o as _,t as ct,x as lt}from"./protocols-CCsohXid.js";import{a as ut,t as dt}from"./dist-es-Bfr4TzQe.js";import{n as ft,t as pt}from"./dist-es-BIjDeceU.js";import{n as mt,t as ht}from"./package-BC0bllK8.js";var v,y,b,x,gt,S,C,w,T,E,D,O,k,A,j,M,_t,vt,yt,bt,xt,St=e((()=>{o(),v=`ref`,y=-1,b=!0,x=`isSet`,gt=`PartitionResult`,S=`booleanEquals`,C=`stringEquals`,w=`getAttr`,T=`us-east-1`,E=`sigv4`,D=`sts`,O=`https://sts.{Region}.{PartitionResult#dnsSuffix}`,k={[v]:`Endpoint`},A={[v]:`Region`},j={[v]:gt},M={},_t=[A],vt={conditions:[[x,[k]],[x,_t],[`aws.partition`,_t,gt],[S,[{[v]:`UseFIPS`},b]],[S,[{[v]:`UseDualStack`},b]],[C,[A,`aws-global`]],[S,[{[v]:`UseGlobalEndpoint`},b]],[C,[A,`eu-central-1`]],[S,[{fn:w,argv:[j,`supportsDualStack`]},b]],[S,[{fn:w,argv:[j,`supportsFIPS`]},b]],[C,[A,`ap-south-1`]],[C,[A,`eu-north-1`]],[C,[A,`eu-west-1`]],[C,[A,`eu-west-2`]],[C,[A,`eu-west-3`]],[C,[A,`sa-east-1`]],[C,[A,T]],[C,[A,`us-east-2`]],[C,[A,`us-west-2`]],[C,[A,`us-west-1`]],[C,[A,`ca-central-1`]],[C,[A,`ap-southeast-1`]],[C,[A,`ap-northeast-1`]],[C,[A,`ap-southeast-2`]],[C,[{fn:w,argv:[j,`name`]},`aws-us-gov`]]],results:[[y],[`https://sts.amazonaws.com`,{authSchemes:[{name:E,signingName:D,signingRegion:T}]}],[O,{authSchemes:[{name:E,signingName:D,signingRegion:`{Region}`}]}],[y,`Invalid Configuration: FIPS and custom endpoint are not supported`],[y,`Invalid Configuration: Dualstack and custom endpoint are not supported`],[k,M],[`https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,M],[y,`FIPS and DualStack are enabled, but this partition does not support one or both`],[`https://sts.{Region}.amazonaws.com`,M],[`https://sts-fips.{Region}.{PartitionResult#dnsSuffix}`,M],[y,`FIPS is enabled but this partition does not support FIPS`],[`https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}`,M],[y,`DualStack is enabled but this partition does not support DualStack`],[O,M],[y,`Invalid Configuration: Missing Region`]]},yt=2,bt=new Int32Array([-1,1,-1,0,30,3,1,4,100000014,2,5,100000014,3,25,6,4,24,7,5,100000001,8,6,9,100000013,7,100000001,10,10,100000001,11,11,100000001,12,12,100000001,13,13,100000001,14,14,100000001,15,15,100000001,16,16,100000001,17,17,100000001,18,18,100000001,19,19,100000001,20,20,100000001,21,21,100000001,22,22,100000001,23,23,100000001,100000002,8,100000011,100000012,4,28,26,9,27,100000010,24,100000008,100000009,8,29,100000007,9,100000006,100000007,3,100000003,31,4,100000004,100000005]),xt=te.from(bt,yt,vt.conditions,vt.results)})),Ct,wt,Tt=e((()=>{m(),o(),St(),Ct=new ne({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`,`UseGlobalEndpoint`]}),wt=(e,t={})=>Ct.get(e,()=>l(xt,{endpointParams:e,logger:t.logger})),Te.aws=be}));function Et(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sts`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function N(e){return{schemeId:`aws.auth#sigv4a`,signingProperties:{name:`sts`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Dt(e){return{schemeId:`smithy.api#noAuth`}}var Ot,kt,At,jt,Mt,Nt,Pt,Ft=e((()=>{_(),pt(),p(),o(),Tt(),Ot=e=>async(t,n,r)=>{if(!r)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let i=await e(t,n,r),a=je(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let o=await c(r,{getEndpointParameterInstructions:a},t);return Object.assign(i,o)},kt=async(e,t,n)=>({operation:je(t).operation,region:await Oe(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),At=Ot(kt),jt=(e,t,n)=>r=>{let i=e(r).properties?.authSchemes;if(!i)return t(r);let a=[];for(let e of i){let{name:t,properties:o={},...s}=e,c=t.toLowerCase();t!==c&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${t}' to '${c}'`);let l;if(c===`sigv4a`){l=`aws.auth#sigv4a`;let e=i.find(e=>{let t=e.name.toLowerCase();return t!==`sigv4a`&&t.startsWith(`sigv4`)});if(ft.sigv4aDependency()===`none`&&e)continue}else if(c.startsWith(`sigv4`))l=`aws.auth#sigv4`;else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${c}'`);let u=n[l];if(!u)throw Error(`Could not find HttpAuthOption create function for '${l}'`);let d=u(r);d.schemeId=l,d.signingProperties={...d.signingProperties||{},...s,...o},a.push(d)}return a},Mt=e=>{let t=[];switch(e.operation){case`AssumeRoleWithWebIdentity`:t.push(Dt(e)),t.push(N(e));break;default:t.push(Et(e)),t.push(N(e))}return t},Nt=jt(wt,Mt,{"aws.auth#sigv4":Et,"aws.auth#sigv4a":N,"smithy.api#noAuth":Dt}),Pt=e=>{let t=at(it(e));return Object.assign(t,{authSchemePreference:Oe(e.authSchemePreference??[])})}})),It,Lt,Rt=e((()=>{It=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:`sts`}),Lt={UseGlobalEndpoint:{type:`builtInParams`,name:`useGlobalEndpoint`},UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),P,F=e((()=>{p(),P=class e extends xe{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt=e((()=>{F(),t(),zt=class e extends P{constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),n(this,`name`,`ExpiredTokenException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Bt=class e extends P{constructor(t){super({name:`MalformedPolicyDocumentException`,$fault:`client`,...t}),n(this,`name`,`MalformedPolicyDocumentException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Vt=class e extends P{constructor(t){super({name:`PackedPolicyTooLargeException`,$fault:`client`,...t}),n(this,`name`,`PackedPolicyTooLargeException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Ht=class e extends P{constructor(t){super({name:`RegionDisabledException`,$fault:`client`,...t}),n(this,`name`,`RegionDisabledException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Ut=class e extends P{constructor(t){super({name:`IDPRejectedClaimException`,$fault:`client`,...t}),n(this,`name`,`IDPRejectedClaimException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Wt=class e extends P{constructor(t){super({name:`InvalidIdentityTokenException`,$fault:`client`,...t}),n(this,`name`,`InvalidIdentityTokenException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Gt=class e extends P{constructor(t){super({name:`IDPCommunicationErrorException`,$fault:`client`,...t}),n(this,`name`,`IDPCommunicationErrorException`),n(this,`$fault`,`client`),n(this,`$retryable`,{}),Object.setPrototypeOf(this,e.prototype)}}})),qt,Jt,Yt,Xt,Zt,Qt,I,$t,en,tn,nn,L,rn,R,an,on,sn,cn,ln,un,dn,fn,z,B,pn,mn,hn,gn,_n,vn,V,yn,bn,H,xn,U,Sn,Cn,W,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,G,K,Pn,q,J,Y,Fn,In,Ln,X,Rn,zn,Z,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,Q=e((()=>{De(),Kt(),F(),qt=`Arn`,Jt=`AccessKeyId`,Yt=`AssumeRole`,Xt=`AssumedRoleId`,Zt=`AssumeRoleRequest`,Qt=`AssumeRoleResponse`,I=`AssumedRoleUser`,$t=`AssumeRoleWithWebIdentity`,en=`AssumeRoleWithWebIdentityRequest`,tn=`AssumeRoleWithWebIdentityResponse`,nn=`Audience`,L=`Credentials`,rn=`ContextAssertion`,R=`DurationSeconds`,an=`Expiration`,on=`ExternalId`,sn=`ExpiredTokenException`,cn=`IDPCommunicationErrorException`,ln=`IDPRejectedClaimException`,un=`InvalidIdentityTokenException`,dn=`Key`,fn=`MalformedPolicyDocumentException`,z=`Policy`,B=`PolicyArns`,pn=`ProviderArn`,mn=`ProvidedContexts`,hn=`ProvidedContextsListType`,gn=`ProvidedContext`,_n=`PolicyDescriptorType`,vn=`ProviderId`,V=`PackedPolicySize`,yn=`PackedPolicyTooLargeException`,bn=`Provider`,H=`RoleArn`,xn=`RegionDisabledException`,U=`RoleSessionName`,Sn=`SecretAccessKey`,Cn=`SubjectFromWebIdentityToken`,W=`SourceIdentity`,wn=`SerialNumber`,Tn=`SessionToken`,En=`Tags`,Dn=`TokenCode`,On=`TransitiveTagKeys`,kn=`Tag`,An=`Value`,jn=`WebIdentityToken`,Mn=`arn`,Nn=`accessKeySecretType`,G=`awsQueryError`,K=`client`,Pn=`clientTokenType`,q=`error`,J=`httpError`,Y=`message`,Fn=`policyDescriptorListType`,In=`smithy.ts.sdk.synthetic.com.amazonaws.sts`,Ln=`tagListType`,X=`com.amazonaws.sts`,Rn=Ae.for(In),zn=[-3,In,`STSServiceException`,0,[],[]],Rn.registerError(zn,P),Z=Ae.for(X),Bn=[-3,X,sn,{[G]:[`ExpiredTokenException`,400],[q]:K,[J]:400},[Y],[0]],Z.registerError(Bn,zt),Vn=[-3,X,cn,{[G]:[`IDPCommunicationError`,400],[q]:K,[J]:400},[Y],[0]],Z.registerError(Vn,Gt),Hn=[-3,X,ln,{[G]:[`IDPRejectedClaim`,403],[q]:K,[J]:403},[Y],[0]],Z.registerError(Hn,Ut),Un=[-3,X,un,{[G]:[`InvalidIdentityToken`,400],[q]:K,[J]:400},[Y],[0]],Z.registerError(Un,Wt),Wn=[-3,X,fn,{[G]:[`MalformedPolicyDocument`,400],[q]:K,[J]:400},[Y],[0]],Z.registerError(Wn,Bt),Gn=[-3,X,yn,{[G]:[`PackedPolicyTooLarge`,400],[q]:K,[J]:400},[Y],[0]],Z.registerError(Gn,Vt),Kn=[-3,X,xn,{[G]:[`RegionDisabledException`,403],[q]:K,[J]:403},[Y],[0]],Z.registerError(Kn,Ht),qn=[Rn,Z],Jn=[0,X,Nn,8,0],Yn=[0,X,Pn,8,0],Xn=[3,X,I,0,[Xt,qt],[0,0],2],Zn=[3,X,Zt,0,[H,U,B,z,R,En,On,on,wn,Dn,W,mn],[0,0,()=>ar,0,1,()=>sr,64,0,0,0,0,()=>or],2],Qn=[3,X,Qt,0,[L,I,V,W],[[()=>tr,0],()=>Xn,1,0]],$n=[3,X,en,0,[H,U,jn,vn,B,z,R],[0,0,[()=>Yn,0],0,()=>ar,0,1],3],er=[3,X,tn,0,[L,Cn,I,V,bn,nn,W],[[()=>tr,0],0,()=>Xn,1,0,0,0]],tr=[3,X,L,0,[Jt,Sn,Tn,an],[0,[()=>Jn,0],0,4],4],nr=[3,X,_n,0,[Mn],[0]],rr=[3,X,gn,0,[pn,rn],[0,0]],ir=[3,X,kn,0,[dn,An],[0,0],2],ar=[1,X,Fn,0,()=>nr],or=[1,X,hn,0,()=>rr],sr=[1,X,Ln,0,()=>ir],cr=[9,X,Yt,0,()=>Zn,()=>Qn],lr=[9,X,$t,0,()=>$n,()=>er]})),ur,dr=e((()=>{_(),ct(),pt(),Qe(),tt(),p(),h(),Be(),Ft(),Tt(),Q(),ur=e=>({apiVersion:`2011-06-15`,base64Decoder:e?.base64Decoder??Ie,base64Encoder:e?.base64Encoder??Ve,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??wt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Nt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new nt},{schemeId:`aws.auth#sigv4a`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4a`),signer:new lt},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Xe}],logger:e?.logger??new re,protocol:e?.protocol??st,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.sts`,errorTypeRegistries:qn,xmlNamespace:`https://sts.amazonaws.com/doc/2011-06-15/`,version:`2011-06-15`,serviceTarget:`AWSSecurityTokenServiceV20110615`},serviceId:e?.serviceId??`STS`,sha256:e?.sha256??et,signerConstructor:e?.signerConstructor??ft,urlParser:e?.urlParser??Ee,utf8Decoder:e?.utf8Decoder??Fe,utf8Encoder:e?.utf8Encoder??Le})})),fr,pr=e((()=>{ht(),m(),_(),Qe(),p(),Je(),i(),Be(),dt(),dr(),fr=e=>{ye(process.version);let t=Ke(e),n=()=>t().then(_e),r=ur(e);Se(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??g(rt,i),bodyLengthChecker:e?.bodyLengthChecker??ze,defaultUserAgentProvider:e?.defaultUserAgentProvider??oe({serviceId:r.serviceId,clientVersion:mt.version}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:t=>t.getIdentityProvider(`aws.auth#sigv4`)||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new nt},{schemeId:`aws.auth#sigv4a`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4a`),signer:new lt},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Xe}],maxAttempts:e?.maxAttempts??g(d,e),region:e?.region??g(qe,{...Ge,...i}),requestHandler:ut.create(e?.requestHandler??n),retryMode:e?.retryMode??g({...de,default:async()=>(await n()).retryMode||u},e),sigv4aSigningRegionSet:e?.sigv4aSigningRegionSet??g(ot,i),streamCollector:e?.streamCollector??Re,useDualstackEndpoint:e?.useDualstackEndpoint??g(Ue,i),useFipsEndpoint:e?.useFipsEndpoint??g(We,i),userAgentAppId:e?.userAgentAppId??g(fe,i)}}})),mr,hr,gr=e((()=>{mr=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},hr=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),_r,vr=e((()=>{m(),p(),h(),gr(),_r=(e,t)=>{let n=Object.assign(me(e),se(e),Me(e),mr(e));return t.forEach(e=>e.configure(n)),Object.assign(e,le(n),he(n),Pe(n),hr(n))}})),$,yr=e((()=>{m(),Qe(),p(),Je(),o(),h(),i(),De(),Ft(),Rt(),pr(),vr(),t(),$=class extends pe{constructor(...[e]){let t=fr(e||{});super(t),n(this,`config`,void 0),this.initConfig=t;let i=_r(Pt(s(r(He(ue(ce(It(t))))))),e?.extensions||[]);this.config=i,this.middlewareStack.use(ke(this.config)),this.middlewareStack.use(ve(this.config)),this.middlewareStack.use(a(this.config)),this.middlewareStack.use(Ne(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(we(this.config)),this.middlewareStack.use(ae(this.config)),this.middlewareStack.use(Ye(this.config,{httpAuthSchemeParametersProvider:At,identityProviderConfigProvider:async e=>new Ze({"aws.auth#sigv4":e.credentials,"aws.auth#sigv4a":e.credentials})})),this.middlewareStack.use($e(this.config))}destroy(){super.destroy()}}})),br,xr,Sr,Cr=e((()=>{p(),o(),Rt(),br=ie(Lt,`AWSSecurityTokenServiceV20110615`,`STSClient`,ee),xr={},Sr=(e,t,n,r)=>[]})),wr,Tr=e((()=>{Cr(),Q(),wr=class extends br(xr,Sr,`AssumeRole`,cr){}})),Er,Dr=e((()=>{Cr(),Q(),Er=class extends br(xr,Sr,`AssumeRoleWithWebIdentity`,lr){}})),Or=e((()=>{})),kr=e((()=>{Tr(),Dr()})),Ar=e((()=>{})),jr,Mr,Nr,Pr,Fr,Ir=e((()=>{m(),Tr(),Dr(),jr=e=>{if(typeof e?.Arn==`string`){let t=e.Arn.split(`:`);if(t.length>4&&t[4]!==``)return t[4]}},Mr=async(e,t,n,r={})=>{let i=typeof e==`function`?await e():e,a=typeof t==`function`?await t():t,o=``,s=i??a??(o=await ge(r)());return n?.debug?.(`@aws-sdk/client-sts::resolveRegion`,`accepting first of:`,`${i} (credential provider clientConfig)`,`${a} (contextual client)`,`${o} (STS default: AWS_REGION, profile region, or us-east-1)`),s},Nr=(e,t)=>{let n,r;return async(i,a)=>{if(r=i,!n){let{logger:i=e?.parentClientConfig?.logger,profile:a=e?.parentClientConfig?.profile,region:o,requestHandler:s=e?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:l=e?.parentClientConfig?.userAgentAppId}=e,u=await Mr(o,e?.parentClientConfig?.region,c,{logger:i,profile:a}),d=!Fr(s);n=new t({...e,userAgentAppId:l,profile:a,credentialDefaultProvider:()=>async()=>r,region:u,requestHandler:d?s:void 0,logger:i})}let{Credentials:o,AssumedRoleUser:s}=await n.send(new wr(a));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${a.RoleArn}`);let c=jr(s),l={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};return f(l,`CREDENTIALS_STS_ASSUME_ROLE`,`i`),l}},Pr=(e,t)=>{let n;return async r=>{if(!n){let{logger:r=e?.parentClientConfig?.logger,profile:i=e?.parentClientConfig?.profile,region:a,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:s,userAgentAppId:c=e?.parentClientConfig?.userAgentAppId}=e,l=await Mr(a,e?.parentClientConfig?.region,s,{logger:r,profile:i}),u=!Fr(o);n=new t({...e,userAgentAppId:c,profile:i,region:l,requestHandler:u?o:void 0,logger:r})}let{Credentials:i,AssumedRoleUser:a}=await n.send(new Er(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);let o=jr(a),s={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...o&&{accountId:o}};return o&&f(s,`RESOLVED_ACCOUNT_ID`,`T`),f(s,`CREDENTIALS_STS_ASSUME_ROLE_WEB_ID`,`k`),s}},Fr=e=>e?.metadata?.handlerProtocol===`h2`})),Lr,Rr,zr,Br=e((()=>{Ir(),yr(),Lr=(e,t)=>t?class extends e{constructor(e){super(e);for(let e of t)this.middlewareStack.use(e)}}:e,Rr=(e={},t)=>Nr(e,Lr($,t)),zr=(e={},t)=>Pr(e,Lr($,t))}));e((()=>{yr(),Or(),kr(),Q(),Kt(),Ar(),Br(),F()}))();export{Rr as getDefaultRoleAssumer,zr as getDefaultRoleAssumerWithWebIdentity};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./subprocessEnv-vrwzMgKn.js";t();export{e as registerUpstreamProxyEnvFn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";function r(e){o=e}function i(){let e=o?.()??{};if(!t(process.env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB))return Object.keys(e).length>0?{...process.env,...e}:process.env;let n={...process.env,...e};for(let e of a)delete n[e],delete n[`INPUT_${e}`];return n}var a,o,s=e((()=>{n(),a=[`ANTHROPIC_API_KEY`,`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_AUTH_TOKEN`,`ANTHROPIC_FOUNDRY_API_KEY`,`ANTHROPIC_CUSTOM_HEADERS`,`OTEL_EXPORTER_OTLP_HEADERS`,`OTEL_EXPORTER_OTLP_LOGS_HEADERS`,`OTEL_EXPORTER_OTLP_METRICS_HEADERS`,`OTEL_EXPORTER_OTLP_TRACES_HEADERS`,`AWS_SECRET_ACCESS_KEY`,`AWS_SESSION_TOKEN`,`AWS_BEARER_TOKEN_BEDROCK`,`GOOGLE_APPLICATION_CREDENTIALS`,`AZURE_CLIENT_SECRET`,`AZURE_CLIENT_CERTIFICATE_PATH`,`ACTIONS_ID_TOKEN_REQUEST_TOKEN`,`ACTIONS_ID_TOKEN_REQUEST_URL`,`ACTIONS_RUNTIME_TOKEN`,`ACTIONS_RUNTIME_URL`,`ALL_INPUTS`,`OVERRIDE_GITHUB_TOKEN`,`DEFAULT_WORKFLOW_TOKEN`,`SSH_SIGNING_KEY`]}));export{r as n,i as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import n from"node:process";import r from"node:os";import i from"node:tty";var a=t({createSupportsColor:()=>u,default:()=>p});function o(e,t=globalThis.Deno?globalThis.Deno.args:n.argv){let r=e.startsWith(`-`)?``:e.length===1?`-`:`--`,i=t.indexOf(r+e),a=t.indexOf(`--`);return i!==-1&&(a===-1||i<a)}function s(){if(!(`FORCE_COLOR`in d))return;if(d.FORCE_COLOR===`true`)return 1;if(d.FORCE_COLOR===`false`)return 0;if(d.FORCE_COLOR.length===0)return 1;let e=Math.min(Number.parseInt(d.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}function c(e){return e!==0&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,{streamIsTTY:t,sniffFlags:i=!0}={}){let a=s();a!==void 0&&(f=a);let c=i?f:a;if(c===0)return 0;if(i){if(o(`color=16m`)||o(`color=full`)||o(`color=truecolor`))return 3;if(o(`color=256`))return 2}if(`TF_BUILD`in d&&`AGENT_NAME`in d)return 1;if(e&&!t&&c===void 0)return 0;let l=c||0;if(d.TERM===`dumb`)return l;if(n.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in d)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in d)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in d)||d.CI_NAME===`codeship`?1:l;if(`TEAMCITY_VERSION`in d)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION);if(d.COLORTERM===`truecolor`||d.TERM===`xterm-kitty`||d.TERM===`xterm-ghostty`||d.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in d){let e=Number.parseInt((d.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(d.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(d.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)||`COLORTERM`in d?1:l}function u(e,t={}){return c(l(e,{streamIsTTY:e&&e.isTTY,...t}))}var d,f,p,m=e((()=>{({env:d}=n),o(`no-color`)||o(`no-colors`)||o(`color=false`)||o(`color=never`)?f=0:(o(`color`)||o(`colors`)||o(`color=true`)||o(`color=always`))&&(f=1),p={stdout:u({isTTY:i.isatty(1)}),stderr:u({isTTY:i.isatty(2)})}}));export{m as n,a as r,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{St as t,c as n,en as r,f as i,fr as a}from"./state-4KQ3kaqz.js";function o(e,t){return{name:e,compute:t,cacheBreak:!1}}function s(e,t,n){return{name:e,compute:t,cacheBreak:!0}}async function c(e){let n=t();return Promise.all(e.map(async e=>{if(!e.cacheBreak&&n.has(e.name))return n.get(e.name)??null;let t=await e.compute();return a(e.name,t),t}))}function l(){i(),n()}var u=e((()=>{r()}));export{o as a,c as i,l as n,u as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./systemPromptSections-CgpggIYX.js";t();export{e as clearSystemPromptSections};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return i===void 0&&(i=r()??`dark`),i}function n(e){return e===`auto`?t():e}function r(){let e=process.env.COLORFGBG;if(!e)return;let t=e.split(`;`),n=t[t.length-1];if(n===void 0||n===``)return;let r=Number(n);if(!(!Number.isInteger(r)||r<0||r>15))return r<=6||r===8?`dark`:`light`}var i,a=e((()=>{}));export{n,a as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,di as i,fi as a,t as o,ui as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{en as u,ht as d}from"./state-4KQ3kaqz.js";import{Er as f,Nb as p,Pb as m,jr as h,pr as g,xi as _}from"./loadAgentsDir-nzr38hai.js";import{D as v,E as y,Y as b}from"./log-B3eB4EFv.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{r as C,t as w}from"./sanitization-DV-94a9Z.js";function T({tagName:e,onConfirm:t,onCancel:i}){return(0,A.jsx)(c,{title:`Remove tag?`,subtitle:`Current tag: #${e}`,onCancel:i,color:`warning`,children:(0,A.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,A.jsx)(r,{children:`This will remove the tag from the current session.`}),(0,A.jsx)(p,{onChange:e=>e===`yes`?t():i(),options:[{label:`Yes, remove tag`,value:`yes`},{label:`No, keep tag`,value:`no`}]})]})})}function E({tagName:e,onDone:t}){let[n,r]=k.useState(!1),[i,a]=k.useState(null),o=C(e).trim();return k.useEffect(()=>{let e=d();if(!e){t(`No active session to tag`,{display:`system`});return}if(!o){t(`Tag name cannot be empty`,{display:`system`});return}a(e);let n=g(e);n===o?(S(`tengu_tag_command_remove_prompt`,{}),r(!0)):(S(`tengu_tag_command_add`,{is_replacing:!!n}),(async()=>{let n=f();await _(e,o,n),t(`Tagged session with ${s.cyan(`#${o}`)}`,{display:`system`})})())},[o,t]),n&&i?(0,A.jsx)(T,{tagName:o,onConfirm:async()=>{S(`tengu_tag_command_remove_confirmed`,{});let e=f();await _(i,``,e),t(`Removed tag ${s.cyan(`#${o}`)}`,{display:`system`})},onCancel:()=>{S(`tengu_tag_command_remove_cancelled`,{}),t(`Kept tag ${s.cyan(`#${o}`)}`,{display:`system`})}}):null}function D({onDone:e}){return k.useEffect(()=>{e(`Usage: /tag <tag-name>
|
|
2
|
+
|
|
3
|
+
Toggle a searchable tag on the current session.
|
|
4
|
+
Run the same command again to remove the tag.
|
|
5
|
+
Tags are displayed after the branch name in /resume and can be searched with /.
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
/tag bugfix # Add tag
|
|
9
|
+
/tag bugfix # Remove tag (toggle)
|
|
10
|
+
/tag feature-auth
|
|
11
|
+
/tag wip`,{display:`system`})},[e]),null}async function O(e,t,n){return n=n?.trim()||``,v.includes(n)||y.includes(n)||!n?(0,A.jsx)(D,{onDone:e}):(0,A.jsx)(E,{tagName:n,onDone:e})}var k,A;e((()=>{i(),k=t(a(),1),u(),m(),o(),b(),x(),w(),h(),A=l()}))();export{O as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./BackgroundTasksDialog-Dvhcgahe.js";async function a(e,t){return(0,o.jsx)(i,{toolUseContext:t,onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Kv as e,Yv as t,Zv as n,ey as r,qv as i}from"./loadAgentsDir-nzr38hai.js";i();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,n as teleportResumeCodeSession,r as validateGitState};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{ID as r,LD as i,g as a,h as o,m as s}from"./loadAgentsDir-nzr38hai.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=o(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let r;try{r=p(n)}catch{continue}for(let a of r){if(!a.endsWith(`.md`))continue;let r=c(a,`.md`);if(t.has(r))continue;t.add(r);let o=l(n,a);try{let{frontmatter:t,content:n}=i(f(o,`utf-8`),o),a=(typeof t.description==`string`?t.description:``)||s(n,`No description`);e.push({name:r,description:a,filePath:o,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{r(),n(),a()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,a+`
|
|
2
|
+
`,`utf-8`)}catch{m(i,a+`
|
|
3
|
+
`,`utf-8`)}let o={...r,updatedAt:new Date().toISOString()};return m(l(n,`state.json`),JSON.stringify(o,null,2),`utf-8`),!0}var T=e((()=>{n()}));async function E(e){let t=e[0];switch(t){case`list`:k();break;case`new`:A(e.slice(1));break;case`reply`:j(e.slice(1));break;case`status`:O(e.slice(1));break;default:console.error(`Unknown template command: ${t}`),D(),process.exitCode=1}}function D(){console.log(`
|
|
4
|
+
Template Job Commands:
|
|
5
|
+
|
|
6
|
+
claude job list List available templates
|
|
7
|
+
claude job new <template> [args] Create a new job from a template
|
|
8
|
+
claude job reply <job-id> <text> Reply to an existing job
|
|
9
|
+
claude job status <job-id> Show job status
|
|
10
|
+
`)}function O(e){let t=e[0];if(!t){console.error(`Usage: claude job status <job-id>`),process.exitCode=1;return}let n=C(t);if(!n){console.error(`Job not found: ${t}`),process.exitCode=1;return}console.log(`Job: ${n.jobId}`),console.log(` Template: ${n.templateName}`),console.log(` Status: ${n.status}`),console.log(` Created: ${n.createdAt}`),console.log(` Updated: ${n.updatedAt}`),console.log(` Args: ${n.args.join(` `)||`(none)`}`)}function k(){let e=_();if(e.length===0){console.log(`No templates found.`),console.log(`Place .md files in .claude/templates/ or ~/.claude/templates/`);return}console.log(`${e.length} template${e.length>1?`s`:``} found:\n`);for(let t of e)console.log(` ${t.name}`),console.log(` ${t.description}`),console.log(` Path: ${t.filePath}`),console.log()}function A(e){let t=e[0];if(!t){console.error(`Usage: claude job new <template> [args...]`),process.exitCode=1;return}let n=v(t);if(!n){console.error(`Template not found: ${t}`),console.log(`
|
|
11
|
+
Available templates:`);for(let e of _())console.log(` ${e.name}`);process.exitCode=1;return}let r=h().slice(0,8),i=e.slice(1).join(` `),a=S(r,t,`---\n${Object.entries(n.frontmatter).map(([e,t])=>`${e}: ${t}`).join(`
|
|
12
|
+
`)}\n---\n${n.content}`,i,e.slice(1));console.log(`Job created: ${r}`),console.log(` Template: ${t}`),console.log(` Directory: ${a}`),i&&console.log(` Input: ${i}`)}function j(e){let t=e[0],n=e.slice(1).join(` `);if(!t||!n){console.error(`Usage: claude job reply <job-id> <text>`),process.exitCode=1;return}if(!C(t)){console.error(`Job not found: ${t}`),process.exitCode=1;return}w(t,n)?(console.log(`Reply added to job ${t}`),console.log(` Directory: ${x(t)}`)):(console.error(`Failed to append reply to job ${t}`),process.exitCode=1)}e((()=>{y(),T()}))();export{E as templatesMain};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,j as a,t as o,ui as s}from"./src-CDCSSo0U2.js";import{n as c,t as l}from"./cwd-BuJhkTrc.js";import{D as u,E as d,K as f,O as ee,U as p,_ as te,h as ne}from"./debug-IKW-jE7K.js";import{Jt as m,Zt as re}from"./settings-5PQdphqC.js";import{b as h,c as g,g as _,o as v,y}from"./config-C7YHKCPV.js";import{r as b,t as x}from"./execFileNoThrow-COKYqVQj.js";import{o as S,s as C}from"./log-B3eB4EFv.js";import{i as ie,o as ae}from"./platform-EtecGacO.js";import{f as oe,m as se}from"./file-D1cN3LMK.js";import{d as ce,o as le,s as w}from"./types-a7X-tJpJ.js";import{r as ue,t as T}from"./completionCache-BQaLkB4d.js";import{homedir as E,platform as D}from"os";import{dirname as de,join as O}from"path";import{randomBytes as k}from"crypto";import{copyFile as A,mkdir as j,readFile as M,stat as N,writeFile as P}from"fs/promises";import{pathToFileURL as fe}from"url";function F(){let e=ne().existsSync(O(l(),`CLAUDE.md`)),t=se(l());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`claudemd`,text:`Run /init to create a CLAUDE.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function I(){return F().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function L(){v().hasCompletedProjectOnboarding||I()&&y(e=>({...e,hasCompletedProjectOnboarding:!0}))}function R(){y(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),_(),c(),oe(),te(),z=t(()=>{let e=v();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!I()})}));function pe(e){h(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function V(){h(e=>({...e,appleTerminalSetupInProgress:!1}))}function me(){let e=g();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function H(){return O(E(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function he(){let e=H(),t=`${e}.bak`;try{let{code:n}=await x(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await N(e)}catch{return null}return await x(`defaults`,[`export`,`com.apple.Terminal`,t]),pe(t),t}catch(e){return C(e),null}}async function U(){let{inProgress:e,backupPath:t}=me();if(!e)return{status:`no_backup`};if(!t)return V(),{status:`no_backup`};try{await N(t)}catch{return V(),{status:`no_backup`}}try{let{code:e}=await x(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await x(`killall`,[`cfprefsd`]),V(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return C(Error(`Failed to restore Terminal.app settings with: ${e}`)),V(),{status:`failed`,backupPath:t}}}var W=e((()=>{_(),b(),S()}));function ge(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function _e(){return!m.terminal||!(m.terminal in $)?null:$[m.terminal]??null}function G(e){return r()?`\x1b]8;;${fe(e).href}\x07${e}\x1b]8;;\x07`:e}function K(){return D()===`darwin`&&m.terminal===`Apple_Terminal`||m.terminal===`vscode`||m.terminal===`cursor`||m.terminal===`windsurf`||m.terminal===`alacritty`||m.terminal===`zed`}async function q(e){let t=``;switch(m.terminal){case`Apple_Terminal`:t=await xe(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await Se(e);break;case`zed`:t=await Ce(e);break;case null:break}return h(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(m.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:m.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),L(),process.env.USER_TYPE===`ant`&&(t+=await ue(e)),t}function ve(){return g().shiftEnterKeyBindingInstalled===!0}function ye(){return g().hasUsedBackslashReturn===!0}function J(){g().hasUsedBackslashReturn||h(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(m.terminal&&m.terminal in $)return e(`Shift+Enter is natively supported in ${$[m.terminal]}.
|
|
2
|
+
|
|
3
|
+
No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!K()){let t=m.terminal||`your current terminal`,n=ie(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
|
|
4
|
+
`:n===`windows`&&(r=` • Windows: Windows Terminal
|
|
5
|
+
`),e(`Terminal setup cannot be run from ${t}.
|
|
6
|
+
|
|
7
|
+
This command configures a convenient Shift+Enter shortcut for multi-line prompts.
|
|
8
|
+
${s.dim(`Note: You can already use backslash (\\\\) + return to add newlines.`)}
|
|
9
|
+
|
|
10
|
+
To set up the shortcut (optional):
|
|
11
|
+
1. Exit tmux/screen temporarily
|
|
12
|
+
2. Run /terminal-setup directly in one of these terminals:
|
|
13
|
+
${r} • IDE: VSCode, Cursor, Windsurf, Zed
|
|
14
|
+
• Other: Alacritty
|
|
15
|
+
3. Return to tmux/screen - settings will persist
|
|
16
|
+
|
|
17
|
+
${s.dim(`Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.`)}`),null}return e(await q(t.options.theme)),null}async function Y(e=`VSCode`,t){if(ge())return`${a(`warning`,t)(`Cannot install keybindings from a remote ${e} session.`)}${Q}${Q}${e} keybindings must be installed on your local machine, not the remote server.${Q}${Q}To install the Shift+Enter keybinding:${Q}1. Open ${e} on your local machine (not connected to remote)${Q}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${Q}3. Add this keybinding (the file must be a JSON array):${Q}${Q}${s.dim(`[
|
|
18
|
+
{
|
|
19
|
+
"key": "shift+enter",
|
|
20
|
+
"command": "workbench.action.terminal.sendSequence",
|
|
21
|
+
"args": { "text": "\\u001b\\r" },
|
|
22
|
+
"when": "terminalFocus"
|
|
23
|
+
}
|
|
24
|
+
]`)}${Q}`;let n=e===`VSCode`?`Code`:e,r=O(E(),D()===`win32`?O(`AppData`,`Roaming`,n,`User`):D()===`darwin`?O(`Library`,`Application Support`,n,`User`):O(`.config`,n,`User`)),i=O(r,`keybindings.json`);try{await j(r,{recursive:!0});let n=`[]`,o=[],c=!1;try{n=await M(i,{encoding:`utf-8`}),c=!0,o=ce(n)??[]}catch(e){if(!f(e))throw e}if(c){let n=`${i}.${k(4).toString(`hex`)}.bak`;try{await A(i,n)}catch{return`${a(`warning`,t)(`Error backing up existing ${e} terminal keybindings. Bailing out.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}return o.find(e=>e.key===`shift+enter`&&e.command===`workbench.action.terminal.sendSequence`&&e.when===`terminalFocus`)?`${a(`warning`,t)(`Found existing ${e} terminal Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`:(await P(i,le(n,{key:`shift+enter`,command:`workbench.action.terminal.sendSequence`,args:{text:`\x1B\r`},when:`terminalFocus`}),{encoding:`utf-8`}),`${a(`success`,t)(`Installed ${e} terminal Shift+Enter key binding`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`)}catch(t){throw C(t),Error(`Failed to install ${e} terminal Shift+Enter key binding`)}}async function X(e){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':useOptionAsMetaKey bool true`,H()]);if(t!==0){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':useOptionAsMetaKey true`,H()]);if(t!==0)return C(Error(`Failed to enable Option as Meta key for Terminal.app profile: ${e}`)),!1}return!0}async function Z(e){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':Bell bool false`,H()]);if(t!==0){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':Bell false`,H()]);if(t!==0)return C(Error(`Failed to disable audio bell for Terminal.app profile: ${e}`)),!1}return!0}async function xe(e){try{if(!await he())throw Error(`Failed to create backup of Terminal.app preferences, bailing out`);let{stdout:t,code:n}=await x(`defaults`,[`read`,`com.apple.Terminal`,`Default Window Settings`]);if(n!==0||!t.trim())throw Error(`Failed to read default Terminal.app profile`);let{stdout:r,code:i}=await x(`defaults`,[`read`,`com.apple.Terminal`,`Startup Window Settings`]);if(i!==0||!r.trim())throw Error(`Failed to read startup Terminal.app profile`);let o=!1,c=t.trim(),l=await X(c),u=await Z(c);(l||u)&&(o=!0);let d=r.trim();if(d!==c){let e=await X(d),t=await Z(d);(e||t)&&(o=!0)}if(!o)throw Error(`Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile`);return await x(`killall`,[`cfprefsd`]),V(),`${a(`success`,e)(`Configured Terminal.app settings:`)}${Q}${a(`success`,e)(`- Enabled "Use Option as Meta key"`)}${Q}${a(`success`,e)(`- Switched to visual bell`)}${Q}${s.dim(`Option+Enter will now enter a newline.`)}${Q}${s.dim(`You must restart Terminal.app for changes to take effect.`,e)}${Q}`}catch(e){C(e);let t=await U(),n=`Failed to enable Option as Meta key for Terminal.app.`;throw t.status===`restored`?Error(`${n} Your settings have been restored from backup.`):t.status===`failed`?Error(`${n} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${t.backupPath}`):Error(`${n} No backup was available to restore from.`)}}async function Se(e){let t=[],n=process.env.XDG_CONFIG_HOME;if(n?t.push(O(n,`alacritty`,`alacritty.toml`)):t.push(O(E(),`.config`,`alacritty`,`alacritty.toml`)),D()===`win32`){let e=process.env.APPDATA;e&&t.push(O(e,`alacritty`,`alacritty.toml`))}let r=null,i=``,o=!1;for(let e of t)try{i=await M(e,{encoding:`utf-8`}),r=e,o=!0;break}catch(e){if(!f(e))throw e}if(r||(r=t[0]??null),!r)throw Error(`No valid config path found for Alacritty`);try{if(o){if(i.includes(`mods = "Shift"`)&&i.includes(`key = "Return"`))return`${a(`warning`,e)(`Found existing Alacritty Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`;let t=k(4).toString(`hex`),n=`${r}.${t}.bak`;try{await A(r,n)}catch{return`${a(`warning`,e)(`Error backing up existing Alacritty config. Bailing out.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}else await j(de(r),{recursive:!0});let t=i;return i&&!i.endsWith(`
|
|
25
|
+
`)&&(t+=`
|
|
26
|
+
`),t+=`
|
|
27
|
+
[[keyboard.bindings]]
|
|
28
|
+
key = "Return"
|
|
29
|
+
mods = "Shift"
|
|
30
|
+
chars = "\\u001B\\r"
|
|
31
|
+
`,await P(r,t,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${a(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`}catch(e){throw C(e),Error(`Failed to install Alacritty Shift+Enter key binding`)}}async function Ce(e){let t=O(E(),`.config`,`zed`),n=O(t,`keymap.json`);try{await j(t,{recursive:!0});let r=`[]`,i=!1;try{r=await M(n,{encoding:`utf-8`}),i=!0}catch(e){if(!f(e))throw e}if(i){if(r.includes(`shift-enter`))return`${a(`warning`,e)(`Found existing Zed Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`;let t=`${n}.${k(4).toString(`hex`)}.bak`;try{await A(n,t)}catch{return`${a(`warning`,e)(`Error backing up existing Zed keymap. Bailing out.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}${s.dim(`Backup path: ${G(t)}`)}${Q}`}}let o;try{o=u(r),Array.isArray(o)||(o=[])}catch{o=[]}return o.push({context:`Terminal`,bindings:{"shift-enter":[`terminal::SendText`,`\x1B\r`]}}),await P(n,ee(o,null,2)+`
|
|
32
|
+
`,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Zed Shift+Enter key binding`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`}catch(e){throw C(e),Error(`Failed to install Zed Shift+Enter key binding`)}}var Q,$,we=e((()=>{i(),o(),B(),W(),T(),_(),re(),p(),b(),w(),S(),ae(),d(),Q=`
|
|
33
|
+
`,$={ghostty:`Ghostty`,kitty:`Kitty`,"iTerm.app":`iTerm2`,WezTerm:`WezTerm`,WarpTerminal:`Warp`}}));export{ve as a,K as c,F as d,R as f,z as h,we as i,U as l,L as m,_e as n,J as o,B as p,ye as r,q as s,be as t,W as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-C0PF87iu.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
|