openpond 0.2.62 → 0.2.63
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/README.md +2 -0
- package/dist/app-server.d.ts +1053 -63
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-DYRBDJRU.js → acp-H3MJCPHX.js} +1 -1
- package/dist/chunks/{acp-agent-UTLP7C3I.js → acp-agent-DWA7272M.js} +1 -1
- package/dist/chunks/actions-command-IIYOO4LL.js +2 -0
- package/dist/chunks/{app-layer-N2H3RBEN.js → app-layer-K7H2WJ56.js} +1 -1
- package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +2 -0
- package/dist/chunks/app-server-evaluations-XGMGS67X.js +2 -0
- package/dist/chunks/app-server-harness-services-BHD6S5II.js +2 -0
- package/dist/chunks/app-server-runtime-LFIL6F7D.js +2 -0
- package/dist/chunks/apps-QKAHJGQ4.js +2 -0
- package/dist/chunks/chunk-25XXZS3E.js +2 -0
- package/dist/chunks/chunk-27JGS3KB.js +12 -0
- package/dist/chunks/{chunk-7JBB4PXS.js → chunk-2HAWOMZK.js} +1 -1
- package/dist/chunks/chunk-2LJCJOJ7.js +2 -0
- package/dist/chunks/{chunk-CN5OXQ7A.js → chunk-3YXYBYWK.js} +1 -1
- package/dist/chunks/{chunk-GEKORCMN.js → chunk-42V4NV2F.js} +1 -1
- package/dist/chunks/{chunk-VAJSRUAB.js → chunk-4FNCBA3Y.js} +1 -1
- package/dist/chunks/{chunk-F7D4BMTO.js → chunk-4L6DU6Z2.js} +1 -1
- package/dist/chunks/{chunk-SZKFNKWO.js → chunk-4SZ3HKHU.js} +1 -1
- package/dist/chunks/chunk-5EP2DZLJ.js +2 -0
- package/dist/chunks/chunk-5FU5RLML.js +2 -0
- package/dist/chunks/{chunk-6SH4B7DV.js → chunk-5MHYGMJG.js} +1 -1
- package/dist/chunks/{chunk-MEK7DLX3.js → chunk-6EBCS57F.js} +1 -1
- package/dist/chunks/chunk-6RS4NAOY.js +2 -0
- package/dist/chunks/{chunk-NVHZRKXB.js → chunk-7HRLWPPZ.js} +1 -1
- package/dist/chunks/chunk-7O6Z3VOZ.js +2 -0
- package/dist/chunks/{chunk-P74RR2GB.js → chunk-7WYL2IDD.js} +1 -1
- package/dist/chunks/chunk-7YLXGILH.js +2 -0
- package/dist/chunks/chunk-7ZLXFKRI.js +2 -0
- package/dist/chunks/{chunk-NWOK6NLE.js → chunk-AH26AQN7.js} +1 -1
- package/dist/chunks/chunk-AHOBCBVZ.js +2 -0
- package/dist/chunks/chunk-B5R53U74.js +2 -0
- package/dist/chunks/{chunk-NKZNPTLA.js → chunk-BPZOABMC.js} +1 -1
- package/dist/chunks/{chunk-2IIBCCOK.js → chunk-BSPFY3Y5.js} +1 -1
- package/dist/chunks/{chunk-5OSM75X5.js → chunk-BU27SLZP.js} +2 -2
- package/dist/chunks/chunk-C2AXMKK4.js +2 -0
- package/dist/chunks/{chunk-AMO5DVKM.js → chunk-C2LAEGOW.js} +2 -2
- package/dist/chunks/{chunk-GNCEZ3UP.js → chunk-CZ5R4JXZ.js} +1 -1
- package/dist/chunks/{chunk-JIFUGA3U.js → chunk-DABBHWSF.js} +1 -1
- package/dist/chunks/{chunk-VK4TPZTA.js → chunk-DLANLLKH.js} +1 -1
- package/dist/chunks/{chunk-WGLVSGFA.js → chunk-DQI5TE6A.js} +2 -2
- package/dist/chunks/chunk-DTTFUANI.js +12 -0
- package/dist/chunks/{chunk-4TM75R7V.js → chunk-DUL6DXOI.js} +1 -1
- package/dist/chunks/{chunk-TGEGXTPR.js → chunk-ELX7VRSU.js} +1 -1
- package/dist/chunks/chunk-ERL2M773.js +3 -0
- package/dist/chunks/{chunk-4PZWGNX4.js → chunk-ERT32RZA.js} +4 -4
- package/dist/chunks/{chunk-RTJCELRR.js → chunk-EZRUWIP6.js} +1 -1
- package/dist/chunks/{chunk-LJDBR3RN.js → chunk-F6UQ6PPK.js} +1 -1
- package/dist/chunks/chunk-F7QTIHXX.js +2 -0
- package/dist/chunks/chunk-FAKDGLZQ.js +8 -0
- package/dist/chunks/{chunk-FFWOTZQM.js → chunk-FVRII5XO.js} +1 -1
- package/dist/chunks/{chunk-C7M2WBWZ.js → chunk-FYYYECHE.js} +51 -49
- package/dist/chunks/chunk-G32BO6M5.js +4 -0
- package/dist/chunks/{chunk-NBE74GLF.js → chunk-G6OR5NB6.js} +1 -1
- package/dist/chunks/{chunk-GQGLPKU4.js → chunk-GGJUWIGR.js} +1 -1
- package/dist/chunks/{chunk-VSQXDS6H.js → chunk-GPL2Z65R.js} +1 -1
- package/dist/chunks/{chunk-INO67SEN.js → chunk-GS6ZUSIN.js} +2 -2
- package/dist/chunks/{chunk-47AXSBPV.js → chunk-GVARQXYI.js} +1 -1
- package/dist/chunks/chunk-GXCUH2VV.js +17 -0
- package/dist/chunks/{chunk-OCC43RSJ.js → chunk-GXZCMO6S.js} +1 -1
- package/dist/chunks/{chunk-CLFYRN46.js → chunk-H6C4MAUN.js} +1 -1
- package/dist/chunks/{chunk-HBLN4OLY.js → chunk-HUCBKXTU.js} +1 -1
- package/dist/chunks/{chunk-M5IX6VUA.js → chunk-IHB5GTOJ.js} +2 -2
- package/dist/chunks/{chunk-J3B2GM4A.js → chunk-IWWXIUAQ.js} +1 -1
- package/dist/chunks/chunk-J572ANHX.js +13 -0
- package/dist/chunks/{chunk-AKZPMKWP.js → chunk-J7ZTPXRQ.js} +1 -1
- package/dist/chunks/{chunk-CJUVHE4U.js → chunk-JORRZ4BB.js} +1 -1
- package/dist/chunks/chunk-JSQRLLN6.js +2 -0
- package/dist/chunks/chunk-KCOTDUGW.js +2 -0
- package/dist/chunks/{chunk-NK4JKB7C.js → chunk-KHTAAVC2.js} +1 -1
- package/dist/chunks/{chunk-LRRBYIGH.js → chunk-LK2K3SPM.js} +2 -2
- package/dist/chunks/{chunk-557XSPVS.js → chunk-LKKMLBOH.js} +1 -1
- package/dist/chunks/{chunk-U456UP3N.js → chunk-LSZJ5M3X.js} +1 -1
- package/dist/chunks/chunk-M3FLEZ4E.js +4 -0
- package/dist/chunks/{chunk-Y2KPHVZK.js → chunk-M3SCON53.js} +1 -1
- package/dist/chunks/{chunk-VPDG2V2R.js → chunk-MEGKXGW3.js} +1 -1
- package/dist/chunks/chunk-MPNJ2BB4.js +2 -0
- package/dist/chunks/{chunk-4RZBGKT7.js → chunk-N33D7KCW.js} +1 -1
- package/dist/chunks/chunk-N42HT64M.js +2 -0
- package/dist/chunks/{chunk-SD64CLJX.js → chunk-N4VHLJBZ.js} +1 -1
- package/dist/chunks/chunk-NEJLJ2XY.js +2 -0
- package/dist/chunks/chunk-NG2L6D7G.js +2 -0
- package/dist/chunks/{chunk-GV3LFSMI.js → chunk-NLYZ5K7U.js} +1 -1
- package/dist/chunks/{chunk-F4TJ7WQV.js → chunk-NT7N6KLE.js} +1 -1
- package/dist/chunks/{chunk-PAE3PQEC.js → chunk-NZTCH6K5.js} +1 -1
- package/dist/chunks/{chunk-BEI4YULC.js → chunk-OG33QAG6.js} +1 -1
- package/dist/chunks/chunk-OTUBJV6C.js +6 -0
- package/dist/chunks/{chunk-RH43WLBX.js → chunk-PBTXLQAU.js} +1 -1
- package/dist/chunks/{chunk-3R4MSE2S.js → chunk-QJ6KUVAR.js} +1 -1
- package/dist/chunks/{chunk-7JXZNCBC.js → chunk-QU4UE73E.js} +1 -1
- package/dist/chunks/{chunk-WQMXEZVE.js → chunk-R6VJDOQM.js} +3 -3
- package/dist/chunks/{chunk-FUSCTBJI.js → chunk-R6WMY6AH.js} +1 -1
- package/dist/chunks/{chunk-EIX2V2KU.js → chunk-RDSVU6F6.js} +1 -1
- package/dist/chunks/{chunk-R4PDSOB4.js → chunk-RFMME46Z.js} +1 -1
- package/dist/chunks/{chunk-GW5SE3FM.js → chunk-RZUCVF2Q.js} +1 -1
- package/dist/chunks/{chunk-UC3FXTDL.js → chunk-SFKZITAG.js} +5 -5
- package/dist/chunks/{chunk-5A6ER3M2.js → chunk-SHJY5RLU.js} +1 -1
- package/dist/chunks/chunk-SI5W5LBV.js +2 -0
- package/dist/chunks/chunk-SO42ZB5K.js +2 -0
- package/dist/chunks/{chunk-2UDAKLJ4.js → chunk-TCOTXCV6.js} +1 -1
- package/dist/chunks/{chunk-QCSLEMZF.js → chunk-U2K7QJCG.js} +1 -1
- package/dist/chunks/{chunk-ISIXFK6U.js → chunk-UH4JSSRL.js} +28 -28
- package/dist/chunks/{chunk-X4ZT22SG.js → chunk-UPWJSNL5.js} +1 -1
- package/dist/chunks/chunk-URNMC46H.js +157 -0
- package/dist/chunks/{chunk-NLQ2UPN2.js → chunk-V7KR74NO.js} +1 -1
- package/dist/chunks/{chunk-HXZXDDKW.js → chunk-VHXDWAEH.js} +1 -1
- package/dist/chunks/{chunk-NE4ESZPT.js → chunk-W2TICQ62.js} +1 -1
- package/dist/chunks/chunk-WP2L2NY2.js +2 -0
- package/dist/chunks/chunk-WSOUMXH3.js +24 -0
- package/dist/chunks/chunk-WWQNMC7C.js +6 -0
- package/dist/chunks/chunk-XMHIQ3SK.js +5 -0
- package/dist/chunks/{chunk-5MTN6KXV.js → chunk-XNOMIWEY.js} +1 -1
- package/dist/chunks/{chunk-ZXT7V64X.js → chunk-XOB6FKQV.js} +1 -1
- package/dist/chunks/chunk-Y766IN7Y.js +2 -0
- package/dist/chunks/chunk-YCZZ62C2.js +2 -0
- package/dist/chunks/chunk-YM4PSVFW.js +4 -0
- package/dist/chunks/chunk-YNQWJWIC.js +10 -0
- package/dist/chunks/{chunk-GSWBNJGZ.js → chunk-Z3BWCFLV.js} +1 -1
- package/dist/chunks/{chunk-GOIKLFXK.js → chunk-ZG6353RM.js} +1 -1
- package/dist/chunks/{chunk-T6C5BNXK.js → chunk-ZPTKR3GB.js} +1 -1
- package/dist/chunks/{chunk-MNXNZDDW.js → chunk-ZYVHOVKL.js} +1 -1
- package/dist/chunks/chunk-ZZHXQCNB.js +22 -0
- package/dist/chunks/cli-PSXMIJTF.js +2 -0
- package/dist/chunks/{configuration-command-BU2RPG33.js → configuration-command-XYKMXIWF.js} +1 -1
- package/dist/chunks/connected-app-executor-6G2LA3PQ.js +2 -0
- package/dist/chunks/connected-evidence-IRXYN6YD.js +2 -0
- package/dist/chunks/{connected-starting-assets-V5QXRK5Q.js → connected-starting-assets-JONPTII6.js} +1 -1
- package/dist/chunks/{continual-FLW6DAJK.js → continual-Z7MO2PF6.js} +1 -1
- package/dist/chunks/core-commands-WWN7X3XC.js +2 -0
- package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +4 -0
- package/dist/chunks/datasets-2PC2HP7N.js +2 -0
- package/dist/chunks/desktop-test-VU6AFAMO.js +3 -0
- package/dist/chunks/dist-47AYOIH6.js +2 -0
- package/dist/chunks/{dist-DCSLPBO2.js → dist-MXBEBM4D.js} +1 -1
- package/dist/chunks/evaluation-coordination-UOWZHHC5.js +2 -0
- package/dist/chunks/experiment-improvements-EB2CV5RA.js +2 -0
- package/dist/chunks/experiments-SZQYR6MH.js +2 -0
- package/dist/chunks/experiments-signal-2KJCP25D.js +2 -0
- package/dist/chunks/{help-PXUUREHZ.js → help-7HXFWIKS.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +2 -0
- package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +2 -0
- package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +3 -0
- package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +2 -0
- package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +3 -0
- package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +3 -0
- package/dist/chunks/{hosted-tasksets-X2YCFYEJ.js → hosted-tasksets-WGXGXJ7E.js} +1 -1
- package/dist/chunks/human-review-M26UKGJL.js +2 -0
- package/dist/chunks/{import-JWZSZCE4.js → import-6SI4BEKS.js} +2 -2
- package/dist/chunks/learning-HM3NWOV5.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +2 -0
- package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +2 -0
- package/dist/chunks/model-projects-YUAMBQTO.js +2 -0
- package/dist/chunks/opchat-AG4CWVY4.js +3 -0
- package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +2 -0
- package/dist/chunks/organizations-KDKX77XZ.js +2 -0
- package/dist/chunks/{profile-ELE2D7HU.js → profile-O5HL5DTQ.js} +1 -1
- package/dist/chunks/project-action-payload-QA24HYGF.js +2 -0
- package/dist/chunks/project-agent-XBOOM5TS.js +2 -0
- package/dist/chunks/published-experiment-source-GZGN354O.js +2 -0
- package/dist/chunks/refiner-profile-service-BJMOYKTC.js +2 -0
- package/dist/chunks/{runtime-776NUSE7.js → runtime-XBA744HJ.js} +2 -2
- package/dist/chunks/sandbox-command-5ECGS7DG.js +2 -0
- package/dist/chunks/{sandbox-template-WP6YCGBK.js → sandbox-template-27U3FQN7.js} +1 -1
- package/dist/chunks/saved-work-KUNVTJ7O.js +2 -0
- package/dist/chunks/{send-turn-RPB65PME.js → send-turn-FIPWOXWV.js} +1 -1
- package/dist/chunks/src-BLWX6DRG.js +424 -0
- package/dist/chunks/{src-2R4CMCJ5.js → src-PU7QTFO5.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +2 -0
- package/dist/chunks/store-chat-resources-YOEJ2BI6.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-R62D2HD6.js → store-continual-support-reviews-FOMYYS25.js} +1 -1
- package/dist/chunks/{store-conversation-serving-25O7BAR2.js → store-conversation-serving-K324SQTO.js} +1 -1
- package/dist/chunks/{store-create-improve-T5E2GUKK.js → store-create-improve-3LQMIYAP.js} +1 -1
- package/dist/chunks/{store-datasets-5Y4U5L3R.js → store-datasets-3KSX7RSO.js} +1 -1
- package/dist/chunks/store-evaluation-results-LHCCNNE6.js +7 -0
- package/dist/chunks/{store-harness-evaluation-review-settings-I2R3HPO3.js → store-harness-evaluation-review-settings-AAN7KKJ5.js} +1 -1
- package/dist/chunks/{store-harness-refinement-candidates-SUT45FQX.js → store-harness-refinement-candidates-3PHL3BUY.js} +1 -1
- package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +2 -0
- package/dist/chunks/store-human-review-QJY3ZPPF.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +2 -0
- package/dist/chunks/{store-learning-MFS4DGQR.js → store-learning-DW3QLQXU.js} +1 -1
- package/dist/chunks/{store-learning-credentials-BECWEG2Y.js → store-learning-credentials-67QNTPA7.js} +1 -1
- package/dist/chunks/{store-local-experiments-LOH4F4TF.js → store-local-experiments-QTVHJAEP.js} +1 -1
- package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +2 -0
- package/dist/chunks/store-model-configuration-3SU73CMS.js +3 -0
- package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +2 -0
- package/dist/chunks/store-ponder-history-WDLMXBIJ.js +2 -0
- package/dist/chunks/store-ponder-hosted-DX6E2BVW.js +4 -0
- package/dist/chunks/{store-preference-comparison-RNIFLJRW.js → store-preference-comparison-DWV5XSMY.js} +1 -1
- package/dist/chunks/{store-schedules-DVQ2PP4F.js → store-schedules-2KUY4T6M.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-LXWFFYCZ.js → store-sidebar-file-bookmarks-A4XCS7RM.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-4HH7LX6N.js → store-sidebar-preferences-V2PKRXUZ.js} +1 -1
- package/dist/chunks/{store-subagents-JLW4GD4Q.js → store-subagents-UGVEFA6M.js} +1 -1
- package/dist/chunks/store-task-inbox-QABI4ZAH.js +33 -0
- package/dist/chunks/{store-task-inventory-NJXRXFLC.js → store-task-inventory-GEQIZELY.js} +1 -1
- package/dist/chunks/store-taskset-drafts-GXABQR5G.js +9 -0
- package/dist/chunks/{store-training-VRLU6NFX.js → store-training-CQV7PL3V.js} +1 -1
- package/dist/chunks/{store-training-jobs-3ZHG4LGI.js → store-training-jobs-XKN6K66J.js} +18 -10
- package/dist/chunks/{store-training-models-KWQD5PRP.js → store-training-models-Q7DTTR4S.js} +1 -1
- package/dist/chunks/{store-usage-ZRS3ILF2.js → store-usage-XGAX7NLB.js} +1 -1
- package/dist/chunks/{taskset-QDMCQQDJ.js → taskset-ARKJQKYQ.js} +1 -1
- package/dist/chunks/taskset-packages-X4K65DTW.js +2 -0
- package/dist/chunks/taskset-packages-XK7FSD45.js +2 -0
- package/dist/chunks/{teams-bot-GF272RGC.js → teams-bot-UTQAJA6H.js} +1 -1
- package/dist/chunks/training-3IWW4256.js +2 -0
- package/dist/chunks/{training-DF5UEPY3.js → training-RVIESURJ.js} +1 -1
- package/dist/chunks/training-error-2EWDOQ4G.js +2 -0
- package/dist/chunks/training-hosted-PFJHYTEU.js +2 -0
- package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +2 -0
- package/dist/chunks/training-hosted-feedback-5B2KJGOT.js +2 -0
- package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +2 -0
- package/dist/chunks/training-hosted-report-UVGTPDOK.js +2 -0
- package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +2 -0
- package/dist/chunks/training-hosted-workers-LST4ZUXN.js +2 -0
- package/dist/chunks/training-model-start-ROLS3E4V.js +2 -0
- package/dist/chunks/{web-search-5RUXYIOF.js → web-search-7FBUBZ66.js} +1 -1
- package/dist/chunks/{workspaces-JRY2IE7H.js → workspaces-G3CMY7ZA.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox/url.d.ts +3 -1
- package/dist/skills/LICENSE +21 -0
- package/dist/skills/manifest.json +168 -0
- package/dist/skills/openpond-agent-authoring/SKILL.md +9 -3
- package/dist/skills/openpond-agent-authoring/references/profile-layout.md +1 -1
- package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +2 -2
- package/dist/skills/openpond-cli/SKILL.md +11 -7
- package/dist/skills/openpond-cli/references/experiments-and-training.md +1 -1
- package/dist/skills/openpond-refiner-authoring/SKILL.md +4 -0
- package/dist/skills/openpond-skill-authoring/SKILL.md +5 -1
- package/dist/web/assets/App-DY2R8Z6r.js +53 -0
- package/dist/web/assets/{AppDialog-BurL61qE.js → AppDialog-8Y0FYalT.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +2 -0
- package/dist/web/assets/{AppToastContext-DZLErwj0.js → AppToastContext-BiQbbVxq.js} +1 -1
- package/dist/web/assets/AppsView-Dtte4h6e.js +1 -0
- package/dist/web/assets/{AttachmentTypeIcon-CpMSfHCK.js → AttachmentTypeIcon-DgADV7dn.js} +1 -1
- package/dist/web/assets/BrowserSidebar-BUqDvEv9.js +1 -0
- package/dist/web/assets/{CartesianChart-CEbM980A.js → CartesianChart-J4ChOjvG.js} +1 -1
- package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +8 -0
- package/dist/web/assets/ChatTimelineEntry-DztFb85D.css +1 -0
- package/dist/web/assets/{CollaborationTabs-DrKJmJZK.js → CollaborationTabs-CFCpk2Ck.js} +1 -1
- package/dist/web/assets/CommandMenu-EPPjB14H.js +1 -0
- package/dist/web/assets/{CommunityView-BzpIq1lD.js → CommunityView-Okydjpqm.js} +1 -1
- package/dist/web/assets/ComposerAttachments-RXCiE88M.js +2 -0
- package/dist/web/assets/{ComposerCreateImproveStrip-ChplO9YP.js → ComposerCreateImproveStrip-CSngc8-V.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-DRHgc7j_.js → ConversationImportsSettings-DS73kyfj.js} +1 -1
- package/dist/web/assets/FilePagePreview-Qc4B0vue.js +2 -0
- package/dist/web/assets/{GetStartedView-CaBk_mX6.js → GetStartedView-DGFPQ1We.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-JtFLyU3F.js → GettingStartedDialog-DFBYQdHz.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-hhcjDifK.js → HostedModelLearningReview-BDu3FlcU.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-CY8198Y1.js → HostedModelLearningSettings-CHaTHwC8.js} +1 -1
- package/dist/web/assets/HtmlVisual-C7GlEVfH.css +1 -0
- package/dist/web/assets/HtmlVisual-D9Mh7xds.js +81 -0
- package/dist/web/assets/LabModelVersionDetailPage-DgY7lAu5.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-HibUEEko.js → LabSkillSidebar-BwtlThO7.js} +1 -1
- package/dist/web/assets/LabsRoute-BV7ZJGEw.js +101 -0
- package/dist/web/assets/MainChatThread-pzHKd_YN.js +2 -0
- package/dist/web/assets/MainPane-6OlLiKKb.js +10 -0
- package/dist/web/assets/MainPane-Dje-hfUM.css +1 -0
- package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +2 -0
- package/dist/web/assets/NativeSkillSidebar-BEJvt5_H.js +1 -0
- package/dist/web/assets/{NewProjectDialog-t9Imnb__.js → NewProjectDialog-CjrjgkTN.js} +1 -1
- package/dist/web/assets/{OutputsPage-CeGq_F1S.js → OutputsPage-jzx93QQ3.js} +1 -1
- package/dist/web/assets/{PageChrome-VHME5V8j.js → PageChrome-C1M13qG2.js} +1 -1
- package/dist/web/assets/{ProjectsPage-2TMZoEPB.js → ProjectsPage-DZrjlMp2.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-Cw1ja2GF.js +1 -0
- package/dist/web/assets/{SettingsView-Y8f98GSE.css → SettingsView-Cc0376pY.css} +1 -1
- package/dist/web/assets/SettingsView-CckoIki3.js +5 -0
- package/dist/web/assets/TasksetDraftEditorPrimitives-ByC8bDjp.js +1 -0
- package/dist/web/assets/TeamChatView-OprnSKLF.js +1 -0
- package/dist/web/assets/{TerminalOverlay-DlhRpi-X.js → TerminalOverlay-d7A2F9Lx.js} +2 -2
- package/dist/web/assets/TrainingCreationPanel-Cyn6R6I6.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-BhhZPPuY.js → TrainingDraftPanel-Mpb5e7t5.js} +1 -1
- package/dist/web/assets/TrainingRunLineage-PXzWR65d.css +1 -0
- package/dist/web/assets/TrainingRunLineage-VcKz7dIR.js +1 -0
- package/dist/web/assets/{UsageSettingsSection-DTZslBeW.js → UsageSettingsSection-FhYymrfc.js} +2 -2
- package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +11 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-C8y3537a.js +35 -0
- package/dist/web/assets/{WorkspaceFileLocation-ChEeZffU.js → WorkspaceFileLocation-LrEWj4UK.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-D_RUXhTi.js → WorkspaceGitDialogs-NRIMXnkS.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BJxaiDrj.js → WorkspaceMonacoEditor-CvDGjKAL.js} +3 -3
- package/dist/web/assets/WorkspacePdfPreview-BZ0BbnHv.js +2 -0
- package/dist/web/assets/{WorkspacePresentationPreview-A28Poeca.js → WorkspacePresentationPreview-DJrjrvT0.js} +1 -1
- package/dist/web/assets/app-models-CUA9XB9U.js +1 -0
- package/dist/web/assets/bot-6OhUEmkE.js +1 -0
- package/dist/web/assets/browser-sidebar-links-ZyYiYBBd.js +1 -0
- package/dist/web/assets/chat-resources-CI8KFVO5.js +1 -0
- package/dist/web/assets/{chevron-down-dYn0pd4Q.js → chevron-down-jmVA1BIf.js} +1 -1
- package/dist/web/assets/chevron-right-BYmDQ7ti.js +1 -0
- package/dist/web/assets/chevron-up-CstyLXH3.js +1 -0
- package/dist/web/assets/{chunk-ZFYI4P6C-BmsNtSkR.js → chunk-ONGOAEY6-C__DQmRT.js} +5 -5
- package/dist/web/assets/{chunk-BYNVSWIQ-DWh9SmdB.js → chunk-SQBYHWZU-DumrB9SB.js} +1 -1
- package/dist/web/assets/{client-choice-storage-DTTLbrYt.js → client-choice-storage-BdQ_YDuk.js} +1 -1
- package/dist/web/assets/{cloud-upload-CRMPCFnq.js → cloud-upload-Ck1ufAr8.js} +1 -1
- package/dist/web/assets/contracts-BLiqJxBv.js +1 -0
- package/dist/web/assets/{copy-DR4ielPn.js → copy-CPkbMfXt.js} +1 -1
- package/dist/web/assets/{createLucideIcon-DmttVQ_a.js → createLucideIcon-CXQny8HU.js} +1 -1
- package/dist/web/assets/{cssMode-d-2GuNvW.js → cssMode-CYxYl_om.js} +1 -1
- package/dist/web/assets/{external-link-B4rPiZEp.js → external-link-CDKOLG_v.js} +1 -1
- package/dist/web/assets/{folder-open-BrIUcUk_.js → folder-open-CEtOb_lK.js} +1 -1
- package/dist/web/assets/{folder-plus-DwImGEt-.js → folder-plus-CVMYZs3e.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-Ds1mkrlW.js → git-commit-horizontal-DDyhPjxS.js} +1 -1
- package/dist/web/assets/{htmlMode-s15GR0Fn.js → htmlMode-DoY4V_j0.js} +1 -1
- package/dist/web/assets/icons-D7jkCa2d.js +1 -0
- package/dist/web/assets/{image-CY-sHbfQ.js → image-B-PjDSwU.js} +1 -1
- package/dist/web/assets/{index-DYrLeSyY.js → index-D9WbJMSq.js} +2 -2
- package/dist/web/assets/index-g7UqJhnX.css +1 -0
- package/dist/web/assets/{info-aSvM8YlJ.js → info-CCnw-K3b.js} +1 -1
- package/dist/web/assets/intake-contracts-BW0Y0C2R.js +1 -0
- package/dist/web/assets/{jsonMode-vos9H2hz.js → jsonMode-CeOpZdPj.js} +1 -1
- package/dist/web/assets/loader-circle-CPaJeTDy.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-pQmEaoMt.js → lspLanguageFeatures-DAbgLCqZ.js} +1 -1
- package/dist/web/assets/{maximize-2-DgF6ZVOM.js → maximize-2-BZX38cpr.js} +1 -1
- package/dist/web/assets/message-square-CvgSecgD.js +1 -0
- package/dist/web/assets/{monaco.contribution-BPwsKvRB.js → monaco.contribution-CF2JDhi4.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CJlccVX3.js → monaco.contribution-cbDqt48m.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BbMpa0_-.js → monaco.contribution-m2ze2EsL.js} +2 -2
- package/dist/web/assets/{monaco.contribution-pWurLXbm.js → monaco.contribution-yeyow_-Q.js} +2 -2
- package/dist/web/assets/{monitor-DlEV241C.js → monitor-By0s4hxb.js} +1 -1
- package/dist/web/assets/{paperclip-fnRZSIRc.js → paperclip-BJ2QgJLa.js} +1 -1
- package/dist/web/assets/{pdf-CT3zVKCE.js → pdf-C4x-1jjP.js} +1 -1
- package/dist/web/assets/pdf.worker.min-BrEVksTu.js +1 -0
- package/dist/web/assets/play-D_SuGDBM.js +1 -0
- package/dist/web/assets/plus-yw95Iaj8.js +1 -0
- package/dist/web/assets/{presentation-Bb8ecExR.js → presentation-I86G1Gd9.js} +1 -1
- package/dist/web/assets/{python-DXA1xp0A.js → python-CqFTPj8r.js} +1 -1
- package/dist/web/assets/{refresh-cw-B53QjxMO.js → refresh-cw-Dga35Eay.js} +1 -1
- package/dist/web/assets/requests-BCbaFiqV.js +1 -0
- package/dist/web/assets/{reward-checks-5AOStF27.js → reward-checks-Bcq9ETCA.js} +1 -1
- package/dist/web/assets/{save-V1Q4Fcqa.js → save-BLKjYtzR.js} +1 -1
- package/dist/web/assets/settings-D7C-Auyi.js +21 -0
- package/dist/web/assets/{settings-lists-CtH1A57b.js → settings-lists-DMKA1lCN.js} +5 -5
- package/dist/web/assets/square-BY5lG2Ol.js +1 -0
- package/dist/web/assets/{square-terminal-Dmgkm5zY.js → square-terminal-B-n7vUex.js} +1 -1
- package/dist/web/assets/submit-issue-command-B7Hrt2tU.js +3 -0
- package/dist/web/assets/{toggleHighContrast-B-BD2K2Q.js → toggleHighContrast-BhmBE5XE.js} +1 -1
- package/dist/web/assets/training-QrdkRQZQ.js +2 -0
- package/dist/web/assets/{training-model-data-14942K_Z.js → training-model-data-DB-jg6L_.js} +12 -12
- package/dist/web/assets/{tsMode-DdgIcxK3.js → tsMode-BSWEII2p.js} +1 -1
- package/dist/web/assets/{upload-82Y6RjLi.js → upload-C4MPhQn8.js} +1 -1
- package/dist/web/assets/{useAccountSettings-BgHXNpq_.js → useAccountSettings-9oqWdRLs.js} +1 -1
- package/dist/web/assets/useAgentInventory-isO79ui9.js +1 -0
- package/dist/web/assets/{useLocalAgentSchedules-CsKv22Hs.js → useLocalAgentSchedules-CZX6PxoK.js} +1 -1
- package/dist/web/assets/{useQuery-CPC2wsWm.js → useQuery-BD0Uexmh.js} +1 -1
- package/dist/web/assets/{wifi-off-DXOoDN9l.js → wifi-off-Cloe0WuQ.js} +1 -1
- package/dist/web/assets/{workers-Clf4hKt5.js → workers-BXagz5eg.js} +1 -1
- package/dist/web/assets/x-Dqpel42h.js +1 -0
- package/dist/web/assets/{yaml-I1tf8Uxx.js → yaml-sBdvVbCc.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +22 -4
- package/package.json +5 -2
- package/dist/chunks/actions-command-6LF4Z4WK.js +0 -2
- package/dist/chunks/app-server-connected-apps-3T546FE7.js +0 -2
- package/dist/chunks/app-server-evaluations-TXD747QA.js +0 -2
- package/dist/chunks/app-server-harness-services-BBCDV5P3.js +0 -2
- package/dist/chunks/app-server-runtime-VEJPDAFP.js +0 -2
- package/dist/chunks/apps-CTT2XYRR.js +0 -2
- package/dist/chunks/chunk-4M3YW3EQ.js +0 -13
- package/dist/chunks/chunk-4U2FNXQW.js +0 -2
- package/dist/chunks/chunk-547AUVKN.js +0 -2
- package/dist/chunks/chunk-557YG77L.js +0 -2
- package/dist/chunks/chunk-7KTARW23.js +0 -2
- package/dist/chunks/chunk-B42QQUZY.js +0 -2
- package/dist/chunks/chunk-EWOTDVDJ.js +0 -4
- package/dist/chunks/chunk-GAQLXFOT.js +0 -2
- package/dist/chunks/chunk-GLDYJM7O.js +0 -1
- package/dist/chunks/chunk-HKV7RX5E.js +0 -2
- package/dist/chunks/chunk-IWK3RTLR.js +0 -2
- package/dist/chunks/chunk-JX6OX6XE.js +0 -12
- package/dist/chunks/chunk-JY3YSI54.js +0 -2
- package/dist/chunks/chunk-LILXHGIA.js +0 -2
- package/dist/chunks/chunk-LJPO3TEL.js +0 -17
- package/dist/chunks/chunk-MNFW5WLD.js +0 -6
- package/dist/chunks/chunk-N5GPINVP.js +0 -2
- package/dist/chunks/chunk-N663LL27.js +0 -2
- package/dist/chunks/chunk-NOSBNHGC.js +0 -18
- package/dist/chunks/chunk-NR5VASQB.js +0 -2
- package/dist/chunks/chunk-O3MHHGC5.js +0 -151
- package/dist/chunks/chunk-OZ6LRNRE.js +0 -2
- package/dist/chunks/chunk-PGO4FRHU.js +0 -10
- package/dist/chunks/chunk-QAVQJZCM.js +0 -2
- package/dist/chunks/chunk-RBDUMASL.js +0 -2
- package/dist/chunks/chunk-TM4VEMNN.js +0 -2
- package/dist/chunks/chunk-TUCKED4T.js +0 -4
- package/dist/chunks/chunk-TVTFEGTU.js +0 -2
- package/dist/chunks/chunk-TW3SRBLU.js +0 -22
- package/dist/chunks/chunk-UT6F6AIB.js +0 -12
- package/dist/chunks/chunk-VE6ZIGUQ.js +0 -2
- package/dist/chunks/chunk-VI32G77S.js +0 -2
- package/dist/chunks/chunk-VWRTE64Y.js +0 -2
- package/dist/chunks/chunk-XSB3T4JZ.js +0 -5
- package/dist/chunks/chunk-XWDFXM3S.js +0 -2
- package/dist/chunks/chunk-ZQHPGEYT.js +0 -2
- package/dist/chunks/cli-GCSO2OAI.js +0 -2
- package/dist/chunks/connected-app-executor-UDE7U4KG.js +0 -2
- package/dist/chunks/connected-evidence-GXIY2L7C.js +0 -2
- package/dist/chunks/core-commands-NJ6TGND4.js +0 -2
- package/dist/chunks/dataset-preparation-authoring-IUXUQK3L.js +0 -4
- package/dist/chunks/datasets-AH56DKLZ.js +0 -2
- package/dist/chunks/desktop-test-PYUTEOWO.js +0 -3
- package/dist/chunks/dist-5267UT3V.js +0 -2
- package/dist/chunks/evaluation-coordination-3AUICOC5.js +0 -2
- package/dist/chunks/experiment-improvements-YS7GGPDW.js +0 -2
- package/dist/chunks/experiments-EJZK7FPT.js +0 -2
- package/dist/chunks/experiments-signal-NKUIJCIY.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-CTC5JQPD.js +0 -2
- package/dist/chunks/host-profile-external-dataset-GJWDY3YT.js +0 -2
- package/dist/chunks/hosted-app-server-composition-TLJSKMJT.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-TIVXXRPG.js +0 -3
- package/dist/chunks/hosted-harness-runtime-SFLJEZFI.js +0 -2
- package/dist/chunks/hosted-profile-candidate-DKEMVIYG.js +0 -3
- package/dist/chunks/hosted-profile-compiler-V6YR6EHO.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-ERCXAPZD.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-Q3AIIIB6.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-ELLGH44Z.js +0 -3
- package/dist/chunks/human-review-5WM6MSON.js +0 -2
- package/dist/chunks/learning-KVLTMRLD.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-IGIKM6GJ.js +0 -2
- package/dist/chunks/local-harness-taskset-review-DR2ZIDOH.js +0 -2
- package/dist/chunks/model-projects-H22KENI4.js +0 -2
- package/dist/chunks/opchat-3S6TSDZO.js +0 -3
- package/dist/chunks/opchat-bounded-chat-B7LPCD4U.js +0 -2
- package/dist/chunks/organizations-62YNTZTO.js +0 -2
- package/dist/chunks/project-action-payload-32F4X2BB.js +0 -2
- package/dist/chunks/project-agent-O4REKO6T.js +0 -2
- package/dist/chunks/published-experiment-source-DAOTJLIN.js +0 -2
- package/dist/chunks/refiner-profile-service-DYMZ7J3X.js +0 -2
- package/dist/chunks/sandbox-command-UQ26NDIX.js +0 -2
- package/dist/chunks/saved-work-PG52WCRQ.js +0 -2
- package/dist/chunks/src-AU6LG7E6.js +0 -421
- package/dist/chunks/standalone-experiment-turn-owner-SD3SUTKX.js +0 -2
- package/dist/chunks/store-chat-resources-T4LR7K25.js +0 -2
- package/dist/chunks/store-evaluation-results-WUVJWCFU.js +0 -7
- package/dist/chunks/store-harness-workspaces-IFEFY5CK.js +0 -2
- package/dist/chunks/store-human-review-ZQNLZRGG.js +0 -7
- package/dist/chunks/store-learned-preference-migration-validation-UH6MJQSH.js +0 -2
- package/dist/chunks/store-model-batch-review-QO4VVKWC.js +0 -2
- package/dist/chunks/store-model-configuration-C3HSOFD5.js +0 -3
- package/dist/chunks/store-model-project-preparation-RQ2YTC2Y.js +0 -2
- package/dist/chunks/store-task-inbox-DL5RYFPO.js +0 -33
- package/dist/chunks/store-taskset-drafts-UFGN4SGF.js +0 -9
- package/dist/chunks/taskset-packages-CBLJFWDQ.js +0 -2
- package/dist/chunks/training-error-L5V5IBX3.js +0 -2
- package/dist/chunks/training-hosted-I2NDBYGS.js +0 -2
- package/dist/chunks/training-hosted-report-4F25RZZ4.js +0 -2
- package/dist/chunks/training-hosted-workers-KI767T4Y.js +0 -2
- package/dist/skills/openpond-desktop-harness/SKILL.md +0 -113
- package/dist/skills/openpond-desktop-harness/agents/openai.yaml +0 -4
- package/dist/web/assets/App-DHJVXTI2.js +0 -54
- package/dist/web/assets/AppTerminalPanel-RjFlF-a4.js +0 -2
- package/dist/web/assets/AppsView-ttlr9ckQ.js +0 -1
- package/dist/web/assets/BrowserSidebar-Cp2l0kg0.js +0 -1
- package/dist/web/assets/ChatTimelineEntry-BITv20Ze.js +0 -1
- package/dist/web/assets/CommandMenu-6oj8FUr6.js +0 -1
- package/dist/web/assets/ComposerAttachments-6en7m_ov.js +0 -2
- package/dist/web/assets/FilePagePreview-CW4J_1u7.js +0 -2
- package/dist/web/assets/LabModelVersionDetailPage-f0tHT-Sn.js +0 -1
- package/dist/web/assets/LabsRoute-B61l1b8P.js +0 -101
- package/dist/web/assets/MainChatThread-egKi0gLk.js +0 -2
- package/dist/web/assets/MainPane-2dj6Dg4l.js +0 -95
- package/dist/web/assets/MainPane-BwHw3UYp.css +0 -1
- package/dist/web/assets/NativeSetupTerminal-CNHTByLo.js +0 -2
- package/dist/web/assets/NativeSkillSidebar-DCdMbSfe.js +0 -1
- package/dist/web/assets/RightChatPanelStack-B3mBViGC.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CxDYSyyx.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-Dh47iH11.js +0 -1
- package/dist/web/assets/SettingsView-D2bu3tK_.js +0 -5
- package/dist/web/assets/TeamChatView-CN17AsgA.js +0 -1
- package/dist/web/assets/TrainingCreationPanel-DJKzaNFj.js +0 -1
- package/dist/web/assets/TrainingMetricWorkbench-DBy8F1xp.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-Ds-eTQLs.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-D_iyg2D4.js +0 -11
- package/dist/web/assets/WorkspaceEnvironmentMenu-Fn-NlfMQ.js +0 -35
- package/dist/web/assets/app-models-BviS9b7U.js +0 -1
- package/dist/web/assets/browser-sidebar-links-ujSvTf5h.js +0 -1
- package/dist/web/assets/chat-resources-3SvnVeKv.js +0 -1
- package/dist/web/assets/chevron-right-sFx2xRvT.js +0 -1
- package/dist/web/assets/contracts-BHTOD1nd.js +0 -1
- package/dist/web/assets/icons-CK5-nxVC.js +0 -1
- package/dist/web/assets/index-Dezj4Z2p.css +0 -1
- package/dist/web/assets/loader-circle-cyf35w3i.js +0 -1
- package/dist/web/assets/play-wI_3FLr4.js +0 -1
- package/dist/web/assets/plus-DoJe4fLj.js +0 -1
- package/dist/web/assets/settings-BKmRueaw.js +0 -21
- package/dist/web/assets/square-BqSK-hv9.js +0 -1
- package/dist/web/assets/submit-issue-command-DRgUboVW.js +0 -3
- package/dist/web/assets/training-managed-adapter-BXNwgd3P.js +0 -1
- package/dist/web/assets/useAgentInventory-B-LNn3up.js +0 -1
- package/dist/web/assets/x-IPhrr4ju.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{l as Bo}from"./chunk-WQMXEZVE.js";import"./chunk-C7M2WBWZ.js";import"./chunk-2V4LPUBH.js";import"./chunk-SD64CLJX.js";import"./chunk-FUSCTBJI.js";import"./chunk-PAE3PQEC.js";import"./chunk-O3MHHGC5.js";import"./chunk-SZKFNKWO.js";import"./chunk-R4PDSOB4.js";import"./chunk-WGLVSGFA.js";import"./chunk-7R56WC7L.js";import"./chunk-VFH5C6D2.js";import"./chunk-AN525SPP.js";import"./chunk-UT6F6AIB.js";import"./chunk-RTJCELRR.js";import"./chunk-SYUKES6H.js";import"./chunk-4NXEYPPX.js";import"./chunk-NWOK6NLE.js";import"./chunk-5MTN6KXV.js";import"./chunk-IZ6DLEVY.js";import"./chunk-6SH4B7DV.js";import"./chunk-LRRBYIGH.js";import"./chunk-VPDG2V2R.js";import"./chunk-GOIKLFXK.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-TGEGXTPR.js";import"./chunk-GNCEZ3UP.js";import"./chunk-Y2KPHVZK.js";import"./chunk-IZ56L2ZK.js";import"./chunk-GW766ZSO.js";import{a as Go,j as Qn}from"./chunk-MNFW5WLD.js";import"./chunk-QAVQJZCM.js";import"./chunk-GV3LFSMI.js";import"./chunk-7KWD2I6W.js";import"./chunk-B4RKHHF7.js";import"./chunk-VK4TPZTA.js";import"./chunk-YU3C6U5V.js";import"./chunk-MNXNZDDW.js";import"./chunk-KVTBX2UP.js";import"./chunk-557XSPVS.js";import{e as Fo}from"./chunk-LJPO3TEL.js";import"./chunk-4ZBOYWQ3.js";import"./chunk-DMFUEUAZ.js";import"./chunk-KCJVFLBB.js";import"./chunk-JHR3LF2F.js";import{a as $o,c as Jn}from"./chunk-TUCKED4T.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-INO67SEN.js";import"./chunk-2ITZW2CN.js";import"./chunk-BEI4YULC.js";import"./chunk-CN5OXQ7A.js";import"./chunk-NR5VASQB.js";import{a as Lo,q as dt,r as Ae,t as Jt,v as Uo,z as Qt}from"./chunk-JY3YSI54.js";import"./chunk-W5W4IODW.js";import"./chunk-OZ6LRNRE.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-RH43WLBX.js";import"./chunk-P74RR2GB.js";import"./chunk-MWXW2CA6.js";import"./chunk-L3KS6MOV.js";import"./chunk-KOKX7PBS.js";import"./chunk-NLQ2UPN2.js";import"./chunk-XGY4OQLC.js";import"./chunk-547AUVKN.js";import"./chunk-IWK3RTLR.js";import"./chunk-IDOGNIMV.js";import"./chunk-JFXINDOQ.js";import"./chunk-PCB65K4G.js";import"./chunk-N5GPINVP.js";import"./chunk-TW3SRBLU.js";import"./chunk-PGO4FRHU.js";import"./chunk-VNJAAYNQ.js";import"./chunk-TVTFEGTU.js";import"./chunk-NVHZRKXB.js";import"./chunk-MTP3B2SU.js";import"./chunk-4N4EH3RJ.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-OSVGNONV.js";import"./chunk-XWDFXM3S.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-JCLTFDVW.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import{a as Po,c as Io}from"./chunk-UGOK7VTC.js";import"./chunk-4M3YW3EQ.js";import{h as Zn,i as sl,j as rl,k as ol,l as il,m as al,n as cl,o as ll,p as ul,q as dl,r as pl}from"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import{A as Q,a as Mo,b as Bn,c as Oo,e as r,f as Zt,g as k,h as X,i as O,j as qo,k as jo,l as p,m as y,n as c,o as B,p as T,q as Vn,r as de,s as m,t as re,u as f,v as F,w as No,x as Wn,y as Do,z as Ho}from"./chunk-PF56N7ZY.js";import{a as i,b as Se,c as Z,e as Wt}from"./chunk-FTQLQJQV.js";var ua=Z(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});var Ef=al(),vf=cl(),Rf=ll(),kf=ul(),la=dl(),Cf=[Ef.default,vf.default,(0,Rf.default)(),kf.default,la.metadataVocabulary,la.contentVocabulary];Fr.default=Cf});var da=Z((OS,Af)=>{Af.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0}});var Vr=Z((G,Br)=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.MissingRefError=G.ValidationError=G.CodeGen=G.Name=G.nil=G.stringify=G.str=G._=G.KeywordCxt=G.Ajv=void 0;var Pf=il(),If=ua(),Mf=pl(),pa=da(),Of=["/properties"],Pn="http://json-schema.org/draft-07/schema",ot=class extends Pf.default{static{i(this,"Ajv")}_addVocabularies(){super._addVocabularies(),If.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Mf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(pa,Of):pa;this.addMetaSchema(e,Pn,!1),this.refs["http://json-schema.org/schema"]=Pn}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pn)?Pn:void 0)}};G.Ajv=ot;Br.exports=G=ot;Br.exports.Ajv=ot;Object.defineProperty(G,"__esModule",{value:!0});G.default=ot;var qf=sl();Object.defineProperty(G,"KeywordCxt",{enumerable:!0,get:i(function(){return qf.KeywordCxt},"get")});var it=Zn();Object.defineProperty(G,"_",{enumerable:!0,get:i(function(){return it._},"get")});Object.defineProperty(G,"str",{enumerable:!0,get:i(function(){return it.str},"get")});Object.defineProperty(G,"stringify",{enumerable:!0,get:i(function(){return it.stringify},"get")});Object.defineProperty(G,"nil",{enumerable:!0,get:i(function(){return it.nil},"get")});Object.defineProperty(G,"Name",{enumerable:!0,get:i(function(){return it.Name},"get")});Object.defineProperty(G,"CodeGen",{enumerable:!0,get:i(function(){return it.CodeGen},"get")});var jf=rl();Object.defineProperty(G,"ValidationError",{enumerable:!0,get:i(function(){return jf.default},"get")});var Nf=ol();Object.defineProperty(G,"MissingRefError",{enumerable:!0,get:i(function(){return Nf.default},"get")})});var wa=Z(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.formatNames=ze.fastFormats=ze.fullFormats=void 0;function he(n,e){return{validate:n,compare:e}}i(he,"fmtDef");ze.fullFormats={date:he(za,Qr),time:he(Zr(!0),Kr),"date-time":he(ma(!0),_a),"iso-time":he(Zr(),ga),"iso-date-time":he(ma(),ya),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Gf,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Qf,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Ff,int32:{type:"number",validate:Wf},int64:{type:"number",validate:Zf},float:{type:"number",validate:ha},double:{type:"number",validate:ha},password:!0,binary:!0};ze.fastFormats={...ze.fullFormats,date:he(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Qr),time:he(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Kr),"date-time":he(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_a),"iso-time":he(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ga),"iso-date-time":he(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ya),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ze.formatNames=Object.keys(ze.fullFormats);function Df(n){return n%4===0&&(n%100!==0||n%400===0)}i(Df,"isLeapYear");var Hf=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,$f=[0,31,28,31,30,31,30,31,31,30,31,30,31];function za(n){let e=Hf.exec(n);if(!e)return!1;let t=+e[1],s=+e[2],o=+e[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&Df(t)?29:$f[s])}i(za,"date");function Qr(n,e){if(n&&e)return n>e?1:n<e?-1:0}i(Qr,"compareDate");var Wr=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Zr(n){return i(function(t){let s=Wr.exec(t);if(!s)return!1;let o=+s[1],l=+s[2],u=+s[3],d=s[4],h=s[5]==="-"?-1:1,z=+(s[6]||0),g=+(s[7]||0);if(z>23||g>59||n&&!d)return!1;if(o<=23&&l<=59&&u<60)return!0;let _=l-g*h,w=o-z*h-(_<0?1:0);return(w===23||w===-1)&&(_===59||_===-1)&&u<61},"time")}i(Zr,"getTime");function Kr(n,e){if(!(n&&e))return;let t=new Date("2020-01-01T"+n).valueOf(),s=new Date("2020-01-01T"+e).valueOf();if(t&&s)return t-s}i(Kr,"compareTime");function ga(n,e){if(!(n&&e))return;let t=Wr.exec(n),s=Wr.exec(e);if(t&&s)return n=t[1]+t[2]+t[3],e=s[1]+s[2]+s[3],n>e?1:n<e?-1:0}i(ga,"compareIsoTime");var Jr=/t|\s/i;function ma(n){let e=Zr(n);return i(function(s){let o=s.split(Jr);return o.length===2&&za(o[0])&&e(o[1])},"date_time")}i(ma,"getDateTime");function _a(n,e){if(!(n&&e))return;let t=new Date(n).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}i(_a,"compareDateTime");function ya(n,e){if(!(n&&e))return;let[t,s]=n.split(Jr),[o,l]=e.split(Jr),u=Qr(t,o);if(u!==void 0)return u||Kr(s,l)}i(ya,"compareIsoDateTime");var Lf=/\/|:/,Uf=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Gf(n){return Lf.test(n)&&Uf.test(n)}i(Gf,"uri");var fa=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Ff(n){return fa.lastIndex=0,fa.test(n)}i(Ff,"byte");var Bf=-(2**31),Vf=2**31-1;function Wf(n){return Number.isInteger(n)&&n<=Vf&&n>=Bf}i(Wf,"validateInt32");function Zf(n){return Number.isInteger(n)}i(Zf,"validateInt64");function ha(){return!0}i(ha,"validateNumber");var Jf=/[^\\]\\Z/;function Qf(n){if(Jf.test(n))return!1;try{return new RegExp(n),!0}catch{return!1}}i(Qf,"regex")});var ba=Z(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.formatLimitDefinition=void 0;var Kf=Vr(),me=Zn(),ke=me.operators,In={formatMaximum:{okStr:"<=",ok:ke.LTE,fail:ke.GT},formatMinimum:{okStr:">=",ok:ke.GTE,fail:ke.LT},formatExclusiveMaximum:{okStr:"<",ok:ke.LT,fail:ke.GTE},formatExclusiveMinimum:{okStr:">",ok:ke.GT,fail:ke.LTE}},Xf={message:i(({keyword:n,schemaCode:e})=>(0,me.str)`should be ${In[n].okStr} ${e}`,"message"),params:i(({keyword:n,schemaCode:e})=>(0,me._)`{comparison: ${In[n].okStr}, limit: ${e}}`,"params")};at.formatLimitDefinition={keyword:Object.keys(In),type:"string",schemaType:"string",$data:!0,error:Xf,code(n){let{gen:e,data:t,schemaCode:s,keyword:o,it:l}=n,{opts:u,self:d}=l;if(!u.validateFormats)return;let h=new Kf.KeywordCxt(l,d.RULES.all.format.definition,"format");h.$data?z():g();function z(){let w=e.scopeValue("formats",{ref:d.formats,code:u.code.formats}),b=e.const("fmt",(0,me._)`${w}[${h.schemaCode}]`);n.fail$data((0,me.or)((0,me._)`typeof ${b} != "object"`,(0,me._)`${b} instanceof RegExp`,(0,me._)`typeof ${b}.compare != "function"`,_(b)))}i(z,"validate$DataFormat");function g(){let w=h.schema,b=d.formats[w];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${o}": format "${w}" does not define "compare" function`);let E=e.scopeValue("formats",{key:w,ref:b,code:u.code.formats?(0,me._)`${u.code.formats}${(0,me.getProperty)(w)}`:void 0});n.fail$data(_(E))}i(g,"validateFormat");function _(w){return(0,me._)`${w}.compare(${t}, ${s}) ${In[o].fail} 0`}i(_,"compareCode")},dependencies:["format"]};var Yf=i(n=>(n.addKeyword(at.formatLimitDefinition),n),"formatLimitPlugin");at.default=Yf});var Ea=Z((Ct,Ta)=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});var ct=wa(),eh=ba(),Xr=Zn(),Sa=new Xr.Name("fullFormats"),th=new Xr.Name("fastFormats"),Yr=i((n,e={keywords:!0})=>{if(Array.isArray(e))return xa(n,e,ct.fullFormats,Sa),n;let[t,s]=e.mode==="fast"?[ct.fastFormats,th]:[ct.fullFormats,Sa],o=e.formats||ct.formatNames;return xa(n,o,t,s),e.keywords&&(0,eh.default)(n),n},"formatsPlugin");Yr.get=(n,e="full")=>{let s=(e==="fast"?ct.fastFormats:ct.fullFormats)[n];if(!s)throw new Error(`Unknown format "${n}"`);return s};function xa(n,e,t,s){var o,l;(o=(l=n.opts.code).formats)!==null&&o!==void 0||(l.formats=(0,Xr._)`require("ajv-formats/dist/formats").${s}`);for(let u of e)n.addFormat(u,t[u])}i(xa,"addFormats");Ta.exports=Ct=Yr;Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=Yr});var Oa=Z((nx,Ma)=>{Ma.exports=Ia;Ia.sync=oh;var Aa=Se("fs");function rh(n,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var s=0;s<t.length;s++){var o=t[s].toLowerCase();if(o&&n.substr(-o.length).toLowerCase()===o)return!0}return!1}i(rh,"checkPathExt");function Pa(n,e,t){return!n.isSymbolicLink()&&!n.isFile()?!1:rh(e,t)}i(Pa,"checkStat");function Ia(n,e,t){Aa.stat(n,function(s,o){t(s,s?!1:Pa(o,n,e))})}i(Ia,"isexe");function oh(n,e){return Pa(Aa.statSync(n),n,e)}i(oh,"sync")});var Ha=Z((rx,Da)=>{Da.exports=ja;ja.sync=ih;var qa=Se("fs");function ja(n,e,t){qa.stat(n,function(s,o){t(s,s?!1:Na(o,e))})}i(ja,"isexe");function ih(n,e){return Na(qa.statSync(n),e)}i(ih,"sync");function Na(n,e){return n.isFile()&&ah(n,e)}i(Na,"checkStat");function ah(n,e){var t=n.mode,s=n.uid,o=n.gid,l=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),u=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),d=parseInt("100",8),h=parseInt("010",8),z=parseInt("001",8),g=d|h,_=t&z||t&h&&o===u||t&d&&s===l||t&g&&l===0;return _}i(ah,"checkMode")});var La=Z((ax,$a)=>{var ix=Se("fs"),Nn;process.platform==="win32"||global.TESTING_WINDOWS?Nn=Oa():Nn=Ha();$a.exports=eo;eo.sync=ch;function eo(n,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,o){eo(n,e||{},function(l,u){l?o(l):s(u)})})}Nn(n,e||{},function(s,o){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,o=!1),t(s,o)})}i(eo,"isexe");function ch(n,e){try{return Nn.sync(n,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}i(ch,"sync")});var Za=Z((lx,Wa)=>{var lt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ua=Se("path"),lh=lt?";":":",Ga=La(),Fa=i(n=>Object.assign(new Error(`not found: ${n}`),{code:"ENOENT"}),"getNotFoundError"),Ba=i((n,e)=>{let t=e.colon||lh,s=n.match(/\//)||lt&&n.match(/\\/)?[""]:[...lt?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=lt?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=lt?o.split(t):[""];return lt&&n.indexOf(".")!==-1&&l[0]!==""&&l.unshift(""),{pathEnv:s,pathExt:l,pathExtExe:o}},"getPathInfo"),Va=i((n,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:s,pathExt:o,pathExtExe:l}=Ba(n,e),u=[],d=i(z=>new Promise((g,_)=>{if(z===s.length)return e.all&&u.length?g(u):_(Fa(n));let w=s[z],b=/^".*"$/.test(w)?w.slice(1,-1):w,E=Ua.join(b,n),x=!b&&/^\.[\\\/]/.test(n)?n.slice(0,2)+E:E;g(h(x,z,0))}),"step"),h=i((z,g,_)=>new Promise((w,b)=>{if(_===o.length)return w(d(g+1));let E=o[_];Ga(z+E,{pathExt:l},(x,A)=>{if(!x&&A)if(e.all)u.push(z+E);else return w(z+E);return w(h(z,g,_+1))})}),"subStep");return t?d(0).then(z=>t(null,z),t):d(0)},"which"),uh=i((n,e)=>{e=e||{};let{pathEnv:t,pathExt:s,pathExtExe:o}=Ba(n,e),l=[];for(let u=0;u<t.length;u++){let d=t[u],h=/^".*"$/.test(d)?d.slice(1,-1):d,z=Ua.join(h,n),g=!h&&/^\.[\\\/]/.test(n)?n.slice(0,2)+z:z;for(let _=0;_<s.length;_++){let w=g+s[_];try{if(Ga.sync(w,{pathExt:o}))if(e.all)l.push(w);else return w}catch{}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw Fa(n)},"whichSync");Wa.exports=Va;Va.sync=uh});var Qa=Z((dx,to)=>{"use strict";var Ja=i((n={})=>{let e=n.env||process.env;return(n.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"},"pathKey");to.exports=Ja;to.exports.default=Ja});var ec=Z((mx,Ya)=>{"use strict";var Ka=Se("path"),dh=Za(),ph=Qa();function Xa(n,e){let t=n.options.env||process.env,s=process.cwd(),o=n.options.cwd!=null,l=o&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(n.options.cwd)}catch{}let u;try{u=dh.sync(n.command,{path:t[ph({env:t})],pathExt:e?Ka.delimiter:void 0})}catch{}finally{l&&process.chdir(s)}return u&&(u=Ka.resolve(o?n.options.cwd:"",u)),u}i(Xa,"resolveCommandAttempt");function mh(n){return Xa(n)||Xa(n,!0)}i(mh,"resolveCommand");Ya.exports=mh});var tc=Z((hx,so)=>{"use strict";var no=/([()\][%!^"`<>&|;, *?])/g;function fh(n){return n=n.replace(no,"^$1"),n}i(fh,"escapeCommand");function hh(n,e){return n=`${n}`,n=n.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),n=n.replace(/(?=(\\+?)?)\1$/,"$1$1"),n=`"${n}"`,n=n.replace(no,"^$1"),e&&(n=n.replace(no,"^$1")),n}i(hh,"escapeArgument");so.exports.command=fh;so.exports.argument=hh});var sc=Z((gx,nc)=>{"use strict";nc.exports=/^#!(.*)/});var oc=Z((_x,rc)=>{"use strict";var zh=sc();rc.exports=(n="")=>{let e=n.match(zh);if(!e)return null;let[t,s]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?s:s?`${o} ${s}`:o}});var ac=Z((yx,ic)=>{"use strict";var ro=Se("fs"),gh=oc();function _h(n){let t=Buffer.alloc(150),s;try{s=ro.openSync(n,"r"),ro.readSync(s,t,0,150,0),ro.closeSync(s)}catch{}return gh(t.toString())}i(_h,"readShebang");ic.exports=_h});var dc=Z((bx,uc)=>{"use strict";var yh=Se("path"),cc=ec(),lc=tc(),wh=ac(),bh=process.platform==="win32",Sh=/\.(?:com|exe)$/i,xh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Th(n){n.file=cc(n);let e=n.file&&wh(n.file);return e?(n.args.unshift(n.file),n.command=e,cc(n)):n.file}i(Th,"detectShebang");function Eh(n){if(!bh)return n;let e=Th(n),t=!Sh.test(e);if(n.options.forceShell||t){let s=xh.test(e);n.command=yh.normalize(n.command),n.command=lc.command(n.command),n.args=n.args.map(l=>lc.argument(l,s));let o=[n.command].concat(n.args).join(" ");n.args=["/d","/s","/c",`"${o}"`],n.command=process.env.comspec||"cmd.exe",n.options.windowsVerbatimArguments=!0}return n}i(Eh,"parseNonShell");function vh(n,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let s={command:n,args:e,options:t,file:void 0,original:{command:n,args:e}};return t.shell?s:Eh(s)}i(vh,"parse");uc.exports=vh});var fc=Z((xx,mc)=>{"use strict";var oo=process.platform==="win32";function io(n,e){return Object.assign(new Error(`${e} ${n.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${n.command}`,path:n.command,spawnargs:n.args})}i(io,"notFoundError");function Rh(n,e){if(!oo)return;let t=n.emit;n.emit=function(s,o){if(s==="exit"){let l=pc(o,e);if(l)return t.call(n,"error",l)}return t.apply(n,arguments)}}i(Rh,"hookChildProcess");function pc(n,e){return oo&&n===1&&!e.file?io(e.original,"spawn"):null}i(pc,"verifyENOENT");function kh(n,e){return oo&&n===1&&!e.file?io(e.original,"spawnSync"):null}i(kh,"verifyENOENTSync");mc.exports={hookChildProcess:Rh,verifyENOENT:pc,verifyENOENTSync:kh,notFoundError:io}});var gc=Z((Ex,ut)=>{"use strict";var hc=Se("child_process"),ao=dc(),co=fc();function zc(n,e,t){let s=ao(n,e,t),o=hc.spawn(s.command,s.args,s.options);return co.hookChildProcess(o,s),o}i(zc,"spawn");function Ch(n,e,t){let s=ao(n,e,t),o=hc.spawnSync(s.command,s.args,s.options);return o.error=o.error||co.verifyENOENTSync(o.status,s),o}i(Ch,"spawnSync");ut.exports=zc;ut.exports.spawn=zc;ut.exports.sync=Ch;ut.exports._parse=ao;ut.exports._enoent=co});var xc=Z(po=>{"use strict";var wc=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Oh=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,bc=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,qh=/\\([\u000b\u0020-\u00ff])/g,jh=/([\\"])/g,Sc=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;po.format=Nh;po.parse=Dh;function Nh(n){if(!n||typeof n!="object")throw new TypeError("argument obj is required");var e=n.parameters,t=n.type;if(!t||!Sc.test(t))throw new TypeError("invalid type");var s=t;if(e&&typeof e=="object")for(var o,l=Object.keys(e).sort(),u=0;u<l.length;u++){if(o=l[u],!bc.test(o))throw new TypeError("invalid parameter name");s+="; "+o+"="+$h(e[o])}return s}i(Nh,"format");function Dh(n){if(!n)throw new TypeError("argument string is required");var e=typeof n=="object"?Hh(n):n;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),s=t!==-1?e.slice(0,t).trim():e.trim();if(!Sc.test(s))throw new TypeError("invalid media type");var o=new Lh(s.toLowerCase());if(t!==-1){var l,u,d;for(wc.lastIndex=t;u=wc.exec(e);){if(u.index!==t)throw new TypeError("invalid parameter format");t+=u[0].length,l=u[1].toLowerCase(),d=u[2],d.charCodeAt(0)===34&&(d=d.slice(1,-1),d.indexOf("\\")!==-1&&(d=d.replace(qh,"$1"))),o.parameters[l]=d}if(t!==e.length)throw new TypeError("invalid parameter format")}return o}i(Dh,"parse");function Hh(n){var e;if(typeof n.getHeader=="function"?e=n.getHeader("content-type"):typeof n.headers=="object"&&(e=n.headers&&n.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}i(Hh,"getcontenttype");function $h(n){var e=String(n);if(bc.test(e))return e;if(e.length>0&&!Oh.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(jh,"\\$1")+'"'}i($h,"qstring");function Lh(n){this.parameters=Object.create(null),this.type=n}i(Lh,"ContentType")});import{Readable as vz,Writable as Rz}from"node:stream";var S={initialize:"initialize",authenticate:"authenticate",providers_list:"providers/list",providers_set:"providers/set",providers_disable:"providers/disable",session_new:"session/new",session_load:"session/load",session_set_mode:"session/set_mode",session_set_config_option:"session/set_config_option",session_prompt:"session/prompt",session_cancel:"session/cancel",mcp_message:"mcp/message",session_list:"session/list",session_delete:"session/delete",session_fork:"session/fork",session_resume:"session/resume",session_close:"session/close",logout:"logout",nes_start:"nes/start",nes_suggest:"nes/suggest",nes_accept:"nes/accept",nes_reject:"nes/reject",nes_close:"nes/close",document_did_open:"document/didOpen",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_save:"document/didSave",document_did_focus:"document/didFocus"},D={session_request_permission:"session/request_permission",session_update:"session/update",fs_write_text_file:"fs/write_text_file",fs_read_text_file:"fs/read_text_file",terminal_create:"terminal/create",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit",terminal_kill:"terminal/kill",mcp_message:"mcp/message",elicitation_create:"elicitation/create",elicitation_complete:"elicitation/complete"},Kn={cancel_request:"$/cancel_request"};var Vo=Symbol("skippedItem");function a(n,e){return n.catch(e)}i(a,"defaultOnError");function oe(n,e){let t=n.catch(e);return Q.unknown().transform((s,o)=>s!==void 0?t.parse(s):(o.addIssue({code:"custom",message:"Required value is missing"}),Q.NEVER))}i(oe,"requiredDefaultOnError");function Wo(n,e){if(n===null||typeof n!="object"||Array.isArray(n))return;let t=n[e];return typeof t=="string"?t:void 0}i(Wo,"stringTag");function Ge(n,e,t){return n.superRefine((s,o)=>{let l=Wo(s,e);l!==void 0&&t.includes(l)&&o.addIssue({code:"custom",path:[e],message:`${e} ${JSON.stringify(l)} is reserved by a known variant, but the value does not match that variant's schema`})})}i(Ge,"excludeKnownTags");function Fe(n,e,t){return Q.unknown().transform((s,o)=>{let l=n.safeParse(s);if(!l.success){for(let h of l.error.issues)o.addIssue({...h,input:s});return Q.NEVER}let u=l.data,d=Wo(s,e);if(d!==void 0&&!t.includes(d)){let h=s;for(let[z,g]of Object.entries(h))z!=="__proto__"&&(Object.hasOwn(u,z)||(u[z]=g))}return u})}i(Fe,"preserveCustomPayload");function j(n){return Q.array(n.catch(Vo)).transform(e=>e.filter(t=>t!==Vo))}i(j,"vecSkipError");var xe=T([k(),r()]).nullable(),N=r(),es=c({sessionId:N,path:r(),content:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),ts=c({sessionId:N,path:r(),line:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),limit:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ns=r(),Zo=T([f("read"),f("edit"),f("delete"),f("move"),f("search"),f("execute"),f("think"),f("fetch"),f("switch_mode"),f("other")]),Jo=T([f("pending"),f("in_progress"),f("completed"),f("failed")]),fl=T([f("assistant"),f("user")]),pt=c({audience:a(j(fl).nullish(),()=>{}),lastModified:a(r().nullish(),()=>{}),priority:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),hl=c({annotations:a(pt.nullish(),()=>{}),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),zl=c({annotations:a(pt.nullish(),()=>{}),data:r(),mimeType:r(),uri:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),gl=c({annotations:a(pt.nullish(),()=>{}),data:r(),mimeType:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),_l=c({annotations:a(pt.nullish(),()=>{}),description:a(r().nullish(),()=>{}),mimeType:a(r().nullish(),()=>{}),name:r(),size:a(k().nullish(),()=>{}),title:a(r().nullish(),()=>{}),uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),yl=c({mimeType:a(r().nullish(),()=>{}),text:r(),uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),wl=c({blob:r(),mimeType:a(r().nullish(),()=>{}),uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),bl=T([yl,wl]),Sl=c({annotations:a(pt.nullish(),()=>{}),resource:bl,_meta:a(m(r(),p()).nullish(),()=>{})}),Pe=T([hl.and(c({type:f("text")})),zl.and(c({type:f("image")})),gl.and(c({type:f("audio")})),_l.and(c({type:f("resource_link")})),Sl.and(c({type:f("resource")}))]),xl=c({content:Pe,_meta:a(m(r(),p()).nullish(),()=>{})}),Tl=c({path:r(),oldText:a(r().nullish(),()=>{}),newText:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Be=r(),El=c({terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),Qo=T([xl.and(c({type:f("content")})),Tl.and(c({type:f("diff")})),El.and(c({type:f("terminal")}))]),Ko=c({path:r(),line:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Xo=c({toolCallId:ns,kind:a(Zo.nullish(),()=>{}),status:a(Jo.nullish(),()=>{}),title:a(r().nullish(),()=>{}),name:a(r().nullish(),()=>{}),content:a(j(Qo).nullish(),()=>{}),locations:a(j(Ko).nullish(),()=>{}),rawInput:a(p().optional(),()=>{}),rawOutput:a(p().optional(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Yo=r(),vl=T([f("allow_once"),f("allow_always"),f("reject_once"),f("reject_always")]),Rl=c({optionId:Yo,name:r(),kind:vl,_meta:a(m(r(),p()).nullish(),()=>{})}),ss=c({sessionId:N,toolCall:Xo,options:y(Rl),_meta:a(m(r(),p()).nullish(),()=>{})}),ei=c({name:r(),value:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),rs=c({sessionId:N,command:r(),args:a(j(r()).optional(),()=>[]),env:a(j(ei).optional(),()=>[]),cwd:a(r().nullish(),()=>{}),outputByteLimit:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),os=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),is=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),as=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),cs=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),mt=c({sessionId:N,toolCallId:a(ns.nullish(),()=>{})}),ft=c({requestId:xe}),kl=f("object"),Cl=T([f("email"),f("uri"),f("date"),f("date-time")]),ti=c({const:r(),title:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ls=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minLength:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),maxLength:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),pattern:r().nullish(),format:Cl.nullish(),default:a(r().nullish(),()=>{}),enum:y(r()).nullish(),oneOf:y(ti).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),us=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minimum:k().nullish(),maximum:k().nullish(),default:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ds=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minimum:k().nullish(),maximum:k().nullish(),default:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ps=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),default:a(O().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ms=c({enum:y(r()),_meta:a(m(r(),p()).nullish(),()=>{})}),ni=c({anyOf:y(ti),_meta:a(m(r(),p()).nullish(),()=>{})}),Al=Fe(T([ms.and(c({type:f("string")})),Ge(c({type:r()}),"type",["string"]),ni]),"type",["string"]),fs=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minItems:k().nullish(),maxItems:k().nullish(),items:Al,default:a(j(r()).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Pl=Fe(T([ls.and(c({type:f("string")})),us.and(c({type:f("number")})),ds.and(c({type:f("integer")})),ps.and(c({type:f("boolean")})),fs.and(c({type:f("array")})),Ge(c({type:r()}),"type",["array","boolean","integer","number","string"])]),"type",["array","boolean","integer","number","string"]),Il=c({type:a(kl.optional().default("object"),()=>"object"),title:a(r().nullish(),()=>{}),properties:m(r(),Pl).optional().default({}),required:y(r()).nullish(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),hs=de(T([mt,ft]),c({requestedSchema:Il})),si=r(),zs=de(T([mt,ft]),c({elicitationId:si,url:Zt()})),gs=Fe(de(T([hs.and(c({mode:f("form")})),zs.and(c({mode:f("url")})),Ge(de(T([mt,ft]),c({mode:r()})),"mode",["form","url"])]),c({message:r(),_meta:a(m(r(),p()).nullish(),()=>{})})),"mode",["form","url"]),_s=r(),ri=r(),Ml=c({serverId:_s,requestId:ri,method:r(),params:m(r(),p()).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),oi=p(),Oz=c({id:xe,method:r(),params:T([es,ts,ss,rs,os,is,as,cs,gs,Ml,oi]).nullish()}),ii=X().gte(0).lte(65535),Ol=c({image:a(O().optional().default(!1),()=>!1),audio:a(O().optional().default(!1),()=>!1),embeddedContext:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),ql=c({http:a(O().optional().default(!1),()=>!1),sse:a(O().optional().default(!1),()=>!1),acp:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),jl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Nl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Dl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Hl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),$l=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Ll=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Ul=c({list:a(jl.nullish(),()=>{}),delete:a(Nl.nullish(),()=>{}),additionalDirectories:a(Dl.nullish(),()=>{}),fork:a(Hl.nullish(),()=>{}),resume:a($l.nullish(),()=>{}),close:a(Ll.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Gl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Fl=c({logout:a(Gl.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Bl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Vl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Wl=T([f("full"),f("incremental")]),Zl=c({syncKind:Wl,_meta:a(m(r(),p()).nullish(),()=>{})}),Jl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Ql=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Kl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Xl=c({didOpen:a(Vl.nullish(),()=>{}),didChange:a(Zl.nullish(),()=>{}),didClose:a(Jl.nullish(),()=>{}),didSave:a(Ql.nullish(),()=>{}),didFocus:a(Kl.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Yl=c({document:a(Xl.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),eu=c({maxCount:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),tu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),nu=c({maxCount:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),su=c({maxCount:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ru=c({_meta:a(m(r(),p()).nullish(),()=>{})}),ou=c({_meta:a(m(r(),p()).nullish(),()=>{})}),iu=c({recentFiles:a(eu.nullish(),()=>{}),relatedSnippets:a(tu.nullish(),()=>{}),editHistory:a(nu.nullish(),()=>{}),userActions:a(su.nullish(),()=>{}),openFiles:a(ru.nullish(),()=>{}),diagnostics:a(ou.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),au=c({events:a(Yl.nullish(),()=>{}),context:a(iu.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ai=T([f("utf-16"),f("utf-32"),f("utf-8")]),cu=c({loadSession:a(O().optional().default(!1),()=>!1),promptCapabilities:a(Ol.optional().default({image:!1,audio:!1,embeddedContext:!1}),()=>({image:!1,audio:!1,embeddedContext:!1})),mcpCapabilities:a(ql.optional().default({http:!1,sse:!1,acp:!1}),()=>({http:!1,sse:!1,acp:!1})),sessionCapabilities:a(Ul.optional().default({}),()=>({})),auth:a(Fl.optional().default({}),()=>({})),providers:a(Bl.nullish(),()=>{}),nes:a(au.nullish(),()=>{}),positionEncoding:a(ai.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ys=r(),lu=c({id:ys,name:r(),description:a(r().nullish(),()=>{}),args:a(j(r()).optional(),()=>[]),env:a(m(r(),r()).optional(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),uu=c({id:ys,name:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),du=T([lu.and(c({type:f("terminal")})),uu]),ci=c({name:r(),title:a(r().nullish(),()=>{}),version:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),pu=c({protocolVersion:ii,agentCapabilities:a(cu.optional().default({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}}),()=>({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}})),authMethods:a(j(du).optional().default([]),()=>[]),agentInfo:a(ci.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),mu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),ws=r(),bs=T([f("anthropic"),f("openai"),f("azure"),f("vertex"),f("bedrock"),r()]),fu=c({apiType:bs,baseUrl:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),hu=c({providerId:ws,supported:oe(j(bs),()=>[]),required:O(),current:fu.nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),zu=c({providers:y(hu),_meta:a(m(r(),p()).nullish(),()=>{})}),gu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),_u=c({_meta:a(m(r(),p()).nullish(),()=>{})}),yu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Kt=r(),wu=c({id:Kt,name:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Xt=c({currentModeId:Kt,availableModes:oe(j(wu),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),li=r(),bu=T([f("mode"),f("model"),f("model_config"),f("thought_level"),r()]),Ss=r(),ui=c({value:Ss,name:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Su=r(),xu=c({group:Su,name:r(),options:oe(j(ui),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Tu=T([y(ui),y(xu)]),Eu=c({currentValue:Ss,options:Tu}),vu=c({currentValue:O()}),Ve=de(T([Eu.and(c({type:f("select")})),vu.and(c({type:f("boolean")}))]),c({id:li,name:r(),description:a(r().nullish(),()=>{}),category:a(bu.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})})),Ru=c({sessionId:N,modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ku=c({modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Cu=c({sessionId:N,cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),title:a(r().nullish(),()=>{}),updatedAt:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Au=c({sessions:oe(j(Cu),()=>[]),nextCursor:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Pu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Iu=c({sessionId:N,modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Mu=c({modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ou=c({_meta:a(m(r(),p()).nullish(),()=>{})}),qu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),ju=c({configOptions:oe(j(Ve),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),di=T([f("end_turn"),f("max_tokens"),f("max_turn_requests"),f("refusal"),f("cancelled")]),pi=c({totalTokens:k(),inputTokens:k(),outputTokens:k(),thoughtTokens:a(k().nullish(),()=>{}),cachedReadTokens:a(k().nullish(),()=>{}),cachedWriteTokens:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Nu=c({stopReason:di,usage:a(pi.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Du=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),We=r(),Te=c({line:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),character:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ze=c({start:Te,end:Te,_meta:a(m(r(),p()).nullish(),()=>{})}),Hu=c({range:Ze,newText:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),$u=c({id:We,uri:r(),edits:y(Hu),cursorPosition:a(Te.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Lu=c({id:We,uri:r(),position:Te,_meta:a(m(r(),p()).nullish(),()=>{})}),Uu=c({id:We,uri:r(),position:Te,newName:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Gu=c({id:We,uri:r(),search:r(),replace:r(),isRegex:O().nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Fu=T([$u.and(c({kind:f("edit")})),Lu.and(c({kind:f("jump")})),Uu.and(c({kind:f("rename")})),Gu.and(c({kind:f("searchAndReplace")}))]),Bu=c({suggestions:y(Fu),_meta:a(m(r(),p()).nullish(),()=>{})}),Vu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),mi=p(),Wu=T([f(-32700),f(-32600),f(-32601),f(-32602),f(-32603),f(-32800),f(-32e3),f(-32002),X().min(-2147483648,{error:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{error:"Invalid value: Expected int32 to be <= 2147483647"})]),fi=c({code:Wu,message:r(),data:a(p().optional(),()=>{})}),qz=T([c({id:xe,result:T([pu,mu,zu,gu,_u,yu,Ru,ku,Au,Pu,Iu,Mu,Ou,qu,ju,Nu,Du,Bu,Vu,mi])}),c({id:xe,error:fi})]),xs=r(),Xn=c({content:Pe,messageId:a(xs.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Zu=c({toolCallId:ns,title:r(),name:a(r().nullish(),()=>{}),kind:a(Zo.optional(),()=>{}),status:a(Jo.optional(),()=>{}),content:a(j(Qo).optional(),()=>[]),locations:a(j(Ko).optional(),()=>[]),rawInput:a(p().optional(),()=>{}),rawOutput:a(p().optional(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ju=T([f("high"),f("medium"),f("low")]),Qu=T([f("pending"),f("in_progress"),f("completed")]),hi=c({content:r(),priority:Ju,status:Qu,_meta:a(m(r(),p()).nullish(),()=>{})}),Ku=c({entries:oe(j(hi),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Yt=r(),Xu=c({planId:Yt,entries:oe(j(hi),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Yu=c({planId:Yt,uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),ed=c({planId:Yt,content:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),td=T([Xu.and(c({type:f("items")})),Yu.and(c({type:f("file")})),ed.and(c({type:f("markdown")}))]),nd=c({plan:td,_meta:a(m(r(),p()).nullish(),()=>{})}),sd=c({planId:Yt,_meta:a(m(r(),p()).nullish(),()=>{})}),rd=c({hint:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),od=rd,id=c({name:r(),description:r(),input:a(od.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ad=c({availableCommands:oe(j(id),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),cd=c({currentModeId:Kt,_meta:a(m(r(),p()).nullish(),()=>{})}),ld=c({configOptions:oe(j(Ve),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),ud=c({title:a(r().nullish(),()=>{}),updatedAt:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),dd=c({amount:k(),currency:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),pd=c({used:k(),size:k(),cost:a(dd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),md=T([f("info"),f("warning"),f("error"),r()]),fd=c({severity:md,title:r().min(1),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),zi=r(),hd=T([f("in_progress"),f("completed"),f("failed"),f("cancelled"),r()]),zd=c({compactionId:zi,status:hd,summary:a(j(Pe).nullish(),()=>{}),error:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),gd=c({compactionId:zi,content:Pe,_meta:a(m(r(),p()).nullish(),()=>{})}),_d=c({_meta:a(m(r(),p()).nullish(),()=>{})}),yd=c({cancel:a(_d.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ts=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Es=c({stopReason:a(di.nullish(),()=>{}),usage:a(pi.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),vs=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Rs=c({_meta:a(m(r(),p()).nullish(),()=>{})}),wd=Fe(T([Ts.and(c({state:f("running")})),Es.and(c({state:f("idle")})),vs.and(c({state:f("requires_action")})),Rs.and(c({state:f("unknown")})),Ge(c({state:r()}),"state",["idle","requires_action","running","unknown"])]),"state",["idle","requires_action","running","unknown"]),bd=c({sessionId:N,title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),capabilities:a(yd.nullish(),()=>{}),state:a(wd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Sd=c({messageId:xs,senderSessionId:a(N.nullish(),()=>{}),recipientSessionId:a(N.nullish(),()=>{}),content:a(j(Pe).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),xd=c({messageId:xs,senderSessionId:a(N.nullish(),()=>{}),recipientSessionId:a(N.nullish(),()=>{}),content:Pe,_meta:a(m(r(),p()).nullish(),()=>{})}),Td=T([Xn.and(c({sessionUpdate:f("user_message_chunk")})),Xn.and(c({sessionUpdate:f("agent_message_chunk")})),Xn.and(c({sessionUpdate:f("agent_thought_chunk")})),Zu.and(c({sessionUpdate:f("tool_call")})),Xo.and(c({sessionUpdate:f("tool_call_update")})),Ku.and(c({sessionUpdate:f("plan")})),nd.and(c({sessionUpdate:f("plan_update")})),sd.and(c({sessionUpdate:f("plan_removed")})),ad.and(c({sessionUpdate:f("available_commands_update")})),cd.and(c({sessionUpdate:f("current_mode_update")})),ld.and(c({sessionUpdate:f("config_option_update")})),ud.and(c({sessionUpdate:f("session_info_update")})),pd.and(c({sessionUpdate:f("usage_update")})),fd.and(c({sessionUpdate:f("notice")})),zd.and(c({sessionUpdate:f("compaction_update")})),gd.and(c({sessionUpdate:f("compaction_summary_chunk")})),bd.and(c({sessionUpdate:f("subagent_update")})),Sd.and(c({sessionUpdate:f("session_message")})),xd.and(c({sessionUpdate:f("session_message_chunk")}))]),en=c({sessionId:N,update:Td,_meta:a(m(r(),p()).nullish(),()=>{})}),ks=c({elicitationId:si,_meta:a(m(r(),p()).nullish(),()=>{})}),gi=p(),jz=c({method:r(),params:T([en,ks,gi]).nullish()}),Ed=c({readTextFile:a(O().optional().default(!1),()=>!1),writeTextFile:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),vd=m(r(),p()),Rd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),kd=c({boolean:a(Rd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Cd=m(r(),p()),Ad=c({compaction:a(vd.nullish(),()=>{}),configOptions:a(kd.nullish(),()=>{}),notices:a(Cd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Pd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Id=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Md=c({terminal:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),Od=c({_meta:a(m(r(),p()).nullish(),()=>{})}),qd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),jd=c({form:a(Od.nullish(),()=>{}),url:a(qd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Nd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Dd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Hd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),$d=c({jump:a(Nd.nullish(),()=>{}),rename:a(Dd.nullish(),()=>{}),searchAndReplace:a(Hd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ld=c({fs:a(Ed.optional().default({readTextFile:!1,writeTextFile:!1}),()=>({readTextFile:!1,writeTextFile:!1})),terminal:a(O().optional().default(!1),()=>!1),session:a(Ad.nullish(),()=>{}),subagents:a(Pd.nullish(),()=>{}),plan:a(Id.nullish(),()=>{}),auth:a(Md.optional().default({terminal:!1}),()=>({terminal:!1})),elicitation:a(jd.nullish(),()=>{}),nes:a($d.nullish(),()=>{}),positionEncodings:a(j(ai).optional(),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Cs=c({protocolVersion:ii,clientCapabilities:a(Ld.optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}),()=>({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}})),clientInfo:a(ci.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),As=c({methodId:ys,_meta:a(m(r(),p()).nullish(),()=>{})}),Ps=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Is=c({providerId:ws,apiType:bs,baseUrl:r(),headers:m(r(),r()).optional(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ms=c({providerId:ws,_meta:a(m(r(),p()).nullish(),()=>{})}),Os=c({_meta:a(m(r(),p()).nullish(),()=>{})}),_i=c({name:r(),value:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ud=c({name:r(),url:r(),headers:y(_i),_meta:a(m(r(),p()).nullish(),()=>{})}),Gd=c({name:r(),url:r(),headers:y(_i),_meta:a(m(r(),p()).nullish(),()=>{})}),Fd=c({name:r(),serverId:_s,_meta:a(m(r(),p()).nullish(),()=>{})}),Bd=c({name:r(),command:r(),args:y(r()),env:y(ei),_meta:a(m(r(),p()).nullish(),()=>{})}),tn=T([Ud.and(c({type:f("http")})),Gd.and(c({type:f("sse")})),Fd.and(c({type:f("acp")})),Bd]),qs=c({cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),mcpServers:oe(j(tn),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),js=c({mcpServers:oe(j(tn),()=>[]),cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Ns=c({cwd:r().nullish(),cursor:r().nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ds=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Hs=c({sessionId:N,cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),mcpServers:a(j(tn).optional(),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),$s=c({sessionId:N,cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),mcpServers:a(j(tn).optional(),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Ls=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Us=c({sessionId:N,modeId:Kt,_meta:a(m(r(),p()).nullish(),()=>{})}),Gs=de(T([c({value:O(),type:f("boolean")}),c({value:Ss})]),c({sessionId:N,configId:li,_meta:a(m(r(),p()).nullish(),()=>{})})),Fs=c({sessionId:N,prompt:y(Pe),_meta:a(m(r(),p()).nullish(),()=>{})}),Vd=c({uri:r(),name:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Wd=c({name:r(),owner:r(),remoteUrl:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Bs=c({workspaceUri:a(r().nullish(),()=>{}),workspaceFolders:y(Vd).nullish(),repository:a(Wd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Zd=T([f("automatic"),f("diagnostic"),f("manual")]),Jd=c({uri:r(),languageId:r(),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Qd=c({startLine:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),endLine:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Kd=c({uri:r(),excerpts:y(Qd),_meta:a(m(r(),p()).nullish(),()=>{})}),Xd=c({uri:r(),diff:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Yd=c({action:r(),uri:r(),position:Te,timestampMs:k(),_meta:a(m(r(),p()).nullish(),()=>{})}),ep=c({uri:r(),languageId:r(),visibleRange:a(Ze.nullish(),()=>{}),lastFocusedMs:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),tp=T([f("error"),f("warning"),f("information"),f("hint")]),np=c({uri:r(),range:Ze,severity:tp,message:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),sp=c({recentFiles:y(Jd).nullish(),relatedSnippets:y(Kd).nullish(),editHistory:y(Xd).nullish(),userActions:y(Yd).nullish(),openFiles:y(ep).nullish(),diagnostics:y(np).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Vs=c({sessionId:N,uri:r(),version:k(),position:Te,selection:Ze.nullish(),triggerKind:Zd,context:sp.nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ws=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Nz=c({id:xe,method:r(),params:T([Cs,As,Ps,Is,Ms,Os,qs,js,Ns,Ds,Hs,$s,Ls,Us,Gs,Fs,Bs,Vs,Ws,oi]).nullish()}),rp=c({_meta:a(m(r(),p()).nullish(),()=>{})}),op=c({content:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),ip=c({optionId:Yo,_meta:a(m(r(),p()).nullish(),()=>{})}),ap=T([c({outcome:f("cancelled")}),ip.and(c({outcome:f("selected")}))]),cp=c({outcome:ap,_meta:a(m(r(),p()).nullish(),()=>{})}),lp=c({terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),up=c({exitCode:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),signal:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),dp=c({output:r(),truncated:O(),exitStatus:a(up.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),pp=c({_meta:a(m(r(),p()).nullish(),()=>{})}),mp=c({exitCode:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),signal:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),fp=c({_meta:a(m(r(),p()).nullish(),()=>{})}),hp=T([r(),k(),k(),O(),y(r())]),Zs=c({content:m(r(),hp).nullish()}),zp=Fe(de(T([Zs.and(c({action:f("accept")})),c({action:f("decline")}),c({action:f("cancel")}),Ge(c({action:r()}),"action",["accept","cancel","decline"])]),c({_meta:a(m(r(),p()).nullish(),()=>{})})),"action",["accept","cancel","decline"]),gp=B({code:X().min(-2147483648,{error:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{error:"Invalid value: Expected int32 to be <= 2147483647"}),message:r(),data:p().optional()}),_p=T([c({result:p(),_meta:a(m(r(),p()).nullish(),()=>{})}),c({error:gp,_meta:a(m(r(),p()).nullish(),()=>{})})]),Dz=T([c({id:xe,result:T([rp,op,cp,lp,dp,pp,mp,fp,zp,_p,mi])}),c({id:xe,error:fi})]),Js=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Qs=c({sessionId:N,uri:r(),languageId:r(),version:k(),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),yp=c({range:Ze.nullish(),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ks=c({sessionId:N,uri:r(),version:k(),contentChanges:oe(j(yp),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Xs=c({sessionId:N,uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ys=c({sessionId:N,uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),er=c({sessionId:N,uri:r(),version:k(),position:Te,visibleRange:Ze,_meta:a(m(r(),p()).nullish(),()=>{})}),tr=c({sessionId:N,id:We,_meta:a(m(r(),p()).nullish(),()=>{})}),wp=T([f("rejected"),f("ignored"),f("replaced"),f("cancelled")]),nr=c({sessionId:N,id:We,reason:a(wp.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),bp=c({serverId:_s,requestId:ri,method:r(),params:m(r(),p()).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Hz=c({method:r(),params:T([Js,Qs,Ks,Xs,Ys,er,tr,nr,bp,gi]).nullish()}),$z=c({requestId:xe,_meta:a(m(r(),p()).nullish(),()=>{})});var wi="$/cancel_request";function nn(n){return ir(n)&&"id"in n&&typeof n.method=="string"&&ar(n.id)}i(nn,"isRequestMessage");function Si(n){if(!ir(n)||"method"in n||!("id"in n)||!ar(n.id))return!1;let e=Object.hasOwn(n,"result"),t=Object.hasOwn(n,"error");return e===t?!1:!t||Tp(n.error)}i(Si,"isResponseMessage");function Je(n){return ir(n)&&!("id"in n)&&typeof n.method=="string"}i(Je,"isNotificationMessage");function Ee(n){return typeof n=="object"&&n!==null}i(Ee,"isRecord");function ir(n){return Ee(n)&&n.jsonrpc==="2.0"}i(ir,"isJsonRpcEnvelope");function ar(n){return n===null||typeof n=="string"||typeof n=="number"&&Number.isFinite(n)}i(ar,"isJsonRpcId");function bi(n){return Ee(n)&&!("method"in n)&&("id"in n||"result"in n||"error"in n)}i(bi,"isResponseShapedMessage");function Sp(n){let e=!1,t=!1,s=!1,o=!1;for(let l of n)e||=nn(l)||Je(l),t||=Si(l),Ee(l)&&(s||="method"in l,o||="result"in l||"error"in l);return e?!1:t?!0:o&&!s}i(Sp,"isResponseBatch");function xp(n){if(!(!Ee(n)||!ar(n.requestId)))return n.requestId}i(xp,"cancelRequestId");function Tp(n){return Ee(n)&&typeof n.code=="number"&&Number.isInteger(n.code)&&typeof n.message=="string"}i(Tp,"isErrorResponse");var ge={yes(){return{handled:!0}},no(n,e=!1){return{handled:!1,message:n,retry:e}}};function Ie(n){let e=Promise.reject(n);return e.catch(()=>{}),e}i(Ie,"rejectedPromise");function Ep(n){if(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")return n.message}i(Ep,"errorDetails");function vp(n){return typeof n=="object"&&n!==null&&"name"in n&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)&&"format"in n&&typeof n.format=="function"}i(vp,"isZodError");function xi(n){if(n instanceof C)return n.toResult();if(vp(n))return C.invalidParams(n.format()).toResult();let e=Ep(n);try{return C.internalError(e?JSON.parse(e):{}).toResult()}catch{return C.internalError({details:e}).toResult()}}i(xi,"errorToResult");function Rp(n){return n instanceof C&&n.code===-32800?n:C.requestCancelled(n)}i(Rp,"requestCancelledError");function kp(n,e){let t=Cp(n,e);return t?t.toResult():xi(n)}i(kp,"errorToRequestResult");function Cp(n,e){if(!(!e.aborted||!Ap(n)))return Rp(e.reason)}i(Cp,"abortErrorToRequestCancelled");function Ap(n){if(typeof n!="object"||n===null)return!1;let e=n;return e.name==="AbortError"||e.code==="ABORT_ERR"}i(Ap,"isAbortError");var sr=class{static{i(this,"RequestResponder")}id;sendResult;signal;finishRequest;didRespond=!1;constructor(e,t,s=new AbortController().signal,o){this.id=e,this.sendResult=t,this.signal=s,this.finishRequest=o}get responded(){return this.didRespond}respond(e){return this.respondWithResult({result:e??null})}respondWithError(e){let t=e instanceof C?e.toErrorResponse():e;return this.respondWithResult({error:t})}respondWithResult(e){return this.didRespond?Ie(new Error("JSON-RPC request already responded")):(this.didRespond=!0,this.sendResult(e).finally(()=>{this.finishRequest?.()}))}},Pp=new WeakMap;var Ke=class{static{i(this,"HandlerRegistration")}disposeHandler;active=!0;constructor(e){this.disposeHandler=e}dispose(){this.active&&(this.active=!1,this.disposeHandler())}[Symbol.dispose](){this.dispose()}runIndefinitely(){return this}},rr=class{static{i(this,"ConnectionContext")}connection;constructor(e){this.connection=e}sendRequest(e,t,s,o){return this.connection.sendRequest(e,t,s,o)}sendNotification(e,t){return this.connection.sendNotification(e,t)}sendBatch(e){return this.connection.sendBatch(e)}sendCancelRequest(e){return this.connection.sendCancelRequest(e)}addDynamicHandler(e){return this.connection.addDynamicHandler(e)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},Xe=class{static{i(this,"Connection")}pendingResponses=new Map;incomingRequests=new Map;nextRequestId=0;staticHandlers=[];dynamicHandlers=new Set;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;retryQueue=[];context=new rr(this);receiveReader;allowBatches=!0;constructor(e,t,s,o){if(typeof e=="function"){let h=e,z=t,g=s;this.initialize(g,[...o?.handlers??[],this.legacyHandler(h,z)],o);return}let l=e,u=t,d=s;this.initialize(l,[...d?.handlers??[],...u],d)}static builder(){return new or}runUntil(e){let t=!1,s=Promise.resolve().then(()=>e(this.context)).finally(()=>{t=!0}),o=this.closed.then(()=>{if(t)return new Promise(()=>{});throw this.closedReason()});return Promise.race([s,o]).finally(()=>{t=!0,this.close()})}addDynamicHandler(e){if(this.dynamicHandlers.add(e),this.retryQueue.length>0)for(let t of this.retryQueue.splice(0))this.processIncomingMessage(t).catch(s=>this.close(s));return new Ke(()=>{this.dynamicHandlers.delete(e)})}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}getContext(){return this.context}sendRequest(e,t,s,o={}){if(this.abortController.signal.aborted)return Ie(this.closedReason());let l=this.prepareRequest(e,t,s,o);return this.sendWireMessage(l.message).catch(()=>{}),o.cancellationSignal?.aborted&&l.cancel(),l.response}sendBatch(e){if(this.abortController.signal.aborted)return Ie(this.closedReason());if(!this.allowBatches)return Ie(new TypeError("JSON-RPC batches are not supported on this connection"));if(e.length===0)return Ie(new TypeError("JSON-RPC batch must contain at least one entry"));let t=[],s=[],o=[];for(let h of e){if(h.kind==="notification"){t.push({jsonrpc:"2.0",method:h.method,params:h.params}),o.push(Promise.resolve(void 0));continue}let z=this.prepareRequest(h.method,h.params,h.mapResponse,h.options);t.push(z.message),o.push(z.response),s.push({signal:h.options?.cancellationSignal,cancel:z.cancel})}let l=t,u=this.sendWireMessage(l);for(let h of s)h.signal?.aborted&&h.cancel();let d=Promise.all([u,...o]).then(([,...h])=>h);return d.catch(()=>{}),d}sendCancelRequest(e){return this.sendNotification(wi,{requestId:e})}sendNotification(e,t){return this.abortController.signal.aborted?Ie(this.closedReason()):this.sendWireMessage({jsonrpc:"2.0",method:e,params:t})}prepareRequest(e,t,s,o={}){let l=this.nextRequestId++,u=i(()=>{},"cancel"),d=new Promise((h,z)=>{let g={resolve:i(_=>{try{h(s?s(_):_)}catch(w){z(w)}},"resolve"),reject:z};u=i(()=>{g.cancellationSent||(g.cancellationSent=!0,g.cleanup?.(),this.sendCancelRequest(l).catch(()=>{}))},"cancel"),o.cancellationSignal?.addEventListener("abort",u,{once:!0}),g.cleanup=()=>{o.cancellationSignal?.removeEventListener("abort",u)},this.pendingResponses.set(l,g)});return d.catch(()=>{}),{message:{jsonrpc:"2.0",id:l,method:e,params:t},response:d,cancel:i(()=>u(),"cancel")}}close(e){if(this.abortController.signal.aborted)return;let t=e??new Error("ACP connection closed");this.abortController.abort(t);for(let s of this.pendingResponses.values())s.cleanup?.(),s.reject(t);this.pendingResponses.clear();for(let s of this.incomingRequests.values())s.abort(t);this.incomingRequests.clear(),this.receiveReader?.cancel(t).catch(()=>{})}initialize(e,t,s){this.stream=e,this.staticHandlers=t,this.allowBatches=s?.allowBatches??!0,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}legacyHandler(e,t){return{handleMessage:i(async(s,o)=>{if(s.kind==="request"){let l=await e(s.method,s.params,o);await s.responder.respond(l)}else await t(s.method,s.params,o);return ge.yes()},"handleMessage")}}async receive(){let e;try{let t=this.stream.readable.getReader();this.receiveReader=t;try{for(;!this.abortController.signal.aborted;){let{value:s,done:o}=await t.read();if(this.abortController.signal.aborted||o)break;this.receiveWireMessage(s)}}finally{this.receiveReader===t&&(this.receiveReader=void 0),t.releaseLock()}}catch(t){e=t}finally{this.close(e)}}receiveWireMessage(e){if(Array.isArray(e)){if(!this.allowBatches){this.close(new TypeError("JSON-RPC batches are not supported on this connection"));return}this.receiveBatch(e);return}if(!nn(e)&&!Je(e)&&!bi(e)){this.sendWireMessage(Qe(C.invalidRequest(e))).catch(()=>{});return}this.receiveMessage(e)}receiveBatch(e){if(e.length===0){this.sendWireMessage(Qe(C.invalidRequest(e))).catch(()=>{});return}let t=Sp(e),o=t?0:e.reduce((g,_)=>g+(Je(_)?0:1),0),l=e.reduce((g,_)=>g+(Je(_)?1:0),0),u=!1,d=[],h=i(async()=>{u||o!==0||l!==0||d.length===0||(u=!0,await this.sendWireMessage(d))},"sendResponsesIfReady"),z=i(async g=>{d.push(g),o-=1,await h()},"collectResponse");for(let g of e){if(t){bi(g)&&this.receiveMessage(g);continue}if(!nn(g)&&!Je(g)){z(Qe(C.invalidRequest(g))).catch(()=>{});continue}let _=this.receiveMessage(g,nn(g)?z:void 0,e.length);Je(g)&&_.finally(()=>{l-=1,h().catch(w=>this.close(w))})}}receiveMessage(e,t,s){return this.abortController.signal.aborted?Promise.resolve():Ee(e)?"method"in e?("id"in e||this.handleProtocolNotification(e),this.processIncomingMessage(this.toIncomingMessage(e,t,s)).catch(o=>this.close(o))):("id"in e?this.handleResponse(e):console.error("Invalid message",{message:e}),Promise.resolve()):(console.error("Invalid message",{message:e}),Promise.resolve())}async processIncomingMessage(e){if(this.abortController.signal.aborted)return;let t=e,s=!1;try{for(let o of[...this.staticHandlers,...this.dynamicHandlers.values()]){if(this.abortController.signal.aborted)return;let l=await o.handleMessage(t,this.context)??{handled:!0};if(l.handled)return;t=l.message??t,s=s||!!l.retry}s?this.retryQueue.push(t):t.kind==="request"&&await t.responder.respondWithError(C.methodNotFound(t.method))}catch(o){if(this.abortController.signal.aborted)return;if(t.kind==="request"&&!t.responder.responded)await t.responder.respondWithResult(kp(o,t.responder.signal));else{let l=xi(o);"error"in l&&console.error("Error handling notification",e.raw,l.error)}}}toIncomingMessage(e,t,s){if("id"in e){let o=new AbortController;this.incomingRequests.set(e.id,o);let l=i(()=>{this.incomingRequests.get(e.id)===o&&this.incomingRequests.delete(e.id)},"finishRequest"),u=new sr(e.id,d=>{let h={jsonrpc:"2.0",id:e.id,...d};return t?t(h):this.sendWireMessage(h)},o.signal,l);return s!==void 0&&Pp.set(u,s),{kind:"request",method:e.method,params:e.params,raw:e,signal:o.signal,responder:u}}return{kind:"notification",method:e.method,params:e.params,raw:e}}handleResponse(e){let t=this.pendingResponses.get(e.id);if(t)if(this.pendingResponses.delete(e.id),t.cleanup?.(),!Si(e))t.reject(C.invalidRequest(e));else if("result"in e)t.resolve(e.result);else{let{code:s,message:o,data:l}=e.error;t.reject(new C(s,o,l))}else console.error("Got response to unknown request",e.id)}handleProtocolNotification(e){if(e.method!==wi)return;let t=xp(e.params);if(t===void 0)return;let s=this.incomingRequests.get(t);!s||s.signal.aborted||s.abort(C.requestCancelled({requestId:t}))}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendWireMessage(e){return this.abortController.signal.aborted?Ie(this.closedReason()):(this.writeQueue=this.writeQueue.then(async()=>{if(this.abortController.signal.aborted)throw this.closedReason();let t=this.stream.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{throw this.close(t),t}),this.writeQueue)}},or=class{static{i(this,"ConnectionBuilder")}handlers=[];connectionName;name(e){return this.connectionName=e,this}withHandler(e){return this.handlers.push(e),this}onReceiveMessage(e){return this.withHandler({handleMessage:i(async(t,s)=>await e(t,s)??ge.no(t),"handleMessage"),describe:i(()=>this.connectionName??"onReceiveMessage","describe")})}onReceiveRequest(e,t,s){return this.withHandler({handleMessage:i(async(o,l)=>{if(o.kind!=="request"||o.method!==e)return ge.no(o);let u=t(o.params);return await s(u,o.responder,l)??ge.yes()},"handleMessage"),describe:i(()=>`${this.connectionName??"request"}:${e}`,"describe")})}onReceiveNotification(e,t,s){return this.withHandler({handleMessage:i(async(o,l)=>{if(o.kind!=="notification"||o.method!==e)return ge.no(o);let u=t(o.params);return await s(u,l)??ge.yes()},"handleMessage"),describe:i(()=>`${this.connectionName??"notification"}:${e}`,"describe")})}connect(e,t){return new Xe(e,this.handlers,t)}connectWith(e,t,s){return this.connect(e,s).runUntil(t)}},C=class n extends Error{static{i(this,"RequestError")}code;data;constructor(e,t,s){super(t),this.code=e,this.name="RequestError",this.data=s}static parseError(e,t){return new n(-32700,`Parse error${t?`: ${t}`:""}`,e)}static invalidRequest(e,t){return new n(-32600,`Invalid request${t?`: ${t}`:""}`,e)}static methodNotFound(e){return new n(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,t){return new n(-32602,`Invalid params${t?`: ${t}`:""}`,e)}static internalError(e,t){return new n(-32603,`Internal error${t?`: ${t}`:""}`,e)}static requestCancelled(e,t){return new n(-32800,`Request cancelled${t?`: ${t}`:""}`,e)}static authRequired(e,t){return new n(-32e3,`Authentication required${t?`: ${t}`:""}`,e)}static resourceNotFound(e){return new n(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};function Qe(n){return{jsonrpc:"2.0",id:null,error:n.toErrorResponse()}}i(Qe,"protocolErrorResponse");var Ye=class extends Error{static{i(this,"MessageTooLargeError")}maxMessageBytes;constructor(e){super(`Incoming ACP data exceeds the configured ${e} byte limit`),this.maxMessageBytes=e,this.name="MessageTooLargeError"}};function ht(n){let e=n??33554432;if(!Number.isSafeInteger(e)||e<=0)throw new RangeError("maxMessageBytes must be a positive safe integer");return e}i(ht,"resolveMaxMessageBytes");var sn=class{static{i(this,"MessageBuffer")}#e=new Uint8Array(0);#t=0;#n;constructor(e){this.#n=ht(e)}get byteLength(){return this.#t}get lastByte(){return this.#e[this.#t-1]}#s(e){if(e>this.#n-this.#t)throw this.clear(),new Ye(this.#n)}append(e){this.#s(e.byteLength);let t=this.#t+e.byteLength;if(t>this.#e.byteLength){let s=Math.min(this.#n,Math.max(t,this.#e.byteLength*2,1024)),o=new Uint8Array(s);o.set(this.#e.subarray(0,this.#t)),this.#e=o}this.#e.set(e,this.#t),this.#t=t}take(){let e=this.#e.subarray(0,this.#t);return this.clear(),e}clear(){this.#e=new Uint8Array(0),this.#t=0}};var Ti=10,rn=class{static{i(this,"LineBuffer")}#e;#t;constructor(e){this.#t=ht(e),this.#e=new sn(Math.min(Number.MAX_SAFE_INTEGER,this.#t+1))}*push(e){let t=0,s=e.indexOf(Ti,t);for(;s!==-1;)yield this.#n(e.subarray(t,s)),t=s+1,s=e.indexOf(Ti,t);if(t<e.byteLength){let o=e.subarray(t);this.#s(o),this.#e.append(o)}}flush(){if(this.#e.byteLength!==0)return cr(this.#e.take())}clear(){this.#e.clear()}#n(e){return this.#s(e),this.#e.byteLength===0?cr(e):(this.#e.append(e),cr(this.#e.take()))}#s(e){let t=e.byteLength>0?e[e.byteLength-1]:this.#e.lastByte;if(this.#e.byteLength+e.byteLength-(t===13?1:0)>this.#t)throw this.clear(),new Ye(this.#t)}};function cr(n){return n[n.byteLength-1]===13?n.subarray(0,-1):n}i(cr,"stripCarriageReturn");function Ei(n,e,t={}){let s=ht(t.maxMessageBytes),o=new TextEncoder,l=new TextDecoder,u=!1,d,h=Promise.resolve(),z=i(w=>{let b=JSON.stringify(w)+`
|
|
2
|
+
import{m as Bo}from"./chunk-R6VJDOQM.js";import"./chunk-FYYYECHE.js";import"./chunk-2V4LPUBH.js";import"./chunk-N4VHLJBZ.js";import"./chunk-R6WMY6AH.js";import"./chunk-NZTCH6K5.js";import"./chunk-URNMC46H.js";import"./chunk-4SZ3HKHU.js";import"./chunk-RFMME46Z.js";import"./chunk-DQI5TE6A.js";import"./chunk-7R56WC7L.js";import"./chunk-VFH5C6D2.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-DTTFUANI.js";import"./chunk-EZRUWIP6.js";import"./chunk-SYUKES6H.js";import"./chunk-4NXEYPPX.js";import"./chunk-AH26AQN7.js";import"./chunk-5MHYGMJG.js";import"./chunk-XNOMIWEY.js";import"./chunk-LK2K3SPM.js";import"./chunk-MEGKXGW3.js";import"./chunk-ZG6353RM.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-ELX7VRSU.js";import"./chunk-CZ5R4JXZ.js";import"./chunk-FAKDGLZQ.js";import"./chunk-GW766ZSO.js";import"./chunk-G32BO6M5.js";import"./chunk-NLYZ5K7U.js";import"./chunk-7KWD2I6W.js";import{a as Go,j as Qn}from"./chunk-WWQNMC7C.js";import"./chunk-B4RKHHF7.js";import"./chunk-DLANLLKH.js";import"./chunk-YU3C6U5V.js";import"./chunk-ZYVHOVKL.js";import"./chunk-KVTBX2UP.js";import"./chunk-LKKMLBOH.js";import"./chunk-ERL2M773.js";import{h as Fo}from"./chunk-GXCUH2VV.js";import"./chunk-4ZBOYWQ3.js";import"./chunk-DMFUEUAZ.js";import"./chunk-JHR3LF2F.js";import{H as Jt,J as Uo,O as Qt,a as $o,c as Jn,g as Lo,w as dt,x as Ae}from"./chunk-M3FLEZ4E.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-GS6ZUSIN.js";import"./chunk-2ITZW2CN.js";import"./chunk-OG33QAG6.js";import"./chunk-W5W4IODW.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-MWXW2CA6.js";import"./chunk-L3KS6MOV.js";import"./chunk-M3SCON53.js";import"./chunk-IZ56L2ZK.js";import"./chunk-KCJVFLBB.js";import"./chunk-3YXYBYWK.js";import"./chunk-MPNJ2BB4.js";import"./chunk-KOKX7PBS.js";import"./chunk-V7KR74NO.js";import"./chunk-XGY4OQLC.js";import"./chunk-7O6Z3VOZ.js";import"./chunk-5EP2DZLJ.js";import"./chunk-IDOGNIMV.js";import"./chunk-W45RKGM6.js";import"./chunk-PBTXLQAU.js";import"./chunk-7WYL2IDD.js";import"./chunk-4N4EH3RJ.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-JFXINDOQ.js";import"./chunk-PCB65K4G.js";import"./chunk-6RS4NAOY.js";import"./chunk-ZZHXQCNB.js";import"./chunk-YNQWJWIC.js";import"./chunk-VNJAAYNQ.js";import"./chunk-7ZLXFKRI.js";import"./chunk-7HRLWPPZ.js";import"./chunk-MTP3B2SU.js";import"./chunk-OSVGNONV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-JCLTFDVW.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import{a as Po,c as Io}from"./chunk-UGOK7VTC.js";import"./chunk-J572ANHX.js";import{h as Zn,i as sl,j as rl,k as ol,l as il,m as al,n as cl,o as ll,p as ul,q as dl,r as pl}from"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import{A as Q,a as Mo,b as Bn,c as Oo,e as r,f as Zt,g as k,h as X,i as O,j as qo,k as jo,l as p,m as y,n as c,o as B,p as T,q as Vn,r as de,s as m,t as re,u as f,v as F,w as No,x as Wn,y as Do,z as Ho}from"./chunk-PF56N7ZY.js";import{a as i,b as Se,c as Z,e as Wt}from"./chunk-FTQLQJQV.js";var ua=Z(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});var Ef=al(),vf=cl(),Rf=ll(),kf=ul(),la=dl(),Cf=[Ef.default,vf.default,(0,Rf.default)(),kf.default,la.metadataVocabulary,la.contentVocabulary];Fr.default=Cf});var da=Z((OS,Af)=>{Af.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0}});var Vr=Z((G,Br)=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.MissingRefError=G.ValidationError=G.CodeGen=G.Name=G.nil=G.stringify=G.str=G._=G.KeywordCxt=G.Ajv=void 0;var Pf=il(),If=ua(),Mf=pl(),pa=da(),Of=["/properties"],Pn="http://json-schema.org/draft-07/schema",ot=class extends Pf.default{static{i(this,"Ajv")}_addVocabularies(){super._addVocabularies(),If.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Mf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(pa,Of):pa;this.addMetaSchema(e,Pn,!1),this.refs["http://json-schema.org/schema"]=Pn}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pn)?Pn:void 0)}};G.Ajv=ot;Br.exports=G=ot;Br.exports.Ajv=ot;Object.defineProperty(G,"__esModule",{value:!0});G.default=ot;var qf=sl();Object.defineProperty(G,"KeywordCxt",{enumerable:!0,get:i(function(){return qf.KeywordCxt},"get")});var it=Zn();Object.defineProperty(G,"_",{enumerable:!0,get:i(function(){return it._},"get")});Object.defineProperty(G,"str",{enumerable:!0,get:i(function(){return it.str},"get")});Object.defineProperty(G,"stringify",{enumerable:!0,get:i(function(){return it.stringify},"get")});Object.defineProperty(G,"nil",{enumerable:!0,get:i(function(){return it.nil},"get")});Object.defineProperty(G,"Name",{enumerable:!0,get:i(function(){return it.Name},"get")});Object.defineProperty(G,"CodeGen",{enumerable:!0,get:i(function(){return it.CodeGen},"get")});var jf=rl();Object.defineProperty(G,"ValidationError",{enumerable:!0,get:i(function(){return jf.default},"get")});var Nf=ol();Object.defineProperty(G,"MissingRefError",{enumerable:!0,get:i(function(){return Nf.default},"get")})});var wa=Z(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.formatNames=ze.fastFormats=ze.fullFormats=void 0;function he(n,e){return{validate:n,compare:e}}i(he,"fmtDef");ze.fullFormats={date:he(za,Qr),time:he(Zr(!0),Kr),"date-time":he(ma(!0),_a),"iso-time":he(Zr(),ga),"iso-date-time":he(ma(),ya),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Gf,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Qf,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Ff,int32:{type:"number",validate:Wf},int64:{type:"number",validate:Zf},float:{type:"number",validate:ha},double:{type:"number",validate:ha},password:!0,binary:!0};ze.fastFormats={...ze.fullFormats,date:he(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Qr),time:he(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Kr),"date-time":he(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_a),"iso-time":he(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ga),"iso-date-time":he(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ya),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ze.formatNames=Object.keys(ze.fullFormats);function Df(n){return n%4===0&&(n%100!==0||n%400===0)}i(Df,"isLeapYear");var Hf=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,$f=[0,31,28,31,30,31,30,31,31,30,31,30,31];function za(n){let e=Hf.exec(n);if(!e)return!1;let t=+e[1],s=+e[2],o=+e[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&Df(t)?29:$f[s])}i(za,"date");function Qr(n,e){if(n&&e)return n>e?1:n<e?-1:0}i(Qr,"compareDate");var Wr=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Zr(n){return i(function(t){let s=Wr.exec(t);if(!s)return!1;let o=+s[1],l=+s[2],u=+s[3],d=s[4],h=s[5]==="-"?-1:1,z=+(s[6]||0),g=+(s[7]||0);if(z>23||g>59||n&&!d)return!1;if(o<=23&&l<=59&&u<60)return!0;let _=l-g*h,w=o-z*h-(_<0?1:0);return(w===23||w===-1)&&(_===59||_===-1)&&u<61},"time")}i(Zr,"getTime");function Kr(n,e){if(!(n&&e))return;let t=new Date("2020-01-01T"+n).valueOf(),s=new Date("2020-01-01T"+e).valueOf();if(t&&s)return t-s}i(Kr,"compareTime");function ga(n,e){if(!(n&&e))return;let t=Wr.exec(n),s=Wr.exec(e);if(t&&s)return n=t[1]+t[2]+t[3],e=s[1]+s[2]+s[3],n>e?1:n<e?-1:0}i(ga,"compareIsoTime");var Jr=/t|\s/i;function ma(n){let e=Zr(n);return i(function(s){let o=s.split(Jr);return o.length===2&&za(o[0])&&e(o[1])},"date_time")}i(ma,"getDateTime");function _a(n,e){if(!(n&&e))return;let t=new Date(n).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}i(_a,"compareDateTime");function ya(n,e){if(!(n&&e))return;let[t,s]=n.split(Jr),[o,l]=e.split(Jr),u=Qr(t,o);if(u!==void 0)return u||Kr(s,l)}i(ya,"compareIsoDateTime");var Lf=/\/|:/,Uf=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Gf(n){return Lf.test(n)&&Uf.test(n)}i(Gf,"uri");var fa=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Ff(n){return fa.lastIndex=0,fa.test(n)}i(Ff,"byte");var Bf=-(2**31),Vf=2**31-1;function Wf(n){return Number.isInteger(n)&&n<=Vf&&n>=Bf}i(Wf,"validateInt32");function Zf(n){return Number.isInteger(n)}i(Zf,"validateInt64");function ha(){return!0}i(ha,"validateNumber");var Jf=/[^\\]\\Z/;function Qf(n){if(Jf.test(n))return!1;try{return new RegExp(n),!0}catch{return!1}}i(Qf,"regex")});var ba=Z(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.formatLimitDefinition=void 0;var Kf=Vr(),me=Zn(),ke=me.operators,In={formatMaximum:{okStr:"<=",ok:ke.LTE,fail:ke.GT},formatMinimum:{okStr:">=",ok:ke.GTE,fail:ke.LT},formatExclusiveMaximum:{okStr:"<",ok:ke.LT,fail:ke.GTE},formatExclusiveMinimum:{okStr:">",ok:ke.GT,fail:ke.LTE}},Xf={message:i(({keyword:n,schemaCode:e})=>(0,me.str)`should be ${In[n].okStr} ${e}`,"message"),params:i(({keyword:n,schemaCode:e})=>(0,me._)`{comparison: ${In[n].okStr}, limit: ${e}}`,"params")};at.formatLimitDefinition={keyword:Object.keys(In),type:"string",schemaType:"string",$data:!0,error:Xf,code(n){let{gen:e,data:t,schemaCode:s,keyword:o,it:l}=n,{opts:u,self:d}=l;if(!u.validateFormats)return;let h=new Kf.KeywordCxt(l,d.RULES.all.format.definition,"format");h.$data?z():g();function z(){let w=e.scopeValue("formats",{ref:d.formats,code:u.code.formats}),b=e.const("fmt",(0,me._)`${w}[${h.schemaCode}]`);n.fail$data((0,me.or)((0,me._)`typeof ${b} != "object"`,(0,me._)`${b} instanceof RegExp`,(0,me._)`typeof ${b}.compare != "function"`,_(b)))}i(z,"validate$DataFormat");function g(){let w=h.schema,b=d.formats[w];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${o}": format "${w}" does not define "compare" function`);let E=e.scopeValue("formats",{key:w,ref:b,code:u.code.formats?(0,me._)`${u.code.formats}${(0,me.getProperty)(w)}`:void 0});n.fail$data(_(E))}i(g,"validateFormat");function _(w){return(0,me._)`${w}.compare(${t}, ${s}) ${In[o].fail} 0`}i(_,"compareCode")},dependencies:["format"]};var Yf=i(n=>(n.addKeyword(at.formatLimitDefinition),n),"formatLimitPlugin");at.default=Yf});var Ea=Z((Ct,Ta)=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});var ct=wa(),eh=ba(),Xr=Zn(),Sa=new Xr.Name("fullFormats"),th=new Xr.Name("fastFormats"),Yr=i((n,e={keywords:!0})=>{if(Array.isArray(e))return xa(n,e,ct.fullFormats,Sa),n;let[t,s]=e.mode==="fast"?[ct.fastFormats,th]:[ct.fullFormats,Sa],o=e.formats||ct.formatNames;return xa(n,o,t,s),e.keywords&&(0,eh.default)(n),n},"formatsPlugin");Yr.get=(n,e="full")=>{let s=(e==="fast"?ct.fastFormats:ct.fullFormats)[n];if(!s)throw new Error(`Unknown format "${n}"`);return s};function xa(n,e,t,s){var o,l;(o=(l=n.opts.code).formats)!==null&&o!==void 0||(l.formats=(0,Xr._)`require("ajv-formats/dist/formats").${s}`);for(let u of e)n.addFormat(u,t[u])}i(xa,"addFormats");Ta.exports=Ct=Yr;Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=Yr});var Oa=Z((nx,Ma)=>{Ma.exports=Ia;Ia.sync=oh;var Aa=Se("fs");function rh(n,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var s=0;s<t.length;s++){var o=t[s].toLowerCase();if(o&&n.substr(-o.length).toLowerCase()===o)return!0}return!1}i(rh,"checkPathExt");function Pa(n,e,t){return!n.isSymbolicLink()&&!n.isFile()?!1:rh(e,t)}i(Pa,"checkStat");function Ia(n,e,t){Aa.stat(n,function(s,o){t(s,s?!1:Pa(o,n,e))})}i(Ia,"isexe");function oh(n,e){return Pa(Aa.statSync(n),n,e)}i(oh,"sync")});var Ha=Z((rx,Da)=>{Da.exports=ja;ja.sync=ih;var qa=Se("fs");function ja(n,e,t){qa.stat(n,function(s,o){t(s,s?!1:Na(o,e))})}i(ja,"isexe");function ih(n,e){return Na(qa.statSync(n),e)}i(ih,"sync");function Na(n,e){return n.isFile()&&ah(n,e)}i(Na,"checkStat");function ah(n,e){var t=n.mode,s=n.uid,o=n.gid,l=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),u=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),d=parseInt("100",8),h=parseInt("010",8),z=parseInt("001",8),g=d|h,_=t&z||t&h&&o===u||t&d&&s===l||t&g&&l===0;return _}i(ah,"checkMode")});var La=Z((ax,$a)=>{var ix=Se("fs"),Nn;process.platform==="win32"||global.TESTING_WINDOWS?Nn=Oa():Nn=Ha();$a.exports=eo;eo.sync=ch;function eo(n,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,o){eo(n,e||{},function(l,u){l?o(l):s(u)})})}Nn(n,e||{},function(s,o){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,o=!1),t(s,o)})}i(eo,"isexe");function ch(n,e){try{return Nn.sync(n,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}i(ch,"sync")});var Za=Z((lx,Wa)=>{var lt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ua=Se("path"),lh=lt?";":":",Ga=La(),Fa=i(n=>Object.assign(new Error(`not found: ${n}`),{code:"ENOENT"}),"getNotFoundError"),Ba=i((n,e)=>{let t=e.colon||lh,s=n.match(/\//)||lt&&n.match(/\\/)?[""]:[...lt?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=lt?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=lt?o.split(t):[""];return lt&&n.indexOf(".")!==-1&&l[0]!==""&&l.unshift(""),{pathEnv:s,pathExt:l,pathExtExe:o}},"getPathInfo"),Va=i((n,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:s,pathExt:o,pathExtExe:l}=Ba(n,e),u=[],d=i(z=>new Promise((g,_)=>{if(z===s.length)return e.all&&u.length?g(u):_(Fa(n));let w=s[z],b=/^".*"$/.test(w)?w.slice(1,-1):w,E=Ua.join(b,n),x=!b&&/^\.[\\\/]/.test(n)?n.slice(0,2)+E:E;g(h(x,z,0))}),"step"),h=i((z,g,_)=>new Promise((w,b)=>{if(_===o.length)return w(d(g+1));let E=o[_];Ga(z+E,{pathExt:l},(x,A)=>{if(!x&&A)if(e.all)u.push(z+E);else return w(z+E);return w(h(z,g,_+1))})}),"subStep");return t?d(0).then(z=>t(null,z),t):d(0)},"which"),uh=i((n,e)=>{e=e||{};let{pathEnv:t,pathExt:s,pathExtExe:o}=Ba(n,e),l=[];for(let u=0;u<t.length;u++){let d=t[u],h=/^".*"$/.test(d)?d.slice(1,-1):d,z=Ua.join(h,n),g=!h&&/^\.[\\\/]/.test(n)?n.slice(0,2)+z:z;for(let _=0;_<s.length;_++){let w=g+s[_];try{if(Ga.sync(w,{pathExt:o}))if(e.all)l.push(w);else return w}catch{}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw Fa(n)},"whichSync");Wa.exports=Va;Va.sync=uh});var Qa=Z((dx,to)=>{"use strict";var Ja=i((n={})=>{let e=n.env||process.env;return(n.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"},"pathKey");to.exports=Ja;to.exports.default=Ja});var ec=Z((mx,Ya)=>{"use strict";var Ka=Se("path"),dh=Za(),ph=Qa();function Xa(n,e){let t=n.options.env||process.env,s=process.cwd(),o=n.options.cwd!=null,l=o&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(n.options.cwd)}catch{}let u;try{u=dh.sync(n.command,{path:t[ph({env:t})],pathExt:e?Ka.delimiter:void 0})}catch{}finally{l&&process.chdir(s)}return u&&(u=Ka.resolve(o?n.options.cwd:"",u)),u}i(Xa,"resolveCommandAttempt");function mh(n){return Xa(n)||Xa(n,!0)}i(mh,"resolveCommand");Ya.exports=mh});var tc=Z((hx,so)=>{"use strict";var no=/([()\][%!^"`<>&|;, *?])/g;function fh(n){return n=n.replace(no,"^$1"),n}i(fh,"escapeCommand");function hh(n,e){return n=`${n}`,n=n.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),n=n.replace(/(?=(\\+?)?)\1$/,"$1$1"),n=`"${n}"`,n=n.replace(no,"^$1"),e&&(n=n.replace(no,"^$1")),n}i(hh,"escapeArgument");so.exports.command=fh;so.exports.argument=hh});var sc=Z((gx,nc)=>{"use strict";nc.exports=/^#!(.*)/});var oc=Z((_x,rc)=>{"use strict";var zh=sc();rc.exports=(n="")=>{let e=n.match(zh);if(!e)return null;let[t,s]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?s:s?`${o} ${s}`:o}});var ac=Z((yx,ic)=>{"use strict";var ro=Se("fs"),gh=oc();function _h(n){let t=Buffer.alloc(150),s;try{s=ro.openSync(n,"r"),ro.readSync(s,t,0,150,0),ro.closeSync(s)}catch{}return gh(t.toString())}i(_h,"readShebang");ic.exports=_h});var dc=Z((bx,uc)=>{"use strict";var yh=Se("path"),cc=ec(),lc=tc(),wh=ac(),bh=process.platform==="win32",Sh=/\.(?:com|exe)$/i,xh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Th(n){n.file=cc(n);let e=n.file&&wh(n.file);return e?(n.args.unshift(n.file),n.command=e,cc(n)):n.file}i(Th,"detectShebang");function Eh(n){if(!bh)return n;let e=Th(n),t=!Sh.test(e);if(n.options.forceShell||t){let s=xh.test(e);n.command=yh.normalize(n.command),n.command=lc.command(n.command),n.args=n.args.map(l=>lc.argument(l,s));let o=[n.command].concat(n.args).join(" ");n.args=["/d","/s","/c",`"${o}"`],n.command=process.env.comspec||"cmd.exe",n.options.windowsVerbatimArguments=!0}return n}i(Eh,"parseNonShell");function vh(n,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let s={command:n,args:e,options:t,file:void 0,original:{command:n,args:e}};return t.shell?s:Eh(s)}i(vh,"parse");uc.exports=vh});var fc=Z((xx,mc)=>{"use strict";var oo=process.platform==="win32";function io(n,e){return Object.assign(new Error(`${e} ${n.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${n.command}`,path:n.command,spawnargs:n.args})}i(io,"notFoundError");function Rh(n,e){if(!oo)return;let t=n.emit;n.emit=function(s,o){if(s==="exit"){let l=pc(o,e);if(l)return t.call(n,"error",l)}return t.apply(n,arguments)}}i(Rh,"hookChildProcess");function pc(n,e){return oo&&n===1&&!e.file?io(e.original,"spawn"):null}i(pc,"verifyENOENT");function kh(n,e){return oo&&n===1&&!e.file?io(e.original,"spawnSync"):null}i(kh,"verifyENOENTSync");mc.exports={hookChildProcess:Rh,verifyENOENT:pc,verifyENOENTSync:kh,notFoundError:io}});var gc=Z((Ex,ut)=>{"use strict";var hc=Se("child_process"),ao=dc(),co=fc();function zc(n,e,t){let s=ao(n,e,t),o=hc.spawn(s.command,s.args,s.options);return co.hookChildProcess(o,s),o}i(zc,"spawn");function Ch(n,e,t){let s=ao(n,e,t),o=hc.spawnSync(s.command,s.args,s.options);return o.error=o.error||co.verifyENOENTSync(o.status,s),o}i(Ch,"spawnSync");ut.exports=zc;ut.exports.spawn=zc;ut.exports.sync=Ch;ut.exports._parse=ao;ut.exports._enoent=co});var xc=Z(po=>{"use strict";var wc=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Oh=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,bc=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,qh=/\\([\u000b\u0020-\u00ff])/g,jh=/([\\"])/g,Sc=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;po.format=Nh;po.parse=Dh;function Nh(n){if(!n||typeof n!="object")throw new TypeError("argument obj is required");var e=n.parameters,t=n.type;if(!t||!Sc.test(t))throw new TypeError("invalid type");var s=t;if(e&&typeof e=="object")for(var o,l=Object.keys(e).sort(),u=0;u<l.length;u++){if(o=l[u],!bc.test(o))throw new TypeError("invalid parameter name");s+="; "+o+"="+$h(e[o])}return s}i(Nh,"format");function Dh(n){if(!n)throw new TypeError("argument string is required");var e=typeof n=="object"?Hh(n):n;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),s=t!==-1?e.slice(0,t).trim():e.trim();if(!Sc.test(s))throw new TypeError("invalid media type");var o=new Lh(s.toLowerCase());if(t!==-1){var l,u,d;for(wc.lastIndex=t;u=wc.exec(e);){if(u.index!==t)throw new TypeError("invalid parameter format");t+=u[0].length,l=u[1].toLowerCase(),d=u[2],d.charCodeAt(0)===34&&(d=d.slice(1,-1),d.indexOf("\\")!==-1&&(d=d.replace(qh,"$1"))),o.parameters[l]=d}if(t!==e.length)throw new TypeError("invalid parameter format")}return o}i(Dh,"parse");function Hh(n){var e;if(typeof n.getHeader=="function"?e=n.getHeader("content-type"):typeof n.headers=="object"&&(e=n.headers&&n.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}i(Hh,"getcontenttype");function $h(n){var e=String(n);if(bc.test(e))return e;if(e.length>0&&!Oh.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(jh,"\\$1")+'"'}i($h,"qstring");function Lh(n){this.parameters=Object.create(null),this.type=n}i(Lh,"ContentType")});import{Readable as vz,Writable as Rz}from"node:stream";var S={initialize:"initialize",authenticate:"authenticate",providers_list:"providers/list",providers_set:"providers/set",providers_disable:"providers/disable",session_new:"session/new",session_load:"session/load",session_set_mode:"session/set_mode",session_set_config_option:"session/set_config_option",session_prompt:"session/prompt",session_cancel:"session/cancel",mcp_message:"mcp/message",session_list:"session/list",session_delete:"session/delete",session_fork:"session/fork",session_resume:"session/resume",session_close:"session/close",logout:"logout",nes_start:"nes/start",nes_suggest:"nes/suggest",nes_accept:"nes/accept",nes_reject:"nes/reject",nes_close:"nes/close",document_did_open:"document/didOpen",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_save:"document/didSave",document_did_focus:"document/didFocus"},D={session_request_permission:"session/request_permission",session_update:"session/update",fs_write_text_file:"fs/write_text_file",fs_read_text_file:"fs/read_text_file",terminal_create:"terminal/create",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit",terminal_kill:"terminal/kill",mcp_message:"mcp/message",elicitation_create:"elicitation/create",elicitation_complete:"elicitation/complete"},Kn={cancel_request:"$/cancel_request"};var Vo=Symbol("skippedItem");function a(n,e){return n.catch(e)}i(a,"defaultOnError");function oe(n,e){let t=n.catch(e);return Q.unknown().transform((s,o)=>s!==void 0?t.parse(s):(o.addIssue({code:"custom",message:"Required value is missing"}),Q.NEVER))}i(oe,"requiredDefaultOnError");function Wo(n,e){if(n===null||typeof n!="object"||Array.isArray(n))return;let t=n[e];return typeof t=="string"?t:void 0}i(Wo,"stringTag");function Ge(n,e,t){return n.superRefine((s,o)=>{let l=Wo(s,e);l!==void 0&&t.includes(l)&&o.addIssue({code:"custom",path:[e],message:`${e} ${JSON.stringify(l)} is reserved by a known variant, but the value does not match that variant's schema`})})}i(Ge,"excludeKnownTags");function Fe(n,e,t){return Q.unknown().transform((s,o)=>{let l=n.safeParse(s);if(!l.success){for(let h of l.error.issues)o.addIssue({...h,input:s});return Q.NEVER}let u=l.data,d=Wo(s,e);if(d!==void 0&&!t.includes(d)){let h=s;for(let[z,g]of Object.entries(h))z!=="__proto__"&&(Object.hasOwn(u,z)||(u[z]=g))}return u})}i(Fe,"preserveCustomPayload");function j(n){return Q.array(n.catch(Vo)).transform(e=>e.filter(t=>t!==Vo))}i(j,"vecSkipError");var xe=T([k(),r()]).nullable(),N=r(),es=c({sessionId:N,path:r(),content:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),ts=c({sessionId:N,path:r(),line:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),limit:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ns=r(),Zo=T([f("read"),f("edit"),f("delete"),f("move"),f("search"),f("execute"),f("think"),f("fetch"),f("switch_mode"),f("other")]),Jo=T([f("pending"),f("in_progress"),f("completed"),f("failed")]),fl=T([f("assistant"),f("user")]),pt=c({audience:a(j(fl).nullish(),()=>{}),lastModified:a(r().nullish(),()=>{}),priority:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),hl=c({annotations:a(pt.nullish(),()=>{}),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),zl=c({annotations:a(pt.nullish(),()=>{}),data:r(),mimeType:r(),uri:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),gl=c({annotations:a(pt.nullish(),()=>{}),data:r(),mimeType:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),_l=c({annotations:a(pt.nullish(),()=>{}),description:a(r().nullish(),()=>{}),mimeType:a(r().nullish(),()=>{}),name:r(),size:a(k().nullish(),()=>{}),title:a(r().nullish(),()=>{}),uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),yl=c({mimeType:a(r().nullish(),()=>{}),text:r(),uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),wl=c({blob:r(),mimeType:a(r().nullish(),()=>{}),uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),bl=T([yl,wl]),Sl=c({annotations:a(pt.nullish(),()=>{}),resource:bl,_meta:a(m(r(),p()).nullish(),()=>{})}),Pe=T([hl.and(c({type:f("text")})),zl.and(c({type:f("image")})),gl.and(c({type:f("audio")})),_l.and(c({type:f("resource_link")})),Sl.and(c({type:f("resource")}))]),xl=c({content:Pe,_meta:a(m(r(),p()).nullish(),()=>{})}),Tl=c({path:r(),oldText:a(r().nullish(),()=>{}),newText:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Be=r(),El=c({terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),Qo=T([xl.and(c({type:f("content")})),Tl.and(c({type:f("diff")})),El.and(c({type:f("terminal")}))]),Ko=c({path:r(),line:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Xo=c({toolCallId:ns,kind:a(Zo.nullish(),()=>{}),status:a(Jo.nullish(),()=>{}),title:a(r().nullish(),()=>{}),name:a(r().nullish(),()=>{}),content:a(j(Qo).nullish(),()=>{}),locations:a(j(Ko).nullish(),()=>{}),rawInput:a(p().optional(),()=>{}),rawOutput:a(p().optional(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Yo=r(),vl=T([f("allow_once"),f("allow_always"),f("reject_once"),f("reject_always")]),Rl=c({optionId:Yo,name:r(),kind:vl,_meta:a(m(r(),p()).nullish(),()=>{})}),ss=c({sessionId:N,toolCall:Xo,options:y(Rl),_meta:a(m(r(),p()).nullish(),()=>{})}),ei=c({name:r(),value:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),rs=c({sessionId:N,command:r(),args:a(j(r()).optional(),()=>[]),env:a(j(ei).optional(),()=>[]),cwd:a(r().nullish(),()=>{}),outputByteLimit:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),os=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),is=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),as=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),cs=c({sessionId:N,terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),mt=c({sessionId:N,toolCallId:a(ns.nullish(),()=>{})}),ft=c({requestId:xe}),kl=f("object"),Cl=T([f("email"),f("uri"),f("date"),f("date-time")]),ti=c({const:r(),title:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ls=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minLength:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),maxLength:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),pattern:r().nullish(),format:Cl.nullish(),default:a(r().nullish(),()=>{}),enum:y(r()).nullish(),oneOf:y(ti).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),us=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minimum:k().nullish(),maximum:k().nullish(),default:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ds=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minimum:k().nullish(),maximum:k().nullish(),default:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ps=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),default:a(O().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ms=c({enum:y(r()),_meta:a(m(r(),p()).nullish(),()=>{})}),ni=c({anyOf:y(ti),_meta:a(m(r(),p()).nullish(),()=>{})}),Al=Fe(T([ms.and(c({type:f("string")})),Ge(c({type:r()}),"type",["string"]),ni]),"type",["string"]),fs=c({title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),minItems:k().nullish(),maxItems:k().nullish(),items:Al,default:a(j(r()).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Pl=Fe(T([ls.and(c({type:f("string")})),us.and(c({type:f("number")})),ds.and(c({type:f("integer")})),ps.and(c({type:f("boolean")})),fs.and(c({type:f("array")})),Ge(c({type:r()}),"type",["array","boolean","integer","number","string"])]),"type",["array","boolean","integer","number","string"]),Il=c({type:a(kl.optional().default("object"),()=>"object"),title:a(r().nullish(),()=>{}),properties:m(r(),Pl).optional().default({}),required:y(r()).nullish(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),hs=de(T([mt,ft]),c({requestedSchema:Il})),si=r(),zs=de(T([mt,ft]),c({elicitationId:si,url:Zt()})),gs=Fe(de(T([hs.and(c({mode:f("form")})),zs.and(c({mode:f("url")})),Ge(de(T([mt,ft]),c({mode:r()})),"mode",["form","url"])]),c({message:r(),_meta:a(m(r(),p()).nullish(),()=>{})})),"mode",["form","url"]),_s=r(),ri=r(),Ml=c({serverId:_s,requestId:ri,method:r(),params:m(r(),p()).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),oi=p(),Oz=c({id:xe,method:r(),params:T([es,ts,ss,rs,os,is,as,cs,gs,Ml,oi]).nullish()}),ii=X().gte(0).lte(65535),Ol=c({image:a(O().optional().default(!1),()=>!1),audio:a(O().optional().default(!1),()=>!1),embeddedContext:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),ql=c({http:a(O().optional().default(!1),()=>!1),sse:a(O().optional().default(!1),()=>!1),acp:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),jl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Nl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Dl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Hl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),$l=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Ll=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Ul=c({list:a(jl.nullish(),()=>{}),delete:a(Nl.nullish(),()=>{}),additionalDirectories:a(Dl.nullish(),()=>{}),fork:a(Hl.nullish(),()=>{}),resume:a($l.nullish(),()=>{}),close:a(Ll.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Gl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Fl=c({logout:a(Gl.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Bl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Vl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Wl=T([f("full"),f("incremental")]),Zl=c({syncKind:Wl,_meta:a(m(r(),p()).nullish(),()=>{})}),Jl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Ql=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Kl=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Xl=c({didOpen:a(Vl.nullish(),()=>{}),didChange:a(Zl.nullish(),()=>{}),didClose:a(Jl.nullish(),()=>{}),didSave:a(Ql.nullish(),()=>{}),didFocus:a(Kl.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Yl=c({document:a(Xl.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),eu=c({maxCount:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),tu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),nu=c({maxCount:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),su=c({maxCount:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ru=c({_meta:a(m(r(),p()).nullish(),()=>{})}),ou=c({_meta:a(m(r(),p()).nullish(),()=>{})}),iu=c({recentFiles:a(eu.nullish(),()=>{}),relatedSnippets:a(tu.nullish(),()=>{}),editHistory:a(nu.nullish(),()=>{}),userActions:a(su.nullish(),()=>{}),openFiles:a(ru.nullish(),()=>{}),diagnostics:a(ou.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),au=c({events:a(Yl.nullish(),()=>{}),context:a(iu.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ai=T([f("utf-16"),f("utf-32"),f("utf-8")]),cu=c({loadSession:a(O().optional().default(!1),()=>!1),promptCapabilities:a(Ol.optional().default({image:!1,audio:!1,embeddedContext:!1}),()=>({image:!1,audio:!1,embeddedContext:!1})),mcpCapabilities:a(ql.optional().default({http:!1,sse:!1,acp:!1}),()=>({http:!1,sse:!1,acp:!1})),sessionCapabilities:a(Ul.optional().default({}),()=>({})),auth:a(Fl.optional().default({}),()=>({})),providers:a(Bl.nullish(),()=>{}),nes:a(au.nullish(),()=>{}),positionEncoding:a(ai.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ys=r(),lu=c({id:ys,name:r(),description:a(r().nullish(),()=>{}),args:a(j(r()).optional(),()=>[]),env:a(m(r(),r()).optional(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),uu=c({id:ys,name:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),du=T([lu.and(c({type:f("terminal")})),uu]),ci=c({name:r(),title:a(r().nullish(),()=>{}),version:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),pu=c({protocolVersion:ii,agentCapabilities:a(cu.optional().default({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}}),()=>({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}})),authMethods:a(j(du).optional().default([]),()=>[]),agentInfo:a(ci.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),mu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),ws=r(),bs=T([f("anthropic"),f("openai"),f("azure"),f("vertex"),f("bedrock"),r()]),fu=c({apiType:bs,baseUrl:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),hu=c({providerId:ws,supported:oe(j(bs),()=>[]),required:O(),current:fu.nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),zu=c({providers:y(hu),_meta:a(m(r(),p()).nullish(),()=>{})}),gu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),_u=c({_meta:a(m(r(),p()).nullish(),()=>{})}),yu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Kt=r(),wu=c({id:Kt,name:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Xt=c({currentModeId:Kt,availableModes:oe(j(wu),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),li=r(),bu=T([f("mode"),f("model"),f("model_config"),f("thought_level"),r()]),Ss=r(),ui=c({value:Ss,name:r(),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Su=r(),xu=c({group:Su,name:r(),options:oe(j(ui),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Tu=T([y(ui),y(xu)]),Eu=c({currentValue:Ss,options:Tu}),vu=c({currentValue:O()}),Ve=de(T([Eu.and(c({type:f("select")})),vu.and(c({type:f("boolean")}))]),c({id:li,name:r(),description:a(r().nullish(),()=>{}),category:a(bu.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})})),Ru=c({sessionId:N,modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ku=c({modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Cu=c({sessionId:N,cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),title:a(r().nullish(),()=>{}),updatedAt:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Au=c({sessions:oe(j(Cu),()=>[]),nextCursor:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Pu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Iu=c({sessionId:N,modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Mu=c({modes:a(Xt.nullish(),()=>{}),configOptions:a(j(Ve).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ou=c({_meta:a(m(r(),p()).nullish(),()=>{})}),qu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),ju=c({configOptions:oe(j(Ve),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),di=T([f("end_turn"),f("max_tokens"),f("max_turn_requests"),f("refusal"),f("cancelled")]),pi=c({totalTokens:k(),inputTokens:k(),outputTokens:k(),thoughtTokens:a(k().nullish(),()=>{}),cachedReadTokens:a(k().nullish(),()=>{}),cachedWriteTokens:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Nu=c({stopReason:di,usage:a(pi.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Du=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),We=r(),Te=c({line:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),character:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ze=c({start:Te,end:Te,_meta:a(m(r(),p()).nullish(),()=>{})}),Hu=c({range:Ze,newText:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),$u=c({id:We,uri:r(),edits:y(Hu),cursorPosition:a(Te.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Lu=c({id:We,uri:r(),position:Te,_meta:a(m(r(),p()).nullish(),()=>{})}),Uu=c({id:We,uri:r(),position:Te,newName:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Gu=c({id:We,uri:r(),search:r(),replace:r(),isRegex:O().nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Fu=T([$u.and(c({kind:f("edit")})),Lu.and(c({kind:f("jump")})),Uu.and(c({kind:f("rename")})),Gu.and(c({kind:f("searchAndReplace")}))]),Bu=c({suggestions:y(Fu),_meta:a(m(r(),p()).nullish(),()=>{})}),Vu=c({_meta:a(m(r(),p()).nullish(),()=>{})}),mi=p(),Wu=T([f(-32700),f(-32600),f(-32601),f(-32602),f(-32603),f(-32800),f(-32e3),f(-32002),X().min(-2147483648,{error:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{error:"Invalid value: Expected int32 to be <= 2147483647"})]),fi=c({code:Wu,message:r(),data:a(p().optional(),()=>{})}),qz=T([c({id:xe,result:T([pu,mu,zu,gu,_u,yu,Ru,ku,Au,Pu,Iu,Mu,Ou,qu,ju,Nu,Du,Bu,Vu,mi])}),c({id:xe,error:fi})]),xs=r(),Xn=c({content:Pe,messageId:a(xs.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Zu=c({toolCallId:ns,title:r(),name:a(r().nullish(),()=>{}),kind:a(Zo.optional(),()=>{}),status:a(Jo.optional(),()=>{}),content:a(j(Qo).optional(),()=>[]),locations:a(j(Ko).optional(),()=>[]),rawInput:a(p().optional(),()=>{}),rawOutput:a(p().optional(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ju=T([f("high"),f("medium"),f("low")]),Qu=T([f("pending"),f("in_progress"),f("completed")]),hi=c({content:r(),priority:Ju,status:Qu,_meta:a(m(r(),p()).nullish(),()=>{})}),Ku=c({entries:oe(j(hi),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Yt=r(),Xu=c({planId:Yt,entries:oe(j(hi),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Yu=c({planId:Yt,uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),ed=c({planId:Yt,content:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),td=T([Xu.and(c({type:f("items")})),Yu.and(c({type:f("file")})),ed.and(c({type:f("markdown")}))]),nd=c({plan:td,_meta:a(m(r(),p()).nullish(),()=>{})}),sd=c({planId:Yt,_meta:a(m(r(),p()).nullish(),()=>{})}),rd=c({hint:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),od=rd,id=c({name:r(),description:r(),input:a(od.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),ad=c({availableCommands:oe(j(id),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),cd=c({currentModeId:Kt,_meta:a(m(r(),p()).nullish(),()=>{})}),ld=c({configOptions:oe(j(Ve),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),ud=c({title:a(r().nullish(),()=>{}),updatedAt:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),dd=c({amount:k(),currency:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),pd=c({used:k(),size:k(),cost:a(dd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),md=T([f("info"),f("warning"),f("error"),r()]),fd=c({severity:md,title:r().min(1),description:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),zi=r(),hd=T([f("in_progress"),f("completed"),f("failed"),f("cancelled"),r()]),zd=c({compactionId:zi,status:hd,summary:a(j(Pe).nullish(),()=>{}),error:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),gd=c({compactionId:zi,content:Pe,_meta:a(m(r(),p()).nullish(),()=>{})}),_d=c({_meta:a(m(r(),p()).nullish(),()=>{})}),yd=c({cancel:a(_d.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ts=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Es=c({stopReason:a(di.nullish(),()=>{}),usage:a(pi.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),vs=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Rs=c({_meta:a(m(r(),p()).nullish(),()=>{})}),wd=Fe(T([Ts.and(c({state:f("running")})),Es.and(c({state:f("idle")})),vs.and(c({state:f("requires_action")})),Rs.and(c({state:f("unknown")})),Ge(c({state:r()}),"state",["idle","requires_action","running","unknown"])]),"state",["idle","requires_action","running","unknown"]),bd=c({sessionId:N,title:a(r().nullish(),()=>{}),description:a(r().nullish(),()=>{}),capabilities:a(yd.nullish(),()=>{}),state:a(wd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Sd=c({messageId:xs,senderSessionId:a(N.nullish(),()=>{}),recipientSessionId:a(N.nullish(),()=>{}),content:a(j(Pe).nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),xd=c({messageId:xs,senderSessionId:a(N.nullish(),()=>{}),recipientSessionId:a(N.nullish(),()=>{}),content:Pe,_meta:a(m(r(),p()).nullish(),()=>{})}),Td=T([Xn.and(c({sessionUpdate:f("user_message_chunk")})),Xn.and(c({sessionUpdate:f("agent_message_chunk")})),Xn.and(c({sessionUpdate:f("agent_thought_chunk")})),Zu.and(c({sessionUpdate:f("tool_call")})),Xo.and(c({sessionUpdate:f("tool_call_update")})),Ku.and(c({sessionUpdate:f("plan")})),nd.and(c({sessionUpdate:f("plan_update")})),sd.and(c({sessionUpdate:f("plan_removed")})),ad.and(c({sessionUpdate:f("available_commands_update")})),cd.and(c({sessionUpdate:f("current_mode_update")})),ld.and(c({sessionUpdate:f("config_option_update")})),ud.and(c({sessionUpdate:f("session_info_update")})),pd.and(c({sessionUpdate:f("usage_update")})),fd.and(c({sessionUpdate:f("notice")})),zd.and(c({sessionUpdate:f("compaction_update")})),gd.and(c({sessionUpdate:f("compaction_summary_chunk")})),bd.and(c({sessionUpdate:f("subagent_update")})),Sd.and(c({sessionUpdate:f("session_message")})),xd.and(c({sessionUpdate:f("session_message_chunk")}))]),en=c({sessionId:N,update:Td,_meta:a(m(r(),p()).nullish(),()=>{})}),ks=c({elicitationId:si,_meta:a(m(r(),p()).nullish(),()=>{})}),gi=p(),jz=c({method:r(),params:T([en,ks,gi]).nullish()}),Ed=c({readTextFile:a(O().optional().default(!1),()=>!1),writeTextFile:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),vd=m(r(),p()),Rd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),kd=c({boolean:a(Rd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Cd=m(r(),p()),Ad=c({compaction:a(vd.nullish(),()=>{}),configOptions:a(kd.nullish(),()=>{}),notices:a(Cd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Pd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Id=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Md=c({terminal:a(O().optional().default(!1),()=>!1),_meta:a(m(r(),p()).nullish(),()=>{})}),Od=c({_meta:a(m(r(),p()).nullish(),()=>{})}),qd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),jd=c({form:a(Od.nullish(),()=>{}),url:a(qd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Nd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Dd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Hd=c({_meta:a(m(r(),p()).nullish(),()=>{})}),$d=c({jump:a(Nd.nullish(),()=>{}),rename:a(Dd.nullish(),()=>{}),searchAndReplace:a(Hd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Ld=c({fs:a(Ed.optional().default({readTextFile:!1,writeTextFile:!1}),()=>({readTextFile:!1,writeTextFile:!1})),terminal:a(O().optional().default(!1),()=>!1),session:a(Ad.nullish(),()=>{}),subagents:a(Pd.nullish(),()=>{}),plan:a(Id.nullish(),()=>{}),auth:a(Md.optional().default({terminal:!1}),()=>({terminal:!1})),elicitation:a(jd.nullish(),()=>{}),nes:a($d.nullish(),()=>{}),positionEncodings:a(j(ai).optional(),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Cs=c({protocolVersion:ii,clientCapabilities:a(Ld.optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}),()=>({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}})),clientInfo:a(ci.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),As=c({methodId:ys,_meta:a(m(r(),p()).nullish(),()=>{})}),Ps=c({_meta:a(m(r(),p()).nullish(),()=>{})}),Is=c({providerId:ws,apiType:bs,baseUrl:r(),headers:m(r(),r()).optional(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ms=c({providerId:ws,_meta:a(m(r(),p()).nullish(),()=>{})}),Os=c({_meta:a(m(r(),p()).nullish(),()=>{})}),_i=c({name:r(),value:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ud=c({name:r(),url:r(),headers:y(_i),_meta:a(m(r(),p()).nullish(),()=>{})}),Gd=c({name:r(),url:r(),headers:y(_i),_meta:a(m(r(),p()).nullish(),()=>{})}),Fd=c({name:r(),serverId:_s,_meta:a(m(r(),p()).nullish(),()=>{})}),Bd=c({name:r(),command:r(),args:y(r()),env:y(ei),_meta:a(m(r(),p()).nullish(),()=>{})}),tn=T([Ud.and(c({type:f("http")})),Gd.and(c({type:f("sse")})),Fd.and(c({type:f("acp")})),Bd]),qs=c({cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),mcpServers:oe(j(tn),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),js=c({mcpServers:oe(j(tn),()=>[]),cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Ns=c({cwd:r().nullish(),cursor:r().nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ds=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Hs=c({sessionId:N,cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),mcpServers:a(j(tn).optional(),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),$s=c({sessionId:N,cwd:r(),additionalDirectories:a(j(r()).optional(),()=>[]),mcpServers:a(j(tn).optional(),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Ls=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Us=c({sessionId:N,modeId:Kt,_meta:a(m(r(),p()).nullish(),()=>{})}),Gs=de(T([c({value:O(),type:f("boolean")}),c({value:Ss})]),c({sessionId:N,configId:li,_meta:a(m(r(),p()).nullish(),()=>{})})),Fs=c({sessionId:N,prompt:y(Pe),_meta:a(m(r(),p()).nullish(),()=>{})}),Vd=c({uri:r(),name:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Wd=c({name:r(),owner:r(),remoteUrl:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Bs=c({workspaceUri:a(r().nullish(),()=>{}),workspaceFolders:y(Vd).nullish(),repository:a(Wd.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),Zd=T([f("automatic"),f("diagnostic"),f("manual")]),Jd=c({uri:r(),languageId:r(),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Qd=c({startLine:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),endLine:X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Kd=c({uri:r(),excerpts:y(Qd),_meta:a(m(r(),p()).nullish(),()=>{})}),Xd=c({uri:r(),diff:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Yd=c({action:r(),uri:r(),position:Te,timestampMs:k(),_meta:a(m(r(),p()).nullish(),()=>{})}),ep=c({uri:r(),languageId:r(),visibleRange:a(Ze.nullish(),()=>{}),lastFocusedMs:a(k().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),tp=T([f("error"),f("warning"),f("information"),f("hint")]),np=c({uri:r(),range:Ze,severity:tp,message:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),sp=c({recentFiles:y(Jd).nullish(),relatedSnippets:y(Kd).nullish(),editHistory:y(Xd).nullish(),userActions:y(Yd).nullish(),openFiles:y(ep).nullish(),diagnostics:y(np).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Vs=c({sessionId:N,uri:r(),version:k(),position:Te,selection:Ze.nullish(),triggerKind:Zd,context:sp.nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ws=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Nz=c({id:xe,method:r(),params:T([Cs,As,Ps,Is,Ms,Os,qs,js,Ns,Ds,Hs,$s,Ls,Us,Gs,Fs,Bs,Vs,Ws,oi]).nullish()}),rp=c({_meta:a(m(r(),p()).nullish(),()=>{})}),op=c({content:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),ip=c({optionId:Yo,_meta:a(m(r(),p()).nullish(),()=>{})}),ap=T([c({outcome:f("cancelled")}),ip.and(c({outcome:f("selected")}))]),cp=c({outcome:ap,_meta:a(m(r(),p()).nullish(),()=>{})}),lp=c({terminalId:Be,_meta:a(m(r(),p()).nullish(),()=>{})}),up=c({exitCode:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),signal:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),dp=c({output:r(),truncated:O(),exitStatus:a(up.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),pp=c({_meta:a(m(r(),p()).nullish(),()=>{})}),mp=c({exitCode:a(X().gte(0).max(4294967295,{error:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),()=>{}),signal:a(r().nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),fp=c({_meta:a(m(r(),p()).nullish(),()=>{})}),hp=T([r(),k(),k(),O(),y(r())]),Zs=c({content:m(r(),hp).nullish()}),zp=Fe(de(T([Zs.and(c({action:f("accept")})),c({action:f("decline")}),c({action:f("cancel")}),Ge(c({action:r()}),"action",["accept","cancel","decline"])]),c({_meta:a(m(r(),p()).nullish(),()=>{})})),"action",["accept","cancel","decline"]),gp=B({code:X().min(-2147483648,{error:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{error:"Invalid value: Expected int32 to be <= 2147483647"}),message:r(),data:p().optional()}),_p=T([c({result:p(),_meta:a(m(r(),p()).nullish(),()=>{})}),c({error:gp,_meta:a(m(r(),p()).nullish(),()=>{})})]),Dz=T([c({id:xe,result:T([rp,op,cp,lp,dp,pp,mp,fp,zp,_p,mi])}),c({id:xe,error:fi})]),Js=c({sessionId:N,_meta:a(m(r(),p()).nullish(),()=>{})}),Qs=c({sessionId:N,uri:r(),languageId:r(),version:k(),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),yp=c({range:Ze.nullish(),text:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ks=c({sessionId:N,uri:r(),version:k(),contentChanges:oe(j(yp),()=>[]),_meta:a(m(r(),p()).nullish(),()=>{})}),Xs=c({sessionId:N,uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),Ys=c({sessionId:N,uri:r(),_meta:a(m(r(),p()).nullish(),()=>{})}),er=c({sessionId:N,uri:r(),version:k(),position:Te,visibleRange:Ze,_meta:a(m(r(),p()).nullish(),()=>{})}),tr=c({sessionId:N,id:We,_meta:a(m(r(),p()).nullish(),()=>{})}),wp=T([f("rejected"),f("ignored"),f("replaced"),f("cancelled")]),nr=c({sessionId:N,id:We,reason:a(wp.nullish(),()=>{}),_meta:a(m(r(),p()).nullish(),()=>{})}),bp=c({serverId:_s,requestId:ri,method:r(),params:m(r(),p()).nullish(),_meta:a(m(r(),p()).nullish(),()=>{})}),Hz=c({method:r(),params:T([Js,Qs,Ks,Xs,Ys,er,tr,nr,bp,gi]).nullish()}),$z=c({requestId:xe,_meta:a(m(r(),p()).nullish(),()=>{})});var wi="$/cancel_request";function nn(n){return ir(n)&&"id"in n&&typeof n.method=="string"&&ar(n.id)}i(nn,"isRequestMessage");function Si(n){if(!ir(n)||"method"in n||!("id"in n)||!ar(n.id))return!1;let e=Object.hasOwn(n,"result"),t=Object.hasOwn(n,"error");return e===t?!1:!t||Tp(n.error)}i(Si,"isResponseMessage");function Je(n){return ir(n)&&!("id"in n)&&typeof n.method=="string"}i(Je,"isNotificationMessage");function Ee(n){return typeof n=="object"&&n!==null}i(Ee,"isRecord");function ir(n){return Ee(n)&&n.jsonrpc==="2.0"}i(ir,"isJsonRpcEnvelope");function ar(n){return n===null||typeof n=="string"||typeof n=="number"&&Number.isFinite(n)}i(ar,"isJsonRpcId");function bi(n){return Ee(n)&&!("method"in n)&&("id"in n||"result"in n||"error"in n)}i(bi,"isResponseShapedMessage");function Sp(n){let e=!1,t=!1,s=!1,o=!1;for(let l of n)e||=nn(l)||Je(l),t||=Si(l),Ee(l)&&(s||="method"in l,o||="result"in l||"error"in l);return e?!1:t?!0:o&&!s}i(Sp,"isResponseBatch");function xp(n){if(!(!Ee(n)||!ar(n.requestId)))return n.requestId}i(xp,"cancelRequestId");function Tp(n){return Ee(n)&&typeof n.code=="number"&&Number.isInteger(n.code)&&typeof n.message=="string"}i(Tp,"isErrorResponse");var ge={yes(){return{handled:!0}},no(n,e=!1){return{handled:!1,message:n,retry:e}}};function Ie(n){let e=Promise.reject(n);return e.catch(()=>{}),e}i(Ie,"rejectedPromise");function Ep(n){if(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")return n.message}i(Ep,"errorDetails");function vp(n){return typeof n=="object"&&n!==null&&"name"in n&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)&&"format"in n&&typeof n.format=="function"}i(vp,"isZodError");function xi(n){if(n instanceof C)return n.toResult();if(vp(n))return C.invalidParams(n.format()).toResult();let e=Ep(n);try{return C.internalError(e?JSON.parse(e):{}).toResult()}catch{return C.internalError({details:e}).toResult()}}i(xi,"errorToResult");function Rp(n){return n instanceof C&&n.code===-32800?n:C.requestCancelled(n)}i(Rp,"requestCancelledError");function kp(n,e){let t=Cp(n,e);return t?t.toResult():xi(n)}i(kp,"errorToRequestResult");function Cp(n,e){if(!(!e.aborted||!Ap(n)))return Rp(e.reason)}i(Cp,"abortErrorToRequestCancelled");function Ap(n){if(typeof n!="object"||n===null)return!1;let e=n;return e.name==="AbortError"||e.code==="ABORT_ERR"}i(Ap,"isAbortError");var sr=class{static{i(this,"RequestResponder")}id;sendResult;signal;finishRequest;didRespond=!1;constructor(e,t,s=new AbortController().signal,o){this.id=e,this.sendResult=t,this.signal=s,this.finishRequest=o}get responded(){return this.didRespond}respond(e){return this.respondWithResult({result:e??null})}respondWithError(e){let t=e instanceof C?e.toErrorResponse():e;return this.respondWithResult({error:t})}respondWithResult(e){return this.didRespond?Ie(new Error("JSON-RPC request already responded")):(this.didRespond=!0,this.sendResult(e).finally(()=>{this.finishRequest?.()}))}},Pp=new WeakMap;var Ke=class{static{i(this,"HandlerRegistration")}disposeHandler;active=!0;constructor(e){this.disposeHandler=e}dispose(){this.active&&(this.active=!1,this.disposeHandler())}[Symbol.dispose](){this.dispose()}runIndefinitely(){return this}},rr=class{static{i(this,"ConnectionContext")}connection;constructor(e){this.connection=e}sendRequest(e,t,s,o){return this.connection.sendRequest(e,t,s,o)}sendNotification(e,t){return this.connection.sendNotification(e,t)}sendBatch(e){return this.connection.sendBatch(e)}sendCancelRequest(e){return this.connection.sendCancelRequest(e)}addDynamicHandler(e){return this.connection.addDynamicHandler(e)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},Xe=class{static{i(this,"Connection")}pendingResponses=new Map;incomingRequests=new Map;nextRequestId=0;staticHandlers=[];dynamicHandlers=new Set;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;retryQueue=[];context=new rr(this);receiveReader;allowBatches=!0;constructor(e,t,s,o){if(typeof e=="function"){let h=e,z=t,g=s;this.initialize(g,[...o?.handlers??[],this.legacyHandler(h,z)],o);return}let l=e,u=t,d=s;this.initialize(l,[...d?.handlers??[],...u],d)}static builder(){return new or}runUntil(e){let t=!1,s=Promise.resolve().then(()=>e(this.context)).finally(()=>{t=!0}),o=this.closed.then(()=>{if(t)return new Promise(()=>{});throw this.closedReason()});return Promise.race([s,o]).finally(()=>{t=!0,this.close()})}addDynamicHandler(e){if(this.dynamicHandlers.add(e),this.retryQueue.length>0)for(let t of this.retryQueue.splice(0))this.processIncomingMessage(t).catch(s=>this.close(s));return new Ke(()=>{this.dynamicHandlers.delete(e)})}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}getContext(){return this.context}sendRequest(e,t,s,o={}){if(this.abortController.signal.aborted)return Ie(this.closedReason());let l=this.prepareRequest(e,t,s,o);return this.sendWireMessage(l.message).catch(()=>{}),o.cancellationSignal?.aborted&&l.cancel(),l.response}sendBatch(e){if(this.abortController.signal.aborted)return Ie(this.closedReason());if(!this.allowBatches)return Ie(new TypeError("JSON-RPC batches are not supported on this connection"));if(e.length===0)return Ie(new TypeError("JSON-RPC batch must contain at least one entry"));let t=[],s=[],o=[];for(let h of e){if(h.kind==="notification"){t.push({jsonrpc:"2.0",method:h.method,params:h.params}),o.push(Promise.resolve(void 0));continue}let z=this.prepareRequest(h.method,h.params,h.mapResponse,h.options);t.push(z.message),o.push(z.response),s.push({signal:h.options?.cancellationSignal,cancel:z.cancel})}let l=t,u=this.sendWireMessage(l);for(let h of s)h.signal?.aborted&&h.cancel();let d=Promise.all([u,...o]).then(([,...h])=>h);return d.catch(()=>{}),d}sendCancelRequest(e){return this.sendNotification(wi,{requestId:e})}sendNotification(e,t){return this.abortController.signal.aborted?Ie(this.closedReason()):this.sendWireMessage({jsonrpc:"2.0",method:e,params:t})}prepareRequest(e,t,s,o={}){let l=this.nextRequestId++,u=i(()=>{},"cancel"),d=new Promise((h,z)=>{let g={resolve:i(_=>{try{h(s?s(_):_)}catch(w){z(w)}},"resolve"),reject:z};u=i(()=>{g.cancellationSent||(g.cancellationSent=!0,g.cleanup?.(),this.sendCancelRequest(l).catch(()=>{}))},"cancel"),o.cancellationSignal?.addEventListener("abort",u,{once:!0}),g.cleanup=()=>{o.cancellationSignal?.removeEventListener("abort",u)},this.pendingResponses.set(l,g)});return d.catch(()=>{}),{message:{jsonrpc:"2.0",id:l,method:e,params:t},response:d,cancel:i(()=>u(),"cancel")}}close(e){if(this.abortController.signal.aborted)return;let t=e??new Error("ACP connection closed");this.abortController.abort(t);for(let s of this.pendingResponses.values())s.cleanup?.(),s.reject(t);this.pendingResponses.clear();for(let s of this.incomingRequests.values())s.abort(t);this.incomingRequests.clear(),this.receiveReader?.cancel(t).catch(()=>{})}initialize(e,t,s){this.stream=e,this.staticHandlers=t,this.allowBatches=s?.allowBatches??!0,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}legacyHandler(e,t){return{handleMessage:i(async(s,o)=>{if(s.kind==="request"){let l=await e(s.method,s.params,o);await s.responder.respond(l)}else await t(s.method,s.params,o);return ge.yes()},"handleMessage")}}async receive(){let e;try{let t=this.stream.readable.getReader();this.receiveReader=t;try{for(;!this.abortController.signal.aborted;){let{value:s,done:o}=await t.read();if(this.abortController.signal.aborted||o)break;this.receiveWireMessage(s)}}finally{this.receiveReader===t&&(this.receiveReader=void 0),t.releaseLock()}}catch(t){e=t}finally{this.close(e)}}receiveWireMessage(e){if(Array.isArray(e)){if(!this.allowBatches){this.close(new TypeError("JSON-RPC batches are not supported on this connection"));return}this.receiveBatch(e);return}if(!nn(e)&&!Je(e)&&!bi(e)){this.sendWireMessage(Qe(C.invalidRequest(e))).catch(()=>{});return}this.receiveMessage(e)}receiveBatch(e){if(e.length===0){this.sendWireMessage(Qe(C.invalidRequest(e))).catch(()=>{});return}let t=Sp(e),o=t?0:e.reduce((g,_)=>g+(Je(_)?0:1),0),l=e.reduce((g,_)=>g+(Je(_)?1:0),0),u=!1,d=[],h=i(async()=>{u||o!==0||l!==0||d.length===0||(u=!0,await this.sendWireMessage(d))},"sendResponsesIfReady"),z=i(async g=>{d.push(g),o-=1,await h()},"collectResponse");for(let g of e){if(t){bi(g)&&this.receiveMessage(g);continue}if(!nn(g)&&!Je(g)){z(Qe(C.invalidRequest(g))).catch(()=>{});continue}let _=this.receiveMessage(g,nn(g)?z:void 0,e.length);Je(g)&&_.finally(()=>{l-=1,h().catch(w=>this.close(w))})}}receiveMessage(e,t,s){return this.abortController.signal.aborted?Promise.resolve():Ee(e)?"method"in e?("id"in e||this.handleProtocolNotification(e),this.processIncomingMessage(this.toIncomingMessage(e,t,s)).catch(o=>this.close(o))):("id"in e?this.handleResponse(e):console.error("Invalid message",{message:e}),Promise.resolve()):(console.error("Invalid message",{message:e}),Promise.resolve())}async processIncomingMessage(e){if(this.abortController.signal.aborted)return;let t=e,s=!1;try{for(let o of[...this.staticHandlers,...this.dynamicHandlers.values()]){if(this.abortController.signal.aborted)return;let l=await o.handleMessage(t,this.context)??{handled:!0};if(l.handled)return;t=l.message??t,s=s||!!l.retry}s?this.retryQueue.push(t):t.kind==="request"&&await t.responder.respondWithError(C.methodNotFound(t.method))}catch(o){if(this.abortController.signal.aborted)return;if(t.kind==="request"&&!t.responder.responded)await t.responder.respondWithResult(kp(o,t.responder.signal));else{let l=xi(o);"error"in l&&console.error("Error handling notification",e.raw,l.error)}}}toIncomingMessage(e,t,s){if("id"in e){let o=new AbortController;this.incomingRequests.set(e.id,o);let l=i(()=>{this.incomingRequests.get(e.id)===o&&this.incomingRequests.delete(e.id)},"finishRequest"),u=new sr(e.id,d=>{let h={jsonrpc:"2.0",id:e.id,...d};return t?t(h):this.sendWireMessage(h)},o.signal,l);return s!==void 0&&Pp.set(u,s),{kind:"request",method:e.method,params:e.params,raw:e,signal:o.signal,responder:u}}return{kind:"notification",method:e.method,params:e.params,raw:e}}handleResponse(e){let t=this.pendingResponses.get(e.id);if(t)if(this.pendingResponses.delete(e.id),t.cleanup?.(),!Si(e))t.reject(C.invalidRequest(e));else if("result"in e)t.resolve(e.result);else{let{code:s,message:o,data:l}=e.error;t.reject(new C(s,o,l))}else console.error("Got response to unknown request",e.id)}handleProtocolNotification(e){if(e.method!==wi)return;let t=xp(e.params);if(t===void 0)return;let s=this.incomingRequests.get(t);!s||s.signal.aborted||s.abort(C.requestCancelled({requestId:t}))}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendWireMessage(e){return this.abortController.signal.aborted?Ie(this.closedReason()):(this.writeQueue=this.writeQueue.then(async()=>{if(this.abortController.signal.aborted)throw this.closedReason();let t=this.stream.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{throw this.close(t),t}),this.writeQueue)}},or=class{static{i(this,"ConnectionBuilder")}handlers=[];connectionName;name(e){return this.connectionName=e,this}withHandler(e){return this.handlers.push(e),this}onReceiveMessage(e){return this.withHandler({handleMessage:i(async(t,s)=>await e(t,s)??ge.no(t),"handleMessage"),describe:i(()=>this.connectionName??"onReceiveMessage","describe")})}onReceiveRequest(e,t,s){return this.withHandler({handleMessage:i(async(o,l)=>{if(o.kind!=="request"||o.method!==e)return ge.no(o);let u=t(o.params);return await s(u,o.responder,l)??ge.yes()},"handleMessage"),describe:i(()=>`${this.connectionName??"request"}:${e}`,"describe")})}onReceiveNotification(e,t,s){return this.withHandler({handleMessage:i(async(o,l)=>{if(o.kind!=="notification"||o.method!==e)return ge.no(o);let u=t(o.params);return await s(u,l)??ge.yes()},"handleMessage"),describe:i(()=>`${this.connectionName??"notification"}:${e}`,"describe")})}connect(e,t){return new Xe(e,this.handlers,t)}connectWith(e,t,s){return this.connect(e,s).runUntil(t)}},C=class n extends Error{static{i(this,"RequestError")}code;data;constructor(e,t,s){super(t),this.code=e,this.name="RequestError",this.data=s}static parseError(e,t){return new n(-32700,`Parse error${t?`: ${t}`:""}`,e)}static invalidRequest(e,t){return new n(-32600,`Invalid request${t?`: ${t}`:""}`,e)}static methodNotFound(e){return new n(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,t){return new n(-32602,`Invalid params${t?`: ${t}`:""}`,e)}static internalError(e,t){return new n(-32603,`Internal error${t?`: ${t}`:""}`,e)}static requestCancelled(e,t){return new n(-32800,`Request cancelled${t?`: ${t}`:""}`,e)}static authRequired(e,t){return new n(-32e3,`Authentication required${t?`: ${t}`:""}`,e)}static resourceNotFound(e){return new n(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};function Qe(n){return{jsonrpc:"2.0",id:null,error:n.toErrorResponse()}}i(Qe,"protocolErrorResponse");var Ye=class extends Error{static{i(this,"MessageTooLargeError")}maxMessageBytes;constructor(e){super(`Incoming ACP data exceeds the configured ${e} byte limit`),this.maxMessageBytes=e,this.name="MessageTooLargeError"}};function ht(n){let e=n??33554432;if(!Number.isSafeInteger(e)||e<=0)throw new RangeError("maxMessageBytes must be a positive safe integer");return e}i(ht,"resolveMaxMessageBytes");var sn=class{static{i(this,"MessageBuffer")}#e=new Uint8Array(0);#t=0;#n;constructor(e){this.#n=ht(e)}get byteLength(){return this.#t}get lastByte(){return this.#e[this.#t-1]}#s(e){if(e>this.#n-this.#t)throw this.clear(),new Ye(this.#n)}append(e){this.#s(e.byteLength);let t=this.#t+e.byteLength;if(t>this.#e.byteLength){let s=Math.min(this.#n,Math.max(t,this.#e.byteLength*2,1024)),o=new Uint8Array(s);o.set(this.#e.subarray(0,this.#t)),this.#e=o}this.#e.set(e,this.#t),this.#t=t}take(){let e=this.#e.subarray(0,this.#t);return this.clear(),e}clear(){this.#e=new Uint8Array(0),this.#t=0}};var Ti=10,rn=class{static{i(this,"LineBuffer")}#e;#t;constructor(e){this.#t=ht(e),this.#e=new sn(Math.min(Number.MAX_SAFE_INTEGER,this.#t+1))}*push(e){let t=0,s=e.indexOf(Ti,t);for(;s!==-1;)yield this.#n(e.subarray(t,s)),t=s+1,s=e.indexOf(Ti,t);if(t<e.byteLength){let o=e.subarray(t);this.#s(o),this.#e.append(o)}}flush(){if(this.#e.byteLength!==0)return cr(this.#e.take())}clear(){this.#e.clear()}#n(e){return this.#s(e),this.#e.byteLength===0?cr(e):(this.#e.append(e),cr(this.#e.take()))}#s(e){let t=e.byteLength>0?e[e.byteLength-1]:this.#e.lastByte;if(this.#e.byteLength+e.byteLength-(t===13?1:0)>this.#t)throw this.clear(),new Ye(this.#t)}};function cr(n){return n[n.byteLength-1]===13?n.subarray(0,-1):n}i(cr,"stripCarriageReturn");function Ei(n,e,t={}){let s=ht(t.maxMessageBytes),o=new TextEncoder,l=new TextDecoder,u=!1,d,h=Promise.resolve(),z=i(w=>{let b=JSON.stringify(w)+`
|
|
3
3
|
`,E=h.then(async()=>{let x=n.getWriter();try{await x.write(o.encode(b))}finally{x.releaseLock()}});return h=E.catch(()=>{}),E},"writeJson"),g=new ReadableStream({async start(w){let b=new rn(s),E=i(async A=>{let q=l.decode(A).trim();if(!q)return;let M;try{M=JSON.parse(q)}catch{await z(Qe(C.parseError()));return}Ee(M)||Array.isArray(M)?w.enqueue(M):await z(Qe(C.invalidRequest(M)))},"enqueueLine"),x=e.getReader();d=x;try{for(;;){let{value:q,done:M}=await x.read();if(u)return;if(M)break;if(q){for(let W of b.push(q))if(await E(W),u)return}}if(u)return;let A=b.flush();A&&await E(A)}catch(A){if(u)return;w.error(A),x.cancel(A).catch(()=>{});return}finally{b.clear(),d===x&&(d=void 0),x.releaseLock()}u||w.close()},cancel(w){return u=!0,d?.cancel(w)}}),_=new WritableStream({write(w){return z(w)}});return{readable:g,writable:_}}i(Ei,"ndJsonStream");var Yz=hs.and(c({mode:f("form")})).and(c({message:r()})),eg=zs.and(c({mode:f("url")})).and(c({message:r()})),tg=T([mt,ft]).and(c({message:r()})),ng=ls.and(c({type:f("string")})),sg=us.and(c({type:f("number")})),rg=ds.and(c({type:f("integer")})),og=ps.and(c({type:f("boolean")})),ig=fs.and(c({type:f("array")})),ag=ms.and(c({type:f("string")}));var cg=Ts.and(c({state:f("running")})),lg=Es.and(c({state:f("idle")})),ug=vs.and(c({state:f("requires_action")})),dg=Rs.and(c({state:f("unknown")})),pg=Zs.and(c({action:f("accept")})),mg=c({action:f("decline")}),fg=c({action:f("cancel")});function Ci(n,e,t){return Ei(n,e,t)}i(Ci,"ndJsonStream");function ce(n){return n??{}}i(ce,"emptyObjectResponse");function Ai(n){return typeof n=="object"&&n!==null&&"readable"in n&&"writable"in n}i(Ai,"isStream");function Pi(){let n=new TransformStream,e=new TransformStream;return[{readable:e.readable,writable:n.writable},{readable:n.readable,writable:e.writable}]}i(Pi,"memoryStreamPair");var _t={agent:{initialize:S.initialize,authenticate:S.authenticate,logout:S.logout,providers:{list:S.providers_list,set:S.providers_set,disable:S.providers_disable},session:{new:S.session_new,load:S.session_load,list:S.session_list,delete:S.session_delete,fork:S.session_fork,resume:S.session_resume,close:S.session_close,setMode:S.session_set_mode,setConfigOption:S.session_set_config_option,prompt:S.session_prompt,cancel:S.session_cancel},nes:{start:S.nes_start,suggest:S.nes_suggest,accept:S.nes_accept,reject:S.nes_reject,close:S.nes_close},document:{didOpen:S.document_did_open,didChange:S.document_did_change,didClose:S.document_did_close,didSave:S.document_did_save,didFocus:S.document_did_focus}},client:{session:{requestPermission:D.session_request_permission,update:D.session_update},fs:{writeTextFile:D.fs_write_text_file,readTextFile:D.fs_read_text_file},terminal:{create:D.terminal_create,output:D.terminal_output,release:D.terminal_release,waitForExit:D.terminal_wait_for_exit,kill:D.terminal_kill},elicitation:{create:D.elicitation_create,complete:D.elicitation_complete}},protocol:{cancelRequest:Kn.cancel_request}},Ii=Symbol("startActiveSession"),cn=class{static{i(this,"AcpContext")}cx;currentRequestId;constructor(e,t){this.cx=e,this.currentRequestId=t}get requestId(){return this.currentRequestId}get connectionContext(){return this.cx}sendRequest(e,t,s,o){return this.cx.sendRequest(e,t,s,o)}sendNotification(e,t){return this.cx.sendNotification(e,t)}addDynamicHandler(e){return this.cx.addDynamicHandler(e)}},zt=class n extends cn{static{i(this,"AgentContext")}constructor(e,t){super(e,t)}static create(e,t){return new n(e,t)}request(e,t,s){let o=Hi[e];return this.sendRequest(e,t,o?.mapResponse,s)}notify(e,t){return this.sendNotification(e,t)}},gt=class n extends cn{static{i(this,"ClientContext")}constructor(e,t){super(e,t)}static create(e,t){return new n(e,t)}[Ii](e,t){return this.sendRequest(S.session_new,e,s=>this.attachSession(s),t)}buildSession(e){return typeof e=="string"?un.create(this,{cwd:e,mcpServers:[]}):un.create(this,e)}attachSession(e){let t=new dr,s=this.connectionContext.signal,o=i(()=>{t.fail(s.reason??new Error("ACP connection closed"))},"failUpdatesOnClose");s.aborted?o():s.addEventListener("abort",o);let l=$i(this.connectionContext).attach(e,t),u=new Ke(()=>{s.removeEventListener("abort",o)});return pr.create(this,e,t,[l,u])}request(e,t,s){let o=Di[e];return this.sendRequest(e,t,o?.mapResponse,s)}notify(e,t){return this.sendNotification(e,t)}},ln=class{static{i(this,"AcpConnectionHandle")}connection;constructor(e){this.connection=e}get signal(){return this.connection.signal}get closed(){return this.connection.closed}close(e){this.connection.close(e)}},lr=class extends ln{static{i(this,"AgentConnectionHandle")}connectHandlers;client;didStartConnectHandlers=!1;constructor(e,t=[]){super(e),this.connectHandlers=t,this.client=zt.create(e.getContext())}startConnectHandlers(){this.didStartConnectHandlers||(this.didStartConnectHandlers=!0,fn(this,this.connectHandlers))}},ur=class extends ln{static{i(this,"ClientConnectionHandle")}connectHandlers;agent;didStartConnectHandlers=!1;constructor(e,t=[]){super(e),this.connectHandlers=t,this.agent=gt.create(e.getContext())}startConnectHandlers(){this.didStartConnectHandlers||(this.didStartConnectHandlers=!0,fn(this,this.connectHandlers))}};function Mi(n,e=[]){return new lr(n,e)}i(Mi,"agentConnection");function Oi(n,e=[]){return new ur(n,e)}i(Oi,"clientConnection");var dr=class{static{i(this,"AsyncQueue")}values=[];waiters=[];failed=!1;failure;enqueue(e){if(this.failed)return;let t=this.waiters.shift();t?t.resolve(e):this.values.push({kind:"value",value:e})}reject(e){if(!this.failed){if(this.waiters.length>0){for(let t of this.waiters.splice(0))t.reject(e);return}this.values.push({kind:"error",error:e})}}clearErrors(){this.values=this.values.filter(e=>e.kind==="value")}fail(e){if(!this.failed){this.failed=!0,this.failure=e;for(let t of this.waiters.splice(0))t.reject(e)}}next(){if(this.values.length>0){let e=this.values.shift();return e.kind==="error"?Promise.reject(e.error):Promise.resolve(e.value)}return this.failed?Promise.reject(this.failure):new Promise((e,t)=>{this.waiters.push({resolve:e,reject:t})})}};function vi(n){return{...n,additionalDirectories:n.additionalDirectories?[...n.additionalDirectories]:void 0,mcpServers:[...n.mcpServers]}}i(vi,"cloneNewSessionRequest");var un=class n{static{i(this,"SessionBuilder")}cx;request;constructor(e,t){this.cx=e,this.request=vi(t)}static create(e,t){return new n(e,t)}toRequest(){return vi(this.request)}withAdditionalDirectories(e){return this.request={...this.request,additionalDirectories:[...e]},this}withMcpServer(e){return this.request={...this.request,mcpServers:[...this.request.mcpServers,e]},this}async start(e){return this.cx[Ii](this.toRequest(),e)}async withSession(e){let t=await this.start();try{return await e(t)}finally{t.dispose()}}},pr=class n{static{i(this,"ActiveSession")}cx;sessionResponse;updates;registrations;constructor(e,t,s,o){this.cx=e,this.sessionResponse=t,this.updates=s,this.registrations=o}static create(e,t,s,o){return new n(e,t,s,o)}get sessionId(){return this.sessionResponse.sessionId}get modes(){return this.sessionResponse.modes}get meta(){return this.sessionResponse._meta}get newSessionResponse(){return this.sessionResponse}prompt(e,t){this.updates.clearErrors();let s=this.cx.request(S.session_prompt,{sessionId:this.sessionId,prompt:this.promptBlocks(e)},t);return s.then(o=>{this.updates.enqueue({kind:"stop",response:o,stopReason:o.stopReason})},o=>{this.updates.reject(o)}),s}nextUpdate(){return this.updates.next()}async readText(){let e="";for(;;){let t=await this.nextUpdate();if(t.kind==="stop")return e;let{update:s}=t;s.sessionUpdate==="agent_message_chunk"&&s.content.type==="text"&&(e+=s.content.text)}}dispose(){for(let e of this.registrations.splice(0))e.dispose();this.updates.fail(new Error("Active session disposed"))}[Symbol.dispose](){this.dispose()}promptBlocks(e){return typeof e=="string"?[{type:"text",text:e}]:Array.isArray(e)?e:[e]}};function qi(n,e){return n?typeof n=="function"?n(e):n.parse(e):e}i(qi,"parseParams");function L(n,e,t){return{method:n,params:e,mapResponse:t}}i(L,"requestSpec");function fe(n,e){return{method:n,params:e}}i(fe,"notificationSpec");function ji(n,e,t,s){n.onReceiveRequest(e.method,o=>qi(e.params,o),async(o,l,u)=>{let d=await s(t(o,u,l.signal,l.id));await l.respond(e.mapResponse?e.mapResponse(d):d)})}i(ji,"registerAppRequest");function Ni(n,e,t,s){n.onReceiveNotification(e.method,o=>qi(e.params,o),(o,l)=>s(t(o,l,l.signal)))}i(Ni,"registerAppNotification");function mn(n){let e={};for(let t of Object.values(n))e[t.method]=t;return e}i(mn,"specsByMethod");var Ip={initialize:L(S.initialize,Cs),newSession:L(S.session_new,qs),loadSession:L(S.session_load,js,ce),unstable_forkSession:L(S.session_fork,Hs),listSessions:L(S.session_list,Ns),deleteSession:L(S.session_delete,Ds,ce),resumeSession:L(S.session_resume,$s),closeSession:L(S.session_close,Ls,ce),setSessionMode:L(S.session_set_mode,Us,ce),setSessionConfigOption:L(S.session_set_config_option,Gs),authenticate:L(S.authenticate,As,ce),unstable_listProviders:L(S.providers_list,Ps),unstable_setProvider:L(S.providers_set,Is,ce),unstable_disableProvider:L(S.providers_disable,Ms,ce),logout:L(S.logout,Os,ce),prompt:L(S.session_prompt,Fs),unstable_startNes:L(S.nes_start,Bs),unstable_suggestNes:L(S.nes_suggest,Vs),unstable_closeNes:L(S.nes_close,Ws,ce)},Mp={cancel:fe(S.session_cancel,Js),unstable_didOpenDocument:fe(S.document_did_open,Qs),unstable_didChangeDocument:fe(S.document_did_change,Ks),unstable_didCloseDocument:fe(S.document_did_close,Xs),unstable_didSaveDocument:fe(S.document_did_save,Ys),unstable_didFocusDocument:fe(S.document_did_focus,er),unstable_acceptNes:fe(S.nes_accept,tr),unstable_rejectNes:fe(S.nes_reject,nr)},Op={requestPermission:L(D.session_request_permission,ss),writeTextFile:L(D.fs_write_text_file,es,ce),readTextFile:L(D.fs_read_text_file,ts),createTerminal:L(D.terminal_create,rs),terminalOutput:L(D.terminal_output,os),releaseTerminal:L(D.terminal_release,is,ce),waitForTerminalExit:L(D.terminal_wait_for_exit,as),killTerminal:L(D.terminal_kill,cs,ce),createElicitation:L(D.elicitation_create,gs)},qp={sessionUpdate:fe(D.session_update,en),completeElicitation:fe(D.elicitation_complete,ks)},Di=mn(Ip),jp=mn(Mp),Hi=mn(Op),Np=mn(qp);function Dp(n,e,t,s){return{params:n,requestId:s,signal:t,client:e}}i(Dp,"agentRequestContext");function Hp(n,e,t){return{params:n,signal:t,client:e}}i(Hp,"agentNotificationContext");function $p(n,e,t,s){return{params:n,requestId:s,signal:t,agent:e}}i($p,"clientRequestContext");function Lp(n,e,t){return{params:n,signal:t,agent:e}}i(Lp,"clientNotificationContext");var mr=class{static{i(this,"SessionUpdateRouter")}activeSessions=new Map;handleMessage(e){if(e.kind!=="notification"||e.method!==D.session_update)return ge.no(e);let t=en.parse(e.params),s={kind:"session_update",notification:t,update:t.update},o=this.activeSessions.get(t.sessionId);if(o&&o.size>0)for(let l of o)l.enqueue(s);return ge.no(e)}attach(e,t){let s=this.activeSessions.get(e.sessionId)??new Set;return s.add(t),this.activeSessions.set(e.sessionId,s),new Ke(()=>{s.delete(t),s.size===0&&this.activeSessions.delete(e.sessionId)})}},Ri=new WeakMap;function $i(n){let e=Ri.get(n);return e||(e=new mr,Ri.set(n,e)),e}i($i,"sessionUpdateRouter");function fn(n,e){for(let t of e){let s;try{s=t(n)}catch(o){throw n.close(o),o}Promise.resolve(s).catch(o=>{n.close(o)})}}i(fn,"runConnectHandlers");var dn=Symbol("appBuilder"),on=Symbol("runAgentConnectHandlers"),an=Symbol("runClientConnectHandlers"),pn={allowBatches:!1};function Li(n){return new fr(n)}i(Li,"agent");var fr=class{static{i(this,"AgentApp")}builder=Xe.builder();connectHandlers=[];constructor(e={}){e.name&&this.builder.name(e.name)}[dn](){return this.builder}[on](e){fn(e,this.connectHandlers)}connect(e,t={}){return this.connectConnection(e,t).connection}connectWith(e,t){let{rawConnection:s,connection:o}=this.connectConnection(e);return s.runUntil(()=>t(o.client))}onConnect(e){return this.connectHandlers.push(e),this}onRequest(e,t,s){if(s)return this.request({method:e,params:t},s);let o=Di[e];if(!o)throw new Error(`Unknown ACP request method '${e}'. Pass a params parser for custom methods.`);return this.request(o,t)}onNotification(e,t,s){if(s)return this.notification({method:e,params:t},s);let o=jp[e];if(!o)throw new Error(`Unknown ACP notification method '${e}'. Pass a params parser for custom methods.`);return this.notification(o,t)}request(e,t){return ji(this.builder,e,(s,o,l,u)=>Dp(s,zt.create(o,u),l,u),t),this}notification(e,t){return Ni(this.builder,e,(s,o,l)=>Hp(s,zt.create(o),l),t),this}connectConnection(e,t={}){if(Ai(e)){let h=this.openStreamConnection(e);return t.deferConnectHandlers||this[on](h.connection),h}let[s,o]=Pi(),l=e[dn]().connect(o,pn),u=Oi(l),d=this.openStreamConnection(s);d.rawConnection.closed.then(()=>u.close()),l.closed.then(()=>d.connection.close());try{e[an](u),this[on](d.connection)}catch(h){throw u.close(h),d.connection.close(h),h}return d}openStreamConnection(e){let t=this.builder.connect(e,pn);return{rawConnection:t,connection:Mi(t,this.connectHandlers)}}};var ki=class{static{i(this,"ClientApp")}builder=Xe.builder();connectHandlers=[];constructor(e={}){e.name&&this.builder.name(e.name),this.builder.withHandler({handleMessage:i((t,s)=>$i(s).handleMessage(t),"handleMessage"),describe:i(()=>"client-session-update-router","describe")})}[dn](){return this.builder}[an](e){fn(e,this.connectHandlers)}connect(e){return this.connectConnection(e).connection}connectWith(e,t){let{rawConnection:s,connection:o}=this.connectConnection(e);return s.runUntil(()=>t(o.agent))}onConnect(e){return this.connectHandlers.push(e),this}onRequest(e,t,s){if(s)return this.request({method:e,params:t},s);let o=Hi[e];if(!o)throw new Error(`Unknown ACP request method '${e}'. Pass a params parser for custom methods.`);return this.request(o,t)}onNotification(e,t,s){if(s)return this.notification({method:e,params:t},s);let o=Np[e];if(!o)throw new Error(`Unknown ACP notification method '${e}'. Pass a params parser for custom methods.`);return this.notification(o,t)}request(e,t){return ji(this.builder,e,(s,o,l,u)=>$p(s,gt.create(o,u),l,u),t),this}notification(e,t){return Ni(this.builder,e,(s,o,l)=>Lp(s,gt.create(o),l),t),this}connectConnection(e){if(Ai(e)){let d=this.openStreamConnection(e);return this[an](d.connection),d}let[t,s]=Pi(),o=e[dn]().connect(s,pn),l=Mi(o),u=this.openStreamConnection(t);u.rawConnection.closed.then(()=>l.close()),o.closed.then(()=>u.connection.close());try{e[on](l),this[an](u.connection)}catch(d){throw l.close(d),u.connection.close(d),d}return u}openStreamConnection(e){let t=this.builder.connect(e,pn);return{rawConnection:t,connection:Oi(t,this.connectHandlers)}}},vg=new Set([S.initialize,S.authenticate,S.providers_list,S.providers_set,S.providers_disable,S.session_new,S.session_load,S.session_set_mode,S.session_set_config_option,S.session_prompt,S.session_list,S.session_delete,S.session_fork,S.session_resume,S.session_close,S.logout,S.nes_start,S.nes_suggest,S.nes_close]),Rg=new Set([S.session_cancel,S.nes_accept,S.nes_reject,S.document_did_open,S.document_did_change,S.document_did_close,S.document_did_save,S.document_did_focus]),kg=new Set([D.session_request_permission,D.fs_write_text_file,D.fs_read_text_file,D.terminal_create,D.terminal_output,D.terminal_release,D.terminal_wait_for_exit,D.terminal_kill,D.elicitation_create]),Cg=new Set([D.session_update,D.elicitation_complete]);import{createHash as Gp}from"node:crypto";import{realpath as Fp,stat as Bp}from"node:fs/promises";import Vp from"node:path";function ie(n){return Gp("sha256").update(JSON.stringify(n)).digest("hex")}i(ie,"fingerprint");async function hr(n,e){if(!Vp.isAbsolute(n)||e?.length)throw C.invalidParams(void 0,"Supply one absolute workspace directory; additional roots are not supported.");try{let t=await Fp(n);if(!(await Bp(t)).isDirectory())throw new Error;return t}catch{throw C.invalidParams(void 0,"Workspace directory does not exist.")}}i(hr,"workspaceRoot");var yt=class{constructor(e){this.home=e}home;static{i(this,"AcpAccount")}async context(){let e=await Po(this.home,()=>Go(process.env.OPENPOND_ACCOUNT,process.env.OPENPOND_BASE_URL));if(!e.token||!e.account)throw C.authRequired(void 0,"Run openpond acp --login with the same --home/account options, then reconnect.");return e}async scope(){let e=await this.context();return ie({home:this.home,account:e.account.handle,api:e.apiBaseUrl,chat:e.chatApiBaseUrl})}stream=async function*(e){let t=await this.context();yield*Qn({...e,apiBaseUrl:t.chatApiBaseUrl,token:t.token,model:e.model||"openpond-chat"})}.bind(this);async streamForScope(e){let t=await this.context();if(ie({home:this.home,account:t.account.handle,api:t.apiBaseUrl,chat:t.chatApiBaseUrl})!==e)throw C.invalidRequest(void 0,"The session account or model route changed. Reconnect with the original account or start a new session.");return async function*(o){yield*Qn({...o,apiBaseUrl:t.chatApiBaseUrl,token:t.token,model:o.model||"openpond-chat"})}}async models(){let e=await this.context(),t=`${e.chatApiBaseUrl.replace(/\/+$/,"")}/models`,s=await fetch(t,{headers:{Authorization:`Bearer ${e.token}`},signal:AbortSignal.timeout(15e3)});if(!s.ok)throw C.authRequired(void 0,`OpenPond model route is unavailable (HTTP ${s.status}). Check login and account access.`);let o=await s.json(),l=[...new Set((o.data??[]).flatMap(u=>typeof u.id=="string"&&u.id.trim()?[u.id]:[]))];if(!l.length)throw C.invalidRequest(void 0,"OpenPond model route returned no usable models.");return l.map(u=>({id:u,name:u==="openpond-chat"?"OpenPond Chat":u}))}};function hn(n){return!!n._zod}i(hn,"isZ4Schema");function pe(n,e){return hn(n)?Bn(n,e):n.safeParse(e)}i(pe,"safeParse");function zn(n){if(!n)return;let e;if(hn(n)?e=n._zod?.def?.shape:e=n.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}i(zn,"getObjectShape");function gn(n){if(hn(n)){let l=n._zod?.def;if(l){if(l.value!==void 0)return l.value;if(Array.isArray(l.values)&&l.values.length>0)return l.values[0]}}let t=n._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let s=n.value;if(s!==void 0)return s}i(gn,"getLiteralValue");var tt="2025-11-25";var Ui=[tt,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ve="io.modelcontextprotocol/related-task",yn="2.0",K=No(n=>n!==null&&(typeof n=="object"||typeof n=="function")),Gi=T([r(),k().int()]),Fi=r(),o_=B({ttl:k().optional(),pollInterval:k().optional()}),Zp=c({ttl:k().optional()}),Jp=c({taskId:r()}),gr=B({progressToken:Gi.optional(),[ve]:Jp.optional()}),ae=c({_meta:gr.optional()}),wt=ae.extend({task:Zp.optional()}),Bi=i(n=>wt.safeParse(n).success,"isTaskAugmentedRequestParams"),Y=c({method:r(),params:ae.loose().optional()}),le=c({_meta:gr.optional()}),ue=c({method:r(),params:le.loose().optional()}),ee=B({_meta:gr.optional()}),wn=T([r(),k().int()]),Vi=c({jsonrpc:f(yn),id:wn,...Y.shape}).strict(),bt=i(n=>Vi.safeParse(n).success,"isJSONRPCRequest"),Wi=c({jsonrpc:f(yn),...ue.shape}).strict(),Zi=i(n=>Wi.safeParse(n).success,"isJSONRPCNotification"),_r=c({jsonrpc:f(yn),id:wn,result:ee}).strict(),Me=i(n=>_r.safeParse(n).success,"isJSONRPCResultResponse");var I;(function(n){n[n.ConnectionClosed=-32e3]="ConnectionClosed",n[n.RequestTimeout=-32001]="RequestTimeout",n[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError",n[n.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(I||(I={}));var yr=c({jsonrpc:f(yn),id:wn.optional(),error:c({code:k().int(),message:r(),data:p().optional()})}).strict();var Ji=i(n=>yr.safeParse(n).success,"isJSONRPCErrorResponse");var nt=T([Vi,Wi,_r,yr]),i_=T([_r,yr]),Oe=ee.strict(),Qp=le.extend({requestId:wn.optional(),reason:r().optional()}),bn=ue.extend({method:f("notifications/cancelled"),params:Qp}),Kp=c({src:r(),mimeType:r().optional(),sizes:y(r()).optional(),theme:re(["light","dark"]).optional()}),St=c({icons:y(Kp).optional()}),et=c({name:r(),title:r().optional()}),Qi=et.extend({...et.shape,...St.shape,version:r(),websiteUrl:r().optional(),description:r().optional()}),Xp=de(c({applyDefaults:O().optional()}),m(r(),p())),Yp=Wn(n=>n&&typeof n=="object"&&!Array.isArray(n)&&Object.keys(n).length===0?{form:{}}:n,de(c({form:Xp.optional(),url:K.optional()}),m(r(),p()).optional())),em=B({list:K.optional(),cancel:K.optional(),requests:B({sampling:B({createMessage:K.optional()}).optional(),elicitation:B({create:K.optional()}).optional()}).optional()}),tm=B({list:K.optional(),cancel:K.optional(),requests:B({tools:B({call:K.optional()}).optional()}).optional()}),nm=c({experimental:m(r(),K).optional(),sampling:c({context:K.optional(),tools:K.optional()}).optional(),elicitation:Yp.optional(),roots:c({listChanged:O().optional()}).optional(),tasks:em.optional(),extensions:m(r(),K).optional()}),sm=ae.extend({protocolVersion:r(),capabilities:nm,clientInfo:Qi}),rm=Y.extend({method:f("initialize"),params:sm});var om=c({experimental:m(r(),K).optional(),logging:K.optional(),completions:K.optional(),prompts:c({listChanged:O().optional()}).optional(),resources:c({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:c({listChanged:O().optional()}).optional(),tasks:tm.optional(),extensions:m(r(),K).optional()}),wr=ee.extend({protocolVersion:r(),capabilities:om,serverInfo:Qi,instructions:r().optional()}),Ki=ue.extend({method:f("notifications/initialized"),params:le.optional()}),Xi=i(n=>Ki.safeParse(n).success,"isInitializedNotification"),Sn=Y.extend({method:f("ping"),params:ae.optional()}),im=c({progress:k(),total:F(k()),message:F(r())}),am=c({...le.shape,...im.shape,progressToken:Gi}),xn=ue.extend({method:f("notifications/progress"),params:am}),cm=ae.extend({cursor:Fi.optional()}),xt=Y.extend({params:cm.optional()}),Tt=ee.extend({nextCursor:Fi.optional()}),lm=re(["working","input_required","completed","failed","cancelled"]),Et=c({taskId:r(),status:lm,ttl:T([k(),qo()]),createdAt:r(),lastUpdatedAt:r(),pollInterval:F(k()),statusMessage:F(r())}),qe=ee.extend({task:Et}),um=le.merge(Et),vt=ue.extend({method:f("notifications/tasks/status"),params:um}),Tn=Y.extend({method:f("tasks/get"),params:ae.extend({taskId:r()})}),En=ee.merge(Et),vn=Y.extend({method:f("tasks/result"),params:ae.extend({taskId:r()})}),a_=ee.loose(),Rn=xt.extend({method:f("tasks/list")}),kn=Tt.extend({tasks:y(Et)}),Cn=Y.extend({method:f("tasks/cancel"),params:ae.extend({taskId:r()})}),Yi=ee.merge(Et),ea=c({uri:r(),mimeType:F(r()),_meta:m(r(),p()).optional()}),ta=ea.extend({text:r()}),br=r().refine(n=>{try{return atob(n),!0}catch{return!1}},{message:"Invalid Base64 string"}),na=ea.extend({blob:br}),Rt=re(["user","assistant"]),st=c({audience:y(Rt).optional(),priority:k().min(0).max(1).optional(),lastModified:Oo.datetime({offset:!0}).optional()}),sa=c({...et.shape,...St.shape,uri:r(),description:F(r()),mimeType:F(r()),size:F(k()),annotations:st.optional(),_meta:F(B({}))}),dm=c({...et.shape,...St.shape,uriTemplate:r(),description:F(r()),mimeType:F(r()),annotations:st.optional(),_meta:F(B({}))}),pm=xt.extend({method:f("resources/list")}),Sr=Tt.extend({resources:y(sa)}),mm=xt.extend({method:f("resources/templates/list")}),xr=Tt.extend({resourceTemplates:y(dm)}),Tr=ae.extend({uri:r()}),fm=Tr,hm=Y.extend({method:f("resources/read"),params:fm}),Er=ee.extend({contents:y(T([ta,na]))}),vr=ue.extend({method:f("notifications/resources/list_changed"),params:le.optional()}),zm=Tr,gm=Y.extend({method:f("resources/subscribe"),params:zm}),_m=Tr,ym=Y.extend({method:f("resources/unsubscribe"),params:_m}),wm=le.extend({uri:r()}),bm=ue.extend({method:f("notifications/resources/updated"),params:wm}),Sm=c({name:r(),description:F(r()),required:F(O())}),xm=c({...et.shape,...St.shape,description:F(r()),arguments:F(y(Sm)),_meta:F(B({}))}),Tm=xt.extend({method:f("prompts/list")}),Rr=Tt.extend({prompts:y(xm)}),Em=ae.extend({name:r(),arguments:m(r(),r()).optional()}),vm=Y.extend({method:f("prompts/get"),params:Em}),kr=c({type:f("text"),text:r(),annotations:st.optional(),_meta:m(r(),p()).optional()}),Cr=c({type:f("image"),data:br,mimeType:r(),annotations:st.optional(),_meta:m(r(),p()).optional()}),Ar=c({type:f("audio"),data:br,mimeType:r(),annotations:st.optional(),_meta:m(r(),p()).optional()}),Rm=c({type:f("tool_use"),name:r(),id:r(),input:m(r(),p()),_meta:m(r(),p()).optional()}),km=c({type:f("resource"),resource:T([ta,na]),annotations:st.optional(),_meta:m(r(),p()).optional()}),Cm=sa.extend({type:f("resource_link")}),Pr=T([kr,Cr,Ar,Cm,km]),Am=c({role:Rt,content:Pr}),Ir=ee.extend({description:r().optional(),messages:y(Am)}),Mr=ue.extend({method:f("notifications/prompts/list_changed"),params:le.optional()}),Pm=c({title:r().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Im=c({taskSupport:re(["required","optional","forbidden"]).optional()}),ra=c({...et.shape,...St.shape,description:r().optional(),inputSchema:c({type:f("object"),properties:m(r(),K).optional(),required:y(r()).optional()}).catchall(p()),outputSchema:c({type:f("object"),properties:m(r(),K).optional(),required:y(r()).optional()}).catchall(p()).optional(),annotations:Pm.optional(),execution:Im.optional(),_meta:m(r(),p()).optional()}),Mm=xt.extend({method:f("tools/list")}),Or=Tt.extend({tools:y(ra)}),rt=ee.extend({content:y(Pr).default([]),structuredContent:m(r(),p()).optional(),isError:O().optional()}),c_=rt.or(ee.extend({toolResult:p()})),Om=wt.extend({name:r(),arguments:m(r(),p()).optional()}),qm=Y.extend({method:f("tools/call"),params:Om}),qr=ue.extend({method:f("notifications/tools/list_changed"),params:le.optional()}),oa=c({autoRefresh:O().default(!0),debounceMs:k().int().nonnegative().default(300)}),ia=re(["debug","info","notice","warning","error","critical","alert","emergency"]),jm=ae.extend({level:ia}),Nm=Y.extend({method:f("logging/setLevel"),params:jm}),Dm=le.extend({level:ia,logger:r().optional(),data:p()}),Hm=ue.extend({method:f("notifications/message"),params:Dm}),$m=c({name:r().optional()}),Lm=c({hints:y($m).optional(),costPriority:k().min(0).max(1).optional(),speedPriority:k().min(0).max(1).optional(),intelligencePriority:k().min(0).max(1).optional()}),Um=c({mode:re(["auto","required","none"]).optional()}),Gm=c({type:f("tool_result"),toolUseId:r().describe("The unique identifier for the corresponding tool call."),content:y(Pr).default([]),structuredContent:c({}).loose().optional(),isError:O().optional(),_meta:m(r(),p()).optional()}),Fm=Vn("type",[kr,Cr,Ar]),_n=Vn("type",[kr,Cr,Ar,Rm,Gm]),Bm=c({role:Rt,content:T([_n,y(_n)]),_meta:m(r(),p()).optional()}),Vm=wt.extend({messages:y(Bm),modelPreferences:Lm.optional(),systemPrompt:r().optional(),includeContext:re(["none","thisServer","allServers"]).optional(),temperature:k().optional(),maxTokens:k().int(),stopSequences:y(r()).optional(),metadata:K.optional(),tools:y(ra).optional(),toolChoice:Um.optional()}),jr=Y.extend({method:f("sampling/createMessage"),params:Vm}),Nr=ee.extend({model:r(),stopReason:F(re(["endTurn","stopSequence","maxTokens"]).or(r())),role:Rt,content:Fm}),Dr=ee.extend({model:r(),stopReason:F(re(["endTurn","stopSequence","maxTokens","toolUse"]).or(r())),role:Rt,content:T([_n,y(_n)])}),Wm=c({type:f("boolean"),title:r().optional(),description:r().optional(),default:O().optional()}),Zm=c({type:f("string"),title:r().optional(),description:r().optional(),minLength:k().optional(),maxLength:k().optional(),format:re(["email","uri","date","date-time"]).optional(),default:r().optional()}),Jm=c({type:re(["number","integer"]),title:r().optional(),description:r().optional(),minimum:k().optional(),maximum:k().optional(),default:k().optional()}),Qm=c({type:f("string"),title:r().optional(),description:r().optional(),enum:y(r()),default:r().optional()}),Km=c({type:f("string"),title:r().optional(),description:r().optional(),oneOf:y(c({const:r(),title:r()})),default:r().optional()}),Xm=c({type:f("string"),title:r().optional(),description:r().optional(),enum:y(r()),enumNames:y(r()).optional(),default:r().optional()}),Ym=T([Qm,Km]),ef=c({type:f("array"),title:r().optional(),description:r().optional(),minItems:k().optional(),maxItems:k().optional(),items:c({type:f("string"),enum:y(r())}),default:y(r()).optional()}),tf=c({type:f("array"),title:r().optional(),description:r().optional(),minItems:k().optional(),maxItems:k().optional(),items:c({anyOf:y(c({const:r(),title:r()}))}),default:y(r()).optional()}),nf=T([ef,tf]),sf=T([Xm,Ym,nf]),rf=T([sf,Wm,Zm,Jm]),of=wt.extend({mode:f("form").optional(),message:r(),requestedSchema:c({type:f("object"),properties:m(r(),rf),required:y(r()).optional()})}),af=wt.extend({mode:f("url"),message:r(),elicitationId:r(),url:r().url()}),cf=T([of,af]),Hr=Y.extend({method:f("elicitation/create"),params:cf}),lf=le.extend({elicitationId:r()}),uf=ue.extend({method:f("notifications/elicitation/complete"),params:lf}),$r=ee.extend({action:re(["accept","decline","cancel"]),content:Wn(n=>n===null?void 0:n,m(r(),T([r(),k(),O(),y(r())])).optional())}),df=c({type:f("ref/resource"),uri:r()});var pf=c({type:f("ref/prompt"),name:r()}),mf=ae.extend({ref:T([pf,df]),argument:c({name:r(),value:r()}),context:c({arguments:m(r(),r()).optional()}).optional()}),ff=Y.extend({method:f("completion/complete"),params:mf});var Lr=ee.extend({completion:B({values:y(r()).max(100),total:F(k().int()),hasMore:F(O())})}),hf=c({uri:r().startsWith("file://"),name:r().optional(),_meta:m(r(),p()).optional()}),zf=Y.extend({method:f("roots/list"),params:ae.optional()}),gf=ee.extend({roots:y(hf)}),_f=ue.extend({method:f("notifications/roots/list_changed"),params:le.optional()}),l_=T([Sn,rm,ff,Nm,vm,Tm,pm,mm,hm,gm,ym,qm,Mm,Tn,vn,Rn,Cn]),u_=T([bn,xn,Ki,_f,vt]),d_=T([Oe,Nr,Dr,$r,gf,En,kn,qe]),p_=T([Sn,jr,Hr,zf,Tn,vn,Rn,Cn]),m_=T([bn,xn,Hm,bm,vr,qr,Mr,vt,uf]),f_=T([Oe,wr,Lr,Ir,Rr,Sr,xr,Er,rt,Or,En,kn,qe]),P=class n extends Error{static{i(this,"McpError")}constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}static fromError(e,t,s){if(e===I.UrlElicitationRequired&&s){let o=s;if(o.elicitations)return new zr(o.elicitations,t)}return new n(e,t,s)}},zr=class extends P{static{i(this,"UrlElicitationRequiredError")}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(I.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function Re(n){return n==="completed"||n==="failed"||n==="cancelled"}i(Re,"isTerminal");var dy=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ur(n){let t=zn(n)?.method;if(!t)throw new Error("Schema is missing a method literal");let s=gn(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}i(Ur,"getMethodLiteral");function Gr(n,e){let t=pe(n,e);if(!t.success)throw t.error;return t.data}i(Gr,"parseWithCompat");var Tf=6e4,An=class{static{i(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(bn,t=>{this._oncancel(t)}),this.setNotificationHandler(xn,t=>{this._onprogress(t)}),this.setRequestHandler(Sn,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Tn,async(t,s)=>{let o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new P(I.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(vn,async(t,s)=>{let o=i(async()=>{let l=t.params.taskId;if(!await this._taskStore.getTask(l,s.sessionId))throw new P(I.InvalidParams,`Task not found: ${l}`);if(this._taskMessageQueue){let d;for(;d=await this._taskMessageQueue.dequeue(l,s.sessionId);){if(d.type==="response"||d.type==="error"){let h=d.message,z=h.id,g=this._requestResolvers.get(z);if(g)if(this._requestResolvers.delete(z),d.type==="response")g(h);else{let _=h,w=new P(_.error.code,_.error.message,_.error.data);g(w)}else{let _=d.type==="response"?"Response":"Error";this._onerror(new Error(`${_} handler missing for request ${z}`))}continue}await this._transport?.send(d.message,{relatedRequestId:s.requestId})}}let u=await this._taskStore.getTask(l,s.sessionId);if(!u)throw new P(I.InvalidParams,`Task not found: ${l}`);if(!Re(u.status))return await this._waitForTaskUpdate(l,s.signal,s.sessionId),await o();if(Re(u.status)){let d=await this._taskStore.getTaskResult(l,s.sessionId);return this._clearTaskQueue(l,s.sessionId),{...d,_meta:{...d._meta,[ve]:{taskId:l}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Rn,async(t,s)=>{try{let{tasks:o,nextCursor:l}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:o,nextCursor:l,_meta:{}}}catch(o){throw new P(I.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Cn,async(t,s)=>{try{let o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new P(I.InvalidParams,`Task not found: ${t.params.taskId}`);if(Re(o.status))throw new P(I.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId,s.sessionId);let l=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!l)throw new P(I.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...l}}catch(o){throw o instanceof P?o:new P(I.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,o,l=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:l,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),P.fromError(I.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let s=this.transport?.onerror;this._transport.onerror=l=>{s?.(l),this._onerror(l)};let o=this._transport?.onmessage;this._transport.onmessage=(l,u)=>{o?.(l,u),Me(l)||Ji(l)?this._onresponse(l):bt(l)?this._onrequest(l,u):Zi(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(let s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();let t=P.fromError(I.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){let s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,l=e.params?._meta?.[ve]?.taskId,u=o?.sessionId,d=this._taskStore,h=!0,z;if(l&&d&&this._taskMessageQueue&&u!==void 0&&(h=!1,z=(async()=>{if(!await d.getTask(l,u))throw new P(I.InvalidParams,`Task not found: ${l}`);h=!0})()),s===void 0){let E={jsonrpc:"2.0",id:e.id,error:{code:I.MethodNotFound,message:"Method not found"}};if(l&&z){let x={type:"error",message:E,timestamp:Date.now()};z.then(()=>this._enqueueTaskMessage(l,x,u),()=>o?.send(E)).catch(A=>this._onerror(new Error(`Failed to send an error response: ${A}`)))}else l&&this._taskMessageQueue?this._enqueueTaskMessage(l,{type:"error",message:E,timestamp:Date.now()},o?.sessionId).catch(x=>this._onerror(new Error(`Failed to enqueue error response: ${x}`))):o?.send(E).catch(x=>this._onerror(new Error(`Failed to send an error response: ${x}`)));return}let g=new AbortController;this._requestHandlerAbortControllers.set(e.id,g);let _=Bi(e.params)?e.params.task:void 0,w=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,b={signal:g.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:i(async E=>{if(g.signal.aborted)return;let x={relatedRequestId:e.id};l&&(x.relatedTask={taskId:l}),await this.notification(E,x)},"sendNotification"),sendRequest:i(async(E,x,A)=>{if(g.signal.aborted)throw new P(I.ConnectionClosed,"Request was cancelled");let q={...A,relatedRequestId:e.id};l&&!q.relatedTask&&(q.relatedTask={taskId:l});let M=q.relatedTask?.taskId??l;return M&&w&&await w.updateTaskStatus(M,"input_required"),await this.request(E,x,q)},"sendRequest"),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:l,taskStore:w,taskRequestedTtl:_?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};(z??Promise.resolve()).then(()=>{if(z&&g.signal.aborted)throw new P(I.ConnectionClosed,"Request was cancelled");_&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,b)).then(async E=>{if(g.signal.aborted)return;let x={result:E,jsonrpc:"2.0",id:e.id};l&&this._taskMessageQueue?await this._enqueueTaskMessage(l,{type:"response",message:x,timestamp:Date.now()},o?.sessionId):await o?.send(x)},async E=>{if(g.signal.aborted)return;let x={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(E.code)?E.code:I.InternalError,message:E.message??"Internal error",...E.data!==void 0&&{data:E.data}}};l&&this._taskMessageQueue&&h?await this._enqueueTaskMessage(l,{type:"error",message:x,timestamp:Date.now()},o?.sessionId):await o?.send(x)}).catch(E=>this._onerror(new Error(`Failed to send response: ${E}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===g&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...s}=e.params,o=Number(t),l=this._progressHandlers.get(o);if(!l){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let u=this._responseHandlers.get(o),d=this._timeoutInfo.get(o);if(d&&u&&d.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(h){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),u(h);return}l(s)}_onresponse(e){let t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),Me(e))s(e);else{let u=new P(e.error.code,e.error.message,e.error.data);s(u)}return}let o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let l=!1;if(Me(e)&&e.result&&typeof e.result=="object"){let u=e.result;if(u.task&&typeof u.task=="object"){let d=u.task;typeof d.taskId=="string"&&(l=!0,this._taskProgressTokens.set(d.taskId,t))}}if(l||this._progressHandlers.delete(t),Me(e))o(e);else{let u=P.fromError(e.error.code,e.error.message,e.error.data);o(u)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){let{task:o}=s??{};if(!o){try{yield{type:"result",result:await this.request(e,t,s)}}catch(u){yield{type:"error",error:u instanceof P?u:new P(I.InternalError,String(u))}}return}let l;try{let u=await this.request(e,qe,s);if(u.task)l=u.task.taskId,yield{type:"taskCreated",task:u.task};else throw new P(I.InternalError,"Task creation did not return a task");for(;;){let d=await this.getTask({taskId:l},s);if(yield{type:"taskStatus",task:d},Re(d.status)){d.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:l},t,s)}:d.status==="failed"?yield{type:"error",error:new P(I.InternalError,`Task ${l} failed`)}:d.status==="cancelled"&&(yield{type:"error",error:new P(I.InternalError,`Task ${l} was cancelled`)});return}if(d.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:l},t,s)};return}let h=d.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(z=>setTimeout(z,h)),s?.signal?.throwIfAborted()}}catch(u){yield{type:"error",error:u instanceof P?u:new P(I.InternalError,String(u))}}}request(e,t,s){let{relatedRequestId:o,resumptionToken:l,onresumptiontoken:u,task:d,relatedTask:h}=s??{};return new Promise((z,g)=>{let _=i(M=>{g(M)},"earlyReject");if(!this._transport){_(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),d&&this.assertTaskCapability(e.method)}catch(M){_(M);return}s?.signal?.throwIfAborted();let w=this._requestMessageId++,b={...e,jsonrpc:"2.0",id:w};s?.onprogress&&(this._progressHandlers.set(w,s.onprogress),b.params={...e.params,_meta:{...e.params?._meta||{},progressToken:w}}),d&&(b.params={...b.params,task:d}),h&&(b.params={...b.params,_meta:{...b.params?._meta||{},[ve]:h}});let E=i(M=>{this._responseHandlers.delete(w),this._progressHandlers.delete(w),this._cleanupTimeout(w),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:w,reason:String(M)}},{relatedRequestId:o,resumptionToken:l,onresumptiontoken:u}).catch(be=>this._onerror(new Error(`Failed to send cancellation: ${be}`)));let W=M instanceof P?M:new P(I.RequestTimeout,String(M));g(W)},"cancel");this._responseHandlers.set(w,M=>{if(!s?.signal?.aborted){if(M instanceof Error)return g(M);try{let W=pe(t,M.result);W.success?z(W.data):g(W.error)}catch(W){g(W)}}}),s?.signal?.addEventListener("abort",()=>{E(s?.signal?.reason)});let x=s?.timeout??Tf,A=i(()=>E(P.fromError(I.RequestTimeout,"Request timed out",{timeout:x})),"timeoutHandler");this._setupTimeout(w,x,s?.maxTotalTimeout,A,s?.resetTimeoutOnProgress??!1);let q=h?.taskId;if(q){let M=i(W=>{let be=this._responseHandlers.get(w);be?be(W):this._onerror(new Error(`Response handler missing for side-channeled request ${w}`))},"responseResolver");this._requestResolvers.set(w,M),this._enqueueTaskMessage(q,{type:"request",message:b,timestamp:Date.now()}).catch(W=>{this._cleanupTimeout(w),g(W)})}else this._transport.send(b,{relatedRequestId:o,resumptionToken:l,onresumptiontoken:u}).catch(M=>{this._cleanupTimeout(w),g(M)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},En,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},kn,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Yi,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let s=t?.relatedTask?.taskId;if(s){let d={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ve]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:d,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let d={...e,jsonrpc:"2.0"};t?.relatedTask&&(d={...d,params:{...d.params,_meta:{...d.params?._meta||{},[ve]:t.relatedTask}}}),this._transport?.send(d,t).catch(h=>this._onerror(h))});return}let u={...e,jsonrpc:"2.0"};t?.relatedTask&&(u={...u,params:{...u.params,_meta:{...u.params?._meta||{},[ve]:t.relatedTask}}}),await this._transport.send(u,t)}setRequestHandler(e,t){let s=Ur(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(o,l)=>{let u=Gr(e,o);return Promise.resolve(t(u,l))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let s=Ur(e);this._notificationHandlers.set(s,o=>{let l=Gr(e,o);return Promise.resolve(t(l))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s??this._transport?.sessionId,o)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let s=await this._taskMessageQueue.dequeueAll(e,t);for(let o of s)if(o.type==="request"&&bt(o.message)){let l=o.message.id,u=this._requestResolvers.get(l);u?(u(new P(I.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(l)):this._onerror(new Error(`Resolver missing for request ${l} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t,s){let o=this._options?.defaultTaskPollInterval??1e3;try{let l=await this._taskStore?.getTask(e,s);l?.pollInterval&&(o=l.pollInterval)}catch{}return new Promise((l,u)=>{if(t.aborted){u(new P(I.InvalidRequest,"Request cancelled"));return}let d=setTimeout(l,o);t.addEventListener("abort",()=>{clearTimeout(d),u(new P(I.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:i(async o=>{if(!e)throw new Error("No request provided");return await s.createTask(o,e.id,{method:e.method,params:e.params},t)},"createTask"),getTask:i(async o=>{let l=await s.getTask(o,t);if(!l)throw new P(I.InvalidParams,"Failed to retrieve task: Task not found");return l},"getTask"),storeTaskResult:i(async(o,l,u)=>{await s.storeTaskResult(o,l,u,t);let d=await s.getTask(o,t);if(d){let h=vt.parse({method:"notifications/tasks/status",params:d});await this.notification(h),Re(d.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:i(o=>s.getTaskResult(o,t),"getTaskResult"),updateTaskStatus:i(async(o,l,u)=>{let d=await s.getTask(o,t);if(!d)throw new P(I.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Re(d.status))throw new P(I.InvalidParams,`Cannot update task "${o}" from terminal status "${d.status}" to "${l}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(o,l,u,t);let h=await s.getTask(o,t);if(h){let z=vt.parse({method:"notifications/tasks/status",params:h});await this.notification(z),Re(h.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:i(o=>s.listTasks(o,t),"listTasks")}}};function aa(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}i(aa,"isPlainObject");function ca(n,e){let t={...n};for(let s in e){let o=s,l=e[o];if(l===void 0)continue;let u=t[o];aa(u)&&aa(l)?t[o]={...u,...l}:t[o]=l}return t}i(ca,"mergeCapabilities");var va=Wt(Vr(),1),Ra=Wt(Ea(),1);function nh(){let n=new va.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Ra.default)(n),n}i(nh,"createDefaultAjvInstance");var Mn=class{static{i(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??nh()}getValidator(e){let t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}};var On=class{static{i(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,t=rt,s){let o=this._client,l={...s,task:s?.task??(o.isToolTask(e.name)?{}:void 0)},u=o.requestStream({method:"tools/call",params:e},t,l),d=o.getToolOutputValidator(e.name);for await(let h of u){if(h.type==="result"&&d){let z=h.result;if(!z.structuredContent&&!z.isError){yield{type:"error",error:new P(I.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(z.structuredContent)try{let g=d(z.structuredContent);if(!g.valid){yield{type:"error",error:new P(I.InvalidParams,`Structured content does not match the tool's output schema: ${g.errorMessage}`)};return}}catch(g){if(g instanceof P){yield{type:"error",error:g};return}yield{type:"error",error:new P(I.InvalidParams,`Failed to validate structured content: ${g instanceof Error?g.message:String(g)}`)};return}}yield h}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}};function ka(n,e,t){if(!n)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!n.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break;default:break}}i(ka,"assertToolsCallTaskCapability");function Ca(n,e,t){if(!n)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!n.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!n.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}i(Ca,"assertClientRequestTaskCapability");function qn(n,e){if(!(!n||e===null||typeof e!="object")){if(n.type==="object"&&n.properties&&typeof n.properties=="object"){let t=e,s=n.properties;for(let o of Object.keys(s)){let l=s[o];t[o]===void 0&&Object.prototype.hasOwnProperty.call(l,"default")&&(t[o]=l.default),t[o]!==void 0&&qn(l,t[o])}}if(Array.isArray(n.anyOf))for(let t of n.anyOf)typeof t!="boolean"&&qn(t,e);if(Array.isArray(n.oneOf))for(let t of n.oneOf)typeof t!="boolean"&&qn(t,e)}}i(qn,"applyElicitationDefaults");function sh(n){if(!n)return{supportsFormMode:!1,supportsUrlMode:!1};let e=n.form!==void 0,t=n.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}i(sh,"getSupportedElicitationModes");var jn=class extends An{static{i(this,"Client")}constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Mn,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",qr,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Mr,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",vr,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new On(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ca(this._capabilities,e)}setRequestHandler(e,t){let o=zn(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let l=gn(o);if(typeof l!="string")throw new Error("Schema method literal must be a string");let u=l;if(u==="elicitation/create"){let d=i(async(h,z)=>{let g=pe(Hr,h);if(!g.success){let M=g.error instanceof Error?g.error.message:String(g.error);throw new P(I.InvalidParams,`Invalid elicitation request: ${M}`)}let{params:_}=g.data;_.mode=_.mode??"form";let{supportsFormMode:w,supportsUrlMode:b}=sh(this._capabilities.elicitation);if(_.mode==="form"&&!w)throw new P(I.InvalidParams,"Client does not support form-mode elicitation requests");if(_.mode==="url"&&!b)throw new P(I.InvalidParams,"Client does not support URL-mode elicitation requests");let E=await Promise.resolve(t(h,z));if(_.task){let M=pe(qe,E);if(!M.success){let W=M.error instanceof Error?M.error.message:String(M.error);throw new P(I.InvalidParams,`Invalid task creation result: ${W}`)}return M.data}let x=pe($r,E);if(!x.success){let M=x.error instanceof Error?x.error.message:String(x.error);throw new P(I.InvalidParams,`Invalid elicitation result: ${M}`)}let A=x.data,q=_.mode==="form"?_.requestedSchema:void 0;if(_.mode==="form"&&A.action==="accept"&&A.content&&q&&this._capabilities.elicitation?.form?.applyDefaults)try{qn(q,A.content)}catch{}return A},"wrappedHandler");return super.setRequestHandler(e,d)}if(u==="sampling/createMessage"){let d=i(async(h,z)=>{let g=pe(jr,h);if(!g.success){let A=g.error instanceof Error?g.error.message:String(g.error);throw new P(I.InvalidParams,`Invalid sampling request: ${A}`)}let{params:_}=g.data,w=await Promise.resolve(t(h,z));if(_.task){let A=pe(qe,w);if(!A.success){let q=A.error instanceof Error?A.error.message:String(A.error);throw new P(I.InvalidParams,`Invalid task creation result: ${q}`)}return A.data}let E=_.tools||_.toolChoice?Dr:Nr,x=pe(E,w);if(!x.success){let A=x.error instanceof Error?x.error.message:String(x.error);throw new P(I.InvalidParams,`Invalid sampling result: ${A}`)}return x.data},"wrappedHandler");return super.setRequestHandler(e,d)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{let s=await this.request({method:"initialize",params:{protocolVersion:tt,capabilities:this._capabilities,clientInfo:this._clientInfo}},wr,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Ui.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){ka(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&Ca(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},Oe,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Lr,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},Oe,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ir,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Rr,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Sr,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xr,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Er,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},Oe,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},Oe,t)}async callTool(e,t=rt,s){if(this.isToolTaskRequired(e.name))throw new P(I.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},t,s),l=this.getToolOutputValidator(e.name);if(l){if(!o.structuredContent&&!o.isError)throw new P(I.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let u=l(o.structuredContent);if(!u.valid)throw new P(I.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)}catch(u){throw u instanceof P?u:new P(I.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let t of e){if(t.outputSchema){let o=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,o)}let s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let s=await this.request({method:"tools/list",params:e},Or,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,o){let l=oa.safeParse(s);if(!l.success)throw new Error(`Invalid ${e} listChanged options: ${l.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:u,debounceMs:d}=l.data,{onChanged:h}=s,z=i(async()=>{if(!u){h(null,null);return}try{let _=await o();h(null,_)}catch(_){let w=_ instanceof Error?_:new Error(String(_));h(w,null)}},"refresh"),g=i(()=>{if(d){let _=this._listChangedDebounceTimers.get(e);_&&clearTimeout(_);let w=setTimeout(z,d);this._listChangedDebounceTimers.set(e,w)}else z()},"handler");this.setNotificationHandler(t,g)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var yc=Wt(gc(),1);import lo from"node:process";import{PassThrough as Ih}from"node:stream";var Ah=10*1024*1024,Dn=class{static{i(this,"ReadBuffer")}constructor(e){this._maxBufferSize=e?.maxBufferSize??Ah}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
4
4
|
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Ph(t)}clear(){this._buffer=void 0}};function Ph(n){return nt.parse(JSON.parse(n))}i(Ph,"deserializeMessage");function _c(n){return JSON.stringify(n)+`
|
|
5
5
|
`}i(_c,"serializeMessage");var Mh=lo.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function uo(){let n={};for(let e of Mh){let t=lo.env[e];t!==void 0&&(t.startsWith("()")||(n[e]=t))}return n}i(uo,"getDefaultEnvironment");var Hn=class{static{i(this,"StdioClientTransport")}constructor(e){this._stderrStream=null,this._serverParams=e,this._readBuffer=new Dn({maxBufferSize:e.maxBufferSize}),(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new Ih)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._process=(0,yc.default)(this._serverParams.command,this._serverParams.args??[],{env:{...uo(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:lo.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",s=>{t(s),this.onerror?.(s)}),this._process.on("spawn",()=>{e()}),this._process.on("close",s=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",s=>{this.onerror?.(s)}),this._process.stdout?.on("data",s=>{try{this._readBuffer.append(s),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}}),this._process.stdout?.on("error",s=>{this.onerror?.(s)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(s=>{e.once("close",()=>{s()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(s=>setTimeout(s,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([t,new Promise(s=>setTimeout(s,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw new Error("Not connected");let s=_c(e);this._process.stdin.write(s)?t():this._process.stdin.once("drain",t)})}};var Tc=Wt(xc(),1);function Ec(n){if(n)try{return Tc.default.parse(n).type}catch{let e=(n.split(";",1)[0]??"").trim().toLowerCase();return e===""||n.slice(e.length).includes(",")?void 0:e}}i(Ec,"mediaTypeEssence");function $n(n){return n?n instanceof Headers?Object.fromEntries(n.entries()):Array.isArray(n)?Object.fromEntries(n):{...n}:{}}i($n,"normalizeHeaders");function vc(n=fetch,e){return e?async(t,s)=>{let o={...e,...s,headers:s?.headers?{...$n(e.headers),...$n(s.headers)}:e.headers};return n(t,o)}:n}i(vc,"createFetchWithInit");var Uh=5,Gh=[301,302,303,307,308];function Fh(n,e){return n.protocol===e.protocol&&n.hostname===e.hostname&&n.port===e.port?!0:n.hostname===e.hostname&&n.protocol==="http:"&&n.port===""&&e.protocol==="https:"&&e.port===""}i(Fh,"isWithinOrigin");function Rc(n,e){let t=Gh.includes(n.status)?n.headers.get("location"):null;try{return t?new URL(t,e):void 0}catch{return}}i(Rc,"redirectTarget");function Ln(n,e,t,s,o=0){let l=Rc(s,e),u=s.status===307||s.status===308||(t?.method??"GET").toUpperCase()==="GET";if(!l||o===Uh||!u)return;let d=new URL(e);if(!((l.username||l.password)&&(l.username!==d.username||l.password!==d.password)||!Fh(d,l)))return Promise.resolve(s.body?.cancel()).then(()=>n(l,{...t,redirect:"manual"})).then(z=>Ln(n,l,t,z,o+1)??z)}i(Ln,"followWithinOrigin");var kc=new WeakSet;function mo(n){let e=i((t,s)=>(n??fetch)(t,s),"following");return kc.add(e),e}i(mo,"fetchLeavingRedirects");function je(n=fetch){return kc.has(n)?n:(e,t)=>t?.redirect==="error"||t?.redirect==="manual"?n(e,t):Promise.resolve(n(e,{...t,redirect:"manual"})).then(s=>Ln(n,e,t,s)??s)}i(je,"fetchWithinOrigin");function Un(n,e){if(n.type==="opaqueredirect")return"Redirect not followed: this runtime does not expose the redirect target";let t=n.url||e,s=Rc(n,t);if(s)return s.username=s.password=s.search=s.hash="",s.protocol==="http:"&&new URL(t).protocol==="https:"?(s.protocol="https:",`Redirect to plain http not followed; try ${s.href} instead`):`Redirect to ${s.href} not followed`}i(Un,"unfollowedRedirect");var fo;fo=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(n=>n.webcrypto);async function Bh(n){return(await fo).getRandomValues(new Uint8Array(n))}i(Bh,"getRandomValues");async function Vh(n){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",t=Math.pow(2,8)-Math.pow(2,8)%e.length,s="";for(;s.length<n;){let o=await Bh(n-s.length);for(let l of o)l<t&&(s+=e[l%e.length])}return s}i(Vh,"random");async function Wh(n){return await Vh(n)}i(Wh,"generateVerifier");async function Zh(n){let e=await(await fo).subtle.digest("SHA-256",new TextEncoder().encode(n));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}i(Zh,"generateChallenge");async function ho(n){if(n||(n=43),n<43||n>128)throw`Expected a length between 43 and 128. Received ${n}.`;let e=await Wh(n),t=await Zh(e);return{code_verifier:e,code_challenge:t}}i(ho,"pkceChallenge");var ne=Zt().superRefine((n,e)=>{if(!URL.canParse(n))return e.addIssue({code:Do.custom,message:"URL must be parseable",fatal:!0}),Mo}).refine(n=>{let e=new URL(n);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Ac=B({resource:r().url(),authorization_servers:y(ne).optional(),jwks_uri:r().url().optional(),scopes_supported:y(r()).optional(),bearer_methods_supported:y(r()).optional(),resource_signing_alg_values_supported:y(r()).optional(),resource_name:r().optional(),resource_documentation:r().optional(),resource_policy_uri:r().url().optional(),resource_tos_uri:r().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:y(r()).optional(),dpop_signing_alg_values_supported:y(r()).optional(),dpop_bound_access_tokens_required:O().optional()}),zo=B({issuer:r(),authorization_endpoint:ne,token_endpoint:ne,registration_endpoint:ne.optional(),scopes_supported:y(r()).optional(),response_types_supported:y(r()),response_modes_supported:y(r()).optional(),grant_types_supported:y(r()).optional(),token_endpoint_auth_methods_supported:y(r()).optional(),token_endpoint_auth_signing_alg_values_supported:y(r()).optional(),service_documentation:ne.optional(),revocation_endpoint:ne.optional(),revocation_endpoint_auth_methods_supported:y(r()).optional(),revocation_endpoint_auth_signing_alg_values_supported:y(r()).optional(),introspection_endpoint:r().optional(),introspection_endpoint_auth_methods_supported:y(r()).optional(),introspection_endpoint_auth_signing_alg_values_supported:y(r()).optional(),code_challenge_methods_supported:y(r()).optional(),client_id_metadata_document_supported:O().optional()}),Jh=B({issuer:r(),authorization_endpoint:ne,token_endpoint:ne,userinfo_endpoint:ne.optional(),jwks_uri:ne,registration_endpoint:ne.optional(),scopes_supported:y(r()).optional(),response_types_supported:y(r()),response_modes_supported:y(r()).optional(),grant_types_supported:y(r()).optional(),acr_values_supported:y(r()).optional(),subject_types_supported:y(r()),id_token_signing_alg_values_supported:y(r()),id_token_encryption_alg_values_supported:y(r()).optional(),id_token_encryption_enc_values_supported:y(r()).optional(),userinfo_signing_alg_values_supported:y(r()).optional(),userinfo_encryption_alg_values_supported:y(r()).optional(),userinfo_encryption_enc_values_supported:y(r()).optional(),request_object_signing_alg_values_supported:y(r()).optional(),request_object_encryption_alg_values_supported:y(r()).optional(),request_object_encryption_enc_values_supported:y(r()).optional(),token_endpoint_auth_methods_supported:y(r()).optional(),token_endpoint_auth_signing_alg_values_supported:y(r()).optional(),display_values_supported:y(r()).optional(),claim_types_supported:y(r()).optional(),claims_supported:y(r()).optional(),service_documentation:r().optional(),claims_locales_supported:y(r()).optional(),ui_locales_supported:y(r()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:ne.optional(),op_tos_uri:ne.optional(),client_id_metadata_document_supported:O().optional()}),Pc=c({...Jh.shape,...zo.pick({code_challenge_methods_supported:!0}).shape}),Ic=c({access_token:r(),id_token:r().optional(),token_type:r(),expires_in:Ho.number().optional(),scope:r().optional(),refresh_token:r().optional(),issuer:r().optional().catch(void 0)}).strip(),Mc=c({error:r(),error_description:r().optional(),error_uri:r().optional()}),Cc=ne.optional().or(f("").transform(()=>{})),Qh=c({redirect_uris:y(ne),token_endpoint_auth_method:r().optional(),grant_types:y(r()).optional(),response_types:y(r()).optional(),client_name:r().optional(),client_uri:ne.optional(),logo_uri:Cc,scope:r().optional(),contacts:y(r()).optional(),tos_uri:Cc,policy_uri:r().optional(),jwks_uri:ne.optional(),jwks:jo().optional(),software_id:r().optional(),software_version:r().optional(),software_statement:r().optional()}).strip(),Kh=c({client_id:r(),client_secret:r().optional(),client_id_issued_at:k().optional(),client_secret_expires_at:k().optional(),issuer:r().optional().catch(void 0)}).strip(),Oc=Qh.merge(Kh),Gx=c({error:r(),error_description:r().optional()}).strip(),Fx=c({token:r(),token_type_hint:r().optional()}).strip();function qc(n){let e=typeof n=="string"?new URL(n):new URL(n.href);return e.hash="",e}i(qc,"resourceUrlFromServerUrl");function jc({requestedResource:n,configuredResource:e}){let t=typeof n=="string"?new URL(n):new URL(n.href),s=typeof e=="string"?new URL(e):new URL(e.href);if(t.origin!==s.origin||t.pathname.length<s.pathname.length)return!1;let o=t.pathname.endsWith("/")?t.pathname:t.pathname+"/",l=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return o.startsWith(l)}i(jc,"checkResourceAllowed");var V=class extends Error{static{i(this,"OAuthError")}constructor(e,t){super(e),this.errorUri=t,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}},At=class extends V{static{i(this,"InvalidRequestError")}};At.errorCode="invalid_request";var Ne=class extends V{static{i(this,"InvalidClientError")}};Ne.errorCode="invalid_client";var De=class extends V{static{i(this,"InvalidGrantError")}};De.errorCode="invalid_grant";var He=class extends V{static{i(this,"UnauthorizedClientError")}};He.errorCode="unauthorized_client";var Pt=class extends V{static{i(this,"UnsupportedGrantTypeError")}};Pt.errorCode="unsupported_grant_type";var It=class extends V{static{i(this,"InvalidScopeError")}};It.errorCode="invalid_scope";var Mt=class extends V{static{i(this,"AccessDeniedError")}};Mt.errorCode="access_denied";var ye=class extends V{static{i(this,"ServerError")}};ye.errorCode="server_error";var Ot=class extends V{static{i(this,"TemporarilyUnavailableError")}};Ot.errorCode="temporarily_unavailable";var qt=class extends V{static{i(this,"UnsupportedResponseTypeError")}};qt.errorCode="unsupported_response_type";var jt=class extends V{static{i(this,"UnsupportedTokenTypeError")}};jt.errorCode="unsupported_token_type";var Nt=class extends V{static{i(this,"InvalidTokenError")}};Nt.errorCode="invalid_token";var Dt=class extends V{static{i(this,"MethodNotAllowedError")}};Dt.errorCode="method_not_allowed";var Ht=class extends V{static{i(this,"TooManyRequestsError")}};Ht.errorCode="too_many_requests";var $e=class extends V{static{i(this,"InvalidClientMetadataError")}};$e.errorCode="invalid_client_metadata";var $t=class extends V{static{i(this,"InsufficientScopeError")}};$t.errorCode="insufficient_scope";var Lt=class extends V{static{i(this,"InvalidTargetError")}};Lt.errorCode="invalid_target";var Nc={[At.errorCode]:At,[Ne.errorCode]:Ne,[De.errorCode]:De,[He.errorCode]:He,[Pt.errorCode]:Pt,[It.errorCode]:It,[Mt.errorCode]:Mt,[ye.errorCode]:ye,[Ot.errorCode]:Ot,[qt.errorCode]:qt,[jt.errorCode]:jt,[Nt.errorCode]:Nt,[Dt.errorCode]:Dt,[Ht.errorCode]:Ht,[$e.errorCode]:$e,[$t.errorCode]:$t,[Lt.errorCode]:Lt};var we=class extends Error{static{i(this,"UnauthorizedError")}constructor(e){super(e??"Unauthorized")}};function Xh(n){return["client_secret_basic","client_secret_post","none"].includes(n)}i(Xh,"isClientAuthMethod");var go="code",_o="S256";function Yh(n,e){let t=n.client_secret!==void 0;return"token_endpoint_auth_method"in n&&n.token_endpoint_auth_method&&Xh(n.token_endpoint_auth_method)&&(e.length===0||e.includes(n.token_endpoint_auth_method))?n.token_endpoint_auth_method:e.length===0?t?"client_secret_basic":"none":t&&e.includes("client_secret_basic")?"client_secret_basic":t&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":t?"client_secret_post":"none"}i(Yh,"selectClientAuthMethod");function ez(n,e,t,s){let{client_id:o,client_secret:l}=e;switch(n){case"client_secret_basic":tz(o,l,t);return;case"client_secret_post":nz(o,l,s);return;case"none":sz(o,s);return;default:throw new Error(`Unsupported client authentication method: ${n}`)}}i(ez,"applyClientAuthentication");function tz(n,e,t){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");let s=btoa(`${n}:${e}`);t.set("Authorization",`Basic ${s}`)}i(tz,"applyBasicAuth");function nz(n,e,t){t.set("client_id",n),e&&t.set("client_secret",e)}i(nz,"applyPostAuth");function sz(n,e){e.set("client_id",n)}i(sz,"applyPublicAuth");async function Hc(n){let e=n instanceof Response?n.status:void 0,t=n instanceof Response?await n.text():n;try{let s=Mc.parse(JSON.parse(t)),{error:o,error_description:l,error_uri:u}=s,d=Nc[o]||ye;return new d(l||"",u)}catch(s){let o=n instanceof Response?Un(n,n.url):void 0,l=`${e?`HTTP ${e}: `:""}${o??`Invalid OAuth error response: ${s}. Raw body: ${t}`}`;return new ye(l)}}i(Hc,"parseErrorResponse");function rz(n,e){let[t,s]=[n,e];try{[t,s]=[new URL(n).href,new URL(e).href]}catch{}return t===s||t.endsWith("/")&&t.slice(0,-1)===s||s.endsWith("/")&&s.slice(0,-1)===t}i(rz,"issuersMatch");function bo(n,e){if(n)return typeof n.issuer!="string"?n.issuer==null?n:{...n,issuer:void 0}:rz(n.issuer,e)?n:void 0}i(bo,"discardIfIssuerMismatch");var oz=Ic.omit({issuer:!0}),iz=Oc.omit({issuer:!0});function $c(n,e){return new Error(`OAuth client information is bound to authorization server ${n.issuer} and is not presented to ${e}. Clear the stored client information, or correct \`expectedIssuer\`, if the authorization server has moved.`)}i($c,"boundElsewhereError");async function Ut(n,e){try{return await yo(n,e)}catch(t){if(t instanceof Ne||t instanceof He)return await n.invalidateCredentials?.("all"),await yo(n,e);if(t instanceof De)return await n.invalidateCredentials?.("tokens"),await yo(n,e);throw t}}i(Ut,"auth");async function yo(n,{serverUrl:e,authorizationCode:t,scope:s,resourceMetadataUrl:o,fetchFn:l}){let u=await n.discoveryState?.(),d,h,z,g=o;if(!g&&u?.resourceMetadataUrl&&(g=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(h=u.authorizationServerUrl,d=u.resourceMetadata,z=u.authorizationServerMetadata??await Uc(h,{fetchFn:l}),!d)try{d=await Lc(e,{resourceMetadataUrl:g},l)}catch{}(z!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await n.saveDiscoveryState?.({authorizationServerUrl:String(h),resourceMetadataUrl:g?.toString(),resourceMetadata:d,authorizationServerMetadata:z})}else{let $=await mz(e,{resourceMetadataUrl:g,fetchFn:l});h=$.authorizationServerUrl,z=$.authorizationServerMetadata,d=$.resourceMetadata,await n.saveDiscoveryState?.({authorizationServerUrl:String(h),resourceMetadataUrl:g?.toString(),resourceMetadata:d,authorizationServerMetadata:z})}let _=String(h),w=await cz(e,n,d),b=w&&d&&!n.validateResourceURL?d.resource:w,E=s||d?.scopes_supported?.join(" ")||n.clientMetadata.scope,x=await Promise.resolve(n.clientInformation()),A=bo(x,_),q=n.saveClientInformation!==void 0&&!!n.redirectUrl;if(x&&!A&&!q)throw $c(x,_);let M=A?.issuer==null?A:void 0,W=i(async()=>{try{M&&await n.saveClientInformation?.({...M,issuer:_})}catch{}},"bindClientInformation");if(!A){if(t!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let $=z?.client_id_metadata_document_supported===!0,se=n.clientMetadataUrl;if(se&&!az(se))throw new $e(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${se}`);if($&&se)A={client_id:se,issuer:_},await n.saveClientInformation?.(A);else{if(!n.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");A={...await _z(h,{metadata:z,clientMetadata:n.clientMetadata,scope:E,fetchFn:l}),issuer:_},await n.saveClientInformation(A)}}let be=!n.redirectUrl;if(t!==void 0||be){let $=await gz(n,h,{metadata:z,resource:b,authorizationCode:t,fetchFn:l});return await W(),await n.saveTokens({...$,issuer:_}),"AUTHORIZED"}let R=bo(await n.tokens(),_);if(R?.refresh_token&&R.issuer==null&&console.warn("[mcp-sdk] stored OAuth tokens have no 'issuer' property (saved by an earlier version, or by a provider that does not keep it) and are used as-is; make sure your OAuthClientProvider stores what saveTokens() and saveClientInformation() receive unchanged."),R?.refresh_token)try{let $=await zz(h,{metadata:z,clientInformation:A,refreshToken:R.refresh_token,resource:b,addClientAuthentication:n.addClientAuthentication,fetchFn:l});return await W(),await n.saveTokens({...$,issuer:_}),"AUTHORIZED"}catch($){if(!(!($ instanceof V)||$ instanceof ye))throw $}let v=n.state?await n.state():void 0,{authorizationUrl:H,codeVerifier:J}=await fz(h,{metadata:z,clientInformation:A,state:v,redirectUrl:n.redirectUrl,scope:E,resource:b});return await n.saveCodeVerifier(J),await n.redirectToAuthorization(H),"REDIRECT"}i(yo,"authInternal");function az(n){if(!n)return!1;try{let e=new URL(n);return e.protocol==="https:"&&e.pathname!=="/"}catch{return!1}}i(az,"isHttpsUrl");async function cz(n,e,t){let s=qc(n);if(e.validateResourceURL)return await e.validateResourceURL(s,t?.resource);if(t){if(!jc({requestedResource:s,configuredResource:t.resource}))throw new Error(`Protected resource ${t.resource} does not match expected ${s} (or origin)`);return new URL(t.resource)}}i(cz,"selectResourceURL");function So(n){let e=n.headers.get("WWW-Authenticate");if(!e)return{};let[t,s]=e.split(" ");if(t.toLowerCase()!=="bearer"||!s)return{};let o=wo(n,"resource_metadata")||void 0,l;if(o)try{l=new URL(o)}catch{}let u=wo(n,"scope")||void 0,d=wo(n,"error")||void 0;return{resourceMetadataUrl:l,scope:u,error:d}}i(So,"extractWWWAuthenticateParams");function wo(n,e){let t=n.headers.get("WWW-Authenticate");if(!t)return null;let s=new RegExp(`${e}=(?:"([^"]+)"|([^\\s,]+))`),o=t.match(s);return o?o[1]||o[2]:null}i(wo,"extractFieldFromWwwAuth");async function Lc(n,e,t=fetch){let s=await dz(n,"oauth-protected-resource",t,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!s||s.status===404)throw await s?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw await s.body?.cancel(),new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Ac.parse(await s.json())}i(Lc,"discoverOAuthProtectedResourceMetadata");async function xo(n,e,t=fetch){try{return await je(t)(n,{headers:e})}catch(s){if(s instanceof TypeError)return e?xo(n,void 0,t):void 0;throw s}}i(xo,"fetchWithCorsRetry");function lz(n,e="",t={}){return e.endsWith("/")&&(e=e.slice(0,-1)),t.prependPathname?`${e}/.well-known/${n}`:`/.well-known/${n}${e}`}i(lz,"buildWellKnownPath");async function Dc(n,e,t=fetch){return await xo(n,{"MCP-Protocol-Version":e},t)}i(Dc,"tryMetadataDiscovery");function uz(n,e){return!n||!n.ok&&n.status<500&&e!=="/"}i(uz,"shouldAttemptFallback");async function dz(n,e,t,s){let o=new URL(n),l=s?.protocolVersion??tt,u;if(s?.metadataUrl)u=new URL(s.metadataUrl);else{let h=lz(e,o.pathname);u=new URL(h,s?.metadataServerUrl??o),u.search=o.search}let d=await Dc(u,l,t);if(!s?.metadataUrl&&uz(d,o.pathname)){let h=new URL(`/.well-known/${e}`,o);d=await Dc(h,l,t)}return d}i(dz,"discoverMetadataWithFallback");function pz(n){let e=typeof n=="string"?new URL(n):n,t=e.pathname!=="/",s=[];if(!t)return s.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),s;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),s.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),s}i(pz,"buildDiscoveryUrls");async function Uc(n,{fetchFn:e=fetch,protocolVersion:t=tt}={}){let s={"MCP-Protocol-Version":t,Accept:"application/json"},o=pz(n);for(let{url:l,type:u}of o){let d=await xo(l,s,e);if(d){if(!d.ok){if(await d.body?.cancel(),d.status<500)continue;throw new Error(`HTTP ${d.status} trying to load ${u==="oauth"?"OAuth":"OpenID provider"} metadata from ${l}`)}return u==="oauth"?zo.parse(await d.json()):Pc.parse(await d.json())}}}i(Uc,"discoverAuthorizationServerMetadata");async function mz(n,e){let t,s;try{t=await Lc(n,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),t.authorization_servers&&t.authorization_servers.length>0&&(s=t.authorization_servers[0])}catch{}s||(s=String(new URL("/",n)));let o=await Uc(s,{fetchFn:e?.fetchFn});return{authorizationServerUrl:s,authorizationServerMetadata:o,resourceMetadata:t}}i(mz,"discoverOAuthServerInfo");function Gc(n){return typeof n=="string"?n:n.href}i(Gc,"resourceIndicatorToString");async function fz(n,{metadata:e,clientInformation:t,redirectUrl:s,scope:o,state:l,resource:u}){let d;if(e){if(d=new URL(e.authorization_endpoint),!e.response_types_supported.includes(go))throw new Error(`Incompatible auth server: does not support response type ${go}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(_o))throw new Error(`Incompatible auth server: does not support code challenge method ${_o}`)}else d=new URL("/authorize",n);let h=await ho(),z=h.code_verifier,g=h.code_challenge;return d.searchParams.set("response_type",go),d.searchParams.set("client_id",t.client_id),d.searchParams.set("code_challenge",g),d.searchParams.set("code_challenge_method",_o),d.searchParams.set("redirect_uri",String(s)),l&&d.searchParams.set("state",l),o&&d.searchParams.set("scope",o),o?.includes("offline_access")&&d.searchParams.append("prompt","consent"),u&&d.searchParams.set("resource",Gc(u)),{authorizationUrl:d,codeVerifier:z}}i(fz,"startAuthorization");function hz(n,e,t){return new URLSearchParams({grant_type:"authorization_code",code:n,code_verifier:e,redirect_uri:String(t)})}i(hz,"prepareAuthorizationCodeRequest");async function Fc(n,{metadata:e,tokenRequestParams:t,clientInformation:s,addClientAuthentication:o,resource:l,fetchFn:u}){let d=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",n),h=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(l&&t.set("resource",Gc(l)),o)await o(h,t,d,e);else if(s){let g=e?.token_endpoint_auth_methods_supported??[],_=Yh(s,g);ez(_,s,h,t)}let z=await je(u??fetch)(d,{method:"POST",headers:h,body:t});if(!z.ok)throw await Hc(z);return oz.parse(await z.json())}i(Fc,"executeTokenRequest");async function zz(n,{metadata:e,clientInformation:t,refreshToken:s,resource:o,addClientAuthentication:l,fetchFn:u}){let d=new URLSearchParams({grant_type:"refresh_token",refresh_token:s}),h=await Fc(n,{metadata:e,tokenRequestParams:d,clientInformation:t,addClientAuthentication:l,resource:o,fetchFn:u});return{refresh_token:s,...h}}i(zz,"refreshAuthorization");async function gz(n,e,{metadata:t,resource:s,authorizationCode:o,fetchFn:l}={}){let u=i(async()=>{let g=await n.clientInformation(),_=bo(g,String(e));if(g&&!_)throw $c(g,String(e));return _},"readClientInformation"),d=await u(),h=n.clientMetadata.scope,z;if(n.prepareTokenRequest&&(z=await n.prepareTokenRequest(h)),!z){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!n.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let g=await n.codeVerifier();z=hz(o,g,n.redirectUrl)}return d??(d=await u()),Fc(e,{metadata:t,tokenRequestParams:z,clientInformation:d,addClientAuthentication:n.addClientAuthentication,resource:s,fetchFn:l})}i(gz,"fetchToken");async function _z(n,{metadata:e,clientMetadata:t,scope:s,fetchFn:o}){let l;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");l=new URL(e.registration_endpoint)}else l=new URL("/register",n);let u=await je(o??fetch)(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,...s!==void 0?{scope:s}:{}})});if(!u.ok)throw await Hc(u);return iz.parse(await u.json())}i(_z,"registerClient");var Gt=class extends Error{static{i(this,"ParseError")}constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},Bc=10,yz=13,Le=32;function To(n){}i(To,"noop");function Zc(n){if(typeof n=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:e=To,onError:t=To,onRetry:s=To,onComment:o,maxBufferSize:l}=n,u=[],d=0,h=!0,z,g="",_=0,w,b=!1;function E(R){if(b)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(h&&(h=!1,R.charCodeAt(0)===239&&R.charCodeAt(1)===187&&R.charCodeAt(2)===191&&(R=R.slice(3))),u.length===0){let J=A(R);J!==""&&(u.push(J),d=J.length),x();return}if(R.indexOf(`
|