@treasuredata/tdx 0.8.10 → 0.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.d.ts +10 -1
- package/dist/client/cdp-api-client.d.ts.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/cdp-api-client.js.map +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +23 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +12 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.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/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +15 -1
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +5 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +18 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +37 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.d.ts +2 -0
- package/dist/utils/tree-formatter.d.ts.map +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/tree-formatter.js.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a100_0xe161(_0x2069eb,_0x2de062){_0x2069eb=_0x2069eb-0x11d;const _0x4df4de=a100_0x4df4();let _0xe16157=_0x4df4de[_0x2069eb];return _0xe16157;}function a100_0x4df4(){const _0x605503=['utf-8','parse','Permission\x20denied\x20reading\x20file:\x20','PERMISSION_DENIED','File\x20not\x20found:\x20','10591944BUhVNX','INVALID_ARGUMENT','code','Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','NOT_FOUND','2451974YQBpfK','268824wCmkBD','66ePNtad','ENOENT','298LEappZ','Invalid\x20JSON\x20string:\x20','20iWvbyi','message','8872nSpHJn','8236308ehCqVE','45KDDQkE','1452NnbzGJ','3340wpxWoG','EACCES','Failed\x20to\x20load\x20JSON:\x20','Invalid\x20JSON\x20in\x20file\x20\x27','INTERNAL','3349908WtnHga'];a100_0x4df4=function(){return _0x605503;};return a100_0x4df4();}(function(_0x46ddf7,_0xc4ec72){const _0x48cbdc=a100_0xe161,_0x222765=_0x46ddf7();while(!![]){try{const _0x24e722=parseInt(_0x48cbdc(0x12f))/0x1*(parseInt(_0x48cbdc(0x137))/0x2)+parseInt(_0x48cbdc(0x136))/0x3*(-parseInt(_0x48cbdc(0x133))/0x4)+parseInt(_0x48cbdc(0x135))/0x5*(-parseInt(_0x48cbdc(0x12c))/0x6)+-parseInt(_0x48cbdc(0x12b))/0x7+-parseInt(_0x48cbdc(0x126))/0x8+parseInt(_0x48cbdc(0x120))/0x9*(-parseInt(_0x48cbdc(0x131))/0xa)+parseInt(_0x48cbdc(0x12d))/0xb*(parseInt(_0x48cbdc(0x134))/0xc);if(_0x24e722===_0xc4ec72)break;else _0x222765['push'](_0x222765['shift']());}catch(_0x43c8fd){_0x222765['push'](_0x222765['shift']());}}}(a100_0x4df4,0xafdef));import{readFile}from'fs/promises';import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x4e7168,_0x397790){const _0x110881=a100_0xe161;try{if(_0x397790){const _0x145349=await readFile(_0x4e7168,_0x110881(0x121));try{return JSON['parse'](_0x145349);}catch(_0x1bd1df){throw new SDKError(ErrorCode[_0x110881(0x127)],_0x110881(0x11e)+_0x4e7168+'\x27:\x20'+(_0x1bd1df instanceof Error?_0x1bd1df[_0x110881(0x132)]:String(_0x1bd1df)));}}else try{return JSON[_0x110881(0x122)](_0x4e7168);}catch(_0x33eec0){throw new SDKError(ErrorCode[_0x110881(0x127)],_0x110881(0x130)+(_0x33eec0 instanceof Error?_0x33eec0[_0x110881(0x132)]:String(_0x33eec0)));}}catch(_0xe6a7e3){if(_0xe6a7e3 instanceof SDKError)throw _0xe6a7e3;if(_0xe6a7e3 instanceof Error&&'code'in _0xe6a7e3){const _0x434b7d=_0xe6a7e3;if(_0x434b7d['code']===_0x110881(0x12e))throw new SDKError(ErrorCode[_0x110881(0x12a)],_0x110881(0x125)+_0x4e7168);else{if(_0x434b7d[_0x110881(0x128)]===_0x110881(0x138))throw new SDKError(ErrorCode[_0x110881(0x124)],_0x110881(0x123)+_0x4e7168);}}throw new SDKError(ErrorCode[_0x110881(0x11f)],_0x110881(0x11d)+(_0xe6a7e3 instanceof Error?_0xe6a7e3[_0x110881(0x132)]:String(_0xe6a7e3)));}}export async function loadJSONFromOptions(_0x3c79a8,_0x6c1390){const _0x426f8a=a100_0xe161;if(_0x3c79a8&&_0x6c1390)throw new SDKError(ErrorCode[_0x426f8a(0x127)],_0x426f8a(0x129));if(_0x3c79a8)return await loadJSON(_0x3c79a8,![]);if(_0x6c1390)return await loadJSON(_0x6c1390,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4abed5,_0x3c6b1d){const _0xc41ddf=a101_0x713c,_0x2c4975=_0x4abed5();while(!![]){try{const _0x3ecfaf=parseInt(_0xc41ddf(0xca))/0x1+parseInt(_0xc41ddf(0xc8))/0x2*(parseInt(_0xc41ddf(0xc7))/0x3)+parseInt(_0xc41ddf(0xd5))/0x4*(-parseInt(_0xc41ddf(0xcf))/0x5)+parseInt(_0xc41ddf(0xcb))/0x6+-parseInt(_0xc41ddf(0xc9))/0x7+-parseInt(_0xc41ddf(0xcc))/0x8*(-parseInt(_0xc41ddf(0xce))/0x9)+parseInt(_0xc41ddf(0xd3))/0xa*(parseInt(_0xc41ddf(0xd6))/0xb);if(_0x3ecfaf===_0x3c6b1d)break;else _0x2c4975['push'](_0x2c4975['shift']());}catch(_0x4bde0e){_0x2c4975['push'](_0x2c4975['shift']());}}}(a101_0x20d7,0x871be));function a101_0x20d7(){const _0x50760e=['targetAgentId','70YJEMDY','get','4PWaLWG','678161UrBWvF','map','1.0','4479idSsMU','590ePinEE','5997271dQJEwv','570489AZwMcj','2603706xIPaob','1398448kosTjQ','tools','27fBQtnR','4953455fEsrKi','attributes','targetKnowledgeBaseId'];a101_0x20d7=function(){return _0x50760e;};return a101_0x20d7();}function a101_0x713c(_0x41d6bd,_0x1eee93){_0x41d6bd=_0x41d6bd-0xc6;const _0x20d736=a101_0x20d7();let _0x713cba=_0x20d736[_0x41d6bd];return _0x713cba;}export function canCreateAgent(_0x38d449,_0x5c5887){const _0xc315fa=a101_0x713c;for(const _0x4b8dcf of _0x38d449[_0xc315fa(0xd0)][_0xc315fa(0xcd)]){if(_0x4b8dcf[_0xc315fa(0xd2)]&&!_0x5c5887['has'](_0x4b8dcf[_0xc315fa(0xd2)]))return![];}return!![];}export function remapToolIds(_0x5e80c3,_0x14fb77,_0x39bf26){const _0x17833d=a101_0x713c;return _0x5e80c3[_0x17833d(0xd7)](_0x4168a8=>({..._0x4168a8,'targetKnowledgeBaseId':_0x4168a8[_0x17833d(0xd1)]?_0x14fb77[_0x17833d(0xd4)](_0x4168a8['targetKnowledgeBaseId'])||_0x4168a8['targetKnowledgeBaseId']:undefined,'targetAgentId':_0x4168a8['targetAgentId']?_0x39bf26[_0x17833d(0xd4)](_0x4168a8[_0x17833d(0xd2)])||_0x4168a8[_0x17833d(0xd2)]:undefined}));}export function remapVariableIds(_0xf3cb4f,_0x45a203){const _0x4ecad3=a101_0x713c;return _0xf3cb4f[_0x4ecad3(0xd7)](_0xf98f7e=>({..._0xf98f7e,'targetKnowledgeBaseId':_0x45a203['get'](_0xf98f7e[_0x4ecad3(0xd1)])||_0xf98f7e[_0x4ecad3(0xd1)]}));}export function isSupportedBackupVersion(_0x87e11d){const _0x54b73c=a101_0x713c;return _0x87e11d===_0x54b73c(0xc6);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a102_0x139b6e=a102_0xc0fb;(function(_0x598f9d,_0x321011){const _0x497c7c=a102_0xc0fb,_0x1669fd=_0x598f9d();while(!![]){try{const _0x27d71c=-parseInt(_0x497c7c(0xfb))/0x1*(-parseInt(_0x497c7c(0xf8))/0x2)+-parseInt(_0x497c7c(0xf5))/0x3+parseInt(_0x497c7c(0x103))/0x4*(parseInt(_0x497c7c(0xff))/0x5)+parseInt(_0x497c7c(0x102))/0x6*(-parseInt(_0x497c7c(0xf7))/0x7)+-parseInt(_0x497c7c(0x100))/0x8*(parseInt(_0x497c7c(0xfc))/0x9)+-parseInt(_0x497c7c(0xf6))/0xa+parseInt(_0x497c7c(0xf9))/0xb*(parseInt(_0x497c7c(0x101))/0xc);if(_0x27d71c===_0x321011)break;else _0x1669fd['push'](_0x1669fd['shift']());}catch(_0x9d7c13){_0x1669fd['push'](_0x1669fd['shift']());}}}(a102_0x2c89,0x46e77));function a102_0x2c89(){const _0x38a3ee=['32qPUsuU','12oyMwhk','2609862pUlVBA','1157096YIYcPR','995841xGGnZp','4211950eyIkCJ','7hQjyCN','10454DQiVaA','13928739XLuOVR','claude-4.5-sonnet','21DfInqp','420183glbghB','match','toLowerCase','5GjFoVX'];a102_0x2c89=function(){return _0x38a3ee;};return a102_0x2c89();}function a102_0xc0fb(_0xc9dbc4,_0x117238){_0xc9dbc4=_0xc9dbc4-0xf5;const _0x2c89d9=a102_0x2c89();let _0xc0fb2a=_0x2c89d9[_0xc9dbc4];return _0xc0fb2a;}const MODEL_ALIASES={'haiku':'claude-4.5-haiku','sonnet':a102_0x139b6e(0xfa)};export function extractModelAlias(_0x4cf133){const _0xc688d9=a102_0x139b6e,_0x190483=_0x4cf133[_0xc688d9(0xfd)](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x190483)return _0x190483[0x1][_0xc688d9(0xfe)]();return _0x4cf133;}export function resolveModelAlias(_0x1c69f7){return MODEL_ALIASES[_0x1c69f7['toLowerCase']()]||_0x1c69f7;}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x102168,_0x123e3d){const _0x1253e8=a103_0x3bd5,_0x12f4e5=_0x102168();while(!![]){try{const _0x5c5e8a=-parseInt(_0x1253e8(0x113))/0x1*(-parseInt(_0x1253e8(0x117))/0x2)+-parseInt(_0x1253e8(0x11f))/0x3*(parseInt(_0x1253e8(0x11b))/0x4)+parseInt(_0x1253e8(0x11d))/0x5*(-parseInt(_0x1253e8(0x10f))/0x6)+-parseInt(_0x1253e8(0x125))/0x7*(-parseInt(_0x1253e8(0x10e))/0x8)+parseInt(_0x1253e8(0x126))/0x9+parseInt(_0x1253e8(0x123))/0xa*(-parseInt(_0x1253e8(0x111))/0xb)+parseInt(_0x1253e8(0x11c))/0xc;if(_0x5c5e8a===_0x123e3d)break;else _0x12f4e5['push'](_0x12f4e5['shift']());}catch(_0x36d30d){_0x12f4e5['push'](_0x12f4e5['shift']());}}}(a103_0x33a4,0xa77f2));export const MODEL_FACTORS={'sonnet':0xa,'claude-4.5-sonnet':0xa,'claude-sonnet-4':0xa,'haiku':3.4,'claude-4.5-haiku':3.4,'claude-haiku-4':3.4,'opus':0xf,'claude-4-opus':0xf,'claude-opus-4':0xf};export const CONTEXT_LIMITS={'sonnet':0x30d40,'haiku':0x30d40,'opus':0x30d40,'default':0x30d40};export function getModelFactor(_0x48b563){const _0x4ea1d2=a103_0x3bd5,_0x85dc72=_0x48b563[_0x4ea1d2(0x128)]();if(MODEL_FACTORS[_0x85dc72])return MODEL_FACTORS[_0x85dc72];if(_0x85dc72[_0x4ea1d2(0x115)](_0x4ea1d2(0x116)))return MODEL_FACTORS[_0x4ea1d2(0x116)];if(_0x85dc72[_0x4ea1d2(0x115)](_0x4ea1d2(0x121)))return MODEL_FACTORS['haiku'];if(_0x85dc72[_0x4ea1d2(0x115)](_0x4ea1d2(0x118)))return MODEL_FACTORS[_0x4ea1d2(0x118)];return MODEL_FACTORS['sonnet'];}function a103_0x33a4(){const _0x1d3e89=['567416dtMZnh','10916004REzccu','20065JjeJBY','Sonnet\x204.5','12zoYoyA','Haiku\x204.5','haiku','Sonnet\x204','2610TfOlKG','Haiku\x204','5281087zuNrld','5961843QoxncM','round','toLowerCase','Opus\x204.5','Opus\x204','8yIBSma','1410MFAcKR','Claude','16357fjEMMG','en-US','1iHsqDj','4.5','includes','sonnet','516218utzHWY','opus','4-5','default'];a103_0x33a4=function(){return _0x1d3e89;};return a103_0x33a4();}export function getContextLimit(_0x54d6e1){const _0x19e889=a103_0x3bd5,_0x53797e=_0x54d6e1[_0x19e889(0x128)]();if(_0x53797e[_0x19e889(0x115)](_0x19e889(0x116)))return CONTEXT_LIMITS[_0x19e889(0x116)];if(_0x53797e[_0x19e889(0x115)](_0x19e889(0x121)))return CONTEXT_LIMITS[_0x19e889(0x121)];if(_0x53797e[_0x19e889(0x115)](_0x19e889(0x118)))return CONTEXT_LIMITS[_0x19e889(0x118)];return CONTEXT_LIMITS[_0x19e889(0x11a)];}export function calculateChatUnit(_0x2b8c37,_0x436a1d,_0x220333){return(_0x2b8c37+_0x436a1d)/0x1388*_0x220333;}export function calculateCredits(_0x1e3009){return _0x1e3009/0x2904;}export function getModelDisplayName(_0x2b3a02){const _0x5b0a83=a103_0x3bd5,_0x55c02e=_0x2b3a02[_0x5b0a83(0x128)]();if(_0x55c02e['includes']('sonnet')){if(_0x55c02e['includes']('4-5')||_0x55c02e[_0x5b0a83(0x115)](_0x5b0a83(0x114)))return _0x5b0a83(0x11e);return _0x5b0a83(0x122);}if(_0x55c02e[_0x5b0a83(0x115)](_0x5b0a83(0x121))){if(_0x55c02e[_0x5b0a83(0x115)]('4-5')||_0x55c02e[_0x5b0a83(0x115)](_0x5b0a83(0x114)))return _0x5b0a83(0x120);return _0x5b0a83(0x124);}if(_0x55c02e['includes'](_0x5b0a83(0x118))){if(_0x55c02e[_0x5b0a83(0x115)](_0x5b0a83(0x119))||_0x55c02e[_0x5b0a83(0x115)](_0x5b0a83(0x114)))return _0x5b0a83(0x129);return _0x5b0a83(0x10d);}return _0x5b0a83(0x110);}export function formatTokenCount(_0x21a0d5){const _0x2c76e4=a103_0x3bd5;return _0x21a0d5['toLocaleString'](_0x2c76e4(0x112));}function a103_0x3bd5(_0x230607,_0x349893){_0x230607=_0x230607-0x10d;const _0x33a45b=a103_0x33a4();let _0x3bd547=_0x33a45b[_0x230607];return _0x3bd547;}export function calculateContextPercentage(_0x5f366d,_0xd3035b){const _0xdba13c=a103_0x3bd5,_0x43c851=getContextLimit(_0xd3035b);return Math[_0xdba13c(0x127)](_0x5f366d/_0x43c851*0x64);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a104_0xbfb8(_0x43e973,_0x1e1b85){_0x43e973=_0x43e973-0x181;const _0x58549e=a104_0x5854();let _0xbfb835=_0x58549e[_0x43e973];return _0xbfb835;}(function(_0x3fbc22,_0x3b91a3){const _0x517ff8=a104_0xbfb8,_0x18e055=_0x3fbc22();while(!![]){try{const _0x4b2c2b=parseInt(_0x517ff8(0x187))/0x1+parseInt(_0x517ff8(0x18b))/0x2*(parseInt(_0x517ff8(0x188))/0x3)+-parseInt(_0x517ff8(0x184))/0x4*(-parseInt(_0x517ff8(0x183))/0x5)+parseInt(_0x517ff8(0x185))/0x6+parseInt(_0x517ff8(0x189))/0x7+-parseInt(_0x517ff8(0x18e))/0x8+-parseInt(_0x517ff8(0x18c))/0x9;if(_0x4b2c2b===_0x3b91a3)break;else _0x18e055['push'](_0x18e055['shift']());}catch(_0x47568f){_0x18e055['push'](_0x18e055['shift']());}}}(a104_0x5854,0xaa85c));export function validateLimitOption(_0x50e48b){const _0x2743ad=a104_0xbfb8;if(!Number['isInteger'](_0x50e48b))return{'isValid':![],'error':_0x2743ad(0x181)+_0x50e48b+'.\x20Must\x20be\x20an\x20integer.'};if(_0x50e48b<=0x0)return{'isValid':![],'error':_0x2743ad(0x181)+_0x50e48b+_0x2743ad(0x182)};return{'isValid':!![],'value':_0x50e48b};}export function validateTimeoutOption(_0x4adc42,_0x233193=0x1e){const _0x43bbd0=a104_0xbfb8;if(_0x4adc42===undefined)return{'isValid':!![],'value':_0x233193};const _0x18553e=typeof _0x4adc42===_0x43bbd0(0x186)?_0x4adc42:parseFloat(_0x4adc42);if(isNaN(_0x18553e))return{'isValid':![],'error':_0x43bbd0(0x18a)+_0x4adc42+_0x43bbd0(0x18d)};if(_0x18553e<=0x0)return{'isValid':![],'error':_0x43bbd0(0x18a)+_0x18553e+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x18553e};}function a104_0x5854(){const _0x23bb03=['.\x20Must\x20be\x20a\x20number.','9802760wuBTsx','Invalid\x20limit\x20value:\x20','.\x20Must\x20be\x20a\x20positive\x20integer.','305SeRVsk','20312jkHfHM','3594840fLEYkD','number','167024plpsWO','3469152MYtGmQ','5644499XWyHdY','Invalid\x20timeout\x20value:\x20','2OzYLbl','10033722ojtNlW'];a104_0x5854=function(){return _0x23bb03;};return a104_0x5854();}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a105_0x7abc(_0x318855,_0x574881){_0x318855=_0x318855-0xfe;const _0x58930c=a105_0x5893();let _0x7abc30=_0x58930c[_0x318855];return _0x7abc30;}(function(_0x48cbba,_0x4fbc77){const _0x29a9bb=a105_0x7abc,_0xed8cfb=_0x48cbba();while(!![]){try{const _0x24d50c=parseInt(_0x29a9bb(0x10f))/0x1+-parseInt(_0x29a9bb(0x102))/0x2*(parseInt(_0x29a9bb(0x10b))/0x3)+parseInt(_0x29a9bb(0x10d))/0x4*(parseInt(_0x29a9bb(0x10c))/0x5)+-parseInt(_0x29a9bb(0x106))/0x6*(-parseInt(_0x29a9bb(0xff))/0x7)+parseInt(_0x29a9bb(0x108))/0x8*(-parseInt(_0x29a9bb(0x110))/0x9)+parseInt(_0x29a9bb(0x107))/0xa+-parseInt(_0x29a9bb(0x10e))/0xb*(-parseInt(_0x29a9bb(0xfe))/0xc);if(_0x24d50c===_0x4fbc77)break;else _0xed8cfb['push'](_0xed8cfb['shift']());}catch(_0x69aee6){_0xed8cfb['push'](_0xed8cfb['shift']());}}}(a105_0x5893,0xc5b05));import{createServer}from'node:net';export async function isPortAvailable(_0x2d4dcf){return new Promise(_0x235b2c=>{const _0x44c754=a105_0x7abc,_0x200c73=createServer();_0x200c73[_0x44c754(0x103)]('error',_0x4b950f=>{const _0x510fb5=_0x44c754;_0x4b950f['code']===_0x510fb5(0x109)?_0x235b2c(![]):_0x235b2c(![]);}),_0x200c73[_0x44c754(0x103)](_0x44c754(0x10a),()=>{const _0x27f6cb=_0x44c754;_0x200c73[_0x27f6cb(0x104)](),_0x235b2c(!![]);}),_0x200c73[_0x44c754(0x105)](_0x2d4dcf,_0x44c754(0x101));});}function a105_0x5893(){const _0x15cd9b=['0.0.0.0','3240jdJQCe','once','close','listen','6YvUWxn','6118610jtwCYw','48cULhZl','EADDRINUSE','listening','2913mosevM','3406295HKmXAh','4WWPuQO','11mOxfhS','163488QaqbPC','2361591iPZvLZ','24627624sGQeoD','3137659DxPgcd','No\x20available\x20port\x20found\x20between\x20'];a105_0x5893=function(){return _0x15cd9b;};return a105_0x5893();}export async function findAvailablePort(_0x208215=0xfa0,_0x2ab700=0x64){const _0x57cf80=a105_0x7abc;for(let _0x4b8280=0x0;_0x4b8280<_0x2ab700;_0x4b8280++){const _0x38eccc=_0x208215+_0x4b8280;if(await isPortAvailable(_0x38eccc))return _0x38eccc;}throw new Error(_0x57cf80(0x100)+_0x208215+'\x20and\x20'+(_0x208215+_0x2ab700-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a106_0x168495=a106_0x23d8;(function(_0x13362e,_0x462059){const _0x289e1c=a106_0x23d8,_0x74f95d=_0x13362e();while(!![]){try{const _0x1ec199=-parseInt(_0x289e1c(0x19b))/0x1*(parseInt(_0x289e1c(0x1a4))/0x2)+-parseInt(_0x289e1c(0x188))/0x3*(-parseInt(_0x289e1c(0x195))/0x4)+-parseInt(_0x289e1c(0x1ac))/0x5*(-parseInt(_0x289e1c(0x1ae))/0x6)+parseInt(_0x289e1c(0x19e))/0x7+-parseInt(_0x289e1c(0x18f))/0x8+-parseInt(_0x289e1c(0x190))/0x9*(-parseInt(_0x289e1c(0x18e))/0xa)+-parseInt(_0x289e1c(0x189))/0xb*(parseInt(_0x289e1c(0x185))/0xc);if(_0x1ec199===_0x462059)break;else _0x74f95d['push'](_0x74f95d['shift']());}catch(_0x48f350){_0x74f95d['push'](_0x74f95d['shift']());}}}(a106_0x1a92,0x76301));import{execSync,spawn}from'node:child_process';const SHELL_NAMES=new Set([a106_0x168495(0x192),'zsh','sh','fish',a106_0x168495(0x19f),a106_0x168495(0x193),'csh',a106_0x168495(0x198),'pwsh',a106_0x168495(0x1a0),'nu',a106_0x168495(0x18b),a106_0x168495(0x1aa),a106_0x168495(0x183)]),EPHEMERAL_SHELL_SPAWNERS=new Set([a106_0x168495(0x194),a106_0x168495(0x1ab),a106_0x168495(0x1a2)]);function getProcessInfoWindows(_0x7c0541){const _0x201d5b=a106_0x168495;try{if(!Number[_0x201d5b(0x1a3)](_0x7c0541)||_0x7c0541<=0x0)return null;const _0x12d913=execSync(_0x201d5b(0x19d)+_0x7c0541+'\x20get\x20ParentProcessId,Name\x20/format:csv',{'encoding':'utf-8','windowsHide':!![]})['trim'](),_0x396d54=_0x12d913['split']('\x0a')[_0x201d5b(0x186)](_0x5274e6=>_0x5274e6['trim']());if(_0x396d54['length']<0x2)return null;const _0x3d356d=_0x396d54[_0x396d54[_0x201d5b(0x196)]-0x1][_0x201d5b(0x1b0)](',');if(_0x3d356d[_0x201d5b(0x196)]<0x3)return null;const _0x4bb738=_0x3d356d[0x1]?.[_0x201d5b(0x18a)]()||'',_0x3d2504=parseInt(_0x3d356d[0x2]?.[_0x201d5b(0x18a)]()||'0',0xa);if(isNaN(_0x3d2504)||!_0x4bb738)return null;return{'pid':_0x7c0541,'ppid':_0x3d2504,'comm':_0x4bb738[_0x201d5b(0x1a6)](/\.exe$/i,'')};}catch{return null;}}function getProcessInfoPosix(_0x1d94ac){const _0x7ef106=a106_0x168495;try{const _0xd63a52=0x400000;if(!Number[_0x7ef106(0x1a3)](_0x1d94ac)||_0x1d94ac<=0x0||_0x1d94ac>_0xd63a52)return null;const _0x2c2517=execSync(_0x7ef106(0x187)+_0x1d94ac+'\x20-o\x20ppid=,comm=',{'encoding':_0x7ef106(0x199),'stdio':_0x7ef106(0x1a7)})['trim'](),[_0x485cf2,..._0xd3c6e9]=_0x2c2517['split'](/\s+/),_0x375567=parseInt(_0x485cf2,0xa),_0x225919=_0xd3c6e9[_0x7ef106(0x1a9)]('\x20');if(isNaN(_0x375567))return null;return{'pid':_0x1d94ac,'ppid':_0x375567,'comm':_0x225919};}catch{return null;}}function a106_0x1a92(){const _0x3fbf9b=['win32','6EsIpON','pid','split','xonsh','ignore','353604GRMxYV','filter','ps\x20-p\x20','1527qQikqE','231lfwwtQ','trim','ion','pop','start','10ckKLLJ','1313128FyCfxW','6937209NqtBlP','has','bash','tcsh','claude','1936LwunmB','length','comm','dash','utf-8','platform','257306gPwyPo','xdg-open','wmic\x20process\x20where\x20ProcessId=','1098118MiZkCJ','ksh','powershell','open','cursor','isInteger','6pTJwzf','darwin','replace','pipe','ppid','join','elvish','code','4324660MUtelI'];a106_0x1a92=function(){return _0x3fbf9b;};return a106_0x1a92();}function getProcessInfo(_0x301b86){const _0x3ee921=a106_0x168495;if(process[_0x3ee921(0x19a)]===_0x3ee921(0x1ad))return getProcessInfoWindows(_0x301b86);return getProcessInfoPosix(_0x301b86);}function getBasename(_0x4d5b0c){const _0x5184c7=a106_0x168495;return _0x4d5b0c[_0x5184c7(0x1a6)](/^-/,'')[_0x5184c7(0x1b0)]('/')[_0x5184c7(0x18c)]()?.['toLowerCase']()||'';}function isShell(_0x4101cc){const _0x4f448f=a106_0x168495;return SHELL_NAMES[_0x4f448f(0x191)](getBasename(_0x4101cc));}function isEphemeralShellSpawner(_0x7aedff){const _0x514b2f=a106_0x168495;return EPHEMERAL_SHELL_SPAWNERS[_0x514b2f(0x191)](getBasename(_0x7aedff));}let cachedShellPID;function findShellPID(){const _0x406213=a106_0x168495;if(process[_0x406213(0x1a8)]===undefined)return process[_0x406213(0x1af)];let _0x2c40d7=process[_0x406213(0x1a8)];const _0x72b1fe=0xa;let _0x23221b=0x0;while(_0x23221b<_0x72b1fe){const _0xa4ac16=getProcessInfo(_0x2c40d7);if(!_0xa4ac16)break;if(isShell(_0xa4ac16[_0x406213(0x197)])){const _0x5b05f9=getProcessInfo(_0xa4ac16['ppid']);if(_0x5b05f9&&isEphemeralShellSpawner(_0x5b05f9[_0x406213(0x197)])){_0x2c40d7=_0xa4ac16['ppid'],_0x23221b++;continue;}return _0xa4ac16['pid'];}if(_0xa4ac16[_0x406213(0x1a8)]===0x0||_0xa4ac16['ppid']===0x1){if(isShell(_0xa4ac16['comm']))return _0xa4ac16['pid'];break;}_0x2c40d7=_0xa4ac16[_0x406213(0x1a8)],_0x23221b++;}return process[_0x406213(0x1a8)]!==undefined?process[_0x406213(0x1a8)]:process['pid'];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}function a106_0x23d8(_0x415e48,_0x5b81ed){_0x415e48=_0x415e48-0x183;const _0x1a920c=a106_0x1a92();let _0x23d850=_0x1a920c[_0x415e48];return _0x23d850;}export function isProcessRunning(_0x209924){const _0x1ec470=a106_0x168495;if(!Number[_0x1ec470(0x1a3)](_0x209924)||_0x209924<=0x0)return![];try{return process['kill'](_0x209924,0x0),!![];}catch{return![];}}export function openBrowser(_0xda2c06){const _0x2d6365=a106_0x168495,_0x408a09=process[_0x2d6365(0x19a)],_0x51f641=_0x408a09===_0x2d6365(0x1a5)?_0x2d6365(0x1a1):_0x408a09===_0x2d6365(0x1ad)?_0x2d6365(0x18d):_0x2d6365(0x19c);spawn(_0x51f641,[_0xda2c06],{'detached':!![],'stdio':_0x2d6365(0x184)})['unref']();}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d5702,_0x5ed892){const _0x52908e=a107_0x3b3f,_0x1b4ec0=_0x1d5702();while(!![]){try{const _0x301eb9=parseInt(_0x52908e(0x1a9))/0x1*(parseInt(_0x52908e(0x1ab))/0x2)+parseInt(_0x52908e(0x199))/0x3+parseInt(_0x52908e(0x1b2))/0x4+-parseInt(_0x52908e(0x1ad))/0x5+-parseInt(_0x52908e(0x1b4))/0x6*(-parseInt(_0x52908e(0x1aa))/0x7)+-parseInt(_0x52908e(0x19b))/0x8*(parseInt(_0x52908e(0x1af))/0x9)+parseInt(_0x52908e(0x1a2))/0xa;if(_0x301eb9===_0x5ed892)break;else _0x1b4ec0['push'](_0x1b4ec0['shift']());}catch(_0x16f894){_0x1b4ec0['push'](_0x1b4ec0['shift']());}}}(a107_0x4a7c,0xbdb91));import*as a107_0x17ead9 from'readline';function a107_0x4a7c(){const _0x501f6c=['7581530PWdRLk','createInterface','resume','utf8','write','\x20[y/N]\x20','question','1oBPQrH','6515327goGfLY','276914NUnJPk','exit','7090515PvzTwm','stdin','27nynyzv','toLowerCase','pause','3335516dfFedR','close','6TGLRsJ','1630167GGZzTL','data','2691816tdslte','stdout','isTTY','setEncoding','\x20(y/N):\x20','stderr','yes'];a107_0x4a7c=function(){return _0x501f6c;};return a107_0x4a7c();}export async function confirm(_0x2af184){const _0x503eb7=a107_0x3b3f,_0x89f9bb=a107_0x17ead9[_0x503eb7(0x1a3)]({'input':process['stdin'],'output':process[_0x503eb7(0x19c)]});return new Promise(_0x26e577=>{const _0x4803a9=_0x503eb7;_0x89f9bb[_0x4803a9(0x1a8)](_0x2af184+_0x4803a9(0x19f),_0x2985fd=>{const _0x55b8f9=_0x4803a9;_0x89f9bb[_0x55b8f9(0x1b3)](),_0x26e577(_0x2985fd[_0x55b8f9(0x1b0)]()==='y'||_0x2985fd[_0x55b8f9(0x1b0)]()===_0x55b8f9(0x1a1));});});}function a107_0x3b3f(_0x53cd21,_0x46cedf){_0x53cd21=_0x53cd21-0x199;const _0x4a7c44=a107_0x4a7c();let _0x3b3fda=_0x4a7c44[_0x53cd21];return _0x3b3fda;}export async function confirmKey(_0x2b34e9){const _0x5a3369=a107_0x3b3f;if(!process[_0x5a3369(0x1ae)][_0x5a3369(0x19d)])return![];return process['stderr']['write'](_0x2b34e9+_0x5a3369(0x1a7)),new Promise(_0xe1405d=>{const _0x2d7a5c=_0x5a3369,_0x4e63b0=process[_0x2d7a5c(0x1ae)];_0x4e63b0['setRawMode'](!![]),_0x4e63b0[_0x2d7a5c(0x1a4)](),_0x4e63b0[_0x2d7a5c(0x19e)](_0x2d7a5c(0x1a5));const _0x170e94=_0xba96e3=>{const _0x1c89c3=_0x2d7a5c;_0x4e63b0['setRawMode'](![]),_0x4e63b0[_0x1c89c3(0x1b1)](),_0x4e63b0['removeListener'](_0x1c89c3(0x19a),_0x170e94);if(_0xba96e3==='\x1b'){process[_0x1c89c3(0x1a0)]['write']('\x0a'),_0xe1405d(![]);return;}_0xba96e3==='\x03'&&(process[_0x1c89c3(0x1a0)][_0x1c89c3(0x1a6)]('\x0a'),process[_0x1c89c3(0x1ac)](0x82));if(_0xba96e3[_0x1c89c3(0x1b0)]()==='y'){process['stderr'][_0x1c89c3(0x1a6)]('y\x0a'),_0xe1405d(!![]);return;}process[_0x1c89c3(0x1a0)][_0x1c89c3(0x1a6)]('\x0a'),_0xe1405d(![]);};_0x4e63b0['on'](_0x2d7a5c(0x19a),_0x170e94);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17a6cb,_0x1252a8){const _0xa6cdb3=a108_0x5cbd,_0x2aaaa1=_0x17a6cb();while(!![]){try{const _0x2a8dd3=parseInt(_0xa6cdb3(0x141))/0x1*(parseInt(_0xa6cdb3(0x14e))/0x2)+-parseInt(_0xa6cdb3(0x146))/0x3+-parseInt(_0xa6cdb3(0x148))/0x4+-parseInt(_0xa6cdb3(0x16a))/0x5+parseInt(_0xa6cdb3(0x144))/0x6*(-parseInt(_0xa6cdb3(0x150))/0x7)+parseInt(_0xa6cdb3(0x15d))/0x8*(parseInt(_0xa6cdb3(0x159))/0x9)+parseInt(_0xa6cdb3(0x161))/0xa;if(_0x2a8dd3===_0x1252a8)break;else _0x2aaaa1['push'](_0x2aaaa1['shift']());}catch(_0xafa3d){_0x2aaaa1['push'](_0x2aaaa1['shift']());}}}(a108_0x4e1a,0x8cf58));import{existsSync,readFileSync}from'fs';import a108_0x40176a from'path';import{parse as a108_0x54681e}from'yaml';function a108_0x4e1a(){const _0x5a6ad9=['Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','1312MeZQUp','segments','type','push','10812750gzuSSa','join','raw','substring','endsWith','relative','utf-8','root','startsWith','537040rGrjXN','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Cannot\x20split\x20empty\x20path','70YFXppx','.yml','slice','4779864UffXrH','filter','202341jNfhHU','dirname','3477560flqnAE','segment','length','parent_segment','trim','isAbsolute','7822FwVCOc','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','7QTqZvQ','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','split','Path\x20segment\x20cannot\x20be\x20empty','pop','Cannot\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','Relative\x20path\x20cannot\x20be\x20empty','.yaml','58347FGthbz','tdx.json'];a108_0x4e1a=function(){return _0x5a6ad9;};return a108_0x4e1a();}function a108_0x5cbd(_0x4374d5,_0x1f2844){_0x4374d5=_0x4374d5-0x141;const _0x4e1a01=a108_0x4e1a();let _0x5cbdfd=_0x4e1a01[_0x4374d5];return _0x5cbdfd;}export function parsePath(_0x28abe8){const _0x3cf181=a108_0x5cbd;if(!_0x28abe8||_0x28abe8[_0x3cf181(0x14c)]()==='')throw new Error(_0x3cf181(0x156));const _0x1437bf=_0x28abe8['trim']();if(_0x1437bf==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x28abe8};const _0x20cb75=_0x1437bf[_0x3cf181(0x169)]('/')?_0x1437bf[_0x3cf181(0x164)](0x1):_0x1437bf,_0x4edd6e=_0x20cb75[_0x3cf181(0x152)]('/')[_0x3cf181(0x145)](_0x578b2e=>_0x578b2e!=='');if(_0x4edd6e[_0x3cf181(0x14a)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x4995e1=_0x1437bf[_0x3cf181(0x169)]('/')||!isRelativePathSegment(_0x4edd6e[0x0]);for(const _0x2a548c of _0x4edd6e){validatePathSegment(_0x2a548c);}return{'segments':_0x4edd6e,'isAbsolute':_0x4995e1,'raw':_0x28abe8};}function isRelativePathSegment(_0x42ff98){return _0x42ff98==='.'||_0x42ff98==='..';}function validatePathSegment(_0x2d460b){const _0x11d475=a108_0x5cbd;if(_0x2d460b==='')throw new Error(_0x11d475(0x153));if(_0x2d460b==='.'||_0x2d460b==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x2d460b))throw new Error(_0x11d475(0x14f)+_0x2d460b);if(_0x2d460b!==_0x2d460b[_0x11d475(0x14c)]()){}}export function validatePath(_0x176468){const _0x13f636=a108_0x5cbd;if(_0x176468[_0x13f636(0x15e)][_0x13f636(0x14a)]===0x0&&!_0x176468[_0x13f636(0x14d)])throw new Error(_0x13f636(0x157));if(_0x176468[_0x13f636(0x14d)]){if(_0x176468[_0x13f636(0x15e)][0x0]==='..')throw new Error(_0x13f636(0x15b));let _0x3d6a26=0x0;for(const _0x3f5f7f of _0x176468[_0x13f636(0x15e)]){if(_0x3f5f7f==='..'){if(_0x3d6a26===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x3d6a26--;}else _0x3f5f7f!=='.'&&_0x3d6a26++;}}}export function joinPaths(_0x57709c,_0x481c66){const _0x45a955=a108_0x5cbd;if(!_0x57709c||_0x57709c==='/')return _0x481c66;if(!_0x481c66||_0x481c66==='.')return _0x57709c;if(_0x481c66[_0x45a955(0x169)]('/'))return _0x481c66;const _0x3069b5=parsePath(_0x57709c),_0x302e2d=parsePath(_0x481c66),_0x46b17f=[..._0x3069b5[_0x45a955(0x15e)]];for(const _0x3b5249 of _0x302e2d[_0x45a955(0x15e)]){if(_0x3b5249==='.')continue;else{if(_0x3b5249==='..'){if(_0x46b17f[_0x45a955(0x14a)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x46b17f[_0x45a955(0x154)]();}else _0x46b17f[_0x45a955(0x160)](_0x3b5249);}}const _0x141c32=_0x46b17f[_0x45a955(0x162)]('/');return _0x3069b5[_0x45a955(0x163)][_0x45a955(0x169)]('/')?'/'+_0x141c32:_0x141c32;}export function normalizePath(_0x129872){const _0x1edeb3=a108_0x5cbd,_0x138e14=parsePath(_0x129872),_0x5cf8d0=[];for(const _0x5270ee of _0x138e14[_0x1edeb3(0x15e)]){if(_0x5270ee==='.')continue;else{if(_0x5270ee==='..'){if(_0x5cf8d0['length']===0x0){if(_0x138e14['isAbsolute'])throw new Error(_0x1edeb3(0x155));_0x5cf8d0['push']('..');}else _0x5cf8d0[_0x5cf8d0[_0x1edeb3(0x14a)]-0x1]==='..'?_0x5cf8d0[_0x1edeb3(0x160)]('..'):_0x5cf8d0[_0x1edeb3(0x154)]();}else _0x5cf8d0[_0x1edeb3(0x160)](_0x5270ee);}}if(_0x5cf8d0[_0x1edeb3(0x14a)]===0x0)return _0x138e14[_0x1edeb3(0x14d)]?'/':'.';const _0x68f117=_0x5cf8d0['join']('/');return _0x138e14[_0x1edeb3(0x163)][_0x1edeb3(0x169)]('/')?'/'+_0x68f117:_0x68f117;}export function getParentPath(_0xe633cc){const _0x505e86=a108_0x5cbd,_0xced6a4=parsePath(_0xe633cc);if(_0xced6a4[_0x505e86(0x15e)][_0x505e86(0x14a)]<=0x1)return'/';const _0x3d4be4=_0xced6a4[_0x505e86(0x15e)][_0x505e86(0x143)](0x0,-0x1)['join']('/');return _0xced6a4[_0x505e86(0x163)][_0x505e86(0x169)]('/')?'/'+_0x3d4be4:_0x3d4be4;}export function getBaseName(_0x476859){const _0x4dec41=a108_0x5cbd,_0x11d529=parsePath(_0x476859);return _0x11d529[_0x4dec41(0x15e)][_0x11d529[_0x4dec41(0x15e)][_0x4dec41(0x14a)]-0x1]||'';}export function isChildPath(_0x107d60,_0x1279dd){const _0x23d9ae=a108_0x5cbd,_0x38cd42=parsePath(_0x107d60),_0x4b79a1=parsePath(_0x1279dd);if(_0x38cd42[_0x23d9ae(0x15e)][_0x23d9ae(0x14a)]<=_0x4b79a1[_0x23d9ae(0x15e)][_0x23d9ae(0x14a)])return![];for(let _0x409809=0x0;_0x409809<_0x4b79a1['segments'][_0x23d9ae(0x14a)];_0x409809++){if(_0x38cd42[_0x23d9ae(0x15e)][_0x409809]!==_0x4b79a1[_0x23d9ae(0x15e)][_0x409809])return![];}return!![];}export function splitPath(_0x3e4917){const _0xb61552=a108_0x5cbd,_0x17c6cd=parsePath(_0x3e4917);if(_0x17c6cd[_0xb61552(0x15e)]['length']===0x0)throw new Error(_0xb61552(0x16c));if(_0x17c6cd[_0xb61552(0x15e)]['length']===0x1)return{'parent':_0x17c6cd[_0xb61552(0x15e)][0x0]};return{'parent':_0x17c6cd[_0xb61552(0x15e)][0x0],'child':_0x17c6cd[_0xb61552(0x15e)][_0xb61552(0x143)](0x1)[_0xb61552(0x162)]('/')};}export function isYamlFilePath(_0x5c799b){const _0x3a1a1b=a108_0x5cbd;return _0x5c799b[_0x3a1a1b(0x165)](_0x3a1a1b(0x142))||_0x5c799b[_0x3a1a1b(0x165)](_0x3a1a1b(0x158));}export function resolveYamlFilePath(_0x4881ce){const _0x397644=a108_0x5cbd,_0x3da5b1=a108_0x40176a['resolve'](_0x4881ce);if(!existsSync(_0x3da5b1))throw new Error('File\x20not\x20found:\x20'+_0x4881ce);let _0x243680=a108_0x40176a[_0x397644(0x147)](_0x3da5b1),_0x59ef0c=null,_0x18765e=null;const _0x559699=a108_0x40176a['parse'](_0x243680)[_0x397644(0x168)];while(_0x243680!==_0x559699){const _0x470cd9=a108_0x40176a[_0x397644(0x162)](_0x243680,_0x397644(0x15a));if(existsSync(_0x470cd9)){_0x59ef0c=_0x470cd9,_0x18765e=_0x243680;break;}_0x243680=a108_0x40176a[_0x397644(0x147)](_0x243680);}if(!_0x59ef0c||!_0x18765e)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x4881ce);const _0x1df1b7=readFileSync(_0x59ef0c,_0x397644(0x167)),_0x258e02=JSON[_0x397644(0x15c)](_0x1df1b7),_0x3b8722=_0x258e02[_0x397644(0x14b)];if(!_0x3b8722)throw new Error(_0x397644(0x16b));const _0x418767=readFileSync(_0x3da5b1,_0x397644(0x167)),_0x2af04f=a108_0x54681e(_0x418767),_0x973820=_0x2af04f['name'];if(!_0x973820)throw new Error(_0x397644(0x151)+_0x4881ce);const _0x1510d8=_0x2af04f[_0x397644(0x15f)]==='journey'?'journey':_0x397644(0x149),_0x20e415=a108_0x40176a[_0x397644(0x166)](_0x18765e,_0x3da5b1),_0x206cf5=a108_0x40176a[_0x397644(0x147)](_0x20e415),_0xef5c56=_0x206cf5==='.'?'':_0x206cf5['replace'](/\\/g,'/'),_0x2943ee=_0xef5c56?_0x3b8722+'/'+_0xef5c56+'/'+_0x973820:_0x3b8722+'/'+_0x973820;return{'parentSegment':_0x3b8722,'segmentName':_0x973820,'folderPath':_0xef5c56,'fullPath':_0x2943ee,'resourceType':_0x1510d8};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x16ebb2,_0x143c59){const _0x678533=a109_0x2ad1,_0x299720=_0x16ebb2();while(!![]){try{const _0x3620f0=parseInt(_0x678533(0x19d))/0x1+-parseInt(_0x678533(0x19b))/0x2+parseInt(_0x678533(0x1a1))/0x3*(parseInt(_0x678533(0x19f))/0x4)+parseInt(_0x678533(0x1a7))/0x5+parseInt(_0x678533(0x1a6))/0x6*(-parseInt(_0x678533(0x1a5))/0x7)+-parseInt(_0x678533(0x1a0))/0x8*(parseInt(_0x678533(0x1a3))/0x9)+-parseInt(_0x678533(0x19c))/0xa*(-parseInt(_0x678533(0x1a2))/0xb);if(_0x3620f0===_0x143c59)break;else _0x299720['push'](_0x299720['shift']());}catch(_0x297dac){_0x299720['push'](_0x299720['shift']());}}}(a109_0x2d24,0xad98b));function a109_0x2ad1(_0x435f3b,_0x429c7b){_0x435f3b=_0x435f3b-0x19b;const _0x2d24ba=a109_0x2d24();let _0x2ad186=_0x2d24ba[_0x435f3b];return _0x2ad186;}export function parseSegmentRef(_0xc9c1d6){const _0x58f9a8=a109_0x2ad1,_0x4a406b=_0xc9c1d6[_0x58f9a8(0x1a9)]('/');if(_0x4a406b===-0x1)return{'parentId':_0xc9c1d6};if(_0x4a406b===0x0)throw new Error(_0x58f9a8(0x1a8)+_0xc9c1d6+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x5e1e8d=_0xc9c1d6['substring'](0x0,_0x4a406b),_0x1e5a52=_0xc9c1d6[_0x58f9a8(0x19e)](_0x4a406b+0x1);if(_0x1e5a52==='')throw new Error(_0x58f9a8(0x1a8)+_0xc9c1d6+_0x58f9a8(0x1a4));return{'parentId':_0x5e1e8d,'childId':_0x1e5a52};}function a109_0x2d24(){const _0x4d8c54=['31603cpLpct','43371FaEiod','.\x20Child\x20name\x20cannot\x20be\x20empty','152887DQInws','48kiXmDv','2978015HaGFXT','Invalid\x20segment\x20reference\x20format:\x20','indexOf','1413376ZeAksU','1690UUmeXE','967526dRFGgy','substring','16xbUJMn','1704tcwkLe','427686ppuKvF'];a109_0x2d24=function(){return _0x4d8c54;};return a109_0x2d24();}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xc512b,_0x7dd84){const _0x4b85d7=a110_0x18a4,_0x5603a4=_0xc512b();while(!![]){try{const _0x18d316=parseInt(_0x4b85d7(0x19d))/0x1+-parseInt(_0x4b85d7(0x1a8))/0x2+-parseInt(_0x4b85d7(0x1aa))/0x3*(parseInt(_0x4b85d7(0x19b))/0x4)+parseInt(_0x4b85d7(0x196))/0x5+-parseInt(_0x4b85d7(0x1a9))/0x6*(-parseInt(_0x4b85d7(0x19f))/0x7)+parseInt(_0x4b85d7(0x19c))/0x8+-parseInt(_0x4b85d7(0x195))/0x9*(-parseInt(_0x4b85d7(0x1a7))/0xa);if(_0x18d316===_0x7dd84)break;else _0x5603a4['push'](_0x5603a4['shift']());}catch(_0x38bda9){_0x5603a4['push'](_0x5603a4['shift']());}}}(a110_0xe581,0x8335b));function a110_0xe581(){const _0x3eb5ed=['1187600LHQzur','now','intervalFactory','stop','\x20[Job\x20ID:\x20','8mbtVUr','2669520skaSXd','557682oASdVl','start','39186eOvEFb','jobId','clock','extra','stdout','text','isTTY','replace','230HZsAjG','1937610oZaJeX','222azncHb','697833FbtXNk','phase','cyan','248652VIWKyV'];a110_0xe581=function(){return _0x3eb5ed;};return a110_0xe581();}function a110_0x18a4(_0x98192d,_0x598868){_0x98192d=_0x98192d-0x193;const _0xe581c2=a110_0xe581();let _0x18a4d7=_0xe581c2[_0x98192d];return _0x18a4d7;}import a110_0x56d740 from'ora';export function createCommandSpinner(_0x524430,_0xd80aaf={}){const _0x17829c=a110_0x18a4,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0xd80aaf;return a110_0x56d740({'text':_0x524430,'color':_0x17829c(0x194),'isEnabled':forceEnabled||process[_0x17829c(0x1a3)][_0x17829c(0x1a5)]&&!verbose});}export async function withSpinner(_0x45ace4,_0x511be4,_0x20e244={}){const _0x298a5d=a110_0x18a4,_0xdea02d=_0x20e244[_0x298a5d(0x1a1)]??(()=>Date[_0x298a5d(0x197)]()),_0x53fff=createCommandSpinner(_0x45ace4,_0x20e244);_0x53fff[_0x298a5d(0x19e)]();const _0xef55c0=_0xdea02d();try{const _0x2a3ade=await _0x511be4(),_0x405c7a=_0xdea02d()-_0xef55c0;return _0x53fff['stop'](),{'data':_0x2a3ade,'elapsedMs':_0x405c7a};}catch(_0x2a8995){_0x53fff[_0x298a5d(0x199)]();throw _0x2a8995;}}export async function withQuerySpinner(_0x541597,_0x31db42,_0x539fbe={}){const _0x97527c=a110_0x18a4,_0x54d653=_0x539fbe[_0x97527c(0x1a1)]??(()=>Date['now']()),_0x4b9273=_0x539fbe[_0x97527c(0x198)]??setInterval,_0x109ed3=createCommandSpinner(_0x541597,_0x539fbe);_0x109ed3[_0x97527c(0x19e)]();const _0x33ac8f=_0x54d653(),_0xf31e5d=_0x541597[_0x97527c(0x1a6)]('...',''),_0x1ea56b={},_0x24b048=()=>{const _0x660854=_0x97527c;if(!_0x109ed3['isSpinning'])return;const _0x3c10d1=_0x54d653()-_0x33ac8f,_0xf71385=formatElapsed(_0x3c10d1),_0x569969=_0x1ea56b[_0x660854(0x193)]??_0xf31e5d,_0x38a3be=_0x1ea56b[_0x660854(0x1a0)]?_0x660854(0x19a)+_0x1ea56b[_0x660854(0x1a0)]+']':'',_0x4e3c43=_0x1ea56b['extra']?'\x20'+_0x1ea56b[_0x660854(0x1a2)]:'';_0x109ed3[_0x660854(0x1a4)]=_0x569969+'\x20'+_0xf71385+_0x4e3c43+_0x38a3be;},_0x3d3fef=_0x4b9273(()=>{_0x24b048();},0x3e8),_0x5c00d6={'setPhase':_0xed03a6=>{const _0x475c79=_0x97527c;_0x1ea56b[_0x475c79(0x193)]=_0xed03a6,_0x24b048();},'setJobId':_0x3c76f8=>{const _0x39d50f=_0x97527c;_0x1ea56b[_0x39d50f(0x1a0)]=_0x3c76f8,_0x24b048();},'setExtra':_0x30cfec=>{const _0x523b07=_0x97527c;_0x1ea56b[_0x523b07(0x1a2)]=_0x30cfec,_0x24b048();}};_0x24b048();try{const _0x30e642=await _0x31db42(_0x5c00d6),_0x2f4375=_0x54d653()-_0x33ac8f;return{'data':_0x30e642,'elapsedMs':_0x2f4375};}finally{clearInterval(_0x3d3fef),_0x109ed3[_0x97527c(0x199)]();}}export function formatElapsed(_0x592134){const _0x136ff6=Math['floor'](_0x592134/0x3e8);if(_0x136ff6<0x3c)return(_0x592134/0x3e8)['toFixed'](0x1)+'s';const _0x34d4f8=Math['floor'](_0x136ff6/0x3c),_0x5da9e8=_0x136ff6%0x3c;if(_0x34d4f8<0x3c)return _0x34d4f8+'m\x20'+_0x5da9e8+'s';const _0x5ea1e4=Math['floor'](_0x34d4f8/0x3c),_0x137f35=_0x34d4f8%0x3c;return _0x5ea1e4+'h\x20'+_0x137f35+'m';}
|
package/dist/utils/sql-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x495adf,_0x54e644){const _0x1f0f50=a111_0x31bf,_0x473b6c=_0x495adf();while(!![]){try{const _0x2b30a6=parseInt(_0x1f0f50(0x12c))/0x1*(-parseInt(_0x1f0f50(0x129))/0x2)+-parseInt(_0x1f0f50(0x13a))/0x3*(parseInt(_0x1f0f50(0x11c))/0x4)+-parseInt(_0x1f0f50(0x11a))/0x5*(-parseInt(_0x1f0f50(0x12f))/0x6)+-parseInt(_0x1f0f50(0x128))/0x7*(parseInt(_0x1f0f50(0x127))/0x8)+-parseInt(_0x1f0f50(0x119))/0x9+-parseInt(_0x1f0f50(0x121))/0xa*(parseInt(_0x1f0f50(0x13b))/0xb)+parseInt(_0x1f0f50(0x120))/0xc*(parseInt(_0x1f0f50(0x124))/0xd);if(_0x2b30a6===_0x54e644)break;else _0x473b6c['push'](_0x473b6c['shift']());}catch(_0x4ee3a8){_0x473b6c['push'](_0x473b6c['shift']());}}}(a111_0x3cfe,0x8ea7a));import{readFileSync}from'fs';function a111_0x31bf(_0x151bcf,_0x5c00bf){_0x151bcf=_0x151bcf-0x119;const _0x3cfec0=a111_0x3cfe();let _0x31bfc7=_0x3cfec0[_0x151bcf];return _0x31bfc7;}import{createInterface}from'readline';export function stripSqlComments(_0x46560d){const _0x4ace1a=a111_0x31bf;let _0x506e8e=_0x46560d[_0x4ace1a(0x11f)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x506e8e=_0x506e8e[_0x4ace1a(0x11f)](/--.*$/gm,''),_0x506e8e['trim']();}function isEscaped(_0x30c0d8,_0x2fe95e){let _0x27472c=0x0;for(let _0x3e08cd=_0x2fe95e-0x1;_0x3e08cd>=0x0&&_0x30c0d8[_0x3e08cd]==='\x5c';_0x3e08cd--){_0x27472c++;}return _0x27472c%0x2===0x1;}export function splitSqlStatements(_0x2c1d2a){const _0x385817=a111_0x31bf,_0x708c69=stripSqlComments(_0x2c1d2a);if(!_0x708c69)throw new Error(_0x385817(0x11e));const _0x2bf024=[];let _0x4daf31='',_0x56209d=![],_0x53c593=![],_0x10de0f=![];for(let _0x2e5a07=0x0;_0x2e5a07<_0x2c1d2a[_0x385817(0x132)];_0x2e5a07++){const _0x24e254=_0x2c1d2a[_0x2e5a07];if(_0x24e254==='\x27'&&!isEscaped(_0x2c1d2a,_0x2e5a07)&&!_0x53c593&&!_0x10de0f)_0x56209d=!_0x56209d;else{if(_0x24e254==='\x22'&&!isEscaped(_0x2c1d2a,_0x2e5a07)&&!_0x56209d&&!_0x10de0f)_0x53c593=!_0x53c593;else _0x24e254==='`'&&!isEscaped(_0x2c1d2a,_0x2e5a07)&&!_0x56209d&&!_0x53c593&&(_0x10de0f=!_0x10de0f);}if(_0x24e254===';'&&!_0x56209d&&!_0x53c593&&!_0x10de0f){const _0x238d7c=_0x4daf31[_0x385817(0x136)]();_0x238d7c&&_0x2bf024[_0x385817(0x122)](_0x238d7c),_0x4daf31='';}else _0x4daf31+=_0x24e254;}const _0xdef815=_0x4daf31[_0x385817(0x136)]();_0xdef815&&_0x2bf024[_0x385817(0x122)](_0xdef815);const _0x1ec272=_0x2bf024['map'](_0x2ce35a=>_0x2ce35a[_0x385817(0x136)]())[_0x385817(0x12a)](_0x5744c3=>{const _0x47fc54=stripSqlComments(_0x5744c3);return _0x47fc54['length']>0x0;});if(_0x1ec272[_0x385817(0x132)]===0x0)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');return _0x1ec272;}export function readFileContent(_0x10bf4f){const _0x5c086f=a111_0x31bf;try{return readFileSync(_0x10bf4f,_0x5c086f(0x138));}catch(_0x476d22){const _0x13265c=_0x476d22[_0x5c086f(0x137)];if(_0x13265c===_0x5c086f(0x139))throw new Error('File\x20\x27'+_0x10bf4f+_0x5c086f(0x126));else{if(_0x13265c===_0x5c086f(0x12b))throw new Error(_0x5c086f(0x12d)+_0x10bf4f+'\x27');else throw new Error('Error\x20reading\x20file\x20\x27'+_0x10bf4f+'\x27:\x20'+_0x476d22['message']);}}}function a111_0x3cfe(){const _0x573b31=['238332lWrMNu','filter','EACCES','8oeILSV','Permission\x20denied\x20reading\x20file\x20\x27','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','2304pdruPQ','isTTY','test','length','stdin','stdin\x20','File\x20\x27','trim','code','utf-8','ENOENT','897QXDnTY','22ljEnyq','join','1757340bVwYXi','10090vIgulY','Error\x20reading\x20from\x20stdin:\x20','3228deZlTM','toLowerCase','Content\x20contains\x20no\x20SQL\x20statements','replace','12199704QQYoUj','2522530KExhGl','push','close','26ZDbtoo','message','\x27\x20not\x20found','40vCNDsH','461293VwJFMR'];a111_0x3cfe=function(){return _0x573b31;};return a111_0x3cfe();}export function readSqlStatementsFromFile(_0x2ed3e8){const _0x4e1286=a111_0x31bf,_0x43520=readFileContent(_0x2ed3e8);try{return splitSqlStatements(_0x43520);}catch(_0x2c8c88){throw new Error(_0x4e1286(0x135)+_0x2ed3e8+'\x27\x20'+_0x2c8c88['message']['toLowerCase']());}}export async function readStdinContent(){const _0x2307e2=a111_0x31bf;if(process[_0x2307e2(0x133)][_0x2307e2(0x130)])throw new Error(_0x2307e2(0x12e));return new Promise((_0x4ebd3f,_0x2451c6)=>{const _0x337fb5=_0x2307e2,_0xdb3300=[],_0x5c093b=createInterface({'input':process['stdin'],'terminal':![]});_0x5c093b['on']('line',_0xacc2d8=>{const _0x33e56b=a111_0x31bf;_0xdb3300[_0x33e56b(0x122)](_0xacc2d8);}),_0x5c093b['on'](_0x337fb5(0x123),()=>{const _0x1863cb=_0x337fb5;_0x4ebd3f(_0xdb3300[_0x1863cb(0x13c)]('\x0a'));}),_0x5c093b['on']('error',_0x3d47e7=>{const _0xb5f6af=_0x337fb5;_0x5c093b[_0xb5f6af(0x123)](),_0x2451c6(new Error(_0xb5f6af(0x11b)+_0x3d47e7['message']));});});}export async function readSqlStatementsFromStdin(){const _0x4eb079=a111_0x31bf,_0x262799=await readStdinContent();try{return splitSqlStatements(_0x262799);}catch(_0x311920){throw new Error(_0x4eb079(0x134)+_0x311920[_0x4eb079(0x125)][_0x4eb079(0x11d)]());}}export function isSqlFilePath(_0x18a83d){const _0x59030d=a111_0x31bf;return/\w\.sql$/[_0x59030d(0x131)](_0x18a83d);}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a112_0x510e(){const _0xdd1aa5=['1332458TkPiro','startsWith','indexOf','split','body','getReader','2uydEpr','parse','4927824mKHvPo','27OhZacG','slice','3462XkXwcr','data','read','4940971pswlPf','20764570czmXhn','[LLM\x20API\x20SSE]\x20','11881692cYmIzq','pop','debug','2535DaQQbZ','trim','event','719756ROpfPY'];a112_0x510e=function(){return _0xdd1aa5;};return a112_0x510e();}(function(_0x4b6dd2,_0x3f11df){const _0x47dc2f=a112_0x4429,_0x14511d=_0x4b6dd2();while(!![]){try{const _0x146534=parseInt(_0x47dc2f(0x1a3))/0x1*(parseInt(_0x47dc2f(0x19d))/0x2)+-parseInt(_0x47dc2f(0x1a6))/0x3*(parseInt(_0x47dc2f(0x19c))/0x4)+-parseInt(_0x47dc2f(0x1b1))/0x5*(-parseInt(_0x47dc2f(0x1a8))/0x6)+parseInt(_0x47dc2f(0x1ab))/0x7+-parseInt(_0x47dc2f(0x1a5))/0x8+-parseInt(_0x47dc2f(0x1ae))/0x9+parseInt(_0x47dc2f(0x1ac))/0xa;if(_0x146534===_0x3f11df)break;else _0x14511d['push'](_0x14511d['shift']());}catch(_0x554d81){_0x14511d['push'](_0x14511d['shift']());}}}(a112_0x510e,0xcfeea));export async function*parseSSEStream(_0x265887,_0x13d213){const _0x306f6c=a112_0x4429;if(!_0x265887[_0x306f6c(0x1a1)])throw new Error('Response\x20body\x20is\x20null');const _0x54be79=_0x265887[_0x306f6c(0x1a1)][_0x306f6c(0x1a2)](),_0x4bcd66=new TextDecoder();let _0x4434f3='',_0xbf4dd8={};try{while(!![]){const {done:_0x3b6fd8,value:_0x4044b0}=await _0x54be79[_0x306f6c(0x1aa)]();if(_0x3b6fd8){if(_0xbf4dd8[_0x306f6c(0x1a9)]){_0x13d213?.[_0x306f6c(0x1b0)]('[LLM\x20API\x20SSE]\x20'+_0xbf4dd8[_0x306f6c(0x1a9)]);const _0x14c6e4=parseSSEData(_0xbf4dd8[_0x306f6c(0x1a9)]);yield _0x14c6e4;}break;}_0x4434f3+=_0x4bcd66['decode'](_0x4044b0,{'stream':!![]});const _0x267c91=_0x4434f3[_0x306f6c(0x1a0)]('\x0a');_0x4434f3=_0x267c91[_0x306f6c(0x1af)]()||'';for(const _0xfd2289 of _0x267c91){if(_0xfd2289[_0x306f6c(0x1b2)]()===''){if(_0xbf4dd8['data']){_0x13d213?.[_0x306f6c(0x1b0)](_0x306f6c(0x1ad)+_0xbf4dd8[_0x306f6c(0x1a9)]);const _0xadf9c3=parseSSEData(_0xbf4dd8[_0x306f6c(0x1a9)]);yield _0xadf9c3,_0xbf4dd8={};}continue;}if(_0xfd2289['startsWith'](':'))continue;const _0x2bc35b=_0xfd2289[_0x306f6c(0x19f)](':');if(_0x2bc35b===-0x1)continue;const _0x437aa6=_0xfd2289[_0x306f6c(0x1a7)](0x0,_0x2bc35b);let _0x3809f0=_0xfd2289['slice'](_0x2bc35b+0x1);_0x3809f0[_0x306f6c(0x19e)]('\x20')&&(_0x3809f0=_0x3809f0['slice'](0x1));switch(_0x437aa6){case _0x306f6c(0x19b):_0xbf4dd8[_0x306f6c(0x19b)]=_0x3809f0;break;case _0x306f6c(0x1a9):_0xbf4dd8[_0x306f6c(0x1a9)]=_0xbf4dd8[_0x306f6c(0x1a9)]?_0xbf4dd8[_0x306f6c(0x1a9)]+'\x0a'+_0x3809f0:_0x3809f0;break;case'id':_0xbf4dd8['id']=_0x3809f0;break;}}}}finally{_0x54be79['releaseLock']();}}function a112_0x4429(_0x354733,_0x3701c3){_0x354733=_0x354733-0x19b;const _0x510e09=a112_0x510e();let _0x44299e=_0x510e09[_0x354733];return _0x44299e;}function parseSSEData(_0x4be2f0){const _0x2caf46=a112_0x4429;try{return JSON[_0x2caf46(0x1a4)](_0x4be2f0);}catch(_0x168810){throw new Error('Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20'+_0x4be2f0,{'cause':_0x168810});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4c0ac5,_0x4ae63a){const _0x2fa3ce=a113_0x27fc,_0x37cedc=_0x4c0ac5();while(!![]){try{const _0x4103df=-parseInt(_0x2fa3ce(0x1e5))/0x1*(-parseInt(_0x2fa3ce(0x1dc))/0x2)+-parseInt(_0x2fa3ce(0x1dd))/0x3*(-parseInt(_0x2fa3ce(0x1d4))/0x4)+parseInt(_0x2fa3ce(0x1df))/0x5*(-parseInt(_0x2fa3ce(0x1e9))/0x6)+parseInt(_0x2fa3ce(0x1d8))/0x7+parseInt(_0x2fa3ce(0x1d7))/0x8*(-parseInt(_0x2fa3ce(0x1e6))/0x9)+-parseInt(_0x2fa3ce(0x1d1))/0xa+parseInt(_0x2fa3ce(0x1e0))/0xb*(-parseInt(_0x2fa3ce(0x1d5))/0xc);if(_0x4103df===_0x4ae63a)break;else _0x37cedc['push'](_0x37cedc['shift']());}catch(_0x5702ff){_0x37cedc['push'](_0x37cedc['shift']());}}}(a113_0x2dd0,0x802ac));import a113_0xb49ff7 from'string-width';export function stringWidth(_0x330cee){return a113_0xb49ff7(_0x330cee);}export function padEnd(_0x5ce9a8,_0x64ba6d){const _0x189b9f=a113_0x27fc,_0x1b59ef=stringWidth(_0x5ce9a8);if(_0x1b59ef>=_0x64ba6d)return _0x5ce9a8;return _0x5ce9a8+'\x20'[_0x189b9f(0x1e3)](_0x64ba6d-_0x1b59ef);}export function padStart(_0x247001,_0x42b9db){const _0x552f3e=a113_0x27fc,_0x1fee30=stringWidth(_0x247001);if(_0x1fee30>=_0x42b9db)return _0x247001;return'\x20'[_0x552f3e(0x1e3)](_0x42b9db-_0x1fee30)+_0x247001;}function a113_0x2dd0(){const _0x2caba4=['unknown','padStart','substring','1107810jaRWeM','slice','USERNAME','4fewzUx','357960DMGQEM','trim','8kxMCfh','4850314xZGVEd','test','toString','floor','2iVILAs','2875623HiPito','length','56080WKaDLu','275lljovA','Cannot\x20escape\x20empty\x20string\x20literal','toLowerCase','repeat','env','189182RDEZBc','3627378FbsqOB','replace','Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string','30DZUfaI'];a113_0x2dd0=function(){return _0x2caba4;};return a113_0x2dd0();}export function centerAlign(_0xb3ebbc,_0x4e0473){const _0x4d8aab=a113_0x27fc,_0x8eb266=stringWidth(_0xb3ebbc);if(_0x8eb266>_0x4e0473){if(_0x4e0473<=0x1)return'…'[_0x4d8aab(0x1d0)](0x0,_0x4e0473);let _0x36bbc1=_0xb3ebbc;while(stringWidth(_0x36bbc1+'…')>_0x4e0473){_0x36bbc1=_0x36bbc1[_0x4d8aab(0x1d2)](0x0,-0x1);}return _0x36bbc1+'…';}if(_0x8eb266===_0x4e0473)return _0xb3ebbc;const _0x1be30d=_0x4e0473-_0x8eb266,_0x53cead=Math['floor'](_0x1be30d/0x2),_0x2be5b2=_0x1be30d-_0x53cead;return'\x20'[_0x4d8aab(0x1e3)](_0x53cead)+_0xb3ebbc+'\x20'[_0x4d8aab(0x1e3)](_0x2be5b2);}export function escapeStringLiteral(_0x4dfb69){const _0x13e11b=a113_0x27fc;if(!_0x4dfb69||_0x4dfb69[_0x13e11b(0x1d6)]()[_0x13e11b(0x1de)]===0x0)throw new Error(_0x13e11b(0x1e1));const _0x2bf204=_0x4dfb69['replace'](/'/g,'\x27\x27');return'\x27'+_0x2bf204+'\x27';}function a113_0x27fc(_0x3fabb8,_0x5efb8d){_0x3fabb8=_0x3fabb8-0x1d0;const _0x2dd04e=a113_0x2dd0();let _0x27fc4e=_0x2dd04e[_0x3fabb8];return _0x27fc4e;}export function globToLike(_0x435cc2){const _0x153ade=a113_0x27fc;let _0x2f472c=_0x435cc2['replace'](/\\/g,'\x5c\x5c')[_0x153ade(0x1e7)](/%/g,'\x5c%')[_0x153ade(0x1e7)](/_/g,'\x5c_');return _0x2f472c=_0x2f472c[_0x153ade(0x1e7)](/\*/g,'%')[_0x153ade(0x1e7)](/\?/g,'_'),_0x2f472c;}export function buildLikePattern(_0x7be6bc){const _0x2d152e=a113_0x27fc;if(!_0x7be6bc||_0x7be6bc[_0x2d152e(0x1d6)]()[_0x2d152e(0x1de)]===0x0)throw new Error(_0x2d152e(0x1e8));const _0x524a3b=globToLike(_0x7be6bc),_0x5f4c92=_0x524a3b['replace'](/'/g,'\x27\x27');return'\x27'+_0x5f4c92+'\x27';}export function matchGlobPattern(_0x4aae52,_0x24c53c){const _0x4a3218=a113_0x27fc,_0x428f06=_0x24c53c[_0x4a3218(0x1e7)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x4a3218(0x1e7)](/\*/g,'.*')[_0x4a3218(0x1e7)](/\?/g,'.'),_0x1e888e=new RegExp('^'+_0x428f06+'$');return _0x1e888e[_0x4a3218(0x1d9)](_0x4aae52);}export function getSanitizedUsername(){const _0xbad70b=a113_0x27fc,_0x43c3e5=process[_0xbad70b(0x1e4)]['USER']||process[_0xbad70b(0x1e4)][_0xbad70b(0x1d3)]||_0xbad70b(0x1ea);return _0x43c3e5[_0xbad70b(0x1e7)](/[^a-zA-Z0-9]/g,'')[_0xbad70b(0x1e2)]();}export function generateRandomHex(){const _0x7fe63=a113_0x27fc,_0x3eea82=Math[_0x7fe63(0x1db)](Math['random']()*0xfffff);return _0x3eea82[_0x7fe63(0x1da)](0x10)[_0x7fe63(0x1eb)](0x5,'0');}export function sanitizeFileName(_0x3dbffc){const _0x52ea3c=a113_0x27fc;return _0x3dbffc[_0x52ea3c(0x1e2)]()[_0x52ea3c(0x1e7)](/[/\\:*?"<>|]/g,'-')[_0x52ea3c(0x1e7)](/\s+/g,'-')[_0x52ea3c(0x1e7)](/-+/g,'-')['replace'](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xdd1031,_0xdf3c12){const _0x3aba07=a114_0x5b72,_0xaba8b0=_0xdd1031();while(!![]){try{const _0x36e508=-parseInt(_0x3aba07(0x1f4))/0x1+-parseInt(_0x3aba07(0x205))/0x2+parseInt(_0x3aba07(0x1ff))/0x3*(parseInt(_0x3aba07(0x1fd))/0x4)+-parseInt(_0x3aba07(0x1fb))/0x5+parseInt(_0x3aba07(0x1fa))/0x6+parseInt(_0x3aba07(0x202))/0x7+parseInt(_0x3aba07(0x1f6))/0x8;if(_0x36e508===_0xdf3c12)break;else _0xaba8b0['push'](_0xaba8b0['shift']());}catch(_0x8a9649){_0xaba8b0['push'](_0xaba8b0['shift']());}}}(a114_0x1a70,0xb2302));function hasWildcard(_0xb8de96){return _0xb8de96['includes']('*')||_0xb8de96['includes']('?');}export function parseTableReference(_0x23567d){const _0x377833=a114_0x5b72;if(!_0x23567d||_0x23567d[_0x377833(0x1f3)]()[_0x377833(0x1f7)]===0x0)throw new Error(_0x377833(0x1fc));const _0x12ffe3=_0x23567d[_0x377833(0x1f3)](),_0xbe013f={'original':_0x12ffe3},_0x17871d=_0x12ffe3[_0x377833(0x204)]('.');if(_0x17871d[_0x377833(0x1f7)]===0x1){const _0x4645fe=_0x17871d[0x0];if(!_0x4645fe)throw new Error('Pattern\x20cannot\x20be\x20just\x20a\x20dot');_0xbe013f[_0x377833(0x1fe)]=_0x4645fe;}else{if(_0x17871d[_0x377833(0x1f7)]===0x2){const [_0x1b20af,_0x4fb7d1]=_0x17871d;if(!_0x1b20af)throw new Error(_0x377833(0x1f5));if(!_0x4fb7d1)throw new Error('Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)');_0xbe013f[_0x377833(0x201)]=_0x1b20af,_0xbe013f[_0x377833(0x1fe)]=_0x4fb7d1;}else{if(_0x17871d['length']===0x3){const [_0x223252,_0x5307f6,_0x105eab]=_0x17871d;if(!_0x223252||!_0x5307f6||!_0x105eab)throw new Error(_0x377833(0x1f9));_0xbe013f[_0x377833(0x203)]=_0x223252,_0xbe013f[_0x377833(0x201)]=_0x5307f6,_0xbe013f[_0x377833(0x1fe)]=_0x105eab;}else throw new Error('Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)');}}return _0xbe013f;}function a114_0x1a70(){const _0xecee5d=['1870434LgJtUW','trim','838016WEytxX','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','16930328BCSiID','length','push','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','882372aimTSg','1525085oSiRBw','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','20SsIAZD','table','153087pzKtOv','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','database','2027270tnrIun','catalog','split'];a114_0x1a70=function(){return _0xecee5d;};return a114_0x1a70();}export function formatTableReference(_0x5123b2){const _0x35d9c9=a114_0x5b72,_0x3286b0=[];return _0x5123b2[_0x35d9c9(0x203)]&&_0x3286b0['push'](_0x5123b2['catalog']),_0x5123b2[_0x35d9c9(0x201)]&&_0x3286b0['push'](_0x5123b2['database']),_0x5123b2[_0x35d9c9(0x1fe)]&&_0x3286b0[_0x35d9c9(0x1f8)](_0x5123b2['table']),_0x3286b0['join']('.');}export function validateTableListReference(_0x111757){return undefined;}function a114_0x5b72(_0x5e42dd,_0x2567ca){_0x5e42dd=_0x5e42dd-0x1f3;const _0x1a70e3=a114_0x1a70();let _0x5b720c=_0x1a70e3[_0x5e42dd];return _0x5b720c;}export function validateTableDescribeReference(_0x3c877e){const _0x4d2858=a114_0x5b72;if(!_0x3c877e[_0x4d2858(0x1fe)])return'Table\x20name\x20is\x20required\x20for\x20describe\x20operation';if(_0x3c877e[_0x4d2858(0x201)]&&hasWildcard(_0x3c877e['database']))return _0x4d2858(0x200);if(hasWildcard(_0x3c877e['table']))return'Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation';return undefined;}
|
package/dist/utils/tdx-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x42b4a5=a115_0x1544;(function(_0x18e1a0,_0x1acbed){const _0x1f5021=a115_0x1544,_0x494153=_0x18e1a0();while(!![]){try{const _0x773231=parseInt(_0x1f5021(0xcd))/0x1+-parseInt(_0x1f5021(0xc9))/0x2+parseInt(_0x1f5021(0xb7))/0x3*(-parseInt(_0x1f5021(0xd1))/0x4)+-parseInt(_0x1f5021(0xc8))/0x5+parseInt(_0x1f5021(0xbe))/0x6*(parseInt(_0x1f5021(0xb8))/0x7)+-parseInt(_0x1f5021(0xc5))/0x8+-parseInt(_0x1f5021(0xbd))/0x9*(-parseInt(_0x1f5021(0xce))/0xa);if(_0x773231===_0x1acbed)break;else _0x494153['push'](_0x494153['shift']());}catch(_0x4a660b){_0x494153['push'](_0x494153['shift']());}}}(a115_0x2531,0x54178));function a115_0x2531(){const _0x141a94=['2762672ShpiCq','relative','Invalid\x20JSON\x20in\x20','3172060bZYIaj','726450JbkilL','root','parent_segment','join','250771wuXRPl','687710wxiAXJ','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','object','195508Egmchz','27CZvpfi','7dIttgJ','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','replace','cwd','Invalid\x20tdx.json:\x20expected\x20object','198xUpXmP','2181426McHgfT','stringify','resolve','utf-8','dirname','segments','string'];a115_0x2531=function(){return _0x141a94;};return a115_0x2531();}import{existsSync,readFileSync}from'fs';import a115_0x5d53bf from'path';const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR=a115_0x42b4a5(0xc3);export function findTdxConfigPath(_0x1fae39=process[a115_0x42b4a5(0xbb)]()){const _0x2ad2e5=a115_0x42b4a5;let _0x38ec27=a115_0x5d53bf[_0x2ad2e5(0xc0)](_0x1fae39);const _0x263fff=a115_0x5d53bf['parse'](_0x38ec27)[_0x2ad2e5(0xca)];while(_0x38ec27!==_0x263fff){const _0x589c37=a115_0x5d53bf[_0x2ad2e5(0xcc)](_0x38ec27,TDX_CONFIG_FILE);if(existsSync(_0x589c37))return _0x589c37;_0x38ec27=a115_0x5d53bf[_0x2ad2e5(0xc2)](_0x38ec27);}return null;}export function loadTdxConfig(_0x24b491){const _0x254f32=a115_0x42b4a5,_0x308d52=readFileSync(_0x24b491,_0x254f32(0xc1));let _0x39400b;try{_0x39400b=JSON['parse'](_0x308d52);}catch{throw new Error(_0x254f32(0xc7)+_0x24b491);}if(!_0x39400b||typeof _0x39400b!==_0x254f32(0xd0))throw new Error(_0x254f32(0xbc));const _0x5be9ed=_0x39400b;if(!_0x5be9ed[_0x254f32(0xcb)]||typeof _0x5be9ed[_0x254f32(0xcb)]!==_0x254f32(0xc4))throw new Error(_0x254f32(0xcf));return{'parent_segment':_0x5be9ed[_0x254f32(0xcb)]};}function a115_0x1544(_0x31e620,_0x91298){_0x31e620=_0x31e620-0xb7;const _0x2531a5=a115_0x2531();let _0x154444=_0x2531a5[_0x31e620];return _0x154444;}export function findTdxConfig(_0x4dce4d=process['cwd']()){const _0x5d3f23=a115_0x42b4a5,_0x171a16=findTdxConfigPath(_0x4dce4d);if(!_0x171a16)throw new Error(_0x5d3f23(0xb9));const _0x3fc71a=loadTdxConfig(_0x171a16),_0x22eca2=a115_0x5d53bf['dirname'](_0x171a16);return{'config':_0x3fc71a,'configPath':_0x171a16,'configDir':_0x22eca2};}export function getSegmentRootDir(_0x93ac2b,_0x2c94aa=process['cwd']()){const _0xf36abd=a115_0x42b4a5;return a115_0x5d53bf[_0xf36abd(0xcc)](_0x2c94aa,SEGMENTS_DIR,_0x93ac2b);}export function getTdxConfigPath(_0xd1cedc,_0x2d8f58=process[a115_0x42b4a5(0xbb)]()){return a115_0x5d53bf['join'](getSegmentRootDir(_0xd1cedc,_0x2d8f58),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x44c995,_0x4770c8){const _0x37a66d=a115_0x42b4a5,_0x249a00=a115_0x5d53bf[_0x37a66d(0xc0)](_0x44c995),_0x497af1=a115_0x5d53bf[_0x37a66d(0xc6)](_0x4770c8,_0x249a00);if(_0x497af1['startsWith']('..'))return'';return _0x497af1;}export function localPathToTdFolderPath(_0x679f28){const _0x2982ef=a115_0x42b4a5,_0x2a720d=a115_0x5d53bf[_0x2982ef(0xc2)](_0x679f28);if(_0x2a720d==='.'||_0x2a720d==='')return'';return _0x2a720d[_0x2982ef(0xba)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0xbf8bf9,_0x42bc99){const _0x50a20e=a115_0x42b4a5;if(!_0xbf8bf9)return _0x42bc99;return a115_0x5d53bf[_0x50a20e(0xcc)](_0x42bc99,_0xbf8bf9);}export function createTdxConfigContent(_0x30fc38){const _0x5641a1=a115_0x42b4a5,_0xe0c34a={'parent_segment':_0x30fc38};return JSON[_0x5641a1(0xbf)](_0xe0c34a,null,0x2)+'\x0a';}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a116_0xdbb544=a116_0x34c3;(function(_0x25adda,_0x178171){const _0x3d5e34=a116_0x34c3,_0x2b2986=_0x25adda();while(!![]){try{const _0x39ae54=-parseInt(_0x3d5e34(0x1f3))/0x1+parseInt(_0x3d5e34(0x1e9))/0x2+-parseInt(_0x3d5e34(0x1c8))/0x3+parseInt(_0x3d5e34(0x1f9))/0x4+parseInt(_0x3d5e34(0x1d7))/0x5*(-parseInt(_0x3d5e34(0x1fc))/0x6)+-parseInt(_0x3d5e34(0x1f4))/0x7*(parseInt(_0x3d5e34(0x1ea))/0x8)+parseInt(_0x3d5e34(0x1e3))/0x9;if(_0x39ae54===_0x178171)break;else _0x2b2986['push'](_0x2b2986['shift']());}catch(_0x42b9c2){_0x2b2986['push'](_0x2b2986['shift']());}}}(a116_0x43b2,0x480c9));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';function a116_0x43b2(){const _0x2927e2=['.log','ERROR','message','364237uOtyfZ','161SvTlBS','DEBUG','getDate','debug','stringify','1668368OjQXBH','TRACE','tdx.log','322254PHVldj','getMonth','WARN','padStart','gray','error','991161vQarOM','.cache','toISOString','tdx','red','end','fileOnly','cyan','map','floor','getLogPath','logStream','trace','close','toString','5gpYhan','info','write','includes','join','stack','rotateOldLogs','logLevel','.gz','init','cause','getTimezoneOffset','4170024QCgCIT','name','logDir','Warning:\x20Failed\x20to\x20compress\x20','getSeconds','warn','834658eBEujF','88456TuEOYg','getHours','test','Warning:\x20Error\x20writing\x20to\x20tdx.log:','INFO','split'];a116_0x43b2=function(){return _0x2927e2;};return a116_0x43b2();}import{join}from'path';import{homedir}from'os';import{createGzip}from'zlib';function a116_0x34c3(_0xa7f2e6,_0x284a64){_0xa7f2e6=_0xa7f2e6-0x1c3;const _0x43b241=a116_0x43b2();let _0x34c30d=_0x43b241[_0xa7f2e6];return _0x34c30d;}import{pipeline}from'stream/promises';import a116_0x134e01 from'chalk';function safeStringify(_0x1b06aa){const _0x534c9d=a116_0x34c3;if(typeof _0x1b06aa==='string')return _0x1b06aa;if(_0x1b06aa instanceof Error)return _0x1b06aa[_0x534c9d(0x1dc)]||_0x1b06aa[_0x534c9d(0x1e4)]+':\x20'+_0x1b06aa['message'];try{return JSON[_0x534c9d(0x1f8)](_0x1b06aa,(_0x4974c2,_0x32df98)=>{const _0x55cafd=_0x534c9d;if(_0x32df98 instanceof Error)return{'name':_0x32df98[_0x55cafd(0x1e4)],'message':_0x32df98[_0x55cafd(0x1f2)],'stack':_0x32df98[_0x55cafd(0x1dc)],'cause':_0x32df98[_0x55cafd(0x1e1)]};return _0x32df98;});}catch{return String(_0x1b06aa);}}function getTimezoneOffset(){const _0x136664=a116_0x34c3,_0x2b926a=-new Date()[_0x136664(0x1e2)](),_0x4ad34d=Math[_0x136664(0x1d1)](Math['abs'](_0x2b926a)/0x3c),_0x1b7d50=Math['abs'](_0x2b926a)%0x3c,_0x19d55e=_0x2b926a>=0x0?'+':'-';return''+_0x19d55e+_0x4ad34d[_0x136664(0x1d6)]()[_0x136664(0x1c5)](0x2,'0')+_0x1b7d50[_0x136664(0x1d6)]()['padStart'](0x2,'0');}function formatTimestamp(){const _0x370df4=a116_0x34c3,_0x5e6f6d=new Date(),_0x3ed9dd=_0x5e6f6d['getFullYear'](),_0xe2f6fd=(_0x5e6f6d[_0x370df4(0x1c3)]()+0x1)[_0x370df4(0x1d6)]()[_0x370df4(0x1c5)](0x2,'0'),_0x1e8f43=_0x5e6f6d[_0x370df4(0x1f6)]()[_0x370df4(0x1d6)]()[_0x370df4(0x1c5)](0x2,'0'),_0x39153d=_0x5e6f6d[_0x370df4(0x1eb)]()['toString']()[_0x370df4(0x1c5)](0x2,'0'),_0x3c81d0=_0x5e6f6d['getMinutes']()['toString']()[_0x370df4(0x1c5)](0x2,'0'),_0x41288f=_0x5e6f6d[_0x370df4(0x1e7)]()['toString']()[_0x370df4(0x1c5)](0x2,'0'),_0x4d4d36=_0x5e6f6d['getMilliseconds']()['toString']()[_0x370df4(0x1c5)](0x3,'0'),_0x545bed=getTimezoneOffset();return _0x3ed9dd+'-'+_0xe2f6fd+'-'+_0x1e8f43+'\x20'+_0x39153d+':'+_0x3c81d0+':'+_0x41288f+'.'+_0x4d4d36+_0x545bed;}function formatColoredLogEntry(_0x5af3a6,_0x5c300a){const _0x3351fb=a116_0x34c3,_0x275eb9=formatTimestamp(),_0x2afdcf=_0x5c300a[_0x3351fb(0x1d0)](safeStringify)[_0x3351fb(0x1db)]('\x20'),_0x149eb5=a116_0x134e01['gray'](_0x275eb9);let _0x2d3dec;switch(_0x5af3a6){case'info':_0x2d3dec=a116_0x134e01[_0x3351fb(0x1cf)]('['+_0x5af3a6+']\x20');break;case'warn':_0x2d3dec=a116_0x134e01['yellow']('['+_0x5af3a6+']\x20');break;case _0x3351fb(0x1c7):_0x2d3dec=a116_0x134e01[_0x3351fb(0x1cc)]('['+_0x5af3a6+']');break;case _0x3351fb(0x1f7):_0x2d3dec=a116_0x134e01[_0x3351fb(0x1c6)]('['+_0x5af3a6+']');break;default:_0x2d3dec='['+_0x5af3a6+']';}return _0x149eb5+'\x20'+_0x2d3dec+'\x20'+_0x2afdcf;}export var LogLevel;(function(_0x49a5ce){const _0x321b10=a116_0x34c3;_0x49a5ce[_0x49a5ce['TRACE']=-0x2]=_0x321b10(0x1fa),_0x49a5ce[_0x49a5ce[_0x321b10(0x1f5)]=-0x1]=_0x321b10(0x1f5),_0x49a5ce[_0x49a5ce[_0x321b10(0x1ee)]=0x0]='INFO',_0x49a5ce[_0x49a5ce[_0x321b10(0x1c4)]=0x1]=_0x321b10(0x1c4),_0x49a5ce[_0x49a5ce[_0x321b10(0x1f1)]=0x2]=_0x321b10(0x1f1);}(LogLevel||(LogLevel={})));export class TDXLogger{[a116_0xdbb544(0x1d3)];['logDir'];[a116_0xdbb544(0x1de)];[a116_0xdbb544(0x1ce)];constructor(_0x29fb6f=LogLevel[a116_0xdbb544(0x1ee)],_0x4410af=![]){const _0x3c0db0=a116_0xdbb544;this[_0x3c0db0(0x1e5)]=join(homedir(),_0x3c0db0(0x1c9),_0x3c0db0(0x1cb),'logs'),this[_0x3c0db0(0x1de)]=_0x29fb6f,this[_0x3c0db0(0x1ce)]=_0x4410af;}async[a116_0xdbb544(0x1e0)](){const _0x34e13e=a116_0xdbb544;try{await mkdir(this['logDir'],{'recursive':!![]}),await this[_0x34e13e(0x1dd)]();const _0x6acb94=join(this[_0x34e13e(0x1e5)],_0x34e13e(0x1fb));this[_0x34e13e(0x1d3)]=createWriteStream(_0x6acb94,{'flags':'a'}),this[_0x34e13e(0x1d3)]['on']('error',_0x38987c=>{const _0x1e83ce=_0x34e13e;console[_0x1e83ce(0x1c7)](_0x1e83ce(0x1ed),_0x38987c[_0x1e83ce(0x1f2)]);});}catch(_0x496b84){console['error']('Warning:\x20Failed\x20to\x20initialize\x20log\x20files:',_0x496b84);}}async[a116_0xdbb544(0x1dd)](){const _0x10e831=a116_0xdbb544;try{const _0x39b709=await readdir(this['logDir']),_0x284eb9=new Date()[_0x10e831(0x1ca)]()[_0x10e831(0x1ef)]('T')[0x0];if(_0x39b709[_0x10e831(0x1da)]('tdx.log')){const _0x4c8556=join(this['logDir'],_0x10e831(0x1fb)),_0x487ece=await stat(_0x4c8556),_0x5230e6=new Date(_0x487ece['mtime'])[_0x10e831(0x1ca)]()[_0x10e831(0x1ef)]('T')[0x0];if(_0x5230e6<_0x284eb9){const _0x3481ef=join(this[_0x10e831(0x1e5)],'tdx-'+_0x5230e6+_0x10e831(0x1f0));await rename(_0x4c8556,_0x3481ef);}}const _0x26c019=await readdir(this[_0x10e831(0x1e5)]),_0x143850=/^tdx-(\d{4}-\d{2}-\d{2})\.log$/,_0x4406ae=_0x26c019['filter'](_0x31361d=>_0x143850[_0x10e831(0x1ec)](_0x31361d));for(const _0x14ae06 of _0x4406ae){const _0x5acdc9=join(this['logDir'],_0x14ae06),_0x14a203=join(this[_0x10e831(0x1e5)],_0x14ae06+_0x10e831(0x1df));try{await pipeline(createReadStream(_0x5acdc9),createGzip(),createWriteStream(_0x14a203)),await unlink(_0x5acdc9);}catch(_0x1beaf8){console['error'](_0x10e831(0x1e6)+_0x14ae06+':',_0x1beaf8);}}}catch{}}['debug'](..._0x166c5c){const _0x1a9b5c=a116_0xdbb544;if(this['logLevel']>LogLevel['DEBUG'])return;const _0x212079=formatColoredLogEntry('debug',_0x166c5c);this[_0x1a9b5c(0x1d3)]?.['write'](_0x212079+'\x0a');}['trace'](..._0x2ee359){const _0x3067e9=a116_0xdbb544;if(this[_0x3067e9(0x1de)]>LogLevel['TRACE'])return;const _0x3fce6c=formatColoredLogEntry(_0x3067e9(0x1d4),_0x2ee359);this[_0x3067e9(0x1d3)]?.[_0x3067e9(0x1d9)](_0x3fce6c+'\x0a');}['info'](..._0x4888bd){const _0x53e6d4=a116_0xdbb544;if(this[_0x53e6d4(0x1de)]>LogLevel[_0x53e6d4(0x1ee)])return;const _0x4a77ef=formatColoredLogEntry(_0x53e6d4(0x1d8),_0x4888bd);!this[_0x53e6d4(0x1ce)]&&console['log'](_0x4a77ef),this[_0x53e6d4(0x1d3)]?.[_0x53e6d4(0x1d9)](_0x4a77ef+'\x0a');}['warn'](..._0x5ad2f3){const _0x460f75=a116_0xdbb544;if(this[_0x460f75(0x1de)]>LogLevel[_0x460f75(0x1c4)])return;const _0x2781ea=formatColoredLogEntry(_0x460f75(0x1e8),_0x5ad2f3);!this['fileOnly']&&console['error'](_0x2781ea),this['logStream']?.[_0x460f75(0x1d9)](_0x2781ea+'\x0a');}[a116_0xdbb544(0x1c7)](..._0x384267){const _0x267118=a116_0xdbb544,_0x542b08=formatColoredLogEntry(_0x267118(0x1c7),_0x384267);!this[_0x267118(0x1ce)]&&console[_0x267118(0x1c7)](_0x542b08),this['logStream']?.[_0x267118(0x1d9)](_0x542b08+'\x0a');}async[a116_0xdbb544(0x1d5)](){const _0x43a1e6=a116_0xdbb544;return this[_0x43a1e6(0x1d8)]('Proxy\x20session\x20ended'),new Promise(_0x25a0f7=>{const _0x2a4d5e=_0x43a1e6;this[_0x2a4d5e(0x1d3)]?this[_0x2a4d5e(0x1d3)][_0x2a4d5e(0x1cd)](()=>{_0x25a0f7();}):_0x25a0f7();});}[a116_0xdbb544(0x1d2)](){const _0x599349=a116_0xdbb544;return join(this[_0x599349(0x1e5)],_0x599349(0x1fb));}}
|