@treasuredata/tdx 0.16.2 → 0.16.4
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.js +1 -1
- package/dist/commands/agent-test-command.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.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.d.ts +3 -0
- package/dist/commands/mcp-command.d.ts.map +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/mcp-command.js.map +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.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +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.d.ts +9 -0
- package/dist/sdk/claude-agent/environment.d.ts.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/environment.js.map +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +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.js +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(_0x5c0f07,_0x30b33d){const _0x18417b=a159_0x3ef7,_0x310685=_0x5c0f07();while(!![]){try{const _0x25884b=-parseInt(_0x18417b(0x1f6))/0x1*(parseInt(_0x18417b(0x20a))/0x2)+parseInt(_0x18417b(0x1f3))/0x3+-parseInt(_0x18417b(0x200))/0x4*(-parseInt(_0x18417b(0x1ff))/0x5)+-parseInt(_0x18417b(0x201))/0x6+parseInt(_0x18417b(0x1f9))/0x7+-parseInt(_0x18417b(0x1f4))/0x8+-parseInt(_0x18417b(0x1fc))/0x9*(parseInt(_0x18417b(0x1f5))/0xa);if(_0x25884b===_0x30b33d)break;else _0x310685['push'](_0x310685['shift']());}catch(_0x1d55c8){_0x310685['push'](_0x310685['shift']());}}}(a159_0x30e5,0x3304e));import{readFile}from'fs/promises';function a159_0x3ef7(_0x4b26f4,_0x42cbe5){_0x4b26f4=_0x4b26f4-0x1f3;const _0x30e5fb=a159_0x30e5();let _0x3ef738=_0x30e5fb[_0x4b26f4];return _0x3ef738;}import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x361006,_0x3b2119){const _0x4186b5=a159_0x3ef7;try{if(_0x3b2119){const _0x1aacbd=await readFile(_0x361006,_0x4186b5(0x1fd));try{return JSON[_0x4186b5(0x202)](_0x1aacbd);}catch(_0x2802ee){throw new SDKError(ErrorCode[_0x4186b5(0x1f7)],_0x4186b5(0x207)+_0x361006+_0x4186b5(0x208)+(_0x2802ee instanceof Error?_0x2802ee['message']:String(_0x2802ee)));}}else try{return JSON[_0x4186b5(0x202)](_0x361006);}catch(_0x3bc588){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4186b5(0x1fa)+(_0x3bc588 instanceof Error?_0x3bc588['message']:String(_0x3bc588)));}}catch(_0xa3d20e){if(_0xa3d20e instanceof SDKError)throw _0xa3d20e;if(_0xa3d20e instanceof Error&&_0x4186b5(0x203)in _0xa3d20e){const _0x1af6e2=_0xa3d20e;if(_0x1af6e2['code']==='ENOENT')throw new SDKError(ErrorCode[_0x4186b5(0x209)],_0x4186b5(0x206)+_0x361006);else{if(_0x1af6e2[_0x4186b5(0x203)]===_0x4186b5(0x1fe))throw new SDKError(ErrorCode[_0x4186b5(0x1fb)],_0x4186b5(0x205)+_0x361006);}}throw new SDKError(ErrorCode[_0x4186b5(0x1f8)],_0x4186b5(0x204)+(_0xa3d20e instanceof Error?_0xa3d20e['message']:String(_0xa3d20e)));}}export async function loadJSONFromOptions(_0x42c61a,_0xb1868b){const _0xb4d3d=a159_0x3ef7;if(_0x42c61a&&_0xb1868b)throw new SDKError(ErrorCode[_0xb4d3d(0x1f7)],'Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.');if(_0x42c61a)return await loadJSON(_0x42c61a,![]);if(_0xb1868b)return await loadJSON(_0xb1868b,!![]);return undefined;}function a159_0x30e5(){const _0xf06528=['Permission\x20denied\x20reading\x20file:\x20','File\x20not\x20found:\x20','Invalid\x20JSON\x20in\x20file\x20\x27','\x27:\x20','NOT_FOUND','34862WjaFPx','1099050ulRRuV','338104CslXnP','3100qeHSLI','4yollzh','INVALID_ARGUMENT','INTERNAL','392665ykFLys','Invalid\x20JSON\x20string:\x20','PERMISSION_DENIED','1854rTCqYQ','utf-8','EACCES','41585PUlrNj','84ZOeOqE','1273686CRipkR','parse','code','Failed\x20to\x20load\x20JSON:\x20'];a159_0x30e5=function(){return _0xf06528;};return a159_0x30e5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1a8c56,_0x2a09e7){const _0x111cdd=a160_0x4ba5,_0x4db72f=_0x1a8c56();while(!![]){try{const _0x1d7757=-parseInt(_0x111cdd(0x16d))/0x1*(-parseInt(_0x111cdd(0x179))/0x2)+-parseInt(_0x111cdd(0x16a))/0x3*(parseInt(_0x111cdd(0x16c))/0x4)+-parseInt(_0x111cdd(0x17a))/0x5*(-parseInt(_0x111cdd(0x171))/0x6)+-parseInt(_0x111cdd(0x176))/0x7*(parseInt(_0x111cdd(0x172))/0x8)+parseInt(_0x111cdd(0x16b))/0x9+-parseInt(_0x111cdd(0x170))/0xa*(parseInt(_0x111cdd(0x16f))/0xb)+parseInt(_0x111cdd(0x174))/0xc;if(_0x1d7757===_0x2a09e7)break;else _0x4db72f['push'](_0x4db72f['shift']());}catch(_0x19cb06){_0x4db72f['push'](_0x4db72f['shift']());}}}(a160_0x3fb4,0x4778c));function a160_0x4ba5(_0x5673d4,_0x42e6fd){_0x5673d4=_0x5673d4-0x168;const _0x3fb4a1=a160_0x3fb4();let _0x4ba53f=_0x3fb4a1[_0x5673d4];return _0x4ba53f;}function a160_0x3fb4(){const _0x5433b5=['4KSTlYJ','2OaCNHL','Invalid\x20timeout\x20value:\x20','51095EpTcVe','1020ttpurH','1360122UolXcz','64dRumRW','Invalid\x20limit\x20value:\x20','10140120jLaZod','.\x20Must\x20be\x20a\x20positive\x20integer.','109781MgKlIb','number','.\x20Must\x20be\x20a\x20number.','17084QxcROA','10dHSiDo','isInteger','.\x20Must\x20be\x20an\x20integer.','1568487ohGxRU','894267RshaiW'];a160_0x3fb4=function(){return _0x5433b5;};return a160_0x3fb4();}export function validateLimitOption(_0xc672c5){const _0x9f7900=a160_0x4ba5;if(!Number[_0x9f7900(0x168)](_0xc672c5))return{'isValid':![],'error':_0x9f7900(0x173)+_0xc672c5+_0x9f7900(0x169)};if(_0xc672c5<=0x0)return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0xc672c5+_0x9f7900(0x175)};return{'isValid':!![],'value':_0xc672c5};}export function validateTimeoutOption(_0x1aa642,_0xcf8402=0x1e){const _0x55f6fe=a160_0x4ba5;if(_0x1aa642===undefined)return{'isValid':!![],'value':_0xcf8402};const _0x589c51=typeof _0x1aa642===_0x55f6fe(0x177)?_0x1aa642:parseFloat(_0x1aa642);if(isNaN(_0x589c51))return{'isValid':![],'error':'Invalid\x20timeout\x20value:\x20'+_0x1aa642+_0x55f6fe(0x178)};if(_0x589c51<=0x0)return{'isValid':![],'error':_0x55f6fe(0x16e)+_0x589c51+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x589c51};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a161_0x3181(_0x118c05,_0x343399){_0x118c05=_0x118c05-0x18d;const _0x2f8b1b=a161_0x2f8b();let _0x31813b=_0x2f8b1b[_0x118c05];return _0x31813b;}(function(_0xa51306,_0x14758){const _0x4717dd=a161_0x3181,_0x400ac2=_0xa51306();while(!![]){try{const _0x2a74d2=parseInt(_0x4717dd(0x19d))/0x1+parseInt(_0x4717dd(0x195))/0x2*(-parseInt(_0x4717dd(0x196))/0x3)+-parseInt(_0x4717dd(0x197))/0x4*(parseInt(_0x4717dd(0x19c))/0x5)+-parseInt(_0x4717dd(0x192))/0x6+-parseInt(_0x4717dd(0x199))/0x7+parseInt(_0x4717dd(0x193))/0x8*(-parseInt(_0x4717dd(0x18d))/0x9)+parseInt(_0x4717dd(0x190))/0xa;if(_0x2a74d2===_0x14758)break;else _0x400ac2['push'](_0x400ac2['shift']());}catch(_0x4b4243){_0x400ac2['push'](_0x400ac2['shift']());}}}(a161_0x2f8b,0x1ca95));import{createServer}from'node:net';function a161_0x2f8b(){const _0x5bcdff=['275868YbqxXW','594056fsBibY','listening','4qNfPUT','33288cmalZW','8QvRrzc','No\x20available\x20port\x20found\x20between\x20','389837LrpvWE','code','listen','472435RsMyni','206279ZnPIcG','once','18GtmBcU','\x20and\x20','0.0.0.0','3724670CAGRWu','error'];a161_0x2f8b=function(){return _0x5bcdff;};return a161_0x2f8b();}export async function isPortAvailable(_0x52b267){return new Promise(_0x18b372=>{const _0x51ab58=a161_0x3181,_0x22a90e=createServer();_0x22a90e[_0x51ab58(0x19e)](_0x51ab58(0x191),_0x31614c=>{const _0x3f7ec1=_0x51ab58;_0x31614c[_0x3f7ec1(0x19a)]==='EADDRINUSE'?_0x18b372(![]):_0x18b372(![]);}),_0x22a90e[_0x51ab58(0x19e)](_0x51ab58(0x194),()=>{_0x22a90e['close'](),_0x18b372(!![]);}),_0x22a90e[_0x51ab58(0x19b)](_0x52b267,_0x51ab58(0x18f));});}export async function findAvailablePort(_0x413516=0xfa0,_0x93a47b=0x64){const _0x315453=a161_0x3181;for(let _0x3e48bf=0x0;_0x3e48bf<_0x93a47b;_0x3e48bf++){const _0x368fb9=_0x413516+_0x3e48bf;if(await isPortAvailable(_0x368fb9))return _0x368fb9;}throw new Error(_0x315453(0x198)+_0x413516+_0x315453(0x18e)+(_0x413516+_0x93a47b-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x31da6b=a162_0x552c;(function(_0x4823d4,_0x5a7d6d){const _0x1f6e80=a162_0x552c,_0x4776a0=_0x4823d4();while(!![]){try{const _0x106e27=-parseInt(_0x1f6e80(0x192))/0x1*(parseInt(_0x1f6e80(0x19a))/0x2)+parseInt(_0x1f6e80(0x1a3))/0x3+parseInt(_0x1f6e80(0x183))/0x4+-parseInt(_0x1f6e80(0x186))/0x5*(-parseInt(_0x1f6e80(0x1a7))/0x6)+parseInt(_0x1f6e80(0x17e))/0x7+-parseInt(_0x1f6e80(0x19d))/0x8*(parseInt(_0x1f6e80(0x195))/0x9)+-parseInt(_0x1f6e80(0x1a1))/0xa*(-parseInt(_0x1f6e80(0x1a9))/0xb);if(_0x106e27===_0x5a7d6d)break;else _0x4776a0['push'](_0x4776a0['shift']());}catch(_0x6ef6a){_0x4776a0['push'](_0x4776a0['shift']());}}}(a162_0x56d7,0x282fc));import{execSync,spawn}from'node:child_process';const SHELL_NAMES=new Set([a162_0x31da6b(0x196),a162_0x31da6b(0x190),'sh','fish',a162_0x31da6b(0x16f),a162_0x31da6b(0x1a0),a162_0x31da6b(0x1a6),a162_0x31da6b(0x181),a162_0x31da6b(0x171),a162_0x31da6b(0x19e),'nu',a162_0x31da6b(0x177),'elvish','xonsh']),EPHEMERAL_SHELL_SPAWNERS=new Set([a162_0x31da6b(0x18d),a162_0x31da6b(0x18e),'cursor']);function getProcessInfoWindows(_0x28de97){const _0x13a7b9=a162_0x31da6b;try{if(!Number[_0x13a7b9(0x18c)](_0x28de97)||_0x28de97<=0x0)return null;const _0x406ea1=_0x13a7b9(0x184)+_0x28de97+_0x13a7b9(0x185),_0x428a42=execSync(_0x13a7b9(0x17f)+_0x406ea1+'\x22',{'encoding':_0x13a7b9(0x18a),'windowsHide':!![],'stdio':[_0x13a7b9(0x199),'pipe',_0x13a7b9(0x199)]})[_0x13a7b9(0x17b)]();if(!_0x428a42)return null;const [_0x334f3e,..._0x222df8]=_0x428a42['split'](','),_0x53ea05=parseInt(_0x334f3e,0xa),_0x40f103=_0x222df8[_0x13a7b9(0x189)](',')['trim']();if(isNaN(_0x53ea05)||!_0x40f103)return null;return{'pid':_0x28de97,'ppid':_0x53ea05,'comm':_0x40f103[_0x13a7b9(0x179)](/\.exe$/i,'')};}catch{return null;}}function getProcessInfoPosix(_0x23cd74){const _0x3b59d7=a162_0x31da6b;try{const _0x52bbc5=0x400000;if(!Number['isInteger'](_0x23cd74)||_0x23cd74<=0x0||_0x23cd74>_0x52bbc5)return null;const _0x4de26b=execSync(_0x3b59d7(0x197)+_0x23cd74+_0x3b59d7(0x178),{'encoding':_0x3b59d7(0x18a),'stdio':_0x3b59d7(0x199)})[_0x3b59d7(0x17b)](),[_0x58f6c8,..._0x14d1c4]=_0x4de26b[_0x3b59d7(0x1a5)](/\s+/),_0xef9836=parseInt(_0x58f6c8,0xa),_0x2a70f5=_0x14d1c4['join']('\x20');if(isNaN(_0xef9836))return null;return{'pid':_0x23cd74,'ppid':_0xef9836,'comm':_0x2a70f5};}catch{return null;}}function getProcessInfo(_0x1cdfcd){const _0x2d9dcc=a162_0x31da6b;if(process[_0x2d9dcc(0x175)]===_0x2d9dcc(0x16c))return getProcessInfoWindows(_0x1cdfcd);return getProcessInfoPosix(_0x1cdfcd);}function getBasename(_0x332b7b){const _0x5d6ef1=a162_0x31da6b;return _0x332b7b['replace'](/^-/,'')[_0x5d6ef1(0x1a5)]('/')[_0x5d6ef1(0x1a2)]()?.[_0x5d6ef1(0x187)]()||'';}function isShell(_0xdf6a6){const _0x53ed67=a162_0x31da6b;return SHELL_NAMES[_0x53ed67(0x1a8)](getBasename(_0xdf6a6));}function isEphemeralShellSpawner(_0x360679){return EPHEMERAL_SHELL_SPAWNERS['has'](getBasename(_0x360679));}function a162_0x56d7(){const _0x219a15=['423WFUBdj','bash','ps\x20-p\x20','xdg-open','pipe','299074yRGWIW','protocol','which','20192VVGWpa','powershell','start','tcsh','2579180jsRBBC','pop','204699wzbnIJ','https:','split','csh','6rumBdc','has','11YjMlfv','win32','http:','data','ksh','darwin','pwsh','open','comm','ignore','platform','test','ion','\x20-o\x20ppid=,comm=','replace','stderr','trim','pid','Unsupported\x20protocol:\x20','308539HeHkfq','powershell.exe\x20-NoProfile\x20-NonInteractive\x20-Command\x20\x22','where.exe','dash','exit','691108OZXSNf','Get-CimInstance\x20Win32_Process\x20-Filter\x20\x22ProcessId=','\x22\x20|\x20Select-Object\x20-Property\x20ParentProcessId,Name\x20|\x20ForEach-Object\x20{\x20\x22$($_.ParentProcessId),$($_.Name)\x22\x20}','196505SpYGNJ','toLowerCase','kill','join','utf-8','unref','isInteger','claude','code','error','zsh','href','2WzeWhg','ppid','map'];a162_0x56d7=function(){return _0x219a15;};return a162_0x56d7();}let cachedShellPID;function findShellPID(){const _0xc10d89=a162_0x31da6b;if(process['ppid']===undefined)return process[_0xc10d89(0x17c)];let _0x457369=process['ppid'];const _0x1d1716=0xa;let _0x333a0e=0x0;while(_0x333a0e<_0x1d1716){const _0x5d0471=getProcessInfo(_0x457369);if(!_0x5d0471)break;if(isShell(_0x5d0471[_0xc10d89(0x173)])){const _0x5d6479=getProcessInfo(_0x5d0471['ppid']);if(_0x5d6479&&isEphemeralShellSpawner(_0x5d6479['comm'])){_0x457369=_0x5d0471[_0xc10d89(0x193)],_0x333a0e++;continue;}return _0x5d0471[_0xc10d89(0x17c)];}if(_0x5d0471[_0xc10d89(0x193)]===0x0||_0x5d0471[_0xc10d89(0x193)]===0x1){if(isShell(_0x5d0471[_0xc10d89(0x173)]))return _0x5d0471[_0xc10d89(0x17c)];break;}_0x457369=_0x5d0471[_0xc10d89(0x193)],_0x333a0e++;}return process[_0xc10d89(0x193)]!==undefined?process[_0xc10d89(0x193)]:process[_0xc10d89(0x17c)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0xb60291){const _0x5932f5=a162_0x31da6b;if(!Number[_0x5932f5(0x18c)](_0xb60291)||_0xb60291<=0x0)return![];try{return process[_0x5932f5(0x188)](_0xb60291,0x0),!![];}catch{return![];}}function a162_0x552c(_0x3d663d,_0x3d5b5c){_0x3d663d=_0x3d663d-0x16c;const _0x56d7e0=a162_0x56d7();let _0x552ccc=_0x56d7e0[_0x3d663d];return _0x552ccc;}export function openBrowser(_0x7a83ce){const _0x509bca=a162_0x31da6b;let _0x4aead6;try{_0x4aead6=new URL(_0x7a83ce);}catch{throw new Error('Invalid\x20URL:\x20'+_0x7a83ce);}if(_0x4aead6[_0x509bca(0x19b)]!==_0x509bca(0x16d)&&_0x4aead6[_0x509bca(0x19b)]!==_0x509bca(0x1a4))throw new Error(_0x509bca(0x17d)+_0x4aead6[_0x509bca(0x19b)]);const _0x49e104=_0x4aead6[_0x509bca(0x191)],_0x28b563=process['platform'];if(_0x28b563===_0x509bca(0x16c))spawn('cmd.exe',['/c',_0x509bca(0x19f),'',_0x49e104],{'detached':!![],'stdio':'ignore'})[_0x509bca(0x18b)]();else{const _0x2f8a27=_0x28b563===_0x509bca(0x170)?_0x509bca(0x172):_0x509bca(0x198);spawn(_0x2f8a27,[_0x49e104],{'detached':!![],'stdio':_0x509bca(0x174)})[_0x509bca(0x18b)]();}}export function isWindows(){const _0x1c5b80=a162_0x31da6b;return process[_0x1c5b80(0x175)]===_0x1c5b80(0x16c);}export function getCrossSpawnOptions(_0x404ea7){return{..._0x404ea7??{},'shell':isWindows()};}export function escapeWindowsArg(_0x40d0b5){const _0x322c57=a162_0x31da6b;if(!/[ \t"&|<>^%!`\r\n]/[_0x322c57(0x176)](_0x40d0b5))return _0x40d0b5;const _0xdb2e9c=_0x40d0b5[_0x322c57(0x179)](/"/g,'\x22\x22');return'\x22'+_0xdb2e9c+'\x22';}export function crossSpawn(_0x412e15,_0x379859,_0x40a087){const _0x4f0f5b=a162_0x31da6b;if(isWindows()){const _0x1c1177=escapeWindowsArg(_0x412e15),_0x2433c4=_0x379859[_0x4f0f5b(0x194)](escapeWindowsArg),_0x17502c=[_0x1c1177,..._0x2433c4]['join']('\x20');return spawn(_0x17502c,[],{..._0x40a087,'shell':!![]});}return spawn(_0x412e15,_0x379859,{..._0x40a087,'shell':![]});}export function findExecutable(_0x543297,_0x2d1265=0x1388){return new Promise(_0x3c7c88=>{const _0x5de931=a162_0x552c,_0xe5b367=isWindows()?_0x5de931(0x180):_0x5de931(0x19c);let _0x108c2b=![];const _0x5d908c=crossSpawn(_0xe5b367,[_0x543297],{'stdio':_0x5de931(0x199)}),_0xfa25db=setTimeout(()=>{const _0x318447=_0x5de931;!_0x108c2b&&(_0x108c2b=!![],_0x5d908c[_0x318447(0x188)](),_0x3c7c88(null));},_0x2d1265);let _0x3958d8='';_0x5d908c['stdout']?.['on'](_0x5de931(0x16e),_0x276d08=>{_0x3958d8+=_0x276d08['toString']();}),_0x5d908c[_0x5de931(0x17a)]?.['on'](_0x5de931(0x16e),()=>{}),_0x5d908c['on'](_0x5de931(0x182),_0x3b309a=>{const _0x15d074=_0x5de931;if(_0x108c2b)return;_0x108c2b=!![],clearTimeout(_0xfa25db);if(_0x3b309a===0x0&&_0x3958d8['trim']()){const _0x3d153a=_0x3958d8[_0x15d074(0x17b)]()[_0x15d074(0x1a5)](/\r?\n/)[0x0];_0x3c7c88(_0x3d153a);}else _0x3c7c88(null);}),_0x5d908c['on'](_0x5de931(0x18f),()=>{if(_0x108c2b)return;_0x108c2b=!![],clearTimeout(_0xfa25db),_0x3c7c88(null);});});}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ee270,_0x3dd254){const _0x5f46dd=a163_0x4fb1,_0x5af0e4=_0x3ee270();while(!![]){try{const _0x5859c8=-parseInt(_0x5f46dd(0x1a1))/0x1+parseInt(_0x5f46dd(0x19c))/0x2*(-parseInt(_0x5f46dd(0x18e))/0x3)+parseInt(_0x5f46dd(0x19b))/0x4+-parseInt(_0x5f46dd(0x196))/0x5*(-parseInt(_0x5f46dd(0x18d))/0x6)+parseInt(_0x5f46dd(0x191))/0x7+parseInt(_0x5f46dd(0x19e))/0x8*(parseInt(_0x5f46dd(0x19d))/0x9)+parseInt(_0x5f46dd(0x198))/0xa;if(_0x5859c8===_0x3dd254)break;else _0x5af0e4['push'](_0x5af0e4['shift']());}catch(_0x310f95){_0x5af0e4['push'](_0x5af0e4['shift']());}}}(a163_0x125f,0x771bb));import*as a163_0x3720f7 from'readline';function a163_0x4fb1(_0xf1610d,_0x25dbc5){_0xf1610d=_0xf1610d-0x18d;const _0x125f30=a163_0x125f();let _0x4fb1e6=_0x125f30[_0xf1610d];return _0x4fb1e6;}function a163_0x125f(){const _0x4a4a52=['stderr','data','yes','10025HtMcky','setEncoding','6112080cKfVPT','setRawMode','\x20[y/N]\x20','2002848LiYdWn','200iNEQUH','3753NlPcmv','1312LPuxVg','removeListener','stdout','786245edXZCT','close','resume','1680tzaKoX','15159jfaBAU','stdin','toLowerCase','263928NyedVP','write'];a163_0x125f=function(){return _0x4a4a52;};return a163_0x125f();}export async function confirm(_0x41ba9a){const _0x37ce8b=a163_0x4fb1,_0x122077=a163_0x3720f7['createInterface']({'input':process['stdin'],'output':process[_0x37ce8b(0x1a0)]});return new Promise(_0x149c29=>{_0x122077['question'](_0x41ba9a+'\x20(y/N):\x20',_0x55b260=>{const _0xde6525=a163_0x4fb1;_0x122077[_0xde6525(0x1a2)](),_0x149c29(_0x55b260['toLowerCase']()==='y'||_0x55b260['toLowerCase']()===_0xde6525(0x195));});});}export async function confirmKey(_0x2cdefe){const _0x56b855=a163_0x4fb1;if(!process[_0x56b855(0x18f)]['isTTY'])return![];return process['stderr'][_0x56b855(0x192)](_0x2cdefe+_0x56b855(0x19a)),new Promise(_0x35edb1=>{const _0x54f5f9=_0x56b855,_0x41a197=process['stdin'];_0x41a197[_0x54f5f9(0x199)](!![]),_0x41a197[_0x54f5f9(0x1a3)](),_0x41a197[_0x54f5f9(0x197)]('utf8');const _0x171f4e=_0x4490e3=>{const _0x37195a=_0x54f5f9;_0x41a197[_0x37195a(0x199)](![]),_0x41a197['pause'](),_0x41a197[_0x37195a(0x19f)](_0x37195a(0x194),_0x171f4e);if(_0x4490e3==='\x1b'){process[_0x37195a(0x193)][_0x37195a(0x192)]('\x0a'),_0x35edb1(![]);return;}_0x4490e3==='\x03'&&(process[_0x37195a(0x193)]['write']('\x0a'),process['exit'](0x82));if(_0x4490e3[_0x37195a(0x190)]()==='y'){process['stderr'][_0x37195a(0x192)]('y\x0a'),_0x35edb1(!![]);return;}process[_0x37195a(0x193)][_0x37195a(0x192)]('\x0a'),_0x35edb1(![]);};_0x41a197['on']('data',_0x171f4e);});}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d9663,_0xb011bf){const _0x20f405=a164_0x1cbd,_0x448587=_0x3d9663();while(!![]){try{const _0x25e22f=parseInt(_0x20f405(0x114))/0x1*(-parseInt(_0x20f405(0x111))/0x2)+-parseInt(_0x20f405(0x106))/0x3*(-parseInt(_0x20f405(0x104))/0x4)+parseInt(_0x20f405(0x117))/0x5+-parseInt(_0x20f405(0x105))/0x6+-parseInt(_0x20f405(0x102))/0x7+-parseInt(_0x20f405(0x115))/0x8+parseInt(_0x20f405(0x118))/0x9;if(_0x25e22f===_0xb011bf)break;else _0x448587['push'](_0x448587['shift']());}catch(_0x2c4925){_0x448587['push'](_0x448587['shift']());}}}(a164_0x2229,0x1e518));function a164_0x2229(){const _0x260d9b=['isTTY','isSpinning','text','824236yPDFXb','cyan','16004ulmdRr','449016mwuipv','3ZJnzUA','replace','clock','extra','stop','start','...','stderr','floor','intervalFactory','jobId','455714Elonhb','now','toFixed','1PgDJzM','520448vsHcRk','trim','717315eLVeqI','4159953aeDiKq','\x20[Job\x20ID:\x20','phase'];a164_0x2229=function(){return _0x260d9b;};return a164_0x2229();}import a164_0x3c3108 from'ora';function a164_0x1cbd(_0x3a0e01,_0xd8b7b2){_0x3a0e01=_0x3a0e01-0xfe;const _0x2229af=a164_0x2229();let _0x1cbd1a=_0x2229af[_0x3a0e01];return _0x1cbd1a;}import{isWindows}from'./process.js';const windowsSpinner={'interval':0x3e8,'frames':['•']};export function createCommandSpinner(_0x65cd70,_0x10163e={}){const _0x27ed68=a164_0x1cbd,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x10163e;return a164_0x3c3108({'text':_0x65cd70,'color':_0x27ed68(0x103),'stream':process[_0x27ed68(0x10d)],'isEnabled':forceEnabled||process['stderr'][_0x27ed68(0xff)]&&!verbose,...isWindows()&&{'spinner':windowsSpinner}});}export async function withSpinner(_0x4d55de,_0x48be93,_0x9d3e8e={}){const _0x415d43=a164_0x1cbd,_0x3e898a=_0x9d3e8e[_0x415d43(0x108)]??(()=>Date[_0x415d43(0x112)]()),_0x388798=createCommandSpinner(_0x4d55de,_0x9d3e8e);_0x388798[_0x415d43(0x10b)]();const _0x37d185=_0x3e898a();try{const _0x39f20e=await _0x48be93(),_0x291815=_0x3e898a()-_0x37d185;return _0x388798[_0x415d43(0x10a)](),{'data':_0x39f20e,'elapsedMs':_0x291815};}catch(_0x314444){_0x388798['stop']();throw _0x314444;}}export async function withProgressSpinner(_0x107cbb,_0x11810c,_0x28e870={}){const _0x2d6c56=a164_0x1cbd,_0x227e12=_0x28e870[_0x2d6c56(0x108)]??(()=>Date[_0x2d6c56(0x112)]()),_0x3b5a73=_0x28e870[_0x2d6c56(0x10f)]??setInterval,_0x5a08c6=createCommandSpinner(_0x107cbb,_0x28e870);_0x5a08c6['start']();const _0x54f647=_0x227e12(),_0x54deca=_0x107cbb[_0x2d6c56(0x107)](_0x2d6c56(0x10c),'')[_0x2d6c56(0x116)]()||'Processing',_0x3cccb2={};let _0x55e80c=_0x107cbb;const _0x515f36=()=>{const _0x317330=_0x2d6c56;if(!_0x5a08c6[_0x317330(0x100)])return;const _0x1379a3=_0x227e12()-_0x54f647,_0x5350a0=formatElapsed(_0x1379a3),_0x45d478=_0x3cccb2[_0x317330(0xfe)]?.[_0x317330(0x116)]()||_0x54deca,_0x3aae07=_0x3cccb2[_0x317330(0x110)]?_0x317330(0x119)+_0x3cccb2[_0x317330(0x110)]+']':'',_0x382cc2=_0x3cccb2['extra']?'\x20'+_0x3cccb2[_0x317330(0x109)]:'',_0x47956f=_0x45d478+'\x20'+_0x5350a0+_0x382cc2+_0x3aae07;_0x47956f!==_0x55e80c&&_0x47956f[_0x317330(0x116)]()&&(_0x5a08c6['text']=_0x47956f,_0x55e80c=_0x47956f);},_0x844976=_0x3b5a73(()=>{_0x515f36();},0x3e8),_0x528d74={'setPhase':_0x2edd4b=>{const _0x3f2ee7=_0x2d6c56;_0x3cccb2[_0x3f2ee7(0xfe)]=_0x2edd4b;const _0x30551c=_0x2edd4b?.[_0x3f2ee7(0x116)]()||_0x54deca,_0x409a34=_0x227e12()-_0x54f647,_0x5332a1=formatElapsed(_0x409a34),_0x3d8743=_0x3cccb2[_0x3f2ee7(0x110)]?_0x3f2ee7(0x119)+_0x3cccb2[_0x3f2ee7(0x110)]+']':'',_0xd613d9=_0x3cccb2[_0x3f2ee7(0x109)]?'\x20'+_0x3cccb2[_0x3f2ee7(0x109)]:'',_0xe0ca45=_0x30551c+'\x20'+_0x5332a1+_0xd613d9+_0x3d8743;_0x5a08c6[_0x3f2ee7(0x100)]&&_0xe0ca45[_0x3f2ee7(0x116)]()&&(_0x5a08c6[_0x3f2ee7(0x101)]=_0xe0ca45,_0x55e80c=_0xe0ca45);},'setJobId':_0x4d0f32=>{_0x3cccb2['jobId']=_0x4d0f32,_0x515f36();},'setExtra':_0x32c173=>{const _0x4fb421=_0x2d6c56;_0x3cccb2[_0x4fb421(0x109)]=_0x32c173,_0x515f36();}};_0x515f36();try{const _0x1a7875=await _0x11810c(_0x528d74),_0x218205=_0x227e12()-_0x54f647;return{'data':_0x1a7875,'elapsedMs':_0x218205};}finally{clearInterval(_0x844976),_0x5a08c6[_0x2d6c56(0x10a)]();}}export function formatElapsed(_0x11d793){const _0x19d3bb=a164_0x1cbd,_0x36f3eb=Math[_0x19d3bb(0x10e)](_0x11d793/0x3e8);if(_0x36f3eb<0x3c)return(_0x11d793/0x3e8)[_0x19d3bb(0x113)](0x1)+'s';const _0x255c98=Math['floor'](_0x36f3eb/0x3c),_0x38c27c=_0x36f3eb%0x3c;if(_0x255c98<0x3c)return _0x255c98+'m\x20'+_0x38c27c+'s';const _0xa8405b=Math['floor'](_0x255c98/0x3c),_0x3565cf=_0x255c98%0x3c;return _0xa8405b+'h\x20'+_0x3565cf+'m';}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a165_0x2ee4(){const _0x21670b=['startsWith','16kucZMm','Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20','9081942ObIcpz','1576037FdMDTb','read','event','39383700KujCdH','14483961nZizKJ','body','debug','slice','getReader','decode','releaseLock','parse','trim','pop','2FRjfjQ','indexOf','2775699dKhaMT','5416901KZZxMb','755cyyzVd','data','[LLM\x20API\x20SSE]\x20','16220IIcvOV'];a165_0x2ee4=function(){return _0x21670b;};return a165_0x2ee4();}(function(_0x2ad784,_0x54283c){const _0x4c91d8=a165_0x2e5f,_0x4dd6f2=_0x2ad784();while(!![]){try{const _0x25a4a5=parseInt(_0x4c91d8(0x19e))/0x1+parseInt(_0x4c91d8(0x192))/0x2*(parseInt(_0x4c91d8(0x194))/0x3)+-parseInt(_0x4c91d8(0x199))/0x4*(-parseInt(_0x4c91d8(0x196))/0x5)+-parseInt(_0x4c91d8(0x19d))/0x6+-parseInt(_0x4c91d8(0x195))/0x7*(-parseInt(_0x4c91d8(0x19b))/0x8)+parseInt(_0x4c91d8(0x1a2))/0x9+-parseInt(_0x4c91d8(0x1a1))/0xa;if(_0x25a4a5===_0x54283c)break;else _0x4dd6f2['push'](_0x4dd6f2['shift']());}catch(_0x533b0c){_0x4dd6f2['push'](_0x4dd6f2['shift']());}}}(a165_0x2ee4,0xc7d83));export async function*parseSSEStream(_0x2c4a28,_0x5c4398){const _0x56e934=a165_0x2e5f;if(!_0x2c4a28['body'])throw new Error('Response\x20body\x20is\x20null');const _0x2373c1=_0x2c4a28[_0x56e934(0x1a3)][_0x56e934(0x18c)](),_0x4793d0=new TextDecoder();let _0x525443='',_0x37179e={};try{while(!![]){const {done:_0x3de03c,value:_0x345298}=await _0x2373c1[_0x56e934(0x19f)]();if(_0x3de03c){if(_0x37179e[_0x56e934(0x197)]){_0x5c4398?.[_0x56e934(0x18a)]('[LLM\x20API\x20SSE]\x20'+_0x37179e[_0x56e934(0x197)]);const _0x401e9b=parseSSEData(_0x37179e['data']);yield _0x401e9b;}break;}_0x525443+=_0x4793d0[_0x56e934(0x18d)](_0x345298,{'stream':!![]});const _0x3388bb=_0x525443['split']('\x0a');_0x525443=_0x3388bb[_0x56e934(0x191)]()||'';for(const _0x36428b of _0x3388bb){if(_0x36428b[_0x56e934(0x190)]()===''){if(_0x37179e['data']){_0x5c4398?.[_0x56e934(0x18a)](_0x56e934(0x198)+_0x37179e[_0x56e934(0x197)]);const _0x3389e7=parseSSEData(_0x37179e[_0x56e934(0x197)]);yield _0x3389e7,_0x37179e={};}continue;}if(_0x36428b[_0x56e934(0x19a)](':'))continue;const _0x3418e2=_0x36428b[_0x56e934(0x193)](':');if(_0x3418e2===-0x1)continue;const _0x442961=_0x36428b[_0x56e934(0x18b)](0x0,_0x3418e2);let _0x1f4eb4=_0x36428b[_0x56e934(0x18b)](_0x3418e2+0x1);_0x1f4eb4[_0x56e934(0x19a)]('\x20')&&(_0x1f4eb4=_0x1f4eb4[_0x56e934(0x18b)](0x1));switch(_0x442961){case _0x56e934(0x1a0):_0x37179e[_0x56e934(0x1a0)]=_0x1f4eb4;break;case _0x56e934(0x197):_0x37179e[_0x56e934(0x197)]=_0x37179e[_0x56e934(0x197)]?_0x37179e[_0x56e934(0x197)]+'\x0a'+_0x1f4eb4:_0x1f4eb4;break;case'id':_0x37179e['id']=_0x1f4eb4;break;}}}}finally{_0x2373c1[_0x56e934(0x18e)]();}}function a165_0x2e5f(_0x3cf011,_0x1cad07){_0x3cf011=_0x3cf011-0x18a;const _0x2ee4f2=a165_0x2ee4();let _0x2e5f38=_0x2ee4f2[_0x3cf011];return _0x2e5f38;}function parseSSEData(_0x3fb8ec){const _0x55ff87=a165_0x2e5f;try{return JSON[_0x55ff87(0x18f)](_0x3fb8ec);}catch(_0x309d62){throw new Error(_0x55ff87(0x19c)+_0x3fb8ec,{'cause':_0x309d62});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b0fe0,_0x4b57f6){const _0x4d931a=a166_0x3020,_0x54eda9=_0x2b0fe0();while(!![]){try{const _0x567fdb=parseInt(_0x4d931a(0x1dc))/0x1+parseInt(_0x4d931a(0x1de))/0x2*(-parseInt(_0x4d931a(0x1ec))/0x3)+-parseInt(_0x4d931a(0x1e6))/0x4*(parseInt(_0x4d931a(0x1f0))/0x5)+-parseInt(_0x4d931a(0x1e9))/0x6*(parseInt(_0x4d931a(0x1da))/0x7)+-parseInt(_0x4d931a(0x1db))/0x8+parseInt(_0x4d931a(0x1e7))/0x9+parseInt(_0x4d931a(0x1df))/0xa;if(_0x567fdb===_0x4b57f6)break;else _0x54eda9['push'](_0x54eda9['shift']());}catch(_0x4d97e8){_0x54eda9['push'](_0x54eda9['shift']());}}}(a166_0x2761,0x3f2b0));import a166_0x5b74cc from'string-width';export function stringWidth(_0x21bfc5){return a166_0x5b74cc(_0x21bfc5);}export function padEnd(_0x268ab3,_0x568dc2){const _0x370887=a166_0x3020,_0x534dfa=stringWidth(_0x268ab3);if(_0x534dfa>=_0x568dc2)return _0x268ab3;return _0x268ab3+'\x20'[_0x370887(0x1f2)](_0x568dc2-_0x534dfa);}export function padStart(_0x1fd346,_0x59cb09){const _0x49a1c2=a166_0x3020,_0x2fd72b=stringWidth(_0x1fd346);if(_0x2fd72b>=_0x59cb09)return _0x1fd346;return'\x20'[_0x49a1c2(0x1f2)](_0x59cb09-_0x2fd72b)+_0x1fd346;}export function centerAlign(_0x22f0c3,_0x4d4a38){const _0x500257=a166_0x3020,_0x58df07=stringWidth(_0x22f0c3);if(_0x58df07>_0x4d4a38){if(_0x4d4a38<=0x1)return'…'['substring'](0x0,_0x4d4a38);let _0x110cfd=_0x22f0c3;while(stringWidth(_0x110cfd+'…')>_0x4d4a38){_0x110cfd=_0x110cfd[_0x500257(0x1d9)](0x0,-0x1);}return _0x110cfd+'…';}if(_0x58df07===_0x4d4a38)return _0x22f0c3;const _0x4500e3=_0x4d4a38-_0x58df07,_0x2aa5aa=Math[_0x500257(0x1e1)](_0x4500e3/0x2),_0x46d959=_0x4500e3-_0x2aa5aa;return'\x20'[_0x500257(0x1f2)](_0x2aa5aa)+_0x22f0c3+'\x20'[_0x500257(0x1f2)](_0x46d959);}function a166_0x3020(_0x15b937,_0x1780ba){_0x15b937=_0x15b937-0x1d9;const _0x276170=a166_0x2761();let _0x302037=_0x276170[_0x15b937];return _0x302037;}function a166_0x2761(){const _0x4668f2=['length','floor','test','unknown','random','USERNAME','464uMkjtz','1877985xPhSKO','trim','1530XloWaQ','Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string','toLowerCase','3ftXdMz','replace','\x5c$&','env','21310tdbxDf','Cannot\x20escape\x20empty\x20string\x20literal','repeat','USER','slice','378QEOeyC','1629912vuHNzf','477282drhkBW','padStart','849796akJcGA','7095880HaQlPG'];a166_0x2761=function(){return _0x4668f2;};return a166_0x2761();}export function escapeStringLiteral(_0x289882){const _0x583ce0=a166_0x3020;if(!_0x289882||_0x289882['trim']()['length']===0x0)throw new Error(_0x583ce0(0x1f1));const _0x92ab1c=_0x289882[_0x583ce0(0x1ed)](/'/g,'\x27\x27');return'\x27'+_0x92ab1c+'\x27';}export function globToLike(_0x401cb3){const _0x16dad0=a166_0x3020;let _0x271f59=_0x401cb3[_0x16dad0(0x1ed)](/\\/g,'\x5c\x5c')[_0x16dad0(0x1ed)](/%/g,'\x5c%')['replace'](/_/g,'\x5c_');return _0x271f59=_0x271f59[_0x16dad0(0x1ed)](/\*/g,'%')['replace'](/\?/g,'_'),_0x271f59;}export function buildLikePattern(_0x4358a6){const _0x2ebfd2=a166_0x3020;if(!_0x4358a6||_0x4358a6[_0x2ebfd2(0x1e8)]()[_0x2ebfd2(0x1e0)]===0x0)throw new Error(_0x2ebfd2(0x1ea));const _0x57c729=globToLike(_0x4358a6),_0x4abe72=_0x57c729[_0x2ebfd2(0x1ed)](/'/g,'\x27\x27');return'\x27'+_0x4abe72+'\x27';}export function matchGlobPattern(_0x3d23cf,_0x104569){const _0x25364a=a166_0x3020,_0x172ba0=_0x104569[_0x25364a(0x1ed)](/[.+^${}()|[\]\\]/g,_0x25364a(0x1ee))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3968bc=new RegExp('^'+_0x172ba0+'$');return _0x3968bc[_0x25364a(0x1e2)](_0x3d23cf);}export function getSanitizedUsername(){const _0x12fd73=a166_0x3020,_0xde5d04=process['env'][_0x12fd73(0x1f3)]||process[_0x12fd73(0x1ef)][_0x12fd73(0x1e5)]||_0x12fd73(0x1e3);return _0xde5d04['replace'](/[^a-zA-Z0-9]/g,'')[_0x12fd73(0x1eb)]();}export function generateRandomHex(){const _0x32bd21=a166_0x3020,_0x2641dc=Math[_0x32bd21(0x1e1)](Math[_0x32bd21(0x1e4)]()*0xfffff);return _0x2641dc['toString'](0x10)[_0x32bd21(0x1dd)](0x5,'0');}export function sanitizeFileName(_0x395a73){const _0x3aa38d=a166_0x3020;return _0x395a73[_0x3aa38d(0x1eb)]()[_0x3aa38d(0x1ed)](/[/\\:*?"<>|]/g,'-')[_0x3aa38d(0x1ed)](/\s+/g,'-')[_0x3aa38d(0x1ed)](/-+/g,'-')[_0x3aa38d(0x1ed)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a167_0x2541(_0x3f637d,_0x58756b){_0x3f637d=_0x3f637d-0xaa;const _0x2ca5b6=a167_0x2ca5();let _0x2541ea=_0x2ca5b6[_0x3f637d];return _0x2541ea;}(function(_0x1da43b,_0x259ce0){const _0x2d65c7=a167_0x2541,_0x4f7baa=_0x1da43b();while(!![]){try{const _0x51407b=-parseInt(_0x2d65c7(0xae))/0x1+-parseInt(_0x2d65c7(0xac))/0x2*(parseInt(_0x2d65c7(0xbb))/0x3)+-parseInt(_0x2d65c7(0xb8))/0x4+-parseInt(_0x2d65c7(0xaa))/0x5*(parseInt(_0x2d65c7(0xc6))/0x6)+parseInt(_0x2d65c7(0xc2))/0x7*(-parseInt(_0x2d65c7(0xbc))/0x8)+-parseInt(_0x2d65c7(0xb7))/0x9*(-parseInt(_0x2d65c7(0xaf))/0xa)+parseInt(_0x2d65c7(0xc3))/0xb*(parseInt(_0x2d65c7(0xb2))/0xc);if(_0x51407b===_0x259ce0)break;else _0x4f7baa['push'](_0x4f7baa['shift']());}catch(_0x3f1c7c){_0x4f7baa['push'](_0x4f7baa['shift']());}}}(a167_0x2ca5,0xf07c5));function hasWildcard(_0x444915){const _0xaecf8=a167_0x2541;return _0x444915[_0xaecf8(0xb1)]('*')||_0x444915[_0xaecf8(0xb1)]('?');}export function parseTableReference(_0x21aa0d){const _0x3e5d7c=a167_0x2541;if(!_0x21aa0d||_0x21aa0d[_0x3e5d7c(0xba)]()[_0x3e5d7c(0xbf)]===0x0)throw new Error(_0x3e5d7c(0xc5));const _0x393794=_0x21aa0d[_0x3e5d7c(0xba)](),_0x2affe6={'original':_0x393794},_0x279caa=_0x393794[_0x3e5d7c(0xb6)]('.');if(_0x279caa[_0x3e5d7c(0xbf)]===0x1){const _0x2d5631=_0x279caa[0x0];if(!_0x2d5631)throw new Error(_0x3e5d7c(0xb4));_0x2affe6[_0x3e5d7c(0xc0)]=_0x2d5631;}else{if(_0x279caa[_0x3e5d7c(0xbf)]===0x2){const [_0x271bb5,_0x234ea2]=_0x279caa;if(!_0x271bb5)throw new Error(_0x3e5d7c(0xb9));if(!_0x234ea2)throw new Error(_0x3e5d7c(0xbd));_0x2affe6[_0x3e5d7c(0xbe)]=_0x271bb5,_0x2affe6['table']=_0x234ea2;}else{if(_0x279caa[_0x3e5d7c(0xbf)]===0x3){const [_0x563bde,_0x3f058d,_0x4eb5a8]=_0x279caa;if(!_0x563bde||!_0x3f058d||!_0x4eb5a8)throw new Error(_0x3e5d7c(0xb3));_0x2affe6[_0x3e5d7c(0xb5)]=_0x563bde,_0x2affe6['database']=_0x3f058d,_0x2affe6[_0x3e5d7c(0xc0)]=_0x4eb5a8;}else throw new Error(_0x3e5d7c(0xab));}}return _0x2affe6;}function a167_0x2ca5(){const _0x514e36=['Table\x20name\x20is\x20required\x20for\x20describe\x20operation','includes','756NYBCQJ','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','Pattern\x20cannot\x20be\x20just\x20a\x20dot','catalog','split','36ByttkL','220284cNWTOf','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','trim','198489JFNMrr','24WpVhdx','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','database','length','table','push','1099434JFBptI','470690GkesWQ','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','1726554kMcuOt','5ZQBVSi','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','44rIVuOp','join','158387TeuWCS','1793120nrsObw'];a167_0x2ca5=function(){return _0x514e36;};return a167_0x2ca5();}export function formatTableReference(_0x3a79ce){const _0x5c5168=a167_0x2541,_0x934e6e=[];return _0x3a79ce['catalog']&&_0x934e6e[_0x5c5168(0xc1)](_0x3a79ce[_0x5c5168(0xb5)]),_0x3a79ce[_0x5c5168(0xbe)]&&_0x934e6e[_0x5c5168(0xc1)](_0x3a79ce[_0x5c5168(0xbe)]),_0x3a79ce[_0x5c5168(0xc0)]&&_0x934e6e[_0x5c5168(0xc1)](_0x3a79ce['table']),_0x934e6e[_0x5c5168(0xad)]('.');}export function validateTableListReference(_0x251619){return undefined;}export function validateTableDescribeReference(_0x4d61d4){const _0x217967=a167_0x2541;if(!_0x4d61d4['table'])return _0x217967(0xb0);if(_0x4d61d4['database']&&hasWildcard(_0x4d61d4[_0x217967(0xbe)]))return'Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation';if(hasWildcard(_0x4d61d4['table']))return _0x217967(0xc4);return undefined;}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a168_0x34b707=a168_0x5d00;(function(_0x52e444,_0x1eb49a){const _0x20af44=a168_0x5d00,_0x21ac37=_0x52e444();while(!![]){try{const _0x5ba6ed=parseInt(_0x20af44(0x1f7))/0x1+-parseInt(_0x20af44(0x226))/0x2*(-parseInt(_0x20af44(0x21c))/0x3)+-parseInt(_0x20af44(0x22c))/0x4+-parseInt(_0x20af44(0x1f2))/0x5+-parseInt(_0x20af44(0x1f5))/0x6*(-parseInt(_0x20af44(0x1fa))/0x7)+-parseInt(_0x20af44(0x21f))/0x8+parseInt(_0x20af44(0x221))/0x9;if(_0x5ba6ed===_0x1eb49a)break;else _0x21ac37['push'](_0x21ac37['shift']());}catch(_0x455d5c){_0x21ac37['push'](_0x21ac37['shift']());}}}(a168_0x2f4d,0xbf34a));function a168_0x5d00(_0x4cb0d7,_0x216799){_0x4cb0d7=_0x4cb0d7-0x1e9;const _0x2f4d01=a168_0x2f4d();let _0x5d0007=_0x2f4d01[_0x4cb0d7];return _0x5d0007;}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';import a168_0x3ee062 from'chalk';function safeStringify(_0x3853b7){const _0xb7d450=a168_0x5d00;if(typeof _0x3853b7===_0xb7d450(0x21d))return _0x3853b7;if(_0x3853b7 instanceof Error)return _0x3853b7[_0xb7d450(0x20c)]||_0x3853b7['name']+':\x20'+_0x3853b7[_0xb7d450(0x1ed)];try{return JSON[_0xb7d450(0x202)](_0x3853b7,(_0x2fcee2,_0x4eef7d)=>{const _0x1803c2=_0xb7d450;if(_0x4eef7d instanceof Error)return{'name':_0x4eef7d['name'],'message':_0x4eef7d[_0x1803c2(0x1ed)],'stack':_0x4eef7d[_0x1803c2(0x20c)],'cause':_0x4eef7d[_0x1803c2(0x1f6)]};return _0x4eef7d;});}catch{return String(_0x3853b7);}}function getTimezoneOffset(){const _0x210526=a168_0x5d00,_0x2191ed=-new Date()[_0x210526(0x214)](),_0x57f81f=Math[_0x210526(0x215)](Math[_0x210526(0x201)](_0x2191ed)/0x3c),_0xbaecf7=Math[_0x210526(0x201)](_0x2191ed)%0x3c,_0x44fa25=_0x2191ed>=0x0?'+':'-';return''+_0x44fa25+_0x57f81f[_0x210526(0x212)]()[_0x210526(0x21b)](0x2,'0')+_0xbaecf7[_0x210526(0x212)]()[_0x210526(0x21b)](0x2,'0');}function formatTimestamp(){const _0x149693=a168_0x5d00,_0x3c223b=new Date(),_0x338f89=_0x3c223b[_0x149693(0x1ff)](),_0x41c633=(_0x3c223b[_0x149693(0x1fb)]()+0x1)[_0x149693(0x212)]()[_0x149693(0x21b)](0x2,'0'),_0x4f31ee=_0x3c223b['getDate']()[_0x149693(0x212)]()[_0x149693(0x21b)](0x2,'0'),_0x410320=_0x3c223b[_0x149693(0x1e9)]()[_0x149693(0x212)]()[_0x149693(0x21b)](0x2,'0'),_0x1ab2bf=_0x3c223b[_0x149693(0x22d)]()[_0x149693(0x212)]()[_0x149693(0x21b)](0x2,'0'),_0x13d2dd=_0x3c223b[_0x149693(0x213)]()[_0x149693(0x212)]()['padStart'](0x2,'0'),_0x509c6a=_0x3c223b[_0x149693(0x206)]()[_0x149693(0x212)]()['padStart'](0x3,'0'),_0x5449f8=getTimezoneOffset();return _0x338f89+'-'+_0x41c633+'-'+_0x4f31ee+'\x20'+_0x410320+':'+_0x1ab2bf+':'+_0x13d2dd+'.'+_0x509c6a+_0x5449f8;}function formatColoredLogEntry(_0x10ebce,_0x4c536c){const _0x46d696=a168_0x5d00,_0x4f170d=formatTimestamp(),_0x517310=_0x4c536c[_0x46d696(0x1f9)](safeStringify)[_0x46d696(0x220)]('\x20'),_0x26f0e4=a168_0x3ee062['gray'](_0x4f170d);let _0x2249dc;switch(_0x10ebce){case _0x46d696(0x207):_0x2249dc=a168_0x3ee062[_0x46d696(0x229)]('['+_0x10ebce+']\x20');break;case'warn':_0x2249dc=a168_0x3ee062[_0x46d696(0x211)]('['+_0x10ebce+']\x20');break;case'error':_0x2249dc=a168_0x3ee062['red']('['+_0x10ebce+']');break;case _0x46d696(0x209):_0x2249dc=a168_0x3ee062[_0x46d696(0x222)]('['+_0x10ebce+']');break;default:_0x2249dc='['+_0x10ebce+']';}return _0x26f0e4+'\x20'+_0x2249dc+'\x20'+_0x517310;}function a168_0x2f4d(){const _0x421ee3=['getHours','getLogPath','logLevel','logFileName','message','write','log','rotateOldLogs','Warning:\x20Failed\x20to\x20initialize\x20log\x20files:','7669215ituEwg','includes','DEBUG','1860ViYjoi','cause','26965PQhtrg','tdx.log','map','20937xELKAn','getMonth','WARN','toISOString','trace','getFullYear','error','abs','stringify','fileOnly','warn','filter','getMilliseconds','info','Proxy\x20session\x20ended','debug','logBaseName','split','stack','INFO','Warning:\x20Error\x20writing\x20to\x20','replace','init','yellow','toString','getSeconds','getTimezoneOffset','floor','ERROR','logDir','mtime','test','logStream','padStart','3vgSAeA','string','\x5c$&','2439840iITfAv','join','10014579jLSOuR','gray','Warning:\x20Failed\x20to\x20compress\x20','.log','logs','1893392sWKqTZ','TRACE','close','cyan','tdx','.gz','1566404XeiaPp','getMinutes'];a168_0x2f4d=function(){return _0x421ee3;};return a168_0x2f4d();}export var LogLevel;(function(_0x3c3bdb){const _0x482a85=a168_0x5d00;_0x3c3bdb[_0x3c3bdb[_0x482a85(0x227)]=-0x2]=_0x482a85(0x227),_0x3c3bdb[_0x3c3bdb[_0x482a85(0x1f4)]=-0x1]=_0x482a85(0x1f4),_0x3c3bdb[_0x3c3bdb[_0x482a85(0x20d)]=0x0]=_0x482a85(0x20d),_0x3c3bdb[_0x3c3bdb['WARN']=0x1]=_0x482a85(0x1fc),_0x3c3bdb[_0x3c3bdb[_0x482a85(0x216)]=0x2]=_0x482a85(0x216);}(LogLevel||(LogLevel={})));export class TDXLogger{[a168_0x34b707(0x21a)];[a168_0x34b707(0x217)];[a168_0x34b707(0x1eb)];[a168_0x34b707(0x203)];[a168_0x34b707(0x1ec)];[a168_0x34b707(0x20a)];constructor(_0x56054d=LogLevel[a168_0x34b707(0x20d)],_0x2474de=![],_0x1eb8c6,_0x4e8773=a168_0x34b707(0x1f8)){const _0x449cb1=a168_0x34b707;this[_0x449cb1(0x217)]=_0x1eb8c6||join(homedir(),'.cache',_0x449cb1(0x22a),_0x449cb1(0x225)),this['logLevel']=_0x56054d,this[_0x449cb1(0x203)]=_0x2474de,this['logFileName']=_0x4e8773,this[_0x449cb1(0x20a)]=_0x4e8773['replace'](/\.log$/,'');}async[a168_0x34b707(0x210)](){const _0x3bdf38=a168_0x34b707;try{await mkdir(this['logDir'],{'recursive':!![]}),await this[_0x3bdf38(0x1f0)]();const _0x19c762=join(this[_0x3bdf38(0x217)],this[_0x3bdf38(0x1ec)]);this[_0x3bdf38(0x21a)]=createWriteStream(_0x19c762,{'flags':'a'}),this[_0x3bdf38(0x21a)]['on'](_0x3bdf38(0x200),_0x165eb2=>{const _0x43d95b=_0x3bdf38;console['error'](_0x43d95b(0x20e)+this[_0x43d95b(0x1ec)]+':',_0x165eb2[_0x43d95b(0x1ed)]);});}catch(_0x4a9294){console['error'](_0x3bdf38(0x1f1),_0x4a9294);}}async['rotateOldLogs'](){const _0x1900c1=a168_0x34b707;try{const _0x51216c=await readdir(this[_0x1900c1(0x217)]),_0x40ac51=new Date()[_0x1900c1(0x1fd)]()[_0x1900c1(0x20b)]('T')[0x0];if(_0x51216c[_0x1900c1(0x1f3)](this['logFileName'])){const _0x2f3b4a=join(this['logDir'],this[_0x1900c1(0x1ec)]),_0x54d26c=await stat(_0x2f3b4a),_0x20ec56=new Date(_0x54d26c[_0x1900c1(0x218)])[_0x1900c1(0x1fd)]()['split']('T')[0x0];if(_0x20ec56<_0x40ac51){const _0x292468=join(this[_0x1900c1(0x217)],this[_0x1900c1(0x20a)]+'-'+_0x20ec56+_0x1900c1(0x224));await rename(_0x2f3b4a,_0x292468);}}const _0x35f159=await readdir(this[_0x1900c1(0x217)]),_0xf3b120=this[_0x1900c1(0x20a)][_0x1900c1(0x20f)](/[.*+?^${}()|[\]\\]/g,_0x1900c1(0x21e)),_0x26da01=new RegExp('^'+_0xf3b120+'-(\x5cd{4}-\x5cd{2}-\x5cd{2})\x5c.log$'),_0x13681f=_0x35f159[_0x1900c1(0x205)](_0x59abf9=>_0x26da01[_0x1900c1(0x219)](_0x59abf9));for(const _0x5c6ed4 of _0x13681f){const _0x18bae7=join(this[_0x1900c1(0x217)],_0x5c6ed4),_0x4ea5b6=join(this[_0x1900c1(0x217)],_0x5c6ed4+_0x1900c1(0x22b));try{await pipeline(createReadStream(_0x18bae7),createGzip(),createWriteStream(_0x4ea5b6)),await unlink(_0x18bae7);}catch(_0x1d4d55){console[_0x1900c1(0x200)](_0x1900c1(0x223)+_0x5c6ed4+':',_0x1d4d55);}}}catch{}}[a168_0x34b707(0x209)](..._0x3c51fc){const _0x30f5a4=a168_0x34b707;if(this['logLevel']>LogLevel['DEBUG'])return;const _0x31597d=formatColoredLogEntry('debug',_0x3c51fc);this[_0x30f5a4(0x21a)]?.['write'](_0x31597d+'\x0a');}['trace'](..._0xb791cc){const _0x2b9a44=a168_0x34b707;if(this[_0x2b9a44(0x1eb)]>LogLevel[_0x2b9a44(0x227)])return;const _0x1b7d69=formatColoredLogEntry(_0x2b9a44(0x1fe),_0xb791cc);this[_0x2b9a44(0x21a)]?.['write'](_0x1b7d69+'\x0a');}[a168_0x34b707(0x207)](..._0x179ed3){const _0x903eb=a168_0x34b707;if(this[_0x903eb(0x1eb)]>LogLevel[_0x903eb(0x20d)])return;const _0x41251c=formatColoredLogEntry(_0x903eb(0x207),_0x179ed3);!this[_0x903eb(0x203)]&&console[_0x903eb(0x1ef)](_0x41251c),this[_0x903eb(0x21a)]?.[_0x903eb(0x1ee)](_0x41251c+'\x0a');}[a168_0x34b707(0x204)](..._0x3155ec){const _0x30b527=a168_0x34b707;if(this[_0x30b527(0x1eb)]>LogLevel[_0x30b527(0x1fc)])return;const _0x51a51a=formatColoredLogEntry('warn',_0x3155ec);!this['fileOnly']&&console[_0x30b527(0x200)](_0x51a51a),this[_0x30b527(0x21a)]?.[_0x30b527(0x1ee)](_0x51a51a+'\x0a');}['error'](..._0x14319a){const _0x26e489=a168_0x34b707,_0x497646=formatColoredLogEntry(_0x26e489(0x200),_0x14319a);!this[_0x26e489(0x203)]&&console['error'](_0x497646),this[_0x26e489(0x21a)]?.[_0x26e489(0x1ee)](_0x497646+'\x0a');}async[a168_0x34b707(0x228)](){const _0x35168e=a168_0x34b707;return this[_0x35168e(0x207)](_0x35168e(0x208)),new Promise(_0x386800=>{const _0x528508=_0x35168e;this[_0x528508(0x21a)]?this[_0x528508(0x21a)]['end'](()=>{_0x386800();}):_0x386800();});}[a168_0x34b707(0x1ea)](){const _0x5f1af8=a168_0x34b707;return join(this[_0x5f1af8(0x217)],this[_0x5f1af8(0x1ec)]);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a169_0x45552b=a169_0x467e;(function(_0x2f97ab,_0x3bee3e){const _0x288081=a169_0x467e,_0x33c1a3=_0x2f97ab();while(!![]){try{const _0x1a45a6=parseInt(_0x288081(0x11b))/0x1+parseInt(_0x288081(0x109))/0x2+parseInt(_0x288081(0x112))/0x3*(-parseInt(_0x288081(0x10f))/0x4)+parseInt(_0x288081(0x111))/0x5+parseInt(_0x288081(0x106))/0x6*(parseInt(_0x288081(0x11c))/0x7)+parseInt(_0x288081(0x10d))/0x8*(parseInt(_0x288081(0x117))/0x9)+-parseInt(_0x288081(0x123))/0xa;if(_0x1a45a6===_0x3bee3e)break;else _0x33c1a3['push'](_0x33c1a3['shift']());}catch(_0x2144eb){_0x33c1a3['push'](_0x33c1a3['shift']());}}}(a169_0x5c99,0x65f0b));import{get}from'https';import{readFileSync,writeFileSync,mkdirSync}from'fs';function a169_0x467e(_0x121dd9,_0x598ab6){_0x121dd9=_0x121dd9-0x102;const _0x5c99d6=a169_0x5c99();let _0x467e78=_0x5c99d6[_0x121dd9];return _0x467e78;}import{join}from'path';import{gt,valid}from'semver';import a169_0x46a913 from'chalk';import{getCacheDir}from'../core/config.js';const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_URL=a169_0x45552b(0x125),TIMEOUT_MS=0x7d0;function getCacheFilePath(){const _0x620569=a169_0x45552b,_0x1c358f=getCacheDir();return join(_0x1c358f,_0x620569(0x11f));}function readCache(){const _0x1db9be=a169_0x45552b;try{const _0x578176=getCacheFilePath(),_0x199200=readFileSync(_0x578176,_0x1db9be(0x10a));return JSON[_0x1db9be(0x126)](_0x199200);}catch{return null;}}function a169_0x5c99(){const _0x26057b=['Invalid\x20version\x20format','54IMcpDh','end','now','green','460898KOAEkA','31913KmVgJp','NO_COLOR','gray','last_version_check','HTTP\x20','Request\x20timeout','currentVersion','2423820GwzWfw','stderr','https://registry.npmjs.org/@treasuredata/tdx/latest','parse','dim','Update\x20available:','yellow','Run:','statusCode','getTime','write','updateAvailable','474afLYea','\x0aRun:\x20','stringify','600306doxULJ','utf-8','npm\x20install\x20-g\x20@treasuredata/tdx@latest','data','43312wHvZJQ','cyan','296AMwpEL','isTTY','756085oiNcKq','26148WpxNmv','latestVersion','lastCheck','toISOString'];a169_0x5c99=function(){return _0x26057b;};return a169_0x5c99();}function writeCache(_0x33f927){const _0x226e5d=a169_0x45552b;try{const _0x70f1e3=getCacheDir();mkdirSync(_0x70f1e3,{'recursive':!![]});const _0x407baa={'lastCheck':new Date()[_0x226e5d(0x115)](),'latestVersion':_0x33f927},_0x7cf1be=getCacheFilePath();writeFileSync(_0x7cf1be,JSON[_0x226e5d(0x108)](_0x407baa,null,0x2),_0x226e5d(0x10a));}catch{}}function isCacheValid(_0x5002ee){const _0x1a150d=a169_0x45552b;if(!_0x5002ee)return![];const _0xa49ec3=new Date(_0x5002ee[_0x1a150d(0x114)])[_0x1a150d(0x103)](),_0x40b119=Date[_0x1a150d(0x119)]();return _0x40b119-_0xa49ec3<CACHE_DURATION_MS;}function fetchLatestVersion(){return new Promise((_0x102b58,_0x13aafa)=>{const _0x51b27b=get(NPM_REGISTRY_URL,_0x42fa1a=>{const _0x239a86=a169_0x467e;if(_0x42fa1a[_0x239a86(0x102)]!==0xc8){clearTimeout(_0x19957b),_0x13aafa(new Error(_0x239a86(0x120)+_0x42fa1a[_0x239a86(0x102)]));return;}let _0x361a4a='';_0x42fa1a['on'](_0x239a86(0x10c),_0x150896=>{_0x361a4a+=_0x150896;}),_0x42fa1a['on'](_0x239a86(0x118),()=>{const _0x2a0ccf=_0x239a86;clearTimeout(_0x19957b);try{const _0xe7bda4=JSON[_0x2a0ccf(0x126)](_0x361a4a);if(!valid(_0xe7bda4['version'])){_0x13aafa(new Error(_0x2a0ccf(0x116)));return;}_0x102b58(_0xe7bda4['version']);}catch(_0x4847b1){_0x13aafa(_0x4847b1);}});})['on']('error',_0x15afbf=>{clearTimeout(_0x19957b),_0x13aafa(_0x15afbf);}),_0x19957b=setTimeout(()=>{const _0x5b6a1f=a169_0x467e;_0x51b27b['destroy'](),_0x13aafa(new Error(_0x5b6a1f(0x121)));},TIMEOUT_MS);});}export async function checkForUpdate(_0x26859e){const _0xee28e2=a169_0x45552b;try{const _0x32731c=readCache();if(isCacheValid(_0x32731c)){const _0x2693a3=gt(_0x32731c[_0xee28e2(0x113)],_0x26859e);return{'updateAvailable':_0x2693a3,'currentVersion':_0x26859e,'latestVersion':_0x32731c['latestVersion']};}const _0xcb54cc=await fetchLatestVersion();writeCache(_0xcb54cc);const _0x5c44d1=gt(_0xcb54cc,_0x26859e);return{'updateAvailable':_0x5c44d1,'currentVersion':_0x26859e,'latestVersion':_0xcb54cc};}catch{return null;}}export function displayUpdateNotification(_0x3a75b3){const _0x3ee8bd=a169_0x45552b;if(!_0x3a75b3[_0x3ee8bd(0x105)])return;const _0x18fdf0=process[_0x3ee8bd(0x124)][_0x3ee8bd(0x110)]&&!process['env'][_0x3ee8bd(0x11d)],_0x55e5c7=_0x18fdf0?a169_0x46a913[_0x3ee8bd(0x11e)]('→'):'→',_0xcffa89=_0x18fdf0?a169_0x46a913[_0x3ee8bd(0x127)](_0x3a75b3[_0x3ee8bd(0x122)]):_0x3a75b3['currentVersion'],_0x2bae3b=_0x18fdf0?a169_0x46a913[_0x3ee8bd(0x11a)](_0x3a75b3[_0x3ee8bd(0x113)]):_0x3a75b3['latestVersion'],_0x4f1f3f=_0x18fdf0?a169_0x46a913[_0x3ee8bd(0x10e)](_0x3ee8bd(0x10b)):'npm\x20install\x20-g\x20@treasuredata/tdx@latest',_0x492941=_0x18fdf0?'\x0a'+a169_0x46a913[_0x3ee8bd(0x129)](_0x3ee8bd(0x128))+'\x20'+_0xcffa89+'\x20'+_0x55e5c7+'\x20'+_0x2bae3b+'\x0a'+a169_0x46a913[_0x3ee8bd(0x127)](_0x3ee8bd(0x12a))+'\x20'+_0x4f1f3f+'\x0a':'\x0aUpdate\x20available:\x20'+_0xcffa89+'\x20'+_0x55e5c7+'\x20'+_0x2bae3b+_0x3ee8bd(0x107)+_0x4f1f3f+'\x0a';process['stderr'][_0x3ee8bd(0x104)](_0x492941);}
|