@treasuredata/tdx 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/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/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-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/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +44 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.d.ts +2 -1
- package/dist/sdk/claude-agent/index.d.ts.map +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/index.js.map +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +4 -1
- package/dist/sdk/claude-agent/types.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.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/spinner.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/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24c3b9,_0xea8734){const _0x1deac2=a159_0x2ab3,_0x4740e6=_0x24c3b9();while(!![]){try{const _0x544ec2=-parseInt(_0x1deac2(0xcc))/0x1*(parseInt(_0x1deac2(0xb9))/0x2)+-parseInt(_0x1deac2(0xc2))/0x3+-parseInt(_0x1deac2(0xca))/0x4+parseInt(_0x1deac2(0xba))/0x5+-parseInt(_0x1deac2(0xcb))/0x6*(-parseInt(_0x1deac2(0xbc))/0x7)+-parseInt(_0x1deac2(0xc8))/0x8+parseInt(_0x1deac2(0xbe))/0x9;if(_0x544ec2===_0xea8734)break;else _0x4740e6['push'](_0x4740e6['shift']());}catch(_0x38e41e){_0x4740e6['push'](_0x4740e6['shift']());}}}(a159_0xc710,0x385ee));import{readFile}from'fs/promises';function a159_0xc710(){const _0x3dc69c=['327075Mvwjqp','Failed\x20to\x20load\x20JSON:\x20','16919uaSWss','INVALID_ARGUMENT','10313694WWchTu','PERMISSION_DENIED','Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','EACCES','1370265ELmFQq','ENOENT','File\x20not\x20found:\x20','Invalid\x20JSON\x20string:\x20','Invalid\x20JSON\x20in\x20file\x20\x27','message','1680056CNepbJ','code','789024Lnuqqh','114WqsmuT','766XcAMiG','parse','424ssjGEz'];a159_0xc710=function(){return _0x3dc69c;};return a159_0xc710();}import{SDKError,ErrorCode}from'../sdk/errors.js';function a159_0x2ab3(_0x50af64,_0x51bece){_0x50af64=_0x50af64-0xb8;const _0xc71055=a159_0xc710();let _0x2ab37f=_0xc71055[_0x50af64];return _0x2ab37f;}export async function loadJSON(_0x392374,_0x4b3549){const _0x400b44=a159_0x2ab3;try{if(_0x4b3549){const _0x28b856=await readFile(_0x392374,'utf-8');try{return JSON[_0x400b44(0xb8)](_0x28b856);}catch(_0x11cbc8){throw new SDKError(ErrorCode[_0x400b44(0xbd)],_0x400b44(0xc6)+_0x392374+'\x27:\x20'+(_0x11cbc8 instanceof Error?_0x11cbc8[_0x400b44(0xc7)]:String(_0x11cbc8)));}}else try{return JSON[_0x400b44(0xb8)](_0x392374);}catch(_0x4f9880){throw new SDKError(ErrorCode[_0x400b44(0xbd)],_0x400b44(0xc5)+(_0x4f9880 instanceof Error?_0x4f9880[_0x400b44(0xc7)]:String(_0x4f9880)));}}catch(_0x493765){if(_0x493765 instanceof SDKError)throw _0x493765;if(_0x493765 instanceof Error&&_0x400b44(0xc9)in _0x493765){const _0x1eddcb=_0x493765;if(_0x1eddcb[_0x400b44(0xc9)]===_0x400b44(0xc3))throw new SDKError(ErrorCode['NOT_FOUND'],_0x400b44(0xc4)+_0x392374);else{if(_0x1eddcb['code']===_0x400b44(0xc1))throw new SDKError(ErrorCode[_0x400b44(0xbf)],'Permission\x20denied\x20reading\x20file:\x20'+_0x392374);}}throw new SDKError(ErrorCode['INTERNAL'],_0x400b44(0xbb)+(_0x493765 instanceof Error?_0x493765[_0x400b44(0xc7)]:String(_0x493765)));}}export async function loadJSONFromOptions(_0x3eb03d,_0x4d0bae){const _0x36a909=a159_0x2ab3;if(_0x3eb03d&&_0x4d0bae)throw new SDKError(ErrorCode[_0x36a909(0xbd)],_0x36a909(0xc0));if(_0x3eb03d)return await loadJSON(_0x3eb03d,![]);if(_0x4d0bae)return await loadJSON(_0x4d0bae,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x43b096,_0x5aac7f){const _0x5e9ecf=a160_0x38fa,_0x1270a9=_0x43b096();while(!![]){try{const _0x1d4d7d=-parseInt(_0x5e9ecf(0x197))/0x1*(-parseInt(_0x5e9ecf(0x193))/0x2)+-parseInt(_0x5e9ecf(0x194))/0x3+-parseInt(_0x5e9ecf(0x192))/0x4+parseInt(_0x5e9ecf(0x18c))/0x5*(parseInt(_0x5e9ecf(0x18b))/0x6)+parseInt(_0x5e9ecf(0x196))/0x7+-parseInt(_0x5e9ecf(0x195))/0x8*(-parseInt(_0x5e9ecf(0x191))/0x9)+-parseInt(_0x5e9ecf(0x18f))/0xa*(parseInt(_0x5e9ecf(0x18a))/0xb);if(_0x1d4d7d===_0x5aac7f)break;else _0x1270a9['push'](_0x1270a9['shift']());}catch(_0xd2d2d6){_0x1270a9['push'](_0x1270a9['shift']());}}}(a160_0x45ab,0x79000));function a160_0x45ab(){const _0x338e71=['3bJQChr','Invalid\x20timeout\x20value:\x20','87131iWwDjx','940158ialxrS','20TDSKTi','number','isInteger','1490yjanjn','Invalid\x20limit\x20value:\x20','18IyaNZa','3024740dQRxzJ','660354eSCaAH','1743537Vqzfbl','3226648lerKXW','4124708jIlHVp'];a160_0x45ab=function(){return _0x338e71;};return a160_0x45ab();}function a160_0x38fa(_0x5a91a7,_0x2c55d3){_0x5a91a7=_0x5a91a7-0x18a;const _0x45ab6c=a160_0x45ab();let _0x38fa1c=_0x45ab6c[_0x5a91a7];return _0x38fa1c;}export function validateLimitOption(_0x133055){const _0x1a9e05=a160_0x38fa;if(!Number[_0x1a9e05(0x18e)](_0x133055))return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0x133055+'.\x20Must\x20be\x20an\x20integer.'};if(_0x133055<=0x0)return{'isValid':![],'error':_0x1a9e05(0x190)+_0x133055+'.\x20Must\x20be\x20a\x20positive\x20integer.'};return{'isValid':!![],'value':_0x133055};}export function validateTimeoutOption(_0x34458e,_0x5356ed=0x1e){const _0x640c72=a160_0x38fa;if(_0x34458e===undefined)return{'isValid':!![],'value':_0x5356ed};const _0x4e5f31=typeof _0x34458e===_0x640c72(0x18d)?_0x34458e:parseFloat(_0x34458e);if(isNaN(_0x4e5f31))return{'isValid':![],'error':_0x640c72(0x198)+_0x34458e+'.\x20Must\x20be\x20a\x20number.'};if(_0x4e5f31<=0x0)return{'isValid':![],'error':_0x640c72(0x198)+_0x4e5f31+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x4e5f31};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13ea8d,_0x22c222){const _0x21e1d4=a161_0x4cfc,_0x1d484e=_0x13ea8d();while(!![]){try{const _0x313c43=parseInt(_0x21e1d4(0x9f))/0x1*(parseInt(_0x21e1d4(0xa6))/0x2)+-parseInt(_0x21e1d4(0xa4))/0x3*(parseInt(_0x21e1d4(0xa7))/0x4)+parseInt(_0x21e1d4(0x9b))/0x5*(-parseInt(_0x21e1d4(0xa2))/0x6)+parseInt(_0x21e1d4(0xaa))/0x7*(-parseInt(_0x21e1d4(0x9c))/0x8)+parseInt(_0x21e1d4(0xa1))/0x9*(-parseInt(_0x21e1d4(0x98))/0xa)+parseInt(_0x21e1d4(0xa3))/0xb*(-parseInt(_0x21e1d4(0xa9))/0xc)+parseInt(_0x21e1d4(0xa8))/0xd;if(_0x313c43===_0x22c222)break;else _0x1d484e['push'](_0x1d484e['shift']());}catch(_0x58340d){_0x1d484e['push'](_0x1d484e['shift']());}}}(a161_0x2817,0x4fba1));import{createServer}from'node:net';function a161_0x2817(){const _0x59792a=['24VrUvDX','EADDRINUSE','0.0.0.0','2UFGEuE','listening','18OkCaln','6720cyqzAx','22TTMPHO','684897YTWNcT','once','502922EEUDWA','8PtaTEF','31086562JNJEgk','3257844utxplu','1475873CTJgwD','code','1547330RhsfAR','close','listen','2795NGqiLY'];a161_0x2817=function(){return _0x59792a;};return a161_0x2817();}export async function isPortAvailable(_0x4ecb35){return new Promise(_0xd1488a=>{const _0x5a84a7=a161_0x4cfc,_0x35bc94=createServer();_0x35bc94[_0x5a84a7(0xa5)]('error',_0x392c26=>{const _0x1f8c48=_0x5a84a7;_0x392c26[_0x1f8c48(0x97)]===_0x1f8c48(0x9d)?_0xd1488a(![]):_0xd1488a(![]);}),_0x35bc94['once'](_0x5a84a7(0xa0),()=>{const _0x381739=_0x5a84a7;_0x35bc94[_0x381739(0x99)](),_0xd1488a(!![]);}),_0x35bc94[_0x5a84a7(0x9a)](_0x4ecb35,_0x5a84a7(0x9e));});}function a161_0x4cfc(_0x5a575e,_0x52e120){_0x5a575e=_0x5a575e-0x97;const _0x2817df=a161_0x2817();let _0x4cfc55=_0x2817df[_0x5a575e];return _0x4cfc55;}export async function findAvailablePort(_0x20f793=0xfa0,_0x4310ce=0x64){for(let _0x44f3db=0x0;_0x44f3db<_0x4310ce;_0x44f3db++){const _0xa1f4e4=_0x20f793+_0x44f3db;if(await isPortAvailable(_0xa1f4e4))return _0xa1f4e4;}throw new Error('No\x20available\x20port\x20found\x20between\x20'+_0x20f793+'\x20and\x20'+(_0x20f793+_0x4310ce-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a162_0xccecb9=a162_0x3166;(function(_0x439f93,_0x4522d3){const _0x4e67bd=a162_0x3166,_0x1276fe=_0x439f93();while(!![]){try{const _0x3f3de7=parseInt(_0x4e67bd(0xd3))/0x1+parseInt(_0x4e67bd(0xe5))/0x2+parseInt(_0x4e67bd(0xea))/0x3+-parseInt(_0x4e67bd(0xd7))/0x4*(-parseInt(_0x4e67bd(0xe4))/0x5)+-parseInt(_0x4e67bd(0xc9))/0x6+parseInt(_0x4e67bd(0xcf))/0x7*(parseInt(_0x4e67bd(0xdc))/0x8)+-parseInt(_0x4e67bd(0xd5))/0x9;if(_0x3f3de7===_0x4522d3)break;else _0x1276fe['push'](_0x1276fe['shift']());}catch(_0x260fde){_0x1276fe['push'](_0x1276fe['shift']());}}}(a162_0x2820,0x4b9b4));import{execSync,spawn}from'node:child_process';const SHELL_NAMES=new Set(['bash',a162_0xccecb9(0xde),'sh','fish',a162_0xccecb9(0xb7),'tcsh',a162_0xccecb9(0xee),a162_0xccecb9(0xd4),a162_0xccecb9(0xd6),a162_0xccecb9(0xda),'nu',a162_0xccecb9(0xce),a162_0xccecb9(0xef),a162_0xccecb9(0xdf)]),EPHEMERAL_SHELL_SPAWNERS=new Set(['claude',a162_0xccecb9(0xc2),'cursor']);function getProcessInfoWindows(_0xf7b909){const _0xa3bc8c=a162_0xccecb9;try{if(!Number[_0xa3bc8c(0xb8)](_0xf7b909)||_0xf7b909<=0x0)return null;const _0x323a02=_0xa3bc8c(0xba)+_0xf7b909+_0xa3bc8c(0xcb),_0x4aa377=execSync(_0xa3bc8c(0xd2)+_0x323a02+'\x22',{'encoding':_0xa3bc8c(0xbf),'windowsHide':!![],'stdio':[_0xa3bc8c(0xe3),'pipe',_0xa3bc8c(0xe3)]})['trim']();if(!_0x4aa377)return null;const [_0x529e26,..._0x1e64ea]=_0x4aa377[_0xa3bc8c(0xc5)](','),_0x4c22c1=parseInt(_0x529e26,0xa),_0x5aecc5=_0x1e64ea['join'](',')[_0xa3bc8c(0xdb)]();if(isNaN(_0x4c22c1)||!_0x5aecc5)return null;return{'pid':_0xf7b909,'ppid':_0x4c22c1,'comm':_0x5aecc5[_0xa3bc8c(0xcc)](/\.exe$/i,'')};}catch{return null;}}function a162_0x2820(){const _0x2f1710=['pop','1738659rkAfFV','data','win32','ppid','csh','elvish','comm','ksh','isInteger','stdout','Get-CimInstance\x20Win32_Process\x20-Filter\x20\x22ProcessId=','cmd.exe','darwin','toLowerCase','Unsupported\x20protocol:\x20','utf-8','ignore','exit','code','https:','kill','split','unref','has','which','706584aFCIxg','Invalid\x20URL:\x20','\x22\x20|\x20Select-Object\x20-Property\x20ParentProcessId,Name\x20|\x20ForEach-Object\x20{\x20\x22$($_.ParentProcessId),$($_.Name)\x22\x20}','replace','protocol','ion','72849xQrvoQ','join','platform','powershell.exe\x20-NoProfile\x20-NonInteractive\x20-Command\x20\x22','18108QxkZMk','dash','6609096VWqUgW','pwsh','4ePvxbl','map','xdg-open','powershell','trim','176dgnUoT','test','zsh','xonsh','pid','where.exe','start','pipe','72655hZtIFE','641292ivUlVF','\x20-o\x20ppid=,comm=','http:','ps\x20-p\x20'];a162_0x2820=function(){return _0x2f1710;};return a162_0x2820();}function getProcessInfoPosix(_0x157e2c){const _0x114702=a162_0xccecb9;try{const _0xf0d875=0x400000;if(!Number[_0x114702(0xb8)](_0x157e2c)||_0x157e2c<=0x0||_0x157e2c>_0xf0d875)return null;const _0x1d66e0=execSync(_0x114702(0xe8)+_0x157e2c+_0x114702(0xe6),{'encoding':'utf-8','stdio':'pipe'})['trim'](),[_0x4e0e69,..._0x3365d8]=_0x1d66e0['split'](/\s+/),_0x43f652=parseInt(_0x4e0e69,0xa),_0x53bf33=_0x3365d8[_0x114702(0xd0)]('\x20');if(isNaN(_0x43f652))return null;return{'pid':_0x157e2c,'ppid':_0x43f652,'comm':_0x53bf33};}catch{return null;}}function a162_0x3166(_0x5014da,_0x166b25){_0x5014da=_0x5014da-0xb7;const _0x2820ec=a162_0x2820();let _0x3166d4=_0x2820ec[_0x5014da];return _0x3166d4;}function getProcessInfo(_0x579b3c){const _0x2c223d=a162_0xccecb9;if(process[_0x2c223d(0xd1)]==='win32')return getProcessInfoWindows(_0x579b3c);return getProcessInfoPosix(_0x579b3c);}function getBasename(_0x50d774){const _0x56adcc=a162_0xccecb9;return _0x50d774['replace'](/^-/,'')[_0x56adcc(0xc5)]('/')[_0x56adcc(0xe9)]()?.[_0x56adcc(0xbd)]()||'';}function isShell(_0x41ff47){const _0x7413d0=a162_0xccecb9;return SHELL_NAMES[_0x7413d0(0xc7)](getBasename(_0x41ff47));}function isEphemeralShellSpawner(_0x4501e0){const _0x4b37b3=a162_0xccecb9;return EPHEMERAL_SHELL_SPAWNERS[_0x4b37b3(0xc7)](getBasename(_0x4501e0));}let cachedShellPID;function findShellPID(){const _0x359953=a162_0xccecb9;if(process[_0x359953(0xed)]===undefined)return process[_0x359953(0xe0)];let _0x27bc8c=process['ppid'];const _0x27003d=0xa;let _0x525b9b=0x0;while(_0x525b9b<_0x27003d){const _0x5e60fb=getProcessInfo(_0x27bc8c);if(!_0x5e60fb)break;if(isShell(_0x5e60fb[_0x359953(0xf0)])){const _0x1cb1f7=getProcessInfo(_0x5e60fb[_0x359953(0xed)]);if(_0x1cb1f7&&isEphemeralShellSpawner(_0x1cb1f7[_0x359953(0xf0)])){_0x27bc8c=_0x5e60fb[_0x359953(0xed)],_0x525b9b++;continue;}return _0x5e60fb[_0x359953(0xe0)];}if(_0x5e60fb[_0x359953(0xed)]===0x0||_0x5e60fb[_0x359953(0xed)]===0x1){if(isShell(_0x5e60fb['comm']))return _0x5e60fb[_0x359953(0xe0)];break;}_0x27bc8c=_0x5e60fb[_0x359953(0xed)],_0x525b9b++;}return process[_0x359953(0xed)]!==undefined?process[_0x359953(0xed)]:process[_0x359953(0xe0)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x4b0047){const _0x150b21=a162_0xccecb9;if(!Number[_0x150b21(0xb8)](_0x4b0047)||_0x4b0047<=0x0)return![];try{return process[_0x150b21(0xc4)](_0x4b0047,0x0),!![];}catch{return![];}}export function openBrowser(_0x102872){const _0x7aa593=a162_0xccecb9;let _0x39a2fd;try{_0x39a2fd=new URL(_0x102872);}catch{throw new Error(_0x7aa593(0xca)+_0x102872);}if(_0x39a2fd[_0x7aa593(0xcd)]!==_0x7aa593(0xe7)&&_0x39a2fd[_0x7aa593(0xcd)]!==_0x7aa593(0xc3))throw new Error(_0x7aa593(0xbe)+_0x39a2fd[_0x7aa593(0xcd)]);const _0x29e8e5=_0x39a2fd['href'],_0x25d1b6=process[_0x7aa593(0xd1)];if(_0x25d1b6==='win32')spawn(_0x7aa593(0xbb),['/c',_0x7aa593(0xe2),'',_0x29e8e5],{'detached':!![],'stdio':_0x7aa593(0xc0)})['unref']();else{const _0x2f8ce0=_0x25d1b6===_0x7aa593(0xbc)?'open':_0x7aa593(0xd9);spawn(_0x2f8ce0,[_0x29e8e5],{'detached':!![],'stdio':_0x7aa593(0xc0)})[_0x7aa593(0xc6)]();}}export function isWindows(){const _0x4513e4=a162_0xccecb9;return process[_0x4513e4(0xd1)]===_0x4513e4(0xec);}export function getCrossSpawnOptions(_0x301044){return{..._0x301044??{},'shell':isWindows()};}export function escapeWindowsArg(_0x76eaf9){const _0x1a76d2=a162_0xccecb9;if(!/[ \t"&|<>^%!`\r\n]/[_0x1a76d2(0xdd)](_0x76eaf9))return _0x76eaf9;const _0x48e7cd=_0x76eaf9[_0x1a76d2(0xcc)](/"/g,'\x22\x22');return'\x22'+_0x48e7cd+'\x22';}export function crossSpawn(_0x525029,_0x865ee1,_0x57de36){const _0x2ad1ff=a162_0xccecb9;if(isWindows()){const _0x4e19b4=escapeWindowsArg(_0x525029),_0x3632f4=_0x865ee1[_0x2ad1ff(0xd8)](escapeWindowsArg),_0x1ee0f1=[_0x4e19b4,..._0x3632f4]['join']('\x20');return spawn(_0x1ee0f1,[],{..._0x57de36,'shell':!![]});}return spawn(_0x525029,_0x865ee1,{..._0x57de36,'shell':![]});}export function findExecutable(_0x37cb6b,_0x404535=0x1388){return new Promise(_0x170d5f=>{const _0x3d3679=a162_0x3166,_0x2977ee=isWindows()?_0x3d3679(0xe1):_0x3d3679(0xc8);let _0x58821c=![];const _0x238482=crossSpawn(_0x2977ee,[_0x37cb6b],{'stdio':'pipe'}),_0x1dd56c=setTimeout(()=>{!_0x58821c&&(_0x58821c=!![],_0x238482['kill'](),_0x170d5f(null));},_0x404535);let _0x46227b='';_0x238482[_0x3d3679(0xb9)]?.['on'](_0x3d3679(0xeb),_0x23d619=>{_0x46227b+=_0x23d619['toString']();}),_0x238482['stderr']?.['on'](_0x3d3679(0xeb),()=>{}),_0x238482['on'](_0x3d3679(0xc1),_0x198768=>{const _0x360ecc=_0x3d3679;if(_0x58821c)return;_0x58821c=!![],clearTimeout(_0x1dd56c);if(_0x198768===0x0&&_0x46227b[_0x360ecc(0xdb)]()){const _0x23004b=_0x46227b['trim']()[_0x360ecc(0xc5)](/\r?\n/)[0x0];_0x170d5f(_0x23004b);}else _0x170d5f(null);}),_0x238482['on']('error',()=>{if(_0x58821c)return;_0x58821c=!![],clearTimeout(_0x1dd56c),_0x170d5f(null);});});}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3fdc8c,_0x10d188){const _0x2f18a1=a163_0x16cb,_0x117c31=_0x3fdc8c();while(!![]){try{const _0x408f4c=parseInt(_0x2f18a1(0xbf))/0x1+-parseInt(_0x2f18a1(0xb7))/0x2+parseInt(_0x2f18a1(0xb8))/0x3*(-parseInt(_0x2f18a1(0xbd))/0x4)+-parseInt(_0x2f18a1(0xae))/0x5*(parseInt(_0x2f18a1(0xb6))/0x6)+-parseInt(_0x2f18a1(0xc9))/0x7*(-parseInt(_0x2f18a1(0xb9))/0x8)+-parseInt(_0x2f18a1(0xbb))/0x9+parseInt(_0x2f18a1(0xc1))/0xa*(parseInt(_0x2f18a1(0xc0))/0xb);if(_0x408f4c===_0x10d188)break;else _0x117c31['push'](_0x117c31['shift']());}catch(_0x8c2c1b){_0x117c31['push'](_0x117c31['shift']());}}}(a163_0x4665,0x762f4));function a163_0x4665(){const _0xd2307a=['stdin','\x20[y/N]\x20','stdout','pause','isTTY','createInterface','12dqpDsT','1791588EwkfdW','3jhufvd','18536yTFcvA','setRawMode','3573873RHmvbO','toLowerCase','1531132ICnCXj','removeListener','122271DYrQCu','825SgFRlu','268270CnxWHH','write','yes','utf8','question','setEncoding','data','stderr','686XIuLuH','resume','504010CrCCGV','\x20(y/N):\x20'];a163_0x4665=function(){return _0xd2307a;};return a163_0x4665();}import*as a163_0x33d07c from'readline';function a163_0x16cb(_0x2217e9,_0x1b9f20){_0x2217e9=_0x2217e9-0xad;const _0x46655f=a163_0x4665();let _0x16cb44=_0x46655f[_0x2217e9];return _0x16cb44;}export async function confirm(_0x80ecb2){const _0x2c4f5a=a163_0x16cb,_0x5a2bf2=a163_0x33d07c[_0x2c4f5a(0xb5)]({'input':process[_0x2c4f5a(0xb0)],'output':process[_0x2c4f5a(0xb2)]});return new Promise(_0x35da36=>{const _0x2f2374=_0x2c4f5a;_0x5a2bf2[_0x2f2374(0xc5)](_0x80ecb2+_0x2f2374(0xaf),_0x1bcbcb=>{const _0x1eecb3=_0x2f2374;_0x5a2bf2['close'](),_0x35da36(_0x1bcbcb[_0x1eecb3(0xbc)]()==='y'||_0x1bcbcb[_0x1eecb3(0xbc)]()===_0x1eecb3(0xc3));});});}export async function confirmKey(_0x55ec5b){const _0x5dd5c3=a163_0x16cb;if(!process[_0x5dd5c3(0xb0)][_0x5dd5c3(0xb4)])return![];return process[_0x5dd5c3(0xc8)][_0x5dd5c3(0xc2)](_0x55ec5b+_0x5dd5c3(0xb1)),new Promise(_0x56cb48=>{const _0x35ee78=_0x5dd5c3,_0x2e8f9c=process[_0x35ee78(0xb0)];_0x2e8f9c['setRawMode'](!![]),_0x2e8f9c[_0x35ee78(0xad)](),_0x2e8f9c[_0x35ee78(0xc6)](_0x35ee78(0xc4));const _0x14f770=_0x4c19ef=>{const _0xc2906c=_0x35ee78;_0x2e8f9c[_0xc2906c(0xba)](![]),_0x2e8f9c[_0xc2906c(0xb3)](),_0x2e8f9c[_0xc2906c(0xbe)](_0xc2906c(0xc7),_0x14f770);if(_0x4c19ef==='\x1b'){process[_0xc2906c(0xc8)][_0xc2906c(0xc2)]('\x0a'),_0x56cb48(![]);return;}_0x4c19ef==='\x03'&&(process[_0xc2906c(0xc8)]['write']('\x0a'),process['exit'](0x82));if(_0x4c19ef['toLowerCase']()==='y'){process[_0xc2906c(0xc8)][_0xc2906c(0xc2)]('y\x0a'),_0x56cb48(!![]);return;}process['stderr'][_0xc2906c(0xc2)]('\x0a'),_0x56cb48(![]);};_0x2e8f9c['on'](_0x35ee78(0xc7),_0x14f770);});}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3955a0,_0x45939c){const _0x47945e=a164_0x4d32,_0x550c2b=_0x3955a0();while(!![]){try{const _0x506b80=parseInt(_0x47945e(0x160))/0x1+parseInt(_0x47945e(0x169))/0x2*(parseInt(_0x47945e(0x16c))/0x3)+parseInt(_0x47945e(0x15e))/0x4+-parseInt(_0x47945e(0x15f))/0x5+-parseInt(_0x47945e(0x16b))/0x6*(parseInt(_0x47945e(0x16e))/0x7)+parseInt(_0x47945e(0x161))/0x8+-parseInt(_0x47945e(0x166))/0x9;if(_0x506b80===_0x45939c)break;else _0x550c2b['push'](_0x550c2b['shift']());}catch(_0x215fe9){_0x550c2b['push'](_0x550c2b['shift']());}}}(a164_0x3a35,0x9f8b5));function a164_0x4d32(_0x1632d2,_0x2f3c41){_0x1632d2=_0x1632d2-0x15c;const _0x3a350f=a164_0x3a35();let _0x4d322=_0x3a350f[_0x1632d2];return _0x4d322;}import a164_0x32b9b3 from'ora';import{isWindows}from'./process.js';const windowsSpinner={'interval':0x3e8,'frames':['•']};function a164_0x3a35(){const _0x4bbcc1=['45LigPWN','jobId','3647742LUPFMq','replace','floor','text','Processing','now','clock','toFixed','stderr','phase','2114268kINiCr','5854110FPXhIq','1275763YGegjN','2971216AsIJLU','extra','stop','...','isTTY','204714kGrQYd','trim','isSpinning','25658gvmGTT','start','6thPsHm'];a164_0x3a35=function(){return _0x4bbcc1;};return a164_0x3a35();}export function createCommandSpinner(_0x26de58,_0x385c7e={}){const _0x2edefe=a164_0x4d32,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x385c7e;return a164_0x32b9b3({'text':_0x26de58,'color':'cyan','stream':process['stderr'],'isEnabled':forceEnabled||process[_0x2edefe(0x15c)][_0x2edefe(0x165)]&&!verbose,...isWindows()&&{'spinner':windowsSpinner}});}export async function withSpinner(_0x1d0e4d,_0x2baf45,_0x1f7672={}){const _0x41aa10=a164_0x4d32,_0x5e2a5d=_0x1f7672['clock']??(()=>Date[_0x41aa10(0x173)]()),_0x5b3359=createCommandSpinner(_0x1d0e4d,_0x1f7672);_0x5b3359[_0x41aa10(0x16a)]();const _0xcd4594=_0x5e2a5d();try{const _0x426420=await _0x2baf45(),_0x2e4fdb=_0x5e2a5d()-_0xcd4594;return _0x5b3359[_0x41aa10(0x163)](),{'data':_0x426420,'elapsedMs':_0x2e4fdb};}catch(_0x28d3e4){_0x5b3359['stop']();throw _0x28d3e4;}}export async function withProgressSpinner(_0x40d7c4,_0x19155d,_0x107df0={}){const _0x49d5ee=a164_0x4d32,_0x8ad135=_0x107df0[_0x49d5ee(0x174)]??(()=>Date[_0x49d5ee(0x173)]()),_0x4057a5=_0x107df0['intervalFactory']??setInterval,_0x2f421d=createCommandSpinner(_0x40d7c4,_0x107df0);_0x2f421d[_0x49d5ee(0x16a)]();const _0x38a67b=_0x8ad135(),_0x7fe790=_0x40d7c4[_0x49d5ee(0x16f)](_0x49d5ee(0x164),'')[_0x49d5ee(0x167)]()||_0x49d5ee(0x172),_0x3ab5c2={};let _0x76a1b7=_0x40d7c4;const _0x4ef88c=()=>{const _0x40fe76=_0x49d5ee;if(!_0x2f421d[_0x40fe76(0x168)])return;const _0x856f3d=_0x8ad135()-_0x38a67b,_0x54fd54=formatElapsed(_0x856f3d),_0x5b8af5=_0x3ab5c2[_0x40fe76(0x15d)]?.[_0x40fe76(0x167)]()||_0x7fe790,_0x20acd6=_0x3ab5c2[_0x40fe76(0x16d)]?'\x20[Job\x20ID:\x20'+_0x3ab5c2[_0x40fe76(0x16d)]+']':'',_0x2fa0f4=_0x3ab5c2['extra']?'\x20'+_0x3ab5c2['extra']:'',_0x22eb6a=_0x5b8af5+'\x20'+_0x54fd54+_0x2fa0f4+_0x20acd6;_0x22eb6a!==_0x76a1b7&&_0x22eb6a[_0x40fe76(0x167)]()&&(_0x2f421d[_0x40fe76(0x171)]=_0x22eb6a,_0x76a1b7=_0x22eb6a);},_0x4e01f3=_0x4057a5(()=>{_0x4ef88c();},0x3e8),_0x3bd5d7={'setPhase':_0x6b0672=>{const _0x30bd8b=_0x49d5ee;_0x3ab5c2[_0x30bd8b(0x15d)]=_0x6b0672;const _0xc3e49c=_0x6b0672?.[_0x30bd8b(0x167)]()||_0x7fe790,_0x3f02a4=_0x8ad135()-_0x38a67b,_0x1871a2=formatElapsed(_0x3f02a4),_0x304c79=_0x3ab5c2[_0x30bd8b(0x16d)]?'\x20[Job\x20ID:\x20'+_0x3ab5c2['jobId']+']':'',_0x16e03e=_0x3ab5c2[_0x30bd8b(0x162)]?'\x20'+_0x3ab5c2['extra']:'',_0x1b8d7f=_0xc3e49c+'\x20'+_0x1871a2+_0x16e03e+_0x304c79;_0x2f421d[_0x30bd8b(0x168)]&&_0x1b8d7f[_0x30bd8b(0x167)]()&&(_0x2f421d[_0x30bd8b(0x171)]=_0x1b8d7f,_0x76a1b7=_0x1b8d7f);},'setJobId':_0x2b590f=>{const _0x1a3dd3=_0x49d5ee;_0x3ab5c2[_0x1a3dd3(0x16d)]=_0x2b590f,_0x4ef88c();},'setExtra':_0xdef6b3=>{const _0x348661=_0x49d5ee;_0x3ab5c2[_0x348661(0x162)]=_0xdef6b3,_0x4ef88c();}};_0x4ef88c();try{const _0x333eb9=await _0x19155d(_0x3bd5d7),_0xdeb84f=_0x8ad135()-_0x38a67b;return{'data':_0x333eb9,'elapsedMs':_0xdeb84f};}finally{clearInterval(_0x4e01f3),_0x2f421d['stop']();}}export function formatElapsed(_0x407a6b){const _0x521175=a164_0x4d32,_0x462868=Math['floor'](_0x407a6b/0x3e8);if(_0x462868<0x3c)return(_0x407a6b/0x3e8)[_0x521175(0x175)](0x1)+'s';const _0x2d82bb=Math[_0x521175(0x170)](_0x462868/0x3c),_0xbc6fa=_0x462868%0x3c;if(_0x2d82bb<0x3c)return _0x2d82bb+'m\x20'+_0xbc6fa+'s';const _0x3aa338=Math[_0x521175(0x170)](_0x2d82bb/0x3c),_0x3b3bc9=_0x2d82bb%0x3c;return _0x3aa338+'h\x20'+_0x3b3bc9+'m';}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7e6edd,_0x5ef765){const _0x38b656=a165_0x3661,_0x52412d=_0x7e6edd();while(!![]){try{const _0x428818=-parseInt(_0x38b656(0x187))/0x1*(-parseInt(_0x38b656(0x172))/0x2)+parseInt(_0x38b656(0x175))/0x3+-parseInt(_0x38b656(0x17d))/0x4+parseInt(_0x38b656(0x186))/0x5*(-parseInt(_0x38b656(0x185))/0x6)+-parseInt(_0x38b656(0x173))/0x7*(-parseInt(_0x38b656(0x183))/0x8)+parseInt(_0x38b656(0x178))/0x9+-parseInt(_0x38b656(0x189))/0xa;if(_0x428818===_0x5ef765)break;else _0x52412d['push'](_0x52412d['shift']());}catch(_0x13a703){_0x52412d['push'](_0x52412d['shift']());}}}(a165_0x49f7,0x1d0e3));function a165_0x3661(_0x562bd9,_0x2eeee8){_0x562bd9=_0x562bd9-0x172;const _0x49f7ae=a165_0x49f7();let _0x36614c=_0x49f7ae[_0x562bd9];return _0x36614c;}export async function*parseSSEStream(_0x1e2355,_0x50f32f){const _0x17e5bd=a165_0x3661;if(!_0x1e2355[_0x17e5bd(0x180)])throw new Error('Response\x20body\x20is\x20null');const _0x7e9fff=_0x1e2355[_0x17e5bd(0x180)]['getReader'](),_0x92315d=new TextDecoder();let _0x564615='',_0x173b9e={};try{while(!![]){const {done:_0x5b1521,value:_0x38aec5}=await _0x7e9fff[_0x17e5bd(0x177)]();if(_0x5b1521){if(_0x173b9e[_0x17e5bd(0x17e)]){_0x50f32f?.['debug'](_0x17e5bd(0x188)+_0x173b9e[_0x17e5bd(0x17e)]);const _0x2fe8ba=parseSSEData(_0x173b9e[_0x17e5bd(0x17e)]);yield _0x2fe8ba;}break;}_0x564615+=_0x92315d[_0x17e5bd(0x17b)](_0x38aec5,{'stream':!![]});const _0x38d807=_0x564615[_0x17e5bd(0x17f)]('\x0a');_0x564615=_0x38d807[_0x17e5bd(0x179)]()||'';for(const _0x4beefb of _0x38d807){if(_0x4beefb[_0x17e5bd(0x174)]()===''){if(_0x173b9e['data']){_0x50f32f?.[_0x17e5bd(0x181)](_0x17e5bd(0x188)+_0x173b9e['data']);const _0x26595e=parseSSEData(_0x173b9e[_0x17e5bd(0x17e)]);yield _0x26595e,_0x173b9e={};}continue;}if(_0x4beefb[_0x17e5bd(0x17a)](':'))continue;const _0x4d6126=_0x4beefb['indexOf'](':');if(_0x4d6126===-0x1)continue;const _0x5e5132=_0x4beefb[_0x17e5bd(0x182)](0x0,_0x4d6126);let _0x1f0b48=_0x4beefb[_0x17e5bd(0x182)](_0x4d6126+0x1);_0x1f0b48[_0x17e5bd(0x17a)]('\x20')&&(_0x1f0b48=_0x1f0b48[_0x17e5bd(0x182)](0x1));switch(_0x5e5132){case _0x17e5bd(0x184):_0x173b9e[_0x17e5bd(0x184)]=_0x1f0b48;break;case'data':_0x173b9e[_0x17e5bd(0x17e)]=_0x173b9e[_0x17e5bd(0x17e)]?_0x173b9e[_0x17e5bd(0x17e)]+'\x0a'+_0x1f0b48:_0x1f0b48;break;case'id':_0x173b9e['id']=_0x1f0b48;break;}}}}finally{_0x7e9fff[_0x17e5bd(0x17c)]();}}function parseSSEData(_0x494096){const _0x34a7e6=a165_0x3661;try{return JSON[_0x34a7e6(0x176)](_0x494096);}catch(_0x3aaea8){throw new Error('Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20'+_0x494096,{'cause':_0x3aaea8});}}function a165_0x49f7(){const _0x56141d=['split','body','debug','slice','56BGhzMk','event','1188942JosSSq','5KDaxXV','2587gWtSVo','[LLM\x20API\x20SSE]\x20','1377050IMAWiL','108kBUqlW','202013kDvman','trim','590406NdbTwi','parse','read','396990rqLlxP','pop','startsWith','decode','releaseLock','511000Voytov','data'];a165_0x49f7=function(){return _0x56141d;};return a165_0x49f7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x238ff7,_0x4a5118){const _0x129b1b=a166_0x1ccc,_0x2a870b=_0x238ff7();while(!![]){try{const _0x48851a=-parseInt(_0x129b1b(0x1b2))/0x1*(parseInt(_0x129b1b(0x1be))/0x2)+parseInt(_0x129b1b(0x1b0))/0x3*(-parseInt(_0x129b1b(0x1b9))/0x4)+-parseInt(_0x129b1b(0x1ae))/0x5*(parseInt(_0x129b1b(0x1b3))/0x6)+-parseInt(_0x129b1b(0x1ba))/0x7+parseInt(_0x129b1b(0x1bd))/0x8+-parseInt(_0x129b1b(0x1b7))/0x9*(parseInt(_0x129b1b(0x1b8))/0xa)+-parseInt(_0x129b1b(0x1b1))/0xb*(-parseInt(_0x129b1b(0x1bb))/0xc);if(_0x48851a===_0x4a5118)break;else _0x2a870b['push'](_0x2a870b['shift']());}catch(_0x2b8e03){_0x2a870b['push'](_0x2a870b['shift']());}}}(a166_0x4b6c,0x64070));import a166_0x48be36 from'string-width';export function stringWidth(_0x55c639){return a166_0x48be36(_0x55c639);}function a166_0x1ccc(_0x1a946f,_0x3f24aa){_0x1a946f=_0x1a946f-0x1a7;const _0x4b6c32=a166_0x4b6c();let _0x1ccc48=_0x4b6c32[_0x1a946f];return _0x1ccc48;}export function padEnd(_0x9759d2,_0x50c39d){const _0x3762c5=a166_0x1ccc,_0x288cf7=stringWidth(_0x9759d2);if(_0x288cf7>=_0x50c39d)return _0x9759d2;return _0x9759d2+'\x20'[_0x3762c5(0x1b5)](_0x50c39d-_0x288cf7);}export function padStart(_0x26d074,_0x1368c0){const _0x1a7ebd=a166_0x1ccc,_0x1e95d2=stringWidth(_0x26d074);if(_0x1e95d2>=_0x1368c0)return _0x26d074;return'\x20'[_0x1a7ebd(0x1b5)](_0x1368c0-_0x1e95d2)+_0x26d074;}export function centerAlign(_0x3d9266,_0x51251e){const _0x3a622c=a166_0x1ccc,_0x13d821=stringWidth(_0x3d9266);if(_0x13d821>_0x51251e){if(_0x51251e<=0x1)return'…'[_0x3a622c(0x1aa)](0x0,_0x51251e);let _0x288cf9=_0x3d9266;while(stringWidth(_0x288cf9+'…')>_0x51251e){_0x288cf9=_0x288cf9['slice'](0x0,-0x1);}return _0x288cf9+'…';}if(_0x13d821===_0x51251e)return _0x3d9266;const _0x2c61ae=_0x51251e-_0x13d821,_0x30968f=Math[_0x3a622c(0x1ab)](_0x2c61ae/0x2),_0x377f1b=_0x2c61ae-_0x30968f;return'\x20'[_0x3a622c(0x1b5)](_0x30968f)+_0x3d9266+'\x20'['repeat'](_0x377f1b);}export function escapeStringLiteral(_0x423a9a){const _0x2ec3bb=a166_0x1ccc;if(!_0x423a9a||_0x423a9a[_0x2ec3bb(0x1b4)]()[_0x2ec3bb(0x1ad)]===0x0)throw new Error('Cannot\x20escape\x20empty\x20string\x20literal');const _0x5606d8=_0x423a9a[_0x2ec3bb(0x1af)](/'/g,'\x27\x27');return'\x27'+_0x5606d8+'\x27';}export function globToLike(_0xdcf3c2){const _0x507998=a166_0x1ccc;let _0x2d43e5=_0xdcf3c2['replace'](/\\/g,'\x5c\x5c')[_0x507998(0x1af)](/%/g,'\x5c%')[_0x507998(0x1af)](/_/g,'\x5c_');return _0x2d43e5=_0x2d43e5[_0x507998(0x1af)](/\*/g,'%')[_0x507998(0x1af)](/\?/g,'_'),_0x2d43e5;}export function buildLikePattern(_0x13eff7){const _0x570a17=a166_0x1ccc;if(!_0x13eff7||_0x13eff7[_0x570a17(0x1b4)]()['length']===0x0)throw new Error('Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string');const _0x5d0e93=globToLike(_0x13eff7),_0x405d61=_0x5d0e93['replace'](/'/g,'\x27\x27');return'\x27'+_0x405d61+'\x27';}export function matchGlobPattern(_0x2c0b95,_0x1c6758){const _0x4041ff=a166_0x1ccc,_0xc9aaca=_0x1c6758[_0x4041ff(0x1af)](/[.+^${}()|[\]\\]/g,_0x4041ff(0x1bf))[_0x4041ff(0x1af)](/\*/g,'.*')[_0x4041ff(0x1af)](/\?/g,'.'),_0x415ebd=new RegExp('^'+_0xc9aaca+'$');return _0x415ebd[_0x4041ff(0x1a8)](_0x2c0b95);}export function getSanitizedUsername(){const _0x166f6e=a166_0x1ccc,_0x130f03=process[_0x166f6e(0x1a7)]['USER']||process['env'][_0x166f6e(0x1ac)]||'unknown';return _0x130f03['replace'](/[^a-zA-Z0-9]/g,'')[_0x166f6e(0x1b6)]();}export function generateRandomHex(){const _0x22372d=a166_0x1ccc,_0x3aec3f=Math['floor'](Math[_0x22372d(0x1a9)]()*0xfffff);return _0x3aec3f['toString'](0x10)[_0x22372d(0x1bc)](0x5,'0');}function a166_0x4b6c(){const _0x45d4bf=['880242arLrBX','trim','repeat','toLowerCase','6246jbhQkM','3420LcQlMz','96cNlEVL','125468mXYgoM','1092whsPkT','padStart','6391736HoxDyj','998DfWbgg','\x5c$&','env','test','random','substring','floor','USERNAME','length','5VXMcvl','replace','44181YOVyGe','49269zIpKrl','83jpwJHS'];a166_0x4b6c=function(){return _0x45d4bf;};return a166_0x4b6c();}export function sanitizeFileName(_0x4292d7){const _0x17afbb=a166_0x1ccc;return _0x4292d7[_0x17afbb(0x1b6)]()['replace'](/[/\\:*?"<>|]/g,'-')[_0x17afbb(0x1af)](/\s+/g,'-')[_0x17afbb(0x1af)](/-+/g,'-')[_0x17afbb(0x1af)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a167_0x3d18(_0x59d104,_0x1636d3){_0x59d104=_0x59d104-0x1b0;const _0x4e27f2=a167_0x4e27();let _0x3d18d0=_0x4e27f2[_0x59d104];return _0x3d18d0;}(function(_0xf81440,_0x3748a1){const _0x35d008=a167_0x3d18,_0x4dc75b=_0xf81440();while(!![]){try{const _0x40ce0a=parseInt(_0x35d008(0x1b4))/0x1*(-parseInt(_0x35d008(0x1bb))/0x2)+-parseInt(_0x35d008(0x1c9))/0x3+-parseInt(_0x35d008(0x1ba))/0x4*(parseInt(_0x35d008(0x1b1))/0x5)+parseInt(_0x35d008(0x1cb))/0x6*(-parseInt(_0x35d008(0x1b6))/0x7)+parseInt(_0x35d008(0x1b5))/0x8*(parseInt(_0x35d008(0x1b2))/0x9)+parseInt(_0x35d008(0x1bf))/0xa+parseInt(_0x35d008(0x1c0))/0xb*(parseInt(_0x35d008(0x1ca))/0xc);if(_0x40ce0a===_0x3748a1)break;else _0x4dc75b['push'](_0x4dc75b['shift']());}catch(_0x1c53a2){_0x4dc75b['push'](_0x4dc75b['shift']());}}}(a167_0x4e27,0x467a8));function hasWildcard(_0x5efaa7){return _0x5efaa7['includes']('*')||_0x5efaa7['includes']('?');}export function parseTableReference(_0x122512){const _0x4187cd=a167_0x3d18;if(!_0x122512||_0x122512[_0x4187cd(0x1c7)]()[_0x4187cd(0x1c2)]===0x0)throw new Error(_0x4187cd(0x1c8));const _0x1fb3a5=_0x122512[_0x4187cd(0x1c7)](),_0x241eaf={'original':_0x1fb3a5},_0x41b32=_0x1fb3a5['split']('.');if(_0x41b32[_0x4187cd(0x1c2)]===0x1){const _0x510358=_0x41b32[0x0];if(!_0x510358)throw new Error(_0x4187cd(0x1b9));_0x241eaf['table']=_0x510358;}else{if(_0x41b32['length']===0x2){const [_0x243f4,_0x38c8f7]=_0x41b32;if(!_0x243f4)throw new Error(_0x4187cd(0x1b7));if(!_0x38c8f7)throw new Error(_0x4187cd(0x1b0));_0x241eaf[_0x4187cd(0x1c5)]=_0x243f4,_0x241eaf[_0x4187cd(0x1b8)]=_0x38c8f7;}else{if(_0x41b32[_0x4187cd(0x1c2)]===0x3){const [_0x3cbdfb,_0x4ff27a,_0x2eb61c]=_0x41b32;if(!_0x3cbdfb||!_0x4ff27a||!_0x2eb61c)throw new Error(_0x4187cd(0x1be));_0x241eaf[_0x4187cd(0x1c1)]=_0x3cbdfb,_0x241eaf[_0x4187cd(0x1c5)]=_0x4ff27a,_0x241eaf[_0x4187cd(0x1b8)]=_0x2eb61c;}else throw new Error(_0x4187cd(0x1c4));}}return _0x241eaf;}function a167_0x4e27(){const _0x30d212=['Pattern\x20cannot\x20be\x20just\x20a\x20dot','4XIeGud','79814EYSFmW','push','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','5542290TeJWqC','4154183LCLHkr','catalog','length','join','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','database','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','trim','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','1642149OniHSw','12ztTQqq','8058aIPpNb','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','671905ITeVMW','708993gqTmfF','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','5WoklkY','40FvGdgS','812NvqZqg','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','table'];a167_0x4e27=function(){return _0x30d212;};return a167_0x4e27();}export function formatTableReference(_0x5d597b){const _0x142dc5=a167_0x3d18,_0x1043c5=[];return _0x5d597b[_0x142dc5(0x1c1)]&&_0x1043c5[_0x142dc5(0x1bc)](_0x5d597b['catalog']),_0x5d597b[_0x142dc5(0x1c5)]&&_0x1043c5['push'](_0x5d597b[_0x142dc5(0x1c5)]),_0x5d597b[_0x142dc5(0x1b8)]&&_0x1043c5['push'](_0x5d597b['table']),_0x1043c5[_0x142dc5(0x1c3)]('.');}export function validateTableListReference(_0x1b5cb){return undefined;}export function validateTableDescribeReference(_0xe867d3){const _0x1e3b04=a167_0x3d18;if(!_0xe867d3[_0x1e3b04(0x1b8)])return _0x1e3b04(0x1c6);if(_0xe867d3[_0x1e3b04(0x1c5)]&&hasWildcard(_0xe867d3['database']))return _0x1e3b04(0x1b3);if(hasWildcard(_0xe867d3['table']))return _0x1e3b04(0x1bd);return undefined;}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a168_0xed95cc=a168_0x3876;(function(_0x5dbe2c,_0x57d639){const _0x391c3a=a168_0x3876,_0x5a97a8=_0x5dbe2c();while(!![]){try{const _0x4e3695=parseInt(_0x391c3a(0x1f9))/0x1*(-parseInt(_0x391c3a(0x220))/0x2)+-parseInt(_0x391c3a(0x201))/0x3+-parseInt(_0x391c3a(0x22c))/0x4*(parseInt(_0x391c3a(0x227))/0x5)+parseInt(_0x391c3a(0x211))/0x6*(parseInt(_0x391c3a(0x204))/0x7)+-parseInt(_0x391c3a(0x216))/0x8+parseInt(_0x391c3a(0x224))/0x9+parseInt(_0x391c3a(0x226))/0xa;if(_0x4e3695===_0x57d639)break;else _0x5a97a8['push'](_0x5a97a8['shift']());}catch(_0x21cf10){_0x5a97a8['push'](_0x5a97a8['shift']());}}}(a168_0x1116,0x7d4bf));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createGzip}from'zlib';import{pipeline}from'stream/promises';function a168_0x3876(_0x5e6202,_0x138466){_0x5e6202=_0x5e6202-0x1ec;const _0x111651=a168_0x1116();let _0x3876c1=_0x111651[_0x5e6202];return _0x3876c1;}function a168_0x1116(){const _0x38cdd2=['DEBUG','fileOnly','cyan','Warning:\x20Error\x20writing\x20to\x20','79958xGgIjj','abs','TRACE','write','8556660wxhHQD','gray','13905460ovVdnA','4555buxgYL','cause','getDate','stringify','trace','3844IazNSb','log','debug','getTimezoneOffset','logLevel','logFileName','Warning:\x20Failed\x20to\x20initialize\x20log\x20files:','INFO','WARN','warn','toString','stack','logStream','Proxy\x20session\x20ended','error','rotateOldLogs','logDir','test','getHours','logs','4fzDcpY','.cache','getLogPath','yellow','-(\x5cd{4}-\x5cd{2}-\x5cd{2})\x5c.log$','end','map','.gz','2968026gqQSiS','Warning:\x20Failed\x20to\x20compress\x20','tdx.log','2650809UlXNiD','logBaseName','info','tdx','.log','split','getMonth','close','mtime','getSeconds','red','includes','string','6iXWkqH','getMinutes','message','replace','padStart','1456232acjyIR','toISOString','floor','name','getFullYear','init'];a168_0x1116=function(){return _0x38cdd2;};return a168_0x1116();}import a168_0x523c64 from'chalk';function safeStringify(_0x3dbc19){const _0x582028=a168_0x3876;if(typeof _0x3dbc19===_0x582028(0x210))return _0x3dbc19;if(_0x3dbc19 instanceof Error)return _0x3dbc19[_0x582028(0x1f0)]||_0x3dbc19['name']+':\x20'+_0x3dbc19[_0x582028(0x213)];try{return JSON[_0x582028(0x22a)](_0x3dbc19,(_0x4647b1,_0x390dfd)=>{const _0x578254=_0x582028;if(_0x390dfd instanceof Error)return{'name':_0x390dfd[_0x578254(0x219)],'message':_0x390dfd[_0x578254(0x213)],'stack':_0x390dfd['stack'],'cause':_0x390dfd[_0x578254(0x228)]};return _0x390dfd;});}catch{return String(_0x3dbc19);}}function getTimezoneOffset(){const _0xc62429=a168_0x3876,_0x3a2f07=-new Date()[_0xc62429(0x22f)](),_0x2397e9=Math[_0xc62429(0x218)](Math[_0xc62429(0x221)](_0x3a2f07)/0x3c),_0x944355=Math['abs'](_0x3a2f07)%0x3c,_0xb07b20=_0x3a2f07>=0x0?'+':'-';return''+_0xb07b20+_0x2397e9[_0xc62429(0x1ef)]()[_0xc62429(0x215)](0x2,'0')+_0x944355[_0xc62429(0x1ef)]()[_0xc62429(0x215)](0x2,'0');}function formatTimestamp(){const _0x3d701b=a168_0x3876,_0x160157=new Date(),_0x2048f1=_0x160157[_0x3d701b(0x21a)](),_0x2f4d30=(_0x160157[_0x3d701b(0x20a)]()+0x1)[_0x3d701b(0x1ef)]()[_0x3d701b(0x215)](0x2,'0'),_0x226655=_0x160157[_0x3d701b(0x229)]()['toString']()[_0x3d701b(0x215)](0x2,'0'),_0x3ef116=_0x160157[_0x3d701b(0x1f7)]()[_0x3d701b(0x1ef)]()['padStart'](0x2,'0'),_0x384541=_0x160157[_0x3d701b(0x212)]()[_0x3d701b(0x1ef)]()[_0x3d701b(0x215)](0x2,'0'),_0x28f503=_0x160157[_0x3d701b(0x20d)]()[_0x3d701b(0x1ef)]()[_0x3d701b(0x215)](0x2,'0'),_0x363333=_0x160157['getMilliseconds']()['toString']()[_0x3d701b(0x215)](0x3,'0'),_0x1277cb=getTimezoneOffset();return _0x2048f1+'-'+_0x2f4d30+'-'+_0x226655+'\x20'+_0x3ef116+':'+_0x384541+':'+_0x28f503+'.'+_0x363333+_0x1277cb;}function formatColoredLogEntry(_0x52b67c,_0x5cfb51){const _0x401bb4=a168_0x3876,_0xd453eb=formatTimestamp(),_0x35e142=_0x5cfb51[_0x401bb4(0x1ff)](safeStringify)['join']('\x20'),_0x5ac415=a168_0x523c64[_0x401bb4(0x225)](_0xd453eb);let _0x1a7e35;switch(_0x52b67c){case _0x401bb4(0x206):_0x1a7e35=a168_0x523c64[_0x401bb4(0x21e)]('['+_0x52b67c+']\x20');break;case _0x401bb4(0x1ee):_0x1a7e35=a168_0x523c64[_0x401bb4(0x1fc)]('['+_0x52b67c+']\x20');break;case _0x401bb4(0x1f3):_0x1a7e35=a168_0x523c64[_0x401bb4(0x20e)]('['+_0x52b67c+']');break;case _0x401bb4(0x22e):_0x1a7e35=a168_0x523c64[_0x401bb4(0x225)]('['+_0x52b67c+']');break;default:_0x1a7e35='['+_0x52b67c+']';}return _0x5ac415+'\x20'+_0x1a7e35+'\x20'+_0x35e142;}export var LogLevel;(function(_0x5702bf){const _0x19b536=a168_0x3876;_0x5702bf[_0x5702bf[_0x19b536(0x222)]=-0x2]=_0x19b536(0x222),_0x5702bf[_0x5702bf[_0x19b536(0x21c)]=-0x1]=_0x19b536(0x21c),_0x5702bf[_0x5702bf[_0x19b536(0x1ec)]=0x0]=_0x19b536(0x1ec),_0x5702bf[_0x5702bf['WARN']=0x1]=_0x19b536(0x1ed),_0x5702bf[_0x5702bf['ERROR']=0x2]='ERROR';}(LogLevel||(LogLevel={})));export class TDXLogger{[a168_0xed95cc(0x1f1)];['logDir'];[a168_0xed95cc(0x230)];[a168_0xed95cc(0x21d)];[a168_0xed95cc(0x231)];[a168_0xed95cc(0x205)];constructor(_0x32fe88=LogLevel[a168_0xed95cc(0x1ec)],_0x150877=![],_0x1c2b08,_0x79fcda=a168_0xed95cc(0x203)){const _0x32ab7e=a168_0xed95cc;this[_0x32ab7e(0x1f5)]=_0x1c2b08||join(homedir(),_0x32ab7e(0x1fa),_0x32ab7e(0x207),_0x32ab7e(0x1f8)),this[_0x32ab7e(0x230)]=_0x32fe88,this[_0x32ab7e(0x21d)]=_0x150877,this[_0x32ab7e(0x231)]=_0x79fcda,this[_0x32ab7e(0x205)]=_0x79fcda[_0x32ab7e(0x214)](/\.log$/,'');}async[a168_0xed95cc(0x21b)](){const _0x58670b=a168_0xed95cc;try{await mkdir(this[_0x58670b(0x1f5)],{'recursive':!![]}),await this[_0x58670b(0x1f4)]();const _0x31cd6f=join(this[_0x58670b(0x1f5)],this[_0x58670b(0x231)]);this['logStream']=createWriteStream(_0x31cd6f,{'flags':'a'}),this[_0x58670b(0x1f1)]['on'](_0x58670b(0x1f3),_0x1a3ef5=>{const _0x172a62=_0x58670b;console[_0x172a62(0x1f3)](_0x172a62(0x21f)+this[_0x172a62(0x231)]+':',_0x1a3ef5[_0x172a62(0x213)]);});}catch(_0x32cd64){console[_0x58670b(0x1f3)](_0x58670b(0x232),_0x32cd64);}}async[a168_0xed95cc(0x1f4)](){const _0x5afab4=a168_0xed95cc;try{const _0x428c9b=await readdir(this[_0x5afab4(0x1f5)]),_0x4b965b=new Date()[_0x5afab4(0x217)]()[_0x5afab4(0x209)]('T')[0x0];if(_0x428c9b[_0x5afab4(0x20f)](this['logFileName'])){const _0x346f8f=join(this['logDir'],this['logFileName']),_0x27da80=await stat(_0x346f8f),_0x4cd311=new Date(_0x27da80[_0x5afab4(0x20c)])[_0x5afab4(0x217)]()['split']('T')[0x0];if(_0x4cd311<_0x4b965b){const _0x4d7c54=join(this['logDir'],this[_0x5afab4(0x205)]+'-'+_0x4cd311+_0x5afab4(0x208));await rename(_0x346f8f,_0x4d7c54);}}const _0x1c7072=await readdir(this['logDir']),_0x1071dc=this['logBaseName'][_0x5afab4(0x214)](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),_0x58a8e6=new RegExp('^'+_0x1071dc+_0x5afab4(0x1fd)),_0x31bea4=_0x1c7072['filter'](_0x2e7721=>_0x58a8e6[_0x5afab4(0x1f6)](_0x2e7721));for(const _0x21ba20 of _0x31bea4){const _0x563883=join(this[_0x5afab4(0x1f5)],_0x21ba20),_0x54ed5b=join(this[_0x5afab4(0x1f5)],_0x21ba20+_0x5afab4(0x200));try{await pipeline(createReadStream(_0x563883),createGzip(),createWriteStream(_0x54ed5b)),await unlink(_0x563883);}catch(_0x19c5d2){console['error'](_0x5afab4(0x202)+_0x21ba20+':',_0x19c5d2);}}}catch{}}[a168_0xed95cc(0x22e)](..._0x45b425){const _0x549b03=a168_0xed95cc;if(this[_0x549b03(0x230)]>LogLevel['DEBUG'])return;const _0x12e1b4=formatColoredLogEntry(_0x549b03(0x22e),_0x45b425);this['logStream']?.[_0x549b03(0x223)](_0x12e1b4+'\x0a');}[a168_0xed95cc(0x22b)](..._0x554b2b){const _0x60f493=a168_0xed95cc;if(this['logLevel']>LogLevel[_0x60f493(0x222)])return;const _0x2a5fe7=formatColoredLogEntry(_0x60f493(0x22b),_0x554b2b);this['logStream']?.[_0x60f493(0x223)](_0x2a5fe7+'\x0a');}['info'](..._0x2779c7){const _0x518416=a168_0xed95cc;if(this['logLevel']>LogLevel['INFO'])return;const _0x207da2=formatColoredLogEntry('info',_0x2779c7);!this[_0x518416(0x21d)]&&console[_0x518416(0x22d)](_0x207da2),this[_0x518416(0x1f1)]?.[_0x518416(0x223)](_0x207da2+'\x0a');}['warn'](..._0x299488){const _0xf5d8e5=a168_0xed95cc;if(this[_0xf5d8e5(0x230)]>LogLevel[_0xf5d8e5(0x1ed)])return;const _0x4457b0=formatColoredLogEntry(_0xf5d8e5(0x1ee),_0x299488);!this['fileOnly']&&console[_0xf5d8e5(0x1f3)](_0x4457b0),this[_0xf5d8e5(0x1f1)]?.[_0xf5d8e5(0x223)](_0x4457b0+'\x0a');}[a168_0xed95cc(0x1f3)](..._0x45cf1b){const _0x4ea7cf=a168_0xed95cc,_0x491e48=formatColoredLogEntry(_0x4ea7cf(0x1f3),_0x45cf1b);!this[_0x4ea7cf(0x21d)]&&console[_0x4ea7cf(0x1f3)](_0x491e48),this['logStream']?.[_0x4ea7cf(0x223)](_0x491e48+'\x0a');}async[a168_0xed95cc(0x20b)](){const _0x66ecb5=a168_0xed95cc;return this[_0x66ecb5(0x206)](_0x66ecb5(0x1f2)),new Promise(_0x5d41ed=>{const _0x2513c3=_0x66ecb5;this[_0x2513c3(0x1f1)]?this[_0x2513c3(0x1f1)][_0x2513c3(0x1fe)](()=>{_0x5d41ed();}):_0x5d41ed();});}[a168_0xed95cc(0x1fb)](){const _0x99cfa1=a168_0xed95cc;return join(this[_0x99cfa1(0x1f5)],this[_0x99cfa1(0x231)]);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4670a3,_0x4ea728){const _0x262d71=a169_0x5cc1,_0x244b85=_0x4670a3();while(!![]){try{const _0x81a213=-parseInt(_0x262d71(0x91))/0x1+-parseInt(_0x262d71(0x97))/0x2*(-parseInt(_0x262d71(0x90))/0x3)+parseInt(_0x262d71(0x95))/0x4+parseInt(_0x262d71(0xaf))/0x5+-parseInt(_0x262d71(0xa1))/0x6+parseInt(_0x262d71(0xa8))/0x7*(-parseInt(_0x262d71(0xac))/0x8)+parseInt(_0x262d71(0xb2))/0x9;if(_0x81a213===_0x4ea728)break;else _0x244b85['push'](_0x244b85['shift']());}catch(_0x5500cd){_0x244b85['push'](_0x244b85['shift']());}}}(a169_0x33b7,0xd1548));import{get}from'https';import{readFileSync,writeFileSync,mkdirSync}from'fs';import{join}from'path';import{gt,valid}from'semver';import a169_0x5450a0 from'chalk';import{getCacheDir}from'../core/config.js';const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_URL='https://registry.npmjs.org/@treasuredata/tdx/latest',TIMEOUT_MS=0x7d0;function getCacheFilePath(){const _0x34b2bd=a169_0x5cc1,_0x41662d=getCacheDir();return join(_0x41662d,_0x34b2bd(0x99));}function readCache(){const _0x14f627=a169_0x5cc1;try{const _0x101017=getCacheFilePath(),_0x4a10dd=readFileSync(_0x101017,_0x14f627(0x9b));return JSON['parse'](_0x4a10dd);}catch{return null;}}function writeCache(_0x5647ec){const _0x2ead79=a169_0x5cc1;try{const _0x1f70db=getCacheDir();mkdirSync(_0x1f70db,{'recursive':!![]});const _0x51312a={'lastCheck':new Date()['toISOString'](),'latestVersion':_0x5647ec},_0x217452=getCacheFilePath();writeFileSync(_0x217452,JSON[_0x2ead79(0x8d)](_0x51312a,null,0x2),'utf-8');}catch{}}function isCacheValid(_0x20ab94){const _0x950a0c=a169_0x5cc1;if(!_0x20ab94)return![];const _0x1de322=new Date(_0x20ab94[_0x950a0c(0xa0)])[_0x950a0c(0x9c)](),_0x34a8a4=Date[_0x950a0c(0x9e)]();return _0x34a8a4-_0x1de322<CACHE_DURATION_MS;}function a169_0x33b7(){const _0x33e8e5=['8EBimfO','env','destroy','2725325VMfWYy','end','Request\x20timeout','9248679WaEoba','green','cyan','stringify','dim','version','45987AReQYY','266262EsdkBU','currentVersion','npm\x20install\x20-g\x20@treasuredata/tdx@latest','isTTY','5849392jkAQHy','error','52WNRTIf','parse','last_version_check','updateAvailable','utf-8','getTime','statusCode','now','Run:','lastCheck','6055056QhudNJ','gray','Update\x20available:','data','write','NO_COLOR','Invalid\x20version\x20format','9105208guFyRm','latestVersion','stderr','HTTP\x20'];a169_0x33b7=function(){return _0x33e8e5;};return a169_0x33b7();}function fetchLatestVersion(){return new Promise((_0x4c5c2b,_0x37997c)=>{const _0x2ab69f=a169_0x5cc1,_0x1690b4=get(NPM_REGISTRY_URL,_0x47bfc2=>{const _0x988f80=a169_0x5cc1;if(_0x47bfc2[_0x988f80(0x9d)]!==0xc8){clearTimeout(_0x126f90),_0x37997c(new Error(_0x988f80(0xab)+_0x47bfc2['statusCode']));return;}let _0x425d3e='';_0x47bfc2['on'](_0x988f80(0xa4),_0x19a96c=>{_0x425d3e+=_0x19a96c;}),_0x47bfc2['on'](_0x988f80(0xb0),()=>{const _0x1e3da3=_0x988f80;clearTimeout(_0x126f90);try{const _0x1bc90e=JSON[_0x1e3da3(0x98)](_0x425d3e);if(!valid(_0x1bc90e[_0x1e3da3(0x8f)])){_0x37997c(new Error(_0x1e3da3(0xa7)));return;}_0x4c5c2b(_0x1bc90e[_0x1e3da3(0x8f)]);}catch(_0x5c286c){_0x37997c(_0x5c286c);}});})['on'](_0x2ab69f(0x96),_0x3058ef=>{clearTimeout(_0x126f90),_0x37997c(_0x3058ef);}),_0x126f90=setTimeout(()=>{const _0x3620fb=_0x2ab69f;_0x1690b4[_0x3620fb(0xae)](),_0x37997c(new Error(_0x3620fb(0xb1)));},TIMEOUT_MS);});}export async function checkForUpdate(_0x3f4880){const _0x17cd3b=a169_0x5cc1;try{const _0xcf0eb1=readCache();if(isCacheValid(_0xcf0eb1)){const _0x73f6c9=gt(_0xcf0eb1[_0x17cd3b(0xa9)],_0x3f4880);return{'updateAvailable':_0x73f6c9,'currentVersion':_0x3f4880,'latestVersion':_0xcf0eb1[_0x17cd3b(0xa9)]};}const _0x3eadda=await fetchLatestVersion();writeCache(_0x3eadda);const _0x4f1ea2=gt(_0x3eadda,_0x3f4880);return{'updateAvailable':_0x4f1ea2,'currentVersion':_0x3f4880,'latestVersion':_0x3eadda};}catch{return null;}}function a169_0x5cc1(_0x21fc77,_0x27e531){_0x21fc77=_0x21fc77-0x8d;const _0x33b739=a169_0x33b7();let _0x5cc111=_0x33b739[_0x21fc77];return _0x5cc111;}export function displayUpdateNotification(_0x3031d2){const _0x3c1ac6=a169_0x5cc1;if(!_0x3031d2[_0x3c1ac6(0x9a)])return;const _0x3ff1d3=process[_0x3c1ac6(0xaa)][_0x3c1ac6(0x94)]&&!process[_0x3c1ac6(0xad)][_0x3c1ac6(0xa6)],_0x45a532=_0x3ff1d3?a169_0x5450a0[_0x3c1ac6(0xa2)]('→'):'→',_0x2ccb4f=_0x3ff1d3?a169_0x5450a0[_0x3c1ac6(0x8e)](_0x3031d2[_0x3c1ac6(0x92)]):_0x3031d2[_0x3c1ac6(0x92)],_0x3a437b=_0x3ff1d3?a169_0x5450a0[_0x3c1ac6(0xb3)](_0x3031d2[_0x3c1ac6(0xa9)]):_0x3031d2[_0x3c1ac6(0xa9)],_0x26b4a2=_0x3ff1d3?a169_0x5450a0[_0x3c1ac6(0xb4)](_0x3c1ac6(0x93)):_0x3c1ac6(0x93),_0x38fa3a=_0x3ff1d3?'\x0a'+a169_0x5450a0['yellow'](_0x3c1ac6(0xa3))+'\x20'+_0x2ccb4f+'\x20'+_0x45a532+'\x20'+_0x3a437b+'\x0a'+a169_0x5450a0[_0x3c1ac6(0x8e)](_0x3c1ac6(0x9f))+'\x20'+_0x26b4a2+'\x0a':'\x0aUpdate\x20available:\x20'+_0x2ccb4f+'\x20'+_0x45a532+'\x20'+_0x3a437b+'\x0aRun:\x20'+_0x26b4a2+'\x0a';process[_0x3c1ac6(0xaa)][_0x3c1ac6(0xa5)](_0x38fa3a);}
|