@sheetxl/mcp 0.0.0-stage → 0.8.0-beta.15
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/LICENSE.md +11 -0
- package/README.md +72 -2
- package/agent/instructions.md +66 -0
- package/assets/9U9XCqqdn-q3i2fj.js +123 -0
- package/assets/B-MqXm_7luDLwazY.js +596 -0
- package/assets/B2Ek-DWpZMGJ0V1Z.js +18 -0
- package/assets/B2udpZ-uIaql3AUh.js +104 -0
- package/assets/B4VnJacrzr1x4PHR.js +402 -0
- package/assets/B5lHOOQ_rkP4Mi2r.js +638 -0
- package/assets/B7gUyrfLln3TiyKM.js +14 -0
- package/assets/B9US2ZrF93KOjmAx.js +22 -0
- package/assets/BBb_3gEGzmEzbTIk.js +359 -0
- package/assets/BCy1zP97fsiIcvj6.js +18 -0
- package/assets/BFXeoFUbuc4IKTz9.js +28 -0
- package/assets/BFdeov2e_xUQPEY_.js +202 -0
- package/assets/BG5kgbDRXMc0re6W.js +242 -0
- package/assets/BJxfinOazQqqByc-.js +105 -0
- package/assets/BOPsJmq7v7HOKUkO.js +32 -0
- package/assets/BPwmBu_aouERJjiW.js +45 -0
- package/assets/BQMDOjNBMjAx9WiW.js +3011 -0
- package/assets/BQbF1RkUH8WyXqSD.js +780 -0
- package/assets/BRzp6DEIYUgM3NkN.js +369 -0
- package/assets/BSxTn2BhkEEeF9x_.js +2346 -0
- package/assets/BTQhJQ3e0hsiousD.js +28 -0
- package/assets/BZPTaa0WjpoUAbgZ.js +35 -0
- package/assets/BbAmA46MhQSu3ZF_.js +119 -0
- package/assets/BbcUxIZe3YXywsQR.js +28 -0
- package/assets/BeLr36oL3jmeXFFi.js +58 -0
- package/assets/Bg95xYj5siqhHVEz.js +594 -0
- package/assets/Bh0PNKlrR4VAqnP8.js +60500 -0
- package/assets/BjqQjxBuoXza8oqg.js +362 -0
- package/assets/BlPubAFi7DY7VrAo.js +33 -0
- package/assets/BleMG0hAQgjE8fTa.js +7 -0
- package/assets/Bn8D2bebQ2tFfwQt.js +310 -0
- package/assets/BrcQmHcE7Hcr1erJ.js +24 -0
- package/assets/BsQZI1vXTRE63Zy-.js +2368 -0
- package/assets/BtjqpAKczftx91BQ.js +96 -0
- package/assets/Btys7KwtvV3hz2F6.js +656 -0
- package/assets/BuUEsifnQALe49uk.js +857 -0
- package/assets/By-7OWXShMlFFejV.js +119 -0
- package/assets/C0CiMKC3lWK1z9p5.js +449 -0
- package/assets/C2OrZ8LZ-TI6eYG0.js +22 -0
- package/assets/C4z2IilWTuu2TWXw.js +3917 -0
- package/assets/C7ONfuYIWRmDu_vs.js +319 -0
- package/assets/C7Z1li2XjWi6bkrp.js +1556 -0
- package/assets/C97xDe_wBbLZh_uW.js +35 -0
- package/assets/CGBGyaCGdlZFQYK0.js +447 -0
- package/assets/CJ5WQnaoCsdr5gf4.js +1783 -0
- package/assets/CMK6tIDVqYYvK4GZ.js +55 -0
- package/assets/CMWAsUQ66V8fYrME.js +223 -0
- package/assets/CNz3LdmvsOEJoLO9.js +12 -0
- package/assets/CWVWdbY1B1-WLl9k.js +199 -0
- package/assets/CWl6oHiJxkNKRixk.js +17 -0
- package/assets/CXHslDxkWCuEcCSQ.js +13 -0
- package/assets/CZTSZL3T_f-vSXqM.js +7 -0
- package/assets/CduNzsdbTigxH-ZK.js +5220 -0
- package/assets/CecTe22WURiXbVdY.js +2260 -0
- package/assets/Cf2dcwmmmf13Rywg.js +146 -0
- package/assets/Cf9LpgZz-W5blzy_.js +27 -0
- package/assets/Cfhv_Yw_LT8VzAMt.js +255 -0
- package/assets/Cg51xaLRUkVOMdCZ.js +144 -0
- package/assets/ChWpsFGl-BYOnX_A.js +142 -0
- package/assets/ClNQN3vEg5b5qUDp.js +10289 -0
- package/assets/Crt2kLdGIlBHANgg.js +28 -0
- package/assets/CudNpUD78SrtJIiy.js +610 -0
- package/assets/CvngwB17_ve4W49b.js +639 -0
- package/assets/CwPBmcY6xSP8dNlh.js +51 -0
- package/assets/CxjchwpiqxPM1XKd.js +304 -0
- package/assets/D-ffk16w8c5w0mxI.js +71 -0
- package/assets/D0CHDsemn0S31ltt.js +32 -0
- package/assets/D7oUtYjetuykGhQ5.js +18 -0
- package/assets/D8J14MLlN2HRXdXB.js +20 -0
- package/assets/DA_ar3QKLKtJ9fJD.js +37 -0
- package/assets/DB-tkqI6wFXDKEfB.js +118 -0
- package/assets/DD8HNAUFroTCuD-b.js +7514 -0
- package/assets/DDnwKPJSznyfYDZS.js +49 -0
- package/assets/DEW2GxfGYqVFvrfg.js +23 -0
- package/assets/DH7sGHzxUqIQkDnd.js +16 -0
- package/assets/DJiLWtmPR2OQNjzi.js +19 -0
- package/assets/DKLm4nWzynGw1Kr9.js +15 -0
- package/assets/DPCKMM7sgWbrtB8z.js +81 -0
- package/assets/DTfl-4Iboi6TQU5m.js +37 -0
- package/assets/DVchxwp6w6lu2Ihu.js +7 -0
- package/assets/DaoSWy3EFlqpZaLr.js +4437 -0
- package/assets/DcWTBOi_iBFc6U4J.js +8338 -0
- package/assets/Dht2mcOSyYlPY32b.js +14 -0
- package/assets/Diee6f_qAmcZBd2_.js +52 -0
- package/assets/DkibD_CEVePaoj_y.js +7 -0
- package/assets/DlBdhv6NHgrNp5Yo.js +7 -0
- package/assets/DoILAmhKUOlKWRVw.js +12 -0
- package/assets/DpdHDTFOeuzDVNEe.js +405 -0
- package/assets/DsCI_ZYm_jDjXF3J.js +12996 -0
- package/assets/DvUUArnZwoYOKOuk.js +12 -0
- package/assets/DwLZpYUp85UHBE3H.js +63 -0
- package/assets/DwWngYJTgC0KLbih.js +184 -0
- package/assets/Dz8UUJ7Xc2oN5PBG.js +45 -0
- package/assets/FS9NbEKgQvz5wqvZ.js +1135 -0
- package/assets/F_f0jJqM5MrXGbwC.js +86 -0
- package/assets/FzNG48GE_wso6RII.js +173 -0
- package/assets/JO3zH9hupFSV6vj2.js +15 -0
- package/assets/LEJp05fjmflKgyqF.js +1760 -0
- package/assets/LyLlBk--VJD2V-f8.js +351 -0
- package/assets/OVRdpPUzR0-ueTxE.js +1860 -0
- package/assets/PpFbmF0DFeUdpb9I.js +145 -0
- package/assets/S16s2h9qoYVBlVEa.js +9137 -0
- package/assets/SHZe9VOU1prGs1F9.js +19 -0
- package/assets/U1XXGEPuuqIAzYl1.js +8 -0
- package/assets/ZuYfVKlp41IJnrOS.js +540 -0
- package/assets/_d5XJ7dn1CKKYrep.js +1131 -0
- package/assets/_fUXIv6nKvgZkhxn.js +23 -0
- package/assets/fDMpDhXp36CatF-G.js +23 -0
- package/assets/hulrR0PldUxMJm_F.js +504 -0
- package/assets/iujMYIEPx_v3sdPf.js +9109 -0
- package/assets/jPUOH4FHF4b-rapv.js +171 -0
- package/assets/jadLBUNBVR9mbZ35.js +4036 -0
- package/assets/jiEe5eKV3BFPBWfi.js +6294 -0
- package/assets/oxjm7Yr7u7MeaO5P.js +37 -0
- package/assets/vZZi_iKYHm05gAye.js +30 -0
- package/assets/wfVh0olISLRWdv9Q.js +47 -0
- package/assets/xmTQJJVyCrcq77WR.js +63 -0
- package/assets/xnhBSX6lAcmBM65y.js +32 -0
- package/index.js +8070 -0
- package/lib.js +7 -0
- package/licenses/dependencies.txt +1552 -0
- package/package.json +44 -3
- package/resources/contents.json +333 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-italic.hinted.json +124 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-regular.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-regular.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold-italic.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-italic.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-regular.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.hinted.json +122 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold.hinted.json +122 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-italic.hinted.json +121 -0
- package/resources/fonts/@sheetxl/sdk/calibri-italic.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-regular.hinted.json +121 -0
- package/resources/fonts/@sheetxl/sdk/calibri-regular.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.hinted.json +105 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold.hinted.json +108 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-italic.hinted.json +102 -0
- package/resources/fonts/@sheetxl/sdk/cambria-italic.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-regular.hinted.json +110 -0
- package/resources/fonts/@sheetxl/sdk/cambria-regular.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/contents.json +646 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-italic.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-italic.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-regular.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-regular.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.metrics.json +141 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.metrics.json +141 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.metrics.json +141 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.rows.json +8 -0
- package/resources/locales/@sheetxl/formulas/contents.json +9 -0
- package/resources/locales/@sheetxl/formulas/de/functions.json +298 -0
- package/resources/locales/@sheetxl/formulas-extended/contents.json +9 -0
- package/resources/locales/@sheetxl/formulas-extended/de/functions.json +59 -0
- package/resources/locales/@sheetxl/sdk/contents.json +19 -0
- package/resources/locales/@sheetxl/sdk/de/grammar.json +16 -0
- package/resources/locales/@sheetxl/sdk/de/model.msg.json +710 -0
- package/resources/locales/@sheetxl/sdk/en/model.msg.json +732 -0
- package/screenshot-page/assets/-cpi3yOZYn6GsYN4.js +9 -0
- package/screenshot-page/assets/-i_fTASJeu9NdNH_.js +7 -0
- package/screenshot-page/assets/0MTaPYjKud2Q9QG9.js +1 -0
- package/screenshot-page/assets/21oAESJyBGXeHegm.js +2 -0
- package/screenshot-page/assets/3Ls_kOvlQseMV8Q0.js +1 -0
- package/screenshot-page/assets/4qZpl2QCzneWdmJO.js +1 -0
- package/screenshot-page/assets/6IEV7KeOEbBdrthj.js +1 -0
- package/screenshot-page/assets/8QrkTrKHDnMBb7q4.js +1 -0
- package/screenshot-page/assets/9w0ECZmzGUyk3F_O.js +1 -0
- package/screenshot-page/assets/AjS2PipZDIH3BXB2.js +1 -0
- package/screenshot-page/assets/B-KIwD5F_5S-NsPg.js +1 -0
- package/screenshot-page/assets/B-sAzW5ROrhvMGM4.js +1 -0
- package/screenshot-page/assets/B0FQypGas6gbGT_U.js +1 -0
- package/screenshot-page/assets/B2IQMVqTZT1rUnib.js +1 -0
- package/screenshot-page/assets/B2MJPcMcsuv6FekC.js +1 -0
- package/screenshot-page/assets/B2g3jiFIQ4Qjh5gG.js +1 -0
- package/screenshot-page/assets/B4PbXdzBe9BsoZ0e.js +2 -0
- package/screenshot-page/assets/B5GO9v4p9L70Xb9i.js +1 -0
- package/screenshot-page/assets/B8y_eLNCGnXLEIaE.js +1 -0
- package/screenshot-page/assets/BEuMvXYIa9A1JacY.js +1 -0
- package/screenshot-page/assets/BEwl-ucV9Jfr0RoC.js +1 -0
- package/screenshot-page/assets/BFaiQZKle44Rhyou.js +1 -0
- package/screenshot-page/assets/BHqg55S-4_OoAu3P.js +2 -0
- package/screenshot-page/assets/BNgLvS2bLOYKRguv.js +1 -0
- package/screenshot-page/assets/BQAN82ftWBiLJT3r.js +1 -0
- package/screenshot-page/assets/BQfe-XTIOGeUnD9B.js +1 -0
- package/screenshot-page/assets/BQnELVV0uR4T4ItQ.js +1 -0
- package/screenshot-page/assets/BRVZJ0OGJg9XJro6.js +1 -0
- package/screenshot-page/assets/BSdFVGZNhU6YHbMI.js +2 -0
- package/screenshot-page/assets/BTMW3ukmc44U2fy7.js +1 -0
- package/screenshot-page/assets/BTOQaSn9DDyJPUlX.js +1 -0
- package/screenshot-page/assets/BTboCICZ-951XWsi.js +1 -0
- package/screenshot-page/assets/BUGXf2DEBog16Slb.js +2 -0
- package/screenshot-page/assets/BUjI304IvdJnFXH3.js +1 -0
- package/screenshot-page/assets/B_W2QroTKADz3ABp.js +2 -0
- package/screenshot-page/assets/Baz0SC2AgGyxMX72.js +1 -0
- package/screenshot-page/assets/BbP9KThfrodyosvn.js +1 -0
- package/screenshot-page/assets/BcOdl17EeFSxnAiq.js +1 -0
- package/screenshot-page/assets/BclKeOKIOBjijhsu.js +1 -0
- package/screenshot-page/assets/Bf7xq8PyF4ohjMzP.js +2 -0
- package/screenshot-page/assets/BimyzECCZl-NESff.js +1 -0
- package/screenshot-page/assets/Bj-vfAT28PK-tWWa.js +2 -0
- package/screenshot-page/assets/BkLH7JH3A93TXFJi.js +1 -0
- package/screenshot-page/assets/BksaQEoZr5OWq-_d.js +3 -0
- package/screenshot-page/assets/BnoVwUBEor8NgQNs.js +4 -0
- package/screenshot-page/assets/BowRIybLgENunTOT.js +1 -0
- package/screenshot-page/assets/Bp7se0JaDGrzfSA_.js +1 -0
- package/screenshot-page/assets/Bx61vmiWY0Xvx9qs.js +1 -0
- package/screenshot-page/assets/ByY3fmwyDPAyOLdo.js +1 -0
- package/screenshot-page/assets/Bz5V1tmiy5gbT9ys.js +1 -0
- package/screenshot-page/assets/Bz9v1lgjvbu4QnOs.js +2 -0
- package/screenshot-page/assets/BzQ5GyiXq8gTz-H-.js +1 -0
- package/screenshot-page/assets/C1k_VrZqlpiUigCP.js +1 -0
- package/screenshot-page/assets/C2Wh2h27c7FUb8Yk.js +1 -0
- package/screenshot-page/assets/C6oLDVnuCS9LGkkH.js +1 -0
- package/screenshot-page/assets/C81mK8aZKZAAS-AB.js +1 -0
- package/screenshot-page/assets/C9SC-cEIt6gdhZRw.js +1 -0
- package/screenshot-page/assets/CE8MCCIiwjOVwBBW.js +1 -0
- package/screenshot-page/assets/CG3ynup87FmG-kkX.js +1 -0
- package/screenshot-page/assets/CHlWgOAlcRCjVuhg.js +1 -0
- package/screenshot-page/assets/CIged53b3hHKxa-o.js +1 -0
- package/screenshot-page/assets/CNQczIR5xcE5u5fT.js +1 -0
- package/screenshot-page/assets/CSUd8n1H0VBfREnk.js +2 -0
- package/screenshot-page/assets/CSlBTkRDITCC8JRB.js +1 -0
- package/screenshot-page/assets/CV2jr9hpQOG2OG0C.js +1 -0
- package/screenshot-page/assets/CXGgKVbVXjWzE0p6.js +1 -0
- package/screenshot-page/assets/CXKCmZ_TRyGaB9Ob.js +1 -0
- package/screenshot-page/assets/CXUO3vYip3JPSJ7A.js +1 -0
- package/screenshot-page/assets/CXwbGzavyvYgDbWU.js +1 -0
- package/screenshot-page/assets/CZf9s6otzzoaBlSs.js +1 -0
- package/screenshot-page/assets/CZvwQEeVhBilgKLG.js +1 -0
- package/screenshot-page/assets/Ca6nxdhEuLLty3d7.js +2 -0
- package/screenshot-page/assets/CbUDukmvDZmVfhJH.js +1 -0
- package/screenshot-page/assets/CbXtAM7H-Jg_J0dk.js +1 -0
- package/screenshot-page/assets/CctIRGMFmARVi2KT.js +1 -0
- package/screenshot-page/assets/Cenh1POxiGMxIQlv.js +1 -0
- package/screenshot-page/assets/ChSvXfVMLxZsP9zG.js +8 -0
- package/screenshot-page/assets/Ci5NtzhJLll1kxGf.js +10 -0
- package/screenshot-page/assets/CjngjJNheGaVRvZp.js +1 -0
- package/screenshot-page/assets/ClzdIJrFdInttVJA.js +1 -0
- package/screenshot-page/assets/CnPgk3HcIziOcskY.js +10 -0
- package/screenshot-page/assets/CnXLpFE_vFrJ5Jbf.js +1 -0
- package/screenshot-page/assets/CpbohdgEaEsVDi9J.js +1 -0
- package/screenshot-page/assets/CqR3hGrC956TkCMj.js +20 -0
- package/screenshot-page/assets/Cr1tQKUBVKOQl3QC.js +1 -0
- package/screenshot-page/assets/CwqNb7JYzC03lCj0.js +1 -0
- package/screenshot-page/assets/CykecBozGGFl26KA.js +3940 -0
- package/screenshot-page/assets/CzTizxHhb-CI_ajE.js +1 -0
- package/screenshot-page/assets/CzhH7lTYQrYGHct6.js +1 -0
- package/screenshot-page/assets/CzzEl3lAkZopkwhC.js +1 -0
- package/screenshot-page/assets/D-LgRj0s-PAVqY-L.js +1 -0
- package/screenshot-page/assets/D-XR1MGhwn7Jqj60.js +1 -0
- package/screenshot-page/assets/D47ePD4x1lVazNdl.js +7 -0
- package/screenshot-page/assets/D66vSE1ConAuENmB.js +586 -0
- package/screenshot-page/assets/D6Jpaz2YkhOfzxDB.js +1 -0
- package/screenshot-page/assets/D9zCVZpnJBfNSNO2.js +1 -0
- package/screenshot-page/assets/DCVUZ_ayOXFwV2d_.js +3 -0
- package/screenshot-page/assets/DDQWM8rNYCYzKa9R.js +1 -0
- package/screenshot-page/assets/DFE-fKq5NV7_O8V6.js +1 -0
- package/screenshot-page/assets/DGXDfjkGZjMRAXPg.js +5 -0
- package/screenshot-page/assets/DHa5_U58lSwCnpmG.js +1 -0
- package/screenshot-page/assets/DKVB6ddRfDJatYid.js +1 -0
- package/screenshot-page/assets/DK_QSosKV62NDcuT.js +42 -0
- package/screenshot-page/assets/DM9U7u7FQK0jcwh4.js +1 -0
- package/screenshot-page/assets/DNDaHmkQrQTaCHhV.js +1 -0
- package/screenshot-page/assets/DQ0kGd99-fXxuNYk.js +1 -0
- package/screenshot-page/assets/DQWHkaQeNXft9j8b.js +2 -0
- package/screenshot-page/assets/DRVfGdmVBvktrZ1t.js +1 -0
- package/screenshot-page/assets/DRrM-dY9nM7nDRpV.js +1 -0
- package/screenshot-page/assets/DT2x1gO3f2G5NfeB.js +1 -0
- package/screenshot-page/assets/DTFRGj188QuLKEXw.js +1 -0
- package/screenshot-page/assets/DU3FmyUH0RjPIBd-.js +1 -0
- package/screenshot-page/assets/DVueE--eOrZPrqrm.js +1 -0
- package/screenshot-page/assets/DXQLzGmxoyN3kfQi.js +27 -0
- package/screenshot-page/assets/DXWWyJlMSWgDFxs1.js +10 -0
- package/screenshot-page/assets/DYJSIlNxrNw8qk-w.js +1 -0
- package/screenshot-page/assets/DYRbCudWTaiE_Sjc.js +1 -0
- package/screenshot-page/assets/DZDRRw-62D6Zw7qs.js +1 -0
- package/screenshot-page/assets/DaKZ4-Li_ULIIwnK.js +1 -0
- package/screenshot-page/assets/DadZXeaVK5UXSHIi.js +1 -0
- package/screenshot-page/assets/Db_VGqQo2G2JgXWW.js +1 -0
- package/screenshot-page/assets/DceNHPrRLok2At-X.js +1 -0
- package/screenshot-page/assets/DcrVJCyDwGKeil2U.js +1 -0
- package/screenshot-page/assets/DeAKjatTVaZ0u_FY.js +1 -0
- package/screenshot-page/assets/DmMZ4pd492HPw_3_.js +1 -0
- package/screenshot-page/assets/DmbuCapSSCYIa3yk.js +1 -0
- package/screenshot-page/assets/Dpepompn_NhpSncR.js +1 -0
- package/screenshot-page/assets/DqYhS4mcQfOe96hU.js +1 -0
- package/screenshot-page/assets/Dsx0NUmGIxS7SvZ8.js +1 -0
- package/screenshot-page/assets/DyGpT6t96jrvgJes.js +1 -0
- package/screenshot-page/assets/DyLWQxXXTw5uwPVy.js +30 -0
- package/screenshot-page/assets/DyYVf8O1rhg3YmjW.js +1 -0
- package/screenshot-page/assets/DyxJBLjUkeDuu96F.js +1 -0
- package/screenshot-page/assets/HclGiUj8dZXDFmoM.js +1 -0
- package/screenshot-page/assets/IRtoU5oVgBWu9rnK.js +2 -0
- package/screenshot-page/assets/J73KTOmdZGNmnq-z.js +1 -0
- package/screenshot-page/assets/J_xJVgE7YlmeU-ZO.js +6 -0
- package/screenshot-page/assets/KoxRo2J_cwB_yOd5.js +2 -0
- package/screenshot-page/assets/LVtV_IPhPQroHRui.js +1 -0
- package/screenshot-page/assets/MNoPOsydrUv1UGU8.js +2 -0
- package/screenshot-page/assets/Q5EKmzoJZCE81Om-.js +2 -0
- package/screenshot-page/assets/TfhknTx8vxQkw4zV.js +2 -0
- package/screenshot-page/assets/VvqAh6BWzaD5OUPF.js +1 -0
- package/screenshot-page/assets/fGlPAximvsxzPzGA.js +1 -0
- package/screenshot-page/assets/gG0AFZ45VxS_moMw.js +2 -0
- package/screenshot-page/assets/hp_-JA1DMK4Yoztn.js +57 -0
- package/screenshot-page/assets/l32n8O_A78Qqduv3.js +1 -0
- package/screenshot-page/assets/nHThFXCAZFOM_npq.js +1 -0
- package/screenshot-page/assets/pRykm05ElquZBk_a.js +1 -0
- package/screenshot-page/assets/rPOkVKdPbFpTG6AY.js +1 -0
- package/screenshot-page/assets/sHBomL5R4-_px8rD.js +1 -0
- package/screenshot-page/assets/skRJ2qjA7kcmnOsh.js +39 -0
- package/screenshot-page/assets/w3bV7wggRayUYTd-.js +1 -0
- package/screenshot-page/assets/zFbb8ESzwR_bE7IQ.js +1 -0
- package/screenshot-page/index.html +44 -0
- package/screenshot-page/resources/contents.json +333 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.hinted.json +124 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.hinted.json +122 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.hinted.json +122 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.hinted.json +121 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.hinted.json +121 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.hinted.json +105 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.hinted.json +108 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.hinted.json +102 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.hinted.json +110 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/contents.json +646 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.metrics.json +141 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.metrics.json +141 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.metrics.json +141 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.rows.json +8 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas/contents.json +9 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas/de/functions.json +298 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas-extended/contents.json +9 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas-extended/de/functions.json +59 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/contents.json +19 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/grammar.json +16 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +710 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +732 -0
- package/types/index.d.ts +1 -0
- package/types/lib.d.ts +2 -0
- package/types/scripting-api.json +10855 -0
- package/types/scripting-enums.json +1339 -0
- package/types/scripting.d.ts +49295 -0
- package/types/src/SessionRegistry.d.ts +630 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/instances.d.ts +104 -0
- package/types/src/lib/Types.d.ts +17 -0
- package/types/src/lib/index.d.ts +2 -0
- package/types/src/lib/runReport.d.ts +158 -0
- package/types/src/lib.d.ts +2 -0
- package/types/src/prepareRun.d.ts +56 -0
- package/types/src/relay.d.ts +102 -0
- package/types/src/screenshot.d.ts +23 -0
- package/types/src/server.d.ts +37 -0
- package/types/src/taskStore.d.ts +28 -0
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { IModule, IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { RunResultLike } from './lib/runReport.ts';
|
|
3
|
+
import { RelayClient } from './relay.ts';
|
|
4
|
+
/**
|
|
5
|
+
* A session's backing tells the agent (and routing) where the SDK instance lives:
|
|
6
|
+
* - `sandbox` — server-owned, headless, in-process. Created on demand; an agent may hold many.
|
|
7
|
+
* - `attended` — owned by a client UI (a VS Code webview today), reached over the relay.
|
|
8
|
+
*
|
|
9
|
+
* `origin` is orthogonal to backing: how the session was seeded.
|
|
10
|
+
*/
|
|
11
|
+
export interface SessionInfo {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
kind: 'sandbox' | 'attended';
|
|
15
|
+
origin: 'blank' | 'file' | 'fork';
|
|
16
|
+
/** Whether the session has a live UI view (presence/selection only applies when true). */
|
|
17
|
+
hasView: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Where the workbook came from — the file for `origin: 'file'` (and, when the client UI reports
|
|
20
|
+
* it, for an attended session's document).
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* A name is not an identity. `list_sessions` showed `named-formulas.xlsx` and nothing else, so
|
|
24
|
+
* two workbooks of the same name in different directories were one row twice, and an agent
|
|
25
|
+
* choosing between them was guessing. Attended ids are now DERIVED from this path (stable across
|
|
26
|
+
* reloads), so the path is the identity's source rather than its only survivor — and still the
|
|
27
|
+
* handle for untitled/legacy sessions whose ids are per-load.
|
|
28
|
+
*/
|
|
29
|
+
originPath?: string;
|
|
30
|
+
/**
|
|
31
|
+
* For `origin: 'fork'`, the session this was cloned from.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Forks used to be indistinguishable: every one was named `Fork`, with no record of its source,
|
|
35
|
+
* so three open experiments were three identical rows. Applying the wrong one to the original is
|
|
36
|
+
* the failure that costs real work.
|
|
37
|
+
*/
|
|
38
|
+
originSource?: string;
|
|
39
|
+
/** Current transaction head — the value to pass as `original_commit_id` for a drift-guarded write. */
|
|
40
|
+
headCommitId?: string;
|
|
41
|
+
/** The last-touched session — what the {@link ACTIVE_SESSION} token resolves to. */
|
|
42
|
+
active?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* When the session's workbook was (re)loaded — its **history epoch**, epoch-ms.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Attended ids are path-derived and survive reloads/restarts, so the id no longer signals "your
|
|
48
|
+
* history is gone" by changing. This does: commit ids are scoped to an epoch, and this timestamp
|
|
49
|
+
* moving under a constant id is how the registry detects (and the events channel reports) that
|
|
50
|
+
* the commit/undo history was reset. For a sandbox it is simply the creation time.
|
|
51
|
+
*/
|
|
52
|
+
openedAt?: number;
|
|
53
|
+
}
|
|
54
|
+
/** How a sandbox was seeded. */
|
|
55
|
+
export type SandboxOrigin = 'blank' | 'file' | 'fork';
|
|
56
|
+
/**
|
|
57
|
+
* The one `session_id` that is not an id: resolves to the sole open session, or to the unambiguous
|
|
58
|
+
* active one. Deliberately absent from every tool description — `session_id` is required so that a
|
|
59
|
+
* write can never land on a workbook the agent did not name, and a documented shortcut would be
|
|
60
|
+
* the default by another spelling. It exists for hand-driven tool testing, where naming a session
|
|
61
|
+
* that was just created is ceremony.
|
|
62
|
+
*/
|
|
63
|
+
export declare const ACTIVE_SESSION = "active";
|
|
64
|
+
/**
|
|
65
|
+
* Settles a sandbox's origin from what the caller actually supplied: a `path` means `file`, a
|
|
66
|
+
* `source` means `fork`, neither means `blank`. An explicit `origin` is honored, and checked
|
|
67
|
+
* against the arguments — "origin 'file' with no path" and "origin 'blank' with a path" are the
|
|
68
|
+
* same confusion, so both are refused rather than half-obeyed.
|
|
69
|
+
*/
|
|
70
|
+
export declare function inferSandboxOrigin(origin: SandboxOrigin | undefined, opts: {
|
|
71
|
+
path?: string;
|
|
72
|
+
source?: string;
|
|
73
|
+
}): SandboxOrigin;
|
|
74
|
+
/**
|
|
75
|
+
* A session that is no longer usable, and why — the tier above commits.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* A dead id used to resolve to nothing, which reads identically whether it never existed, was
|
|
79
|
+
* closed, or came back under a new number. Kept in a small ring buffer, so an agent holding a stale
|
|
80
|
+
* id is answered rather than left to experiment.
|
|
81
|
+
*/
|
|
82
|
+
export interface ClosedSession {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
/** The document it was showing, when known — the key a reload is matched on. */
|
|
86
|
+
path?: string;
|
|
87
|
+
kind: 'sandbox' | 'attended';
|
|
88
|
+
closedAt: number;
|
|
89
|
+
/**
|
|
90
|
+
* `closed` — this server disposed a sandbox on request.
|
|
91
|
+
* `gone` — an attended workbook stopped being reported by the client UI.
|
|
92
|
+
* `reloaded` — an attended workbook came back under a new id (see {@link replacedBy}). With
|
|
93
|
+
* path-derived ids this is the untitled/legacy case only — a file-backed workbook returns under
|
|
94
|
+
* the SAME id (its tombstone is simply withdrawn; see the `returned` event).
|
|
95
|
+
*/
|
|
96
|
+
reason: 'closed' | 'gone' | 'reloaded';
|
|
97
|
+
/** The id that took over, when a workbook was reloaded rather than closed. */
|
|
98
|
+
replacedBy?: string;
|
|
99
|
+
/** Where it was when it died — so an agent can tell whether it lost work. */
|
|
100
|
+
headCommitId?: string;
|
|
101
|
+
/** Tool-authored commits it held. Zero for an untouched session; nothing was lost with it. */
|
|
102
|
+
agentCommits?: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* One attended-session lifecycle change, observed but not yet reported to the agent.
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* An agent perceives the world only through tool results — it does not poll `list_sessions`, and a
|
|
109
|
+
* protocol notification never reaches the model. So changes the user makes (opening, closing,
|
|
110
|
+
* reloading a workbook) are queued here and delivered at the top of the NEXT tool result, whatever
|
|
111
|
+
* it is. Until this existed, the diff was computed on every call and shown to no one: an agent
|
|
112
|
+
* learned "the workbook closed" only by failing against its dead id.
|
|
113
|
+
*
|
|
114
|
+
* A departure holds the {@link ClosedSession} BY REFERENCE because `reconcileAttended` upgrades a
|
|
115
|
+
* tombstone in place when the matching arrival lands (`gone` → `reloaded`) — rendering at delivery
|
|
116
|
+
* time sees the upgrade, so a same-poll reload reads as one reload, not a close plus an open.
|
|
117
|
+
*
|
|
118
|
+
* Only USER actions are recorded. Sandbox create/close are the agent's own calls — their results
|
|
119
|
+
* already said what happened — and a server restart is the stale-state notice's job (`instances.ts`).
|
|
120
|
+
*
|
|
121
|
+
* `returned` and `reset` exist because attended ids are path-derived and STABLE: a closed file
|
|
122
|
+
* reopens under the same id (`returned` — its tombstone is withdrawn), and a reload keeps the id
|
|
123
|
+
* while rebuilding the workbook (`reset` — detected by `openedAt` moving under a constant id).
|
|
124
|
+
* In both, the fact the agent must hear is not "the id changed" (it did not) but "the commit/undo
|
|
125
|
+
* history you may be holding ids into is gone".
|
|
126
|
+
*/
|
|
127
|
+
export type SessionEvent = {
|
|
128
|
+
kind: 'departed';
|
|
129
|
+
tomb: ClosedSession;
|
|
130
|
+
} | {
|
|
131
|
+
kind: 'arrived';
|
|
132
|
+
info: SessionInfo;
|
|
133
|
+
} | {
|
|
134
|
+
kind: 'returned';
|
|
135
|
+
info: SessionInfo;
|
|
136
|
+
} | {
|
|
137
|
+
kind: 'reset';
|
|
138
|
+
info: SessionInfo;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Normalized outcome of a macro run, shared by sandbox (in-process) and attended (relayed) sessions.
|
|
142
|
+
* Exactly one of `drift` or `result` is set. The tool layer turns this into the MCP report.
|
|
143
|
+
*/
|
|
144
|
+
export interface RunOutcome {
|
|
145
|
+
/** Set when `originalCommitId` did not match the session head — the write was NOT applied. */
|
|
146
|
+
drift?: {
|
|
147
|
+
expected: string;
|
|
148
|
+
actual?: string;
|
|
149
|
+
};
|
|
150
|
+
/** The run result when not a drift (may itself be a compile/runtime failure). */
|
|
151
|
+
result?: RunResultLike;
|
|
152
|
+
logs: string;
|
|
153
|
+
}
|
|
154
|
+
/** One row of a session's commit log (newest first). JSON-safe — crosses the relay as-is. */
|
|
155
|
+
export interface CommitEntry {
|
|
156
|
+
id: string;
|
|
157
|
+
description: string | null;
|
|
158
|
+
/** Who wrote it, or `null` when unattributed. Commits an agent did not write mean the session moved under it. */
|
|
159
|
+
author: string | null;
|
|
160
|
+
timestamp: number;
|
|
161
|
+
}
|
|
162
|
+
export interface ListCommitsOptions {
|
|
163
|
+
/** Maximum entries, newest first. */
|
|
164
|
+
limit?: number;
|
|
165
|
+
}
|
|
166
|
+
export interface RunOptions {
|
|
167
|
+
description?: string;
|
|
168
|
+
/** Drift guard: reject (without applying) if the session head differs from this. */
|
|
169
|
+
originalCommitId?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Arguments exposed to the macro as `ctx.args` — the MCP half of the CLI's `-- <args…>`, so the
|
|
172
|
+
* same parameterized script runs on either transport without editing its source.
|
|
173
|
+
*/
|
|
174
|
+
args?: Record<string, any>;
|
|
175
|
+
/**
|
|
176
|
+
* Report options for the rendered result — the MCP half of the CLI's `--md.<key>=<value>`.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* String-valued and parsed by `@sheetxl/query`, so both transports read one vocabulary. The
|
|
180
|
+
* agent-facing reason to reach for it is the same one a person has at a terminal: a workbook
|
|
181
|
+
* report over a heavily formatted sheet is dozens of region sections, and `{ features: "fill" }`
|
|
182
|
+
* is the difference between an answer and a haystack.
|
|
183
|
+
*/
|
|
184
|
+
md?: Record<string, string>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* An ephemeral grid highlight — one or more ranges marked in a session's view. Never a commit (see
|
|
188
|
+
* lane1-target-state decision #7). Declarative: each call REPLACES the prior highlight, so an empty
|
|
189
|
+
* `ranges` clears it. Only meaningful for sessions with `hasView === true`; a no-op on headless
|
|
190
|
+
* sandboxes.
|
|
191
|
+
*/
|
|
192
|
+
export interface Highlight {
|
|
193
|
+
/**
|
|
194
|
+
* The marked ranges, **in review order** — empty clears the highlight.
|
|
195
|
+
*
|
|
196
|
+
* @remarks
|
|
197
|
+
* Order is meaningful, not incidental: the UI walks this list (a counter and next/previous over
|
|
198
|
+
* the set), so index 0 is the first thing the user is taken to. A findings list is therefore
|
|
199
|
+
* ranked by the agent — most severe or most confident first — and not left in whatever order the
|
|
200
|
+
* scan happened to produce.
|
|
201
|
+
*
|
|
202
|
+
* Each entry carries its own `label` because that is what a walked list needs: one label across
|
|
203
|
+
* seven findings shows the same text at all seven stops, which is the least useful moment for it.
|
|
204
|
+
*/
|
|
205
|
+
ranges: HighlightRange[];
|
|
206
|
+
/** Visual intent — drives styling (working cursor / finding / candidate question). */
|
|
207
|
+
intent: 'working' | 'finding' | 'question';
|
|
208
|
+
}
|
|
209
|
+
/** One marked range and what it means. */
|
|
210
|
+
export interface HighlightRange {
|
|
211
|
+
/** Sheet-qualified range (e.g. "Sheet1!B2:D8"). */
|
|
212
|
+
range: string;
|
|
213
|
+
/** Short label for THIS range — what the user reads when they arrive at it. */
|
|
214
|
+
label?: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* What actually happened to a {@link Highlight} — so the caller is never told it marked cells it
|
|
218
|
+
* did not.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* Two separate false positives lived here: a headless sandbox silently discarded the call, and a
|
|
222
|
+
* malformed address was accepted and only failed later at render time. Both reported success.
|
|
223
|
+
* `ranges` is what the grid RESOLVED (sheet-qualified, normalized), not what was asked for, so the
|
|
224
|
+
* reply stays observable in the same way `run` reports the form it chose.
|
|
225
|
+
*/
|
|
226
|
+
export interface HighlightResult {
|
|
227
|
+
/** The addresses a grid actually marked, as it resolved them. Empty when the highlight was cleared. */
|
|
228
|
+
ranges: string[];
|
|
229
|
+
/**
|
|
230
|
+
* `true` when a grid applied it. `false` on a headless sandbox — nothing was highlighted and
|
|
231
|
+
* nothing could be, which the caller must be told rather than shown an unbacked success.
|
|
232
|
+
*/
|
|
233
|
+
applied: boolean;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* A grid prompt — the human-facing step of an MCP `prompt` task. Shown in the session's grid; the
|
|
237
|
+
* answer flows back through the relay. Only meaningful for sessions with a view (rejected on headless
|
|
238
|
+
* sandboxes).
|
|
239
|
+
*
|
|
240
|
+
* @remarks
|
|
241
|
+
* One prompt is one dialog. It holds one question or several, which the user answers one step at a
|
|
242
|
+
* time and which come back together. At most one prompt is pending per session.
|
|
243
|
+
*/
|
|
244
|
+
export interface PromptSpec {
|
|
245
|
+
questions: PromptQuestion[];
|
|
246
|
+
}
|
|
247
|
+
/** One question of a {@link PromptSpec}. */
|
|
248
|
+
export interface PromptQuestion {
|
|
249
|
+
/** What the answer comes back under. */
|
|
250
|
+
id: string;
|
|
251
|
+
/** A short name for the question's tab in the dialog. */
|
|
252
|
+
header?: string;
|
|
253
|
+
message: string;
|
|
254
|
+
/**
|
|
255
|
+
* Empty for an acknowledge step (message and continue / close only). `description` is a second,
|
|
256
|
+
* quieter line under the label.
|
|
257
|
+
*/
|
|
258
|
+
options: {
|
|
259
|
+
id: string;
|
|
260
|
+
label: string;
|
|
261
|
+
description?: string;
|
|
262
|
+
}[];
|
|
263
|
+
/**
|
|
264
|
+
* The single range the question is ABOUT — the step is shown at those cells.
|
|
265
|
+
*
|
|
266
|
+
* @remarks
|
|
267
|
+
* Omitted, the step is a centred dialog rather than being anchored somewhere arbitrary. It
|
|
268
|
+
* deliberately does **not** fall back to the user's selection: the selection is theirs, it is
|
|
269
|
+
* almost never the subject of the agent's question, and anchoring there asserts a relationship
|
|
270
|
+
* that does not exist.
|
|
271
|
+
*/
|
|
272
|
+
range?: string;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* One question's answer: the option chosen, or `text` when the user answered in their own words
|
|
276
|
+
* ("Other"). Neither is set for an acknowledged step.
|
|
277
|
+
*/
|
|
278
|
+
export interface PromptQuestionAnswer {
|
|
279
|
+
questionId: string;
|
|
280
|
+
optionId?: string;
|
|
281
|
+
text?: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* The user's answer — elicitation-shaped (`accept`/`cancel`).
|
|
285
|
+
*
|
|
286
|
+
* @remarks
|
|
287
|
+
* `answers` is in question order. On `accept` every question is answered; on `cancel` it holds the
|
|
288
|
+
* questions answered before the user dismissed the prompt (possibly none).
|
|
289
|
+
*/
|
|
290
|
+
export interface PromptResult {
|
|
291
|
+
action: 'accept' | 'cancel';
|
|
292
|
+
answers: PromptQuestionAnswer[];
|
|
293
|
+
}
|
|
294
|
+
/** Common write/read surface implemented by both sandbox and attended sessions. */
|
|
295
|
+
export interface Session {
|
|
296
|
+
/**
|
|
297
|
+
* The id every tool routes by — what `run` echoes back so the agent can read which workbook its
|
|
298
|
+
* code ran against. Defined for any session a tool call resolved; an attended session built
|
|
299
|
+
* without one (the synchronous logging path) routes to the relay's active workbook.
|
|
300
|
+
*/
|
|
301
|
+
readonly id: string | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* Where this session's SDK instance lives — in-process (`sandbox`) or in a client UI reached over
|
|
304
|
+
* the relay (`attended`). Both implementations already carried it; it is on the interface so a
|
|
305
|
+
* caller holding a `Session` can attribute it (the tool log does) without a `list()` round-trip.
|
|
306
|
+
*/
|
|
307
|
+
readonly kind: 'sandbox' | 'attended';
|
|
308
|
+
/**
|
|
309
|
+
* Execute a read tool from the shared `TOOLS` descriptor list (`@sheetxl/query`) against this
|
|
310
|
+
* session's live workbook, returning the descriptor's rendering. A sandbox runs it in-process;
|
|
311
|
+
* an attended session runs it in the webview — the only place its workbook lives.
|
|
312
|
+
*/
|
|
313
|
+
runTool(name: string, args: Record<string, unknown>): Promise<string>;
|
|
314
|
+
/**
|
|
315
|
+
* Execute an already-compiled module as one undoable commit. Compilation (and snippet
|
|
316
|
+
* classification/wrapping) happens in the tool layer — see `prepareRun` — so both session kinds
|
|
317
|
+
* run the identical artifact.
|
|
318
|
+
*/
|
|
319
|
+
run(module: IModule.JSON, opts: RunOptions): Promise<RunOutcome>;
|
|
320
|
+
revert(commitId: string): Promise<void>;
|
|
321
|
+
restore(commitId: string): Promise<void>;
|
|
322
|
+
/** The session's commit log, newest first — the ids `session_revert`/`session_restore` take. */
|
|
323
|
+
listCommits(opts: ListCommitsOptions): Promise<CommitEntry[]>;
|
|
324
|
+
/**
|
|
325
|
+
* Mark ranges in the session's grid. Reports back what a grid actually resolved and marked —
|
|
326
|
+
* a headless sandbox has no view, and says so rather than reporting success.
|
|
327
|
+
*/
|
|
328
|
+
highlight(highlight: Highlight): Promise<HighlightResult>;
|
|
329
|
+
/**
|
|
330
|
+
* Show a grid prompt and resolve when the user answers. `opts.signal` aborts the wait (and clears
|
|
331
|
+
* the grid prompt) — used for agent-side cancellation (`tasks/cancel`). Rejected on headless sandboxes.
|
|
332
|
+
*/
|
|
333
|
+
prompt(spec: PromptSpec, opts?: {
|
|
334
|
+
signal?: AbortSignal;
|
|
335
|
+
}): Promise<PromptResult>;
|
|
336
|
+
/** Serialize the workbook to JSON — the fork/snapshot primitive (rides the relay's JSON channel). */
|
|
337
|
+
snapshot(): Promise<IWorkbook.JSON>;
|
|
338
|
+
/**
|
|
339
|
+
* Waits until no async function call (`IMAGE`, `STOCKHISTORY`) is waiting for an answer, so a
|
|
340
|
+
* {@link snapshot} taken next holds the answers rather than `#BUSY!`. Gives up after `timeout`
|
|
341
|
+
* milliseconds. An attended session's workbook is the client's, and is not waited for.
|
|
342
|
+
*/
|
|
343
|
+
whenAnswered(timeout: number): Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Write the workbook to disk and resolve the absolute path written.
|
|
346
|
+
*
|
|
347
|
+
* @param path Absolute destination. Omitted, or the session's own file, is a Save; any other
|
|
348
|
+
* path is a Save As.
|
|
349
|
+
*/
|
|
350
|
+
save(path: string | undefined, opts?: SaveOptions): Promise<string>;
|
|
351
|
+
}
|
|
352
|
+
/** Options for {@link Session.save}. */
|
|
353
|
+
export interface SaveOptions {
|
|
354
|
+
/** Replace an existing file other than the session's own. */
|
|
355
|
+
overwrite?: boolean;
|
|
356
|
+
/** Each feature the destination format cannot hold; the session still has it. */
|
|
357
|
+
onWarning?: (message: string) => void;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* A server-owned, in-process workbook. This is the headless side of the session registry — the
|
|
361
|
+
* "sandbox" backing. It owns the `IWorkbook` directly, so macros run in-process with no relay.
|
|
362
|
+
*/
|
|
363
|
+
export declare class SandboxSession implements Session {
|
|
364
|
+
readonly id: string;
|
|
365
|
+
readonly name: string;
|
|
366
|
+
readonly origin: 'blank' | 'file' | 'fork';
|
|
367
|
+
private readonly workbook;
|
|
368
|
+
private readonly lineage;
|
|
369
|
+
readonly kind: "sandbox";
|
|
370
|
+
/** Creation time — the sandbox's `openedAt`. In-memory, so its history epoch IS its lifetime. */
|
|
371
|
+
private readonly createdAt;
|
|
372
|
+
private constructor();
|
|
373
|
+
static create(id: string, origin: 'blank' | 'file' | 'fork', opts: {
|
|
374
|
+
path?: string;
|
|
375
|
+
name?: string;
|
|
376
|
+
json?: IWorkbook.JSON;
|
|
377
|
+
source?: string;
|
|
378
|
+
sourceName?: string;
|
|
379
|
+
}): Promise<SandboxSession>;
|
|
380
|
+
snapshot(): Promise<IWorkbook.JSON>;
|
|
381
|
+
whenAnswered(timeout: number): Promise<void>;
|
|
382
|
+
/**
|
|
383
|
+
* Saves the session's own workbook. A Save As moves the session to the new file, so the next
|
|
384
|
+
* plain save writes there.
|
|
385
|
+
*/
|
|
386
|
+
save(path: string | undefined, opts?: SaveOptions): Promise<string>;
|
|
387
|
+
/** Dispose the in-memory workbook. No further operations are valid after this. */
|
|
388
|
+
close(): void;
|
|
389
|
+
/** Current transaction head id — `undefined` only if the store has no commits yet. */
|
|
390
|
+
getHeadCommitId(): string | undefined;
|
|
391
|
+
/**
|
|
392
|
+
* How many commits in this sandbox were written through a tool — what an agent loses if the
|
|
393
|
+
* session goes away unnoticed.
|
|
394
|
+
*
|
|
395
|
+
* @remarks
|
|
396
|
+
* Agent-authored only. The raw log counts the workbook's initial state as an entry, so an
|
|
397
|
+
* untouched sandbox would report "1 commit" and a tombstone would claim work was lost where none
|
|
398
|
+
* existed. The number exists to answer "did I lose anything", and only these commits can be lost.
|
|
399
|
+
*/
|
|
400
|
+
agentCommitCount(): number;
|
|
401
|
+
info(): SessionInfo;
|
|
402
|
+
runTool(name: string, args: Record<string, unknown>): Promise<string>;
|
|
403
|
+
run(module: IModule.JSON, opts: RunOptions): Promise<RunOutcome>;
|
|
404
|
+
revert(commitId: string): Promise<void>;
|
|
405
|
+
restore(commitId: string): Promise<void>;
|
|
406
|
+
listCommits(opts: ListCommitsOptions): Promise<CommitEntry[]>;
|
|
407
|
+
highlight(_highlight: Highlight): Promise<HighlightResult>;
|
|
408
|
+
prompt(_spec: PromptSpec, _opts?: {
|
|
409
|
+
signal?: AbortSignal;
|
|
410
|
+
}): Promise<PromptResult>;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* An attended session — owned by a client UI (a VS Code webview). All operations forward over the relay
|
|
414
|
+
* to the webview, which executes them against the live `IWorkbook`. `id` is the workbook id; when
|
|
415
|
+
* `undefined`, the relay routes to its active workbook.
|
|
416
|
+
*/
|
|
417
|
+
export declare class AttendedSession implements Session {
|
|
418
|
+
private readonly relay;
|
|
419
|
+
readonly id: string | undefined;
|
|
420
|
+
readonly kind: "attended";
|
|
421
|
+
constructor(relay: RelayClient, id: string | undefined);
|
|
422
|
+
runTool(name: string, args: Record<string, unknown>): Promise<string>;
|
|
423
|
+
run(module: IModule.JSON, opts: RunOptions): Promise<RunOutcome>;
|
|
424
|
+
revert(commitId: string): Promise<void>;
|
|
425
|
+
restore(commitId: string): Promise<void>;
|
|
426
|
+
listCommits(opts: ListCommitsOptions): Promise<CommitEntry[]>;
|
|
427
|
+
highlight(highlight: Highlight): Promise<HighlightResult>;
|
|
428
|
+
prompt(spec: PromptSpec, opts?: {
|
|
429
|
+
signal?: AbortSignal;
|
|
430
|
+
}): Promise<PromptResult>;
|
|
431
|
+
snapshot(): Promise<IWorkbook.JSON>;
|
|
432
|
+
whenAnswered(): Promise<void>;
|
|
433
|
+
/**
|
|
434
|
+
* The workbook lives in the client UI, so this writes a copy of it to `path`. The UI's workbook
|
|
435
|
+
* stays bound to its own file.
|
|
436
|
+
*/
|
|
437
|
+
save(path: string | undefined, opts?: SaveOptions): Promise<string>;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* The token identifying THIS server process, minted once at module load.
|
|
441
|
+
*
|
|
442
|
+
* @remarks
|
|
443
|
+
* Sandbox ids used to be `sandbox-<n>` off a process-local counter, which meant a restart handed
|
|
444
|
+
* `sandbox-1` to a different workbook — an agent that created a sandbox, lost the server, and then
|
|
445
|
+
* ran against `sandbox-1` could be answered confidently about the wrong file. That is strictly
|
|
446
|
+
* worse than an error, so the id carries who issued it.
|
|
447
|
+
*
|
|
448
|
+
* Time-ordered rather than purely random, because the ordering is what lets
|
|
449
|
+
* {@link SessionRegistry.explainUnknownId} separate an id from an EARLIER instance (a restart —
|
|
450
|
+
* sandboxes are in-memory and simply gone) from one issued by a CONCURRENTLY running server (another
|
|
451
|
+
* chat, or a duplicate registration — a different failure with a different fix). The trailing random character
|
|
452
|
+
* breaks the tie when two servers start in the same second, which duplicate registrations do.
|
|
453
|
+
*/
|
|
454
|
+
export declare const INSTANCE_TOKEN: string;
|
|
455
|
+
/**
|
|
456
|
+
* The single source of truth for open sessions. Replaces the old global connected/direct mode:
|
|
457
|
+
* the server ALWAYS owns sandboxes in-process, and ADDITIONALLY surfaces attended sessions from the
|
|
458
|
+
* relay when one is attached (the relay is the attended-session provider, not a mode selector).
|
|
459
|
+
*
|
|
460
|
+
* Routing: a `session_id` that resolves to a local sandbox executes in-process; otherwise it is a
|
|
461
|
+
* attended session and forwards to the relay.
|
|
462
|
+
*/
|
|
463
|
+
export declare class SessionRegistry {
|
|
464
|
+
private readonly discover;
|
|
465
|
+
private readonly sandboxes;
|
|
466
|
+
private activeId;
|
|
467
|
+
private counter;
|
|
468
|
+
private readonly startedAt;
|
|
469
|
+
/** The live relay, once discovered. Mutable: a client UI can start, stop and restart under us. */
|
|
470
|
+
private relayClient;
|
|
471
|
+
private lastProbeAt;
|
|
472
|
+
private probing;
|
|
473
|
+
/** Sessions that have died, oldest first. Capped — this is a hint, not an audit trail. */
|
|
474
|
+
private readonly closed;
|
|
475
|
+
/** The last SUCCESSFULLY observed attended list, for the departure/arrival diff. */
|
|
476
|
+
private lastAttended;
|
|
477
|
+
/** Lifecycle changes observed but not yet delivered on a tool result — see {@link SessionEvent}. */
|
|
478
|
+
private pendingEvents;
|
|
479
|
+
/** Whether the attended list has ever been successfully read (the diff baseline exists). */
|
|
480
|
+
private attendedObserved;
|
|
481
|
+
/** Whether at least one tool result has gone out — see the baseline rule in {@link reconcileAttended}. */
|
|
482
|
+
private deliveredOnce;
|
|
483
|
+
private static readonly CLOSED_LIMIT;
|
|
484
|
+
private static readonly EVENT_LIMIT;
|
|
485
|
+
/** How long a departed workbook stays eligible to be recognized as a reload rather than a close. */
|
|
486
|
+
private static readonly RELOAD_WINDOW_MS;
|
|
487
|
+
/**
|
|
488
|
+
* Discovery is a function rather than a pre-resolved client because presence CHANGES: the old
|
|
489
|
+
* shape resolved it once at startup, so a workbook opened after the server was invisible forever,
|
|
490
|
+
* and a UI restart left a stale endpoint whose failures were swallowed into "no sessions open".
|
|
491
|
+
*/
|
|
492
|
+
constructor(discover: () => Promise<RelayClient | null>);
|
|
493
|
+
/**
|
|
494
|
+
* Cooldown between negative probes. `discoverRelay` costs up to 2s against a stale lock, and a
|
|
495
|
+
* genuinely unattended server would otherwise pay that on every tool call.
|
|
496
|
+
*/
|
|
497
|
+
private static readonly REDISCOVER_COOLDOWN_MS;
|
|
498
|
+
/** The relay, discovering one if we have none and the cooldown has passed. */
|
|
499
|
+
private getRelay;
|
|
500
|
+
/**
|
|
501
|
+
* Forget the current relay after a failed call — the endpoint is stale (the UI restarted onto a
|
|
502
|
+
* new port/token). The cooldown is cleared rather than started: the failure WAS the probe, and
|
|
503
|
+
* the point of dropping is to re-discover at the next opportunity.
|
|
504
|
+
*/
|
|
505
|
+
private dropRelay;
|
|
506
|
+
/** Discover eagerly and report whether a relay is attached — for the startup log line. */
|
|
507
|
+
probeRelay(): Promise<boolean>;
|
|
508
|
+
/**
|
|
509
|
+
* The relay if one is ALREADY attached — never probes for one. For fire-and-forget side channels
|
|
510
|
+
* (the tool-call trace) that must add neither latency nor discovery cost to the call they are
|
|
511
|
+
* describing. A truly headless server has nowhere to send them anyway, and `info` — the required
|
|
512
|
+
* first call — has already discovered by the time there is anything interesting to say.
|
|
513
|
+
*/
|
|
514
|
+
get attachedRelay(): RelayClient | null;
|
|
515
|
+
/**
|
|
516
|
+
* Whether a client UI is attached, as of the last discovery. Read AFTER {@link list} — it is what
|
|
517
|
+
* turns an empty session list from a dead end into "nothing is listening" or "nothing is open".
|
|
518
|
+
*/
|
|
519
|
+
get relayAttached(): boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Creates a sandbox. `origin` may be omitted — it is settled by {@link inferSandboxOrigin} from
|
|
522
|
+
* the arguments that were passed, which is also the check an explicit origin is held to.
|
|
523
|
+
*/
|
|
524
|
+
createSandbox(origin: SandboxOrigin | undefined, opts?: {
|
|
525
|
+
path?: string;
|
|
526
|
+
name?: string;
|
|
527
|
+
source?: string;
|
|
528
|
+
}): Promise<SandboxSession>;
|
|
529
|
+
/** Resolves a sandbox by id, or the active sandbox when `id` is omitted. */
|
|
530
|
+
getSandbox(id?: string): SandboxSession | undefined;
|
|
531
|
+
/**
|
|
532
|
+
* Dispose a sandbox session. Attended (VS Code) sessions cannot be closed here — the UI owns their
|
|
533
|
+
* lifecycle — so a non-sandbox id is rejected.
|
|
534
|
+
*
|
|
535
|
+
* An id that IS sandbox-shaped but unknown gets the full explanation instead: "not a sandbox" is
|
|
536
|
+
* the one thing it definitely is not, and sending an agent to look for an attended session it will
|
|
537
|
+
* never find is the failure this whole pass exists to remove.
|
|
538
|
+
*/
|
|
539
|
+
closeSandbox(id: string): Promise<void>;
|
|
540
|
+
/**
|
|
541
|
+
* Resolves any session for a tool call. Precedence: a matching sandbox (or the active sandbox when
|
|
542
|
+
* `id` is omitted); otherwise, if a relay is attached, an attended session (the relay validates the id,
|
|
543
|
+
* and routes to its active workbook when `id` is omitted). Returns `undefined` when nothing matches.
|
|
544
|
+
*
|
|
545
|
+
* Sync and best-effort — it reads the last-known relay rather than discovering one. An id that is
|
|
546
|
+
* SHAPED like a sandbox never falls through to the relay: a dead sandbox id is a dead sandbox id,
|
|
547
|
+
* and handing it to the relay as a workbook id is how a lookup failure turns into an answer about
|
|
548
|
+
* the wrong workbook.
|
|
549
|
+
*/
|
|
550
|
+
resolveSession(id?: string): Session | undefined;
|
|
551
|
+
/**
|
|
552
|
+
* Resolve the target session for a tool call, validating against the live session list and
|
|
553
|
+
* producing friendly errors. Unlike {@link resolveSession} (sync, internal), this:
|
|
554
|
+
*
|
|
555
|
+
* - **requires** an `id` — an omitted one is refused with the open sessions listed, never
|
|
556
|
+
* defaulted. A default here is how a write reaches the human's open workbook without the
|
|
557
|
+
* agent ever naming it; the tool schemas require the field, and this is the backstop;
|
|
558
|
+
* - **validates** a provided `id` — an unknown id throws "no session with id …" instead of
|
|
559
|
+
* letting it fall through to the relay and surface a misleading "no workbook open" error;
|
|
560
|
+
* - **auto-selects** only on the {@link ACTIVE_SESSION} token — the sole open session if there
|
|
561
|
+
* is exactly one, else the unambiguous active session.
|
|
562
|
+
*
|
|
563
|
+
* Costs one relay round-trip (via {@link list}) per call when a relay is attached.
|
|
564
|
+
*/
|
|
565
|
+
resolveForTool(id?: string): Promise<Session>;
|
|
566
|
+
/**
|
|
567
|
+
* Fold a successful attended-session observation into the closed log and the events queue.
|
|
568
|
+
*
|
|
569
|
+
* @remarks
|
|
570
|
+
* With path-derived ids the common cases are the QUIET ones: a reload keeps the id and only
|
|
571
|
+
* moves `openedAt` (a `reset`), and a closed file reopens under the id the agent already holds
|
|
572
|
+
* (a `returned`, which withdraws the tombstone). The id-SWAP machinery below them — a departure
|
|
573
|
+
* recorded as `gone`, upgraded to `reloaded` when a same-document arrival shows up under a
|
|
574
|
+
* different id, matched by path/name across polls — survives for the sessions that still re-mint:
|
|
575
|
+
* untitled workbooks and older clients. Both halves of a swap need not land in the same poll, so
|
|
576
|
+
* both orders are handled.
|
|
577
|
+
*/
|
|
578
|
+
private reconcileAttended;
|
|
579
|
+
/** Queue an event for the next tool result, oldest evicted beyond the cap. */
|
|
580
|
+
private recordEvent;
|
|
581
|
+
/**
|
|
582
|
+
* Drain undelivered lifecycle events into the notice that rides the next tool result, or `null`
|
|
583
|
+
* when nothing changed. Call once per delivered result — draining IS the delivery.
|
|
584
|
+
*
|
|
585
|
+
* @remarks
|
|
586
|
+
* A same-batch reload arrives as two events (a departure upgraded to `reloaded`, and its
|
|
587
|
+
* arrival); they render as ONE line, because "Budget.xlsx was closed. Budget.xlsx was opened."
|
|
588
|
+
* invites the agent to mourn and re-plan when the only fact that matters is "your id changed".
|
|
589
|
+
* When the halves were delivered in different batches (the close was reported before the file
|
|
590
|
+
* came back), the arrival line does the repair instead: it names the dead id it replaces.
|
|
591
|
+
*/
|
|
592
|
+
drainEventsNotice(): string | null;
|
|
593
|
+
/** Append to the ring buffer, newest last, oldest evicted. */
|
|
594
|
+
private remember;
|
|
595
|
+
/** Sessions that are no longer usable, newest first. */
|
|
596
|
+
listClosed(): ClosedSession[];
|
|
597
|
+
/**
|
|
598
|
+
* Why an id did not resolve — the whole point of this method existing.
|
|
599
|
+
*
|
|
600
|
+
* @remarks
|
|
601
|
+
* `No session with id X. No sessions are open.` covered four different situations (never existed
|
|
602
|
+
* / the user closed the workbook / the sandbox was closed / this server restarted), and an agent
|
|
603
|
+
* had to run experiments to tell them apart. Each of those has a different next move, so each
|
|
604
|
+
* gets its own sentence.
|
|
605
|
+
*
|
|
606
|
+
* The two "this instance" answers need no lifecycle log: an ordinal at or below the counter was
|
|
607
|
+
* necessarily issued by us, and only `session_close` removes an entry — so the arithmetic proves
|
|
608
|
+
* "closed" without recording anything.
|
|
609
|
+
*/
|
|
610
|
+
/**
|
|
611
|
+
* The open sessions as a sentence, or — when there are none — which kind of none: a client UI
|
|
612
|
+
* with nothing open and no client UI at all have different next moves.
|
|
613
|
+
*/
|
|
614
|
+
private describeOpen;
|
|
615
|
+
private explainUnknownId;
|
|
616
|
+
/** Materialize a {@link Session} from a {@link SessionInfo} row (sandbox instance or relayed attended). */
|
|
617
|
+
private sessionFor;
|
|
618
|
+
/**
|
|
619
|
+
* Merged view: attended sessions (from the relay, if attached) followed by local sandboxes.
|
|
620
|
+
*
|
|
621
|
+
* @remarks
|
|
622
|
+
* Two attempts, not one. A client UI that restarts comes back on a new port with a new token, so
|
|
623
|
+
* the first call after a restart fails against the stale endpoint — dropping it and re-discovering
|
|
624
|
+
* inside the SAME call is what makes the user's workbook reappear now rather than one tool call
|
|
625
|
+
* later. Falling through with sandboxes only is still the last resort, but it is now the answer
|
|
626
|
+
* to "nothing is listening", not to "we are holding a dead endpoint".
|
|
627
|
+
*/
|
|
628
|
+
list(): Promise<SessionInfo[]>;
|
|
629
|
+
}
|
|
630
|
+
//# sourceMappingURL=SessionRegistry.d.ts.map
|