@treasuredata/tdx 0.4.7 → 0.5.0
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/README.md +0 -4
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts +23 -0
- package/dist/commands/claude-statusline-command.d.ts.map +1 -0
- package/dist/commands/claude-statusline-command.js +1 -0
- package/dist/commands/claude-statusline-command.js.map +1 -0
- package/dist/commands/claude-usage-command.d.ts +22 -0
- package/dist/commands/claude-usage-command.d.ts.map +1 -0
- package/dist/commands/claude-usage-command.js +1 -0
- package/dist/commands/claude-usage-command.js.map +1 -0
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +10 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/claude-usage-tracker.d.ts +124 -0
- package/dist/utils/claude-usage-tracker.d.ts.map +1 -0
- package/dist/utils/claude-usage-tracker.js +1 -0
- package/dist/utils/claude-usage-tracker.js.map +1 -0
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.d.ts +52 -0
- package/dist/utils/model-factors.d.ts.map +1 -0
- package/dist/utils/model-factors.js +1 -0
- package/dist/utils/model-factors.js.map +1 -0
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x57de1a=a31_0x4f17;(function(_0x369a68,_0x366d73){const _0x5176f4=a31_0x4f17,_0x69c80d=_0x369a68();while(!![]){try{const _0xac8a32=-parseInt(_0x5176f4(0x7f))/0x1*(parseInt(_0x5176f4(0x99))/0x2)+parseInt(_0x5176f4(0x85))/0x3+-parseInt(_0x5176f4(0x8d))/0x4+-parseInt(_0x5176f4(0x9f))/0x5*(-parseInt(_0x5176f4(0x8a))/0x6)+-parseInt(_0x5176f4(0x81))/0x7+-parseInt(_0x5176f4(0x93))/0x8*(-parseInt(_0x5176f4(0x92))/0x9)+parseInt(_0x5176f4(0x95))/0xa;if(_0xac8a32===_0x366d73)break;else _0x69c80d['push'](_0x69c80d['shift']());}catch(_0x2d7e80){_0x69c80d['push'](_0x69c80d['shift']());}}}(a31_0x2a86,0x81f4e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a31_0x2a86(){const _0x4cd8ed=['.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','segmentId','2893420nqALOI','Segment\x20ID:\x20','name','ruleFile','segmentName','✔\x20Updated\x20segment\x20\x27','Updating\x20segment\x20\x27','includes','Resolving\x20path\x20\x27','updateSegmentById','type','verbose','117709GCBXyG','Resolved\x20folder\x20ID:\x20','5841409yhLzyG','Resolving\x20folder\x20\x27','resolveFolderId','folder','593064mOQyEj','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Examples:','parentId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','6reZGiR','resolvePathToResource','Resolved\x20type:\x20','433556LIwVWi','segment','kind','Parent\x20ID:\x20','error','4058217uINXHM','16gPOHvl','execute','3855250RUvTOc','rule','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','description','10lQggBD','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','length'];a31_0x2a86=function(){return _0x4cd8ed;};return a31_0x2a86();}import{withSpinner}from'../utils/spinner.js';function a31_0x4f17(_0x236c0d,_0x1defcf){const _0x2a8639=a31_0x2a86();return a31_0x4f17=function(_0x4f17b8,_0x2358b6){_0x4f17b8=_0x4f17b8-0x7c;let _0x54d7a1=_0x2a8639[_0x4f17b8];return _0x54d7a1;},a31_0x4f17(_0x236c0d,_0x1defcf);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';['description']='Update\x20existing\x20child\x20segment';async[a31_0x57de1a(0x94)](_0x50a668){const _0x3875e5=a31_0x57de1a,{options:_0x44db19,args:_0x5589a8,tdx:_0x3a6e6a}=_0x50a668,_0x1bf2ca=_0x44db19;if(_0x5589a8[_0x3875e5(0x9b)]===0x0)return console[_0x3875e5(0x91)](_0x3875e5(0x89)),console[_0x3875e5(0x91)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x3875e5(0x91)](_0x3875e5(0x87)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x3875e5(0x91)](_0x3875e5(0x97)),0x1;const _0x3450c8=_0x5589a8[0x0],_0x5acff9=_0x44db19['segmentPath'];let _0x4f2fb5=_0x3450c8;_0x5acff9&&!_0x3450c8[_0x3875e5(0xa6)]('/')&&(_0x4f2fb5=_0x5acff9+'/'+_0x3450c8,_0x1bf2ca['verbose']&&console[_0x3875e5(0x91)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4f2fb5));const _0x35afa3=await withSpinner(_0x3875e5(0xa7)+_0x4f2fb5+_0x3875e5(0x9d),()=>_0x3a6e6a[_0x3875e5(0x8e)][_0x3875e5(0x8b)](_0x4f2fb5),{'verbose':_0x1bf2ca[_0x3875e5(0x7e)]}),_0x6c6a92=_0x35afa3['data'];_0x1bf2ca[_0x3875e5(0x7e)]&&console[_0x3875e5(0x91)](_0x3875e5(0x8c)+_0x6c6a92[_0x3875e5(0x7d)]);if(_0x6c6a92[_0x3875e5(0x7d)]!==_0x3875e5(0x8e))return console['error']('Error:\x20Cannot\x20update\x20'+_0x6c6a92[_0x3875e5(0x7d)]+_0x3875e5(0x9c)),console[_0x3875e5(0x91)](_0x3875e5(0x9a)),0x1;if(!_0x6c6a92[_0x3875e5(0x9e)])throw new SDKError(ErrorCode['INTERNAL'],_0x3875e5(0x86));const _0x386e12=_0x6c6a92[_0x3875e5(0x88)],_0x1c04d0=_0x6c6a92[_0x3875e5(0x9e)];_0x1bf2ca[_0x3875e5(0x7e)]&&(console['error'](_0x3875e5(0x90)+_0x386e12),console[_0x3875e5(0x91)](_0x3875e5(0xa0)+_0x1c04d0));let _0x18eb8f;if(_0x1bf2ca[_0x3875e5(0x84)]){const _0x33ea65=_0x1bf2ca[_0x3875e5(0x84)],_0x81e871=await withSpinner(_0x3875e5(0x82)+_0x33ea65+'\x27...',()=>_0x3a6e6a[_0x3875e5(0x8e)][_0x3875e5(0x83)](_0x386e12,_0x33ea65),{'verbose':_0x1bf2ca[_0x3875e5(0x7e)]});_0x18eb8f=parseInt(_0x81e871['data'],0xa),_0x1bf2ca[_0x3875e5(0x7e)]&&console[_0x3875e5(0x91)](_0x3875e5(0x80)+_0x18eb8f);}const _0x2deabd=await loadJSONFromOptions(_0x1bf2ca[_0x3875e5(0x96)],_0x1bf2ca[_0x3875e5(0xa2)]),_0x29ef7e={'name':_0x1bf2ca[_0x3875e5(0xa1)],'description':_0x1bf2ca[_0x3875e5(0x98)],'rule':_0x2deabd,'kind':_0x1bf2ca[_0x3875e5(0x8f)]!==undefined?parseInt(_0x1bf2ca[_0x3875e5(0x8f)],0xa):undefined,'segmentFolderId':_0x18eb8f},_0x465760=await withSpinner(_0x3875e5(0xa5)+_0x6c6a92[_0x3875e5(0xa3)]+_0x3875e5(0x9d),()=>_0x3a6e6a[_0x3875e5(0x8e)][_0x3875e5(0x7c)](_0x386e12,_0x1c04d0,_0x29ef7e),{'verbose':_0x1bf2ca[_0x3875e5(0x7e)]}),_0x3c2ceb=_0x465760['data'];return console[_0x3875e5(0x91)](_0x3875e5(0xa4)+_0x3c2ceb[_0x3875e5(0xa1)]+'\x27'),_0x4f2fb5!==_0x3450c8&&console[_0x3875e5(0x91)]('\x20\x20\x20Path:\x20'+_0x4f2fb5),await handleSDKOutput([_0x3c2ceb],_0x1bf2ca),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a32_0x3804(_0x567e8f,_0x5eba8c){const _0x1e4aec=a32_0x1e4a();return a32_0x3804=function(_0x38049d,_0x106967){_0x38049d=_0x38049d-0x1c4;let _0x5113ed=_0x1e4aec[_0x38049d];return _0x5113ed;},a32_0x3804(_0x567e8f,_0x5eba8c);}function a32_0x1e4a(){const _0x4fb647=['10CHVRcb','folderId','Use:\x20tdx\x20segment\x20use\x20','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','segmentPath','length','Target\x20path:\x20','type','segment:use','Context\x20set\x20to:\x20','Resolved\x20path\x20type:\x20','segment','segments','slice','Resolving\x20path\x20\x27','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1369902UTKVYg','session','parentId','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','isAbsolute','1670184lslQtu','error','parentName','join','data','fullPath','Usage:\x20tdx\x20segment\x20use\x20<path>','folderPath','site','log','4989447txiDZp','458620iGOGuJ','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','1804105AJcFLA','Context\x20cleared.\x20Back\x20to\x20root.','Site:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','2053940NaMIWa','Parent\x20ID:\x20','Error:\x20Path\x20is\x20required','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','name','\x27...','3ICjVRV','resolvePathToResource','2tEqjWn','151483bjiLpR','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','verbose'];a32_0x1e4a=function(){return _0x4fb647;};return a32_0x1e4a();}const a32_0x19e94f=a32_0x3804;(function(_0x4a36a6,_0x331b7e){const _0x139bb4=a32_0x3804,_0x1a2ef8=_0x4a36a6();while(!![]){try{const _0x50f377=parseInt(_0x139bb4(0x1e6))/0x1*(parseInt(_0x139bb4(0x1e5))/0x2)+parseInt(_0x139bb4(0x1e3))/0x3*(parseInt(_0x139bb4(0x1d5))/0x4)+parseInt(_0x139bb4(0x1d7))/0x5+parseInt(_0x139bb4(0x1c5))/0x6+-parseInt(_0x139bb4(0x1dc))/0x7+parseInt(_0x139bb4(0x1ca))/0x8+-parseInt(_0x139bb4(0x1d4))/0x9*(parseInt(_0x139bb4(0x1e9))/0xa);if(_0x50f377===_0x331b7e)break;else _0x1a2ef8['push'](_0x1a2ef8['shift']());}catch(_0x8969ff){_0x1a2ef8['push'](_0x1a2ef8['shift']());}}}(a32_0x1e4a,0x34cb6));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a32_0x19e94f(0x1e1)]=a32_0x19e94f(0x1f1);['description']=a32_0x19e94f(0x1f9);async['execute'](_0x8b5bd7){const _0x38124d=a32_0x19e94f,{options:_0x5b8f70,args:_0x17987c,tdx:_0x4d83fe}=_0x8b5bd7;if(_0x17987c[_0x38124d(0x1ee)]===0x0)return console[_0x38124d(0x1cb)](_0x38124d(0x1de)),console['error'](_0x38124d(0x1d0)),console[_0x38124d(0x1cb)]('Examples:'),console[_0x38124d(0x1cb)](_0x38124d(0x1e0)),console[_0x38124d(0x1cb)](_0x38124d(0x1db)),console[_0x38124d(0x1cb)](_0x38124d(0x1da)),console[_0x38124d(0x1cb)](_0x38124d(0x1c8)),0x1;const _0x292fa3=_0x17987c[0x0],_0x4b502e=_0x5b8f70[_0x38124d(0x1c6)];try{if(_0x292fa3==='/')return saveSessionContext({'segment_path':undefined},_0x4b502e),console['log'](_0x38124d(0x1d8)),0x0;const _0x1d0c09=_0x5b8f70[_0x38124d(0x1ed)];let _0x7c1a90=_0x292fa3;const _0x22ac11=parsePath(_0x292fa3);if(!_0x22ac11[_0x38124d(0x1c9)]){if(!_0x1d0c09)return console[_0x38124d(0x1cb)](_0x38124d(0x1e7)),console[_0x38124d(0x1cb)](_0x38124d(0x1f8)),0x1;if(_0x292fa3==='..'){const _0x4bb992=_0x1d0c09['split']('/')[_0x38124d(0x1f6)](0x0,-0x1)[_0x38124d(0x1cd)]('/');_0x7c1a90=_0x4bb992||'/';}else _0x292fa3==='.'?_0x7c1a90=_0x1d0c09:_0x7c1a90=_0x1d0c09+'/'+_0x292fa3;_0x5b8f70[_0x38124d(0x1e8)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x7c1a90);}if(_0x7c1a90==='/'||_0x7c1a90==='')return saveSessionContext({'segment_path':undefined},_0x4b502e),console[_0x38124d(0x1d3)](_0x38124d(0x1d8)),0x0;_0x7c1a90=normalizePath(_0x7c1a90);const _0x2043cb=parsePath(_0x7c1a90)[_0x38124d(0x1f5)];if(_0x2043cb[_0x38124d(0x1ee)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4b502e),console['log'](_0x38124d(0x1d8)),0x0;_0x5b8f70[_0x38124d(0x1e8)]&&(console[_0x38124d(0x1cb)](_0x38124d(0x1d9)+_0x5b8f70[_0x38124d(0x1d2)]),console[_0x38124d(0x1cb)](_0x38124d(0x1ef)+_0x7c1a90));const _0x5e7b67=await withSpinner(_0x38124d(0x1f7)+_0x7c1a90+_0x38124d(0x1e2),()=>_0x4d83fe[_0x38124d(0x1f4)][_0x38124d(0x1e4)](_0x7c1a90),{'verbose':_0x5b8f70[_0x38124d(0x1e8)]}),_0x33b094=_0x5e7b67[_0x38124d(0x1ce)];_0x5b8f70[_0x38124d(0x1e8)]&&(console[_0x38124d(0x1cb)](_0x38124d(0x1f3)+_0x33b094[_0x38124d(0x1f0)]),console[_0x38124d(0x1cb)](_0x38124d(0x1dd)+_0x33b094[_0x38124d(0x1c7)]),_0x33b094['folderId']&&console[_0x38124d(0x1cb)](_0x38124d(0x1df)+_0x33b094[_0x38124d(0x1ea)]));if(_0x33b094[_0x38124d(0x1f0)]===_0x38124d(0x1f4))return console[_0x38124d(0x1cb)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x38124d(0x1cb)](_0x38124d(0x1c4)),console[_0x38124d(0x1cb)](_0x38124d(0x1eb)+_0x33b094[_0x38124d(0x1cc)]+(_0x33b094[_0x38124d(0x1d1)]?'/'+_0x33b094['folderPath'][_0x38124d(0x1cd)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x33b094[_0x38124d(0x1cf)],'parent_segment':_0x33b094[_0x38124d(0x1cc)]},_0x4b502e),console[_0x38124d(0x1d3)](_0x38124d(0x1f2)+_0x33b094[_0x38124d(0x1cf)]),_0x5b8f70['verbose']&&(console[_0x38124d(0x1cb)](_0x38124d(0x1d6)),console['error'](_0x38124d(0x1ec)),console[_0x38124d(0x1cb)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0x3b597c){throw _0x3b597c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a33_0x2c71(){const _0x4d1f99=['listParentsWithPattern','Parent\x20ID:\x20','data','6cEWsHX','jsonl','includes','389074QyoPgO','population','resolvePathToResource','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','execute','\x20\x20Cause:\x20','name','maxDepth','\x20folder','Listing\x20folders\x20and\x20segments...','No\x20parent\x20segments\x20match\x20pattern:\x20','9648dNqGmi','localeCompare','✔\x20Found\x20','👥\x20','log','filter','Folder\x20ID:\x20','Error:\x20','recursive','557868IVJSEN','listRecursive','folder','length','[parent\x20segments]','695276XzJAym','1DRtqyv','Listing\x20parent\x20segments\x20matching\x20\x27','12931180vJfswp','\x20and\x20','Listing\x20parent\x20segments...','Path/pattern\x20arg:\x20','Resolving\x20context\x20path\x20\x27','Site:\x20','✔\x20Built\x20tree\x20with\x20','2007YzFWKB','2105135XJvkCB','message','parentId','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','folderId','format','cause','json','attributes','listParents','\x27...','test','\x20matching\x20\x27','\x20parent\x20segment','map','listUnified','Current\x20context:\x20','verbose','segments','description','replace','dim','site','\x5c$&','1318080UjspMl','segment','Building\x20hierarchy\x20tree...','error'];a33_0x2c71=function(){return _0x4d1f99;};return a33_0x2c71();}const a33_0x375287=a33_0x54d8;(function(_0x225559,_0x1008f7){const _0x4dc994=a33_0x54d8,_0x4a25b6=_0x225559();while(!![]){try{const _0x3f12ed=parseInt(_0x4dc994(0xe9))/0x1*(-parseInt(_0x4dc994(0xe8))/0x2)+-parseInt(_0x4dc994(0x129))/0x3+-parseInt(_0x4dc994(0x10b))/0x4+-parseInt(_0x4dc994(0xf3))/0x5+parseInt(_0x4dc994(0x112))/0x6*(-parseInt(_0x4dc994(0x115))/0x7)+-parseInt(_0x4dc994(0x120))/0x8*(-parseInt(_0x4dc994(0xf2))/0x9)+parseInt(_0x4dc994(0xeb))/0xa;if(_0x3f12ed===_0x1008f7)break;else _0x4a25b6['push'](_0x4a25b6['shift']());}catch(_0x3959d9){_0x4a25b6['push'](_0x4a25b6['shift']());}}}(a33_0x2c71,0x3647d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a33_0x890f77 from'chalk';function a33_0x54d8(_0x473280,_0x3b5bb1){const _0x2c7145=a33_0x2c71();return a33_0x54d8=function(_0x54d83b,_0x5c700d){_0x54d83b=_0x54d83b-0xe4;let _0x12bedb=_0x2c7145[_0x54d83b];return _0x12bedb;},a33_0x54d8(_0x473280,_0x3b5bb1);}export class SegmentsCommand extends BaseCommand{[a33_0x375287(0x11b)]=a33_0x375287(0x105);[a33_0x375287(0x106)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a33_0x375287(0x119)](_0x231dea){const _0x41fab6=a33_0x375287,{options:_0x122d11,args:_0x3c7ae8}=_0x231dea,_0x274740=_0x122d11[_0x41fab6(0x128)],_0x446fb7=_0x3c7ae8[0x0];try{const _0x48cba0=_0x122d11['segmentPath'];_0x122d11[_0x41fab6(0x104)]&&(console[_0x41fab6(0x10e)](_0x41fab6(0xf0)+_0x122d11[_0x41fab6(0x109)]),console[_0x41fab6(0x10e)](_0x41fab6(0x103)+(_0x48cba0||'/')),_0x446fb7&&console[_0x41fab6(0x10e)](_0x41fab6(0xee)+_0x446fb7),_0x274740&&console[_0x41fab6(0x10e)]('Recursive\x20mode:\x20enabled'));if(_0x446fb7){const _0x10a39b=_0x446fb7['includes']('*')||_0x446fb7[_0x41fab6(0x114)]('?');if(_0x10a39b&&!_0x48cba0)return await this[_0x41fab6(0x10f)](_0x231dea,_0x446fb7);else return _0x10a39b?(console[_0x41fab6(0x10e)](_0x41fab6(0x118)),console['error'](_0x41fab6(0xf6)),0x1):_0x274740?await this['listRecursive'](_0x231dea,_0x446fb7):await this[_0x41fab6(0x102)](_0x231dea,_0x446fb7);}if(!_0x48cba0)return await this[_0x41fab6(0xfc)](_0x231dea);return _0x274740?await this[_0x41fab6(0xe4)](_0x231dea,_0x48cba0):await this[_0x41fab6(0x102)](_0x231dea,_0x48cba0);}catch(_0x3d098c){if(_0x3d098c instanceof SDKError)return console[_0x41fab6(0x10e)](_0x41fab6(0x127)+_0x3d098c[_0x41fab6(0xf4)]),_0x3d098c[_0x41fab6(0xf9)]&&console[_0x41fab6(0x10e)](_0x41fab6(0x11a)+_0x3d098c['cause']),0x1;throw _0x3d098c;}}async['listParentsWithPattern'](_0x1dbcbd,_0x5f1031){const _0xf68ad9=a33_0x375287,{options:_0x35f568,tdx:_0x310250}=_0x1dbcbd,_0x43f9de=await withSpinner(_0xf68ad9(0xea)+_0x5f1031+_0xf68ad9(0xfd),()=>_0x310250['segment'][_0xf68ad9(0xfc)](),{'verbose':_0x35f568[_0xf68ad9(0x104)]}),_0x355fa6=_0x43f9de[_0xf68ad9(0x111)],_0x284436=_0x5f1031[_0xf68ad9(0x107)](/[.+^${}()|[\]\\]/g,_0xf68ad9(0x10a))['replace'](/\*/g,'.*')[_0xf68ad9(0x107)](/\?/g,'.'),_0x4b56b1=new RegExp('^'+_0x284436+'$','i'),_0x5259a9=_0x355fa6[_0xf68ad9(0x125)](_0x43dfd4=>_0x4b56b1[_0xf68ad9(0xfe)](_0x43dfd4[_0xf68ad9(0xfb)][_0xf68ad9(0x11b)]));console['error']('✔\x20Found\x20'+_0x5259a9['length']+'\x20parent\x20segment'+(_0x5259a9[_0xf68ad9(0xe6)]!==0x1?'s':'')+_0xf68ad9(0xff)+_0x5f1031+'\x27');if(_0x35f568[_0xf68ad9(0xf8)]===_0xf68ad9(0xfa)||_0x35f568[_0xf68ad9(0xf8)]==='jsonl')await handleSDKOutput(_0x5259a9,_0x35f568);else{if(_0x5259a9[_0xf68ad9(0xe6)]===0x0)console[_0xf68ad9(0x124)](_0xf68ad9(0x11f)+_0x5f1031);else{console[_0xf68ad9(0x124)]('[parent\x20segments]');for(const _0x2a8010 of _0x5259a9){const _0xb488ab=_0x2a8010[_0xf68ad9(0xfb)][_0xf68ad9(0x116)]?a33_0x890f77[_0xf68ad9(0x108)]('\x20('+formatRows(_0x2a8010[_0xf68ad9(0xfb)][_0xf68ad9(0x116)])+')'):'';console[_0xf68ad9(0x124)](_0xf68ad9(0x123)+_0x2a8010[_0xf68ad9(0xfb)][_0xf68ad9(0x11b)]+_0xb488ab);}}}return 0x0;}async[a33_0x375287(0xfc)](_0x63002b){const _0x2830c5=a33_0x375287,{options:_0x27a0c2,tdx:_0xefe561}=_0x63002b,_0x7519e0=await withSpinner(_0x2830c5(0xed),()=>_0xefe561[_0x2830c5(0x10c)][_0x2830c5(0xfc)](),{'verbose':_0x27a0c2['verbose']}),_0x3bb367=_0x7519e0['data'];console[_0x2830c5(0x10e)](_0x2830c5(0x122)+_0x3bb367[_0x2830c5(0xe6)]+_0x2830c5(0x100)+(_0x3bb367[_0x2830c5(0xe6)]!==0x1?'s':''));if(_0x27a0c2[_0x2830c5(0xf8)]===_0x2830c5(0xfa)||_0x27a0c2[_0x2830c5(0xf8)]===_0x2830c5(0x113))await handleSDKOutput(_0x3bb367,_0x27a0c2);else{console[_0x2830c5(0x124)](_0x2830c5(0xe7));for(const _0x3cc942 of _0x3bb367){const _0x25127e=_0x3cc942[_0x2830c5(0xfb)][_0x2830c5(0x116)]?a33_0x890f77['dim']('\x20('+formatRows(_0x3cc942[_0x2830c5(0xfb)][_0x2830c5(0x116)])+')'):'';console[_0x2830c5(0x124)]('👥\x20'+_0x3cc942['attributes'][_0x2830c5(0x11b)]+_0x25127e);}}return 0x0;}async[a33_0x375287(0x102)](_0x3d35c3,_0x2c08e2){const _0x1fc851=a33_0x375287,{options:_0x82254d,tdx:_0x4dc833}=_0x3d35c3,_0x256e2d=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x2c08e2+_0x1fc851(0xfd),()=>_0x4dc833[_0x1fc851(0x10c)][_0x1fc851(0x117)](_0x2c08e2),{'verbose':_0x82254d['verbose']}),_0x4b6677=_0x256e2d['data'];_0x82254d['verbose']&&(console[_0x1fc851(0x10e)](_0x1fc851(0x110)+_0x4b6677['parentId']),_0x4b6677[_0x1fc851(0xf7)]&&console[_0x1fc851(0x10e)]('Folder\x20ID:\x20'+_0x4b6677[_0x1fc851(0xf7)]));const _0xa6b7e4=await withSpinner(_0x1fc851(0x11e),()=>_0x4dc833[_0x1fc851(0x10c)][_0x1fc851(0x102)](_0x4b6677[_0x1fc851(0xf5)],_0x4b6677[_0x1fc851(0xf7)]),{'verbose':_0x82254d['verbose']}),{folders:_0x3c20cc,segments:_0x53a84f}=_0xa6b7e4[_0x1fc851(0x111)],_0xc66c23=_0x3c20cc[_0x1fc851(0xe6)]+_0x53a84f['length'];console['error'](_0x1fc851(0x122)+_0x3c20cc[_0x1fc851(0xe6)]+_0x1fc851(0x11d)+(_0x3c20cc[_0x1fc851(0xe6)]!==0x1?'s':'')+_0x1fc851(0xec)+_0x53a84f[_0x1fc851(0xe6)]+'\x20segment'+(_0x53a84f[_0x1fc851(0xe6)]!==0x1?'s':''));if(_0x82254d[_0x1fc851(0xf8)]===_0x1fc851(0xfa)||_0x82254d[_0x1fc851(0xf8)]===_0x1fc851(0x113)){const _0x389576=[..._0x3c20cc[_0x1fc851(0x101)](_0x1c183b=>({..._0x1c183b,'type':_0x1fc851(0xe5)})),..._0x53a84f[_0x1fc851(0x101)](_0x396854=>({..._0x396854,'type':'segment'}))]['sort']((_0x39e36c,_0xfde7bd)=>_0x39e36c['name'][_0x1fc851(0x121)](_0xfde7bd[_0x1fc851(0x11b)]));await handleSDKOutput(_0x389576,_0x82254d);}else{if(_0xc66c23===0x0)console[_0x1fc851(0x124)](a33_0x890f77['dim']('[/'+_0x2c08e2+']')),console[_0x1fc851(0x124)]('(empty)');else{console['log'](a33_0x890f77['dim']('[/'+_0x2c08e2+']'));const _0x1e3d6d=formatFlatList(_0x3c20cc,_0x53a84f,{'showMetadata':!![]});console[_0x1fc851(0x124)](_0x1e3d6d);}}return 0x0;}async[a33_0x375287(0xe4)](_0x338125,_0x106831){const _0x464834=a33_0x375287,{options:_0xddb72d,tdx:_0x2ad819}=_0x338125,_0x13bbba=await withSpinner(_0x464834(0xef)+_0x106831+'\x27...',()=>_0x2ad819[_0x464834(0x10c)]['resolvePathToResource'](_0x106831),{'verbose':_0xddb72d['verbose']}),_0x3df995=_0x13bbba[_0x464834(0x111)];_0xddb72d[_0x464834(0x104)]&&(console[_0x464834(0x10e)](_0x464834(0x110)+_0x3df995[_0x464834(0xf5)]),_0x3df995['folderId']&&console[_0x464834(0x10e)](_0x464834(0x126)+_0x3df995[_0x464834(0xf7)]));const _0x168e17=_0xddb72d[_0x464834(0x11c)]||0xa,_0x3b8250=await withSpinner(_0x464834(0x10d),()=>_0x2ad819[_0x464834(0x10c)][_0x464834(0xe4)](_0x3df995[_0x464834(0xf5)],_0x3df995[_0x464834(0xf7)],0x0,_0x168e17),{'verbose':_0xddb72d[_0x464834(0x104)]}),_0x1cd18b=_0x3b8250['data'];console[_0x464834(0x10e)](_0x464834(0xf1)+_0x1cd18b[_0x464834(0xe6)]+'\x20top-level\x20items');if(_0xddb72d[_0x464834(0xf8)]===_0x464834(0xfa)||_0xddb72d[_0x464834(0xf8)]===_0x464834(0x113))await handleSDKOutput(_0x1cd18b,_0xddb72d);else{console[_0x464834(0x124)](a33_0x890f77[_0x464834(0x108)]('[/'+_0x106831+']'));const _0x226c42=formatTree(_0x1cd18b,{'showMetadata':!![]});console[_0x464834(0x124)](_0x226c42);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x4ac922=a34_0x2bb3;(function(_0x2a6661,_0x142b97){const _0x300fac=a34_0x2bb3,_0x135700=_0x2a6661();while(!![]){try{const _0x54b5e6=-parseInt(_0x300fac(0x173))/0x1*(parseInt(_0x300fac(0x14c))/0x2)+-parseInt(_0x300fac(0x148))/0x3+-parseInt(_0x300fac(0x172))/0x4+parseInt(_0x300fac(0x149))/0x5*(-parseInt(_0x300fac(0x15a))/0x6)+-parseInt(_0x300fac(0x15f))/0x7*(-parseInt(_0x300fac(0x155))/0x8)+parseInt(_0x300fac(0x14e))/0x9+-parseInt(_0x300fac(0x158))/0xa*(-parseInt(_0x300fac(0x15d))/0xb);if(_0x54b5e6===_0x142b97)break;else _0x135700['push'](_0x135700['shift']());}catch(_0x348606){_0x135700['push'](_0x135700['shift']());}}}(a34_0x2015,0x351af));function a34_0x2015(){const _0x1ca1f9=['...','223298EIaUbo','Show\x20table\x20contents','1258812BJQzCr','show','description','Catalog:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','32ZMzxTH','validate','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','87490ilioCn','Error:\x20','2009634pzUfbB','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Site:\x20','825xiyXFC','error','291872LoDTsy','message','Table:\x20','length','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','database','query','verbose','site','name','\x20\x20Cause:\x20','showTable','args','table','Database:\x20','data','\x20row','limit','Usage:\x20tdx\x20show\x20<database.table>','337580bNGmIN','1GDkSsa','642975deEVfd','5zRkxby','catalog'];a34_0x2015=function(){return _0x1ca1f9;};return a34_0x2015();}function a34_0x2bb3(_0x55e1d7,_0x30b495){const _0x20154f=a34_0x2015();return a34_0x2bb3=function(_0x2bb33e,_0x3d63c4){_0x2bb33e=_0x2bb33e-0x148;let _0x2ea764=_0x20154f[_0x2bb33e];return _0x2ea764;},a34_0x2bb3(_0x55e1d7,_0x30b495);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a34_0x4ac922(0x168)]=a34_0x4ac922(0x14f);[a34_0x4ac922(0x150)]=a34_0x4ac922(0x14d);async['execute'](_0x4e3cff){const _0x2e1ce5=a34_0x4ac922;return this[_0x2e1ce5(0x16a)](_0x4e3cff);}async[a34_0x4ac922(0x16a)](_0x11cbac){const _0x53cefc=a34_0x4ac922,{options:_0xf3ef4e,args:_0x2c408e,tdx:_0x32ba68}=_0x11cbac;let _0x2c8cbb;try{_0x2c8cbb=parseTableReference(_0x2c408e[0x0]);const _0xd6d27b=_0xf3ef4e[_0x53cefc(0x164)];!_0x2c8cbb[_0x53cefc(0x164)]&&_0xd6d27b&&(_0x2c8cbb['database']=_0xd6d27b);const _0x3f7d39=validateTableDescribeReference(_0x2c8cbb);if(_0x3f7d39)return console[_0x53cefc(0x15e)](_0x53cefc(0x159)+_0x3f7d39),console[_0x53cefc(0x15e)](_0x53cefc(0x171)),console[_0x53cefc(0x15e)](_0x53cefc(0x163)),console[_0x53cefc(0x15e)](_0x53cefc(0x153)),0x1;}catch(_0x2c9a74){return console['error'](_0x53cefc(0x159)+_0x2c9a74['message']),console[_0x53cefc(0x15e)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x53cefc(0x15e)](_0x53cefc(0x163)),console['error'](_0x53cefc(0x153)),0x1;}const _0x4d61bc=_0x2c8cbb[_0x53cefc(0x14a)],_0x5ef4bb=_0x2c8cbb[_0x53cefc(0x164)],_0x2b0579=_0x2c8cbb[_0x53cefc(0x16c)],_0x2b7087=resolveLimit(_0xf3ef4e[_0x53cefc(0x170)],DEFAULT_DISPLAY_LIMIT);try{_0xf3ef4e[_0x53cefc(0x166)]&&(console[_0x53cefc(0x15e)](_0x53cefc(0x15c)+_0xf3ef4e[_0x53cefc(0x167)]),_0x4d61bc&&console[_0x53cefc(0x15e)](_0x53cefc(0x151)+_0x4d61bc),console[_0x53cefc(0x15e)](_0x53cefc(0x16d)+_0x5ef4bb),console[_0x53cefc(0x15e)](_0x53cefc(0x161)+_0x2b0579),console[_0x53cefc(0x15e)]('Limit:\x20'+_0x2b7087));const _0x151c7f=_0x4d61bc?_0x4d61bc+'.'+_0x5ef4bb+'.'+_0x2b0579:_0x5ef4bb+'.'+_0x2b0579,_0x3df78a=await withSpinner('Querying\x20'+_0x151c7f+_0x53cefc(0x14b),()=>_0x32ba68[_0x53cefc(0x165)][_0x53cefc(0x16a)](_0x5ef4bb,_0x2b0579,_0x2b7087,_0x4d61bc),{'verbose':_0xf3ef4e[_0x53cefc(0x166)]}),_0x3952b1=_0x3df78a[_0x53cefc(0x16e)],_0xcefbc9=_0x3952b1[_0x53cefc(0x16e)];return _0xcefbc9['length']===0x0?console[_0x53cefc(0x15e)](_0x53cefc(0x152)):console[_0x53cefc(0x15e)]('✔\x20Retrieved\x20'+_0xcefbc9[_0x53cefc(0x162)]+_0x53cefc(0x16f)+(_0xcefbc9['length']!==0x1?'s':'')+'\x20from\x20'+_0x151c7f),await handleSDKOutput(_0xcefbc9,_0xf3ef4e),0x0;}catch(_0x4f8913){if(_0x4f8913 instanceof SDKError)return console[_0x53cefc(0x15e)]('Error:\x20'+_0x4f8913[_0x53cefc(0x160)]),_0x4f8913['cause']&&console[_0x53cefc(0x15e)](_0x53cefc(0x169)+_0x4f8913[_0x53cefc(0x154)]),0x1;throw _0x4f8913;}}[a34_0x4ac922(0x156)](_0x57f1dc){const _0x3ad9ca=a34_0x4ac922;if(_0x57f1dc[_0x3ad9ca(0x16b)][_0x3ad9ca(0x162)]===0x0)return _0x3ad9ca(0x15b);if(_0x57f1dc['args']['length']>0x1)return _0x3ad9ca(0x157);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a35_0x29ec(){const _0x289ecc=['\x20table','219200UzBkHB','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','519834WxzoLB','Error:\x20','266106ecyvcD','196889vvNcCs','\x20\x20Use:\x20tdx\x20tables\x20\x22','5Antwdq','tables','message','database','Database\x20pattern:\x20','Note:\x20\x27','.*\x22','includes','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Listing\x20tables...','Site:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20Cause:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','cause','39621cdNDCR','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','description','334990OTduDj','error','validate','limit','60HZpWub','verbose','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','site','27IPOdgn','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','16VGdvxm','207645XUlHes','Table\x20pattern:\x20','table','\x27\x20across\x20all\x20databases.','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x27\x20is\x20ambiguous.'];a35_0x29ec=function(){return _0x289ecc;};return a35_0x29ec();}function a35_0x3ea9(_0x1028b6,_0x48c5f2){const _0x29ec57=a35_0x29ec();return a35_0x3ea9=function(_0x3ea9b0,_0x51fd66){_0x3ea9b0=_0x3ea9b0-0x10d;let _0x5e804b=_0x29ec57[_0x3ea9b0];return _0x5e804b;},a35_0x3ea9(_0x1028b6,_0x48c5f2);}const a35_0x4ce7f7=a35_0x3ea9;(function(_0x5a9866,_0x3496cd){const _0x2e97db=a35_0x3ea9,_0xe55174=_0x5a9866();while(!![]){try{const _0x2c3fc0=parseInt(_0x2e97db(0x10e))/0x1+parseInt(_0x2e97db(0x115))/0x2+parseInt(_0x2e97db(0x12c))/0x3*(-parseInt(_0x2e97db(0x133))/0x4)+-parseInt(_0x2e97db(0x11d))/0x5*(parseInt(_0x2e97db(0x11a))/0x6)+parseInt(_0x2e97db(0x118))/0x7*(parseInt(_0x2e97db(0x10d))/0x8)+-parseInt(_0x2e97db(0x137))/0x9*(parseInt(_0x2e97db(0x12f))/0xa)+-parseInt(_0x2e97db(0x11b))/0xb;if(_0x2c3fc0===_0x3496cd)break;else _0xe55174['push'](_0xe55174['shift']());}catch(_0x1b5831){_0xe55174['push'](_0xe55174['shift']());}}}(a35_0x29ec,0x199d5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a35_0x4ce7f7(0x11e);[a35_0x4ce7f7(0x12e)]='List\x20tables\x20in\x20a\x20database';async['execute'](_0x34ef31){const _0x1e45ba=a35_0x4ce7f7,{options:_0x2378bf,args:_0x5c7137,tdx:_0x112bc5}=_0x34ef31;let _0x53f358;if(_0x5c7137[_0x1e45ba(0x116)]===0x0)_0x53f358={'database':undefined,'table':undefined,'original':''};else{if(_0x5c7137[_0x1e45ba(0x116)]===0x1)try{_0x53f358=parseTableReference(_0x5c7137[0x0]);if(_0x53f358[_0x1e45ba(0x110)]&&!_0x53f358[_0x1e45ba(0x120)]&&!_0x53f358[_0x1e45ba(0x110)][_0x1e45ba(0x124)]('*')&&!_0x53f358[_0x1e45ba(0x110)][_0x1e45ba(0x124)]('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x5c7137[0x0]+_0x1e45ba(0x113)),console[_0x1e45ba(0x130)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x53f358[_0x1e45ba(0x110)]+'\x27?'),console[_0x1e45ba(0x130)](_0x1e45ba(0x11c)+_0x53f358['table']+_0x1e45ba(0x123)),console[_0x1e45ba(0x130)](_0x1e45ba(0x128)+_0x53f358[_0x1e45ba(0x110)]),console[_0x1e45ba(0x130)](_0x1e45ba(0x125)+_0x53f358[_0x1e45ba(0x110)]),console[_0x1e45ba(0x130)](''),console[_0x1e45ba(0x130)](_0x1e45ba(0x122)+_0x5c7137[0x0]+_0x1e45ba(0x12a)+_0x53f358['table']+_0x1e45ba(0x111)),0x1;}catch(_0x4de77f){return console[_0x1e45ba(0x130)]('Error:\x20'+_0x4de77f[_0x1e45ba(0x11f)]),0x1;}else return console[_0x1e45ba(0x130)](_0x1e45ba(0x135)),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console['error'](_0x1e45ba(0x139)),console[_0x1e45ba(0x130)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x1e45ba(0x130)](_0x1e45ba(0x112)),console[_0x1e45ba(0x130)]('Or\x20use\x20--in\x20flag:'),console['error'](_0x1e45ba(0x12d)),0x1;}const _0x3e5524=_0x2378bf[_0x1e45ba(0x120)];!_0x53f358['database']&&_0x3e5524&&(_0x53f358[_0x1e45ba(0x120)]=_0x3e5524);try{const _0x3e9895=_0x23f34b=>_0x23f34b&&(_0x23f34b[_0x1e45ba(0x124)]('*')||_0x23f34b['includes']('?')),_0x5753f8=_0x3e9895(_0x53f358[_0x1e45ba(0x120)]);_0x2378bf['verbose']&&(console[_0x1e45ba(0x130)](_0x1e45ba(0x127)+_0x2378bf[_0x1e45ba(0x136)]),_0x53f358[_0x1e45ba(0x120)]?_0x5753f8?console[_0x1e45ba(0x130)](_0x1e45ba(0x121)+_0x53f358[_0x1e45ba(0x120)]):console[_0x1e45ba(0x130)]('Database:\x20'+_0x53f358[_0x1e45ba(0x120)]):console[_0x1e45ba(0x130)]('Database:\x20all'),_0x53f358[_0x1e45ba(0x110)]&&console[_0x1e45ba(0x130)](_0x1e45ba(0x10f)+_0x53f358[_0x1e45ba(0x110)]));const _0x50fdda=_0x53f358[_0x1e45ba(0x120)]&&!_0x5753f8?_0x53f358['database']:undefined,_0x525317=_0x5753f8?_0x53f358[_0x1e45ba(0x120)]:undefined,_0xe8fd33=_0x53f358[_0x1e45ba(0x110)],_0x125662=resolveLimit(_0x2378bf[_0x1e45ba(0x132)],DEFAULT_LISTING_LIMIT),_0x396153=await withSpinner(_0x1e45ba(0x126),()=>_0x112bc5['query']['listTables'](_0x50fdda,_0xe8fd33,_0x525317,_0x125662),{'verbose':_0x2378bf[_0x1e45ba(0x134)]}),_0xf86a08=_0x396153['data'];if(_0xf86a08[_0x1e45ba(0x116)]===0x0&&_0x53f358['database']&&!_0x5753f8)return console[_0x1e45ba(0x130)](_0x1e45ba(0x138)),console[_0x1e45ba(0x130)]('Database\x20\x27'+_0x53f358[_0x1e45ba(0x120)]+_0x1e45ba(0x117)),0x1;return console['error']('✔\x20Found\x20'+_0xf86a08['length']+_0x1e45ba(0x114)+(_0xf86a08[_0x1e45ba(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0xf86a08,{..._0x2378bf,'limit':_0x125662}),0x0;}catch(_0x15f4da){if(_0x15f4da instanceof SDKError)return console[_0x1e45ba(0x130)](_0x1e45ba(0x119)+_0x15f4da['message']),_0x15f4da[_0x1e45ba(0x12b)]&&console[_0x1e45ba(0x130)](_0x1e45ba(0x129)+_0x15f4da[_0x1e45ba(0x12b)]),0x1;throw _0x15f4da;}}[a35_0x4ce7f7(0x131)](_0x2aa291){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x19574c=a36_0x32e7;(function(_0x120912,_0x87da02){const _0x329556=a36_0x32e7,_0x255dc2=_0x120912();while(!![]){try{const _0x3adb17=parseInt(_0x329556(0x112))/0x1+-parseInt(_0x329556(0xfa))/0x2+-parseInt(_0x329556(0x109))/0x3*(-parseInt(_0x329556(0x117))/0x4)+parseInt(_0x329556(0x10e))/0x5+parseInt(_0x329556(0x11f))/0x6*(parseInt(_0x329556(0x108))/0x7)+-parseInt(_0x329556(0x11e))/0x8*(-parseInt(_0x329556(0x118))/0x9)+parseInt(_0x329556(0x10b))/0xa*(-parseInt(_0x329556(0x100))/0xb);if(_0x3adb17===_0x87da02)break;else _0x255dc2['push'](_0x255dc2['shift']());}catch(_0x5ecd0f){_0x255dc2['push'](_0x255dc2['shift']());}}}(a36_0x4d1e,0xa9d67));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a36_0x32e7(_0x5e0ded,_0x2af2f6){const _0x4d1e70=a36_0x4d1e();return a36_0x32e7=function(_0x32e79b,_0x1599c3){_0x32e79b=_0x32e79b-0xf9;let _0x599d46=_0x4d1e70[_0x32e79b];return _0x599d46;},a36_0x32e7(_0x5e0ded,_0x2af2f6);}export class UseCommand extends BaseCommand{[a36_0x19574c(0xfc)]='use';[a36_0x19574c(0x105)]=a36_0x19574c(0x116);[a36_0x19574c(0x114)](_0x1bc2e7){const _0x54d52f=a36_0x19574c,{args:_0x2f10b1}=_0x1bc2e7;if(_0x2f10b1[_0x54d52f(0x110)]<0x2)return _0x54d52f(0x10d)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x54d52f(0x121)+_0x54d52f(0x10c);const _0x374089=_0x2f10b1[0x0],_0x3fa1cb=[_0x54d52f(0x115),_0x54d52f(0xff),_0x54d52f(0x111),'profile',_0x54d52f(0x119)];if(!_0x3fa1cb[_0x54d52f(0x11a)](_0x374089))return'Invalid\x20resource:\x20'+_0x374089+_0x54d52f(0x107)+_0x3fa1cb[_0x54d52f(0x10a)](',\x20');return undefined;}async[a36_0x19574c(0x10f)](_0x1c4186){const _0x1f2d69=a36_0x19574c,{args:_0x1a5f46,options:_0x542430}=_0x1c4186;try{const _0x4634f5=_0x1a5f46[0x0],_0x3e4bca=_0x1a5f46[0x1];if(_0x4634f5==='profile'){if(!profileExists(_0x3e4bca))return console[_0x1f2d69(0xfd)](_0x1f2d69(0xf9)+_0x3e4bca+_0x1f2d69(0x101)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x4718c7=_0x542430[_0x1f2d69(0xfb)]||getCurrentSessionPID()[_0x1f2d69(0x11b)]();return saveSessionContext({'profile':_0x3e4bca},_0x542430[_0x1f2d69(0xfb)]),console['log'](_0x1f2d69(0x104)+_0x3e4bca+'\x20(session:\x20'+_0x4718c7+')'),console[_0x1f2d69(0xfe)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}const _0x2e3345={},_0x139581=_0x542430[_0x1f2d69(0xfb)]||getCurrentSessionPID()[_0x1f2d69(0x11b)]();switch(_0x4634f5){case'database':_0x2e3345[_0x1f2d69(0x115)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x11d)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;case _0x1f2d69(0xff):_0x2e3345[_0x1f2d69(0xff)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x113)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;case _0x1f2d69(0x111):_0x2e3345[_0x1f2d69(0x111)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x120)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;case _0x1f2d69(0x119):_0x2e3345[_0x1f2d69(0x119)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x106)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;}return saveSessionContext(_0x2e3345,_0x542430[_0x1f2d69(0xfb)]),console[_0x1f2d69(0xfe)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x365f9e){return _0x365f9e instanceof Error&&console[_0x1f2d69(0xfd)](_0x1f2d69(0x11c)+_0x365f9e[_0x1f2d69(0x103)]),0x1;}}}function a36_0x4d1e(){const _0x2e36ca=['length','llm_project','1165396tUqzcS','Session\x20parent_segment\x20set\x20to:\x20','validate','database','Set\x20session-level\x20context','40pdpUsd','1132938AZxoij','engage_workspace','includes','toString','Error:\x20','Session\x20database\x20set\x20to:\x20','8NwpFzB','6eVxeXO','Session\x20llm_project\x20set\x20to:\x20','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Error:\x20Profile\x20\x27','902874lnItfd','session','name','error','log','parent_segment','11cjeAJk','\x27\x20does\x20not\x20exist','\x20(session:\x20','message','Session\x20profile\x20set\x20to:\x20','description','Session\x20engage_workspace\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','3343942vQYptB','177789VTKESF','join','22202300XQrdgb','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','5028540MNwKIh','execute'];a36_0x4d1e=function(){return _0x2e36ca;};return a36_0x4d1e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a35_0xd85e(_0x2fbe9c,_0x51d1a6){const _0x45620f=a35_0x4562();return a35_0xd85e=function(_0xd85efe,_0x3c3a74){_0xd85efe=_0xd85efe-0xb7;let _0x1f9547=_0x45620f[_0xd85efe];return _0x1f9547;},a35_0xd85e(_0x2fbe9c,_0x51d1a6);}const a35_0x41fd43=a35_0xd85e;(function(_0xeea529,_0x2c0eac){const _0x2454b1=a35_0xd85e,_0x3e4050=_0xeea529();while(!![]){try{const _0x2c5558=-parseInt(_0x2454b1(0x11a))/0x1*(parseInt(_0x2454b1(0x131))/0x2)+-parseInt(_0x2454b1(0x153))/0x3+-parseInt(_0x2454b1(0xec))/0x4+-parseInt(_0x2454b1(0x12e))/0x5*(-parseInt(_0x2454b1(0xc7))/0x6)+parseInt(_0x2454b1(0xc5))/0x7+-parseInt(_0x2454b1(0xe0))/0x8+parseInt(_0x2454b1(0x116))/0x9;if(_0x2c5558===_0x2c0eac)break;else _0x3e4050['push'](_0x3e4050['shift']());}catch(_0x21fc1b){_0x3e4050['push'](_0x3e4050['shift']());}}}(a35_0x4562,0x249be));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a35_0x2452eb from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xf1);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xf3);async[a35_0x41fd43(0x10a)](_0x14417d){const _0xa74ae8=a35_0x41fd43,{options:_0x414c3e,args:_0x4bd90f,tdx:_0x248053}=_0x14417d,_0x4395d9=_0x4bd90f[0x0];try{_0x414c3e[_0xa74ae8(0xeb)]&&_0x4395d9&&console['error'](_0xa74ae8(0x133)+_0x4395d9);const _0x143c0e=await withSpinner(_0xa74ae8(0x136),()=>_0x248053['workflow'][_0xa74ae8(0x104)](_0x4395d9,{'limit':_0x414c3e[_0xa74ae8(0x10c)]}),{'verbose':_0x414c3e[_0xa74ae8(0xeb)]}),_0x2b27bd=_0x143c0e[_0xa74ae8(0x113)];return console[_0xa74ae8(0xee)]('✔\x20Found\x20'+_0x2b27bd[_0xa74ae8(0x155)]+_0xa74ae8(0x146)+(_0x2b27bd[_0xa74ae8(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x2b27bd,_0x414c3e),0x0;}catch(_0x4fe018){if(_0x4fe018 instanceof SDKError)return console['error'](_0xa74ae8(0x138)+_0x4fe018[_0xa74ae8(0x119)]),_0x4fe018['cause']&&console[_0xa74ae8(0xee)](_0xa74ae8(0x115)+_0x4fe018['cause']),0x1;throw _0x4fe018;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xca);[a35_0x41fd43(0x137)]='List\x20workflows';async['execute'](_0x1d2436){const _0x4c45e8=a35_0x41fd43,{options:_0x5b19cc,args:_0x5bbe48,tdx:_0x406e07}=_0x1d2436,_0xb8d481=_0x5bbe48[0x0];try{_0x5b19cc[_0x4c45e8(0xeb)]&&_0xb8d481&&console['error']('Project\x20filter:\x20'+_0xb8d481);const _0x4c5854=await withSpinner('Listing\x20workflows...',()=>_0x406e07[_0x4c45e8(0x141)][_0x4c45e8(0x140)](_0xb8d481,{'limit':_0x5b19cc[_0x4c45e8(0x10c)]}),{'verbose':_0x5b19cc['verbose']}),_0x1660ed=_0x4c5854[_0x4c45e8(0x113)];return console[_0x4c45e8(0xee)](_0x4c45e8(0x13a)+_0x1660ed[_0x4c45e8(0x155)]+_0x4c45e8(0xbd)+(_0x1660ed[_0x4c45e8(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x1660ed,_0x5b19cc),0x0;}catch(_0x451f9c){if(_0x451f9c instanceof SDKError)return console[_0x4c45e8(0xee)](_0x4c45e8(0x138)+_0x451f9c[_0x4c45e8(0x119)]),_0x451f9c['cause']&&console[_0x4c45e8(0xee)]('\x20\x20Cause:\x20'+_0x451f9c[_0x4c45e8(0xea)]),0x1;throw _0x451f9c;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a35_0x41fd43(0xbf);[a35_0x41fd43(0x137)]='List\x20workflow\x20execution\x20sessions';async[a35_0x41fd43(0x10a)](_0x2a7226){const _0x5ab1e7=a35_0x41fd43,{options:_0x57da2a,args:_0x44f635,tdx:_0x2bb57a}=_0x2a7226;let _0x33deee,_0x30db47;if(_0x44f635[0x0]){const _0xf926ce=_0x44f635[0x0][_0x5ab1e7(0xf4)]('.');if(_0xf926ce[_0x5ab1e7(0x155)]===0x1)_0x33deee=_0xf926ce[0x0];else{if(_0xf926ce['length']===0x2)[_0x33deee,_0x30db47]=_0xf926ce;else return console[_0x5ab1e7(0xee)](_0x5ab1e7(0x13e)),0x1;}}try{if(_0x57da2a['verbose']){if(_0x33deee&&_0x30db47)console[_0x5ab1e7(0xee)]('Filter:\x20'+_0x33deee+'.'+_0x30db47);else _0x33deee&&console[_0x5ab1e7(0xee)](_0x5ab1e7(0xc3)+_0x33deee);const _0x520ba6=_0x57da2a[_0x5ab1e7(0x12f)];_0x520ba6&&console[_0x5ab1e7(0xee)](_0x5ab1e7(0xb9)+_0x520ba6);}const _0x493de1=await withSpinner(_0x5ab1e7(0xbb),()=>_0x2bb57a[_0x5ab1e7(0x141)][_0x5ab1e7(0xb8)]({'projectName':_0x33deee,'workflowName':_0x30db47,'status':_0x57da2a[_0x5ab1e7(0x12f)],'fromTime':_0x57da2a[_0x5ab1e7(0x11f)],'toTime':_0x57da2a['to'],'limit':_0x57da2a['limit']}),{'verbose':_0x57da2a[_0x5ab1e7(0xeb)]}),_0x3144af=_0x493de1['data'];return console[_0x5ab1e7(0xee)](_0x5ab1e7(0x13a)+_0x3144af[_0x5ab1e7(0x155)]+_0x5ab1e7(0xcc)+(_0x3144af[_0x5ab1e7(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x3144af,_0x57da2a),0x0;}catch(_0x52e663){if(_0x52e663 instanceof SDKError)return console[_0x5ab1e7(0xee)]('Error:\x20'+_0x52e663[_0x5ab1e7(0x119)]),_0x52e663[_0x5ab1e7(0xea)]&&console[_0x5ab1e7(0xee)](_0x5ab1e7(0x115)+_0x52e663[_0x5ab1e7(0xea)]),0x1;throw _0x52e663;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a35_0x41fd43(0x120);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xfb);async[a35_0x41fd43(0x10a)](_0x5ac752){const _0x389a80=a35_0x41fd43,{options:_0xd4591c,args:_0x402cc2,tdx:_0x13375c}=_0x5ac752;let _0x55825b,_0x4db95f;if(_0x402cc2[0x0]){const _0x1cb6f7=_0x402cc2[0x0][_0x389a80(0xf4)]('.');if(_0x1cb6f7[_0x389a80(0x155)]===0x1)_0x55825b=_0x1cb6f7[0x0];else{if(_0x1cb6f7[_0x389a80(0x155)]===0x2)[_0x55825b,_0x4db95f]=_0x1cb6f7;else return console[_0x389a80(0xee)](_0x389a80(0x13e)),0x1;}}try{const _0x482abc=_0xd4591c['includeRetried'];if(_0xd4591c[_0x389a80(0xeb)]){if(_0x55825b&&_0x4db95f)console[_0x389a80(0xee)]('Filter:\x20'+_0x55825b+'.'+_0x4db95f);else _0x55825b&&console[_0x389a80(0xee)](_0x389a80(0xc3)+_0x55825b);_0x482abc&&console['error']('Include\x20retried:\x20yes');}const _0x12f6c3=await withSpinner(_0x389a80(0xf7),()=>_0x13375c[_0x389a80(0x141)]['attempts']({'projectName':_0x55825b,'workflowName':_0x4db95f,'includeRetried':_0x482abc,'limit':_0xd4591c[_0x389a80(0x10c)]}),{'verbose':_0xd4591c[_0x389a80(0xeb)]}),_0x1931f3=_0x12f6c3[_0x389a80(0x113)];return console[_0x389a80(0xee)]('✔\x20Found\x20'+_0x1931f3[_0x389a80(0x155)]+_0x389a80(0x144)+(_0x1931f3[_0x389a80(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x1931f3,_0xd4591c),0x0;}catch(_0x46f8ed){if(_0x46f8ed instanceof SDKError)return console['error'](_0x389a80(0x138)+_0x46f8ed[_0x389a80(0x119)]),_0x46f8ed[_0x389a80(0xea)]&&console[_0x389a80(0xee)](_0x389a80(0x115)+_0x46f8ed[_0x389a80(0xea)]),0x1;throw _0x46f8ed;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a35_0x41fd43(0x10d);[a35_0x41fd43(0x137)]=a35_0x41fd43(0x14a);async['execute'](_0x3df091){const _0x42ad80=a35_0x41fd43,{options:_0x1a28f2,args:_0x2b2220,tdx:_0x57cb6c}=_0x3df091,_0x13cca7=_0x2b2220[0x0];if(!_0x13cca7)return console[_0x42ad80(0xee)](_0x42ad80(0x128)),0x1;try{_0x1a28f2[_0x42ad80(0xeb)]&&console[_0x42ad80(0xee)]('Attempt\x20ID:\x20'+_0x13cca7);const _0x2b53af=await withSpinner(_0x42ad80(0xd2),()=>_0x57cb6c[_0x42ad80(0x141)][_0x42ad80(0x139)](_0x13cca7),{'verbose':_0x1a28f2[_0x42ad80(0xeb)]}),_0x2d33d2=_0x2b53af['data'];let _0x29512a;!_0x2d33d2[_0x42ad80(0x145)]?_0x29512a=_0x2d33d2[_0x42ad80(0x14b)]?_0x42ad80(0xe2):_0x42ad80(0xc4):_0x29512a=_0x2d33d2[_0x42ad80(0xc2)]?_0x42ad80(0xc2):_0x42ad80(0xee);let _0x1bb3d6;if(_0x2d33d2[_0x42ad80(0x14d)]&&_0x2d33d2[_0x42ad80(0xfc)]){const _0x366c0b=new Date(_0x2d33d2[_0x42ad80(0x14d)])[_0x42ad80(0x152)](),_0x340f9b=new Date(_0x2d33d2['finishedAt'])[_0x42ad80(0x152)]();_0x1bb3d6=Math[_0x42ad80(0x112)]((_0x340f9b-_0x366c0b)/0x3e8);}const _0x4c3a38={'attempt_id':_0x2d33d2['id'],'status':_0x29512a,..._0x2d33d2['index']!==undefined&&{'index':_0x2d33d2['index']},..._0x2d33d2[_0x42ad80(0xf5)]&&{'project':_0x2d33d2[_0x42ad80(0xf5)][_0x42ad80(0x123)]},..._0x2d33d2[_0x42ad80(0x141)]&&{'workflow':_0x2d33d2['workflow'][_0x42ad80(0x123)]},..._0x2d33d2[_0x42ad80(0xc9)]&&{'session_id':_0x2d33d2[_0x42ad80(0xc9)]},..._0x2d33d2[_0x42ad80(0x157)]&&{'session_time':_0x2d33d2[_0x42ad80(0x157)]},..._0x2d33d2[_0x42ad80(0xda)]&&{'retry_attempt':_0x2d33d2[_0x42ad80(0xda)]},..._0x1bb3d6!==undefined&&{'duration_sec':_0x1bb3d6},..._0x2d33d2['createdAt']&&{'created_at':_0x2d33d2[_0x42ad80(0x14d)]},..._0x2d33d2[_0x42ad80(0xfc)]&&{'finished_at':_0x2d33d2['finishedAt']},...Object[_0x42ad80(0xd0)](_0x2d33d2[_0x42ad80(0x106)])[_0x42ad80(0x155)]>0x0&&{'params':_0x2d33d2['params']}};return await handleSingleObjectOutput(_0x4c3a38,_0x1a28f2),0x0;}catch(_0x598d88){if(_0x598d88 instanceof SDKError)return console[_0x42ad80(0xee)](_0x42ad80(0x138)+_0x598d88[_0x42ad80(0x119)]),_0x598d88['cause']&&console[_0x42ad80(0xee)](_0x42ad80(0x115)+_0x598d88[_0x42ad80(0xea)]),0x1;throw _0x598d88;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a35_0x41fd43(0xba);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xf8);async[a35_0x41fd43(0x10a)](_0x46681b){const _0x12dc4b=a35_0x41fd43,{options:_0x551d09,args:_0x8c0e22,tdx:_0x2a3ddb}=_0x46681b,_0x22efee=_0x8c0e22[0x0];if(!_0x22efee)return console[_0x12dc4b(0xee)](_0x12dc4b(0x128)),0x1;try{const _0x175f43=_0x551d09[_0x12dc4b(0xb7)];_0x551d09[_0x12dc4b(0xeb)]&&(console[_0x12dc4b(0xee)](_0x12dc4b(0x13d)+_0x22efee),_0x175f43&&console['error'](_0x12dc4b(0xd4)));const _0x26d9ca=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x2a3ddb[_0x12dc4b(0x141)][_0x12dc4b(0x13b)](_0x22efee,_0x175f43||![]),{'verbose':_0x551d09['verbose']}),_0x732d00=_0x26d9ca[_0x12dc4b(0x113)];return console[_0x12dc4b(0xee)](_0x12dc4b(0x13a)+_0x732d00[_0x12dc4b(0x155)]+'\x20task'+(_0x732d00[_0x12dc4b(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x732d00,_0x551d09),0x0;}catch(_0x5af2e7){if(_0x5af2e7 instanceof SDKError)return console[_0x12dc4b(0xee)](_0x12dc4b(0x138)+_0x5af2e7['message']),_0x5af2e7[_0x12dc4b(0xea)]&&console[_0x12dc4b(0xee)](_0x12dc4b(0x115)+_0x5af2e7[_0x12dc4b(0xea)]),0x1;throw _0x5af2e7;}}}export class WorkflowLogsCommand extends BaseCommand{['name']=a35_0x41fd43(0x110);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xf2);async['execute'](_0x18705b){const _0x5adf3f=a35_0x41fd43,{options:_0x5965f1,args:_0x4f506a,tdx:_0x4911c6}=_0x18705b,_0x384acd=_0x4f506a[0x0];let _0x246e6e=_0x4f506a[0x1];if(!_0x384acd)return console['error'](_0x5adf3f(0x128)),0x1;try{_0x5965f1[_0x5adf3f(0xeb)]&&(console[_0x5adf3f(0xee)]('Attempt\x20ID:\x20'+_0x384acd),_0x246e6e&&console[_0x5adf3f(0xee)](_0x5adf3f(0x107)+_0x246e6e));const _0x1cdbdf=await withSpinner(_0x5adf3f(0xd7),()=>_0x4911c6[_0x5adf3f(0x141)]['logFiles'](_0x384acd,_0x246e6e),{'verbose':_0x5965f1['verbose']}),_0x54ef94=_0x1cdbdf['data'];if(_0x54ef94[_0x5adf3f(0x155)]===0x0)return console[_0x5adf3f(0xee)](_0x5adf3f(0xd9)),0x0;if(!_0x246e6e&&(_0x5965f1['json']||_0x5965f1[_0x5adf3f(0xf6)]))return await handleSDKOutput(_0x54ef94,_0x5965f1),0x0;if(!_0x246e6e){const _0x5c4b27=_0x54ef94['map'](_0x3edde3=>({'title':_0x3edde3[_0x5adf3f(0xdd)]+'\x20('+formatBytes(_0x3edde3[_0x5adf3f(0xc6)])+')','value':_0x3edde3[_0x5adf3f(0xdd)]})),_0x23c2ff=await a35_0x2452eb({'type':_0x5adf3f(0x10e),'name':_0x5adf3f(0xfa),'message':_0x5adf3f(0xd1),'choices':_0x5c4b27});if(!_0x23c2ff[_0x5adf3f(0xfa)])return console['error'](_0x5adf3f(0x143)),0x0;_0x246e6e=_0x23c2ff[_0x5adf3f(0xfa)];}const _0x4860c7=await withSpinner(_0x5adf3f(0xd5),()=>_0x4911c6[_0x5adf3f(0x141)][_0x5adf3f(0xbc)](_0x384acd,_0x246e6e),{'verbose':_0x5965f1['verbose']}),_0x53818c=_0x4860c7[_0x5adf3f(0x113)];return _0x53818c?console['log'](_0x53818c):console['error']('No\x20log\x20content\x20found'),0x0;}catch(_0x462c25){if(_0x462c25 instanceof SDKError)return console['error']('Error:\x20'+_0x462c25[_0x5adf3f(0x119)]),_0x462c25[_0x5adf3f(0xea)]&&console[_0x5adf3f(0xee)](_0x5adf3f(0x115)+_0x462c25[_0x5adf3f(0xea)]),0x1;throw _0x462c25;}}}export class WorkflowKillCommand extends BaseCommand{[a35_0x41fd43(0x123)]='workflow:kill';[a35_0x41fd43(0x137)]=a35_0x41fd43(0x15a);async['execute'](_0x1c4af5){const _0x4a077d=a35_0x41fd43,{options:_0x2eb3f0,args:_0x40e023,tdx:_0x345a79}=_0x1c4af5,_0x3842ab=_0x40e023[0x0];if(!_0x3842ab)return console[_0x4a077d(0xee)](_0x4a077d(0x128)),0x1;try{const _0x57b929=_0x2eb3f0[_0x4a077d(0x121)];_0x2eb3f0[_0x4a077d(0xeb)]&&(console[_0x4a077d(0xee)](_0x4a077d(0x13d)+_0x3842ab),_0x57b929&&console[_0x4a077d(0xee)]('Reason:\x20'+_0x57b929));if(!_0x2eb3f0[_0x4a077d(0xfe)]){const _0x25fa3a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3842ab+'?');if(!_0x25fa3a)return console[_0x4a077d(0xee)](_0x4a077d(0x143)),0x0;}const _0x31cfb8=await withSpinner(_0x4a077d(0x13c),()=>_0x345a79[_0x4a077d(0x141)][_0x4a077d(0xf9)](_0x3842ab,_0x57b929),{'verbose':_0x2eb3f0['verbose']}),_0x566e8a=_0x31cfb8['data'];return console[_0x4a077d(0xee)]('✔\x20'+_0x566e8a),0x0;}catch(_0x13ef70){if(_0x13ef70 instanceof SDKError)return console['error'](_0x4a077d(0x138)+_0x13ef70[_0x4a077d(0x119)]),_0x13ef70['cause']&&console[_0x4a077d(0xee)]('\x20\x20Cause:\x20'+_0x13ef70[_0x4a077d(0xea)]),0x1;throw _0x13ef70;}}}export class WorkflowRetryCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xe1);[a35_0x41fd43(0x137)]='Retry\x20a\x20session\x20or\x20attempt';async[a35_0x41fd43(0x10a)](_0x5e82c5){const _0x8d78af=a35_0x41fd43,{options:_0xe87798,args:_0x3addd6,tdx:_0x475c20}=_0x5e82c5,_0x4ac33d=_0x3addd6[0x0];if(!_0x4ac33d)return console[_0x8d78af(0xee)](_0x8d78af(0x11c)),console['error'](_0x8d78af(0x11e)),0x1;let _0x21c4af=![],_0x41073c=_0x4ac33d;if(_0x4ac33d[_0x8d78af(0x12c)]('session:'))_0x21c4af=!![],_0x41073c=_0x4ac33d['substring'](0x8);else{if(_0x4ac33d[_0x8d78af(0x12c)](_0x8d78af(0xed)))_0x21c4af=![],_0x41073c=_0x4ac33d[_0x8d78af(0x11b)](0x8);else return console['error'](_0x8d78af(0x117)),console[_0x8d78af(0xee)](_0x8d78af(0x11e)),0x1;}try{const _0x39c7ec=_0xe87798['fromTask'],_0x75b519=_0xe87798['resumeFrom'],_0x46a9c2=_0xe87798[_0x8d78af(0x106)],_0x163c89=_0xe87798[_0x8d78af(0x118)];_0xe87798[_0x8d78af(0xeb)]&&(console[_0x8d78af(0xee)]('Target:\x20'+(_0x21c4af?_0x8d78af(0x132):_0x8d78af(0x139))+'\x20'+_0x41073c),_0x39c7ec&&console[_0x8d78af(0xee)](_0x8d78af(0x105)+_0x39c7ec),_0x75b519&&console[_0x8d78af(0xee)](_0x8d78af(0xde)+_0x75b519),_0x46a9c2&&console[_0x8d78af(0xee)](_0x8d78af(0xc0)+_0x46a9c2),_0x163c89&&console['error'](_0x8d78af(0x114)));let _0x4d9b6a;if(_0x46a9c2)try{if(_0x46a9c2[_0x8d78af(0x12c)]('@')){const _0x1c9cf6=await import('fs/promises'),_0x55269c=_0x46a9c2[_0x8d78af(0x11b)](0x1),_0x4b24d7=await _0x1c9cf6[_0x8d78af(0xcb)](_0x55269c,_0x8d78af(0x135));_0x4d9b6a=JSON[_0x8d78af(0xc8)](_0x4b24d7);}else _0x4d9b6a=JSON[_0x8d78af(0xc8)](_0x46a9c2);}catch{return console[_0x8d78af(0xee)](_0x8d78af(0x10f)),0x1;}if(!_0xe87798[_0x8d78af(0xfe)]){const _0x188307=await confirm(_0x8d78af(0xd6)+(_0x21c4af?_0x8d78af(0x132):_0x8d78af(0x139))+'\x20'+_0x41073c+'?');if(!_0x188307)return console[_0x8d78af(0xee)](_0x8d78af(0x143)),0x0;}let _0x509180;_0x21c4af?_0x509180=await withSpinner(_0x8d78af(0x14f),()=>_0x475c20['workflow']['retrySession'](_0x41073c,{'fromTask':_0x39c7ec,'retryParams':_0x4d9b6a}),{'verbose':_0xe87798[_0x8d78af(0xeb)]}):_0x509180=await withSpinner(_0x8d78af(0xef),()=>_0x475c20['workflow']['retryAttempt'](_0x41073c,{'resumeFrom':_0x75b519,'retryParams':_0x4d9b6a,'force':_0x163c89}),{'verbose':_0xe87798[_0x8d78af(0xeb)]});const _0x133a87=_0x509180['data'];return console[_0x8d78af(0xee)](_0x8d78af(0x12b)),console['error'](_0x8d78af(0x150)+_0x133a87[_0x8d78af(0xdb)]),console[_0x8d78af(0xee)](_0x8d78af(0xd3)+_0x133a87['sessionId']),0x0;}catch(_0x261e11){if(_0x261e11 instanceof SDKError)return console[_0x8d78af(0xee)](_0x8d78af(0x138)+_0x261e11['message']),_0x261e11[_0x8d78af(0xea)]&&console['error'](_0x8d78af(0x115)+_0x261e11[_0x8d78af(0xea)]),0x1;throw _0x261e11;}}}export class WorkflowRunCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0x127);[a35_0x41fd43(0x137)]='Start\x20a\x20workflow\x20run';async[a35_0x41fd43(0x10a)](_0x35b955){const _0x27b943=a35_0x41fd43,{options:_0x11a5a9,args:_0x2cd433,tdx:_0x375b23}=_0x35b955,_0x38558c=_0x2cd433[0x0];if(!_0x38558c)return console[_0x27b943(0xee)](_0x27b943(0x124)),console['error'](_0x27b943(0x158)),0x1;const _0x1529db=_0x11a5a9[_0x27b943(0xe5)],_0x4ec947=_0x11a5a9[_0x27b943(0x157)],_0x2ea1c1={};if(_0x1529db&&Array[_0x27b943(0x101)](_0x1529db))for(const _0x3eec86 of _0x1529db){const _0x300e18=_0x3eec86['indexOf']('=');if(_0x300e18===-0x1)return console[_0x27b943(0xee)](_0x27b943(0x149)+_0x3eec86),console[_0x27b943(0xee)](_0x27b943(0x130)),0x1;const _0x518dfe=_0x3eec86[_0x27b943(0x11b)](0x0,_0x300e18),_0x43b701=_0x3eec86[_0x27b943(0x11b)](_0x300e18+0x1);try{_0x2ea1c1[_0x518dfe]=JSON[_0x27b943(0xc8)](_0x43b701);}catch{_0x2ea1c1[_0x518dfe]=_0x43b701;}}_0x11a5a9['verbose']&&(console[_0x27b943(0xee)](_0x27b943(0xc1)+_0x38558c),Object[_0x27b943(0xd0)](_0x2ea1c1)[_0x27b943(0x155)]>0x0&&console[_0x27b943(0xee)](_0x27b943(0xf0)+JSON[_0x27b943(0xdf)](_0x2ea1c1)),_0x4ec947&&console['error'](_0x27b943(0xe7)+_0x4ec947));const _0x3e48c5=await withSpinner('Starting\x20workflow\x20run...',()=>_0x375b23['workflow']['run'](_0x38558c,_0x2ea1c1,{'sessionTime':_0x4ec947}),{'verbose':_0x11a5a9[_0x27b943(0xeb)]}),_0x5bba8e=_0x3e48c5[_0x27b943(0x113)];return console[_0x27b943(0xee)](_0x27b943(0x156)),console[_0x27b943(0xee)](_0x27b943(0x100)+_0x5bba8e['id']),console[_0x27b943(0xee)](_0x27b943(0xd3)+_0x5bba8e['sessionId']),console[_0x27b943(0xee)]('\x20\x20Project:\x20'+_0x5bba8e[_0x27b943(0xf5)]?.[_0x27b943(0x123)]),console['error'](_0x27b943(0x125)+_0x5bba8e[_0x27b943(0x141)]?.[_0x27b943(0x123)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xe4);[a35_0x41fd43(0x137)]=a35_0x41fd43(0x147);async[a35_0x41fd43(0x10a)](_0x55cb9c){const _0x167d72=a35_0x41fd43,{options:_0x4eb352,args:_0x4a64c2,tdx:_0x4d278f}=_0x55cb9c,_0x4f91a1=_0x4a64c2[0x0],_0x1d1e40=_0x4a64c2[0x1]||'.';if(!_0x4f91a1)return console[_0x167d72(0xee)](_0x167d72(0x151)),console[_0x167d72(0xee)](_0x167d72(0x111)),0x1;const _0xabe1dc=_0x4eb352['revision'];_0x4eb352['verbose']&&(console[_0x167d72(0xee)](_0x167d72(0x102)+_0x4f91a1),console['error']('Output\x20directory:\x20'+_0x1d1e40),_0xabe1dc&&console[_0x167d72(0xee)](_0x167d72(0x13f)+_0xabe1dc));const _0x12aa90=await withSpinner(_0x167d72(0x108)+_0x4f91a1+_0x167d72(0x10b),()=>_0x4d278f[_0x167d72(0x141)]['download'](_0x4f91a1,_0x1d1e40,{'revision':_0xabe1dc}),{'verbose':_0x4eb352[_0x167d72(0xeb)]}),_0x1b3382=_0x12aa90[_0x167d72(0x113)];return console[_0x167d72(0xee)](_0x167d72(0xe9)+_0x1b3382[_0x167d72(0x134)]),console['error'](_0x167d72(0x159)+_0x1b3382['revision']),console[_0x167d72(0xee)](_0x167d72(0xe8)+_0x1b3382[_0x167d72(0x154)]),console['error'](_0x167d72(0x126)+_0x1d1e40+'/'+_0x1b3382[_0x167d72(0x134)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xe3);[a35_0x41fd43(0x137)]=a35_0x41fd43(0x12a);async[a35_0x41fd43(0x10a)](_0x4e6781){const _0x451e73=a35_0x41fd43,{options:_0x40ef3f,args:_0x2dcbc7,tdx:_0x5b7f31}=_0x4e6781;let _0x118651='.',_0x4e44c6=_0x40ef3f[_0x451e73(0x123)];if(_0x2dcbc7[0x0]){const {promises:_0x3bc404}=await import('fs');try{const _0x172cd6=await _0x3bc404['stat'](_0x2dcbc7[0x0]);if(_0x172cd6[_0x451e73(0xd8)]())_0x118651=_0x2dcbc7[0x0];else return console[_0x451e73(0xee)](_0x451e73(0x138)+_0x2dcbc7[0x0]+_0x451e73(0x14c)),0x1;}catch{_0x4e44c6=_0x2dcbc7[0x0],_0x118651='.';}}const _0x2a173a=_0x40ef3f['revision'],_0x356465=_0x40ef3f[_0x451e73(0xfd)];_0x40ef3f[_0x451e73(0xeb)]&&(console[_0x451e73(0xee)](_0x451e73(0xff)+_0x118651),_0x4e44c6&&console[_0x451e73(0xee)](_0x451e73(0xcf)+_0x4e44c6),_0x2a173a&&console[_0x451e73(0xee)](_0x451e73(0x13f)+_0x2a173a),_0x356465&&console['error'](_0x451e73(0x14e)));const _0x93a8c3=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x5b7f31[_0x451e73(0x141)][_0x451e73(0x148)](_0x118651,{'projectName':_0x4e44c6,'revision':_0x2a173a,'skipValidation':_0x356465}),{'verbose':_0x40ef3f[_0x451e73(0xeb)]}),_0x1b29b7=_0x93a8c3['data'];return console[_0x451e73(0xee)](_0x451e73(0xbe)+_0x1b29b7['projectName']),console[_0x451e73(0xee)](_0x451e73(0x11d)+_0x1b29b7['projectId']),console[_0x451e73(0xee)](_0x451e73(0x159)+_0x1b29b7[_0x451e73(0xe6)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0x103);[a35_0x41fd43(0x137)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a35_0x41fd43(0x10a)](_0x328ecd){const _0x2ea9eb=a35_0x41fd43,{options:_0x18e573,args:_0x5822d7,tdx:_0x127b27}=_0x328ecd,_0x2b8b1a=_0x5822d7[0x0];if(!_0x2b8b1a)return console['error'](_0x2ea9eb(0x129)),console[_0x2ea9eb(0xee)](_0x2ea9eb(0x12d)),0x1;_0x18e573[_0x2ea9eb(0xeb)]&&console[_0x2ea9eb(0xee)](_0x2ea9eb(0x102)+_0x2b8b1a);if(!_0x18e573[_0x2ea9eb(0xfe)]){const _0x3c15ff=await confirm(_0x2ea9eb(0x142)+_0x2b8b1a+_0x2ea9eb(0x109));if(!_0x3c15ff)return console[_0x2ea9eb(0xee)]('Cancelled'),0x0;}const _0x36d1c9=await withSpinner(_0x2ea9eb(0x122)+_0x2b8b1a+_0x2ea9eb(0x10b),()=>_0x127b27[_0x2ea9eb(0x141)][_0x2ea9eb(0xce)](_0x2b8b1a),{'verbose':_0x18e573[_0x2ea9eb(0xeb)]}),_0x3cbd4a=_0x36d1c9[_0x2ea9eb(0x113)];return console['error'](_0x2ea9eb(0xcd)+_0x3cbd4a[_0x2ea9eb(0x134)]),console[_0x2ea9eb(0xee)](_0x2ea9eb(0x11d)+_0x3cbd4a[_0x2ea9eb(0xdc)]),0x0;}}function a35_0x4562(){const _0x3ed161=['running','1631672XnlltT','fileSize','39372XQWKgP','parse','sessionId','workflow:workflows','readFile','\x20session','✔\x20Deleted\x20project\x20','delete','Project\x20name:\x20','keys','Select\x20a\x20task\x20to\x20view\x20logs:','Getting\x20attempt\x20details...','\x20\x20Session\x20ID:\x20','Including\x20subtasks:\x20yes','Downloading\x20logs...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Fetching\x20log\x20files...','isDirectory','No\x20log\x20files\x20found\x20for\x20this\x20attempt','retryAttemptName','attemptId','projectId','taskName','Resume\x20from:\x20','stringify','2362512UEnQuI','workflow:retry','canceling','workflow:push','workflow:download','param','revision','Session\x20time:\x20','\x20\x20Files\x20extracted:\x20','✔\x20Downloaded\x20','cause','verbose','321932EPBVdP','attempt:','error','Retrying\x20attempt...','Parameters:\x20','workflow:projects','Show\x20logs\x20for\x20a\x20workflow\x20attempt','List\x20all\x20workflow\x20projects','split','project','format','Listing\x20workflow\x20attempts...','Show\x20tasks\x20for\x20an\x20attempt','kill','task','List\x20workflow\x20attempts','finishedAt','skipValidation','yes','Project\x20directory:\x20','\x20\x20Attempt\x20ID:\x20','isArray','Project:\x20','workflow:delete','projects','From\x20task:\x20','params','Task\x20name:\x20','Downloading\x20project\x20','\x22?\x20This\x20cannot\x20be\x20undone.','execute','...','limit','workflow:attempt','select','Error:\x20Invalid\x20JSON\x20in\x20--params','workflow:logs','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','round','data','Force:\x20yes','\x20\x20Cause:\x20','3177405KGqqNV','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','force','message','60068oJhSzR','substring','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Project\x20ID:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','from','workflow:attempts','reason','Deleting\x20project\x20','name','Error:\x20Workflow\x20identifier\x20is\x20required','\x20\x20Workflow:\x20','\x20\x20Location:\x20','workflow:run','Error:\x20Attempt\x20ID\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','✔\x20Retry\x20started','startsWith','Usage:\x20workflow:delete\x20<project-name-or-id>','125QplUSo','status','Expected\x20format:\x20--param\x20key=value','6CdlSjP','session','Pattern:\x20','projectName','utf-8','Listing\x20workflow\x20projects...','description','Error:\x20','attempt','✔\x20Found\x20','tasks','Killing\x20attempt...','Attempt\x20ID:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Revision:\x20','workflows','workflow','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Cancelled','\x20attempt','done','\x20project','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','push','Error:\x20Invalid\x20parameter\x20format:\x20','Show\x20specific\x20attempt\x20details','cancelRequested','\x20is\x20not\x20a\x20directory','createdAt','Validation:\x20skipped','Retrying\x20session...','\x20\x20New\x20attempt\x20ID:\x20','Error:\x20Project\x20name\x20is\x20required','getTime','132720lwjUqG','filesExtracted','length','✔\x20Workflow\x20run\x20started','sessionTime','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','\x20\x20Revision:\x20','Kill\x20a\x20running\x20attempt','includeSubtasks','sessions','Status:\x20','workflow:tasks','Listing\x20workflow\x20sessions...','logs','\x20workflow','✔\x20Pushed\x20','workflow:sessions','Params:\x20','Workflow:\x20','success','Filter:\x20project='];a35_0x4562=function(){return _0x3ed161;};return a35_0x4562();}
|
|
1
|
+
const a37_0x4af247=a37_0x50b4;(function(_0x59b00b,_0xc54ef){const _0x360ea6=a37_0x50b4,_0x4697e8=_0x59b00b();while(!![]){try{const _0x4a9b74=parseInt(_0x360ea6(0xbc))/0x1*(-parseInt(_0x360ea6(0xa4))/0x2)+parseInt(_0x360ea6(0x8e))/0x3+parseInt(_0x360ea6(0x11f))/0x4+-parseInt(_0x360ea6(0xca))/0x5*(parseInt(_0x360ea6(0x117))/0x6)+parseInt(_0x360ea6(0xa6))/0x7*(-parseInt(_0x360ea6(0xef))/0x8)+-parseInt(_0x360ea6(0xd9))/0x9+parseInt(_0x360ea6(0xac))/0xa*(parseInt(_0x360ea6(0xc6))/0xb);if(_0x4a9b74===_0xc54ef)break;else _0x4697e8['push'](_0x4697e8['shift']());}catch(_0x3907c2){_0x4697e8['push'](_0x4697e8['shift']());}}}(a37_0x1436,0x96894));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a37_0x12b109 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0xf4);[a37_0x4af247(0xea)]=a37_0x4af247(0xd7);async[a37_0x4af247(0x118)](_0x4420b3){const _0x161d8c=a37_0x4af247,{options:_0x43cfa9,args:_0xb9506f,tdx:_0x4fc3f8}=_0x4420b3,_0x2a5040=_0xb9506f[0x0];try{_0x43cfa9[_0x161d8c(0xa2)]&&_0x2a5040&&console[_0x161d8c(0x10a)]('Pattern:\x20'+_0x2a5040);const _0xc4e598=await withSpinner(_0x161d8c(0x11c),()=>_0x4fc3f8[_0x161d8c(0xb8)][_0x161d8c(0x85)](_0x2a5040,{'limit':_0x43cfa9[_0x161d8c(0x8d)]}),{'verbose':_0x43cfa9['verbose']}),_0x51389a=_0xc4e598['data'];return console[_0x161d8c(0x10a)](_0x161d8c(0x102)+_0x51389a[_0x161d8c(0xdc)]+_0x161d8c(0xe4)+(_0x51389a['length']!==0x1?'s':'')),await handleSDKOutput(_0x51389a,_0x43cfa9),0x0;}catch(_0x50a6a7){if(_0x50a6a7 instanceof SDKError)return console['error'](_0x161d8c(0x11d)+_0x50a6a7['message']),_0x50a6a7[_0x161d8c(0x101)]&&console[_0x161d8c(0x10a)](_0x161d8c(0xb3)+_0x50a6a7[_0x161d8c(0x101)]),0x1;throw _0x50a6a7;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0xdd);[a37_0x4af247(0xea)]='List\x20workflows';async[a37_0x4af247(0x118)](_0x169585){const _0x33cb4b=a37_0x4af247,{options:_0x14100d,args:_0x3c9bac,tdx:_0x2cc69a}=_0x169585,_0x440381=_0x3c9bac[0x0];try{_0x14100d['verbose']&&_0x440381&&console['error'](_0x33cb4b(0xa5)+_0x440381);const _0x22cb54=await withSpinner(_0x33cb4b(0x96),()=>_0x2cc69a[_0x33cb4b(0xb8)]['workflows'](_0x440381,{'limit':_0x14100d['limit']}),{'verbose':_0x14100d[_0x33cb4b(0xa2)]}),_0xe3ca21=_0x22cb54[_0x33cb4b(0xf9)];return console[_0x33cb4b(0x10a)]('✔\x20Found\x20'+_0xe3ca21[_0x33cb4b(0xdc)]+_0x33cb4b(0xe5)+(_0xe3ca21[_0x33cb4b(0xdc)]!==0x1?'s':'')),await handleSDKOutput(_0xe3ca21,_0x14100d),0x0;}catch(_0x311ff0){if(_0x311ff0 instanceof SDKError)return console[_0x33cb4b(0x10a)](_0x33cb4b(0x11d)+_0x311ff0[_0x33cb4b(0xbe)]),_0x311ff0['cause']&&console[_0x33cb4b(0x10a)](_0x33cb4b(0xb3)+_0x311ff0[_0x33cb4b(0x101)]),0x1;throw _0x311ff0;}}}export class WorkflowSessionsCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0x97);[a37_0x4af247(0xea)]=a37_0x4af247(0x105);async[a37_0x4af247(0x118)](_0x4a0514){const _0x1ea6f1=a37_0x4af247,{options:_0x5bcf5e,args:_0x185593,tdx:_0x41c9c5}=_0x4a0514;let _0x2ab7b5,_0x2c64e3;if(_0x185593[0x0]){const _0x42d423=_0x185593[0x0][_0x1ea6f1(0xc8)]('.');if(_0x42d423[_0x1ea6f1(0xdc)]===0x1)_0x2ab7b5=_0x42d423[0x0];else{if(_0x42d423[_0x1ea6f1(0xdc)]===0x2)[_0x2ab7b5,_0x2c64e3]=_0x42d423;else return console[_0x1ea6f1(0x10a)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5bcf5e[_0x1ea6f1(0xa2)]){if(_0x2ab7b5&&_0x2c64e3)console['error'](_0x1ea6f1(0x89)+_0x2ab7b5+'.'+_0x2c64e3);else _0x2ab7b5&&console[_0x1ea6f1(0x10a)](_0x1ea6f1(0xf5)+_0x2ab7b5);const _0x5dff8a=_0x5bcf5e['status'];_0x5dff8a&&console[_0x1ea6f1(0x10a)](_0x1ea6f1(0xdb)+_0x5dff8a);}const _0x222aa6=await withSpinner(_0x1ea6f1(0x9d),()=>_0x41c9c5[_0x1ea6f1(0xb8)][_0x1ea6f1(0xf3)]({'projectName':_0x2ab7b5,'workflowName':_0x2c64e3,'status':_0x5bcf5e['status'],'fromTime':_0x5bcf5e[_0x1ea6f1(0x9a)],'toTime':_0x5bcf5e['to'],'limit':_0x5bcf5e['limit']}),{'verbose':_0x5bcf5e[_0x1ea6f1(0xa2)]}),_0x26712a=_0x222aa6[_0x1ea6f1(0xf9)];return console[_0x1ea6f1(0x10a)](_0x1ea6f1(0x102)+_0x26712a[_0x1ea6f1(0xdc)]+_0x1ea6f1(0x93)+(_0x26712a[_0x1ea6f1(0xdc)]!==0x1?'s':'')),await handleSDKOutput(_0x26712a,_0x5bcf5e),0x0;}catch(_0x55440b){if(_0x55440b instanceof SDKError)return console[_0x1ea6f1(0x10a)](_0x1ea6f1(0x11d)+_0x55440b['message']),_0x55440b['cause']&&console[_0x1ea6f1(0x10a)](_0x1ea6f1(0xb3)+_0x55440b['cause']),0x1;throw _0x55440b;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a37_0x4af247(0x8c);[a37_0x4af247(0xea)]='List\x20workflow\x20attempts';async[a37_0x4af247(0x118)](_0x136926){const _0x2f09ff=a37_0x4af247,{options:_0x1b5cf0,args:_0x32360f,tdx:_0x1ea2a4}=_0x136926;let _0x5a23d5,_0xd48ae8;if(_0x32360f[0x0]){const _0x89e91b=_0x32360f[0x0][_0x2f09ff(0xc8)]('.');if(_0x89e91b[_0x2f09ff(0xdc)]===0x1)_0x5a23d5=_0x89e91b[0x0];else{if(_0x89e91b[_0x2f09ff(0xdc)]===0x2)[_0x5a23d5,_0xd48ae8]=_0x89e91b;else return console[_0x2f09ff(0x10a)](_0x2f09ff(0xeb)),0x1;}}try{const _0x38ae33=_0x1b5cf0[_0x2f09ff(0xae)];if(_0x1b5cf0[_0x2f09ff(0xa2)]){if(_0x5a23d5&&_0xd48ae8)console[_0x2f09ff(0x10a)](_0x2f09ff(0x89)+_0x5a23d5+'.'+_0xd48ae8);else _0x5a23d5&&console[_0x2f09ff(0x10a)](_0x2f09ff(0xf5)+_0x5a23d5);_0x38ae33&&console[_0x2f09ff(0x10a)](_0x2f09ff(0x9c));}const _0xfe62b9=await withSpinner(_0x2f09ff(0x109),()=>_0x1ea2a4[_0x2f09ff(0xb8)][_0x2f09ff(0x108)]({'projectName':_0x5a23d5,'workflowName':_0xd48ae8,'includeRetried':_0x38ae33,'limit':_0x1b5cf0['limit']}),{'verbose':_0x1b5cf0[_0x2f09ff(0xa2)]}),_0x34a2c1=_0xfe62b9[_0x2f09ff(0xf9)];return console['error'](_0x2f09ff(0x102)+_0x34a2c1['length']+'\x20attempt'+(_0x34a2c1['length']!==0x1?'s':'')),await handleSDKOutput(_0x34a2c1,_0x1b5cf0),0x0;}catch(_0x4aa527){if(_0x4aa527 instanceof SDKError)return console[_0x2f09ff(0x10a)](_0x2f09ff(0x11d)+_0x4aa527[_0x2f09ff(0xbe)]),_0x4aa527[_0x2f09ff(0x101)]&&console[_0x2f09ff(0x10a)](_0x2f09ff(0xb3)+_0x4aa527[_0x2f09ff(0x101)]),0x1;throw _0x4aa527;}}}function a37_0x50b4(_0x7436a7,_0x318a2f){const _0x1436a2=a37_0x1436();return a37_0x50b4=function(_0x50b439,_0x4323b8){_0x50b439=_0x50b439-0x7c;let _0x13d544=_0x1436a2[_0x50b439];return _0x13d544;},a37_0x50b4(_0x7436a7,_0x318a2f);}export class WorkflowAttemptCommand extends BaseCommand{['name']=a37_0x4af247(0xba);['description']=a37_0x4af247(0x8f);async[a37_0x4af247(0x118)](_0x428190){const _0xa0368b=a37_0x4af247,{options:_0x3dc3ea,args:_0x324178,tdx:_0x346b39}=_0x428190,_0x4ebc85=_0x324178[0x0];if(!_0x4ebc85)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x3dc3ea['verbose']&&console[_0xa0368b(0x10a)]('Attempt\x20ID:\x20'+_0x4ebc85);const _0x392374=await withSpinner('Getting\x20attempt\x20details...',()=>_0x346b39[_0xa0368b(0xb8)][_0xa0368b(0xbb)](_0x4ebc85),{'verbose':_0x3dc3ea[_0xa0368b(0xa2)]}),_0x3d12dd=_0x392374[_0xa0368b(0xf9)];let _0x4241d1;!_0x3d12dd[_0xa0368b(0x110)]?_0x4241d1=_0x3d12dd[_0xa0368b(0x11b)]?_0xa0368b(0xb0):_0xa0368b(0x120):_0x4241d1=_0x3d12dd[_0xa0368b(0xd3)]?_0xa0368b(0xd3):_0xa0368b(0x10a);let _0x585926;if(_0x3d12dd[_0xa0368b(0xd6)]&&_0x3d12dd[_0xa0368b(0xf7)]){const _0x363f66=new Date(_0x3d12dd[_0xa0368b(0xd6)])[_0xa0368b(0x111)](),_0x2bbe3f=new Date(_0x3d12dd[_0xa0368b(0xf7)])['getTime']();_0x585926=Math[_0xa0368b(0xbd)]((_0x2bbe3f-_0x363f66)/0x3e8);}const _0x13a9dc={'attempt_id':_0x3d12dd['id'],'status':_0x4241d1,..._0x3d12dd[_0xa0368b(0xb5)]!==undefined&&{'index':_0x3d12dd['index']},..._0x3d12dd[_0xa0368b(0x11a)]&&{'project':_0x3d12dd['project'][_0xa0368b(0xfa)]},..._0x3d12dd['workflow']&&{'workflow':_0x3d12dd[_0xa0368b(0xb8)]['name']},..._0x3d12dd['sessionId']&&{'session_id':_0x3d12dd[_0xa0368b(0x80)]},..._0x3d12dd[_0xa0368b(0x8b)]&&{'session_time':_0x3d12dd[_0xa0368b(0x8b)]},..._0x3d12dd[_0xa0368b(0xee)]&&{'retry_attempt':_0x3d12dd[_0xa0368b(0xee)]},..._0x585926!==undefined&&{'duration_sec':_0x585926},..._0x3d12dd[_0xa0368b(0xd6)]&&{'created_at':_0x3d12dd['createdAt']},..._0x3d12dd[_0xa0368b(0xf7)]&&{'finished_at':_0x3d12dd[_0xa0368b(0xf7)]},...Object[_0xa0368b(0xe2)](_0x3d12dd['params'])['length']>0x0&&{'params':_0x3d12dd[_0xa0368b(0x91)]}};return await handleSingleObjectOutput(_0x13a9dc,_0x3dc3ea),0x0;}catch(_0x2c1c8d){if(_0x2c1c8d instanceof SDKError)return console['error'](_0xa0368b(0x11d)+_0x2c1c8d[_0xa0368b(0xbe)]),_0x2c1c8d[_0xa0368b(0x101)]&&console[_0xa0368b(0x10a)](_0xa0368b(0xb3)+_0x2c1c8d[_0xa0368b(0x101)]),0x1;throw _0x2c1c8d;}}}export class WorkflowTasksCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0xc7);[a37_0x4af247(0xea)]=a37_0x4af247(0xd1);async[a37_0x4af247(0x118)](_0x4789dc){const _0x56003e=a37_0x4af247,{options:_0x34ec2d,args:_0x18261e,tdx:_0x698a9e}=_0x4789dc,_0x424451=_0x18261e[0x0];if(!_0x424451)return console[_0x56003e(0x10a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x49d02c=_0x34ec2d[_0x56003e(0xc4)];_0x34ec2d[_0x56003e(0xa2)]&&(console[_0x56003e(0x10a)](_0x56003e(0xb1)+_0x424451),_0x49d02c&&console[_0x56003e(0x10a)](_0x56003e(0xf1)));const _0x2eff4e=await withSpinner(_0x56003e(0xb9),()=>_0x698a9e['workflow'][_0x56003e(0x90)](_0x424451,_0x49d02c||![]),{'verbose':_0x34ec2d[_0x56003e(0xa2)]}),_0x1fd013=_0x2eff4e[_0x56003e(0xf9)];return console[_0x56003e(0x10a)]('✔\x20Found\x20'+_0x1fd013[_0x56003e(0xdc)]+_0x56003e(0x116)+(_0x1fd013[_0x56003e(0xdc)]!==0x1?'s':'')),await handleSDKOutput(_0x1fd013,_0x34ec2d),0x0;}catch(_0x475021){if(_0x475021 instanceof SDKError)return console[_0x56003e(0x10a)]('Error:\x20'+_0x475021[_0x56003e(0xbe)]),_0x475021['cause']&&console['error'](_0x56003e(0xb3)+_0x475021[_0x56003e(0x101)]),0x1;throw _0x475021;}}}function a37_0x1436(){const _0x2117c0=['Listing\x20workflow\x20sessions...','✔\x20Workflow\x20run\x20started','Error:\x20Project\x20name\x20is\x20required','\x20\x20Attempt\x20ID:\x20','param','verbose','filesExtracted','1156DhwtSj','Project\x20filter:\x20','2359406XjrFuX','readFile','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x22?\x20This\x20cannot\x20be\x20undone.','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Kill\x20a\x20running\x20attempt','9707930FYLGkg','workflow:push','includeRetried','Usage:\x20workflow:delete\x20<project-name-or-id>','canceling','Attempt\x20ID:\x20','Session\x20time:\x20','\x20\x20Cause:\x20','utf-8','index','Error:\x20Invalid\x20JSON\x20in\x20--params','format','workflow','Getting\x20attempt\x20tasks...','workflow:attempt','attempt','631sDfrQh','round','message','Expected\x20format:\x20--param\x20key=value','delete','projectName','stringify','\x20\x20New\x20attempt\x20ID:\x20','includeSubtasks','parse','22uNHQcw','workflow:tasks','split','Retry\x20a\x20session\x20or\x20attempt','1305rLVWAy','\x20is\x20not\x20a\x20directory','\x20\x20Project:\x20','Start\x20a\x20workflow\x20run','...','Retrying\x20attempt...','stat','Show\x20tasks\x20for\x20an\x20attempt','fileSize','success','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','✔\x20Deleted\x20project\x20','createdAt','List\x20all\x20workflow\x20projects','workflow:run','10141506roSNnw','resumeFrom','Status:\x20','length','workflow:workflows','\x20\x20Workflow:\x20','Output\x20directory:\x20','✔\x20Downloaded\x20','map','keys','retrySession','\x20project','\x20workflow','retryAttempt','push','session:','Project\x20directory:\x20','description','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','run','No\x20log\x20files\x20found\x20for\x20this\x20attempt','retryAttemptName','16MrLFqT','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Including\x20subtasks:\x20yes','Revision:\x20','sessions','workflow:projects','Filter:\x20project=','workflow:kill','finishedAt','substring','data','name','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Retry\x20started','Reason:\x20','json','Validation:\x20skipped','Downloading\x20logs...','cause','✔\x20Found\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','task','List\x20workflow\x20execution\x20sessions','Workflow:\x20','kill','attempts','Listing\x20workflow\x20attempts...','error','Resume\x20from:\x20','Fetching\x20log\x20files...','Parameters:\x20','startsWith','\x20\x20Session\x20ID:\x20','done','getTime','Pushing\x20workflow\x20project...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Error:\x20Invalid\x20parameter\x20format:\x20','\x20task','27954oGDqlV','execute','From\x20task:\x20','project','cancelRequested','Listing\x20workflow\x20projects...','Error:\x20','fromTask','4640928iCCjFm','running','\x20\x20Location:\x20','workflow:delete','Starting\x20workflow\x20run...','attemptId','Cancelled','Downloading\x20project\x20','attempt:','sessionId','session','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Project:\x20','select','projects','✔\x20Pushed\x20','download','Retrying\x20session...','Filter:\x20','Error:\x20Attempt\x20ID\x20is\x20required','sessionTime','workflow:attempts','limit','2689335USTwmu','Show\x20specific\x20attempt\x20details','tasks','params','workflow:download','\x20session','yes','projectId','Listing\x20workflows...','workflow:sessions','revision','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','from','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Include\x20retried:\x20yes'];a37_0x1436=function(){return _0x2117c0;};return a37_0x1436();}export class WorkflowLogsCommand extends BaseCommand{[a37_0x4af247(0xfa)]='workflow:logs';[a37_0x4af247(0xea)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a37_0x4af247(0x118)](_0x48178d){const _0xfed8dd=a37_0x4af247,{options:_0x1c6a47,args:_0x55c4cf,tdx:_0x576386}=_0x48178d,_0x5d78f0=_0x55c4cf[0x0];let _0x844715=_0x55c4cf[0x1];if(!_0x5d78f0)return console['error'](_0xfed8dd(0x8a)),0x1;try{_0x1c6a47[_0xfed8dd(0xa2)]&&(console[_0xfed8dd(0x10a)]('Attempt\x20ID:\x20'+_0x5d78f0),_0x844715&&console[_0xfed8dd(0x10a)]('Task\x20name:\x20'+_0x844715));const _0x5b35a9=await withSpinner(_0xfed8dd(0x10c),()=>_0x576386[_0xfed8dd(0xb8)]['logFiles'](_0x5d78f0,_0x844715),{'verbose':_0x1c6a47[_0xfed8dd(0xa2)]}),_0x4ab443=_0x5b35a9[_0xfed8dd(0xf9)];if(_0x4ab443[_0xfed8dd(0xdc)]===0x0)return console[_0xfed8dd(0x10a)](_0xfed8dd(0xed)),0x0;if(!_0x844715&&(_0x1c6a47[_0xfed8dd(0xfe)]||_0x1c6a47[_0xfed8dd(0xb7)]))return await handleSDKOutput(_0x4ab443,_0x1c6a47),0x0;if(!_0x844715){const _0x10482d=_0x4ab443[_0xfed8dd(0xe1)](_0x5ddecc=>({'title':_0x5ddecc['taskName']+'\x20('+formatBytes(_0x5ddecc[_0xfed8dd(0xd2)])+')','value':_0x5ddecc['taskName']})),_0x26a48c=await a37_0x12b109({'type':_0xfed8dd(0x84),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x10482d});if(!_0x26a48c[_0xfed8dd(0x104)])return console[_0xfed8dd(0x10a)](_0xfed8dd(0x7d)),0x0;_0x844715=_0x26a48c[_0xfed8dd(0x104)];}const _0x34e0fb=await withSpinner(_0xfed8dd(0x100),()=>_0x576386[_0xfed8dd(0xb8)]['logs'](_0x5d78f0,_0x844715),{'verbose':_0x1c6a47[_0xfed8dd(0xa2)]}),_0x42f898=_0x34e0fb[_0xfed8dd(0xf9)];return _0x42f898?console['log'](_0x42f898):console['error']('No\x20log\x20content\x20found'),0x0;}catch(_0xda3f5a){if(_0xda3f5a instanceof SDKError)return console[_0xfed8dd(0x10a)]('Error:\x20'+_0xda3f5a[_0xfed8dd(0xbe)]),_0xda3f5a['cause']&&console[_0xfed8dd(0x10a)](_0xfed8dd(0xb3)+_0xda3f5a['cause']),0x1;throw _0xda3f5a;}}}export class WorkflowKillCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0xf6);['description']=a37_0x4af247(0xab);async[a37_0x4af247(0x118)](_0x508807){const _0x47cdc5=a37_0x4af247,{options:_0x4b9617,args:_0x437cbb,tdx:_0x379550}=_0x508807,_0x265d01=_0x437cbb[0x0];if(!_0x265d01)return console[_0x47cdc5(0x10a)](_0x47cdc5(0x8a)),0x1;try{const _0x577f37=_0x4b9617['reason'];_0x4b9617['verbose']&&(console['error'](_0x47cdc5(0xb1)+_0x265d01),_0x577f37&&console[_0x47cdc5(0x10a)](_0x47cdc5(0xfd)+_0x577f37));if(!_0x4b9617[_0x47cdc5(0x94)]){const _0x126075=await confirm(_0x47cdc5(0x114)+_0x265d01+'?');if(!_0x126075)return console[_0x47cdc5(0x10a)]('Cancelled'),0x0;}const _0x257c88=await withSpinner('Killing\x20attempt...',()=>_0x379550[_0x47cdc5(0xb8)][_0x47cdc5(0x107)](_0x265d01,_0x577f37),{'verbose':_0x4b9617[_0x47cdc5(0xa2)]}),_0xa4a8a1=_0x257c88[_0x47cdc5(0xf9)];return console[_0x47cdc5(0x10a)]('✔\x20'+_0xa4a8a1),0x0;}catch(_0x3dde78){if(_0x3dde78 instanceof SDKError)return console[_0x47cdc5(0x10a)](_0x47cdc5(0x11d)+_0x3dde78[_0x47cdc5(0xbe)]),_0x3dde78['cause']&&console[_0x47cdc5(0x10a)](_0x47cdc5(0xb3)+_0x3dde78[_0x47cdc5(0x101)]),0x1;throw _0x3dde78;}}}export class WorkflowRetryCommand extends BaseCommand{[a37_0x4af247(0xfa)]='workflow:retry';[a37_0x4af247(0xea)]=a37_0x4af247(0xc9);async[a37_0x4af247(0x118)](_0x2fd264){const _0x5162a1=a37_0x4af247,{options:_0x4167cf,args:_0x3884eb,tdx:_0xed22a2}=_0x2fd264,_0x2ebf4a=_0x3884eb[0x0];if(!_0x2ebf4a)return console[_0x5162a1(0x10a)](_0x5162a1(0x113)),console[_0x5162a1(0x10a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x3b457c=![],_0x3f519a=_0x2ebf4a;if(_0x2ebf4a[_0x5162a1(0x10e)](_0x5162a1(0xe8)))_0x3b457c=!![],_0x3f519a=_0x2ebf4a[_0x5162a1(0xf8)](0x8);else{if(_0x2ebf4a['startsWith'](_0x5162a1(0x7f)))_0x3b457c=![],_0x3f519a=_0x2ebf4a[_0x5162a1(0xf8)](0x8);else return console[_0x5162a1(0x10a)](_0x5162a1(0x9b)),console[_0x5162a1(0x10a)](_0x5162a1(0xfb)),0x1;}try{const _0x487d6e=_0x4167cf[_0x5162a1(0x11e)],_0x37df90=_0x4167cf[_0x5162a1(0xda)],_0x535594=_0x4167cf[_0x5162a1(0x91)],_0x5aede9=_0x4167cf['force'];_0x4167cf[_0x5162a1(0xa2)]&&(console[_0x5162a1(0x10a)]('Target:\x20'+(_0x3b457c?_0x5162a1(0x81):_0x5162a1(0xbb))+'\x20'+_0x3f519a),_0x487d6e&&console[_0x5162a1(0x10a)](_0x5162a1(0x119)+_0x487d6e),_0x37df90&&console['error'](_0x5162a1(0x10b)+_0x37df90),_0x535594&&console[_0x5162a1(0x10a)]('Params:\x20'+_0x535594),_0x5aede9&&console[_0x5162a1(0x10a)]('Force:\x20yes'));let _0x14a71e;if(_0x535594)try{if(_0x535594[_0x5162a1(0x10e)]('@')){const _0x1a141a=await import('fs/promises'),_0x25c510=_0x535594['substring'](0x1),_0x5ddc7=await _0x1a141a[_0x5162a1(0xa7)](_0x25c510,_0x5162a1(0xb4));_0x14a71e=JSON[_0x5162a1(0xc5)](_0x5ddc7);}else _0x14a71e=JSON[_0x5162a1(0xc5)](_0x535594);}catch{return console[_0x5162a1(0x10a)](_0x5162a1(0xb6)),0x1;}if(!_0x4167cf[_0x5162a1(0x94)]){const _0x4f7fad=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x3b457c?_0x5162a1(0x81):_0x5162a1(0xbb))+'\x20'+_0x3f519a+'?');if(!_0x4f7fad)return console[_0x5162a1(0x10a)](_0x5162a1(0x7d)),0x0;}let _0x460d60;_0x3b457c?_0x460d60=await withSpinner(_0x5162a1(0x88),()=>_0xed22a2[_0x5162a1(0xb8)][_0x5162a1(0xe3)](_0x3f519a,{'fromTask':_0x487d6e,'retryParams':_0x14a71e}),{'verbose':_0x4167cf[_0x5162a1(0xa2)]}):_0x460d60=await withSpinner(_0x5162a1(0xcf),()=>_0xed22a2[_0x5162a1(0xb8)][_0x5162a1(0xe6)](_0x3f519a,{'resumeFrom':_0x37df90,'retryParams':_0x14a71e,'force':_0x5aede9}),{'verbose':_0x4167cf[_0x5162a1(0xa2)]});const _0x5ac7ae=_0x460d60['data'];return console[_0x5162a1(0x10a)](_0x5162a1(0xfc)),console[_0x5162a1(0x10a)](_0x5162a1(0xc3)+_0x5ac7ae[_0x5162a1(0x7c)]),console[_0x5162a1(0x10a)](_0x5162a1(0x10f)+_0x5ac7ae[_0x5162a1(0x80)]),0x0;}catch(_0x3146ae){if(_0x3146ae instanceof SDKError)return console[_0x5162a1(0x10a)](_0x5162a1(0x11d)+_0x3146ae['message']),_0x3146ae['cause']&&console['error'](_0x5162a1(0xb3)+_0x3146ae[_0x5162a1(0x101)]),0x1;throw _0x3146ae;}}}export class WorkflowRunCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0xd8);[a37_0x4af247(0xea)]=a37_0x4af247(0xcd);async[a37_0x4af247(0x118)](_0x4bcc53){const _0x1d3862=a37_0x4af247,{options:_0x3df5b5,args:_0x1616b3,tdx:_0x340dc9}=_0x4bcc53,_0x403c4a=_0x1616b3[0x0];if(!_0x403c4a)return console['error']('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x1d3862(0x10a)](_0x1d3862(0x103)),0x1;const _0x5ad0bf=_0x3df5b5[_0x1d3862(0xa1)],_0x40e8da=_0x3df5b5[_0x1d3862(0x8b)],_0x5c312d={};if(_0x5ad0bf&&Array['isArray'](_0x5ad0bf))for(const _0x506210 of _0x5ad0bf){const _0x42bba8=_0x506210['indexOf']('=');if(_0x42bba8===-0x1)return console[_0x1d3862(0x10a)](_0x1d3862(0x115)+_0x506210),console[_0x1d3862(0x10a)](_0x1d3862(0xbf)),0x1;const _0x26157d=_0x506210[_0x1d3862(0xf8)](0x0,_0x42bba8),_0x5824f1=_0x506210[_0x1d3862(0xf8)](_0x42bba8+0x1);try{_0x5c312d[_0x26157d]=JSON['parse'](_0x5824f1);}catch{_0x5c312d[_0x26157d]=_0x5824f1;}}_0x3df5b5[_0x1d3862(0xa2)]&&(console[_0x1d3862(0x10a)](_0x1d3862(0x106)+_0x403c4a),Object[_0x1d3862(0xe2)](_0x5c312d)[_0x1d3862(0xdc)]>0x0&&console[_0x1d3862(0x10a)](_0x1d3862(0x10d)+JSON[_0x1d3862(0xc2)](_0x5c312d)),_0x40e8da&&console['error'](_0x1d3862(0xb2)+_0x40e8da));const _0x57e50a=await withSpinner(_0x1d3862(0x123),()=>_0x340dc9[_0x1d3862(0xb8)][_0x1d3862(0xec)](_0x403c4a,_0x5c312d,{'sessionTime':_0x40e8da}),{'verbose':_0x3df5b5[_0x1d3862(0xa2)]}),_0xbe16ed=_0x57e50a[_0x1d3862(0xf9)];return console[_0x1d3862(0x10a)](_0x1d3862(0x9e)),console[_0x1d3862(0x10a)](_0x1d3862(0xa0)+_0xbe16ed['id']),console[_0x1d3862(0x10a)](_0x1d3862(0x10f)+_0xbe16ed['sessionId']),console[_0x1d3862(0x10a)](_0x1d3862(0xcc)+_0xbe16ed[_0x1d3862(0x11a)]?.[_0x1d3862(0xfa)]),console[_0x1d3862(0x10a)](_0x1d3862(0xde)+_0xbe16ed[_0x1d3862(0xb8)]?.[_0x1d3862(0xfa)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a37_0x4af247(0x92);[a37_0x4af247(0xea)]=a37_0x4af247(0xa8);async['execute'](_0x356606){const _0x1133ff=a37_0x4af247,{options:_0x540f71,args:_0x735013,tdx:_0x244064}=_0x356606,_0x29cd5a=_0x735013[0x0],_0x2db136=_0x735013[0x1]||'.';if(!_0x29cd5a)return console[_0x1133ff(0x10a)](_0x1133ff(0x9f)),console[_0x1133ff(0x10a)](_0x1133ff(0xaa)),0x1;const _0x8bd133=_0x540f71[_0x1133ff(0x98)];_0x540f71[_0x1133ff(0xa2)]&&(console[_0x1133ff(0x10a)](_0x1133ff(0x83)+_0x29cd5a),console['error'](_0x1133ff(0xdf)+_0x2db136),_0x8bd133&&console[_0x1133ff(0x10a)]('Revision:\x20'+_0x8bd133));const _0x25aaf5=await withSpinner(_0x1133ff(0x7e)+_0x29cd5a+_0x1133ff(0xce),()=>_0x244064[_0x1133ff(0xb8)][_0x1133ff(0x87)](_0x29cd5a,_0x2db136,{'revision':_0x8bd133}),{'verbose':_0x540f71[_0x1133ff(0xa2)]}),_0x4571ca=_0x25aaf5[_0x1133ff(0xf9)];return console['error'](_0x1133ff(0xe0)+_0x4571ca[_0x1133ff(0xc1)]),console['error']('\x20\x20Revision:\x20'+_0x4571ca[_0x1133ff(0x98)]),console[_0x1133ff(0x10a)]('\x20\x20Files\x20extracted:\x20'+_0x4571ca[_0x1133ff(0xa3)]),console[_0x1133ff(0x10a)](_0x1133ff(0x121)+_0x2db136+'/'+_0x4571ca[_0x1133ff(0xc1)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a37_0x4af247(0xad);[a37_0x4af247(0xea)]=a37_0x4af247(0xf0);async[a37_0x4af247(0x118)](_0xc7c50e){const _0xd66c9e=a37_0x4af247,{options:_0x113f17,args:_0x30f5d5,tdx:_0xfc93e7}=_0xc7c50e;let _0x2397b6='.',_0x865781=_0x113f17[_0xd66c9e(0xfa)];if(_0x30f5d5[0x0]){const {promises:_0x583302}=await import('fs');try{const _0x45511a=await _0x583302[_0xd66c9e(0xd0)](_0x30f5d5[0x0]);if(_0x45511a['isDirectory']())_0x2397b6=_0x30f5d5[0x0];else return console[_0xd66c9e(0x10a)]('Error:\x20'+_0x30f5d5[0x0]+_0xd66c9e(0xcb)),0x1;}catch{_0x865781=_0x30f5d5[0x0],_0x2397b6='.';}}const _0x590287=_0x113f17[_0xd66c9e(0x98)],_0x5ecb45=_0x113f17['skipValidation'];_0x113f17[_0xd66c9e(0xa2)]&&(console[_0xd66c9e(0x10a)](_0xd66c9e(0xe9)+_0x2397b6),_0x865781&&console[_0xd66c9e(0x10a)]('Project\x20name:\x20'+_0x865781),_0x590287&&console['error'](_0xd66c9e(0xf2)+_0x590287),_0x5ecb45&&console['error'](_0xd66c9e(0xff)));const _0x20db9a=await withSpinner(_0xd66c9e(0x112),()=>_0xfc93e7[_0xd66c9e(0xb8)][_0xd66c9e(0xe7)](_0x2397b6,{'projectName':_0x865781,'revision':_0x590287,'skipValidation':_0x5ecb45}),{'verbose':_0x113f17[_0xd66c9e(0xa2)]}),_0x526b7d=_0x20db9a[_0xd66c9e(0xf9)];return console[_0xd66c9e(0x10a)](_0xd66c9e(0x86)+_0x526b7d[_0xd66c9e(0xc1)]),console[_0xd66c9e(0x10a)]('\x20\x20Project\x20ID:\x20'+_0x526b7d[_0xd66c9e(0x95)]),console['error']('\x20\x20Revision:\x20'+_0x526b7d[_0xd66c9e(0x98)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a37_0x4af247(0xfa)]=a37_0x4af247(0x122);[a37_0x4af247(0xea)]=a37_0x4af247(0xd4);async['execute'](_0x5479ec){const _0x5998a9=a37_0x4af247,{options:_0x3cbfd5,args:_0x1fb04f,tdx:_0x4e061b}=_0x5479ec,_0x2d965c=_0x1fb04f[0x0];if(!_0x2d965c)return console['error'](_0x5998a9(0x82)),console[_0x5998a9(0x10a)](_0x5998a9(0xaf)),0x1;_0x3cbfd5[_0x5998a9(0xa2)]&&console['error'](_0x5998a9(0x83)+_0x2d965c);if(!_0x3cbfd5['yes']){const _0x3869b8=await confirm(_0x5998a9(0x99)+_0x2d965c+_0x5998a9(0xa9));if(!_0x3869b8)return console[_0x5998a9(0x10a)](_0x5998a9(0x7d)),0x0;}const _0x5929cb=await withSpinner('Deleting\x20project\x20'+_0x2d965c+_0x5998a9(0xce),()=>_0x4e061b[_0x5998a9(0xb8)][_0x5998a9(0xc0)](_0x2d965c),{'verbose':_0x3cbfd5[_0x5998a9(0xa2)]}),_0x880fda=_0x5929cb[_0x5998a9(0xf9)];return console[_0x5998a9(0x10a)](_0x5998a9(0xd5)+_0x880fda[_0x5998a9(0xc1)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x880fda[_0x5998a9(0x95)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x536b17,_0x4217e1){const _0x36c143=a38_0x40fc,_0x26b741=_0x536b17();while(!![]){try{const _0x31a3e1=-parseInt(_0x36c143(0x180))/0x1*(parseInt(_0x36c143(0x17f))/0x2)+parseInt(_0x36c143(0x17d))/0x3+parseInt(_0x36c143(0x185))/0x4+parseInt(_0x36c143(0x186))/0x5*(-parseInt(_0x36c143(0x17e))/0x6)+-parseInt(_0x36c143(0x183))/0x7*(parseInt(_0x36c143(0x184))/0x8)+parseInt(_0x36c143(0x187))/0x9+-parseInt(_0x36c143(0x18f))/0xa;if(_0x31a3e1===_0x4217e1)break;else _0x26b741['push'](_0x26b741['shift']());}catch(_0x531e63){_0x26b741['push'](_0x26b741['shift']());}}}(a38_0x1f56,0xc3abc));import{platform}from'os';import{readFileSync}from'fs';function a38_0x1f56(){const _0x3e3b10=['248423aXLIrf','328ZSAXce','3890456rWrkLl','4020910LZeTEj','13583709IOPdrX','X-Trino-User','version','length','TD1\x20','0.0.0','Authorization','entries','4277460GABxOJ','3687228ABszBn','6fhmYxg','5116jDQntX','87Ssuklv','../../package.json','tdx/'];a38_0x1f56=function(){return _0x3e3b10;};return a38_0x1f56();}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';function a38_0x40fc(_0x4ef0fe,_0x24c49a){const _0x1f5632=a38_0x1f56();return a38_0x40fc=function(_0x40fcc0,_0x332e58){_0x40fcc0=_0x40fcc0-0x17d;let _0x3f968f=_0x1f5632[_0x40fcc0];return _0x3f968f;},a38_0x40fc(_0x4ef0fe,_0x24c49a);}export function getVersion(){const _0x54805d=a38_0x40fc;try{const _0x4c08f5=fileURLToPath(import.meta['url']),_0x5e615d=dirname(_0x4c08f5),_0x132a1f=join(_0x5e615d,_0x54805d(0x181)),_0x256481=JSON['parse'](readFileSync(_0x132a1f,'utf-8'));return _0x256481[_0x54805d(0x189)];}catch{return _0x54805d(0x18c);}}export function getUserAgent(){const _0x3cfd25=a38_0x40fc,_0x3862c7=getVersion(),_0x3d3b8b=platform(),_0x141f2a=process[_0x3cfd25(0x189)]['replace']('v','');return _0x3cfd25(0x182)+_0x3862c7+'\x20('+_0x3d3b8b+';\x20node/'+_0x141f2a+')';}export function getAuthHeaders(_0xe34992,_0x31efcb){const _0x148379=a38_0x40fc,_0x47ac4f=getVersion(),_0x169bc0={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x47ac4f};return _0x31efcb&&(_0x169bc0[_0x148379(0x18d)]=_0x148379(0x18b)+_0x31efcb),_0x169bc0;}export function toHeaderRecord(_0x59b211){const _0x57b4fa=a38_0x40fc,_0x188b90={};for(const [_0xeb6e1d,_0x1fef40]of Object[_0x57b4fa(0x18e)](_0x59b211)){_0x1fef40!==undefined&&(_0x188b90[_0xeb6e1d]=_0x1fef40);}return _0x188b90;}export function getTrinoHeaders(_0x189f1d,_0x129636){const _0x529275=a38_0x40fc,_0x5fca3e=getAuthHeaders(_0x189f1d,_0x129636),_0x3a16bb=toHeaderRecord(_0x5fca3e);return delete _0x3a16bb[_0x529275(0x18d)],_0x129636&&(_0x3a16bb[_0x529275(0x188)]=_0x129636),_0x3a16bb;}export function hasAPIKey(_0x427eb5){const _0x331136=a38_0x40fc,_0x1443b2=getAPIKey(_0x427eb5);return _0x1443b2!==undefined&&_0x1443b2[_0x331136(0x18a)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1fdb22,_0x52e38c){const _0x2b684a=a37_0x26ac,_0xa891f4=_0x1fdb22();while(!![]){try{const _0x57c101=parseInt(_0x2b684a(0x1a8))/0x1+-parseInt(_0x2b684a(0x1a9))/0x2+parseInt(_0x2b684a(0x1a3))/0x3+-parseInt(_0x2b684a(0x1b3))/0x4+parseInt(_0x2b684a(0x1a4))/0x5+-parseInt(_0x2b684a(0x1da))/0x6+parseInt(_0x2b684a(0x1d2))/0x7*(parseInt(_0x2b684a(0x1d9))/0x8);if(_0x57c101===_0x52e38c)break;else _0xa891f4['push'](_0xa891f4['shift']());}catch(_0x406903){_0xa891f4['push'](_0xa891f4['shift']());}}}(a37_0x27d1,0x4d243));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a37_0x5cc80d from'node:fs';import*as a37_0x624760 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';function a37_0x26ac(_0x380a2c,_0x1a5b2d){const _0x27d139=a37_0x27d1();return a37_0x26ac=function(_0x26ac02,_0x3325ab){_0x26ac02=_0x26ac02-0x19e;let _0x5d022a=_0x27d139[_0x26ac02];return _0x5d022a;},a37_0x26ac(_0x380a2c,_0x1a5b2d);}import a37_0x553907 from'chalk';export function getConfigDir(){const _0x4f01e1=a37_0x26ac;return process[_0x4f01e1(0x1c5)]['TDX_CONFIG_DIR']||join(homedir(),_0x4f01e1(0x19f),_0x4f01e1(0x1ce));}export function getConfigFile(){const _0x19cc1b=a37_0x26ac;return join(getConfigDir(),_0x19cc1b(0x1c8));}export function getConfigFilePath(_0x40dccf){const _0xa60964=a37_0x26ac,_0x44b465=getConfigDir();return _0x40dccf?a37_0x624760[_0xa60964(0x1d4)](_0x44b465,_0xa60964(0x1b0)+_0x40dccf):getConfigFile();}export function getCacheDir(){const _0x957f8f=a37_0x26ac;return process[_0x957f8f(0x1c5)][_0x957f8f(0x1b4)]||join(homedir(),_0x957f8f(0x1af),_0x957f8f(0x1ce));}export function getLLMProjectCacheFile(){const _0x250e73=a37_0x26ac;return join(getCacheDir(),_0x250e73(0x1c2));}export function readCachedLLMProject(){const _0x3c3400=a37_0x26ac;try{const _0x3a287f=getLLMProjectCacheFile();if(!existsSync(_0x3a287f))return null;return readFileSync(_0x3a287f,_0x3c3400(0x1bd))[_0x3c3400(0x1bf)]();}catch{return null;}}export function writeCachedLLMProject(_0x4fddef){const _0x4fc6d6=a37_0x26ac;try{const _0x5dfc34=getCacheDir(),_0x56de67=getLLMProjectCacheFile();!existsSync(_0x5dfc34)&&mkdirSync(_0x5dfc34,{'recursive':!![]}),writeFileSync(_0x56de67,_0x4fddef,_0x4fc6d6(0x1bd));}catch(_0x1cd89a){console[_0x4fc6d6(0x1c6)](_0x4fc6d6(0x1cc),_0x1cd89a);}}export function parseEnvFile(_0x2cba27){const _0x2e9bb5=a37_0x26ac,_0x5eca7f={};for(const _0xcd494c of _0x2cba27['split']('\x0a')){const _0x5e36fd=_0xcd494c[_0x2e9bb5(0x1bf)]();if(!_0x5e36fd||_0x5e36fd[_0x2e9bb5(0x1a2)]('#'))continue;const _0x48d5c3=_0x5e36fd['match'](/^([^=]+)=(.*)$/);if(_0x48d5c3){const _0x60b881=_0x48d5c3[0x1][_0x2e9bb5(0x1bf)]();let _0x31522c=_0x48d5c3[0x2][_0x2e9bb5(0x1bf)]();(_0x31522c[_0x2e9bb5(0x1a2)]('\x22')&&_0x31522c['endsWith']('\x22')||_0x31522c[_0x2e9bb5(0x1a2)]('\x27')&&_0x31522c[_0x2e9bb5(0x1ae)]('\x27'))&&(_0x31522c=_0x31522c[_0x2e9bb5(0x1cb)](0x1,-0x1)),_0x5eca7f[_0x60b881]=_0x31522c;}}return _0x5eca7f;}export function readUserConfig(){const _0x244c61=a37_0x26ac,_0x2e82ce=getConfigFile();if(!existsSync(_0x2e82ce))return{};try{const _0x1e7dde=readFileSync(_0x2e82ce,_0x244c61(0x1bd));return parseEnvFile(_0x1e7dde);}catch(_0x4519d9){return console['warn'](_0x244c61(0x1d7)+_0x2e82ce+':',_0x4519d9),{};}}export function resolveSite(_0x31880a){const _0x4c8442=a37_0x26ac,_0x2dba46=[_0x4c8442(0x1bc),_0x4c8442(0x1ca),'eu01',_0x4c8442(0x1a1),_0x4c8442(0x1b7),_0x4c8442(0x1d3),_0x4c8442(0x1a7),_0x4c8442(0x1d5),_0x4c8442(0x1cd),_0x4c8442(0x1ad)];if(_0x2dba46[_0x4c8442(0x1d1)](_0x31880a))return _0x31880a;if(_0x31880a in SITE_ALIASES)return SITE_ALIASES[_0x31880a];return console[_0x4c8442(0x1b9)](_0x4c8442(0x1d8)+_0x31880a+'\x27,\x20defaulting\x20to\x20us01'),_0x4c8442(0x1bc);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x373742,_0x5d00e4){const _0x25dfb1=a37_0x26ac,_0x87101f=_0x373742[_0x25dfb1(0x1a0)]()[_0x25dfb1(0x1ab)](/-/g,'_'),_0x1fe13f=_0x25dfb1(0x1a6)+_0x87101f;if(process[_0x25dfb1(0x1c5)][_0x1fe13f])return process[_0x25dfb1(0x1c5)][_0x1fe13f];if(process['env'][_0x25dfb1(0x1d0)])return process['env']['TD_API_KEY'];const _0x54d074=_0x5d00e4||getActiveProfileName();if(_0x54d074){const _0x2c8276=loadProfileEnv(_0x54d074);if(_0x2c8276){if(_0x2c8276[_0x1fe13f])return _0x2c8276[_0x1fe13f];if(_0x2c8276[_0x25dfb1(0x1d0)])return _0x2c8276['TD_API_KEY'];}}const _0x3eaea9=loadUserConfigOnce();if(_0x3eaea9[_0x1fe13f])return _0x3eaea9[_0x1fe13f];if(_0x3eaea9[_0x25dfb1(0x1d0)])return _0x3eaea9[_0x25dfb1(0x1d0)];return undefined;}export async function getAPIKeyAsync(_0x30ab63,_0x1ee4f3){const _0x268be2=a37_0x26ac,_0xe8b292=_0x30ab63[_0x268be2(0x1a0)]()['replace'](/-/g,'_'),_0x3689bb='TD_API_KEY_'+_0xe8b292;if(process[_0x268be2(0x1c5)][_0x3689bb])return process[_0x268be2(0x1c5)][_0x3689bb];if(process['env'][_0x268be2(0x1d0)])return process[_0x268be2(0x1c5)]['TD_API_KEY'];const _0x13c242=_0x1ee4f3||getActiveProfileName()||undefined,_0x286851=getCachedCredential(_0x30ab63,_0x13c242);if(_0x286851)return _0x286851;const _0x4aee0f=await getKeychainAPIKey(_0x13c242);if(_0x4aee0f)return setCachedCredential(_0x4aee0f,_0x30ab63,_0x13c242),_0x4aee0f;const _0x295e02=getLegacyEnvAPIKey(_0x30ab63,_0x13c242);if(_0x295e02){const _0x5b75fd=await isKeychainAvailable();if(_0x5b75fd)try{await saveKeychainAPIKey(_0x295e02,_0x13c242),setCachedCredential(_0x295e02,_0x30ab63,_0x13c242);const _0x33a75b=getConfigFilePath(_0x13c242);cleanupLegacyEnvFile(_0x33a75b)&&console[_0x268be2(0x1b9)](a37_0x553907['yellow'](_0x268be2(0x1c1)));}catch(_0x45f43b){console[_0x268be2(0x1b9)](a37_0x553907[_0x268be2(0x1b2)](_0x268be2(0x1c3)+_0x45f43b));}return _0x295e02;}return undefined;}function getLegacyEnvAPIKey(_0x4184db,_0x462535){const _0x363e7a=a37_0x26ac,_0xb25643=_0x4184db[_0x363e7a(0x1a0)]()[_0x363e7a(0x1ab)](/-/g,'_'),_0x5f0cf7='TD_API_KEY_'+_0xb25643;if(_0x462535){const _0x336c04=loadProfileEnv(_0x462535);if(_0x336c04){if(_0x336c04[_0x5f0cf7])return _0x336c04[_0x5f0cf7];if(_0x336c04[_0x363e7a(0x1d0)])return _0x336c04[_0x363e7a(0x1d0)];}}const _0x474436=loadUserConfigOnce();if(_0x474436[_0x5f0cf7])return _0x474436[_0x5f0cf7];if(_0x474436['TD_API_KEY'])return _0x474436[_0x363e7a(0x1d0)];return undefined;}function a37_0x27d1(){const _0x4afa04=['apiKeys','ap03','filter','warn','profile','Warning:\x20Failed\x20to\x20read\x20','us01','utf-8','split','trim','readFileSync','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','llm_default_project','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','existsSync','env','error','map','.env','env:\x20','jp01','slice','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','stg-jp01','tdx','\x20(TD_API_KEY)','TD_API_KEY','includes','72877ZfsheE','dev-us01','join','stg-us01','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','Warning:\x20Unknown\x20site\x20\x27','96KlNrTm','2984712iusynt','tdx.json','global:\x20','profiles','.config','toUpperCase','ap02','startsWith','1224981nfDspE','3107780OjLIKj','profile:\x20','TD_API_KEY_','dev-eu01','333292hWlcue','762668kEOExq','eu01','replace','env:\x20TD_API_KEY','stg-ap03','endsWith','.cache','.env.','parse','yellow','1173400UnOJQo','TDX_CACHE_DIR','some'];a37_0x27d1=function(){return _0x4afa04;};return a37_0x27d1();}function cleanupLegacyEnvFile(_0x202caa){const _0x1a2b91=a37_0x26ac;if(!existsSync(_0x202caa))return![];try{const _0x87a73c=readFileSync(_0x202caa,'utf-8'),_0x2cc5f1=_0x87a73c[_0x1a2b91(0x1be)]('\x0a'),_0x3a8805=_0x2cc5f1[_0x1a2b91(0x1b8)](_0x5ad7f2=>{const _0x62641a=_0x1a2b91,_0x4ba290=_0x5ad7f2[_0x62641a(0x1bf)]();if(!_0x4ba290||_0x4ba290[_0x62641a(0x1a2)]('#'))return!![];const [_0x15adad]=_0x4ba290[_0x62641a(0x1be)]('=');return!_0x15adad[_0x62641a(0x1a2)](_0x62641a(0x1d0));}),_0x9e9cd6=_0x3a8805[_0x1a2b91(0x1b5)](_0x5f7299=>{const _0x572f39=_0x1a2b91,_0x4e0525=_0x5f7299[_0x572f39(0x1bf)]();return _0x4e0525&&!_0x4e0525[_0x572f39(0x1a2)]('#');});if(!_0x9e9cd6)return unlinkSync(_0x202caa),!![];return writeFileSync(_0x202caa,_0x3a8805[_0x1a2b91(0x1d4)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x1206a5,_0x1a54dd){const _0x2a840d=a37_0x26ac,_0x5173d6=_0x2a840d(0x1a6)+_0x1206a5['toUpperCase']()[_0x2a840d(0x1ab)](/-/g,'_');if(process['env'][_0x5173d6])return _0x2a840d(0x1c9)+_0x5173d6;if(process['env'][_0x2a840d(0x1d0)])return _0x2a840d(0x1ac);const _0x97c0bf=_0x1a54dd||getActiveProfileName();if(_0x97c0bf){const _0x4ff61a=loadProfileEnv(_0x97c0bf);if(_0x4ff61a){if(_0x4ff61a[_0x5173d6])return _0x2a840d(0x1a5)+_0x97c0bf+'\x20('+_0x5173d6+')';if(_0x4ff61a[_0x2a840d(0x1d0)])return _0x2a840d(0x1a5)+_0x97c0bf+_0x2a840d(0x1cf);}}const _0x539577=loadUserConfigOnce(),_0x21de60=getConfigFile();if(_0x539577[_0x5173d6])return _0x2a840d(0x1dc)+_0x21de60+'\x20('+_0x5173d6+')';if(_0x539577[_0x2a840d(0x1d0)])return _0x2a840d(0x1dc)+_0x21de60+_0x2a840d(0x1cf);return null;}function loadProfileEnv(_0x11f860){const _0x51c038=a37_0x26ac,_0x10bf24=a37_0x624760[_0x51c038(0x1d4)](getConfigDir(),'.env.'+_0x11f860);if(a37_0x5cc80d[_0x51c038(0x1c4)](_0x10bf24)){validateSecureFilePermissions(_0x10bf24);try{const _0x1b87f9=a37_0x5cc80d[_0x51c038(0x1c0)](_0x10bf24,_0x51c038(0x1bd));return parseEnvFile(_0x1b87f9);}catch(_0x17db62){console[_0x51c038(0x1b9)]('Warning:\x20Failed\x20to\x20load\x20'+_0x10bf24+':\x20'+_0x17db62);}}const _0x362d43=a37_0x624760[_0x51c038(0x1d4)](getConfigDir(),_0x51c038(0x19e),_0x11f860,_0x51c038(0x1c8));if(a37_0x5cc80d[_0x51c038(0x1c4)](_0x362d43)){validateSecureFilePermissions(_0x362d43);try{const _0x28b872=a37_0x5cc80d[_0x51c038(0x1c0)](_0x362d43,_0x51c038(0x1bd));return parseEnvFile(_0x28b872);}catch(_0x28ac33){return console[_0x51c038(0x1b9)]('Warning:\x20Failed\x20to\x20load\x20'+_0x362d43+':\x20'+_0x28ac33),null;}}return null;}function getActiveProfileName(){const _0x370629=a37_0x26ac,_0x4cc010=a37_0x624760[_0x370629(0x1d4)](getConfigDir(),_0x370629(0x1db));if(!a37_0x5cc80d[_0x370629(0x1c4)](_0x4cc010))return null;try{const _0x390d05=a37_0x5cc80d[_0x370629(0x1c0)](_0x4cc010,'utf-8'),_0xe05c58=JSON[_0x370629(0x1b1)](_0x390d05);return _0xe05c58[_0x370629(0x1ba)]||null;}catch{return null;}}export function saveAPIKey(_0x3957a1,_0x5280b1,_0x6aa40f){const _0x372446=a37_0x26ac,_0x28f24f=getConfigDir(),_0x7057e1=getConfigFilePath(_0x6aa40f);!existsSync(_0x28f24f)&&mkdirSync(_0x28f24f,{'recursive':!![],'mode':0x1c0});let _0x255ab4={};if(existsSync(_0x7057e1))try{const _0x1e512c=readFileSync(_0x7057e1,_0x372446(0x1bd));_0x255ab4=parseEnvFile(_0x1e512c);}catch(_0x335a43){console['warn'](_0x372446(0x1bb)+_0x7057e1+':',_0x335a43);}const _0xf04cda=_0x3957a1['toUpperCase']()[_0x372446(0x1ab)](/-/g,'_');_0x255ab4[_0x372446(0x1a6)+_0xf04cda]=_0x5280b1;const _0x3e6cf9=Object['entries'](_0x255ab4)[_0x372446(0x1c7)](([_0x928a53,_0x31e031])=>_0x928a53+'='+_0x31e031);writeFileSync(_0x7057e1,_0x3e6cf9[_0x372446(0x1d4)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x21484e,_0x6f6cf9,_0xb03426){const _0x52447d=a37_0x26ac;await saveKeychainAPIKey(_0x21484e,_0xb03426),setCachedCredential(_0x21484e,_0x6f6cf9,_0xb03426);const _0x49f60f=getConfigFilePath(_0xb03426);cleanupLegacyEnvFile(_0x49f60f)&&console[_0x52447d(0x1b9)](a37_0x553907['yellow'](_0x52447d(0x1d6)));}export function loadConfig(){const _0x3ad12f=a37_0x26ac,_0x32c977={'apiKeys':{},'defaultSite':'us01'},_0x45d1b5=[_0x3ad12f(0x1bc),_0x3ad12f(0x1ca),_0x3ad12f(0x1aa),'ap02',_0x3ad12f(0x1b7),'dev-us01',_0x3ad12f(0x1a7),_0x3ad12f(0x1d5),_0x3ad12f(0x1cd),_0x3ad12f(0x1ad)];for(const _0x310c2f of _0x45d1b5){const _0x22ff59=getAPIKey(_0x310c2f);_0x22ff59&&(_0x32c977[_0x3ad12f(0x1b6)][_0x310c2f]=_0x22ff59);}return _0x32c977;}
|
|
1
|
+
(function(_0x48b1a5,_0x5f14c3){const _0x2c4c77=a39_0x48f5,_0x4f3f6b=_0x48b1a5();while(!![]){try{const _0x49bc3b=parseInt(_0x2c4c77(0x205))/0x1*(-parseInt(_0x2c4c77(0x1f6))/0x2)+parseInt(_0x2c4c77(0x1d4))/0x3*(parseInt(_0x2c4c77(0x1de))/0x4)+parseInt(_0x2c4c77(0x1e3))/0x5*(parseInt(_0x2c4c77(0x1d5))/0x6)+parseInt(_0x2c4c77(0x1f7))/0x7+-parseInt(_0x2c4c77(0x1f1))/0x8+-parseInt(_0x2c4c77(0x1d9))/0x9*(-parseInt(_0x2c4c77(0x1f4))/0xa)+-parseInt(_0x2c4c77(0x1e8))/0xb*(-parseInt(_0x2c4c77(0x1d1))/0xc);if(_0x49bc3b===_0x5f14c3)break;else _0x4f3f6b['push'](_0x4f3f6b['shift']());}catch(_0x37e87a){_0x4f3f6b['push'](_0x4f3f6b['shift']());}}}(a39_0x3101,0x90084));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a39_0x2617aa from'node:fs';import*as a39_0x28cafd from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';function a39_0x48f5(_0x3ff48b,_0x331733){const _0x3101b6=a39_0x3101();return a39_0x48f5=function(_0x48f503,_0x2345de){_0x48f503=_0x48f503-0x1cf;let _0x1144f0=_0x3101b6[_0x48f503];return _0x1144f0;},a39_0x48f5(_0x3ff48b,_0x331733);}import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a39_0x548bff from'chalk';export function getConfigDir(){const _0x4892a7=a39_0x48f5;return process[_0x4892a7(0x1fe)][_0x4892a7(0x1f9)]||join(homedir(),'.config',_0x4892a7(0x1e4));}export function getConfigFile(){const _0x5d37b6=a39_0x48f5;return join(getConfigDir(),_0x5d37b6(0x1fb));}export function getConfigFilePath(_0x2f7424){const _0x1699f9=getConfigDir();return _0x2f7424?a39_0x28cafd['join'](_0x1699f9,'.env.'+_0x2f7424):getConfigFile();}export function getCacheDir(){const _0x5ccc7d=a39_0x48f5;return process[_0x5ccc7d(0x1fe)][_0x5ccc7d(0x1f2)]||join(homedir(),_0x5ccc7d(0x1eb),_0x5ccc7d(0x1e4));}export function getLLMProjectCacheFile(){const _0x20ae27=a39_0x48f5;return join(getCacheDir(),_0x20ae27(0x201));}export function readCachedLLMProject(){const _0xc87b2f=a39_0x48f5;try{const _0x4878ca=getLLMProjectCacheFile();if(!existsSync(_0x4878ca))return null;return readFileSync(_0x4878ca,_0xc87b2f(0x1ee))[_0xc87b2f(0x1e1)]();}catch{return null;}}export function writeCachedLLMProject(_0x16a6de){const _0x38b240=a39_0x48f5;try{const _0x19fcea=getCacheDir(),_0x5de3d1=getLLMProjectCacheFile();!existsSync(_0x19fcea)&&mkdirSync(_0x19fcea,{'recursive':!![]}),writeFileSync(_0x5de3d1,_0x16a6de,_0x38b240(0x1ee));}catch(_0x28b8ad){console[_0x38b240(0x1dc)]('Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:',_0x28b8ad);}}export function parseEnvFile(_0x29a1c4){const _0x1e9d47=a39_0x48f5,_0x55a58c={};for(const _0x40e3e of _0x29a1c4[_0x1e9d47(0x1e5)]('\x0a')){const _0x3e7701=_0x40e3e[_0x1e9d47(0x1e1)]();if(!_0x3e7701||_0x3e7701[_0x1e9d47(0x1da)]('#'))continue;const _0x57c2b5=_0x3e7701['match'](/^([^=]+)=(.*)$/);if(_0x57c2b5){const _0x391f7a=_0x57c2b5[0x1][_0x1e9d47(0x1e1)]();let _0x472d79=_0x57c2b5[0x2][_0x1e9d47(0x1e1)]();(_0x472d79[_0x1e9d47(0x1da)]('\x22')&&_0x472d79[_0x1e9d47(0x20d)]('\x22')||_0x472d79[_0x1e9d47(0x1da)]('\x27')&&_0x472d79[_0x1e9d47(0x20d)]('\x27'))&&(_0x472d79=_0x472d79['slice'](0x1,-0x1)),_0x55a58c[_0x391f7a]=_0x472d79;}}return _0x55a58c;}export function readUserConfig(){const _0x354ef8=a39_0x48f5,_0x58de93=getConfigFile();if(!existsSync(_0x58de93))return{};try{const _0x1e28a3=readFileSync(_0x58de93,_0x354ef8(0x1ee));return parseEnvFile(_0x1e28a3);}catch(_0xf925a1){return console[_0x354ef8(0x1d0)](_0x354ef8(0x1e7)+_0x58de93+':',_0xf925a1),{};}}export function resolveSite(_0x43bfc7){const _0x412bb1=a39_0x48f5,_0x3b6ccc=['us01',_0x412bb1(0x1fa),_0x412bb1(0x1f0),'ap02',_0x412bb1(0x208),_0x412bb1(0x1dd),_0x412bb1(0x202),'stg-us01',_0x412bb1(0x1fc),_0x412bb1(0x20f)];if(_0x3b6ccc[_0x412bb1(0x1d7)](_0x43bfc7))return _0x43bfc7;if(_0x43bfc7 in SITE_ALIASES)return SITE_ALIASES[_0x43bfc7];return console[_0x412bb1(0x1d0)](_0x412bb1(0x1ea)+_0x43bfc7+_0x412bb1(0x1f8)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x542a23,_0x2d49e1){const _0x5d607=a39_0x48f5,_0xca2a52=_0x542a23['toUpperCase']()[_0x5d607(0x1d2)](/-/g,'_'),_0x395cf1=_0x5d607(0x1df)+_0xca2a52;if(process[_0x5d607(0x1fe)][_0x395cf1])return process[_0x5d607(0x1fe)][_0x395cf1];if(process[_0x5d607(0x1fe)][_0x5d607(0x1cf)])return process[_0x5d607(0x1fe)][_0x5d607(0x1cf)];const _0x4de2b8=_0x2d49e1||getActiveProfileName();if(_0x4de2b8){const _0x240b88=loadProfileEnv(_0x4de2b8);if(_0x240b88){if(_0x240b88[_0x395cf1])return _0x240b88[_0x395cf1];if(_0x240b88[_0x5d607(0x1cf)])return _0x240b88[_0x5d607(0x1cf)];}}const _0x1fe5b1=loadUserConfigOnce();if(_0x1fe5b1[_0x395cf1])return _0x1fe5b1[_0x395cf1];if(_0x1fe5b1[_0x5d607(0x1cf)])return _0x1fe5b1[_0x5d607(0x1cf)];return undefined;}export async function getAPIKeyAsync(_0x430afe,_0x256461){const _0x1e22f7=a39_0x48f5,_0x408627=_0x430afe['toUpperCase']()[_0x1e22f7(0x1d2)](/-/g,'_'),_0x2f57e1=_0x1e22f7(0x1df)+_0x408627;if(process[_0x1e22f7(0x1fe)][_0x2f57e1])return process[_0x1e22f7(0x1fe)][_0x2f57e1];if(process[_0x1e22f7(0x1fe)][_0x1e22f7(0x1cf)])return process[_0x1e22f7(0x1fe)][_0x1e22f7(0x1cf)];const _0x3b1739=_0x256461||getActiveProfileName()||undefined,_0x16e7b8=getCachedCredential(_0x430afe,_0x3b1739);if(_0x16e7b8)return _0x16e7b8;const _0x47939c=await getKeychainAPIKey(_0x3b1739);if(_0x47939c)return setCachedCredential(_0x47939c,_0x430afe,_0x3b1739),_0x47939c;const _0x1e3718=getLegacyEnvAPIKey(_0x430afe,_0x3b1739);if(_0x1e3718){const _0x3aa87b=await isKeychainAvailable();if(_0x3aa87b)try{await saveKeychainAPIKey(_0x1e3718,_0x3b1739),setCachedCredential(_0x1e3718,_0x430afe,_0x3b1739);const _0x191145=getConfigFilePath(_0x3b1739);cleanupLegacyEnvFile(_0x191145)&&console[_0x1e22f7(0x1d0)](a39_0x548bff[_0x1e22f7(0x1fd)](_0x1e22f7(0x1db)));}catch(_0x3dc1ab){console[_0x1e22f7(0x1d0)](a39_0x548bff[_0x1e22f7(0x1fd)](_0x1e22f7(0x206)+_0x3dc1ab));}return _0x1e3718;}return undefined;}function getLegacyEnvAPIKey(_0x28c1e2,_0x3fa950){const _0x37e9e0=a39_0x48f5,_0x2dc9b5=_0x28c1e2[_0x37e9e0(0x1ec)]()['replace'](/-/g,'_'),_0x21d94e=_0x37e9e0(0x1df)+_0x2dc9b5;if(_0x3fa950){const _0x3f61db=loadProfileEnv(_0x3fa950);if(_0x3f61db){if(_0x3f61db[_0x21d94e])return _0x3f61db[_0x21d94e];if(_0x3f61db['TD_API_KEY'])return _0x3f61db[_0x37e9e0(0x1cf)];}}const _0x13c409=loadUserConfigOnce();if(_0x13c409[_0x21d94e])return _0x13c409[_0x21d94e];if(_0x13c409['TD_API_KEY'])return _0x13c409[_0x37e9e0(0x1cf)];return undefined;}function a39_0x3101(){const _0x184e44=['yellow','env','filter','stg-us01','llm_default_project','dev-eu01','profile:\x20','\x20(TD_API_KEY)','9557euRETB','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','ap02','ap03','global:\x20','profile','some','parse','endsWith','profiles','stg-ap03','TD_API_KEY','warn','12jsMHrA','replace','.env.','1135263jtNyfq','1812xbTFOT','existsSync','includes','Warning:\x20Failed\x20to\x20load\x20','585ozXdRf','startsWith','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','error','dev-us01','4dQcUOf','TD_API_KEY_','env:\x20TD_API_KEY','trim','map','2910FpsgHb','tdx','split','env:\x20','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','2047133WUunPi','join','Warning:\x20Unknown\x20site\x20\x27','.cache','toUpperCase','us01','utf-8','apiKeys','eu01','9099872RDNwnv','TDX_CACHE_DIR','readFileSync','62470fBfkLT','Warning:\x20Failed\x20to\x20read\x20','50iTWRxn','5740154jhsEoR','\x27,\x20defaulting\x20to\x20us01','TDX_CONFIG_DIR','jp01','.env','stg-jp01'];a39_0x3101=function(){return _0x184e44;};return a39_0x3101();}function cleanupLegacyEnvFile(_0x513ad9){const _0x59ed27=a39_0x48f5;if(!existsSync(_0x513ad9))return![];try{const _0x507be6=readFileSync(_0x513ad9,'utf-8'),_0x4ed6e6=_0x507be6['split']('\x0a'),_0x51d88b=_0x4ed6e6[_0x59ed27(0x1ff)](_0x2730b9=>{const _0x20932f=_0x59ed27,_0x11989b=_0x2730b9[_0x20932f(0x1e1)]();if(!_0x11989b||_0x11989b[_0x20932f(0x1da)]('#'))return!![];const [_0x51d141]=_0x11989b['split']('=');return!_0x51d141[_0x20932f(0x1da)]('TD_API_KEY');}),_0x2167f0=_0x51d88b[_0x59ed27(0x20b)](_0x3a98b5=>{const _0x37eefc=_0x59ed27,_0x57a6df=_0x3a98b5[_0x37eefc(0x1e1)]();return _0x57a6df&&!_0x57a6df[_0x37eefc(0x1da)]('#');});if(!_0x2167f0)return unlinkSync(_0x513ad9),!![];return writeFileSync(_0x513ad9,_0x51d88b[_0x59ed27(0x1e9)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x12e47a,_0x53830a){const _0x275d9b=a39_0x48f5,_0x5cfb9b='TD_API_KEY_'+_0x12e47a['toUpperCase']()[_0x275d9b(0x1d2)](/-/g,'_');if(process[_0x275d9b(0x1fe)][_0x5cfb9b])return _0x275d9b(0x1e6)+_0x5cfb9b;if(process[_0x275d9b(0x1fe)]['TD_API_KEY'])return _0x275d9b(0x1e0);const _0x5f370f=_0x53830a||getActiveProfileName();if(_0x5f370f){const _0x1cba31=loadProfileEnv(_0x5f370f);if(_0x1cba31){if(_0x1cba31[_0x5cfb9b])return _0x275d9b(0x203)+_0x5f370f+'\x20('+_0x5cfb9b+')';if(_0x1cba31[_0x275d9b(0x1cf)])return'profile:\x20'+_0x5f370f+_0x275d9b(0x204);}}const _0x472919=loadUserConfigOnce(),_0x57b758=getConfigFile();if(_0x472919[_0x5cfb9b])return _0x275d9b(0x209)+_0x57b758+'\x20('+_0x5cfb9b+')';if(_0x472919[_0x275d9b(0x1cf)])return _0x275d9b(0x209)+_0x57b758+_0x275d9b(0x204);return null;}function loadProfileEnv(_0x49137e){const _0x6ff2a9=a39_0x48f5,_0x27e4c0=a39_0x28cafd[_0x6ff2a9(0x1e9)](getConfigDir(),_0x6ff2a9(0x1d3)+_0x49137e);if(a39_0x2617aa['existsSync'](_0x27e4c0)){validateSecureFilePermissions(_0x27e4c0);try{const _0x1d7dd2=a39_0x2617aa[_0x6ff2a9(0x1f3)](_0x27e4c0,_0x6ff2a9(0x1ee));return parseEnvFile(_0x1d7dd2);}catch(_0x73caf){console[_0x6ff2a9(0x1d0)](_0x6ff2a9(0x1d8)+_0x27e4c0+':\x20'+_0x73caf);}}const _0x403dda=a39_0x28cafd[_0x6ff2a9(0x1e9)](getConfigDir(),_0x6ff2a9(0x20e),_0x49137e,_0x6ff2a9(0x1fb));if(a39_0x2617aa[_0x6ff2a9(0x1d6)](_0x403dda)){validateSecureFilePermissions(_0x403dda);try{const _0x5e7ac9=a39_0x2617aa[_0x6ff2a9(0x1f3)](_0x403dda,_0x6ff2a9(0x1ee));return parseEnvFile(_0x5e7ac9);}catch(_0x600311){return console[_0x6ff2a9(0x1d0)](_0x6ff2a9(0x1d8)+_0x403dda+':\x20'+_0x600311),null;}}return null;}function getActiveProfileName(){const _0x1e2671=a39_0x48f5,_0x4983a7=a39_0x28cafd[_0x1e2671(0x1e9)](getConfigDir(),'tdx.json');if(!a39_0x2617aa[_0x1e2671(0x1d6)](_0x4983a7))return null;try{const _0x323ec1=a39_0x2617aa[_0x1e2671(0x1f3)](_0x4983a7,_0x1e2671(0x1ee)),_0x4ce806=JSON[_0x1e2671(0x20c)](_0x323ec1);return _0x4ce806[_0x1e2671(0x20a)]||null;}catch{return null;}}export function saveAPIKey(_0x448d86,_0x2bd28a,_0x1e9701){const _0x4ac019=a39_0x48f5,_0x28e821=getConfigDir(),_0x5c3c78=getConfigFilePath(_0x1e9701);!existsSync(_0x28e821)&&mkdirSync(_0x28e821,{'recursive':!![],'mode':0x1c0});let _0x48550a={};if(existsSync(_0x5c3c78))try{const _0x9b791e=readFileSync(_0x5c3c78,_0x4ac019(0x1ee));_0x48550a=parseEnvFile(_0x9b791e);}catch(_0x5cd683){console['warn'](_0x4ac019(0x1f5)+_0x5c3c78+':',_0x5cd683);}const _0x24adba=_0x448d86[_0x4ac019(0x1ec)]()[_0x4ac019(0x1d2)](/-/g,'_');_0x48550a[_0x4ac019(0x1df)+_0x24adba]=_0x2bd28a;const _0x4803a1=Object['entries'](_0x48550a)[_0x4ac019(0x1e2)](([_0x276976,_0x536ea0])=>_0x276976+'='+_0x536ea0);writeFileSync(_0x5c3c78,_0x4803a1['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x4c60ad,_0x4f518e,_0x1ad57c){const _0x561bab=a39_0x48f5;await saveKeychainAPIKey(_0x4c60ad,_0x1ad57c),setCachedCredential(_0x4c60ad,_0x4f518e,_0x1ad57c);const _0x316b82=getConfigFilePath(_0x1ad57c);cleanupLegacyEnvFile(_0x316b82)&&console[_0x561bab(0x1d0)](a39_0x548bff['yellow']('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x311c10=a39_0x48f5,_0x40983a={'apiKeys':{},'defaultSite':_0x311c10(0x1ed)},_0x46c83c=[_0x311c10(0x1ed),_0x311c10(0x1fa),_0x311c10(0x1f0),_0x311c10(0x207),_0x311c10(0x208),_0x311c10(0x1dd),'dev-eu01',_0x311c10(0x200),_0x311c10(0x1fc),_0x311c10(0x20f)];for(const _0x2f9d5c of _0x46c83c){const _0x89520c=getAPIKey(_0x2f9d5c);_0x89520c&&(_0x40983a[_0x311c10(0x1ef)][_0x2f9d5c]=_0x89520c);}return _0x40983a;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5aa8e8,_0x55f26a){const _0x13cf3a=a40_0x2276,_0x40706a=_0x5aa8e8();while(!![]){try{const _0x212bd9=-parseInt(_0x13cf3a(0x1ca))/0x1+parseInt(_0x13cf3a(0x1cf))/0x2*(-parseInt(_0x13cf3a(0x1cd))/0x3)+-parseInt(_0x13cf3a(0x1cc))/0x4*(parseInt(_0x13cf3a(0x1d3))/0x5)+parseInt(_0x13cf3a(0x1c7))/0x6*(parseInt(_0x13cf3a(0x1d0))/0x7)+-parseInt(_0x13cf3a(0x1c6))/0x8+parseInt(_0x13cf3a(0x1cb))/0x9*(parseInt(_0x13cf3a(0x1c5))/0xa)+-parseInt(_0x13cf3a(0x1d2))/0xb*(-parseInt(_0x13cf3a(0x1c9))/0xc);if(_0x212bd9===_0x55f26a)break;else _0x40706a['push'](_0x40706a['shift']());}catch(_0x358d8a){_0x40706a['push'](_0x40706a['shift']());}}}(a40_0x5e44,0x504c0));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x46303e,_0x49b518){const _0x28697d=a40_0x2276,_0x18d6e6=_0x46303e||_0x28697d(0x1c8),_0xaaa079=_0x49b518||_0x28697d(0x1ce);return _0x18d6e6+':'+_0xaaa079;}export function getCachedCredential(_0x31a525,_0x1e4bdb){const _0x1d3230=a40_0x2276,_0x4de19d=getCacheKey(_0x31a525,_0x1e4bdb),_0x339884=cache['get'](_0x4de19d);if(!_0x339884)return null;if(Date[_0x1d3230(0x1c3)]()-_0x339884[_0x1d3230(0x1c0)]>CACHE_TTL_MS)return cache[_0x1d3230(0x1c2)](_0x4de19d),null;return _0x339884[_0x1d3230(0x1c1)];}function a40_0x5e44(){const _0x57749f=['delete','now','clear','250XphKew','4872128nOunSZ','234NYfKSv','__default_site__','432jYGGBB','70026OBMFUt','53550sFkOpj','32rwkOig','687mchHSL','__default_profile__','1802wyOznJ','82397UsdzZX','set','286154XTjILZ','206285CKlQyH','loadedAt','apiKey'];a40_0x5e44=function(){return _0x57749f;};return a40_0x5e44();}export function setCachedCredential(_0x54acdd,_0x3e5874,_0x1371ed){const _0x4a57e1=a40_0x2276,_0x3fa427=getCacheKey(_0x3e5874,_0x1371ed);cache[_0x4a57e1(0x1d1)](_0x3fa427,{'apiKey':_0x54acdd,'loadedAt':Date[_0x4a57e1(0x1c3)]()});}export function clearCredentialCache(){const _0x2023a7=a40_0x2276;cache[_0x2023a7(0x1c4)]();}function a40_0x2276(_0x9d31b7,_0x4bb7e8){const _0x5e4472=a40_0x5e44();return a40_0x2276=function(_0x227664,_0x273a90){_0x227664=_0x227664-0x1c0;let _0x249d66=_0x5e4472[_0x227664];return _0x249d66;},a40_0x2276(_0x9d31b7,_0x4bb7e8);}export function clearCachedCredential(_0x2ba4fb,_0x350d58){const _0x5389b5=a40_0x2276,_0x1763ee=getCacheKey(_0x2ba4fb,_0x350d58);cache[_0x5389b5(0x1c2)](_0x1763ee);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-context.d.ts","sourceRoot":"","sources":["../../src/core/global-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAgClD;;GAEG;AACH,qBAAa,aAAa;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"global-context.d.ts","sourceRoot":"","sources":["../../src/core/global-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAgClD;;GAEG;AACH,qBAAa,aAAa;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAkB;gBAEzB,OAAO,EAAE,aAAa;IA8GlC;;;OAGG;IACH,OAAO,CAAC,SAAS;IA4CjB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAexB;;;OAGG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAmBzD;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,IAAI,IAAI;IAUf;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAkC1B;;;;;;;OAOG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKvD;;;;;;;;OAQG;WACU,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAKzE"}
|