univer-cli 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/build-id-Coc3wh1M.js +1 -1
- package/chunks/build-info-CYwzl-uD.js +1 -0
- package/chunks/headless-univer-CbMCumXv.js +1 -0
- package/chunks/node-0IWqXZGJ.js +1 -0
- package/chunks/runtime-eval-kernels-BWvkXRlB.js +1 -1
- package/chunks/runtime-manifest-ChxEzYC3.js +1 -0
- package/chunks/trace-DPfd8LdJ.js +1 -1
- package/chunks/{vendor-BzHSCzgc.js → vendor-BUmrAeJ_.js} +162 -162
- package/chunks/vendor-dynamic-proxies.js +1 -1
- package/internal/cli.js +1 -1
- package/internal/daemon.js +1 -1
- package/internal/product-telemetry.js +1 -1
- package/internal/univer-runner.js +1 -1
- package/package.json +3 -2
- package/sac-help/topics/apply-ledger.md +59 -0
- package/sac-help/topics/authoring.md +58 -0
- package/sac-help/topics/data-assets.md +34 -0
- package/sac-help/topics/facade-api.md +42 -0
- package/sac-help/topics/rebuild.md +22 -0
- package/sac-help/topics/workflow.md +69 -0
- package/view/browser/assets/formula-dependency-graph-panel.js +1 -1
- package/view/browser/assets/viewer.js +1 -1
- package/chunks/build-info-BA0nrxkO.js +0 -1
- package/chunks/headless-univer-BHRYaTxY.js +0 -1
- package/chunks/node-C6ZVE15U.js +0 -1
- package/chunks/runtime-manifest-Bdf66z_K.js +0 -1
package/internal/daemon.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const _0x54ef5e=_0x18ac;(function(_0x141928,_0x4ef23f){const _0x5ec9c3=_0x18ac,_0x47bb52=_0x141928();while(!![]){try{const _0x59de37=-parseInt(_0x5ec9c3(0x19a))/0x1+parseInt(_0x5ec9c3(0x19f))/0x2*(-parseInt(_0x5ec9c3(0x1da))/0x3)+parseInt(_0x5ec9c3(0x1c1))/0x4+parseInt(_0x5ec9c3(0x1e3))/0x5+parseInt(_0x5ec9c3(0x1dc))/0x6+parseInt(_0x5ec9c3(0x1cc))/0x7*(-parseInt(_0x5ec9c3(0x18b))/0x8)+parseInt(_0x5ec9c3(0x1b0))/0x9*(parseInt(_0x5ec9c3(0x1ae))/0xa);if(_0x59de37===_0x4ef23f)break;else _0x47bb52['push'](_0x47bb52['shift']());}catch(_0x253df1){_0x47bb52['push'](_0x47bb52['shift']());}}}(_0x43e3,0x9ff93));import'../chunks/vendor-BzHSCzgc.js';import{a as _0x99b054,i as _0x3376b5,n,o as _0x2103dc,r as _0x5ebd16,t as _0x174dcb}from'../chunks/trace-DPfd8LdJ.js';import{c as _0xa62184,f as _0x1e7303,l as _0x304997,r as _0x1d8c72,s as _0x4547b8,t as _0x12e92f}from'../chunks/node-C6ZVE15U.js';function _0x43e3(){const _0x1cf859=['utf8','write','runtimeRoot','lockPath','socketPath','7124110uoONUV','SessionEvalJs','9wCrFXe','DaemonRpcFinish','homeDir','unref','sizeBytes','env','SessionGetWorkbook','logRequestError','workbookData','max','stringify','buildId','serve','SessionLoadWorkbookDataReplayPack','slice','timestamp','mutations','3713588qYJXCm','destroyAll','2.0','runtimeExecutionPlaneEntry','DaemonRpcStart','DaemonStop','flush','info','getSessionCount','toISOString','loadWorkbookDataReplayPack','1086043QFEkVZ','resolveIdentity','logRequestEvent','withSpan','outputPath','metaPath','Runtime','method','getWorkbookSession','evalJs','eventName','meta','SessionExportWorkbookData','params','258lPYMNS','UNIVER_CLI_VERSION','34806OUULRU','code','sigterm','name','execArgv','DaemonRpcServer','argv','5739305VcxQas','pidPath','Shutdown','min','current','startedAt','catch','withContext','unloadIdleSessions','close','createWorkbook','exit','sessionHost','cwd','format','SessionLoadWorkbook','packageIdentity','Another\x20daemon\x20startup\x20owns\x20','sessionId','mutates','Health','server','dispose','DaemonStart','SessionExportWorkbookFile','loadWorkbook','sigint','finally','Daemon','parse','message','sessionRoot','isFinite','indexOf','absolutePath','getSessionIdleTtlMs','56QBwPru','loadWorkbookData','once','exportWorkbookFile','error','getSession','createConnection','end','baseWorkbookData','univer-daemon','createdAt','modulePath','DaemonRpcError','local','length','616210bNQxXe','pid','data','toString','exportWorkbookData','10162ROeezq','createServer','Method\x20not\x20found:\x20','session','listen','traceparent','UNIVER_CLI_BUILD_ID','trim','rpc-shutdown','now'];_0x43e3=function(){return _0x1cf859;};return _0x43e3();}import{t as _0x26b5ec}from'../chunks/build-id-Coc3wh1M.js';import{n as _0x4355b4}from'../chunks/runtime-manifest-Bdf66z_K.js';import{existsSync as _0xf9fd70}from'node:fs';import{chmod as _0x9f2e35,mkdir as _0x1adbde,readFile as _0x3d772c,rm as _0x310b53,writeFile as _0xb730e6}from'node:fs/promises';import _0x131268 from'node:net';import _0x1b518b from'node:process';var S=new _0x12e92f();async function C(_0x5c6b47={}){const _0x29cb36=_0x18ac;let _0x5030f2=_0x5c6b47[_0x29cb36(0x1b5)]??_0x1b518b['env'],_0x32d10a=_0xa62184(_0x5030f2),_0x57c7d2=_0x4355b4(_0x5030f2),_0x538178=_0x5c6b47['sessionHost']??E(new _0x1d8c72({'env':_0x5030f2,'logger':_0x304997({'env':_0x5030f2,'role':_0x99b054[_0x29cb36(0x1d2)]}),'resolveExecutionPlaneOptions':()=>({'execArgv':[..._0x57c7d2[_0x29cb36(0x1c4)][_0x29cb36(0x1e0)]],'modulePath':_0x57c7d2[_0x29cb36(0x1c4)][_0x29cb36(0x196)]})})),_0x4843a5=_0x26b5ec(_0x5030f2),_0x26da9d=new Date()[_0x29cb36(0x1ca)]();if(await _0x1adbde(_0x32d10a['daemonDir'],{'recursive':!0x0,'mode':0x1c0}),await _0x1adbde(_0x32d10a[_0x29cb36(0x186)],{'recursive':!0x0,'mode':0x1c0}),!await M(_0x32d10a['lockPath'],_0x32d10a['pidPath'])){if(await N(_0x32d10a[_0x29cb36(0x1ad)]))return;throw Error(_0x29cb36(0x178)+_0x32d10a['lockPath']);}await j(_0x32d10a);let _0x3b3b0a=_0x304997({'env':_0x5030f2,'role':_0x99b054[_0x29cb36(0x183)]}),_0x587082=k({'buildId':_0x4843a5,'env':_0x5030f2,'pid':_0x1b518b[_0x29cb36(0x19b)]}),_0x816622=!0x1,_0x4bac16={},_0x42d68c=async _0x302a2c=>z(null,-0x7f5b,Error('Daemon\x20handler\x20not\x20ready:\x20'+_0x302a2c)),_0x5920aa=_0x131268[_0x29cb36(0x1a0)](_0x32b02c=>{const _0x18aabc=_0x29cb36;let _0x1915b8='';_0x32b02c['on'](_0x18aabc(0x19c),_0x3402e7=>{const _0x40674a=_0x18aabc;_0x1915b8+=_0x3402e7[_0x40674a(0x19d)]('utf8'),_0x297fc2();}),_0x32b02c['on']('error',()=>void 0x0);let _0x297fc2=async()=>{const _0x52df8a=_0x18aabc;for(;;){let _0x3a3724=_0x1915b8[_0x52df8a(0x188)]('\x0a');if(_0x3a3724<0x0)return;let _0x571803=_0x1915b8[_0x52df8a(0x1be)](0x0,_0x3a3724)[_0x52df8a(0x1a6)]();if(_0x1915b8=_0x1915b8[_0x52df8a(0x1be)](_0x3a3724+0x1),!_0x571803)continue;let _0x564f76=await _0x42d68c(_0x571803);_0x32b02c[_0x52df8a(0x1aa)](JSON[_0x52df8a(0x1ba)](_0x564f76)+'\x0a');}};});_0x42d68c=w({'buildId':_0x4843a5,'logRequestEvent':async _0x2fd956=>{const _0x1051a9=_0x29cb36;_0x3b3b0a['event']({'level':_0x2fd956[_0x1051a9(0x1d6)]===_0x3376b5[_0x1051a9(0x197)]?_0x1051a9(0x18f):_0x1051a9(0x1c8),'event_name':_0x2fd956[_0x1051a9(0x1d6)],'component':_0x5ebd16['Daemon'],'process_role':_0x99b054[_0x1051a9(0x183)],..._0x2fd956[_0x1051a9(0x18f)]===void 0x0?{}:{'error':_0x2fd956[_0x1051a9(0x18f)]},'fields':{..._0x587082,..._0x2fd956['durationMs']===void 0x0?{}:{'duration_ms':_0x2fd956['durationMs']},'method':_0x2fd956[_0x1051a9(0x1d3)],'timestamp':_0x2fd956[_0x1051a9(0x1bf)]}});},'logRequestError':async _0x22f7de=>{const _0x1d14ee=_0x29cb36;_0x3b3b0a[_0x1d14ee(0x18f)]({'event_name':_0x3376b5[_0x1d14ee(0x197)],'component':_0x5ebd16[_0x1d14ee(0x183)],'process_role':_0x99b054[_0x1d14ee(0x183)],'error':_0x22f7de[_0x1d14ee(0x18f)],'fields':{..._0x587082,'method':_0x22f7de['method'],'timestamp':_0x22f7de['timestamp']}});},'onShutdownRequest':()=>{const _0x3eea42=_0x29cb36;_0xe284c5(_0x3eea42(0x1a7))[_0x3eea42(0x182)](()=>{_0x1b518b['exit'](0x0);});},'pid':_0x1b518b[_0x29cb36(0x19b)],'runtimeRoot':_0x32d10a[_0x29cb36(0x1b2)],'sessionHost':_0x538178,'socketPath':_0x32d10a[_0x29cb36(0x1ad)],'startedAt':_0x26da9d}),await new Promise((_0x4092af,_0x231479)=>{const _0x13169e=_0x29cb36;_0x5920aa[_0x13169e(0x18d)](_0x13169e(0x18f),_0x231479),_0x5920aa[_0x13169e(0x1a3)](_0x32d10a[_0x13169e(0x1ad)],_0x4092af);}),_0x4547b8(_0x32d10a[_0x29cb36(0x1ad)])||await _0x9f2e35(_0x32d10a[_0x29cb36(0x1ad)],0x180);let _0x4bf61f={'pid':_0x1b518b[_0x29cb36(0x19b)],'startedAt':_0x26da9d,'socketPath':_0x32d10a['socketPath'],'runtimeRoot':_0x32d10a[_0x29cb36(0x1b2)],'buildId':_0x4843a5};await _0xb730e6(_0x32d10a[_0x29cb36(0x1e4)],String(_0x1b518b['pid']),_0x29cb36(0x1a9)),await _0xb730e6(_0x32d10a['metaPath'],JSON['stringify'](_0x4bf61f,null,0x2),_0x29cb36(0x1a9)),_0x3b3b0a[_0x29cb36(0x1c8)]({'event_name':_0x3376b5[_0x29cb36(0x17e)],'component':_0x5ebd16[_0x29cb36(0x183)],'process_role':_0x99b054[_0x29cb36(0x183)],'fields':{..._0x587082,'pid':_0x1b518b[_0x29cb36(0x19b)],'runtime_root':_0x32d10a['homeDir'],'socket_path':_0x32d10a[_0x29cb36(0x1ad)],'started_at':_0x26da9d}}),await _0x3b3b0a[_0x29cb36(0x1c7)]();let _0x2b151a=setInterval(()=>{const _0x40a66b=_0x29cb36;_0x538178[_0x40a66b(0x1eb)]();},Math[_0x29cb36(0x1b9)](0x3e8,Math[_0x29cb36(0x1e6)](_0x538178[_0x29cb36(0x18a)](),0xea60)));_0x2b151a[_0x29cb36(0x1b3)](),_0x4bac16[_0x29cb36(0x1e7)]=_0x2b151a;async function _0xe284c5(_0x17a155){const _0x1984de=_0x29cb36;_0x816622||(_0x816622=!0x0,_0x4bac16[_0x1984de(0x1e7)]!==void 0x0&&clearInterval(_0x4bac16['current']),_0x3b3b0a[_0x1984de(0x1c8)]({'event_name':_0x3376b5[_0x1984de(0x1c6)],'component':_0x5ebd16[_0x1984de(0x183)],'process_role':_0x99b054[_0x1984de(0x183)],'fields':{..._0x587082,'pid':_0x1b518b[_0x1984de(0x19b)],'reason':_0x17a155,'timestamp':new Date()[_0x1984de(0x1ca)]()}}),await _0x3b3b0a[_0x1984de(0x1c7)](),await _0x538178[_0x1984de(0x1c2)](_0x17a155),await new Promise(_0x366e1d=>{const _0x5418c1=_0x1984de;_0x5920aa[_0x5418c1(0x1ec)](()=>_0x366e1d());}),await F(_0x32d10a[_0x1984de(0x1ad)]),await _0x310b53(_0x32d10a[_0x1984de(0x1e4)],{'force':!0x0})['catch'](()=>void 0x0),await _0x310b53(_0x32d10a['metaPath'],{'force':!0x0})[_0x1984de(0x1e9)](()=>void 0x0),await _0x310b53(_0x32d10a['lockPath'],{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0));}_0x1b518b['on']('SIGINT',()=>{const _0x194fc8=_0x29cb36;_0xe284c5(_0x194fc8(0x181))[_0x194fc8(0x182)](()=>{const _0x523adc=_0x194fc8;_0x1b518b[_0x523adc(0x172)](0x0);});}),_0x1b518b['on']('SIGTERM',()=>{const _0x1ad9b1=_0x29cb36;_0xe284c5(_0x1ad9b1(0x1de))[_0x1ad9b1(0x182)](()=>{_0x1b518b['exit'](0x0);});});}function w(_0x224ef3){return async _0x57bcff=>{const _0x353cba=_0x18ac;let _0x4c1d58;try{_0x4c1d58=JSON[_0x353cba(0x184)](_0x57bcff);}catch(_0x15ddc7){return z(null,-0x7fbc,_0x15ddc7);}let _0x31ddd1=_0x174dcb(_0x4c1d58[_0x353cba(0x1d7)]?.[_0x353cba(0x1a4)]),_0x83fc26=async()=>await n[_0x353cba(0x1cf)]({'name':_0x2103dc[_0x353cba(0x1e1)],'kind':_0x353cba(0x17c)},async()=>{const _0x97636a=_0x353cba;let _0x37c043=Date[_0x97636a(0x1a8)]();await _0x224ef3[_0x97636a(0x1ce)]?.({'eventName':_0x3376b5[_0x97636a(0x1c5)],'method':_0x4c1d58[_0x97636a(0x1d3)],'timestamp':new Date()[_0x97636a(0x1ca)]()});try{let _0x20ae2d=await T(_0x4c1d58,_0x224ef3);return await _0x224ef3[_0x97636a(0x1ce)]?.({'durationMs':Date[_0x97636a(0x1a8)]()-_0x37c043,'eventName':_0x3376b5[_0x97636a(0x1b1)],'method':_0x4c1d58[_0x97636a(0x1d3)],'timestamp':new Date()[_0x97636a(0x1ca)]()}),_0x20ae2d;}catch(_0x4d6fb2){return await _0x224ef3[_0x97636a(0x1ce)]?.({'durationMs':Date[_0x97636a(0x1a8)]()-_0x37c043,'eventName':_0x3376b5[_0x97636a(0x197)],'method':_0x4c1d58['method'],'error':_0x4d6fb2,'timestamp':new Date()[_0x97636a(0x1ca)]()}),_0x224ef3['logRequestEvent']===void 0x0&&await _0x224ef3[_0x97636a(0x1b7)]?.({'method':_0x4c1d58[_0x97636a(0x1d3)],'error':_0x4d6fb2 instanceof Error?_0x4d6fb2[_0x97636a(0x185)]:String(_0x4d6fb2),'timestamp':new Date()[_0x97636a(0x1ca)]()}),z(_0x4c1d58['id'],-0x7f5b,_0x4d6fb2);}});return _0x31ddd1===void 0x0?await _0x83fc26():await n[_0x353cba(0x1ea)](_0x31ddd1,_0x83fc26);};}async function T(_0x272a8c,_0x5b8303){const _0x331880=_0x18ac;switch(_0x272a8c[_0x331880(0x1d3)]){case _0x1e7303[_0x331880(0x17b)]:return{'jsonrpc':'2.0','id':_0x272a8c['id'],'result':{'ok':!0x0,'pid':_0x5b8303['pid'],'startedAt':_0x5b8303[_0x331880(0x1e8)],'socketPath':_0x5b8303[_0x331880(0x1ad)],'runtimeRoot':_0x5b8303[_0x331880(0x1ab)],'buildId':_0x5b8303['buildId'],'sessionCount':_0x5b8303[_0x331880(0x173)][_0x331880(0x1c9)]()}};case _0x1e7303[_0x331880(0x1e5)]:return _0x5b8303['onShutdownRequest']?.(),{'jsonrpc':_0x331880(0x1c3),'id':_0x272a8c['id'],'result':{'stopping':!0x0}};case _0x1e7303[_0x331880(0x176)]:{let _0xf2fb33=await _0x5b8303[_0x331880(0x173)][_0x331880(0x180)](_0x272a8c[_0x331880(0x1d9)]);return R(_0x272a8c['id'],_0xf2fb33);}case _0x1e7303[_0x331880(0x1bd)]:{let _0x279942=await _0x5b8303[_0x331880(0x173)][_0x331880(0x1cb)](_0x272a8c[_0x331880(0x1d9)]);return R(_0x272a8c['id'],_0x279942);}case _0x1e7303['SessionCreateWorkbook']:{let _0x5de4a1=await _0x5b8303[_0x331880(0x173)][_0x331880(0x171)](_0x272a8c['params']);return R(_0x272a8c['id'],_0x5de4a1);}case _0x1e7303[_0x331880(0x1af)]:{let _0xdea8ae=await _0x5b8303[_0x331880(0x173)]['evalJs'](_0x272a8c[_0x331880(0x1d9)]);return R(_0x272a8c['id'],_0xdea8ae);}case _0x1e7303[_0x331880(0x17f)]:{let _0x4e710b=await _0x5b8303[_0x331880(0x173)][_0x331880(0x18e)](_0x272a8c[_0x331880(0x1d9)]);return R(_0x272a8c['id'],_0x4e710b);}case _0x1e7303[_0x331880(0x1d8)]:{let _0x353c68=_0x272a8c['params'],_0x5ed0a6=await _0x5b8303[_0x331880(0x173)][_0x331880(0x19e)](_0x353c68);return R(_0x272a8c['id'],_0x5ed0a6);}case _0x1e7303['SessionDispose']:{let _0x5778ca=await _0x5b8303[_0x331880(0x173)][_0x331880(0x17d)](_0x272a8c[_0x331880(0x1d9)]);return R(_0x272a8c['id'],_0x5778ca);}case _0x1e7303[_0x331880(0x1b6)]:{let _0x5139a0=await _0x5b8303[_0x331880(0x173)][_0x331880(0x1d4)](_0x272a8c['params']);return R(_0x272a8c['id'],_0x5139a0);}default:return z(_0x272a8c['id'],-0x7f59,Error(_0x331880(0x1a1)+_0x272a8c[_0x331880(0x1d3)]));}}function E(_0x439492){return{async 'createWorkbook'(_0x532878){const _0x426fc7=_0x18ac;let _0x4683ca=await D(_0x532878),_0x29842d=await _0x439492['createWorkbook']({..._0x532878[_0x426fc7(0x174)]===void 0x0?{}:{'cwd':_0x532878[_0x426fc7(0x174)]},'identity':_0x4683ca,..._0x532878['id']===void 0x0?{}:{'workbookId':_0x532878['id']},..._0x532878[_0x426fc7(0x1df)]===void 0x0?{}:{'workbookName':_0x532878[_0x426fc7(0x1df)]}});return{'success':!0x0,'workbookData':_0x29842d[_0x426fc7(0x1b8)],'session':O(_0x29842d[_0x426fc7(0x1a2)])};},async 'dispose'(_0x345fb5){const _0x19e813=_0x18ac;let _0x43466f=await D(_0x345fb5);return await _0x439492[_0x19e813(0x17d)]({..._0x345fb5[_0x19e813(0x174)]===void 0x0?{}:{'cwd':_0x345fb5['cwd']},'identity':_0x43466f}),{'disposed':!0x0,'workbookIdentity':_0x43466f['absolutePath']};},async 'destroyAll'(_0x4b271c){const _0x40cd29=_0x18ac;await _0x439492[_0x40cd29(0x1c2)]?.(_0x4b271c);},async 'evalJs'(_0x403b0a){const _0xbf8f16=_0x18ac;let _0x908add=await D(_0x403b0a),_0x4510fb=await _0x439492[_0xbf8f16(0x1d5)]({'code':_0x403b0a[_0xbf8f16(0x1dd)],..._0x403b0a[_0xbf8f16(0x174)]===void 0x0?{}:{'cwd':_0x403b0a[_0xbf8f16(0x174)]},'identity':_0x908add,..._0x403b0a[_0xbf8f16(0x17a)]===void 0x0?{}:{'mutates':_0x403b0a[_0xbf8f16(0x17a)]}});return{..._0x4510fb[_0xbf8f16(0x1c0)]===void 0x0?{}:{'mutations':_0x4510fb[_0xbf8f16(0x1c0)]},'success':!0x0,'value':_0x4510fb['value'],'session':O(_0x4510fb['session'])};},async 'exportWorkbookData'(_0x349f1e){const _0x1ae86e=_0x18ac;let _0x1ddd8a=await D(_0x349f1e),_0x6add00=await _0x439492[_0x1ae86e(0x19e)]({..._0x349f1e[_0x1ae86e(0x174)]===void 0x0?{}:{'cwd':_0x349f1e[_0x1ae86e(0x174)]},'identity':_0x1ddd8a});return{'success':!0x0,'workbookData':_0x6add00[_0x1ae86e(0x1b8)],'session':O(_0x6add00[_0x1ae86e(0x1a2)])};},async 'exportWorkbookFile'(_0x190003){const _0x1408dc=_0x18ac;let _0x15a6ce=await D(_0x190003),_0x26eb02=await _0x439492[_0x1408dc(0x18e)]({..._0x190003['cwd']===void 0x0?{}:{'cwd':_0x190003[_0x1408dc(0x174)]},'format':_0x190003[_0x1408dc(0x175)],'identity':_0x15a6ce,'outputPath':_0x190003['outputPath']});return{'success':!0x0,'format':_0x26eb02[_0x1408dc(0x175)],'outputPath':_0x26eb02[_0x1408dc(0x1d0)],'sizeBytes':_0x26eb02[_0x1408dc(0x1b4)],'session':O(_0x26eb02[_0x1408dc(0x1a2)])};},async 'getWorkbookSession'(_0x5245f6){const _0x266fc1=_0x18ac;let _0x7b15f0=await D(_0x5245f6),_0x48e0f1=await _0x439492[_0x266fc1(0x190)]({..._0x5245f6['cwd']===void 0x0?{}:{'cwd':_0x5245f6[_0x266fc1(0x174)]},'identity':_0x7b15f0});return{'exists':_0x48e0f1!==null,'session':_0x48e0f1===null?null:O(_0x48e0f1)};},'getSessionCount'(){const _0x53cb13=_0x18ac;return _0x439492[_0x53cb13(0x1c9)]?.()??0x0;},'getSessionIdleTtlMs'(){const _0xeda6c1=_0x18ac;return _0x439492[_0xeda6c1(0x18a)]?.()??0xea60;},async 'loadWorkbook'(_0x1ff555){const _0x1754b0=_0x18ac;let _0xebb3be=await D(_0x1ff555),_0x5b4756=await _0x439492[_0x1754b0(0x18c)]({..._0x1ff555[_0x1754b0(0x174)]===void 0x0?{}:{'cwd':_0x1ff555[_0x1754b0(0x174)]},'identity':_0xebb3be,'workbookData':_0x1ff555[_0x1754b0(0x1b8)]});return{'success':!0x0,'workbookData':_0x5b4756[_0x1754b0(0x1b8)],'session':O(_0x5b4756[_0x1754b0(0x1a2)])};},async 'loadWorkbookDataReplayPack'(_0xa1c2c6){const _0x59dfbf=_0x18ac;let _0x1528af=await D(_0xa1c2c6);return{'success':!0x0,'session':O((await _0x439492[_0x59dfbf(0x1cb)]({..._0xa1c2c6['cwd']===void 0x0?{}:{'cwd':_0xa1c2c6[_0x59dfbf(0x174)]},'identity':_0x1528af,'replayPack':{'baseWorkbookData':_0xa1c2c6[_0x59dfbf(0x193)],'mutations':_0xa1c2c6['mutations']}}))['session'])};},async 'unloadIdleSessions'(){const _0x1ef970=_0x18ac;await _0x439492[_0x1ef970(0x1eb)]?.();}};}async function D(_0x75e4b3){const _0x19bc81=_0x18ac;return await S[_0x19bc81(0x1cd)](_0x75e4b3);}function O(_0x1aa690){const _0x5b66f4=_0x18ac;return{'createdAt':_0x1aa690[_0x5b66f4(0x195)]??'','lastAccessedAt':_0x1aa690['lastAccessedAt']??'','sessionId':_0x1aa690[_0x5b66f4(0x179)],'workbookIdentity':_0x1aa690[_0x5b66f4(0x177)][_0x5b66f4(0x189)]};}function k(_0x3bafd8){const _0x3abca9=_0x18ac;return{'build.id':A(_0x3bafd8['env'],_0x3abca9(0x1a5))??_0x3bafd8[_0x3abca9(0x1bb)],'deployment.environment.name':_0x3abca9(0x198),'distribution.channel':A(_0x3bafd8[_0x3abca9(0x1b5)],'UNIVER_DISTRIBUTION_CHANNEL')??'unknown','service.instance.id':String(_0x3bafd8[_0x3abca9(0x19b)]),'service.name':_0x3abca9(0x194),...A(_0x3bafd8[_0x3abca9(0x1b5)],_0x3abca9(0x1db))===void 0x0?{}:{'service.version':A(_0x3bafd8['env'],'UNIVER_CLI_VERSION')}};}function A(_0x35ee64,_0x5de232){const _0x3c9b8e=_0x18ac;let _0x3f98c3=_0x35ee64[_0x5de232]?.[_0x3c9b8e(0x1a6)]();return _0x3f98c3===void 0x0||_0x3f98c3[_0x3c9b8e(0x199)]===0x0?void 0x0:_0x3f98c3;}async function j(_0x590a0c){const _0x57d264=_0x18ac;P(_0x590a0c['socketPath'])&&!await N(_0x590a0c['socketPath'])&&await F(_0x590a0c[_0x57d264(0x1ad)]);let _0x946a05=await I(_0x590a0c['pidPath']);_0x946a05!==null&&!L(_0x946a05)&&(await _0x310b53(_0x590a0c[_0x57d264(0x1e4)],{'force':!0x0})['catch'](()=>void 0x0),await _0x310b53(_0x590a0c[_0x57d264(0x1d1)],{'force':!0x0})[_0x57d264(0x1e9)](()=>void 0x0),await _0x310b53(_0x590a0c[_0x57d264(0x1ac)],{'recursive':!0x0,'force':!0x0})[_0x57d264(0x1e9)](()=>void 0x0));}async function M(_0x8a2156,_0x519ad4){const _0xf7f7a6=_0x18ac;try{return await _0x1adbde(_0x8a2156,{'recursive':!0x1,'mode':0x1c0}),!0x0;}catch(_0x2ea332){if(_0x2ea332[_0xf7f7a6(0x1dd)]!=='EEXIST')throw _0x2ea332;let _0x26d788=await I(_0x519ad4);return _0x26d788!==null&&L(_0x26d788)?!0x1:(await _0x310b53(_0x8a2156,{'recursive':!0x0,'force':!0x0}),await _0x1adbde(_0x8a2156,{'recursive':!0x1,'mode':0x1c0}),!0x0);}}async function N(_0x252cc4){return await new Promise(_0x337af6=>{const _0x11b99a=_0x18ac;let _0xca3d6c=_0x131268[_0x11b99a(0x191)](_0x252cc4);_0xca3d6c['once']('connect',()=>{const _0x3d684d=_0x11b99a;_0xca3d6c[_0x3d684d(0x192)](),_0x337af6(!0x0);}),_0xca3d6c[_0x11b99a(0x18d)](_0x11b99a(0x18f),()=>{_0x337af6(!0x1);});});}function P(_0x50fb34){return _0x4547b8(_0x50fb34)?!0x1:_0xf9fd70(_0x50fb34);}async function F(_0x4b466c){const _0x5d4484=_0x18ac;_0x4547b8(_0x4b466c)||await _0x310b53(_0x4b466c,{'force':!0x0})[_0x5d4484(0x1e9)](()=>void 0x0);}function _0x18ac(_0x20a365,_0x1015d1){_0x20a365=_0x20a365-0x171;const _0x43e328=_0x43e3();let _0x18acfa=_0x43e328[_0x20a365];return _0x18acfa;}async function I(_0x3ebda6){const _0x5f192a=_0x18ac;try{let _0x267c20=await _0x3d772c(_0x3ebda6,_0x5f192a(0x1a9)),_0x354d4d=Number(_0x267c20[_0x5f192a(0x1a6)]());return Number[_0x5f192a(0x187)](_0x354d4d)?_0x354d4d:null;}catch{return null;}}function L(_0x31fe8d){try{return _0x1b518b['kill'](_0x31fe8d,0x0),!0x0;}catch{return!0x1;}}function R(_0x1e6587,_0x1fa48a){const _0x20f65b=_0x18ac;return{'jsonrpc':_0x20f65b(0x1c3),'id':_0x1e6587,'result':_0x1fa48a};}function z(_0x1ae78a,_0x245223,_0xea2bf){const _0x1e9b36=_0x18ac;return{'jsonrpc':_0x1e9b36(0x1c3),'id':_0x1ae78a,'error':{'code':_0x245223,'message':_0xea2bf instanceof Error?_0xea2bf[_0x1e9b36(0x185)]:String(_0xea2bf)}};}var B=process[_0x54ef5e(0x1e2)][0x2]??_0x54ef5e(0x1bc);B!=='serve'&&(console[_0x54ef5e(0x18f)]('Unknown\x20daemon\x20subcommand:\x20'+B),process[_0x54ef5e(0x172)](0x1)),C()[_0x54ef5e(0x1e9)](_0xa82e1b=>{const _0x3dafd0=_0x54ef5e;console[_0x3dafd0(0x18f)](_0xa82e1b instanceof Error?_0xa82e1b[_0x3dafd0(0x185)]:String(_0xa82e1b)),process[_0x3dafd0(0x172)](0x1);});
|
|
2
|
+
const _0x430fd8=_0x222b;(function(_0x1936a6,_0x233909){const _0x1e7ffb=_0x222b,_0x162a66=_0x1936a6();while(!![]){try{const _0x4b1209=-parseInt(_0x1e7ffb(0x18c))/0x1*(-parseInt(_0x1e7ffb(0x1ab))/0x2)+parseInt(_0x1e7ffb(0x1af))/0x3*(-parseInt(_0x1e7ffb(0x194))/0x4)+-parseInt(_0x1e7ffb(0x17d))/0x5*(-parseInt(_0x1e7ffb(0x180))/0x6)+-parseInt(_0x1e7ffb(0x1c0))/0x7+-parseInt(_0x1e7ffb(0x17a))/0x8*(-parseInt(_0x1e7ffb(0x1a1))/0x9)+-parseInt(_0x1e7ffb(0x1a4))/0xa*(-parseInt(_0x1e7ffb(0x160))/0xb)+parseInt(_0x1e7ffb(0x195))/0xc*(-parseInt(_0x1e7ffb(0x1b4))/0xd);if(_0x4b1209===_0x233909)break;else _0x162a66['push'](_0x162a66['shift']());}catch(_0x24ea2c){_0x162a66['push'](_0x162a66['shift']());}}}(_0x5751,0xc3e29));import'../chunks/vendor-BUmrAeJ_.js';import{a as _0x4dc68b,i as _0x2bea10,n,o as _0x47e69a,r as _0x5898da,t as _0x3037d5}from'../chunks/trace-DPfd8LdJ.js';function _0x5751(){const _0x4e3af1=['packageIdentity','getWorkbookSession','evalJs','utf8','Shutdown','destroyAll','toString','durationMs','serve','getSession','496yZxYtq','homeDir','dispose','2858685XcCbwH','mutations','event','12knzBbz','runtimeExecutionPlaneEntry','timestamp','sigint','SessionEvalJs','absolutePath','method','SessionExportWorkbookData','exit','flush','pidPath','rpc-shutdown','60483nrCnyE','env','unknown','baseWorkbookData','lockPath','length','loadWorkbookDataReplayPack','argv','410464YeBGlF','12598260xMpgdD','connect','createWorkbook','SessionLoadWorkbook','socketPath','traceparent','indexOf','now','getSessionCount','Health','sizeBytes','UNIVER_CLI_BUILD_ID','49257vXMjGN','EEXIST','params','70xkaMFl','stringify','withSpan','sigterm','SIGINT','trim','format','6ZNcndu','withContext','Daemon','SessionCreateWorkbook','3PykJFi','parse','SessionDispose','cwd','end','13XgXIdx','UNIVER_CLI_VERSION','write','data','exportWorkbookFile','2.0','message','local','buildId','server','slice','DaemonStart','4725679cwMsUd','createdAt','once','workbookData','name','kill','univer-daemon','DaemonRpcError','error','DaemonStop','DaemonRpcServer','runtimeRoot','max','pid','sessionHost','mutates','loadWorkbookData','finally','current','lastAccessedAt','code','sessionId','session','execArgv','Another\x20daemon\x20startup\x20owns\x20','logRequestEvent','loadWorkbook','resolveIdentity','metaPath','listen','info','toISOString','1517472JeSwZR','catch','Runtime','createConnection','eventName','value','createServer','Unknown\x20daemon\x20subcommand:\x20','min','getSessionIdleTtlMs','modulePath','DaemonRpcStart','unloadIdleSessions','SessionGetWorkbook','exportWorkbookData','unref'];_0x5751=function(){return _0x4e3af1;};return _0x5751();}import{c as _0x21a6e4,i as _0xa323ff,l as _0x5ddebf,p as _0x9b23e4,t as _0x1043f7,u as _0x5e2459}from'../chunks/node-0IWqXZGJ.js';import{t as _0x4f7ab3}from'../chunks/build-id-Coc3wh1M.js';import{n as _0x521e2e}from'../chunks/runtime-manifest-ChxEzYC3.js';import{existsSync as _0x5c19e9}from'node:fs';import{chmod as _0x29c632,mkdir as _0x84f010,readFile as _0x2277a1,rm as _0x1797cd,writeFile as _0x322b92}from'node:fs/promises';import _0x4e3ec4 from'node:net';import _0x662e25 from'node:process';var S=0x2bf20,C=new _0x1043f7();async function w(_0x2af26d={}){const _0x5afda1=_0x222b;let _0x4e08ac=_0x2af26d[_0x5afda1(0x18d)]??_0x662e25['env'],_0x1942c8=_0x5ddebf(_0x4e08ac),_0xf05d1a=_0x521e2e(_0x4e08ac),_0x323da4=_0x2af26d[_0x5afda1(0x1ce)]??D(new _0xa323ff({'env':_0x4e08ac,'logger':_0x5e2459({'env':_0x4e08ac,'role':_0x4dc68b[_0x5afda1(0x162)]}),'resolveExecutionPlaneOptions':()=>({'execArgv':[..._0xf05d1a[_0x5afda1(0x181)][_0x5afda1(0x1d7)]],'modulePath':_0xf05d1a[_0x5afda1(0x181)][_0x5afda1(0x16a)]}),'rpcTimeoutMs':S})),_0x115de2=_0x4f7ab3(_0x4e08ac),_0x42487d=new Date()[_0x5afda1(0x15f)]();if(await _0x84f010(_0x1942c8['daemonDir'],{'recursive':!0x0,'mode':0x1c0}),await _0x84f010(_0x1942c8['sessionRoot'],{'recursive':!0x0,'mode':0x1c0}),!await N(_0x1942c8[_0x5afda1(0x190)],_0x1942c8[_0x5afda1(0x18a)])){if(await P(_0x1942c8[_0x5afda1(0x199)]))return;throw Error(_0x5afda1(0x1d8)+_0x1942c8[_0x5afda1(0x190)]);}await M(_0x1942c8);let _0x4764dc=_0x5e2459({'env':_0x4e08ac,'role':_0x4dc68b[_0x5afda1(0x1ad)]}),_0x11320a=A({'buildId':_0x115de2,'env':_0x4e08ac,'pid':_0x662e25[_0x5afda1(0x1cd)]}),_0x120d47=!0x1,_0x2b7cbf={},_0x153aa2=async _0x835590=>B(null,-0x7f5b,Error('Daemon\x20handler\x20not\x20ready:\x20'+_0x835590)),_0x532512=_0x4e3ec4[_0x5afda1(0x166)](_0x408565=>{const _0x956849=_0x5afda1;let _0x35b206='';_0x408565['on'](_0x956849(0x1b7),_0x203c98=>{const _0x5e6807=_0x956849;_0x35b206+=_0x203c98[_0x5e6807(0x176)](_0x5e6807(0x173)),_0x19ea2c();}),_0x408565['on'](_0x956849(0x1c8),()=>void 0x0);let _0x19ea2c=async()=>{const _0x3179b8=_0x956849;for(;;){let _0x39d6ea=_0x35b206[_0x3179b8(0x19b)]('\x0a');if(_0x39d6ea<0x0)return;let _0x33ad4a=_0x35b206[_0x3179b8(0x1be)](0x0,_0x39d6ea)[_0x3179b8(0x1a9)]();if(_0x35b206=_0x35b206[_0x3179b8(0x1be)](_0x39d6ea+0x1),!_0x33ad4a)continue;let _0x3e4bcd=await _0x153aa2(_0x33ad4a);_0x408565[_0x3179b8(0x1b6)](JSON[_0x3179b8(0x1a5)](_0x3e4bcd)+'\x0a');}};});_0x153aa2=T({'buildId':_0x115de2,'logRequestEvent':async _0x2f1b2a=>{const _0x514b79=_0x5afda1;_0x4764dc[_0x514b79(0x17f)]({'level':_0x2f1b2a[_0x514b79(0x164)]===_0x2bea10[_0x514b79(0x1c7)]?_0x514b79(0x1c8):_0x514b79(0x1de),'event_name':_0x2f1b2a[_0x514b79(0x164)],'component':_0x5898da[_0x514b79(0x1ad)],'process_role':_0x4dc68b[_0x514b79(0x1ad)],..._0x2f1b2a['error']===void 0x0?{}:{'error':_0x2f1b2a[_0x514b79(0x1c8)]},'fields':{..._0x11320a,..._0x2f1b2a['durationMs']===void 0x0?{}:{'duration_ms':_0x2f1b2a[_0x514b79(0x177)]},'method':_0x2f1b2a['method'],'timestamp':_0x2f1b2a[_0x514b79(0x182)]}});},'logRequestError':async _0x22d5a6=>{const _0x2d4234=_0x5afda1;_0x4764dc['error']({'event_name':_0x2bea10['DaemonRpcError'],'component':_0x5898da[_0x2d4234(0x1ad)],'process_role':_0x4dc68b[_0x2d4234(0x1ad)],'error':_0x22d5a6[_0x2d4234(0x1c8)],'fields':{..._0x11320a,'method':_0x22d5a6['method'],'timestamp':_0x22d5a6['timestamp']}});},'onShutdownRequest':()=>{const _0x58e693=_0x5afda1;_0x23e708(_0x58e693(0x18b))[_0x58e693(0x1d1)](()=>{const _0x4fa380=_0x58e693;_0x662e25[_0x4fa380(0x188)](0x0);});},'pid':_0x662e25[_0x5afda1(0x1cd)],'runtimeRoot':_0x1942c8['homeDir'],'sessionHost':_0x323da4,'socketPath':_0x1942c8['socketPath'],'startedAt':_0x42487d}),await new Promise((_0x51cbf5,_0x2ad717)=>{const _0x62f142=_0x5afda1;_0x532512[_0x62f142(0x1c2)](_0x62f142(0x1c8),_0x2ad717),_0x532512[_0x62f142(0x1dd)](_0x1942c8['socketPath'],_0x51cbf5);}),_0x21a6e4(_0x1942c8[_0x5afda1(0x199)])||await _0x29c632(_0x1942c8[_0x5afda1(0x199)],0x180);let _0x1c8d24={'pid':_0x662e25['pid'],'startedAt':_0x42487d,'socketPath':_0x1942c8[_0x5afda1(0x199)],'runtimeRoot':_0x1942c8[_0x5afda1(0x17b)],'buildId':_0x115de2};await _0x322b92(_0x1942c8['pidPath'],String(_0x662e25[_0x5afda1(0x1cd)]),'utf8'),await _0x322b92(_0x1942c8['metaPath'],JSON[_0x5afda1(0x1a5)](_0x1c8d24,null,0x2),_0x5afda1(0x173)),_0x4764dc[_0x5afda1(0x1de)]({'event_name':_0x2bea10[_0x5afda1(0x1bf)],'component':_0x5898da[_0x5afda1(0x1ad)],'process_role':_0x4dc68b[_0x5afda1(0x1ad)],'fields':{..._0x11320a,'pid':_0x662e25[_0x5afda1(0x1cd)],'runtime_root':_0x1942c8['homeDir'],'socket_path':_0x1942c8[_0x5afda1(0x199)],'started_at':_0x42487d}}),await _0x4764dc[_0x5afda1(0x189)]();let _0x146241=setInterval(()=>{const _0x511b3f=_0x5afda1;_0x323da4[_0x511b3f(0x16c)]();},Math[_0x5afda1(0x1cc)](0x3e8,Math[_0x5afda1(0x168)](_0x323da4[_0x5afda1(0x169)](),0xea60)));_0x146241[_0x5afda1(0x16f)](),_0x2b7cbf[_0x5afda1(0x1d2)]=_0x146241;async function _0x23e708(_0x52a89f){const _0x5e4caa=_0x5afda1;_0x120d47||(_0x120d47=!0x0,_0x2b7cbf['current']!==void 0x0&&clearInterval(_0x2b7cbf['current']),_0x4764dc[_0x5e4caa(0x1de)]({'event_name':_0x2bea10[_0x5e4caa(0x1c9)],'component':_0x5898da[_0x5e4caa(0x1ad)],'process_role':_0x4dc68b[_0x5e4caa(0x1ad)],'fields':{..._0x11320a,'pid':_0x662e25['pid'],'reason':_0x52a89f,'timestamp':new Date()['toISOString']()}}),await _0x4764dc[_0x5e4caa(0x189)](),await _0x323da4[_0x5e4caa(0x175)](_0x52a89f),await new Promise(_0x568ec8=>{_0x532512['close'](()=>_0x568ec8());}),await I(_0x1942c8[_0x5e4caa(0x199)]),await _0x1797cd(_0x1942c8[_0x5e4caa(0x18a)],{'force':!0x0})[_0x5e4caa(0x161)](()=>void 0x0),await _0x1797cd(_0x1942c8['metaPath'],{'force':!0x0})[_0x5e4caa(0x161)](()=>void 0x0),await _0x1797cd(_0x1942c8['lockPath'],{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0));}_0x662e25['on'](_0x5afda1(0x1a8),()=>{const _0x55821c=_0x5afda1;_0x23e708(_0x55821c(0x183))[_0x55821c(0x1d1)](()=>{const _0x31b773=_0x55821c;_0x662e25[_0x31b773(0x188)](0x0);});}),_0x662e25['on']('SIGTERM',()=>{const _0x5949f3=_0x5afda1;_0x23e708(_0x5949f3(0x1a7))[_0x5949f3(0x1d1)](()=>{const _0x5b1f1f=_0x5949f3;_0x662e25[_0x5b1f1f(0x188)](0x0);});});}function T(_0x1e07d6){return async _0x430e1f=>{const _0x576849=_0x222b;let _0x3aa622;try{_0x3aa622=JSON[_0x576849(0x1b0)](_0x430e1f);}catch(_0xa3efbc){return B(null,-0x7fbc,_0xa3efbc);}let _0x1cd839=_0x3037d5(_0x3aa622['meta']?.[_0x576849(0x19a)]),_0x548d56=async()=>await n[_0x576849(0x1a6)]({'name':_0x47e69a[_0x576849(0x1ca)],'kind':_0x576849(0x1bd)},async()=>{const _0x55dff8=_0x576849;let _0x467dbd=Date[_0x55dff8(0x19c)]();await _0x1e07d6[_0x55dff8(0x1d9)]?.({'eventName':_0x2bea10[_0x55dff8(0x16b)],'method':_0x3aa622['method'],'timestamp':new Date()[_0x55dff8(0x15f)]()});try{let _0x4df8ec=await E(_0x3aa622,_0x1e07d6);return await _0x1e07d6[_0x55dff8(0x1d9)]?.({'durationMs':Date[_0x55dff8(0x19c)]()-_0x467dbd,'eventName':_0x2bea10['DaemonRpcFinish'],'method':_0x3aa622['method'],'timestamp':new Date()[_0x55dff8(0x15f)]()}),_0x4df8ec;}catch(_0x1d4887){return await _0x1e07d6[_0x55dff8(0x1d9)]?.({'durationMs':Date[_0x55dff8(0x19c)]()-_0x467dbd,'eventName':_0x2bea10[_0x55dff8(0x1c7)],'method':_0x3aa622['method'],'error':_0x1d4887,'timestamp':new Date()['toISOString']()}),_0x1e07d6[_0x55dff8(0x1d9)]===void 0x0&&await _0x1e07d6['logRequestError']?.({'method':_0x3aa622[_0x55dff8(0x186)],'error':_0x1d4887 instanceof Error?_0x1d4887[_0x55dff8(0x1ba)]:String(_0x1d4887),'timestamp':new Date()['toISOString']()}),B(_0x3aa622['id'],-0x7f5b,_0x1d4887);}});return _0x1cd839===void 0x0?await _0x548d56():await n[_0x576849(0x1ac)](_0x1cd839,_0x548d56);};}async function E(_0x2a684b,_0x50f52e){const _0x54998=_0x222b;switch(_0x2a684b[_0x54998(0x186)]){case _0x9b23e4[_0x54998(0x19e)]:return{'jsonrpc':_0x54998(0x1b9),'id':_0x2a684b['id'],'result':{'ok':!0x0,'pid':_0x50f52e['pid'],'startedAt':_0x50f52e['startedAt'],'socketPath':_0x50f52e[_0x54998(0x199)],'runtimeRoot':_0x50f52e[_0x54998(0x1cb)],'buildId':_0x50f52e[_0x54998(0x1bc)],'sessionCount':_0x50f52e['sessionHost'][_0x54998(0x19d)]()}};case _0x9b23e4[_0x54998(0x174)]:return _0x50f52e['onShutdownRequest']?.(),{'jsonrpc':_0x54998(0x1b9),'id':_0x2a684b['id'],'result':{'stopping':!0x0}};case _0x9b23e4[_0x54998(0x198)]:{let _0xaba713=await _0x50f52e[_0x54998(0x1ce)][_0x54998(0x1da)](_0x2a684b[_0x54998(0x1a3)]);return z(_0x2a684b['id'],_0xaba713);}case _0x9b23e4['SessionLoadWorkbookDataReplayPack']:{let _0x111d06=await _0x50f52e[_0x54998(0x1ce)][_0x54998(0x192)](_0x2a684b[_0x54998(0x1a3)]);return z(_0x2a684b['id'],_0x111d06);}case _0x9b23e4[_0x54998(0x1ae)]:{let _0x733234=await _0x50f52e['sessionHost'][_0x54998(0x197)](_0x2a684b[_0x54998(0x1a3)]);return z(_0x2a684b['id'],_0x733234);}case _0x9b23e4[_0x54998(0x184)]:{let _0x3bcbe3=await _0x50f52e[_0x54998(0x1ce)][_0x54998(0x172)](_0x2a684b[_0x54998(0x1a3)]);return z(_0x2a684b['id'],_0x3bcbe3);}case _0x9b23e4['SessionExportWorkbookFile']:{let _0x3789b1=await _0x50f52e[_0x54998(0x1ce)]['exportWorkbookFile'](_0x2a684b['params']);return z(_0x2a684b['id'],_0x3789b1);}case _0x9b23e4[_0x54998(0x187)]:{let _0x196751=_0x2a684b[_0x54998(0x1a3)],_0x40ea0c=await _0x50f52e[_0x54998(0x1ce)][_0x54998(0x16e)](_0x196751);return z(_0x2a684b['id'],_0x40ea0c);}case _0x9b23e4[_0x54998(0x1b1)]:{let _0x46ea9c=await _0x50f52e['sessionHost'][_0x54998(0x17c)](_0x2a684b[_0x54998(0x1a3)]);return z(_0x2a684b['id'],_0x46ea9c);}case _0x9b23e4[_0x54998(0x16d)]:{let _0x4b7839=await _0x50f52e['sessionHost'][_0x54998(0x171)](_0x2a684b[_0x54998(0x1a3)]);return z(_0x2a684b['id'],_0x4b7839);}default:return B(_0x2a684b['id'],-0x7f59,Error('Method\x20not\x20found:\x20'+_0x2a684b[_0x54998(0x186)]));}}function D(_0x24202a){return{async 'createWorkbook'(_0x12f91a){const _0x23c9a4=_0x222b;let _0x528ca8=await O(_0x12f91a),_0x2b1349=await _0x24202a[_0x23c9a4(0x197)]({..._0x12f91a['cwd']===void 0x0?{}:{'cwd':_0x12f91a[_0x23c9a4(0x1b2)]},'identity':_0x528ca8,..._0x12f91a['id']===void 0x0?{}:{'workbookId':_0x12f91a['id']},..._0x12f91a[_0x23c9a4(0x1c4)]===void 0x0?{}:{'workbookName':_0x12f91a[_0x23c9a4(0x1c4)]}});return{'success':!0x0,'workbookData':_0x2b1349[_0x23c9a4(0x1c3)],'session':k(_0x2b1349[_0x23c9a4(0x1d6)])};},async 'dispose'(_0xa246b3){const _0x598de0=_0x222b;let _0x365f93=await O(_0xa246b3);return await _0x24202a[_0x598de0(0x17c)]({..._0xa246b3[_0x598de0(0x1b2)]===void 0x0?{}:{'cwd':_0xa246b3['cwd']},'identity':_0x365f93}),{'disposed':!0x0,'workbookIdentity':_0x365f93[_0x598de0(0x185)]};},async 'destroyAll'(_0x164bb6){await _0x24202a['destroyAll']?.(_0x164bb6);},async 'evalJs'(_0x54180e){const _0x1e9c39=_0x222b;let _0x3ce6ac=await O(_0x54180e),_0x4b981d=await _0x24202a[_0x1e9c39(0x172)]({'code':_0x54180e['code'],..._0x54180e['cwd']===void 0x0?{}:{'cwd':_0x54180e[_0x1e9c39(0x1b2)]},'identity':_0x3ce6ac,..._0x54180e['maxCodeLength']===void 0x0?{}:{'maxCodeLength':_0x54180e['maxCodeLength']},..._0x54180e[_0x1e9c39(0x1cf)]===void 0x0?{}:{'mutates':_0x54180e[_0x1e9c39(0x1cf)]}});return{..._0x4b981d[_0x1e9c39(0x17e)]===void 0x0?{}:{'mutations':_0x4b981d[_0x1e9c39(0x17e)]},'success':!0x0,'value':_0x4b981d[_0x1e9c39(0x165)],'session':k(_0x4b981d['session'])};},async 'exportWorkbookData'(_0x27cac4){const _0xaf81c0=_0x222b;let _0x5d38b9=await O(_0x27cac4),_0x34e9e9=await _0x24202a[_0xaf81c0(0x16e)]({..._0x27cac4['cwd']===void 0x0?{}:{'cwd':_0x27cac4['cwd']},'identity':_0x5d38b9});return{'success':!0x0,'workbookData':_0x34e9e9[_0xaf81c0(0x1c3)],'session':k(_0x34e9e9[_0xaf81c0(0x1d6)])};},async 'exportWorkbookFile'(_0x34fbc3){const _0x4d1830=_0x222b;let _0x4d1b9d=await O(_0x34fbc3),_0x3196bf=await _0x24202a[_0x4d1830(0x1b8)]({..._0x34fbc3[_0x4d1830(0x1b2)]===void 0x0?{}:{'cwd':_0x34fbc3[_0x4d1830(0x1b2)]},'format':_0x34fbc3[_0x4d1830(0x1aa)],'identity':_0x4d1b9d,'outputPath':_0x34fbc3['outputPath']});return{'success':!0x0,'format':_0x3196bf[_0x4d1830(0x1aa)],'outputPath':_0x3196bf['outputPath'],'sizeBytes':_0x3196bf[_0x4d1830(0x19f)],'session':k(_0x3196bf['session'])};},async 'getWorkbookSession'(_0x32f68a){const _0x1e19c3=_0x222b;let _0x2fef06=await O(_0x32f68a),_0x2fd658=await _0x24202a[_0x1e19c3(0x179)]({..._0x32f68a[_0x1e19c3(0x1b2)]===void 0x0?{}:{'cwd':_0x32f68a['cwd']},'identity':_0x2fef06});return{'exists':_0x2fd658!==null,'session':_0x2fd658===null?null:k(_0x2fd658)};},'getSessionCount'(){const _0x571cb5=_0x222b;return _0x24202a[_0x571cb5(0x19d)]?.()??0x0;},'getSessionIdleTtlMs'(){return _0x24202a['getSessionIdleTtlMs']?.()??0xea60;},async 'loadWorkbook'(_0x111c14){const _0x524ce6=_0x222b;let _0x5b2010=await O(_0x111c14),_0x28061e=await _0x24202a[_0x524ce6(0x1d0)]({..._0x111c14[_0x524ce6(0x1b2)]===void 0x0?{}:{'cwd':_0x111c14[_0x524ce6(0x1b2)]},'identity':_0x5b2010,'workbookData':_0x111c14['workbookData']});return{'success':!0x0,'workbookData':_0x28061e['workbookData'],'session':k(_0x28061e[_0x524ce6(0x1d6)])};},async 'loadWorkbookDataReplayPack'(_0x23612b){const _0x3365eb=_0x222b;let _0x16c08e=await O(_0x23612b);return{'success':!0x0,'session':k((await _0x24202a[_0x3365eb(0x192)]({..._0x23612b[_0x3365eb(0x1b2)]===void 0x0?{}:{'cwd':_0x23612b['cwd']},'identity':_0x16c08e,'replayPack':{'baseWorkbookData':_0x23612b[_0x3365eb(0x18f)],'mutations':_0x23612b[_0x3365eb(0x17e)]}}))[_0x3365eb(0x1d6)])};},async 'unloadIdleSessions'(){const _0xfe31b6=_0x222b;await _0x24202a[_0xfe31b6(0x16c)]?.();}};}async function O(_0x32ac01){const _0x5094bf=_0x222b;return await C[_0x5094bf(0x1db)](_0x32ac01);}function k(_0x32dd70){const _0x17fd18=_0x222b;return{'createdAt':_0x32dd70[_0x17fd18(0x1c1)]??'','lastAccessedAt':_0x32dd70[_0x17fd18(0x1d3)]??'','sessionId':_0x32dd70[_0x17fd18(0x1d5)],'workbookIdentity':_0x32dd70[_0x17fd18(0x170)]['absolutePath']};}function A(_0x1fd532){const _0x117bb1=_0x222b;return{'build.id':j(_0x1fd532[_0x117bb1(0x18d)],_0x117bb1(0x1a0))??_0x1fd532[_0x117bb1(0x1bc)],'deployment.environment.name':_0x117bb1(0x1bb),'distribution.channel':j(_0x1fd532[_0x117bb1(0x18d)],'UNIVER_DISTRIBUTION_CHANNEL')??_0x117bb1(0x18e),'service.instance.id':String(_0x1fd532[_0x117bb1(0x1cd)]),'service.name':_0x117bb1(0x1c6),...j(_0x1fd532[_0x117bb1(0x18d)],_0x117bb1(0x1b5))===void 0x0?{}:{'service.version':j(_0x1fd532['env'],'UNIVER_CLI_VERSION')}};}function _0x222b(_0x31bfa1,_0x183f03){_0x31bfa1=_0x31bfa1-0x15f;const _0x5751c4=_0x5751();let _0x222b3d=_0x5751c4[_0x31bfa1];return _0x222b3d;}function j(_0x4ba5c6,_0x12b8f1){const _0x5ec643=_0x222b;let _0x21e526=_0x4ba5c6[_0x12b8f1]?.[_0x5ec643(0x1a9)]();return _0x21e526===void 0x0||_0x21e526[_0x5ec643(0x191)]===0x0?void 0x0:_0x21e526;}async function M(_0x207d1c){const _0x2a1626=_0x222b;F(_0x207d1c['socketPath'])&&!await P(_0x207d1c['socketPath'])&&await I(_0x207d1c[_0x2a1626(0x199)]);let _0x5820b3=await L(_0x207d1c['pidPath']);_0x5820b3!==null&&!R(_0x5820b3)&&(await _0x1797cd(_0x207d1c[_0x2a1626(0x18a)],{'force':!0x0})['catch'](()=>void 0x0),await _0x1797cd(_0x207d1c[_0x2a1626(0x1dc)],{'force':!0x0})['catch'](()=>void 0x0),await _0x1797cd(_0x207d1c[_0x2a1626(0x190)],{'recursive':!0x0,'force':!0x0})[_0x2a1626(0x161)](()=>void 0x0));}async function N(_0x3f495b,_0x3fb5ed){const _0x4d0e74=_0x222b;try{return await _0x84f010(_0x3f495b,{'recursive':!0x1,'mode':0x1c0}),!0x0;}catch(_0x557e16){if(_0x557e16[_0x4d0e74(0x1d4)]!==_0x4d0e74(0x1a2))throw _0x557e16;let _0x5862a8=await L(_0x3fb5ed);return _0x5862a8!==null&&R(_0x5862a8)?!0x1:(await _0x1797cd(_0x3f495b,{'recursive':!0x0,'force':!0x0}),await _0x84f010(_0x3f495b,{'recursive':!0x1,'mode':0x1c0}),!0x0);}}async function P(_0x2375c4){return await new Promise(_0x4dc4a9=>{const _0x90857=_0x222b;let _0x51f456=_0x4e3ec4[_0x90857(0x163)](_0x2375c4);_0x51f456[_0x90857(0x1c2)](_0x90857(0x196),()=>{const _0x15deec=_0x90857;_0x51f456[_0x15deec(0x1b3)](),_0x4dc4a9(!0x0);}),_0x51f456[_0x90857(0x1c2)]('error',()=>{_0x4dc4a9(!0x1);});});}function F(_0x18ece0){return _0x21a6e4(_0x18ece0)?!0x1:_0x5c19e9(_0x18ece0);}async function I(_0x48306b){const _0x233366=_0x222b;_0x21a6e4(_0x48306b)||await _0x1797cd(_0x48306b,{'force':!0x0})[_0x233366(0x161)](()=>void 0x0);}async function L(_0x52f98c){const _0x158a0e=_0x222b;try{let _0x153819=await _0x2277a1(_0x52f98c,_0x158a0e(0x173)),_0x6d281d=Number(_0x153819['trim']());return Number['isFinite'](_0x6d281d)?_0x6d281d:null;}catch{return null;}}function R(_0x580d31){const _0x2eeba8=_0x222b;try{return _0x662e25[_0x2eeba8(0x1c5)](_0x580d31,0x0),!0x0;}catch{return!0x1;}}function z(_0x1b971a,_0x2e3164){const _0x267799=_0x222b;return{'jsonrpc':_0x267799(0x1b9),'id':_0x1b971a,'result':_0x2e3164};}function B(_0x3209eb,_0xf69b88,_0x2faa34){const _0x5db292=_0x222b;return{'jsonrpc':'2.0','id':_0x3209eb,'error':{'code':_0xf69b88,'message':_0x2faa34 instanceof Error?_0x2faa34[_0x5db292(0x1ba)]:String(_0x2faa34)}};}var V=process[_0x430fd8(0x193)][0x2]??_0x430fd8(0x178);V!==_0x430fd8(0x178)&&(console[_0x430fd8(0x1c8)](_0x430fd8(0x167)+V),process[_0x430fd8(0x188)](0x1)),w()[_0x430fd8(0x161)](_0x347deb=>{const _0x341d58=_0x430fd8;console[_0x341d58(0x1c8)](_0x347deb instanceof Error?_0x347deb[_0x341d58(0x1ba)]:String(_0x347deb)),process[_0x341d58(0x188)](0x1);});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const _0x58305b=_0x324c;function _0x3323(){const _0x15047c=['writeFile','npm_config_user_agent','univer-cli','eventName','now','path','name','11BlaLQd','argv','https://univer.ai/api/telemetry/cli','0.0.0','parse','CLI\x20telemetry\x20proxy\x20failed\x20with\x20status\x20','versions','mode','buildInfo','@dream-num/univer-cli','830030ntLxqZ','split','cliVersion','attemptedAt','manifest','bun','capture','env','postinstall-worker','arch','object','endpoint','stateIo','1145924HcdeeA','string','stringify','length','events','packaged','state.json','randomId','.tmp','341152vBLWCJ','UNIVER_MANAGED_BY_BUN','state','properties','npm_execpath','1270968EDHEUT','UNIVER_HOME','captured','461385nFxvpt','1LyNyoS','POST','distinctId','missing-endpoint','number','config','package.json','isSafeInteger','transport','timeout','internal-github','cli-startup','timeoutMs','rename','cli_installed','buildCommit','version','18576012LZKXMu','unknown','not-packaged','readFile','24Eiuprg','yarn','unref','589486rEfJcO','ignore','statePath','eventSource','anonymousInstallId','application/json','execPath','skipped','3MuWBcn','utf8','commitHash','pnpm','status','homeDir','cli_first_opened','10CbhCPF','postinstall','first-open','state-unavailable','test','trim','internal','npm','packageRoot','event','telemetry'];_0x3323=function(){return _0x15047c;};return _0x3323();}(function(_0x59d2b5,_0xa8f1f4){const _0x32703c=_0x324c,_0x3a81a5=_0x59d2b5();while(!![]){try{const _0xab79f9=parseInt(_0x32703c(0x16f))/0x1*(-parseInt(_0x32703c(0x187))/0x2)+-parseInt(_0x32703c(0x18f))/0x3*(parseInt(_0x32703c(0x1bf))/0x4)+parseInt(_0x32703c(0x196))/0x5*(-parseInt(_0x32703c(0x1cd))/0x6)+-parseInt(_0x32703c(0x1c8))/0x7+-parseInt(_0x32703c(0x184))/0x8*(parseInt(_0x32703c(0x16e))/0x9)+parseInt(_0x32703c(0x1b2))/0xa*(-parseInt(_0x32703c(0x1a8))/0xb)+parseInt(_0x32703c(0x180))/0xc;if(_0xab79f9===_0xa8f1f4)break;else _0x3a81a5['push'](_0x3a81a5['shift']());}catch(_0x484615){_0x3a81a5['push'](_0x3a81a5['shift']());}}}(_0x3323,0x3ee33));import{t as _0x46c36b}from'../chunks/build-info-BA0nrxkO.js';import{n as _0x53079c}from'../chunks/runtime-manifest-Bdf66z_K.js';import{spawn as _0x48e3ea}from'node:child_process';import{readFileSync as _0x135494}from'node:fs';import{mkdir as _0x59a79e,readFile as _0x43566e,rename as _0xc645f8,writeFile as _0x32d3f7}from'node:fs/promises';import{dirname as _0x1d8eb5,join as _0x293ee1,resolve as _0x50906f}from'node:path';import{fileURLToPath as _0x1aef5a}from'node:url';import{homedir as _0x5383dc,platform as _0xecc6dd}from'node:os';import{randomUUID as _0xa8c209}from'node:crypto';async function h(_0xb57d42){const _0x12965b=_0x324c;let _0x28375=_0xb57d42['env']??process.env,_0x49d4c1=_0xb57d42[_0x12965b(0x1b6)]??_0x53079c(_0x28375);if(_0x49d4c1[_0x12965b(0x1af)]!==_0x12965b(0x1c4))return{'reason':_0x12965b(0x182),'status':_0x12965b(0x18e)};let _0x39c9db=_0xb57d42[_0x12965b(0x1b0)]??_0x46c36b;if(N(_0x39c9db))return{'reason':'development-build','status':_0x12965b(0x18e)};let _0x522d1b=_0xb57d42[_0x12965b(0x174)]??await O(_0x49d4c1[_0x12965b(0x19e)]);if(_0x522d1b[_0x12965b(0x1bd)][_0x12965b(0x1c2)]===0x0)return{'reason':_0x12965b(0x172),'status':_0x12965b(0x18e)};let _0x5b9740=_0xb57d42[_0x12965b(0x1a5)]??new Date(),_0x40eba7=_0xb57d42[_0x12965b(0x189)]??v({'env':_0x28375}),_0x14ddc4=await b({'path':_0x40eba7,..._0xb57d42[_0x12965b(0x1c6)]===void 0x0?{}:{'randomId':_0xb57d42[_0x12965b(0x1c6)]},..._0xb57d42['stateIo']===void 0x0?{}:{'stateIo':_0xb57d42[_0x12965b(0x1be)]}});if(_0x14ddc4['state']===void 0x0)return{'reason':_0x12965b(0x199),'status':'skipped'};if(_0xb57d42[_0x12965b(0x1a4)]===_0x12965b(0x195)&&_0x14ddc4[_0x12965b(0x1ca)]['events']['cli_first_opened']!==void 0x0)return{'reason':'already-attempted','status':_0x12965b(0x18e)};let _0x3bd328=w({'buildInfo':_0x39c9db,'eventName':_0xb57d42[_0x12965b(0x1a4)],'now':_0x5b9740,'state':_0x14ddc4[_0x12965b(0x1ca)]});await C({'path':_0x40eba7,'state':_0x3bd328,..._0xb57d42[_0x12965b(0x1be)]===void 0x0?{}:{'stateIo':_0xb57d42[_0x12965b(0x1be)]}});let _0x12dc75=T({'buildInfo':_0x39c9db,'env':_0x28375,'eventName':_0xb57d42['eventName'],'eventSource':_0xb57d42[_0x12965b(0x18a)],'manifest':_0x49d4c1,'state':_0x3bd328});try{return await(_0xb57d42[_0x12965b(0x177)]??new A())['capture']({'capture':_0x12dc75,'config':_0x522d1b}),{'status':_0x12965b(0x16d)};}catch{return{'reason':'capture-failed','status':_0x12965b(0x18e)};}}async function g(_0x27bde7={}){const _0xd87d84=_0x324c;return await h({..._0x27bde7,'eventName':_0xd87d84(0x17d),'eventSource':_0xd87d84(0x197)});}async function _(_0x2602c5={}){const _0x3f8ab3=_0x324c;return await h({..._0x2602c5,'eventName':_0x3f8ab3(0x195),'eventSource':_0x3f8ab3(0x17a)});}function v(_0x54a809={}){const _0x558bc4=_0x324c;let _0xc03d40=(_0x54a809['env']??process.env)[_0x558bc4(0x1ce)]?.[_0x558bc4(0x19b)]();return _0x50906f(_0xc03d40&&_0xc03d40[_0x558bc4(0x1c2)]>0x0?_0xc03d40:_0x293ee1(_0x54a809[_0x558bc4(0x194)]??_0x5383dc(),'.univer'),_0x558bc4(0x1a0),_0x558bc4(0x1c5));}function y(_0x7d4a93={}){const _0x69be67=_0x324c;return{'anonymousInstallId':_0x7d4a93[_0x69be67(0x1c6)]?.()??_0xa8c209(),'events':{},'version':0x1};}async function b(_0x334188){const _0x54c7a4=_0x324c;let _0x5129a1=_0x334188['stateIo']?.[_0x54c7a4(0x183)]??_0x43566e;try{return{'state':x(await _0x5129a1(_0x334188['path'],_0x54c7a4(0x190)))};}catch{return{'state':y({..._0x334188[_0x54c7a4(0x1c6)]===void 0x0?{}:{'randomId':_0x334188[_0x54c7a4(0x1c6)]}})};}}function x(_0x1542b9){const _0xc0ba40=_0x324c;let _0x598747=JSON[_0xc0ba40(0x1ac)](_0x1542b9);if(!R(_0x598747)||_0x598747[_0xc0ba40(0x17f)]!==0x1)throw Error('Invalid\x20product\x20telemetry\x20state\x20version.');if(typeof _0x598747['anonymousInstallId']!='string'||_0x598747[_0xc0ba40(0x18b)][_0xc0ba40(0x1c2)]===0x0)throw Error('Invalid\x20product\x20telemetry\x20anonymous\x20install\x20id.');let _0x4ca1e8=R(_0x598747[_0xc0ba40(0x1c3)])?_0x598747[_0xc0ba40(0x1c3)]:{};return{'anonymousInstallId':_0x598747[_0xc0ba40(0x18b)],'events':{...P(_0x4ca1e8['cli_installed'],_0xc0ba40(0x17d)),...P(_0x4ca1e8[_0xc0ba40(0x195)],_0xc0ba40(0x195))},'version':0x1};}function S(_0x1b06dd){const _0x2a0192=_0x324c;return JSON[_0x2a0192(0x1c1)](_0x1b06dd,null,0x2)+'\x0a';}async function C(_0x41fcd9){const _0xe7f1fb=_0x324c;let _0x39d9fa=_0x41fcd9['stateIo']?.[_0xe7f1fb(0x1a1)]??_0x32d3f7,_0x34f139=_0x41fcd9[_0xe7f1fb(0x1be)]?.[_0xe7f1fb(0x17c)]??_0xc645f8,_0x3287b6=_0x41fcd9[_0xe7f1fb(0x1a6)]+'.'+process['pid']+'.'+Date[_0xe7f1fb(0x1a5)]()+_0xe7f1fb(0x1c7);try{await _0x59a79e(_0x1d8eb5(_0x41fcd9[_0xe7f1fb(0x1a6)]),{'mode':0x1c0,'recursive':!0x0}),await _0x39d9fa(_0x3287b6,S(_0x41fcd9[_0xe7f1fb(0x1ca)]),{'encoding':'utf8','mode':0x180}),await _0x34f139(_0x3287b6,_0x41fcd9[_0xe7f1fb(0x1a6)]);}catch{}}function w(_0x473d88){const _0x4edafd=_0x324c;return{..._0x473d88[_0x4edafd(0x1ca)],'events':{..._0x473d88[_0x4edafd(0x1ca)]['events'],[_0x473d88[_0x4edafd(0x1a4)]]:{'attemptedAt':_0x473d88[_0x4edafd(0x1a5)]['toISOString'](),'buildCommit':_0x473d88[_0x4edafd(0x1b0)][_0x4edafd(0x191)],'cliVersion':_0x473d88[_0x4edafd(0x1b0)]['version']}}};}function T(_0x54b8aa){const _0x2fd758=_0x324c;return{'distinctId':_0x54b8aa[_0x2fd758(0x1ca)][_0x2fd758(0x18b)],'event':_0x54b8aa['eventName'],'properties':E(_0x54b8aa)};}function E(_0x352283){const _0x52da7e=_0x324c;return{'arch':process[_0x52da7e(0x1bb)],'build_commit':_0x352283['buildInfo'][_0x52da7e(0x191)],'cli_version':_0x352283[_0x52da7e(0x1b0)][_0x52da7e(0x17f)],'distribution_channel':M(_0x352283[_0x52da7e(0x1b6)]),'event_source':_0x352283[_0x52da7e(0x18a)],'install_manager':D(_0x352283[_0x52da7e(0x1b9)]??process.env),'node_major_version':F(process[_0x52da7e(0x1ae)]['node']),'package_name':j(_0x352283[_0x52da7e(0x1b6)]),'platform':_0xecc6dd(),'telemetry_state_version':0x1};}function D(_0x11553d=process.env){const _0x3fb787=_0x324c;let _0x10d9b3=process[_0x3fb787(0x1ae)];if(typeof _0x10d9b3[_0x3fb787(0x1b7)]==_0x3fb787(0x1c0)&&_0x10d9b3['bun'][_0x3fb787(0x1c2)]>0x0)return _0x3fb787(0x1b7);let _0x4eb7be=_0x11553d[_0x3fb787(0x1a2)]??'';if(/\bbun\//u['test'](_0x4eb7be))return _0x3fb787(0x1b7);if(/\bpnpm\//u[_0x3fb787(0x19a)](_0x4eb7be))return'pnpm';if(/\byarn\//u[_0x3fb787(0x19a)](_0x4eb7be))return'yarn';if(/\bnpm\//u[_0x3fb787(0x19a)](_0x4eb7be))return _0x3fb787(0x19d);let _0x412145=_0x11553d[_0x3fb787(0x1cc)]??'';return/(^|[/\\])bun(?:\.exe)?$/u[_0x3fb787(0x19a)](_0x412145)?'bun':/(^|[/\\])pnpm(?:\.cmd|\.ps1|\.exe)?$/u[_0x3fb787(0x19a)](_0x412145)?_0x3fb787(0x192):/(^|[/\\])yarn(?:\.cmd|\.ps1|\.exe)?$/u[_0x3fb787(0x19a)](_0x412145)?_0x3fb787(0x185):/(^|[/\\])npm(?:\.cmd|\.ps1|\.exe)?$/u[_0x3fb787(0x19a)](_0x412145)?'npm':_0x11553d[_0x3fb787(0x1c9)]==='1'?_0x3fb787(0x1b7):_0x11553d['UNIVER_MANAGED_BY_NPM']==='1'?'npm':_0x3fb787(0x181);}async function O(_0x187642){const _0x146e64=_0x324c;try{let _0x4b862d=await _0x43566e(_0x293ee1(_0x187642,_0x146e64(0x19c),'product-telemetry.json'),_0x146e64(0x190));return k(JSON[_0x146e64(0x1ac)](_0x4b862d));}catch{return k({});}}function k(_0x306fc4){const _0x37fde2=_0x324c;let _0x5306ef=R(_0x306fc4)?_0x306fc4:{};return{'endpoint':I(_0x5306ef[_0x37fde2(0x1bd)],_0x37fde2(0x1aa)),'timeoutMs':L(_0x5306ef[_0x37fde2(0x17b)],0x1388)};}var A=class{async[_0x58305b(0x1b8)](_0x2709ca){const _0x242812=_0x58305b;let _0x150518=await fetch(_0x2709ca[_0x242812(0x174)][_0x242812(0x1bd)],{'body':JSON['stringify']({'distinctId':_0x2709ca[_0x242812(0x1b8)][_0x242812(0x171)],'event':_0x2709ca[_0x242812(0x1b8)][_0x242812(0x19f)],'properties':_0x2709ca['capture'][_0x242812(0x1cb)]}),'headers':{'content-type':_0x242812(0x18c)},'method':_0x242812(0x170),'signal':AbortSignal[_0x242812(0x178)](_0x2709ca[_0x242812(0x174)][_0x242812(0x17b)])});if(!_0x150518['ok'])throw Error(_0x242812(0x1ad)+_0x150518[_0x242812(0x193)]);}};function j(_0x2b095a){const _0x5d7abd=_0x58305b;try{let _0x2515b1=JSON['parse'](_0x135494(_0x293ee1(_0x2b095a[_0x5d7abd(0x19e)],_0x5d7abd(0x175)),_0x5d7abd(0x190)));return typeof _0x2515b1['name']==_0x5d7abd(0x1c0)&&_0x2515b1['name'][_0x5d7abd(0x19b)]()[_0x5d7abd(0x1c2)]>0x0?_0x2515b1[_0x5d7abd(0x1a7)]:'univer-cli';}catch{return'univer-cli';}}function M(_0x23b9fb){const _0x3b4d68=_0x58305b;let _0x313c35=j(_0x23b9fb);return _0x313c35===_0x3b4d68(0x1b1)?_0x3b4d68(0x179):_0x313c35===_0x3b4d68(0x1a3)?'public-npm':_0x23b9fb[_0x3b4d68(0x1af)];}function N(_0x462086){const _0x14a304=_0x58305b;return _0x462086[_0x14a304(0x17f)]===_0x14a304(0x1ab);}function P(_0x2a21e0,_0x2b0bbe){const _0x58f3a5=_0x58305b;return!R(_0x2a21e0)||typeof _0x2a21e0['attemptedAt']!=_0x58f3a5(0x1c0)||typeof _0x2a21e0[_0x58f3a5(0x17e)]!=_0x58f3a5(0x1c0)||typeof _0x2a21e0[_0x58f3a5(0x1b4)]!=_0x58f3a5(0x1c0)?{}:{[_0x2b0bbe]:{'attemptedAt':_0x2a21e0[_0x58f3a5(0x1b5)],'buildCommit':_0x2a21e0[_0x58f3a5(0x17e)],'cliVersion':_0x2a21e0[_0x58f3a5(0x1b4)]}};}function F(_0x3e6364){const _0x5564c8=_0x58305b;let _0x32d423=Number(_0x3e6364[_0x5564c8(0x1b3)]('.')[0x0]);return Number[_0x5564c8(0x176)](_0x32d423)&&_0x32d423>0x0?_0x32d423:void 0x0;}function I(_0x524f93,_0x1f8b93){const _0x244ada=_0x58305b;return typeof _0x524f93==_0x244ada(0x1c0)&&_0x524f93[_0x244ada(0x19b)]()[_0x244ada(0x1c2)]>0x0?_0x524f93[_0x244ada(0x19b)]():_0x1f8b93;}function L(_0x44c851,_0x1e65ea){const _0x872fe6=_0x58305b;return typeof _0x44c851==_0x872fe6(0x173)&&Number[_0x872fe6(0x176)](_0x44c851)&&_0x44c851>0x0?_0x44c851:_0x1e65ea;}function R(_0xfaab9b){const _0x2a1fc6=_0x58305b;return typeof _0xfaab9b==_0x2a1fc6(0x1bc)&&!!_0xfaab9b;}var z=process[_0x58305b(0x1a9)][0x2];try{z===_0x58305b(0x198)?await _():z===_0x58305b(0x197)?B(_0x58305b(0x1ba)):z===_0x58305b(0x1ba)&&await g();}catch{}function _0x324c(_0x193fc0,_0xf79620){_0x193fc0=_0x193fc0-0x16d;const _0x3323b8=_0x3323();let _0x324ce2=_0x3323b8[_0x193fc0];return _0x324ce2;}function B(_0x5a8e4c){const _0x498a09=_0x58305b;_0x48e3ea(process[_0x498a09(0x18d)],[_0x1aef5a(import.meta.url),_0x5a8e4c],{'detached':!0x0,'env':process.env,'stdio':_0x498a09(0x188),'windowsHide':!0x0})[_0x498a09(0x186)]();}
|
|
2
|
+
const _0x60eacd=_0x4d96;(function(_0x46c63e,_0x5108f7){const _0xc8a1bb=_0x4d96,_0x1773ef=_0x46c63e();while(!![]){try{const _0x2150a4=parseInt(_0xc8a1bb(0x1de))/0x1*(parseInt(_0xc8a1bb(0x1d2))/0x2)+-parseInt(_0xc8a1bb(0x1ae))/0x3+parseInt(_0xc8a1bb(0x1ec))/0x4*(parseInt(_0xc8a1bb(0x1f4))/0x5)+parseInt(_0xc8a1bb(0x200))/0x6*(-parseInt(_0xc8a1bb(0x1f9))/0x7)+-parseInt(_0xc8a1bb(0x202))/0x8*(parseInt(_0xc8a1bb(0x1da))/0x9)+parseInt(_0xc8a1bb(0x1d3))/0xa*(parseInt(_0xc8a1bb(0x1d6))/0xb)+parseInt(_0xc8a1bb(0x1ff))/0xc*(parseInt(_0xc8a1bb(0x1e1))/0xd);if(_0x2150a4===_0x5108f7)break;else _0x1773ef['push'](_0x1773ef['shift']());}catch(_0x1b8724){_0x1773ef['push'](_0x1773ef['shift']());}}}(_0x1b8a,0x41da6));import{t as _0x4228b8}from'../chunks/build-info-CYwzl-uD.js';import{n as _0x5bf70c}from'../chunks/runtime-manifest-ChxEzYC3.js';import{spawn as _0x523bf8}from'node:child_process';import{readFileSync as _0x43279f}from'node:fs';import{mkdir as _0x4f6007,readFile as _0x4a7386,rename as _0x71a450,writeFile as _0x556f7f}from'node:fs/promises';import{dirname as _0x38c37a,join as _0x3d820d,resolve as _0x2b6ff4}from'node:path';import{fileURLToPath as _0x3a7fa7}from'node:url';import{homedir as _0x2c0a61,platform as _0x1f4a2d}from'node:os';import{randomUUID as _0x2f0562}from'node:crypto';async function h(_0x4111c6){const _0x37d276=_0x4d96;let _0xc5b212=_0x4111c6[_0x37d276(0x1bc)]??process.env,_0x1f368b=_0x4111c6[_0x37d276(0x1f7)]??_0x5bf70c(_0xc5b212);if(_0x1f368b[_0x37d276(0x206)]!=='packaged')return{'reason':_0x37d276(0x1b0),'status':_0x37d276(0x1fe)};let _0x480a43=_0x4111c6[_0x37d276(0x204)]??_0x4228b8;if(N(_0x480a43))return{'reason':'development-build','status':_0x37d276(0x1fe)};let _0x4af7bb=_0x4111c6[_0x37d276(0x1ad)]??await O(_0x1f368b[_0x37d276(0x1fa)]);if(_0x4af7bb['endpoint'][_0x37d276(0x1c2)]===0x0)return{'reason':'missing-endpoint','status':_0x37d276(0x1fe)};let _0x156e3a=_0x4111c6[_0x37d276(0x205)]??new Date(),_0x30bc22=_0x4111c6['statePath']??v({'env':_0xc5b212}),_0x32b42c=await b({'path':_0x30bc22,..._0x4111c6[_0x37d276(0x1c1)]===void 0x0?{}:{'randomId':_0x4111c6['randomId']},..._0x4111c6[_0x37d276(0x1b2)]===void 0x0?{}:{'stateIo':_0x4111c6[_0x37d276(0x1b2)]}});if(_0x32b42c[_0x37d276(0x1db)]===void 0x0)return{'reason':_0x37d276(0x203),'status':_0x37d276(0x1fe)};if(_0x4111c6[_0x37d276(0x1f1)]===_0x37d276(0x1b1)&&_0x32b42c[_0x37d276(0x1db)][_0x37d276(0x1be)]['cli_first_opened']!==void 0x0)return{'reason':'already-attempted','status':_0x37d276(0x1fe)};let _0x13794a=w({'buildInfo':_0x480a43,'eventName':_0x4111c6[_0x37d276(0x1f1)],'now':_0x156e3a,'state':_0x32b42c[_0x37d276(0x1db)]});await C({'path':_0x30bc22,'state':_0x13794a,..._0x4111c6['stateIo']===void 0x0?{}:{'stateIo':_0x4111c6[_0x37d276(0x1b2)]}});let _0x120961=T({'buildInfo':_0x480a43,'env':_0xc5b212,'eventName':_0x4111c6[_0x37d276(0x1f1)],'eventSource':_0x4111c6['eventSource'],'manifest':_0x1f368b,'state':_0x13794a});try{return await(_0x4111c6['transport']??new A())[_0x37d276(0x1c9)]({'capture':_0x120961,'config':_0x4af7bb}),{'status':_0x37d276(0x1b7)};}catch{return{'reason':_0x37d276(0x1b6),'status':_0x37d276(0x1fe)};}}async function g(_0x4d09d5={}){const _0xc1fcd5=_0x4d96;return await h({..._0x4d09d5,'eventName':_0xc1fcd5(0x1e5),'eventSource':_0xc1fcd5(0x1cf)});}async function _(_0x255ddf={}){const _0x4337fd=_0x4d96;return await h({..._0x255ddf,'eventName':'cli_first_opened','eventSource':_0x4337fd(0x1e8)});}function v(_0x2367d8={}){const _0x320055=_0x4d96;let _0x551fb7=(_0x2367d8[_0x320055(0x1bc)]??process.env)[_0x320055(0x1c7)]?.[_0x320055(0x1f2)]();return _0x2b6ff4(_0x551fb7&&_0x551fb7['length']>0x0?_0x551fb7:_0x3d820d(_0x2367d8['homeDir']??_0x2c0a61(),_0x320055(0x1dd)),_0x320055(0x1c4),_0x320055(0x207));}function y(_0x1647ba={}){const _0x4e3fb6=_0x4d96;return{'anonymousInstallId':_0x1647ba[_0x4e3fb6(0x1c1)]?.()??_0x2f0562(),'events':{},'version':0x1};}async function b(_0x1ce454){const _0x4cb411=_0x4d96;let _0x3223ab=_0x1ce454[_0x4cb411(0x1b2)]?.[_0x4cb411(0x1ac)]??_0x4a7386;try{return{'state':x(await _0x3223ab(_0x1ce454[_0x4cb411(0x1ee)],'utf8'))};}catch{return{'state':y({..._0x1ce454[_0x4cb411(0x1c1)]===void 0x0?{}:{'randomId':_0x1ce454[_0x4cb411(0x1c1)]}})};}}function x(_0x475033){const _0x1e71db=_0x4d96;let _0x48cc19=JSON['parse'](_0x475033);if(!R(_0x48cc19)||_0x48cc19[_0x1e71db(0x1af)]!==0x1)throw Error('Invalid\x20product\x20telemetry\x20state\x20version.');if(typeof _0x48cc19[_0x1e71db(0x20a)]!='string'||_0x48cc19['anonymousInstallId'][_0x1e71db(0x1c2)]===0x0)throw Error(_0x1e71db(0x1e2));let _0x4f2006=R(_0x48cc19['events'])?_0x48cc19[_0x1e71db(0x1be)]:{};return{'anonymousInstallId':_0x48cc19[_0x1e71db(0x20a)],'events':{...P(_0x4f2006[_0x1e71db(0x1e5)],'cli_installed'),...P(_0x4f2006[_0x1e71db(0x1b1)],_0x1e71db(0x1b1))},'version':0x1};}function S(_0x116663){const _0x3882eb=_0x4d96;return JSON[_0x3882eb(0x20b)](_0x116663,null,0x2)+'\x0a';}async function C(_0x451b22){const _0x10f6c7=_0x4d96;let _0x3e885d=_0x451b22[_0x10f6c7(0x1b2)]?.['writeFile']??_0x556f7f,_0x34b158=_0x451b22[_0x10f6c7(0x1b2)]?.[_0x10f6c7(0x208)]??_0x71a450,_0x30f915=_0x451b22[_0x10f6c7(0x1ee)]+'.'+process[_0x10f6c7(0x1cd)]+'.'+Date[_0x10f6c7(0x205)]()+_0x10f6c7(0x1fd);try{await _0x4f6007(_0x38c37a(_0x451b22['path']),{'mode':0x1c0,'recursive':!0x0}),await _0x3e885d(_0x30f915,S(_0x451b22[_0x10f6c7(0x1db)]),{'encoding':_0x10f6c7(0x1f8),'mode':0x180}),await _0x34b158(_0x30f915,_0x451b22[_0x10f6c7(0x1ee)]);}catch{}}function w(_0x29fc82){const _0x3f82dd=_0x4d96;return{..._0x29fc82['state'],'events':{..._0x29fc82['state'][_0x3f82dd(0x1be)],[_0x29fc82[_0x3f82dd(0x1f1)]]:{'attemptedAt':_0x29fc82['now'][_0x3f82dd(0x1cc)](),'buildCommit':_0x29fc82[_0x3f82dd(0x204)][_0x3f82dd(0x1e4)],'cliVersion':_0x29fc82[_0x3f82dd(0x204)]['version']}}};}function T(_0x24ffe7){const _0x314f1c=_0x4d96;return{'distinctId':_0x24ffe7[_0x314f1c(0x1db)][_0x314f1c(0x20a)],'event':_0x24ffe7['eventName'],'properties':E(_0x24ffe7)};}function E(_0x10388e){const _0x2f894b=_0x4d96;return{'arch':process[_0x2f894b(0x1c0)],'build_commit':_0x10388e[_0x2f894b(0x204)][_0x2f894b(0x1e4)],'cli_version':_0x10388e[_0x2f894b(0x204)][_0x2f894b(0x1af)],'distribution_channel':M(_0x10388e[_0x2f894b(0x1f7)]),'event_source':_0x10388e[_0x2f894b(0x1d1)],'install_manager':D(_0x10388e['env']??process.env),'node_major_version':F(process['versions'][_0x2f894b(0x1bf)]),'package_name':j(_0x10388e[_0x2f894b(0x1f7)]),'platform':_0x1f4a2d(),'telemetry_state_version':0x1};}function D(_0x58eba6=process.env){const _0x460264=_0x4d96;let _0x251a53=process[_0x460264(0x1e7)];if(typeof _0x251a53[_0x460264(0x1dc)]==_0x460264(0x1ce)&&_0x251a53['bun'][_0x460264(0x1c2)]>0x0)return'bun';let _0x2d1ea0=_0x58eba6[_0x460264(0x1ca)]??'';if(/\bbun\//u[_0x460264(0x1ba)](_0x2d1ea0))return'bun';if(/\bpnpm\//u[_0x460264(0x1ba)](_0x2d1ea0))return _0x460264(0x1b9);if(/\byarn\//u[_0x460264(0x1ba)](_0x2d1ea0))return _0x460264(0x1d4);if(/\bnpm\//u[_0x460264(0x1ba)](_0x2d1ea0))return'npm';let _0x5702b8=_0x58eba6[_0x460264(0x1c5)]??'';return/(^|[/\\])bun(?:\.exe)?$/u[_0x460264(0x1ba)](_0x5702b8)?_0x460264(0x1dc):/(^|[/\\])pnpm(?:\.cmd|\.ps1|\.exe)?$/u['test'](_0x5702b8)?_0x460264(0x1b9):/(^|[/\\])yarn(?:\.cmd|\.ps1|\.exe)?$/u[_0x460264(0x1ba)](_0x5702b8)?'yarn':/(^|[/\\])npm(?:\.cmd|\.ps1|\.exe)?$/u[_0x460264(0x1ba)](_0x5702b8)?_0x460264(0x1ea):_0x58eba6[_0x460264(0x201)]==='1'?'bun':_0x58eba6[_0x460264(0x1c6)]==='1'?_0x460264(0x1ea):_0x460264(0x1fb);}async function O(_0x1aea41){const _0x4089ed=_0x4d96;try{let _0x1c516c=await _0x4a7386(_0x3d820d(_0x1aea41,_0x4089ed(0x1f6),_0x4089ed(0x1f0)),'utf8');return k(JSON[_0x4089ed(0x1d7)](_0x1c516c));}catch{return k({});}}function k(_0x5ad348){const _0x56eb9e=_0x4d96;let _0x24fb27=R(_0x5ad348)?_0x5ad348:{};return{'endpoint':I(_0x24fb27['endpoint'],_0x56eb9e(0x1c3)),'timeoutMs':L(_0x24fb27['timeoutMs'],0x1388)};}var A=class{async[_0x60eacd(0x1c9)](_0x18432c){const _0x35f8f2=_0x60eacd;let _0x1b480c=await fetch(_0x18432c[_0x35f8f2(0x1ad)][_0x35f8f2(0x1b8)],{'body':JSON['stringify']({'distinctId':_0x18432c[_0x35f8f2(0x1c9)][_0x35f8f2(0x1eb)],'event':_0x18432c[_0x35f8f2(0x1c9)][_0x35f8f2(0x1b5)],'properties':_0x18432c[_0x35f8f2(0x1c9)]['properties']}),'headers':{'content-type':_0x35f8f2(0x1ef)},'method':_0x35f8f2(0x1e0),'signal':AbortSignal[_0x35f8f2(0x1f5)](_0x18432c[_0x35f8f2(0x1ad)][_0x35f8f2(0x1e3)])});if(!_0x1b480c['ok'])throw Error(_0x35f8f2(0x1e6)+_0x1b480c[_0x35f8f2(0x1fc)]);}};function j(_0x4aa213){const _0x3b3a19=_0x60eacd;try{let _0x26ce8b=JSON['parse'](_0x43279f(_0x3d820d(_0x4aa213['packageRoot'],_0x3b3a19(0x1ed)),_0x3b3a19(0x1f8)));return typeof _0x26ce8b['name']==_0x3b3a19(0x1ce)&&_0x26ce8b['name']['trim']()['length']>0x0?_0x26ce8b[_0x3b3a19(0x1c8)]:_0x3b3a19(0x1df);}catch{return _0x3b3a19(0x1df);}}function M(_0x3f3ac2){const _0x1d150e=_0x60eacd;let _0x2cc410=j(_0x3f3ac2);return _0x2cc410===_0x1d150e(0x1d5)?_0x1d150e(0x1cb):_0x2cc410===_0x1d150e(0x1df)?_0x1d150e(0x1d9):_0x3f3ac2[_0x1d150e(0x206)];}function _0x1b8a(){const _0x434fc7=['packageRoot','unknown','status','.tmp','skipped','12FvABnG','18cfIrGE','UNIVER_MANAGED_BY_BUN','866504fBpmSa','state-unavailable','buildInfo','now','mode','state.json','rename','isSafeInteger','anonymousInstallId','stringify','number','0.0.0','readFile','config','1234164iGrcFA','version','not-packaged','cli_first_opened','stateIo','split','cliVersion','event','capture-failed','captured','endpoint','pnpm','test','object','env','execPath','events','node','arch','randomId','length','https://univer.ai/api/telemetry/cli','telemetry','npm_execpath','UNIVER_MANAGED_BY_NPM','UNIVER_HOME','name','capture','npm_config_user_agent','internal-github','toISOString','pid','string','postinstall','buildCommit','eventSource','1962JIjzwB','30GWqBmG','yarn','@dream-num/univer-cli','1467499QIfTrS','parse','first-open','public-npm','27VVeWmh','state','bun','.univer','371Ppmsxo','univer-cli','POST','7821944EvskoX','Invalid\x20product\x20telemetry\x20anonymous\x20install\x20id.','timeoutMs','commitHash','cli_installed','CLI\x20telemetry\x20proxy\x20failed\x20with\x20status\x20','versions','cli-startup','attemptedAt','npm','distinctId','1388DZwjGH','package.json','path','application/json','product-telemetry.json','eventName','trim','argv','1230hGxgfX','timeout','internal','manifest','utf8','1038723QZPkZn'];_0x1b8a=function(){return _0x434fc7;};return _0x1b8a();}function N(_0xa31bbe){const _0x3c95f2=_0x60eacd;return _0xa31bbe[_0x3c95f2(0x1af)]===_0x3c95f2(0x1ab);}function P(_0x1df85a,_0x1ac6b9){const _0x34880d=_0x60eacd;return!R(_0x1df85a)||typeof _0x1df85a[_0x34880d(0x1e9)]!=_0x34880d(0x1ce)||typeof _0x1df85a['buildCommit']!=_0x34880d(0x1ce)||typeof _0x1df85a[_0x34880d(0x1b4)]!=_0x34880d(0x1ce)?{}:{[_0x1ac6b9]:{'attemptedAt':_0x1df85a[_0x34880d(0x1e9)],'buildCommit':_0x1df85a[_0x34880d(0x1d0)],'cliVersion':_0x1df85a[_0x34880d(0x1b4)]}};}function F(_0x1aaa95){const _0x20d2c9=_0x60eacd;let _0x160187=Number(_0x1aaa95[_0x20d2c9(0x1b3)]('.')[0x0]);return Number['isSafeInteger'](_0x160187)&&_0x160187>0x0?_0x160187:void 0x0;}function _0x4d96(_0x4b2580,_0x43e9f3){_0x4b2580=_0x4b2580-0x1ab;const _0x1b8a00=_0x1b8a();let _0x4d9671=_0x1b8a00[_0x4b2580];return _0x4d9671;}function I(_0x1ff680,_0x4cf924){const _0x3406b8=_0x60eacd;return typeof _0x1ff680==_0x3406b8(0x1ce)&&_0x1ff680[_0x3406b8(0x1f2)]()[_0x3406b8(0x1c2)]>0x0?_0x1ff680[_0x3406b8(0x1f2)]():_0x4cf924;}function L(_0x227140,_0x4cd5dd){const _0x5338b8=_0x60eacd;return typeof _0x227140==_0x5338b8(0x20c)&&Number[_0x5338b8(0x209)](_0x227140)&&_0x227140>0x0?_0x227140:_0x4cd5dd;}function R(_0x1b3147){const _0x27db24=_0x60eacd;return typeof _0x1b3147==_0x27db24(0x1bb)&&!!_0x1b3147;}var z=process[_0x60eacd(0x1f3)][0x2];try{z===_0x60eacd(0x1d8)?await _():z==='postinstall'?B('postinstall-worker'):z==='postinstall-worker'&&await g();}catch{}function B(_0x725984){const _0x54cd24=_0x60eacd;_0x523bf8(process[_0x54cd24(0x1bd)],[_0x3a7fa7(import.meta.url),_0x725984],{'detached':!0x0,'env':process.env,'stdio':'ignore','windowsHide':!0x0})['unref']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x9ccb59=_0x2b79;function _0x5ca3(){const _0x4f2732=['LoadWorkbookDataReplayPack','data','enqueue','ExportWorkbookFile','traceparent','2QzIPxG','6Dsulcg','server','params','1374690CKacqv','loadWorkbookDataReplayPack','exportWorkbookData','513736JXhhZE','tail','13650iSdtXY','createWorkbook','outputPath','rpc-request','CreateWorkbook','EvalJs','send','method','RuntimeRpcClient','5782272eSKOJG','275boNBQM','rpc-response','ready','Method\x20not\x20implemented:\x20','maxCodeLength','withContext','value','resolve','9698544wHYjHI','mutates','2170UMgbdU','1017452yzCjQH','type','code','642803ustaIB','ExportWorkbookData','exit','message','evalJs','2.0'];_0x5ca3=function(){return _0x4f2732;};return _0x5ca3();}(function(_0x21f002,_0x4f0f43){const _0xaf0c3d=_0x2b79,_0x34bc74=_0x21f002();while(!![]){try{const _0x5d50f0=-parseInt(_0xaf0c3d(0x202))/0x1*(-parseInt(_0xaf0c3d(0x210))/0x2)+-parseInt(_0xaf0c3d(0x211))/0x3*(-parseInt(_0xaf0c3d(0x1eb))/0x4)+-parseInt(_0xaf0c3d(0x201))/0x5*(-parseInt(_0xaf0c3d(0x1ed))/0x6)+parseInt(_0xaf0c3d(0x205))/0x7+parseInt(_0xaf0c3d(0x1f6))/0x8+parseInt(_0xaf0c3d(0x1ff))/0x9+-parseInt(_0xaf0c3d(0x1e8))/0xa*(parseInt(_0xaf0c3d(0x1f7))/0xb);if(_0x5d50f0===_0x4f0f43)break;else _0x34bc74['push'](_0x34bc74['shift']());}catch(_0x544360){_0x34bc74['push'](_0x34bc74['shift']());}}}(_0x5ca3,0xaf176));import'../chunks/vendor-BUmrAeJ_.js';import{t as _0x2dff6c}from'../chunks/headless-univer-CbMCumXv.js';import{n as _0x4d937b,o as _0x56073a,t as _0x56abd2}from'../chunks/trace-DPfd8LdJ.js';let i=function(_0x27019b){const _0x5e629=_0x2b79;return _0x27019b[_0x5e629(0x1f1)]=_0x5e629(0x1ee),_0x27019b['EvalJs']='evaljs',_0x27019b[_0x5e629(0x20e)]='exportWorkbookFile',_0x27019b['ExportWorkbookData']=_0x5e629(0x1ea),_0x27019b['LoadWorkbook']='loadWorkbook',_0x27019b[_0x5e629(0x20b)]='loadWorkbookDataReplayPack',_0x27019b;}({});var a=class{[_0x9ccb59(0x1ec)]=Promise[_0x9ccb59(0x1fe)]();async[_0x9ccb59(0x20d)](_0x278be9){const _0x55047a=_0x9ccb59;let _0x3e3e01=this[_0x55047a(0x1ec)],_0x2b369b;this[_0x55047a(0x1ec)]=new Promise(_0x1b2d23=>{_0x2b369b=_0x1b2d23;}),await _0x3e3e01;try{return await _0x278be9();}finally{_0x2b369b?.();}}},o=_0x2dff6c(),s=new a();process['send']?.({'type':_0x9ccb59(0x1f9)}),process['on']('message',async _0x6fb840=>{const _0xf6ac35=_0x9ccb59;if(_0x6fb840?.[_0xf6ac35(0x203)]!==_0xf6ac35(0x1f0))return;let _0x5b2799=await c(_0x6fb840[_0xf6ac35(0x20c)]);process[_0xf6ac35(0x1f3)]?.({'type':_0xf6ac35(0x1f8),'id':_0x6fb840['id'],'data':_0x5b2799});}),process['on']('disconnect',()=>{o['dispose'](),process['exit'](0x0);}),process['on']('SIGTERM',()=>{const _0xe4fff7=_0x9ccb59;o['dispose'](),process[_0xe4fff7(0x207)](0x0);});function _0x2b79(_0x3375d1,_0x211adc){_0x3375d1=_0x3375d1-0x1e8;const _0x5ca31c=_0x5ca3();let _0x2b7910=_0x5ca31c[_0x3375d1];return _0x2b7910;}async function c(_0x24605f){const _0xd0d7c4=_0x9ccb59;let _0x22dcd2=_0x56abd2(_0x24605f['meta']?.[_0xd0d7c4(0x20f)]),_0x134248=async()=>await _0x4d937b['withSpan']({'name':_0x56073a[_0xd0d7c4(0x1f5)],'kind':_0xd0d7c4(0x212)},async()=>await l(_0x24605f));return _0x22dcd2===void 0x0?await _0x134248():await _0x4d937b[_0xd0d7c4(0x1fc)](_0x22dcd2,_0x134248);}async function l(_0x11a632){const _0x2efaae=_0x9ccb59;try{switch(_0x11a632[_0x2efaae(0x1f4)]){case i[_0x2efaae(0x1f1)]:{let _0x4739d4=o[_0x2efaae(0x1ee)](_0x11a632[_0x2efaae(0x213)]??{});return{'jsonrpc':'2.0','id':_0x11a632['id'],'result':{'success':!0x0,'workbookData':_0x4739d4}};}case i['LoadWorkbook']:{let _0x4c40dc=o['loadWorkbookData'](_0x11a632[_0x2efaae(0x213)]['workbookData']);return{'jsonrpc':_0x2efaae(0x20a),'id':_0x11a632['id'],'result':{'success':!0x0,'workbookData':_0x4c40dc}};}case i[_0x2efaae(0x20b)]:return await o[_0x2efaae(0x1e9)](_0x11a632[_0x2efaae(0x213)]),{'jsonrpc':_0x2efaae(0x20a),'id':_0x11a632['id'],'result':{'success':!0x0}};case i[_0x2efaae(0x206)]:return{'jsonrpc':_0x2efaae(0x20a),'id':_0x11a632['id'],'result':{'success':!0x0,'workbookData':o['exportWorkbookData']()}};case i[_0x2efaae(0x20e)]:{let _0x26c8d6=_0x11a632[_0x2efaae(0x213)],_0x19a444=await o['exportWorkbookFile'](_0x26c8d6[_0x2efaae(0x1ef)],_0x26c8d6['format']);return{'jsonrpc':_0x2efaae(0x20a),'id':_0x11a632['id'],'result':{'success':!0x0,..._0x19a444}};}case i[_0x2efaae(0x1f2)]:{let _0x2eb8f3=_0x11a632[_0x2efaae(0x213)]??{},_0x4adf57=async()=>{const _0x4c5c82=_0x2efaae;let _0x4571d4=_0x2eb8f3[_0x4c5c82(0x200)]?await o['evalJsWithMutationCapture'](_0x2eb8f3[_0x4c5c82(0x204)],_0x2eb8f3[_0x4c5c82(0x1fb)]):{'value':await o[_0x4c5c82(0x209)](_0x2eb8f3[_0x4c5c82(0x204)],_0x2eb8f3[_0x4c5c82(0x1fb)]),'mutations':void 0x0};return{'success':!0x0,..._0x4571d4['mutations']===void 0x0?{}:{'mutations':_0x4571d4['mutations']},'value':_0x4571d4[_0x4c5c82(0x1fd)]};},_0x190ca5=_0x2eb8f3[_0x2efaae(0x200)]?await s[_0x2efaae(0x20d)](_0x4adf57):await _0x4adf57();return{'jsonrpc':_0x2efaae(0x20a),'id':_0x11a632['id'],'result':_0x190ca5};}default:throw Error(_0x2efaae(0x1fa)+String(_0x11a632['method']));}}catch(_0x1cb6fe){return{'jsonrpc':'2.0','id':_0x11a632['id'],'error':{'code':-0x7f5b,'message':_0x1cb6fe instanceof Error?_0x1cb6fe[_0x2efaae(0x208)]:String(_0x1cb6fe)}};}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "univer-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Command-line tools for local Univer workbook automation.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
"internal",
|
|
32
32
|
"chunks",
|
|
33
33
|
"run-help",
|
|
34
|
+
"sac-help",
|
|
34
35
|
"view",
|
|
35
36
|
"README.md"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@univerjs-pro/uexcli": "0.1.
|
|
39
|
+
"@univerjs-pro/uexcli": "^0.1.21"
|
|
39
40
|
},
|
|
40
41
|
"private": false,
|
|
41
42
|
"publishConfig": {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# SaC Apply And Ledger
|
|
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.
|
|
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.
|
|
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.
|
|
8
|
+
|
|
9
|
+
## Target Lifecycle
|
|
10
|
+
|
|
11
|
+
When no `--target` is provided, the target path comes from `sac.config.ts` and must match the workspace artifact mode.
|
|
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.
|
|
30
|
+
|
|
31
|
+
## Ledger Contract
|
|
32
|
+
|
|
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.
|
|
36
|
+
|
|
37
|
+
Apply fails before executing pending source when:
|
|
38
|
+
|
|
39
|
+
- the target exists but is unmanaged
|
|
40
|
+
- the ledger is malformed
|
|
41
|
+
- the target ledger is ahead of source
|
|
42
|
+
- an already-applied pack id has a different source hash
|
|
43
|
+
- artifact content has drifted since the ledger head
|
|
44
|
+
- automatic workbook commit finds no pending workbook mutations
|
|
45
|
+
- automatic workbook commit returns more than one local changeset for a single pack
|
|
46
|
+
|
|
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.
|
|
48
|
+
|
|
49
|
+
## Verification
|
|
50
|
+
|
|
51
|
+
After apply, verify workbook-visible state:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
univer inspect workbook ./model/artifacts/model.univer
|
|
55
|
+
univer pipe out ./model/artifacts/model.univer --range "Revenue!A1:C4" --format tsv
|
|
56
|
+
univer view ./model/artifacts/model.univer
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Do not treat successful command output as the only validation for a non-trivial workbook change.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# SaC Authoring
|
|
2
|
+
|
|
3
|
+
`univer sac migration create` writes a draft `pack.ts` with `files: []`. The draft is intentionally empty. Before `apply`, add one or more `*.sheet.ts` files, list them in `pack.files`, and export the migration module.
|
|
4
|
+
|
|
5
|
+
## Migration Module Shape
|
|
6
|
+
|
|
7
|
+
`pack.ts` owns pack metadata and sheet execution order:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { defineFacadeMigrationPack } from "univer:sac/facade-migration-pack";
|
|
11
|
+
import type { FacadeMigrationModule } from "univer:sac/facade-migration-pack";
|
|
12
|
+
import revenue from "./revenue.sheet";
|
|
13
|
+
|
|
14
|
+
const pack = defineFacadeMigrationPack({
|
|
15
|
+
id: "20260523090000-add-revenue-model",
|
|
16
|
+
title: "Add Revenue Model",
|
|
17
|
+
appliesAfter: null,
|
|
18
|
+
files: ["revenue.sheet.ts"]
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
pack,
|
|
23
|
+
sheetMigrations: [revenue]
|
|
24
|
+
} satisfies FacadeMigrationModule;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The `files` list is authoritative. Every `*.sheet.ts` file in the pack directory must be listed, and files execute in that order.
|
|
28
|
+
|
|
29
|
+
## Sheet Migration Shape
|
|
30
|
+
|
|
31
|
+
Each sheet migration declares one primary sheet. `create: true` allows the CLI to create the sheet when it does not exist.
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { defineSheetMigration } from "univer:sac/facade-migration-pack";
|
|
35
|
+
import rowsText from "./revenue.tsv";
|
|
36
|
+
|
|
37
|
+
const rows = rowsText
|
|
38
|
+
.trim()
|
|
39
|
+
.split("\n")
|
|
40
|
+
.map((line) => line.split("\t"));
|
|
41
|
+
|
|
42
|
+
export default defineSheetMigration({
|
|
43
|
+
sheet: { id: "revenue", name: "Revenue", create: true },
|
|
44
|
+
apply({ sheet }) {
|
|
45
|
+
sheet.getRange("A1:C4").setValues(rows);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Put tabular seed data in CSV or TSV files when that keeps the migration easier to review. Referenced data assets are part of the source hash.
|
|
51
|
+
|
|
52
|
+
## Authoring Rules
|
|
53
|
+
|
|
54
|
+
- Keep one durable workbook intent per migration.
|
|
55
|
+
- Use stable sheet ids in `sheet.id`; use human-visible sheet names in `sheet.name`.
|
|
56
|
+
- Prefer one primary sheet per `*.sheet.ts` file.
|
|
57
|
+
- Use `univer:sac/facade-migration-pack` for helper types and definitions.
|
|
58
|
+
- Check `univer help sac facade-api` before using unfamiliar Facade APIs.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# SaC Data Assets
|
|
2
|
+
|
|
3
|
+
Migration source may import workspace-local CSV and TSV files when external data makes the workbook intent easier to review.
|
|
4
|
+
|
|
5
|
+
## CSV And TSV Assets
|
|
6
|
+
|
|
7
|
+
Keep data assets next to the migration that uses them:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
migrations/
|
|
11
|
+
20260523090000-add-revenue-model/
|
|
12
|
+
pack.ts
|
|
13
|
+
revenue.sheet.ts
|
|
14
|
+
revenue.tsv
|
|
15
|
+
```
|
|
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.
|
|
18
|
+
|
|
19
|
+
## Import Boundary
|
|
20
|
+
|
|
21
|
+
SaC source must stay inside the workspace realpath boundary. These inputs are allowed:
|
|
22
|
+
|
|
23
|
+
- relative TypeScript imports that resolve inside the workspace
|
|
24
|
+
- relative CSV or TSV imports that resolve inside the workspace
|
|
25
|
+
- the CLI-provided helper specifier `univer:sac/facade-migration-pack`
|
|
26
|
+
|
|
27
|
+
These inputs are rejected before any workbook mutation runs:
|
|
28
|
+
|
|
29
|
+
- parent-path or symlink escapes outside the workspace
|
|
30
|
+
- ordinary package imports such as `lodash`
|
|
31
|
+
- Node builtins such as `node:fs`
|
|
32
|
+
- non-literal dynamic imports
|
|
33
|
+
|
|
34
|
+
The generated `package.json` is for the local toolchain, not for arbitrary migration source package imports.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# SaC Facade API
|
|
2
|
+
|
|
3
|
+
SaC migrations run inside the same Univer runtime family as `univer run`, but they are committed as ordered source packs with ledger entries. SaC help does not duplicate the full Facade API reference.
|
|
4
|
+
|
|
5
|
+
## Migration Context
|
|
6
|
+
|
|
7
|
+
A sheet migration `apply` function receives a bounded context:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
apply({ workbook, sheet, univerAPI }) {
|
|
11
|
+
sheet.getRange("A1").setValue("ready");
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- `sheet` is the declared primary sheet, resolved or created before `apply` runs.
|
|
16
|
+
- `workbook` is the active workbook facade.
|
|
17
|
+
- `univerAPI` is available for Facade APIs that are not sheet-local.
|
|
18
|
+
|
|
19
|
+
## Use The Run Manual
|
|
20
|
+
|
|
21
|
+
Before using unfamiliar APIs, read the relevant run manual topic:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
univer help run sheets
|
|
25
|
+
univer help run ranges
|
|
26
|
+
univer help run formulas
|
|
27
|
+
univer help run formatting
|
|
28
|
+
univer help run conditional-formatting
|
|
29
|
+
univer help run charts
|
|
30
|
+
univer help run shapes
|
|
31
|
+
univer help run images
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Use only APIs documented by those topics. Strictly do not guess or invent Facade method names, overloads, enum names, or object relationships.
|
|
35
|
+
|
|
36
|
+
## Common Starting Points
|
|
37
|
+
|
|
38
|
+
- Sheet creation, rename, visibility, gridlines, and freeze panes: `univer help run sheets`
|
|
39
|
+
- Range values, formulas, merges, clears, and AutoFill: `univer help run ranges`
|
|
40
|
+
- Formula write and async calculation readback: `univer help run formulas`
|
|
41
|
+
- Fonts, fills, borders, alignment, and number formats: `univer help run formatting`
|
|
42
|
+
- Charts, shapes, and floating images: read their dedicated run manual topics first.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# SaC Rebuild
|
|
2
|
+
|
|
3
|
+
Rebuild is an advanced checkpoint operation for a managed SaC artifact. It is not the first local happy path for creating a new SaC project.
|
|
4
|
+
|
|
5
|
+
## When Rebuild Helps
|
|
6
|
+
|
|
7
|
+
Use rebuild when the current workbook state is clearer than a noisy migration history, for example after repeated trial migrations or redundant table reshapes. The goal is to compact active source into one full checkpoint migration.
|
|
8
|
+
|
|
9
|
+
Rebuild does not extract mutation groups. It materializes the current managed artifact state as a full source checkpoint.
|
|
10
|
+
|
|
11
|
+
## Checkpoint Semantics
|
|
12
|
+
|
|
13
|
+
A successful rebuild replaces active `migrations/` with one generated checkpoint pack and resets the active artifact ledger to one rebuild entry. Historical source preservation is owned by git or external backups.
|
|
14
|
+
|
|
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
|
+
|
|
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.
|
|
18
|
+
|
|
19
|
+
## Related Help
|
|
20
|
+
|
|
21
|
+
- `univer help sac workflow`
|
|
22
|
+
- `univer help sac apply-ledger`
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SaC Workflow
|
|
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.
|
|
4
|
+
|
|
5
|
+
## Local Happy Path
|
|
6
|
+
|
|
7
|
+
Enable the experimental command surface first:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
univer config set experimental.sac true
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Create an empty SaC project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
univer sac init ./model
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Install the workspace-local TypeScript toolchain declared by the generated `package.json`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cd model
|
|
23
|
+
pnpm install
|
|
24
|
+
cd ..
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Create one migration, then edit the generated source before applying it:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
univer sac migration create "Add Revenue Model" --workspace ./model
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Apply the source chain to the default `.univer` artifact from `sac.config.ts`:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
univer sac apply ./model
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
Each successful apply creates one workbook local changeset per migration pack. To undo the newest applied migration, use:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
univer reset ./model/artifacts/model.univer --hard HEAD~1
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Verify workbook-visible state after apply:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
univer inspect workbook ./model/artifacts/model.univer
|
|
51
|
+
univer pipe out ./model/artifacts/model.univer --range "Revenue!A1:C4" --format tsv
|
|
52
|
+
univer view ./model/artifacts/model.univer
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Repeat the loop one migration at a time: create, edit source, apply, verify. Keep each migration focused on one durable workbook intent.
|
|
56
|
+
|
|
57
|
+
## Project Shape
|
|
58
|
+
|
|
59
|
+
- `sac.config.ts` declares the migration directory, artifact mode, and default artifact path.
|
|
60
|
+
- `package.json` is private and exists for the workspace-local bundling toolchain.
|
|
61
|
+
- `migrations/` contains timestamped migration pack directories.
|
|
62
|
+
- 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.
|
|
63
|
+
- `.sac/runs/` is reserved for agent runner evidence and is separate from generated workbook results.
|
|
64
|
+
|
|
65
|
+
## Related Help
|
|
66
|
+
|
|
67
|
+
- `univer help sac authoring`
|
|
68
|
+
- `univer help sac facade-api`
|
|
69
|
+
- `univer help sac apply-ledger`
|