@readmagic/workmate 0.0.1 → 0.0.3
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 → AddWorkspaceDirectory-mANiG0xj.js} +1 -1
- package/dist/chunks/{App-DY5O6IKw.js → App-aUVaOLeo.js} +1 -1
- package/dist/chunks/{ApproveApiKey-BEzfC6r3.js → ApproveApiKey-36iUE5CW.js} +1 -1
- package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-Ce3PraaD.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-B68V1bCq.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CTWhpIm8.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
- package/dist/chunks/{DesktopHandoff-BRbU4is4.js → DesktopHandoff-Blg1TVut.js} +1 -1
- package/dist/chunks/{DiffDialog-CBluIK-x.js → DiffDialog-CUEpuocY.js} +2 -2
- package/dist/chunks/Doctor-B540I-gq.js +1 -0
- package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
- package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
- package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
- package/dist/chunks/{Grove--kttLxvs.js → Grove-D9lSG_Lh.js} +1 -1
- package/dist/chunks/Grove-DLYXL8hv.js +1 -0
- package/dist/chunks/{HybridTransport-BgV5_7Az.js → HybridTransport-8j0AviF6.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-DCGwXW_p.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-jTwsdXWr.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
- package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
- package/dist/chunks/{McpParsingWarnings-WQrWJeWP.js → McpParsingWarnings-D0XvLirX.js} +1 -1
- package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
- package/dist/chunks/Messages-Dv2VrytX.js +11 -0
- package/dist/chunks/{Onboarding-BoIVNCgc.js → Onboarding-B1WRpoBI.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-1FCN8bH3.js → OverageCreditUpsell-BSmgq089.js} +1 -1
- package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-CrGST0Cq.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-B2TDpbpw.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
- package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
- package/dist/chunks/REPL-B3RbzeV7.js +1 -0
- package/dist/chunks/{REPL-BV4WyYMg.js → REPL-CA8FEO7J.js} +44 -44
- package/dist/chunks/{RemoteCallout-DS_EV6Fh.js → RemoteCallout-BFzCx_Pn.js} +1 -1
- package/dist/chunks/RemoteSessionManager-BhUrtejX.js +2 -0
- package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
- package/dist/chunks/{SSETransport-BXiEBMpb.js → SSETransport-DGIytG74.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
- package/dist/chunks/Settings-BvhG1XoW.js +2 -0
- package/dist/chunks/{TeleportProgress-CcDzMC5L.js → TeleportProgress-Bens06DU.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DZbxl4sD.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-EowJO5nm.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
- package/dist/chunks/{ThemePicker-BYbChJpu.js → ThemePicker-BTfuZZ7E.js} +1 -1
- package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
- package/dist/chunks/{ValidationErrorsList-Cx-hoRwG.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
- package/dist/chunks/WelcomeV2-C93xQYAF.js +1 -0
- package/dist/chunks/{add-dir-CWt69NAZ.js → add-dir-C3IhJYVH.js} +1 -1
- package/dist/chunks/{agentDisplay-CQ4mZWFH.js → agentDisplay-Cju-aXCx.js} +1 -1
- package/dist/chunks/{agents-D4clhuCl.js → agents-Bhg0CtXR.js} +7 -7
- package/dist/chunks/{agents-C6jzKOit.js → agents-Du3FQ82k.js} +1 -1
- package/dist/chunks/{allErrors-HMPqE0jK.js → allErrors-DJYCAtab.js} +1 -1
- package/dist/chunks/{ant-9Z5bppVC.js → ant-CVvy4SuO.js} +1 -1
- package/dist/chunks/api-CI8HXREw.js +1 -0
- package/dist/chunks/api-gJBnC8z3.js +1 -0
- package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
- package/dist/chunks/{asciicast-n-BBfgDq.js → asciicast-CbAjUHT_.js} +4 -4
- package/dist/chunks/{assistant-BA9_Mo9U.js → assistant-C83quuNj.js} +1 -1
- package/dist/chunks/{assistant-BiNOSla3.js → assistant-C_SkUDk_.js} +1 -1
- package/dist/chunks/assistant-z2o4-UJe.js +1 -0
- package/dist/chunks/auth-B9V3i5oZ.js +1 -0
- package/dist/chunks/auth-CgEABs3i.js +15 -0
- package/dist/chunks/auth-fSFfSKy_.js +1 -0
- package/dist/chunks/{autoMode-Db4QrgFr.js → autoMode-CZyb-mMY.js} +7 -7
- package/dist/chunks/{autonomy-BkAMA7du.js → autonomy-BpINX4jw.js} +1 -1
- package/dist/chunks/{autonomy-D4Vy-RPQ.js → autonomy-DJZ25xZp.js} +7 -7
- package/dist/chunks/{autonomyPanel-EjfO8jvg.js → autonomyPanel-ssoiIOx5.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-hDDE8mJC.js → backgroundHousekeeping-BHncba6e.js} +3 -3
- package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +1 -0
- package/dist/chunks/{banner-hD6wZygx.js → banner-CWkrK10u.js} +1 -1
- package/dist/chunks/bg-B0iMGM9C.js +1 -0
- package/dist/chunks/{bg-DQ0Q3Qv-.js → bg-WnYN5ifx.js} +2 -2
- package/dist/chunks/{branch-CeQ9IyZk.js → branch-BXo5z2al.js} +1 -1
- package/dist/chunks/{break-cache-Bd0clV2N.js → break-cache-BQfgkNAo.js} +2 -2
- package/dist/chunks/{bridge-yerAiaK2.js → bridge-CbKc1HeD.js} +2 -2
- package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
- package/dist/chunks/{bridgeConfig-CCtXe8ak.js → bridgeConfig-DbqUHe0H.js} +1 -1
- package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
- package/dist/chunks/{bridgeEnabled--F-6TUi4.js → bridgeEnabled-CM3SaumJ.js} +1 -1
- package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
- package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
- package/dist/chunks/bridgeMessaging-lfa_v3oi.js +1 -0
- package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
- package/dist/chunks/{browser-Bd7GeBH1.js → browser-BmZuQom6.js} +1 -1
- package/dist/chunks/{btw-CVGRmL9a.js → btw-Cp0whJaJ.js} +1 -1
- package/dist/chunks/{caches-BtmAri4e.js → caches-CmW7idg5.js} +2 -2
- package/dist/chunks/caches-CpqTC0Lb.js +1 -0
- package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
- package/dist/chunks/{claudeDesktop-aUMx06RK.js → claudeDesktop-Cx31Ugjp.js} +1 -1
- package/dist/chunks/{clear-C6nRzIQE.js → clear-DjGPxX7T.js} +1 -1
- package/dist/chunks/{cliLaunch-2AUoMnqx.js → cliLaunch-BkPAatcs.js} +1 -1
- package/dist/chunks/client-DPUvQ6Rf.js +1 -0
- package/dist/chunks/{color-DXI_4ibU.js → color-DYYBN52b.js} +1 -1
- package/dist/chunks/commands-D7l3P1k9.js +1 -0
- package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
- package/dist/chunks/{commitAttribution-Cm40fdNU.js → commitAttribution-Bmzgtqc6.js} +2 -2
- package/dist/chunks/compact-D6xqZN4Q.js +2 -0
- package/dist/chunks/{completionCache-BQaLkB4d.js → completionCache-MN3_MqK8.js} +2 -2
- package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
- package/dist/chunks/config-DiT2Z8dY.js +3 -0
- package/dist/chunks/config-huQaTcNb.js +1 -0
- package/dist/chunks/config-qLaiAn7z.js +1 -0
- package/dist/chunks/{context-C_cKrBUn.js → context-Bh_iUj76.js} +1 -1
- package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
- package/dist/chunks/{context-noninteractive-DnH6Q9Lu.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
- package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
- package/dist/chunks/conversation-CvCQta8e.js +1 -0
- package/dist/chunks/{createSSHSession--bWmmIk9.js → createSSHSession-B0s839mX.js} +5 -5
- package/dist/chunks/createSession-GNSNbUbN.js +1 -0
- package/dist/chunks/{createSession-DIr4sUp6.js → createSession-VMTMXOHu.js} +1 -1
- package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
- package/dist/chunks/cwd--nvsx73T.js +1 -0
- package/dist/chunks/{cwd-BuJhkTrc.js → cwd-CYmmnQVS.js} +1 -1
- package/dist/chunks/{daemon-B9lBPdBJ.js → daemon-YtZbMQtn.js} +1 -1
- package/dist/chunks/datadog-D9rlcN12.js +1 -0
- package/dist/chunks/{debug-IKW-jE7K.js → debug-BrXObCdR.js} +2 -2
- package/dist/chunks/{debugUtils-D2981c0Z.js → debugUtils-NO5KtXqi.js} +1 -1
- package/dist/chunks/{desktop-B5cvrcOQ.js → desktop-DidI-4N5.js} +1 -1
- package/dist/chunks/{detached-rfIUyc-B.js → detached-TYk4hMFj.js} +1 -1
- package/dist/chunks/{detectRepository-ReZ0Fz8Z.js → detectRepository-BPr0VWNO.js} +1 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
- package/dist/chunks/{diff-cXAp9cNN.js → diff-CZg5qL2n.js} +1 -1
- package/dist/chunks/{directoryCompletion-DBM2o5kx.js → directoryCompletion-CW2ckkQg.js} +1 -1
- package/dist/chunks/doctor-CKUXGCri.js +1 -0
- package/dist/chunks/{effort-Br8KKHdx.js → effort-BcvNemuq.js} +2 -2
- package/dist/chunks/entry-dA1UCfC0.js +14 -0
- package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
- package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
- package/dist/chunks/esm-DjGYYlQe.js +1 -0
- package/dist/chunks/{execFileNoThrow-COKYqVQj.js → execFileNoThrow-D244NytW.js} +1 -1
- package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
- package/dist/chunks/exit-COMnVxzw.js +1 -0
- package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
- package/dist/chunks/extra-usage-By33zGLT.js +1 -0
- package/dist/chunks/{extra-usage-core-CdL1ltqq.js → extra-usage-core-RZMzaH0L.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-DxxRI0Yx.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
- package/dist/chunks/{extraUsage-BYZdi44Y.js → extraUsage-CTn9FWSk.js} +1 -1
- package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
- package/dist/chunks/fast-BXzdzzXU.js +1 -0
- package/dist/chunks/{fast-DKqiojzf.js → fast-CNXgsvnE.js} +1 -1
- package/dist/chunks/{feedback-yB19xph5.js → feedback-DeJ2gvw2.js} +1 -1
- package/dist/chunks/{file-D1cN3LMK.js → file-DcZWPH2V.js} +5 -5
- package/dist/chunks/{files-DAzGtmzz.js → files-Cz1-PK3r.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
- package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
- package/dist/chunks/{flushGate-ZFr8yv7F.js → flushGate-CJ73xcaK.js} +1 -1
- package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
- package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
- package/dist/chunks/{generateSessionName-48veu5dv.js → generateSessionName-CGpL6ATy.js} +1 -1
- package/dist/chunks/{genericProcessUtils-F1Qcb1sO.js → genericProcessUtils-CdQTApYX.js} +1 -1
- package/dist/chunks/git-CbcnOf0E.js +1 -0
- package/dist/chunks/git-Do0wJvux.js +6 -0
- package/dist/chunks/{githubRepoPathMapping-BlR0BphY.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
- package/dist/chunks/{goal-Bn8Kz2Dp.js → goal-C8Qzl7_i.js} +3 -3
- package/dist/chunks/{grok-DhnO_KDC.js → grok-CDT9P_BL.js} +1 -1
- package/dist/chunks/{grove-DotW04-v.js → grove-BGXzEyH9.js} +2 -2
- package/dist/chunks/{heapdump-DkZSKNbp.js → heapdump-CFHvdSZv.js} +5 -5
- package/dist/chunks/{help-DU_BcZtU.js → help-DUZ7Y7Em.js} +1 -1
- package/dist/chunks/{hooks-BTMWE5Qx.js → hooks-RHwUCXcT.js} +2 -2
- package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
- package/dist/chunks/{hostGuard-Dh296c6q.js → hostGuard-C5xydXZI.js} +1 -1
- package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
- package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
- package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
- package/dist/chunks/install-OkuNmjmB.js +1 -0
- package/dist/chunks/{instrumentation-H0XRS1yG.js → instrumentation-hrXeo-G4.js} +6 -6
- package/dist/chunks/{job-DKtLkF8V.js → job-DjmIpwJl.js} +1 -1
- package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
- package/dist/chunks/keybindings-B8U17bhs.js +2 -0
- package/dist/chunks/{language-BuRSO2sR.js → language-BA5WprZv.js} +1 -1
- package/dist/chunks/language-BbaOTWm3.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-BQyPdrHp.js → launchAgentsPlatform-DnxH2SAn.js} +1 -1
- package/dist/chunks/{launchLocalMemory-CWHAj7CX.js → launchLocalMemory-CgXtGng1.js} +2 -2
- package/dist/chunks/{launchLocalVault-D8iJdtsP.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
- package/dist/chunks/{launchMemoryStores-W7jWG2uH.js → launchMemoryStores-DxVAIJuB.js} +1 -1
- package/dist/chunks/{launchOnboarding-q__LaLy1.js → launchOnboarding-Cn0t_o2k.js} +1 -1
- package/dist/chunks/{launchSchedule-BWi9F5vh.js → launchSchedule-Chwr3Nzd.js} +1 -1
- package/dist/chunks/{launchSkillStore-4wd4MQBc.js → launchSkillStore-6zxJfWVU.js} +1 -1
- package/dist/chunks/{launchTeleport-BlCf2QM_.js → launchTeleport-Ba_Hj13c.js} +1 -1
- package/dist/chunks/{launchVault-C7u7LZV7.js → launchVault-hGVrHy33.js} +1 -1
- package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
- package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
- package/dist/chunks/{loadAgentsDir-nzr38hai.js → loadAgentsDir-DrDu5yYy.js} +691 -689
- package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
- package/dist/chunks/localSearch-CebU5BA9.js +1 -0
- package/dist/chunks/{localSearch-B-L_ldos.js → localSearch-_bQhk9W6.js} +1 -1
- package/dist/chunks/{log-B3eB4EFv.js → log-BMCygSzM.js} +1 -1
- package/dist/chunks/{logoV2Utils-RQ160dI2.js → logoV2Utils-CoC4nheD.js} +1 -1
- package/dist/chunks/{magicDocs-BqZ0GewA.js → magicDocs-kMjYpjCA.js} +3 -3
- package/dist/chunks/main-C_rVSWfm.js +859 -0
- package/dist/chunks/{main-DeFMhaFE.js → main-D862LI_d.js} +3 -3
- package/dist/chunks/{mappers-CWykjGfP.js → mappers-D0CNXG32.js} +1 -1
- package/dist/chunks/mcp-1ZuFesM9.js +2 -0
- package/dist/chunks/mcp-CKvGBEjz.js +1 -0
- package/dist/chunks/mcp-DtxIl6aN.js +6 -0
- package/dist/chunks/{memoize-BO31Ws9Q.js → memoize-B0zhbT8Z.js} +1 -1
- package/dist/chunks/{memory-DcpPpYN0.js → memory-DE2jtkd_.js} +1 -1
- package/dist/chunks/{mode-BkViT_0o.js → mode-B4WIxCMW.js} +2 -2
- package/dist/chunks/model-C4RHNhDQ.js +1 -0
- package/dist/chunks/model-fi472PRc.js +1 -0
- package/dist/chunks/{model-CZktWw6o.js → model-j9GNZDFr.js} +1 -1
- package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
- package/dist/chunks/{onChangeAppState-DwGVi-BC.js → onChangeAppState-CGVeNkt7.js} +1 -1
- package/dist/chunks/{openai-B2wxZDQx.js → openai-BSVjSJiF.js} +3 -3
- package/dist/chunks/{overageCreditGrant-CjK49axw.js → overageCreditGrant-BVxlYgeU.js} +1 -1
- package/dist/chunks/{panel-R4ue6pSW.js → panel-Be-OxtqL.js} +1 -1
- package/dist/chunks/{panel-B-nrcHpm.js → panel-CrTPqXCv.js} +1 -1
- package/dist/chunks/{panelCall-I_fbgub5.js → panelCall-Cp6fpQeL.js} +1 -1
- package/dist/chunks/parser-Bf6iasPV.js +1 -0
- package/dist/chunks/{parser-CQrasoUB.js → parser-DFwaTGf7.js} +1 -1
- package/dist/chunks/{partition-CxRF7T-f.js → partition-RjCtgt9J.js} +1 -1
- package/dist/chunks/{passes-U_h-hNu-.js → passes-ByTLy6pj.js} +1 -1
- package/dist/chunks/{path-BCSE0S-c.js → path-D5U-tm91.js} +1 -1
- package/dist/chunks/permissions-B3df_htx.js +3 -0
- package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
- package/dist/chunks/{pipeTransport-D3Qx9v1V.js → pipeTransport-CqCnc-Ys.js} +1 -1
- package/dist/chunks/{plan-BAhStVci.js → plan-BxTA-b4l.js} +1 -1
- package/dist/chunks/{platform-EtecGacO.js → platform-BrYefG_2.js} +1 -1
- package/dist/chunks/{plugin-D9huNnv6.js → plugin-DOpl5e1t.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-BfmyxR5g.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
- package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
- package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
- package/dist/chunks/{pluginFlagging-BVy7Xv_0.js → pluginFlagging-3FQGvIfq.js} +1 -1
- package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
- package/dist/chunks/{pluginStartupCheck-w24D-wwk.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
- package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
- package/dist/chunks/plugins-CcDG95Bs.js +4 -0
- package/dist/chunks/policyLimits-Bwi9VqDF.js +1 -0
- package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
- package/dist/chunks/{poor-CfbMKZNJ.js → poor-DekfGNT7.js} +1 -1
- package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
- package/dist/chunks/{poorMode-Bsw2V-V_.js → poorMode-CtcqaiwD.js} +1 -1
- package/dist/chunks/print-Cc_QOSPF.js +23 -0
- package/dist/chunks/{privacy-settings-DeGoBRrZ.js → privacy-settings-ChNsgGUs.js} +1 -1
- package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
- package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
- package/dist/chunks/prompt-C0nU0VK3.js +139 -0
- package/dist/chunks/prompt-CYx145pp.js +1 -0
- package/dist/chunks/prompt-DH3lKFag.js +1 -0
- package/dist/chunks/{promptEditor-foiayhdY.js → promptEditor-Cumef6hJ.js} +2 -2
- package/dist/chunks/{protocolHandler-BsiB1oW_.js → protocolHandler-z2zxAtB1.js} +4 -4
- package/dist/chunks/{proxy-Cn2YwITp.js → proxy-CRN7jYIi.js} +3 -3
- package/dist/chunks/{rate-limit-options-DTJPDcTr.js → rate-limit-options-VL7S3SCx.js} +1 -1
- package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
- package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
- package/dist/chunks/{referral-DP_GshTS.js → referral-DrebVwqx.js} +1 -1
- package/dist/chunks/refresh-pFezssA8.js +1 -0
- package/dist/chunks/{registerProtocol-CjxlFsKw.js → registerProtocol-CukLQuxJ.js} +5 -5
- package/dist/chunks/{release-notes-BxgK8zWO.js → release-notes-D7vrFNXp.js} +1 -1
- package/dist/chunks/{releaseNotes-CbSktIJW.js → releaseNotes-CDx2P0fb.js} +2 -2
- package/dist/chunks/{reload-plugins-CDu6yU5-.js → reload-plugins-CltHfg-l.js} +1 -1
- package/dist/chunks/{remote-env-B4HnhISc.js → remote-env-SvvSuP0J.js} +1 -1
- package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
- package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
- package/dist/chunks/{rename-DlbMb24l.js → rename-CbqrCCBO.js} +1 -1
- package/dist/chunks/{renderOptions-5kWQpVr2.js → renderOptions-BUJB9nAm.js} +1 -1
- package/dist/chunks/{resume-BB5iBogS.js → resume-DockJaY9.js} +2 -2
- package/dist/chunks/{ripgrep-BvDwiKJ3.js → ripgrep-BXmXjAzA.js} +1 -1
- package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
- package/dist/chunks/{runtimeObserver-BNH2WGE3.js → runtimeObserver-DSUuYKfs.js} +1 -1
- package/dist/chunks/{runtimeObserver-Ci-5gvYg.js → runtimeObserver-XufSllVw.js} +4 -4
- package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
- package/dist/chunks/{sandbox-toggle-B2Yk4y2V.js → sandbox-toggle-CZI5fuK3.js} +1 -1
- package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
- package/dist/chunks/{session-Bmx7L3Mt.js → session-B-Z3DU9o.js} +2 -2
- package/dist/chunks/{sessionDiscovery-DcEAr5vJ.js → sessionDiscovery-C3pMZkBM.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
- package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
- package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
- package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
- package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
- package/dist/chunks/{sessionObserver-DQwHsDrM.js → sessionObserver-B_09FQKV.js} +1 -1
- package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
- package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
- package/dist/chunks/{sessionTracing-BuLsL6qA.js → sessionTracing-lArOaj9u.js} +3 -3
- package/dist/chunks/settings-DfWP5y6X.js +19 -0
- package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
- package/dist/chunks/setup-DdbmxSZh.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-7Z8ezTKF.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
- package/dist/chunks/{shellQuote-fB02N16J.js → shellQuote-DkSy9MYE.js} +1 -1
- package/dist/chunks/{sideQuestion-CYdNATPW.js → sideQuestion-BjHCLSR9.js} +1 -1
- package/dist/chunks/sinks-Cb--pqr-.js +2 -0
- package/dist/chunks/sinks-DbwDBd-E.js +1 -0
- package/dist/chunks/{skill-learning-E8tQed-Q.js → skill-learning-B0dyBT1_.js} +1 -1
- package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
- package/dist/chunks/{skillGapStore-CjJrxxjk.js → skillGapStore-75ZYlfwi.js} +2 -2
- package/dist/chunks/{skillGapStore-B5rl12bV.js → skillGapStore-D2fqmnKx.js} +1 -1
- package/dist/chunks/{skillGenerator-BDR_z3-X.js → skillGenerator-CwXUfM4Y.js} +2 -2
- package/dist/chunks/{skillLearning-BQtfFE0g.js → skillLearning-CB-5fdMl.js} +1 -1
- package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
- package/dist/chunks/{skillPanel-yR8Oi-mO.js → skillPanel-Bum7xpgo.js} +3 -3
- package/dist/chunks/{skillSearchPanel-DUQQUCUS.js → skillSearchPanel-LSPwZIOw.js} +6 -6
- package/dist/chunks/{skills-NAZQ3j-t.js → skills-G8WBeffd.js} +1 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
- package/dist/chunks/{startupProfiler-DxRQteII.js → startupProfiler-xa3NmN7Z.js} +2 -2
- package/dist/chunks/state-BOa-3Av3.js +1 -0
- package/dist/chunks/{state-4KQ3kaqz.js → state-ix0xIunV.js} +1 -1
- package/dist/chunks/{stats-h4yu84Q-.js → stats-DmFubHpI.js} +1 -1
- package/dist/chunks/{status-is_Bg_IB.js → status-ClSsvm1N.js} +2 -2
- package/dist/chunks/{status-BbdeubJG.js → status-i5beKggW.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-CQ7CUugR.js → statusNoticeHelpers-BK-54uGY.js} +1 -1
- package/dist/chunks/{stickers-qJoNhPk4.js → stickers-D5teCKMN.js} +1 -1
- package/dist/chunks/{stringUtils-CvXbHQRH.js → stringUtils-DGLPkqJ4.js} +1 -1
- package/dist/chunks/systemPromptSections-CR_AoPIX.js +1 -0
- package/dist/chunks/{systemPromptSections-CgpggIYX.js → systemPromptSections-DN0HGVye.js} +1 -1
- package/dist/chunks/{tag-i3HZ4lhj.js → tag-DYYq4H_i.js} +2 -2
- package/dist/chunks/{tasks-HzsYNTZ1.js → tasks-BySzm_YJ.js} +1 -1
- package/dist/chunks/teleport-dxtBcM01.js +1 -0
- package/dist/chunks/{templateJobs-CIv_ysje.js → templateJobs-CT5VxeRr.js} +1 -1
- package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
- package/dist/chunks/{terminalSetup-CxniwSF-.js → terminalSetup-RDKg8dVa.js} +1 -1
- package/dist/chunks/{theme-BKIHX_Dx.js → theme-CVTVsRwt.js} +1 -1
- package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
- package/dist/chunks/thinkback-CXsRbDYN.js +1 -0
- package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
- package/dist/chunks/{tmux-CbsW-VDJ.js → tmux-BY7IdQ1f.js} +1 -1
- package/dist/chunks/{toolEventObserver-B1xvyKdE.js → toolEventObserver--4fqXxQZ.js} +1 -1
- package/dist/chunks/{toolEventObserver-8FQtxeVv.js → toolEventObserver-DdhPsAs1.js} +1 -1
- package/dist/chunks/toolPool-DvHECcbN.js +1 -0
- package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
- package/dist/chunks/trustedDevice-e6iF1X7C.js +1 -0
- package/dist/chunks/{tui-fTa_pzdA.js → tui-C2yuCuOU.js} +3 -3
- package/dist/chunks/{types-a7X-tJpJ.js → types-C-MRCL8J.js} +3 -3
- package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
- package/dist/chunks/{ultrareviewCommand-DCFRZsKp.js → ultrareviewCommand-i3PfFKly.js} +2 -2
- package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
- package/dist/chunks/{undercover-CsLPQb-a.js → undercover-Q24TWRw0.js} +3 -3
- package/dist/chunks/{up-dO5BcPaq.js → up-BHkC97_C.js} +1 -1
- package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
- package/dist/chunks/{upgrade-kpttjebY.js → upgrade-7OrBbrzS.js} +1 -1
- package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
- package/dist/chunks/upload-B-lNHpWe.js +1 -0
- package/dist/chunks/{upstreamproxy-CvcjNY7J.js → upstreamproxy-DyR_eXO8.js} +4 -4
- package/dist/chunks/usage-7jOeIVv9.js +1 -0
- package/dist/chunks/{usage-CJ5w0907.js → usage-CZdPfUqP.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-yAroCqu4.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
- package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
- package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
- package/dist/chunks/{useMergedTools-CZJffsmf.js → useMergedTools-DMGRA1ga.js} +1 -1
- package/dist/chunks/{useSearchInput-C-CqUK6w.js → useSearchInput-D5VU9IDU.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BWlJCgYF.js → useSettingsErrors-B5PSF1va.js} +1 -1
- package/dist/chunks/{util-DJV0joAW.js → util-CNa1ib_4.js} +1 -1
- package/dist/chunks/validatePlugin-Dw-RGCrm.js +1 -0
- package/dist/chunks/{vim-n8-UT5w-.js → vim-C0KTnJJs.js} +1 -1
- package/dist/chunks/{which-BBCjXfI2.js → which-CKQnSouy.js} +1 -1
- package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
- package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
- package/dist/chunks/{workSecret-C_lv0dRh.js → workSecret-CNWiR2uQ.js} +1 -1
- package/dist/chunks/{workerRegistry-BdHi7_sN.js → workerRegistry-B2QD2sKq.js} +1 -1
- package/dist/chunks/worktree-D38cJ23W.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +4 -5
- package/dist/chunks/ApproveApiKey-DfAPwDix.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +0 -1
- package/dist/chunks/Doctor-B0CRtxi2.js +0 -1
- package/dist/chunks/Doctor-WxNv49HC.js +0 -3
- package/dist/chunks/ExitFlow-CRPgptCN.js +0 -2
- package/dist/chunks/Feedback-CEtzaLr3.js +0 -2
- package/dist/chunks/Grove-CelgLWH4.js +0 -1
- package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +0 -1
- package/dist/chunks/MessageSelector-_UZB8cGb.js +0 -3
- package/dist/chunks/Messages-jCoW_1Rr.js +0 -11
- package/dist/chunks/PluginSettings-BD9JLV9-.js +0 -17
- package/dist/chunks/QueryEngine-D2HUnwmU.js +0 -1
- package/dist/chunks/REPL-DcpN3MRC.js +0 -1
- package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +0 -2
- package/dist/chunks/ResumeConversation-Cw3vP4G8.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +0 -1
- package/dist/chunks/Settings-ns6mRsDc.js +0 -2
- package/dist/chunks/TrustDialog-DA3YTk_k.js +0 -1
- package/dist/chunks/WelcomeV2-BTfttGcv.js +0 -1
- package/dist/chunks/ajv-5vMo9UcX.js +0 -8
- package/dist/chunks/api-L2IgleTV.js +0 -1
- package/dist/chunks/api-TgV7fl9V.js +0 -1
- package/dist/chunks/asciicast-DYbkzGCN.js +0 -1
- package/dist/chunks/assistant-YvbVKjVh.js +0 -1
- package/dist/chunks/auth-CEig4Gxp.js +0 -1
- package/dist/chunks/auth-CbGDlhyO.js +0 -1
- package/dist/chunks/auth-DHyCIxCk.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +0 -1
- package/dist/chunks/bg-BzG63WOm.js +0 -1
- package/dist/chunks/bridgeConfig-D5dB38xD.js +0 -1
- package/dist/chunks/bridgeEnabled-DKX8-T_H.js +0 -1
- package/dist/chunks/bridgeMain--R1HFbOv.js +0 -68
- package/dist/chunks/bridgeMain-d06JByZn.js +0 -1
- package/dist/chunks/bridgeMessaging-CqbLTDcx.js +0 -1
- package/dist/chunks/bridgePointer-W_jdQ8zf.js +0 -1
- package/dist/chunks/caches-BuTIAOtY.js +0 -1
- package/dist/chunks/ccrClient-HqMi5Kfu.js +0 -1
- package/dist/chunks/client-BeET1hnC.js +0 -1
- package/dist/chunks/commands-VjcG4qFq.js +0 -1
- package/dist/chunks/commitAttribution-Lb3qUlAR.js +0 -1
- package/dist/chunks/compact-DPTVpJ4D.js +0 -2
- package/dist/chunks/completionCache-CW8lKIgy.js +0 -1
- package/dist/chunks/config-0cRberzR.js +0 -1
- package/dist/chunks/config-BrxKpHpR.js +0 -1
- package/dist/chunks/config-C7YHKCPV.js +0 -3
- package/dist/chunks/config-CLmFk-5V.js +0 -1
- package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +0 -1
- package/dist/chunks/conversation-GJxfkr6M.js +0 -1
- package/dist/chunks/conversation-oK3aFzqO.js +0 -1
- package/dist/chunks/createSession-DM4acqaC.js +0 -1
- package/dist/chunks/crossProjectResume-DKrtjTpm.js +0 -40
- package/dist/chunks/cwd-D-tY2NKc.js +0 -1
- package/dist/chunks/datadog-ByS7LGGa.js +0 -1
- package/dist/chunks/datadog-DNCsyfSO.js +0 -1
- package/dist/chunks/debug-DzZUT2Wv.js +0 -1
- package/dist/chunks/detectRepository-6nw-Aw3v.js +0 -1
- package/dist/chunks/doctor-CTMHXZvQ.js +0 -1
- package/dist/chunks/entry-4lIRMrLI.js +0 -14
- package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +0 -1
- package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +0 -1
- package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
- package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +0 -1
- package/dist/chunks/exit-Z9oWrqE4.js +0 -1
- package/dist/chunks/extra-usage-BS4aVOt5.js +0 -1
- package/dist/chunks/extra-usage-DtAIhW74.js +0 -1
- package/dist/chunks/extractMemories-C4f9JWuI.js +0 -1
- package/dist/chunks/fast-B0OB4x7K.js +0 -1
- package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +0 -1
- package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +0 -5
- package/dist/chunks/gemini-DqAv8_GY.js +0 -1
- package/dist/chunks/generateRecap-lO2PDlx8.js +0 -1
- package/dist/chunks/git-BE_FiJZp.js +0 -1
- package/dist/chunks/git-tyaWOgRL.js +0 -6
- package/dist/chunks/hooks-DONAb_nq.js +0 -1
- package/dist/chunks/inboundAttachments-BcEgi49j.js +0 -1
- package/dist/chunks/inboundAttachments-DVs3_m48.js +0 -1
- package/dist/chunks/initReplBridge-D0Xec8S-.js +0 -1
- package/dist/chunks/install-BkfXeXpv.js +0 -1
- package/dist/chunks/jwtUtils-C-ojmb8W.js +0 -1
- package/dist/chunks/keybindings-ez51eHHp.js +0 -2
- package/dist/chunks/language-Da4KNbjm.js +0 -1
- package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
- package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +0 -1
- package/dist/chunks/loadPluginHooks-z1-zvBLw.js +0 -1
- package/dist/chunks/localSearch-D-FprOMr.js +0 -1
- package/dist/chunks/main-y7LJ5qUc.js +0 -1243
- package/dist/chunks/mcp-CSFPAfaW.js +0 -2
- package/dist/chunks/mcp-DBwT4pa9.js +0 -6
- package/dist/chunks/mcp-DvZTaHZE.js +0 -1
- package/dist/chunks/metadata-BRLJvh61.js +0 -1
- package/dist/chunks/model--z4Di9QO.js +0 -1
- package/dist/chunks/model-DfFA3qMO.js +0 -1
- package/dist/chunks/nativeInstaller-GcIk7G2Y.js +0 -1
- package/dist/chunks/parser-BlM_Fk4J.js +0 -1
- package/dist/chunks/permissions-B8epy16o.js +0 -3
- package/dist/chunks/pidLock-CBJDnBG_.js +0 -3
- package/dist/chunks/pluginBlocklist-03sZaZa6.js +0 -1
- package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +0 -1
- package/dist/chunks/pluginOperations-Cz37qcjF.js +0 -2
- package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +0 -1
- package/dist/chunks/plugins-B0hiIN4q.js +0 -4
- package/dist/chunks/policyLimits-Dem-XJ_h.js +0 -1
- package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
- package/dist/chunks/poorMode-jvImnkty.js +0 -1
- package/dist/chunks/print-ozjC0Mhg.js +0 -23
- package/dist/chunks/processBashCommand-loWZ8MSE.js +0 -1
- package/dist/chunks/processSlashCommand-BdouajZb.js +0 -5
- package/dist/chunks/prompt-Bef63FhB.js +0 -132
- package/dist/chunks/prompt-C7wd1H_i.js +0 -1
- package/dist/chunks/prompt-DIoNqZvO.js +0 -1
- package/dist/chunks/rcDebugLog-BUuD-X1D.js +0 -11
- package/dist/chunks/reconciler-DqXTmV3J.js +0 -4
- package/dist/chunks/refresh-CNzXPAFw.js +0 -1
- package/dist/chunks/remoteBridgeCore-D-wG5jau.js +0 -1
- package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +0 -1
- package/dist/chunks/ripgrep-BQgJ02F9.js +0 -1
- package/dist/chunks/sandbox-adapter-Coe1GDAE.js +0 -1
- package/dist/chunks/searchExtraTools-BnWZ9roi.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +0 -1
- package/dist/chunks/sessionMemory-Bsg2unYX.js +0 -1
- package/dist/chunks/sessionMemory-CIbCojm-.js +0 -1
- package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +0 -1
- package/dist/chunks/sessionObserver-CRU1qWnP.js +0 -1
- package/dist/chunks/sessionStorage-BxDN8qRc.js +0 -1
- package/dist/chunks/sessionTitle-B8jcexkQ.js +0 -14
- package/dist/chunks/settings-5PQdphqC.js +0 -19
- package/dist/chunks/settingsSync-BDeuErb5.js +0 -1
- package/dist/chunks/setup-BKEnSLR9.js +0 -3
- package/dist/chunks/sink-DjKoYMsA.js +0 -1
- package/dist/chunks/sink-iYxWapbU.js +0 -1
- package/dist/chunks/sinks-GryGVRT8.js +0 -2
- package/dist/chunks/sinks-jfaIjsRJ.js +0 -1
- package/dist/chunks/skillChangeDetector-A8SAuyo9.js +0 -1
- package/dist/chunks/skillLearning-C8ihdryM.js +0 -1
- package/dist/chunks/src-xRRBgNzF.js +0 -25
- package/dist/chunks/startupProfiler-B0m6crkd.js +0 -1
- package/dist/chunks/state-53JDbNQM.js +0 -1
- package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
- package/dist/chunks/stdio-W_Kokrkh.js +0 -3
- package/dist/chunks/systemPromptSections-IePG5K8r.js +0 -1
- package/dist/chunks/teleport-hN3cAbYC.js +0 -1
- package/dist/chunks/terminalSetup-C0PF87iu.js +0 -33
- package/dist/chunks/thinkback-BA4cMz4D.js +0 -1
- package/dist/chunks/thinkback-mT-8FIT-.js +0 -1
- package/dist/chunks/thinkback-play-Cfk49mvF.js +0 -1
- package/dist/chunks/toolPool-CHVDZqh7.js +0 -1
- package/dist/chunks/trustedDevice-BYCh1ff7.js +0 -1
- package/dist/chunks/trustedDevice-DnIWErCt.js +0 -1
- package/dist/chunks/udsClient-Cg9bBD0p.js +0 -1
- package/dist/chunks/undercover-B-kKUWtK.js +0 -1
- package/dist/chunks/updateCCB-CfUnkOLT.js +0 -11
- package/dist/chunks/upgrade-CngUwvY4.js +0 -1
- package/dist/chunks/upload-DDhQqV8n.js +0 -1
- package/dist/chunks/usage-eZRwLa77.js +0 -1
- package/dist/chunks/useMainLoopModel-BNFW-g8E.js +0 -1
- package/dist/chunks/useManagePlugins-CTtPaQRP.js +0 -1
- package/dist/chunks/validatePlugin-CRmpIGLV.js +0 -1
- package/dist/chunks/windowsPaths-D6T_3XaU.js +0 -1
- package/dist/chunks/windowsPaths-DUKTzBck.js +0 -1
- package/dist/chunks/worktree-YDeHMlHZ.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,r as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";var i=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??(this._str=this._items.reduce((e,t)=>`${e}${t}`,``))}get names(){return this._names??(this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{}))}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),a=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=i(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var a=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=a;var o=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=o;var s=(0,t._)`\n`;e.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new o(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),o=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=i(),n=a(),r=i();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=a();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var s=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},c=class extends s{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},l=class extends s{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=j(this.rhs,e,n),this}get names(){return A(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},u=class extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},d=class extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},f=class extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},p=class extends s{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},m=class extends s{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=j(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends s{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(M(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>k(e,t.names),{})}},g=class extends h{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},_=class extends h{},v=class extends g{};v.kind=`else`;var y=class e extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new v(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(N(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=j(this.condition,e,t),this}get names(){let e=super.names;return A(e,this.condition),this.else&&k(e,this.else.names),e}};y.kind=`if`;var b=class extends g{};b.kind=`for`;var x=class extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=j(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}},S=class extends b{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return A(A(super.names,this.from),this.to)}},C=class extends b{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=j(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}},w=class extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};w.kind=`func`;var T=class extends h{render(e){return`return `+super.render(e)}};T.kind=`return`;var E=class extends g{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}},D=class extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};D.kind=`catch`;var O=class extends g{render(e){return`finally`+super.render(e)}};O.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
2
|
-
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new c(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(t,n){return this._leafNode(new u(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new m(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new y(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new x(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new S(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new C(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new C(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){let t=new T;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(T)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new E;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new D(e),t(e)}return n&&(this._currNode=r.finally=new O,this.code(n)),this._endBlockNode(D,O)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new w(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof y))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function k(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function A(e,n){return n instanceof t._CodeOrName?k(e,n.names):e}function j(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function M(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function N(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${z(e)}`}e.not=N;var P=R(e.operators.AND);function F(...e){return e.reduce(P)}e.and=F;var I=R(e.operators.OR);function L(...e){return e.reduce(I)}e.or=L;function R(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${z(n)} ${e} ${z(r)}`}function z(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),s=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=o(),n=i();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function a(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(s(e,t),!c(t,e.self.RULES.all))}e.alwaysValidSchema=a;function s(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||C(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=s;function c(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=c;function l(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=l;function u({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=u;function d(e){return m(decodeURIComponent(e))}e.unescapeFragment=d;function f(e){return encodeURIComponent(p(e))}e.escapeFragment=f;function p(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=p;function m(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=m;function h(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=h;function g({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:g({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),v(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:_}),items:g({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function _(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&v(e,r,n),r}e.evaluatedPropsToName=_;function v(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=v;var y={};function b(e,t){return e.scopeValue(`func`,{ref:t,code:y[t.code]||(y[t.code]=new n._Code(t.code))})}e.useFunc=b;var x;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(x||(e.Type=x={}));function S(e,n,r){if(e instanceof t.Name){let i=n===x.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+p(e)}e.getErrorPath=S;function C(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=C})),c=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),l=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=o(),n=s(),r=c();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:c,allErrors:l}=o,u=m(n,r,i);a??(c||l)?d(s,u):f(o,(0,t._)`[${u}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:c}=a;d(o,m(t,n,i)),s||c||f(a,r.default.vErrors)}e.reportExtraError=a;function l(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=l;function u({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=u;function d(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function f(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var p={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function m(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:h(e,n,r)}function h(e,t,n={}){let{gen:r,it:i}=e,a=[g(i,n),_(e,n)];return v(e,t,a),r.object(...a)}function g({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function _({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[p.schemaPath,o]}function v(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:m}=l;a.push([p.keyword,o],[p.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),u.messages&&a.push([p.message,typeof i==`function`?i(e):i]),u.verbose&&a.push([p.schema,c],[p.parentSchema,(0,t._)`${f}${m}`],[r.default.data,s]),d&&a.push([p.propertyName,d])}})),u=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=l(),n=o(),r=c(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?u(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function s(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),u(e)):n.var(t,!0)}e.boolOrEmptySchema=s;function u(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),d=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),f=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),p=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=d(),n=f(),r=l(),i=o(),a=s(),c;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(c||(e.DataType=c={}));function u(e){let t=p(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=u;function p(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=p;function m(e,t){let{gen:r,data:i,opts:a}=e,o=g(t,a.coerceTypes),s=t.length>0&&!(o.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(s){let n=b(t,i,a.strictNumbers,c.Wrong);r.if(n,()=>{o.length?_(e,t,o):S(e)})}return s}e.coerceAndCheckDataType=m;var h=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function g(e,t){return t?e.filter(e=>h.has(e)||t===`array`&&e===`array`):[]}function _(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(b(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(h.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),S(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),v(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
3
|
-
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
4
|
-
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
5
|
-
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function v({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function y(e,t,n,r=c.Correct){let a=r===c.Correct?i.operators.EQ:i.operators.NEQ,o;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:o=(0,i._)`Array.isArray(${t})`;break;case`object`:o=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:o=s((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:o=s();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===c.Correct?o:(0,i.not)(o);function s(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=y;function b(e,t,n,r){if(e.length===1)return y(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,y(e,t,n,r));return o}e.checkDataTypes=b;var x={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function S(e){let t=C(e);(0,r.reportError)(t,x)}e.reportTypeError=S;function C(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),m=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;var t=o(),n=s();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),h=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=o(),n=s(),r=c(),i=s();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(m(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function l({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(m(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=l;function u(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=u;function d(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=d;function f(e,n,r){return(0,t._)`${d(e)}.call(${n}, ${r})`}e.isOwnProperty=f;function p(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${f(e,n,r)}`:a}e.propertyInData=p;function m(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(f(e,n,r))):a}e.noPropertyInData=m;function h(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=h;function g(e,t){return h(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=g;function _({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=_;var v=(0,t._)`new RegExp`;function y({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?v:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=y;function b(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=b;function x(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=x})),g=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=o(),n=c(),r=h(),i=l();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=p(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let u=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}e.macroKeywordCode=a;function s(e,i){let{gen:a,keyword:o,schema:s,parentSchema:c,$data:l,it:m}=e;f(m,i);let h=p(a,o,!l&&i.compile?i.compile.call(m.self,s,c,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&u(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&u(e),x(()=>d(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!l||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=s;function u(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function d(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function f({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function p(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function m(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=m;function g({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=g})),_=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=o(),n=s();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),v=r(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),y=r(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else(p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),b=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=s(),n=v(),r=y(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!c(e):t?l(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function c(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(c)||typeof n==`object`&&c(n))return!0}return!1}function l(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=l(e)),n===1/0)))return 1/0;return n}function u(e,t=``,n){return n!==!1&&(t=p(t)),d(e,e.parse(t))}e.getFullPath=u;function d(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=d;var f=/#\/?$/;function p(e){return e?e.replace(f,``):``}e.normalizeId=p;function m(e,t,n){return n=p(n),e.resolve(t,n)}e.resolveUrl=m;var h=/^[a-z_][-a-z0-9._]*$/i;function g(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=p(e[i]||t),s={"":o},c=u(a,o,!1),l={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=u.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function u(t){let n=this.opts.uriResolver.resolve;if(t=p(o?n(o,t):t),d.has(t))throw m(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?f(e,r.schema,t):t!==p(a)&&(t[0]===`#`?(f(e,l[t],t),l[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!h.test(e))throw Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}}),l;function f(e,t,r){if(t!==void 0&&!n(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=g})),x=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=u(),n=p(),r=f(),i=p(),a=m(),d=g(),h=_(),v=o(),y=c(),x=b(),S=s(),C=l();function w(e){if(N(e)&&(F(e),M(e))){O(e);return}T(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=w;function T({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,v._)`${y.default.data}, ${y.default.valCxt}`,r.$async,()=>{e.code((0,v._)`"use strict"; ${A(n,i)}`),D(e,i),e.code(a)}):e.func(t,(0,v._)`${y.default.data}, ${E(i)}`,r.$async,()=>e.code(A(n,i)).code(a))}function E(e){return(0,v._)`{${y.default.instancePath}="", ${y.default.parentData}, ${y.default.parentDataProperty}, ${y.default.rootData}=${y.default.data}${e.dynamicRef?(0,v._)`, ${y.default.dynamicAnchors}={}`:v.nil}}={}`}function D(e,t){e.if(y.default.valCxt,()=>{e.var(y.default.instancePath,(0,v._)`${y.default.valCxt}.${y.default.instancePath}`),e.var(y.default.parentData,(0,v._)`${y.default.valCxt}.${y.default.parentData}`),e.var(y.default.parentDataProperty,(0,v._)`${y.default.valCxt}.${y.default.parentDataProperty}`),e.var(y.default.rootData,(0,v._)`${y.default.valCxt}.${y.default.rootData}`),t.dynamicRef&&e.var(y.default.dynamicAnchors,(0,v._)`${y.default.valCxt}.${y.default.dynamicAnchors}`)},()=>{e.var(y.default.instancePath,(0,v._)`""`),e.var(y.default.parentData,(0,v._)`undefined`),e.var(y.default.parentDataProperty,(0,v._)`undefined`),e.var(y.default.rootData,y.default.data),t.dynamicRef&&e.var(y.default.dynamicAnchors,(0,v._)`{}`)})}function O(e){let{schema:t,opts:n,gen:r}=e;T(e,()=>{n.$comment&&t.$comment&&V(e),R(e),r.let(y.default.vErrors,null),r.let(y.default.errors,0),n.unevaluated&&k(e),I(e),ee(e)})}function k(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,v._)`${n}.evaluated`),t.if((0,v._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,v._)`${e.evaluated}.props`,(0,v._)`undefined`)),t.if((0,v._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,v._)`${e.evaluated}.items`,(0,v._)`undefined`))}function A(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,v._)`/*# sourceURL=${n} */`:v.nil}function j(e,n){if(N(e)&&(F(e),M(e))){P(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function M({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function N(e){return typeof e.schema!=`boolean`}function P(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&V(e),z(e),B(e);let a=r.const(`_errs`,y.default.errors);I(e,a),r.var(t,(0,v._)`${a} === ${y.default.errors}`)}function F(e){(0,S.checkUnknownRules)(e),L(e)}function I(e,t){if(e.opts.jtd)return U(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);U(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function L(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,S.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function R(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,S.checkStrictMode)(e,`default is ignored in the schema root`)}function z(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,x.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function B(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function V({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,v._)`${y.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,v.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,v._)`${y.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function ee(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,v._)`${y.default.errors} === 0`,()=>t.return(y.default.data),()=>t.throw((0,v._)`new ${i}(${y.default.vErrors})`)):(t.assign((0,v._)`${r}.errors`,y.default.vErrors),a.unevaluated&&H(e),t.return((0,v._)`${y.default.errors} === 0`))}function H({gen:e,evaluated:t,props:n,items:r}){n instanceof v.Name&&e.assign((0,v._)`${t}.props`,n),r instanceof v.Name&&e.assign((0,v._)`${t}.items`,r)}function U(e,t,n,a){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=e,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,S.schemaHasRulesButRef)(s,f))){o.block(()=>Q(e,`$ref`,f.all.$ref.definition));return}u.jtd||G(e,t),o.block(()=>{for(let e of f.rules)p(e);p(f.post)});function p(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,c,u.strictNumbers)),W(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):W(e,d),l||o.if((0,v._)`${y.default.errors} === ${a||0}`))}}function W(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&Q(e,n.keyword,n.definition,t.type)})}function G(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(K(e,t),e.opts.allowUnionTypes||q(e,t),J(e,e.dataTypes))}function K(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{Y(e.dataTypes,t)||X(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),ne(e,t)}}function q(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&X(e,`use allowUnionTypes to allow union type keyword`)}function J(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>te(t,e))&&X(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function te(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function Y(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function ne(e,t){let n=[];for(let r of e.dataTypes)Y(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function X(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,S.checkStrictMode)(e,t,e.opts.strictTypes)}var Z=class{constructor(e,t,n){if((0,d.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,S.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,$(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,d.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,y.default.errors))}result(e,t,n){this.failResult((0,v.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,v.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,v._)`${t} !== undefined && (${(0,v.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?C.reportExtraError:C.reportError)(this,this.def.error,t)}$dataError(){(0,C.reportError)(this,this.def.$dataError||C.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,C.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=v.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=v.nil,t=v.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,v.or)((0,v._)`${r} === undefined`,t)),e!==v.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==v.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,v.or)(o(),s());function o(){if(n.length){if(!(t instanceof v.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,v._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return v.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,v._)`!${n}(${t})`}return v.nil}}subschema(e,t){let n=(0,h.getSubschema)(this.it,e);(0,h.extendSubschemaData)(n,this.it,e),(0,h.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return j(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=S.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=S.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,v.Name)),!0}};e.KeywordCxt=Z;function Q(e,t,n,r){let i=new Z(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,d.funcKeywordCode)(i,n):`macro`in n?(0,d.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,d.funcKeywordCode)(i,n)}var re=/^\/(?:[^~]|~0|~1)*$/,ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function $(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return y.default.rootData;if(e[0]===`/`){if(!re.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=y.default.rootData}else{let o=ie.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(c(`property/index`,s));return r[t-s]}if(s>t)throw Error(c(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,v._)`${a}${(0,v.getProperty)((0,S.unescapeJsonPointer)(e))}`,o=(0,v._)`${o} && ${a}`);return o;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=$})),S=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),C=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=b();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),w=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=o(),n=S(),r=c(),i=b(),a=s(),l=x(),u=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=u;function d(e){let a=m.call(this,e);if(a)return a;let o=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:c}=this.opts.code,{ownProperties:u}=this.opts,d=new t.CodeGen(this.scope,{es5:s,lines:c,ownProperties:u}),f;e.$async&&(f=d.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let p=d.scopeName(`validate`);e.validateName=p;let h={gen:d,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:o,baseId:e.baseId||o,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,l.validateFunctionCode)(h),d.optimize(this.opts.code.optimize);let n=d.toString();g=`${d.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:p,validateCode:n,scopeValues:d._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=d;function f(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=g.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new u({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=p.call(this,a)}e.resolveRef=f;function p(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function m(e){for(let t of this._compilations)if(h(t,e))return t}e.getCompilingSchema=m;function h(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function g(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||_.call(this,e,t)}function _(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return y.call(this,n,e);let o=(0,i.normalizeId)(r),s=this.refs[o]||this.schemas[o];if(typeof s==`string`){let t=_.call(this,e,s);return typeof t?.schema==`object`?y.call(this,n,t):void 0}if(typeof s?.schema==`object`){if(s.validate||d.call(this,s),o===(0,i.normalizeId)(t)){let{schema:t}=s,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new u({schema:t,schemaId:n,root:e,baseId:a})}return y.call(this,n,s)}}e.resolveSchema=_;var v=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function y(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!v.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=_.call(this,r,e)}let{schemaId:s}=this.opts;if(o=o||new u({schema:n,schemaId:s,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),T=n({$id:()=>E,additionalProperties:()=>!1,default:()=>j,description:()=>D,properties:()=>A,required:()=>k,type:()=>O}),E,D,O,k,A,j,M=t((()=>{E=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,D=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,O=`object`,k=[`$data`],A={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},j={$id:E,description:D,type:O,required:k,properties:A,additionalProperties:!1}})),N=r(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(!(u===`[`||u===`]`))if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}else if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}var h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),P=r(((e,t)=>{var{isUUID:n}=N(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||(e.path=`/`),e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),F=r(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=N(),{SCHEMES:d,getSchemeHandler:f}=P();function p(e,t){return typeof e==`string`?e=S(e,t):typeof e==`object`&&(e=x(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=h(x(e,r),x(t,r),r,!0);return r.skipEscape=!0,_(i,r)}function h(e,t,n,i){let a={};return i||(e=x(_(e,n),n),t=x(_(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=w(e,n),i=w(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function b(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(v);if(d){i.scheme=d[1],i.userinfo=d[3],i.host=d[4],i.port=parseInt(d[5],10),i.path=d[6]||``,i.query=d[7],i.fragment=d[8],isNaN(i.port)&&(i.port=d[5]);let t=y(i,d);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host)if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let p=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!p||!p.unicodeSupport)&&i.host&&(r.domainHost||p&&p.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!p||p&&!p.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&(i.path=o(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}p&&p.parse&&p.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function x(e,t){return b(e,t).parsed}function S(e,t){return C(e,t).normalized}function C(e,t){let{parsed:n,malformedAuthorityOrPort:r}=b(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function w(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=C(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var T={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:x};t.exports=T,t.exports.default=T,t.exports.fastUri=T})),I=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=F();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),L=r((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=x();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var r=o();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});var i=S(),a=C(),c=d(),l=w(),u=o(),f=b(),m=p(),h=s(),g=(M(),e(T).default),_=I(),v=(e,t)=>new RegExp(e,t);v.code=`new RegExp`;var y=[`removeAdditional`,`useDefaults`,`coerceTypes`],E=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),D={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},O={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},k=200;function A(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??v,a=e.uriResolver??_.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??k,loopEnum:e.loopEnum??k,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var j=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...A(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:E,es5:t,lines:n}),this.logger=V(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,c.getRules)(),N.call(this,D,e,`NOT SUPPORTED`),N.call(this,O,e,`DEPRECATED`,`warn`),this._metaOpts=z.call(this),e.formats&&L.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&R.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),F.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=g;n===`id`&&(r={...g},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,f.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=P.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=P.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,f.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(H.call(this,n,t),!t)return(0,h.eachItem)(n,e=>U.call(this,e)),this;G.call(this,t);let r={...t,type:(0,m.getJSONTypes)(t.type),schemaType:(0,m.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(n,r.type.length===0?e=>U.call(this,e,r):e=>r.type.forEach(t=>U.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=q(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let s=this._cache.get(e);if(s!==void 0)return s;n=(0,f.normalizeId)(a||n);let c=f.getSchemaRefs.call(this,e,n);return s=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:c}),this._cache.set(s.schema,s),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=s),r&&this.validateSchema(e,!0),s}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}};j.ValidationError=i.default,j.MissingRefError=a.default,t.default=j;function N(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function P(e){return e=(0,f.normalizeId)(e),this.schemas[e]||this.refs[e]}function F(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function L(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function R(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}function z(){let e={...this.opts};for(let t of y)delete e[t];return e}var B={log(){},warn(){},error(){}};function V(e){if(e===!1)return B;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ee=/^[a-z_$][a-z0-9_$:-]*$/i;function H(e,t){let{RULES:n}=this;if((0,h.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ee.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function U(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,m.getJSONTypes)(t.type),schemaType:(0,m.getJSONTypes)(t.schemaType)}};t.before?W.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function W(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function G(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=q(t)),e.validateSchema=this.compile(t,!0))}var K={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function q(e){return{anyOf:[e,K]}}})),R=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),z=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;var t=C(),n=h(),r=o(),i=c(),a=w(),l=s(),u={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:u,self:p}=o,{root:m}=c;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(c===m)return f(e,l,c,c.$async);let t=n.scopeValue(`root`,{ref:m});return f(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){f(e,d(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,u.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function d(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=d;function f(e,t,a,o){let{gen:s,it:c}=e,{allErrors:u,schemaEnv:d,opts:f}=c,p=f.passContext?i.default.this:r.nil;o?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=s.let(`valid`);s.try(()=>{s.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||s.assign(i,!0)},e=>{s.if((0,r._)`!(${e} instanceof ${c.ValidationError})`,()=>s.throw(e)),g(e),u||s.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;s.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),s.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!c.opts.unevaluated)return;let t=a?.validate?.evaluated;if(c.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(c.props=l.mergeEvaluated.props(s,t.props,c.props));else{let t=s.var(`props`,(0,r._)`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(s,t,c.props,r.Name)}if(c.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(c.items=l.mergeEvaluated.items(s,t.items,c.items));else{let t=s.var(`items`,(0,r._)`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(s,t,c.items,r.Name)}}}e.callRef=f,e.default=u})),B=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=R(),n=z();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),V=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),ee=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),H=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),U=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s(),r=H();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),W=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=h(),n=s(),r=o();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),G=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),K=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=h(),n=o(),r=s();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),q=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),J=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=v();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),te=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=p(),n=o(),r=s(),i=J();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),Y=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s(),r=J();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),ne=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s(),r=J();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??(d=(0,n.useFunc)(i,r.default)),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),X=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=V(),n=ee(),r=U(),i=W(),a=G(),o=K(),s=q(),c=te(),l=Y(),u=ne();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),Z=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;var t=o(),n=s(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),Q=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;var t=o(),n=s(),r=h(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),re=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Q();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),ie=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s(),r=h(),i=Z();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),$=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),ae=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=o(),n=s(),r=h();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
6
|
-
missingProperty: ${i},
|
|
7
|
-
depsCount: ${n},
|
|
8
|
-
deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);c(e,t),l(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function c(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=c;function l(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=l,e.default=i})),oe=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),se=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=h(),n=o(),r=c(),i=s();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),ce=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=x(),n=h(),r=s(),i=se();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),le=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=h(),n=o(),r=s(),i=s();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),ue=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=s();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),de=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:h().validateUnion,error:{message:`must match a schema in anyOf`}}})),fe=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),pe=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=s();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),me=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=s(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),he=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=s();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),ge=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=re(),r=Q(),i=ie(),a=$(),o=ae(),s=oe(),c=se(),l=ce(),u=le(),d=ue(),f=de(),p=fe(),m=pe(),h=me(),g=he();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),_e=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),ve=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[_e().default]})),ye=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),be=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=B(),n=X(),r=ge(),i=ve(),a=ye();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),xe=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),Se=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=o(),n=xe(),r=w(),i=C(),a=s();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n=n&&(t||o(c)),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),Ce=n({$id:()=>Te,$schema:()=>we,default:()=>Ae,definitions:()=>De,properties:()=>ke,title:()=>Ee,type:()=>Oe}),we,Te,Ee,De,Oe,ke,Ae,je=t((()=>{we=`http://json-schema.org/draft-07/schema#`,Te=`http://json-schema.org/draft-07/schema#`,Ee=`Core schema meta-schema`,De={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},Oe=[`object`,`boolean`],ke={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},Ae={$schema:we,$id:Te,title:Ee,definitions:De,type:Oe,properties:ke,default:!0}})),Me=r(((t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=L(),i=be(),a=Se(),s=(je(),e(Ce).default),c=[`/properties`],l=`http://json-schema.org/draft-07/schema`,u=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(e,l,!1),this.refs[`http://json-schema.org/schema`]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};t.Ajv=u,n.exports=t=u,n.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=x();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var f=o();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var p=S();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var m=C();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}));export{o as n,Me as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./api-TgV7fl9V.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{n as r,t as i}from"./v4-jw6qOKwQ.js";import{E as a,J as o,O as s,U as c,l,p as u,z as d}from"./debug-IKW-jE7K.js";import{c as f,g as p}from"./config-C7YHKCPV.js";import{o as m,s as h}from"./log-B3eB4EFv.js";import{n as g,t as _}from"./lazySchema-uxlVVNM1.js";import{l as v,u as y}from"./oauth-BqJqV-2M.js";import{Hr as b,Ur as x,Vt as S,kt as C,vn as w,yn as T}from"./model-DfFA3qMO.js";import{a as E,i as D}from"./detectRepository-ReZ0Fz8Z.js";import{randomUUID as O}from"crypto";function k(e){return t.isAxiosError(e)?!e.response||e.response.status>=500:!1}async function A(e,n){let r;for(let i=0;i<=V;i++)try{return await t.get(e,n)}catch(e){if(r=e,!k(e))throw e;if(i>=V)throw u(`Teleport request failed after ${i+1} attempts: ${d(e)}`),e;let t=B[i]??2e3;u(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${d(e)}`),await T(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=f(),t=process.env.ANTHROPIC_API_KEY?.trim()||e.workspaceApiKey?.trim();if(!t){let t=e.workspaceApiKey,n=j(t)?`Your workspace API key was cleared. `:`A workspace API key (sk-ant-api03-*) is required to use workspace endpoints (/v1/agents, /v1/vaults, /v1/memory_stores, /v1/skills). `;throw Error(n+`Press W in /login to save your key directly (no restart needed), or set ANTHROPIC_API_KEY=<key> and restart. Obtain a key from https://console.anthropic.com/settings/keys. Subscription OAuth (claude.ai login) cannot reach these endpoints.`)}if(!t.startsWith(`sk-ant-api03-`))throw Error(`Workspace API key must start with sk-ant-api03-, got prefix "${t.slice(0,4)}...". Obtain a workspace API key from https://console.anthropic.com/settings/keys. Press W in /login to save your key, or set ANTHROPIC_API_KEY.`);return{apiKey:t}}async function N(){let e=C()?.accessToken;if(e===void 0)throw Error(`Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.`);let t=await b();if(!t)throw Error(`Unable to get organization UUID`);return{accessToken:e,orgUUID:t}}async function P(){let{accessToken:e,orgUUID:t}=await N(),n=`${v().BASE_API_URL}/v1/sessions`;try{let r=await A(n,{headers:{...F(e),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":t}});if(r.status!==200)throw Error(`Failed to fetch code sessions: ${r.statusText}`);return r.data.data.map(e=>{let t=e.session_context.sources.find(e=>e.type===`git_repository`),n=null;if(t?.url){let e=E(t.url);if(e){let[r,i]=e.split(`/`);r&&i&&(n={name:i,owner:{login:r},default_branch:t.revision||void 0})}}return{id:e.id,title:e.title||`Untitled`,description:``,status:e.session_status,repo:n,turns:[],created_at:e.created_at,updated_at:e.updated_at}})}catch(e){throw h(o(e)),e}}function F(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`}}async function I(e){let{accessToken:n,orgUUID:r}=await N(),i=`${v().BASE_API_URL}/v1/sessions/${e}`,a={...F(n),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":r},o=await t.get(i,{headers:a,timeout:15e3,validateStatus:e=>e<500});if(o.status!==200){let t=o.data?.error?.message;throw o.status===404?Error(`Session not found: ${e}`):o.status===401?Error(`Session expired. Please run /login to sign in again.`):Error(t||`Failed to fetch session: ${o.status} ${o.statusText}`)}return o.data}function L(e){return(e.session_context.outcomes?.find(e=>e.type===`git_repository`))?.git_info?.branches[0]}async function R(e,n,r){try{let{accessToken:i,orgUUID:a}=await N(),o=`${v().BASE_API_URL}/v1/sessions/${e}/events`,c={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},l={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};u(`[sendEventToRemoteSession] Sending event to session ${e}`);let d=await t.post(o,l,{headers:c,validateStatus:e=>e<500,timeout:3e4});return d.status===200||d.status===201?(u(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(u(`[sendEventToRemoteSession] Failed with status ${d.status}: ${s(d.data)}`),!1)}catch(e){return u(`[sendEventToRemoteSession] Error: ${d(e)}`),!1}}async function z(e,n){try{let{accessToken:r,orgUUID:i}=await N(),a=`${v().BASE_API_URL}/v1/sessions/${e}`,o={...F(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i};u(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let c=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return c.status===200?(u(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(u(`[updateSessionTitle] Failed with status ${c.status}: ${s(c.data)}`),!1)}catch(e){return u(`[updateSessionTitle] Error: ${d(e)}`),!1}}var B,V,H=e((()=>{n(),y(),x(),i(),S(),p(),l(),D(),c(),_(),m(),w(),a(),B=[2e3,4e3,8e3,16e3],V=B.length,g(()=>r.object({id:r.string(),title:r.string(),description:r.string(),status:r.enum([`idle`,`working`,`waiting`,`completed`,`archived`,`cancelled`,`rejected`]),repo:r.object({name:r.string(),owner:r.object({login:r.string()}),default_branch:r.string().optional()}).nullable(),turns:r.array(r.string()),created_at:r.string(),updated_at:r.string()}))}));export{F as a,j as c,R as d,z as f,L as i,N as l,P as n,H as o,I as r,k as s,A as t,M as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./asciicast-n-BBfgDq.js";export{e as renameRecordingForSession};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t}from"./assistant-BA9_Mo9U.js";e();export{t as isAssistantMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Lt as e,Vt as t,bt as n,ht as r,kt as i}from"./model-DfFA3qMO.js";t();export{r as checkAndRefreshOAuthTokenIfNeeded,n as clearOAuthTokenCache,i as getClaudeAIOAuthTokens,e as handleOAuth401Error};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./auth-DHyCIxCk.js";export{t as authLogin,e as authStatus};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{d as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{n as i,t as a}from"./axios-DaWTGg7G.js";import{Ba as o,Va as s}from"./loadAgentsDir-nzr38hai.js";import{E as c,O as l,U as u,l as d,p as f,z as p}from"./debug-IKW-jE7K.js";import{g as ee,n as m}from"./settings-5PQdphqC.js";import{b as h,c as te,g}from"./config-C7YHKCPV.js";import{o as _,s as v}from"./log-B3eB4EFv.js";import{n as y,r as b}from"./analytics-BotDBGh0.js";import{l as x,u as S}from"./oauth-BqJqV-2M.js";import{Br as ne,Cn as C,Ct as re,Dn as w,Gr as T,It as E,Jr as D,Lr as O,Mn as ie,Mt as ae,Ot as oe,Qr as se,Rr as k,Ur as A,Vr as j,Vt as M,Yr as N,Zr as P,_n as F,bt as I,dn as L,er as R,fi as z,hn as B,ir as V,kt as H,lr as U,mi as W,mn as G,pn as K,qr as ce,rn as le,ur as ue,wn as de,zr as fe}from"./model-DfFA3qMO.js";import{P as q,W as J}from"./rcDebugLog-BUuD-X1D.js";import{d as pe,u as me}from"./firstPartyEventLogger-hU-LPkje.js";import{n as he,t as ge}from"./browser-Bd7GeBH1.js";import{n as _e}from"./trustedDevice-BYCh1ff7.js";import{a as ve,i as ye,r as be}from"./grove-DotW04-v.js";import{t as xe}from"./remoteManagedSettings-B7gt0VAX.js";import{d as Se,n as Ce,t as we}from"./status-is_Bg_IB.js";import{createHash as Te,randomBytes as Y}from"crypto";import{createServer as Ee}from"http";ve(),s(),M(),ie(),g(),de(),F(),me();async function X(){H.cache?.clear?.(),_e(),w(),B(),pe(),be.cache?.clear?.(),ye.cache?.clear?.(),await xe(),await o()}async function De({clearOnboarding:e=!1}){let{flushTelemetry:t}=await import(`./instrumentation-H0XRS1yG.js`);await t(),await L(),C().delete(),await X(),h(t=>{let n={...t};return e&&(n.hasCompletedOnboarding=!1,n.subscriptionNoticeCount=0,n.hasAvailableSubscription=!1,n.customApiKeyResponses?.approved&&(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]})),n.oauthAccount=void 0,n})}t(),n(),u(),c(),d(),y(),ee(),W(),se(),A(),q(),a(),S(),g(),V(),_(),ue();async function Oe(){try{if(te().claudeCodeFirstTokenDate!==void 0)return;let e=R();if(e.error){v(Error(`Failed to get auth headers: ${e.error}`));return}let t=`${x().BASE_API_URL}/api/organization/claude_code_first_token_date`,n=(await i.get(t,{headers:{...e.headers,"User-Agent":U()},timeout:1e4})).data?.first_token_date??null;if(n!==null){let e=new Date(n).getTime();if(isNaN(e)){v(Error(`Received invalid first_token_date from API: ${n}`));return}}h(e=>({...e,claudeCodeFirstTokenDate:n}))}catch(e){v(e)}}ge(),S(),_();var ke=class{constructor(e=`/callback`){r(this,`localServer`,void 0),r(this,`port`,0),r(this,`promiseResolver`,null),r(this,`promiseRejecter`,null),r(this,`expectedState`,null),r(this,`pendingResponse`,null),r(this,`callbackPath`,void 0),this.localServer=Ee(),this.callbackPath=e}async start(e){return new Promise((t,n)=>{this.localServer.once(`error`,e=>{n(Error(`Failed to start OAuth callback server: ${e.message}`))}),this.localServer.listen(e??0,`localhost`,()=>{let e=this.localServer.address();this.port=e.port,t(this.port)})})}getPort(){return this.port}hasPendingResponse(){return this.pendingResponse!==null}async waitForAuthorization(e,t){return new Promise((n,r)=>{this.promiseResolver=n,this.promiseRejecter=r,this.expectedState=e,this.startLocalListener(t)})}handleSuccessRedirect(e,t){if(!this.pendingResponse)return;if(t){t(this.pendingResponse,e),this.pendingResponse=null,b(`tengu_oauth_automatic_redirect`,{custom_handler:!0});return}let n=D(e)?x().CLAUDEAI_SUCCESS_URL:x().CONSOLE_SUCCESS_URL;this.pendingResponse.writeHead(302,{Location:n}),this.pendingResponse.end(),this.pendingResponse=null,b(`tengu_oauth_automatic_redirect`,{})}handleErrorRedirect(){if(!this.pendingResponse)return;let e=x().CLAUDEAI_SUCCESS_URL;this.pendingResponse.writeHead(302,{Location:e}),this.pendingResponse.end(),this.pendingResponse=null,b(`tengu_oauth_automatic_redirect_error`,{})}startLocalListener(e){this.localServer.on(`request`,this.handleRedirect.bind(this)),this.localServer.on(`error`,this.handleError.bind(this)),e()}handleRedirect(e,t){let n=new URL(e.url||``,`http://${e.headers.host||`localhost`}`);if(n.pathname!==this.callbackPath){t.writeHead(404),t.end();return}let r=n.searchParams.get(`code`)??void 0,i=n.searchParams.get(`state`)??void 0;this.validateAndRespond(r,i,t)}validateAndRespond(e,t,n){if(!e){n.writeHead(400),n.end(`Authorization code not found`),this.reject(Error(`No authorization code received`));return}if(t!==this.expectedState){n.writeHead(400),n.end(`Invalid state parameter`),this.reject(Error(`Invalid state parameter`));return}this.pendingResponse=n,this.resolve(e)}handleError(e){v(e),this.close(),this.reject(e)}resolve(e){this.promiseResolver&&(this.promiseResolver(e),this.promiseResolver=null,this.promiseRejecter=null)}reject(e){this.promiseRejecter&&(this.promiseRejecter(e),this.promiseResolver=null,this.promiseRejecter=null)}close(){this.pendingResponse&&this.handleErrorRedirect(),this.localServer&&(this.localServer.removeAllListeners(),this.localServer.close())}};function Z(e){return e.toString(`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Ae(){return Z(Y(32))}function je(e){let t=Te(`sha256`);return t.update(e),Z(t.digest())}function Me(){return Z(Y(32))}y(),A(),n();var Q=class{constructor(){r(this,`codeVerifier`,void 0),r(this,`authCodeListener`,null),r(this,`port`,null),r(this,`manualAuthCodeResolver`,null),this.codeVerifier=Ae()}async startOAuthFlow(e,t){this.authCodeListener=new ke,this.port=await this.authCodeListener.start();let n=je(this.codeVerifier),r=Me(),i={codeChallenge:n,state:r,port:this.port,loginWithClaudeAi:t?.loginWithClaudeAi,inferenceOnly:t?.inferenceOnly,orgUUID:t?.orgUUID,loginHint:t?.loginHint,loginMethod:t?.loginMethod},a=O({...i,isManual:!0}),o=O({...i,isManual:!1}),s=await this.waitForAuthorizationCode(r,async()=>{t?.skipBrowserOpen?await e(a,o):(await e(a),await he(o))}),c=this.authCodeListener?.hasPendingResponse()??!1;b(`tengu_oauth_auth_code_received`,{automatic:c});try{let e=await fe(s,r,this.codeVerifier,this.port,!c,t?.expiresIn),n=await j(e.access_token);if(c){let t=T(e.scope);this.authCodeListener?.handleSuccessRedirect(t)}return this.formatTokens(e,n.subscriptionType,n.rateLimitTier,n.rawProfile)}catch(e){throw c&&this.authCodeListener?.handleErrorRedirect(),e}finally{this.authCodeListener?.close()}}async waitForAuthorizationCode(e,t){return new Promise((n,r)=>{this.manualAuthCodeResolver=n,this.authCodeListener?.waitForAuthorization(e,t).then(e=>{this.manualAuthCodeResolver=null,n(e)}).catch(e=>{this.manualAuthCodeResolver=null,r(e)})})}handleManualAuthCodeInput(e){this.manualAuthCodeResolver&&(this.manualAuthCodeResolver(e.authorizationCode),this.manualAuthCodeResolver=null,this.authCodeListener?.close())}formatTokens(e,t,n,r){return{accessToken:e.access_token,refreshToken:e.refresh_token,expiresAt:Date.now()+e.expires_in*1e3,scopes:T(e.scope),subscriptionType:t,rateLimitTier:n,profile:r,tokenAccount:e.account?{uuid:e.account.uuid,emailAddress:e.account.email_address,organizationUuid:e.organization?.uuid}:void 0}}cleanup(){this.authCodeListener?.close(),this.manualAuthCodeResolver=null}};y(),A(),M(),g(),_(),Se();async function $(e){await De({clearOnboarding:!1});let t=e.profile??await P(e.accessToken);t?N({accountUuid:t.account.uuid,emailAddress:t.account.email,organizationUuid:t.organization.uuid,displayName:t.account.display_name||void 0,hasExtraUsageEnabled:t.organization.has_extra_usage_enabled??void 0,billingType:t.organization.billing_type??void 0,subscriptionCreatedAt:t.organization.subscription_created_at??void 0,accountCreatedAt:t.account.created_at}):e.tokenAccount&&N({accountUuid:e.tokenAccount.uuid,emailAddress:e.tokenAccount.emailAddress,organizationUuid:e.tokenAccount.organizationUuid});let n=K(e);if(I(),n.warning&&b(`tengu_oauth_storage_warning`,{warning:n.warning}),await ne(e.accessToken).catch(e=>f(String(e),{level:`error`})),D(e.scopes))await Oe().catch(e=>f(String(e),{level:`error`}));else if(!await k(e.accessToken))throw Error(`Unable to create API key. The server accepted the request but did not return a key.`);await X()}async function Ne({email:e,sso:t,console:n,claudeai:r}){n&&r&&(process.stderr.write(`Error: --console and --claudeai cannot be used together.
|
|
2
|
-
`),process.exit(1));let i=m(),a=i.forceLoginMethod?i.forceLoginMethod===`claudeai`:!n,o=i.forceLoginOrgUUID,s=process.env.CLAUDE_CODE_OAUTH_REFRESH_TOKEN;if(s){let e=process.env.CLAUDE_CODE_OAUTH_SCOPES;e||(process.stderr.write(`CLAUDE_CODE_OAUTH_SCOPES is required when using CLAUDE_CODE_OAUTH_REFRESH_TOKEN.
|
|
3
|
-
Set it to the space-separated scopes the refresh token was issued with
|
|
4
|
-
(e.g. "user:inference" or "user:profile user:inference user:sessions:claude_code user:mcp_servers").
|
|
5
|
-
`),process.exit(1));let t=e.split(/\s+/).filter(Boolean);try{b(`tengu_login_from_refresh_token`,{});let e=await ce(s,{scopes:t});await $(e);let n=await G();n.valid||(process.stderr.write(n.message+`
|
|
6
|
-
`),process.exit(1)),h(e=>e.hasCompletedOnboarding?e:{...e,hasCompletedOnboarding:!0}),b(`tengu_oauth_success`,{loginWithClaudeAi:D(e.scopes)}),process.stdout.write(`Login successful.
|
|
7
|
-
`),process.exit(0)}catch(e){v(e);let t=J(e);process.stderr.write(`Login failed: ${p(e)}\n${t?t+`
|
|
8
|
-
`:``}`),process.exit(1)}}let c=t?`sso`:void 0,l=new Q;try{b(`tengu_oauth_flow_start`,{loginWithClaudeAi:a}),await $(await l.startOAuthFlow(async e=>{process.stdout.write(`Opening browser to sign in…
|
|
9
|
-
`),process.stdout.write(`If the browser didn't open, visit: ${e}\n`)},{loginWithClaudeAi:a,loginHint:e,loginMethod:c,orgUUID:o}));let t=await G();t.valid||(process.stderr.write(t.message+`
|
|
10
|
-
`),process.exit(1)),b(`tengu_oauth_success`,{loginWithClaudeAi:a}),process.stdout.write(`Login successful.
|
|
11
|
-
`),process.exit(0)}catch(e){v(e);let t=J(e);process.stderr.write(`Login failed: ${p(e)}\n${t?t+`
|
|
12
|
-
`:``}`),process.exit(1)}finally{l.cleanup()}}async function Pe(t){let{source:n,hasToken:r}=oe(),{source:i}=re(),a=!!process.env.ANTHROPIC_API_KEY&&!e(),o=ae(),s=E(),c=le(),u=r||i!==`none`||a||c,d=`none`;if(c?d=`third_party`:n===`claude.ai`?d=`claude.ai`:n===`apiKeyHelper`?d=`api_key_helper`:n===`none`?i===`ANTHROPIC_API_KEY`||a?d=`api_key`:i===`/login managed key`&&(d=`claude.ai`):d=`oauth_token`,t.text){let e=[...Ce(),...we()],t=!1;for(let n of e){let e=typeof n.value==`string`?n.value:Array.isArray(n.value)?n.value.join(`, `):null;e===null||e===`none`||(t=!0,n.label?process.stdout.write(`${n.label}: ${e}\n`):process.stdout.write(`${e}\n`))}!t&&a&&process.stdout.write(`API key: ANTHROPIC_API_KEY
|
|
13
|
-
`),u||process.stdout.write(`Not logged in. Run claude auth login to authenticate.
|
|
14
|
-
`)}else{let e=z(),t=i===`none`?a?`ANTHROPIC_API_KEY`:null:i,n={loggedIn:u,authMethod:d,apiProvider:e};t&&(n.apiKeySource=t),d===`claude.ai`&&(n.email=o?.emailAddress??null,n.orgId=o?.organizationUuid??null,n.orgName=o?.organizationName??null,n.subscriptionType=s??null),process.stdout.write(l(n,null,2)+`
|
|
15
|
-
`)}process.exit(+!u)}export{Q as i,Pe as n,$ as r,Ne as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./backgroundHousekeeping-hDDE8mJC.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,r,s as i,t as a}from"./bg-DQ0Q3Qv-.js";n();export{a as attachHandler,r as handleBgStart,e as killHandler,i as logsHandler,t as psHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,t as r}from"./bridgeConfig-CCtXe8ak.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./bridgeEnabled--F-6TUi4.js";t();export{n as checkBridgeMinVersion,e as getBridgeDisabledReason};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{l as e,o as t,u as n}from"./envUtils-DSxRz_kt.js";import{Gr as r,di as i,t as a,ui as o}from"./src-CDCSSo0U2.js";import{$S as s,Aa as c,Ab as l,Db as u,Eb as d,Et as f,Fa as p,Ma as m,Na as h,Pa as g,Sb as _,Tb as v,eC as y,ja as ee,jb as b,jt as x,kb as S,vt as C,wb as te}from"./loadAgentsDir-nzr38hai.js";import{D as w,E as T,O as E,U as D,l as O,p as k,z as A}from"./debug-IKW-jE7K.js";import{Gt as j,Kt as M,Wt as ne}from"./settings-5PQdphqC.js";import{M as N,j as P}from"./git-tyaWOgRL.js";import{o as F,s as I}from"./log-B3eB4EFv.js";import{i as L,n as R,r as z}from"./analytics-BotDBGh0.js";import{T as B,b as V,u as H}from"./startupProfiler-DxRQteII.js";import{vn as U,yn as W}from"./model-DfFA3qMO.js";import{n as G,t as K}from"./rcDebugLog-BUuD-X1D.js";import{c as q,d as re,f as J,n as Y,o as X,r as ie}from"./debugUtils-D2981c0Z.js";import{r as ae,t as oe}from"./datadog-DNCsyfSO.js";import{n as se,s as ce}from"./firstPartyEventLogger-hU-LPkje.js";import{a as le,t as ue}from"./types-Czs-_G1S.js";import{t as de}from"./lib-BlVGipXx.js";import{i as Z,n as Q,r as $}from"./cliLaunch-2AUoMnqx.js";import{t as fe}from"./capacityWake-CV_x9H8j.js";import{t as pe}from"./jwtUtils-C-ojmb8W.js";import{t as me}from"./pollConfig-C2Ac8WMU.js";import{i as he}from"./trustedDevice-BYCh1ff7.js";import{a as ge,i as _e,n as ve,r as ye,t as be}from"./workSecret-C_lv0dRh.js";import{hostname as xe,tmpdir as Se}from"os";import{basename as Ce,dirname as we,join as Te,resolve as Ee}from"path";import{createWriteStream as De}from"fs";import{randomUUID as Oe}from"crypto";import{spawn as ke}from"child_process";import{createInterface as Ae}from"readline";t(),D(),T(),P(),F(),R(),V(),U(),y(),oe(),se(),X(),K(),le(),m(),f(),Z(),i();var je=de();M(),a(),O(),S();var Me={type:`utf8`,errorCorrectionLevel:`L`,small:!0};async function Ne(e){return(await(0,je.toString)(e,Me)).split(`
|
|
2
|
-
`).filter(e=>e.length>0)}function Pe(e){let t=e.write??(e=>process.stdout.write(e)),n=e.verbose,i=0,a=`idle`,s=`Ready`,c=``,f=``,p=``,m=``,h=``,g=``,y=null,ee=[],x=!1,S=null,C=0,w=0,T=1,E=null,D=`single-session`,O=new Map,A=null,M=0;function N(e){let t=process.stdout.columns||80,n=0;for(let i of e.split(`
|
|
3
|
-
`)){if(i.length===0){n++;continue}let e=r(i);n+=Math.max(1,Math.ceil(e/t))}return e.endsWith(`
|
|
4
|
-
`)&&n--,n}function P(e){t(e),i+=N(e)}function F(){i<=0||(k(`[bridge:ui] clearStatusLines count=${i}`),t(`\x1b[${i}A`),t(`\x1B[J`),i=0)}function I(e){F(),t(e)}function L(e){Ne(e).then(e=>{ee=e,U()}).catch(e=>{k(`QR code generation failed: ${e}`,{level:`error`})})}function R(){F();let e=j[M%j.length],t=``;c&&(t+=o.dim(` · `)+o.dim(c)),f&&(t+=o.dim(` · `)+o.dim(f)),P(`${o.yellow(e)} ${o.yellow(`Connecting`)}${t}\n`)}function z(){V(),R(),A=setInterval(()=>{M++,R()},150)}function V(){A&&(clearInterval(A),A=null)}function U(){if(a===`reconnecting`||a===`failed`)return;F();let e=a===`idle`;if(x)for(let e of ee)P(`${o.dim(e)}\n`);let t=ne,n=e?o.green:o.cyan,r=(e?o.green:o.cyan)(s),i=``;if(c&&(i+=o.dim(` · `)+o.dim(c)),f&&D!==`worktree`&&(i+=o.dim(` · `)+o.dim(f)),process.env.USER_TYPE===`ant`&&p&&P(`${o.yellow(`[ANT-ONLY] Logs:`)} ${o.dim(p)}\n`),P(`${n(t)} ${r}${i}\n`),T>1){let e=D===`worktree`?`New sessions will be created in an isolated worktree`:`New sessions will be created in the current directory`;P(` ${o.dim(`Capacity: ${w}/${T} \u00b7 ${e}`)}\n`);for(let[,e]of O){let t=b(e.title?B(e.title,35):o.dim(`Attached`),e.url),n=e.activity;P(` ${t}${n&&n.type!==`result`&&n.type!==`error`?o.dim(` ${B(n.summary,40)}`):``}
|
|
5
|
-
`)}}if(T===1){let e=D===`single-session`?`Single session · exits when complete`:D===`worktree`?`Capacity: ${w}/1 \u00b7 New sessions will be created in an isolated worktree`:`Capacity: ${w}/1 \u00b7 New sessions will be created in the current directory`;P(` ${o.dim(e)}\n`)}T===1&&!e&&S&&Date.now()-C<3e4&&P(` ${o.dim(B(S,60))}\n`);let l=y??m;if(l){P(`
|
|
6
|
-
`);let t=e?u(l):te(l),n=x?o.dim.italic(`space to hide QR code`):o.dim.italic(`space to show QR code`),r=E?o.dim.italic(` · w to toggle spawn mode`):``;P(`${o.dim(t)}\n`),P(`${n}${r}\n`)}}return{printBanner(e,r){h=e.sessionIngressUrl,g=r,m=v(r,h),L(m),n&&t(o.dim(`Remote Control`)+` v0.0.1
|
|
7
|
-
`),n&&(e.spawnMode!==`single-session`&&(t(o.dim(`Spawn mode: `)+`${e.spawnMode}\n`),t(o.dim(`Max concurrent sessions: `)+`${e.maxSessions}\n`)),t(o.dim(`Environment ID: `)+`${r}\n`)),e.sandbox&&t(o.dim(`Sandbox: `)+`${o.green(`Enabled`)}\n`),t(`
|
|
8
|
-
`),z()},logSessionStart(e,t){if(n){let n=B(t,80);I(o.dim(`[${l()}]`)+` Session started: ${o.white(`"${n}"`)} (${o.dim(e)})\n`)}},logSessionComplete(e,t){I(o.dim(`[${l()}]`)+` Session ${o.green(`completed`)} (${H(t)}) ${o.dim(e)}\n`)},logSessionFailed(e,t){I(o.dim(`[${l()}]`)+` Session ${o.red(`failed`)}: ${t} ${o.dim(e)}\n`)},logStatus(e){I(o.dim(`[${l()}]`)+` ${e}\n`)},logVerbose(e){n&&I(o.dim(`[${l()}] ${e}`)+`
|
|
9
|
-
`)},logError(e){I(o.red(`[${l()}] Error: ${e}`)+`
|
|
10
|
-
`)},logReconnected(e){I(o.dim(`[${l()}]`)+` ${o.green(`Reconnected`)} after ${H(e)}\n`)},setRepoInfo(e,t){c=e,f=t},setDebugLogPath(e){p=e},updateIdleStatus(){V(),a=`idle`,s=`Ready`,S=null,C=0,y=null,L(m),U()},setAttached(e){V(),a=`attached`,s=`Connected`,S=null,C=0,T<=1&&(y=d(e,g,h),L(y)),U()},updateReconnectingStatus(e,t){if(V(),F(),a=`reconnecting`,x)for(let e of ee)P(`${o.dim(e)}\n`);let n=j[M%j.length];M++,P(`${o.yellow(n)} ${o.yellow(`Reconnecting`)} ${o.dim(`·`)} ${o.dim(`retrying in ${e}`)} ${o.dim(`·`)} ${o.dim(`disconnected ${t}`)}\n`)},updateFailedStatus(e){V(),F(),a=`failed`;let t=``;c&&(t+=o.dim(` · `)+o.dim(c)),f&&(t+=o.dim(` · `)+o.dim(f)),P(`${o.red(`×`)} ${o.red(`Remote Control Failed`)}${t}\n`),P(`${o.dim(_)}\n`),e&&P(`${o.red(e)}\n`)},updateSessionStatus(e,t,n,r){n.type===`tool_start`&&(S=n.summary,C=Date.now()),U()},clearStatus(){V(),F()},toggleQr(){x=!x,U()},updateSessionCount(e,t,n){w===e&&T===t&&D===n||(w=e,T=t,D=n)},setSpawnModeDisplay(e){E!==e&&(E=e,e&&(D=e))},addSession(e,t){O.set(e,{url:t})},updateSessionActivity(e,t){let n=O.get(e);n&&(n.activity=t)},setSessionTitle(e,t){let n=O.get(e);n&&(n.title=t,!(a===`reconnecting`||a===`failed`)&&(T===1&&(a=`titled`,s=B(t,40)),U()))},removeSession(e){O.delete(e)},refreshDisplay(){a===`reconnecting`||a===`failed`||U()}}}q();var Fe=10,Ie=10;function Le(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}var Re={Read:`Reading`,Write:`Writing`,Edit:`Editing`,MultiEdit:`Editing`,Bash:`Running`,Glob:`Searching`,Grep:`Searching`,WebFetch:`Fetching`,WebSearch:`Searching`,Task:`Running task`,FileReadTool:`Reading`,FileWriteTool:`Writing`,FileEditTool:`Editing`,GlobTool:`Searching`,GrepTool:`Searching`,BashTool:`Running`,NotebookEditTool:`Editing notebook`,LSP:`LSP`};function ze(e,t){let n=Re[e]??e,r=t.file_path??t.filePath??t.pattern??t.command?.slice(0,60)??t.url??t.query??``;return r?`${n} ${r}`:n}function Be(e,t,n){let r;try{r=w(e)}catch{return[]}if(!r||typeof r!=`object`)return[];let i=r,a=[],o=Date.now();switch(i.type){case`assistant`:{let e=i.message;if(!e)break;let r=e.content;if(!Array.isArray(r))break;for(let e of r){if(!e||typeof e!=`object`)continue;let r=e;if(r.type===`tool_use`){let e=r.name??`Tool`,i=r.input??{},s=ze(e,i);a.push({type:`tool_start`,summary:s,timestamp:o}),n(`[bridge:activity] sessionId=${t} tool_use name=${e} ${He(i)}`)}else if(r.type===`text`){let e=r.text??``;e.length>0&&(a.push({type:`text`,summary:e.slice(0,80),timestamp:o}),n(`[bridge:activity] sessionId=${t} text "${e.slice(0,100)}"`))}}break}case`result`:{let e=i.subtype;if(e===`success`)a.push({type:`result`,summary:`Session completed`,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=success`);else if(e){let r=i.errors?.[0]??`Error: ${e}`;a.push({type:`error`,summary:r,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=${e} error="${r}"`)}else n(`[bridge:activity] sessionId=${t} result subtype=undefined`);break}default:break}return a}function Ve(e){if(e.parent_tool_use_id!=null||e.isSynthetic||e.isReplay)return;let t=e.message?.content,n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let e of t)if(e&&typeof e==`object`&&e.type===`text`){n=e.text;break}}return n=n?.trim(),n||void 0}function He(e){let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`&&t.push(`${n}="${r.slice(0,100)}"`),t.length>=3)break;return t.join(` `)}function Ue(e){return{spawn(t,n){let r=Le(t.sessionId),i;if(e.debugFile){let t=e.debugFile.lastIndexOf(`.`);i=t>0?`${e.debugFile.slice(0,t)}-${r}${e.debugFile.slice(t)}`:`${e.debugFile}-${r}`}else(e.verbose||process.env.USER_TYPE===`ant`)&&(i=Te(Se(),`claude`,`bridge-session-${r}.log`));let a=null,o;e.debugFile&&(o=Te(we(e.debugFile),`bridge-transcript-${r}.jsonl`),a=De(o,{flags:`a`}),a.on(`error`,t=>{e.onDebug(`[bridge:session] Transcript write error: ${t.message}`),a=null}),e.onDebug(`[bridge:session] Transcript log: ${o}`));let s=[...e.scriptArgs,`--print`,`--sdk-url`,t.sdkUrl,`--session-id`,t.sessionId,`--input-format`,`stream-json`,`--output-format`,`stream-json`,`--replay-user-messages`,...e.verbose?[`--verbose`]:[],...i?[`--debug-file`,i]:[],...e.permissionMode?[`--permission-mode`,e.permissionMode]:[]],c={...e.env,CLAUDE_CODE_OAUTH_TOKEN:void 0,CLAUDE_CODE_ENVIRONMENT_KIND:`bridge`,...e.sandbox&&{CLAUDE_CODE_FORCE_SANDBOX:`1`},CLAUDE_CODE_SESSION_ACCESS_TOKEN:t.accessToken,CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2:`1`,...t.useCcrV2&&{CLAUDE_CODE_USE_CCR_V2:`1`,CLAUDE_CODE_WORKER_EPOCH:String(t.workerEpoch)}};e.onDebug(`[bridge:session] Spawning sessionId=${t.sessionId} sdkUrl=${t.sdkUrl} accessToken=${t.accessToken?`present`:`MISSING`}`),e.onDebug(`[bridge:session] Child args: ${s.join(` `)}`),i&&e.onDebug(`[bridge:session] Debug log: ${i}`);let l=ke(e.execPath,s,{cwd:n,stdio:[`pipe`,`pipe`,`pipe`],env:c,windowsHide:!0});e.onDebug(`[bridge:session] sessionId=${t.sessionId} pid=${l.pid}`);let u=[],d=null,f=[],p=!1,m=!1;l.stderr&&Ae({input:l.stderr}).on(`line`,t=>{e.verbose&&process.stderr.write(t+`
|
|
11
|
-
`),f.length>=Ie&&f.shift(),f.push(t)}),l.stdout&&Ae({input:l.stdout}).on(`line`,n=>{a&&a.write(n+`
|
|
12
|
-
`),e.onDebug(`[bridge:ws] sessionId=${t.sessionId} <<< ${Y(n)}`),e.verbose&&process.stderr.write(n+`
|
|
13
|
-
`);let r=Be(n,t.sessionId,e.onDebug);for(let n of r)u.length>=Fe&&u.shift(),u.push(n),d=n,e.onActivity?.(t.sessionId,n);{let r;try{r=w(n)}catch{}if(r&&typeof r==`object`){let n=r;if(n.type===`control_request`)n.request?.subtype===`can_use_tool`&&e.onPermissionRequest&&e.onPermissionRequest(t.sessionId,r,t.accessToken);else if(n.type===`user`&&!m&&t.onFirstUserMessage){let e=Ve(n);e&&(m=!0,t.onFirstUserMessage(e))}}}});let h=new Promise(n=>{l.on(`close`,(r,i)=>{a&&(a.end(),a=null),i===`SIGTERM`||i===`SIGINT`?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} interrupted signal=${i} pid=${l.pid}`),n(`interrupted`)):r===0?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} completed exit_code=0 pid=${l.pid}`),n(`completed`)):(e.onDebug(`[bridge:session] sessionId=${t.sessionId} failed exit_code=${r} pid=${l.pid}`),n(`failed`))}),l.on(`error`,r=>{e.onDebug(`[bridge:session] sessionId=${t.sessionId} spawn error: ${r.message}`),n(`failed`)})}),g={sessionId:t.sessionId,done:h,activities:u,accessToken:t.accessToken,lastStderr:f,get currentActivity(){return d},kill(){l.killed||(e.onDebug(`[bridge:session] Sending SIGTERM to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGTERM`))},forceKill(){!p&&l.pid&&(p=!0,e.onDebug(`[bridge:session] Sending SIGKILL to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGKILL`))},writeStdin(n){l.stdin&&!l.stdin.destroyed&&(e.onDebug(`[bridge:ws] sessionId=${t.sessionId} >>> ${Y(n)}`),l.stdin.write(n))},updateAccessToken(n){g.accessToken=n,g.writeStdin(E({type:`update_environment_variables`,variables:{CLAUDE_CODE_SESSION_ACCESS_TOKEN:n}})+`
|
|
14
|
-
`),e.onDebug(`[bridge:session] Sent token refresh via stdin for sessionId=${t.sessionId}`)}};return g}}}O(),S(),X();var We={connInitialMs:2e3,connCapMs:12e4,connGiveUpMs:6e5,generalInitialMs:500,generalCapMs:3e4,generalGiveUpMs:6e5},Ge=1e3,Ke=32;async function qe(){return!1}function Je(e){return e.connCapMs*2}function Ye(){let e=[...Q()],t=$();return t&&e.push(t),e}function Xe(e,t,n){try{return e.spawn(t,n)}catch(e){let t=A(e);return I(Error(`Session spawn failed: ${t}`)),t}}async function Ze(t,r,i,a,o,l,u,d=We,f,m){let _=new AbortController;u.aborted?_.abort():u.addEventListener(`abort`,()=>_.abort(),{once:!0});let v=_.signal,y=new Map,ee=new Map,b=new Map,S=new Map,te=new Map,w=new Map,T=new Set,E=new Map,D=new Set,O=new Set,j=fe(v);async function M(){G(`heartbeat: checking ${y.size} active session(s)`);let e=!1,t=!1,n=[];for(let[i]of y){let o=b.get(i),s=te.get(i);if(!(!o||!s))try{await a.heartbeatWork(r,o,s),e=!0}catch(e){k(`[bridge:heartbeat] Failed for sessionId=${i} workId=${o}: ${A(e)}`),e instanceof c&&(z(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),e.status===401||e.status===403?n.push(i):t=!0)}}for(let e of n){l.logVerbose(`Session ${e} token expired — re-queuing via bridge/reconnect`);try{await a.reconnectSession(r,e),k(`[bridge:heartbeat] Re-queued sessionId=${e} via bridge/reconnect`)}catch(t){l.logError(`Failed to refresh session ${e} token: ${A(t)}`),k(`[bridge:heartbeat] reconnectSession(${e}) failed: ${A(t)}`,{level:`error`})}}return t?`fatal`:n.length>0?`auth_failed`:e?`ok`:`failed`}let ne=new Set,P=m?pe({getAccessToken:m,onRefresh:(e,t)=>{let n=y.get(e);n&&(ne.has(e)?(l.logVerbose(`Refreshing session ${e} token via bridge/reconnect`),a.reconnectSession(r,e).catch(t=>{l.logError(`Failed to refresh session ${e} token: ${A(t)}`),k(`[bridge:token] reconnectSession(${e}) failed: ${A(t)}`,{level:`error`})})):n.updateAccessToken(t))},label:`bridge`}):null,F=Date.now(),L=new Set;function R(e){L.add(e),e.finally(()=>L.delete(e))}let B=0,V=0,U=null,K=null,q=null,J=null,Y=!1;if(k(`[bridge:work] Starting poll loop spawnMode=${t.spawnMode} maxSessions=${t.maxSessions} environmentId=${r}`),N(`info`,`bridge_loop_started`,{max_sessions:t.maxSessions,spawn_mode:t.spawnMode}),process.env.USER_TYPE===`ant`){let e;if(t.debugFile){let n=t.debugFile.lastIndexOf(`.`);e=n>0?`${t.debugFile.slice(0,n)}-*${t.debugFile.slice(n)}`:`${t.debugFile}-*`}else e=Te(Se(),`claude`,`bridge-session-*.log`);l.setDebugLogPath(e)}l.printBanner(t,r),l.updateSessionCount(0,t.maxSessions,t.spawnMode),f&&l.setAttached(f);function X(){l.updateSessionCount(y.size,t.maxSessions,t.spawnMode);for(let[e,t]of y){let n=t.currentActivity;n&&l.updateSessionActivity(S.get(e)??e,n)}if(y.size===0){l.updateIdleStatus();return}let[e,n]=[...y.entries()].pop(),r=ee.get(e);if(!r)return;let i=n.currentActivity;if(!i||i.type===`result`||i.type===`error`){t.maxSessions>1&&l.refreshDisplay();return}let a=H(Date.now()-r),o=n.activities.filter(e=>e.type===`tool_start`).slice(-5).map(e=>e.summary);l.updateSessionStatus(e,a,i,o)}function ae(){oe(),X(),J=setInterval(X,Ge)}function oe(){J&&(clearInterval(J),J=null)}function se(e,n,i){return o=>{let s=b.get(e);G(`session done: sessionId=${e} workId=${s??`none`} status=${o} wasTimedOut=${D.has(e)} duration=${Math.round((Date.now()-n)/1e3)}s stderr=${i.lastStderr.length>0?i.lastStderr.join(`\\n`).slice(0,500):`(none)`}`),y.delete(e),ee.delete(e),b.delete(e),te.delete(e);let c=S.get(e)??e;S.delete(e),l.removeSession(c),O.delete(c),ne.delete(e);let u=w.get(e);u&&(clearTimeout(u),w.delete(e)),P?.cancel(e),j.wake();let f=D.delete(e),p=f&&o===`interrupted`?`failed`:o,m=Date.now()-n;k(`[bridge:session] sessionId=${e} workId=${s??`unknown`} exited status=${p} duration=${H(m)}`),z(`tengu_bridge_session_done`,{status:p,duration_ms:m}),N(`info`,`bridge_session_done`,{status:p,duration_ms:m}),l.clearStatus(),oe();let h=i.lastStderr.length>0?i.lastStderr.join(`
|
|
15
|
-
`):void 0,g;switch(p){case`completed`:l.logSessionComplete(e,m);break;case`failed`:!f&&!v.aborted&&(g=h??`Process exited with error`,l.logSessionFailed(e,g),I(Error(`Bridge session failed: ${g}`)));break;case`interrupted`:l.logVerbose(`Session ${e} interrupted`);break}p!==`interrupted`&&s&&(R(rt(a,r,s,l,d.stopWorkBaseDelayMs)),T.add(s));let C=E.get(e);if(C&&(E.delete(e),R(x(C.worktreePath,C.worktreeBranch,C.gitRoot,C.hookBased).catch(e=>l.logVerbose(`Failed to remove worktree ${C.worktreePath}: ${A(e)}`)))),p!==`interrupted`&&!v.aborted)if(t.spawnMode!==`single-session`)R(a.archiveSession(c).catch(t=>l.logVerbose(`Failed to archive session ${e}: ${A(t)}`))),k(`[bridge:session] Session ${p}, returning to idle (multi-session mode)`);else{k(`[bridge:session] Session ${p}, aborting poll loop to tear down environment`),_.abort();return}v.aborted||ae()}}for(f||ae();!v.aborted;){let u=me();try{G(`poll: envId=${r} activeSessions=${y.size}`);let c=await a.pollForWork(r,i,v,u.reclaim_older_than_ms);if(U!==null||K!==null){let e=Date.now()-(U??K??Date.now());l.logReconnected(e),k(`[bridge:poll] Reconnected after ${H(e)}`),z(`tengu_bridge_reconnected`,{disconnected_ms:e})}if(B=0,V=0,U=null,K=null,q=null,!c){if(y.size>=t.maxSessions){let e=u.multisession_poll_interval_ms_at_capacity;if(u.non_exclusive_heartbeat_interval_ms>0){z(`tengu_bridge_heartbeat_mode_entered`,{active_sessions:y.size,heartbeat_interval_ms:u.non_exclusive_heartbeat_interval_ms});let n=e>0?Date.now()+e:null,r=`ok`,i=0;for(;!v.aborted&&y.size>=t.maxSessions&&(n===null||Date.now()<n);){let e=me();if(e.non_exclusive_heartbeat_interval_ms<=0)break;let t=j.signal();if(r=await M(),r===`auth_failed`||r===`fatal`){t.cleanup();break}i++,await W(e.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}let a=r===`auth_failed`||r===`fatal`?r:v.aborted?`shutdown`:y.size<t.maxSessions?`capacity_changed`:n!==null&&Date.now()>=n?`poll_due`:`config_disabled`;if(z(`tengu_bridge_heartbeat_mode_exited`,{reason:a,heartbeat_cycles:i,active_sessions:y.size}),a===`poll_due`&&k(`[bridge:poll] Heartbeat poll_due after ${i} cycles — falling through to pollForWork`),r===`auth_failed`||r===`fatal`){let t=j.signal();await W(e>0?e:u.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}}else if(e>0){let t=j.signal();await W(e,t.signal),t.cleanup()}}else await W(y.size>0?u.multisession_poll_interval_ms_partial_capacity:u.multisession_poll_interval_ms_not_at_capacity,v);continue}let m=y.size>=t.maxSessions;if(T.has(c.id)){if(k(`[bridge:work] Skipping already-completed workId=${c.id}`),m){let e=j.signal();u.non_exclusive_heartbeat_interval_ms>0?(await M(),await W(u.non_exclusive_heartbeat_interval_ms,e.signal)):u.multisession_poll_interval_ms_at_capacity>0&&await W(u.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}else await W(1e3,v);continue}let h;try{h=ye(c.secret)}catch(e){let t=A(e);if(l.logError(`Failed to decode work secret for workId=${c.id}: ${t}`),z(`tengu_bridge_work_secret_failed`,{}),T.add(c.id),R(rt(a,r,c.id,l,d.stopWorkBaseDelayMs)),m){let e=j.signal();u.non_exclusive_heartbeat_interval_ms>0?(await M(),await W(u.non_exclusive_heartbeat_interval_ms,e.signal)):u.multisession_poll_interval_ms_at_capacity>0&&await W(u.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}continue}let g=async()=>{k(`[bridge:work] Acknowledging workId=${c.id}`);try{await a.acknowledgeWork(r,c.id,h.session_ingress_token)}catch(e){k(`[bridge:work] Acknowledge failed workId=${c.id}: ${A(e)}`)}},_=c.data.type;switch(c.data.type){case`healthcheck`:await g(),k(`[bridge:work] Healthcheck received`),l.logVerbose(`Healthcheck received`);break;case`session`:{let i=c.data.id;G(`work received: type=session sessionId=${i} workId=${c.id}`);try{p(i,`session_id`)}catch{await g(),l.logError(`Invalid session_id received: ${i}`);break}let u=y.get(i);if(u){u.updateAccessToken(h.session_ingress_token),te.set(i,h.session_ingress_token),b.set(i,c.id),P?.schedule(i,h.session_ingress_token),k(`[bridge:work] Updated access token for existing sessionId=${i} workId=${c.id}`),await g();break}if(y.size>=t.maxSessions){k(`[bridge:work] At capacity (${y.size}/${t.maxSessions}), cannot spawn new session for workId=${c.id}`);break}await g();let m=Date.now(),_,j=!1,M;if(h.use_code_sessions===!0||e(process.env.CLAUDE_BRIDGE_USE_CCR_V2)){_=be(t.apiBaseUrl,i);for(let e=1;e<=2;e++)try{M=await _e(_,h.session_ingress_token),j=!0,k(`[bridge:session] CCR v2: registered worker sessionId=${i} epoch=${M} attempt=${e}`);break}catch(t){let n=A(t);if(e<2){if(k(`[bridge:session] CCR v2: registerWorker attempt ${e} failed, retrying: ${n}`),await W(2e3,v),v.aborted)break;continue}l.logError(`CCR v2 worker registration failed for session ${i}: ${n}`),I(Error(`registerWorker failed: ${n}`)),T.add(c.id),R(rt(a,r,c.id,l,d.stopWorkBaseDelayMs))}if(!j)break}else _=ve(t.sessionIngressUrl,i);let F=t.spawnMode,L=t.dir,B=0;if(F===`worktree`&&(f===void 0||!ge(i,f))){let e=Date.now();try{let t=await C(`bridge-${Le(i)}`);B=Date.now()-e,E.set(i,{worktreePath:t.worktreePath,worktreeBranch:t.worktreeBranch,gitRoot:t.gitRoot,hookBased:t.hookBased}),L=t.worktreePath,k(`[bridge:session] Created worktree for sessionId=${i} at ${t.worktreePath}`)}catch(e){let t=A(e);l.logError(`Failed to create worktree for session ${i}: ${t}`),I(Error(`Worktree creation failed: ${t}`)),T.add(c.id),R(rt(a,r,c.id,l,d.stopWorkBaseDelayMs));break}}k(`[bridge:session] Spawning sessionId=${i} sdkUrl=${_}`);let V=re(i);G(`spawning session: sessionId=${i} sdkUrl=${_} useCcrV2=${j} workerEpoch=${M} dir=${L} accessToken=${h.session_ingress_token?h.session_ingress_token.slice(0,8)+`...`:`NONE`}`);let H=Xe(o,{sessionId:i,sdkUrl:_,accessToken:h.session_ingress_token,useCcrV2:j,workerEpoch:M,onFirstUserMessage:e=>{if(O.has(V))return;O.add(V);let n=dt(e);l.setSessionTitle(V,n),k(`[bridge:title] derived title for ${V}: ${n}`),import(`./createSession-DM4acqaC.js`).then(({updateBridgeSessionTitle:e})=>e(V,n,{baseUrl:t.apiBaseUrl})).catch(e=>k(`[bridge:title] failed to update title for ${V}: ${e}`,{level:`error`}))}},L);if(typeof H==`string`){l.logError(`Failed to spawn session ${i}: ${H}`);let e=E.get(i);e&&(E.delete(i),R(x(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased).catch(t=>l.logVerbose(`Failed to remove worktree ${e.worktreePath}: ${A(t)}`)))),T.add(c.id),R(rt(a,r,c.id,l,d.stopWorkBaseDelayMs));break}let U=H,K=Date.now()-m;z(`tengu_bridge_session_started`,{active_sessions:y.size,spawn_mode:F,in_worktree:E.has(i),spawn_duration_ms:K,worktree_create_ms:B,inProtectedNamespace:n()}),N(`info`,`bridge_session_started`,{spawn_mode:F,in_worktree:E.has(i),spawn_duration_ms:K,worktree_create_ms:B}),y.set(i,U),b.set(i,c.id),te.set(i,h.session_ingress_token),S.set(i,V);let q=Date.now();ee.set(i,q),l.logSessionStart(i,`Session ${i}`);let J=Le(i),Y;if(t.debugFile){let e=t.debugFile.lastIndexOf(`.`);Y=e>0?`${t.debugFile.slice(0,e)}-${J}${t.debugFile.slice(e)}`:`${t.debugFile}-${J}`}else(t.verbose||process.env.USER_TYPE===`ant`)&&(Y=Te(Se(),`claude`,`bridge-session-${J}.log`));Y&&l.logVerbose(`Debug log: ${Y}`),l.addSession(V,s(V,t.sessionIngressUrl)),ae(),l.setAttached(V),ft(V,t.apiBaseUrl).then(e=>{e&&y.has(i)&&(O.add(V),l.setSessionTitle(V,e),k(`[bridge:title] server title for ${V}: ${e}`))}).catch(e=>k(`[bridge:title] failed to fetch title for ${V}: ${e}`,{level:`error`}));let X=t.sessionTimeoutMs??864e5;if(X>0){let e=setTimeout(it,X,i,X,l,D,U);w.set(i,e)}j&&ne.add(i),P?.schedule(i,h.session_ingress_token),U.done.then(se(i,q,U));break}default:await g(),k(`[bridge:work] Unknown work type: ${_}, skipping`);break}if(m){let e=j.signal();u.non_exclusive_heartbeat_interval_ms>0?(await M(),await W(u.non_exclusive_heartbeat_interval_ms,e.signal)):u.multisession_poll_interval_ms_at_capacity>0&&await W(u.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}}catch(e){if(v.aborted)break;if(e instanceof c){Y=!0,h(e.errorType)?l.logStatus(e.message):g(e)?k(`[bridge:work] Suppressed 403 error: ${e.message}`):(l.logError(e.message),I(e)),z(`tengu_bridge_fatal_error`,{status:e.status,error_type:e.errorType}),N(h(e.errorType)?`info`:`error`,`bridge_fatal_error`,{status:e.status,error_type:e.errorType});break}let t=ie(e);if(G(`poll error: ${t} isConn=${$e(e)} isServer=${et(e)} activeSessions=${y.size}`),$e(e)||et(e)){let e=Date.now();q!==null&&e-q>Je(d)&&(k(`[bridge:work] Detected system sleep (${Math.round((e-q)/1e3)}s gap), resetting error budget`),N(`info`,`bridge_poll_sleep_detected`,{gapMs:e-q}),U=null,B=0,K=null,V=0),q=e,U||(U=e);let n=e-U;if(n>=d.connGiveUpMs){l.logError(`Server unreachable for ${Math.round(n/6e4)} minutes, giving up.`),z(`tengu_bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),N(`error`,`bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),Y=!0;break}K=null,V=0,B=B?Math.min(B*2,d.connCapMs):d.connInitialMs;let r=tt(B);l.logVerbose(`Connection error, retrying in ${nt(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),l.updateReconnectingStatus(nt(r),H(n)),me().non_exclusive_heartbeat_interval_ms>0&&await M(),await W(r,v)}else{let e=Date.now();q!==null&&e-q>Je(d)&&(k(`[bridge:work] Detected system sleep (${Math.round((e-q)/1e3)}s gap), resetting error budget`),N(`info`,`bridge_poll_sleep_detected`,{gapMs:e-q}),U=null,B=0,K=null,V=0),q=e,K||(K=e);let n=e-K;if(n>=d.generalGiveUpMs){l.logError(`Persistent errors for ${Math.round(n/6e4)} minutes, giving up.`),z(`tengu_bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),N(`error`,`bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),Y=!0;break}U=null,B=0,V=V?Math.min(V*2,d.generalCapMs):d.generalInitialMs;let r=tt(V);l.logVerbose(`Poll failed, retrying in ${nt(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),l.updateReconnectingStatus(nt(r),H(n)),me().non_exclusive_heartbeat_interval_ms>0&&await M(),await W(r,v)}}}oe(),l.clearStatus();let ce=Date.now()-F;z(`tengu_bridge_shutdown`,{active_sessions:y.size,loop_duration_ms:ce}),N(`info`,`bridge_shutdown`,{active_sessions:y.size,loop_duration_ms:ce});let le=new Set(y.keys());f&&le.add(f);let ue=new Map(S);if(y.size>0){k(`[bridge:shutdown] Shutting down ${y.size} active session(s)`),l.logStatus(`Shutting down ${y.size} active session(s)\u2026`);let e=new Map(b);for(let[e,t]of y.entries())k(`[bridge:shutdown] Sending SIGTERM to sessionId=${e}`),t.kill();let t=new AbortController;await Promise.race([Promise.allSettled([...y.values()].map(e=>e.done)),W(d.shutdownGraceMs??3e4,t.signal)]),t.abort();for(let[e,t]of y.entries())k(`[bridge:shutdown] Force-killing stuck sessionId=${e}`),t.forceKill();for(let e of w.values())clearTimeout(e);if(w.clear(),P?.cancelAll(),E.size>0){let e=[...E.values()];E.clear(),k(`[bridge:shutdown] Cleaning up ${e.length} worktree(s)`),await Promise.allSettled(e.map(e=>x(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased)))}await Promise.allSettled([...e.entries()].map(([e,t])=>a.stopWork(r,t,!0).catch(n=>l.logVerbose(`Failed to stop work ${t} for session ${e}: ${A(n)}`))))}if(L.size>0&&await Promise.allSettled([...L]),t.spawnMode===`single-session`&&f&&!Y){l.logStatus("Resume this session by running `claude remote-control --continue`"),k(`[bridge:shutdown] Skipping archive+deregister to allow resume of session ${f}`);return}le.size>0&&(k(`[bridge:shutdown] Archiving ${le.size} session(s)`),await Promise.allSettled([...le].map(e=>a.archiveSession(ue.get(e)??re(e)).catch(t=>l.logVerbose(`Failed to archive session ${e}: ${A(t)}`)))));try{await a.deregisterEnvironment(r),k(`[bridge:shutdown] Environment deregistered, bridge offline`),l.logVerbose(`Environment deregistered.`)}catch(e){l.logVerbose(`Failed to deregister environment: ${A(e)}`)}let{clearBridgePointer:de}=await import(`./bridgePointer-W_jdQ8zf.js`);await de(t.dir),l.logVerbose(`Environment offline.`)}var Qe=new Set([`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`ENETUNREACH`,`EHOSTUNREACH`]);function $e(e){return!!(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&Qe.has(e.code))}function et(e){return!!e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&e.code===`ERR_BAD_RESPONSE`}function tt(e){return Math.max(0,e+e*.25*(2*Math.random()-1))}function nt(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}async function rt(e,t,n,r,i=1e3){for(let a=1;a<=3;a++)try{await e.stopWork(t,n,!1),k(`[bridge:work] stopWork succeeded for workId=${n} on attempt ${a}/3`);return}catch(e){if(e instanceof c){g(e)?k(`[bridge:work] Suppressed stopWork 403 for ${n}: ${e.message}`):r.logError(`Failed to stop work ${n}: ${e.message}`),N(`error`,`bridge_stop_work_failed`,{attempts:a,fatal:!0});return}let t=A(e);if(a<3){let e=tt(i*2**(a-1));r.logVerbose(`Failed to stop work ${n} (attempt ${a}/3), retrying in ${nt(e)}: ${t}`),await W(e)}else r.logError(`Failed to stop work ${n} after 3 attempts: ${t}`),N(`error`,`bridge_stop_work_failed`,{attempts:3})}}function it(e,t,n,r,i){k(`[bridge:session] sessionId=${e} timed out after ${H(t)}`),z(`tengu_bridge_session_timeout`,{timeout_ms:t}),n.logSessionFailed(e,`Session timed out after ${H(t)}`),r.add(e),i.kill()}var at=[`session`,`same-dir`,`worktree`];function ot(e){return e===`session`?`single-session`:e===`same-dir`?`same-dir`:e===`worktree`?`worktree`:`--spawn requires one of: ${at.join(`, `)} (got: ${e??`<missing>`})`}function st(e){let t=e===void 0?NaN:parseInt(e,10);return isNaN(t)||t<1?`--capacity requires a positive integer (got: ${e??`<missing>`})`:t}function ct(e){let t=!1,n=!1,r,i,a,o,s=!1,c,l,u,d,f=!1;for(let m=0;m<e.length;m++){let h=e[m];if(h===`--help`||h===`-h`)s=!0;else if(h===`--verbose`||h===`-v`)t=!0;else if(h===`--sandbox`)n=!0;else if(h===`--no-sandbox`)n=!1;else if(h===`--debug-file`&&m+1<e.length)r=Ee(e[++m]);else if(h.startsWith(`--debug-file=`))r=Ee(h.slice(13));else if(h===`--session-timeout`&&m+1<e.length)i=parseInt(e[++m],10)*1e3;else if(h.startsWith(`--session-timeout=`))i=parseInt(h.slice(18),10)*1e3;else if(h===`--permission-mode`&&m+1<e.length)a=e[++m];else if(h.startsWith(`--permission-mode=`))a=h.slice(18);else if(h===`--name`&&m+1<e.length)o=e[++m];else if(h.startsWith(`--name=`))o=h.slice(7);else if(h===`--session-id`&&m+1<e.length){if(d=e[++m],!d)return p(`--session-id requires a value`)}else if(h.startsWith(`--session-id=`)){if(d=h.slice(13),!d)return p(`--session-id requires a value`)}else if(h===`--continue`||h===`-c`)f=!0;else if(h===`--spawn`||h.startsWith(`--spawn=`)){if(c!==void 0)return p(`--spawn may only be specified once`);let t=ot(h.startsWith(`--spawn=`)?h.slice(8):e[++m]);if(t===`single-session`||t===`same-dir`||t===`worktree`)c=t;else return p(t)}else if(h===`--capacity`||h.startsWith(`--capacity=`)){if(l!==void 0)return p(`--capacity may only be specified once`);let t=st(h.startsWith(`--capacity=`)?h.slice(11):e[++m]);if(typeof t==`number`)l=t;else return p(t)}else if(h===`--create-session-in-dir`)u=!0;else if(h===`--no-create-session-in-dir`)u=!1;else return p(`Unknown argument: ${h}\nRun 'claude remote-control --help' for usage.`)}if(c===`single-session`&&l!==void 0)return p(`--capacity cannot be used with --spawn=session (single-session mode has fixed capacity 1).`);if((d||f)&&(c!==void 0||l!==void 0||u!==void 0))return p(`--session-id and --continue cannot be used with --spawn, --capacity, or --create-session-in-dir.`);if(d&&f)return p(`--session-id and --continue cannot be used together.`);return{verbose:t,sandbox:n,debugFile:r,sessionTimeoutMs:i,permissionMode:a,name:o,spawnMode:c,capacity:l,createSessionInDir:u,sessionId:d,continueSession:f,help:s};function p(e){return{verbose:t,sandbox:n,debugFile:r,sessionTimeoutMs:i,permissionMode:a,name:o,spawnMode:c,capacity:l,createSessionInDir:u,sessionId:d,continueSession:f,help:s,error:e}}}async function lt(){let{EXTERNAL_PERMISSION_MODES:e}=await import(`./permissions-CeYKbtSC.js`),t=e.join(`, `),n=await qe(),r=`
|
|
16
|
-
Remote Control - Connect your local environment to claude.ai/code
|
|
17
|
-
|
|
18
|
-
USAGE
|
|
19
|
-
claude remote-control [options]
|
|
20
|
-
OPTIONS
|
|
21
|
-
--name <name> Name for the session (shown in claude.ai/code)
|
|
22
|
-
-c, --continue Resume the last session in this directory
|
|
23
|
-
--session-id <id> Resume a specific session by ID (cannot be
|
|
24
|
-
used with spawn flags or --continue)
|
|
25
|
-
--permission-mode <mode> Permission mode for spawned sessions
|
|
26
|
-
(${t})
|
|
27
|
-
--debug-file <path> Write debug logs to file
|
|
28
|
-
-v, --verbose Enable verbose output
|
|
29
|
-
-h, --help Show this help
|
|
30
|
-
${n?` --spawn <mode> Spawn mode: same-dir, worktree, session
|
|
31
|
-
(default: same-dir)
|
|
32
|
-
--capacity <N> Max concurrent sessions in worktree or
|
|
33
|
-
same-dir mode (default: ${Ke})
|
|
34
|
-
--[no-]create-session-in-dir Pre-create a session in the current
|
|
35
|
-
directory; in worktree mode this session
|
|
36
|
-
stays in cwd while on-demand sessions get
|
|
37
|
-
isolated worktrees (default: on)
|
|
38
|
-
`:``}
|
|
39
|
-
DESCRIPTION
|
|
40
|
-
Remote Control allows you to control sessions on your local device from
|
|
41
|
-
claude.ai/code (https://claude.ai/code). Run this command in the
|
|
42
|
-
directory you want to work in, then connect from the Claude app or web.
|
|
43
|
-
${n?`
|
|
44
|
-
Remote Control runs as a persistent server that accepts multiple concurrent
|
|
45
|
-
sessions in the current directory. One session is pre-created on start so
|
|
46
|
-
you have somewhere to type immediately. Use --spawn=worktree to isolate
|
|
47
|
-
each on-demand session in its own git worktree, or --spawn=session for
|
|
48
|
-
the classic single-session mode (exits when that session ends). Press 'w'
|
|
49
|
-
during runtime to toggle between same-dir and worktree.
|
|
50
|
-
`:``}
|
|
51
|
-
NOTES
|
|
52
|
-
- You must be logged in with a Claude account that has a subscription
|
|
53
|
-
- Run \`claude\` first in the directory to accept the workspace trust dialog
|
|
54
|
-
${n?` - Worktree mode requires a git repository or WorktreeCreate/WorktreeRemove hooks
|
|
55
|
-
`:``}`;console.log(r)}var ut=80;function dt(e){return B(e.replace(/\s+/g,` `).trim(),ut)}async function ft(e,t){let{getBridgeSession:n}=await import(`./createSession-DM4acqaC.js`);return(await n(e,{baseUrl:t}))?.title||void 0}async function pt(e){let t=ct(e);if(t.help){await lt();return}t.error&&(console.error(`Error: ${t.error}`),process.exit(1));let{verbose:n,sandbox:r,debugFile:i,sessionTimeoutMs:a,permissionMode:o,name:s,spawnMode:l,capacity:u,createSessionInDir:d,sessionId:f,continueSession:m}=t,h=f,g,_=l!==void 0||u!==void 0||d!==void 0;if(o!==void 0){let{PERMISSION_MODES:e}=await import(`./permissions-CeYKbtSC.js`),t=e;t.includes(o)||(console.error(`Error: Invalid permission mode '${o}'. Valid modes: ${t.join(`, `)}`),process.exit(1))}let v=Ee(`.`),{enableConfigs:y,checkHasTrustDialogAccepted:b}=await import(`./config-BrxKpHpR.js`);y();let{initSinks:x}=await import(`./sinks-jfaIjsRJ.js`);x();let S=await qe();_&&!S&&(await L(`tengu_bridge_multi_session_denied`,{used_spawn:l!==void 0,used_capacity:u!==void 0,used_create_session_in_dir:d!==void 0}),await Promise.race([Promise.all([ce(),ae()]),W(500,void 0,{unref:!0})]).catch(()=>{}),console.error(`Error: Multi-session Remote Control is not enabled for your account yet.`),process.exit(1));let{setOriginalCwd:C,setCwdState:te}=await import(`./state-53JDbNQM.js`);C(v),te(v),b()||(console.error(`Error: Workspace not trusted. Please run \`claude\` in ${v} first to review and accept the workspace trust dialog.`),process.exit(1));let{clearOAuthTokenCache:w,checkAndRefreshOAuthTokenIfNeeded:T}=await import(`./auth-CEig4Gxp.js`),{getBridgeAccessToken:E,getBridgeBaseUrl:D}=await import(`./bridgeConfig-D5dB38xD.js`);E()||(console.error(ue),process.exit(1));let{getGlobalConfig:O,saveGlobalConfig:j,getCurrentProjectConfig:M,saveCurrentProjectConfig:ne}=await import(`./config-BrxKpHpR.js`);if(!O().remoteDialogSeen){let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout});console.log(`
|
|
56
|
-
Remote Control lets you access this CLI session from the web (claude.ai/code)
|
|
57
|
-
or the Claude app, so you can pick up where you left off on any device.
|
|
58
|
-
|
|
59
|
-
You can disconnect remote access anytime by running /remote-control again.
|
|
60
|
-
`);let t=await new Promise(t=>{e.question(`Enable Remote Control? (y/n) `,t)});e.close(),j(e=>e.remoteDialogSeen?e:{...e,remoteDialogSeen:!0}),t.toLowerCase()!==`y`&&t.toLowerCase()!==`yes`&&process.exit(0)}if(m){let{readBridgePointerAcrossWorktrees:e}=await import(`./bridgePointer-W_jdQ8zf.js`),t=await e(v);t||(console.error("Error: No recent session found in this directory or its worktrees. Run `claude remote-control` to start a new one."),process.exit(1));let{pointer:n,dir:r}=t,i=Math.round(n.ageMs/6e4),a=i<60?`${i}m`:`${Math.round(i/60)}h`,o=r===v?``:` from worktree ${r}`;console.error(`Resuming session ${n.sessionId} (${a} ago)${o}\u2026`),h=n.sessionId,g=r}let P=D();P.startsWith(`http://`)&&!P.includes(`localhost`)&&!P.includes(`127.0.0.1`)&&(console.error(`Error: Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`),process.exit(1));let F=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||P,{getBranch:R,getRemoteUrl:B,findGitRoot:V}=await import(`./git-BE_FiJZp.js`),{hasWorktreeCreateHook:H}=await import(`./hooks-DONAb_nq.js`),U=H()||V(v)!==null,G=S?M().remoteControlSpawnMode:void 0;if(G===`worktree`&&!U&&(console.error(`Warning: Saved spawn mode is worktree but this directory is not a git repository. Falling back to same-dir.`),G=void 0,ne(e=>e.remoteControlSpawnMode===void 0?e:{...e,remoteControlSpawnMode:void 0})),S&&!G&&U&&l===void 0&&!h&&process.stdin.isTTY){let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout});console.log(`
|
|
61
|
-
Claude Remote Control is launching in spawn mode which lets you create new sessions in this project from Claude Code on Web or your Mobile app. Learn more here: https://code.claude.com/docs/en/remote-control
|
|
62
|
-
|
|
63
|
-
Spawn mode for this project:
|
|
64
|
-
[1] same-dir — sessions share the current directory (default)
|
|
65
|
-
[2] worktree — each session gets an isolated git worktree
|
|
66
|
-
|
|
67
|
-
This can be changed later or explicitly set with --spawn=same-dir or --spawn=worktree.
|
|
68
|
-
`);let t=await new Promise(t=>{e.question(`Choose [1/2] (default: 1): `,t)});e.close();let n=t.trim()===`2`?`worktree`:`same-dir`;G=n,z(`tengu_bridge_spawn_mode_chosen`,{spawn_mode:n}),ne(e=>e.remoteControlSpawnMode===n?e:{...e,remoteControlSpawnMode:n})}let K,q;h?(q=`single-session`,K=`resume`):l===void 0?G===void 0?(q=S?`same-dir`:`single-session`,K=`gate_default`):(q=G,K=`saved`):(q=l,K=`flag`);let re=q===`single-session`?1:u??Ke,Y=d??!0;if(!h){let{clearBridgePointer:e}=await import(`./bridgePointer-W_jdQ8zf.js`);await e(v)}q===`worktree`&&!U&&(console.error(`Error: Worktree mode requires a git repository or WorktreeCreate hooks configured. Use --spawn=session for single-session mode.`),process.exit(1));let X=await R(),ie=await B(),oe=xe(),se=Oe(),{handleOAuth401Error:le}=await import(`./auth-CEig4Gxp.js`),de=ee({baseUrl:P,getAccessToken:E,runnerVersion:`0.0.1`,onDebug:k,onAuth401:le,getTrustedDeviceToken:he}),Z;if(h){try{p(h,`sessionId`)}catch{console.error(`Error: Invalid session ID "${h}". Session IDs must not contain unsafe characters.`),process.exit(1)}await T(),w();let{getBridgeSession:e}=await import(`./createSession-DM4acqaC.js`),t=await e(h,{baseUrl:P,getAccessToken:E});if(!t){if(g){let{clearBridgePointer:e}=await import(`./bridgePointer-W_jdQ8zf.js`);await e(g)}console.error(`Error: Session ${h} not found. It may have been archived or expired, or your login may have lapsed (run \`claude /login\`).`),process.exit(1)}if(!t.environment_id){if(g){let{clearBridgePointer:e}=await import(`./bridgePointer-W_jdQ8zf.js`);await e(g)}console.error(`Error: Session ${h} has no environment_id. It may never have been attached to a bridge.`),process.exit(1)}Z=t.environment_id,k(`[bridge:init] Resuming session ${h} on environment ${Z}`)}let Q={dir:v,machineName:oe,branch:X,gitRepoUrl:ie,maxSessions:re,spawnMode:q,verbose:n,sandbox:r,bridgeId:se,workerType:`claude_code`,environmentId:Oe(),reuseEnvironmentId:Z,apiBaseUrl:P,sessionIngressUrl:F,debugFile:i,sessionTimeoutMs:a};k(`[bridge:init] bridgeId=${se}${Z?` reuseEnvironmentId=${Z}`:``} dir=${v} branch=${X} gitRepoUrl=${ie} machine=${oe}`),k(`[bridge:init] apiBaseUrl=${P} sessionIngressUrl=${F}`),k(`[bridge:init] sandbox=${r}${i?` debugFile=${i}`:``}`);let $,fe;try{let e=await de.registerBridgeEnvironment(Q);$=e.environment_id,fe=e.environment_secret}catch(e){z(`tengu_bridge_registration_failed`,{status:e instanceof c?e.status:void 0}),console.error(e instanceof c&&e.status===404?`Remote Control environments are not available for your account.`:`Error: ${A(e)}`),process.exit(1)}let pe;if(h)if(Z&&$!==Z)I(Error(`Bridge resume env mismatch: requested ${Z}, backend returned ${$}. Falling back to fresh session.`)),console.warn(`Warning: Could not resume session ${h} — its environment has expired. Creating a fresh session instead.`);else{let e=J(h),t=e===h?[h]:[h,e],n=!1,r;for(let e of t)try{await de.reconnectSession($,e),k(`[bridge:init] Session ${e} re-queued via bridge/reconnect`),pe=h,n=!0;break}catch(t){r=t,k(`[bridge:init] reconnectSession(${e}) failed: ${A(t)}`)}if(!n){let e=r,t=e instanceof c;if(g&&t){let{clearBridgePointer:e}=await import(`./bridgePointer-W_jdQ8zf.js`);await e(g)}console.error(t?`Error: ${A(e)}`:`Error: Failed to reconnect session ${h}: ${A(e)}\nThe session may still be resumable — try running the same command again.`),process.exit(1)}}k(`[bridge:init] Registered, server environmentId=${$}`);let ge=me();z(`tengu_bridge_started`,{max_sessions:Q.maxSessions,has_debug_file:!!Q.debugFile,sandbox:Q.sandbox,verbose:Q.verbose,heartbeat_interval_ms:ge.non_exclusive_heartbeat_interval_ms,spawn_mode:Q.spawnMode,spawn_mode_source:K,multi_session_gate:S,pre_create_session:Y,worktree_available:U}),N(`info`,`bridge_started`,{max_sessions:Q.maxSessions,sandbox:Q.sandbox,spawn_mode:Q.spawnMode});let _e=Ue({execPath:process.execPath,scriptArgs:Ye(),env:process.env,verbose:n,sandbox:r,debugFile:i,permissionMode:o,onDebug:k,onActivity:(e,t)=>{k(`[bridge:activity] sessionId=${e} ${t.type} ${t.summary}`)},onPermissionRequest:(e,t,n)=>{k(`[bridge:perm] sessionId=${e} tool=${t.request.tool_name} request_id=${t.request_id} (not auto-approving)`)}}),ve=Pe({verbose:n}),{parseGitHubRepository:ye}=await import(`./detectRepository-6nw-Aw3v.js`),be=ie?ye(ie):null,Se=be?be.split(`/`).pop():Ce(v);ve.setRepoInfo(Se,X);let we=q!==`single-session`&&U;we&&ve.setSpawnModeDisplay(q);let Te=e=>{if(e[0]===3||e[0]===4){process.emit(`SIGINT`);return}if(e[0]===32){ve.toggleQr();return}if(e[0]===119){if(!we)return;let e=Q.spawnMode===`same-dir`?`worktree`:`same-dir`;Q.spawnMode=e,z(`tengu_bridge_spawn_mode_toggled`,{spawn_mode:e}),ve.logStatus(e===`worktree`?`Spawn mode: worktree (new sessions get isolated git worktrees)`:`Spawn mode: same-dir (new sessions share the current directory)`),ve.setSpawnModeDisplay(e),ve.refreshDisplay(),ne(t=>t.remoteControlSpawnMode===e?t:{...t,remoteControlSpawnMode:e});return}};process.stdin.isTTY&&(process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on(`data`,Te));let De=new AbortController,ke=()=>{k(`[bridge:shutdown] SIGINT received, shutting down`),De.abort()},Ae=()=>{k(`[bridge:shutdown] SIGTERM received, shutting down`),De.abort()};process.on(`SIGINT`,ke),process.on(`SIGTERM`,Ae);let je=pe||null;if(Y&&!pe){let{createBridgeSession:e}=await import(`./createSession-DM4acqaC.js`);try{je=await e({environmentId:$,title:s,events:[],gitRepoUrl:ie,branch:X,signal:De.signal,baseUrl:P,getAccessToken:E,permissionMode:o}),je&&k(`[bridge:init] Created initial session ${je}`)}catch(e){k(`[bridge:init] Session creation failed (non-fatal): ${A(e)}`)}}let Me=null;if(je&&q===`single-session`){let{writeBridgePointer:e}=await import(`./bridgePointer-W_jdQ8zf.js`),t={sessionId:je,environmentId:$,source:`standalone`};await e(Q.dir,t),Me=setInterval(e,3600*1e3,Q.dir,t),Me.unref?.()}try{await Ze(Q,$,fe,de,_e,ve,De.signal,void 0,je??void 0,async()=>(w(),await T(),E()))}finally{Me!==null&&clearInterval(Me),process.off(`SIGINT`,ke),process.off(`SIGTERM`,Ae),process.stdin.off(`data`,Te),process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdin.pause()}process.exit(0)}var mt=class extends Error{constructor(e){super(e),this.name=`BridgeHeadlessPermanentError`}};async function ht(e,t){let{dir:n,log:r}=e;process.chdir(n);let{setOriginalCwd:i,setCwdState:a}=await import(`./state-53JDbNQM.js`);i(n),a(n);let{enableConfigs:o,checkHasTrustDialogAccepted:s}=await import(`./config-BrxKpHpR.js`);o();let{initSinks:c}=await import(`./sinks-jfaIjsRJ.js`);if(c(),!s())throw new mt(`Workspace not trusted: ${n}. Run \`claude\` in that directory first to accept the trust dialog.`);if(!e.getAccessToken())throw Error(ue);let{getBridgeBaseUrl:l}=await import(`./bridgeConfig-D5dB38xD.js`),u=l();if(u.startsWith(`http://`)&&!u.includes(`localhost`)&&!u.includes(`127.0.0.1`))throw new mt(`Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`);let d=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||u,{getBranch:f,getRemoteUrl:p,findGitRoot:m}=await import(`./git-BE_FiJZp.js`),{hasWorktreeCreateHook:h}=await import(`./hooks-DONAb_nq.js`);if(e.spawnMode===`worktree`&&!(h()||m(n)!==null))throw new mt(`Worktree mode requires a git repository or WorktreeCreate hooks. Directory ${n} has neither.`);let g=await f(),_=await p(),v=xe(),y=Oe(),b={dir:n,machineName:v,branch:g,gitRepoUrl:_,maxSessions:e.capacity,spawnMode:e.spawnMode,verbose:!1,sandbox:e.sandbox,bridgeId:y,workerType:`claude_code`,environmentId:Oe(),apiBaseUrl:u,sessionIngressUrl:d,sessionTimeoutMs:e.sessionTimeoutMs},x=ee({baseUrl:u,getAccessToken:e.getAccessToken,runnerVersion:`0.0.1`,onDebug:r,onAuth401:e.onAuth401,getTrustedDeviceToken:he}),S,C;try{let e=await x.registerBridgeEnvironment(b);S=e.environment_id,C=e.environment_secret}catch(e){throw Error(`Bridge registration failed: ${A(e)}`)}let te=Ue({execPath:process.execPath,scriptArgs:Ye(),env:process.env,verbose:!1,sandbox:e.sandbox,permissionMode:e.permissionMode,onDebug:r}),w=gt(r);w.printBanner(b,S);let T;if(e.createSessionOnStart){let{createBridgeSession:n}=await import(`./createSession-DM4acqaC.js`);try{let i=await n({environmentId:S,title:e.name,events:[],gitRepoUrl:_,branch:g,signal:t,baseUrl:u,getAccessToken:e.getAccessToken,permissionMode:e.permissionMode});i&&(T=i,r(`created initial session ${i}`))}catch(e){r(`session pre-creation failed (non-fatal): ${A(e)}`)}}await Ze(b,S,C,x,te,w,t,void 0,T,async()=>e.getAccessToken())}function gt(e){let t=()=>{};return{printBanner:(t,n)=>e(`registered environmentId=${n} dir=${t.dir} spawnMode=${t.spawnMode} capacity=${t.maxSessions}`),logSessionStart:(t,n)=>e(`session start ${t}`),logSessionComplete:(t,n)=>e(`session complete ${t} (${n}ms)`),logSessionFailed:(t,n)=>e(`session failed ${t}: ${n}`),logStatus:e,logVerbose:e,logError:t=>e(`error: ${t}`),logReconnected:t=>e(`reconnected after ${t}ms`),addSession:(t,n)=>e(`session attached ${t}`),removeSession:t=>e(`session detached ${t}`),updateIdleStatus:t,updateReconnectingStatus:t,updateSessionStatus:t,updateSessionActivity:t,updateSessionCount:t,updateFailedStatus:t,setSpawnModeDisplay:t,setRepoInfo:t,setDebugLogPath:t,setAttached:t,setSessionTitle:t,clearStatus:t,toggleQr:t,refreshDisplay:t}}export{ct as a,et as i,pt as n,ht as o,$e as r,Ze as s,mt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./bridgeMain--R1HFbOv.js";export{e as bridgeMain};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{D as n,E as r,U as i,l as a,p as o,z as s}from"./debug-IKW-jE7K.js";import{B as c,F as l,G as u,I as d,O as f,U as p,Y as m,b as h,g,m as _}from"./log-B3eB4EFv.js";import{n as v,r as y}from"./analytics-BotDBGh0.js";import{P as b,lt as x,n as S,t as C}from"./rcDebugLog-BUuD-X1D.js";import{t as w}from"./controlMessageCompat-IFu4Gc1y.js";import{randomUUID as T}from"crypto";v(),b(),a(),C(),_(),i(),r(),m(),e();function E(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function D(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`control_response`&&`response`in e}function O(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`control_request`&&`request_id`in e&&`request`in e}function k(e){return(e.type===`user`||e.type===`assistant`)&&e.isVirtual?!1:e.type===`user`||e.type===`assistant`||e.type===`system`&&e.subtype===`local_command`}function A(e){if(e.type!==`user`||e.isMeta||e.toolUseResult||e.isCompactSummary||e.origin&&e.origin.kind!==`human`)return;let t=e.message.content,n;if(typeof t==`string`)n=t;else for(let e of t??[])if(e.type===`text`){n=e.text;break}if(n)return g(n)||void 0}var j=`system-reminder`,M=/\s*<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\s*/gy,N=new Set([h,f,l,d,c,p,u]);function P(e){let t=e.message?.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``):``}function F(e){let t=e.trim();if(!t)return null;M.lastIndex=0;let n=[];for(;M.lastIndex<t.length;){let e=M.exec(t);if(!e)return null;n.push(e[1])}return n.length>0?n:null}function I(e){if(e.type!==`user`||e.isVisibleInTranscriptOnly)return!1;if(e.toolUseResult!==void 0||!e.isMeta)return!0;let t=F(P(e));return!t||t.some(e=>e!==`local-command-caveat`&&e!==j&&N.has(e))}function L(e){return e.some(I)}function R(e,t,r,i,a,c){try{let s=w(n(e));if(D(s)){o(`[bridge:repl] Ingress message type=control_response`),a?.(s);return}if(O(s)){o(`[bridge:repl] Inbound control_request subtype=${s.request.subtype}`),c?.(s);return}if(!E(s))return;let l=`uuid`in s&&typeof s.uuid==`string`?s.uuid:void 0;if(l&&t.has(l)){o(`[bridge:repl] Ignoring echo: type=${s.type} uuid=${l}`);return}if(l&&r.has(l)){o(`[bridge:repl] Ignoring re-delivered inbound: type=${s.type} uuid=${l}`);return}o(`[bridge:repl] Ingress message type=${s.type}${l?` uuid=${l}`:``}`),s.type===`user`?(l&&r.add(l),y(`tengu_bridge_message_received`,{is_repl:!0}),i?.(s)):o(`[bridge:repl] Ignoring non-user inbound message: type=${s.type}`)}catch(e){o(`[bridge:repl] Failed to parse ingress message: ${s(e)}`)}}var z=`This session is outbound-only. Enable Remote Control locally to allow inbound control.`;function B(e,t){let{transport:n,sessionId:r,outboundOnly:i,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:c,onSetPermissionMode:l}=t;if(!n){o(`[bridge:repl] Cannot respond to control_request: transport not configured`);return}let u,d=e.request;if(i&&d.subtype!==`initialize`){u={type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:z}};let t={...u,session_id:r};n.write(t),o(`[bridge:repl] Rejected ${d.subtype} (outbound-only) request_id=${e.request_id}`);return}switch(d.subtype){case`initialize`:u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id,response:{commands:[],output_style:`normal`,available_output_styles:[`normal`],models:[],account:{},pid:process.pid}}};break;case`set_model`:s?.(d.model),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;case`set_max_thinking_tokens`:c?.(d.max_thinking_tokens??null),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;case`set_permission_mode`:{let t=l?.(d.mode)??{ok:!1,error:`set_permission_mode is not supported in this context (onSetPermissionMode callback not registered)`};u=t.ok?{type:`control_response`,response:{subtype:`success`,request_id:e.request_id}}:{type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:t.error}};break}case`interrupt`:a?.(),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;default:u={type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:`REPL bridge does not handle control_request subtype: ${d.subtype}`}}}let f={...u,session_id:r};n.write(f),S(`control_response: subtype=${d.subtype} request_id=${e.request_id} result=${u.response.subtype}`),o(`[bridge:repl] Sent control_response for ${d.subtype} request_id=${e.request_id} result=${u.response.subtype}`)}function V(e){return{type:`result_success`,subtype:`success`,duration_ms:0,duration_api_ms:0,is_error:!1,num_turns:0,result:``,stop_reason:null,total_cost_usd:0,usage:{...x},modelUsage:{},permission_denials:[],session_id:e,uuid:T()}}var H=class{constructor(e){t(this,`capacity`,void 0),t(this,`ring`,void 0),t(this,`set`,new Set),t(this,`writeIdx`,0),this.capacity=e,this.ring=Array(e)}add(e){if(this.set.has(e))return;let t=this.ring[this.writeIdx];t!==void 0&&this.set.delete(t),this.ring[this.writeIdx]=e,this.set.add(e),this.writeIdx=(this.writeIdx+1)%this.capacity}has(e){return this.set.has(e)}clear(){this.set.clear(),this.ring.fill(void 0),this.writeIdx=0}};export{k as a,L as c,B as i,A as n,V as o,R as r,I as s,H as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,l as t,t as n,w as r}from"./v4-jw6qOKwQ.js";import{D as i,E as a,G as o,O as s,U as c,l,p as u}from"./debug-IKW-jE7K.js";import{_ as d,c as f,g as p,l as m,m as h}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{n as g,t as _}from"./lazySchema-uxlVVNM1.js";import{dirname as v,join as y}from"path";import{mkdir as b,readFile as x,stat as S,unlink as C,writeFile as w}from"fs/promises";n(),l(),c(),d(),_(),m(),a();var T=50,E=g(()=>r({sessionId:e(),environmentId:e(),source:t([`standalone`,`repl`])}));function D(e){return y(f(),h(e),`bridge-pointer.json`)}async function O(e,t){let n=D(e);try{await b(v(n),{recursive:!0}),await w(n,s(t),`utf8`),u(`[bridge:pointer] wrote ${n}`)}catch(e){u(`[bridge:pointer] write failed: ${e}`,{level:`warn`})}}async function k(e){let t=D(e),n,r;try{r=(await S(t)).mtimeMs,n=await x(t,`utf8`)}catch{return null}let i=E().safeParse(M(n));if(!i.success)return u(`[bridge:pointer] invalid schema, clearing: ${t}`),await j(e),null;let a=Math.max(0,Date.now()-r);return a>144e5?(u(`[bridge:pointer] stale (>4h mtime), clearing: ${t}`),await j(e),null):{...i.data,ageMs:a}}async function A(e){let t=await k(e);if(t)return{pointer:t,dir:e};let n=await p(e);if(n.length<=1)return null;if(n.length>T)return u(`[bridge:pointer] ${n.length} worktrees exceeds fanout cap ${T}, skipping`),null;let r=h(e),i=n.filter(e=>h(e)!==r),a=await Promise.all(i.map(async e=>{let t=await k(e);return t?{pointer:t,dir:e}:null})),o=null;for(let e of a)e&&(!o||e.pointer.ageMs<o.pointer.ageMs)&&(o=e);return o&&u(`[bridge:pointer] fanout found pointer in worktree ${o.dir} (ageMs=${o.pointer.ageMs})`),o}async function j(e){let t=D(e);try{await C(t),u(`[bridge:pointer] cleared ${t}`)}catch(e){o(e)||u(`[bridge:pointer] clear failed: ${e}`,{level:`warn`})}}function M(e){try{return i(e)}catch{return null}}export{j as clearBridgePointer,k as readBridgePointer,A as readBridgePointerAcrossWorktrees,O as writeBridgePointer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-BtmAri4e.js";e();export{t as clearSessionCaches};
|