@treasuredata/tdx 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -11
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/http-client.js.map +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.d.ts +9 -1
- package/dist/client/td-client.d.ts.map +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/td-client.js.map +1 -1
- package/dist/client/trino-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts +23 -0
- package/dist/commands/auth-command.d.ts.map +1 -0
- package/dist/commands/auth-command.js +1 -0
- package/dist/commands/auth-command.js.map +1 -0
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.d.ts +13 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.d.ts +8 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +6 -5
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.d.ts +12 -0
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/endpoints.js.map +1 -1
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a62_0xe240(_0x5203d3,_0x502038){const _0x5d41f9=a62_0x5d41();return a62_0xe240=function(_0xe24071,_0x19658c){_0xe24071=_0xe24071-0x11b;let _0x1d234b=_0x5d41f9[_0xe24071];return _0x1d234b;},a62_0xe240(_0x5203d3,_0x502038);}(function(_0x155e67,_0x698dab){const _0x2a25d5=a62_0xe240,_0x28371c=_0x155e67();while(!![]){try{const _0x23ba39=-parseInt(_0x2a25d5(0x127))/0x1*(-parseInt(_0x2a25d5(0x14d))/0x2)+parseInt(_0x2a25d5(0x138))/0x3+parseInt(_0x2a25d5(0x13f))/0x4*(-parseInt(_0x2a25d5(0x12f))/0x5)+parseInt(_0x2a25d5(0x149))/0x6*(-parseInt(_0x2a25d5(0x132))/0x7)+parseInt(_0x2a25d5(0x13b))/0x8*(-parseInt(_0x2a25d5(0x122))/0x9)+-parseInt(_0x2a25d5(0x139))/0xa+parseInt(_0x2a25d5(0x11d))/0xb;if(_0x23ba39===_0x698dab)break;else _0x28371c['push'](_0x28371c['shift']());}catch(_0x8f45a3){_0x28371c['push'](_0x28371c['shift']());}}}(a62_0x5d41,0xd4377));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a62_0x26d84a from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x4c2c52){const _0x543659=a62_0xe240;return{'format':_0x4c2c52['format']||_0x543659(0x128),'output':_0x4c2c52[_0x543659(0x126)]||'','limit':_0x4c2c52[_0x543659(0x156)],'color':_0x4c2c52[_0x543659(0x148)],'noColor':_0x4c2c52[_0x543659(0x12d)]};}function convertSDKResultToQueryResult(_0x2f9a8e){const _0x387b6b=a62_0xe240,_0x5ea16c=[];if(_0x2f9a8e[_0x387b6b(0x141)]>0x0){const _0x3efe8a=_0x2f9a8e[0x0];for(const [_0x5f3b8c,_0x2a59c9]of Object[_0x387b6b(0x11f)](_0x3efe8a)){let _0x52b80f='varchar';if(typeof _0x2a59c9===_0x387b6b(0x158))_0x52b80f=Number['isInteger'](_0x2a59c9)?_0x387b6b(0x150):_0x387b6b(0x136);else{if(typeof _0x2a59c9===_0x387b6b(0x140))_0x52b80f='boolean';else _0x2a59c9===null&&(_0x52b80f=_0x387b6b(0x142));}_0x5ea16c[_0x387b6b(0x154)]({'name':_0x5f3b8c,'type':_0x52b80f});}}return{'queryId':_0x387b6b(0x12c),'columns':_0x5ea16c,'data':_0x2f9a8e,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2f9a8e['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xb9305,_0x20e08c){const _0x39cd1a=convertSDKResultToQueryResult(_0xb9305);return formatQueryOutput(_0x39cd1a,_0x20e08c);}export async function formatQueryOutput(_0x41f972,_0x3e535f){const _0x28cabc=a62_0xe240,{format:_0x4af690,limit:_0x27a118,output:_0x2c413e,color:_0x4ee5b3,noColor:_0x4482e8}=_0x3e535f,_0x276760=Boolean(_0x2c413e)&&!_0x4ee5b3,_0x45f744={'color':_0x4ee5b3,'noColor':_0x4482e8||_0x276760};if(_0x4af690===_0x28cabc(0x128)){const _0x40a642=shouldUseLess(_0x4af690,_0x2c413e);return formatAsTable(_0x41f972,_0x27a118,_0x40a642,_0x45f744);}else{if(_0x4af690===_0x28cabc(0x137))return formatAsJSON(_0x41f972,_0x45f744);else return _0x4af690==='jsonl'?formatAsJSONL(_0x41f972,_0x45f744):formatQueryResult(_0x41f972,_0x4af690);}}function shouldUseLess(_0x24528e,_0x3d2fc7){const _0x7abb6a=a62_0xe240;return _0x24528e==='table'&&process[_0x7abb6a(0x121)][_0x7abb6a(0x152)]&&!_0x3d2fc7;}export function resolveOutputOptions(_0x11a981){const _0x1217f8=a62_0xe240,_0x41af62=resolveOutputFormat(_0x11a981['format'],_0x11a981['output'],_0x1217f8(0x128));let _0x49593d=typeof _0x11a981['limit']===_0x1217f8(0x158)?_0x11a981[_0x1217f8(0x156)]:parseInt(_0x11a981[_0x1217f8(0x156)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2c6d49=_0x11a981[_0x1217f8(0x126)]||'';return shouldUseLess(_0x41af62,_0x2c6d49)&&(_0x49593d=Infinity),{'format':_0x41af62,'output':_0x2c6d49,'limit':_0x49593d,'color':_0x11a981[_0x1217f8(0x148)],'noColor':_0x11a981[_0x1217f8(0x12d)]};}export function writeOutput(_0x3a40a4,_0x2a24d4,_0x293979){const _0x2afadf=a62_0xe240;return _0x2a24d4?(writeFileSync(_0x2a24d4,_0x3a40a4),console[_0x2afadf(0x12b)]('Results\x20saved\x20to\x20'+_0x2a24d4),Promise[_0x2afadf(0x144)]()):shouldUseLess(_0x293979||'','')?new Promise(_0x329d28=>{const _0x35ccdc=_0x2afadf,_0x275018=spawn('less',[_0x35ccdc(0x130)],{'stdio':[_0x35ccdc(0x13d),'inherit',_0x35ccdc(0x13c)]});let _0x2249a9=![];_0x275018['on'](_0x35ccdc(0x12b),()=>{!_0x2249a9&&(_0x2249a9=!![],console['log'](_0x3a40a4),_0x329d28());}),_0x275018['on'](_0x35ccdc(0x14f),()=>{!_0x2249a9&&(_0x2249a9=!![],_0x329d28());}),_0x275018['on']('spawn',()=>{const _0xdae971=_0x35ccdc;!_0x2249a9&&_0x275018['stdin']&&(_0x275018['stdin']['on'](_0xdae971(0x12b),()=>{}),_0x275018['stdin'][_0xdae971(0x123)](_0x3a40a4),_0x275018['stdin']['end']());}),!_0x275018[_0x35ccdc(0x146)]&&(!_0x2249a9&&(_0x2249a9=!![],console[_0x35ccdc(0x14c)](_0x3a40a4),_0x329d28()));}):(console['log'](_0x3a40a4),Promise[_0x2afadf(0x144)]());}export async function handleSDKOutput(_0x4c9d07,_0xe16ba9){const _0x20aeb6=a62_0xe240,_0x3516eb=resolveOutputOptions(_0xe16ba9),_0x10cac2=await formatSDKOutput(_0x4c9d07,_0x3516eb);await writeOutput(_0x10cac2,_0x3516eb[_0x20aeb6(0x126)]||undefined,_0x3516eb[_0x20aeb6(0x11b)]);}export async function handleQueryOutput(_0x146f20,_0x33da9e){const _0x61d7fd=a62_0xe240,_0x24cf97=resolveOutputOptions(_0x33da9e),_0x5b63e3=await formatQueryOutput(_0x146f20,_0x24cf97);await writeOutput(_0x5b63e3,_0x24cf97['output']||undefined,_0x24cf97[_0x61d7fd(0x11b)]);}function a62_0x5d41(){const _0x36454d=['[error]','limit','trim','number','format','stringify','22274989cWTdvm','query','entries','join','stdout','3501dXbBnW','write','red','split','output','774627psDUMw','table','max','string','error','sdk-result','noColor','cmdout','20OJMTAw','-FXRSn','─┴─','21YAjEKM','No\x20data','yellow','stderr','double','json','3597354ZplLwL','15724210epiFgA','map','6824uoBoIY','inherit','pipe','object','1197544CjppOz','boolean','length','varchar','─┬─','resolve','filter','stdin','repeat','color','55446iIMxVk','padEnd','forEach','log','2pJIFRH','bold','close','bigint','debug','isTTY','[Object]','push'];a62_0x5d41=function(){return _0x36454d;};return a62_0x5d41();}async function formatSingleObject(_0x41fd75,_0x5d489d){const _0xc8ef2d=a62_0xe240,{format:_0x45de33,color:_0x5118e6,noColor:_0x5d5a37}=_0x5d489d,_0x30706c={'color':_0x5118e6,'noColor':_0x5d5a37};if(_0x45de33===_0xc8ef2d(0x137)){if(shouldUseColor(_0x30706c))return colorizeJSON(_0x41fd75,_0x30706c);return JSON['stringify'](_0x41fd75,null,0x2);}else{if(_0x45de33==='jsonl'){if(shouldUseColor(_0x30706c))return colorizeJSONCompact(_0x41fd75,_0x30706c);return JSON[_0xc8ef2d(0x11c)](_0x41fd75);}else{if(_0x45de33==='tsv')return Object[_0xc8ef2d(0x11f)](_0x41fd75)['map'](([_0x47233c,_0x23d718])=>_0x47233c+'\x09'+_0x23d718)['join']('\x0a');else{const _0x52b6ec=Object[_0xc8ef2d(0x11f)](_0x41fd75);if(_0x52b6ec[_0xc8ef2d(0x141)]===0x0)return _0xc8ef2d(0x133);const _0x205bbe=_0x41fd75[_0xc8ef2d(0x151)],_0x4fef67=_0x41fd75['query'],_0x5179b8=_0x4fef67?typeof _0x4fef67===_0xc8ef2d(0x12a)?_0x4fef67:JSON[_0xc8ef2d(0x11c)](_0x4fef67,null,0x2):undefined,_0x1ea696=_0x52b6ec[_0xc8ef2d(0x145)](([_0x2fd367])=>_0x2fd367!==_0xc8ef2d(0x151)&&_0x2fd367!==_0xc8ef2d(0x11e)),_0x4479cf=Math[_0xc8ef2d(0x129)](..._0x1ea696['map'](([_0x44dd0a])=>_0x44dd0a[_0xc8ef2d(0x141)])),_0xce6ff9=Math[_0xc8ef2d(0x129)](..._0x1ea696['map'](([,_0x459d91])=>{const _0x18346d=_0xc8ef2d;try{const _0x529d88=_0x459d91===null||_0x459d91===undefined?'':typeof _0x459d91===_0x18346d(0x13e)?JSON['stringify'](_0x459d91):String(_0x459d91),_0x5300b8=_0x529d88['split']('\x0a');return Math[_0x18346d(0x129)](..._0x5300b8[_0x18346d(0x13a)](_0x111847=>_0x111847[_0x18346d(0x141)]),0x0);}catch{return 0x0;}}),0x14),_0x1a8973=[];_0x1a8973['push'](colorBorder('┌─'+'─'[_0xc8ef2d(0x147)](_0x4479cf)+_0xc8ef2d(0x143)+'─'[_0xc8ef2d(0x147)](_0xce6ff9)+'─┐',_0x30706c)),_0x1ea696[_0xc8ef2d(0x14b)](([_0x9f51c,_0x16b31d])=>{const _0x3db151=_0xc8ef2d;let _0x4b40cf;try{_0x4b40cf=_0x16b31d===null||_0x16b31d===undefined?'':typeof _0x16b31d==='object'?JSON[_0x3db151(0x11c)](_0x16b31d):String(_0x16b31d);}catch{_0x4b40cf=_0x3db151(0x153);}const _0x1fc8d7=_0x9f51c[_0x3db151(0x14a)](_0x4479cf),_0x4b6099=_0x4b40cf[_0x3db151(0x125)]('\x0a');_0x4b6099[_0x3db151(0x14b)]((_0x51874d,_0xb62ac1)=>{const _0xbdfcc6=_0x3db151,_0x2f7b0a=colorBorder('│',_0x30706c);_0xb62ac1===0x0?_0x1a8973[_0xbdfcc6(0x154)](_0x2f7b0a+'\x20'+_0x1fc8d7+'\x20'+_0x2f7b0a+'\x20'+_0x51874d[_0xbdfcc6(0x14a)](_0xce6ff9)+'\x20'+_0x2f7b0a):_0x1a8973['push'](_0x2f7b0a+'\x20'+'\x20'[_0xbdfcc6(0x147)](_0x4479cf)+'\x20'+_0x2f7b0a+'\x20'+_0x51874d[_0xbdfcc6(0x14a)](_0xce6ff9)+'\x20'+_0x2f7b0a);});}),_0x1a8973['push'](colorBorder('└─'+'─'[_0xc8ef2d(0x147)](_0x4479cf)+_0xc8ef2d(0x131)+'─'[_0xc8ef2d(0x147)](_0xce6ff9)+'─┘',_0x30706c));_0x5179b8&&(_0x1a8973[_0xc8ef2d(0x154)](''),_0x1a8973[_0xc8ef2d(0x154)](String(a62_0x26d84a[_0xc8ef2d(0x134)][_0xc8ef2d(0x14e)]('[query]'))),_0x1a8973[_0xc8ef2d(0x154)](_0x5179b8));if(_0x205bbe){if(_0x205bbe[_0xc8ef2d(0x135)]){_0x1a8973['push'](''),_0x1a8973[_0xc8ef2d(0x154)](String(a62_0x26d84a[_0xc8ef2d(0x124)]['bold'](_0xc8ef2d(0x155))));const _0x32faee=_0x205bbe['stderr'][_0xc8ef2d(0x125)]('\x0a');_0x32faee[_0xc8ef2d(0x14b)](_0x2a034f=>{const _0x78df79=_0xc8ef2d;_0x2a034f[_0x78df79(0x157)]()&&_0x1a8973['push'](_0x2a034f);});}if(_0x205bbe[_0xc8ef2d(0x12e)]){_0x1a8973[_0xc8ef2d(0x154)](''),_0x1a8973[_0xc8ef2d(0x154)](String(a62_0x26d84a['cyan'][_0xc8ef2d(0x14e)]('[logs]')));const _0x14f689=_0x205bbe[_0xc8ef2d(0x12e)]['split']('\x0a');_0x14f689[_0xc8ef2d(0x14b)](_0x19e1f3=>{const _0x5c17b7=_0xc8ef2d;_0x19e1f3[_0x5c17b7(0x157)]()&&_0x1a8973[_0x5c17b7(0x154)](_0x19e1f3);});}}return _0x1a8973[_0xc8ef2d(0x120)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3e4cfb,_0x550913){const _0x4611f7=resolveOutputOptions(_0x550913),_0xecfb50=await formatSingleObject(_0x3e4cfb,_0x4611f7);await writeOutput(_0xecfb50,_0x4611f7['output']||undefined,_0x4611f7['format']);}
|
|
1
|
+
(function(_0x10a55b,_0x3b9a19){const _0x398da2=a63_0x17f6,_0x31bc08=_0x10a55b();while(!![]){try{const _0x189b12=-parseInt(_0x398da2(0xa9))/0x1+parseInt(_0x398da2(0xa4))/0x2+parseInt(_0x398da2(0x74))/0x3*(parseInt(_0x398da2(0xab))/0x4)+parseInt(_0x398da2(0x9f))/0x5+-parseInt(_0x398da2(0xa8))/0x6*(-parseInt(_0x398da2(0x7e))/0x7)+-parseInt(_0x398da2(0xaf))/0x8*(parseInt(_0x398da2(0xb1))/0x9)+-parseInt(_0x398da2(0x88))/0xa*(parseInt(_0x398da2(0x83))/0xb);if(_0x189b12===_0x3b9a19)break;else _0x31bc08['push'](_0x31bc08['shift']());}catch(_0x2e8bf3){_0x31bc08['push'](_0x31bc08['shift']());}}}(a63_0x1e64,0xe9549));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';function a63_0x1e64(){const _0x3822ef=['3392uRHYgd','debug','2124wNwHNF','forEach','stderr','26934WyomIJ','limit','entries','red','end','stringify','tsv','length','─┬─','output','1691417Cqexyq','format','yellow','noColor','object','11CrHIYi','jsonl','varchar','close','color','14432380wrXpUL','isTTY','trim','join','cmdout','bold','[logs]','stdin','number','bigint','[Object]','pipe','map','FINISHED','repeat','boolean','json','table','write','stdout','-FXRSn','resolve','query','6118245uEXrRz','split','max','push','padEnd','1052596nFxUmQ','inherit','cyan','No\x20data','42PHxNyI','1516933zRApYI','log','256VXhFac','spawn','less','error'];a63_0x1e64=function(){return _0x3822ef;};return a63_0x1e64();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a63_0x24c6aa from'chalk';function a63_0x17f6(_0x5617a2,_0x595595){const _0x1e64b8=a63_0x1e64();return a63_0x17f6=function(_0x17f608,_0x4365e2){_0x17f608=_0x17f608-0x73;let _0x4ccbb6=_0x1e64b8[_0x17f608];return _0x4ccbb6;},a63_0x17f6(_0x5617a2,_0x595595);}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x5684b3){const _0x574a99=a63_0x17f6;return{'format':_0x5684b3['format']||'table','output':_0x5684b3['output']||'','limit':_0x5684b3[_0x574a99(0x75)],'color':_0x5684b3[_0x574a99(0x87)],'noColor':_0x5684b3[_0x574a99(0x81)]};}function convertSDKResultToQueryResult(_0x52c036){const _0xde561f=a63_0x17f6,_0xb40e34=[];if(_0x52c036[_0xde561f(0x7b)]>0x0){const _0x648f56=_0x52c036[0x0];for(const [_0x49df2a,_0x483ff4]of Object[_0xde561f(0x76)](_0x648f56)){let _0x41ffb6='varchar';if(typeof _0x483ff4===_0xde561f(0x90))_0x41ffb6=Number['isInteger'](_0x483ff4)?_0xde561f(0x91):'double';else{if(typeof _0x483ff4==='boolean')_0x41ffb6=_0xde561f(0x97);else _0x483ff4===null&&(_0x41ffb6=_0xde561f(0x85));}_0xb40e34[_0xde561f(0xa2)]({'name':_0x49df2a,'type':_0x41ffb6});}}return{'queryId':'sdk-result','columns':_0xb40e34,'data':_0x52c036,'stats':{'state':_0xde561f(0x95),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x52c036['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1e5cea,_0x5887e5){const _0x1419eb=convertSDKResultToQueryResult(_0x1e5cea);return formatQueryOutput(_0x1419eb,_0x5887e5);}export async function formatQueryOutput(_0x14e90b,_0x3a5c5b){const _0x5e9763=a63_0x17f6,{format:_0x25556d,limit:_0x2edbdf,output:_0x5be10a,color:_0x39784e,noColor:_0x2f0ad6}=_0x3a5c5b,_0x59fcfe=Boolean(_0x5be10a)&&!_0x39784e,_0x587515={'color':_0x39784e,'noColor':_0x2f0ad6||_0x59fcfe};if(_0x25556d==='table'){const _0xd549c6=shouldUseLess(_0x25556d,_0x5be10a);return formatAsTable(_0x14e90b,_0x2edbdf,_0xd549c6,_0x587515);}else{if(_0x25556d===_0x5e9763(0x98))return formatAsJSON(_0x14e90b,_0x587515);else return _0x25556d===_0x5e9763(0x84)?formatAsJSONL(_0x14e90b,_0x587515):formatQueryResult(_0x14e90b,_0x25556d);}}function shouldUseLess(_0x22cc38,_0x230304){const _0x3032b0=a63_0x17f6;return _0x22cc38==='table'&&process[_0x3032b0(0x9b)][_0x3032b0(0x89)]&&!_0x230304;}export function resolveOutputOptions(_0x3f55ad){const _0x4c6168=a63_0x17f6,_0x57ebf7=resolveOutputFormat(_0x3f55ad[_0x4c6168(0x7f)],_0x3f55ad[_0x4c6168(0x7d)],_0x4c6168(0x99));let _0x23eddc=typeof _0x3f55ad['limit']===_0x4c6168(0x90)?_0x3f55ad[_0x4c6168(0x75)]:parseInt(_0x3f55ad['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x10b8ee=_0x3f55ad[_0x4c6168(0x7d)]||'';return shouldUseLess(_0x57ebf7,_0x10b8ee)&&(_0x23eddc=Infinity),{'format':_0x57ebf7,'output':_0x10b8ee,'limit':_0x23eddc,'color':_0x3f55ad[_0x4c6168(0x87)],'noColor':_0x3f55ad[_0x4c6168(0x81)]};}export function writeOutput(_0x45ac27,_0x1402ae,_0x1676d3){const _0x44b76d=a63_0x17f6;return _0x1402ae?(writeFileSync(_0x1402ae,_0x45ac27),console['error']('Results\x20saved\x20to\x20'+_0x1402ae),Promise[_0x44b76d(0x9d)]()):shouldUseLess(_0x1676d3||'','')?new Promise(_0xe68ca4=>{const _0x213261=_0x44b76d,_0x1d4188=spawn(_0x213261(0xad),[_0x213261(0x9c)],{'stdio':[_0x213261(0x93),_0x213261(0xa5),_0x213261(0xa5)]});let _0x17ebec=![];_0x1d4188['on'](_0x213261(0xae),()=>{const _0x51ed74=_0x213261;!_0x17ebec&&(_0x17ebec=!![],console[_0x51ed74(0xaa)](_0x45ac27),_0xe68ca4());}),_0x1d4188['on'](_0x213261(0x86),()=>{!_0x17ebec&&(_0x17ebec=!![],_0xe68ca4());}),_0x1d4188['on'](_0x213261(0xac),()=>{const _0x2434c8=_0x213261;!_0x17ebec&&_0x1d4188[_0x2434c8(0x8f)]&&(_0x1d4188[_0x2434c8(0x8f)]['on'](_0x2434c8(0xae),()=>{}),_0x1d4188['stdin'][_0x2434c8(0x9a)](_0x45ac27),_0x1d4188['stdin'][_0x2434c8(0x78)]());}),!_0x1d4188[_0x213261(0x8f)]&&(!_0x17ebec&&(_0x17ebec=!![],console['log'](_0x45ac27),_0xe68ca4()));}):(console['log'](_0x45ac27),Promise[_0x44b76d(0x9d)]());}export async function handleSDKOutput(_0x5e9145,_0x1df762){const _0x19b46d=a63_0x17f6,_0x38eec6=resolveOutputOptions(_0x1df762),_0x64b85d=await formatSDKOutput(_0x5e9145,_0x38eec6);await writeOutput(_0x64b85d,_0x38eec6[_0x19b46d(0x7d)]||undefined,_0x38eec6[_0x19b46d(0x7f)]);}export async function handleQueryOutput(_0x15c654,_0x20c59e){const _0x1a7978=a63_0x17f6,_0x36cf21=resolveOutputOptions(_0x20c59e),_0x423f5e=await formatQueryOutput(_0x15c654,_0x36cf21);await writeOutput(_0x423f5e,_0x36cf21[_0x1a7978(0x7d)]||undefined,_0x36cf21['format']);}async function formatSingleObject(_0x1d47fb,_0x201324){const _0x1c6ac5=a63_0x17f6,{format:_0x446cbe,color:_0xa7761c,noColor:_0x5e335f}=_0x201324,_0x124e22={'color':_0xa7761c,'noColor':_0x5e335f};if(_0x446cbe===_0x1c6ac5(0x98)){if(shouldUseColor(_0x124e22))return colorizeJSON(_0x1d47fb,_0x124e22);return JSON[_0x1c6ac5(0x79)](_0x1d47fb,null,0x2);}else{if(_0x446cbe===_0x1c6ac5(0x84)){if(shouldUseColor(_0x124e22))return colorizeJSONCompact(_0x1d47fb,_0x124e22);return JSON[_0x1c6ac5(0x79)](_0x1d47fb);}else{if(_0x446cbe===_0x1c6ac5(0x7a))return Object[_0x1c6ac5(0x76)](_0x1d47fb)['map'](([_0x1aa19a,_0x3f8e84])=>_0x1aa19a+'\x09'+_0x3f8e84)[_0x1c6ac5(0x8b)]('\x0a');else{const _0x20be59=Object['entries'](_0x1d47fb);if(_0x20be59[_0x1c6ac5(0x7b)]===0x0)return _0x1c6ac5(0xa7);const _0x39302d=_0x1d47fb[_0x1c6ac5(0xb0)],_0x27f801=_0x1d47fb['query'],_0x2967fc=_0x27f801?typeof _0x27f801==='string'?_0x27f801:JSON[_0x1c6ac5(0x79)](_0x27f801,null,0x2):undefined,_0x1bfe84=_0x20be59['filter'](([_0xf605af])=>_0xf605af!==_0x1c6ac5(0xb0)&&_0xf605af!==_0x1c6ac5(0x9e)),_0x4acbf1=Math[_0x1c6ac5(0xa1)](..._0x1bfe84['map'](([_0x4a5f3f])=>_0x4a5f3f[_0x1c6ac5(0x7b)])),_0x59cc5f=Math[_0x1c6ac5(0xa1)](..._0x1bfe84[_0x1c6ac5(0x94)](([,_0x396dd7])=>{const _0x31ef5b=_0x1c6ac5;try{const _0x57ce66=_0x396dd7===null||_0x396dd7===undefined?'':typeof _0x396dd7==='object'?JSON[_0x31ef5b(0x79)](_0x396dd7):String(_0x396dd7),_0x1382c7=_0x57ce66[_0x31ef5b(0xa0)]('\x0a');return Math[_0x31ef5b(0xa1)](..._0x1382c7['map'](_0x3f5406=>_0x3f5406[_0x31ef5b(0x7b)]),0x0);}catch{return 0x0;}}),0x14),_0x228d4f=[];_0x228d4f[_0x1c6ac5(0xa2)](colorBorder('┌─'+'─'[_0x1c6ac5(0x96)](_0x4acbf1)+_0x1c6ac5(0x7c)+'─'[_0x1c6ac5(0x96)](_0x59cc5f)+'─┐',_0x124e22)),_0x1bfe84[_0x1c6ac5(0xb2)](([_0x5d6a92,_0x2577f9])=>{const _0x3661a0=_0x1c6ac5;let _0x10db13;try{_0x10db13=_0x2577f9===null||_0x2577f9===undefined?'':typeof _0x2577f9===_0x3661a0(0x82)?JSON[_0x3661a0(0x79)](_0x2577f9):String(_0x2577f9);}catch{_0x10db13=_0x3661a0(0x92);}const _0xd518e=_0x5d6a92[_0x3661a0(0xa3)](_0x4acbf1),_0x1b3ff9=_0x10db13['split']('\x0a');_0x1b3ff9['forEach']((_0x66592c,_0x2a6fdc)=>{const _0x50fc4b=_0x3661a0,_0x5323a2=colorBorder('│',_0x124e22);_0x2a6fdc===0x0?_0x228d4f[_0x50fc4b(0xa2)](_0x5323a2+'\x20'+_0xd518e+'\x20'+_0x5323a2+'\x20'+_0x66592c[_0x50fc4b(0xa3)](_0x59cc5f)+'\x20'+_0x5323a2):_0x228d4f[_0x50fc4b(0xa2)](_0x5323a2+'\x20'+'\x20'[_0x50fc4b(0x96)](_0x4acbf1)+'\x20'+_0x5323a2+'\x20'+_0x66592c[_0x50fc4b(0xa3)](_0x59cc5f)+'\x20'+_0x5323a2);});}),_0x228d4f[_0x1c6ac5(0xa2)](colorBorder('└─'+'─'['repeat'](_0x4acbf1)+'─┴─'+'─'[_0x1c6ac5(0x96)](_0x59cc5f)+'─┘',_0x124e22));_0x2967fc&&(_0x228d4f[_0x1c6ac5(0xa2)](''),_0x228d4f[_0x1c6ac5(0xa2)](String(a63_0x24c6aa[_0x1c6ac5(0x80)][_0x1c6ac5(0x8d)]('[query]'))),_0x228d4f[_0x1c6ac5(0xa2)](_0x2967fc));if(_0x39302d){if(_0x39302d[_0x1c6ac5(0x73)]){_0x228d4f[_0x1c6ac5(0xa2)](''),_0x228d4f[_0x1c6ac5(0xa2)](String(a63_0x24c6aa[_0x1c6ac5(0x77)][_0x1c6ac5(0x8d)]('[error]')));const _0x34b7e4=_0x39302d[_0x1c6ac5(0x73)][_0x1c6ac5(0xa0)]('\x0a');_0x34b7e4[_0x1c6ac5(0xb2)](_0x562ac4=>{const _0x7bb798=_0x1c6ac5;_0x562ac4[_0x7bb798(0x8a)]()&&_0x228d4f['push'](_0x562ac4);});}if(_0x39302d[_0x1c6ac5(0x8c)]){_0x228d4f[_0x1c6ac5(0xa2)](''),_0x228d4f[_0x1c6ac5(0xa2)](String(a63_0x24c6aa[_0x1c6ac5(0xa6)][_0x1c6ac5(0x8d)](_0x1c6ac5(0x8e))));const _0x2f1e13=_0x39302d[_0x1c6ac5(0x8c)][_0x1c6ac5(0xa0)]('\x0a');_0x2f1e13['forEach'](_0x498d43=>{const _0x39711a=_0x1c6ac5;_0x498d43[_0x39711a(0x8a)]()&&_0x228d4f[_0x39711a(0xa2)](_0x498d43);});}}return _0x228d4f[_0x1c6ac5(0x8b)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3d0613,_0x5603e5){const _0x30b0fb=a63_0x17f6,_0x310c37=resolveOutputOptions(_0x5603e5),_0x1107e2=await formatSingleObject(_0x3d0613,_0x310c37);await writeOutput(_0x1107e2,_0x310c37[_0x30b0fb(0x7d)]||undefined,_0x310c37[_0x30b0fb(0x7f)]);}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a64_0x58f2(){const _0x46cf11=['210815ShtnkY','507HJGgaI','67771LoGfSN','1099vqYlju','8514syiuuQ','10NsuuZI','5296ZTiGot','1579090cJeKRe','2847447kJrwew','2656752MeuxdY','10JJvNth'];a64_0x58f2=function(){return _0x46cf11;};return a64_0x58f2();}(function(_0x2de52b,_0x264840){const _0x117ca7=a64_0x5e9d,_0x135dde=_0x2de52b();while(!![]){try{const _0x51327c=parseInt(_0x117ca7(0x1b4))/0x1*(parseInt(_0x117ca7(0x1b1))/0x2)+parseInt(_0x117ca7(0x1b3))/0x3*(-parseInt(_0x117ca7(0x1ad))/0x4)+parseInt(_0x117ca7(0x1ae))/0x5+parseInt(_0x117ca7(0x1b6))/0x6*(-parseInt(_0x117ca7(0x1b5))/0x7)+-parseInt(_0x117ca7(0x1b0))/0x8+-parseInt(_0x117ca7(0x1af))/0x9*(-parseInt(_0x117ca7(0x1b7))/0xa)+parseInt(_0x117ca7(0x1b2))/0xb;if(_0x51327c===_0x264840)break;else _0x135dde['push'](_0x135dde['shift']());}catch(_0x4e3b32){_0x135dde['push'](_0x135dde['shift']());}}}(a64_0x58f2,0x33a84));function a64_0x5e9d(_0x1bf779,_0x1a8114){const _0x58f2c3=a64_0x58f2();return a64_0x5e9d=function(_0x5e9d39,_0x1e6ff2){_0x5e9d39=_0x5e9d39-0x1ad;let _0x3c83b8=_0x58f2c3[_0x5e9d39];return _0x3c83b8;},a64_0x5e9d(_0x1bf779,_0x1a8114);}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x325126,_0x4aff05){if(_0x325126===undefined)return _0x4aff05;if(typeof _0x325126==='number')return _0x325126;return parseInt(_0x325126,0xa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38525c,_0x2e35b1){const _0x48a762=a65_0x8e0d,_0x36a9cb=_0x38525c();while(!![]){try{const _0x3c026c=parseInt(_0x48a762(0x146))/0x1+parseInt(_0x48a762(0x13d))/0x2*(parseInt(_0x48a762(0x14b))/0x3)+-parseInt(_0x48a762(0x142))/0x4+parseInt(_0x48a762(0x147))/0x5+parseInt(_0x48a762(0x139))/0x6+-parseInt(_0x48a762(0x144))/0x7+-parseInt(_0x48a762(0x138))/0x8;if(_0x3c026c===_0x2e35b1)break;else _0x36a9cb['push'](_0x36a9cb['shift']());}catch(_0x49a6e1){_0x36a9cb['push'](_0x36a9cb['shift']());}}}(a65_0x24ed,0x7f603));import*as a65_0x3bb68a from'node:fs';function a65_0x24ed(){const _0x539198=['Warning:\x20','existsSync','1574948QuKLoD',').\x20','1536731QYEHfL','mkdirSync','16022tsGaHU','4079530DjBeNJ','chmodSync','warn','statSync','33SFnrVB','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','3407112vwKCsi','4330080qNaXtE','Should\x20be\x200600\x20or\x20more\x20restrictive.','toString','dirname','1324KhNORC','writeFileSync','mode'];a65_0x24ed=function(){return _0x539198;};return a65_0x24ed();}import*as a65_0x26220d from'node:path';export function setSecureFilePermissions(_0x44ce93){const _0x37f8cf=a65_0x8e0d;try{a65_0x3bb68a[_0x37f8cf(0x148)](_0x44ce93,0x180);}catch{console[_0x37f8cf(0x149)](_0x37f8cf(0x137)+_0x44ce93);}}export function setSecureDirectoryPermissions(_0x25c755){const _0x405bbb=a65_0x8e0d;try{a65_0x3bb68a[_0x405bbb(0x148)](_0x25c755,0x1c0);}catch{console['warn'](_0x405bbb(0x137)+_0x25c755);}}export function createSecureDirectory(_0x444e94){const _0x17d619=a65_0x8e0d;!a65_0x3bb68a[_0x17d619(0x141)](_0x444e94)&&(a65_0x3bb68a[_0x17d619(0x145)](_0x444e94,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x444e94));}function a65_0x8e0d(_0x112533,_0x3232c4){const _0x24edcd=a65_0x24ed();return a65_0x8e0d=function(_0x8e0d89,_0x200b97){_0x8e0d89=_0x8e0d89-0x137;let _0x5d9d44=_0x24edcd[_0x8e0d89];return _0x5d9d44;},a65_0x8e0d(_0x112533,_0x3232c4);}export function validateSecureFilePermissions(_0x1bef6c){const _0x583d3f=a65_0x8e0d;try{const _0xa48ae0=a65_0x3bb68a[_0x583d3f(0x14a)](_0x1bef6c),_0x55d532=_0xa48ae0[_0x583d3f(0x13f)]&0x1ff,_0x4980b3=(_0x55d532&0x3f)!==0x0;if(_0x4980b3)return console[_0x583d3f(0x149)](_0x583d3f(0x140)+_0x1bef6c+'\x20has\x20insecure\x20permissions\x20('+_0x55d532[_0x583d3f(0x13b)](0x8)+_0x583d3f(0x143)+_0x583d3f(0x13a)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x49277c,_0x35e52f){const _0x37a263=a65_0x8e0d,_0x223147=a65_0x26220d[_0x37a263(0x13c)](_0x49277c);createSecureDirectory(_0x223147),a65_0x3bb68a[_0x37a263(0x13e)](_0x49277c,_0x35e52f,{'mode':0x180}),setSecureFilePermissions(_0x49277c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a66_0x91a4(_0xfd13ee,_0x3493b5){const _0x185bc1=a66_0x185b();return a66_0x91a4=function(_0x91a42c,_0x5ecdea){_0x91a42c=_0x91a42c-0x17b;let _0xe8682a=_0x185bc1[_0x91a42c];return _0xe8682a;},a66_0x91a4(_0xfd13ee,_0x3493b5);}(function(_0x754760,_0x55465c){const _0x4a0489=a66_0x91a4,_0x50a4a8=_0x754760();while(!![]){try{const _0x389f7c=-parseInt(_0x4a0489(0x181))/0x1*(parseInt(_0x4a0489(0x18b))/0x2)+-parseInt(_0x4a0489(0x184))/0x3*(-parseInt(_0x4a0489(0x17c))/0x4)+-parseInt(_0x4a0489(0x182))/0x5+parseInt(_0x4a0489(0x18a))/0x6+parseInt(_0x4a0489(0x185))/0x7+-parseInt(_0x4a0489(0x187))/0x8*(parseInt(_0x4a0489(0x17d))/0x9)+-parseInt(_0x4a0489(0x189))/0xa;if(_0x389f7c===_0x55465c)break;else _0x50a4a8['push'](_0x50a4a8['shift']());}catch(_0x5c7b6d){_0x50a4a8['push'](_0x50a4a8['shift']());}}}(a66_0x185b,0x4c379));export function detectFormatFromExtension(_0x75c536){const _0x3fcfaa=a66_0x91a4,_0xd2ecb3=_0x75c536['toLowerCase']()[_0x3fcfaa(0x17f)]('.')[_0x3fcfaa(0x17e)]();switch(_0xd2ecb3){case _0x3fcfaa(0x180):return _0x3fcfaa(0x180);case'jsonl':return _0x3fcfaa(0x183);case _0x3fcfaa(0x18c):case _0x3fcfaa(0x17b):return _0x3fcfaa(0x18c);case'txt':case _0x3fcfaa(0x188):return _0x3fcfaa(0x186);default:return undefined;}}function a66_0x185b(){const _0x44d3cd=['347416nmaEnM','text','3718030nLYJPo','3694290WzjOpY','184jMwaQS','tsv','tab','12xUzxnq','36kLTcux','pop','split','json','1657iXkyFh','232955qoenGy','jsonl','25977CaYsSs','2905273GbFRyS','table'];a66_0x185b=function(){return _0x44d3cd;};return a66_0x185b();}export function resolveOutputFormat(_0x4524c3,_0x32c79b,_0x489fe9){if(_0x4524c3)return _0x4524c3;if(_0x32c79b){const _0x4ad0e2=detectFormatFromExtension(_0x32c79b);if(_0x4ad0e2)return _0x4ad0e2;}return _0x489fe9;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x231954,_0x2bf7d5){const _0xe4860=a66_0x5d31,_0x246e9d=_0x231954();while(!![]){try{const _0x405a80=parseInt(_0xe4860(0x21b))/0x1+-parseInt(_0xe4860(0x1f8))/0x2*(parseInt(_0xe4860(0x1ff))/0x3)+-parseInt(_0xe4860(0x20c))/0x4+parseInt(_0xe4860(0x1ef))/0x5*(-parseInt(_0xe4860(0x1f3))/0x6)+-parseInt(_0xe4860(0x20b))/0x7+parseInt(_0xe4860(0x217))/0x8*(-parseInt(_0xe4860(0x215))/0x9)+parseInt(_0xe4860(0x1ed))/0xa;if(_0x405a80===_0x2bf7d5)break;else _0x246e9d['push'](_0x246e9d['shift']());}catch(_0x476d49){_0x246e9d['push'](_0x246e9d['shift']());}}}(a66_0x5954,0x9df22));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';function a66_0x5954(){const _0x25163f=['toISOString','name','data','No\x20rows\x20returned','4yzXmTf','forEach','slice','row','\x20rows\x20(','int','length','1432536RuvfwW','pow','columns','join','replace','entries','min','floor','max','\x20shown)','bool','tsv','7265965POGzjq','3115104LfqITu','number','long','object','padEnd','date','repeat','push','\x20row','333kAekWv','string','23944WQFbMx','log','boolean','table','610995KNdymM','json','true','type','test','map','double','reduce','array','timestamp','stdout','29537880FgiZlO','stringify','58835cYANNN','false','startsWith','toFixed','18vZlnGc'];a66_0x5954=function(){return _0x25163f;};return a66_0x5954();}import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x3a6058=a66_0x5d31;return process[_0x3a6058(0x1ec)][_0x3a6058(0x201)]||Infinity;}export function formatAsTable(_0x51604f,_0x207ba3=DEFAULT_MAX_DISPLAY_ROWS,_0x520586=![],_0x40fc35={}){const _0x57a501=a66_0x5d31;if(_0x51604f[_0x57a501(0x1f6)][_0x57a501(0x1fe)]===0x0)return _0x57a501(0x1f7);const _0x452949=_0x51604f[_0x57a501(0x201)][_0x57a501(0x1e7)](_0x185d16=>_0x185d16['name']),_0x5ec96e=_0x51604f[_0x57a501(0x201)][_0x57a501(0x1e7)](_0x5be26b=>simplifyType(_0x5be26b[_0x57a501(0x1e5)])),_0x38f62b=_0x51604f[_0x57a501(0x1f6)][_0x57a501(0x1fa)](0x0,_0x207ba3),_0x361a20=_0x51604f[_0x57a501(0x1f6)][_0x57a501(0x1fe)],_0x2940b4=_0x361a20>_0x207ba3,_0x44505e=[],_0x3e5640=getTerminalWidth(),_0x1a71c9=_0x3e5640!==Infinity,_0x2d4733=0x32;let _0x474df5=_0x452949[_0x57a501(0x1e7)]((_0x4bebb3,_0x6831d2)=>{const _0x3211f7=_0x57a501,_0x572ae3=stringWidth(_0x5ec96e[_0x6831d2]),_0x4aca8c=Math[_0x3211f7(0x207)](..._0x38f62b[_0x3211f7(0x1e7)](_0xef8245=>{const _0x274136=_0xef8245[_0x4bebb3];return stringWidth(formatValue(_0x274136));})),_0x2f8ec0=Math['max'](stringWidth(_0x4bebb3),_0x572ae3,_0x4aca8c);return _0x520586?_0x2f8ec0:Math[_0x3211f7(0x205)](_0x2f8ec0,_0x2d4733);});if(_0x1a71c9&&!_0x520586&&_0x452949[_0x57a501(0x1fe)]>0x0){const _0x548f9f=_0x4ad0e=>{let _0x5b6d27=0x1;for(const _0x3d2a49 of _0x4ad0e){_0x5b6d27+=_0x3d2a49+0x3;}return _0x5b6d27+0x1;};let _0x1075ba=_0x548f9f(_0x474df5);if(_0x1075ba>_0x3e5640){const _0x1ecf70=0x3;for(let _0x7493af=_0x474df5[_0x57a501(0x1fe)]-0x1;_0x7493af>=0x0;_0x7493af--){_0x1075ba=_0x548f9f(_0x474df5);if(_0x1075ba<=_0x3e5640)break;const _0x1c5c34=_0x474df5[_0x7493af],_0x31771a=_0x1075ba-_0x3e5640,_0x377100=_0x1c5c34-_0x1ecf70,_0xa78c5c=Math[_0x57a501(0x205)](_0x31771a,_0x377100);_0xa78c5c>0x0&&(_0x474df5[_0x7493af]=_0x1c5c34-_0xa78c5c);}}}const _0x1d1cd1=_0x452949,_0x46b488=_0x5ec96e,_0xe4d4fc=_0x474df5,_0x4edcc3=_0x474df5;_0x44505e['push'](colorBorder('┌'+_0x4edcc3[_0x57a501(0x1e7)](_0x12c511=>'─'[_0x57a501(0x212)](_0x12c511+0x2))[_0x57a501(0x202)]('┬')+'┐',_0x40fc35));const _0x525334=_0x1d1cd1[_0x57a501(0x1e7)]((_0x4fbcdf,_0xcf1174)=>centerAlign(_0x4fbcdf,_0xe4d4fc[_0xcf1174]));_0x44505e[_0x57a501(0x213)](colorBorder('│',_0x40fc35)+'\x20'+_0x525334['join']('\x20'+colorBorder('│',_0x40fc35)+'\x20')+'\x20'+colorBorder('│',_0x40fc35));const _0x363e9b=_0x46b488[_0x57a501(0x1e7)]((_0x593656,_0x51132e)=>colorType(centerAlign(_0x593656,_0xe4d4fc[_0x51132e]),_0x40fc35));_0x44505e[_0x57a501(0x213)](colorBorder('│',_0x40fc35)+'\x20'+_0x363e9b[_0x57a501(0x202)]('\x20'+colorBorder('│',_0x40fc35)+'\x20')+'\x20'+colorBorder('│',_0x40fc35)),_0x44505e['push'](colorBorder('├'+_0x4edcc3[_0x57a501(0x1e7)](_0x3ce3be=>'─'['repeat'](_0x3ce3be+0x2))[_0x57a501(0x202)]('┼')+'┤',_0x40fc35));const _0x5b3f6c=(_0x56c2bf,_0x49b899)=>{const _0x51162e=_0x57a501,_0x109286=stringWidth(_0x56c2bf);if(_0x109286<=_0x49b899)return _0x56c2bf;let _0x19e7fe=_0x56c2bf;while(stringWidth(_0x19e7fe+'…')>_0x49b899&&_0x19e7fe[_0x51162e(0x1fe)]>0x0){_0x19e7fe=_0x19e7fe['slice'](0x0,-0x1);}return _0x19e7fe+'…';};_0x38f62b[_0x57a501(0x1f9)](_0x6fca3e=>{const _0x18fccb=_0x57a501,_0x1022cf=_0x452949[_0x18fccb(0x1e7)]((_0x53a6f0,_0x5a4200)=>{const _0x17d478=_0x18fccb,_0x5f32a4=_0x6fca3e[_0x53a6f0],_0x389f45=formatValue(_0x5f32a4),_0x4d773e=_0xe4d4fc[_0x5a4200],_0x1186e2=_0x5b3f6c(_0x389f45,_0x4d773e),_0x5262a6=typeof _0x5f32a4==='number'||typeof _0x5f32a4===_0x17d478(0x216)&&/^-?\d+$/[_0x17d478(0x1e6)](_0x5f32a4);return _0x5262a6?padStart(_0x1186e2,_0x4d773e):padEnd(_0x1186e2,_0x4d773e);});_0x44505e['push'](colorBorder('│',_0x40fc35)+'\x20'+_0x1022cf[_0x18fccb(0x202)]('\x20'+colorBorder('│',_0x40fc35)+'\x20')+'\x20'+colorBorder('│',_0x40fc35));});const _0x42a806=_0x4edcc3[_0x57a501(0x1e9)]((_0x1f54a1,_0x48eb72)=>_0x1f54a1+_0x48eb72+0x3,-0x1);_0x44505e[_0x57a501(0x213)](colorBorder('├'+_0x4edcc3['map'](_0x55b939=>'─'[_0x57a501(0x212)](_0x55b939+0x2))[_0x57a501(0x202)]('┴')+'┤',_0x40fc35));let _0x78b5c7;_0x2940b4?_0x78b5c7=_0x361a20+_0x57a501(0x1fc)+_0x207ba3+_0x57a501(0x208):_0x78b5c7=_0x361a20+_0x57a501(0x214)+(_0x361a20===0x1?'':'s');const _0x24bba7=_0x78b5c7[_0x57a501(0x210)](_0x42a806-0x2);return _0x44505e[_0x57a501(0x213)](colorBorder('│',_0x40fc35)+'\x20'+_0x24bba7+'\x20'+colorBorder('│',_0x40fc35)),_0x44505e[_0x57a501(0x213)](colorBorder('└'+'─'['repeat'](_0x42a806)+'┘',_0x40fc35)),_0x44505e[_0x57a501(0x202)]('\x0a');}function simplifyType(_0x5484ad){const _0x220887=a66_0x5d31,_0x55ec1a={'varchar':'string','bigint':_0x220887(0x20e),'integer':_0x220887(0x1fd),'double':_0x220887(0x1e8),'boolean':_0x220887(0x209),'date':_0x220887(0x211),'timestamp':_0x220887(0x1eb),'array':_0x220887(0x1ea),'map':_0x220887(0x1e7),'row':_0x220887(0x1fb)},_0x472c43=_0x5484ad['toLowerCase']();for(const [_0x283da7,_0x15c42a]of Object[_0x220887(0x204)](_0x55ec1a)){if(_0x472c43[_0x220887(0x1f1)](_0x283da7))return _0x15c42a;}return _0x5484ad[_0x220887(0x1fe)]>0xa?_0x5484ad['substring'](0x0,0xa):_0x5484ad;}export function formatAsJSON(_0x59fef2,_0x44fe7b={}){const _0x3f8fe8=a66_0x5d31;if(_0x59fef2[_0x3f8fe8(0x1f6)][_0x3f8fe8(0x1fe)]===0x0)return'[]';if(shouldUseColor(_0x44fe7b))return colorizeJSON(_0x59fef2[_0x3f8fe8(0x1f6)],_0x44fe7b);const _0x130dd1=_0x59fef2[_0x3f8fe8(0x1f6)]['map'](_0x37084a=>'\x20\x20'+JSON[_0x3f8fe8(0x1ee)](_0x37084a));return'[\x0a'+_0x130dd1['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x119654,_0x4f1b46={}){const _0x503a2c=a66_0x5d31;if(_0x119654['data'][_0x503a2c(0x1fe)]===0x0)return'';if(shouldUseColor(_0x4f1b46))return _0x119654[_0x503a2c(0x1f6)][_0x503a2c(0x1e7)](_0x2afdda=>colorizeJSONCompact(_0x2afdda,_0x4f1b46))[_0x503a2c(0x202)]('\x0a');return _0x119654[_0x503a2c(0x1f6)]['map'](_0x260bc8=>JSON[_0x503a2c(0x1ee)](_0x260bc8))[_0x503a2c(0x202)]('\x0a');}export function formatAsTSV(_0x2ef50c){const _0x44000d=a66_0x5d31;if(_0x2ef50c[_0x44000d(0x1f6)][_0x44000d(0x1fe)]===0x0)return'';const _0x571d1a=[],_0xae3f29=_0x2ef50c[_0x44000d(0x201)]['map'](_0x1dc88f=>_0x1dc88f[_0x44000d(0x1f5)]);return _0x571d1a['push'](_0xae3f29['join']('\x09')),_0x2ef50c['data'][_0x44000d(0x1f9)](_0x54d5c4=>{const _0x255a40=_0x44000d,_0x11ee0f=_0xae3f29[_0x255a40(0x1e7)](_0x3e8209=>{const _0x29053a=_0x54d5c4[_0x3e8209];return formatValueForTSV(_0x29053a);});_0x571d1a[_0x255a40(0x213)](_0x11ee0f[_0x255a40(0x202)]('\x09'));}),_0x571d1a['join']('\x0a');}function formatValue(_0x152ce5){const _0x2584ed=a66_0x5d31;if(_0x152ce5===null||_0x152ce5===undefined)return'';if(typeof _0x152ce5==='string'){const _0x2da053=_0x152ce5['replace'](/\n/g,'\x5cn')[_0x2584ed(0x203)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x2da053;}if(typeof _0x152ce5===_0x2584ed(0x20d))return String(_0x152ce5);if(typeof _0x152ce5===_0x2584ed(0x219))return _0x152ce5?_0x2584ed(0x1e4):_0x2584ed(0x1f0);if(_0x152ce5 instanceof Date)return _0x152ce5[_0x2584ed(0x1f4)]();if(typeof _0x152ce5===_0x2584ed(0x20f))return JSON[_0x2584ed(0x1ee)](_0x152ce5);return String(_0x152ce5);}function formatValueForTSV(_0x2c6970){const _0x1e27c1=a66_0x5d31;if(_0x2c6970===null||_0x2c6970===undefined)return'';if(typeof _0x2c6970===_0x1e27c1(0x216))return _0x2c6970['replace'](/\t/g,'\x5ct')[_0x1e27c1(0x203)](/\n/g,'\x5cn');if(typeof _0x2c6970===_0x1e27c1(0x20d)||typeof _0x2c6970===_0x1e27c1(0x219))return String(_0x2c6970);if(_0x2c6970 instanceof Date)return _0x2c6970[_0x1e27c1(0x1f4)]();if(typeof _0x2c6970===_0x1e27c1(0x20f))return JSON[_0x1e27c1(0x1ee)](_0x2c6970);return String(_0x2c6970);}export function formatQueryResult(_0x923af5,_0x313956){const _0x3ea568=a66_0x5d31;switch(_0x313956){case _0x3ea568(0x21a):return formatAsTable(_0x923af5);case _0x3ea568(0x21c):return formatAsJSON(_0x923af5);case'jsonl':return formatAsJSONL(_0x923af5);case _0x3ea568(0x20a):return formatAsTSV(_0x923af5);default:return formatAsJSON(_0x923af5);}}function a66_0x5d31(_0x43b018,_0x1ad9f0){const _0x5954dc=a66_0x5954();return a66_0x5d31=function(_0x5d3195,_0x45d581){_0x5d3195=_0x5d3195-0x1e4;let _0x5e03f3=_0x5954dc[_0x5d3195];return _0x5e03f3;},a66_0x5d31(_0x43b018,_0x1ad9f0);}export function formatBytes(_0x1bb0d1){const _0x187366=a66_0x5d31;if(_0x1bb0d1===0x0)return'0\x20B';const _0x19a0e3=['B','KB','MB','GB','TB'],_0x19d308=0x400,_0x4505d1=Math[_0x187366(0x206)](Math[_0x187366(0x218)](_0x1bb0d1)/Math[_0x187366(0x218)](_0x19d308)),_0x8cd301=_0x1bb0d1/Math[_0x187366(0x200)](_0x19d308,_0x4505d1),_0x579504=_0x8cd301>=0xa?0x1:0x2;return _0x8cd301[_0x187366(0x1f2)](_0x579504)+'\x20'+_0x19a0e3[_0x4505d1];}export function formatRows(_0x42d93a){const _0x2af704=a66_0x5d31;if(_0x42d93a==null)return'-';if(_0x42d93a===0x0)return'0';if(_0x42d93a<0x3e8)return _0x42d93a['toString']();const _0x365ccf=['','K','M','B','T'],_0x2e8ea3=0x3e8,_0xf322a9=Math[_0x2af704(0x206)](Math['log'](_0x42d93a)/Math[_0x2af704(0x218)](_0x2e8ea3)),_0x3d0390=_0x42d93a/Math[_0x2af704(0x200)](_0x2e8ea3,_0xf322a9),_0x278e5b=_0x3d0390>=0xa?0x1:0x2;return''+_0x3d0390[_0x2af704(0x1f2)](_0x278e5b)+_0x365ccf[_0xf322a9];}
|
|
1
|
+
(function(_0x29358b,_0x213443){const _0x107951=a67_0x195e,_0x37e849=_0x29358b();while(!![]){try{const _0x3a0079=parseInt(_0x107951(0x128))/0x1*(-parseInt(_0x107951(0x122))/0x2)+-parseInt(_0x107951(0x13a))/0x3+-parseInt(_0x107951(0x125))/0x4*(parseInt(_0x107951(0x11a))/0x5)+parseInt(_0x107951(0x138))/0x6+parseInt(_0x107951(0x140))/0x7*(-parseInt(_0x107951(0x13f))/0x8)+parseInt(_0x107951(0x11e))/0x9+parseInt(_0x107951(0x147))/0xa*(parseInt(_0x107951(0x121))/0xb);if(_0x3a0079===_0x213443)break;else _0x37e849['push'](_0x37e849['shift']());}catch(_0x26a1d3){_0x37e849['push'](_0x37e849['shift']());}}}(a67_0x1967,0xe6b23));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x2230e9=a67_0x195e;return process[_0x2230e9(0x11b)][_0x2230e9(0x137)]||Infinity;}export function formatAsTable(_0x21b653,_0x21f301=DEFAULT_MAX_DISPLAY_ROWS,_0x1653f2=![],_0x16298d={}){const _0x9db125=a67_0x195e;if(_0x21b653[_0x9db125(0x127)][_0x9db125(0x135)]===0x0)return _0x9db125(0x132);const _0x281bd9=_0x21b653[_0x9db125(0x137)][_0x9db125(0x123)](_0x2c57d3=>_0x2c57d3['name']),_0x1d5103=_0x21b653[_0x9db125(0x137)][_0x9db125(0x123)](_0x4d3f6b=>simplifyType(_0x4d3f6b[_0x9db125(0x119)])),_0x57b81e=_0x21b653[_0x9db125(0x127)][_0x9db125(0x13d)](0x0,_0x21f301),_0x297cfc=_0x21b653[_0x9db125(0x127)][_0x9db125(0x135)],_0x57d60c=_0x297cfc>_0x21f301,_0x36f6ec=[],_0x57d2a5=getTerminalWidth(),_0x236d34=_0x57d2a5!==Infinity,_0x2ad578=0x32;let _0x3dd988=_0x281bd9['map']((_0x132364,_0x2edca6)=>{const _0x38a7c1=_0x9db125,_0x48ba28=stringWidth(_0x1d5103[_0x2edca6]),_0x562d2b=Math[_0x38a7c1(0x134)](..._0x57b81e[_0x38a7c1(0x123)](_0x433b5a=>{const _0x59b63e=_0x433b5a[_0x132364];return stringWidth(formatValue(_0x59b63e));})),_0x409d20=Math[_0x38a7c1(0x134)](stringWidth(_0x132364),_0x48ba28,_0x562d2b);return _0x1653f2?_0x409d20:Math[_0x38a7c1(0x13e)](_0x409d20,_0x2ad578);});if(_0x236d34&&!_0x1653f2&&_0x281bd9[_0x9db125(0x135)]>0x0){const _0x4f5823=_0x1daa51=>{let _0x59a1c4=0x1;for(const _0xbf61b3 of _0x1daa51){_0x59a1c4+=_0xbf61b3+0x3;}return _0x59a1c4+0x1;};let _0x4738ba=_0x4f5823(_0x3dd988);if(_0x4738ba>_0x57d2a5){const _0x32d2ec=0x3;for(let _0x20d3bb=_0x3dd988[_0x9db125(0x135)]-0x1;_0x20d3bb>=0x0;_0x20d3bb--){_0x4738ba=_0x4f5823(_0x3dd988);if(_0x4738ba<=_0x57d2a5)break;const _0x15f3ca=_0x3dd988[_0x20d3bb],_0x52a56f=_0x4738ba-_0x57d2a5,_0x1bb821=_0x15f3ca-_0x32d2ec,_0x1ed909=Math[_0x9db125(0x13e)](_0x52a56f,_0x1bb821);_0x1ed909>0x0&&(_0x3dd988[_0x20d3bb]=_0x15f3ca-_0x1ed909);}}}const _0x5064db=_0x281bd9,_0x558a80=_0x1d5103,_0x1ca00e=_0x3dd988,_0x5c74aa=_0x3dd988;_0x36f6ec[_0x9db125(0x13b)](colorBorder('┌'+_0x5c74aa[_0x9db125(0x123)](_0x374f4b=>'─'[_0x9db125(0x11d)](_0x374f4b+0x2))[_0x9db125(0x12a)]('┬')+'┐',_0x16298d));const _0x4dda3d=_0x5064db[_0x9db125(0x123)]((_0x1157de,_0x5eb65e)=>centerAlign(_0x1157de,_0x1ca00e[_0x5eb65e]));_0x36f6ec[_0x9db125(0x13b)](colorBorder('│',_0x16298d)+'\x20'+_0x4dda3d['join']('\x20'+colorBorder('│',_0x16298d)+'\x20')+'\x20'+colorBorder('│',_0x16298d));const _0x3b313b=_0x558a80[_0x9db125(0x123)]((_0x20b869,_0x21432b)=>colorType(centerAlign(_0x20b869,_0x1ca00e[_0x21432b]),_0x16298d));_0x36f6ec['push'](colorBorder('│',_0x16298d)+'\x20'+_0x3b313b[_0x9db125(0x12a)]('\x20'+colorBorder('│',_0x16298d)+'\x20')+'\x20'+colorBorder('│',_0x16298d)),_0x36f6ec[_0x9db125(0x13b)](colorBorder('├'+_0x5c74aa[_0x9db125(0x123)](_0x39a9a7=>'─'['repeat'](_0x39a9a7+0x2))[_0x9db125(0x12a)]('┼')+'┤',_0x16298d));const _0x1e61e8=(_0x4b4f93,_0x43536a)=>{const _0x6ab6bc=_0x9db125,_0x1dbbca=stringWidth(_0x4b4f93);if(_0x1dbbca<=_0x43536a)return _0x4b4f93;let _0x351de7=_0x4b4f93;while(stringWidth(_0x351de7+'…')>_0x43536a&&_0x351de7[_0x6ab6bc(0x135)]>0x0){_0x351de7=_0x351de7[_0x6ab6bc(0x13d)](0x0,-0x1);}return _0x351de7+'…';};_0x57b81e[_0x9db125(0x11c)](_0x3b194b=>{const _0x110fb1=_0x9db125,_0x362656=_0x281bd9[_0x110fb1(0x123)]((_0xe3d9ea,_0x462760)=>{const _0x40243b=_0x110fb1,_0x1b5b20=_0x3b194b[_0xe3d9ea],_0x239f77=formatValue(_0x1b5b20),_0x2aff7a=_0x1ca00e[_0x462760],_0x2fc9fa=_0x1e61e8(_0x239f77,_0x2aff7a),_0x67d328=typeof _0x1b5b20==='number'||typeof _0x1b5b20===_0x40243b(0x12e)&&/^-?\d+$/[_0x40243b(0x126)](_0x1b5b20);return _0x67d328?padStart(_0x2fc9fa,_0x2aff7a):padEnd(_0x2fc9fa,_0x2aff7a);});_0x36f6ec[_0x110fb1(0x13b)](colorBorder('│',_0x16298d)+'\x20'+_0x362656[_0x110fb1(0x12a)]('\x20'+colorBorder('│',_0x16298d)+'\x20')+'\x20'+colorBorder('│',_0x16298d));});const _0x3ef70b=_0x5c74aa['reduce']((_0x22ad10,_0x2366dc)=>_0x22ad10+_0x2366dc+0x3,-0x1);_0x36f6ec[_0x9db125(0x13b)](colorBorder('├'+_0x5c74aa[_0x9db125(0x123)](_0x2c34d9=>'─'['repeat'](_0x2c34d9+0x2))['join']('┴')+'┤',_0x16298d));let _0x1d4aa5;_0x57d60c?_0x1d4aa5=_0x297cfc+'\x20rows\x20('+_0x21f301+_0x9db125(0x142):_0x1d4aa5=_0x297cfc+_0x9db125(0x133)+(_0x297cfc===0x1?'':'s');const _0x32484f=_0x1d4aa5['padEnd'](_0x3ef70b-0x2);return _0x36f6ec['push'](colorBorder('│',_0x16298d)+'\x20'+_0x32484f+'\x20'+colorBorder('│',_0x16298d)),_0x36f6ec[_0x9db125(0x13b)](colorBorder('└'+'─'[_0x9db125(0x11d)](_0x3ef70b)+'┘',_0x16298d)),_0x36f6ec[_0x9db125(0x12a)]('\x0a');}function a67_0x1967(){const _0xe9f8bc=['1243891CTUpaF','2NLHswV','map','table','45676UEUHxm','test','data','306363aDDMvW','object','join','date','entries','stringify','string','toFixed','tsv','double','No\x20rows\x20returned','\x20row','max','length','bool','columns','1708860hAtwPV','boolean','3918150UzZGdP','push','toISOString','slice','min','573272dkNukg','133ejhjCN','toString','\x20shown)','log','pow','floor','json','350jmKHec','0\x20B','jsonl','type','355fkXsxD','stdout','forEach','repeat','4382721pDWqXZ','replace','number'];a67_0x1967=function(){return _0xe9f8bc;};return a67_0x1967();}function simplifyType(_0x5703c2){const _0x1c48ac=a67_0x195e,_0x57cb62={'varchar':_0x1c48ac(0x12e),'bigint':'long','integer':'int','double':_0x1c48ac(0x131),'boolean':_0x1c48ac(0x136),'date':_0x1c48ac(0x12b),'timestamp':'timestamp','array':'array','map':_0x1c48ac(0x123),'row':'row'},_0x40b4b3=_0x5703c2['toLowerCase']();for(const [_0x52b669,_0x276844]of Object[_0x1c48ac(0x12c)](_0x57cb62)){if(_0x40b4b3['startsWith'](_0x52b669))return _0x276844;}return _0x5703c2[_0x1c48ac(0x135)]>0xa?_0x5703c2['substring'](0x0,0xa):_0x5703c2;}export function formatAsJSON(_0x2cbe32,_0x2029b2={}){const _0x29b7f6=a67_0x195e;if(_0x2cbe32['data'][_0x29b7f6(0x135)]===0x0)return'[]';if(shouldUseColor(_0x2029b2))return colorizeJSON(_0x2cbe32[_0x29b7f6(0x127)],_0x2029b2);const _0x4eefa7=_0x2cbe32[_0x29b7f6(0x127)][_0x29b7f6(0x123)](_0x2d87c1=>'\x20\x20'+JSON['stringify'](_0x2d87c1));return'[\x0a'+_0x4eefa7[_0x29b7f6(0x12a)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x28ea60,_0xa1e9f1={}){const _0x40e382=a67_0x195e;if(_0x28ea60[_0x40e382(0x127)][_0x40e382(0x135)]===0x0)return'';if(shouldUseColor(_0xa1e9f1))return _0x28ea60[_0x40e382(0x127)]['map'](_0x46ef67=>colorizeJSONCompact(_0x46ef67,_0xa1e9f1))[_0x40e382(0x12a)]('\x0a');return _0x28ea60[_0x40e382(0x127)][_0x40e382(0x123)](_0x5d57fc=>JSON['stringify'](_0x5d57fc))[_0x40e382(0x12a)]('\x0a');}export function formatAsTSV(_0x4b9a4d){const _0x5d95f0=a67_0x195e;if(_0x4b9a4d[_0x5d95f0(0x127)][_0x5d95f0(0x135)]===0x0)return'';const _0x2dccb0=[],_0x43cedb=_0x4b9a4d[_0x5d95f0(0x137)][_0x5d95f0(0x123)](_0x3bf252=>_0x3bf252['name']);return _0x2dccb0['push'](_0x43cedb['join']('\x09')),_0x4b9a4d[_0x5d95f0(0x127)][_0x5d95f0(0x11c)](_0x55116e=>{const _0x5def51=_0x5d95f0,_0x4a646e=_0x43cedb[_0x5def51(0x123)](_0x428afe=>{const _0xfb4dfc=_0x55116e[_0x428afe];return formatValueForTSV(_0xfb4dfc);});_0x2dccb0[_0x5def51(0x13b)](_0x4a646e[_0x5def51(0x12a)]('\x09'));}),_0x2dccb0['join']('\x0a');}function formatValue(_0xe651d){const _0x3f7503=a67_0x195e;if(_0xe651d===null||_0xe651d===undefined)return'';if(typeof _0xe651d==='string'){const _0x2c8469=_0xe651d[_0x3f7503(0x11f)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')[_0x3f7503(0x11f)](/\t/g,'\x5ct');return _0x2c8469;}if(typeof _0xe651d===_0x3f7503(0x120))return String(_0xe651d);if(typeof _0xe651d===_0x3f7503(0x139))return _0xe651d?'true':'false';if(_0xe651d instanceof Date)return _0xe651d[_0x3f7503(0x13c)]();if(typeof _0xe651d===_0x3f7503(0x129))return JSON[_0x3f7503(0x12d)](_0xe651d);return String(_0xe651d);}function a67_0x195e(_0x59c095,_0x31370c){const _0x196797=a67_0x1967();return a67_0x195e=function(_0x195e2f,_0x544e90){_0x195e2f=_0x195e2f-0x118;let _0xaa6037=_0x196797[_0x195e2f];return _0xaa6037;},a67_0x195e(_0x59c095,_0x31370c);}function formatValueForTSV(_0x10e1ff){const _0x58cd62=a67_0x195e;if(_0x10e1ff===null||_0x10e1ff===undefined)return'';if(typeof _0x10e1ff===_0x58cd62(0x12e))return _0x10e1ff[_0x58cd62(0x11f)](/\t/g,'\x5ct')[_0x58cd62(0x11f)](/\n/g,'\x5cn');if(typeof _0x10e1ff===_0x58cd62(0x120)||typeof _0x10e1ff==='boolean')return String(_0x10e1ff);if(_0x10e1ff instanceof Date)return _0x10e1ff[_0x58cd62(0x13c)]();if(typeof _0x10e1ff===_0x58cd62(0x129))return JSON[_0x58cd62(0x12d)](_0x10e1ff);return String(_0x10e1ff);}export function formatQueryResult(_0x2db357,_0x64803d){const _0x2a6118=a67_0x195e;switch(_0x64803d){case _0x2a6118(0x124):return formatAsTable(_0x2db357);case _0x2a6118(0x146):return formatAsJSON(_0x2db357);case _0x2a6118(0x118):return formatAsJSONL(_0x2db357);case _0x2a6118(0x130):return formatAsTSV(_0x2db357);default:return formatAsJSON(_0x2db357);}}export function formatBytes(_0x3a544c){const _0xe9770e=a67_0x195e;if(_0x3a544c===0x0)return _0xe9770e(0x148);const _0x4b5df3=['B','KB','MB','GB','TB'],_0x2dbd3e=0x400,_0x159662=Math[_0xe9770e(0x145)](Math['log'](_0x3a544c)/Math['log'](_0x2dbd3e)),_0xb5cbcf=_0x3a544c/Math['pow'](_0x2dbd3e,_0x159662),_0x27a5c9=_0xb5cbcf>=0xa?0x1:0x2;return _0xb5cbcf[_0xe9770e(0x12f)](_0x27a5c9)+'\x20'+_0x4b5df3[_0x159662];}export function formatRows(_0x1ba04a){const _0x24e76=a67_0x195e;if(_0x1ba04a==null)return'-';if(_0x1ba04a===0x0)return'0';if(_0x1ba04a<0x3e8)return _0x1ba04a[_0x24e76(0x141)]();const _0x5e0b38=['','K','M','B','T'],_0x45fc36=0x3e8,_0x227485=Math['floor'](Math[_0x24e76(0x143)](_0x1ba04a)/Math['log'](_0x45fc36)),_0x19eb2b=_0x1ba04a/Math[_0x24e76(0x144)](_0x45fc36,_0x227485),_0x317f22=_0x19eb2b>=0xa?0x1:0x2;return''+_0x19eb2b[_0x24e76(0x12f)](_0x317f22)+_0x5e0b38[_0x227485];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5f2c20,_0x3d9072){const _0x29aa77=a68_0x4963,_0x389749=_0x5f2c20();while(!![]){try{const _0x1ffe78=parseInt(_0x29aa77(0x161))/0x1+-parseInt(_0x29aa77(0x158))/0x2+-parseInt(_0x29aa77(0x163))/0x3+parseInt(_0x29aa77(0x160))/0x4*(-parseInt(_0x29aa77(0x153))/0x5)+-parseInt(_0x29aa77(0x15a))/0x6+parseInt(_0x29aa77(0x156))/0x7*(-parseInt(_0x29aa77(0x167))/0x8)+parseInt(_0x29aa77(0x152))/0x9*(parseInt(_0x29aa77(0x15e))/0xa);if(_0x1ffe78===_0x3d9072)break;else _0x389749['push'](_0x389749['shift']());}catch(_0xa151a8){_0x389749['push'](_0x389749['shift']());}}}(a68_0x1163,0x75dd4));import{readFile}from'fs/promises';function a68_0x1163(){const _0x5dbabd=['220hoUGwC','code','56JUvVgY','610769xJRYlf','Failed\x20to\x20load\x20JSON:\x20','2297817WDyyrL','Invalid\x20JSON\x20in\x20file\x20\x27','EACCES','Permission\x20denied\x20reading\x20file:\x20','296LXiqFq','message','1256238qZmIpJ','86285yNfVUw','INTERNAL','File\x20not\x20found:\x20','172662ysHMNh','parse','1405744kyXlCc','Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','3454500fZYgmt','Invalid\x20JSON\x20string:\x20','PERMISSION_DENIED','INVALID_ARGUMENT'];a68_0x1163=function(){return _0x5dbabd;};return a68_0x1163();}function a68_0x4963(_0x71b0b2,_0x4904a6){const _0x1163d2=a68_0x1163();return a68_0x4963=function(_0x4963f1,_0x74ec1b){_0x4963f1=_0x4963f1-0x152;let _0x2a0727=_0x1163d2[_0x4963f1];return _0x2a0727;},a68_0x4963(_0x71b0b2,_0x4904a6);}import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x491e06,_0xb398c8){const _0xe9bff1=a68_0x4963;try{if(_0xb398c8){const _0x1e1cbf=await readFile(_0x491e06,'utf-8');try{return JSON[_0xe9bff1(0x157)](_0x1e1cbf);}catch(_0xf344f4){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe9bff1(0x164)+_0x491e06+'\x27:\x20'+(_0xf344f4 instanceof Error?_0xf344f4[_0xe9bff1(0x168)]:String(_0xf344f4)));}}else try{return JSON[_0xe9bff1(0x157)](_0x491e06);}catch(_0x4dfaab){throw new SDKError(ErrorCode[_0xe9bff1(0x15d)],_0xe9bff1(0x15b)+(_0x4dfaab instanceof Error?_0x4dfaab['message']:String(_0x4dfaab)));}}catch(_0x2071ed){if(_0x2071ed instanceof SDKError)throw _0x2071ed;if(_0x2071ed instanceof Error&&'code'in _0x2071ed){const _0xb9075b=_0x2071ed;if(_0xb9075b[_0xe9bff1(0x15f)]==='ENOENT')throw new SDKError(ErrorCode['NOT_FOUND'],_0xe9bff1(0x155)+_0x491e06);else{if(_0xb9075b[_0xe9bff1(0x15f)]===_0xe9bff1(0x165))throw new SDKError(ErrorCode[_0xe9bff1(0x15c)],_0xe9bff1(0x166)+_0x491e06);}}throw new SDKError(ErrorCode[_0xe9bff1(0x154)],_0xe9bff1(0x162)+(_0x2071ed instanceof Error?_0x2071ed[_0xe9bff1(0x168)]:String(_0x2071ed)));}}export async function loadJSONFromOptions(_0x58cf81,_0x1d82a2){const _0x163ae5=a68_0x4963;if(_0x58cf81&&_0x1d82a2)throw new SDKError(ErrorCode[_0x163ae5(0x15d)],_0x163ae5(0x159));if(_0x58cf81)return await loadJSON(_0x58cf81,![]);if(_0x1d82a2)return await loadJSON(_0x1d82a2,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a69_0x423b(_0xaa704f,_0x3abb54){const _0x1a399f=a69_0x1a39();return a69_0x423b=function(_0x423b06,_0x5d3f29){_0x423b06=_0x423b06-0x117;let _0x514694=_0x1a399f[_0x423b06];return _0x514694;},a69_0x423b(_0xaa704f,_0x3abb54);}const a69_0x38631d=a69_0x423b;(function(_0x115627,_0x5267d3){const _0x41ccf5=a69_0x423b,_0x497e22=_0x115627();while(!![]){try{const _0x45ca25=-parseInt(_0x41ccf5(0x11e))/0x1*(parseInt(_0x41ccf5(0x11d))/0x2)+-parseInt(_0x41ccf5(0x11a))/0x3*(parseInt(_0x41ccf5(0x124))/0x4)+parseInt(_0x41ccf5(0x11f))/0x5+parseInt(_0x41ccf5(0x125))/0x6*(parseInt(_0x41ccf5(0x119))/0x7)+-parseInt(_0x41ccf5(0x122))/0x8+-parseInt(_0x41ccf5(0x120))/0x9*(-parseInt(_0x41ccf5(0x118))/0xa)+parseInt(_0x41ccf5(0x117))/0xb;if(_0x45ca25===_0x5267d3)break;else _0x497e22['push'](_0x497e22['shift']());}catch(_0x7c6f53){_0x497e22['push'](_0x497e22['shift']());}}}(a69_0x1a39,0x6e4e4));const MODEL_ALIASES={'haiku':a69_0x38631d(0x121),'sonnet':a69_0x38631d(0x123)};export function extractModelAlias(_0x8bb685){const _0x348d67=a69_0x38631d,_0x2909ce=_0x8bb685[_0x348d67(0x11c)](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x2909ce)return _0x2909ce[0x1][_0x348d67(0x11b)]();return _0x8bb685;}export function resolveModelAlias(_0x1d21e6){const _0x3f1c12=a69_0x38631d;return MODEL_ALIASES[_0x1d21e6[_0x3f1c12(0x11b)]()]||_0x1d21e6;}function a69_0x1a39(){const _0x589ae8=['158033ZniqgL','4494955wctagD','3303GcrHPw','claude-4.5-haiku','4551352JeLbQk','claude-4.5-sonnet','4dEBIGI','906AoiVkf','9171481GPDayF','9200SSLwIY','4984XmlGcV','1101054jazATF','toLowerCase','match','10Lrnxhj'];a69_0x1a39=function(){return _0x589ae8;};return a69_0x1a39();}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a70_0x196c(){const _0xded954=['24TglJHN','2894765yVbdkO','Invalid\x20timeout\x20value:\x20','1577832kgUhuZ','number','22136856WdzkYV','5709wNbAgH','Invalid\x20limit\x20value:\x20','isInteger','.\x20Must\x20be\x20an\x20integer.','.\x20Must\x20be\x20a\x20number.','.\x20Must\x20be\x20a\x20positive\x20number.','4776485eepQDA','723143BIfnij','5382006rDKvrs'];a70_0x196c=function(){return _0xded954;};return a70_0x196c();}function a70_0x13e1(_0x11795f,_0x5eec2d){const _0x196c57=a70_0x196c();return a70_0x13e1=function(_0x13e119,_0x133d85){_0x13e119=_0x13e119-0x114;let _0x3b7799=_0x196c57[_0x13e119];return _0x3b7799;},a70_0x13e1(_0x11795f,_0x5eec2d);}(function(_0x307d6a,_0x14c522){const _0x34a268=a70_0x13e1,_0x333544=_0x307d6a();while(!![]){try{const _0x22268b=-parseInt(_0x34a268(0x121))/0x1+parseInt(_0x34a268(0x117))/0x2+-parseInt(_0x34a268(0x11a))/0x3*(-parseInt(_0x34a268(0x114))/0x4)+-parseInt(_0x34a268(0x115))/0x5+-parseInt(_0x34a268(0x122))/0x6+-parseInt(_0x34a268(0x120))/0x7+parseInt(_0x34a268(0x119))/0x8;if(_0x22268b===_0x14c522)break;else _0x333544['push'](_0x333544['shift']());}catch(_0x42f95a){_0x333544['push'](_0x333544['shift']());}}}(a70_0x196c,0xa77a5));export function validateLimitOption(_0x3166ef){const _0x3f7b94=a70_0x13e1;if(!Number[_0x3f7b94(0x11c)](_0x3166ef))return{'isValid':![],'error':_0x3f7b94(0x11b)+_0x3166ef+_0x3f7b94(0x11d)};if(_0x3166ef<=0x0)return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0x3166ef+'.\x20Must\x20be\x20a\x20positive\x20integer.'};return{'isValid':!![],'value':_0x3166ef};}export function validateTimeoutOption(_0xe202af,_0x4d9934=0x1e){const _0x949c54=a70_0x13e1;if(_0xe202af===undefined)return{'isValid':!![],'value':_0x4d9934};const _0x26455d=typeof _0xe202af===_0x949c54(0x118)?_0xe202af:parseFloat(_0xe202af);if(isNaN(_0x26455d))return{'isValid':![],'error':'Invalid\x20timeout\x20value:\x20'+_0xe202af+_0x949c54(0x11e)};if(_0x26455d<=0x0)return{'isValid':![],'error':_0x949c54(0x116)+_0x26455d+_0x949c54(0x11f)};return{'isValid':!![],'value':_0x26455d};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1462c2,_0xb9412f){const _0x3f6752=a71_0x48b7,_0x12180b=_0x1462c2();while(!![]){try{const _0x333ea5=-parseInt(_0x3f6752(0x73))/0x1*(parseInt(_0x3f6752(0x6b))/0x2)+parseInt(_0x3f6752(0x79))/0x3*(-parseInt(_0x3f6752(0x74))/0x4)+parseInt(_0x3f6752(0x7a))/0x5+-parseInt(_0x3f6752(0x78))/0x6*(-parseInt(_0x3f6752(0x6d))/0x7)+-parseInt(_0x3f6752(0x7c))/0x8*(parseInt(_0x3f6752(0x75))/0x9)+parseInt(_0x3f6752(0x77))/0xa+parseInt(_0x3f6752(0x6a))/0xb;if(_0x333ea5===_0xb9412f)break;else _0x12180b['push'](_0x12180b['shift']());}catch(_0x3da55a){_0x12180b['push'](_0x12180b['shift']());}}}(a71_0x1b8f,0x4bedd));function a71_0x1b8f(){const _0x3d9ac7=['0.0.0.0','15112GtSakM','\x20and\x20','11439197cXOGsx','2342XeuhZI','listening','1449FwuRUZ','close','code','No\x20available\x20port\x20found\x20between\x20','once','EADDRINUSE','365WnDXtf','36lftUMk','2133LiXOBA','error','72130BTZEjl','5502DQzNbZ','126849CwhhLX','1648505CTQdfJ'];a71_0x1b8f=function(){return _0x3d9ac7;};return a71_0x1b8f();}import{createServer}from'node:net';export async function isPortAvailable(_0x76bd95){return new Promise(_0x16ada0=>{const _0x22ab32=a71_0x48b7,_0x399503=createServer();_0x399503['once'](_0x22ab32(0x76),_0x56f022=>{const _0x233f7c=_0x22ab32;_0x56f022[_0x233f7c(0x6f)]===_0x233f7c(0x72)?_0x16ada0(![]):_0x16ada0(![]);}),_0x399503[_0x22ab32(0x71)](_0x22ab32(0x6c),()=>{const _0x3458b6=_0x22ab32;_0x399503[_0x3458b6(0x6e)](),_0x16ada0(!![]);}),_0x399503['listen'](_0x76bd95,_0x22ab32(0x7b));});}function a71_0x48b7(_0x2428cb,_0x4801ec){const _0x1b8f0b=a71_0x1b8f();return a71_0x48b7=function(_0x48b7de,_0x2386f3){_0x48b7de=_0x48b7de-0x69;let _0x5588e7=_0x1b8f0b[_0x48b7de];return _0x5588e7;},a71_0x48b7(_0x2428cb,_0x4801ec);}export async function findAvailablePort(_0x72c436=0xfa0,_0x1ccd96=0x64){const _0x314303=a71_0x48b7;for(let _0x467e87=0x0;_0x467e87<_0x1ccd96;_0x467e87++){const _0x427f2b=_0x72c436+_0x467e87;if(await isPortAvailable(_0x427f2b))return _0x427f2b;}throw new Error(_0x314303(0x70)+_0x72c436+_0x314303(0x69)+(_0x72c436+_0x1ccd96-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x416fb3=a72_0x1b81;function a72_0xb33e(){const _0x2de87f=['10DZawce','has','platform','55720SulNGG','length','trim','\x20-o\x20ppid=,comm=','3aEUzhG',',\x20using\x20fallback','91LNTbIh','2878381UDXdhi','122630BiyHou','2845296SxpQYg','replace','pid','powershell','DEBUG','ksh','win32','\x20on\x20Windows:','utf-8','comm','split','env','dash','ion','wmic\x20process\x20where\x20ProcessId=','124GdxnmT','kill','Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20','error','Could\x20not\x20get\x20process\x20info\x20for\x20PID\x20','224724xlZBbr','csh','\x20get\x20ParentProcessId,Name\x20/format:csv','124782AozZYp','join','tcsh','toLowerCase','\x20on\x20POSIX:','ppid','xonsh','filter','pwsh','9845vQiqXF'];a72_0xb33e=function(){return _0x2de87f;};return a72_0xb33e();}(function(_0x4521f5,_0x4b3e34){const _0x422027=a72_0x1b81,_0x43f4e7=_0x4521f5();while(!![]){try{const _0x1a7359=parseInt(_0x422027(0xa9))/0x1+parseInt(_0x422027(0xbe))/0x2*(-parseInt(_0x422027(0xba))/0x3)+-parseInt(_0x422027(0xa1))/0x4*(-parseInt(_0x422027(0xb2))/0x5)+parseInt(_0x422027(0xa6))/0x6+-parseInt(_0x422027(0xbc))/0x7*(-parseInt(_0x422027(0xb6))/0x8)+parseInt(_0x422027(0xbf))/0x9*(-parseInt(_0x422027(0xb3))/0xa)+parseInt(_0x422027(0xbd))/0xb;if(_0x1a7359===_0x4b3e34)break;else _0x43f4e7['push'](_0x43f4e7['shift']());}catch(_0x2a6888){_0x43f4e7['push'](_0x43f4e7['shift']());}}}(a72_0xb33e,0x30590));import{execSync}from'node:child_process';const SHELL_NAMES=new Set(['bash','zsh','sh','fish',a72_0x416fb3(0xc4),a72_0x416fb3(0xab),a72_0x416fb3(0xa7),a72_0x416fb3(0x9e),a72_0x416fb3(0xb1),a72_0x416fb3(0xc2),'nu',a72_0x416fb3(0x9f),'elvish',a72_0x416fb3(0xaf)]);function getProcessInfoWindows(_0x31719b){const _0x47b22b=a72_0x416fb3;try{const _0x17adc5=execSync(_0x47b22b(0xa0)+_0x31719b+_0x47b22b(0xa8),{'encoding':_0x47b22b(0x9a),'windowsHide':!![]})[_0x47b22b(0xb8)](),_0x3f0f03=_0x17adc5[_0x47b22b(0x9c)]('\x0a')[_0x47b22b(0xb0)](_0x2c7f3c=>_0x2c7f3c['trim']());if(_0x3f0f03['length']<0x2)return null;const _0x58d987=_0x3f0f03[_0x3f0f03[_0x47b22b(0xb7)]-0x1][_0x47b22b(0x9c)](',');if(_0x58d987[_0x47b22b(0xb7)]<0x3)return null;const _0x1cc686=_0x58d987[0x1]?.[_0x47b22b(0xb8)]()||'',_0xf1caf1=parseInt(_0x58d987[0x2]?.[_0x47b22b(0xb8)]()||'0',0xa);if(isNaN(_0xf1caf1)||!_0x1cc686)return null;return{'pid':_0x31719b,'ppid':_0xf1caf1,'comm':_0x1cc686[_0x47b22b(0xc0)](/\.exe$/i,'')};}catch(_0x533831){return process[_0x47b22b(0x9d)][_0x47b22b(0xc3)]&&console[_0x47b22b(0xa4)](_0x47b22b(0xa3)+_0x31719b+_0x47b22b(0x99),_0x533831),null;}}function a72_0x1b81(_0x7e5bdb,_0x1f063b){const _0xb33ec3=a72_0xb33e();return a72_0x1b81=function(_0x1b8169,_0x3cdbce){_0x1b8169=_0x1b8169-0x99;let _0x27cce5=_0xb33ec3[_0x1b8169];return _0x27cce5;},a72_0x1b81(_0x7e5bdb,_0x1f063b);}function getProcessInfoPosix(_0x545525){const _0x334dd8=a72_0x416fb3;try{const _0x1cfc5c=execSync('ps\x20-p\x20'+_0x545525+_0x334dd8(0xb9),{'encoding':_0x334dd8(0x9a)})['trim'](),[_0x31af40,..._0x112746]=_0x1cfc5c[_0x334dd8(0x9c)](/\s+/),_0x52e557=parseInt(_0x31af40,0xa),_0x1c2bb6=_0x112746[_0x334dd8(0xaa)]('\x20');if(isNaN(_0x52e557))return null;return{'pid':_0x545525,'ppid':_0x52e557,'comm':_0x1c2bb6};}catch(_0x9e6485){return process[_0x334dd8(0x9d)][_0x334dd8(0xc3)]&&console[_0x334dd8(0xa4)](_0x334dd8(0xa3)+_0x545525+_0x334dd8(0xad),_0x9e6485),null;}}function getProcessInfo(_0x52c18a){const _0x5d7606=a72_0x416fb3;if(process[_0x5d7606(0xb5)]===_0x5d7606(0xc5))return getProcessInfoWindows(_0x52c18a);return getProcessInfoPosix(_0x52c18a);}function isShell(_0x52659c){const _0x4b1330=a72_0x416fb3,_0x14b8eb=_0x52659c[_0x4b1330(0xc0)](/^-/,'')['split']('/')['pop']()||'';return SHELL_NAMES[_0x4b1330(0xb4)](_0x14b8eb[_0x4b1330(0xac)]());}let cachedShellPID;function findShellPID(){const _0x5ec2e2=a72_0x416fb3;let _0x3e2279=process[_0x5ec2e2(0xae)];const _0xfaefb=0xa;let _0x4e1f6b=0x0;while(_0x4e1f6b<_0xfaefb){const _0x37f656=getProcessInfo(_0x3e2279);if(!_0x37f656){process['env']['DEBUG']&&console[_0x5ec2e2(0xa4)](_0x5ec2e2(0xa5)+_0x3e2279+_0x5ec2e2(0xbb));break;}if(isShell(_0x37f656[_0x5ec2e2(0x9b)]))return _0x37f656[_0x5ec2e2(0xc1)];if(_0x37f656['ppid']===0x0||_0x37f656[_0x5ec2e2(0xae)]===0x1){if(isShell(_0x37f656[_0x5ec2e2(0x9b)]))return _0x37f656['pid'];break;}_0x3e2279=_0x37f656[_0x5ec2e2(0xae)],_0x4e1f6b++;}return process[_0x5ec2e2(0x9d)]['DEBUG']&&console[_0x5ec2e2(0xa4)]('No\x20shell\x20found\x20in\x20process\x20tree,\x20falling\x20back\x20to\x20process.ppid'),process[_0x5ec2e2(0xae)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x3e0b0c){const _0x2baa12=a72_0x416fb3;try{return process[_0x2baa12(0xa2)](_0x3e0b0c,0x0),!![];}catch{return![];}}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x418eed,_0x428c6){const _0xa74aa9=a73_0x37fc,_0x3997d7=_0x418eed();while(!![]){try{const _0x2cbb6b=-parseInt(_0xa74aa9(0x1e9))/0x1*(parseInt(_0xa74aa9(0x1e8))/0x2)+parseInt(_0xa74aa9(0x1f0))/0x3+parseInt(_0xa74aa9(0x1ef))/0x4*(parseInt(_0xa74aa9(0x1e7))/0x5)+-parseInt(_0xa74aa9(0x1ee))/0x6*(parseInt(_0xa74aa9(0x1f9))/0x7)+parseInt(_0xa74aa9(0x1f5))/0x8+parseInt(_0xa74aa9(0x1f8))/0x9*(parseInt(_0xa74aa9(0x1f3))/0xa)+parseInt(_0xa74aa9(0x1f7))/0xb*(-parseInt(_0xa74aa9(0x1ed))/0xc);if(_0x2cbb6b===_0x428c6)break;else _0x3997d7['push'](_0x3997d7['shift']());}catch(_0x261bc0){_0x3997d7['push'](_0x3997d7['shift']());}}}(a73_0x2d77,0x4c437));function a73_0x37fc(_0x1c12db,_0x49a30c){const _0x2d7712=a73_0x2d77();return a73_0x37fc=function(_0x37fc42,_0x95be60){_0x37fc42=_0x37fc42-0x1e7;let _0x27ab19=_0x2d7712[_0x37fc42];return _0x27ab19;},a73_0x37fc(_0x1c12db,_0x49a30c);}function a73_0x2d77(){const _0x10e433=['12heheeu','1178676JnuPqx','question','toLowerCase','775990nXpzqw','stdout','2099232AjMFmv','close','11fuEnCA','63VYVXEl','7bvRAmy','443995nriEGj','10514UVzJHu','23GHWOGG','yes','stdin','\x20(y/N):\x20','5299572HKEXsi','3539814tvDzaq'];a73_0x2d77=function(){return _0x10e433;};return a73_0x2d77();}import*as a73_0x1ecc0b from'readline';export async function confirm(_0x59f58c){const _0xbcefd9=a73_0x37fc,_0x264e07=a73_0x1ecc0b['createInterface']({'input':process[_0xbcefd9(0x1eb)],'output':process[_0xbcefd9(0x1f4)]});return new Promise(_0x1cfbea=>{const _0x462aaf=_0xbcefd9;_0x264e07[_0x462aaf(0x1f1)](_0x59f58c+_0x462aaf(0x1ec),_0xf216a1=>{const _0x5edb9b=_0x462aaf;_0x264e07[_0x5edb9b(0x1f6)](),_0x1cfbea(_0xf216a1['toLowerCase']()==='y'||_0xf216a1[_0x5edb9b(0x1f2)]()===_0x5edb9b(0x1ea));});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d69f1,_0x2c2589){const _0x13aece=a74_0x1f12,_0x28934f=_0x2d69f1();while(!![]){try{const _0x20bfdf=parseInt(_0x13aece(0x8c))/0x1*(parseInt(_0x13aece(0x6d))/0x2)+-parseInt(_0x13aece(0x71))/0x3+-parseInt(_0x13aece(0x7c))/0x4+-parseInt(_0x13aece(0x7e))/0x5+parseInt(_0x13aece(0x81))/0x6*(-parseInt(_0x13aece(0x84))/0x7)+-parseInt(_0x13aece(0x7a))/0x8*(-parseInt(_0x13aece(0x83))/0x9)+parseInt(_0x13aece(0x72))/0xa;if(_0x20bfdf===_0x2c2589)break;else _0x28934f['push'](_0x28934f['shift']());}catch(_0x1fdce8){_0x28934f['push'](_0x28934f['shift']());}}}(a74_0x18cd,0x1ce8f));export function parsePath(_0x5e398c){const _0x29c399=a74_0x1f12;if(!_0x5e398c||_0x5e398c['trim']()==='')throw new Error(_0x29c399(0x82));const _0x3800f9=_0x5e398c['trim']();if(_0x3800f9==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5e398c};const _0x23fe15=_0x3800f9[_0x29c399(0x6c)]('/')?_0x3800f9[_0x29c399(0x86)](0x1):_0x3800f9,_0x42b51f=_0x23fe15[_0x29c399(0x80)]('/')[_0x29c399(0x75)](_0x2ba1e6=>_0x2ba1e6!=='');if(_0x42b51f['length']===0x0)throw new Error(_0x29c399(0x88));const _0x1800cf=_0x3800f9['startsWith']('/')||!isRelativePathSegment(_0x42b51f[0x0]);for(const _0x41c088 of _0x42b51f){validatePathSegment(_0x41c088);}return{'segments':_0x42b51f,'isAbsolute':_0x1800cf,'raw':_0x5e398c};}function isRelativePathSegment(_0x4aae7c){return _0x4aae7c==='.'||_0x4aae7c==='..';}function validatePathSegment(_0xeb01a9){const _0x17181f=a74_0x1f12;if(_0xeb01a9==='')throw new Error(_0x17181f(0x8b));if(_0xeb01a9==='.'||_0xeb01a9==='..')return;if(/[\x00-\x1F\x7F]/[_0x17181f(0x89)](_0xeb01a9))throw new Error(_0x17181f(0x76)+_0xeb01a9);if(_0xeb01a9!==_0xeb01a9[_0x17181f(0x6f)]()){}}function a74_0x18cd(){const _0x200b42=['trim','join','148467PDpGrh','3430200VYnwdC','Cannot\x20split\x20empty\x20path','raw','filter','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Cannot\x20navigate\x20above\x20root','isAbsolute','841624NtrVVy','segments','538156ezYITF','length','988020LlRVol','push','split','21006ykBhJh','Path\x20cannot\x20be\x20empty','9hkXOex','161pKrHfv','Relative\x20path\x20cannot\x20be\x20empty','substring','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','test','slice','Path\x20segment\x20cannot\x20be\x20empty','132347Mecwhu','startsWith','2IcgGjV','pop'];a74_0x18cd=function(){return _0x200b42;};return a74_0x18cd();}function a74_0x1f12(_0x4e6e5e,_0x3bfc17){const _0x18cdf2=a74_0x18cd();return a74_0x1f12=function(_0x1f123,_0x14d586){_0x1f123=_0x1f123-0x6c;let _0x2815aa=_0x18cdf2[_0x1f123];return _0x2815aa;},a74_0x1f12(_0x4e6e5e,_0x3bfc17);}export function validatePath(_0x324cc4){const _0x4235ae=a74_0x1f12;if(_0x324cc4[_0x4235ae(0x7b)]['length']===0x0&&!_0x324cc4[_0x4235ae(0x79)])throw new Error(_0x4235ae(0x85));if(_0x324cc4['isAbsolute']){if(_0x324cc4[_0x4235ae(0x7b)][0x0]==='..')throw new Error(_0x4235ae(0x77));let _0x5eea37=0x0;for(const _0x2c5407 of _0x324cc4[_0x4235ae(0x7b)]){if(_0x2c5407==='..'){if(_0x5eea37===0x0)throw new Error(_0x4235ae(0x87));_0x5eea37--;}else _0x2c5407!=='.'&&_0x5eea37++;}}}export function joinPaths(_0x4210c2,_0x4038d8){const _0x19b42d=a74_0x1f12;if(!_0x4210c2||_0x4210c2==='/')return _0x4038d8;if(!_0x4038d8||_0x4038d8==='.')return _0x4210c2;if(_0x4038d8['startsWith']('/'))return _0x4038d8;const _0x36330c=parsePath(_0x4210c2),_0xbcb585=parsePath(_0x4038d8),_0x5de55d=[..._0x36330c['segments']];for(const _0x244dbd of _0xbcb585[_0x19b42d(0x7b)]){if(_0x244dbd==='.')continue;else{if(_0x244dbd==='..'){if(_0x5de55d['length']===0x0)throw new Error(_0x19b42d(0x78));_0x5de55d[_0x19b42d(0x6e)]();}else _0x5de55d[_0x19b42d(0x7f)](_0x244dbd);}}const _0x588f86=_0x5de55d['join']('/');return _0x36330c['raw'][_0x19b42d(0x6c)]('/')?'/'+_0x588f86:_0x588f86;}export function normalizePath(_0x37ae7c){const _0xba95c5=a74_0x1f12,_0xb13d5a=parsePath(_0x37ae7c),_0x5c4ed5=[];for(const _0x22dcd7 of _0xb13d5a['segments']){if(_0x22dcd7==='.')continue;else{if(_0x22dcd7==='..'){if(_0x5c4ed5[_0xba95c5(0x7d)]===0x0){if(_0xb13d5a['isAbsolute'])throw new Error(_0xba95c5(0x78));_0x5c4ed5[_0xba95c5(0x7f)]('..');}else _0x5c4ed5[_0x5c4ed5[_0xba95c5(0x7d)]-0x1]==='..'?_0x5c4ed5['push']('..'):_0x5c4ed5[_0xba95c5(0x6e)]();}else _0x5c4ed5['push'](_0x22dcd7);}}if(_0x5c4ed5['length']===0x0)return _0xb13d5a[_0xba95c5(0x79)]?'/':'.';const _0x3c1342=_0x5c4ed5[_0xba95c5(0x70)]('/');return _0xb13d5a[_0xba95c5(0x74)]['startsWith']('/')?'/'+_0x3c1342:_0x3c1342;}export function getParentPath(_0x30016c){const _0x4548a7=a74_0x1f12,_0xe21d4e=parsePath(_0x30016c);if(_0xe21d4e['segments'][_0x4548a7(0x7d)]<=0x1)return'/';const _0x10dc38=_0xe21d4e['segments'][_0x4548a7(0x8a)](0x0,-0x1)['join']('/');return _0xe21d4e[_0x4548a7(0x74)][_0x4548a7(0x6c)]('/')?'/'+_0x10dc38:_0x10dc38;}export function getBaseName(_0x29e33e){const _0x141a00=a74_0x1f12,_0x819076=parsePath(_0x29e33e);return _0x819076[_0x141a00(0x7b)][_0x819076['segments'][_0x141a00(0x7d)]-0x1]||'';}export function isChildPath(_0x3e544e,_0x364c6c){const _0x3b25ba=a74_0x1f12,_0x49fe83=parsePath(_0x3e544e),_0x60d05=parsePath(_0x364c6c);if(_0x49fe83[_0x3b25ba(0x7b)][_0x3b25ba(0x7d)]<=_0x60d05[_0x3b25ba(0x7b)][_0x3b25ba(0x7d)])return![];for(let _0x5e7af5=0x0;_0x5e7af5<_0x60d05[_0x3b25ba(0x7b)][_0x3b25ba(0x7d)];_0x5e7af5++){if(_0x49fe83[_0x3b25ba(0x7b)][_0x5e7af5]!==_0x60d05[_0x3b25ba(0x7b)][_0x5e7af5])return![];}return!![];}export function splitPath(_0x22a66d){const _0xacaab0=a74_0x1f12,_0xbe87b4=parsePath(_0x22a66d);if(_0xbe87b4['segments'][_0xacaab0(0x7d)]===0x0)throw new Error(_0xacaab0(0x73));if(_0xbe87b4[_0xacaab0(0x7b)][_0xacaab0(0x7d)]===0x1)return{'parent':_0xbe87b4['segments'][0x0]};return{'parent':_0xbe87b4[_0xacaab0(0x7b)][0x0],'child':_0xbe87b4[_0xacaab0(0x7b)][_0xacaab0(0x8a)](0x1)[_0xacaab0(0x70)]('/')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x215428,_0x152234){const _0x1182ee=a75_0x2fa4,_0x5e3de8=_0x215428();while(!![]){try{const _0x24d031=parseInt(_0x1182ee(0xd0))/0x1*(-parseInt(_0x1182ee(0xd5))/0x2)+parseInt(_0x1182ee(0xd1))/0x3*(-parseInt(_0x1182ee(0xc9))/0x4)+-parseInt(_0x1182ee(0xce))/0x5*(parseInt(_0x1182ee(0xd2))/0x6)+-parseInt(_0x1182ee(0xd3))/0x7*(parseInt(_0x1182ee(0xc8))/0x8)+-parseInt(_0x1182ee(0xcb))/0x9+parseInt(_0x1182ee(0xd6))/0xa*(-parseInt(_0x1182ee(0xcd))/0xb)+-parseInt(_0x1182ee(0xd4))/0xc*(-parseInt(_0x1182ee(0xc7))/0xd);if(_0x24d031===_0x152234)break;else _0x5e3de8['push'](_0x5e3de8['shift']());}catch(_0x358db7){_0x5e3de8['push'](_0x5e3de8['shift']());}}}(a75_0x5ac9,0x5eda9));function a75_0x2fa4(_0x2a6079,_0x5628b2){const _0x5ac9da=a75_0x5ac9();return a75_0x2fa4=function(_0x2fa409,_0x21034d){_0x2fa409=_0x2fa409-0xc6;let _0x258f26=_0x5ac9da[_0x2fa409];return _0x258f26;},a75_0x2fa4(_0x2a6079,_0x5628b2);}function a75_0x5ac9(){const _0x55b2c6=['7IrquuK','60qgetji','14sZGxNx','90vJMgIx','substring','indexOf','5076175mTypLC','785160EsADzH','11468qqDGvL','Invalid\x20segment\x20reference\x20format:\x20','3443931tviyPM','.\x20Child\x20name\x20cannot\x20be\x20empty','311179CMImkc','264415XKQwGY','.\x20Parent\x20name\x20cannot\x20be\x20empty','100783IpiXjp','18KYjFAV','12JcOVwB'];a75_0x5ac9=function(){return _0x55b2c6;};return a75_0x5ac9();}export function parseSegmentRef(_0x15516c){const _0x2656eb=a75_0x2fa4,_0x2982b6=_0x15516c[_0x2656eb(0xc6)]('/');if(_0x2982b6===-0x1)return{'parentId':_0x15516c};if(_0x2982b6===0x0)throw new Error(_0x2656eb(0xca)+_0x15516c+_0x2656eb(0xcf));const _0x382bca=_0x15516c[_0x2656eb(0xd7)](0x0,_0x2982b6),_0x268f89=_0x15516c[_0x2656eb(0xd7)](_0x2982b6+0x1);if(_0x268f89==='')throw new Error(_0x2656eb(0xca)+_0x15516c+_0x2656eb(0xcc));return{'parentId':_0x382bca,'childId':_0x268f89};}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f1ad3,_0x511827){const _0xe46fdc=a76_0x4aa2,_0x59746d=_0x4f1ad3();while(!![]){try{const _0x3b0c8c=parseInt(_0xe46fdc(0xc9))/0x1*(-parseInt(_0xe46fdc(0xd2))/0x2)+-parseInt(_0xe46fdc(0xd6))/0x3+-parseInt(_0xe46fdc(0xd5))/0x4*(-parseInt(_0xe46fdc(0xcd))/0x5)+-parseInt(_0xe46fdc(0xca))/0x6*(parseInt(_0xe46fdc(0xce))/0x7)+-parseInt(_0xe46fdc(0xde))/0x8+-parseInt(_0xe46fdc(0xe3))/0x9*(parseInt(_0xe46fdc(0xdf))/0xa)+parseInt(_0xe46fdc(0xe0))/0xb*(parseInt(_0xe46fdc(0xd7))/0xc);if(_0x3b0c8c===_0x511827)break;else _0x59746d['push'](_0x59746d['shift']());}catch(_0x107e20){_0x59746d['push'](_0x59746d['shift']());}}}(a76_0x4380,0x9f8c8));import a76_0x5f1472 from'ora';export function createCommandSpinner(_0x136fe2,_0x2cadf2={}){const _0x385fea=a76_0x4aa2,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x2cadf2;return a76_0x5f1472({'text':_0x136fe2,'color':_0x385fea(0xe2),'isEnabled':forceEnabled||process[_0x385fea(0xcc)][_0x385fea(0xd8)]&&!verbose});}function a76_0x4380(){const _0x1c144b=['start','2692904SQeRmG','10LWutPw','37354273PCstjt','replace','cyan','11326608GhkvFR','text','phase','43892IgJpVG','1254afHAfv','intervalFactory','stdout','5srlutN','22561LxVJsu','\x20[Job\x20ID:\x20','toFixed','stop','46eQGTbL','extra','...','3948884ekdHNd','1353912PCEQQb','12NMGfFo','isTTY','floor','now','jobId','clock'];a76_0x4380=function(){return _0x1c144b;};return a76_0x4380();}export async function withSpinner(_0x15fd20,_0x5c7036,_0x5771e8={}){const _0x53604a=a76_0x4aa2,_0x55e6b5=_0x5771e8[_0x53604a(0xdc)]??(()=>Date[_0x53604a(0xda)]()),_0x4b0294=createCommandSpinner(_0x15fd20,_0x5771e8);_0x4b0294[_0x53604a(0xdd)]();const _0xac14ab=_0x55e6b5();try{const _0x570171=await _0x5c7036(),_0x4c50bf=_0x55e6b5()-_0xac14ab;return _0x4b0294[_0x53604a(0xd1)](),{'data':_0x570171,'elapsedMs':_0x4c50bf};}catch(_0x5c9023){_0x4b0294[_0x53604a(0xd1)]();throw _0x5c9023;}}export async function withQuerySpinner(_0x3dae2c,_0x7b3a22,_0x41a58a={}){const _0x2165f1=a76_0x4aa2,_0x5c4634=_0x41a58a[_0x2165f1(0xdc)]??(()=>Date[_0x2165f1(0xda)]()),_0x4116b8=_0x41a58a[_0x2165f1(0xcb)]??setInterval,_0x168d2b=createCommandSpinner(_0x3dae2c,_0x41a58a);_0x168d2b['start']();const _0x535ff2=_0x5c4634(),_0x236152=_0x3dae2c[_0x2165f1(0xe1)](_0x2165f1(0xd4),''),_0x225538={},_0x4e87d4=()=>{const _0x1dc3cf=_0x2165f1;if(!_0x168d2b['isSpinning'])return;const _0x3a4565=_0x5c4634()-_0x535ff2,_0x518cd0=formatElapsed(_0x3a4565),_0x39ad28=_0x225538[_0x1dc3cf(0xe5)]??_0x236152,_0x5cbcbe=_0x225538[_0x1dc3cf(0xdb)]?_0x1dc3cf(0xcf)+_0x225538['jobId']+']':'',_0x51fd6d=_0x225538['extra']?'\x20'+_0x225538[_0x1dc3cf(0xd3)]:'';_0x168d2b[_0x1dc3cf(0xe4)]=_0x39ad28+'\x20'+_0x518cd0+_0x51fd6d+_0x5cbcbe;},_0x51aeae=_0x4116b8(()=>{_0x4e87d4();},0x3e8),_0xd6bf20={'setPhase':_0x1025ab=>{_0x225538['phase']=_0x1025ab,_0x4e87d4();},'setJobId':_0x361be6=>{_0x225538['jobId']=_0x361be6,_0x4e87d4();},'setExtra':_0xac96cb=>{const _0x3b5a2=_0x2165f1;_0x225538[_0x3b5a2(0xd3)]=_0xac96cb,_0x4e87d4();}};_0x4e87d4();try{const _0x3412ff=await _0x7b3a22(_0xd6bf20),_0x2c894a=_0x5c4634()-_0x535ff2;return{'data':_0x3412ff,'elapsedMs':_0x2c894a};}finally{clearInterval(_0x51aeae),_0x168d2b[_0x2165f1(0xd1)]();}}function a76_0x4aa2(_0x4fb152,_0x8bc543){const _0x43805c=a76_0x4380();return a76_0x4aa2=function(_0x4aa2fe,_0x33a31e){_0x4aa2fe=_0x4aa2fe-0xc9;let _0x6305dc=_0x43805c[_0x4aa2fe];return _0x6305dc;},a76_0x4aa2(_0x4fb152,_0x8bc543);}export function formatElapsed(_0x6acc89){const _0x57bc87=a76_0x4aa2,_0x250430=Math[_0x57bc87(0xd9)](_0x6acc89/0x3e8);if(_0x250430<0x3c)return(_0x6acc89/0x3e8)[_0x57bc87(0xd0)](0x1)+'s';const _0x57fc14=Math[_0x57bc87(0xd9)](_0x250430/0x3c),_0xc90016=_0x250430%0x3c;if(_0x57fc14<0x3c)return _0x57fc14+'m\x20'+_0xc90016+'s';const _0x189b0f=Math[_0x57bc87(0xd9)](_0x57fc14/0x3c),_0x4b26ac=_0x57fc14%0x3c;return _0x189b0f+'h\x20'+_0x4b26ac+'m';}
|
package/dist/utils/sql-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a77_0x4969(){const _0x1c6c40=['replace','\x27\x20not\x20found','Error\x20reading\x20file\x20\x27','148430BMYyTG','3421RMxkLb','3188304GSExiW','length','EACCES','21VJOfdh','trim','46017OmxfBx','toLowerCase','filter','push','2044270vLVyhQ','1048620oEVCUP','message','utf-8','486756AcWQln','575088Aocvkw','1888rBBJkf','3gzhJzj','Content\x20contains\x20no\x20SQL\x20statements','ENOENT'];a77_0x4969=function(){return _0x1c6c40;};return a77_0x4969();}(function(_0x135647,_0x28ec05){const _0x43029f=a77_0x4f78,_0x4daebb=_0x135647();while(!![]){try{const _0x750ee9=-parseInt(_0x43029f(0x9e))/0x1+-parseInt(_0x43029f(0xb1))/0x2*(parseInt(_0x43029f(0xa0))/0x3)+-parseInt(_0x43029f(0xa8))/0x4+parseInt(_0x43029f(0xb2))/0x5+parseInt(_0x43029f(0x9d))/0x6*(-parseInt(_0x43029f(0xab))/0x7)+-parseInt(_0x43029f(0x9f))/0x8*(parseInt(_0x43029f(0xad))/0x9)+parseInt(_0x43029f(0xa6))/0xa*(parseInt(_0x43029f(0xa7))/0xb);if(_0x750ee9===_0x28ec05)break;else _0x4daebb['push'](_0x4daebb['shift']());}catch(_0x8f0b03){_0x4daebb['push'](_0x4daebb['shift']());}}}(a77_0x4969,0xefa30));import{readFileSync}from'fs';export function stripSqlComments(_0x537620){const _0x3d4c3d=a77_0x4f78;let _0x5b9415=_0x537620[_0x3d4c3d(0xa3)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x5b9415=_0x5b9415[_0x3d4c3d(0xa3)](/--.*$/gm,''),_0x5b9415[_0x3d4c3d(0xac)]();}function a77_0x4f78(_0x43c6a0,_0x2121f6){const _0x496940=a77_0x4969();return a77_0x4f78=function(_0x4f78bb,_0x36216e){_0x4f78bb=_0x4f78bb-0x9b;let _0xd92671=_0x496940[_0x4f78bb];return _0xd92671;},a77_0x4f78(_0x43c6a0,_0x2121f6);}function isEscaped(_0x287768,_0x4aa003){let _0xb4c062=0x0;for(let _0x234a5b=_0x4aa003-0x1;_0x234a5b>=0x0&&_0x287768[_0x234a5b]==='\x5c';_0x234a5b--){_0xb4c062++;}return _0xb4c062%0x2===0x1;}export function splitSqlStatements(_0x1490b2){const _0x3d4667=a77_0x4f78,_0x3cd514=stripSqlComments(_0x1490b2);if(!_0x3cd514)throw new Error(_0x3d4667(0xa1));const _0x8842bd=[];let _0x1ab80a='',_0x342a8b=![],_0x465cd3=![],_0x180d6f=![];for(let _0x5407e9=0x0;_0x5407e9<_0x1490b2[_0x3d4667(0xa9)];_0x5407e9++){const _0x37d67b=_0x1490b2[_0x5407e9];if(_0x37d67b==='\x27'&&!isEscaped(_0x1490b2,_0x5407e9)&&!_0x465cd3&&!_0x180d6f)_0x342a8b=!_0x342a8b;else{if(_0x37d67b==='\x22'&&!isEscaped(_0x1490b2,_0x5407e9)&&!_0x342a8b&&!_0x180d6f)_0x465cd3=!_0x465cd3;else _0x37d67b==='`'&&!isEscaped(_0x1490b2,_0x5407e9)&&!_0x342a8b&&!_0x465cd3&&(_0x180d6f=!_0x180d6f);}if(_0x37d67b===';'&&!_0x342a8b&&!_0x465cd3&&!_0x180d6f){const _0x2e5821=_0x1ab80a['trim']();_0x2e5821&&_0x8842bd[_0x3d4667(0xb0)](_0x2e5821),_0x1ab80a='';}else _0x1ab80a+=_0x37d67b;}const _0x5301d8=_0x1ab80a['trim']();_0x5301d8&&_0x8842bd[_0x3d4667(0xb0)](_0x5301d8);const _0x12098a=_0x8842bd['map'](_0x4da465=>_0x4da465[_0x3d4667(0xac)]())[_0x3d4667(0xaf)](_0x1ab552=>{const _0x5abae8=_0x3d4667,_0x37b9dc=stripSqlComments(_0x1ab552);return _0x37b9dc[_0x5abae8(0xa9)]>0x0;});if(_0x12098a[_0x3d4667(0xa9)]===0x0)throw new Error(_0x3d4667(0xa1));return _0x12098a;}export function readFileContent(_0x33b0f8){const _0x3e8452=a77_0x4f78;try{return readFileSync(_0x33b0f8,_0x3e8452(0x9c));}catch(_0x35ef7d){const _0x3c6b06=_0x35ef7d['code'];if(_0x3c6b06===_0x3e8452(0xa2))throw new Error('File\x20\x27'+_0x33b0f8+_0x3e8452(0xa4));else{if(_0x3c6b06===_0x3e8452(0xaa))throw new Error('Permission\x20denied\x20reading\x20file\x20\x27'+_0x33b0f8+'\x27');else throw new Error(_0x3e8452(0xa5)+_0x33b0f8+'\x27:\x20'+_0x35ef7d[_0x3e8452(0x9b)]);}}}export function readSqlStatementsFromFile(_0x3dbbfb){const _0xae77=a77_0x4f78,_0x282f32=readFileContent(_0x3dbbfb);try{return splitSqlStatements(_0x282f32);}catch(_0x246f1b){throw new Error('File\x20\x27'+_0x3dbbfb+'\x27\x20'+_0x246f1b['message'][_0xae77(0xae)]());}}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a78_0x14ce(_0x35ee9f,_0x4ab585){const _0x2ddc48=a78_0x2ddc();return a78_0x14ce=function(_0x14cedf,_0x1de422){_0x14cedf=_0x14cedf-0x127;let _0x3d71c5=_0x2ddc48[_0x14cedf];return _0x3d71c5;},a78_0x14ce(_0x35ee9f,_0x4ab585);}function a78_0x2ddc(){const _0x5d6d19=['read','decode','2321988CbSKjj','1452740UPHNTt','trim','[LLM\x20API\x20SSE]\x20','5883399hOFtUm','3988fWdKrl','event','startsWith','277RzFJqG','parse','2182692HQJsmi','10303117cBIblQ','indexOf','5GnRaUH','2291824cYKosy','getReader','debug','split','slice','10GaKaMn','releaseLock','data','14xvsTKm','body'];a78_0x2ddc=function(){return _0x5d6d19;};return a78_0x2ddc();}(function(_0x2a537a,_0x58fbe4){const _0x192db9=a78_0x14ce,_0x2bcf30=_0x2a537a();while(!![]){try{const _0x43cc8c=parseInt(_0x192db9(0x12e))/0x1*(parseInt(_0x192db9(0x12b))/0x2)+-parseInt(_0x192db9(0x140))/0x3+parseInt(_0x192db9(0x127))/0x4+-parseInt(_0x192db9(0x133))/0x5*(-parseInt(_0x192db9(0x130))/0x6)+-parseInt(_0x192db9(0x13c))/0x7*(-parseInt(_0x192db9(0x134))/0x8)+parseInt(_0x192db9(0x12a))/0x9+-parseInt(_0x192db9(0x139))/0xa*(parseInt(_0x192db9(0x131))/0xb);if(_0x43cc8c===_0x58fbe4)break;else _0x2bcf30['push'](_0x2bcf30['shift']());}catch(_0x59a374){_0x2bcf30['push'](_0x2bcf30['shift']());}}}(a78_0x2ddc,0xc22c1));export async function*parseSSEStream(_0x227f38,_0x2b8b15){const _0x2aa423=a78_0x14ce;if(!_0x227f38[_0x2aa423(0x13d)])throw new Error('Response\x20body\x20is\x20null');const _0x709a95=_0x227f38[_0x2aa423(0x13d)][_0x2aa423(0x135)](),_0x2c05b6=new TextDecoder();let _0x25ba69='',_0x59dc3a={};try{while(!![]){const {done:_0x51bcd7,value:_0x902325}=await _0x709a95[_0x2aa423(0x13e)]();if(_0x51bcd7){if(_0x59dc3a['data']){_0x2b8b15?.[_0x2aa423(0x136)](_0x2aa423(0x129)+_0x59dc3a[_0x2aa423(0x13b)]);const _0x187830=parseSSEData(_0x59dc3a[_0x2aa423(0x13b)]);yield _0x187830;}break;}_0x25ba69+=_0x2c05b6[_0x2aa423(0x13f)](_0x902325,{'stream':!![]});const _0x52d49b=_0x25ba69[_0x2aa423(0x137)]('\x0a');_0x25ba69=_0x52d49b['pop']()||'';for(const _0x42ef87 of _0x52d49b){if(_0x42ef87[_0x2aa423(0x128)]()===''){if(_0x59dc3a['data']){_0x2b8b15?.['debug']('[LLM\x20API\x20SSE]\x20'+_0x59dc3a[_0x2aa423(0x13b)]);const _0x29ec4d=parseSSEData(_0x59dc3a['data']);yield _0x29ec4d,_0x59dc3a={};}continue;}if(_0x42ef87['startsWith'](':'))continue;const _0x110387=_0x42ef87[_0x2aa423(0x132)](':');if(_0x110387===-0x1)continue;const _0x1536a1=_0x42ef87[_0x2aa423(0x138)](0x0,_0x110387);let _0x45c916=_0x42ef87[_0x2aa423(0x138)](_0x110387+0x1);_0x45c916[_0x2aa423(0x12d)]('\x20')&&(_0x45c916=_0x45c916[_0x2aa423(0x138)](0x1));switch(_0x1536a1){case _0x2aa423(0x12c):_0x59dc3a[_0x2aa423(0x12c)]=_0x45c916;break;case _0x2aa423(0x13b):_0x59dc3a[_0x2aa423(0x13b)]=_0x59dc3a[_0x2aa423(0x13b)]?_0x59dc3a[_0x2aa423(0x13b)]+'\x0a'+_0x45c916:_0x45c916;break;case'id':_0x59dc3a['id']=_0x45c916;break;}}}}finally{_0x709a95[_0x2aa423(0x13a)]();}}function parseSSEData(_0x3cd6c2){const _0x30deec=a78_0x14ce;try{return JSON[_0x30deec(0x12f)](_0x3cd6c2);}catch(_0x7107d2){throw new Error('Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20'+_0x3cd6c2,{'cause':_0x7107d2});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x117110,_0x45c0fd){const _0x49d3dc=a79_0x32ed,_0x524ba3=_0x117110();while(!![]){try{const _0x2f5245=-parseInt(_0x49d3dc(0x124))/0x1+-parseInt(_0x49d3dc(0x122))/0x2*(parseInt(_0x49d3dc(0x125))/0x3)+parseInt(_0x49d3dc(0x123))/0x4*(-parseInt(_0x49d3dc(0x11b))/0x5)+parseInt(_0x49d3dc(0x11a))/0x6+-parseInt(_0x49d3dc(0x120))/0x7*(parseInt(_0x49d3dc(0x112))/0x8)+parseInt(_0x49d3dc(0x118))/0x9+parseInt(_0x49d3dc(0x117))/0xa;if(_0x2f5245===_0x45c0fd)break;else _0x524ba3['push'](_0x524ba3['shift']());}catch(_0x30fb40){_0x524ba3['push'](_0x524ba3['shift']());}}}(a79_0x2e5d,0xa9287));import a79_0x15f064 from'string-width';export function stringWidth(_0x2ab5af){return a79_0x15f064(_0x2ab5af);}export function padEnd(_0x5de8bd,_0x495e09){const _0x51c8a9=a79_0x32ed,_0x1b16c2=stringWidth(_0x5de8bd);if(_0x1b16c2>=_0x495e09)return _0x5de8bd;return _0x5de8bd+'\x20'[_0x51c8a9(0x110)](_0x495e09-_0x1b16c2);}export function padStart(_0x3dde7a,_0x3938cd){const _0x458ad9=a79_0x32ed,_0x2749c9=stringWidth(_0x3dde7a);if(_0x2749c9>=_0x3938cd)return _0x3dde7a;return'\x20'[_0x458ad9(0x110)](_0x3938cd-_0x2749c9)+_0x3dde7a;}export function centerAlign(_0x80c917,_0x2a9da1){const _0x33556d=a79_0x32ed,_0xbe394d=stringWidth(_0x80c917);if(_0xbe394d>_0x2a9da1){if(_0x2a9da1<=0x1)return'…'[_0x33556d(0x116)](0x0,_0x2a9da1);let _0x16dd7e=_0x80c917;while(stringWidth(_0x16dd7e+'…')>_0x2a9da1){_0x16dd7e=_0x16dd7e[_0x33556d(0x11f)](0x0,-0x1);}return _0x16dd7e+'…';}if(_0xbe394d===_0x2a9da1)return _0x80c917;const _0x331ab9=_0x2a9da1-_0xbe394d,_0x108d48=Math[_0x33556d(0x121)](_0x331ab9/0x2),_0x5909c0=_0x331ab9-_0x108d48;return'\x20'[_0x33556d(0x110)](_0x108d48)+_0x80c917+'\x20'[_0x33556d(0x110)](_0x5909c0);}export function escapeStringLiteral(_0x4a272f){const _0x4c4e04=a79_0x32ed;if(!_0x4a272f||_0x4a272f['trim']()[_0x4c4e04(0x126)]===0x0)throw new Error(_0x4c4e04(0x114));const _0x3ff646=_0x4a272f[_0x4c4e04(0x11c)](/'/g,'\x27\x27');return'\x27'+_0x3ff646+'\x27';}export function globToLike(_0xa881b9){const _0x238ac0=a79_0x32ed;let _0x2dffcf=_0xa881b9[_0x238ac0(0x11c)](/\\/g,'\x5c\x5c')[_0x238ac0(0x11c)](/%/g,'\x5c%')[_0x238ac0(0x11c)](/_/g,'\x5c_');return _0x2dffcf=_0x2dffcf[_0x238ac0(0x11c)](/\*/g,'%')[_0x238ac0(0x11c)](/\?/g,'_'),_0x2dffcf;}export function buildLikePattern(_0x3032d9){const _0x1ba7a1=a79_0x32ed;if(!_0x3032d9||_0x3032d9[_0x1ba7a1(0x11e)]()[_0x1ba7a1(0x126)]===0x0)throw new Error('Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string');const _0x4ac4ed=globToLike(_0x3032d9),_0x1cb85d=_0x4ac4ed[_0x1ba7a1(0x11c)](/'/g,'\x27\x27');return'\x27'+_0x1cb85d+'\x27';}export function matchGlobPattern(_0x3f31dc,_0x2a9335){const _0x10534e=a79_0x32ed,_0x2f9fc3=_0x2a9335['replace'](/[.+^${}()|[\]\\]/g,_0x10534e(0x127))[_0x10534e(0x11c)](/\*/g,'.*')[_0x10534e(0x11c)](/\?/g,'.'),_0x1637fc=new RegExp('^'+_0x2f9fc3+'$');return _0x1637fc[_0x10534e(0x128)](_0x3f31dc);}export function getSanitizedUsername(){const _0x30f8d4=a79_0x32ed,_0x337a31=process[_0x30f8d4(0x11d)]['USER']||process[_0x30f8d4(0x11d)]['USERNAME']||_0x30f8d4(0x119);return _0x337a31[_0x30f8d4(0x11c)](/[^a-zA-Z0-9]/g,'')[_0x30f8d4(0x115)]();}function a79_0x32ed(_0x2879b4,_0x4e1cb4){const _0x2e5d1b=a79_0x2e5d();return a79_0x32ed=function(_0x32ed80,_0xd61d28){_0x32ed80=_0x32ed80-0x110;let _0x2b8726=_0x2e5d1b[_0x32ed80];return _0x2b8726;},a79_0x32ed(_0x2879b4,_0x4e1cb4);}function a79_0x2e5d(){const _0x53eb7c=['unknown','5693022gZxwOM','5uWkTsw','replace','env','trim','slice','28NFnUJg','floor','280970BcknZm','958468okotWE','1372551KaoUcN','24ajGegA','length','\x5c$&','test','repeat','random','302656HiOOVu','padStart','Cannot\x20escape\x20empty\x20string\x20literal','toLowerCase','substring','24320970DAtado','1793817vqBYSX'];a79_0x2e5d=function(){return _0x53eb7c;};return a79_0x2e5d();}export function generateRandomHex(){const _0x2dc1b3=a79_0x32ed,_0x1ef929=Math[_0x2dc1b3(0x121)](Math[_0x2dc1b3(0x111)]()*0xfffff);return _0x1ef929['toString'](0x10)[_0x2dc1b3(0x113)](0x5,'0');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a80_0x184e(_0x36fe03,_0x272139){const _0x20445f=a80_0x2044();return a80_0x184e=function(_0x184e80,_0x4436a4){_0x184e80=_0x184e80-0x12b;let _0x5d0921=_0x20445f[_0x184e80];return _0x5d0921;},a80_0x184e(_0x36fe03,_0x272139);}(function(_0x43cd59,_0x11371f){const _0x738688=a80_0x184e,_0x4e1bcd=_0x43cd59();while(!![]){try{const _0x36551d=parseInt(_0x738688(0x140))/0x1*(-parseInt(_0x738688(0x144))/0x2)+-parseInt(_0x738688(0x12f))/0x3*(-parseInt(_0x738688(0x13a))/0x4)+parseInt(_0x738688(0x136))/0x5+parseInt(_0x738688(0x130))/0x6*(parseInt(_0x738688(0x135))/0x7)+parseInt(_0x738688(0x137))/0x8+parseInt(_0x738688(0x132))/0x9+parseInt(_0x738688(0x13d))/0xa*(-parseInt(_0x738688(0x12d))/0xb);if(_0x36551d===_0x11371f)break;else _0x4e1bcd['push'](_0x4e1bcd['shift']());}catch(_0xfaff04){_0x4e1bcd['push'](_0x4e1bcd['shift']());}}}(a80_0x2044,0x47147));function hasWildcard(_0x5a5621){const _0xd51065=a80_0x184e;return _0x5a5621[_0xd51065(0x12b)]('*')||_0x5a5621[_0xd51065(0x12b)]('?');}export function parseTableReference(_0x32da31){const _0x239b23=a80_0x184e;if(!_0x32da31||_0x32da31[_0x239b23(0x13b)]()['length']===0x0)throw new Error(_0x239b23(0x138));const _0x3caacb=_0x32da31['trim'](),_0x348f61={'original':_0x3caacb},_0x2b73d9=_0x3caacb[_0x239b23(0x142)]('.');if(_0x2b73d9[_0x239b23(0x143)]===0x1){const _0x2be7da=_0x2b73d9[0x0];if(!_0x2be7da)throw new Error(_0x239b23(0x146));_0x348f61[_0x239b23(0x13f)]=_0x2be7da;}else{if(_0x2b73d9[_0x239b23(0x143)]===0x2){const [_0xb4fd74,_0x159224]=_0x2b73d9;if(!_0xb4fd74)throw new Error(_0x239b23(0x133));if(!_0x159224)throw new Error('Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)');_0x348f61['database']=_0xb4fd74,_0x348f61[_0x239b23(0x13f)]=_0x159224;}else{if(_0x2b73d9[_0x239b23(0x143)]===0x3){const [_0x319491,_0x2a0c5a,_0x504c3c]=_0x2b73d9;if(!_0x319491||!_0x2a0c5a||!_0x504c3c)throw new Error(_0x239b23(0x145));_0x348f61[_0x239b23(0x134)]=_0x319491,_0x348f61[_0x239b23(0x12c)]=_0x2a0c5a,_0x348f61['table']=_0x504c3c;}else throw new Error(_0x239b23(0x13e));}}return _0x348f61;}export function formatTableReference(_0x16a632){const _0x339c5a=a80_0x184e,_0x443d0f=[];return _0x16a632[_0x339c5a(0x134)]&&_0x443d0f[_0x339c5a(0x131)](_0x16a632[_0x339c5a(0x134)]),_0x16a632[_0x339c5a(0x12c)]&&_0x443d0f[_0x339c5a(0x131)](_0x16a632[_0x339c5a(0x12c)]),_0x16a632[_0x339c5a(0x13f)]&&_0x443d0f[_0x339c5a(0x131)](_0x16a632[_0x339c5a(0x13f)]),_0x443d0f[_0x339c5a(0x12e)]('.');}export function validateTableListReference(_0xc248e1){return undefined;}export function validateTableDescribeReference(_0x75ead2){const _0x4af82e=a80_0x184e;if(!_0x75ead2[_0x4af82e(0x13f)])return _0x4af82e(0x13c);if(_0x75ead2['database']&&hasWildcard(_0x75ead2[_0x4af82e(0x12c)]))return _0x4af82e(0x139);if(hasWildcard(_0x75ead2[_0x4af82e(0x13f)]))return _0x4af82e(0x141);return undefined;}function a80_0x2044(){const _0x1fee16=['Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','catalog','1130927juMNbx','368885cuflro','3400512CGqpbF','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','673772vLdpXD','trim','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','20IsEEDl','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','table','1ogVbap','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','split','length','1106606aIVvLr','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','Pattern\x20cannot\x20be\x20just\x20a\x20dot','includes','database','5902633WmVlEa','join','9YusMus','18zNgBhX','push','3859191ZrRagG'];a80_0x2044=function(){return _0x1fee16;};return a80_0x2044();}
|