@treasuredata/tdx 0.4.5 → 0.4.7
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/build-info.json +2 -2
- 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/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-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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.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/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +6 -5
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0xb658e5=a60_0x7c63;function a60_0x7c63(_0x5dd1fc,_0x391b25){const _0x367ba6=a60_0x367b();return a60_0x7c63=function(_0x7c63b7,_0x1e88d4){_0x7c63b7=_0x7c63b7-0x184;let _0x5b3f1b=_0x367ba6[_0x7c63b7];return _0x5b3f1b;},a60_0x7c63(_0x5dd1fc,_0x391b25);}(function(_0x5e1ff9,_0x12604b){const _0x46c15e=a60_0x7c63,_0x38f81=_0x5e1ff9();while(!![]){try{const _0x5f197f=parseInt(_0x46c15e(0x1ba))/0x1+-parseInt(_0x46c15e(0x193))/0x2+-parseInt(_0x46c15e(0x1a1))/0x3+parseInt(_0x46c15e(0x1a6))/0x4*(parseInt(_0x46c15e(0x18f))/0x5)+parseInt(_0x46c15e(0x1af))/0x6*(-parseInt(_0x46c15e(0x1bc))/0x7)+parseInt(_0x46c15e(0x186))/0x8+-parseInt(_0x46c15e(0x1a0))/0x9*(-parseInt(_0x46c15e(0x1c2))/0xa);if(_0x5f197f===_0x12604b)break;else _0x38f81['push'](_0x38f81['shift']());}catch(_0x346d1d){_0x38f81['push'](_0x38f81['shift']());}}}(a60_0x367b,0x56321));export const TD_ENDPOINTS={'us01':'https://api.treasuredata.com','jp01':a60_0xb658e5(0x190),'eu01':a60_0xb658e5(0x185),'ap02':a60_0xb658e5(0x187),'ap03':a60_0xb658e5(0x1bf),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a60_0xb658e5(0x19f),'stg-us01':a60_0xb658e5(0x1a4),'stg-jp01':a60_0xb658e5(0x198),'stg-ap03':a60_0xb658e5(0x1b1)};export const CDP_ENDPOINTS={'us01':'https://api-cdp.treasuredata.com','jp01':a60_0xb658e5(0x19d),'eu01':a60_0xb658e5(0x19e),'ap02':'https://api-cdp.ap02.treasuredata.com','ap03':a60_0xb658e5(0x197),'dev-us01':a60_0xb658e5(0x196),'dev-eu01':a60_0xb658e5(0x1b8),'stg-us01':'https://api-staging-cdp.us01.treasuredata.com','stg-jp01':a60_0xb658e5(0x195),'stg-ap03':a60_0xb658e5(0x19a)};export const WORKFLOW_ENDPOINTS={'us01':a60_0xb658e5(0x18c),'jp01':a60_0xb658e5(0x1c3),'eu01':a60_0xb658e5(0x19b),'ap02':a60_0xb658e5(0x1a2),'ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a60_0xb658e5(0x19c),'dev-eu01':a60_0xb658e5(0x1a3),'stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-jp01':a60_0xb658e5(0x194),'stg-ap03':a60_0xb658e5(0x1ad)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','jp01':a60_0xb658e5(0x18e),'eu01':'https://api-presto.eu01.treasuredata.com','ap02':a60_0xb658e5(0x1b3),'ap03':a60_0xb658e5(0x192),'dev-us01':a60_0xb658e5(0x191),'dev-eu01':a60_0xb658e5(0x1a5),'stg-us01':a60_0xb658e5(0x18a),'stg-jp01':a60_0xb658e5(0x188),'stg-ap03':a60_0xb658e5(0x1b2)};export const LLM_ENDPOINTS={'us01':'https://llm-api.treasuredata.com','jp01':a60_0xb658e5(0x1c1),'eu01':a60_0xb658e5(0x1bd),'ap02':'https://llm-api.ap02.treasuredata.com','ap03':a60_0xb658e5(0x1be),'dev-us01':a60_0xb658e5(0x1ac),'dev-eu01':a60_0xb658e5(0x1b7),'stg-us01':a60_0xb658e5(0x1bb),'stg-jp01':a60_0xb658e5(0x1ae),'stg-ap03':a60_0xb658e5(0x1aa)};export const ENGAGE_ENDPOINTS={'us01':'https://engage-api.treasuredata.com','jp01':a60_0xb658e5(0x18d),'eu01':a60_0xb658e5(0x18b),'ap02':a60_0xb658e5(0x1ab),'ap03':a60_0xb658e5(0x1a8),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a60_0xb658e5(0x199),'stg-us01':'https://engage-api-staging.us01.treasuredata.com','stg-jp01':a60_0xb658e5(0x1a7),'stg-ap03':a60_0xb658e5(0x1a9)};export const CONSOLE_ENDPOINTS={'us01':'https://console.treasuredata.com','jp01':a60_0xb658e5(0x1b0),'eu01':'https://console.eu01.treasuredata.com','ap02':a60_0xb658e5(0x1b4),'ap03':a60_0xb658e5(0x1b6),'dev-us01':a60_0xb658e5(0x184),'dev-eu01':'https://console-development.eu01.treasuredata.com','stg-us01':'https://console-staging.us01.treasuredata.com','stg-jp01':a60_0xb658e5(0x189),'stg-ap03':a60_0xb658e5(0x1c0)};export function getConsoleUrl(_0x5c5509,_0x27541a){const _0x26fa5e=a60_0xb658e5,_0x19bbc2=CONSOLE_ENDPOINTS[_0x5c5509]||'https://console.'+_0x5c5509+_0x26fa5e(0x1b5);return _0x27541a?''+_0x19bbc2+_0x27541a:_0x19bbc2;}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS};function a60_0x367b(){const _0x3169a4=['545902XWOGJX','https://llm-api-staging.us01.treasuredata.com','7VgNsJC','https://llm-api.eu01.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://api.ap03.treasuredata.com','https://console-staging.ap03.treasuredata.com','https://llm-api.treasuredata.co.jp','10fvyIDd','https://api-workflow.treasuredata.co.jp','https://console-development.treasuredata.com','https://api.eu01.treasuredata.com','3715432rDEMxJ','https://api.ap02.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://console-staging.treasuredata.co.jp','https://api-staging-presto.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://api-workflow.treasuredata.com','https://engage-api.treasuredata.co.jp','https://api-presto.treasuredata.co.jp','95jGeSby','https://api.treasuredata.co.jp','https://api-development-presto.treasuredata.com','https://api-presto.ap03.treasuredata.com','1020616FENBQx','https://api-staging-workflow.treasuredata.co.jp','https://api-staging-cdp.treasuredata.co.jp','https://api-development-cdp.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://api-staging.treasuredata.co.jp','https://engage-api-development.eu01.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://api-cdp.eu01.treasuredata.com','https://api-development.eu01.treasuredata.com','1440000lVyZHT','523647zXyIRz','https://api-workflow.ap02.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','https://api-staging.us01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','32612ZteBdW','https://engage-api-staging.treasuredata.co.jp','https://engage-api.ap03.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://engage-api.ap02.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','1723944rQwLhi','https://console.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://console.ap02.treasuredata.com','.treasuredata.com','https://console.ap03.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','\x27\x20and\x20site\x20\x27'];a60_0x367b=function(){return _0x3169a4;};return a60_0x367b();}export function getEndpoint(_0x1ce80d,_0x372dde='td'){const _0x63b555=a60_0xb658e5,_0x44dace=API_ENDPOINTS[_0x372dde]?.[_0x1ce80d];if(!_0x44dace)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x372dde+_0x63b555(0x1b9)+_0x1ce80d+'\x27');return _0x44dace;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a62_0x276116=a62_0x1ed0;function a62_0x224f(){const _0x4cead0=['1258570AacMbB','jp01','12026112yzuhum','894zPqpGo','126428OqToMu','18298FCwZHM','147xmPKcn','stg-us01','1462735eqHUDi','us01','32592753KXxbTl','6973610GNzArM'];a62_0x224f=function(){return _0x4cead0;};return a62_0x224f();}(function(_0x464d56,_0x4dd7cc){const _0x58ebe0=a62_0x1ed0,_0x3b1942=_0x464d56();while(!![]){try{const _0x380123=parseInt(_0x58ebe0(0xc6))/0x1+parseInt(_0x58ebe0(0xbe))/0x2+-parseInt(_0x58ebe0(0xc4))/0x3*(parseInt(_0x58ebe0(0xc2))/0x4)+-parseInt(_0x58ebe0(0xc9))/0x5+parseInt(_0x58ebe0(0xc1))/0x6*(-parseInt(_0x58ebe0(0xc3))/0x7)+-parseInt(_0x58ebe0(0xc0))/0x8+parseInt(_0x58ebe0(0xc8))/0x9;if(_0x380123===_0x4dd7cc)break;else _0x3b1942['push'](_0x3b1942['shift']());}catch(_0x31b2c1){_0x3b1942['push'](_0x3b1942['shift']());}}}(a62_0x224f,0xd62a6));function a62_0x1ed0(_0x3f54f2,_0x287c5e){const _0x224fec=a62_0x224f();return a62_0x1ed0=function(_0x1ed0a9,_0x2ac110){_0x1ed0a9=_0x1ed0a9-0xbe;let _0x5e1ba0=_0x224fec[_0x1ed0a9];return _0x5e1ba0;},a62_0x1ed0(_0x3f54f2,_0x287c5e);}export const SITE_ALIASES={'us':a62_0x276116(0xc7),'aws':a62_0x276116(0xc7),'jp':a62_0x276116(0xbf),'aws-tokyo':a62_0x276116(0xbf),'dev':'dev-us01','stg':a62_0x276116(0xc5)};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a67_0x1d1f(_0x55c174,_0x5f55b2){const _0x19670b=a67_0x1967();return a67_0x1d1f=function(_0x1d1f7f,_0x4d2647){_0x1d1f7f=_0x1d1f7f-0x110;let _0x105f75=_0x19670b[_0x1d1f7f];return _0x105f75;},a67_0x1d1f(_0x55c174,_0x5f55b2);}function a67_0x1967(){const _0x20f1b1=['341390dQBQFF','358804iMeHEd','5657360ukFeCk','892074sLhxrw','Project\x20name\x20cannot\x20be\x20empty','trim','20vFKbCX','1007946dzuNxb','split','3985776WrGyaH','Agent\x20reference\x20cannot\x20be\x20empty','length','32EeGEAl','Agent\x20name\x20cannot\x20be\x20empty','Invalid\x20agent\x20reference\x20format:\x20','96099kRWdRU','132gaJZjw'];a67_0x1967=function(){return _0x20f1b1;};return a67_0x1967();}(function(_0x4768e7,_0xfe7a0e){const _0x4b83a3=a67_0x1d1f,_0x2d8346=_0x4768e7();while(!![]){try{const _0x252cbe=parseInt(_0x4b83a3(0x112))/0x1+parseInt(_0x4b83a3(0x11d))/0x2+-parseInt(_0x4b83a3(0x11a))/0x3*(parseInt(_0x4b83a3(0x11b))/0x4)+-parseInt(_0x4b83a3(0x111))/0x5*(-parseInt(_0x4b83a3(0x11f))/0x6)+-parseInt(_0x4b83a3(0x11c))/0x7*(-parseInt(_0x4b83a3(0x117))/0x8)+parseInt(_0x4b83a3(0x114))/0x9+-parseInt(_0x4b83a3(0x11e))/0xa;if(_0x252cbe===_0xfe7a0e)break;else _0x2d8346['push'](_0x2d8346['shift']());}catch(_0x4822a1){_0x2d8346['push'](_0x2d8346['shift']());}}}(a67_0x1967,0xc29ff));export function parseAgentRef(_0x1abd4f){const _0x358b95=a67_0x1d1f;if(!_0x1abd4f||_0x1abd4f[_0x358b95(0x110)]()==='')throw new Error(_0x358b95(0x115));const _0x465010=_0x1abd4f[_0x358b95(0x110)](),_0x1da738=_0x465010[_0x358b95(0x113)]('/');if(_0x1da738['length']===0x1)return{'projectName':_0x1da738[0x0],'agentName':undefined};else{if(_0x1da738[_0x358b95(0x116)]===0x2){const [_0x4d901e,_0x3ebff4]=_0x1da738;if(!_0x4d901e||_0x4d901e[_0x358b95(0x110)]()==='')throw new Error(_0x358b95(0x120));if(!_0x3ebff4||_0x3ebff4[_0x358b95(0x110)]()==='')throw new Error(_0x358b95(0x118));return{'projectName':_0x4d901e[_0x358b95(0x110)](),'agentName':_0x3ebff4[_0x358b95(0x110)]()};}else throw new Error(_0x358b95(0x119)+_0x1abd4f+'.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22');}}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a68_0x130a(){const _0x5c77da=['1007354ErSWJW','trim','525182sQenmb','5144duQfVW','1041SYPATc','223624znZVCL','10fofleM','cwd','.cache','1308865hzOPuB','1446018YDHDPb','utf-8','12QTyKSc','164879CSlbYc','117KqscTA'];a68_0x130a=function(){return _0x5c77da;};return a68_0x130a();}(function(_0x210455,_0x4b590e){const _0x4b0832=a68_0x509e,_0x5b5138=_0x210455();while(!![]){try{const _0xe180af=parseInt(_0x4b0832(0x1ff))/0x1+parseInt(_0x4b0832(0x1fd))/0x2+-parseInt(_0x4b0832(0x201))/0x3*(parseInt(_0x4b0832(0x200))/0x4)+-parseInt(_0x4b0832(0x1f7))/0x5+-parseInt(_0x4b0832(0x1fa))/0x6*(parseInt(_0x4b0832(0x1f8))/0x7)+parseInt(_0x4b0832(0x202))/0x8*(parseInt(_0x4b0832(0x1fc))/0x9)+parseInt(_0x4b0832(0x1f4))/0xa*(parseInt(_0x4b0832(0x1fb))/0xb);if(_0xe180af===_0x4b590e)break;else _0x5b5138['push'](_0x5b5138['shift']());}catch(_0x3e6ae7){_0x5b5138['push'](_0x5b5138['shift']());}}}(a68_0x130a,0x45d7a));function a68_0x509e(_0x5c73fb,_0x32b9a7){const _0x130ada=a68_0x130a();return a68_0x509e=function(_0x509e17,_0x385151){_0x509e17=_0x509e17-0x1f4;let _0x4aca14=_0x130ada[_0x509e17];return _0x4aca14;},a68_0x509e(_0x5c73fb,_0x32b9a7);}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x2d1540=a68_0x509e;return join(process[_0x2d1540(0x1f5)](),_0x2d1540(0x1f6),'tdx');}function getLastChatIdPath(){return join(getCacheDir(),'last_chat_id');}function ensureCacheDir(){const _0x10f634=getCacheDir();!existsSync(_0x10f634)&&mkdirSync(_0x10f634,{'recursive':!![]});}export function saveLastChatId(_0x4e79d5){ensureCacheDir();const _0x4047f8=getLastChatIdPath();writeFileSync(_0x4047f8,_0x4e79d5,'utf-8');}export function loadLastChatId(){const _0x1198c2=a68_0x509e,_0x3b25b8=getLastChatIdPath();if(!existsSync(_0x3b25b8))return undefined;try{const _0x3433e6=readFileSync(_0x3b25b8,_0x1198c2(0x1f9))[_0x1198c2(0x1fe)]();return _0x3433e6||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x5ab358=a68_0x509e,_0x2fd304=getLastChatIdPath();if(existsSync(_0x2fd304))try{writeFileSync(_0x2fd304,'',_0x5ab358(0x1f9));}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x322fc7,_0x10ce25){const _0x211489=a69_0x5f93,_0x2208b5=_0x322fc7();while(!![]){try{const _0x31ac1a=-parseInt(_0x211489(0xde))/0x1*(-parseInt(_0x211489(0xf2))/0x2)+-parseInt(_0x211489(0xec))/0x3+-parseInt(_0x211489(0xf4))/0x4+-parseInt(_0x211489(0xdb))/0x5*(-parseInt(_0x211489(0xed))/0x6)+-parseInt(_0x211489(0xe2))/0x7+parseInt(_0x211489(0xe3))/0x8+parseInt(_0x211489(0xeb))/0x9;if(_0x31ac1a===_0x10ce25)break;else _0x2208b5['push'](_0x2208b5['shift']());}catch(_0x1ee061){_0x2208b5['push'](_0x2208b5['shift']());}}}(a69_0x48fe,0x78dd5));import{Chalk}from'chalk';export function shouldUseColor(_0x1dd863={}){const _0x2cba84=a69_0x5f93;if(_0x1dd863[_0x2cba84(0xdc)]===!![])return![];if(_0x1dd863['color']===!![])return!![];if(process[_0x2cba84(0xe0)][_0x2cba84(0xef)]!==undefined)return![];return process[_0x2cba84(0xf5)][_0x2cba84(0xe9)]??![];}export function getChalk(_0x3cc4c1={}){if(shouldUseColor(_0x3cc4c1))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x473ea3,_0x2085f2={}){const _0x22a036=a69_0x5f93;return getChalk(_0x2085f2)[_0x22a036(0xf0)](_0x473ea3);}function a69_0x48fe(){const _0x1f5bc0=['1733472zQkfAJ','stdout','null','green','string','3958155enfVWX','noColor','yellow','7yIThyD','boolean','env','map','6206123lrhzLj','3065952wyhsNq','number','join','object','cyan','stringify','isTTY','repeat','2821851kojTEh','350475YEgaTX','6plJuhu','isArray','NO_COLOR','dim','entries','126694OGNiIW','length'];a69_0x48fe=function(){return _0x1f5bc0;};return a69_0x48fe();}export function colorHeader(_0x5917e6,_0x22537e={}){const _0xc814c9=a69_0x5f93;return getChalk(_0x22537e)[_0xc814c9(0xe7)](_0x5917e6);}export function colorType(_0x49be57,_0x1b5150={}){const _0x568c6c=a69_0x5f93;return getChalk(_0x1b5150)[_0x568c6c(0xf0)](_0x49be57);}export function colorJSONKey(_0x208f9f,_0xcc2839={}){return getChalk(_0xcc2839)['blue'](_0x208f9f);}export function colorJSONString(_0x225e37,_0x3ddbda={}){const _0x2b4683=a69_0x5f93;return getChalk(_0x3ddbda)[_0x2b4683(0xd9)](_0x225e37);}export function colorJSONNumber(_0x46aab0,_0x554371={}){return getChalk(_0x554371)['cyan'](_0x46aab0);}export function colorJSONBoolean(_0xe59dde,_0x17cc54={}){const _0xb24bff=a69_0x5f93;return getChalk(_0x17cc54)[_0xb24bff(0xdd)](_0xe59dde);}export function colorJSONNull(_0x11344f,_0xb90ca2={}){const _0x466a6c=a69_0x5f93;return getChalk(_0xb90ca2)[_0x466a6c(0xf0)](_0x11344f);}export function colorizeJSONCompact(_0x5b6863,_0x1b31d1={}){const _0x464cf9=a69_0x5f93;if(!shouldUseColor(_0x1b31d1))return JSON[_0x464cf9(0xe8)](_0x5b6863);if(_0x5b6863===null)return colorJSONNull(_0x464cf9(0xd8),_0x1b31d1);if(typeof _0x5b6863===_0x464cf9(0xdf))return colorJSONBoolean(String(_0x5b6863),_0x1b31d1);if(typeof _0x5b6863===_0x464cf9(0xe4))return colorJSONNumber(String(_0x5b6863),_0x1b31d1);if(typeof _0x5b6863===_0x464cf9(0xda))return colorJSONString(JSON[_0x464cf9(0xe8)](_0x5b6863),_0x1b31d1);if(Array[_0x464cf9(0xee)](_0x5b6863)){if(_0x5b6863[_0x464cf9(0xf3)]===0x0)return'[]';const _0x4615a8=_0x5b6863['map'](_0x560b96=>colorizeJSONCompact(_0x560b96,_0x1b31d1));return'['+_0x4615a8[_0x464cf9(0xe5)](',')+']';}if(typeof _0x5b6863==='object'){const _0x896546=Object[_0x464cf9(0xf1)](_0x5b6863);if(_0x896546[_0x464cf9(0xf3)]===0x0)return'{}';const _0x4d388b=_0x896546[_0x464cf9(0xe1)](([_0x5e23a8,_0x151890])=>{const _0x1f18b4=_0x464cf9,_0xc53695=colorJSONKey(JSON[_0x1f18b4(0xe8)](_0x5e23a8),_0x1b31d1),_0x460236=colorizeJSONCompact(_0x151890,_0x1b31d1);return _0xc53695+':'+_0x460236;});return'{'+_0x4d388b[_0x464cf9(0xe5)](',')+'}';}return String(_0x5b6863);}function a69_0x5f93(_0x453129,_0x4ca87e){const _0x48fe8e=a69_0x48fe();return a69_0x5f93=function(_0x5f930,_0x4e77f3){_0x5f930=_0x5f930-0xd8;let _0x1005c3=_0x48fe8e[_0x5f930];return _0x1005c3;},a69_0x5f93(_0x453129,_0x4ca87e);}export function colorizeJSON(_0x47db10,_0x2e2bdd={},_0x220ce3=0x0){const _0x27fbf4=a69_0x5f93;if(!shouldUseColor(_0x2e2bdd))return JSON[_0x27fbf4(0xe8)](_0x47db10,null,0x2);const _0x2e1e7c='\x20'[_0x27fbf4(0xea)](_0x220ce3),_0x38e5c8=_0x220ce3+0x2;if(_0x47db10===null)return colorJSONNull(_0x27fbf4(0xd8),_0x2e2bdd);if(typeof _0x47db10===_0x27fbf4(0xdf))return colorJSONBoolean(String(_0x47db10),_0x2e2bdd);if(typeof _0x47db10===_0x27fbf4(0xe4))return colorJSONNumber(String(_0x47db10),_0x2e2bdd);if(typeof _0x47db10===_0x27fbf4(0xda))return colorJSONString(JSON[_0x27fbf4(0xe8)](_0x47db10),_0x2e2bdd);if(Array[_0x27fbf4(0xee)](_0x47db10)){if(_0x47db10[_0x27fbf4(0xf3)]===0x0)return'[]';const _0x1694a9=_0x47db10[_0x27fbf4(0xe1)](_0x4ce900=>{const _0x495cca=_0x27fbf4,_0x4f8c98=colorizeJSON(_0x4ce900,_0x2e2bdd,_0x38e5c8);return''+'\x20'[_0x495cca(0xea)](_0x38e5c8)+_0x4f8c98;});return'[\x0a'+_0x1694a9['join'](',\x0a')+('\x0a'+_0x2e1e7c+']');}if(typeof _0x47db10===_0x27fbf4(0xe6)){const _0x5edf9e=Object['entries'](_0x47db10);if(_0x5edf9e[_0x27fbf4(0xf3)]===0x0)return'{}';const _0x39e200=_0x5edf9e[_0x27fbf4(0xe1)](([_0x21a53a,_0x45cbf4])=>{const _0x47e5dd=_0x27fbf4,_0x59c561=colorJSONKey(JSON[_0x47e5dd(0xe8)](_0x21a53a),_0x2e2bdd),_0x22e494=colorizeJSON(_0x45cbf4,_0x2e2bdd,_0x38e5c8);return''+'\x20'['repeat'](_0x38e5c8)+_0x59c561+':\x20'+_0x22e494;});return'{\x0a'+_0x39e200[_0x27fbf4(0xe5)](',\x0a')+('\x0a'+_0x2e1e7c+'}');}return String(_0x47db10);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x6b540f,_0x403cd0){const _0x5b3846=a70_0x3b1c,_0x466286=_0x6b540f();while(!![]){try{const _0x1dde42=parseInt(_0x5b3846(0xb8))/0x1+parseInt(_0x5b3846(0xaa))/0x2*(parseInt(_0x5b3846(0xc8))/0x3)+-parseInt(_0x5b3846(0xee))/0x4*(parseInt(_0x5b3846(0xcc))/0x5)+-parseInt(_0x5b3846(0xea))/0x6+-parseInt(_0x5b3846(0xd0))/0x7+parseInt(_0x5b3846(0xd3))/0x8*(parseInt(_0x5b3846(0xbd))/0x9)+-parseInt(_0x5b3846(0xba))/0xa;if(_0x1dde42===_0x403cd0)break;else _0x466286['push'](_0x466286['shift']());}catch(_0x283b94){_0x466286['push'](_0x466286['shift']());}}}(a70_0x5336,0x75ee7));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a70_0x47346f from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x52656a){const _0x367b80=a70_0x3b1c;return{'format':_0x52656a[_0x367b80(0xd6)]||_0x367b80(0xc4),'output':_0x52656a[_0x367b80(0xb5)]||'','limit':_0x52656a[_0x367b80(0xda)],'color':_0x52656a[_0x367b80(0xe9)],'noColor':_0x52656a[_0x367b80(0xb7)]};}function convertSDKResultToQueryResult(_0x2ea147){const _0x163086=a70_0x3b1c,_0x28bd7b=[];if(_0x2ea147['length']>0x0){const _0x50a9d3=_0x2ea147[0x0];for(const [_0x1724c1,_0x353842]of Object[_0x163086(0xe7)](_0x50a9d3)){let _0x474b25=_0x163086(0xdd);if(typeof _0x353842===_0x163086(0xb3))_0x474b25=Number[_0x163086(0xd5)](_0x353842)?_0x163086(0xe8):_0x163086(0xd1);else{if(typeof _0x353842===_0x163086(0xe2))_0x474b25='boolean';else _0x353842===null&&(_0x474b25=_0x163086(0xdd));}_0x28bd7b[_0x163086(0xc6)]({'name':_0x1724c1,'type':_0x474b25});}}return{'queryId':_0x163086(0xd8),'columns':_0x28bd7b,'data':_0x2ea147,'stats':{'state':_0x163086(0xcd),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2ea147['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3539c3,_0x295b4c){const _0x4eb85d=convertSDKResultToQueryResult(_0x3539c3);return formatQueryOutput(_0x4eb85d,_0x295b4c);}export async function formatQueryOutput(_0x505fd7,_0xd2c2d6){const _0x25e31f=a70_0x3b1c,{format:_0x1ac3f0,limit:_0x4b11ad,output:_0x4bb843,color:_0x229601,noColor:_0x3a4292}=_0xd2c2d6,_0x1f039d=Boolean(_0x4bb843)&&!_0x229601,_0x2e159f={'color':_0x229601,'noColor':_0x3a4292||_0x1f039d};if(_0x1ac3f0==='table'){const _0x2a80ac=shouldUseLess(_0x1ac3f0,_0x4bb843);return formatAsTable(_0x505fd7,_0x4b11ad,_0x2a80ac,_0x2e159f);}else{if(_0x1ac3f0===_0x25e31f(0xe3))return formatAsJSON(_0x505fd7,_0x2e159f);else return _0x1ac3f0===_0x25e31f(0xd4)?formatAsJSONL(_0x505fd7,_0x2e159f):formatQueryResult(_0x505fd7,_0x1ac3f0);}}function shouldUseLess(_0xd49dcc,_0x56dfbf){const _0x572cbb=a70_0x3b1c;return _0xd49dcc===_0x572cbb(0xc4)&&process[_0x572cbb(0xd9)]['isTTY']&&!_0x56dfbf;}export function resolveOutputOptions(_0x18febd){const _0x41dae2=a70_0x3b1c,_0x458004=resolveOutputFormat(_0x18febd[_0x41dae2(0xd6)],_0x18febd[_0x41dae2(0xb5)],'table');let _0x2afa79=typeof _0x18febd[_0x41dae2(0xda)]===_0x41dae2(0xb3)?_0x18febd[_0x41dae2(0xda)]:parseInt(_0x18febd['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x193337=_0x18febd['output']||'';return shouldUseLess(_0x458004,_0x193337)&&(_0x2afa79=Infinity),{'format':_0x458004,'output':_0x193337,'limit':_0x2afa79,'color':_0x18febd[_0x41dae2(0xe9)],'noColor':_0x18febd[_0x41dae2(0xb7)]};}export function writeOutput(_0x348da2,_0x34249f,_0x2a21a4){const _0x257c1c=a70_0x3b1c;return _0x34249f?(writeFileSync(_0x34249f,_0x348da2),console['error'](_0x257c1c(0xdb)+_0x34249f),Promise['resolve']()):shouldUseLess(_0x2a21a4||'','')?new Promise(_0x216b65=>{const _0x23f5c1=_0x257c1c,_0x3d4739=spawn(_0x23f5c1(0xc0),['-FXRSn'],{'stdio':[_0x23f5c1(0xcb),_0x23f5c1(0xb9),_0x23f5c1(0xb9)]});let _0x722990=![];_0x3d4739['on'](_0x23f5c1(0xce),()=>{const _0x376384=_0x23f5c1;!_0x722990&&(_0x722990=!![],console[_0x376384(0xed)](_0x348da2),_0x216b65());}),_0x3d4739['on'](_0x23f5c1(0xbc),()=>{!_0x722990&&(_0x722990=!![],_0x216b65());}),_0x3d4739['on'](_0x23f5c1(0xd7),()=>{const _0x9da358=_0x23f5c1;!_0x722990&&_0x3d4739['stdin']&&(_0x3d4739[_0x9da358(0xde)]['on']('error',()=>{}),_0x3d4739[_0x9da358(0xde)][_0x9da358(0xac)](_0x348da2),_0x3d4739[_0x9da358(0xde)][_0x9da358(0xdf)]());}),!_0x3d4739[_0x23f5c1(0xde)]&&(!_0x722990&&(_0x722990=!![],console['log'](_0x348da2),_0x216b65()));}):(console['log'](_0x348da2),Promise[_0x257c1c(0xbb)]());}function a70_0x5336(){const _0x2cf5f7=['close','99765XwFbFD','stringify','[query]','less','query','keys','─┴─','table','params','push','debug','69QYfZdM','bold','string','pipe','632945VWlAeO','FINISHED','error','[rule]','1242353BzBxPn','double','split','112owqIKM','jsonl','isInteger','format','spawn','sdk-result','stdout','limit','Results\x20saved\x20to\x20','[logs]','varchar','stdin','end','padEnd','magenta','boolean','json','length','cmdout','yellow','entries','bigint','color','1948134OudlPP','trim','max','log','16iyluRi','blue','filter','rule','68494UOyLtn','stderr','write','object','cyan','join','[error]','map','forEach','number','red','output','repeat','noColor','904874DzbwHj','inherit','3561740TiARie','resolve'];a70_0x5336=function(){return _0x2cf5f7;};return a70_0x5336();}export async function handleSDKOutput(_0x5ab620,_0x584e8a){const _0x266612=a70_0x3b1c,_0x315cc2=resolveOutputOptions(_0x584e8a),_0x116978=await formatSDKOutput(_0x5ab620,_0x315cc2);await writeOutput(_0x116978,_0x315cc2['output']||undefined,_0x315cc2[_0x266612(0xd6)]);}export async function handleQueryOutput(_0x15fa64,_0xc2650d){const _0x5837ee=a70_0x3b1c,_0x21e801=resolveOutputOptions(_0xc2650d),_0x240ec2=await formatQueryOutput(_0x15fa64,_0x21e801);await writeOutput(_0x240ec2,_0x21e801['output']||undefined,_0x21e801[_0x5837ee(0xd6)]);}function a70_0x3b1c(_0x5517b2,_0x1f6963){const _0x53368f=a70_0x5336();return a70_0x3b1c=function(_0x3b1c5f,_0x5e3551){_0x3b1c5f=_0x3b1c5f-0xa7;let _0x5b5196=_0x53368f[_0x3b1c5f];return _0x5b5196;},a70_0x3b1c(_0x5517b2,_0x1f6963);}async function formatSingleObject(_0x1d7e28,_0x20d5c7){const _0x1add7f=a70_0x3b1c,{format:_0x1209b6,color:_0x843f41,noColor:_0xa8f298}=_0x20d5c7,_0x248dca={'color':_0x843f41,'noColor':_0xa8f298};if(_0x1209b6===_0x1add7f(0xe3)){if(shouldUseColor(_0x248dca))return colorizeJSON(_0x1d7e28,_0x248dca);return JSON[_0x1add7f(0xbe)](_0x1d7e28,null,0x2);}else{if(_0x1209b6==='jsonl'){if(shouldUseColor(_0x248dca))return colorizeJSONCompact(_0x1d7e28,_0x248dca);return JSON[_0x1add7f(0xbe)](_0x1d7e28);}else{if(_0x1209b6==='tsv')return Object[_0x1add7f(0xe7)](_0x1d7e28)[_0x1add7f(0xb1)](([_0x4b9ed6,_0x2610a6])=>_0x4b9ed6+'\x09'+_0x2610a6)[_0x1add7f(0xaf)]('\x0a');else{const _0x5024f8=Object['entries'](_0x1d7e28);if(_0x5024f8[_0x1add7f(0xe4)]===0x0)return'No\x20data';const _0x4d4f26=_0x1d7e28['debug'],_0x14448c=_0x1d7e28[_0x1add7f(0xc1)],_0xf806c2=_0x1d7e28[_0x1add7f(0xc5)],_0x59c437=_0x1d7e28[_0x1add7f(0xa9)],_0x20a950=_0x14448c?typeof _0x14448c===_0x1add7f(0xca)?_0x14448c:JSON[_0x1add7f(0xbe)](_0x14448c,null,0x2):undefined,_0xd99ea7=_0xf806c2&&Object[_0x1add7f(0xc2)](_0xf806c2)[_0x1add7f(0xe4)]>0x0?JSON[_0x1add7f(0xbe)](_0xf806c2,null,0x2):undefined,_0xe1a291=_0x59c437&&Object['keys'](_0x59c437)[_0x1add7f(0xe4)]>0x0?JSON[_0x1add7f(0xbe)](_0x59c437,null,0x2):undefined,_0x3819ca=_0x5024f8[_0x1add7f(0xa8)](([_0x2efc85])=>_0x2efc85!==_0x1add7f(0xc7)&&_0x2efc85!==_0x1add7f(0xc1)&&_0x2efc85!=='params'&&_0x2efc85!==_0x1add7f(0xa9)),_0x12b522=Math['max'](..._0x3819ca[_0x1add7f(0xb1)](([_0x4bd694])=>_0x4bd694[_0x1add7f(0xe4)])),_0x3bfdb5=Math['max'](..._0x3819ca[_0x1add7f(0xb1)](([,_0x2e0977])=>{const _0x5aa85f=_0x1add7f;try{const _0x28e96c=_0x2e0977===null||_0x2e0977===undefined?'':typeof _0x2e0977==='object'?JSON[_0x5aa85f(0xbe)](_0x2e0977):String(_0x2e0977),_0xd4037a=_0x28e96c[_0x5aa85f(0xd2)]('\x0a');return Math[_0x5aa85f(0xec)](..._0xd4037a[_0x5aa85f(0xb1)](_0x50fc9a=>_0x50fc9a['length']),0x0);}catch{return 0x0;}}),0x14),_0x5e6c37=[];_0x5e6c37[_0x1add7f(0xc6)](colorBorder('┌─'+'─'[_0x1add7f(0xb6)](_0x12b522)+'─┬─'+'─'[_0x1add7f(0xb6)](_0x3bfdb5)+'─┐',_0x248dca)),_0x3819ca['forEach'](([_0x1c3780,_0x25c4c8])=>{const _0x12b444=_0x1add7f;let _0x1e83df;try{_0x1e83df=_0x25c4c8===null||_0x25c4c8===undefined?'':typeof _0x25c4c8===_0x12b444(0xad)?JSON[_0x12b444(0xbe)](_0x25c4c8):String(_0x25c4c8);}catch{_0x1e83df='[Object]';}const _0x566dcf=_0x1c3780[_0x12b444(0xe0)](_0x12b522),_0x307169=_0x1e83df[_0x12b444(0xd2)]('\x0a');_0x307169[_0x12b444(0xb2)]((_0x2ba2f9,_0x4cf692)=>{const _0x5cff82=_0x12b444,_0x471b22=colorBorder('│',_0x248dca);_0x4cf692===0x0?_0x5e6c37[_0x5cff82(0xc6)](_0x471b22+'\x20'+_0x566dcf+'\x20'+_0x471b22+'\x20'+_0x2ba2f9[_0x5cff82(0xe0)](_0x3bfdb5)+'\x20'+_0x471b22):_0x5e6c37[_0x5cff82(0xc6)](_0x471b22+'\x20'+'\x20'['repeat'](_0x12b522)+'\x20'+_0x471b22+'\x20'+_0x2ba2f9['padEnd'](_0x3bfdb5)+'\x20'+_0x471b22);});}),_0x5e6c37[_0x1add7f(0xc6)](colorBorder('└─'+'─'[_0x1add7f(0xb6)](_0x12b522)+_0x1add7f(0xc3)+'─'[_0x1add7f(0xb6)](_0x3bfdb5)+'─┘',_0x248dca));_0x20a950&&(_0x5e6c37[_0x1add7f(0xc6)](''),_0x5e6c37[_0x1add7f(0xc6)](String(a70_0x47346f[_0x1add7f(0xe6)][_0x1add7f(0xc9)](_0x1add7f(0xbf)))),_0x5e6c37[_0x1add7f(0xc6)](_0x20a950));_0xd99ea7&&(_0x5e6c37[_0x1add7f(0xc6)](''),_0x5e6c37[_0x1add7f(0xc6)](String(a70_0x47346f[_0x1add7f(0xa7)][_0x1add7f(0xc9)]('[params]'))),_0x5e6c37[_0x1add7f(0xc6)](_0xd99ea7));_0xe1a291&&(_0x5e6c37[_0x1add7f(0xc6)](''),_0x5e6c37['push'](String(a70_0x47346f[_0x1add7f(0xe1)]['bold'](_0x1add7f(0xcf)))),_0x5e6c37[_0x1add7f(0xc6)](_0xe1a291));if(_0x4d4f26){if(_0x4d4f26[_0x1add7f(0xab)]){_0x5e6c37[_0x1add7f(0xc6)](''),_0x5e6c37['push'](String(a70_0x47346f[_0x1add7f(0xb4)][_0x1add7f(0xc9)](_0x1add7f(0xb0))));const _0x40f036=_0x4d4f26[_0x1add7f(0xab)][_0x1add7f(0xd2)]('\x0a');_0x40f036[_0x1add7f(0xb2)](_0x521f42=>{const _0x1503ed=_0x1add7f;_0x521f42[_0x1503ed(0xeb)]()&&_0x5e6c37[_0x1503ed(0xc6)](_0x521f42);});}if(_0x4d4f26[_0x1add7f(0xe5)]){_0x5e6c37[_0x1add7f(0xc6)](''),_0x5e6c37[_0x1add7f(0xc6)](String(a70_0x47346f[_0x1add7f(0xae)][_0x1add7f(0xc9)](_0x1add7f(0xdc))));const _0x36fa07=_0x4d4f26[_0x1add7f(0xe5)][_0x1add7f(0xd2)]('\x0a');_0x36fa07[_0x1add7f(0xb2)](_0x30aade=>{const _0x226565=_0x1add7f;_0x30aade['trim']()&&_0x5e6c37[_0x226565(0xc6)](_0x30aade);});}}return _0x5e6c37[_0x1add7f(0xaf)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x183e6c,_0x5613ec){const _0x6ce3f3=a70_0x3b1c,_0x24b916=resolveOutputOptions(_0x5613ec),_0xbb1607=await formatSingleObject(_0x183e6c,_0x24b916);await writeOutput(_0xbb1607,_0x24b916[_0x6ce3f3(0xb5)]||undefined,_0x24b916[_0x6ce3f3(0xd6)]);}
|
|
1
|
+
(function(_0x3afa1d,_0x436bf8){const _0xeafe2=a70_0x24f1,_0x3fe141=_0x3afa1d();while(!![]){try{const _0x264d37=parseInt(_0xeafe2(0x19c))/0x1*(parseInt(_0xeafe2(0x1c4))/0x2)+parseInt(_0xeafe2(0x1d1))/0x3+-parseInt(_0xeafe2(0x1a7))/0x4+parseInt(_0xeafe2(0x1c6))/0x5+parseInt(_0xeafe2(0x1a2))/0x6*(parseInt(_0xeafe2(0x1bf))/0x7)+-parseInt(_0xeafe2(0x1ba))/0x8*(-parseInt(_0xeafe2(0x1cd))/0x9)+-parseInt(_0xeafe2(0x1a3))/0xa*(parseInt(_0xeafe2(0x1b2))/0xb);if(_0x264d37===_0x436bf8)break;else _0x3fe141['push'](_0x3fe141['shift']());}catch(_0x448311){_0x3fe141['push'](_0x3fe141['shift']());}}}(a70_0x342f,0x8fec6));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a70_0x292819 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x5afaa9){const _0xa0326e=a70_0x24f1;return{'format':_0x5afaa9[_0xa0326e(0x1a1)]||_0xa0326e(0x1c5),'output':_0x5afaa9[_0xa0326e(0x1c3)]||'','limit':_0x5afaa9[_0xa0326e(0x190)],'color':_0x5afaa9[_0xa0326e(0x1c1)],'noColor':_0x5afaa9['noColor']};}function convertSDKResultToQueryResult(_0x376af7){const _0x2ced3b=a70_0x24f1,_0x512c51=[];if(_0x376af7[_0x2ced3b(0x1ad)]>0x0){const _0x2ac69a=_0x376af7[0x0];for(const [_0x52683f,_0x50b834]of Object[_0x2ced3b(0x1be)](_0x2ac69a)){let _0x3d8387=_0x2ced3b(0x1c8);if(typeof _0x50b834==='number')_0x3d8387=Number[_0x2ced3b(0x19b)](_0x50b834)?_0x2ced3b(0x1d5):_0x2ced3b(0x1b6);else{if(typeof _0x50b834==='boolean')_0x3d8387=_0x2ced3b(0x1c9);else _0x50b834===null&&(_0x3d8387=_0x2ced3b(0x1c8));}_0x512c51['push']({'name':_0x52683f,'type':_0x3d8387});}}return{'queryId':_0x2ced3b(0x1d4),'columns':_0x512c51,'data':_0x376af7,'stats':{'state':_0x2ced3b(0x18e),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x376af7['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}function a70_0x342f(){const _0x547422=['query','[query]','cmdout','length','less','pipe','[params]','forEach','8235062wtIWmQ','bold','stdout','split','double','stderr','resolve','─┴─','568hJHxId','debug','error','[rule]','entries','1883sPggNH','blue','color','rule','output','2hoNWHr','table','4689265kJEnoF','join','varchar','boolean','max','stringify','write','11277PSaCYE','close','isTTY','padEnd','2266704XIVDAS','-FXRSn','yellow','sdk-result','bigint','cyan','FINISHED','[error]','limit','No\x20data','stdin','string','keys','jsonl','map','repeat','number','inherit','object','isInteger','399769mIBfRJ','push','params','spawn','log','format','15522zjqvhI','20rsBvEh','magenta','noColor','[Object]','3165048WSJOEN','trim','red'];a70_0x342f=function(){return _0x547422;};return a70_0x342f();}export async function formatSDKOutput(_0x4c7b2a,_0x386fa0){const _0x264985=convertSDKResultToQueryResult(_0x4c7b2a);return formatQueryOutput(_0x264985,_0x386fa0);}export async function formatQueryOutput(_0x21a7d6,_0x44b02b){const _0x550305=a70_0x24f1,{format:_0x2ebd5a,limit:_0x1b8a8e,output:_0x4d107d,color:_0x5b323e,noColor:_0x244472}=_0x44b02b,_0x280491=Boolean(_0x4d107d)&&!_0x5b323e,_0x5dfff2={'color':_0x5b323e,'noColor':_0x244472||_0x280491};if(_0x2ebd5a===_0x550305(0x1c5)){const _0x1451f1=shouldUseLess(_0x2ebd5a,_0x4d107d);return formatAsTable(_0x21a7d6,_0x1b8a8e,_0x1451f1,_0x5dfff2);}else{if(_0x2ebd5a==='json')return formatAsJSON(_0x21a7d6,_0x5dfff2);else return _0x2ebd5a===_0x550305(0x195)?formatAsJSONL(_0x21a7d6,_0x5dfff2):formatQueryResult(_0x21a7d6,_0x2ebd5a);}}function shouldUseLess(_0x426e9e,_0x1123c7){const _0x3e3ca9=a70_0x24f1;return _0x426e9e==='table'&&process[_0x3e3ca9(0x1b4)][_0x3e3ca9(0x1cf)]&&!_0x1123c7;}export function resolveOutputOptions(_0x48c0fb){const _0x56a845=a70_0x24f1,_0x48e13d=resolveOutputFormat(_0x48c0fb['format'],_0x48c0fb['output'],_0x56a845(0x1c5));let _0x25c15c=typeof _0x48c0fb[_0x56a845(0x190)]===_0x56a845(0x198)?_0x48c0fb[_0x56a845(0x190)]:parseInt(_0x48c0fb[_0x56a845(0x190)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x59c7a9=_0x48c0fb[_0x56a845(0x1c3)]||'';return shouldUseLess(_0x48e13d,_0x59c7a9)&&(_0x25c15c=Infinity),{'format':_0x48e13d,'output':_0x59c7a9,'limit':_0x25c15c,'color':_0x48c0fb[_0x56a845(0x1c1)],'noColor':_0x48c0fb[_0x56a845(0x1a5)]};}export function writeOutput(_0x298eb0,_0xf2eee1,_0x5de5f4){const _0x3b644d=a70_0x24f1;return _0xf2eee1?(writeFileSync(_0xf2eee1,_0x298eb0),console['error']('Results\x20saved\x20to\x20'+_0xf2eee1),Promise[_0x3b644d(0x1b8)]()):shouldUseLess(_0x5de5f4||'','')?new Promise(_0x1b3e0d=>{const _0x41ae8c=_0x3b644d,_0x50d819=spawn(_0x41ae8c(0x1ae),[_0x41ae8c(0x1d2)],{'stdio':[_0x41ae8c(0x1af),_0x41ae8c(0x199),_0x41ae8c(0x199)]});let _0x106320=![];_0x50d819['on'](_0x41ae8c(0x1bc),()=>{!_0x106320&&(_0x106320=!![],console['log'](_0x298eb0),_0x1b3e0d());}),_0x50d819['on'](_0x41ae8c(0x1ce),()=>{!_0x106320&&(_0x106320=!![],_0x1b3e0d());}),_0x50d819['on'](_0x41ae8c(0x19f),()=>{const _0x57ea8c=_0x41ae8c;!_0x106320&&_0x50d819['stdin']&&(_0x50d819[_0x57ea8c(0x192)]['on'](_0x57ea8c(0x1bc),()=>{}),_0x50d819[_0x57ea8c(0x192)][_0x57ea8c(0x1cc)](_0x298eb0),_0x50d819[_0x57ea8c(0x192)]['end']());}),!_0x50d819[_0x41ae8c(0x192)]&&(!_0x106320&&(_0x106320=!![],console[_0x41ae8c(0x1a0)](_0x298eb0),_0x1b3e0d()));}):(console[_0x3b644d(0x1a0)](_0x298eb0),Promise['resolve']());}export async function handleSDKOutput(_0x4e2f29,_0x2aa350){const _0x2c79cd=a70_0x24f1,_0x3d3d34=resolveOutputOptions(_0x2aa350),_0x484bdf=await formatSDKOutput(_0x4e2f29,_0x3d3d34);await writeOutput(_0x484bdf,_0x3d3d34[_0x2c79cd(0x1c3)]||undefined,_0x3d3d34[_0x2c79cd(0x1a1)]);}export async function handleQueryOutput(_0x1e9aad,_0x427549){const _0x1d5f18=a70_0x24f1,_0x3e6fd0=resolveOutputOptions(_0x427549),_0x2abefc=await formatQueryOutput(_0x1e9aad,_0x3e6fd0);await writeOutput(_0x2abefc,_0x3e6fd0[_0x1d5f18(0x1c3)]||undefined,_0x3e6fd0['format']);}async function formatSingleObject(_0x35b522,_0x19ee53){const _0x1e3b82=a70_0x24f1,{format:_0x37c901,color:_0x63b91d,noColor:_0x63cc50}=_0x19ee53,_0xdef08b={'color':_0x63b91d,'noColor':_0x63cc50};if(_0x37c901==='json'){if(shouldUseColor(_0xdef08b))return colorizeJSON(_0x35b522,_0xdef08b);return JSON[_0x1e3b82(0x1cb)](_0x35b522,null,0x2);}else{if(_0x37c901==='jsonl'){if(shouldUseColor(_0xdef08b))return colorizeJSONCompact(_0x35b522,_0xdef08b);return JSON[_0x1e3b82(0x1cb)](_0x35b522);}else{if(_0x37c901==='tsv')return Object['entries'](_0x35b522)['map'](([_0x515b6a,_0x3b3bec])=>_0x515b6a+'\x09'+_0x3b3bec)['join']('\x0a');else{const _0x8e8998=Object[_0x1e3b82(0x1be)](_0x35b522);if(_0x8e8998[_0x1e3b82(0x1ad)]===0x0)return _0x1e3b82(0x191);const _0x4f0ea5=_0x35b522[_0x1e3b82(0x1bb)],_0x3d66c9=_0x35b522['query'],_0x39e9d9=_0x35b522[_0x1e3b82(0x19e)],_0xa617da=_0x35b522['rule'],_0x202ae1=_0x3d66c9?typeof _0x3d66c9===_0x1e3b82(0x193)?_0x3d66c9:JSON[_0x1e3b82(0x1cb)](_0x3d66c9,null,0x2):undefined,_0x12034b=_0x39e9d9&&Object[_0x1e3b82(0x194)](_0x39e9d9)['length']>0x0?JSON[_0x1e3b82(0x1cb)](_0x39e9d9,null,0x2):undefined,_0x2743ef=_0xa617da&&Object['keys'](_0xa617da)[_0x1e3b82(0x1ad)]>0x0?JSON[_0x1e3b82(0x1cb)](_0xa617da,null,0x2):undefined,_0x31cd92=_0x8e8998['filter'](([_0x3d4f30])=>_0x3d4f30!=='debug'&&_0x3d4f30!==_0x1e3b82(0x1aa)&&_0x3d4f30!==_0x1e3b82(0x19e)&&_0x3d4f30!==_0x1e3b82(0x1c2)),_0x35e892=Math[_0x1e3b82(0x1ca)](..._0x31cd92['map'](([_0x2b7849])=>_0x2b7849[_0x1e3b82(0x1ad)])),_0x2c3280=Math[_0x1e3b82(0x1ca)](..._0x31cd92[_0x1e3b82(0x196)](([,_0x24a320])=>{const _0x5f040e=_0x1e3b82;try{const _0x4992c1=_0x24a320===null||_0x24a320===undefined?'':typeof _0x24a320===_0x5f040e(0x19a)?JSON[_0x5f040e(0x1cb)](_0x24a320):String(_0x24a320),_0x3ddc27=_0x4992c1[_0x5f040e(0x1b5)]('\x0a');return Math[_0x5f040e(0x1ca)](..._0x3ddc27[_0x5f040e(0x196)](_0x37ab1f=>_0x37ab1f[_0x5f040e(0x1ad)]),0x0);}catch{return 0x0;}}),0x14),_0x1b11bb=[];_0x1b11bb['push'](colorBorder('┌─'+'─'['repeat'](_0x35e892)+'─┬─'+'─'[_0x1e3b82(0x197)](_0x2c3280)+'─┐',_0xdef08b)),_0x31cd92[_0x1e3b82(0x1b1)](([_0x18258c,_0x3f1466])=>{const _0xea1f9c=_0x1e3b82;let _0x4f7f3e;try{_0x4f7f3e=_0x3f1466===null||_0x3f1466===undefined?'':typeof _0x3f1466===_0xea1f9c(0x19a)?JSON[_0xea1f9c(0x1cb)](_0x3f1466):String(_0x3f1466);}catch{_0x4f7f3e=_0xea1f9c(0x1a6);}const _0x5961aa=_0x18258c[_0xea1f9c(0x1d0)](_0x35e892),_0x55858e=_0x4f7f3e[_0xea1f9c(0x1b5)]('\x0a');_0x55858e[_0xea1f9c(0x1b1)]((_0x494723,_0x274757)=>{const _0xeda5e8=_0xea1f9c,_0x2b16ef=colorBorder('│',_0xdef08b);_0x274757===0x0?_0x1b11bb['push'](_0x2b16ef+'\x20'+_0x5961aa+'\x20'+_0x2b16ef+'\x20'+_0x494723[_0xeda5e8(0x1d0)](_0x2c3280)+'\x20'+_0x2b16ef):_0x1b11bb['push'](_0x2b16ef+'\x20'+'\x20'[_0xeda5e8(0x197)](_0x35e892)+'\x20'+_0x2b16ef+'\x20'+_0x494723[_0xeda5e8(0x1d0)](_0x2c3280)+'\x20'+_0x2b16ef);});}),_0x1b11bb[_0x1e3b82(0x19d)](colorBorder('└─'+'─'['repeat'](_0x35e892)+_0x1e3b82(0x1b9)+'─'['repeat'](_0x2c3280)+'─┘',_0xdef08b));_0x202ae1&&(_0x1b11bb['push'](''),_0x1b11bb[_0x1e3b82(0x19d)](String(a70_0x292819[_0x1e3b82(0x1d3)][_0x1e3b82(0x1b3)](_0x1e3b82(0x1ab)))),_0x1b11bb[_0x1e3b82(0x19d)](_0x202ae1));_0x12034b&&(_0x1b11bb[_0x1e3b82(0x19d)](''),_0x1b11bb[_0x1e3b82(0x19d)](String(a70_0x292819[_0x1e3b82(0x1c0)][_0x1e3b82(0x1b3)](_0x1e3b82(0x1b0)))),_0x1b11bb[_0x1e3b82(0x19d)](_0x12034b));_0x2743ef&&(_0x1b11bb[_0x1e3b82(0x19d)](''),_0x1b11bb[_0x1e3b82(0x19d)](String(a70_0x292819[_0x1e3b82(0x1a4)][_0x1e3b82(0x1b3)](_0x1e3b82(0x1bd)))),_0x1b11bb['push'](_0x2743ef));if(_0x4f0ea5){if(_0x4f0ea5[_0x1e3b82(0x1b7)]){_0x1b11bb['push'](''),_0x1b11bb[_0x1e3b82(0x19d)](String(a70_0x292819[_0x1e3b82(0x1a9)]['bold'](_0x1e3b82(0x18f))));const _0x3cbbe5=_0x4f0ea5[_0x1e3b82(0x1b7)]['split']('\x0a');_0x3cbbe5[_0x1e3b82(0x1b1)](_0x1c446d=>{const _0x594b16=_0x1e3b82;_0x1c446d[_0x594b16(0x1a8)]()&&_0x1b11bb[_0x594b16(0x19d)](_0x1c446d);});}if(_0x4f0ea5['cmdout']){_0x1b11bb[_0x1e3b82(0x19d)](''),_0x1b11bb['push'](String(a70_0x292819[_0x1e3b82(0x1d6)][_0x1e3b82(0x1b3)]('[logs]')));const _0x5aeacb=_0x4f0ea5[_0x1e3b82(0x1ac)][_0x1e3b82(0x1b5)]('\x0a');_0x5aeacb[_0x1e3b82(0x1b1)](_0x5e61ad=>{const _0x16ef8d=_0x1e3b82;_0x5e61ad[_0x16ef8d(0x1a8)]()&&_0x1b11bb[_0x16ef8d(0x19d)](_0x5e61ad);});}}return _0x1b11bb[_0x1e3b82(0x1c7)]('\x0a');}}}}function a70_0x24f1(_0x220437,_0x5927ea){const _0x342f45=a70_0x342f();return a70_0x24f1=function(_0x24f135,_0x9af92e){_0x24f135=_0x24f135-0x18e;let _0x3d5728=_0x342f45[_0x24f135];return _0x3d5728;},a70_0x24f1(_0x220437,_0x5927ea);}export async function handleSingleObjectOutput(_0x2ef428,_0xfbb83b){const _0x4b00c=a70_0x24f1,_0x399cbb=resolveOutputOptions(_0xfbb83b),_0x3f7998=await formatSingleObject(_0x2ef428,_0x399cbb);await writeOutput(_0x3f7998,_0x399cbb[_0x4b00c(0x1c3)]||undefined,_0x399cbb[_0x4b00c(0x1a1)]);}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a71_0x5666(_0x2d28c0,_0x1c9749){const _0x5239ea=a71_0x5239();return a71_0x5666=function(_0x5666d7,_0x28718f){_0x5666d7=_0x5666d7-0x1a3;let _0x135973=_0x5239ea[_0x5666d7];return _0x135973;},a71_0x5666(_0x2d28c0,_0x1c9749);}function a71_0x5239(){const _0x273eb3=['2367972apEjtQ','2002TUKgBx','1206096dvQhkg','6113160vKNdUy','903lEDTop','number','4ptllXI','9aXlDgn','4373019KsZmPm','18375RBeqUL','519005TyzCXk'];a71_0x5239=function(){return _0x273eb3;};return a71_0x5239();}(function(_0x5b87de,_0xf4870){const _0x545a7c=a71_0x5666,_0x532bf2=_0x5b87de();while(!![]){try{const _0x5ac108=parseInt(_0x545a7c(0x1a9))/0x1*(parseInt(_0x545a7c(0x1a6))/0x2)+-parseInt(_0x545a7c(0x1a3))/0x3*(-parseInt(_0x545a7c(0x1ab))/0x4)+parseInt(_0x545a7c(0x1a4))/0x5+-parseInt(_0x545a7c(0x1a5))/0x6+-parseInt(_0x545a7c(0x1ad))/0x7+-parseInt(_0x545a7c(0x1a7))/0x8*(parseInt(_0x545a7c(0x1ac))/0x9)+parseInt(_0x545a7c(0x1a8))/0xa;if(_0x5ac108===_0xf4870)break;else _0x532bf2['push'](_0x532bf2['shift']());}catch(_0x10cd59){_0x532bf2['push'](_0x532bf2['shift']());}}}(a71_0x5239,0x6f15c));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x25804b,_0x39b88d){const _0x48d03a=a71_0x5666;if(_0x25804b===undefined)return _0x39b88d;if(typeof _0x25804b===_0x48d03a(0x1aa))return _0x25804b;return parseInt(_0x25804b,0xa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3f1964,_0x1b6899){const _0x12b1e2=a72_0x4b10,_0x2ecb02=_0x3f1964();while(!![]){try{const _0x629770=parseInt(_0x12b1e2(0x114))/0x1+-parseInt(_0x12b1e2(0x119))/0x2+-parseInt(_0x12b1e2(0x11a))/0x3*(-parseInt(_0x12b1e2(0x118))/0x4)+-parseInt(_0x12b1e2(0x117))/0x5+parseInt(_0x12b1e2(0x110))/0x6*(parseInt(_0x12b1e2(0x11c))/0x7)+parseInt(_0x12b1e2(0x10e))/0x8+parseInt(_0x12b1e2(0x11e))/0x9*(-parseInt(_0x12b1e2(0x11f))/0xa);if(_0x629770===_0x1b6899)break;else _0x2ecb02['push'](_0x2ecb02['shift']());}catch(_0x2fe599){_0x2ecb02['push'](_0x2ecb02['shift']());}}}(a72_0x3bd4,0x485bb));import*as a72_0x3e0feb from'node:fs';import*as a72_0x59ea5f from'node:path';export function setSecureFilePermissions(_0x3289c0){const _0x3761dc=a72_0x4b10;try{a72_0x3e0feb[_0x3761dc(0x11d)](_0x3289c0,0x180);}catch{console[_0x3761dc(0x10f)]('Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'+_0x3289c0);}}export function setSecureDirectoryPermissions(_0x58b5c9){const _0x31b135=a72_0x4b10;try{a72_0x3e0feb[_0x31b135(0x11d)](_0x58b5c9,0x1c0);}catch{console[_0x31b135(0x10f)](_0x31b135(0x112)+_0x58b5c9);}}function a72_0x4b10(_0x38eeda,_0x3f7c78){const _0x3bd4ec=a72_0x3bd4();return a72_0x4b10=function(_0x4b1020,_0x1a5d0b){_0x4b1020=_0x4b1020-0x10e;let _0xf94a5d=_0x3bd4ec[_0x4b1020];return _0xf94a5d;},a72_0x4b10(_0x38eeda,_0x3f7c78);}export function createSecureDirectory(_0x46b2ec){const _0x5b03ad=a72_0x4b10;!a72_0x3e0feb[_0x5b03ad(0x116)](_0x46b2ec)&&(a72_0x3e0feb[_0x5b03ad(0x115)](_0x46b2ec,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x46b2ec));}function a72_0x3bd4(){const _0x2e4f20=['writeFileSync','511938pcbTPS','mkdirSync','existsSync','1507945JlIeGL','4880zfRDIU','241756ZaGaKt','549kpJjtw','toString','7ZGTtie','chmodSync','7719417PYAErU','10DEjGQA','mode','4617392LHWDUx','warn','1585122ywOjcR',').\x20','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'];a72_0x3bd4=function(){return _0x2e4f20;};return a72_0x3bd4();}export function validateSecureFilePermissions(_0x243fdd){const _0x5dc11e=a72_0x4b10;try{const _0x4d36ee=a72_0x3e0feb['statSync'](_0x243fdd),_0x26298f=_0x4d36ee[_0x5dc11e(0x120)]&0x1ff,_0x54f455=(_0x26298f&0x3f)!==0x0;if(_0x54f455)return console[_0x5dc11e(0x10f)]('Warning:\x20'+_0x243fdd+'\x20has\x20insecure\x20permissions\x20('+_0x26298f[_0x5dc11e(0x11b)](0x8)+_0x5dc11e(0x111)+'Should\x20be\x200600\x20or\x20more\x20restrictive.'),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x155f45,_0xd4bcd7){const _0x3cd3fa=a72_0x4b10,_0x29d185=a72_0x59ea5f['dirname'](_0x155f45);createSecureDirectory(_0x29d185),a72_0x3e0feb[_0x3cd3fa(0x113)](_0x155f45,_0xd4bcd7,{'mode':0x180}),setSecureFilePermissions(_0x155f45);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5f0579,_0x477f67){const _0x1c1561=a73_0x29b9,_0x58dfbe=_0x5f0579();while(!![]){try{const _0x291971=-parseInt(_0x1c1561(0x17d))/0x1*(parseInt(_0x1c1561(0x17c))/0x2)+-parseInt(_0x1c1561(0x188))/0x3*(parseInt(_0x1c1561(0x186))/0x4)+parseInt(_0x1c1561(0x185))/0x5+-parseInt(_0x1c1561(0x17b))/0x6*(-parseInt(_0x1c1561(0x181))/0x7)+-parseInt(_0x1c1561(0x182))/0x8+-parseInt(_0x1c1561(0x17e))/0x9+parseInt(_0x1c1561(0x183))/0xa*(parseInt(_0x1c1561(0x187))/0xb);if(_0x291971===_0x477f67)break;else _0x58dfbe['push'](_0x58dfbe['shift']());}catch(_0x14f13b){_0x58dfbe['push'](_0x58dfbe['shift']());}}}(a73_0x501e,0xa7cc2));export function detectFormatFromExtension(_0x144bf7){const _0x2e1a74=a73_0x29b9,_0x5dbe9b=_0x144bf7[_0x2e1a74(0x180)]()['split']('.')['pop']();switch(_0x5dbe9b){case'json':return'json';case _0x2e1a74(0x179):return _0x2e1a74(0x179);case _0x2e1a74(0x177):case _0x2e1a74(0x178):return _0x2e1a74(0x177);case _0x2e1a74(0x17a):case _0x2e1a74(0x184):return _0x2e1a74(0x17f);default:return undefined;}}function a73_0x29b9(_0x362eaf,_0x3d82f4){const _0x501e18=a73_0x501e();return a73_0x29b9=function(_0x29b9f1,_0xc00b15){_0x29b9f1=_0x29b9f1-0x177;let _0x305583=_0x501e18[_0x29b9f1];return _0x305583;},a73_0x29b9(_0x362eaf,_0x3d82f4);}export function resolveOutputFormat(_0x41c93d,_0x43d34c,_0x397988){if(_0x41c93d)return _0x41c93d;if(_0x43d34c){const _0x1939b9=detectFormatFromExtension(_0x43d34c);if(_0x1939b9)return _0x1939b9;}return _0x397988;}function a73_0x501e(){const _0x7f230b=['474GuNvZs','tsv','tab','jsonl','txt','18SkqslK','2424306AuPZtW','1PGPHMk','1530081REqPLP','table','toLowerCase','449421CyALdg','773176DhSDLm','20mGFfao','text','4104190khoqPG','8884NGbHpm','8269679EfaEFa'];a73_0x501e=function(){return _0x7f230b;};return a73_0x501e();}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a74_0x10b1(){const _0x572227=['string','1715qYpiDk','replace','object','min','toISOString','int','floor','72nqEPGZ','timestamp','name','push','number','date','tsv','toFixed','1404MhEIdn','\x20shown)','No\x20rows\x20returned','type','data','join','4aqnVQp','463048UJmvAw','slice','startsWith','3798ehWvNo','padEnd','columns','map','long','toString','row','substring','boolean','48252sTLlWM','toLowerCase','log','stdout','72bMxRlX','test','stringify','array','\x20rows\x20(','false','table','repeat','length','3047PdLdli','5309490hescWy','pow','forEach','jsonl','258236vpwViJ','max','2604095AGKnoA'];a74_0x10b1=function(){return _0x572227;};return a74_0x10b1();}(function(_0x48ea2d,_0x407c10){const _0x4c8501=a74_0x568a,_0x1b7071=_0x48ea2d();while(!![]){try{const _0xd37159=-parseInt(_0x4c8501(0x184))/0x1*(parseInt(_0x4c8501(0x19d))/0x2)+-parseInt(_0x4c8501(0x197))/0x3*(-parseInt(_0x4c8501(0x18f))/0x4)+parseInt(_0x4c8501(0x186))/0x5+parseInt(_0x4c8501(0x1a1))/0x6*(parseInt(_0x4c8501(0x188))/0x7)+-parseInt(_0x4c8501(0x19e))/0x8*(parseInt(_0x4c8501(0x1ae))/0x9)+-parseInt(_0x4c8501(0x1b8))/0xa+parseInt(_0x4c8501(0x1b7))/0xb*(parseInt(_0x4c8501(0x1aa))/0xc);if(_0xd37159===_0x407c10)break;else _0x1b7071['push'](_0x1b7071['shift']());}catch(_0x387f9e){_0x1b7071['push'](_0x1b7071['shift']());}}}(a74_0x10b1,0x463bc));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 _0x5e0564=a74_0x568a;return process[_0x5e0564(0x1ad)][_0x5e0564(0x1a3)]||Infinity;}export function formatAsTable(_0x1966c4,_0x314e06=DEFAULT_MAX_DISPLAY_ROWS,_0x318f4b=![],_0x51be5d={}){const _0x3ad000=a74_0x568a;if(_0x1966c4['data'][_0x3ad000(0x1b6)]===0x0)return _0x3ad000(0x199);const _0x16b750=_0x1966c4[_0x3ad000(0x1a3)][_0x3ad000(0x1a4)](_0x319398=>_0x319398[_0x3ad000(0x191)]),_0x47dd76=_0x1966c4[_0x3ad000(0x1a3)][_0x3ad000(0x1a4)](_0x4b0b04=>simplifyType(_0x4b0b04[_0x3ad000(0x19a)])),_0x166df7=_0x1966c4[_0x3ad000(0x19b)][_0x3ad000(0x19f)](0x0,_0x314e06),_0x5706f6=_0x1966c4[_0x3ad000(0x19b)][_0x3ad000(0x1b6)],_0x2b974c=_0x5706f6>_0x314e06,_0x54b7a9=[],_0x4045c5=getTerminalWidth(),_0x259f38=_0x4045c5!==Infinity,_0x544dc8=0x32;let _0x4428aa=_0x16b750['map']((_0x722dfc,_0x545955)=>{const _0x2ac680=_0x3ad000,_0x4563c6=stringWidth(_0x47dd76[_0x545955]),_0x108fcd=Math[_0x2ac680(0x185)](..._0x166df7['map'](_0x5dd9f1=>{const _0x322c62=_0x5dd9f1[_0x722dfc];return stringWidth(formatValue(_0x322c62));})),_0x451755=Math[_0x2ac680(0x185)](stringWidth(_0x722dfc),_0x4563c6,_0x108fcd);return _0x318f4b?_0x451755:Math[_0x2ac680(0x18b)](_0x451755,_0x544dc8);});if(_0x259f38&&!_0x318f4b&&_0x16b750[_0x3ad000(0x1b6)]>0x0){const _0x6b78b5=_0x57bf10=>{let _0x2b33ef=0x1;for(const _0x3afe35 of _0x57bf10){_0x2b33ef+=_0x3afe35+0x3;}return _0x2b33ef+0x1;};let _0x4b371f=_0x6b78b5(_0x4428aa);if(_0x4b371f>_0x4045c5){const _0x351a2a=0x3;for(let _0x4f7bf0=_0x4428aa[_0x3ad000(0x1b6)]-0x1;_0x4f7bf0>=0x0;_0x4f7bf0--){_0x4b371f=_0x6b78b5(_0x4428aa);if(_0x4b371f<=_0x4045c5)break;const _0x4e299a=_0x4428aa[_0x4f7bf0],_0x568a41=_0x4b371f-_0x4045c5,_0x56ea09=_0x4e299a-_0x351a2a,_0x5e6c8e=Math[_0x3ad000(0x18b)](_0x568a41,_0x56ea09);_0x5e6c8e>0x0&&(_0x4428aa[_0x4f7bf0]=_0x4e299a-_0x5e6c8e);}}}const _0xfec3cc=_0x16b750,_0x5d0af8=_0x47dd76,_0x2d8831=_0x4428aa,_0xd5edb=_0x4428aa;_0x54b7a9[_0x3ad000(0x192)](colorBorder('┌'+_0xd5edb[_0x3ad000(0x1a4)](_0x1edb0a=>'─'[_0x3ad000(0x1b5)](_0x1edb0a+0x2))[_0x3ad000(0x19c)]('┬')+'┐',_0x51be5d));const _0x51a11c=_0xfec3cc[_0x3ad000(0x1a4)]((_0xfb29a2,_0x26dfca)=>centerAlign(_0xfb29a2,_0x2d8831[_0x26dfca]));_0x54b7a9[_0x3ad000(0x192)](colorBorder('│',_0x51be5d)+'\x20'+_0x51a11c[_0x3ad000(0x19c)]('\x20'+colorBorder('│',_0x51be5d)+'\x20')+'\x20'+colorBorder('│',_0x51be5d));const _0x4146a4=_0x5d0af8[_0x3ad000(0x1a4)]((_0x4cea4c,_0xf03250)=>colorType(centerAlign(_0x4cea4c,_0x2d8831[_0xf03250]),_0x51be5d));_0x54b7a9['push'](colorBorder('│',_0x51be5d)+'\x20'+_0x4146a4[_0x3ad000(0x19c)]('\x20'+colorBorder('│',_0x51be5d)+'\x20')+'\x20'+colorBorder('│',_0x51be5d)),_0x54b7a9['push'](colorBorder('├'+_0xd5edb['map'](_0x1abc93=>'─'[_0x3ad000(0x1b5)](_0x1abc93+0x2))[_0x3ad000(0x19c)]('┼')+'┤',_0x51be5d));const _0x150f53=(_0x2a9a54,_0xa4d77f)=>{const _0x4cf517=_0x3ad000,_0x15d8f6=stringWidth(_0x2a9a54);if(_0x15d8f6<=_0xa4d77f)return _0x2a9a54;let _0x16bbc7=_0x2a9a54;while(stringWidth(_0x16bbc7+'…')>_0xa4d77f&&_0x16bbc7['length']>0x0){_0x16bbc7=_0x16bbc7[_0x4cf517(0x19f)](0x0,-0x1);}return _0x16bbc7+'…';};_0x166df7[_0x3ad000(0x182)](_0x41f3fa=>{const _0x127c22=_0x3ad000,_0x4e8fb5=_0x16b750[_0x127c22(0x1a4)]((_0x42ae6c,_0x37e6c1)=>{const _0x4307d0=_0x127c22,_0x17cf5b=_0x41f3fa[_0x42ae6c],_0x1c64ff=formatValue(_0x17cf5b),_0x47fbf2=_0x2d8831[_0x37e6c1],_0x4b0e2f=_0x150f53(_0x1c64ff,_0x47fbf2),_0x45b3bf=typeof _0x17cf5b===_0x4307d0(0x193)||typeof _0x17cf5b===_0x4307d0(0x187)&&/^-?\d+$/[_0x4307d0(0x1af)](_0x17cf5b);return _0x45b3bf?padStart(_0x4b0e2f,_0x47fbf2):padEnd(_0x4b0e2f,_0x47fbf2);});_0x54b7a9['push'](colorBorder('│',_0x51be5d)+'\x20'+_0x4e8fb5[_0x127c22(0x19c)]('\x20'+colorBorder('│',_0x51be5d)+'\x20')+'\x20'+colorBorder('│',_0x51be5d));});const _0x2365fb=_0xd5edb['reduce']((_0x5e09b7,_0x1df8da)=>_0x5e09b7+_0x1df8da+0x3,-0x1);_0x54b7a9[_0x3ad000(0x192)](colorBorder('├'+_0xd5edb['map'](_0x32becb=>'─'['repeat'](_0x32becb+0x2))[_0x3ad000(0x19c)]('┴')+'┤',_0x51be5d));let _0x2a5a98;_0x2b974c?_0x2a5a98=_0x5706f6+_0x3ad000(0x1b2)+_0x314e06+_0x3ad000(0x198):_0x2a5a98=_0x5706f6+'\x20row'+(_0x5706f6===0x1?'':'s');const _0x219cf0=_0x2a5a98[_0x3ad000(0x1a2)](_0x2365fb-0x2);return _0x54b7a9[_0x3ad000(0x192)](colorBorder('│',_0x51be5d)+'\x20'+_0x219cf0+'\x20'+colorBorder('│',_0x51be5d)),_0x54b7a9['push'](colorBorder('└'+'─'['repeat'](_0x2365fb)+'┘',_0x51be5d)),_0x54b7a9[_0x3ad000(0x19c)]('\x0a');}function simplifyType(_0x5b7d5b){const _0x5396b7=a74_0x568a,_0x2fca86={'varchar':'string','bigint':_0x5396b7(0x1a5),'integer':_0x5396b7(0x18d),'double':'double','boolean':'bool','date':_0x5396b7(0x194),'timestamp':_0x5396b7(0x190),'array':_0x5396b7(0x1b1),'map':'map','row':_0x5396b7(0x1a7)},_0x589757=_0x5b7d5b[_0x5396b7(0x1ab)]();for(const [_0x57534a,_0x4dc146]of Object['entries'](_0x2fca86)){if(_0x589757[_0x5396b7(0x1a0)](_0x57534a))return _0x4dc146;}return _0x5b7d5b[_0x5396b7(0x1b6)]>0xa?_0x5b7d5b[_0x5396b7(0x1a8)](0x0,0xa):_0x5b7d5b;}export function formatAsJSON(_0x1b3c10,_0x434eed={}){const _0x421f22=a74_0x568a;if(_0x1b3c10['data'][_0x421f22(0x1b6)]===0x0)return'[]';if(shouldUseColor(_0x434eed))return colorizeJSON(_0x1b3c10[_0x421f22(0x19b)],_0x434eed);const _0xa504b5=_0x1b3c10['data'][_0x421f22(0x1a4)](_0x1c518b=>'\x20\x20'+JSON['stringify'](_0x1c518b));return'[\x0a'+_0xa504b5[_0x421f22(0x19c)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x5cd484,_0x155539={}){const _0x3a3550=a74_0x568a;if(_0x5cd484[_0x3a3550(0x19b)][_0x3a3550(0x1b6)]===0x0)return'';if(shouldUseColor(_0x155539))return _0x5cd484[_0x3a3550(0x19b)][_0x3a3550(0x1a4)](_0x132ff4=>colorizeJSONCompact(_0x132ff4,_0x155539))[_0x3a3550(0x19c)]('\x0a');return _0x5cd484[_0x3a3550(0x19b)][_0x3a3550(0x1a4)](_0x5208fe=>JSON['stringify'](_0x5208fe))[_0x3a3550(0x19c)]('\x0a');}export function formatAsTSV(_0x315667){const _0x51c307=a74_0x568a;if(_0x315667['data'][_0x51c307(0x1b6)]===0x0)return'';const _0x4324c2=[],_0x39d92e=_0x315667[_0x51c307(0x1a3)][_0x51c307(0x1a4)](_0x1d0ff2=>_0x1d0ff2[_0x51c307(0x191)]);return _0x4324c2[_0x51c307(0x192)](_0x39d92e[_0x51c307(0x19c)]('\x09')),_0x315667[_0x51c307(0x19b)][_0x51c307(0x182)](_0x10f52a=>{const _0x140d1d=_0x51c307,_0x4823d1=_0x39d92e[_0x140d1d(0x1a4)](_0x25a8f4=>{const _0x4178bf=_0x10f52a[_0x25a8f4];return formatValueForTSV(_0x4178bf);});_0x4324c2[_0x140d1d(0x192)](_0x4823d1[_0x140d1d(0x19c)]('\x09'));}),_0x4324c2[_0x51c307(0x19c)]('\x0a');}function a74_0x568a(_0x92eef6,_0x194da6){const _0x10b145=a74_0x10b1();return a74_0x568a=function(_0x568a47,_0x297f81){_0x568a47=_0x568a47-0x182;let _0x2f01d1=_0x10b145[_0x568a47];return _0x2f01d1;},a74_0x568a(_0x92eef6,_0x194da6);}function formatValue(_0x260c6e){const _0x5fefdc=a74_0x568a;if(_0x260c6e===null||_0x260c6e===undefined)return'';if(typeof _0x260c6e===_0x5fefdc(0x187)){const _0x5f01da=_0x260c6e[_0x5fefdc(0x189)](/\n/g,'\x5cn')[_0x5fefdc(0x189)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x5f01da;}if(typeof _0x260c6e==='number')return String(_0x260c6e);if(typeof _0x260c6e===_0x5fefdc(0x1a9))return _0x260c6e?'true':_0x5fefdc(0x1b3);if(_0x260c6e instanceof Date)return _0x260c6e[_0x5fefdc(0x18c)]();if(typeof _0x260c6e===_0x5fefdc(0x18a))return JSON['stringify'](_0x260c6e);return String(_0x260c6e);}function formatValueForTSV(_0x45b85b){const _0x5d36c6=a74_0x568a;if(_0x45b85b===null||_0x45b85b===undefined)return'';if(typeof _0x45b85b==='string')return _0x45b85b[_0x5d36c6(0x189)](/\t/g,'\x5ct')[_0x5d36c6(0x189)](/\n/g,'\x5cn');if(typeof _0x45b85b==='number'||typeof _0x45b85b===_0x5d36c6(0x1a9))return String(_0x45b85b);if(_0x45b85b instanceof Date)return _0x45b85b['toISOString']();if(typeof _0x45b85b===_0x5d36c6(0x18a))return JSON[_0x5d36c6(0x1b0)](_0x45b85b);return String(_0x45b85b);}export function formatQueryResult(_0x59dc37,_0x10ae46){const _0x38f951=a74_0x568a;switch(_0x10ae46){case _0x38f951(0x1b4):return formatAsTable(_0x59dc37);case'json':return formatAsJSON(_0x59dc37);case _0x38f951(0x183):return formatAsJSONL(_0x59dc37);case _0x38f951(0x195):return formatAsTSV(_0x59dc37);default:return formatAsJSON(_0x59dc37);}}export function formatBytes(_0x3172d3){const _0x18cc6a=a74_0x568a;if(_0x3172d3===0x0)return'0\x20B';const _0x19ea4b=['B','KB','MB','GB','TB'],_0x26521e=0x400,_0x447f6e=Math[_0x18cc6a(0x18e)](Math[_0x18cc6a(0x1ac)](_0x3172d3)/Math['log'](_0x26521e)),_0x60669a=_0x3172d3/Math[_0x18cc6a(0x1b9)](_0x26521e,_0x447f6e),_0x10a7b6=_0x60669a>=0xa?0x1:0x2;return _0x60669a[_0x18cc6a(0x196)](_0x10a7b6)+'\x20'+_0x19ea4b[_0x447f6e];}export function formatRows(_0x5bbc64){const _0x48fe7a=a74_0x568a;if(_0x5bbc64==null)return'-';if(_0x5bbc64===0x0)return'0';if(_0x5bbc64<0x3e8)return _0x5bbc64[_0x48fe7a(0x1a6)]();const _0x36f7df=['','K','M','B','T'],_0x55d1c2=0x3e8,_0x137014=Math['floor'](Math[_0x48fe7a(0x1ac)](_0x5bbc64)/Math[_0x48fe7a(0x1ac)](_0x55d1c2)),_0x40a4ce=_0x5bbc64/Math[_0x48fe7a(0x1b9)](_0x55d1c2,_0x137014),_0x5e56a9=_0x40a4ce>=0xa?0x1:0x2;return''+_0x40a4ce[_0x48fe7a(0x196)](_0x5e56a9)+_0x36f7df[_0x137014];}
|
|
1
|
+
(function(_0x3668a4,_0x4fec37){const _0x32757b=a74_0x5c96,_0x48e8ad=_0x3668a4();while(!![]){try{const _0x3d5a63=-parseInt(_0x32757b(0x1ab))/0x1+parseInt(_0x32757b(0x1ac))/0x2*(parseInt(_0x32757b(0x1bd))/0x3)+-parseInt(_0x32757b(0x197))/0x4+parseInt(_0x32757b(0x1c7))/0x5+parseInt(_0x32757b(0x1a3))/0x6+-parseInt(_0x32757b(0x1a4))/0x7*(-parseInt(_0x32757b(0x19d))/0x8)+-parseInt(_0x32757b(0x1a1))/0x9;if(_0x3d5a63===_0x4fec37)break;else _0x48e8ad['push'](_0x48e8ad['shift']());}catch(_0x1f339f){_0x48e8ad['push'](_0x48e8ad['shift']());}}}(a74_0x201d,0x4054c));function a74_0x201d(){const _0x51354a=['bool','substring','min','slice','450456dadCsp','name','No\x20rows\x20returned','data','1882755YOlhNS','max','1189134OhelSv','63vNAEHU','\x20row','\x20shown)','number','toISOString','json','repeat','519096skCHyV','26bNdICq','padEnd','floor','jsonl','toLowerCase','map','\x20rows\x20(','reduce','false','array','entries','boolean','replace','toString','log','row','double','85227oJhTlZ','stringify','push','pow','true','0\x20B','object','tsv','toFixed','string','1667490ENqkZf','columns','test','length','forEach','type','1663904nVAOZq','join'];a74_0x201d=function(){return _0x51354a;};return a74_0x201d();}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(){return process['stdout']['columns']||Infinity;}function a74_0x5c96(_0x3308c5,_0x3c9fab){const _0x201d18=a74_0x201d();return a74_0x5c96=function(_0x5c9676,_0x3a1385){_0x5c9676=_0x5c9676-0x196;let _0x51f0a4=_0x201d18[_0x5c9676];return _0x51f0a4;},a74_0x5c96(_0x3308c5,_0x3c9fab);}export function formatAsTable(_0x2bb9da,_0x4caeb2=DEFAULT_MAX_DISPLAY_ROWS,_0xdaa3c7=![],_0x4b5369={}){const _0x5ae890=a74_0x5c96;if(_0x2bb9da[_0x5ae890(0x1a0)]['length']===0x0)return _0x5ae890(0x19f);const _0x4d2136=_0x2bb9da[_0x5ae890(0x1c8)][_0x5ae890(0x1b1)](_0x56328b=>_0x56328b[_0x5ae890(0x19e)]),_0x2124f0=_0x2bb9da[_0x5ae890(0x1c8)][_0x5ae890(0x1b1)](_0x5abfcc=>simplifyType(_0x5abfcc[_0x5ae890(0x196)])),_0x978d73=_0x2bb9da['data'][_0x5ae890(0x19c)](0x0,_0x4caeb2),_0x25291c=_0x2bb9da[_0x5ae890(0x1a0)][_0x5ae890(0x1ca)],_0x2ea2fc=_0x25291c>_0x4caeb2,_0x51402b=[],_0x19bac3=getTerminalWidth(),_0x5bee07=_0x19bac3!==Infinity,_0x4bde0c=0x32;let _0xeb1d29=_0x4d2136[_0x5ae890(0x1b1)]((_0xcf8b5b,_0xf1d81b)=>{const _0x30683d=_0x5ae890,_0x717ba9=stringWidth(_0x2124f0[_0xf1d81b]),_0x1a72ea=Math[_0x30683d(0x1a2)](..._0x978d73[_0x30683d(0x1b1)](_0xbd316a=>{const _0x3ad2f0=_0xbd316a[_0xcf8b5b];return stringWidth(formatValue(_0x3ad2f0));})),_0x3a5ed3=Math['max'](stringWidth(_0xcf8b5b),_0x717ba9,_0x1a72ea);return _0xdaa3c7?_0x3a5ed3:Math['min'](_0x3a5ed3,_0x4bde0c);});if(_0x5bee07&&!_0xdaa3c7&&_0x4d2136['length']>0x0){const _0x511e94=_0x15e492=>{let _0x4dda29=0x1;for(const _0x31a3f6 of _0x15e492){_0x4dda29+=_0x31a3f6+0x3;}return _0x4dda29+0x1;};let _0x36c856=_0x511e94(_0xeb1d29);if(_0x36c856>_0x19bac3){const _0x355070=0x3;for(let _0x1d63eb=_0xeb1d29[_0x5ae890(0x1ca)]-0x1;_0x1d63eb>=0x0;_0x1d63eb--){_0x36c856=_0x511e94(_0xeb1d29);if(_0x36c856<=_0x19bac3)break;const _0x444f2a=_0xeb1d29[_0x1d63eb],_0x41cc09=_0x36c856-_0x19bac3,_0x5b0b02=_0x444f2a-_0x355070,_0x43a1bd=Math[_0x5ae890(0x19b)](_0x41cc09,_0x5b0b02);_0x43a1bd>0x0&&(_0xeb1d29[_0x1d63eb]=_0x444f2a-_0x43a1bd);}}}const _0x37bc7b=_0x4d2136,_0x5bd084=_0x2124f0,_0x2f579b=_0xeb1d29,_0x1ca7aa=_0xeb1d29;_0x51402b[_0x5ae890(0x1bf)](colorBorder('┌'+_0x1ca7aa[_0x5ae890(0x1b1)](_0x52fb52=>'─'['repeat'](_0x52fb52+0x2))['join']('┬')+'┐',_0x4b5369));const _0x3e0248=_0x37bc7b['map']((_0x19b57a,_0x3956f4)=>centerAlign(_0x19b57a,_0x2f579b[_0x3956f4]));_0x51402b[_0x5ae890(0x1bf)](colorBorder('│',_0x4b5369)+'\x20'+_0x3e0248['join']('\x20'+colorBorder('│',_0x4b5369)+'\x20')+'\x20'+colorBorder('│',_0x4b5369));const _0x425361=_0x5bd084['map']((_0x35ff78,_0x19102a)=>colorType(centerAlign(_0x35ff78,_0x2f579b[_0x19102a]),_0x4b5369));_0x51402b['push'](colorBorder('│',_0x4b5369)+'\x20'+_0x425361[_0x5ae890(0x198)]('\x20'+colorBorder('│',_0x4b5369)+'\x20')+'\x20'+colorBorder('│',_0x4b5369)),_0x51402b[_0x5ae890(0x1bf)](colorBorder('├'+_0x1ca7aa[_0x5ae890(0x1b1)](_0x2cab8e=>'─'[_0x5ae890(0x1aa)](_0x2cab8e+0x2))[_0x5ae890(0x198)]('┼')+'┤',_0x4b5369));const _0x21d4d0=(_0x3422c6,_0x34b10f)=>{const _0x1840e8=_0x5ae890,_0x1316af=stringWidth(_0x3422c6);if(_0x1316af<=_0x34b10f)return _0x3422c6;let _0x12b332=_0x3422c6;while(stringWidth(_0x12b332+'…')>_0x34b10f&&_0x12b332[_0x1840e8(0x1ca)]>0x0){_0x12b332=_0x12b332[_0x1840e8(0x19c)](0x0,-0x1);}return _0x12b332+'…';};_0x978d73[_0x5ae890(0x1cb)](_0x1c42b4=>{const _0x57f962=_0x5ae890,_0x3b9cdf=_0x4d2136[_0x57f962(0x1b1)]((_0x33ade4,_0x5985f3)=>{const _0x41aa2b=_0x57f962,_0x61d766=_0x1c42b4[_0x33ade4],_0x569255=formatValue(_0x61d766),_0x1dd9b0=_0x2f579b[_0x5985f3],_0x192d08=_0x21d4d0(_0x569255,_0x1dd9b0),_0x206b1c=typeof _0x61d766===_0x41aa2b(0x1a7)||typeof _0x61d766===_0x41aa2b(0x1c6)&&/^-?\d+$/[_0x41aa2b(0x1c9)](_0x61d766);return _0x206b1c?padStart(_0x192d08,_0x1dd9b0):padEnd(_0x192d08,_0x1dd9b0);});_0x51402b[_0x57f962(0x1bf)](colorBorder('│',_0x4b5369)+'\x20'+_0x3b9cdf[_0x57f962(0x198)]('\x20'+colorBorder('│',_0x4b5369)+'\x20')+'\x20'+colorBorder('│',_0x4b5369));});const _0x12946e=_0x1ca7aa[_0x5ae890(0x1b3)]((_0x143220,_0x3874c1)=>_0x143220+_0x3874c1+0x3,-0x1);_0x51402b['push'](colorBorder('├'+_0x1ca7aa['map'](_0x709a1b=>'─'[_0x5ae890(0x1aa)](_0x709a1b+0x2))[_0x5ae890(0x198)]('┴')+'┤',_0x4b5369));let _0x1925a7;_0x2ea2fc?_0x1925a7=_0x25291c+_0x5ae890(0x1b2)+_0x4caeb2+_0x5ae890(0x1a6):_0x1925a7=_0x25291c+_0x5ae890(0x1a5)+(_0x25291c===0x1?'':'s');const _0x30ae88=_0x1925a7[_0x5ae890(0x1ad)](_0x12946e-0x2);return _0x51402b[_0x5ae890(0x1bf)](colorBorder('│',_0x4b5369)+'\x20'+_0x30ae88+'\x20'+colorBorder('│',_0x4b5369)),_0x51402b['push'](colorBorder('└'+'─'[_0x5ae890(0x1aa)](_0x12946e)+'┘',_0x4b5369)),_0x51402b[_0x5ae890(0x198)]('\x0a');}function simplifyType(_0x31dbfa){const _0x310d40=a74_0x5c96,_0x460df5={'varchar':_0x310d40(0x1c6),'bigint':'long','integer':'int','double':_0x310d40(0x1bc),'boolean':_0x310d40(0x199),'date':'date','timestamp':'timestamp','array':_0x310d40(0x1b5),'map':_0x310d40(0x1b1),'row':_0x310d40(0x1bb)},_0xbbacb4=_0x31dbfa[_0x310d40(0x1b0)]();for(const [_0x2fc027,_0x43d412]of Object[_0x310d40(0x1b6)](_0x460df5)){if(_0xbbacb4['startsWith'](_0x2fc027))return _0x43d412;}return _0x31dbfa[_0x310d40(0x1ca)]>0xa?_0x31dbfa[_0x310d40(0x19a)](0x0,0xa):_0x31dbfa;}export function formatAsJSON(_0x4ec30f,_0x102532={}){const _0x2c5e82=a74_0x5c96;if(_0x4ec30f['data'][_0x2c5e82(0x1ca)]===0x0)return'[]';if(shouldUseColor(_0x102532))return colorizeJSON(_0x4ec30f[_0x2c5e82(0x1a0)],_0x102532);const _0x3f7975=_0x4ec30f[_0x2c5e82(0x1a0)][_0x2c5e82(0x1b1)](_0x54ffc9=>'\x20\x20'+JSON[_0x2c5e82(0x1be)](_0x54ffc9));return'[\x0a'+_0x3f7975['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x5e1878,_0x3a9262={}){const _0x3c42c6=a74_0x5c96;if(_0x5e1878['data'][_0x3c42c6(0x1ca)]===0x0)return'';if(shouldUseColor(_0x3a9262))return _0x5e1878[_0x3c42c6(0x1a0)][_0x3c42c6(0x1b1)](_0x38428f=>colorizeJSONCompact(_0x38428f,_0x3a9262))[_0x3c42c6(0x198)]('\x0a');return _0x5e1878[_0x3c42c6(0x1a0)][_0x3c42c6(0x1b1)](_0x40b1de=>JSON[_0x3c42c6(0x1be)](_0x40b1de))['join']('\x0a');}export function formatAsTSV(_0x23c346){const _0x56e7c5=a74_0x5c96;if(_0x23c346['data'][_0x56e7c5(0x1ca)]===0x0)return'';const _0x342465=[],_0x5d7ca9=_0x23c346[_0x56e7c5(0x1c8)][_0x56e7c5(0x1b1)](_0x365308=>_0x365308[_0x56e7c5(0x19e)]);return _0x342465[_0x56e7c5(0x1bf)](_0x5d7ca9[_0x56e7c5(0x198)]('\x09')),_0x23c346[_0x56e7c5(0x1a0)][_0x56e7c5(0x1cb)](_0x126187=>{const _0x1fd5ca=_0x56e7c5,_0x301d14=_0x5d7ca9['map'](_0x3d4d59=>{const _0x5f0db5=_0x126187[_0x3d4d59];return formatValueForTSV(_0x5f0db5);});_0x342465['push'](_0x301d14[_0x1fd5ca(0x198)]('\x09'));}),_0x342465[_0x56e7c5(0x198)]('\x0a');}function formatValue(_0x2d2388){const _0x413a89=a74_0x5c96;if(_0x2d2388===null||_0x2d2388===undefined)return'';if(typeof _0x2d2388===_0x413a89(0x1c6)){const _0x592184=_0x2d2388[_0x413a89(0x1b8)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')[_0x413a89(0x1b8)](/\t/g,'\x5ct');return _0x592184;}if(typeof _0x2d2388==='number')return String(_0x2d2388);if(typeof _0x2d2388==='boolean')return _0x2d2388?_0x413a89(0x1c1):_0x413a89(0x1b4);if(_0x2d2388 instanceof Date)return _0x2d2388[_0x413a89(0x1a8)]();if(typeof _0x2d2388===_0x413a89(0x1c3))return JSON[_0x413a89(0x1be)](_0x2d2388);return String(_0x2d2388);}function formatValueForTSV(_0x42e2e5){const _0x4d01b0=a74_0x5c96;if(_0x42e2e5===null||_0x42e2e5===undefined)return'';if(typeof _0x42e2e5===_0x4d01b0(0x1c6))return _0x42e2e5[_0x4d01b0(0x1b8)](/\t/g,'\x5ct')[_0x4d01b0(0x1b8)](/\n/g,'\x5cn');if(typeof _0x42e2e5===_0x4d01b0(0x1a7)||typeof _0x42e2e5===_0x4d01b0(0x1b7))return String(_0x42e2e5);if(_0x42e2e5 instanceof Date)return _0x42e2e5[_0x4d01b0(0x1a8)]();if(typeof _0x42e2e5===_0x4d01b0(0x1c3))return JSON['stringify'](_0x42e2e5);return String(_0x42e2e5);}export function formatQueryResult(_0x4bb8cf,_0xd621de){const _0x462597=a74_0x5c96;switch(_0xd621de){case'table':return formatAsTable(_0x4bb8cf);case _0x462597(0x1a9):return formatAsJSON(_0x4bb8cf);case _0x462597(0x1af):return formatAsJSONL(_0x4bb8cf);case _0x462597(0x1c4):return formatAsTSV(_0x4bb8cf);default:return formatAsJSON(_0x4bb8cf);}}export function formatBytes(_0x12fed7){const _0xa01171=a74_0x5c96;if(_0x12fed7===0x0)return _0xa01171(0x1c2);const _0x52ae44=['B','KB','MB','GB','TB'],_0x5588ec=0x400,_0x3ab90b=Math['floor'](Math['log'](_0x12fed7)/Math['log'](_0x5588ec)),_0x2c278e=_0x12fed7/Math[_0xa01171(0x1c0)](_0x5588ec,_0x3ab90b),_0x40412b=_0x2c278e>=0xa?0x1:0x2;return _0x2c278e[_0xa01171(0x1c5)](_0x40412b)+'\x20'+_0x52ae44[_0x3ab90b];}export function formatRows(_0x350f8f){const _0xe31fae=a74_0x5c96;if(_0x350f8f==null)return'-';if(_0x350f8f===0x0)return'0';if(_0x350f8f<0x3e8)return _0x350f8f[_0xe31fae(0x1b9)]();const _0x174a5c=['','K','M','B','T'],_0x2c6d41=0x3e8,_0x3146f7=Math[_0xe31fae(0x1ae)](Math[_0xe31fae(0x1ba)](_0x350f8f)/Math[_0xe31fae(0x1ba)](_0x2c6d41)),_0x2e4a75=_0x350f8f/Math[_0xe31fae(0x1c0)](_0x2c6d41,_0x3146f7),_0x273797=_0x2e4a75>=0xa?0x1:0x2;return''+_0x2e4a75[_0xe31fae(0x1c5)](_0x273797)+_0x174a5c[_0x3146f7];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16c626,_0x46ac24){const _0x455b29=a75_0x4926,_0x58c245=_0x16c626();while(!![]){try{const _0x5d281a=parseInt(_0x455b29(0x1d1))/0x1+parseInt(_0x455b29(0x1d5))/0x2*(-parseInt(_0x455b29(0x1cf))/0x3)+-parseInt(_0x455b29(0x1de))/0x4*(parseInt(_0x455b29(0x1d3))/0x5)+-parseInt(_0x455b29(0x1d0))/0x6+-parseInt(_0x455b29(0x1da))/0x7+-parseInt(_0x455b29(0x1db))/0x8*(parseInt(_0x455b29(0x1d7))/0x9)+parseInt(_0x455b29(0x1df))/0xa;if(_0x5d281a===_0x46ac24)break;else _0x58c245['push'](_0x58c245['shift']());}catch(_0xe6906e){_0x58c245['push'](_0x58c245['shift']());}}}(a75_0x1b5d,0xe17b6));function a75_0x4926(_0x317bc8,_0x340f59){const _0x1b5d04=a75_0x1b5d();return a75_0x4926=function(_0x49267b,_0x224df7){_0x49267b=_0x49267b-0x1cc;let _0x9c236d=_0x1b5d04[_0x49267b];return _0x9c236d;},a75_0x4926(_0x317bc8,_0x340f59);}import{readFile}from'fs/promises';import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x27eece,_0xe2c3cf){const _0x174442=a75_0x4926;try{if(_0xe2c3cf){const _0xbc6999=await readFile(_0x27eece,'utf-8');try{return JSON[_0x174442(0x1dd)](_0xbc6999);}catch(_0x2664ca){throw new SDKError(ErrorCode[_0x174442(0x1cd)],_0x174442(0x1d4)+_0x27eece+'\x27:\x20'+(_0x2664ca instanceof Error?_0x2664ca[_0x174442(0x1dc)]:String(_0x2664ca)));}}else try{return JSON['parse'](_0x27eece);}catch(_0x371181){throw new SDKError(ErrorCode[_0x174442(0x1cd)],'Invalid\x20JSON\x20string:\x20'+(_0x371181 instanceof Error?_0x371181[_0x174442(0x1dc)]:String(_0x371181)));}}catch(_0x715f83){if(_0x715f83 instanceof SDKError)throw _0x715f83;if(_0x715f83 instanceof Error&&_0x174442(0x1d8)in _0x715f83){const _0x5a63da=_0x715f83;if(_0x5a63da['code']==='ENOENT')throw new SDKError(ErrorCode['NOT_FOUND'],'File\x20not\x20found:\x20'+_0x27eece);else{if(_0x5a63da[_0x174442(0x1d8)]===_0x174442(0x1d9))throw new SDKError(ErrorCode['PERMISSION_DENIED'],_0x174442(0x1cc)+_0x27eece);}}throw new SDKError(ErrorCode[_0x174442(0x1d2)],_0x174442(0x1ce)+(_0x715f83 instanceof Error?_0x715f83['message']:String(_0x715f83)));}}export async function loadJSONFromOptions(_0xac4d20,_0x2e41d8){const _0x41b097=a75_0x4926;if(_0xac4d20&&_0x2e41d8)throw new SDKError(ErrorCode[_0x41b097(0x1cd)],_0x41b097(0x1d6));if(_0xac4d20)return await loadJSON(_0xac4d20,![]);if(_0x2e41d8)return await loadJSON(_0x2e41d8,!![]);return undefined;}function a75_0x1b5d(){const _0x785340=['1923mbIeZE','2631318DyTPvz','1100214JEkOnI','INTERNAL','35RYzhYc','Invalid\x20JSON\x20in\x20file\x20\x27','3938kdvsxg','Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','397989yHTxRg','code','EACCES','994973alMoct','232KsKAiR','message','parse','128756oPdcPJ','31739130ugCiyW','Permission\x20denied\x20reading\x20file:\x20','INVALID_ARGUMENT','Failed\x20to\x20load\x20JSON:\x20'];a75_0x1b5d=function(){return _0x785340;};return a75_0x1b5d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3fa164,_0xf05905){const _0x260acc=a76_0x55ae,_0x4c6ad7=_0x3fa164();while(!![]){try{const _0x34803d=-parseInt(_0x260acc(0xdc))/0x1*(parseInt(_0x260acc(0xd8))/0x2)+parseInt(_0x260acc(0xe1))/0x3+-parseInt(_0x260acc(0xdb))/0x4+-parseInt(_0x260acc(0xd9))/0x5*(parseInt(_0x260acc(0xda))/0x6)+parseInt(_0x260acc(0xe2))/0x7+-parseInt(_0x260acc(0xd5))/0x8+parseInt(_0x260acc(0xe3))/0x9;if(_0x34803d===_0xf05905)break;else _0x4c6ad7['push'](_0x4c6ad7['shift']());}catch(_0x20e97d){_0x4c6ad7['push'](_0x4c6ad7['shift']());}}}(a76_0x48f1,0xf1336));export function canCreateAgent(_0x12e078,_0x13d470){const _0x3fcfe0=a76_0x55ae;for(const _0x21b798 of _0x12e078[_0x3fcfe0(0xd6)][_0x3fcfe0(0xd7)]){if(_0x21b798[_0x3fcfe0(0xe0)]&&!_0x13d470['has'](_0x21b798[_0x3fcfe0(0xe0)]))return![];}return!![];}function a76_0x55ae(_0x5902aa,_0x51b93d){const _0x48f1df=a76_0x48f1();return a76_0x55ae=function(_0x55aec5,_0x424857){_0x55aec5=_0x55aec5-0xd5;let _0x2b6c28=_0x48f1df[_0x55aec5];return _0x2b6c28;},a76_0x55ae(_0x5902aa,_0x51b93d);}export function remapToolIds(_0x59e06f,_0x3c2a3c,_0xd9b361){const _0x189b00=a76_0x55ae;return _0x59e06f['map'](_0xa575c6=>({..._0xa575c6,'targetKnowledgeBaseId':_0xa575c6[_0x189b00(0xdd)]?_0x3c2a3c[_0x189b00(0xdf)](_0xa575c6['targetKnowledgeBaseId'])||_0xa575c6[_0x189b00(0xdd)]:undefined,'targetAgentId':_0xa575c6['targetAgentId']?_0xd9b361[_0x189b00(0xdf)](_0xa575c6[_0x189b00(0xe0)])||_0xa575c6[_0x189b00(0xe0)]:undefined}));}export function remapVariableIds(_0x11e940,_0x31a481){const _0x556ea2=a76_0x55ae;return _0x11e940[_0x556ea2(0xde)](_0x500386=>({..._0x500386,'targetKnowledgeBaseId':_0x31a481[_0x556ea2(0xdf)](_0x500386[_0x556ea2(0xdd)])||_0x500386[_0x556ea2(0xdd)]}));}export function isSupportedBackupVersion(_0x365ef7){return _0x365ef7==='1.0';}function a76_0x48f1(){const _0x3e4fa0=['51258cURJnO','3076036IMgAJr','211FcKomk','targetKnowledgeBaseId','map','get','targetAgentId','5456196IjvCew','386582UYdlRt','15970716BPyeAm','4325776levpeT','attributes','tools','5030MKCFpG','480xgOniy'];a76_0x48f1=function(){return _0x3e4fa0;};return a76_0x48f1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a77_0x184f6d=a77_0x444f;(function(_0x1355d5,_0x55d40b){const _0x172287=a77_0x444f,_0x3d938d=_0x1355d5();while(!![]){try{const _0x1788f3=-parseInt(_0x172287(0x19a))/0x1*(-parseInt(_0x172287(0x192))/0x2)+-parseInt(_0x172287(0x193))/0x3+-parseInt(_0x172287(0x194))/0x4*(-parseInt(_0x172287(0x195))/0x5)+-parseInt(_0x172287(0x19c))/0x6*(parseInt(_0x172287(0x19e))/0x7)+parseInt(_0x172287(0x197))/0x8+-parseInt(_0x172287(0x19f))/0x9+parseInt(_0x172287(0x19d))/0xa;if(_0x1788f3===_0x55d40b)break;else _0x3d938d['push'](_0x3d938d['shift']());}catch(_0x1585a9){_0x3d938d['push'](_0x3d938d['shift']());}}}(a77_0x1ca5,0x2abd3));function a77_0x444f(_0x1a2658,_0x46ec64){const _0x1ca500=a77_0x1ca5();return a77_0x444f=function(_0x444f94,_0x212482){_0x444f94=_0x444f94-0x192;let _0x2c6482=_0x1ca500[_0x444f94];return _0x2c6482;},a77_0x444f(_0x1a2658,_0x46ec64);}const MODEL_ALIASES={'haiku':a77_0x184f6d(0x199),'sonnet':a77_0x184f6d(0x19b)};export function extractModelAlias(_0x2364f3){const _0x307239=a77_0x184f6d,_0x30df37=_0x2364f3[_0x307239(0x196)](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x30df37)return _0x30df37[0x1][_0x307239(0x198)]();return _0x2364f3;}export function resolveModelAlias(_0x33da55){const _0x2b42fe=a77_0x184f6d;return MODEL_ALIASES[_0x33da55[_0x2b42fe(0x198)]()]||_0x33da55;}export function getModelAliases(){return{...MODEL_ALIASES};}function a77_0x1ca5(){const _0x166e11=['5181080xZCXmx','559041bfwWan','1067328TFDPCE','12842pxWbOd','1031556SnehbW','72PGMiTY','32620nJYuUj','match','397768QTMkQn','toLowerCase','claude-4.5-haiku','5qLQCwY','claude-4.5-sonnet','6FATtes'];a77_0x1ca5=function(){return _0x166e11;};return a77_0x1ca5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17aa6b,_0x545812){const _0x30df1d=a78_0x14ec,_0x47a80b=_0x17aa6b();while(!![]){try{const _0x50103d=parseInt(_0x30df1d(0xd4))/0x1*(-parseInt(_0x30df1d(0xc8))/0x2)+-parseInt(_0x30df1d(0xd8))/0x3+-parseInt(_0x30df1d(0xd0))/0x4*(-parseInt(_0x30df1d(0xcf))/0x5)+-parseInt(_0x30df1d(0xca))/0x6+-parseInt(_0x30df1d(0xd2))/0x7*(parseInt(_0x30df1d(0xcc))/0x8)+-parseInt(_0x30df1d(0xd3))/0x9+parseInt(_0x30df1d(0xcb))/0xa;if(_0x50103d===_0x545812)break;else _0x47a80b['push'](_0x47a80b['shift']());}catch(_0x3afae3){_0x47a80b['push'](_0x47a80b['shift']());}}}(a78_0x48e1,0x88fdb));export function validateLimitOption(_0x372f65){const _0xd3832d=a78_0x14ec;if(!Number[_0xd3832d(0xcd)](_0x372f65))return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0x372f65+'.\x20Must\x20be\x20an\x20integer.'};if(_0x372f65<=0x0)return{'isValid':![],'error':_0xd3832d(0xd5)+_0x372f65+_0xd3832d(0xd6)};return{'isValid':!![],'value':_0x372f65};}function a78_0x48e1(){const _0x29d484=['.\x20Must\x20be\x20a\x20positive\x20integer.','.\x20Must\x20be\x20a\x20number.','2054340ltVzqS','1759378QAPETE','Invalid\x20timeout\x20value:\x20','6190722TTfvZz','34910350heegzN','4300304jBwQHZ','isInteger','number','3857870gcgsWT','4meGYhR','.\x20Must\x20be\x20a\x20positive\x20number.','7vYfWtq','5109300EKIoHN','1NzWGmK','Invalid\x20limit\x20value:\x20'];a78_0x48e1=function(){return _0x29d484;};return a78_0x48e1();}function a78_0x14ec(_0x130dde,_0x30514a){const _0x48e109=a78_0x48e1();return a78_0x14ec=function(_0x14ecce,_0x2a25a3){_0x14ecce=_0x14ecce-0xc8;let _0xa92e91=_0x48e109[_0x14ecce];return _0xa92e91;},a78_0x14ec(_0x130dde,_0x30514a);}export function validateTimeoutOption(_0x19ab56,_0x2d6084=0x1e){const _0x48991=a78_0x14ec;if(_0x19ab56===undefined)return{'isValid':!![],'value':_0x2d6084};const _0x4daefa=typeof _0x19ab56===_0x48991(0xce)?_0x19ab56:parseFloat(_0x19ab56);if(isNaN(_0x4daefa))return{'isValid':![],'error':_0x48991(0xc9)+_0x19ab56+_0x48991(0xd7)};if(_0x4daefa<=0x0)return{'isValid':![],'error':_0x48991(0xc9)+_0x4daefa+_0x48991(0xd1)};return{'isValid':!![],'value':_0x4daefa};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a79_0x2726(_0x4ee5f1,_0x53ec44){const _0x467d65=a79_0x467d();return a79_0x2726=function(_0x272607,_0x348290){_0x272607=_0x272607-0x11f;let _0x3fa7aa=_0x467d65[_0x272607];return _0x3fa7aa;},a79_0x2726(_0x4ee5f1,_0x53ec44);}(function(_0x57bae0,_0x4d9363){const _0x1607c4=a79_0x2726,_0x43277e=_0x57bae0();while(!![]){try{const _0x4fc6b5=-parseInt(_0x1607c4(0x127))/0x1*(-parseInt(_0x1607c4(0x123))/0x2)+parseInt(_0x1607c4(0x131))/0x3+parseInt(_0x1607c4(0x12e))/0x4+-parseInt(_0x1607c4(0x122))/0x5*(parseInt(_0x1607c4(0x11f))/0x6)+-parseInt(_0x1607c4(0x121))/0x7*(-parseInt(_0x1607c4(0x132))/0x8)+parseInt(_0x1607c4(0x12a))/0x9*(-parseInt(_0x1607c4(0x12d))/0xa)+-parseInt(_0x1607c4(0x129))/0xb*(-parseInt(_0x1607c4(0x130))/0xc);if(_0x4fc6b5===_0x4d9363)break;else _0x43277e['push'](_0x43277e['shift']());}catch(_0x321295){_0x43277e['push'](_0x43277e['shift']());}}}(a79_0x467d,0x53224));import{createServer}from'node:net';function a79_0x467d(){const _0x274df2=['114664minUGd','27JZNmQV','error','\x20and\x20','1426290JbpoFl','506516fOLlMF','listen','12MlERwJ','1281210xjTbJN','10904DLLkeT','3112722YsPQXE','close','1463ZRqaRP','5XXRBez','4382srwoHw','No\x20available\x20port\x20found\x20between\x20','code','0.0.0.0','200uMzVSg','listening'];a79_0x467d=function(){return _0x274df2;};return a79_0x467d();}export async function isPortAvailable(_0x39b21c){return new Promise(_0x4a957a=>{const _0x551c34=a79_0x2726,_0x1e6d03=createServer();_0x1e6d03['once'](_0x551c34(0x12b),_0x57a2c9=>{const _0x2bca99=_0x551c34;_0x57a2c9[_0x2bca99(0x125)]==='EADDRINUSE'?_0x4a957a(![]):_0x4a957a(![]);}),_0x1e6d03['once'](_0x551c34(0x128),()=>{const _0xd986b=_0x551c34;_0x1e6d03[_0xd986b(0x120)](),_0x4a957a(!![]);}),_0x1e6d03[_0x551c34(0x12f)](_0x39b21c,_0x551c34(0x126));});}export async function findAvailablePort(_0x2202a4=0xfa0,_0x20c805=0x64){const _0x4a2683=a79_0x2726;for(let _0x1f2e61=0x0;_0x1f2e61<_0x20c805;_0x1f2e61++){const _0x296bd7=_0x2202a4+_0x1f2e61;if(await isPortAvailable(_0x296bd7))return _0x296bd7;}throw new Error(_0x4a2683(0x124)+_0x2202a4+_0x4a2683(0x12c)+(_0x2202a4+_0x20c805-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a80_0x25a537=a80_0x5670;(function(_0x3c2f00,_0x323c53){const _0x3b9022=a80_0x5670,_0x141b50=_0x3c2f00();while(!![]){try{const _0x4620c4=-parseInt(_0x3b9022(0xe2))/0x1+-parseInt(_0x3b9022(0xc1))/0x2+parseInt(_0x3b9022(0xdc))/0x3*(-parseInt(_0x3b9022(0xd9))/0x4)+parseInt(_0x3b9022(0xca))/0x5*(parseInt(_0x3b9022(0xe1))/0x6)+parseInt(_0x3b9022(0xbd))/0x7+-parseInt(_0x3b9022(0xba))/0x8*(-parseInt(_0x3b9022(0xc8))/0x9)+-parseInt(_0x3b9022(0xc6))/0xa*(parseInt(_0x3b9022(0xce))/0xb);if(_0x4620c4===_0x323c53)break;else _0x141b50['push'](_0x141b50['shift']());}catch(_0x2363b2){_0x141b50['push'](_0x141b50['shift']());}}}(a80_0x3a96,0x66eb2));import{execSync}from'node:child_process';const SHELL_NAMES=new Set([a80_0x25a537(0xc2),a80_0x25a537(0xc0),'sh',a80_0x25a537(0xe0),'ksh',a80_0x25a537(0xc9),a80_0x25a537(0xc4),'dash',a80_0x25a537(0xcb),'powershell','nu',a80_0x25a537(0xcc),a80_0x25a537(0xbf),a80_0x25a537(0xdd)]),EPHEMERAL_SHELL_SPAWNERS=new Set([a80_0x25a537(0xd2),a80_0x25a537(0xd3),a80_0x25a537(0xdb)]);function a80_0x5670(_0x4d00c2,_0x596095){const _0x3a9622=a80_0x3a96();return a80_0x5670=function(_0x567087,_0x53c8a6){_0x567087=_0x567087-0xb3;let _0x5245e8=_0x3a9622[_0x567087];return _0x5245e8;},a80_0x5670(_0x4d00c2,_0x596095);}function getProcessInfoWindows(_0x28bc8a){const _0x2b68d7=a80_0x25a537;try{const _0x29666f=execSync('wmic\x20process\x20where\x20ProcessId='+_0x28bc8a+_0x2b68d7(0xd4),{'encoding':_0x2b68d7(0xb3),'windowsHide':!![]})['trim'](),_0x5a2f69=_0x29666f[_0x2b68d7(0xb6)]('\x0a')[_0x2b68d7(0xb8)](_0x54393f=>_0x54393f['trim']());if(_0x5a2f69[_0x2b68d7(0xcd)]<0x2)return null;const _0x10291f=_0x5a2f69[_0x5a2f69[_0x2b68d7(0xcd)]-0x1][_0x2b68d7(0xb6)](',');if(_0x10291f[_0x2b68d7(0xcd)]<0x3)return null;const _0x18a676=_0x10291f[0x1]?.[_0x2b68d7(0xe3)]()||'',_0x43fd2d=parseInt(_0x10291f[0x2]?.['trim']()||'0',0xa);if(isNaN(_0x43fd2d)||!_0x18a676)return null;return{'pid':_0x28bc8a,'ppid':_0x43fd2d,'comm':_0x18a676[_0x2b68d7(0xb5)](/\.exe$/i,'')};}catch(_0x2dd60d){return process['env'][_0x2b68d7(0xc5)]&&console[_0x2b68d7(0xbb)](_0x2b68d7(0xd8)+_0x28bc8a+_0x2b68d7(0xbc),_0x2dd60d),null;}}function getProcessInfoPosix(_0x36227d){const _0x457aac=a80_0x25a537;try{const _0x128a5d=execSync(_0x457aac(0xde)+_0x36227d+'\x20-o\x20ppid=,comm=',{'encoding':_0x457aac(0xb3)})[_0x457aac(0xe3)](),[_0x4ca2f7,..._0x42dece]=_0x128a5d[_0x457aac(0xb6)](/\s+/),_0x40fda4=parseInt(_0x4ca2f7,0xa),_0x350462=_0x42dece[_0x457aac(0xc3)]('\x20');if(isNaN(_0x40fda4))return null;return{'pid':_0x36227d,'ppid':_0x40fda4,'comm':_0x350462};}catch(_0x3dc3fa){return process[_0x457aac(0xbe)][_0x457aac(0xc5)]&&console[_0x457aac(0xbb)](_0x457aac(0xd8)+_0x36227d+_0x457aac(0xd5),_0x3dc3fa),null;}}function getProcessInfo(_0x9142cf){const _0x47803a=a80_0x25a537;if(process[_0x47803a(0xb4)]===_0x47803a(0xd6))return getProcessInfoWindows(_0x9142cf);return getProcessInfoPosix(_0x9142cf);}function getBasename(_0x3f591a){const _0x46b8ff=a80_0x25a537;return _0x3f591a['replace'](/^-/,'')[_0x46b8ff(0xb6)]('/')[_0x46b8ff(0xd7)]()?.['toLowerCase']()||'';}function isShell(_0x4325ac){const _0x59f774=a80_0x25a537;return SHELL_NAMES[_0x59f774(0xd1)](getBasename(_0x4325ac));}function isEphemeralShellSpawner(_0x3b1096){const _0x327114=a80_0x25a537;return EPHEMERAL_SHELL_SPAWNERS[_0x327114(0xd1)](getBasename(_0x3b1096));}function a80_0x3a96(){const _0x121dcb=['env','elvish','zsh','758560pcmxMQ','bash','join','csh','DEBUG','22370UVEQXh','Found\x20ephemeral\x20shell\x20','5130pAcfSL','tcsh','80RgYKWn','pwsh','ion','length','11cugBHH','ppid',',\x20continuing\x20up','has','claude','code','\x20get\x20ParentProcessId,Name\x20/format:csv','\x20on\x20POSIX:','win32','pop','Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20','324ididIk',',\x20using\x20fallback','cursor','8076bpsqoL','xonsh','ps\x20-p\x20','kill','fish','265974GGstmN','529589aNOeyb','trim','utf-8','platform','replace','split','Could\x20not\x20get\x20process\x20info\x20for\x20PID\x20','filter','comm','3424SkPFzL','error','\x20on\x20Windows:','4182416BSYiuS'];a80_0x3a96=function(){return _0x121dcb;};return a80_0x3a96();}let cachedShellPID;function findShellPID(){const _0x1882e6=a80_0x25a537;let _0xc71941=process['ppid'];const _0x140256=0xa;let _0x2d1515=0x0;while(_0x2d1515<_0x140256){const _0x1fec55=getProcessInfo(_0xc71941);if(!_0x1fec55){process[_0x1882e6(0xbe)][_0x1882e6(0xc5)]&&console[_0x1882e6(0xbb)](_0x1882e6(0xb7)+_0xc71941+_0x1882e6(0xda));break;}if(isShell(_0x1fec55['comm'])){const _0x2073fb=getProcessInfo(_0x1fec55['ppid']);if(_0x2073fb&&isEphemeralShellSpawner(_0x2073fb[_0x1882e6(0xb9)])){process['env'][_0x1882e6(0xc5)]&&console[_0x1882e6(0xbb)](_0x1882e6(0xc7)+_0x1fec55['pid']+'\x20('+_0x1fec55['comm']+')\x20spawned\x20by\x20'+_0x2073fb['comm']+_0x1882e6(0xd0));_0xc71941=_0x1fec55[_0x1882e6(0xcf)],_0x2d1515++;continue;}return _0x1fec55['pid'];}if(_0x1fec55[_0x1882e6(0xcf)]===0x0||_0x1fec55[_0x1882e6(0xcf)]===0x1){if(isShell(_0x1fec55[_0x1882e6(0xb9)]))return _0x1fec55['pid'];break;}_0xc71941=_0x1fec55[_0x1882e6(0xcf)],_0x2d1515++;}return process[_0x1882e6(0xbe)]['DEBUG']&&console['error']('No\x20shell\x20found\x20in\x20process\x20tree,\x20falling\x20back\x20to\x20process.ppid'),process['ppid'];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x3e43ab){const _0x5ecb0b=a80_0x25a537;try{return process[_0x5ecb0b(0xdf)](_0x3e43ab,0x0),!![];}catch{return![];}}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfe20ea,_0x148358){const _0x26dc9a=a81_0x5403,_0x1fdee9=_0xfe20ea();while(!![]){try{const _0x1876e9=-parseInt(_0x26dc9a(0x108))/0x1+parseInt(_0x26dc9a(0x101))/0x2+-parseInt(_0x26dc9a(0x109))/0x3+parseInt(_0x26dc9a(0xff))/0x4+parseInt(_0x26dc9a(0x104))/0x5*(-parseInt(_0x26dc9a(0x100))/0x6)+parseInt(_0x26dc9a(0x102))/0x7+-parseInt(_0x26dc9a(0x10b))/0x8*(-parseInt(_0x26dc9a(0x105))/0x9);if(_0x1876e9===_0x148358)break;else _0x1fdee9['push'](_0x1fdee9['shift']());}catch(_0xe3ef1c){_0x1fdee9['push'](_0x1fdee9['shift']());}}}(a81_0x44a6,0xbc6ae));import*as a81_0x4692a4 from'readline';function a81_0x5403(_0x1332e7,_0x136935){const _0x44a64b=a81_0x44a6();return a81_0x5403=function(_0x540385,_0x2d0995){_0x540385=_0x540385-0xff;let _0x49a94d=_0x44a64b[_0x540385];return _0x49a94d;},a81_0x5403(_0x1332e7,_0x136935);}function a81_0x44a6(){const _0x5b4d73=['1013632wvRitF','createInterface','stdout','184064UEUOGX','10974Vtrmnd','946198rcIRBU','8960427DSFuaa','toLowerCase','635rsqKfs','63yBuUTh','yes','question','841527yuRNYA','2521608paxAmV','close'];a81_0x44a6=function(){return _0x5b4d73;};return a81_0x44a6();}export async function confirm(_0x223d9d){const _0x18a8e9=a81_0x5403,_0x1caa89=a81_0x4692a4[_0x18a8e9(0x10c)]({'input':process['stdin'],'output':process[_0x18a8e9(0x10d)]});return new Promise(_0x279553=>{const _0x5f07a9=_0x18a8e9;_0x1caa89[_0x5f07a9(0x107)](_0x223d9d+'\x20(y/N):\x20',_0x37f2f1=>{const _0x55ca9b=_0x5f07a9;_0x1caa89[_0x55ca9b(0x10a)](),_0x279553(_0x37f2f1[_0x55ca9b(0x103)]()==='y'||_0x37f2f1[_0x55ca9b(0x103)]()===_0x55ca9b(0x106));});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d6f5d,_0x2319cc){const _0x35a0d5=a82_0x3dd2,_0x1fed63=_0x5d6f5d();while(!![]){try{const _0x41ce0f=parseInt(_0x35a0d5(0xb4))/0x1+-parseInt(_0x35a0d5(0xb7))/0x2+parseInt(_0x35a0d5(0xba))/0x3*(-parseInt(_0x35a0d5(0xae))/0x4)+-parseInt(_0x35a0d5(0xc1))/0x5+parseInt(_0x35a0d5(0xb5))/0x6+-parseInt(_0x35a0d5(0xaf))/0x7*(parseInt(_0x35a0d5(0xb8))/0x8)+parseInt(_0x35a0d5(0xb0))/0x9;if(_0x41ce0f===_0x2319cc)break;else _0x1fed63['push'](_0x1fed63['shift']());}catch(_0x51142f){_0x1fed63['push'](_0x1fed63['shift']());}}}(a82_0x5ac8,0xd3999));export function parsePath(_0x536df4){const _0x250579=a82_0x3dd2;if(!_0x536df4||_0x536df4['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x1d0074=_0x536df4[_0x250579(0xac)]();if(_0x1d0074==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x536df4};const _0x4841ee=_0x1d0074[_0x250579(0xb9)]('/')?_0x1d0074[_0x250579(0xb1)](0x1):_0x1d0074,_0x1e0e33=_0x4841ee['split']('/')['filter'](_0x49e161=>_0x49e161!=='');if(_0x1e0e33[_0x250579(0xbb)]===0x0)throw new Error(_0x250579(0xbd));const _0x42df7b=_0x1d0074['startsWith']('/')||!isRelativePathSegment(_0x1e0e33[0x0]);for(const _0x18c3c4 of _0x1e0e33){validatePathSegment(_0x18c3c4);}return{'segments':_0x1e0e33,'isAbsolute':_0x42df7b,'raw':_0x536df4};}function isRelativePathSegment(_0x468341){return _0x468341==='.'||_0x468341==='..';}function a82_0x5ac8(){const _0x1a7e8f=['1449JykzsM','31430349hUWfwH','substring','push','Path\x20attempts\x20to\x20navigate\x20above\x20root','848363ECCtDm','4899006LALhsD','Cannot\x20navigate\x20above\x20root','2263178YhgqQo','7096OFTvXp','startsWith','42hQJpPg','length','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','slice','segments','8206540XXjLvL','pop','test','raw','isAbsolute','Relative\x20path\x20cannot\x20be\x20empty','trim','join','381116FZGoWo'];a82_0x5ac8=function(){return _0x1a7e8f;};return a82_0x5ac8();}function a82_0x3dd2(_0x5b9ed5,_0x230492){const _0x5ac86b=a82_0x5ac8();return a82_0x3dd2=function(_0x3dd201,_0x2a2f5d){_0x3dd201=_0x3dd201-0xac;let _0x416cf1=_0x5ac86b[_0x3dd201];return _0x416cf1;},a82_0x3dd2(_0x5b9ed5,_0x230492);}function validatePathSegment(_0x2574a2){const _0x3900bf=a82_0x3dd2;if(_0x2574a2==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x2574a2==='.'||_0x2574a2==='..')return;if(/[\x00-\x1F\x7F]/[_0x3900bf(0xc3)](_0x2574a2))throw new Error(_0x3900bf(0xbc)+_0x2574a2);if(_0x2574a2!==_0x2574a2[_0x3900bf(0xac)]()){}}export function validatePath(_0x29889c){const _0x2bc615=a82_0x3dd2;if(_0x29889c[_0x2bc615(0xc0)][_0x2bc615(0xbb)]===0x0&&!_0x29889c[_0x2bc615(0xc5)])throw new Error(_0x2bc615(0xc6));if(_0x29889c['isAbsolute']){if(_0x29889c[_0x2bc615(0xc0)][0x0]==='..')throw new Error(_0x2bc615(0xbe));let _0x3144d0=0x0;for(const _0x22c236 of _0x29889c[_0x2bc615(0xc0)]){if(_0x22c236==='..'){if(_0x3144d0===0x0)throw new Error(_0x2bc615(0xb3));_0x3144d0--;}else _0x22c236!=='.'&&_0x3144d0++;}}}export function joinPaths(_0xc949bb,_0xad2bd6){const _0x19bbaa=a82_0x3dd2;if(!_0xc949bb||_0xc949bb==='/')return _0xad2bd6;if(!_0xad2bd6||_0xad2bd6==='.')return _0xc949bb;if(_0xad2bd6[_0x19bbaa(0xb9)]('/'))return _0xad2bd6;const _0x30259b=parsePath(_0xc949bb),_0x4fee92=parsePath(_0xad2bd6),_0x44a998=[..._0x30259b[_0x19bbaa(0xc0)]];for(const _0x39f2af of _0x4fee92[_0x19bbaa(0xc0)]){if(_0x39f2af==='.')continue;else{if(_0x39f2af==='..'){if(_0x44a998[_0x19bbaa(0xbb)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x44a998[_0x19bbaa(0xc2)]();}else _0x44a998[_0x19bbaa(0xb2)](_0x39f2af);}}const _0x2010ce=_0x44a998[_0x19bbaa(0xad)]('/');return _0x30259b['raw'][_0x19bbaa(0xb9)]('/')?'/'+_0x2010ce:_0x2010ce;}export function normalizePath(_0x21c8fc){const _0x446649=a82_0x3dd2,_0x181bfe=parsePath(_0x21c8fc),_0x567e46=[];for(const _0x319d1d of _0x181bfe[_0x446649(0xc0)]){if(_0x319d1d==='.')continue;else{if(_0x319d1d==='..'){if(_0x567e46['length']===0x0){if(_0x181bfe[_0x446649(0xc5)])throw new Error(_0x446649(0xb6));_0x567e46[_0x446649(0xb2)]('..');}else _0x567e46[_0x567e46[_0x446649(0xbb)]-0x1]==='..'?_0x567e46[_0x446649(0xb2)]('..'):_0x567e46[_0x446649(0xc2)]();}else _0x567e46[_0x446649(0xb2)](_0x319d1d);}}if(_0x567e46[_0x446649(0xbb)]===0x0)return _0x181bfe[_0x446649(0xc5)]?'/':'.';const _0xaba3cf=_0x567e46[_0x446649(0xad)]('/');return _0x181bfe[_0x446649(0xc4)]['startsWith']('/')?'/'+_0xaba3cf:_0xaba3cf;}export function getParentPath(_0x3cbced){const _0x3aa7a5=a82_0x3dd2,_0x5e5e94=parsePath(_0x3cbced);if(_0x5e5e94['segments'][_0x3aa7a5(0xbb)]<=0x1)return'/';const _0x2179e4=_0x5e5e94[_0x3aa7a5(0xc0)][_0x3aa7a5(0xbf)](0x0,-0x1)[_0x3aa7a5(0xad)]('/');return _0x5e5e94[_0x3aa7a5(0xc4)][_0x3aa7a5(0xb9)]('/')?'/'+_0x2179e4:_0x2179e4;}export function getBaseName(_0x3126a3){const _0x39dfac=a82_0x3dd2,_0x4f4ca4=parsePath(_0x3126a3);return _0x4f4ca4[_0x39dfac(0xc0)][_0x4f4ca4[_0x39dfac(0xc0)][_0x39dfac(0xbb)]-0x1]||'';}export function isChildPath(_0x215721,_0xe577f6){const _0x43b2cd=a82_0x3dd2,_0x28ddb8=parsePath(_0x215721),_0x131f88=parsePath(_0xe577f6);if(_0x28ddb8[_0x43b2cd(0xc0)][_0x43b2cd(0xbb)]<=_0x131f88[_0x43b2cd(0xc0)][_0x43b2cd(0xbb)])return![];for(let _0x1f08e8=0x0;_0x1f08e8<_0x131f88[_0x43b2cd(0xc0)]['length'];_0x1f08e8++){if(_0x28ddb8[_0x43b2cd(0xc0)][_0x1f08e8]!==_0x131f88[_0x43b2cd(0xc0)][_0x1f08e8])return![];}return!![];}export function splitPath(_0x2416a9){const _0x5297da=a82_0x3dd2,_0x5c4143=parsePath(_0x2416a9);if(_0x5c4143[_0x5297da(0xc0)][_0x5297da(0xbb)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x5c4143[_0x5297da(0xc0)]['length']===0x1)return{'parent':_0x5c4143[_0x5297da(0xc0)][0x0]};return{'parent':_0x5c4143[_0x5297da(0xc0)][0x0],'child':_0x5c4143['segments'][_0x5297da(0xbf)](0x1)[_0x5297da(0xad)]('/')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a83_0x5a80(){const _0x11189a=['2504560VoCVDR','1476344SRUXuM','.\x20Child\x20name\x20cannot\x20be\x20empty','5QTUfud','substring','1116853paumoQ','684838NTkTpE','5958090xqGGbj','27daMoQu','4178544MsOStr','1115149lKJURE','indexOf','Invalid\x20segment\x20reference\x20format:\x20','6nZzNaD','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a83_0x5a80=function(){return _0x11189a;};return a83_0x5a80();}(function(_0x3167fd,_0x108ecf){const _0x1f2153=a83_0x93f8,_0x35db49=_0x3167fd();while(!![]){try{const _0x5e274f=-parseInt(_0x1f2153(0x1bd))/0x1+parseInt(_0x1f2153(0x1be))/0x2*(-parseInt(_0x1f2153(0x1c5))/0x3)+-parseInt(_0x1f2153(0x1b9))/0x4*(-parseInt(_0x1f2153(0x1bb))/0x5)+parseInt(_0x1f2153(0x1c1))/0x6+-parseInt(_0x1f2153(0x1c2))/0x7+-parseInt(_0x1f2153(0x1c7))/0x8+-parseInt(_0x1f2153(0x1c0))/0x9*(-parseInt(_0x1f2153(0x1bf))/0xa);if(_0x5e274f===_0x108ecf)break;else _0x35db49['push'](_0x35db49['shift']());}catch(_0x3b7e88){_0x35db49['push'](_0x35db49['shift']());}}}(a83_0x5a80,0x8d535));function a83_0x93f8(_0x44ae0c,_0x1a5e4d){const _0x5a8033=a83_0x5a80();return a83_0x93f8=function(_0x93f864,_0x1bdf7d){_0x93f864=_0x93f864-0x1b9;let _0x387e95=_0x5a8033[_0x93f864];return _0x387e95;},a83_0x93f8(_0x44ae0c,_0x1a5e4d);}export function parseSegmentRef(_0x5cd375){const _0x300126=a83_0x93f8,_0x4cbfbd=_0x5cd375[_0x300126(0x1c3)]('/');if(_0x4cbfbd===-0x1)return{'parentId':_0x5cd375};if(_0x4cbfbd===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x5cd375+_0x300126(0x1c6));const _0x4a32b4=_0x5cd375[_0x300126(0x1bc)](0x0,_0x4cbfbd),_0x1474b3=_0x5cd375[_0x300126(0x1bc)](_0x4cbfbd+0x1);if(_0x1474b3==='')throw new Error(_0x300126(0x1c4)+_0x5cd375+_0x300126(0x1ba));return{'parentId':_0x4a32b4,'childId':_0x1474b3};}
|