univer-cli 0.1.23 → 0.1.24

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.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x34e16e=_0x26a2;(function(_0x354fca,_0x4aebf0){const _0x38b082=_0x26a2,_0x5e8167=_0x354fca();while(!![]){try{const _0x372954=-parseInt(_0x38b082(0x154))/0x1+-parseInt(_0x38b082(0x162))/0x2+parseInt(_0x38b082(0x16e))/0x3*(parseInt(_0x38b082(0x16d))/0x4)+parseInt(_0x38b082(0x145))/0x5*(-parseInt(_0x38b082(0x167))/0x6)+-parseInt(_0x38b082(0x11a))/0x7+parseInt(_0x38b082(0x146))/0x8+parseInt(_0x38b082(0xf3))/0x9;if(_0x372954===_0x4aebf0)break;else _0x5e8167['push'](_0x5e8167['shift']());}catch(_0x3d2a0e){_0x5e8167['push'](_0x5e8167['shift']());}}}(_0x2ed0,0x4e27a));import'../chunks/vendor-CgwrUUL6.js';import{a as _0x14841a,i as _0x2e4137,n,o as _0x1992fc,r as _0x162b4d,t as _0x55fdc4}from'../chunks/trace-DPfd8LdJ.js';import{a as _0x386f94,d as _0x4cbc22,l as _0x1b48fa,m as _0x1f7e4c,n as _0x4fb273,u as _0x458e09}from'../chunks/node-BLWTwYLW.js';import{t as _0x461280}from'../chunks/build-id-Coc3wh1M.js';import{n as _0x2162b3}from'../chunks/runtime-manifest-D6bFR_JZ.js';import{existsSync as _0x23ebfc}from'node:fs';import{chmod as _0xf05445,mkdir as _0x52846a,readFile as _0x394518,rm as _0x45485d,writeFile as _0x29c871}from'node:fs/promises';import _0x54c65c from'node:net';import _0x56bb65 from'node:process';var S=0x2bf20,C=new _0x4fb273();async function w(_0x1c2c3b={}){const _0x147151=_0x26a2;let _0x26c211=_0x1c2c3b[_0x147151(0x123)]??_0x56bb65[_0x147151(0x123)],_0x215185=_0x458e09(_0x26c211),_0x326dd2=_0x2162b3(_0x26c211),_0x2c0531=_0x1c2c3b[_0x147151(0x139)]??D(new _0x386f94({'env':_0x26c211,'logger':_0x4cbc22({'env':_0x26c211,'role':_0x14841a[_0x147151(0x12d)]}),'resolveExecutionPlaneOptions':()=>({'execArgv':[..._0x326dd2[_0x147151(0x119)][_0x147151(0x10f)]],'modulePath':_0x326dd2[_0x147151(0x119)][_0x147151(0x141)]}),'rpcTimeoutMs':S})),_0x11ab9b=_0x461280(_0x26c211),_0x5445c6=new Date()[_0x147151(0x142)]();if(await _0x52846a(_0x215185[_0x147151(0x16f)],{'recursive':!0x0,'mode':0x1c0}),await _0x52846a(_0x215185[_0x147151(0x150)],{'recursive':!0x0,'mode':0x1c0}),!await N(_0x215185[_0x147151(0x115)],_0x215185[_0x147151(0x14c)])){if(await P(_0x215185['socketPath']))return;throw Error(_0x147151(0x105)+_0x215185['lockPath']);}await M(_0x215185);let _0x35093c=_0x4cbc22({'env':_0x26c211,'role':_0x14841a[_0x147151(0x122)]}),_0x4ffbfb=A({'buildId':_0x11ab9b,'env':_0x26c211,'pid':_0x56bb65[_0x147151(0xfa)]}),_0x537af8=!0x1,_0x382c11={},_0x551967=async _0x5693f2=>B(null,-0x7f5b,Error(_0x147151(0x120)+_0x5693f2)),_0x52b3a2=_0x54c65c[_0x147151(0xff)](_0x461f20=>{const _0x547e4c=_0x147151;let _0x1e284f='';_0x461f20['on'](_0x547e4c(0x121),_0x67ee02=>{const _0x1959d4=_0x547e4c;_0x1e284f+=_0x67ee02[_0x1959d4(0x147)](_0x1959d4(0x124)),_0x2bd65b();}),_0x461f20['on'](_0x547e4c(0x165),()=>void 0x0);let _0x2bd65b=async()=>{const _0x446bfb=_0x547e4c;for(;;){let _0x42492c=_0x1e284f[_0x446bfb(0x108)]('\x0a');if(_0x42492c<0x0)return;let _0x51a991=_0x1e284f[_0x446bfb(0xf5)](0x0,_0x42492c)[_0x446bfb(0x157)]();if(_0x1e284f=_0x1e284f[_0x446bfb(0xf5)](_0x42492c+0x1),!_0x51a991)continue;let _0x5532a4=await _0x551967(_0x51a991);_0x461f20[_0x446bfb(0x158)](JSON['stringify'](_0x5532a4)+'\x0a');}};});_0x551967=T({'buildId':_0x11ab9b,'logRequestEvent':async _0x2cc94d=>{const _0x37a079=_0x147151;_0x35093c['event']({'level':_0x2cc94d[_0x37a079(0x132)]===_0x2e4137[_0x37a079(0x14a)]?_0x37a079(0x165):_0x37a079(0x11d),'event_name':_0x2cc94d['eventName'],'component':_0x162b4d[_0x37a079(0x122)],'process_role':_0x14841a[_0x37a079(0x122)],..._0x2cc94d['error']===void 0x0?{}:{'error':_0x2cc94d[_0x37a079(0x165)]},'fields':{..._0x4ffbfb,..._0x2cc94d['durationMs']===void 0x0?{}:{'duration_ms':_0x2cc94d[_0x37a079(0x133)]},'method':_0x2cc94d[_0x37a079(0x15e)],'timestamp':_0x2cc94d[_0x37a079(0x16a)]}});},'logRequestError':async _0x4aa9ed=>{const _0x1106c2=_0x147151;_0x35093c[_0x1106c2(0x165)]({'event_name':_0x2e4137[_0x1106c2(0x14a)],'component':_0x162b4d[_0x1106c2(0x122)],'process_role':_0x14841a['Daemon'],'error':_0x4aa9ed['error'],'fields':{..._0x4ffbfb,'method':_0x4aa9ed[_0x1106c2(0x15e)],'timestamp':_0x4aa9ed[_0x1106c2(0x16a)]}});},'onShutdownRequest':()=>{const _0x4904ee=_0x147151;_0x229a21(_0x4904ee(0x135))['finally'](()=>{const _0x4f0ad5=_0x4904ee;_0x56bb65[_0x4f0ad5(0x129)](0x0);});},'pid':_0x56bb65[_0x147151(0xfa)],'runtimeRoot':_0x215185[_0x147151(0x11b)],'sessionHost':_0x2c0531,'socketPath':_0x215185[_0x147151(0x10b)],'startedAt':_0x5445c6}),await new Promise((_0x56f743,_0x557f73)=>{const _0x26166f=_0x147151;_0x52b3a2[_0x26166f(0xfc)](_0x26166f(0x165),_0x557f73),_0x52b3a2[_0x26166f(0x155)](_0x215185[_0x26166f(0x10b)],_0x56f743);}),_0x1b48fa(_0x215185[_0x147151(0x10b)])||await _0xf05445(_0x215185[_0x147151(0x10b)],0x180);let _0x2eaf8b={'pid':_0x56bb65['pid'],'startedAt':_0x5445c6,'socketPath':_0x215185[_0x147151(0x10b)],'runtimeRoot':_0x215185[_0x147151(0x11b)],'buildId':_0x11ab9b};await _0x29c871(_0x215185['pidPath'],String(_0x56bb65['pid']),_0x147151(0x124)),await _0x29c871(_0x215185[_0x147151(0x102)],JSON[_0x147151(0x15b)](_0x2eaf8b,null,0x2),'utf8'),_0x35093c['info']({'event_name':_0x2e4137[_0x147151(0x160)],'component':_0x162b4d[_0x147151(0x122)],'process_role':_0x14841a['Daemon'],'fields':{..._0x4ffbfb,'pid':_0x56bb65[_0x147151(0xfa)],'runtime_root':_0x215185[_0x147151(0x11b)],'socket_path':_0x215185['socketPath'],'started_at':_0x5445c6}}),await _0x35093c['flush']();let _0x17d420=setInterval(()=>{const _0x3052f6=_0x147151;_0x2c0531[_0x3052f6(0x169)]();},Math['max'](0x3e8,Math[_0x147151(0x170)](_0x2c0531[_0x147151(0x107)](),0xea60)));_0x17d420[_0x147151(0x130)](),_0x382c11[_0x147151(0x12f)]=_0x17d420;async function _0x229a21(_0x31bb6a){const _0x44c497=_0x147151;_0x537af8||(_0x537af8=!0x0,_0x382c11['current']!==void 0x0&&clearInterval(_0x382c11[_0x44c497(0x12f)]),_0x35093c[_0x44c497(0x11d)]({'event_name':_0x2e4137[_0x44c497(0x15c)],'component':_0x162b4d['Daemon'],'process_role':_0x14841a['Daemon'],'fields':{..._0x4ffbfb,'pid':_0x56bb65[_0x44c497(0xfa)],'reason':_0x31bb6a,'timestamp':new Date()[_0x44c497(0x142)]()}}),await _0x35093c[_0x44c497(0x14e)](),await _0x2c0531[_0x44c497(0x11c)](_0x31bb6a),await new Promise(_0x1f292c=>{const _0x9bc294=_0x44c497;_0x52b3a2[_0x9bc294(0x12b)](()=>_0x1f292c());}),await I(_0x215185[_0x44c497(0x10b)]),await _0x45485d(_0x215185[_0x44c497(0x14c)],{'force':!0x0})[_0x44c497(0x13e)](()=>void 0x0),await _0x45485d(_0x215185[_0x44c497(0x102)],{'force':!0x0})[_0x44c497(0x13e)](()=>void 0x0),await _0x45485d(_0x215185[_0x44c497(0x115)],{'recursive':!0x0,'force':!0x0})[_0x44c497(0x13e)](()=>void 0x0));}_0x56bb65['on'](_0x147151(0x149),()=>{const _0x5564d7=_0x147151;_0x229a21(_0x5564d7(0x134))['finally'](()=>{const _0x2ee4e4=_0x5564d7;_0x56bb65[_0x2ee4e4(0x129)](0x0);});}),_0x56bb65['on'](_0x147151(0x114),()=>{_0x229a21('sigterm')['finally'](()=>{const _0x54e573=_0x26a2;_0x56bb65[_0x54e573(0x129)](0x0);});});}function _0x26a2(_0x4c9ae6,_0x5cffb1){_0x4c9ae6=_0x4c9ae6-0xf3;const _0x2ed077=_0x2ed0();let _0x26a2b7=_0x2ed077[_0x4c9ae6];return _0x26a2b7;}function T(_0x38478d){return async _0x557b94=>{const _0x1c3ea8=_0x26a2;let _0x5deadb;try{_0x5deadb=JSON[_0x1c3ea8(0x140)](_0x557b94);}catch(_0x2b45d4){return B(null,-0x7fbc,_0x2b45d4);}let _0x1f1bb2=_0x55fdc4(_0x5deadb['meta']?.[_0x1c3ea8(0x12c)]),_0x254300=async()=>await n['withSpan']({'name':_0x1992fc[_0x1c3ea8(0x12a)],'kind':'server'},async()=>{const _0x1cc4cb=_0x1c3ea8;let _0x1a06eb=Date[_0x1cc4cb(0x104)]();await _0x38478d[_0x1cc4cb(0x12e)]?.({'eventName':_0x2e4137[_0x1cc4cb(0x112)],'method':_0x5deadb[_0x1cc4cb(0x15e)],'timestamp':new Date()[_0x1cc4cb(0x142)]()});try{let _0x215f75=await E(_0x5deadb,_0x38478d);return await _0x38478d[_0x1cc4cb(0x12e)]?.({'durationMs':Date['now']()-_0x1a06eb,'eventName':_0x2e4137[_0x1cc4cb(0x13d)],'method':_0x5deadb[_0x1cc4cb(0x15e)],'timestamp':new Date()[_0x1cc4cb(0x142)]()}),_0x215f75;}catch(_0xaf4343){return await _0x38478d[_0x1cc4cb(0x12e)]?.({'durationMs':Date[_0x1cc4cb(0x104)]()-_0x1a06eb,'eventName':_0x2e4137[_0x1cc4cb(0x14a)],'method':_0x5deadb[_0x1cc4cb(0x15e)],'error':_0xaf4343,'timestamp':new Date()[_0x1cc4cb(0x142)]()}),_0x38478d[_0x1cc4cb(0x12e)]===void 0x0&&await _0x38478d[_0x1cc4cb(0x166)]?.({'method':_0x5deadb[_0x1cc4cb(0x15e)],'error':_0xaf4343 instanceof Error?_0xaf4343[_0x1cc4cb(0x159)]:String(_0xaf4343),'timestamp':new Date()[_0x1cc4cb(0x142)]()}),B(_0x5deadb['id'],-0x7f5b,_0xaf4343);}});return _0x1f1bb2===void 0x0?await _0x254300():await n[_0x1c3ea8(0x13c)](_0x1f1bb2,_0x254300);};}async function E(_0x4b1cc4,_0x1f64c1){const _0x49a5e0=_0x26a2;switch(_0x4b1cc4[_0x49a5e0(0x15e)]){case _0x1f7e4c[_0x49a5e0(0x13b)]:return{'jsonrpc':_0x49a5e0(0x16c),'id':_0x4b1cc4['id'],'result':{'ok':!0x0,'pid':_0x1f64c1['pid'],'startedAt':_0x1f64c1[_0x49a5e0(0x131)],'socketPath':_0x1f64c1[_0x49a5e0(0x10b)],'runtimeRoot':_0x1f64c1[_0x49a5e0(0x126)],'buildId':_0x1f64c1[_0x49a5e0(0x143)],'sessionCount':_0x1f64c1[_0x49a5e0(0x139)][_0x49a5e0(0x103)]()}};case _0x1f7e4c[_0x49a5e0(0x16b)]:return _0x1f64c1['onShutdownRequest']?.(),{'jsonrpc':_0x49a5e0(0x16c),'id':_0x4b1cc4['id'],'result':{'stopping':!0x0}};case _0x1f7e4c[_0x49a5e0(0x117)]:{let _0x2e2b4e=await _0x1f64c1['sessionHost'][_0x49a5e0(0x14f)](_0x4b1cc4[_0x49a5e0(0x13a)]);return z(_0x4b1cc4['id'],_0x2e2b4e);}case _0x1f7e4c[_0x49a5e0(0x156)]:{let _0x2cf64b=await _0x1f64c1[_0x49a5e0(0x139)][_0x49a5e0(0x15d)](_0x4b1cc4['params']);return z(_0x4b1cc4['id'],_0x2cf64b);}case _0x1f7e4c[_0x49a5e0(0x138)]:{let _0x40eb7a=await _0x1f64c1[_0x49a5e0(0x139)][_0x49a5e0(0x111)](_0x4b1cc4[_0x49a5e0(0x13a)]);return z(_0x4b1cc4['id'],_0x40eb7a);}case _0x1f7e4c[_0x49a5e0(0xf9)]:{let _0x3f8d9e=await _0x1f64c1[_0x49a5e0(0x139)][_0x49a5e0(0x15f)](_0x4b1cc4[_0x49a5e0(0x13a)]);return z(_0x4b1cc4['id'],_0x3f8d9e);}case _0x1f7e4c['SessionExportWorkbookFile']:{let _0x587370=await _0x1f64c1[_0x49a5e0(0x139)][_0x49a5e0(0x168)](_0x4b1cc4['params']);return z(_0x4b1cc4['id'],_0x587370);}case _0x1f7e4c[_0x49a5e0(0x152)]:{let _0x421f11=_0x4b1cc4['params'],_0x34d761=await _0x1f64c1[_0x49a5e0(0x139)]['exportWorkbookData'](_0x421f11);return z(_0x4b1cc4['id'],_0x34d761);}case _0x1f7e4c[_0x49a5e0(0x171)]:{let _0x9aee5b=await _0x1f64c1['sessionHost']['dispose'](_0x4b1cc4[_0x49a5e0(0x13a)]);return z(_0x4b1cc4['id'],_0x9aee5b);}case _0x1f7e4c[_0x49a5e0(0x161)]:{let _0x222065=await _0x1f64c1[_0x49a5e0(0x139)]['getWorkbookSession'](_0x4b1cc4[_0x49a5e0(0x13a)]);return z(_0x4b1cc4['id'],_0x222065);}default:return B(_0x4b1cc4['id'],-0x7f59,Error(_0x49a5e0(0xf6)+_0x4b1cc4[_0x49a5e0(0x15e)]));}}function D(_0x69e18e){return{async 'createWorkbook'(_0x304374){const _0x4cd6ab=_0x26a2;let _0x5919bd=await O(_0x304374),_0x1440b7=await _0x69e18e['createWorkbook']({..._0x304374['cwd']===void 0x0?{}:{'cwd':_0x304374[_0x4cd6ab(0xf8)]},'identity':_0x5919bd,..._0x304374['id']===void 0x0?{}:{'workbookId':_0x304374['id']},..._0x304374[_0x4cd6ab(0x101)]===void 0x0?{}:{'workbookName':_0x304374[_0x4cd6ab(0x101)]}});return{'success':!0x0,'workbookData':_0x1440b7[_0x4cd6ab(0xf7)],'session':k(_0x1440b7[_0x4cd6ab(0x10e)])};},async 'dispose'(_0x58415e){const _0x51bba5=_0x26a2;let _0x2c2989=await O(_0x58415e);return await _0x69e18e[_0x51bba5(0x15a)]({..._0x58415e[_0x51bba5(0xf8)]===void 0x0?{}:{'cwd':_0x58415e[_0x51bba5(0xf8)]},'identity':_0x2c2989}),{'disposed':!0x0,'workbookIdentity':_0x2c2989[_0x51bba5(0x109)]};},async 'destroyAll'(_0x4c032c){const _0x4f2f3b=_0x26a2;await _0x69e18e[_0x4f2f3b(0x11c)]?.(_0x4c032c);},async 'evalJs'(_0x49ba90){const _0x20b0e5=_0x26a2;let _0x46bb6e=await O(_0x49ba90),_0x5018de=await _0x69e18e[_0x20b0e5(0x15f)]({'code':_0x49ba90[_0x20b0e5(0xfb)],..._0x49ba90['cwd']===void 0x0?{}:{'cwd':_0x49ba90[_0x20b0e5(0xf8)]},'identity':_0x46bb6e,..._0x49ba90[_0x20b0e5(0x10a)]===void 0x0?{}:{'maxCodeLength':_0x49ba90[_0x20b0e5(0x10a)]},..._0x49ba90['mutates']===void 0x0?{}:{'mutates':_0x49ba90[_0x20b0e5(0x118)]}});return{..._0x5018de[_0x20b0e5(0x127)]===void 0x0?{}:{'mutations':_0x5018de[_0x20b0e5(0x127)]},'success':!0x0,'value':_0x5018de[_0x20b0e5(0x164)],'session':k(_0x5018de[_0x20b0e5(0x10e)])};},async 'exportWorkbookData'(_0x1e73f2){const _0x55fd6e=_0x26a2;let _0x54792d=await O(_0x1e73f2),_0x8ca8c4=await _0x69e18e[_0x55fd6e(0x110)]({..._0x1e73f2[_0x55fd6e(0xf8)]===void 0x0?{}:{'cwd':_0x1e73f2[_0x55fd6e(0xf8)]},'identity':_0x54792d});return{'success':!0x0,'workbookData':_0x8ca8c4['workbookData'],'session':k(_0x8ca8c4[_0x55fd6e(0x10e)])};},async 'exportWorkbookFile'(_0x29574d){const _0x2c9982=_0x26a2;let _0x3d83aa=await O(_0x29574d),_0x3ede6c=await _0x69e18e[_0x2c9982(0x168)]({..._0x29574d[_0x2c9982(0xf8)]===void 0x0?{}:{'cwd':_0x29574d[_0x2c9982(0xf8)]},'format':_0x29574d[_0x2c9982(0x144)],'identity':_0x3d83aa,'outputPath':_0x29574d[_0x2c9982(0x10c)]});return{'success':!0x0,'format':_0x3ede6c[_0x2c9982(0x144)],'outputPath':_0x3ede6c[_0x2c9982(0x10c)],'sizeBytes':_0x3ede6c[_0x2c9982(0x13f)],'session':k(_0x3ede6c[_0x2c9982(0x10e)])};},async 'getWorkbookSession'(_0x38454a){const _0x550832=_0x26a2;let _0x273f64=await O(_0x38454a),_0x73e345=await _0x69e18e[_0x550832(0x136)]({..._0x38454a[_0x550832(0xf8)]===void 0x0?{}:{'cwd':_0x38454a[_0x550832(0xf8)]},'identity':_0x273f64});return{'exists':_0x73e345!==null,'session':_0x73e345===null?null:k(_0x73e345)};},'getSessionCount'(){const _0x3347e4=_0x26a2;return _0x69e18e[_0x3347e4(0x103)]?.()??0x0;},'getSessionIdleTtlMs'(){const _0x25b5c2=_0x26a2;return _0x69e18e[_0x25b5c2(0x107)]?.()??0xea60;},async 'loadWorkbook'(_0x426722){const _0x4f295d=_0x26a2;let _0x562daa=await O(_0x426722),_0x41af06=await _0x69e18e[_0x4f295d(0xfe)]({..._0x426722[_0x4f295d(0xf8)]===void 0x0?{}:{'cwd':_0x426722[_0x4f295d(0xf8)]},'identity':_0x562daa,'workbookData':_0x426722[_0x4f295d(0xf7)]});return{'success':!0x0,'workbookData':_0x41af06[_0x4f295d(0xf7)],'session':k(_0x41af06[_0x4f295d(0x10e)])};},async 'loadWorkbookDataReplayPack'(_0xf03eaf){const _0x5a64f9=_0x26a2;let _0x293870=await O(_0xf03eaf);return{'success':!0x0,'session':k((await _0x69e18e[_0x5a64f9(0x15d)]({..._0xf03eaf[_0x5a64f9(0xf8)]===void 0x0?{}:{'cwd':_0xf03eaf[_0x5a64f9(0xf8)]},'identity':_0x293870,'replayPack':{'baseWorkbookData':_0xf03eaf['baseWorkbookData'],'mutations':_0xf03eaf[_0x5a64f9(0x127)]}}))['session'])};},async 'unloadIdleSessions'(){const _0x399201=_0x26a2;await _0x69e18e[_0x399201(0x169)]?.();}};}async function O(_0x2d9ff7){const _0x36607d=_0x26a2;return await C[_0x36607d(0x148)](_0x2d9ff7);}function k(_0x2fa862){const _0x3888b2=_0x26a2;return{'createdAt':_0x2fa862[_0x3888b2(0x125)]??'','lastAccessedAt':_0x2fa862[_0x3888b2(0x128)]??'','sessionId':_0x2fa862[_0x3888b2(0x100)],'workbookIdentity':_0x2fa862['packageIdentity'][_0x3888b2(0x109)]};}function A(_0x47197d){const _0x2d27d0=_0x26a2;return{'build.id':j(_0x47197d['env'],_0x2d27d0(0x11e))??_0x47197d[_0x2d27d0(0x143)],'deployment.environment.name':_0x2d27d0(0x11f),'distribution.channel':j(_0x47197d[_0x2d27d0(0x123)],'UNIVER_DISTRIBUTION_CHANNEL')??_0x2d27d0(0x153),'service.instance.id':String(_0x47197d[_0x2d27d0(0xfa)]),'service.name':_0x2d27d0(0x14b),...j(_0x47197d[_0x2d27d0(0x123)],'UNIVER_CLI_VERSION')===void 0x0?{}:{'service.version':j(_0x47197d[_0x2d27d0(0x123)],_0x2d27d0(0x10d))}};}function j(_0x4fc6af,_0x21cc45){const _0x4c53a1=_0x26a2;let _0x5036ef=_0x4fc6af[_0x21cc45]?.['trim']();return _0x5036ef===void 0x0||_0x5036ef[_0x4c53a1(0x106)]===0x0?void 0x0:_0x5036ef;}async function M(_0x3f1e16){const _0x1ecb18=_0x26a2;F(_0x3f1e16['socketPath'])&&!await P(_0x3f1e16[_0x1ecb18(0x10b)])&&await I(_0x3f1e16[_0x1ecb18(0x10b)]);let _0xcb33e=await L(_0x3f1e16[_0x1ecb18(0x14c)]);_0xcb33e!==null&&!R(_0xcb33e)&&(await _0x45485d(_0x3f1e16[_0x1ecb18(0x14c)],{'force':!0x0})[_0x1ecb18(0x13e)](()=>void 0x0),await _0x45485d(_0x3f1e16[_0x1ecb18(0x102)],{'force':!0x0})['catch'](()=>void 0x0),await _0x45485d(_0x3f1e16[_0x1ecb18(0x115)],{'recursive':!0x0,'force':!0x0})[_0x1ecb18(0x13e)](()=>void 0x0));}async function N(_0x34ab9c,_0x4a73d5){const _0xd80ff6=_0x26a2;try{return await _0x52846a(_0x34ab9c,{'recursive':!0x1,'mode':0x1c0}),!0x0;}catch(_0x601bfa){if(_0x601bfa[_0xd80ff6(0xfb)]!==_0xd80ff6(0x14d))throw _0x601bfa;let _0x41ed18=await L(_0x4a73d5);return _0x41ed18!==null&&R(_0x41ed18)?!0x1:(await _0x45485d(_0x34ab9c,{'recursive':!0x0,'force':!0x0}),await _0x52846a(_0x34ab9c,{'recursive':!0x1,'mode':0x1c0}),!0x0);}}async function P(_0x19cc66){return await new Promise(_0x4ef729=>{const _0x3e9fe2=_0x26a2;let _0x1f1227=_0x54c65c[_0x3e9fe2(0x113)](_0x19cc66);_0x1f1227[_0x3e9fe2(0xfc)](_0x3e9fe2(0x163),()=>{const _0x3052f9=_0x3e9fe2;_0x1f1227[_0x3052f9(0xf4)](),_0x4ef729(!0x0);}),_0x1f1227[_0x3e9fe2(0xfc)]('error',()=>{_0x4ef729(!0x1);});});}function F(_0x1c67b3){return _0x1b48fa(_0x1c67b3)?!0x1:_0x23ebfc(_0x1c67b3);}async function I(_0x3d73c4){const _0x249f2c=_0x26a2;_0x1b48fa(_0x3d73c4)||await _0x45485d(_0x3d73c4,{'force':!0x0})[_0x249f2c(0x13e)](()=>void 0x0);}async function L(_0x1da5bd){const _0x2f8c86=_0x26a2;try{let _0x2a3b45=await _0x394518(_0x1da5bd,_0x2f8c86(0x124)),_0x19a952=Number(_0x2a3b45[_0x2f8c86(0x157)]());return Number['isFinite'](_0x19a952)?_0x19a952:null;}catch{return null;}}function R(_0x52e6af){const _0x3ce1cd=_0x26a2;try{return _0x56bb65[_0x3ce1cd(0x116)](_0x52e6af,0x0),!0x0;}catch{return!0x1;}}function _0x2ed0(){const _0x592bf1=['sigint','rpc-shutdown','getSession','serve','SessionCreateWorkbook','sessionHost','params','Health','withContext','DaemonRpcFinish','catch','sizeBytes','parse','modulePath','toISOString','buildId','format','1401840FeKyGR','4414400hgEpsx','toString','resolveIdentity','SIGINT','DaemonRpcError','univer-daemon','pidPath','EEXIST','flush','loadWorkbook','sessionRoot','Unknown\x20daemon\x20subcommand:\x20','SessionExportWorkbookData','unknown','498126eoRrdC','listen','SessionLoadWorkbookDataReplayPack','trim','write','message','dispose','stringify','DaemonStop','loadWorkbookDataReplayPack','method','evalJs','DaemonStart','SessionGetWorkbook','645968uMpzWJ','connect','value','error','logRequestError','6qUyatP','exportWorkbookFile','unloadIdleSessions','timestamp','Shutdown','2.0','1145884YEgSHv','3BVZvko','daemonDir','min','SessionDispose','5489739vmkwEz','end','slice','Method\x20not\x20found:\x20','workbookData','cwd','SessionEvalJs','pid','code','once','argv','loadWorkbookData','createServer','sessionId','name','metaPath','getSessionCount','now','Another\x20daemon\x20startup\x20owns\x20','length','getSessionIdleTtlMs','indexOf','absolutePath','maxCodeLength','socketPath','outputPath','UNIVER_CLI_VERSION','session','execArgv','exportWorkbookData','createWorkbook','DaemonRpcStart','createConnection','SIGTERM','lockPath','kill','SessionLoadWorkbook','mutates','runtimeExecutionPlaneEntry','186494bezLeK','homeDir','destroyAll','info','UNIVER_CLI_BUILD_ID','local','Daemon\x20handler\x20not\x20ready:\x20','data','Daemon','env','utf8','createdAt','runtimeRoot','mutations','lastAccessedAt','exit','DaemonRpcServer','close','traceparent','Runtime','logRequestEvent','current','unref','startedAt','eventName','durationMs'];_0x2ed0=function(){return _0x592bf1;};return _0x2ed0();}function z(_0x192128,_0x3a44f8){const _0xc2f987=_0x26a2;return{'jsonrpc':_0xc2f987(0x16c),'id':_0x192128,'result':_0x3a44f8};}function B(_0x3fe89c,_0x2b252f,_0x588ded){const _0xa07a0f=_0x26a2;return{'jsonrpc':'2.0','id':_0x3fe89c,'error':{'code':_0x2b252f,'message':_0x588ded instanceof Error?_0x588ded[_0xa07a0f(0x159)]:String(_0x588ded)}};}var V=process[_0x34e16e(0xfd)][0x2]??_0x34e16e(0x137);V!==_0x34e16e(0x137)&&(console['error'](_0x34e16e(0x151)+V),process[_0x34e16e(0x129)](0x1)),w()[_0x34e16e(0x13e)](_0x1337a1=>{const _0xdc0d25=_0x34e16e;console['error'](_0x1337a1 instanceof Error?_0x1337a1[_0xdc0d25(0x159)]:String(_0x1337a1)),process['exit'](0x1);});
2
+ const _0x1f5815=_0x5964;(function(_0x39b04a,_0x3018f8){const _0xb77ede=_0x5964,_0x2f5174=_0x39b04a();while(!![]){try{const _0x455fc3=-parseInt(_0xb77ede(0x91))/0x1*(parseInt(_0xb77ede(0x71))/0x2)+-parseInt(_0xb77ede(0x70))/0x3*(parseInt(_0xb77ede(0xb2))/0x4)+-parseInt(_0xb77ede(0x72))/0x5*(-parseInt(_0xb77ede(0x7b))/0x6)+-parseInt(_0xb77ede(0xa3))/0x7*(parseInt(_0xb77ede(0x75))/0x8)+parseInt(_0xb77ede(0x8c))/0x9+-parseInt(_0xb77ede(0xc7))/0xa*(parseInt(_0xb77ede(0x9a))/0xb)+-parseInt(_0xb77ede(0x8e))/0xc*(-parseInt(_0xb77ede(0xbc))/0xd);if(_0x455fc3===_0x3018f8)break;else _0x2f5174['push'](_0x2f5174['shift']());}catch(_0x33a698){_0x2f5174['push'](_0x2f5174['shift']());}}}(_0xa988,0x2a17a));import'../chunks/vendor-CgwrUUL6.js';import{a as _0x2f7a7b,i as _0x510568,n,o as _0x1a68e8,r as _0x39825b,t as _0x2d3714}from'../chunks/trace-DPfd8LdJ.js';import{a as _0x41dc62,d as _0x41c736,l as _0x261233,m as _0x3807a4,n as _0x3248ed,u as _0x4eb6ee}from'../chunks/node-BLWTwYLW.js';import{t as _0x35a4a2}from'../chunks/build-id-Coc3wh1M.js';import{n as _0x395242}from'../chunks/runtime-manifest-D6bFR_JZ.js';import{existsSync as _0x56bc9e}from'node:fs';import{chmod as _0x1891fb,mkdir as _0x10b2f8,readFile as _0x1fd745,rm as _0x54d075,writeFile as _0x536c4c}from'node:fs/promises';import _0x362a8b from'node:net';import _0x1aa976 from'node:process';var S=0x2bf20,C=new _0x3248ed();async function w(_0x6d8c5a={}){const _0x2da84a=_0x5964;let _0x1d35a8=_0x6d8c5a['env']??_0x1aa976['env'],_0x56b658=_0x4eb6ee(_0x1d35a8),_0x4459ba=_0x395242(_0x1d35a8),_0x162594=_0x6d8c5a[_0x2da84a(0x88)]??D(new _0x41dc62({'env':_0x1d35a8,'logger':_0x41c736({'env':_0x1d35a8,'role':_0x2f7a7b[_0x2da84a(0xb8)]}),'resolveExecutionPlaneOptions':()=>({'execArgv':[..._0x4459ba[_0x2da84a(0x73)][_0x2da84a(0xd5)]],'modulePath':_0x4459ba[_0x2da84a(0x73)]['modulePath']}),'rpcTimeoutMs':S})),_0x868b7b=_0x35a4a2(_0x1d35a8),_0x210275=new Date()[_0x2da84a(0xa8)]();if(await _0x10b2f8(_0x56b658[_0x2da84a(0x8f)],{'recursive':!0x0,'mode':0x1c0}),await _0x10b2f8(_0x56b658[_0x2da84a(0xd3)],{'recursive':!0x0,'mode':0x1c0}),!await N(_0x56b658[_0x2da84a(0x6b)],_0x56b658['pidPath'])){if(await P(_0x56b658[_0x2da84a(0xe0)]))return;throw Error(_0x2da84a(0xb3)+_0x56b658[_0x2da84a(0x6b)]);}await M(_0x56b658);let _0x2b740f=_0x41c736({'env':_0x1d35a8,'role':_0x2f7a7b[_0x2da84a(0xe5)]}),_0x270cc4=A({'buildId':_0x868b7b,'env':_0x1d35a8,'pid':_0x1aa976[_0x2da84a(0xdf)]}),_0x136931=!0x1,_0x498e60={},_0x5b9c8e=async _0x35764d=>B(null,-0x7f5b,Error(_0x2da84a(0x6d)+_0x35764d)),_0x3ced67=_0x362a8b[_0x2da84a(0xca)](_0x308738=>{const _0x589185=_0x2da84a;let _0xed2eaf='';_0x308738['on'](_0x589185(0xaf),_0x543b78=>{const _0x4e7a8b=_0x589185;_0xed2eaf+=_0x543b78[_0x4e7a8b(0xe4)]('utf8'),_0x5c6717();}),_0x308738['on'](_0x589185(0xdd),()=>void 0x0);let _0x5c6717=async()=>{const _0x596475=_0x589185;for(;;){let _0x5e8042=_0xed2eaf['indexOf']('\x0a');if(_0x5e8042<0x0)return;let _0x26da85=_0xed2eaf[_0x596475(0xd8)](0x0,_0x5e8042)[_0x596475(0xba)]();if(_0xed2eaf=_0xed2eaf[_0x596475(0xd8)](_0x5e8042+0x1),!_0x26da85)continue;let _0x25af18=await _0x5b9c8e(_0x26da85);_0x308738[_0x596475(0xc2)](JSON[_0x596475(0xc5)](_0x25af18)+'\x0a');}};});_0x5b9c8e=T({'buildId':_0x868b7b,'logRequestEvent':async _0x2e08a8=>{const _0x325ab8=_0x2da84a;_0x2b740f[_0x325ab8(0xd2)]({'level':_0x2e08a8[_0x325ab8(0xad)]===_0x510568[_0x325ab8(0x6a)]?_0x325ab8(0xdd):_0x325ab8(0xda),'event_name':_0x2e08a8[_0x325ab8(0xad)],'component':_0x39825b[_0x325ab8(0xe5)],'process_role':_0x2f7a7b[_0x325ab8(0xe5)],..._0x2e08a8['error']===void 0x0?{}:{'error':_0x2e08a8['error']},'fields':{..._0x270cc4,..._0x2e08a8[_0x325ab8(0xd7)]===void 0x0?{}:{'duration_ms':_0x2e08a8[_0x325ab8(0xd7)]},'method':_0x2e08a8['method'],'timestamp':_0x2e08a8[_0x325ab8(0x94)]}});},'logRequestError':async _0x8d74c2=>{const _0x967558=_0x2da84a;_0x2b740f[_0x967558(0xdd)]({'event_name':_0x510568['DaemonRpcError'],'component':_0x39825b['Daemon'],'process_role':_0x2f7a7b[_0x967558(0xe5)],'error':_0x8d74c2['error'],'fields':{..._0x270cc4,'method':_0x8d74c2[_0x967558(0x98)],'timestamp':_0x8d74c2[_0x967558(0x94)]}});},'onShutdownRequest':()=>{const _0x4f7646=_0x2da84a;_0x1c2a76(_0x4f7646(0x9d))[_0x4f7646(0xb7)](()=>{const _0x1a52cd=_0x4f7646;_0x1aa976[_0x1a52cd(0xcf)](0x0);});},'pid':_0x1aa976[_0x2da84a(0xdf)],'runtimeRoot':_0x56b658[_0x2da84a(0x8b)],'sessionHost':_0x162594,'socketPath':_0x56b658[_0x2da84a(0xe0)],'startedAt':_0x210275}),await new Promise((_0xc14e83,_0x54e560)=>{const _0x45c6fe=_0x2da84a;_0x3ced67[_0x45c6fe(0x76)](_0x45c6fe(0xdd),_0x54e560),_0x3ced67['listen'](_0x56b658[_0x45c6fe(0xe0)],_0xc14e83);}),_0x261233(_0x56b658[_0x2da84a(0xe0)])||await _0x1891fb(_0x56b658['socketPath'],0x180);let _0x46b1e1={'pid':_0x1aa976[_0x2da84a(0xdf)],'startedAt':_0x210275,'socketPath':_0x56b658['socketPath'],'runtimeRoot':_0x56b658[_0x2da84a(0x8b)],'buildId':_0x868b7b};await _0x536c4c(_0x56b658[_0x2da84a(0x7c)],String(_0x1aa976[_0x2da84a(0xdf)]),_0x2da84a(0xd6)),await _0x536c4c(_0x56b658[_0x2da84a(0xc3)],JSON[_0x2da84a(0xc5)](_0x46b1e1,null,0x2),_0x2da84a(0xd6)),_0x2b740f[_0x2da84a(0xda)]({'event_name':_0x510568[_0x2da84a(0xa2)],'component':_0x39825b['Daemon'],'process_role':_0x2f7a7b[_0x2da84a(0xe5)],'fields':{..._0x270cc4,'pid':_0x1aa976['pid'],'runtime_root':_0x56b658[_0x2da84a(0x8b)],'socket_path':_0x56b658[_0x2da84a(0xe0)],'started_at':_0x210275}}),await _0x2b740f[_0x2da84a(0x80)]();let _0x5a8d74=setInterval(()=>{const _0x3dc4f7=_0x2da84a;_0x162594[_0x3dc4f7(0x83)]();},Math[_0x2da84a(0xb5)](0x3e8,Math[_0x2da84a(0xa0)](_0x162594[_0x2da84a(0x96)](),0xea60)));_0x5a8d74[_0x2da84a(0xb0)](),_0x498e60[_0x2da84a(0xc1)]=_0x5a8d74;async function _0x1c2a76(_0x4df5a7){const _0x408f89=_0x2da84a;_0x136931||(_0x136931=!0x0,_0x498e60[_0x408f89(0xc1)]!==void 0x0&&clearInterval(_0x498e60[_0x408f89(0xc1)]),_0x2b740f[_0x408f89(0xda)]({'event_name':_0x510568['DaemonStop'],'component':_0x39825b['Daemon'],'process_role':_0x2f7a7b[_0x408f89(0xe5)],'fields':{..._0x270cc4,'pid':_0x1aa976[_0x408f89(0xdf)],'reason':_0x4df5a7,'timestamp':new Date()[_0x408f89(0xa8)]()}}),await _0x2b740f[_0x408f89(0x80)](),await _0x162594['destroyAll'](_0x4df5a7),await new Promise(_0x1eca5b=>{const _0xa68ea=_0x408f89;_0x3ced67[_0xa68ea(0x74)](()=>_0x1eca5b());}),await I(_0x56b658['socketPath']),await _0x54d075(_0x56b658[_0x408f89(0x7c)],{'force':!0x0})[_0x408f89(0x97)](()=>void 0x0),await _0x54d075(_0x56b658[_0x408f89(0xc3)],{'force':!0x0})[_0x408f89(0x97)](()=>void 0x0),await _0x54d075(_0x56b658['lockPath'],{'recursive':!0x0,'force':!0x0})[_0x408f89(0x97)](()=>void 0x0));}_0x1aa976['on'](_0x2da84a(0xa1),()=>{const _0x40cf48=_0x2da84a;_0x1c2a76(_0x40cf48(0xd1))['finally'](()=>{const _0x47071e=_0x40cf48;_0x1aa976[_0x47071e(0xcf)](0x0);});}),_0x1aa976['on']('SIGTERM',()=>{const _0x1321ab=_0x2da84a;_0x1c2a76(_0x1321ab(0x92))[_0x1321ab(0xb7)](()=>{_0x1aa976['exit'](0x0);});});}function T(_0x1c7a4f){return async _0x2098e1=>{const _0x1e0b73=_0x5964;let _0x4a17cb;try{_0x4a17cb=JSON[_0x1e0b73(0x93)](_0x2098e1);}catch(_0x1a2cf8){return B(null,-0x7fbc,_0x1a2cf8);}let _0x4b7be8=_0x2d3714(_0x4a17cb[_0x1e0b73(0xb4)]?.[_0x1e0b73(0xa9)]),_0x24d509=async()=>await n['withSpan']({'name':_0x1a68e8[_0x1e0b73(0xc4)],'kind':_0x1e0b73(0xde)},async()=>{const _0x3802d5=_0x1e0b73;let _0xbb8fab=Date[_0x3802d5(0x9e)]();await _0x1c7a4f[_0x3802d5(0xac)]?.({'eventName':_0x510568[_0x3802d5(0x78)],'method':_0x4a17cb[_0x3802d5(0x98)],'timestamp':new Date()[_0x3802d5(0xa8)]()});try{let _0x465bc0=await E(_0x4a17cb,_0x1c7a4f);return await _0x1c7a4f['logRequestEvent']?.({'durationMs':Date[_0x3802d5(0x9e)]()-_0xbb8fab,'eventName':_0x510568[_0x3802d5(0x99)],'method':_0x4a17cb[_0x3802d5(0x98)],'timestamp':new Date()[_0x3802d5(0xa8)]()}),_0x465bc0;}catch(_0x22d424){return await _0x1c7a4f['logRequestEvent']?.({'durationMs':Date[_0x3802d5(0x9e)]()-_0xbb8fab,'eventName':_0x510568['DaemonRpcError'],'method':_0x4a17cb[_0x3802d5(0x98)],'error':_0x22d424,'timestamp':new Date()[_0x3802d5(0xa8)]()}),_0x1c7a4f[_0x3802d5(0xac)]===void 0x0&&await _0x1c7a4f['logRequestError']?.({'method':_0x4a17cb[_0x3802d5(0x98)],'error':_0x22d424 instanceof Error?_0x22d424[_0x3802d5(0x6f)]:String(_0x22d424),'timestamp':new Date()[_0x3802d5(0xa8)]()}),B(_0x4a17cb['id'],-0x7f5b,_0x22d424);}});return _0x4b7be8===void 0x0?await _0x24d509():await n[_0x1e0b73(0xab)](_0x4b7be8,_0x24d509);};}async function E(_0x4977b4,_0x1a71ec){const _0x2636e7=_0x5964;switch(_0x4977b4[_0x2636e7(0x98)]){case _0x3807a4[_0x2636e7(0xc9)]:return{'jsonrpc':_0x2636e7(0xe2),'id':_0x4977b4['id'],'result':{'ok':!0x0,'pid':_0x1a71ec['pid'],'startedAt':_0x1a71ec[_0x2636e7(0xe1)],'socketPath':_0x1a71ec[_0x2636e7(0xe0)],'runtimeRoot':_0x1a71ec['runtimeRoot'],'buildId':_0x1a71ec[_0x2636e7(0x9f)],'sessionCount':_0x1a71ec[_0x2636e7(0x88)][_0x2636e7(0x7a)]()}};case _0x3807a4['Shutdown']:return _0x1a71ec[_0x2636e7(0xbb)]?.(),{'jsonrpc':'2.0','id':_0x4977b4['id'],'result':{'stopping':!0x0}};case _0x3807a4[_0x2636e7(0x87)]:{let _0x100b15=await _0x1a71ec['sessionHost']['loadWorkbook'](_0x4977b4[_0x2636e7(0xcd)]);return z(_0x4977b4['id'],_0x100b15);}case _0x3807a4[_0x2636e7(0xb9)]:{let _0x48e175=await _0x1a71ec['sessionHost'][_0x2636e7(0xc0)](_0x4977b4[_0x2636e7(0xcd)]);return z(_0x4977b4['id'],_0x48e175);}case _0x3807a4[_0x2636e7(0x84)]:{let _0x5be74d=await _0x1a71ec['sessionHost'][_0x2636e7(0xae)](_0x4977b4[_0x2636e7(0xcd)]);return z(_0x4977b4['id'],_0x5be74d);}case _0x3807a4[_0x2636e7(0xc6)]:{let _0x1d4b54=await _0x1a71ec[_0x2636e7(0x88)][_0x2636e7(0xe3)](_0x4977b4[_0x2636e7(0xcd)]);return z(_0x4977b4['id'],_0x1d4b54);}case _0x3807a4[_0x2636e7(0xbe)]:{let _0x434d0e=await _0x1a71ec[_0x2636e7(0x88)]['exportWorkbookFile'](_0x4977b4['params']);return z(_0x4977b4['id'],_0x434d0e);}case _0x3807a4[_0x2636e7(0xb1)]:{let _0x5c3083=_0x4977b4[_0x2636e7(0xcd)],_0x5490a0=await _0x1a71ec[_0x2636e7(0x88)][_0x2636e7(0xd4)](_0x5c3083);return z(_0x4977b4['id'],_0x5490a0);}case _0x3807a4['SessionDispose']:{let _0x3cc69b=await _0x1a71ec['sessionHost'][_0x2636e7(0x86)](_0x4977b4[_0x2636e7(0xcd)]);return z(_0x4977b4['id'],_0x3cc69b);}case _0x3807a4[_0x2636e7(0x77)]:{let _0x50a058=await _0x1a71ec[_0x2636e7(0x88)]['getWorkbookSession'](_0x4977b4[_0x2636e7(0xcd)]);return z(_0x4977b4['id'],_0x50a058);}default:return B(_0x4977b4['id'],-0x7f59,Error('Method\x20not\x20found:\x20'+_0x4977b4[_0x2636e7(0x98)]));}}function D(_0x1a1238){return{async 'createWorkbook'(_0x1eaa84){const _0xc46f2d=_0x5964;let _0x1d581b=await O(_0x1eaa84),_0x91754a=await _0x1a1238[_0xc46f2d(0xae)]({..._0x1eaa84[_0xc46f2d(0x7d)]===void 0x0?{}:{'cwd':_0x1eaa84[_0xc46f2d(0x7d)]},'identity':_0x1d581b,..._0x1eaa84['id']===void 0x0?{}:{'workbookId':_0x1eaa84['id']},..._0x1eaa84[_0xc46f2d(0xd9)]===void 0x0?{}:{'workbookName':_0x1eaa84['name']}});return{'success':!0x0,'workbookData':_0x91754a[_0xc46f2d(0xa7)],'session':k(_0x91754a[_0xc46f2d(0xcc)])};},async 'dispose'(_0x4542fe){const _0x842d2d=_0x5964;let _0x36301f=await O(_0x4542fe);return await _0x1a1238[_0x842d2d(0x86)]({..._0x4542fe[_0x842d2d(0x7d)]===void 0x0?{}:{'cwd':_0x4542fe[_0x842d2d(0x7d)]},'identity':_0x36301f}),{'disposed':!0x0,'workbookIdentity':_0x36301f['absolutePath']};},async 'destroyAll'(_0xff90a9){const _0x3fdec3=_0x5964;await _0x1a1238[_0x3fdec3(0xa6)]?.(_0xff90a9);},async 'evalJs'(_0x6c0ff9){const _0x3dd672=_0x5964;let _0x54f7a3=await O(_0x6c0ff9),_0x3ae284=await _0x1a1238[_0x3dd672(0xe3)]({'code':_0x6c0ff9[_0x3dd672(0xa5)],..._0x6c0ff9['cwd']===void 0x0?{}:{'cwd':_0x6c0ff9[_0x3dd672(0x7d)]},'identity':_0x54f7a3,..._0x6c0ff9[_0x3dd672(0x7f)]===void 0x0?{}:{'maxCodeLength':_0x6c0ff9[_0x3dd672(0x7f)]},..._0x6c0ff9['mutates']===void 0x0?{}:{'mutates':_0x6c0ff9[_0x3dd672(0xdb)]}});return{..._0x3ae284[_0x3dd672(0xa4)]===void 0x0?{}:{'mutations':_0x3ae284[_0x3dd672(0xa4)]},'success':!0x0,'value':_0x3ae284['value'],'session':k(_0x3ae284[_0x3dd672(0xcc)])};},async 'exportWorkbookData'(_0x560e54){const _0xbc4124=_0x5964;let _0x214c5f=await O(_0x560e54),_0x57dba0=await _0x1a1238[_0xbc4124(0xd4)]({..._0x560e54['cwd']===void 0x0?{}:{'cwd':_0x560e54[_0xbc4124(0x7d)]},'identity':_0x214c5f});return{'success':!0x0,'workbookData':_0x57dba0[_0xbc4124(0xa7)],'session':k(_0x57dba0[_0xbc4124(0xcc)])};},async 'exportWorkbookFile'(_0x35b124){const _0x48ef06=_0x5964;let _0x1ec035=await O(_0x35b124),_0x59f088=await _0x1a1238[_0x48ef06(0x8d)]({..._0x35b124['cwd']===void 0x0?{}:{'cwd':_0x35b124[_0x48ef06(0x7d)]},'format':_0x35b124[_0x48ef06(0x95)],'identity':_0x1ec035,'outputPath':_0x35b124['outputPath']});return{'success':!0x0,'format':_0x59f088['format'],'outputPath':_0x59f088['outputPath'],'sizeBytes':_0x59f088['sizeBytes'],'session':k(_0x59f088['session'])};},async 'getWorkbookSession'(_0x2e2b28){const _0x2799b5=_0x5964;let _0x38426=await O(_0x2e2b28),_0x5b5b5b=await _0x1a1238[_0x2799b5(0x85)]({..._0x2e2b28[_0x2799b5(0x7d)]===void 0x0?{}:{'cwd':_0x2e2b28[_0x2799b5(0x7d)]},'identity':_0x38426});return{'exists':_0x5b5b5b!==null,'session':_0x5b5b5b===null?null:k(_0x5b5b5b)};},'getSessionCount'(){return _0x1a1238['getSessionCount']?.()??0x0;},'getSessionIdleTtlMs'(){return _0x1a1238['getSessionIdleTtlMs']?.()??0xea60;},async 'loadWorkbook'(_0x125940){const _0x1b235d=_0x5964;let _0x1d5389=await O(_0x125940),_0x38c888=await _0x1a1238[_0x1b235d(0x90)]({..._0x125940[_0x1b235d(0x7d)]===void 0x0?{}:{'cwd':_0x125940['cwd']},'identity':_0x1d5389,'workbookData':_0x125940['workbookData']});return{'success':!0x0,'workbookData':_0x38c888[_0x1b235d(0xa7)],'session':k(_0x38c888[_0x1b235d(0xcc)])};},async 'loadWorkbookDataReplayPack'(_0x210bf3){const _0x59adc3=_0x5964;let _0x844f1e=await O(_0x210bf3);return{'success':!0x0,'session':k((await _0x1a1238['loadWorkbookDataReplayPack']({..._0x210bf3[_0x59adc3(0x7d)]===void 0x0?{}:{'cwd':_0x210bf3[_0x59adc3(0x7d)]},'identity':_0x844f1e,'replayPack':{'baseWorkbookData':_0x210bf3[_0x59adc3(0xc8)],'mutations':_0x210bf3['mutations']}}))[_0x59adc3(0xcc)])};},async 'unloadIdleSessions'(){const _0x2d9607=_0x5964;await _0x1a1238[_0x2d9607(0x83)]?.();}};}async function O(_0x2bf838){return await C['resolveIdentity'](_0x2bf838);}function k(_0x15e52a){const _0x3d06c3=_0x5964;return{'createdAt':_0x15e52a[_0x3d06c3(0xcb)]??'','lastAccessedAt':_0x15e52a[_0x3d06c3(0xb6)]??'','sessionId':_0x15e52a['sessionId'],'workbookIdentity':_0x15e52a[_0x3d06c3(0xce)][_0x3d06c3(0xd0)]};}function _0x5964(_0x502af7,_0x3534d6){_0x502af7=_0x502af7-0x6a;const _0xa98831=_0xa988();let _0x596416=_0xa98831[_0x502af7];return _0x596416;}function A(_0x432220){const _0x3363a6=_0x5964;return{'build.id':j(_0x432220[_0x3363a6(0xdc)],_0x3363a6(0xbd))??_0x432220[_0x3363a6(0x9f)],'deployment.environment.name':'local','distribution.channel':j(_0x432220['env'],'UNIVER_DISTRIBUTION_CHANNEL')??_0x3363a6(0x82),'service.instance.id':String(_0x432220['pid']),'service.name':_0x3363a6(0xaa),...j(_0x432220['env'],_0x3363a6(0x6c))===void 0x0?{}:{'service.version':j(_0x432220[_0x3363a6(0xdc)],'UNIVER_CLI_VERSION')}};}function j(_0x51f277,_0x12faa2){const _0x18d04d=_0x5964;let _0x24c5f3=_0x51f277[_0x12faa2]?.[_0x18d04d(0xba)]();return _0x24c5f3===void 0x0||_0x24c5f3[_0x18d04d(0x8a)]===0x0?void 0x0:_0x24c5f3;}async function M(_0x48a95e){const _0x3da30e=_0x5964;F(_0x48a95e[_0x3da30e(0xe0)])&&!await P(_0x48a95e['socketPath'])&&await I(_0x48a95e[_0x3da30e(0xe0)]);let _0x5017d8=await L(_0x48a95e[_0x3da30e(0x7c)]);_0x5017d8!==null&&!R(_0x5017d8)&&(await _0x54d075(_0x48a95e[_0x3da30e(0x7c)],{'force':!0x0})[_0x3da30e(0x97)](()=>void 0x0),await _0x54d075(_0x48a95e['metaPath'],{'force':!0x0})[_0x3da30e(0x97)](()=>void 0x0),await _0x54d075(_0x48a95e[_0x3da30e(0x6b)],{'recursive':!0x0,'force':!0x0})[_0x3da30e(0x97)](()=>void 0x0));}async function N(_0x23dc35,_0x4b8a42){const _0x55e9ff=_0x5964;try{return await _0x10b2f8(_0x23dc35,{'recursive':!0x1,'mode':0x1c0}),!0x0;}catch(_0x4a13bd){if(_0x4a13bd[_0x55e9ff(0xa5)]!==_0x55e9ff(0x7e))throw _0x4a13bd;let _0x16b995=await L(_0x4b8a42);return _0x16b995!==null&&R(_0x16b995)?!0x1:(await _0x54d075(_0x23dc35,{'recursive':!0x0,'force':!0x0}),await _0x10b2f8(_0x23dc35,{'recursive':!0x1,'mode':0x1c0}),!0x0);}}async function P(_0x17bb2f){return await new Promise(_0x38a56e=>{const _0x31db82=_0x5964;let _0x2e2d74=_0x362a8b[_0x31db82(0x81)](_0x17bb2f);_0x2e2d74[_0x31db82(0x76)](_0x31db82(0x89),()=>{const _0x12d446=_0x31db82;_0x2e2d74[_0x12d446(0xbf)](),_0x38a56e(!0x0);}),_0x2e2d74[_0x31db82(0x76)](_0x31db82(0xdd),()=>{_0x38a56e(!0x1);});});}function F(_0xcd17ae){return _0x261233(_0xcd17ae)?!0x1:_0x56bc9e(_0xcd17ae);}async function I(_0x275357){const _0x13ffb0=_0x5964;_0x261233(_0x275357)||await _0x54d075(_0x275357,{'force':!0x0})[_0x13ffb0(0x97)](()=>void 0x0);}async function L(_0x2333bc){const _0x8859b0=_0x5964;try{let _0x223279=await _0x1fd745(_0x2333bc,_0x8859b0(0xd6)),_0x5126b8=Number(_0x223279[_0x8859b0(0xba)]());return Number[_0x8859b0(0x9b)](_0x5126b8)?_0x5126b8:null;}catch{return null;}}function R(_0x7a8e2f){try{return _0x1aa976['kill'](_0x7a8e2f,0x0),!0x0;}catch{return!0x1;}}function z(_0x3c3059,_0x71d20){return{'jsonrpc':'2.0','id':_0x3c3059,'result':_0x71d20};}function B(_0x563ef4,_0x174bc4,_0x3ba718){const _0x23b6fb=_0x5964;return{'jsonrpc':_0x23b6fb(0xe2),'id':_0x563ef4,'error':{'code':_0x174bc4,'message':_0x3ba718 instanceof Error?_0x3ba718[_0x23b6fb(0x6f)]:String(_0x3ba718)}};}var V=process[_0x1f5815(0x79)][0x2]??_0x1f5815(0x9c);V!=='serve'&&(console[_0x1f5815(0xdd)](_0x1f5815(0x6e)+V),process[_0x1f5815(0xcf)](0x1)),w()[_0x1f5815(0x97)](_0xef2574=>{const _0xa35b7d=_0x1f5815;console[_0xa35b7d(0xdd)](_0xef2574 instanceof Error?_0xef2574['message']:String(_0xef2574)),process['exit'](0x1);});function _0xa988(){const _0xa4a32b=['405644owFHUV','12940EGbFlk','runtimeExecutionPlaneEntry','close','495832PKepLf','once','SessionGetWorkbook','DaemonRpcStart','argv','getSessionCount','234rQVEcY','pidPath','cwd','EEXIST','maxCodeLength','flush','createConnection','unknown','unloadIdleSessions','SessionCreateWorkbook','getSession','dispose','SessionLoadWorkbook','sessionHost','connect','length','homeDir','817758TflIws','exportWorkbookFile','2699508PyTJoy','daemonDir','loadWorkbookData','1LiGTJW','sigterm','parse','timestamp','format','getSessionIdleTtlMs','catch','method','DaemonRpcFinish','55kchgFC','isFinite','serve','rpc-shutdown','now','buildId','min','SIGINT','DaemonStart','21GMbach','mutations','code','destroyAll','workbookData','toISOString','traceparent','univer-daemon','withContext','logRequestEvent','eventName','createWorkbook','data','unref','SessionExportWorkbookData','108eGzRFR','Another\x20daemon\x20startup\x20owns\x20','meta','max','lastAccessedAt','finally','Runtime','SessionLoadWorkbookDataReplayPack','trim','onShutdownRequest','26wnpeck','UNIVER_CLI_BUILD_ID','SessionExportWorkbookFile','end','loadWorkbookDataReplayPack','current','write','metaPath','DaemonRpcServer','stringify','SessionEvalJs','28570OtxHkH','baseWorkbookData','Health','createServer','createdAt','session','params','packageIdentity','exit','absolutePath','sigint','event','sessionRoot','exportWorkbookData','execArgv','utf8','durationMs','slice','name','info','mutates','env','error','server','pid','socketPath','startedAt','2.0','evalJs','toString','Daemon','DaemonRpcError','lockPath','UNIVER_CLI_VERSION','Daemon\x20handler\x20not\x20ready:\x20','Unknown\x20daemon\x20subcommand:\x20','message','7362PkHQed'];_0xa988=function(){return _0xa4a32b;};return _0xa988();}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x5e5f2e=_0x5f43;(function(_0x4689a4,_0x415ae5){const _0x50cd2f=_0x5f43,_0x35fcc4=_0x4689a4();while(!![]){try{const _0x5b0115=-parseInt(_0x50cd2f(0x161))/0x1+parseInt(_0x50cd2f(0x181))/0x2*(-parseInt(_0x50cd2f(0x19f))/0x3)+parseInt(_0x50cd2f(0x185))/0x4+-parseInt(_0x50cd2f(0x15a))/0x5*(-parseInt(_0x50cd2f(0x17e))/0x6)+-parseInt(_0x50cd2f(0x145))/0x7+parseInt(_0x50cd2f(0x165))/0x8*(parseInt(_0x50cd2f(0x166))/0x9)+-parseInt(_0x50cd2f(0x163))/0xa;if(_0x5b0115===_0x415ae5)break;else _0x35fcc4['push'](_0x35fcc4['shift']());}catch(_0x569757){_0x35fcc4['push'](_0x35fcc4['shift']());}}}(_0x26cc,0xcdfd4));import{t as _0xaee66c}from'../chunks/build-info-59KMzaXH.js';import{n as _0xfbf059}from'../chunks/runtime-manifest-D6bFR_JZ.js';import{spawn as _0x459dc2}from'node:child_process';import{readFileSync as _0x112dfc}from'node:fs';import{mkdir as _0x2bb0c6,readFile as _0x2b0bb6,rename as _0x2180a9,writeFile as _0x427a75}from'node:fs/promises';import{dirname as _0x194d2c,join as _0x1dba67,resolve as _0x2a7ecc}from'node:path';import{fileURLToPath as _0x17b18c}from'node:url';import{homedir as _0x36d943,platform as _0x16ee5a}from'node:os';import{randomUUID as _0x469056}from'node:crypto';async function h(_0x236c35){const _0x4541ef=_0x5f43;let _0x18a3f0=_0x236c35[_0x4541ef(0x192)]??process.env,_0x3533fd=_0x236c35[_0x4541ef(0x16b)]??_0xfbf059(_0x18a3f0);if(_0x3533fd[_0x4541ef(0x177)]!==_0x4541ef(0x176))return{'reason':'not-packaged','status':_0x4541ef(0x16a)};let _0x2af8dd=_0x236c35[_0x4541ef(0x162)]??_0xaee66c;if(N(_0x2af8dd))return{'reason':_0x4541ef(0x170),'status':_0x4541ef(0x16a)};let _0x4944fa=_0x236c35[_0x4541ef(0x184)]??await O(_0x3533fd[_0x4541ef(0x19b)]);if(_0x4944fa[_0x4541ef(0x148)]['length']===0x0)return{'reason':'missing-endpoint','status':_0x4541ef(0x16a)};let _0x161994=_0x236c35[_0x4541ef(0x154)]??new Date(),_0x2bfd9f=_0x236c35[_0x4541ef(0x15e)]??v({'env':_0x18a3f0}),_0x5d18ba=await b({'path':_0x2bfd9f,..._0x236c35['randomId']===void 0x0?{}:{'randomId':_0x236c35['randomId']},..._0x236c35[_0x4541ef(0x169)]===void 0x0?{}:{'stateIo':_0x236c35[_0x4541ef(0x169)]}});if(_0x5d18ba[_0x4541ef(0x191)]===void 0x0)return{'reason':_0x4541ef(0x186),'status':_0x4541ef(0x16a)};if(_0x236c35[_0x4541ef(0x164)]==='cli_first_opened'&&_0x5d18ba[_0x4541ef(0x191)][_0x4541ef(0x14c)]['cli_first_opened']!==void 0x0)return{'reason':'already-attempted','status':_0x4541ef(0x16a)};let _0x7bef01=w({'buildInfo':_0x2af8dd,'eventName':_0x236c35[_0x4541ef(0x164)],'now':_0x161994,'state':_0x5d18ba['state']});await C({'path':_0x2bfd9f,'state':_0x7bef01,..._0x236c35[_0x4541ef(0x169)]===void 0x0?{}:{'stateIo':_0x236c35[_0x4541ef(0x169)]}});let _0x1a3854=T({'buildInfo':_0x2af8dd,'env':_0x18a3f0,'eventName':_0x236c35[_0x4541ef(0x164)],'eventSource':_0x236c35['eventSource'],'manifest':_0x3533fd,'state':_0x7bef01});try{return await(_0x236c35[_0x4541ef(0x18c)]??new A())['capture']({'capture':_0x1a3854,'config':_0x4944fa}),{'status':_0x4541ef(0x199)};}catch{return{'reason':'capture-failed','status':'skipped'};}}async function g(_0x83b61a={}){const _0x441156=_0x5f43;return await h({..._0x83b61a,'eventName':_0x441156(0x188),'eventSource':_0x441156(0x157)});}async function _(_0x2f8b96={}){const _0x2cb76d=_0x5f43;return await h({..._0x2f8b96,'eventName':_0x2cb76d(0x158),'eventSource':'cli-startup'});}function v(_0x2a8e0f={}){const _0xf9c5f9=_0x5f43;let _0x444675=(_0x2a8e0f[_0xf9c5f9(0x192)]??process.env)[_0xf9c5f9(0x19c)]?.['trim']();return _0x2a7ecc(_0x444675&&_0x444675[_0xf9c5f9(0x149)]>0x0?_0x444675:_0x1dba67(_0x2a8e0f[_0xf9c5f9(0x194)]??_0x36d943(),_0xf9c5f9(0x156)),_0xf9c5f9(0x17c),_0xf9c5f9(0x18f));}function y(_0x29b82a={}){const _0x23b543=_0x5f43;return{'anonymousInstallId':_0x29b82a[_0x23b543(0x19a)]?.()??_0x469056(),'events':{},'version':0x1};}async function b(_0x6d2309){const _0x33024a=_0x5f43;let _0x5aef0d=_0x6d2309[_0x33024a(0x169)]?.[_0x33024a(0x14a)]??_0x2b0bb6;try{return{'state':x(await _0x5aef0d(_0x6d2309[_0x33024a(0x175)],_0x33024a(0x182)))};}catch{return{'state':y({..._0x6d2309[_0x33024a(0x19a)]===void 0x0?{}:{'randomId':_0x6d2309[_0x33024a(0x19a)]}})};}}function x(_0x2f20a0){const _0xde4a3=_0x5f43;let _0x2bb758=JSON[_0xde4a3(0x183)](_0x2f20a0);if(!R(_0x2bb758)||_0x2bb758['version']!==0x1)throw Error(_0xde4a3(0x17f));if(typeof _0x2bb758[_0xde4a3(0x153)]!=_0xde4a3(0x14f)||_0x2bb758[_0xde4a3(0x153)]['length']===0x0)throw Error(_0xde4a3(0x179));let _0x29832a=R(_0x2bb758[_0xde4a3(0x14c)])?_0x2bb758[_0xde4a3(0x14c)]:{};return{'anonymousInstallId':_0x2bb758[_0xde4a3(0x153)],'events':{...P(_0x29832a[_0xde4a3(0x188)],_0xde4a3(0x188)),...P(_0x29832a[_0xde4a3(0x158)],_0xde4a3(0x158))},'version':0x1};}function S(_0x5b4233){const _0x5a58eb=_0x5f43;return JSON[_0x5a58eb(0x190)](_0x5b4233,null,0x2)+'\x0a';}async function C(_0x13c4ad){const _0xb44703=_0x5f43;let _0x973b6f=_0x13c4ad['stateIo']?.[_0xb44703(0x193)]??_0x427a75,_0x5c8326=_0x13c4ad[_0xb44703(0x169)]?.[_0xb44703(0x150)]??_0x2180a9,_0x1ce7c1=_0x13c4ad[_0xb44703(0x175)]+'.'+process['pid']+'.'+Date[_0xb44703(0x154)]()+_0xb44703(0x16c);try{await _0x2bb0c6(_0x194d2c(_0x13c4ad[_0xb44703(0x175)]),{'mode':0x1c0,'recursive':!0x0}),await _0x973b6f(_0x1ce7c1,S(_0x13c4ad['state']),{'encoding':_0xb44703(0x182),'mode':0x180}),await _0x5c8326(_0x1ce7c1,_0x13c4ad['path']);}catch{}}function _0x26cc(){const _0x1bd92a=['Invalid\x20product\x20telemetry\x20anonymous\x20install\x20id.','timeoutMs','POST','telemetry','argv','6IwunPe','Invalid\x20product\x20telemetry\x20state\x20version.','name','12YIeUdq','utf8','parse','config','1220896ZbduNn','state-unavailable','isSafeInteger','cli_installed','package.json','yarn','test','transport','properties','number','state.json','stringify','state','env','writeFile','homeDir','ignore','https://univer.ai/api/telemetry/cli','timeout','buildCommit','captured','randomId','packageRoot','UNIVER_HOME','versions','internal','200877ZXFCpf','@dream-num/univer-cli','npm','CLI\x20telemetry\x20proxy\x20failed\x20with\x20status\x20','version','355376gJilUP','UNIVER_MANAGED_BY_NPM','0.0.0','endpoint','length','readFile','commitHash','events','postinstall-worker','object','string','rename','cliVersion','split','anonymousInstallId','now','unknown','.univer','postinstall','cli_first_opened','arch','6867970JygaEk','status','event','eventSource','statePath','UNIVER_MANAGED_BY_BUN','public-npm','715601AescIz','buildInfo','1198010ErpTBP','eventName','1704lsTqqC','19134vuZZCi','univer-cli','attemptedAt','stateIo','skipped','manifest','.tmp','npm_execpath','trim','bun','development-build','application/json','node','npm_config_user_agent','unref','path','packaged','mode','capture'];_0x26cc=function(){return _0x1bd92a;};return _0x26cc();}function w(_0x44db59){const _0x184039=_0x5f43;return{..._0x44db59[_0x184039(0x191)],'events':{..._0x44db59[_0x184039(0x191)][_0x184039(0x14c)],[_0x44db59['eventName']]:{'attemptedAt':_0x44db59['now']['toISOString'](),'buildCommit':_0x44db59[_0x184039(0x162)][_0x184039(0x14b)],'cliVersion':_0x44db59['buildInfo'][_0x184039(0x1a3)]}}};}function T(_0x3170f6){const _0x5bee40=_0x5f43;return{'distinctId':_0x3170f6['state'][_0x5bee40(0x153)],'event':_0x3170f6[_0x5bee40(0x164)],'properties':E(_0x3170f6)};}function E(_0x34f47b){const _0x4dbddb=_0x5f43;return{'arch':process[_0x4dbddb(0x159)],'build_commit':_0x34f47b[_0x4dbddb(0x162)]['commitHash'],'cli_version':_0x34f47b['buildInfo'][_0x4dbddb(0x1a3)],'distribution_channel':M(_0x34f47b[_0x4dbddb(0x16b)]),'event_source':_0x34f47b[_0x4dbddb(0x15d)],'install_manager':D(_0x34f47b['env']??process.env),'node_major_version':F(process[_0x4dbddb(0x19d)][_0x4dbddb(0x172)]),'package_name':j(_0x34f47b['manifest']),'platform':_0x16ee5a(),'telemetry_state_version':0x1};}function D(_0x3df57a=process.env){const _0x3b8b01=_0x5f43;let _0x3b3961=process[_0x3b8b01(0x19d)];if(typeof _0x3b3961[_0x3b8b01(0x16f)]==_0x3b8b01(0x14f)&&_0x3b3961[_0x3b8b01(0x16f)][_0x3b8b01(0x149)]>0x0)return _0x3b8b01(0x16f);let _0x1e3b68=_0x3df57a[_0x3b8b01(0x173)]??'';if(/\bbun\//u['test'](_0x1e3b68))return _0x3b8b01(0x16f);if(/\bpnpm\//u[_0x3b8b01(0x18b)](_0x1e3b68))return'pnpm';if(/\byarn\//u['test'](_0x1e3b68))return'yarn';if(/\bnpm\//u['test'](_0x1e3b68))return _0x3b8b01(0x1a1);let _0xdf7fe7=_0x3df57a[_0x3b8b01(0x16d)]??'';return/(^|[/\\])bun(?:\.exe)?$/u['test'](_0xdf7fe7)?_0x3b8b01(0x16f):/(^|[/\\])pnpm(?:\.cmd|\.ps1|\.exe)?$/u[_0x3b8b01(0x18b)](_0xdf7fe7)?'pnpm':/(^|[/\\])yarn(?:\.cmd|\.ps1|\.exe)?$/u[_0x3b8b01(0x18b)](_0xdf7fe7)?_0x3b8b01(0x18a):/(^|[/\\])npm(?:\.cmd|\.ps1|\.exe)?$/u[_0x3b8b01(0x18b)](_0xdf7fe7)?'npm':_0x3df57a[_0x3b8b01(0x15f)]==='1'?_0x3b8b01(0x16f):_0x3df57a[_0x3b8b01(0x146)]==='1'?'npm':_0x3b8b01(0x155);}async function O(_0x5b805a){const _0x2be7dc=_0x5f43;try{let _0x5101e8=await _0x2b0bb6(_0x1dba67(_0x5b805a,_0x2be7dc(0x19e),'product-telemetry.json'),_0x2be7dc(0x182));return k(JSON[_0x2be7dc(0x183)](_0x5101e8));}catch{return k({});}}function k(_0x4b862e){const _0x3125d=_0x5f43;let _0x25fc5a=R(_0x4b862e)?_0x4b862e:{};return{'endpoint':I(_0x25fc5a[_0x3125d(0x148)],_0x3125d(0x196)),'timeoutMs':L(_0x25fc5a[_0x3125d(0x17a)],0x1388)};}var A=class{async[_0x5e5f2e(0x178)](_0x4a039f){const _0x38b27d=_0x5e5f2e;let _0x4f0eea=await fetch(_0x4a039f[_0x38b27d(0x184)]['endpoint'],{'body':JSON[_0x38b27d(0x190)]({'distinctId':_0x4a039f[_0x38b27d(0x178)]['distinctId'],'event':_0x4a039f[_0x38b27d(0x178)][_0x38b27d(0x15c)],'properties':_0x4a039f[_0x38b27d(0x178)][_0x38b27d(0x18d)]}),'headers':{'content-type':_0x38b27d(0x171)},'method':_0x38b27d(0x17b),'signal':AbortSignal[_0x38b27d(0x197)](_0x4a039f[_0x38b27d(0x184)]['timeoutMs'])});if(!_0x4f0eea['ok'])throw Error(_0x38b27d(0x1a2)+_0x4f0eea[_0x38b27d(0x15b)]);}};function j(_0x49f5b5){const _0x4d40a7=_0x5e5f2e;try{let _0x44f4b6=JSON[_0x4d40a7(0x183)](_0x112dfc(_0x1dba67(_0x49f5b5[_0x4d40a7(0x19b)],_0x4d40a7(0x189)),'utf8'));return typeof _0x44f4b6[_0x4d40a7(0x180)]==_0x4d40a7(0x14f)&&_0x44f4b6[_0x4d40a7(0x180)][_0x4d40a7(0x16e)]()['length']>0x0?_0x44f4b6[_0x4d40a7(0x180)]:_0x4d40a7(0x167);}catch{return'univer-cli';}}function M(_0x2bd5c7){const _0x1fcaed=_0x5e5f2e;let _0x3a0c40=j(_0x2bd5c7);return _0x3a0c40===_0x1fcaed(0x1a0)?'internal-github':_0x3a0c40==='univer-cli'?_0x1fcaed(0x160):_0x2bd5c7[_0x1fcaed(0x177)];}function N(_0x3e9327){const _0x5bef5c=_0x5e5f2e;return _0x3e9327[_0x5bef5c(0x1a3)]===_0x5bef5c(0x147);}function P(_0x17a95c,_0x3c98b0){const _0xc4b335=_0x5e5f2e;return!R(_0x17a95c)||typeof _0x17a95c[_0xc4b335(0x168)]!=_0xc4b335(0x14f)||typeof _0x17a95c[_0xc4b335(0x198)]!=_0xc4b335(0x14f)||typeof _0x17a95c[_0xc4b335(0x151)]!=_0xc4b335(0x14f)?{}:{[_0x3c98b0]:{'attemptedAt':_0x17a95c[_0xc4b335(0x168)],'buildCommit':_0x17a95c[_0xc4b335(0x198)],'cliVersion':_0x17a95c['cliVersion']}};}function _0x5f43(_0x25f93c,_0x30fdf4){_0x25f93c=_0x25f93c-0x145;const _0x26cc8f=_0x26cc();let _0x5f430c=_0x26cc8f[_0x25f93c];return _0x5f430c;}function F(_0x14daef){const _0x487787=_0x5e5f2e;let _0x3750ce=Number(_0x14daef[_0x487787(0x152)]('.')[0x0]);return Number[_0x487787(0x187)](_0x3750ce)&&_0x3750ce>0x0?_0x3750ce:void 0x0;}function I(_0x52ffa0,_0x1bb2f6){const _0x229bc1=_0x5e5f2e;return typeof _0x52ffa0==_0x229bc1(0x14f)&&_0x52ffa0[_0x229bc1(0x16e)]()['length']>0x0?_0x52ffa0['trim']():_0x1bb2f6;}function L(_0x4c3a09,_0x35b29c){const _0x359c20=_0x5e5f2e;return typeof _0x4c3a09==_0x359c20(0x18e)&&Number[_0x359c20(0x187)](_0x4c3a09)&&_0x4c3a09>0x0?_0x4c3a09:_0x35b29c;}function R(_0x464ba5){const _0x1f09d4=_0x5e5f2e;return typeof _0x464ba5==_0x1f09d4(0x14e)&&!!_0x464ba5;}var z=process[_0x5e5f2e(0x17d)][0x2];try{z==='first-open'?await _():z===_0x5e5f2e(0x157)?B(_0x5e5f2e(0x14d)):z===_0x5e5f2e(0x14d)&&await g();}catch{}function B(_0x409449){const _0x5e6170=_0x5e5f2e;_0x459dc2(process['execPath'],[_0x17b18c(import.meta.url),_0x409449],{'detached':!0x0,'env':process.env,'stdio':_0x5e6170(0x195),'windowsHide':!0x0})[_0x5e6170(0x174)]();}
2
+ const _0x4de12c=_0x4bae;(function(_0x61c101,_0x4355e8){const _0x199f4c=_0x4bae,_0x231bb5=_0x61c101();while(!![]){try{const _0x400679=parseInt(_0x199f4c(0x193))/0x1*(parseInt(_0x199f4c(0x198))/0x2)+parseInt(_0x199f4c(0x1d5))/0x3*(parseInt(_0x199f4c(0x1b5))/0x4)+parseInt(_0x199f4c(0x19a))/0x5*(-parseInt(_0x199f4c(0x1a7))/0x6)+parseInt(_0x199f4c(0x1ad))/0x7*(-parseInt(_0x199f4c(0x1d8))/0x8)+parseInt(_0x199f4c(0x1bc))/0x9+parseInt(_0x199f4c(0x1dc))/0xa+parseInt(_0x199f4c(0x18a))/0xb*(parseInt(_0x199f4c(0x1d9))/0xc);if(_0x400679===_0x4355e8)break;else _0x231bb5['push'](_0x231bb5['shift']());}catch(_0x2d0590){_0x231bb5['push'](_0x231bb5['shift']());}}}(_0x4856,0x691d2));import{t as _0x2ff531}from'../chunks/build-info-BeqRsVqe.js';import{n as _0x3b07c7}from'../chunks/runtime-manifest-D6bFR_JZ.js';function _0x4856(){const _0x580ec0=['packaged','isSafeInteger','stateIo','34024qbxuHN','public-npm','50045ukXOar','endpoint','cli-startup','parse','CLI\x20telemetry\x20proxy\x20failed\x20with\x20status\x20','captured','UNIVER_MANAGED_BY_NPM','events','execPath','npm','argv','attemptedAt','transport','390gPRzEx','yarn','distinctId','packageRoot','homeDir','bun','4841886EujtBJ','skipped','string','writeFile','event','name','toISOString','commitHash','1684ASwAuu','config','ignore','buildCommit','telemetry','cli_installed','POST','688500yVpNbT','eventSource','eventName','@dream-num/univer-cli','length','npm_config_user_agent','versions','node','mode','test','UNIVER_HOME','cli_first_opened','development-build','univer-cli','object','randomId','application/json','internal','stringify','trim','state','status','postinstall-worker','postinstall','not-packaged','474QQgNQA','manifest','state.json','8tmOKph','12IslPvA','path','version','2570440dszKpC','env','split','properties','0.0.0','unknown','Invalid\x20product\x20telemetry\x20state\x20version.','npm_execpath','state-unavailable','timeoutMs','unref','buildInfo','14164777BNLaLo','.tmp','https://univer.ai/api/telemetry/cli','now','capture','pnpm','anonymousInstallId','package.json','utf8','5xxUelD','number'];_0x4856=function(){return _0x580ec0;};return _0x4856();}import{spawn as _0x2bfd54}from'node:child_process';import{readFileSync as _0x5b68be}from'node:fs';import{mkdir as _0x2c293f,readFile as _0xad7546,rename as _0x4babaf,writeFile as _0x35daf1}from'node:fs/promises';import{dirname as _0x7ccd89,join as _0x381a33,resolve as _0x3f31ba}from'node:path';import{fileURLToPath as _0xffb230}from'node:url';import{homedir as _0x4a7dbe,platform as _0x42ef24}from'node:os';import{randomUUID as _0x2e8a7a}from'node:crypto';async function h(_0x3c2a66){const _0x642c6e=_0x4bae;let _0x10248e=_0x3c2a66[_0x642c6e(0x1dd)]??process.env,_0x467fc5=_0x3c2a66[_0x642c6e(0x1d6)]??_0x3b07c7(_0x10248e);if(_0x467fc5[_0x642c6e(0x1c4)]!==_0x642c6e(0x195))return{'reason':_0x642c6e(0x1d4),'status':'skipped'};let _0x4c8cc8=_0x3c2a66[_0x642c6e(0x189)]??_0x2ff531;if(N(_0x4c8cc8))return{'reason':_0x642c6e(0x1c8),'status':_0x642c6e(0x1ae)};let _0x483e8c=_0x3c2a66['config']??await O(_0x467fc5['packageRoot']);if(_0x483e8c[_0x642c6e(0x19b)][_0x642c6e(0x1c0)]===0x0)return{'reason':'missing-endpoint','status':_0x642c6e(0x1ae)};let _0x36dbfc=_0x3c2a66['now']??new Date(),_0x27404f=_0x3c2a66['statePath']??v({'env':_0x10248e}),_0x12501c=await b({'path':_0x27404f,..._0x3c2a66['randomId']===void 0x0?{}:{'randomId':_0x3c2a66[_0x642c6e(0x1cb)]},..._0x3c2a66[_0x642c6e(0x197)]===void 0x0?{}:{'stateIo':_0x3c2a66[_0x642c6e(0x197)]}});if(_0x12501c[_0x642c6e(0x1d0)]===void 0x0)return{'reason':_0x642c6e(0x186),'status':'skipped'};if(_0x3c2a66[_0x642c6e(0x1be)]==='cli_first_opened'&&_0x12501c[_0x642c6e(0x1d0)][_0x642c6e(0x1a1)]['cli_first_opened']!==void 0x0)return{'reason':'already-attempted','status':_0x642c6e(0x1ae)};let _0x3ab4d0=w({'buildInfo':_0x4c8cc8,'eventName':_0x3c2a66['eventName'],'now':_0x36dbfc,'state':_0x12501c['state']});await C({'path':_0x27404f,'state':_0x3ab4d0,..._0x3c2a66[_0x642c6e(0x197)]===void 0x0?{}:{'stateIo':_0x3c2a66[_0x642c6e(0x197)]}});let _0x22dd9d=T({'buildInfo':_0x4c8cc8,'env':_0x10248e,'eventName':_0x3c2a66[_0x642c6e(0x1be)],'eventSource':_0x3c2a66[_0x642c6e(0x1bd)],'manifest':_0x467fc5,'state':_0x3ab4d0});try{return await(_0x3c2a66[_0x642c6e(0x1a6)]??new A())['capture']({'capture':_0x22dd9d,'config':_0x483e8c}),{'status':_0x642c6e(0x19f)};}catch{return{'reason':'capture-failed','status':_0x642c6e(0x1ae)};}}async function g(_0x4fc750={}){const _0x2062dd=_0x4bae;return await h({..._0x4fc750,'eventName':'cli_installed','eventSource':_0x2062dd(0x1d3)});}async function _(_0x410eb4={}){const _0x5e5ea2=_0x4bae;return await h({..._0x410eb4,'eventName':_0x5e5ea2(0x1c7),'eventSource':_0x5e5ea2(0x19c)});}function v(_0x353e3f={}){const _0x21f58e=_0x4bae;let _0x52c0ae=(_0x353e3f[_0x21f58e(0x1dd)]??process.env)[_0x21f58e(0x1c6)]?.[_0x21f58e(0x1cf)]();return _0x3f31ba(_0x52c0ae&&_0x52c0ae[_0x21f58e(0x1c0)]>0x0?_0x52c0ae:_0x381a33(_0x353e3f[_0x21f58e(0x1ab)]??_0x4a7dbe(),'.univer'),_0x21f58e(0x1b9),_0x21f58e(0x1d7));}function y(_0x12d96c={}){return{'anonymousInstallId':_0x12d96c['randomId']?.()??_0x2e8a7a(),'events':{},'version':0x1};}async function b(_0x1ed5a4){const _0x5ecf53=_0x4bae;let _0xd80a8=_0x1ed5a4[_0x5ecf53(0x197)]?.['readFile']??_0xad7546;try{return{'state':x(await _0xd80a8(_0x1ed5a4[_0x5ecf53(0x1da)],'utf8'))};}catch{return{'state':y({..._0x1ed5a4[_0x5ecf53(0x1cb)]===void 0x0?{}:{'randomId':_0x1ed5a4[_0x5ecf53(0x1cb)]}})};}}function x(_0xa7e1c5){const _0x47621b=_0x4bae;let _0x2d3136=JSON[_0x47621b(0x19d)](_0xa7e1c5);if(!R(_0x2d3136)||_0x2d3136[_0x47621b(0x1db)]!==0x1)throw Error(_0x47621b(0x184));if(typeof _0x2d3136[_0x47621b(0x190)]!=_0x47621b(0x1af)||_0x2d3136[_0x47621b(0x190)][_0x47621b(0x1c0)]===0x0)throw Error('Invalid\x20product\x20telemetry\x20anonymous\x20install\x20id.');let _0x124949=R(_0x2d3136[_0x47621b(0x1a1)])?_0x2d3136['events']:{};return{'anonymousInstallId':_0x2d3136[_0x47621b(0x190)],'events':{...P(_0x124949[_0x47621b(0x1ba)],_0x47621b(0x1ba)),...P(_0x124949[_0x47621b(0x1c7)],_0x47621b(0x1c7))},'version':0x1};}function _0x4bae(_0x2e2106,_0x4a3882){_0x2e2106=_0x2e2106-0x180;const _0x485638=_0x4856();let _0x4baeb5=_0x485638[_0x2e2106];return _0x4baeb5;}function S(_0x393c49){const _0x53b3c4=_0x4bae;return JSON[_0x53b3c4(0x1ce)](_0x393c49,null,0x2)+'\x0a';}async function C(_0x5ed2e8){const _0x170d9a=_0x4bae;let _0x370259=_0x5ed2e8['stateIo']?.[_0x170d9a(0x1b0)]??_0x35daf1,_0x411896=_0x5ed2e8[_0x170d9a(0x197)]?.['rename']??_0x4babaf,_0x4157e3=_0x5ed2e8[_0x170d9a(0x1da)]+'.'+process['pid']+'.'+Date['now']()+_0x170d9a(0x18b);try{await _0x2c293f(_0x7ccd89(_0x5ed2e8['path']),{'mode':0x1c0,'recursive':!0x0}),await _0x370259(_0x4157e3,S(_0x5ed2e8[_0x170d9a(0x1d0)]),{'encoding':_0x170d9a(0x192),'mode':0x180}),await _0x411896(_0x4157e3,_0x5ed2e8['path']);}catch{}}function w(_0x58472d){const _0x4c4e9d=_0x4bae;return{..._0x58472d['state'],'events':{..._0x58472d['state'][_0x4c4e9d(0x1a1)],[_0x58472d[_0x4c4e9d(0x1be)]]:{'attemptedAt':_0x58472d[_0x4c4e9d(0x18d)][_0x4c4e9d(0x1b3)](),'buildCommit':_0x58472d['buildInfo'][_0x4c4e9d(0x1b4)],'cliVersion':_0x58472d['buildInfo'][_0x4c4e9d(0x1db)]}}};}function T(_0x113067){const _0x45f451=_0x4bae;return{'distinctId':_0x113067[_0x45f451(0x1d0)][_0x45f451(0x190)],'event':_0x113067[_0x45f451(0x1be)],'properties':E(_0x113067)};}function E(_0x240dd5){const _0xcea250=_0x4bae;return{'arch':process['arch'],'build_commit':_0x240dd5['buildInfo']['commitHash'],'cli_version':_0x240dd5[_0xcea250(0x189)][_0xcea250(0x1db)],'distribution_channel':M(_0x240dd5[_0xcea250(0x1d6)]),'event_source':_0x240dd5[_0xcea250(0x1bd)],'install_manager':D(_0x240dd5['env']??process.env),'node_major_version':F(process[_0xcea250(0x1c2)][_0xcea250(0x1c3)]),'package_name':j(_0x240dd5[_0xcea250(0x1d6)]),'platform':_0x42ef24(),'telemetry_state_version':0x1};}function D(_0x118ab1=process.env){const _0x431005=_0x4bae;let _0x7974e4=process[_0x431005(0x1c2)];if(typeof _0x7974e4['bun']==_0x431005(0x1af)&&_0x7974e4[_0x431005(0x1ac)][_0x431005(0x1c0)]>0x0)return _0x431005(0x1ac);let _0x5f4025=_0x118ab1[_0x431005(0x1c1)]??'';if(/\bbun\//u[_0x431005(0x1c5)](_0x5f4025))return _0x431005(0x1ac);if(/\bpnpm\//u['test'](_0x5f4025))return _0x431005(0x18f);if(/\byarn\//u[_0x431005(0x1c5)](_0x5f4025))return _0x431005(0x1a8);if(/\bnpm\//u['test'](_0x5f4025))return'npm';let _0x581ade=_0x118ab1[_0x431005(0x185)]??'';return/(^|[/\\])bun(?:\.exe)?$/u[_0x431005(0x1c5)](_0x581ade)?'bun':/(^|[/\\])pnpm(?:\.cmd|\.ps1|\.exe)?$/u[_0x431005(0x1c5)](_0x581ade)?_0x431005(0x18f):/(^|[/\\])yarn(?:\.cmd|\.ps1|\.exe)?$/u[_0x431005(0x1c5)](_0x581ade)?'yarn':/(^|[/\\])npm(?:\.cmd|\.ps1|\.exe)?$/u['test'](_0x581ade)?_0x431005(0x1a3):_0x118ab1['UNIVER_MANAGED_BY_BUN']==='1'?_0x431005(0x1ac):_0x118ab1[_0x431005(0x1a0)]==='1'?_0x431005(0x1a3):_0x431005(0x183);}async function O(_0x338e32){const _0x3a5079=_0x4bae;try{let _0x57e61b=await _0xad7546(_0x381a33(_0x338e32,_0x3a5079(0x1cd),'product-telemetry.json'),_0x3a5079(0x192));return k(JSON['parse'](_0x57e61b));}catch{return k({});}}function k(_0x3d2664){const _0x52c956=_0x4bae;let _0x2e46f7=R(_0x3d2664)?_0x3d2664:{};return{'endpoint':I(_0x2e46f7[_0x52c956(0x19b)],_0x52c956(0x18c)),'timeoutMs':L(_0x2e46f7[_0x52c956(0x187)],0x1388)};}var A=class{async[_0x4de12c(0x18e)](_0x16619f){const _0x190b4f=_0x4de12c;let _0x44e23a=await fetch(_0x16619f[_0x190b4f(0x1b6)][_0x190b4f(0x19b)],{'body':JSON[_0x190b4f(0x1ce)]({'distinctId':_0x16619f[_0x190b4f(0x18e)][_0x190b4f(0x1a9)],'event':_0x16619f[_0x190b4f(0x18e)][_0x190b4f(0x1b1)],'properties':_0x16619f[_0x190b4f(0x18e)][_0x190b4f(0x181)]}),'headers':{'content-type':_0x190b4f(0x1cc)},'method':_0x190b4f(0x1bb),'signal':AbortSignal['timeout'](_0x16619f[_0x190b4f(0x1b6)][_0x190b4f(0x187)])});if(!_0x44e23a['ok'])throw Error(_0x190b4f(0x19e)+_0x44e23a[_0x190b4f(0x1d1)]);}};function j(_0x332513){const _0x310d01=_0x4de12c;try{let _0x2fc0a2=JSON[_0x310d01(0x19d)](_0x5b68be(_0x381a33(_0x332513[_0x310d01(0x1aa)],_0x310d01(0x191)),_0x310d01(0x192)));return typeof _0x2fc0a2['name']==_0x310d01(0x1af)&&_0x2fc0a2[_0x310d01(0x1b2)][_0x310d01(0x1cf)]()['length']>0x0?_0x2fc0a2[_0x310d01(0x1b2)]:_0x310d01(0x1c9);}catch{return _0x310d01(0x1c9);}}function M(_0x26cfb0){const _0x530245=_0x4de12c;let _0x4f39e0=j(_0x26cfb0);return _0x4f39e0===_0x530245(0x1bf)?'internal-github':_0x4f39e0==='univer-cli'?_0x530245(0x199):_0x26cfb0['mode'];}function N(_0x310ebf){const _0x4ed4ab=_0x4de12c;return _0x310ebf[_0x4ed4ab(0x1db)]===_0x4ed4ab(0x182);}function P(_0x411172,_0x2e28f3){const _0x53e5ca=_0x4de12c;return!R(_0x411172)||typeof _0x411172[_0x53e5ca(0x1a5)]!=_0x53e5ca(0x1af)||typeof _0x411172['buildCommit']!='string'||typeof _0x411172['cliVersion']!=_0x53e5ca(0x1af)?{}:{[_0x2e28f3]:{'attemptedAt':_0x411172['attemptedAt'],'buildCommit':_0x411172[_0x53e5ca(0x1b8)],'cliVersion':_0x411172['cliVersion']}};}function F(_0x22d5e8){const _0x38c218=_0x4de12c;let _0x3b5179=Number(_0x22d5e8[_0x38c218(0x180)]('.')[0x0]);return Number[_0x38c218(0x196)](_0x3b5179)&&_0x3b5179>0x0?_0x3b5179:void 0x0;}function I(_0x371b9f,_0x4bc799){const _0x462e39=_0x4de12c;return typeof _0x371b9f==_0x462e39(0x1af)&&_0x371b9f[_0x462e39(0x1cf)]()[_0x462e39(0x1c0)]>0x0?_0x371b9f[_0x462e39(0x1cf)]():_0x4bc799;}function L(_0x56c6cf,_0x5cb361){const _0x1b8d37=_0x4de12c;return typeof _0x56c6cf==_0x1b8d37(0x194)&&Number[_0x1b8d37(0x196)](_0x56c6cf)&&_0x56c6cf>0x0?_0x56c6cf:_0x5cb361;}function R(_0x44b796){const _0x3c8484=_0x4de12c;return typeof _0x44b796==_0x3c8484(0x1ca)&&!!_0x44b796;}var z=process[_0x4de12c(0x1a4)][0x2];try{z==='first-open'?await _():z===_0x4de12c(0x1d3)?B(_0x4de12c(0x1d2)):z===_0x4de12c(0x1d2)&&await g();}catch{}function B(_0x494417){const _0x4b9ce8=_0x4de12c;_0x2bfd54(process[_0x4b9ce8(0x1a2)],[_0xffb230(import.meta.url),_0x494417],{'detached':!0x0,'env':process.env,'stdio':_0x4b9ce8(0x1b7),'windowsHide':!0x0})[_0x4b9ce8(0x188)]();}
@@ -1 +1 @@
1
- function _0xf363(){const _0x48c661=['method','5716449bGPlQA','SIGTERM','data','5996YbkSBA','loadWorkbook','24qYDUxx','type','meta','tail','LoadWorkbookDataReplayPack','233045KqwysK','evalJs','disconnect','2.0','exit','130LzKRiI','evaljs','exportWorkbookFile','value','withSpan','204NoWqPO','outputPath','message','8INjEsp','10MDkuZe','Method\x20not\x20implemented:\x20','1262085QxgXCY','resolve','params','21523GgrHoQ','rpc-request','CreateWorkbook','send','3687McBKvR','7246337pVIvPE','mutates','LoadWorkbook','code','RuntimeRpcClient','dispose','ExportWorkbookFile','loadWorkbookDataReplayPack','EvalJs','3313188bmBpCr','enqueue','evalJsWithMutationCapture','createWorkbook','ExportWorkbookData','maxCodeLength','traceparent','exportWorkbookData'];_0xf363=function(){return _0x48c661;};return _0xf363();}const _0x5a7b5c=_0x1369;(function(_0x208494,_0x165567){const _0x41040e=_0x1369,_0x5e0a83=_0x208494();while(!![]){try{const _0x35736a=-parseInt(_0x41040e(0x197))/0x1*(parseInt(_0x41040e(0x1b3))/0x2)+parseInt(_0x41040e(0x19b))/0x3*(parseInt(_0x41040e(0x1b1))/0x4)+parseInt(_0x41040e(0x1b8))/0x5*(-parseInt(_0x41040e(0x18e))/0x6)+-parseInt(_0x41040e(0x19c))/0x7*(parseInt(_0x41040e(0x191))/0x8)+parseInt(_0x41040e(0x1ae))/0x9*(-parseInt(_0x41040e(0x192))/0xa)+-parseInt(_0x41040e(0x194))/0xb+-parseInt(_0x41040e(0x1a5))/0xc*(-parseInt(_0x41040e(0x1bd))/0xd);if(_0x35736a===_0x165567)break;else _0x5e0a83['push'](_0x5e0a83['shift']());}catch(_0x1caef1){_0x5e0a83['push'](_0x5e0a83['shift']());}}}(_0xf363,0xee158));import'../chunks/vendor-CgwrUUL6.js';function _0x1369(_0x426c0c,_0x3ff984){_0x426c0c=_0x426c0c-0x18c;const _0xf363cf=_0xf363();let _0x1369ac=_0xf363cf[_0x426c0c];return _0x1369ac;}import{t as _0x1ee3cd}from'../chunks/headless-univer-B0Rozw6u.js';import{n as _0x2b0f70,o as _0x402f0e,t as _0x24d259}from'../chunks/trace-DPfd8LdJ.js';let i=function(_0x53d728){const _0x4f4ab4=_0x1369;return _0x53d728[_0x4f4ab4(0x199)]=_0x4f4ab4(0x1a8),_0x53d728[_0x4f4ab4(0x1a4)]=_0x4f4ab4(0x1be),_0x53d728[_0x4f4ab4(0x1a2)]='exportWorkbookFile',_0x53d728['ExportWorkbookData']=_0x4f4ab4(0x1ac),_0x53d728[_0x4f4ab4(0x19e)]=_0x4f4ab4(0x1b2),_0x53d728['LoadWorkbookDataReplayPack']=_0x4f4ab4(0x1a3),_0x53d728;}({});var a=class{['tail']=Promise[_0x5a7b5c(0x195)]();async[_0x5a7b5c(0x1a6)](_0x1b1f45){const _0x19589f=_0x5a7b5c;let _0x1804a4=this['tail'],_0x27ee6f;this[_0x19589f(0x1b6)]=new Promise(_0x23f279=>{_0x27ee6f=_0x23f279;}),await _0x1804a4;try{return await _0x1b1f45();}finally{_0x27ee6f?.();}}},o=_0x1ee3cd(),s=new a();process[_0x5a7b5c(0x19a)]?.({'type':'ready'}),process['on'](_0x5a7b5c(0x190),async _0x56db01=>{const _0x42cc4d=_0x5a7b5c;if(_0x56db01?.[_0x42cc4d(0x1b4)]!==_0x42cc4d(0x198))return;let _0x4c5a9b=await c(_0x56db01[_0x42cc4d(0x1b0)]);process[_0x42cc4d(0x19a)]?.({'type':'rpc-response','id':_0x56db01['id'],'data':_0x4c5a9b});}),process['on'](_0x5a7b5c(0x1ba),()=>{const _0x5ed5a1=_0x5a7b5c;o[_0x5ed5a1(0x1a1)](),process[_0x5ed5a1(0x1bc)](0x0);}),process['on'](_0x5a7b5c(0x1af),()=>{const _0x7278ac=_0x5a7b5c;o[_0x7278ac(0x1a1)](),process[_0x7278ac(0x1bc)](0x0);});async function c(_0x3f574d){const _0x3c4300=_0x5a7b5c;let _0x49e11d=_0x24d259(_0x3f574d[_0x3c4300(0x1b5)]?.[_0x3c4300(0x1ab)]),_0x121bba=async()=>await _0x2b0f70[_0x3c4300(0x18d)]({'name':_0x402f0e[_0x3c4300(0x1a0)],'kind':'server'},async()=>await l(_0x3f574d));return _0x49e11d===void 0x0?await _0x121bba():await _0x2b0f70['withContext'](_0x49e11d,_0x121bba);}async function l(_0x31707f){const _0x5af16b=_0x5a7b5c;try{switch(_0x31707f['method']){case i[_0x5af16b(0x199)]:{let _0x1b32a7=o[_0x5af16b(0x1a8)](_0x31707f[_0x5af16b(0x196)]??{});return{'jsonrpc':_0x5af16b(0x1bb),'id':_0x31707f['id'],'result':{'success':!0x0,'workbookData':_0x1b32a7}};}case i[_0x5af16b(0x19e)]:{let _0x4befb5=o['loadWorkbookData'](_0x31707f[_0x5af16b(0x196)]['workbookData']);return{'jsonrpc':_0x5af16b(0x1bb),'id':_0x31707f['id'],'result':{'success':!0x0,'workbookData':_0x4befb5}};}case i[_0x5af16b(0x1b7)]:return await o[_0x5af16b(0x1a3)](_0x31707f[_0x5af16b(0x196)]),{'jsonrpc':'2.0','id':_0x31707f['id'],'result':{'success':!0x0}};case i[_0x5af16b(0x1a9)]:return{'jsonrpc':'2.0','id':_0x31707f['id'],'result':{'success':!0x0,'workbookData':o['exportWorkbookData']()}};case i[_0x5af16b(0x1a2)]:{let _0x4ea18b=_0x31707f['params'],_0x12f563=await o[_0x5af16b(0x1bf)](_0x4ea18b[_0x5af16b(0x18f)],_0x4ea18b['format']);return{'jsonrpc':'2.0','id':_0x31707f['id'],'result':{'success':!0x0,..._0x12f563}};}case i['EvalJs']:{let _0xd44c40=_0x31707f[_0x5af16b(0x196)]??{},_0x88ba92=async()=>{const _0x192657=_0x5af16b;let _0x358f1f=_0xd44c40[_0x192657(0x19d)]?await o[_0x192657(0x1a7)](_0xd44c40['code'],_0xd44c40[_0x192657(0x1aa)]):{'value':await o[_0x192657(0x1b9)](_0xd44c40[_0x192657(0x19f)],_0xd44c40[_0x192657(0x1aa)]),'mutations':void 0x0};return{'success':!0x0,..._0x358f1f['mutations']===void 0x0?{}:{'mutations':_0x358f1f['mutations']},'value':_0x358f1f[_0x192657(0x18c)]};},_0x1b1a92=_0xd44c40[_0x5af16b(0x19d)]?await s[_0x5af16b(0x1a6)](_0x88ba92):await _0x88ba92();return{'jsonrpc':_0x5af16b(0x1bb),'id':_0x31707f['id'],'result':_0x1b1a92};}default:throw Error(_0x5af16b(0x193)+String(_0x31707f[_0x5af16b(0x1ad)]));}}catch(_0x532aba){return{'jsonrpc':_0x5af16b(0x1bb),'id':_0x31707f['id'],'error':{'code':-0x7f5b,'message':_0x532aba instanceof Error?_0x532aba[_0x5af16b(0x190)]:String(_0x532aba)}};}}
1
+ const _0xfcf1b=_0x34f6;(function(_0x5dc782,_0x4181a9){const _0x22edeb=_0x34f6,_0x2109df=_0x5dc782();while(!![]){try{const _0x1af380=parseInt(_0x22edeb(0x11a))/0x1*(-parseInt(_0x22edeb(0x104))/0x2)+parseInt(_0x22edeb(0xf5))/0x3*(-parseInt(_0x22edeb(0xf7))/0x4)+parseInt(_0x22edeb(0x11d))/0x5*(parseInt(_0x22edeb(0x106))/0x6)+parseInt(_0x22edeb(0x112))/0x7*(parseInt(_0x22edeb(0x113))/0x8)+-parseInt(_0x22edeb(0x119))/0x9+parseInt(_0x22edeb(0x10b))/0xa+parseInt(_0x22edeb(0x11c))/0xb*(parseInt(_0x22edeb(0x118))/0xc);if(_0x1af380===_0x4181a9)break;else _0x2109df['push'](_0x2109df['shift']());}catch(_0x19c4d9){_0x2109df['push'](_0x2109df['shift']());}}}(_0x4d79,0x461d5));import'../chunks/vendor-CgwrUUL6.js';import{t as _0x986637}from'../chunks/headless-univer-B0Rozw6u.js';import{n as _0x1dc48a,o as _0x526737,t as _0x492a29}from'../chunks/trace-DPfd8LdJ.js';let i=function(_0x5b29c9){const _0x1064c7=_0x34f6;return _0x5b29c9['CreateWorkbook']=_0x1064c7(0x114),_0x5b29c9['EvalJs']=_0x1064c7(0xf6),_0x5b29c9['ExportWorkbookFile']='exportWorkbookFile',_0x5b29c9[_0x1064c7(0xf8)]=_0x1064c7(0x11e),_0x5b29c9[_0x1064c7(0xfe)]='loadWorkbook',_0x5b29c9['LoadWorkbookDataReplayPack']=_0x1064c7(0x100),_0x5b29c9;}({});var a=class{[_0xfcf1b(0x10f)]=Promise[_0xfcf1b(0x11b)]();async[_0xfcf1b(0x117)](_0x172b43){const _0x312f4b=_0xfcf1b;let _0x3b05a9=this[_0x312f4b(0x10f)],_0x49e7d0;this[_0x312f4b(0x10f)]=new Promise(_0x3498d8=>{_0x49e7d0=_0x3498d8;}),await _0x3b05a9;try{return await _0x172b43();}finally{_0x49e7d0?.();}}},o=_0x986637(),s=new a();process[_0xfcf1b(0xfd)]?.({'type':_0xfcf1b(0x115)}),process['on'](_0xfcf1b(0xfc),async _0x379ca0=>{const _0x38091c=_0xfcf1b;if(_0x379ca0?.[_0x38091c(0x105)]!==_0x38091c(0x107))return;let _0xfeaa4f=await c(_0x379ca0['data']);process['send']?.({'type':_0x38091c(0x10e),'id':_0x379ca0['id'],'data':_0xfeaa4f});}),process['on'](_0xfcf1b(0x123),()=>{const _0x232d73=_0xfcf1b;o[_0x232d73(0x10c)](),process[_0x232d73(0x109)](0x0);}),process['on'](_0xfcf1b(0x10a),()=>{const _0x5aace0=_0xfcf1b;o[_0x5aace0(0x10c)](),process[_0x5aace0(0x109)](0x0);});function _0x4d79(){const _0x31ef35=['exportWorkbookFile','rpc-response','tail','workbookData','RuntimeRpcClient','481047qrETJA','56KAlpdN','createWorkbook','ready','format','enqueue','6331548GKPdMZ','3256434JzIeFd','316795AxrqoE','resolve','11tXXpqL','47585xdPZlu','exportWorkbookData','ExportWorkbookFile','value','mutations','method','disconnect','withSpan','3KblWoR','evaljs','1688436UjevZi','ExportWorkbookData','LoadWorkbookDataReplayPack','evalJsWithMutationCapture','CreateWorkbook','message','send','LoadWorkbook','2.0','loadWorkbookDataReplayPack','evalJs','params','code','2SLiVwt','type','174JdctqQ','rpc-request','meta','exit','SIGTERM','1032500UDOjyS','dispose'];_0x4d79=function(){return _0x31ef35;};return _0x4d79();}async function c(_0x5e2b68){const _0x3e2749=_0xfcf1b;let _0x975f19=_0x492a29(_0x5e2b68[_0x3e2749(0x108)]?.['traceparent']),_0xac3dfd=async()=>await _0x1dc48a[_0x3e2749(0xf4)]({'name':_0x526737[_0x3e2749(0x111)],'kind':'server'},async()=>await l(_0x5e2b68));return _0x975f19===void 0x0?await _0xac3dfd():await _0x1dc48a['withContext'](_0x975f19,_0xac3dfd);}function _0x34f6(_0x3f4c5d,_0x205e04){_0x3f4c5d=_0x3f4c5d-0xf4;const _0x4d7913=_0x4d79();let _0x34f616=_0x4d7913[_0x3f4c5d];return _0x34f616;}async function l(_0x2712ed){const _0x252bd5=_0xfcf1b;try{switch(_0x2712ed['method']){case i[_0x252bd5(0xfb)]:{let _0x355e6b=o[_0x252bd5(0x114)](_0x2712ed[_0x252bd5(0x102)]??{});return{'jsonrpc':_0x252bd5(0xff),'id':_0x2712ed['id'],'result':{'success':!0x0,'workbookData':_0x355e6b}};}case i['LoadWorkbook']:{let _0x2d724b=o['loadWorkbookData'](_0x2712ed['params'][_0x252bd5(0x110)]);return{'jsonrpc':'2.0','id':_0x2712ed['id'],'result':{'success':!0x0,'workbookData':_0x2d724b}};}case i[_0x252bd5(0xf9)]:return await o[_0x252bd5(0x100)](_0x2712ed['params']),{'jsonrpc':'2.0','id':_0x2712ed['id'],'result':{'success':!0x0}};case i[_0x252bd5(0xf8)]:return{'jsonrpc':'2.0','id':_0x2712ed['id'],'result':{'success':!0x0,'workbookData':o[_0x252bd5(0x11e)]()}};case i[_0x252bd5(0x11f)]:{let _0x277db7=_0x2712ed[_0x252bd5(0x102)],_0x523b2c=await o[_0x252bd5(0x10d)](_0x277db7['outputPath'],_0x277db7[_0x252bd5(0x116)]);return{'jsonrpc':_0x252bd5(0xff),'id':_0x2712ed['id'],'result':{'success':!0x0,..._0x523b2c}};}case i['EvalJs']:{let _0x1cbc1d=_0x2712ed[_0x252bd5(0x102)]??{},_0x375c22=async()=>{const _0x359f7e=_0x252bd5;let _0x356c9b=_0x1cbc1d['mutates']?await o[_0x359f7e(0xfa)](_0x1cbc1d[_0x359f7e(0x103)],_0x1cbc1d['maxCodeLength']):{'value':await o[_0x359f7e(0x101)](_0x1cbc1d['code'],_0x1cbc1d['maxCodeLength']),'mutations':void 0x0};return{'success':!0x0,..._0x356c9b[_0x359f7e(0x121)]===void 0x0?{}:{'mutations':_0x356c9b['mutations']},'value':_0x356c9b[_0x359f7e(0x120)]};},_0x458629=_0x1cbc1d['mutates']?await s[_0x252bd5(0x117)](_0x375c22):await _0x375c22();return{'jsonrpc':'2.0','id':_0x2712ed['id'],'result':_0x458629};}default:throw Error('Method\x20not\x20implemented:\x20'+String(_0x2712ed[_0x252bd5(0x122)]));}}catch(_0x1c1e9b){return{'jsonrpc':_0x252bd5(0xff),'id':_0x2712ed['id'],'error':{'code':-0x7f5b,'message':_0x1c1e9b instanceof Error?_0x1c1e9b[_0x252bd5(0xfc)]:String(_0x1c1e9b)}};}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "univer-cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Command-line tools for local Univer workbook automation.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,62 +1,40 @@
1
1
  # SaC Apply And Ledger
2
2
 
3
- `univer sac apply` validates the source chain, validates the target ledger, bundles one pending pack, applies it to an isolated working artifact, commits it, and then moves to the next pack. The commit model is pack by pack.
3
+ `univer sac apply <package.univer>` validates package-local source under `project/migrations/`, validates the package ledger, bundles pending packs, and writes workbook state plus `manifest.metadata.sac.migrationLedger` back to the same project workbook package.
4
4
 
5
- By default, every successfully applied pack is also committed through workbook versioning as one local changeset. If the newest applied pack is wrong, roll back the target workbook with `univer reset <target> --hard HEAD~1`, inspect, then fix the migration source before applying again.
5
+ By default, every successfully applied pack is also committed through workbook versioning as one local changeset. If the newest applied pack is wrong, roll back the package with `univer reset <package.univer> --hard HEAD~1`, inspect, then fix the migration source before applying again.
6
6
 
7
- Use `univer sac apply <workspace> --no-commit` only for compatibility or recovery workflows where SaC should write ledger metadata without creating workbook local changesets.
7
+ Use `--no-commit` only for compatibility or recovery workflows where SaC should write ledger metadata without creating workbook local changesets.
8
8
 
9
9
  ## Target Lifecycle
10
10
 
11
- When no `--target` is provided, the target path comes from `sac.config.ts` and must match the workspace artifact mode.
11
+ The package path is the target. `--target` is not supported, and `project/univer.config.ts` does not contain artifact output settings.
12
12
 
13
- Generated workspaces are created by `univer sac init ./model`. They use `artifacts.mode: "generated"` and must write the managed result to `artifacts/<workspace-name>.univer`, for example `./model/artifacts/model.univer`.
14
-
15
- Adopted workspaces are created by `univer sac init ./model --from ./existing.univer`. They use `artifacts.mode: "adopted"` and must continue updating the original artifact recorded in `artifacts.defaultWorkbook`.
16
-
17
- If `--target` is provided, it must still resolve to the target required by the workspace artifact mode. Do not write SaC result workbooks to `dist/`, the workspace root, or ad hoc output names.
18
-
19
- Generated workspaces are created by `univer sac init ./model`. They use `artifacts.mode: "generated"` and must write the managed result to `artifacts/<workspace-name>.univer`, for example `./model/artifacts/model.univer`.
20
-
21
- Adopted workspaces are created by `univer sac init ./model --from ./existing.univer`. They use `artifacts.mode: "adopted"` and must continue updating the original artifact recorded in `artifacts.defaultWorkbook`.
22
-
23
- If `--target` is provided, it must still resolve to the target required by the workspace artifact mode. Do not write SaC result workbooks to `dist/`, the workspace root, or ad hoc output names.
24
-
25
- If the target `.univer` artifact does not exist, apply starts from an empty logical workbook and creates the artifact. The resulting workbook should contain only sheets declared by migration source.
26
-
27
- If the target exists, it must be managed by SaC and contain the artifact-local ledger in package manifest metadata.
28
-
29
- The ledger is artifact-local to the required result artifact. Apply rejects any default target or `--target` path that does not match the workspace artifact mode.
13
+ If the package has `project/univer.config.ts` but no SaC ledger, run `univer sac rebuild <package.univer>` to establish the package-local source/workbook baseline. Apply does not infer or repair a missing ledger.
30
14
 
31
15
  ## Ledger Contract
32
16
 
33
- Each applied pack writes a ledger entry with pack id, source hash, previous pack pointer, artifact content hash, runner metadata, timestamp, and origin.
34
-
35
- New default apply entries also include `workbookCommit` with the local changeset `sid`, `reqId`, commit message, and mutation count. Entries created with `--no-commit` omit `workbookCommit` and report the workbook commit as skipped in command output.
17
+ Apply updates the project workbook package pack by pack. Each applied pack writes a ledger entry with pack id, source hash, previous pack pointer, workbook content hash, runner metadata, timestamp, and origin.
36
18
 
37
19
  Apply fails before executing pending source when:
38
20
 
39
- - the target exists but is unmanaged
40
- - the ledger is malformed
41
- - the target ledger is ahead of source
21
+ - the package project is missing
22
+ - the package ledger is missing or malformed
23
+ - the package ledger is ahead of source
42
24
  - an already-applied pack id has a different source hash
43
- - artifact content has drifted since the ledger head
25
+ - workbook content has drifted since the ledger head
44
26
  - automatic workbook commit finds no pending workbook mutations
45
27
  - automatic workbook commit returns more than one local changeset for a single pack
46
28
 
47
- If every source pack is already ledgered with matching hashes and the artifact has not drifted, apply succeeds as an up to date no-op.
29
+ If every source pack is already ledgered with matching hashes and the workbook content has not drifted, apply succeeds as an up-to-date no-op.
48
30
 
49
31
  ## Verification
50
32
 
51
- Apply success is not the Spreadsheet TDD completion gate. For assertion-backed SaC work, run `univer sac verify <workspace> --json` after apply and read the referenced `.sac/runs/<run-id>/verify-report.json`.
52
-
53
- Use `inspect`, `pipe out`, and `view` as supplemental workbook-visible checks when they help explain or hand off the result:
33
+ Apply success is not the Spreadsheet TDD completion gate. For assertion-backed SaC work, run `univer sac verify <package.univer> --json` after apply and read the referenced `internal/sac/runs/<run-id>/verify-report.json`.
54
34
 
55
35
  ```bash
56
- univer sac verify <workspace> --json
57
- univer inspect workbook ./model/artifacts/model.univer
58
- univer pipe out ./model/artifacts/model.univer --range "Revenue!A1:C4" --format tsv
59
- univer view ./model/artifacts/model.univer
36
+ univer sac verify ./model.univer --json
37
+ univer inspect workbook ./model.univer
38
+ univer pipe out ./model.univer --range "Revenue!A1:C4" --format tsv
39
+ univer view ./model.univer
60
40
  ```
61
-
62
- Do not treat successful command output as the only validation for a non-trivial workbook change.
@@ -1,6 +1,6 @@
1
1
  # SaC Assertions
2
2
 
3
- Use `assertions.ts` to express the workbook-visible contract for a Facade Migration Pack. `univer sac verify` loads each applied pack's assertion source, copies the target workbook into a sandbox under `.sac/runs/<run-id>/`, reads workbook state through the Facade API, and writes `.sac/runs/<run-id>/verify-report.json`.
3
+ Use `assertions.ts` to express the workbook-visible contract for a Facade Migration Pack. `univer sac verify` loads each applied pack's assertion source, copies the target workbook into a sandbox under `internal/sac/runs/<run-id>/`, reads workbook state through the Facade API, and writes `internal/sac/runs/<run-id>/verify-report.json`.
4
4
 
5
5
  `univer sac verify` does not mutate the canonical target workbook.
6
6
 
@@ -46,14 +46,14 @@ Keep assertions deterministic and representative. Prefer stable workbook-visible
46
46
  Run apply before verification when a migration is not yet applied:
47
47
 
48
48
  ```bash
49
- univer sac apply <workspace>
50
- univer sac verify <workspace> --json
49
+ univer sac apply <package.univer>
50
+ univer sac verify <package.univer> --json
51
51
  ```
52
52
 
53
53
  The JSON summary includes status, checked and skipped pack counts, assertion counts, failure summaries, and the report path. Read the referenced report for detailed failure evidence:
54
54
 
55
55
  ```text
56
- .sac/runs/<run-id>/verify-report.json
56
+ internal/sac/runs/<run-id>/verify-report.json
57
57
  ```
58
58
 
59
59
  Status interpretation:
@@ -78,9 +78,9 @@ For `failed` reports, inspect each failure for:
78
78
  Then decide whether the migration source is wrong or the assertion expectation is wrong. Repair the source or assertion, rerun apply when the applied artifact needs to change, then rerun:
79
79
 
80
80
  ```bash
81
- univer sac verify <workspace> --json
81
+ univer sac verify <package.univer> --json
82
82
  ```
83
83
 
84
84
  For `error` reports, repair setup first. Do not treat setup errors as proof that workbook behavior is wrong.
85
85
 
86
- Apply success is not a Spreadsheet TDD completion gate. The completion gate is a relevant `univer sac verify <workspace> --json` run with status `passed`, plus the report path recorded in the handoff.
86
+ Apply success is not a Spreadsheet TDD completion gate. The completion gate is a relevant `univer sac verify <package.univer> --json` run with status `passed`, plus the report path recorded in the handoff.
@@ -1,6 +1,6 @@
1
1
  # SaC Data Assets
2
2
 
3
- Migration source may import workspace-local CSV and TSV files when external data makes the workbook intent easier to review.
3
+ Migration source may import package-local CSV and TSV files when external data makes the workbook intent easier to review.
4
4
 
5
5
  ## CSV And TSV Assets
6
6
 
@@ -14,22 +14,22 @@ migrations/
14
14
  revenue.tsv
15
15
  ```
16
16
 
17
- The TypeScript bundler treats referenced CSV and TSV assets as source inputs. They participate in the same source hash as `pack.ts`, `*.sheet.ts`, and workspace-local helper files.
17
+ The TypeScript bundler treats referenced CSV and TSV assets as source inputs. They participate in the same source hash as `pack.ts`, `*.sheet.ts`, and package-local helper files.
18
18
 
19
19
  ## Import Boundary
20
20
 
21
- SaC source must stay inside the workspace realpath boundary. These inputs are allowed:
21
+ SaC source must stay inside the package `project/` realpath boundary. These inputs are allowed:
22
22
 
23
- - relative TypeScript imports that resolve inside the workspace
24
- - relative CSV or TSV imports that resolve inside the workspace
23
+ - relative TypeScript imports that resolve inside the package project
24
+ - relative CSV or TSV imports that resolve inside the package project
25
25
  - the CLI-provided helper specifier `univer:sac/facade-migration-pack`
26
- - type-only imports for module declarations exposed by workspace `types/*.d.ts`, such as `import type { FRange } from "@univerjs/sheets/facade"`
26
+ - type-only imports for module declarations exposed by `project/types/*.d.ts`, such as `import type { FRange } from "@univerjs/sheets/facade"`
27
27
 
28
28
  These inputs are rejected before any workbook mutation runs:
29
29
 
30
- - parent-path or symlink escapes outside the workspace
31
- - runtime package imports; SaC does not install or bundle workspace dependencies
30
+ - parent-path or symlink escapes outside the package project
31
+ - runtime package imports; SaC does not install or bundle project dependencies
32
32
  - runtime Node builtin imports such as `import { readFile } from "node:fs/promises"`
33
33
  - non-literal dynamic imports
34
34
 
35
- The SaC workspace is not a package project and does not support external dependencies. Use `import type` only when source needs named Facade or SDK types from local `types/*.d.ts`; do not add runtime package imports to migration source.
35
+ The SaC project does not support external dependencies. Use `import type` only when source needs named Facade or SDK types from local `project/types/*.d.ts`; do not add runtime package imports to migration source.
@@ -1,6 +1,6 @@
1
1
  # SaC Facade API
2
2
 
3
- SaC help does not duplicate the full Facade API reference. New workspaces include local `types/*.d.ts` files generated from the CLI runtime SDK; use them as the authoring reference for method names, overloads, enum names, and data shapes.
3
+ SaC help does not duplicate the full Facade API reference. Project-enabled packages include local `project/types/*.d.ts` files generated from the CLI runtime SDK; use them as the authoring reference for method names, overloads, enum names, and data shapes.
4
4
 
5
5
  ## Local Types
6
6
 
@@ -17,11 +17,11 @@ apply({ workbook, sheet, univerAPI }) {
17
17
  - `univerAPI` is available for Facade APIs that are not sheet-local.
18
18
 
19
19
  ```bash
20
- rg "class FRange|setFormula|setValues" types
21
- rg "interface ICellData|enum BorderType" types
20
+ rg "class FRange|setFormula|setValues" project/types
21
+ rg "interface ICellData|enum BorderType" project/types
22
22
  pnpm exec tsc -p tsconfig.json --pretty false
23
23
  ```
24
24
 
25
- Use only APIs present in local `types/*.d.ts`. Do not guess Facade method names, and do not hand-write local ambient declarations or shim files for Facade or `univer:sac/*` helpers.
25
+ Use only APIs present in local `project/types/*.d.ts`. Do not guess Facade method names, and do not hand-write local ambient declarations or shim files for Facade or `univer:sac/*` helpers.
26
26
 
27
27
  If a public Facade API or type is missing from the generated assets, treat it as a CLI type asset gap instead of patching the SaC project with private declarations.
@@ -14,7 +14,7 @@ A successful rebuild replaces active `migrations/` with one generated checkpoint
14
14
 
15
15
  Default rebuild requires the source chain and artifact ledger to match. `--force` may discard active source history only inside the same workspace artifact boundary; it does not bypass managed-artifact validation, materialization gaps, package locks, transaction recovery, or path safety.
16
16
 
17
- Rebuild recovery state is stored in `.sac/rebuild-recovery` and is cleaned after a successful rebuild or rollback. Agent runner evidence belongs in `.sac/runs/` and must not be removed by rebuild recovery cleanup.
17
+ Rebuild recovery state is stored in `internal/sac/rebuild-recovery` and is cleaned after a successful rebuild or rollback. Agent runner evidence belongs in `internal/sac/runs/` and must not be removed by rebuild recovery cleanup.
18
18
 
19
19
  ## Related Help
20
20
 
@@ -1,6 +1,6 @@
1
1
  # SaC Workflow
2
2
 
3
- Use SaC when the workbook should be maintained as a source project with ordered Facade Migration Packs. Use `univer run` for one-off workbook-local edits. In SaC, migrations/ is the source of truth and the .univer target artifact is generated by replaying migration source.
3
+ Use SaC when the workbook should be maintained as a source project with ordered Facade Migration Packs. Use `univer run` for one-off workbook-local edits. In SaC, `project/migrations/` is the source of truth and the `.univer` package is updated in place.
4
4
 
5
5
  ## Local Happy Path
6
6
 
@@ -13,49 +13,48 @@ univer config set experimental.sac true
13
13
  Create an empty SaC project:
14
14
 
15
15
  ```bash
16
- univer sac init ./model
16
+ univer new ./model.univer --with-project
17
17
  ```
18
18
 
19
19
  Create one migration, then edit the generated source before applying it:
20
20
 
21
21
  ```bash
22
- univer sac migration create "Add Revenue Model" --workspace ./model
22
+ univer sac migration create "Add Revenue Model" ./model.univer
23
23
  ```
24
24
 
25
25
  Write `assertions.ts` beside the migration `pack.ts` before claiming a non-trivial migration is complete. The assertions should describe workbook-visible outcomes such as sheet existence, used ranges, representative values, and formulas.
26
26
 
27
- Apply the source chain to the default `.univer` artifact from `sac.config.ts`:
27
+ Apply the source chain to the same project workbook package:
28
28
 
29
29
  ```bash
30
- univer sac apply ./model
30
+ univer sac apply ./model.univer
31
31
  ```
32
32
 
33
- For an empty project, `univer sac init ./model` creates a generated workspace. Its result workbook is `./model/artifacts/model.univer`. Keep `inspect`, `pipe out`, and `view` pointed at that same artifact.
33
+ For an empty project, `univer new ./model.univer --with-project` creates `project/univer.config.ts` and `project/migrations/` inside the package. Keep `inspect`, `pipe out`, and `view` pointed at `./model.univer`.
34
34
 
35
35
  Each successful apply creates one workbook local changeset per migration pack. To undo the newest applied migration, use:
36
36
 
37
37
  ```bash
38
- univer reset ./model/artifacts/model.univer --hard HEAD~1
38
+ univer reset ./model.univer --hard HEAD~1
39
39
  ```
40
40
 
41
41
  Verify workbook-visible state after apply with the assertion gate:
42
42
 
43
43
  ```bash
44
- univer sac verify ./model --json
44
+ univer sac verify ./model.univer --json
45
45
  ```
46
46
 
47
- Read the JSON summary and the referenced `.sac/runs/<run-id>/verify-report.json`. If verification fails, inspect the report, repair migration source or assertions, then apply or verify again. Repeat the loop one migration at a time: create or edit migration, write assertions, apply, verify, repair, and repeat. Keep each migration focused on one durable workbook intent.
47
+ Read the JSON summary and the referenced `internal/sac/runs/<run-id>/verify-report.json`. If verification fails, inspect the report, repair migration source or assertions, then apply or verify again. Repeat the loop one migration at a time: create or edit migration, write assertions, apply, verify, repair, and repeat. Keep each migration focused on one durable workbook intent.
48
48
 
49
49
  `univer inspect`, `univer pipe out`, and `univer view` are supplemental inspection tools for understanding workbook-visible state and handoff review. They are not the primary SaC Spreadsheet TDD completion gate when assertions exist.
50
50
 
51
51
  ## Project Shape
52
52
 
53
- - `sac.config.ts` declares the migration directory, artifact mode, and default artifact path.
54
- - `types/` is managed by the current CLI and exposes the curated Facade d.ts view.
55
- - `migrations/` contains timestamped migration pack directories.
56
- - The workspace does not contain `package.json`, `tsconfig.json`, or `node_modules`; apply prepares the shared CLI-owned toolchain as needed.
57
- - Empty init uses generated mode: `artifacts/<workspace-name>.univer` is the generated workbook result and should stay ignored by git unless a workflow explicitly chooses otherwise.
58
- - `.sac/runs/` is reserved for agent runner evidence and is separate from generated workbook results.
53
+ - `project/univer.config.ts` declares `spreadsheet.source.migrationsDir`.
54
+ - `project/types/` is managed by the current CLI and exposes the curated Facade d.ts view.
55
+ - `project/migrations/` contains timestamped migration pack directories.
56
+ - The project does not contain `package.json`, `tsconfig.json`, or `node_modules`; apply prepares the shared CLI-owned toolchain as needed.
57
+ - `internal/sac/runs/` is reserved for agent runner evidence and is separate from generated workbook results.
59
58
 
60
59
  ## Related Help
61
60