@treasuredata/tdx 0.8.1 → 0.8.3
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/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-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.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +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/engage-command.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-pull-command.js +1 -1
- package/dist/commands/segment-push-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/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts +11 -19
- 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/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/conversation-utils.js.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +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/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.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/diff.js +1 -1
- package/dist/utils/fields-display.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/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.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-config.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 +1 -1
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1259e8,_0x5e3e68){const _0x566719=a88_0x9179,_0x17cc93=_0x1259e8();while(!![]){try{const _0x4c32f0=parseInt(_0x566719(0xa6))/0x1*(parseInt(_0x566719(0xa1))/0x2)+parseInt(_0x566719(0xad))/0x3*(-parseInt(_0x566719(0xb5))/0x4)+parseInt(_0x566719(0xa8))/0x5+-parseInt(_0x566719(0xab))/0x6*(-parseInt(_0x566719(0xb9))/0x7)+-parseInt(_0x566719(0xa5))/0x8*(-parseInt(_0x566719(0xaf))/0x9)+-parseInt(_0x566719(0xb2))/0xa+parseInt(_0x566719(0xb4))/0xb;if(_0x4c32f0===_0x5e3e68)break;else _0x17cc93['push'](_0x17cc93['shift']());}catch(_0x3f35e8){_0x17cc93['push'](_0x17cc93['shift']());}}}(a88_0x2943,0xc9e34));import{Chalk}from'chalk';export function shouldUseColor(_0x16092c={}){const _0x29bc07=a88_0x9179;if(_0x16092c[_0x29bc07(0xb3)]===!![])return![];if(_0x16092c[_0x29bc07(0xa4)]===!![])return!![];if(process[_0x29bc07(0xae)][_0x29bc07(0xa2)]!==undefined)return![];return process['stdout'][_0x29bc07(0xb6)]??![];}export function getChalk(_0x318946={}){if(shouldUseColor(_0x318946))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0xfc4aa6,_0x103f9a={}){return getChalk(_0x103f9a)['dim'](_0xfc4aa6);}export function colorHeader(_0x36fa05,_0x554676={}){const _0x1b0f46=a88_0x9179;return getChalk(_0x554676)[_0x1b0f46(0xb1)](_0x36fa05);}export function colorType(_0x1be35a,_0x20e5b0={}){return getChalk(_0x20e5b0)['dim'](_0x1be35a);}function a88_0x9179(_0x5d7cf5,_0xf77cd){_0x5d7cf5=_0x5d7cf5-0x9f;const _0x294332=a88_0x2943();let _0x91796f=_0x294332[_0x5d7cf5];return _0x91796f;}export function colorJSONKey(_0x38aecc,_0x11e2e8={}){const _0x5c0c2b=a88_0x9179;return getChalk(_0x11e2e8)[_0x5c0c2b(0xb0)](_0x38aecc);}export function colorJSONString(_0x12b9c0,_0x39b4a9={}){return getChalk(_0x39b4a9)['green'](_0x12b9c0);}export function colorJSONNumber(_0x2b4334,_0x8e00d8={}){const _0x17cee6=a88_0x9179;return getChalk(_0x8e00d8)[_0x17cee6(0xb1)](_0x2b4334);}export function colorJSONBoolean(_0x5558f3,_0x526f7b={}){const _0x3ca77f=a88_0x9179;return getChalk(_0x526f7b)[_0x3ca77f(0xbb)](_0x5558f3);}export function colorJSONNull(_0x2638ba,_0x325aa9={}){const _0x3f2881=a88_0x9179;return getChalk(_0x325aa9)[_0x3f2881(0xb7)](_0x2638ba);}function a88_0x2943(){const _0x3f799b=['blue','cyan','12820540iBgtXp','noColor','7619161FZPWdE','44lAHxab','isTTY','dim','join','42tMjFxJ','repeat','yellow','null','boolean','entries','66526GtdWvQ','NO_COLOR','length','color','8OEfqaO','25CSjInN','number','2686915BXvjdq','map','string','510684XZCXrp','stringify','359703XXZdrj','env','7700436aIQwpD'];a88_0x2943=function(){return _0x3f799b;};return a88_0x2943();}export function colorizeJSONCompact(_0xe96465,_0x2016c4={}){const _0x495501=a88_0x9179;if(!shouldUseColor(_0x2016c4))return JSON[_0x495501(0xac)](_0xe96465);if(_0xe96465===null)return colorJSONNull(_0x495501(0xbc),_0x2016c4);if(typeof _0xe96465===_0x495501(0x9f))return colorJSONBoolean(String(_0xe96465),_0x2016c4);if(typeof _0xe96465===_0x495501(0xa7))return colorJSONNumber(String(_0xe96465),_0x2016c4);if(typeof _0xe96465==='string')return colorJSONString(JSON['stringify'](_0xe96465),_0x2016c4);if(Array['isArray'](_0xe96465)){if(_0xe96465[_0x495501(0xa3)]===0x0)return'[]';const _0x1be42b=_0xe96465['map'](_0x91a725=>colorizeJSONCompact(_0x91a725,_0x2016c4));return'['+_0x1be42b[_0x495501(0xb8)](',')+']';}if(typeof _0xe96465==='object'){const _0x1d85d3=Object[_0x495501(0xa0)](_0xe96465);if(_0x1d85d3[_0x495501(0xa3)]===0x0)return'{}';const _0x140fdf=_0x1d85d3[_0x495501(0xa9)](([_0x1a1f95,_0x4f98f1])=>{const _0x20816a=colorJSONKey(JSON['stringify'](_0x1a1f95),_0x2016c4),_0x2e1249=colorizeJSONCompact(_0x4f98f1,_0x2016c4);return _0x20816a+':'+_0x2e1249;});return'{'+_0x140fdf[_0x495501(0xb8)](',')+'}';}return String(_0xe96465);}export function colorizeJSON(_0x564644,_0x22c9af={},_0x3df2e0=0x0){const _0x5f08e2=a88_0x9179;if(!shouldUseColor(_0x22c9af))return JSON[_0x5f08e2(0xac)](_0x564644,null,0x2);const _0x52416a='\x20'[_0x5f08e2(0xba)](_0x3df2e0),_0x4e3474=_0x3df2e0+0x2;if(_0x564644===null)return colorJSONNull(_0x5f08e2(0xbc),_0x22c9af);if(typeof _0x564644===_0x5f08e2(0x9f))return colorJSONBoolean(String(_0x564644),_0x22c9af);if(typeof _0x564644===_0x5f08e2(0xa7))return colorJSONNumber(String(_0x564644),_0x22c9af);if(typeof _0x564644===_0x5f08e2(0xaa))return colorJSONString(JSON['stringify'](_0x564644),_0x22c9af);if(Array['isArray'](_0x564644)){if(_0x564644[_0x5f08e2(0xa3)]===0x0)return'[]';const _0x4f95cf=_0x564644['map'](_0x12d512=>{const _0x121477=colorizeJSON(_0x12d512,_0x22c9af,_0x4e3474);return''+'\x20'['repeat'](_0x4e3474)+_0x121477;});return'[\x0a'+_0x4f95cf['join'](',\x0a')+('\x0a'+_0x52416a+']');}if(typeof _0x564644==='object'){const _0x395eda=Object[_0x5f08e2(0xa0)](_0x564644);if(_0x395eda[_0x5f08e2(0xa3)]===0x0)return'{}';const _0x15a5f7=_0x395eda[_0x5f08e2(0xa9)](([_0x4679fa,_0x5d7fea])=>{const _0xe457db=_0x5f08e2,_0xe2456e=colorJSONKey(JSON[_0xe457db(0xac)](_0x4679fa),_0x22c9af),_0x5a8729=colorizeJSON(_0x5d7fea,_0x22c9af,_0x4e3474);return''+'\x20'[_0xe457db(0xba)](_0x4e3474)+_0xe2456e+':\x20'+_0x5a8729;});return'{\x0a'+_0x15a5f7['join'](',\x0a')+('\x0a'+_0x52416a+'}');}return String(_0x564644);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4c8191,_0x1bd007){const _0x53afce=a89_0x2c77,_0x3ca615=_0x4c8191();while(!![]){try{const _0x26e2ac=parseInt(_0x53afce(0x1ef))/0x1*(-parseInt(_0x53afce(0x1e3))/0x2)+-parseInt(_0x53afce(0x1e7))/0x3+-parseInt(_0x53afce(0x1ec))/0x4+parseInt(_0x53afce(0x1ae))/0x5+-parseInt(_0x53afce(0x1df))/0x6*(parseInt(_0x53afce(0x1e2))/0x7)+parseInt(_0x53afce(0x1b5))/0x8*(parseInt(_0x53afce(0x1b1))/0x9)+-parseInt(_0x53afce(0x1cb))/0xa*(-parseInt(_0x53afce(0x1b3))/0xb);if(_0x26e2ac===_0x1bd007)break;else _0x3ca615['push'](_0x3ca615['shift']());}catch(_0xd41906){_0x3ca615['push'](_0x3ca615['shift']());}}}(a89_0x2d05,0x622eb));import{writeFileSync}from'fs';function a89_0x2c77(_0x193d26,_0x23b1db){_0x193d26=_0x193d26-0x1a9;const _0x2d05ff=a89_0x2d05();let _0x2c771d=_0x2d05ff[_0x193d26];return _0x2c771d;}import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a89_0x543509 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function isStructuredFormat(_0x1690ad){const _0x47fd22=a89_0x2c77;return _0x1690ad[_0x47fd22(0x1c8)]===_0x47fd22(0x1c5)||_0x1690ad[_0x47fd22(0x1c8)]==='jsonl'||_0x1690ad['format']===_0x47fd22(0x1da)||_0x1690ad[_0x47fd22(0x1c8)]==='table'||_0x1690ad[_0x47fd22(0x1c5)]===!![]||_0x1690ad['jsonl']===!![]||_0x1690ad[_0x47fd22(0x1da)]===!![]||_0x1690ad['table']===!![];}export function parseOutputOptions(_0x3f5b13){const _0x25bc19=a89_0x2c77;return{'format':_0x3f5b13[_0x25bc19(0x1c8)]||_0x25bc19(0x1c7),'output':_0x3f5b13[_0x25bc19(0x1b0)]||'','limit':_0x3f5b13[_0x25bc19(0x1ea)],'color':_0x3f5b13[_0x25bc19(0x1d7)],'noColor':_0x3f5b13[_0x25bc19(0x1ad)]};}function convertSDKResultToQueryResult(_0x2461bc){const _0x628a59=a89_0x2c77,_0x2af450=[];if(_0x2461bc['length']>0x0){const _0xc3c157=_0x2461bc[0x0];for(const [_0x155525,_0xa382b9]of Object[_0x628a59(0x1eb)](_0xc3c157)){let _0x4d9147=_0x628a59(0x1e6);if(typeof _0xa382b9===_0x628a59(0x1d1))_0x4d9147=Number[_0x628a59(0x1ac)](_0xa382b9)?_0x628a59(0x1b2):_0x628a59(0x1d8);else{if(typeof _0xa382b9===_0x628a59(0x1c6))_0x4d9147=_0x628a59(0x1c6);else _0xa382b9===null&&(_0x4d9147=_0x628a59(0x1e6));}_0x2af450[_0x628a59(0x1cd)]({'name':_0x155525,'type':_0x4d9147});}}return{'queryId':_0x628a59(0x1c9),'columns':_0x2af450,'data':_0x2461bc,'stats':{'state':_0x628a59(0x1f0),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2461bc['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2b464b,_0x16da62){const _0x18dbf7=convertSDKResultToQueryResult(_0x2b464b);return formatQueryOutput(_0x18dbf7,_0x16da62);}export async function formatQueryOutput(_0x4de2bb,_0x2f682a){const _0x28ad07=a89_0x2c77,{format:_0xef12f8,limit:_0x8e9203,output:_0xb1c8fa,color:_0x3e8a6e,noColor:_0x1c3606}=_0x2f682a,_0x4f356c=Boolean(_0xb1c8fa)&&!_0x3e8a6e,_0x1e836f={'color':_0x3e8a6e,'noColor':_0x1c3606||_0x4f356c};if(_0xef12f8===_0x28ad07(0x1c7)){const _0x5ea200=shouldUseLess(_0xef12f8,_0xb1c8fa);return formatAsTable(_0x4de2bb,_0x8e9203,_0x5ea200,_0x1e836f);}else{if(_0xef12f8===_0x28ad07(0x1c5))return formatAsJSON(_0x4de2bb,_0x1e836f);else return _0xef12f8==='jsonl'?formatAsJSONL(_0x4de2bb,_0x1e836f):formatQueryResult(_0x4de2bb,_0xef12f8);}}function shouldUseLess(_0x49aa52,_0x5cda64){const _0x2093f0=a89_0x2c77;return _0x49aa52===_0x2093f0(0x1c7)&&process[_0x2093f0(0x1ca)][_0x2093f0(0x1b9)]&&!_0x5cda64;}function a89_0x2d05(){const _0x3cb8b1=['debug','cyan','forEach','red','[query]','end','json','boolean','table','format','sdk-result','stdout','20mEyouI','padEnd','push','cmdout','[Object]','resolve','number','query','[error]','map','[params]','spawn','color','double','length','tsv','max','log','filter','keys','115932LbqYIs','jsonl','repeat','189yuAaFt','695904QXgTie','params','split','varchar','2176584oPKGFh','less','bold','limit','entries','1662748vByCgR','blue','close','1yApLYJ','FINISHED','inherit','stdin','join','isInteger','noColor','1273475SntRdn','yellow','output','1867167QcSumK','bigint','10729719gHcfJD','-FXRSn','8cAzQPj','error','stringify','No\x20data','isTTY','trim','stderr','string','rule','object'];a89_0x2d05=function(){return _0x3cb8b1;};return a89_0x2d05();}export function resolveOutputOptions(_0x360167){const _0x4fa3f6=a89_0x2c77,_0x1e51fd=resolveOutputFormat(_0x360167['format'],_0x360167['output'],_0x4fa3f6(0x1c7));let _0x4a37f9=typeof _0x360167['limit']===_0x4fa3f6(0x1d1)?_0x360167[_0x4fa3f6(0x1ea)]:parseInt(_0x360167[_0x4fa3f6(0x1ea)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x14a8ee=_0x360167[_0x4fa3f6(0x1b0)]||'';return shouldUseLess(_0x1e51fd,_0x14a8ee)&&(_0x4a37f9=Infinity),{'format':_0x1e51fd,'output':_0x14a8ee,'limit':_0x4a37f9,'color':_0x360167[_0x4fa3f6(0x1d7)],'noColor':_0x360167[_0x4fa3f6(0x1ad)]};}export function writeOutput(_0x3973d1,_0x1cf89a,_0x2a7c27){const _0x3ebe7f=a89_0x2c77;return _0x1cf89a?(writeFileSync(_0x1cf89a,_0x3973d1),console['error']('Results\x20saved\x20to\x20'+_0x1cf89a),Promise[_0x3ebe7f(0x1d0)]()):shouldUseLess(_0x2a7c27||'','')?new Promise(_0x5fbdb5=>{const _0x19f606=_0x3ebe7f,_0xe33ba=spawn(_0x19f606(0x1e8),[_0x19f606(0x1b4)],{'stdio':['pipe',_0x19f606(0x1a9),_0x19f606(0x1a9)]});let _0x2c6f63=![];_0xe33ba['on'](_0x19f606(0x1b6),()=>{const _0x1560e5=_0x19f606;!_0x2c6f63&&(_0x2c6f63=!![],console[_0x1560e5(0x1dc)](_0x3973d1),_0x5fbdb5());}),_0xe33ba['on'](_0x19f606(0x1ee),()=>{!_0x2c6f63&&(_0x2c6f63=!![],_0x5fbdb5());}),_0xe33ba['on'](_0x19f606(0x1d6),()=>{const _0x485351=_0x19f606;!_0x2c6f63&&_0xe33ba[_0x485351(0x1aa)]&&(_0xe33ba[_0x485351(0x1aa)]['on'](_0x485351(0x1b6),()=>{}),_0xe33ba[_0x485351(0x1aa)]['write'](_0x3973d1),_0xe33ba['stdin'][_0x485351(0x1c4)]());}),!_0xe33ba[_0x19f606(0x1aa)]&&(!_0x2c6f63&&(_0x2c6f63=!![],console[_0x19f606(0x1dc)](_0x3973d1),_0x5fbdb5()));}):(console[_0x3ebe7f(0x1dc)](_0x3973d1),Promise[_0x3ebe7f(0x1d0)]());}export async function handleSDKOutput(_0x340ec7,_0xc93770){const _0xf5da87=a89_0x2c77,_0x31e70d=resolveOutputOptions(_0xc93770),_0x39759=await formatSDKOutput(_0x340ec7,_0x31e70d);await writeOutput(_0x39759,_0x31e70d[_0xf5da87(0x1b0)]||undefined,_0x31e70d[_0xf5da87(0x1c8)]);}export async function handleQueryOutput(_0x6a7153,_0x2fe2c4){const _0xe0c098=a89_0x2c77,_0x5ced7c=resolveOutputOptions(_0x2fe2c4),_0x14b981=await formatQueryOutput(_0x6a7153,_0x5ced7c);await writeOutput(_0x14b981,_0x5ced7c[_0xe0c098(0x1b0)]||undefined,_0x5ced7c[_0xe0c098(0x1c8)]);}async function formatSingleObject(_0x2b71e5,_0x406390){const _0x2e05ec=a89_0x2c77,{format:_0xab1980,color:_0x2d49cf,noColor:_0x59da60}=_0x406390,_0x31dd6e={'color':_0x2d49cf,'noColor':_0x59da60};if(_0xab1980==='json'){if(shouldUseColor(_0x31dd6e))return colorizeJSON(_0x2b71e5,_0x31dd6e);return JSON[_0x2e05ec(0x1b7)](_0x2b71e5,null,0x2);}else{if(_0xab1980===_0x2e05ec(0x1e0)){if(shouldUseColor(_0x31dd6e))return colorizeJSONCompact(_0x2b71e5,_0x31dd6e);return JSON['stringify'](_0x2b71e5);}else{if(_0xab1980===_0x2e05ec(0x1da))return Object['entries'](_0x2b71e5)[_0x2e05ec(0x1d4)](([_0x3935e0,_0x42cf63])=>_0x3935e0+'\x09'+_0x42cf63)[_0x2e05ec(0x1ab)]('\x0a');else{const _0x18f648=Object[_0x2e05ec(0x1eb)](_0x2b71e5);if(_0x18f648['length']===0x0)return _0x2e05ec(0x1b8);const _0x5c5200=_0x2b71e5[_0x2e05ec(0x1bf)],_0x5a1ea3=_0x2b71e5['query'],_0x4bc969=_0x2b71e5[_0x2e05ec(0x1e4)],_0x57032b=_0x2b71e5[_0x2e05ec(0x1bd)],_0x55cd1a=_0x5a1ea3?typeof _0x5a1ea3===_0x2e05ec(0x1bc)?_0x5a1ea3:JSON[_0x2e05ec(0x1b7)](_0x5a1ea3,null,0x2):undefined,_0x21c116=_0x4bc969&&Object['keys'](_0x4bc969)[_0x2e05ec(0x1d9)]>0x0?JSON['stringify'](_0x4bc969,null,0x2):undefined,_0x3358b6=_0x57032b&&Object[_0x2e05ec(0x1de)](_0x57032b)[_0x2e05ec(0x1d9)]>0x0?JSON[_0x2e05ec(0x1b7)](_0x57032b,null,0x2):undefined,_0x52bc12=_0x18f648[_0x2e05ec(0x1dd)](([_0x7dbb6])=>_0x7dbb6!=='debug'&&_0x7dbb6!==_0x2e05ec(0x1d2)&&_0x7dbb6!==_0x2e05ec(0x1e4)&&_0x7dbb6!=='rule'),_0x25f01b=Math['max'](..._0x52bc12['map'](([_0x3df45d])=>_0x3df45d[_0x2e05ec(0x1d9)])),_0x5439ae=Math[_0x2e05ec(0x1db)](..._0x52bc12['map'](([,_0xce16b8])=>{const _0x4dde17=_0x2e05ec;try{const _0x224e95=_0xce16b8===null||_0xce16b8===undefined?'':typeof _0xce16b8===_0x4dde17(0x1be)?JSON['stringify'](_0xce16b8):String(_0xce16b8),_0x57d90e=_0x224e95[_0x4dde17(0x1e5)]('\x0a');return Math[_0x4dde17(0x1db)](..._0x57d90e['map'](_0x59023a=>_0x59023a[_0x4dde17(0x1d9)]),0x0);}catch{return 0x0;}}),0x14),_0x119a9e=[];_0x119a9e[_0x2e05ec(0x1cd)](colorBorder('┌─'+'─'['repeat'](_0x25f01b)+'─┬─'+'─'[_0x2e05ec(0x1e1)](_0x5439ae)+'─┐',_0x31dd6e)),_0x52bc12[_0x2e05ec(0x1c1)](([_0x11feb7,_0x4480f0])=>{const _0x1a2451=_0x2e05ec;let _0x4cb0f4;try{_0x4cb0f4=_0x4480f0===null||_0x4480f0===undefined?'':typeof _0x4480f0==='object'?JSON[_0x1a2451(0x1b7)](_0x4480f0):String(_0x4480f0);}catch{_0x4cb0f4=_0x1a2451(0x1cf);}const _0x12fe56=_0x11feb7[_0x1a2451(0x1cc)](_0x25f01b),_0x5efc5b=_0x4cb0f4[_0x1a2451(0x1e5)]('\x0a');_0x5efc5b[_0x1a2451(0x1c1)]((_0x3e94ad,_0x2a4c7b)=>{const _0x1294e1=_0x1a2451,_0x344ac0=colorBorder('│',_0x31dd6e);_0x2a4c7b===0x0?_0x119a9e[_0x1294e1(0x1cd)](_0x344ac0+'\x20'+_0x12fe56+'\x20'+_0x344ac0+'\x20'+_0x3e94ad[_0x1294e1(0x1cc)](_0x5439ae)+'\x20'+_0x344ac0):_0x119a9e[_0x1294e1(0x1cd)](_0x344ac0+'\x20'+'\x20'[_0x1294e1(0x1e1)](_0x25f01b)+'\x20'+_0x344ac0+'\x20'+_0x3e94ad[_0x1294e1(0x1cc)](_0x5439ae)+'\x20'+_0x344ac0);});}),_0x119a9e[_0x2e05ec(0x1cd)](colorBorder('└─'+'─'[_0x2e05ec(0x1e1)](_0x25f01b)+'─┴─'+'─'['repeat'](_0x5439ae)+'─┘',_0x31dd6e));_0x55cd1a&&(_0x119a9e[_0x2e05ec(0x1cd)](''),_0x119a9e['push'](String(a89_0x543509[_0x2e05ec(0x1af)][_0x2e05ec(0x1e9)](_0x2e05ec(0x1c3)))),_0x119a9e[_0x2e05ec(0x1cd)](_0x55cd1a));_0x21c116&&(_0x119a9e[_0x2e05ec(0x1cd)](''),_0x119a9e[_0x2e05ec(0x1cd)](String(a89_0x543509[_0x2e05ec(0x1ed)][_0x2e05ec(0x1e9)](_0x2e05ec(0x1d5)))),_0x119a9e[_0x2e05ec(0x1cd)](_0x21c116));_0x3358b6&&(_0x119a9e[_0x2e05ec(0x1cd)](''),_0x119a9e[_0x2e05ec(0x1cd)](String(a89_0x543509['magenta'][_0x2e05ec(0x1e9)]('[rule]'))),_0x119a9e[_0x2e05ec(0x1cd)](_0x3358b6));if(_0x5c5200){if(_0x5c5200[_0x2e05ec(0x1bb)]){_0x119a9e['push'](''),_0x119a9e[_0x2e05ec(0x1cd)](String(a89_0x543509[_0x2e05ec(0x1c2)]['bold'](_0x2e05ec(0x1d3))));const _0x1c96e0=_0x5c5200[_0x2e05ec(0x1bb)][_0x2e05ec(0x1e5)]('\x0a');_0x1c96e0[_0x2e05ec(0x1c1)](_0x1cb6d2=>{const _0x2fe5fc=_0x2e05ec;_0x1cb6d2[_0x2fe5fc(0x1ba)]()&&_0x119a9e[_0x2fe5fc(0x1cd)](_0x1cb6d2);});}if(_0x5c5200[_0x2e05ec(0x1ce)]){_0x119a9e[_0x2e05ec(0x1cd)](''),_0x119a9e['push'](String(a89_0x543509[_0x2e05ec(0x1c0)][_0x2e05ec(0x1e9)]('[logs]')));const _0x2c684c=_0x5c5200[_0x2e05ec(0x1ce)]['split']('\x0a');_0x2c684c[_0x2e05ec(0x1c1)](_0x1c4e86=>{const _0x2cb9bf=_0x2e05ec;_0x1c4e86[_0x2cb9bf(0x1ba)]()&&_0x119a9e[_0x2cb9bf(0x1cd)](_0x1c4e86);});}}return _0x119a9e['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x322938,_0x271241){const _0x44ea4f=a89_0x2c77;if(_0x271241[_0x44ea4f(0x1c8)]===_0x44ea4f(0x1c7)){await handleSDKOutput([_0x322938],_0x271241);return;}const _0x36ae49=resolveOutputOptions(_0x271241),_0x4564a3=await formatSingleObject(_0x322938,_0x36ae49);await writeOutput(_0x4564a3,_0x36ae49[_0x44ea4f(0x1b0)]||undefined,_0x36ae49['format']);}
|
|
1
|
+
(function(_0x5acdd6,_0xbf1cae){const _0x61de3c=a89_0x3810,_0x376e81=_0x5acdd6();while(!![]){try{const _0x312779=-parseInt(_0x61de3c(0x1e7))/0x1*(-parseInt(_0x61de3c(0x1f0))/0x2)+parseInt(_0x61de3c(0x1cc))/0x3*(-parseInt(_0x61de3c(0x1b3))/0x4)+parseInt(_0x61de3c(0x1e3))/0x5+-parseInt(_0x61de3c(0x1d1))/0x6*(parseInt(_0x61de3c(0x1cf))/0x7)+-parseInt(_0x61de3c(0x1df))/0x8*(-parseInt(_0x61de3c(0x1b6))/0x9)+parseInt(_0x61de3c(0x1c1))/0xa*(parseInt(_0x61de3c(0x1e9))/0xb)+-parseInt(_0x61de3c(0x1c9))/0xc;if(_0x312779===_0xbf1cae)break;else _0x376e81['push'](_0x376e81['shift']());}catch(_0x73275){_0x376e81['push'](_0x376e81['shift']());}}}(a89_0x37ee,0x6a6ed));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a89_0x168a47 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';function a89_0x3810(_0x3ccfe5,_0x16cd68){_0x3ccfe5=_0x3ccfe5-0x1b1;const _0x37eeff=a89_0x37ee();let _0x38107d=_0x37eeff[_0x3ccfe5];return _0x38107d;}export function isStructuredFormat(_0x301562){const _0x2b8701=a89_0x3810;return _0x301562[_0x2b8701(0x1c3)]===_0x2b8701(0x1da)||_0x301562[_0x2b8701(0x1c3)]===_0x2b8701(0x1ba)||_0x301562['format']==='tsv'||_0x301562['format']===_0x2b8701(0x1f2)||_0x301562[_0x2b8701(0x1da)]===!![]||_0x301562[_0x2b8701(0x1ba)]===!![]||_0x301562[_0x2b8701(0x1de)]===!![]||_0x301562['table']===!![];}export function parseOutputOptions(_0x5bcdf7){const _0x29b6ec=a89_0x3810;return{'format':_0x5bcdf7['format']||'table','output':_0x5bcdf7[_0x29b6ec(0x1b7)]||'','limit':_0x5bcdf7[_0x29b6ec(0x1d2)],'color':_0x5bcdf7[_0x29b6ec(0x1ef)],'noColor':_0x5bcdf7[_0x29b6ec(0x1bd)]};}function convertSDKResultToQueryResult(_0x123b81){const _0x10e0db=a89_0x3810,_0x3c8c76=[];if(_0x123b81[_0x10e0db(0x1ee)]>0x0){const _0x39496d=_0x123b81[0x0];for(const [_0x244bf6,_0x324405]of Object[_0x10e0db(0x1e2)](_0x39496d)){let _0x4a1817=_0x10e0db(0x1f8);if(typeof _0x324405===_0x10e0db(0x1ed))_0x4a1817=Number[_0x10e0db(0x1c7)](_0x324405)?_0x10e0db(0x1f6):'double';else{if(typeof _0x324405===_0x10e0db(0x1d0))_0x4a1817='boolean';else _0x324405===null&&(_0x4a1817=_0x10e0db(0x1f8));}_0x3c8c76[_0x10e0db(0x1cb)]({'name':_0x244bf6,'type':_0x4a1817});}}return{'queryId':'sdk-result','columns':_0x3c8c76,'data':_0x123b81,'stats':{'state':_0x10e0db(0x1f3),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x123b81[_0x10e0db(0x1ee)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4ed75b,_0x5242ab){const _0x2093ed=convertSDKResultToQueryResult(_0x4ed75b);return formatQueryOutput(_0x2093ed,_0x5242ab);}export async function formatQueryOutput(_0x542e42,_0x4991a8){const _0x5eff4d=a89_0x3810,{format:_0x418713,limit:_0x385373,output:_0x57523f,color:_0x1ccdb7,noColor:_0x1e4038}=_0x4991a8,_0x135eb1=Boolean(_0x57523f)&&!_0x1ccdb7,_0x38b47f={'color':_0x1ccdb7,'noColor':_0x1e4038||_0x135eb1};if(_0x418713===_0x5eff4d(0x1f2)){const _0x5dbee8=shouldUseLess(_0x418713,_0x57523f);return formatAsTable(_0x542e42,_0x385373,_0x5dbee8,_0x38b47f);}else{if(_0x418713==='json')return formatAsJSON(_0x542e42,_0x38b47f);else return _0x418713==='jsonl'?formatAsJSONL(_0x542e42,_0x38b47f):formatQueryResult(_0x542e42,_0x418713);}}function shouldUseLess(_0x5a96cf,_0x40afe6){const _0x41406d=a89_0x3810;return _0x5a96cf===_0x41406d(0x1f2)&&process[_0x41406d(0x1db)]['isTTY']&&!_0x40afe6;}export function resolveOutputOptions(_0x6a383e){const _0x57a6f9=a89_0x3810,_0x5666da=resolveOutputFormat(_0x6a383e[_0x57a6f9(0x1c3)],_0x6a383e['output'],_0x57a6f9(0x1f2));let _0x4ae7ec=typeof _0x6a383e[_0x57a6f9(0x1d2)]==='number'?_0x6a383e['limit']:parseInt(_0x6a383e[_0x57a6f9(0x1d2)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x10b37a=_0x6a383e[_0x57a6f9(0x1b7)]||'';return shouldUseLess(_0x5666da,_0x10b37a)&&(_0x4ae7ec=Infinity),{'format':_0x5666da,'output':_0x10b37a,'limit':_0x4ae7ec,'color':_0x6a383e[_0x57a6f9(0x1ef)],'noColor':_0x6a383e['noColor']};}export function writeOutput(_0x291a15,_0x1eef54,_0x5dc926){const _0x306b8e=a89_0x3810;return _0x1eef54?(writeFileSync(_0x1eef54,_0x291a15),console[_0x306b8e(0x1c2)](_0x306b8e(0x1dc)+_0x1eef54),Promise[_0x306b8e(0x1d5)]()):shouldUseLess(_0x5dc926||'','')?new Promise(_0x19407=>{const _0x205988=_0x306b8e,_0x487073=spawn(_0x205988(0x1e6),['-FXRSn'],{'stdio':[_0x205988(0x1d8),_0x205988(0x1f5),'inherit']});let _0xfb62a9=![];_0x487073['on'](_0x205988(0x1c2),()=>{const _0x15bf06=_0x205988;!_0xfb62a9&&(_0xfb62a9=!![],console[_0x15bf06(0x1c0)](_0x291a15),_0x19407());}),_0x487073['on'](_0x205988(0x1d4),()=>{!_0xfb62a9&&(_0xfb62a9=!![],_0x19407());}),_0x487073['on'](_0x205988(0x1b8),()=>{const _0x327b9a=_0x205988;!_0xfb62a9&&_0x487073[_0x327b9a(0x1ea)]&&(_0x487073[_0x327b9a(0x1ea)]['on']('error',()=>{}),_0x487073[_0x327b9a(0x1ea)][_0x327b9a(0x1e5)](_0x291a15),_0x487073[_0x327b9a(0x1ea)]['end']());}),!_0x487073[_0x205988(0x1ea)]&&(!_0xfb62a9&&(_0xfb62a9=!![],console[_0x205988(0x1c0)](_0x291a15),_0x19407()));}):(console['log'](_0x291a15),Promise['resolve']());}export async function handleSDKOutput(_0x5750af,_0x458081){const _0x51dfa8=a89_0x3810,_0x492f4f=resolveOutputOptions(_0x458081),_0x4bc1d0=await formatSDKOutput(_0x5750af,_0x492f4f);await writeOutput(_0x4bc1d0,_0x492f4f[_0x51dfa8(0x1b7)]||undefined,_0x492f4f[_0x51dfa8(0x1c3)]);}export async function handleQueryOutput(_0x3256af,_0x465813){const _0x231811=a89_0x3810,_0x3ec0bc=resolveOutputOptions(_0x465813),_0x46b3d7=await formatQueryOutput(_0x3256af,_0x3ec0bc);await writeOutput(_0x46b3d7,_0x3ec0bc[_0x231811(0x1b7)]||undefined,_0x3ec0bc[_0x231811(0x1c3)]);}function a89_0x37ee(){const _0x49c076=['number','length','color','1319666cSuNGg','keys','table','FINISHED','forEach','inherit','bigint','blue','varchar','magenta','padEnd','bold','769292EfpkPN','debug','map','3315789DenvxG','output','spawn','No\x20data','jsonl','[error]','cyan','noColor','yellow','stringify','log','10LphKWa','error','format','rule','cmdout','[params]','isInteger','repeat','6931872hIfcXQ','stderr','push','9LkSxzL','[rule]','filter','13706yGVQud','boolean','1470JfZqnK','limit','─┬─','close','resolve','max','object','pipe','params','json','stdout','Results\x20saved\x20to\x20','─┴─','tsv','8PlbtRx','query','trim','entries','3394295CvosxK','string','write','less','1wqNRAy','split','3994881qnufSW','stdin','join','[Object]'];a89_0x37ee=function(){return _0x49c076;};return a89_0x37ee();}async function formatSingleObject(_0x26d203,_0x529f09){const _0x393b83=a89_0x3810,{format:_0x1dc187,color:_0x576401,noColor:_0x2b8e48}=_0x529f09,_0x2a1fe1={'color':_0x576401,'noColor':_0x2b8e48};if(_0x1dc187===_0x393b83(0x1da)){if(shouldUseColor(_0x2a1fe1))return colorizeJSON(_0x26d203,_0x2a1fe1);return JSON[_0x393b83(0x1bf)](_0x26d203,null,0x2);}else{if(_0x1dc187===_0x393b83(0x1ba)){if(shouldUseColor(_0x2a1fe1))return colorizeJSONCompact(_0x26d203,_0x2a1fe1);return JSON[_0x393b83(0x1bf)](_0x26d203);}else{if(_0x1dc187===_0x393b83(0x1de))return Object[_0x393b83(0x1e2)](_0x26d203)[_0x393b83(0x1b5)](([_0x518710,_0x526fe3])=>_0x518710+'\x09'+_0x526fe3)['join']('\x0a');else{const _0x14ca9d=Object[_0x393b83(0x1e2)](_0x26d203);if(_0x14ca9d['length']===0x0)return _0x393b83(0x1b9);const _0x3ae58d=_0x26d203[_0x393b83(0x1b4)],_0x2a9ac6=_0x26d203[_0x393b83(0x1e0)],_0x1069df=_0x26d203[_0x393b83(0x1d9)],_0x1e378e=_0x26d203[_0x393b83(0x1c4)],_0x23732f=_0x2a9ac6?typeof _0x2a9ac6===_0x393b83(0x1e4)?_0x2a9ac6:JSON[_0x393b83(0x1bf)](_0x2a9ac6,null,0x2):undefined,_0x482d94=_0x1069df&&Object[_0x393b83(0x1f1)](_0x1069df)[_0x393b83(0x1ee)]>0x0?JSON[_0x393b83(0x1bf)](_0x1069df,null,0x2):undefined,_0x5eb786=_0x1e378e&&Object[_0x393b83(0x1f1)](_0x1e378e)[_0x393b83(0x1ee)]>0x0?JSON['stringify'](_0x1e378e,null,0x2):undefined,_0x4d0e70=_0x14ca9d[_0x393b83(0x1ce)](([_0x3f9e5e])=>_0x3f9e5e!==_0x393b83(0x1b4)&&_0x3f9e5e!==_0x393b83(0x1e0)&&_0x3f9e5e!==_0x393b83(0x1d9)&&_0x3f9e5e!==_0x393b83(0x1c4)),_0x1d80f6=Math['max'](..._0x4d0e70[_0x393b83(0x1b5)](([_0x1ab735])=>_0x1ab735['length'])),_0x49a1ab=Math[_0x393b83(0x1d6)](..._0x4d0e70[_0x393b83(0x1b5)](([,_0x326b87])=>{const _0x457303=_0x393b83;try{const _0x54b3e9=_0x326b87===null||_0x326b87===undefined?'':typeof _0x326b87==='object'?JSON[_0x457303(0x1bf)](_0x326b87):String(_0x326b87),_0x3c340c=_0x54b3e9[_0x457303(0x1e8)]('\x0a');return Math[_0x457303(0x1d6)](..._0x3c340c['map'](_0x1b06f9=>_0x1b06f9[_0x457303(0x1ee)]),0x0);}catch{return 0x0;}}),0x14),_0x44d435=[];_0x44d435[_0x393b83(0x1cb)](colorBorder('┌─'+'─'[_0x393b83(0x1c8)](_0x1d80f6)+_0x393b83(0x1d3)+'─'['repeat'](_0x49a1ab)+'─┐',_0x2a1fe1)),_0x4d0e70[_0x393b83(0x1f4)](([_0x55ee28,_0x411261])=>{const _0x12cb1e=_0x393b83;let _0x3e4d4e;try{_0x3e4d4e=_0x411261===null||_0x411261===undefined?'':typeof _0x411261===_0x12cb1e(0x1d7)?JSON[_0x12cb1e(0x1bf)](_0x411261):String(_0x411261);}catch{_0x3e4d4e=_0x12cb1e(0x1ec);}const _0x284dcf=_0x55ee28['padEnd'](_0x1d80f6),_0x54acee=_0x3e4d4e[_0x12cb1e(0x1e8)]('\x0a');_0x54acee['forEach']((_0x3ddf51,_0x5c7e6a)=>{const _0x128746=_0x12cb1e,_0xbb0200=colorBorder('│',_0x2a1fe1);_0x5c7e6a===0x0?_0x44d435['push'](_0xbb0200+'\x20'+_0x284dcf+'\x20'+_0xbb0200+'\x20'+_0x3ddf51[_0x128746(0x1b1)](_0x49a1ab)+'\x20'+_0xbb0200):_0x44d435[_0x128746(0x1cb)](_0xbb0200+'\x20'+'\x20'[_0x128746(0x1c8)](_0x1d80f6)+'\x20'+_0xbb0200+'\x20'+_0x3ddf51[_0x128746(0x1b1)](_0x49a1ab)+'\x20'+_0xbb0200);});}),_0x44d435[_0x393b83(0x1cb)](colorBorder('└─'+'─'['repeat'](_0x1d80f6)+_0x393b83(0x1dd)+'─'[_0x393b83(0x1c8)](_0x49a1ab)+'─┘',_0x2a1fe1));_0x23732f&&(_0x44d435[_0x393b83(0x1cb)](''),_0x44d435[_0x393b83(0x1cb)](String(a89_0x168a47[_0x393b83(0x1be)]['bold']('[query]'))),_0x44d435[_0x393b83(0x1cb)](_0x23732f));_0x482d94&&(_0x44d435['push'](''),_0x44d435[_0x393b83(0x1cb)](String(a89_0x168a47[_0x393b83(0x1f7)]['bold'](_0x393b83(0x1c6)))),_0x44d435[_0x393b83(0x1cb)](_0x482d94));_0x5eb786&&(_0x44d435[_0x393b83(0x1cb)](''),_0x44d435[_0x393b83(0x1cb)](String(a89_0x168a47[_0x393b83(0x1f9)]['bold'](_0x393b83(0x1cd)))),_0x44d435[_0x393b83(0x1cb)](_0x5eb786));if(_0x3ae58d){if(_0x3ae58d[_0x393b83(0x1ca)]){_0x44d435['push'](''),_0x44d435[_0x393b83(0x1cb)](String(a89_0x168a47['red'][_0x393b83(0x1b2)](_0x393b83(0x1bb))));const _0x13bf6b=_0x3ae58d[_0x393b83(0x1ca)]['split']('\x0a');_0x13bf6b['forEach'](_0x4cbb38=>{const _0x5d0b9b=_0x393b83;_0x4cbb38[_0x5d0b9b(0x1e1)]()&&_0x44d435[_0x5d0b9b(0x1cb)](_0x4cbb38);});}if(_0x3ae58d[_0x393b83(0x1c5)]){_0x44d435[_0x393b83(0x1cb)](''),_0x44d435[_0x393b83(0x1cb)](String(a89_0x168a47[_0x393b83(0x1bc)][_0x393b83(0x1b2)]('[logs]')));const _0x1da1f9=_0x3ae58d[_0x393b83(0x1c5)][_0x393b83(0x1e8)]('\x0a');_0x1da1f9[_0x393b83(0x1f4)](_0x58ea09=>{const _0x538223=_0x393b83;_0x58ea09['trim']()&&_0x44d435[_0x538223(0x1cb)](_0x58ea09);});}}return _0x44d435[_0x393b83(0x1eb)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x345a01,_0xe66466){const _0x60ca39=a89_0x3810;if(_0xe66466[_0x60ca39(0x1c3)]===_0x60ca39(0x1f2)){await handleSDKOutput([_0x345a01],_0xe66466);return;}const _0x5c3ca=resolveOutputOptions(_0xe66466),_0x2dad3f=await formatSingleObject(_0x345a01,_0x5c3ca);await writeOutput(_0x2dad3f,_0x5c3ca['output']||undefined,_0x5c3ca[_0x60ca39(0x1c3)]);}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40cc56,_0x542171){const _0x35a4dd=a90_0x4668,_0x30264b=_0x40cc56();while(!![]){try{const _0x5ad377=-parseInt(_0x35a4dd(0x70))/0x1+parseInt(_0x35a4dd(0x6b))/0x2+parseInt(_0x35a4dd(0x6d))/0x3+parseInt(_0x35a4dd(0x71))/0x4+-parseInt(_0x35a4dd(0x6f))/0x5+parseInt(_0x35a4dd(0x6c))/0x6+-parseInt(_0x35a4dd(0x6e))/0x7;if(_0x5ad377===_0x542171)break;else _0x30264b['push'](_0x30264b['shift']());}catch(_0x311ddc){_0x30264b['push'](_0x30264b['shift']());}}}(a90_0x1bbc,0xd4655));export const DEFAULT_DISPLAY_LIMIT=0x28;function a90_0x1bbc(){const _0x3ab6f6=['14762713upGPmN','4536830joSIyo','925164dcnOOc','3781064HSnEoN','2263424CSMirY','8922390dDoaQw','3742257rmvsIJ'];a90_0x1bbc=function(){return _0x3ab6f6;};return a90_0x1bbc();}export const DEFAULT_LISTING_LIMIT=0x2710;function a90_0x4668(_0x42277c,_0x43ac7e){_0x42277c=_0x42277c-0x6b;const _0x1bbcf6=a90_0x1bbc();let _0x4668cb=_0x1bbcf6[_0x42277c];return _0x4668cb;}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x46a010,_0x19e604){if(_0x46a010===undefined)return _0x19e604;if(typeof _0x46a010==='number')return _0x46a010;return parseInt(_0x46a010,0xa);}
|
package/dist/utils/diff.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfe0fd1,_0xe158fa){const _0x534ec5=a91_0x46a5,_0x517387=_0xfe0fd1();while(!![]){try{const _0x2320f6=-parseInt(_0x534ec5(0xb0))/0x1+-parseInt(_0x534ec5(0xa9))/0x2*(-parseInt(_0x534ec5(0xb3))/0x3)+parseInt(_0x534ec5(0x97))/0x4+-parseInt(_0x534ec5(0xad))/0x5*(parseInt(_0x534ec5(0xb5))/0x6)+parseInt(_0x534ec5(0x9d))/0x7*(-parseInt(_0x534ec5(0xb2))/0x8)+-parseInt(_0x534ec5(0xa7))/0x9*(-parseInt(_0x534ec5(0xa8))/0xa)+parseInt(_0x534ec5(0x9c))/0xb;if(_0x2320f6===_0xe158fa)break;else _0x517387['push'](_0x517387['shift']());}catch(_0x13ff5d){_0x517387['push'](_0x517387['shift']());}}}(a91_0x5288,0xe840c));import a91_0x1b1e5b from'chalk';export function generateDiff(_0x4c4850,_0x19a07a){const _0x296aad=a91_0x46a5,_0x494769=_0x4c4850[_0x296aad(0x9b)]('\x0a'),_0x16387b=_0x19a07a[_0x296aad(0x9b)]('\x0a'),_0x24e034=[],_0x28b320=computeLCS(_0x494769,_0x16387b);let _0x2bc659=0x0,_0xc05cb1=0x0,_0x381909=0x0;while(_0x2bc659<_0x494769[_0x296aad(0xb1)]||_0xc05cb1<_0x16387b[_0x296aad(0xb1)]){if(_0x381909<_0x28b320[_0x296aad(0xb1)]&&_0x2bc659<_0x494769[_0x296aad(0xb1)]&&_0x494769[_0x2bc659]===_0x28b320[_0x381909])_0xc05cb1<_0x16387b[_0x296aad(0xb1)]&&_0x16387b[_0xc05cb1]===_0x28b320[_0x381909]?(_0x24e034[_0x296aad(0xb7)]({'type':_0x296aad(0x99),'content':_0x494769[_0x2bc659]}),_0x2bc659++,_0xc05cb1++,_0x381909++):(_0x24e034[_0x296aad(0xb7)]({'type':_0x296aad(0xa3),'content':_0x16387b[_0xc05cb1]}),_0xc05cb1++);else{if(_0x381909<_0x28b320[_0x296aad(0xb1)]&&_0xc05cb1<_0x16387b['length']&&_0x16387b[_0xc05cb1]===_0x28b320[_0x381909])_0x24e034['push']({'type':_0x296aad(0xab),'content':_0x494769[_0x2bc659]}),_0x2bc659++;else{if(_0x2bc659<_0x494769[_0x296aad(0xb1)]&&(_0x381909>=_0x28b320[_0x296aad(0xb1)]||_0x494769[_0x2bc659]!==_0x28b320[_0x381909]))_0x24e034[_0x296aad(0xb7)]({'type':_0x296aad(0xab),'content':_0x494769[_0x2bc659]}),_0x2bc659++;else _0xc05cb1<_0x16387b[_0x296aad(0xb1)]&&(_0x24e034[_0x296aad(0xb7)]({'type':'added','content':_0x16387b[_0xc05cb1]}),_0xc05cb1++);}}}return _0x24e034;}function a91_0x5288(){const _0x4136cb=['5gIxcLJ','fill','\x20-\x20','450834vOthoI','length','14024592KgQvbD','12ixfhtz','unshift','11065134Ljxhio','old','push','content','\x20\x20...','dim','min','6507120mVDxaN','new','unchanged','cyan','split','9127261YKGMwq','7JFtbBz','has','\x20\x20\x20','max','\x20+\x20','padStart','added','repeat','some','add','1413eaaCSp','108860brKMSn','416886XPcVYu','map','removed','type'];a91_0x5288=function(){return _0x4136cb;};return a91_0x5288();}function computeLCS(_0x5628a8,_0xb7d812){const _0x1e1c62=a91_0x46a5,_0xec869f=_0x5628a8[_0x1e1c62(0xb1)],_0x4cd9fc=_0xb7d812['length'],_0x295105=Array(_0xec869f+0x1)[_0x1e1c62(0xae)](null)[_0x1e1c62(0xaa)](()=>Array(_0x4cd9fc+0x1)[_0x1e1c62(0xae)](0x0));for(let _0x487fa2=0x1;_0x487fa2<=_0xec869f;_0x487fa2++){for(let _0x126179=0x1;_0x126179<=_0x4cd9fc;_0x126179++){_0x5628a8[_0x487fa2-0x1]===_0xb7d812[_0x126179-0x1]?_0x295105[_0x487fa2][_0x126179]=_0x295105[_0x487fa2-0x1][_0x126179-0x1]+0x1:_0x295105[_0x487fa2][_0x126179]=Math['max'](_0x295105[_0x487fa2-0x1][_0x126179],_0x295105[_0x487fa2][_0x126179-0x1]);}}const _0x48f979=[];let _0x57ebc7=_0xec869f,_0x3eb7b1=_0x4cd9fc;while(_0x57ebc7>0x0&&_0x3eb7b1>0x0){if(_0x5628a8[_0x57ebc7-0x1]===_0xb7d812[_0x3eb7b1-0x1])_0x48f979[_0x1e1c62(0xb4)](_0x5628a8[_0x57ebc7-0x1]),_0x57ebc7--,_0x3eb7b1--;else _0x295105[_0x57ebc7-0x1][_0x3eb7b1]>_0x295105[_0x57ebc7][_0x3eb7b1-0x1]?_0x57ebc7--:_0x3eb7b1--;}return _0x48f979;}function a91_0x46a5(_0x36183c,_0x47f736){_0x36183c=_0x36183c-0x93;const _0x528881=a91_0x5288();let _0x46a52=_0x528881[_0x36183c];return _0x46a52;}export function formatDiffWithColors(_0x1cad19,_0xde977a=0x3){const _0x635b7a=a91_0x46a5,_0x4d7d07=new Set();_0x1cad19['forEach']((_0x41a62a,_0x2168e7)=>{const _0x1e0003=a91_0x46a5;_0x41a62a[_0x1e0003(0xac)]!==_0x1e0003(0x99)&&_0x4d7d07['add'](_0x2168e7);});if(_0x4d7d07['size']===0x0)return'';const _0x3dc7d5=new Set();for(const _0x1473d0 of _0x4d7d07){for(let _0x436ec4=Math['max'](0x0,_0x1473d0-_0xde977a);_0x436ec4<=Math[_0x635b7a(0x96)](_0x1cad19[_0x635b7a(0xb1)]-0x1,_0x1473d0+_0xde977a);_0x436ec4++){_0x3dc7d5[_0x635b7a(0xa6)](_0x436ec4);}}const _0x211275=[];let _0x4195cd=-0x1;const _0x2d2de9=_0x1cad19[_0x635b7a(0xb1)],_0x89c861=Math[_0x635b7a(0xa0)](0x3,String(_0x2d2de9)[_0x635b7a(0xb1)]),_0x4c43ee=[];let _0x583816=0x0,_0x30a49c=0x0;for(const _0x156b8b of _0x1cad19){if(_0x156b8b[_0x635b7a(0xac)]===_0x635b7a(0xab))_0x583816++,_0x4c43ee['push']({'old':_0x583816,'new':0x0});else _0x156b8b[_0x635b7a(0xac)]===_0x635b7a(0xa3)?(_0x30a49c++,_0x4c43ee['push']({'old':0x0,'new':_0x30a49c})):(_0x583816++,_0x30a49c++,_0x4c43ee[_0x635b7a(0xb7)]({'old':_0x583816,'new':_0x30a49c}));}for(let _0x5b849b=0x0;_0x5b849b<_0x1cad19['length'];_0x5b849b++){if(!_0x3dc7d5[_0x635b7a(0x9e)](_0x5b849b))continue;_0x4195cd!==-0x1&&_0x5b849b>_0x4195cd+0x1&&_0x211275['push'](a91_0x1b1e5b[_0x635b7a(0x9a)](_0x635b7a(0x94)));_0x4195cd=_0x5b849b;const _0x4fb0bc=_0x1cad19[_0x5b849b],_0xdf4641=_0x4c43ee[_0x5b849b],_0x5429d7=_0xdf4641['old']>0x0?String(_0xdf4641[_0x635b7a(0xb6)])['padStart'](_0x89c861):'\x20'[_0x635b7a(0xa4)](_0x89c861),_0x2399bf=_0xdf4641['new']>0x0?String(_0xdf4641[_0x635b7a(0x98)])[_0x635b7a(0xa2)](_0x89c861):'\x20'[_0x635b7a(0xa4)](_0x89c861);switch(_0x4fb0bc['type']){case _0x635b7a(0xab):_0x211275[_0x635b7a(0xb7)](a91_0x1b1e5b['red'](_0x5429d7+'\x20'+_0x2399bf+_0x635b7a(0xaf)+_0x4fb0bc[_0x635b7a(0x93)]));break;case'added':_0x211275['push'](a91_0x1b1e5b['green'](_0x5429d7+'\x20'+_0x2399bf+_0x635b7a(0xa1)+_0x4fb0bc[_0x635b7a(0x93)]));break;default:_0x211275[_0x635b7a(0xb7)](a91_0x1b1e5b[_0x635b7a(0x95)](_0x5429d7+'\x20'+_0x2399bf+_0x635b7a(0x9f)+_0x4fb0bc[_0x635b7a(0x93)]));break;}}return _0x211275['join']('\x0a');}export function hasChanges(_0x7e3bc){const _0x113334=a91_0x46a5;return _0x7e3bc[_0x113334(0xa5)](_0x5ac8bb=>_0x5ac8bb['type']!==_0x113334(0x99));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10d3c8,_0x4a380e){const _0x1fc492=a92_0x196f,_0x59e2fd=_0x10d3c8();while(!![]){try{const _0x4840ad=-parseInt(_0x1fc492(0x1ce))/0x1*(parseInt(_0x1fc492(0x1b9))/0x2)+-parseInt(_0x1fc492(0x1b1))/0x3*(parseInt(_0x1fc492(0x1b7))/0x4)+-parseInt(_0x1fc492(0x1cb))/0x5+parseInt(_0x1fc492(0x1a9))/0x6+-parseInt(_0x1fc492(0x1c9))/0x7*(parseInt(_0x1fc492(0x1a3))/0x8)+-parseInt(_0x1fc492(0x1d2))/0x9*(-parseInt(_0x1fc492(0x1a4))/0xa)+parseInt(_0x1fc492(0x1b5))/0xb;if(_0x4840ad===_0x4a380e)break;else _0x59e2fd['push'](_0x59e2fd['shift']());}catch(_0xa8c7fc){_0x59e2fd['push'](_0x59e2fd['shift']());}}}(a92_0x12dd,0x52569));import a92_0x6b8838 from'chalk';function a92_0x196f(_0x1235a2,_0x1c0e01){_0x1235a2=_0x1235a2-0x1a2;const _0x12dd72=a92_0x12dd();let _0x196f21=_0x12dd72[_0x1235a2];return _0x196f21;}import{withQuerySpinner}from'./spinner.js';function a92_0x12dd(){const _0x472311=['replace','Attributes','query','data','6bRFeHF','localeCompare','startsWith','length','7914148bqiXqW','information_schema','930724MUOSHq','key','516746wHwQIh','filter','type','tableName','behavior','displayName','set','fields','Behaviors','Fetching\x20schema...','parentColumn','extra','error','trim','dim','setJobId','8771BzTOUC','null','1975535cyeuHl','Unknown','Schema\x20query:\x0a','1HvoPKz','\x20\x20\x20\x20','parentTableName','default','3177nbFCeE','column_type','source','get','varchar','push','sort','3312JuaHYn','18070iTYLNt','entries','bold','verbose','size','3705012wcmSJM','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','name','cyan'];a92_0x12dd=function(){return _0x472311;};return a92_0x12dd();}export function buildSchemaResult(_0x5c6b96){const _0x266d26=a92_0x196f,_0x5ab564=_0x5c6b96['columns']['map'](_0x1f7988=>({'column_name':_0x1f7988[_0x266d26(0x1ab)],'column_type':_0x1f7988[_0x266d26(0x1bb)],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x5c6b96,'columns':[{'name':'column_name','type':'varchar'},{'name':_0x266d26(0x1d3),'type':_0x266d26(0x1d6)},{'name':_0x266d26(0x1ca),'type':_0x266d26(0x1d6)},{'name':_0x266d26(0x1b8),'type':_0x266d26(0x1d6)},{'name':_0x266d26(0x1d1),'type':_0x266d26(0x1d6)},{'name':_0x266d26(0x1c4),'type':_0x266d26(0x1d6)}],'data':_0x5ab564};}export async function executeSchemaQuery(_0x51f3f2,_0x5dca5e,_0x26a83b){const _0xfaf208=a92_0x196f,_0x279812=_0x51f3f2[_0xfaf208(0x1c6)]()[_0xfaf208(0x1ad)](/;+$/,''),_0x22df29='SELECT\x20*\x20FROM\x20(\x0a'+_0x279812+_0xfaf208(0x1aa);_0x26a83b['verbose']&&console[_0xfaf208(0x1c5)](_0xfaf208(0x1cd)+_0x22df29);const _0x8e0114=await withQuerySpinner(_0xfaf208(0x1c2),async _0x41b73c=>{const _0x4c3a48=_0xfaf208,_0x1c68b6=await _0x5dca5e[_0x4c3a48(0x1af)]['execute'](_0x22df29,{'catalog':'td','schema':_0x4c3a48(0x1b6),'onJobId':_0x3d5469=>{const _0x2b4ecd=_0x4c3a48;_0x41b73c[_0x2b4ecd(0x1c8)](_0x3d5469);}});return _0x1c68b6;},{'verbose':_0x26a83b[_0xfaf208(0x1a7)]});return buildSchemaResult(_0x8e0114[_0xfaf208(0x1b0)]);}export function displayFieldsHumanReadable(_0x2d9660,_0x52c5fd){const _0x1f4ec8=a92_0x196f,_0x40a553=_0x2d9660[_0x1f4ec8(0x1ba)](_0x3248a3=>_0x3248a3[_0x1f4ec8(0x1d4)]==='attribute'),_0x528bce=_0x2d9660['filter'](_0x1f3ab3=>_0x1f3ab3[_0x1f4ec8(0x1d4)]===_0x1f4ec8(0x1bd)),_0x280eaa=new Map();for(const _0x3d11d6 of _0x40a553){const _0x20c42c=_0x3d11d6['groupingName']||_0x3d11d6['parentTableName']||_0x1f4ec8(0x1cc),_0x2903a2=_0x280eaa[_0x1f4ec8(0x1d5)](_0x20c42c);_0x2903a2?_0x2903a2['fields'][_0x1f4ec8(0x1d7)](_0x3d11d6):_0x280eaa[_0x1f4ec8(0x1bf)](_0x20c42c,{'displayName':_0x20c42c,'tableName':_0x3d11d6[_0x1f4ec8(0x1d0)],'fields':[_0x3d11d6]});}const _0xa8339e=new Map();for(const _0x48e570 of _0x528bce){const _0x5da66a=_0x48e570['behaviorName']||_0x1f4ec8(0x1cc),_0x5aa58c=_0xa8339e[_0x1f4ec8(0x1d5)](_0x5da66a)||[];_0x5aa58c['push'](_0x48e570),_0xa8339e[_0x1f4ec8(0x1bf)](_0x5da66a,_0x5aa58c);}console['error']('\x0a'+a92_0x6b8838[_0x1f4ec8(0x1a6)](_0x52c5fd));if(_0x280eaa[_0x1f4ec8(0x1a8)]>0x0){console[_0x1f4ec8(0x1c5)]('\x0a'+a92_0x6b8838[_0x1f4ec8(0x1c7)](_0x1f4ec8(0x1ae)));const _0x8c50ed=[..._0x280eaa[_0x1f4ec8(0x1a5)]()]['sort']((_0x572001,_0x3217c5)=>_0x572001[0x0][_0x1f4ec8(0x1b2)](_0x3217c5[0x0]));for(const [,_0x7a6ee4]of _0x8c50ed){const _0x34707e=_0x7a6ee4[_0x1f4ec8(0x1bc)]&&_0x7a6ee4[_0x1f4ec8(0x1bc)]!==_0x7a6ee4[_0x1f4ec8(0x1be)]?'\x20'+a92_0x6b8838[_0x1f4ec8(0x1c7)]('('+_0x7a6ee4[_0x1f4ec8(0x1bc)]+')'):'';console[_0x1f4ec8(0x1c5)]('\x20\x20'+a92_0x6b8838[_0x1f4ec8(0x1a6)](_0x7a6ee4['displayName'])+_0x34707e);const _0x1e5ecb=[..._0x7a6ee4[_0x1f4ec8(0x1c0)]]['sort']((_0x403d89,_0x23ee33)=>_0x403d89[_0x1f4ec8(0x1ab)][_0x1f4ec8(0x1b2)](_0x23ee33['name']));for(const _0x2337e9 of _0x1e5ecb){const _0x2165e5=_0x2337e9[_0x1f4ec8(0x1c3)]&&_0x2337e9[_0x1f4ec8(0x1c3)]!==_0x2337e9[_0x1f4ec8(0x1ab)]?'\x20'+a92_0x6b8838[_0x1f4ec8(0x1c7)]('('+_0x2337e9[_0x1f4ec8(0x1c3)]+')'):'';console[_0x1f4ec8(0x1c5)](_0x1f4ec8(0x1cf)+_0x2337e9[_0x1f4ec8(0x1ab)]+_0x2165e5+':\x20'+a92_0x6b8838[_0x1f4ec8(0x1ac)](_0x2337e9[_0x1f4ec8(0x1bb)]));}}}if(_0xa8339e['size']>0x0){console[_0x1f4ec8(0x1c5)]('\x0a'+a92_0x6b8838['dim'](_0x1f4ec8(0x1c1)));const _0x563c4f=[..._0xa8339e[_0x1f4ec8(0x1a5)]()][_0x1f4ec8(0x1a2)]((_0x124f44,_0x3e3a50)=>_0x124f44[0x0][_0x1f4ec8(0x1b2)](_0x3e3a50[0x0]));for(const [_0x8c1e3,_0x5376d3]of _0x563c4f){const _0xb4a725=_0x5376d3[0x0],_0x3e4765=_0xb4a725?.['parentTableName']||'';console[_0x1f4ec8(0x1c5)]('\x20\x20'+a92_0x6b8838[_0x1f4ec8(0x1a6)](_0x8c1e3)+(_0x3e4765?'\x20'+a92_0x6b8838[_0x1f4ec8(0x1c7)]('('+_0x3e4765+')'):''));const _0x398962=[..._0x5376d3][_0x1f4ec8(0x1a2)]((_0x4afcac,_0x5acfe5)=>_0x4afcac[_0x1f4ec8(0x1ab)]['localeCompare'](_0x5acfe5[_0x1f4ec8(0x1ab)]));for(const _0x309d79 of _0x398962){const _0x19d68e=_0x309d79[_0x1f4ec8(0x1ab)][_0x1f4ec8(0x1b3)](_0x8c1e3+'.')?_0x309d79[_0x1f4ec8(0x1ab)]['slice'](_0x8c1e3[_0x1f4ec8(0x1b4)]+0x1):_0x309d79[_0x1f4ec8(0x1ab)],_0x1bd64f=_0x309d79[_0x1f4ec8(0x1c3)]&&_0x309d79[_0x1f4ec8(0x1c3)]!==_0x19d68e?'\x20'+a92_0x6b8838['dim']('('+_0x309d79[_0x1f4ec8(0x1c3)]+')'):'';console[_0x1f4ec8(0x1c5)](_0x1f4ec8(0x1cf)+_0x19d68e+_0x1bd64f+':\x20'+a92_0x6b8838[_0x1f4ec8(0x1ac)](_0x309d79[_0x1f4ec8(0x1bb)]));}}}console[_0x1f4ec8(0x1c5)]('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2dc01b,_0x4c071e){const _0x383b95=a93_0x46f4,_0x2a8bd7=_0x2dc01b();while(!![]){try{const _0x1195d7=-parseInt(_0x383b95(0xa6))/0x1+-parseInt(_0x383b95(0x99))/0x2*(parseInt(_0x383b95(0xa0))/0x3)+parseInt(_0x383b95(0x97))/0x4+-parseInt(_0x383b95(0xa2))/0x5+parseInt(_0x383b95(0xa4))/0x6+-parseInt(_0x383b95(0x95))/0x7*(parseInt(_0x383b95(0xa3))/0x8)+parseInt(_0x383b95(0x9f))/0x9;if(_0x1195d7===_0x4c071e)break;else _0x2a8bd7['push'](_0x2a8bd7['shift']());}catch(_0x17d3f1){_0x2a8bd7['push'](_0x2a8bd7['shift']());}}}(a93_0x124d,0xa3fb4));import*as a93_0xb93eab from'node:fs';import*as a93_0x192a58 from'node:path';export function setSecureFilePermissions(_0x3d98fa){const _0x437202=a93_0x46f4;try{a93_0xb93eab[_0x437202(0xa5)](_0x3d98fa,0x180);}catch{console[_0x437202(0x94)](_0x437202(0x98)+_0x3d98fa);}}function a93_0x124d(){const _0x291137=['44yxssIa','mkdirSync','Warning:\x20','dirname','existsSync','Should\x20be\x200600\x20or\x20more\x20restrictive.','20994993FUcjPG','42243mRGgez','statSync','6017135xDmidm','24ppOkUJ','6050376togcQQ','chmodSync','408933dGCQsp',').\x20','warn','2758238kFRmzO','\x20has\x20insecure\x20permissions\x20(','1738956WwnmKq','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'];a93_0x124d=function(){return _0x291137;};return a93_0x124d();}export function setSecureDirectoryPermissions(_0x95c9a4){const _0x5ee717=a93_0x46f4;try{a93_0xb93eab['chmodSync'](_0x95c9a4,0x1c0);}catch{console[_0x5ee717(0x94)](_0x5ee717(0x98)+_0x95c9a4);}}function a93_0x46f4(_0x1e071f,_0x3ad84b){_0x1e071f=_0x1e071f-0x94;const _0x124d21=a93_0x124d();let _0x46f48a=_0x124d21[_0x1e071f];return _0x46f48a;}export function createSecureDirectory(_0x2d9e65){const _0x2f8239=a93_0x46f4;!a93_0xb93eab[_0x2f8239(0x9d)](_0x2d9e65)&&(a93_0xb93eab[_0x2f8239(0x9a)](_0x2d9e65,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x2d9e65));}export function validateSecureFilePermissions(_0x4dbc45){const _0x14d064=a93_0x46f4;try{const _0x1d5682=a93_0xb93eab[_0x14d064(0xa1)](_0x4dbc45),_0x50f610=_0x1d5682['mode']&0x1ff,_0x3bcf09=(_0x50f610&0x3f)!==0x0;if(_0x3bcf09)return console[_0x14d064(0x94)](_0x14d064(0x9b)+_0x4dbc45+_0x14d064(0x96)+_0x50f610['toString'](0x8)+_0x14d064(0xa7)+_0x14d064(0x9e)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x59c73f,_0x582e71){const _0x33d4f6=a93_0x46f4,_0x582488=a93_0x192a58[_0x33d4f6(0x9c)](_0x59c73f);createSecureDirectory(_0x582488),a93_0xb93eab['writeFileSync'](_0x59c73f,_0x582e71,{'mode':0x180}),setSecureFilePermissions(_0x59c73f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a94_0x4ca1(_0x744d4c,_0x31d6aa){_0x744d4c=_0x744d4c-0x7f;const _0x30d559=a94_0x30d5();let _0x4ca15c=_0x30d559[_0x744d4c];return _0x4ca15c;}function a94_0x30d5(){const _0x4d5303=['8jbgQnX','4739913aSPvVi','split','52498FBrgJY','6cWjVZM','1499892hzDYkg','pop','tsv','table','16138450auyCsR','4159253DWYbuV','15oYWqUm','json','jsonl','toLowerCase','416600LzLjoY','633871lYGjHn','text'];a94_0x30d5=function(){return _0x4d5303;};return a94_0x30d5();}(function(_0x1030be,_0x515567){const _0x38b549=a94_0x4ca1,_0x20cb1f=_0x1030be();while(!![]){try{const _0x15f406=-parseInt(_0x38b549(0x87))/0x1+parseInt(_0x38b549(0x8c))/0x2*(-parseInt(_0x38b549(0x82))/0x3)+-parseInt(_0x38b549(0x8e))/0x4+-parseInt(_0x38b549(0x86))/0x5+parseInt(_0x38b549(0x8d))/0x6*(-parseInt(_0x38b549(0x81))/0x7)+parseInt(_0x38b549(0x89))/0x8*(parseInt(_0x38b549(0x8a))/0x9)+parseInt(_0x38b549(0x80))/0xa;if(_0x15f406===_0x515567)break;else _0x20cb1f['push'](_0x20cb1f['shift']());}catch(_0x15961a){_0x20cb1f['push'](_0x20cb1f['shift']());}}}(a94_0x30d5,0x4ed62));export function detectFormatFromExtension(_0x1cddde){const _0x31e2ff=a94_0x4ca1,_0x4dffca=_0x1cddde[_0x31e2ff(0x85)]()[_0x31e2ff(0x8b)]('.')[_0x31e2ff(0x8f)]();switch(_0x4dffca){case _0x31e2ff(0x83):return _0x31e2ff(0x83);case _0x31e2ff(0x84):return _0x31e2ff(0x84);case _0x31e2ff(0x90):case'tab':return'tsv';case'txt':case _0x31e2ff(0x88):return _0x31e2ff(0x7f);default:return undefined;}}export function resolveOutputFormat(_0x24de94,_0xd507b2,_0x3dbf63){if(_0x24de94)return _0x24de94;if(_0xd507b2){const _0x1875b3=detectFormatFromExtension(_0xd507b2);if(_0x1875b3)return _0x1875b3;}return _0x3dbf63;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x57732c,_0x381292){const _0x123d46=a95_0x370b,_0x5ed461=_0x57732c();while(!![]){try{const _0xf16a90=parseInt(_0x123d46(0x162))/0x1+-parseInt(_0x123d46(0x171))/0x2*(parseInt(_0x123d46(0x16c))/0x3)+-parseInt(_0x123d46(0x173))/0x4*(parseInt(_0x123d46(0x15d))/0x5)+parseInt(_0x123d46(0x15e))/0x6*(parseInt(_0x123d46(0x17c))/0x7)+-parseInt(_0x123d46(0x187))/0x8*(-parseInt(_0x123d46(0x166))/0x9)+-parseInt(_0x123d46(0x17a))/0xa*(parseInt(_0x123d46(0x16a))/0xb)+parseInt(_0x123d46(0x168))/0xc;if(_0xf16a90===_0x381292)break;else _0x5ed461['push'](_0x5ed461['shift']());}catch(_0x8f793d){_0x5ed461['push'](_0x5ed461['shift']());}}}(a95_0x2811,0x350f0));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 _0x2940dc=a95_0x370b;return process[_0x2940dc(0x181)][_0x2940dc(0x175)]||Infinity;}export function formatAsTable(_0xd3b166,_0x47254f=DEFAULT_MAX_DISPLAY_ROWS,_0x384b9e=![],_0x385117={}){const _0x3f7628=a95_0x370b;if(_0xd3b166[_0x3f7628(0x170)][_0x3f7628(0x172)]===0x0)return _0x3f7628(0x16e);const _0x338439=_0xd3b166[_0x3f7628(0x175)][_0x3f7628(0x17e)](_0x1ca9df=>_0x1ca9df[_0x3f7628(0x186)]),_0x42a338=_0xd3b166[_0x3f7628(0x175)][_0x3f7628(0x17e)](_0x3c1499=>simplifyType(_0x3c1499['type'])),_0x327495=_0xd3b166['data']['slice'](0x0,_0x47254f),_0xcb452c=_0xd3b166[_0x3f7628(0x170)][_0x3f7628(0x172)],_0x44c05b=_0xcb452c>_0x47254f,_0xbd9161=[],_0x5c62f5=getTerminalWidth(),_0x424cdc=_0x5c62f5!==Infinity,_0x34cc78=0x32;let _0x1f8751=_0x338439[_0x3f7628(0x17e)]((_0x245e9d,_0x288b10)=>{const _0x1058fd=_0x3f7628,_0x45ecf2=stringWidth(_0x42a338[_0x288b10]),_0x4e47ad=Math['max'](..._0x327495[_0x1058fd(0x17e)](_0x29ca85=>{const _0x4ce867=_0x29ca85[_0x245e9d];return stringWidth(formatValue(_0x4ce867));})),_0x17c15d=Math['max'](stringWidth(_0x245e9d),_0x45ecf2,_0x4e47ad);return _0x384b9e?_0x17c15d:Math[_0x1058fd(0x15f)](_0x17c15d,_0x34cc78);});if(_0x424cdc&&!_0x384b9e&&_0x338439[_0x3f7628(0x172)]>0x0){const _0x3e03b0=_0x52fb28=>{let _0x55d642=0x1;for(const _0x3690e3 of _0x52fb28){_0x55d642+=_0x3690e3+0x3;}return _0x55d642+0x1;};let _0x48cf78=_0x3e03b0(_0x1f8751);if(_0x48cf78>_0x5c62f5){const _0x1079d9=0x3;for(let _0x5973ea=_0x1f8751[_0x3f7628(0x172)]-0x1;_0x5973ea>=0x0;_0x5973ea--){_0x48cf78=_0x3e03b0(_0x1f8751);if(_0x48cf78<=_0x5c62f5)break;const _0x3fafb1=_0x1f8751[_0x5973ea],_0x6614a3=_0x48cf78-_0x5c62f5,_0x4da8f8=_0x3fafb1-_0x1079d9,_0x647a16=Math[_0x3f7628(0x15f)](_0x6614a3,_0x4da8f8);_0x647a16>0x0&&(_0x1f8751[_0x5973ea]=_0x3fafb1-_0x647a16);}}}const _0x5a8842=_0x338439,_0x274deb=_0x42a338,_0x226468=_0x1f8751,_0x4056d6=_0x1f8751;_0xbd9161[_0x3f7628(0x164)](colorBorder('┌'+_0x4056d6[_0x3f7628(0x17e)](_0x31d203=>'─'['repeat'](_0x31d203+0x2))[_0x3f7628(0x161)]('┬')+'┐',_0x385117));const _0x50e8bc=_0x5a8842[_0x3f7628(0x17e)]((_0x3d45c2,_0x41a332)=>centerAlign(_0x3d45c2,_0x226468[_0x41a332]));_0xbd9161['push'](colorBorder('│',_0x385117)+'\x20'+_0x50e8bc['join']('\x20'+colorBorder('│',_0x385117)+'\x20')+'\x20'+colorBorder('│',_0x385117));const _0x4612f0=_0x274deb['map']((_0xdfccee,_0x5c5046)=>colorType(centerAlign(_0xdfccee,_0x226468[_0x5c5046]),_0x385117));_0xbd9161[_0x3f7628(0x164)](colorBorder('│',_0x385117)+'\x20'+_0x4612f0[_0x3f7628(0x161)]('\x20'+colorBorder('│',_0x385117)+'\x20')+'\x20'+colorBorder('│',_0x385117)),_0xbd9161[_0x3f7628(0x164)](colorBorder('├'+_0x4056d6[_0x3f7628(0x17e)](_0x34ae26=>'─'[_0x3f7628(0x17d)](_0x34ae26+0x2))['join']('┼')+'┤',_0x385117));const _0x2b4103=(_0x36eb88,_0x2d44a2)=>{const _0x1b23fb=stringWidth(_0x36eb88);if(_0x1b23fb<=_0x2d44a2)return _0x36eb88;let _0x1c4ac0=_0x36eb88;while(stringWidth(_0x1c4ac0+'…')>_0x2d44a2&&_0x1c4ac0['length']>0x0){_0x1c4ac0=_0x1c4ac0['slice'](0x0,-0x1);}return _0x1c4ac0+'…';};_0x327495[_0x3f7628(0x188)](_0xed347d=>{const _0x549d14=_0x3f7628,_0x3e5f81=_0x338439[_0x549d14(0x17e)]((_0x576443,_0x549d62)=>{const _0x5f0679=_0xed347d[_0x576443],_0x291232=formatValue(_0x5f0679),_0x2357d6=_0x226468[_0x549d62],_0x46e51c=_0x2b4103(_0x291232,_0x2357d6),_0x49f682=typeof _0x5f0679==='number'||typeof _0x5f0679==='string'&&/^-?\d+$/['test'](_0x5f0679);return _0x49f682?padStart(_0x46e51c,_0x2357d6):padEnd(_0x46e51c,_0x2357d6);});_0xbd9161[_0x549d14(0x164)](colorBorder('│',_0x385117)+'\x20'+_0x3e5f81['join']('\x20'+colorBorder('│',_0x385117)+'\x20')+'\x20'+colorBorder('│',_0x385117));});const _0x35fe46=_0x4056d6[_0x3f7628(0x180)]((_0x5aa7e5,_0x4a5433)=>_0x5aa7e5+_0x4a5433+0x3,-0x1);_0xbd9161[_0x3f7628(0x164)](colorBorder('├'+_0x4056d6[_0x3f7628(0x17e)](_0x36c232=>'─'[_0x3f7628(0x17d)](_0x36c232+0x2))[_0x3f7628(0x161)]('┴')+'┤',_0x385117));let _0x9511e6;_0x44c05b?_0x9511e6=_0xcb452c+_0x3f7628(0x17b)+_0x47254f+_0x3f7628(0x185):_0x9511e6=_0xcb452c+_0x3f7628(0x18a)+(_0xcb452c===0x1?'':'s');const _0x3b3a47=_0x9511e6[_0x3f7628(0x169)](_0x35fe46-0x2);return _0xbd9161[_0x3f7628(0x164)](colorBorder('│',_0x385117)+'\x20'+_0x3b3a47+'\x20'+colorBorder('│',_0x385117)),_0xbd9161[_0x3f7628(0x164)](colorBorder('└'+'─'[_0x3f7628(0x17d)](_0x35fe46)+'┘',_0x385117)),_0xbd9161['join']('\x0a');}function simplifyType(_0x176666){const _0x438735=a95_0x370b,_0x3f592a={'varchar':'string','bigint':_0x438735(0x18c),'integer':_0x438735(0x189),'double':_0x438735(0x167),'boolean':'bool','date':'date','timestamp':_0x438735(0x18e),'array':'array','map':_0x438735(0x17e),'row':_0x438735(0x177)},_0x592dc4=_0x176666['toLowerCase']();for(const [_0x2e640a,_0x35c65c]of Object[_0x438735(0x16b)](_0x3f592a)){if(_0x592dc4['startsWith'](_0x2e640a))return _0x35c65c;}return _0x176666[_0x438735(0x172)]>0xa?_0x176666[_0x438735(0x17f)](0x0,0xa):_0x176666;}export function formatAsJSON(_0x1cff32,_0x1cddb9={}){const _0x340979=a95_0x370b;if(_0x1cff32['data'][_0x340979(0x172)]===0x0)return'[]';if(shouldUseColor(_0x1cddb9))return colorizeJSON(_0x1cff32[_0x340979(0x170)],_0x1cddb9);const _0x38de13=_0x1cff32[_0x340979(0x170)][_0x340979(0x17e)](_0x21dc66=>'\x20\x20'+JSON[_0x340979(0x179)](_0x21dc66));return'[\x0a'+_0x38de13[_0x340979(0x161)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x11d557,_0x231c97={}){const _0x1ba94f=a95_0x370b;if(_0x11d557[_0x1ba94f(0x170)][_0x1ba94f(0x172)]===0x0)return'';if(shouldUseColor(_0x231c97))return _0x11d557[_0x1ba94f(0x170)][_0x1ba94f(0x17e)](_0x386fa0=>colorizeJSONCompact(_0x386fa0,_0x231c97))['join']('\x0a');return _0x11d557[_0x1ba94f(0x170)][_0x1ba94f(0x17e)](_0x37e610=>JSON[_0x1ba94f(0x179)](_0x37e610))[_0x1ba94f(0x161)]('\x0a');}export function formatAsTSV(_0x4e67c0){const _0x58fc21=a95_0x370b;if(_0x4e67c0['data']['length']===0x0)return'';const _0x5986ad=[],_0x148aaf=_0x4e67c0[_0x58fc21(0x175)][_0x58fc21(0x17e)](_0xe360c4=>_0xe360c4['name']);return _0x5986ad[_0x58fc21(0x164)](_0x148aaf['join']('\x09')),_0x4e67c0[_0x58fc21(0x170)][_0x58fc21(0x188)](_0x5400d6=>{const _0x41e804=_0x58fc21,_0x390947=_0x148aaf[_0x41e804(0x17e)](_0x1e84f1=>{const _0x33c5c9=_0x5400d6[_0x1e84f1];return formatValueForTSV(_0x33c5c9);});_0x5986ad['push'](_0x390947[_0x41e804(0x161)]('\x09'));}),_0x5986ad[_0x58fc21(0x161)]('\x0a');}function formatValue(_0x433d8a){const _0x1dbc15=a95_0x370b;if(_0x433d8a===null||_0x433d8a===undefined)return'';if(typeof _0x433d8a===_0x1dbc15(0x165)){const _0x493525=_0x433d8a[_0x1dbc15(0x16f)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')[_0x1dbc15(0x16f)](/\t/g,'\x5ct');return _0x493525;}if(typeof _0x433d8a===_0x1dbc15(0x160))return String(_0x433d8a);if(typeof _0x433d8a===_0x1dbc15(0x176))return _0x433d8a?'true':_0x1dbc15(0x183);if(_0x433d8a instanceof Date)return _0x433d8a[_0x1dbc15(0x18b)]();if(typeof _0x433d8a===_0x1dbc15(0x15b))return JSON['stringify'](_0x433d8a);return String(_0x433d8a);}function a95_0x370b(_0x4c84b1,_0x400d3a){_0x4c84b1=_0x4c84b1-0x15b;const _0x2811c8=a95_0x2811();let _0x370b8a=_0x2811c8[_0x4c84b1];return _0x370b8a;}function formatValueForTSV(_0x3c24db){const _0x37210d=a95_0x370b;if(_0x3c24db===null||_0x3c24db===undefined)return'';if(typeof _0x3c24db===_0x37210d(0x165))return _0x3c24db['replace'](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x3c24db===_0x37210d(0x160)||typeof _0x3c24db==='boolean')return String(_0x3c24db);if(_0x3c24db instanceof Date)return _0x3c24db[_0x37210d(0x18b)]();if(typeof _0x3c24db===_0x37210d(0x15b))return JSON['stringify'](_0x3c24db);return String(_0x3c24db);}export function formatQueryResult(_0xa4541f,_0x1ca9d2){const _0xc6ff8e=a95_0x370b;switch(_0x1ca9d2){case'table':return formatAsTable(_0xa4541f);case _0xc6ff8e(0x18d):return formatAsJSON(_0xa4541f);case _0xc6ff8e(0x184):return formatAsJSONL(_0xa4541f);case'tsv':return formatAsTSV(_0xa4541f);default:return formatAsJSON(_0xa4541f);}}function a95_0x2811(){const _0x19ce65=['112okcMsv','forEach','int','\x20row','toISOString','long','json','timestamp','object','pow','4625AQUgGl','132378fMKncC','min','number','join','25356FnhhAX','0\x20B','push','string','24147iameFA','double','9279804objwSn','padEnd','2304698bMNdGs','entries','3jfcapD','log','No\x20rows\x20returned','replace','data','679686rKdkWB','length','1064dIkTTe','toFixed','columns','boolean','row','toString','stringify','10OwguTx','\x20rows\x20(','56ZoulnT','repeat','map','substring','reduce','stdout','floor','false','jsonl','\x20shown)','name'];a95_0x2811=function(){return _0x19ce65;};return a95_0x2811();}export function formatBytes(_0x154238){const _0x1410d6=a95_0x370b;if(_0x154238===0x0)return _0x1410d6(0x163);const _0x45dbe7=['B','KB','MB','GB','TB'],_0x4db9f9=0x400,_0x2f52c3=Math[_0x1410d6(0x182)](Math[_0x1410d6(0x16d)](_0x154238)/Math[_0x1410d6(0x16d)](_0x4db9f9)),_0x2d0305=_0x154238/Math[_0x1410d6(0x15c)](_0x4db9f9,_0x2f52c3),_0x5d186b=_0x2d0305>=0xa?0x1:0x2;return _0x2d0305['toFixed'](_0x5d186b)+'\x20'+_0x45dbe7[_0x2f52c3];}export function formatRows(_0x1105c1){const _0x61317=a95_0x370b;if(_0x1105c1==null)return'-';if(_0x1105c1===0x0)return'0';if(_0x1105c1<0x3e8)return _0x1105c1[_0x61317(0x178)]();const _0x145639=['','K','M','B','T'],_0x382823=0x3e8,_0x30ea84=Math[_0x61317(0x182)](Math[_0x61317(0x16d)](_0x1105c1)/Math[_0x61317(0x16d)](_0x382823)),_0x25b7aa=_0x1105c1/Math[_0x61317(0x15c)](_0x382823,_0x30ea84),_0x3fc061=_0x25b7aa>=0xa?0x1:0x2;return''+_0x25b7aa[_0x61317(0x174)](_0x3fc061)+_0x145639[_0x30ea84];}
|
|
1
|
+
(function(_0x36114e,_0x5e11bd){const _0x5c9002=a95_0x3d64,_0x4912b5=_0x36114e();while(!![]){try{const _0x2148b9=-parseInt(_0x5c9002(0xa4))/0x1*(parseInt(_0x5c9002(0x99))/0x2)+-parseInt(_0x5c9002(0xa2))/0x3*(-parseInt(_0x5c9002(0x82))/0x4)+parseInt(_0x5c9002(0x91))/0x5+parseInt(_0x5c9002(0x93))/0x6*(-parseInt(_0x5c9002(0xac))/0x7)+-parseInt(_0x5c9002(0xa5))/0x8*(parseInt(_0x5c9002(0xa9))/0x9)+parseInt(_0x5c9002(0xad))/0xa+parseInt(_0x5c9002(0x96))/0xb*(parseInt(_0x5c9002(0xa1))/0xc);if(_0x2148b9===_0x5e11bd)break;else _0x4912b5['push'](_0x4912b5['shift']());}catch(_0x493319){_0x4912b5['push'](_0x4912b5['shift']());}}}(a95_0x4f9c,0x83979));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';function a95_0x4f9c(){const _0x42e4eb=['true','toISOString','toLowerCase','0\x20B','false','jsonl','forEach','reduce','max','2449110bLhCrM','repeat','5334510ACIdWz','toString','long','512809UuVpfW','slice','stringify','2sLHwDE','boolean','name','replace','\x20rows\x20(','min','int','map','180ZFWkUf','98205kzspxc','tsv','264371lJXCKg','16SuVlhG','padEnd','join','test','3879054GkEnEk','row','substring','7wQPsxw','6779270FAKZGw','toFixed','floor','startsWith','length','json','type','push','string','log','No\x20rows\x20returned','84CUuGbp','columns','pow','data','number','\x20row'];a95_0x4f9c=function(){return _0x42e4eb;};return a95_0x4f9c();}const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){return process['stdout']['columns']||Infinity;}export function formatAsTable(_0x3ade96,_0x467952=DEFAULT_MAX_DISPLAY_ROWS,_0x3fa397=![],_0x11854a={}){const _0x949401=a95_0x3d64;if(_0x3ade96[_0x949401(0x85)][_0x949401(0xb1)]===0x0)return _0x949401(0x81);const _0x862489=_0x3ade96['columns'][_0x949401(0xa0)](_0x5f0c28=>_0x5f0c28[_0x949401(0x9b)]),_0x34a16c=_0x3ade96[_0x949401(0x83)][_0x949401(0xa0)](_0x29187a=>simplifyType(_0x29187a[_0x949401(0x7d)])),_0x5eff40=_0x3ade96['data'][_0x949401(0x97)](0x0,_0x467952),_0x1c6b37=_0x3ade96['data']['length'],_0x413234=_0x1c6b37>_0x467952,_0x86a2aa=[],_0x165198=getTerminalWidth(),_0x47c631=_0x165198!==Infinity,_0x31cf21=0x32;let _0x4483e8=_0x862489[_0x949401(0xa0)]((_0x648ade,_0x35b1fc)=>{const _0x4d5374=_0x949401,_0x283db9=stringWidth(_0x34a16c[_0x35b1fc]),_0x1dac1f=Math[_0x4d5374(0x90)](..._0x5eff40[_0x4d5374(0xa0)](_0x354ac6=>{const _0x2135dd=_0x354ac6[_0x648ade];return stringWidth(formatValue(_0x2135dd));})),_0x5c1f37=Math[_0x4d5374(0x90)](stringWidth(_0x648ade),_0x283db9,_0x1dac1f);return _0x3fa397?_0x5c1f37:Math[_0x4d5374(0x9e)](_0x5c1f37,_0x31cf21);});if(_0x47c631&&!_0x3fa397&&_0x862489[_0x949401(0xb1)]>0x0){const _0x434463=_0x47ba0b=>{let _0x94ea=0x1;for(const _0x19dda7 of _0x47ba0b){_0x94ea+=_0x19dda7+0x3;}return _0x94ea+0x1;};let _0x46c571=_0x434463(_0x4483e8);if(_0x46c571>_0x165198){const _0x18a1e3=0x3;for(let _0x3c0903=_0x4483e8[_0x949401(0xb1)]-0x1;_0x3c0903>=0x0;_0x3c0903--){_0x46c571=_0x434463(_0x4483e8);if(_0x46c571<=_0x165198)break;const _0x4c53e8=_0x4483e8[_0x3c0903],_0x42abeb=_0x46c571-_0x165198,_0x410ca3=_0x4c53e8-_0x18a1e3,_0x1c92d1=Math['min'](_0x42abeb,_0x410ca3);_0x1c92d1>0x0&&(_0x4483e8[_0x3c0903]=_0x4c53e8-_0x1c92d1);}}}const _0x1b9652=_0x862489,_0x551081=_0x34a16c,_0x2adbe1=_0x4483e8,_0x39670a=_0x4483e8;_0x86a2aa[_0x949401(0x7e)](colorBorder('┌'+_0x39670a[_0x949401(0xa0)](_0x1a3894=>'─'[_0x949401(0x92)](_0x1a3894+0x2))[_0x949401(0xa7)]('┬')+'┐',_0x11854a));const _0x3d161a=_0x1b9652[_0x949401(0xa0)]((_0x3d6220,_0x5231af)=>centerAlign(_0x3d6220,_0x2adbe1[_0x5231af]));_0x86a2aa[_0x949401(0x7e)](colorBorder('│',_0x11854a)+'\x20'+_0x3d161a[_0x949401(0xa7)]('\x20'+colorBorder('│',_0x11854a)+'\x20')+'\x20'+colorBorder('│',_0x11854a));const _0x48110c=_0x551081[_0x949401(0xa0)]((_0xa18ca8,_0x411350)=>colorType(centerAlign(_0xa18ca8,_0x2adbe1[_0x411350]),_0x11854a));_0x86a2aa['push'](colorBorder('│',_0x11854a)+'\x20'+_0x48110c[_0x949401(0xa7)]('\x20'+colorBorder('│',_0x11854a)+'\x20')+'\x20'+colorBorder('│',_0x11854a)),_0x86a2aa[_0x949401(0x7e)](colorBorder('├'+_0x39670a[_0x949401(0xa0)](_0x485187=>'─'['repeat'](_0x485187+0x2))[_0x949401(0xa7)]('┼')+'┤',_0x11854a));const _0x52aa65=(_0x3da5f2,_0x4a6267)=>{const _0x2a0822=_0x949401,_0xcbc989=stringWidth(_0x3da5f2);if(_0xcbc989<=_0x4a6267)return _0x3da5f2;let _0x2d16ee=_0x3da5f2;while(stringWidth(_0x2d16ee+'…')>_0x4a6267&&_0x2d16ee[_0x2a0822(0xb1)]>0x0){_0x2d16ee=_0x2d16ee[_0x2a0822(0x97)](0x0,-0x1);}return _0x2d16ee+'…';};_0x5eff40[_0x949401(0x8e)](_0x5bcf89=>{const _0x9a5b48=_0x949401,_0x3ad329=_0x862489[_0x9a5b48(0xa0)]((_0x4e1bef,_0x325472)=>{const _0x345791=_0x9a5b48,_0x110638=_0x5bcf89[_0x4e1bef],_0x23bff4=formatValue(_0x110638),_0x257d23=_0x2adbe1[_0x325472],_0xbcd2da=_0x52aa65(_0x23bff4,_0x257d23),_0x35faf1=typeof _0x110638==='number'||typeof _0x110638===_0x345791(0x7f)&&/^-?\d+$/[_0x345791(0xa8)](_0x110638);return _0x35faf1?padStart(_0xbcd2da,_0x257d23):padEnd(_0xbcd2da,_0x257d23);});_0x86a2aa[_0x9a5b48(0x7e)](colorBorder('│',_0x11854a)+'\x20'+_0x3ad329['join']('\x20'+colorBorder('│',_0x11854a)+'\x20')+'\x20'+colorBorder('│',_0x11854a));});const _0x20cd7e=_0x39670a[_0x949401(0x8f)]((_0x3623e9,_0xecf7e1)=>_0x3623e9+_0xecf7e1+0x3,-0x1);_0x86a2aa[_0x949401(0x7e)](colorBorder('├'+_0x39670a['map'](_0x28d351=>'─'[_0x949401(0x92)](_0x28d351+0x2))[_0x949401(0xa7)]('┴')+'┤',_0x11854a));let _0x4dca9e;_0x413234?_0x4dca9e=_0x1c6b37+_0x949401(0x9d)+_0x467952+'\x20shown)':_0x4dca9e=_0x1c6b37+_0x949401(0x87)+(_0x1c6b37===0x1?'':'s');const _0xb96001=_0x4dca9e[_0x949401(0xa6)](_0x20cd7e-0x2);return _0x86a2aa[_0x949401(0x7e)](colorBorder('│',_0x11854a)+'\x20'+_0xb96001+'\x20'+colorBorder('│',_0x11854a)),_0x86a2aa['push'](colorBorder('└'+'─'[_0x949401(0x92)](_0x20cd7e)+'┘',_0x11854a)),_0x86a2aa[_0x949401(0xa7)]('\x0a');}function a95_0x3d64(_0x153998,_0x56df53){_0x153998=_0x153998-0x7d;const _0x4f9c27=a95_0x4f9c();let _0x3d6483=_0x4f9c27[_0x153998];return _0x3d6483;}function simplifyType(_0x4ab8e3){const _0x1c855b=a95_0x3d64,_0x5f39c4={'varchar':_0x1c855b(0x7f),'bigint':_0x1c855b(0x95),'integer':_0x1c855b(0x9f),'double':'double','boolean':'bool','date':'date','timestamp':'timestamp','array':'array','map':'map','row':_0x1c855b(0xaa)},_0x1e9f42=_0x4ab8e3[_0x1c855b(0x8a)]();for(const [_0x173427,_0x4988f8]of Object['entries'](_0x5f39c4)){if(_0x1e9f42[_0x1c855b(0xb0)](_0x173427))return _0x4988f8;}return _0x4ab8e3['length']>0xa?_0x4ab8e3[_0x1c855b(0xab)](0x0,0xa):_0x4ab8e3;}export function formatAsJSON(_0x47daa8,_0x347c4b={}){const _0x2a95f1=a95_0x3d64;if(_0x47daa8[_0x2a95f1(0x85)]['length']===0x0)return'[]';if(shouldUseColor(_0x347c4b))return colorizeJSON(_0x47daa8[_0x2a95f1(0x85)],_0x347c4b);const _0x251781=_0x47daa8[_0x2a95f1(0x85)][_0x2a95f1(0xa0)](_0x1e9519=>'\x20\x20'+JSON[_0x2a95f1(0x98)](_0x1e9519));return'[\x0a'+_0x251781[_0x2a95f1(0xa7)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x417c84,_0x12b249={}){const _0x5d3555=a95_0x3d64;if(_0x417c84[_0x5d3555(0x85)][_0x5d3555(0xb1)]===0x0)return'';if(shouldUseColor(_0x12b249))return _0x417c84[_0x5d3555(0x85)][_0x5d3555(0xa0)](_0x468998=>colorizeJSONCompact(_0x468998,_0x12b249))['join']('\x0a');return _0x417c84[_0x5d3555(0x85)]['map'](_0x14a24b=>JSON['stringify'](_0x14a24b))['join']('\x0a');}export function formatAsTSV(_0x4edf99){const _0x37850b=a95_0x3d64;if(_0x4edf99[_0x37850b(0x85)]['length']===0x0)return'';const _0xe71ba2=[],_0x72a934=_0x4edf99[_0x37850b(0x83)][_0x37850b(0xa0)](_0x531108=>_0x531108['name']);return _0xe71ba2[_0x37850b(0x7e)](_0x72a934[_0x37850b(0xa7)]('\x09')),_0x4edf99[_0x37850b(0x85)][_0x37850b(0x8e)](_0x341c4e=>{const _0x170812=_0x37850b,_0x36abac=_0x72a934['map'](_0x295c43=>{const _0x1515c0=_0x341c4e[_0x295c43];return formatValueForTSV(_0x1515c0);});_0xe71ba2[_0x170812(0x7e)](_0x36abac[_0x170812(0xa7)]('\x09'));}),_0xe71ba2['join']('\x0a');}function formatValue(_0x211c77){const _0x2b1b67=a95_0x3d64;if(_0x211c77===null||_0x211c77===undefined)return'';if(typeof _0x211c77===_0x2b1b67(0x7f)){const _0x318611=_0x211c77['replace'](/\n/g,'\x5cn')[_0x2b1b67(0x9c)](/\r/g,'\x5cr')[_0x2b1b67(0x9c)](/\t/g,'\x5ct');return _0x318611;}if(typeof _0x211c77===_0x2b1b67(0x86))return String(_0x211c77);if(typeof _0x211c77===_0x2b1b67(0x9a))return _0x211c77?_0x2b1b67(0x88):_0x2b1b67(0x8c);if(_0x211c77 instanceof Date)return _0x211c77[_0x2b1b67(0x89)]();if(typeof _0x211c77==='object')return JSON[_0x2b1b67(0x98)](_0x211c77);return String(_0x211c77);}function formatValueForTSV(_0x4cf121){const _0x4dfc28=a95_0x3d64;if(_0x4cf121===null||_0x4cf121===undefined)return'';if(typeof _0x4cf121===_0x4dfc28(0x7f))return _0x4cf121[_0x4dfc28(0x9c)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x4cf121===_0x4dfc28(0x86)||typeof _0x4cf121===_0x4dfc28(0x9a))return String(_0x4cf121);if(_0x4cf121 instanceof Date)return _0x4cf121['toISOString']();if(typeof _0x4cf121==='object')return JSON['stringify'](_0x4cf121);return String(_0x4cf121);}export function formatQueryResult(_0xb244ea,_0x7d5790){const _0x996346=a95_0x3d64;switch(_0x7d5790){case'table':return formatAsTable(_0xb244ea);case _0x996346(0xb2):return formatAsJSON(_0xb244ea);case _0x996346(0x8d):return formatAsJSONL(_0xb244ea);case _0x996346(0xa3):return formatAsTSV(_0xb244ea);default:return formatAsJSON(_0xb244ea);}}export function formatBytes(_0x504c12){const _0x57a260=a95_0x3d64;if(_0x504c12===0x0)return _0x57a260(0x8b);const _0x488656=['B','KB','MB','GB','TB'],_0x55f8d2=0x400,_0x15aa17=Math[_0x57a260(0xaf)](Math[_0x57a260(0x80)](_0x504c12)/Math[_0x57a260(0x80)](_0x55f8d2)),_0x47d3ab=_0x504c12/Math['pow'](_0x55f8d2,_0x15aa17),_0x564a79=_0x47d3ab>=0xa?0x1:0x2;return _0x47d3ab[_0x57a260(0xae)](_0x564a79)+'\x20'+_0x488656[_0x15aa17];}export function formatRows(_0x425feb){const _0x37f739=a95_0x3d64;if(_0x425feb==null)return'-';if(_0x425feb===0x0)return'0';if(_0x425feb<0x3e8)return _0x425feb[_0x37f739(0x94)]();const _0x4e4539=['','K','M','B','T'],_0x553503=0x3e8,_0x1b852f=Math['floor'](Math[_0x37f739(0x80)](_0x425feb)/Math[_0x37f739(0x80)](_0x553503)),_0x513491=_0x425feb/Math[_0x37f739(0x84)](_0x553503,_0x1b852f),_0x143bf8=_0x513491>=0xa?0x1:0x2;return''+_0x513491[_0x37f739(0xae)](_0x143bf8)+_0x4e4539[_0x1b852f];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a96_0x5b46(){const _0x119c2d=['1302VTmfhE','parse','Permission\x20denied\x20reading\x20file:\x20','Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','Invalid\x20JSON\x20string:\x20','ENOENT','message','1183115sURsHR','File\x20not\x20found:\x20','EACCES','3873312TocyPl','8279103vrfuiR','\x27:\x20','1434476kDKTep','PERMISSION_DENIED','Failed\x20to\x20load\x20JSON:\x20','code','9828232zBCmts','NOT_FOUND','433350OvvyYb','INVALID_ARGUMENT','124kcUcEO'];a96_0x5b46=function(){return _0x119c2d;};return a96_0x5b46();}(function(_0x47dff3,_0x319723){const _0x43bc99=a96_0xca58,_0x63ea67=_0x47dff3();while(!![]){try{const _0x4dd37e=parseInt(_0x43bc99(0xd1))/0x1+parseInt(_0x43bc99(0xd7))/0x2+-parseInt(_0x43bc99(0xda))/0x3*(-parseInt(_0x43bc99(0xd9))/0x4)+-parseInt(_0x43bc99(0xe1))/0x5+-parseInt(_0x43bc99(0xe4))/0x6+parseInt(_0x43bc99(0xe5))/0x7+-parseInt(_0x43bc99(0xd5))/0x8;if(_0x4dd37e===_0x319723)break;else _0x63ea67['push'](_0x63ea67['shift']());}catch(_0x43c435){_0x63ea67['push'](_0x63ea67['shift']());}}}(a96_0x5b46,0xb3d76));import{readFile}from'fs/promises';import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x197c38,_0x500e6c){const _0x160ec8=a96_0xca58;try{if(_0x500e6c){const _0x3beb5f=await readFile(_0x197c38,'utf-8');try{return JSON[_0x160ec8(0xdb)](_0x3beb5f);}catch(_0x799900){throw new SDKError(ErrorCode[_0x160ec8(0xd8)],'Invalid\x20JSON\x20in\x20file\x20\x27'+_0x197c38+_0x160ec8(0xe6)+(_0x799900 instanceof Error?_0x799900[_0x160ec8(0xe0)]:String(_0x799900)));}}else try{return JSON['parse'](_0x197c38);}catch(_0x628f16){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x160ec8(0xde)+(_0x628f16 instanceof Error?_0x628f16[_0x160ec8(0xe0)]:String(_0x628f16)));}}catch(_0x1cf0b5){if(_0x1cf0b5 instanceof SDKError)throw _0x1cf0b5;if(_0x1cf0b5 instanceof Error&&_0x160ec8(0xd4)in _0x1cf0b5){const _0x5ed5b2=_0x1cf0b5;if(_0x5ed5b2['code']===_0x160ec8(0xdf))throw new SDKError(ErrorCode[_0x160ec8(0xd6)],_0x160ec8(0xe2)+_0x197c38);else{if(_0x5ed5b2['code']===_0x160ec8(0xe3))throw new SDKError(ErrorCode[_0x160ec8(0xd2)],_0x160ec8(0xdc)+_0x197c38);}}throw new SDKError(ErrorCode['INTERNAL'],_0x160ec8(0xd3)+(_0x1cf0b5 instanceof Error?_0x1cf0b5[_0x160ec8(0xe0)]:String(_0x1cf0b5)));}}function a96_0xca58(_0x51ea8a,_0x434631){_0x51ea8a=_0x51ea8a-0xd1;const _0x5b4663=a96_0x5b46();let _0xca58b3=_0x5b4663[_0x51ea8a];return _0xca58b3;}export async function loadJSONFromOptions(_0x2ecb9c,_0x1179dd){const _0x2bb76d=a96_0xca58;if(_0x2ecb9c&&_0x1179dd)throw new SDKError(ErrorCode[_0x2bb76d(0xd8)],_0x2bb76d(0xdd));if(_0x2ecb9c)return await loadJSON(_0x2ecb9c,![]);if(_0x1179dd)return await loadJSON(_0x1179dd,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1139f6,_0x329c09){const _0x498892=a97_0xcdc5,_0xffd834=_0x1139f6();while(!![]){try{const _0x3f1e8c=parseInt(_0x498892(0xd1))/0x1*(parseInt(_0x498892(0xdd))/0x2)+-parseInt(_0x498892(0xe0))/0x3*(-parseInt(_0x498892(0xd8))/0x4)+-parseInt(_0x498892(0xd4))/0x5+parseInt(_0x498892(0xd3))/0x6+-parseInt(_0x498892(0xe1))/0x7+parseInt(_0x498892(0xdf))/0x8+-parseInt(_0x498892(0xdb))/0x9;if(_0x3f1e8c===_0x329c09)break;else _0xffd834['push'](_0xffd834['shift']());}catch(_0x238827){_0xffd834['push'](_0xffd834['shift']());}}}(a97_0x51df,0x1ec25));export function canCreateAgent(_0x454da6,_0x2641c3){const _0x2fd9e6=a97_0xcdc5;for(const _0x16e1c1 of _0x454da6[_0x2fd9e6(0xde)][_0x2fd9e6(0xd6)]){if(_0x16e1c1[_0x2fd9e6(0xd7)]&&!_0x2641c3[_0x2fd9e6(0xd5)](_0x16e1c1[_0x2fd9e6(0xd7)]))return![];}return!![];}export function remapToolIds(_0x10910a,_0x3481be,_0x46884c){const _0x2e54e0=a97_0xcdc5;return _0x10910a[_0x2e54e0(0xdc)](_0x7d9422=>({..._0x7d9422,'targetKnowledgeBaseId':_0x7d9422[_0x2e54e0(0xda)]?_0x3481be[_0x2e54e0(0xd9)](_0x7d9422[_0x2e54e0(0xda)])||_0x7d9422['targetKnowledgeBaseId']:undefined,'targetAgentId':_0x7d9422[_0x2e54e0(0xd7)]?_0x46884c[_0x2e54e0(0xd9)](_0x7d9422[_0x2e54e0(0xd7)])||_0x7d9422[_0x2e54e0(0xd7)]:undefined}));}export function remapVariableIds(_0x1c6b84,_0x411fe7){const _0x3d6b72=a97_0xcdc5;return _0x1c6b84[_0x3d6b72(0xdc)](_0x18dae8=>({..._0x18dae8,'targetKnowledgeBaseId':_0x411fe7[_0x3d6b72(0xd9)](_0x18dae8[_0x3d6b72(0xda)])||_0x18dae8['targetKnowledgeBaseId']}));}function a97_0x51df(){const _0xd80c1f=['3404FrefSq','get','targetKnowledgeBaseId','2328993dyKDEZ','map','554vQjmpn','attributes','1031984rwDKXe','237NYbzqb','213248IWyDYx','623XyORPy','1.0','1267542zXtSZN','824125AOfhOA','has','tools','targetAgentId'];a97_0x51df=function(){return _0xd80c1f;};return a97_0x51df();}function a97_0xcdc5(_0x7af165,_0x562c2f){_0x7af165=_0x7af165-0xd1;const _0x51df68=a97_0x51df();let _0xcdc5b6=_0x51df68[_0x7af165];return _0xcdc5b6;}export function isSupportedBackupVersion(_0x26225d){const _0x24773d=a97_0xcdc5;return _0x26225d===_0x24773d(0xd2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a98_0x26c229=a98_0xd306;(function(_0x136c45,_0x1464c4){const _0x1c814e=a98_0xd306,_0x1e9ace=_0x136c45();while(!![]){try{const _0x1dd2d3=parseInt(_0x1c814e(0xdc))/0x1*(-parseInt(_0x1c814e(0xd5))/0x2)+-parseInt(_0x1c814e(0xdd))/0x3+-parseInt(_0x1c814e(0xd8))/0x4*(-parseInt(_0x1c814e(0xd6))/0x5)+-parseInt(_0x1c814e(0xd4))/0x6+-parseInt(_0x1c814e(0xda))/0x7+-parseInt(_0x1c814e(0xdb))/0x8*(-parseInt(_0x1c814e(0xd1))/0x9)+-parseInt(_0x1c814e(0xd9))/0xa*(-parseInt(_0x1c814e(0xd3))/0xb);if(_0x1dd2d3===_0x1464c4)break;else _0x1e9ace['push'](_0x1e9ace['shift']());}catch(_0x493abb){_0x1e9ace['push'](_0x1e9ace['shift']());}}}(a98_0x1c67,0x61c1c));function a98_0xd306(_0x277e6d,_0x4b1097){_0x277e6d=_0x277e6d-0xd1;const _0x1c67ac=a98_0x1c67();let _0xd306fd=_0x1c67ac[_0x277e6d];return _0xd306fd;}const MODEL_ALIASES={'haiku':a98_0x26c229(0xd2),'sonnet':'claude-4.5-sonnet'};export function extractModelAlias(_0x3f8fad){const _0x27fa86=a98_0x26c229,_0x1a55c4=_0x3f8fad[_0x27fa86(0xde)](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x1a55c4)return _0x1a55c4[0x1][_0x27fa86(0xd7)]();return _0x3f8fad;}export function resolveModelAlias(_0x42df7c){return MODEL_ALIASES[_0x42df7c['toLowerCase']()]||_0x42df7c;}function a98_0x1c67(){const _0x40505d=['claude-4.5-haiku','2285404NnNbrX','2986980tIVrLU','126252MZZBmZ','229210feruas','toLowerCase','8TkQcNR','70JFebUi','1232448LvGhDc','72CnVkDR','10tYlTES','1492209CNTEPG','match','656937pKayFX'];a98_0x1c67=function(){return _0x40505d;};return a98_0x1c67();}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x771674,_0x5bb1b2){const _0x166448=a99_0x5176,_0x5a6443=_0x771674();while(!![]){try{const _0x4051fb=parseInt(_0x166448(0x19c))/0x1+-parseInt(_0x166448(0x195))/0x2*(parseInt(_0x166448(0x193))/0x3)+-parseInt(_0x166448(0x190))/0x4+-parseInt(_0x166448(0x19b))/0x5+-parseInt(_0x166448(0x1a0))/0x6*(-parseInt(_0x166448(0x194))/0x7)+parseInt(_0x166448(0x19f))/0x8+-parseInt(_0x166448(0x1a6))/0x9*(parseInt(_0x166448(0x19e))/0xa);if(_0x4051fb===_0x5bb1b2)break;else _0x5a6443['push'](_0x5a6443['shift']());}catch(_0x5c138b){_0x5a6443['push'](_0x5a6443['shift']());}}}(a99_0x4c53,0x57059));export const MODEL_FACTORS={'sonnet':0xa,'claude-4.5-sonnet':0xa,'claude-sonnet-4':0xa,'haiku':3.4,'claude-4.5-haiku':3.4,'claude-haiku-4':3.4,'opus':0xf,'claude-4-opus':0xf,'claude-opus-4':0xf};export const CONTEXT_LIMITS={'sonnet':0x30d40,'haiku':0x30d40,'opus':0x30d40,'default':0x30d40};export function getModelFactor(_0x33f4a4){const _0x4b0478=a99_0x5176,_0x2f857d=_0x33f4a4[_0x4b0478(0x18c)]();if(MODEL_FACTORS[_0x2f857d])return MODEL_FACTORS[_0x2f857d];if(_0x2f857d[_0x4b0478(0x198)](_0x4b0478(0x19a)))return MODEL_FACTORS[_0x4b0478(0x19a)];if(_0x2f857d[_0x4b0478(0x198)](_0x4b0478(0x199)))return MODEL_FACTORS[_0x4b0478(0x199)];if(_0x2f857d['includes'](_0x4b0478(0x196)))return MODEL_FACTORS['opus'];return MODEL_FACTORS[_0x4b0478(0x19a)];}export function getContextLimit(_0x13d234){const _0x1b8314=a99_0x5176,_0x5beb8f=_0x13d234[_0x1b8314(0x18c)]();if(_0x5beb8f[_0x1b8314(0x198)](_0x1b8314(0x19a)))return CONTEXT_LIMITS[_0x1b8314(0x19a)];if(_0x5beb8f[_0x1b8314(0x198)]('haiku'))return CONTEXT_LIMITS[_0x1b8314(0x199)];if(_0x5beb8f[_0x1b8314(0x198)](_0x1b8314(0x196)))return CONTEXT_LIMITS[_0x1b8314(0x196)];return CONTEXT_LIMITS['default'];}export function calculateChatUnit(_0x35f337,_0x2730b2,_0x4652db){return(_0x35f337+_0x2730b2)/0x1388*_0x4652db;}function a99_0x5176(_0x219cf0,_0x58c89f){_0x219cf0=_0x219cf0-0x18c;const _0x4c534f=a99_0x4c53();let _0x517688=_0x4c534f[_0x219cf0];return _0x517688;}export function calculateCredits(_0x3111a8){return _0x3111a8/0x2904;}function a99_0x4c53(){const _0x267f23=['opus','Opus\x204.5','includes','haiku','sonnet','1916395tLqxKm','651860UbGzQp','4-5','3098470tWpPFj','3751472PINfNe','923664YBchmO','Sonnet\x204.5','Opus\x204','en-US','round','Sonnet\x204','9QqNNJO','toLowerCase','4.5','Haiku\x204.5','toLocaleString','94340QmSHQU','Claude','Haiku\x204','66ZeqthV','7dmQbuo','18326XEYCXv'];a99_0x4c53=function(){return _0x267f23;};return a99_0x4c53();}export function getModelDisplayName(_0x4ac771){const _0x1d634c=a99_0x5176,_0x81c45a=_0x4ac771[_0x1d634c(0x18c)]();if(_0x81c45a[_0x1d634c(0x198)]('sonnet')){if(_0x81c45a[_0x1d634c(0x198)]('4-5')||_0x81c45a['includes'](_0x1d634c(0x18d)))return _0x1d634c(0x1a1);return _0x1d634c(0x1a5);}if(_0x81c45a[_0x1d634c(0x198)](_0x1d634c(0x199))){if(_0x81c45a[_0x1d634c(0x198)](_0x1d634c(0x19d))||_0x81c45a[_0x1d634c(0x198)](_0x1d634c(0x18d)))return _0x1d634c(0x18e);return _0x1d634c(0x192);}if(_0x81c45a[_0x1d634c(0x198)](_0x1d634c(0x196))){if(_0x81c45a[_0x1d634c(0x198)](_0x1d634c(0x19d))||_0x81c45a[_0x1d634c(0x198)](_0x1d634c(0x18d)))return _0x1d634c(0x197);return _0x1d634c(0x1a2);}return _0x1d634c(0x191);}export function formatTokenCount(_0x5eba78){const _0x3c0c68=a99_0x5176;return _0x5eba78[_0x3c0c68(0x18f)](_0x3c0c68(0x1a3));}export function calculateContextPercentage(_0x5348ce,_0x5470b8){const _0x1aec75=a99_0x5176,_0x2719de=getContextLimit(_0x5470b8);return Math[_0x1aec75(0x1a4)](_0x5348ce/_0x2719de*0x64);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a100_0x1eec(_0x5ee1d1,_0x5cc316){_0x5ee1d1=_0x5ee1d1-0x192;const _0x3bca3a=a100_0x3bca();let _0x1eec02=_0x3bca3a[_0x5ee1d1];return _0x1eec02;}(function(_0x19c876,_0x217575){const _0x171503=a100_0x1eec,_0x41c3d8=_0x19c876();while(!![]){try{const _0x56fc27=-parseInt(_0x171503(0x1a2))/0x1*(-parseInt(_0x171503(0x194))/0x2)+parseInt(_0x171503(0x19c))/0x3+parseInt(_0x171503(0x1a3))/0x4*(-parseInt(_0x171503(0x19d))/0x5)+parseInt(_0x171503(0x193))/0x6*(-parseInt(_0x171503(0x19b))/0x7)+-parseInt(_0x171503(0x195))/0x8*(-parseInt(_0x171503(0x19a))/0x9)+parseInt(_0x171503(0x1a1))/0xa*(-parseInt(_0x171503(0x199))/0xb)+parseInt(_0x171503(0x198))/0xc*(parseInt(_0x171503(0x196))/0xd);if(_0x56fc27===_0x217575)break;else _0x41c3d8['push'](_0x41c3d8['shift']());}catch(_0x709456){_0x41c3d8['push'](_0x41c3d8['shift']());}}}(a100_0x3bca,0x23d74));export function validateLimitOption(_0x3ee19a){const _0x54ca80=a100_0x1eec;if(!Number['isInteger'](_0x3ee19a))return{'isValid':![],'error':_0x54ca80(0x19e)+_0x3ee19a+_0x54ca80(0x192)};if(_0x3ee19a<=0x0)return{'isValid':![],'error':_0x54ca80(0x19e)+_0x3ee19a+_0x54ca80(0x1a0)};return{'isValid':!![],'value':_0x3ee19a};}export function validateTimeoutOption(_0x16a0de,_0x19dfe4=0x1e){const _0x19de96=a100_0x1eec;if(_0x16a0de===undefined)return{'isValid':!![],'value':_0x19dfe4};const _0x136938=typeof _0x16a0de===_0x19de96(0x19f)?_0x16a0de:parseFloat(_0x16a0de);if(isNaN(_0x136938))return{'isValid':![],'error':_0x19de96(0x1a4)+_0x16a0de+_0x19de96(0x197)};if(_0x136938<=0x0)return{'isValid':![],'error':'Invalid\x20timeout\x20value:\x20'+_0x136938+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x136938};}function a100_0x3bca(){const _0x17368e=['11112HwmyXC','2750PONvdU','16UUtOBo','5616aoRsKc','.\x20Must\x20be\x20a\x20number.','4476abRoFY','773102VpZkAS','963639JvdUGQ','469LenPlk','377511YroWCk','1280uogOIA','Invalid\x20limit\x20value:\x20','number','.\x20Must\x20be\x20a\x20positive\x20integer.','10ZMVbXq','41hGAWFM','3380mPtCJt','Invalid\x20timeout\x20value:\x20','.\x20Must\x20be\x20an\x20integer.'];a100_0x3bca=function(){return _0x17368e;};return a100_0x3bca();}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x528eb7,_0x31120a){const _0x5b7268=a101_0x1364,_0x2836c1=_0x528eb7();while(!![]){try{const _0x30394a=parseInt(_0x5b7268(0x7e))/0x1*(parseInt(_0x5b7268(0x7a))/0x2)+parseInt(_0x5b7268(0x81))/0x3+-parseInt(_0x5b7268(0x82))/0x4*(parseInt(_0x5b7268(0x7b))/0x5)+-parseInt(_0x5b7268(0x77))/0x6*(-parseInt(_0x5b7268(0x73))/0x7)+parseInt(_0x5b7268(0x75))/0x8+-parseInt(_0x5b7268(0x74))/0x9*(parseInt(_0x5b7268(0x7f))/0xa)+-parseInt(_0x5b7268(0x80))/0xb;if(_0x30394a===_0x31120a)break;else _0x2836c1['push'](_0x2836c1['shift']());}catch(_0x32f0df){_0x2836c1['push'](_0x2836c1['shift']());}}}(a101_0x1897,0xdd6b2));import{createServer}from'node:net';export async function isPortAvailable(_0x4fe4e7){return new Promise(_0x113109=>{const _0x569871=a101_0x1364,_0x5471d6=createServer();_0x5471d6[_0x569871(0x7c)](_0x569871(0x7d),_0xca1214=>{const _0x5d5fb6=_0x569871;_0xca1214[_0x5d5fb6(0x79)]===_0x5d5fb6(0x78)?_0x113109(![]):_0x113109(![]);}),_0x5471d6[_0x569871(0x7c)]('listening',()=>{_0x5471d6['close'](),_0x113109(!![]);}),_0x5471d6[_0x569871(0x83)](_0x4fe4e7,_0x569871(0x76));});}function a101_0x1364(_0x32084c,_0x591785){_0x32084c=_0x32084c-0x72;const _0x18977e=a101_0x1897();let _0x13644c=_0x18977e[_0x32084c];return _0x13644c;}function a101_0x1897(){const _0x48a907=['7939295wtlaAT','7236819VlIhks','416608RBIpxZ','0.0.0.0','6pqoHVd','EADDRINUSE','code','469774PNCSQX','581190VmQIDw','once','error','5BcbTNb','10CzdawB','6009575thMdHs','2828376qleZCq','36JEPLzi','listen','No\x20available\x20port\x20found\x20between\x20'];a101_0x1897=function(){return _0x48a907;};return a101_0x1897();}export async function findAvailablePort(_0x5205f8=0xfa0,_0x4109c5=0x64){const _0x2d8c43=a101_0x1364;for(let _0x2930af=0x0;_0x2930af<_0x4109c5;_0x2930af++){const _0x59cdd4=_0x5205f8+_0x2930af;if(await isPortAvailable(_0x59cdd4))return _0x59cdd4;}throw new Error(_0x2d8c43(0x72)+_0x5205f8+'\x20and\x20'+(_0x5205f8+_0x4109c5-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a102_0x5aeca1=a102_0xf741;(function(_0x37be19,_0x14b87c){const _0xffa7f5=a102_0xf741,_0xe828c9=_0x37be19();while(!![]){try{const _0x3bd3f6=parseInt(_0xffa7f5(0x1e4))/0x1*(-parseInt(_0xffa7f5(0x1eb))/0x2)+-parseInt(_0xffa7f5(0x1d1))/0x3*(parseInt(_0xffa7f5(0x1d7))/0x4)+-parseInt(_0xffa7f5(0x1dc))/0x5*(parseInt(_0xffa7f5(0x1de))/0x6)+-parseInt(_0xffa7f5(0x1e6))/0x7+-parseInt(_0xffa7f5(0x1c5))/0x8+parseInt(_0xffa7f5(0x1db))/0x9+parseInt(_0xffa7f5(0x1c9))/0xa;if(_0x3bd3f6===_0x14b87c)break;else _0xe828c9['push'](_0xe828c9['shift']());}catch(_0x7f2305){_0xe828c9['push'](_0xe828c9['shift']());}}}(a102_0x4197,0xad9ce));import{execSync}from'node:child_process';const SHELL_NAMES=new Set(['bash',a102_0x5aeca1(0x1dd),'sh',a102_0x5aeca1(0x1e7),a102_0x5aeca1(0x1c6),'tcsh',a102_0x5aeca1(0x1d2),a102_0x5aeca1(0x1e5),'pwsh',a102_0x5aeca1(0x1d8),'nu',a102_0x5aeca1(0x1e0),'elvish',a102_0x5aeca1(0x1cb)]),EPHEMERAL_SHELL_SPAWNERS=new Set([a102_0x5aeca1(0x1cd),a102_0x5aeca1(0x1e2),a102_0x5aeca1(0x1e8)]);function getProcessInfoWindows(_0x339c60){const _0x1bb0e1=a102_0x5aeca1;try{const _0x176565=execSync(_0x1bb0e1(0x1d4)+_0x339c60+_0x1bb0e1(0x1df),{'encoding':_0x1bb0e1(0x1d9),'windowsHide':!![]})[_0x1bb0e1(0x1ee)](),_0x2d83cd=_0x176565[_0x1bb0e1(0x1c3)]('\x0a')['filter'](_0x10e7fb=>_0x10e7fb['trim']());if(_0x2d83cd[_0x1bb0e1(0x1ce)]<0x2)return null;const _0x119859=_0x2d83cd[_0x2d83cd[_0x1bb0e1(0x1ce)]-0x1]['split'](',');if(_0x119859[_0x1bb0e1(0x1ce)]<0x3)return null;const _0x39f4d1=_0x119859[0x1]?.[_0x1bb0e1(0x1ee)]()||'',_0x1a222a=parseInt(_0x119859[0x2]?.[_0x1bb0e1(0x1ee)]()||'0',0xa);if(isNaN(_0x1a222a)||!_0x39f4d1)return null;return{'pid':_0x339c60,'ppid':_0x1a222a,'comm':_0x39f4d1['replace'](/\.exe$/i,'')};}catch(_0x40e65d){return process[_0x1bb0e1(0x1e9)]['DEBUG']&&console[_0x1bb0e1(0x1cc)]('Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20'+_0x339c60+_0x1bb0e1(0x1ec),_0x40e65d),null;}}function a102_0xf741(_0x10997e,_0x47f6a9){_0x10997e=_0x10997e-0x1c1;const _0x419733=a102_0x4197();let _0xf741b3=_0x419733[_0x10997e];return _0xf741b3;}function getProcessInfoPosix(_0xaf3f1d){const _0x37965d=a102_0x5aeca1;try{const _0x55466d=execSync(_0x37965d(0x1ef)+_0xaf3f1d+_0x37965d(0x1c1),{'encoding':_0x37965d(0x1d9)})['trim'](),[_0x3a4938,..._0x2bbc47]=_0x55466d[_0x37965d(0x1c3)](/\s+/),_0x5e1f6d=parseInt(_0x3a4938,0xa),_0x54a660=_0x2bbc47[_0x37965d(0x1c7)]('\x20');if(isNaN(_0x5e1f6d))return null;return{'pid':_0xaf3f1d,'ppid':_0x5e1f6d,'comm':_0x54a660};}catch(_0x3e235c){return process[_0x37965d(0x1e9)][_0x37965d(0x1e1)]&&console['error'](_0x37965d(0x1d5)+_0xaf3f1d+_0x37965d(0x1f0),_0x3e235c),null;}}function getProcessInfo(_0xcdc554){const _0x55ab35=a102_0x5aeca1;if(process[_0x55ab35(0x1c8)]==='win32')return getProcessInfoWindows(_0xcdc554);return getProcessInfoPosix(_0xcdc554);}function getBasename(_0x39e784){const _0x5513bd=a102_0x5aeca1;return _0x39e784[_0x5513bd(0x1c2)](/^-/,'')['split']('/')[_0x5513bd(0x1d6)]()?.[_0x5513bd(0x1cf)]()||'';}function isShell(_0x5916e8){const _0x213d62=a102_0x5aeca1;return SHELL_NAMES[_0x213d62(0x1ea)](getBasename(_0x5916e8));}function isEphemeralShellSpawner(_0x46d53e){const _0x47ff44=a102_0x5aeca1;return EPHEMERAL_SHELL_SPAWNERS[_0x47ff44(0x1ea)](getBasename(_0x46d53e));}let cachedShellPID;function findShellPID(){const _0x47a96e=a102_0x5aeca1;let _0x26f585=process['ppid'];const _0x2bd007=0xa;let _0x55cdb9=0x0;while(_0x55cdb9<_0x2bd007){const _0x245a5f=getProcessInfo(_0x26f585);if(!_0x245a5f){process[_0x47a96e(0x1e9)]['DEBUG']&&console[_0x47a96e(0x1cc)](_0x47a96e(0x1c4)+_0x26f585+_0x47a96e(0x1e3));break;}if(isShell(_0x245a5f[_0x47a96e(0x1ca)])){const _0x3a9ff3=getProcessInfo(_0x245a5f[_0x47a96e(0x1d3)]);if(_0x3a9ff3&&isEphemeralShellSpawner(_0x3a9ff3['comm'])){process[_0x47a96e(0x1e9)][_0x47a96e(0x1e1)]&&console[_0x47a96e(0x1cc)]('Found\x20ephemeral\x20shell\x20'+_0x245a5f[_0x47a96e(0x1d0)]+'\x20('+_0x245a5f[_0x47a96e(0x1ca)]+_0x47a96e(0x1da)+_0x3a9ff3[_0x47a96e(0x1ca)]+',\x20continuing\x20up');_0x26f585=_0x245a5f[_0x47a96e(0x1d3)],_0x55cdb9++;continue;}return _0x245a5f['pid'];}if(_0x245a5f[_0x47a96e(0x1d3)]===0x0||_0x245a5f[_0x47a96e(0x1d3)]===0x1){if(isShell(_0x245a5f['comm']))return _0x245a5f['pid'];break;}_0x26f585=_0x245a5f[_0x47a96e(0x1d3)],_0x55cdb9++;}return process[_0x47a96e(0x1e9)][_0x47a96e(0x1e1)]&&console[_0x47a96e(0x1cc)]('No\x20shell\x20found\x20in\x20process\x20tree,\x20falling\x20back\x20to\x20process.ppid'),process[_0x47a96e(0x1d3)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x1a8b5d){const _0x46c011=a102_0x5aeca1;try{return process[_0x46c011(0x1ed)](_0x1a8b5d,0x0),!![];}catch{return![];}}function a102_0x4197(){const _0x2c8777=['env','has','1129006UgdCzg','\x20on\x20Windows:','kill','trim','ps\x20-p\x20','\x20on\x20POSIX:','\x20-o\x20ppid=,comm=','replace','split','Could\x20not\x20get\x20process\x20info\x20for\x20PID\x20','2939488TzdcTV','ksh','join','platform','26060830xJnxHp','comm','xonsh','error','claude','length','toLowerCase','pid','6kLjzVN','csh','ppid','wmic\x20process\x20where\x20ProcessId=','Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20','pop','2063328qpFEZX','powershell','utf-8',')\x20spawned\x20by\x20','12182796OnsZIl','22840YYIJdw','zsh','36PUfiRO','\x20get\x20ParentProcessId,Name\x20/format:csv','ion','DEBUG','code',',\x20using\x20fallback','2jtSmen','dash','4851665gNQLXZ','fish','cursor'];a102_0x4197=function(){return _0x2c8777;};return a102_0x4197();}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1dc048,_0x2503e3){const _0x1db0c0=a103_0x537a,_0xd9237e=_0x1dc048();while(!![]){try{const _0x4e9041=-parseInt(_0x1db0c0(0x102))/0x1*(-parseInt(_0x1db0c0(0xfc))/0x2)+-parseInt(_0x1db0c0(0x110))/0x3+parseInt(_0x1db0c0(0x10e))/0x4*(parseInt(_0x1db0c0(0x101))/0x5)+-parseInt(_0x1db0c0(0x112))/0x6+-parseInt(_0x1db0c0(0x113))/0x7*(-parseInt(_0x1db0c0(0x103))/0x8)+parseInt(_0x1db0c0(0xff))/0x9*(-parseInt(_0x1db0c0(0x107))/0xa)+parseInt(_0x1db0c0(0xfe))/0xb;if(_0x4e9041===_0x2503e3)break;else _0xd9237e['push'](_0xd9237e['shift']());}catch(_0x66a59a){_0xd9237e['push'](_0xd9237e['shift']());}}}(a103_0x613f,0xe50fa));function a103_0x537a(_0x20dcb7,_0x305b3e){_0x20dcb7=_0x20dcb7-0xfc;const _0x613f45=a103_0x613f();let _0x537a1f=_0x613f45[_0x20dcb7];return _0x537a1f;}function a103_0x613f(){const _0x1364c6=['7545762qjqtTq','resume','21394KmCmJM','stdout','643423MoZqdU','2747367XWUPxK','question','10SpCbfx','93hQRaue','8vmUELe','\x20[y/N]\x20','setEncoding','close','10XCbUpl','stdin','\x20(y/N):\x20','setRawMode','toLowerCase','write','stderr','1010604qpOZvm','pause','2810109FHAazR','yes','2738292LSFQdL'];a103_0x613f=function(){return _0x1364c6;};return a103_0x613f();}import*as a103_0x3a38eb from'readline';export async function confirm(_0x28ba7e){const _0x3dfcd4=a103_0x537a,_0xcd4248=a103_0x3a38eb['createInterface']({'input':process[_0x3dfcd4(0x108)],'output':process[_0x3dfcd4(0xfd)]});return new Promise(_0x463b9d=>{const _0x1c01ef=_0x3dfcd4;_0xcd4248[_0x1c01ef(0x100)](_0x28ba7e+_0x1c01ef(0x109),_0x3c09c0=>{const _0x4ffc76=_0x1c01ef;_0xcd4248[_0x4ffc76(0x106)](),_0x463b9d(_0x3c09c0['toLowerCase']()==='y'||_0x3c09c0[_0x4ffc76(0x10b)]()===_0x4ffc76(0x111));});});}export async function confirmKey(_0x1f5e3e){const _0x4c1140=a103_0x537a;if(!process[_0x4c1140(0x108)]['isTTY'])return![];return process['stderr'][_0x4c1140(0x10c)](_0x1f5e3e+_0x4c1140(0x104)),new Promise(_0x6d3997=>{const _0xbc4630=_0x4c1140,_0x26dd1b=process[_0xbc4630(0x108)];_0x26dd1b[_0xbc4630(0x10a)](!![]),_0x26dd1b[_0xbc4630(0x114)](),_0x26dd1b[_0xbc4630(0x105)]('utf8');const _0x2266ba=_0x210686=>{const _0x502832=_0xbc4630;_0x26dd1b[_0x502832(0x10a)](![]),_0x26dd1b[_0x502832(0x10f)](),_0x26dd1b['removeListener']('data',_0x2266ba);if(_0x210686==='\x1b'){process[_0x502832(0x10d)][_0x502832(0x10c)]('\x0a'),_0x6d3997(![]);return;}_0x210686==='\x03'&&(process[_0x502832(0x10d)][_0x502832(0x10c)]('\x0a'),process['exit'](0x82));if(_0x210686[_0x502832(0x10b)]()==='y'){process[_0x502832(0x10d)][_0x502832(0x10c)]('y\x0a'),_0x6d3997(!![]);return;}process[_0x502832(0x10d)][_0x502832(0x10c)]('\x0a'),_0x6d3997(![]);};_0x26dd1b['on']('data',_0x2266ba);});}
|