@treasuredata/tdx 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/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/global-context.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/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/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/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x247628=a27_0x1c20;(function(_0x7bca58,_0x3bd679){const _0x18496f=a27_0x1c20,_0x200c63=_0x7bca58();while(!![]){try{const _0x5cd9f0=parseInt(_0x18496f(0x149))/0x1+-parseInt(_0x18496f(0x153))/0x2+-parseInt(_0x18496f(0x15d))/0x3+parseInt(_0x18496f(0x143))/0x4+parseInt(_0x18496f(0x148))/0x5*(-parseInt(_0x18496f(0x13e))/0x6)+-parseInt(_0x18496f(0x157))/0x7+parseInt(_0x18496f(0x14f))/0x8;if(_0x5cd9f0===_0x3bd679)break;else _0x200c63['push'](_0x200c63['shift']());}catch(_0x18a3d2){_0x200c63['push'](_0x200c63['shift']());}}}(a27_0x1f01,0x49651));function a27_0x1f01(){const _0x2c994f=['Parent\x20ID:\x20','\x27...','42UHKNhY','name','isAbsolute','folderPath','verbose','739124QBCFfJ','resolvePathToResource','Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolved\x20path\x20type:\x20','163675eeeOJr','239920kbYKSJ','Examples:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Context\x20cleared.\x20Back\x20to\x20root.','split','folderId','11836688qhOUFD','Resolved\x20relative\x20path\x20to:\x20','Use:\x20tdx\x20segment\x20use\x20','Site:\x20','676706Siojgl','parentName','Error:\x20Path\x20is\x20required','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3335892mVKBaf','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','log','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','session','1678824lLoSLk','site','segments','type','slice','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','join','error','data','segmentPath','segment','length','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','description'];a27_0x1f01=function(){return _0x2c994f;};return a27_0x1f01();}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';function a27_0x1c20(_0x265817,_0x2ae963){const _0x1f0179=a27_0x1f01();return a27_0x1c20=function(_0x1c2054,_0x4e1e4b){_0x1c2054=_0x1c2054-0x137;let _0x29ab09=_0x1f0179[_0x1c2054];return _0x29ab09;},a27_0x1c20(_0x265817,_0x2ae963);}export class SegmentUseCommand extends BaseCommand{[a27_0x247628(0x13f)]='segment:use';[a27_0x247628(0x13b)]=a27_0x247628(0x163);async['execute'](_0x11d146){const _0x266926=a27_0x247628,{options:_0x192c7a,args:_0x55440b,tdx:_0xb5cad0}=_0x11d146;if(_0x55440b[_0x266926(0x139)]===0x0)return console[_0x266926(0x167)](_0x266926(0x155)),console[_0x266926(0x167)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x266926(0x167)](_0x266926(0x14a)),console[_0x266926(0x167)](_0x266926(0x15b)),console[_0x266926(0x167)](_0x266926(0x146)),console['error'](_0x266926(0x158)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x22b1fc=_0x55440b[0x0],_0x228d78=_0x192c7a[_0x266926(0x15c)];try{if(_0x22b1fc==='/')return saveSessionContext({'segment_path':undefined},_0x228d78),console['log'](_0x266926(0x14c)),0x0;const _0x571643=_0x192c7a[_0x266926(0x137)];let _0x119c2d=_0x22b1fc;const _0x3acf3c=parsePath(_0x22b1fc);if(!_0x3acf3c[_0x266926(0x140)]){if(!_0x571643)return console[_0x266926(0x167)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x266926(0x156)),0x1;if(_0x22b1fc==='..'){const _0x3f2300=_0x571643[_0x266926(0x14d)]('/')[_0x266926(0x161)](0x0,-0x1)[_0x266926(0x166)]('/');_0x119c2d=_0x3f2300||'/';}else _0x22b1fc==='.'?_0x119c2d=_0x571643:_0x119c2d=_0x571643+'/'+_0x22b1fc;_0x192c7a[_0x266926(0x142)]&&console['error'](_0x266926(0x150)+_0x119c2d);}if(_0x119c2d==='/'||_0x119c2d==='')return saveSessionContext({'segment_path':undefined},_0x228d78),console[_0x266926(0x159)](_0x266926(0x14c)),0x0;_0x119c2d=normalizePath(_0x119c2d);const _0xeef7ee=parsePath(_0x119c2d)[_0x266926(0x15f)];if(_0xeef7ee[_0x266926(0x139)]===0x0)return saveSessionContext({'segment_path':undefined},_0x228d78),console[_0x266926(0x159)](_0x266926(0x14c)),0x0;_0x192c7a[_0x266926(0x142)]&&(console[_0x266926(0x167)](_0x266926(0x152)+_0x192c7a[_0x266926(0x15e)]),console[_0x266926(0x167)]('Target\x20path:\x20'+_0x119c2d));const _0x4979dc=await withSpinner(_0x266926(0x15a)+_0x119c2d+_0x266926(0x13d),()=>_0xb5cad0[_0x266926(0x138)][_0x266926(0x144)](_0x119c2d),{'verbose':_0x192c7a[_0x266926(0x142)]}),_0x36053e=_0x4979dc[_0x266926(0x168)];_0x192c7a[_0x266926(0x142)]&&(console[_0x266926(0x167)](_0x266926(0x147)+_0x36053e[_0x266926(0x160)]),console[_0x266926(0x167)](_0x266926(0x13c)+_0x36053e['parentId']),_0x36053e['folderId']&&console[_0x266926(0x167)]('Folder\x20ID:\x20'+_0x36053e[_0x266926(0x14e)]));if(_0x36053e[_0x266926(0x160)]===_0x266926(0x138))return console[_0x266926(0x167)](_0x266926(0x164)),console['error'](_0x266926(0x13a)),console[_0x266926(0x167)](_0x266926(0x151)+_0x36053e[_0x266926(0x154)]+(_0x36053e[_0x266926(0x141)]?'/'+_0x36053e[_0x266926(0x141)][_0x266926(0x166)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x36053e[_0x266926(0x162)],'parent_segment':_0x36053e[_0x266926(0x154)]},_0x228d78),console[_0x266926(0x159)](_0x266926(0x145)+_0x36053e['fullPath']),_0x192c7a['verbose']&&(console[_0x266926(0x167)](_0x266926(0x165)),console['error']('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x266926(0x167)](_0x266926(0x14b))),0x0;}catch(_0x2799aa){throw _0x2799aa;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x1dc4c6=a28_0x4c0f;(function(_0x205937,_0x1cd109){const _0x66c1c3=a28_0x4c0f,_0xe97810=_0x205937();while(!![]){try{const _0x3b6be0=parseInt(_0x66c1c3(0x103))/0x1+-parseInt(_0x66c1c3(0x119))/0x2*(parseInt(_0x66c1c3(0x10d))/0x3)+parseInt(_0x66c1c3(0x11b))/0x4*(-parseInt(_0x66c1c3(0x13a))/0x5)+parseInt(_0x66c1c3(0x128))/0x6+-parseInt(_0x66c1c3(0x126))/0x7+-parseInt(_0x66c1c3(0x116))/0x8+parseInt(_0x66c1c3(0x118))/0x9*(parseInt(_0x66c1c3(0x10f))/0xa);if(_0x3b6be0===_0x1cd109)break;else _0xe97810['push'](_0xe97810['shift']());}catch(_0xc0855b){_0xe97810['push'](_0xe97810['shift']());}}}(a28_0x3a4f,0x9aadf));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a28_0x4c0f(_0x26209d,_0x2d5b2a){const _0x3a4fed=a28_0x3a4f();return a28_0x4c0f=function(_0x4c0f34,_0x5d8a8b){_0x4c0f34=_0x4c0f34-0xfd;let _0x1dd75e=_0x3a4fed[_0x4c0f34];return _0x1dd75e;},a28_0x4c0f(_0x26209d,_0x2d5b2a);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a28_0x3a4f(){const _0x266949=['2017036XjVjBS','execute','✔\x20Found\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Parent\x20ID:\x20','map','replace','resolvePathToResource','filter','length','site','348250bQUkCg','segment','138342NOeBCW','includes','description','\x20\x20Cause:\x20','(empty)','error','Listing\x20folders\x20and\x20segments...','listParentsWithPattern','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','cause','\x20folder','listRecursive','verbose','\x20segment','Resolving\x20context\x20path\x20\x27','Folder\x20ID:\x20','\x20parent\x20segment','localeCompare','5MWSJBh','Building\x20hierarchy\x20tree...','Path/pattern\x20arg:\x20','dim','segments','[parent\x20segments]','Site:\x20','format','491698WKThLB','Listing\x20parent\x20segments...','listUnified','\x20top-level\x20items','attributes','jsonl','parentId','listParents','Listing\x20parent\x20segments\x20matching\x20\x27','recursive','78YlKIOU','name','22178670ZzeCAO','folderId','json','👥\x20','\x5c$&','log','\x27...','8203072WUdpug','population','9uCresW','39974HgHYGG','data'];a28_0x3a4f=function(){return _0x266949;};return a28_0x3a4f();}import{formatRows}from'../utils/formatters.js';import a28_0x52f7c9 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x1dc4c6(0x10e)]=a28_0x1dc4c6(0xff);[a28_0x1dc4c6(0x12a)]=a28_0x1dc4c6(0x130);async[a28_0x1dc4c6(0x11c)](_0x459eae){const _0x8489e7=a28_0x1dc4c6,{options:_0x565ab8,args:_0x288c21}=_0x459eae,_0x2c42b9=_0x565ab8[_0x8489e7(0x10c)],_0x228617=_0x288c21[0x0];try{const _0x4a0e23=_0x565ab8['segmentPath'];_0x565ab8['verbose']&&(console[_0x8489e7(0x12d)](_0x8489e7(0x101)+_0x565ab8[_0x8489e7(0x125)]),console[_0x8489e7(0x12d)]('Current\x20context:\x20'+(_0x4a0e23||'/')),_0x228617&&console[_0x8489e7(0x12d)](_0x8489e7(0xfd)+_0x228617),_0x2c42b9&&console['error']('Recursive\x20mode:\x20enabled'));if(_0x228617){const _0x275e15=_0x228617[_0x8489e7(0x129)]('*')||_0x228617[_0x8489e7(0x129)]('?');if(_0x275e15&&!_0x4a0e23)return await this[_0x8489e7(0x12f)](_0x459eae,_0x228617);else return _0x275e15?(console['error']('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x8489e7(0x12d)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x2c42b9?await this['listRecursive'](_0x459eae,_0x228617):await this[_0x8489e7(0x105)](_0x459eae,_0x228617);}if(!_0x4a0e23)return await this[_0x8489e7(0x10a)](_0x459eae);return _0x2c42b9?await this['listRecursive'](_0x459eae,_0x4a0e23):await this[_0x8489e7(0x105)](_0x459eae,_0x4a0e23);}catch(_0x3d4250){if(_0x3d4250 instanceof SDKError)return console[_0x8489e7(0x12d)]('Error:\x20'+_0x3d4250['message']),_0x3d4250[_0x8489e7(0x131)]&&console[_0x8489e7(0x12d)](_0x8489e7(0x12b)+_0x3d4250[_0x8489e7(0x131)]),0x1;throw _0x3d4250;}}async['listParentsWithPattern'](_0x20f16a,_0x56c077){const _0x15832a=a28_0x1dc4c6,{options:_0x2e17f3,tdx:_0x27b6ff}=_0x20f16a,_0x2345cb=await withSpinner(_0x15832a(0x10b)+_0x56c077+_0x15832a(0x115),()=>_0x27b6ff[_0x15832a(0x127)]['listParents'](),{'verbose':_0x2e17f3[_0x15832a(0x134)]}),_0x27a3a5=_0x2345cb['data'],_0x58fd33=_0x56c077[_0x15832a(0x121)](/[.+^${}()|[\]\\]/g,_0x15832a(0x113))[_0x15832a(0x121)](/\*/g,'.*')[_0x15832a(0x121)](/\?/g,'.'),_0x92ab0=new RegExp('^'+_0x58fd33+'$','i'),_0x47986a=_0x27a3a5[_0x15832a(0x123)](_0x4d84ff=>_0x92ab0['test'](_0x4d84ff[_0x15832a(0x107)][_0x15832a(0x10e)]));console[_0x15832a(0x12d)](_0x15832a(0x11d)+_0x47986a['length']+_0x15832a(0x138)+(_0x47986a[_0x15832a(0x124)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x56c077+'\x27');if(_0x2e17f3[_0x15832a(0x102)]===_0x15832a(0x111)||_0x2e17f3['format']===_0x15832a(0x108))await handleSDKOutput(_0x47986a,_0x2e17f3);else{if(_0x47986a[_0x15832a(0x124)]===0x0)console[_0x15832a(0x114)](_0x15832a(0x11e)+_0x56c077);else{console[_0x15832a(0x114)](_0x15832a(0x100));for(const _0x53ffdd of _0x47986a){const _0x21fb9f=_0x53ffdd[_0x15832a(0x107)][_0x15832a(0x117)]?a28_0x52f7c9[_0x15832a(0xfe)]('\x20('+formatRows(_0x53ffdd['attributes'][_0x15832a(0x117)])+')'):'';console[_0x15832a(0x114)](_0x15832a(0x112)+_0x53ffdd[_0x15832a(0x107)][_0x15832a(0x10e)]+_0x21fb9f);}}}return 0x0;}async[a28_0x1dc4c6(0x10a)](_0x1bcf57){const _0x3633ac=a28_0x1dc4c6,{options:_0x113726,tdx:_0x52d9f4}=_0x1bcf57,_0x482d02=await withSpinner(_0x3633ac(0x104),()=>_0x52d9f4[_0x3633ac(0x127)][_0x3633ac(0x10a)](),{'verbose':_0x113726[_0x3633ac(0x134)]}),_0x42b758=_0x482d02['data'];console[_0x3633ac(0x12d)](_0x3633ac(0x11d)+_0x42b758[_0x3633ac(0x124)]+_0x3633ac(0x138)+(_0x42b758[_0x3633ac(0x124)]!==0x1?'s':''));if(_0x113726[_0x3633ac(0x102)]===_0x3633ac(0x111)||_0x113726[_0x3633ac(0x102)]==='jsonl')await handleSDKOutput(_0x42b758,_0x113726);else{console[_0x3633ac(0x114)](_0x3633ac(0x100));for(const _0x121fd0 of _0x42b758){const _0x53fe33=_0x121fd0['attributes'][_0x3633ac(0x117)]?a28_0x52f7c9[_0x3633ac(0xfe)]('\x20('+formatRows(_0x121fd0[_0x3633ac(0x107)][_0x3633ac(0x117)])+')'):'';console[_0x3633ac(0x114)](_0x3633ac(0x112)+_0x121fd0[_0x3633ac(0x107)][_0x3633ac(0x10e)]+_0x53fe33);}}return 0x0;}async[a28_0x1dc4c6(0x105)](_0x2b9dac,_0x84e14b){const _0x485c65=a28_0x1dc4c6,{options:_0x3007ad,tdx:_0x50a694}=_0x2b9dac,_0x2a20a5=await withSpinner(_0x485c65(0x136)+_0x84e14b+_0x485c65(0x115),()=>_0x50a694[_0x485c65(0x127)][_0x485c65(0x122)](_0x84e14b),{'verbose':_0x3007ad[_0x485c65(0x134)]}),_0x27eebf=_0x2a20a5['data'];_0x3007ad['verbose']&&(console[_0x485c65(0x12d)](_0x485c65(0x11f)+_0x27eebf['parentId']),_0x27eebf['folderId']&&console['error'](_0x485c65(0x137)+_0x27eebf[_0x485c65(0x110)]));const _0x586625=await withSpinner(_0x485c65(0x12e),()=>_0x50a694[_0x485c65(0x127)][_0x485c65(0x105)](_0x27eebf['parentId'],_0x27eebf[_0x485c65(0x110)]),{'verbose':_0x3007ad[_0x485c65(0x134)]}),{folders:_0x57df89,segments:_0x34e46e}=_0x586625[_0x485c65(0x11a)],_0xea7ae8=_0x57df89[_0x485c65(0x124)]+_0x34e46e[_0x485c65(0x124)];console['error'](_0x485c65(0x11d)+_0x57df89['length']+_0x485c65(0x132)+(_0x57df89[_0x485c65(0x124)]!==0x1?'s':'')+'\x20and\x20'+_0x34e46e['length']+_0x485c65(0x135)+(_0x34e46e['length']!==0x1?'s':''));if(_0x3007ad[_0x485c65(0x102)]===_0x485c65(0x111)||_0x3007ad[_0x485c65(0x102)]===_0x485c65(0x108)){const _0x271ac3=[..._0x57df89[_0x485c65(0x120)](_0x53da88=>({..._0x53da88,'type':'folder'})),..._0x34e46e['map'](_0x1f857a=>({..._0x1f857a,'type':_0x485c65(0x127)}))]['sort']((_0x2c3d34,_0x34e0b5)=>_0x2c3d34[_0x485c65(0x10e)][_0x485c65(0x139)](_0x34e0b5['name']));await handleSDKOutput(_0x271ac3,_0x3007ad);}else{if(_0xea7ae8===0x0)console[_0x485c65(0x114)](a28_0x52f7c9[_0x485c65(0xfe)]('[/'+_0x84e14b+']')),console[_0x485c65(0x114)](_0x485c65(0x12c));else{console[_0x485c65(0x114)](a28_0x52f7c9[_0x485c65(0xfe)]('[/'+_0x84e14b+']'));const _0x5aeb22=formatFlatList(_0x57df89,_0x34e46e,{'showMetadata':!![]});console[_0x485c65(0x114)](_0x5aeb22);}}return 0x0;}async[a28_0x1dc4c6(0x133)](_0x1c8f96,_0x409872){const _0x585247=a28_0x1dc4c6,{options:_0x2d87be,tdx:_0x5acdbf}=_0x1c8f96,_0x14518a=await withSpinner(_0x585247(0x136)+_0x409872+_0x585247(0x115),()=>_0x5acdbf[_0x585247(0x127)][_0x585247(0x122)](_0x409872),{'verbose':_0x2d87be[_0x585247(0x134)]}),_0x2be6b3=_0x14518a[_0x585247(0x11a)];_0x2d87be['verbose']&&(console['error'](_0x585247(0x11f)+_0x2be6b3[_0x585247(0x109)]),_0x2be6b3[_0x585247(0x110)]&&console[_0x585247(0x12d)]('Folder\x20ID:\x20'+_0x2be6b3[_0x585247(0x110)]));const _0x56fe4f=_0x2d87be['maxDepth']||0xa,_0x1348d6=await withSpinner(_0x585247(0x13b),()=>_0x5acdbf[_0x585247(0x127)][_0x585247(0x133)](_0x2be6b3[_0x585247(0x109)],_0x2be6b3[_0x585247(0x110)],0x0,_0x56fe4f),{'verbose':_0x2d87be[_0x585247(0x134)]}),_0x1800a3=_0x1348d6[_0x585247(0x11a)];console[_0x585247(0x12d)]('✔\x20Built\x20tree\x20with\x20'+_0x1800a3[_0x585247(0x124)]+_0x585247(0x106));if(_0x2d87be[_0x585247(0x102)]===_0x585247(0x111)||_0x2d87be[_0x585247(0x102)]===_0x585247(0x108))await handleSDKOutput(_0x1800a3,_0x2d87be);else{console['log'](a28_0x52f7c9[_0x585247(0xfe)]('[/'+_0x409872+']'));const _0x41551c=formatTree(_0x1800a3,{'showMetadata':!![]});console[_0x585247(0x114)](_0x41551c);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x4162b1=a29_0x114f;function a29_0x114f(_0x25f2d1,_0x51e5e3){const _0x52a07a=a29_0x52a0();return a29_0x114f=function(_0x114f04,_0x1dfe2d){_0x114f04=_0x114f04-0xc3;let _0x30d1f3=_0x52a07a[_0x114f04];return _0x30d1f3;},a29_0x114f(_0x25f2d1,_0x51e5e3);}(function(_0x399f35,_0x38e9d9){const _0x5970eb=a29_0x114f,_0x10ebb9=_0x399f35();while(!![]){try{const _0x36a104=-parseInt(_0x5970eb(0xc8))/0x1*(-parseInt(_0x5970eb(0xc6))/0x2)+-parseInt(_0x5970eb(0xc9))/0x3*(-parseInt(_0x5970eb(0xcd))/0x4)+parseInt(_0x5970eb(0xe3))/0x5*(parseInt(_0x5970eb(0xe2))/0x6)+-parseInt(_0x5970eb(0xc4))/0x7*(parseInt(_0x5970eb(0xdd))/0x8)+-parseInt(_0x5970eb(0xcb))/0x9*(parseInt(_0x5970eb(0xde))/0xa)+-parseInt(_0x5970eb(0xe5))/0xb+parseInt(_0x5970eb(0xec))/0xc;if(_0x36a104===_0x38e9d9)break;else _0x10ebb9['push'](_0x10ebb9['shift']());}catch(_0x38c13b){_0x10ebb9['push'](_0x10ebb9['shift']());}}}(a29_0x52a0,0xabdc3));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';function a29_0x52a0(){const _0x2000d6=['\x20row','verbose','Show\x20table\x20contents','Error:\x20','site','error','message','cause','2325936fhWtqv','489950MKIpXj','✔\x20Retrieved\x20','database','showTable','30yGztca','618675DWgMDx','description','7820351OcOlaZ','table','...','Site:\x20','Catalog:\x20','show','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','7919100gmDilL','args','14aKLSBg','length','30ETAfCT','catalog','79791TNyjiy','473502wEHCNA','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','117UWTOkq','Usage:\x20tdx\x20show\x20<database.table>','4HQNhZr','validate','name','Table:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20from\x20','data','execute'];a29_0x52a0=function(){return _0x2000d6;};return a29_0x52a0();}import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x4162b1(0xcf)]=a29_0x4162b1(0xea);[a29_0x4162b1(0xe4)]=a29_0x4162b1(0xd7);async[a29_0x4162b1(0xd4)](_0x32e594){const _0x4afef4=a29_0x4162b1;return this[_0x4afef4(0xe1)](_0x32e594);}async[a29_0x4162b1(0xe1)](_0x2535d7){const _0x47b16f=a29_0x4162b1,{options:_0x57b520,args:_0x4e7444,tdx:_0x292c75}=_0x2535d7;let _0x383d53;try{_0x383d53=parseTableReference(_0x4e7444[0x0]);const _0x450373=_0x57b520[_0x47b16f(0xe0)];!_0x383d53[_0x47b16f(0xe0)]&&_0x450373&&(_0x383d53[_0x47b16f(0xe0)]=_0x450373);const _0x1ba9c7=validateTableDescribeReference(_0x383d53);if(_0x1ba9c7)return console[_0x47b16f(0xda)]('Error:\x20'+_0x1ba9c7),console[_0x47b16f(0xda)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x47b16f(0xda)](_0x47b16f(0xd1)),console[_0x47b16f(0xda)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0xea9fbf){return console[_0x47b16f(0xda)](_0x47b16f(0xd8)+_0xea9fbf[_0x47b16f(0xdb)]),console[_0x47b16f(0xda)](_0x47b16f(0xcc)),console[_0x47b16f(0xda)](_0x47b16f(0xd1)),console[_0x47b16f(0xda)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x471d7b=_0x383d53[_0x47b16f(0xc7)],_0x105906=_0x383d53[_0x47b16f(0xe0)],_0x3c2dbe=_0x383d53[_0x47b16f(0xe6)],_0x54e283=_0x57b520['limit'];try{_0x57b520[_0x47b16f(0xd6)]&&(console[_0x47b16f(0xda)](_0x47b16f(0xe8)+_0x57b520[_0x47b16f(0xd9)]),_0x471d7b&&console[_0x47b16f(0xda)](_0x47b16f(0xe9)+_0x471d7b),console[_0x47b16f(0xda)]('Database:\x20'+_0x105906),console[_0x47b16f(0xda)](_0x47b16f(0xd0)+_0x3c2dbe),console[_0x47b16f(0xda)]('Limit:\x20'+_0x54e283));const _0x5ce6fe=_0x471d7b?_0x471d7b+'.'+_0x105906+'.'+_0x3c2dbe:_0x105906+'.'+_0x3c2dbe,_0x4fb5b0=await withSpinner('Querying\x20'+_0x5ce6fe+_0x47b16f(0xe7),()=>_0x292c75[_0x47b16f(0xe6)][_0x47b16f(0xea)](_0x105906,_0x3c2dbe,_0x54e283,_0x471d7b),{'verbose':_0x57b520['verbose']}),_0xa172e1=_0x4fb5b0[_0x47b16f(0xd3)],_0x51808f=_0xa172e1[_0x47b16f(0xd3)];return _0x51808f[_0x47b16f(0xc5)]===0x0?console[_0x47b16f(0xda)](_0x47b16f(0xca)):console[_0x47b16f(0xda)](_0x47b16f(0xdf)+_0x51808f[_0x47b16f(0xc5)]+_0x47b16f(0xd5)+(_0x51808f[_0x47b16f(0xc5)]!==0x1?'s':'')+_0x47b16f(0xd2)+_0x5ce6fe),await handleSDKOutput(_0x51808f,_0x57b520),0x0;}catch(_0x26a6d0){if(_0x26a6d0 instanceof SDKError)return console[_0x47b16f(0xda)]('Error:\x20'+_0x26a6d0['message']),_0x26a6d0[_0x47b16f(0xdc)]&&console[_0x47b16f(0xda)]('\x20\x20Cause:\x20'+_0x26a6d0[_0x47b16f(0xdc)]),0x1;throw _0x26a6d0;}}[a29_0x4162b1(0xce)](_0xd331c7){const _0x572f82=a29_0x4162b1;if(_0xd331c7[_0x572f82(0xc3)][_0x572f82(0xc5)]===0x0)return _0x572f82(0xeb);if(_0xd331c7[_0x572f82(0xc3)][_0x572f82(0xc5)]>0x1)return'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';return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x28aa27=a30_0x37ab;(function(_0x177102,_0x8c15d1){const _0x239dbb=a30_0x37ab,_0x1da8e1=_0x177102();while(!![]){try{const _0x3ad1d1=-parseInt(_0x239dbb(0x165))/0x1+-parseInt(_0x239dbb(0x15d))/0x2*(-parseInt(_0x239dbb(0x16c))/0x3)+parseInt(_0x239dbb(0x173))/0x4*(parseInt(_0x239dbb(0x174))/0x5)+-parseInt(_0x239dbb(0x163))/0x6+parseInt(_0x239dbb(0x162))/0x7*(parseInt(_0x239dbb(0x161))/0x8)+-parseInt(_0x239dbb(0x169))/0x9+parseInt(_0x239dbb(0x166))/0xa;if(_0x3ad1d1===_0x8c15d1)break;else _0x1da8e1['push'](_0x1da8e1['shift']());}catch(_0x45227a){_0x1da8e1['push'](_0x1da8e1['shift']());}}}(a30_0x70c7,0xd07ec));function a30_0x37ab(_0x3eb59b,_0x168a96){const _0x70c72a=a30_0x70c7();return a30_0x37ab=function(_0x37abcf,_0x254e5e){_0x37abcf=_0x37abcf-0x15d;let _0x4d6b2a=_0x70c72a[_0x37abcf];return _0x4d6b2a;},a30_0x37ab(_0x3eb59b,_0x168a96);}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{withSpinner}from'../utils/spinner.js';function a30_0x70c7(){const _0x134223=['✖\x20No\x20tables\x20found','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✔\x20Found\x20','190XISpzi','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','tables','40QsHHEV','2180969GsXxwh','2043894wsXxfc','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','1386452xvsixQ','12053250TamZib','validate','\x20\x20Use:\x20tdx\x20tables\x20\x22','14261535tFfMeb','list','.*\x22','35835JWMSGp','\x27\x20across\x20all\x20databases.','table','\x20table','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20\x27','error','12RqYLOb','446295OmKslc','Database\x20pattern:\x20','Error:\x20','execute','message','database','length','site','Error:\x20Pattern\x20\x27','name','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Or\x20use\x20--in\x20flag:','verbose','includes','description','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'];a30_0x70c7=function(){return _0x134223;};return a30_0x70c7();}export class TablesCommand extends BaseCommand{[a30_0x28aa27(0x17d)]=a30_0x28aa27(0x160);[a30_0x28aa27(0x182)]='List\x20tables\x20in\x20a\x20database';async[a30_0x28aa27(0x177)](_0xdc8b09){const _0x1818d3=a30_0x28aa27,{options:_0x1f9fd3,args:_0x28c8c1,tdx:_0x29dca4}=_0xdc8b09;let _0x23bd49;if(_0x28c8c1[_0x1818d3(0x17a)]===0x0)_0x23bd49={'database':undefined,'table':undefined,'original':''};else{if(_0x28c8c1['length']===0x1)try{_0x23bd49=parseTableReference(_0x28c8c1[0x0]);if(_0x23bd49[_0x1818d3(0x16e)]&&!_0x23bd49['database']&&!_0x23bd49[_0x1818d3(0x16e)][_0x1818d3(0x181)]('*')&&!_0x23bd49[_0x1818d3(0x16e)][_0x1818d3(0x181)]('?'))return console[_0x1818d3(0x172)](_0x1818d3(0x17c)+_0x28c8c1[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x1818d3(0x172)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x23bd49['table']+'\x27?'),console['error'](_0x1818d3(0x168)+_0x23bd49[_0x1818d3(0x16e)]+_0x1818d3(0x16b)),console[_0x1818d3(0x172)](_0x1818d3(0x184)+_0x23bd49[_0x1818d3(0x16e)]),console[_0x1818d3(0x172)](_0x1818d3(0x17e)+_0x23bd49['table']),console[_0x1818d3(0x172)](''),console[_0x1818d3(0x172)]('Note:\x20\x27'+_0x28c8c1[0x0]+_0x1818d3(0x186)+_0x23bd49[_0x1818d3(0x16e)]+_0x1818d3(0x16d)),0x1;}catch(_0xbd64e3){return console[_0x1818d3(0x172)]('Error:\x20'+_0xbd64e3[_0x1818d3(0x178)]),0x1;}else return console[_0x1818d3(0x172)](_0x1818d3(0x164)),console[_0x1818d3(0x172)](_0x1818d3(0x183)),console[_0x1818d3(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x1818d3(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x1818d3(0x15f)),console['error'](_0x1818d3(0x17f)),console[_0x1818d3(0x172)](_0x1818d3(0x170)),0x1;}const _0x18793c=_0x1f9fd3[_0x1818d3(0x179)];!_0x23bd49[_0x1818d3(0x179)]&&_0x18793c&&(_0x23bd49[_0x1818d3(0x179)]=_0x18793c);try{const _0x51aaba=_0x11156e=>_0x11156e&&(_0x11156e['includes']('*')||_0x11156e[_0x1818d3(0x181)]('?')),_0x926b5a=_0x51aaba(_0x23bd49['database']);_0x1f9fd3[_0x1818d3(0x180)]&&(console[_0x1818d3(0x172)]('Site:\x20'+_0x1f9fd3[_0x1818d3(0x17b)]),_0x23bd49[_0x1818d3(0x179)]?_0x926b5a?console[_0x1818d3(0x172)](_0x1818d3(0x175)+_0x23bd49[_0x1818d3(0x179)]):console[_0x1818d3(0x172)]('Database:\x20'+_0x23bd49[_0x1818d3(0x179)]):console['error']('Database:\x20all'),_0x23bd49['table']&&console[_0x1818d3(0x172)]('Table\x20pattern:\x20'+_0x23bd49[_0x1818d3(0x16e)]));const _0x476521=_0x23bd49[_0x1818d3(0x179)]&&!_0x926b5a?_0x23bd49[_0x1818d3(0x179)]:undefined,_0x482a09=_0x926b5a?_0x23bd49[_0x1818d3(0x179)]:undefined,_0x3e53eb=_0x23bd49[_0x1818d3(0x16e)],_0x175e1e=await withSpinner('Listing\x20tables...',()=>_0x29dca4['table'][_0x1818d3(0x16a)](_0x476521,_0x3e53eb,_0x482a09),{'verbose':_0x1f9fd3[_0x1818d3(0x180)]}),_0x4de6ab=_0x175e1e['data'];if(_0x4de6ab[_0x1818d3(0x17a)]===0x0&&_0x23bd49[_0x1818d3(0x179)]&&!_0x926b5a)return console[_0x1818d3(0x172)](_0x1818d3(0x185)),console[_0x1818d3(0x172)](_0x1818d3(0x171)+_0x23bd49[_0x1818d3(0x179)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x1818d3(0x172)](_0x1818d3(0x187)+_0x4de6ab[_0x1818d3(0x17a)]+_0x1818d3(0x16f)+(_0x4de6ab[_0x1818d3(0x17a)]!==0x1?'s':'')),await handleSDKOutput(_0x4de6ab,_0x1f9fd3),0x0;}catch(_0x3d85db){if(_0x3d85db instanceof SDKError)return console[_0x1818d3(0x172)](_0x1818d3(0x176)+_0x3d85db[_0x1818d3(0x178)]),_0x3d85db['cause']&&console['error'](_0x1818d3(0x15e)+_0x3d85db['cause']),0x1;throw _0x3d85db;}}[a30_0x28aa27(0x167)](_0x227976){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a31_0x583f(_0x331f96,_0x8cf5e){const _0x7b06f2=a31_0x7b06();return a31_0x583f=function(_0x583f5e,_0x498591){_0x583f5e=_0x583f5e-0x1a9;let _0x4c9617=_0x7b06f2[_0x583f5e];return _0x4c9617;},a31_0x583f(_0x331f96,_0x8cf5e);}const a31_0x1c82eb=a31_0x583f;(function(_0x25de69,_0x348e37){const _0x5aa95f=a31_0x583f,_0x590f31=_0x25de69();while(!![]){try{const _0x33f473=parseInt(_0x5aa95f(0x1c3))/0x1+-parseInt(_0x5aa95f(0x1c8))/0x2+parseInt(_0x5aa95f(0x1af))/0x3*(parseInt(_0x5aa95f(0x1c5))/0x4)+parseInt(_0x5aa95f(0x1ab))/0x5*(parseInt(_0x5aa95f(0x1a9))/0x6)+-parseInt(_0x5aa95f(0x1b1))/0x7+-parseInt(_0x5aa95f(0x1be))/0x8+parseInt(_0x5aa95f(0x1b2))/0x9;if(_0x33f473===_0x348e37)break;else _0x590f31['push'](_0x590f31['shift']());}catch(_0x2df7da){_0x590f31['push'](_0x590f31['shift']());}}}(a31_0x7b06,0xa79fd));import{BaseCommand}from'./command.js';function a31_0x7b06(){const _0x70414f=['description','profile','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','.\x20Must\x20be\x20one\x20of:\x20','llm_project','session','\x20(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x27\x20does\x20not\x20exist','join','log','4266608sFNRCp','Session\x20llm_project\x20set\x20to:\x20','toString','Session\x20profile\x20set\x20to:\x20','name','713426hzMUAL','parent_segment','1583480IzCixv','Set\x20session-level\x20context','Session\x20database\x20set\x20to:\x20','1072792XNwJwW','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','validate','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Invalid\x20resource:\x20','3318744JIAZnW','Session\x20parent_segment\x20set\x20to:\x20','10OLroHB','use','database','error','3uFQijP','execute','7180446QBTKSW','5098905gDmjHy'];a31_0x7b06=function(){return _0x70414f;};return a31_0x7b06();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x1c82eb(0x1c2)]=a31_0x1c82eb(0x1ac);[a31_0x1c82eb(0x1b3)]=a31_0x1c82eb(0x1c6);[a31_0x1c82eb(0x1ca)](_0x5a50e0){const _0x1d5406=a31_0x1c82eb,{args:_0x30428e}=_0x5a50e0;if(_0x30428e['length']<0x2)return _0x1d5406(0x1b5)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x1d5406(0x1cb)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x388efb=_0x30428e[0x0],_0x1bf524=[_0x1d5406(0x1ad),_0x1d5406(0x1c4),_0x1d5406(0x1b7),_0x1d5406(0x1b4)];if(!_0x1bf524['includes'](_0x388efb))return _0x1d5406(0x1cc)+_0x388efb+_0x1d5406(0x1b6)+_0x1bf524[_0x1d5406(0x1bc)](',\x20');return undefined;}async[a31_0x1c82eb(0x1b0)](_0x3ae843){const _0x5d0320=a31_0x1c82eb,{args:_0x6f7bd5,options:_0x140e90}=_0x3ae843;try{const _0x4439e8=_0x6f7bd5[0x0],_0x1e0aa4=_0x6f7bd5[0x1];if(_0x4439e8===_0x5d0320(0x1b4)){if(!profileExists(_0x1e0aa4))return console[_0x5d0320(0x1ae)]('Error:\x20Profile\x20\x27'+_0x1e0aa4+_0x5d0320(0x1bb)),console['error'](_0x5d0320(0x1c9)),0x1;const _0x549967=_0x140e90[_0x5d0320(0x1b8)]||getCurrentSessionPID()[_0x5d0320(0x1c0)]();return saveSessionContext({'profile':_0x1e0aa4},_0x140e90['session']),console[_0x5d0320(0x1bd)](_0x5d0320(0x1c1)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x549967+')'),console['log'](_0x5d0320(0x1ba)),0x0;}const _0x409b07={},_0x5d16ec=_0x140e90[_0x5d0320(0x1b8)]||getCurrentSessionPID()['toString']();switch(_0x4439e8){case _0x5d0320(0x1ad):_0x409b07[_0x5d0320(0x1ad)]=_0x1e0aa4,console['log'](_0x5d0320(0x1c7)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;case _0x5d0320(0x1c4):_0x409b07['parent_segment']=_0x1e0aa4,console[_0x5d0320(0x1bd)](_0x5d0320(0x1aa)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;case _0x5d0320(0x1b7):_0x409b07[_0x5d0320(0x1b7)]=_0x1e0aa4,console[_0x5d0320(0x1bd)](_0x5d0320(0x1bf)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;}return saveSessionContext(_0x409b07,_0x140e90['session']),console['log'](_0x5d0320(0x1ba)),0x0;}catch(_0x34d10f){return _0x34d10f instanceof Error&&console[_0x5d0320(0x1ae)]('Error:\x20'+_0x34d10f['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x1d683a=a32_0x453f;function a32_0x453f(_0x2174ae,_0x53c72c){const _0x4c65dc=a32_0x4c65();return a32_0x453f=function(_0x453f3b,_0x3d2202){_0x453f3b=_0x453f3b-0x1d1;let _0x32ce42=_0x4c65dc[_0x453f3b];return _0x32ce42;},a32_0x453f(_0x2174ae,_0x53c72c);}(function(_0x4e4227,_0x41a6b5){const _0x17603f=a32_0x453f,_0x42aa87=_0x4e4227();while(!![]){try{const _0x3b3199=-parseInt(_0x17603f(0x20c))/0x1*(-parseInt(_0x17603f(0x1d1))/0x2)+parseInt(_0x17603f(0x243))/0x3+parseInt(_0x17603f(0x1f3))/0x4*(parseInt(_0x17603f(0x1d6))/0x5)+-parseInt(_0x17603f(0x21a))/0x6*(-parseInt(_0x17603f(0x1d5))/0x7)+-parseInt(_0x17603f(0x20d))/0x8*(-parseInt(_0x17603f(0x231))/0x9)+-parseInt(_0x17603f(0x235))/0xa+-parseInt(_0x17603f(0x203))/0xb*(parseInt(_0x17603f(0x1e4))/0xc);if(_0x3b3199===_0x41a6b5)break;else _0x42aa87['push'](_0x42aa87['shift']());}catch(_0x146f48){_0x42aa87['push'](_0x42aa87['shift']());}}}(a32_0x4c65,0x9ed01));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{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x1d683a(0x242)]='workflow:projects';[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1dd);async[a32_0x1d683a(0x23c)](_0xb295c7){const _0x2e921d=a32_0x1d683a,{options:_0x35b80b,args:_0x90cc5b,tdx:_0x2c40d}=_0xb295c7,_0x29de17=_0x90cc5b[0x0];try{_0x35b80b[_0x2e921d(0x1e3)]&&_0x29de17&&console[_0x2e921d(0x220)]('Pattern:\x20'+_0x29de17);const _0x2d0ffd=await withSpinner(_0x2e921d(0x1d7),()=>_0x2c40d[_0x2e921d(0x227)][_0x2e921d(0x216)](_0x29de17,{'limit':_0x35b80b[_0x2e921d(0x1f2)]}),{'verbose':_0x35b80b[_0x2e921d(0x1e3)]}),_0x21a2bc=_0x2d0ffd['data'];return console[_0x2e921d(0x220)]('✔\x20Found\x20'+_0x21a2bc[_0x2e921d(0x1e2)]+_0x2e921d(0x1f0)+(_0x21a2bc[_0x2e921d(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x21a2bc,_0x35b80b),0x0;}catch(_0x2eb68d){if(_0x2eb68d instanceof SDKError)return console[_0x2e921d(0x220)](_0x2e921d(0x20f)+_0x2eb68d[_0x2e921d(0x223)]),_0x2eb68d['cause']&&console['error'](_0x2e921d(0x1df)+_0x2eb68d['cause']),0x1;throw _0x2eb68d;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']='workflow:workflows';[a32_0x1d683a(0x244)]='List\x20workflows';async[a32_0x1d683a(0x23c)](_0x7d1624){const _0x11c2b1=a32_0x1d683a,{options:_0x13811e,args:_0x5bcf1b,tdx:_0x3e079f}=_0x7d1624,_0x32193d=_0x5bcf1b[0x0];try{_0x13811e[_0x11c2b1(0x1e3)]&&_0x32193d&&console['error'](_0x11c2b1(0x1d3)+_0x32193d);const _0x177288=await withSpinner(_0x11c2b1(0x211),()=>_0x3e079f['workflow'][_0x11c2b1(0x236)](_0x32193d,{'limit':_0x13811e[_0x11c2b1(0x1f2)]}),{'verbose':_0x13811e[_0x11c2b1(0x1e3)]}),_0x5386dc=_0x177288[_0x11c2b1(0x1d9)];return console[_0x11c2b1(0x220)]('✔\x20Found\x20'+_0x5386dc[_0x11c2b1(0x1e2)]+_0x11c2b1(0x1ed)+(_0x5386dc['length']!==0x1?'s':'')),await handleSDKOutput(_0x5386dc,_0x13811e),0x0;}catch(_0x22f3fa){if(_0x22f3fa instanceof SDKError)return console[_0x11c2b1(0x220)]('Error:\x20'+_0x22f3fa[_0x11c2b1(0x223)]),_0x22f3fa[_0x11c2b1(0x1f6)]&&console[_0x11c2b1(0x220)](_0x11c2b1(0x1df)+_0x22f3fa[_0x11c2b1(0x1f6)]),0x1;throw _0x22f3fa;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x217);[a32_0x1d683a(0x244)]='List\x20workflow\x20execution\x20sessions';async[a32_0x1d683a(0x23c)](_0x1d0991){const _0x20950c=a32_0x1d683a,{options:_0x562271,args:_0x7f8c92,tdx:_0x21ceb9}=_0x1d0991;let _0x4cd9a9,_0x56a864;if(_0x7f8c92[0x0]){const _0x29b09e=_0x7f8c92[0x0][_0x20950c(0x21c)]('.');if(_0x29b09e['length']===0x1)_0x4cd9a9=_0x29b09e[0x0];else{if(_0x29b09e[_0x20950c(0x1e2)]===0x2)[_0x4cd9a9,_0x56a864]=_0x29b09e;else return console['error'](_0x20950c(0x248)),0x1;}}try{if(_0x562271[_0x20950c(0x1e3)]){if(_0x4cd9a9&&_0x56a864)console[_0x20950c(0x220)](_0x20950c(0x23f)+_0x4cd9a9+'.'+_0x56a864);else _0x4cd9a9&&console[_0x20950c(0x220)](_0x20950c(0x224)+_0x4cd9a9);const _0x159c8a=_0x562271[_0x20950c(0x1f5)];_0x159c8a&&console[_0x20950c(0x220)](_0x20950c(0x21f)+_0x159c8a);}const _0x33d68d=await withSpinner(_0x20950c(0x249),()=>_0x21ceb9['workflow']['sessions']({'projectName':_0x4cd9a9,'workflowName':_0x56a864,'status':_0x562271['status'],'fromTime':_0x562271[_0x20950c(0x1f8)],'toTime':_0x562271['to'],'limit':_0x562271['limit']}),{'verbose':_0x562271['verbose']}),_0x311a02=_0x33d68d[_0x20950c(0x1d9)];return console[_0x20950c(0x220)](_0x20950c(0x1ec)+_0x311a02[_0x20950c(0x1e2)]+'\x20session'+(_0x311a02[_0x20950c(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x311a02,_0x562271),0x0;}catch(_0x4c8683){if(_0x4c8683 instanceof SDKError)return console[_0x20950c(0x220)](_0x20950c(0x20f)+_0x4c8683['message']),_0x4c8683['cause']&&console['error'](_0x20950c(0x1df)+_0x4c8683[_0x20950c(0x1f6)]),0x1;throw _0x4c8683;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x22a);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x201);async[a32_0x1d683a(0x23c)](_0x173491){const _0x571b8e=a32_0x1d683a,{options:_0x184af7,args:_0x50adf0,tdx:_0xb58681}=_0x173491;let _0x5680ea,_0xb1a261;if(_0x50adf0[0x0]){const _0x56d63a=_0x50adf0[0x0][_0x571b8e(0x21c)]('.');if(_0x56d63a[_0x571b8e(0x1e2)]===0x1)_0x5680ea=_0x56d63a[0x0];else{if(_0x56d63a['length']===0x2)[_0x5680ea,_0xb1a261]=_0x56d63a;else return console[_0x571b8e(0x220)](_0x571b8e(0x248)),0x1;}}try{const _0x3fc716=_0x184af7[_0x571b8e(0x1ff)];if(_0x184af7[_0x571b8e(0x1e3)]){if(_0x5680ea&&_0xb1a261)console[_0x571b8e(0x220)](_0x571b8e(0x23f)+_0x5680ea+'.'+_0xb1a261);else _0x5680ea&&console[_0x571b8e(0x220)](_0x571b8e(0x224)+_0x5680ea);_0x3fc716&&console[_0x571b8e(0x220)]('Include\x20retried:\x20yes');}const _0x119b12=await withSpinner(_0x571b8e(0x20e),()=>_0xb58681[_0x571b8e(0x227)][_0x571b8e(0x212)]({'projectName':_0x5680ea,'workflowName':_0xb1a261,'includeRetried':_0x3fc716,'limit':_0x184af7[_0x571b8e(0x1f2)]}),{'verbose':_0x184af7[_0x571b8e(0x1e3)]}),_0x3b6cf6=_0x119b12['data'];return console['error'](_0x571b8e(0x1ec)+_0x3b6cf6[_0x571b8e(0x1e2)]+_0x571b8e(0x1e6)+(_0x3b6cf6[_0x571b8e(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x3b6cf6,_0x184af7),0x0;}catch(_0x5f5682){if(_0x5f5682 instanceof SDKError)return console['error'](_0x571b8e(0x20f)+_0x5f5682['message']),_0x5f5682['cause']&&console['error'](_0x571b8e(0x1df)+_0x5f5682[_0x571b8e(0x1f6)]),0x1;throw _0x5f5682;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x1d683a(0x242)]='workflow:attempt';['description']=a32_0x1d683a(0x24d);async[a32_0x1d683a(0x23c)](_0x2c2147){const _0x40d79a=a32_0x1d683a,{options:_0x3a5ada,args:_0x17f60a,tdx:_0x1ffa2d}=_0x2c2147,_0x441e18=_0x17f60a[0x0];if(!_0x441e18)return console['error'](_0x40d79a(0x1e8)),0x1;try{_0x3a5ada['verbose']&&console['error'](_0x40d79a(0x241)+_0x441e18);const _0x1165e9=await withSpinner('Getting\x20attempt\x20details...',()=>_0x1ffa2d[_0x40d79a(0x227)][_0x40d79a(0x1d2)](_0x441e18),{'verbose':_0x3a5ada[_0x40d79a(0x1e3)]}),_0x5a3703=_0x1165e9[_0x40d79a(0x1d9)];return await handleSDKOutput([_0x5a3703],_0x3a5ada),0x0;}catch(_0x5c54d2){if(_0x5c54d2 instanceof SDKError)return console[_0x40d79a(0x220)](_0x40d79a(0x20f)+_0x5c54d2['message']),_0x5c54d2[_0x40d79a(0x1f6)]&&console[_0x40d79a(0x220)](_0x40d79a(0x1df)+_0x5c54d2[_0x40d79a(0x1f6)]),0x1;throw _0x5c54d2;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x1d683a(0x24c);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x225);async[a32_0x1d683a(0x23c)](_0x42c0c6){const _0x23d57a=a32_0x1d683a,{options:_0x1673bc,args:_0x359baa,tdx:_0x1886d6}=_0x42c0c6,_0x9b5a70=_0x359baa[0x0];if(!_0x9b5a70)return console[_0x23d57a(0x220)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x383ca1=_0x1673bc[_0x23d57a(0x221)];_0x1673bc[_0x23d57a(0x1e3)]&&(console['error']('Attempt\x20ID:\x20'+_0x9b5a70),_0x383ca1&&console['error'](_0x23d57a(0x1e7)));const _0x13e538=await withSpinner(_0x23d57a(0x219),()=>_0x1886d6[_0x23d57a(0x227)]['tasks'](_0x9b5a70,_0x383ca1||![]),{'verbose':_0x1673bc['verbose']}),_0x1163e7=_0x13e538[_0x23d57a(0x1d9)];return console[_0x23d57a(0x220)](_0x23d57a(0x1ec)+_0x1163e7[_0x23d57a(0x1e2)]+'\x20task'+(_0x1163e7[_0x23d57a(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x1163e7,_0x1673bc),0x0;}catch(_0x2dd345){if(_0x2dd345 instanceof SDKError)return console[_0x23d57a(0x220)](_0x23d57a(0x20f)+_0x2dd345['message']),_0x2dd345[_0x23d57a(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x2dd345[_0x23d57a(0x1f6)]),0x1;throw _0x2dd345;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x232);[a32_0x1d683a(0x244)]='Show\x20logs\x20for\x20a\x20specific\x20task';async['execute'](_0x27ed65){const _0x3b8f46=a32_0x1d683a,{options:_0x2b7dfb,args:_0x287b26,tdx:_0x3dae73}=_0x27ed65,_0x464ec2=_0x287b26[0x0],_0x4106da=_0x287b26[0x1];if(!_0x464ec2||!_0x4106da)return console['error']('Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required'),0x1;try{_0x2b7dfb[_0x3b8f46(0x1e3)]&&(console[_0x3b8f46(0x220)]('Attempt\x20ID:\x20'+_0x464ec2),console['error'](_0x3b8f46(0x1ea)+_0x4106da));const _0x2a737c=_0x2b7dfb[_0x3b8f46(0x20b)],_0x286e39=await withSpinner('Getting\x20task\x20logs...',()=>_0x3dae73['workflow'][_0x3b8f46(0x208)](_0x464ec2,_0x4106da,{'offset':_0x2a737c,'limit':_0x2b7dfb[_0x3b8f46(0x1f2)]}),{'verbose':_0x2b7dfb['verbose']}),_0x1a192f=_0x286e39['data'];return console[_0x3b8f46(0x220)]('✔\x20Found\x20'+_0x1a192f[_0x3b8f46(0x1e2)]+_0x3b8f46(0x1e0)+(_0x1a192f['length']!==0x1?'ies':'y')),await handleSDKOutput(_0x1a192f,_0x2b7dfb),0x0;}catch(_0x290813){if(_0x290813 instanceof SDKError)return console['error'](_0x3b8f46(0x20f)+_0x290813[_0x3b8f46(0x223)]),_0x290813[_0x3b8f46(0x1f6)]&&console[_0x3b8f46(0x220)](_0x3b8f46(0x1df)+_0x290813['cause']),0x1;throw _0x290813;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x23d);[a32_0x1d683a(0x244)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x119564){const _0x265bdd=a32_0x1d683a,{options:_0xf59173,args:_0x57645c,tdx:_0x1ec766}=_0x119564,_0x3eaee6=_0x57645c[0x0];if(!_0x3eaee6)return console[_0x265bdd(0x220)](_0x265bdd(0x1e8)),0x1;try{const _0x27663f=_0xf59173[_0x265bdd(0x230)];_0xf59173[_0x265bdd(0x1e3)]&&(console[_0x265bdd(0x220)](_0x265bdd(0x241)+_0x3eaee6),_0x27663f&&console['error'](_0x265bdd(0x1d4)+_0x27663f));if(!_0xf59173['yes']){const _0x46b5fd=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3eaee6+'?');if(!_0x46b5fd)return console[_0x265bdd(0x220)](_0x265bdd(0x22c)),0x0;}const _0x19b415=await withSpinner('Killing\x20attempt...',()=>_0x1ec766[_0x265bdd(0x227)]['kill'](_0x3eaee6,_0x27663f),{'verbose':_0xf59173[_0x265bdd(0x1e3)]}),_0x5c245b=_0x19b415[_0x265bdd(0x1d9)];return console[_0x265bdd(0x220)]('✔\x20'+_0x5c245b),0x0;}catch(_0x54d4a5){if(_0x54d4a5 instanceof SDKError)return console['error'](_0x265bdd(0x20f)+_0x54d4a5[_0x265bdd(0x223)]),_0x54d4a5[_0x265bdd(0x1f6)]&&console[_0x265bdd(0x220)](_0x265bdd(0x1df)+_0x54d4a5[_0x265bdd(0x1f6)]),0x1;throw _0x54d4a5;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x210);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x1d683a(0x23c)](_0x3d6476){const _0x535a9e=a32_0x1d683a,{options:_0x4bcf1a,args:_0x4e6285,tdx:_0x4ad7d4}=_0x3d6476,_0x3c8506=_0x4e6285[0x0];if(!_0x3c8506)return console['error'](_0x535a9e(0x218)),console[_0x535a9e(0x220)](_0x535a9e(0x246)),0x1;let _0x5d82b6=![],_0x12dd8f=_0x3c8506;if(_0x3c8506[_0x535a9e(0x22b)](_0x535a9e(0x1fb)))_0x5d82b6=!![],_0x12dd8f=_0x3c8506[_0x535a9e(0x1e5)](0x8);else{if(_0x3c8506[_0x535a9e(0x22b)](_0x535a9e(0x1fa)))_0x5d82b6=![],_0x12dd8f=_0x3c8506[_0x535a9e(0x1e5)](0x8);else return console[_0x535a9e(0x220)](_0x535a9e(0x240)),console['error'](_0x535a9e(0x246)),0x1;}try{const _0x39a0f9=_0x4bcf1a[_0x535a9e(0x1f4)],_0x58458d=_0x4bcf1a[_0x535a9e(0x239)],_0x5405e4=_0x4bcf1a[_0x535a9e(0x204)],_0x4fbbf9=_0x4bcf1a['force'];_0x4bcf1a[_0x535a9e(0x1e3)]&&(console[_0x535a9e(0x220)](_0x535a9e(0x1f7)+(_0x5d82b6?_0x535a9e(0x24b):_0x535a9e(0x1d2))+'\x20'+_0x12dd8f),_0x39a0f9&&console[_0x535a9e(0x220)]('From\x20task:\x20'+_0x39a0f9),_0x58458d&&console[_0x535a9e(0x220)](_0x535a9e(0x22e)+_0x58458d),_0x5405e4&&console[_0x535a9e(0x220)](_0x535a9e(0x21e)+_0x5405e4),_0x4fbbf9&&console[_0x535a9e(0x220)](_0x535a9e(0x213)));let _0x4a88d2;if(_0x5405e4)try{if(_0x5405e4[_0x535a9e(0x22b)]('@')){const _0x57ae48=await import(_0x535a9e(0x1da)),_0x5106c4=_0x5405e4[_0x535a9e(0x1e5)](0x1),_0x54938f=await _0x57ae48['readFile'](_0x5106c4,_0x535a9e(0x23e));_0x4a88d2=JSON[_0x535a9e(0x209)](_0x54938f);}else _0x4a88d2=JSON[_0x535a9e(0x209)](_0x5405e4);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4bcf1a[_0x535a9e(0x233)]){const _0x5f52c5=await confirm(_0x535a9e(0x1db)+(_0x5d82b6?_0x535a9e(0x24b):_0x535a9e(0x1d2))+'\x20'+_0x12dd8f+'?');if(!_0x5f52c5)return console[_0x535a9e(0x220)](_0x535a9e(0x22c)),0x0;}let _0x233fbb;_0x5d82b6?_0x233fbb=await withSpinner(_0x535a9e(0x22d),()=>_0x4ad7d4[_0x535a9e(0x227)]['retrySession'](_0x12dd8f,{'fromTask':_0x39a0f9,'retryParams':_0x4a88d2}),{'verbose':_0x4bcf1a[_0x535a9e(0x1e3)]}):_0x233fbb=await withSpinner(_0x535a9e(0x21d),()=>_0x4ad7d4[_0x535a9e(0x227)]['retryAttempt'](_0x12dd8f,{'resumeFrom':_0x58458d,'retryParams':_0x4a88d2,'force':_0x4fbbf9}),{'verbose':_0x4bcf1a[_0x535a9e(0x1e3)]});const _0x10fa05=_0x233fbb[_0x535a9e(0x1d9)];return console[_0x535a9e(0x220)]('✔\x20Retry\x20started'),console[_0x535a9e(0x220)](_0x535a9e(0x228)+_0x10fa05[_0x535a9e(0x1fc)]),console[_0x535a9e(0x220)](_0x535a9e(0x23a)+_0x10fa05[_0x535a9e(0x24a)]),0x0;}catch(_0x37d845){if(_0x37d845 instanceof SDKError)return console[_0x535a9e(0x220)](_0x535a9e(0x20f)+_0x37d845[_0x535a9e(0x223)]),_0x37d845[_0x535a9e(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x37d845['cause']),0x1;throw _0x37d845;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x222);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1e9);async[a32_0x1d683a(0x23c)](_0x52f8d7){const _0x10df88=a32_0x1d683a,{options:_0x153e50,args:_0x41cdda,tdx:_0x2876cc}=_0x52f8d7,_0x1d9670=_0x41cdda[0x0],_0x31fa59=_0x41cdda[0x1]||'.';if(!_0x1d9670)return console[_0x10df88(0x220)](_0x10df88(0x1fd)),console[_0x10df88(0x220)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x4703fa=_0x153e50[_0x10df88(0x238)];_0x153e50[_0x10df88(0x1e3)]&&(console[_0x10df88(0x220)](_0x10df88(0x21b)+_0x1d9670),console[_0x10df88(0x220)]('Output\x20directory:\x20'+_0x31fa59),_0x4703fa&&console[_0x10df88(0x220)](_0x10df88(0x1dc)+_0x4703fa));const _0x44b089=await withSpinner(_0x10df88(0x205)+_0x1d9670+'...',()=>_0x2876cc['workflow'][_0x10df88(0x1eb)](_0x1d9670,_0x31fa59,{'revision':_0x4703fa}),{'verbose':_0x153e50[_0x10df88(0x1e3)]}),_0x9f34ca=_0x44b089[_0x10df88(0x1d9)];return console[_0x10df88(0x220)](_0x10df88(0x202)+_0x9f34ca[_0x10df88(0x229)]),console['error'](_0x10df88(0x226)+_0x9f34ca[_0x10df88(0x238)]),console[_0x10df88(0x220)](_0x10df88(0x1f9)+_0x9f34ca['filesExtracted']),console['error']('\x20\x20Location:\x20'+_0x31fa59+'/'+_0x9f34ca[_0x10df88(0x229)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x207);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1ee);async[a32_0x1d683a(0x23c)](_0x56fe58){const _0x38c6ae=a32_0x1d683a,{options:_0x1276cb,args:_0x2d510c,tdx:_0x350bb9}=_0x56fe58;let _0x570b49='.',_0x25c4f1=_0x1276cb[_0x38c6ae(0x242)];if(_0x2d510c[0x0]){const {promises:_0xdf59b3}=await import('fs');try{const _0x25679d=await _0xdf59b3[_0x38c6ae(0x23b)](_0x2d510c[0x0]);if(_0x25679d[_0x38c6ae(0x214)]())_0x570b49=_0x2d510c[0x0];else return console[_0x38c6ae(0x220)](_0x38c6ae(0x20f)+_0x2d510c[0x0]+_0x38c6ae(0x1ef)),0x1;}catch{_0x25c4f1=_0x2d510c[0x0],_0x570b49='.';}}const _0x59d379=_0x1276cb[_0x38c6ae(0x238)],_0x3d3dcf=_0x1276cb['skipValidation'];_0x1276cb[_0x38c6ae(0x1e3)]&&(console[_0x38c6ae(0x220)]('Project\x20directory:\x20'+_0x570b49),_0x25c4f1&&console['error'](_0x38c6ae(0x200)+_0x25c4f1),_0x59d379&&console[_0x38c6ae(0x220)](_0x38c6ae(0x1dc)+_0x59d379),_0x3d3dcf&&console['error'](_0x38c6ae(0x22f)));const _0x1d23db=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x350bb9[_0x38c6ae(0x227)][_0x38c6ae(0x1d8)](_0x570b49,{'projectName':_0x25c4f1,'revision':_0x59d379,'skipValidation':_0x3d3dcf}),{'verbose':_0x1276cb['verbose']}),_0x52c408=_0x1d23db['data'];return console[_0x38c6ae(0x220)](_0x38c6ae(0x245)+_0x52c408[_0x38c6ae(0x229)]),console[_0x38c6ae(0x220)]('\x20\x20Project\x20ID:\x20'+_0x52c408['projectId']),console[_0x38c6ae(0x220)](_0x38c6ae(0x226)+_0x52c408[_0x38c6ae(0x238)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a32_0x1d683a(0x1fe);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x247);async['execute'](_0x1ff859){const _0x49260e=a32_0x1d683a,{options:_0x31e053,args:_0x553c27,tdx:_0x13a715}=_0x1ff859,_0xf912c5=_0x553c27[0x0];if(!_0xf912c5)return console['error'](_0x49260e(0x1de)),console[_0x49260e(0x220)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x31e053[_0x49260e(0x1e3)]&&console[_0x49260e(0x220)](_0x49260e(0x21b)+_0xf912c5);if(!_0x31e053[_0x49260e(0x233)]){const _0x4ee724=await confirm(_0x49260e(0x234)+_0xf912c5+_0x49260e(0x20a));if(!_0x4ee724)return console[_0x49260e(0x220)](_0x49260e(0x22c)),0x0;}const _0x31476d=await withSpinner(_0x49260e(0x1e1)+_0xf912c5+_0x49260e(0x1f1),()=>_0x13a715[_0x49260e(0x227)][_0x49260e(0x215)](_0xf912c5),{'verbose':_0x31e053[_0x49260e(0x1e3)]}),_0x441dd7=_0x31476d[_0x49260e(0x1d9)];return console['error']('✔\x20Deleted\x20project\x20'+_0x441dd7[_0x49260e(0x229)]),console[_0x49260e(0x220)](_0x49260e(0x237)+_0x441dd7[_0x49260e(0x206)]),0x0;}}function a32_0x4c65(){const _0x5996fb=['Attempt\x20ID:\x20','name','649248AohEFb','description','✔\x20Pushed\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Listing\x20workflow\x20sessions...','sessionId','session','workflow:tasks','Show\x20specific\x20attempt\x20details','837524YhOZrY','attempt','Project\x20filter:\x20','Reason:\x20','7CKyfZy','55qvYpOo','Listing\x20workflow\x20projects...','push','data','fs/promises','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Revision:\x20','List\x20all\x20workflow\x20projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Cause:\x20','\x20log\x20entr','Deleting\x20project\x20','length','verbose','2388OCOIjP','substring','\x20attempt','Including\x20subtasks:\x20yes','Error:\x20Attempt\x20ID\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Task\x20name:\x20','download','✔\x20Found\x20','\x20workflow','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','\x20is\x20not\x20a\x20directory','\x20project','...','limit','328912LUouzU','fromTask','status','cause','Target:\x20','from','\x20\x20Files\x20extracted:\x20','attempt:','session:','attemptId','Error:\x20Project\x20name\x20is\x20required','workflow:delete','includeRetried','Project\x20name:\x20','List\x20workflow\x20attempts','✔\x20Downloaded\x20','126929vhbecz','params','Downloading\x20project\x20','projectId','workflow:push','logs','parse','\x22?\x20This\x20cannot\x20be\x20undone.','offset','1wXQoxw','3336280goCEfR','Listing\x20workflow\x20attempts...','Error:\x20','workflow:retry','Listing\x20workflows...','attempts','Force:\x20yes','isDirectory','delete','projects','workflow:sessions','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','4508556CsDxaL','Project:\x20','split','Retrying\x20attempt...','Params:\x20','Status:\x20','error','includeSubtasks','workflow:download','message','Filter:\x20project=','Show\x20tasks\x20for\x20an\x20attempt','\x20\x20Revision:\x20','workflow','\x20\x20New\x20attempt\x20ID:\x20','projectName','workflow:attempts','startsWith','Cancelled','Retrying\x20session...','Resume\x20from:\x20','Validation:\x20skipped','reason','27HIRpqL','workflow:logs','yes','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','5954590moClOB','workflows','\x20\x20Project\x20ID:\x20','revision','resumeFrom','\x20\x20Session\x20ID:\x20','stat','execute','workflow:kill','utf-8','Filter:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'];a32_0x4c65=function(){return _0x5996fb;};return a32_0x4c65();}
|
|
1
|
+
const a32_0x5464de=a32_0x17ba;(function(_0x256e81,_0x2456ca){const _0x10b546=a32_0x17ba,_0x216856=_0x256e81();while(!![]){try{const _0x4669cd=parseInt(_0x10b546(0x19e))/0x1+-parseInt(_0x10b546(0x215))/0x2*(parseInt(_0x10b546(0x1d5))/0x3)+-parseInt(_0x10b546(0x1f6))/0x4*(parseInt(_0x10b546(0x1ba))/0x5)+parseInt(_0x10b546(0x1d6))/0x6+-parseInt(_0x10b546(0x1a6))/0x7+parseInt(_0x10b546(0x1de))/0x8+-parseInt(_0x10b546(0x1ff))/0x9;if(_0x4669cd===_0x2456ca)break;else _0x216856['push'](_0x216856['shift']());}catch(_0x1f9583){_0x216856['push'](_0x216856['shift']());}}}(a32_0x4c91,0xc43bd));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{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:projects';[a32_0x5464de(0x1a9)]='List\x20all\x20workflow\x20projects';async[a32_0x5464de(0x1d0)](_0x3b2b80){const _0x5be79e=a32_0x5464de,{options:_0x3b27bc,args:_0x463928,tdx:_0x48dcf8}=_0x3b2b80,_0x164548=_0x463928[0x0];try{_0x3b27bc[_0x5be79e(0x1b7)]&&_0x164548&&console['error']('Pattern:\x20'+_0x164548);const _0x1daf38=await withSpinner(_0x5be79e(0x218),()=>_0x48dcf8[_0x5be79e(0x1b9)][_0x5be79e(0x1ac)](_0x164548,{'limit':_0x3b27bc['limit']}),{'verbose':_0x3b27bc[_0x5be79e(0x1b7)]}),_0x4f5cb0=_0x1daf38[_0x5be79e(0x1d8)];return console['error']('✔\x20Found\x20'+_0x4f5cb0['length']+'\x20project'+(_0x4f5cb0['length']!==0x1?'s':'')),await handleSDKOutput(_0x4f5cb0,_0x3b27bc),0x0;}catch(_0x4759cf){if(_0x4759cf instanceof SDKError)return console[_0x5be79e(0x1a4)](_0x5be79e(0x1db)+_0x4759cf[_0x5be79e(0x1b1)]),_0x4759cf[_0x5be79e(0x1e6)]&&console[_0x5be79e(0x1a4)]('\x20\x20Cause:\x20'+_0x4759cf[_0x5be79e(0x1e6)]),0x1;throw _0x4759cf;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x1c5);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x217);async[a32_0x5464de(0x1d0)](_0x144c52){const _0x222a6e=a32_0x5464de,{options:_0x5682c9,args:_0x2e29ec,tdx:_0x51f1f5}=_0x144c52,_0x43d0d6=_0x2e29ec[0x0];try{_0x5682c9[_0x222a6e(0x1b7)]&&_0x43d0d6&&console[_0x222a6e(0x1a4)](_0x222a6e(0x1b3)+_0x43d0d6);const _0xbc5ce9=await withSpinner(_0x222a6e(0x1d3),()=>_0x51f1f5['workflow']['workflows'](_0x43d0d6,{'limit':_0x5682c9['limit']}),{'verbose':_0x5682c9['verbose']}),_0x2a8942=_0xbc5ce9[_0x222a6e(0x1d8)];return console['error'](_0x222a6e(0x1ae)+_0x2a8942[_0x222a6e(0x1ec)]+_0x222a6e(0x203)+(_0x2a8942[_0x222a6e(0x1ec)]!==0x1?'s':'')),await handleSDKOutput(_0x2a8942,_0x5682c9),0x0;}catch(_0x4a62e4){if(_0x4a62e4 instanceof SDKError)return console['error']('Error:\x20'+_0x4a62e4[_0x222a6e(0x1b1)]),_0x4a62e4[_0x222a6e(0x1e6)]&&console[_0x222a6e(0x1a4)](_0x222a6e(0x1aa)+_0x4a62e4['cause']),0x1;throw _0x4a62e4;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:sessions';['description']=a32_0x5464de(0x1ee);async[a32_0x5464de(0x1d0)](_0x4f05f7){const _0x3db96d=a32_0x5464de,{options:_0x5dcc20,args:_0x2ce3b9,tdx:_0xdae82c}=_0x4f05f7;let _0x35c3df,_0x3226ed;if(_0x2ce3b9[0x0]){const _0x569833=_0x2ce3b9[0x0][_0x3db96d(0x1df)]('.');if(_0x569833[_0x3db96d(0x1ec)]===0x1)_0x35c3df=_0x569833[0x0];else{if(_0x569833['length']===0x2)[_0x35c3df,_0x3226ed]=_0x569833;else return console[_0x3db96d(0x1a4)](_0x3db96d(0x214)),0x1;}}try{if(_0x5dcc20[_0x3db96d(0x1b7)]){if(_0x35c3df&&_0x3226ed)console[_0x3db96d(0x1a4)](_0x3db96d(0x1ca)+_0x35c3df+'.'+_0x3226ed);else _0x35c3df&&console[_0x3db96d(0x1a4)](_0x3db96d(0x1dc)+_0x35c3df);const _0x57baa1=_0x5dcc20[_0x3db96d(0x1d7)];_0x57baa1&&console[_0x3db96d(0x1a4)]('Status:\x20'+_0x57baa1);}const _0x555935=await withSpinner(_0x3db96d(0x1a7),()=>_0xdae82c[_0x3db96d(0x1b9)][_0x3db96d(0x1eb)]({'projectName':_0x35c3df,'workflowName':_0x3226ed,'status':_0x5dcc20['status'],'fromTime':_0x5dcc20['from'],'toTime':_0x5dcc20['to'],'limit':_0x5dcc20['limit']}),{'verbose':_0x5dcc20[_0x3db96d(0x1b7)]}),_0x51a58c=_0x555935['data'];return console[_0x3db96d(0x1a4)](_0x3db96d(0x1ae)+_0x51a58c[_0x3db96d(0x1ec)]+'\x20session'+(_0x51a58c[_0x3db96d(0x1ec)]!==0x1?'s':'')),await handleSDKOutput(_0x51a58c,_0x5dcc20),0x0;}catch(_0x4aeebb){if(_0x4aeebb instanceof SDKError)return console[_0x3db96d(0x1a4)]('Error:\x20'+_0x4aeebb[_0x3db96d(0x1b1)]),_0x4aeebb[_0x3db96d(0x1e6)]&&console['error'](_0x3db96d(0x1aa)+_0x4aeebb['cause']),0x1;throw _0x4aeebb;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x212);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1cd);async[a32_0x5464de(0x1d0)](_0x1afe5c){const _0x303ed8=a32_0x5464de,{options:_0x21b9d3,args:_0x3684b9,tdx:_0x4755b7}=_0x1afe5c;let _0x777265,_0x1064bc;if(_0x3684b9[0x0]){const _0x540516=_0x3684b9[0x0][_0x303ed8(0x1df)]('.');if(_0x540516[_0x303ed8(0x1ec)]===0x1)_0x777265=_0x540516[0x0];else{if(_0x540516[_0x303ed8(0x1ec)]===0x2)[_0x777265,_0x1064bc]=_0x540516;else return console[_0x303ed8(0x1a4)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x3dee6b=_0x21b9d3['includeRetried'];if(_0x21b9d3[_0x303ed8(0x1b7)]){if(_0x777265&&_0x1064bc)console[_0x303ed8(0x1a4)]('Filter:\x20'+_0x777265+'.'+_0x1064bc);else _0x777265&&console[_0x303ed8(0x1a4)](_0x303ed8(0x1dc)+_0x777265);_0x3dee6b&&console[_0x303ed8(0x1a4)](_0x303ed8(0x19f));}const _0x4dde43=await withSpinner(_0x303ed8(0x1bd),()=>_0x4755b7[_0x303ed8(0x1b9)][_0x303ed8(0x1d1)]({'projectName':_0x777265,'workflowName':_0x1064bc,'includeRetried':_0x3dee6b,'limit':_0x21b9d3[_0x303ed8(0x20e)]}),{'verbose':_0x21b9d3['verbose']}),_0x592031=_0x4dde43[_0x303ed8(0x1d8)];return console[_0x303ed8(0x1a4)]('✔\x20Found\x20'+_0x592031[_0x303ed8(0x1ec)]+_0x303ed8(0x1be)+(_0x592031[_0x303ed8(0x1ec)]!==0x1?'s':'')),await handleSDKOutput(_0x592031,_0x21b9d3),0x0;}catch(_0x12eefb){if(_0x12eefb instanceof SDKError)return console[_0x303ed8(0x1a4)](_0x303ed8(0x1db)+_0x12eefb[_0x303ed8(0x1b1)]),_0x12eefb[_0x303ed8(0x1e6)]&&console[_0x303ed8(0x1a4)](_0x303ed8(0x1aa)+_0x12eefb['cause']),0x1;throw _0x12eefb;}}}function a32_0x4c91(){const _0x37339a=['logs','479732ercJil','Include\x20retried:\x20yes','includeSubtasks','Reason:\x20','\x20log\x20entr','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','error','attempt','8354689PJngfA','Listing\x20workflow\x20sessions...','push','description','\x20\x20Cause:\x20','\x20task','projects','✔\x20Retry\x20started','✔\x20Found\x20','Getting\x20attempt\x20details...','Getting\x20task\x20logs...','message','workflow:kill','Project\x20filter:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','offset','\x20\x20New\x20attempt\x20ID:\x20','verbose','session:','workflow','10225iEHqkR','Downloading\x20project\x20','workflow:retry','Listing\x20workflow\x20attempts...','\x20attempt','\x20\x20Location:\x20','kill','Error:\x20Invalid\x20JSON\x20in\x20--params','Show\x20logs\x20for\x20a\x20specific\x20task','Pushing\x20workflow\x20project...','\x20\x20Project\x20ID:\x20','workflow:workflows','Resume\x20from:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:delete','stat','Filter:\x20','revision','Attempt\x20ID:\x20','List\x20workflow\x20attempts','params','yes','execute','attempts','Retrying\x20session...','Listing\x20workflows...','fs/promises','503211lxMtMc','9014340dfHOBx','status','data','projectId','fromTask','Error:\x20','Filter:\x20project=','Output\x20directory:\x20','6313056cXDKgH','split','Cancelled','✔\x20Deleted\x20project\x20','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Show\x20specific\x20attempt\x20details','Error:\x20Project\x20name\x20is\x20required','cause','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Session\x20ID:\x20','Project:\x20','tasks','sessions','length','attemptId','List\x20workflow\x20execution\x20sessions','workflow:attempt','\x22?\x20This\x20cannot\x20be\x20undone.','delete','Force:\x20yes','parse','utf-8','...','340cewlbW','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:\x20Attempt\x20ID\x20is\x20required','Task\x20name:\x20','✔\x20Pushed\x20','name','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','reason','Params:\x20','2381895tVUXPb','isDirectory','session','From\x20task:\x20','\x20workflow','\x20is\x20not\x20a\x20directory','workflow:logs','Revision:\x20','✔\x20Downloaded\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','force','substring','download','Validation:\x20skipped','Kill\x20a\x20running\x20attempt','limit','projectName','\x20\x20Revision:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:attempts','Deleting\x20project\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','4mvYmtR','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','List\x20workflows','Listing\x20workflow\x20projects...','Killing\x20attempt...','startsWith'];a32_0x4c91=function(){return _0x37339a;};return a32_0x4c91();}export class WorkflowAttemptCommand extends BaseCommand{['name']=a32_0x5464de(0x1ef);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1e4);async[a32_0x5464de(0x1d0)](_0x5a98dd){const _0x52b81d=a32_0x5464de,{options:_0x16d4d2,args:_0x18849f,tdx:_0x3069c3}=_0x5a98dd,_0x5a9d7a=_0x18849f[0x0];if(!_0x5a9d7a)return console[_0x52b81d(0x1a4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x16d4d2['verbose']&&console['error'](_0x52b81d(0x1cc)+_0x5a9d7a);const _0x16b0a4=await withSpinner(_0x52b81d(0x1af),()=>_0x3069c3[_0x52b81d(0x1b9)][_0x52b81d(0x1a5)](_0x5a9d7a),{'verbose':_0x16d4d2[_0x52b81d(0x1b7)]}),_0x5b06cf=_0x16b0a4[_0x52b81d(0x1d8)];return await handleSDKOutput([_0x5b06cf],_0x16d4d2),0x0;}catch(_0x206b95){if(_0x206b95 instanceof SDKError)return console[_0x52b81d(0x1a4)](_0x52b81d(0x1db)+_0x206b95[_0x52b81d(0x1b1)]),_0x206b95[_0x52b81d(0x1e6)]&&console[_0x52b81d(0x1a4)](_0x52b81d(0x1aa)+_0x206b95['cause']),0x1;throw _0x206b95;}}}export class WorkflowTasksCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:tasks';[a32_0x5464de(0x1a9)]='Show\x20tasks\x20for\x20an\x20attempt';async[a32_0x5464de(0x1d0)](_0x4fbd1b){const _0x5b834f=a32_0x5464de,{options:_0x59b5c3,args:_0x362a50,tdx:_0x4c5b77}=_0x4fbd1b,_0x33c411=_0x362a50[0x0];if(!_0x33c411)return console[_0x5b834f(0x1a4)](_0x5b834f(0x1f8)),0x1;try{const _0x5c97f0=_0x59b5c3[_0x5b834f(0x1a0)];_0x59b5c3['verbose']&&(console[_0x5b834f(0x1a4)](_0x5b834f(0x1cc)+_0x33c411),_0x5c97f0&&console[_0x5b834f(0x1a4)]('Including\x20subtasks:\x20yes'));const _0xffdbe0=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4c5b77[_0x5b834f(0x1b9)][_0x5b834f(0x1ea)](_0x33c411,_0x5c97f0||![]),{'verbose':_0x59b5c3[_0x5b834f(0x1b7)]}),_0x49e35d=_0xffdbe0['data'];return console[_0x5b834f(0x1a4)](_0x5b834f(0x1ae)+_0x49e35d[_0x5b834f(0x1ec)]+_0x5b834f(0x1ab)+(_0x49e35d['length']!==0x1?'s':'')),await handleSDKOutput(_0x49e35d,_0x59b5c3),0x0;}catch(_0x3090ef){if(_0x3090ef instanceof SDKError)return console[_0x5b834f(0x1a4)](_0x5b834f(0x1db)+_0x3090ef[_0x5b834f(0x1b1)]),_0x3090ef[_0x5b834f(0x1e6)]&&console['error'](_0x5b834f(0x1aa)+_0x3090ef[_0x5b834f(0x1e6)]),0x1;throw _0x3090ef;}}}function a32_0x17ba(_0x47d5c2,_0x18a27a){const _0x4c910a=a32_0x4c91();return a32_0x17ba=function(_0x17ba6c,_0x313a98){_0x17ba6c=_0x17ba6c-0x19c;let _0xa50dc=_0x4c910a[_0x17ba6c];return _0xa50dc;},a32_0x17ba(_0x47d5c2,_0x18a27a);}export class WorkflowLogsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x205);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1c2);async[a32_0x5464de(0x1d0)](_0x5ac784){const _0xb7f34a=a32_0x5464de,{options:_0x4c3587,args:_0x5b700f,tdx:_0x37327b}=_0x5ac784,_0x52576a=_0x5b700f[0x0],_0x1186a2=_0x5b700f[0x1];if(!_0x52576a||!_0x1186a2)return console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1e2)),0x1;try{_0x4c3587[_0xb7f34a(0x1b7)]&&(console['error'](_0xb7f34a(0x1cc)+_0x52576a),console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1f9)+_0x1186a2));const _0x3c86d6=_0x4c3587[_0xb7f34a(0x1b5)],_0x3e710a=await withSpinner(_0xb7f34a(0x1b0),()=>_0x37327b[_0xb7f34a(0x1b9)][_0xb7f34a(0x19d)](_0x52576a,_0x1186a2,{'offset':_0x3c86d6,'limit':_0x4c3587['limit']}),{'verbose':_0x4c3587[_0xb7f34a(0x1b7)]}),_0x295db0=_0x3e710a['data'];return console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1ae)+_0x295db0[_0xb7f34a(0x1ec)]+_0xb7f34a(0x1a2)+(_0x295db0[_0xb7f34a(0x1ec)]!==0x1?'ies':'y')),await handleSDKOutput(_0x295db0,_0x4c3587),0x0;}catch(_0x2b3d70){if(_0x2b3d70 instanceof SDKError)return console[_0xb7f34a(0x1a4)]('Error:\x20'+_0x2b3d70[_0xb7f34a(0x1b1)]),_0x2b3d70[_0xb7f34a(0x1e6)]&&console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1aa)+_0x2b3d70[_0xb7f34a(0x1e6)]),0x1;throw _0x2b3d70;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a32_0x5464de(0x1b2);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x20d);async['execute'](_0xec8d9b){const _0x28ccbb=a32_0x5464de,{options:_0x254112,args:_0x3b487f,tdx:_0x1cec77}=_0xec8d9b,_0x557b84=_0x3b487f[0x0];if(!_0x557b84)return console[_0x28ccbb(0x1a4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x1ea6f9=_0x254112[_0x28ccbb(0x1fd)];_0x254112[_0x28ccbb(0x1b7)]&&(console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1cc)+_0x557b84),_0x1ea6f9&&console['error'](_0x28ccbb(0x1a1)+_0x1ea6f9));if(!_0x254112[_0x28ccbb(0x1cf)]){const _0x53a8d3=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x557b84+'?');if(!_0x53a8d3)return console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1e0)),0x0;}const _0x1d3c66=await withSpinner(_0x28ccbb(0x219),()=>_0x1cec77[_0x28ccbb(0x1b9)][_0x28ccbb(0x1c0)](_0x557b84,_0x1ea6f9),{'verbose':_0x254112[_0x28ccbb(0x1b7)]}),_0x97ec90=_0x1d3c66[_0x28ccbb(0x1d8)];return console[_0x28ccbb(0x1a4)]('✔\x20'+_0x97ec90),0x0;}catch(_0x8932cf){if(_0x8932cf instanceof SDKError)return console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1db)+_0x8932cf[_0x28ccbb(0x1b1)]),_0x8932cf['cause']&&console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1aa)+_0x8932cf['cause']),0x1;throw _0x8932cf;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x5464de(0x1bc);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x5464de(0x1d0)](_0x3738fc){const _0x5f308a=a32_0x5464de,{options:_0x288fdb,args:_0x3ee2d3,tdx:_0x32fa20}=_0x3738fc,_0x55f241=_0x3ee2d3[0x0];if(!_0x55f241)return console[_0x5f308a(0x1a4)](_0x5f308a(0x1e3)),console[_0x5f308a(0x1a4)](_0x5f308a(0x1a3)),0x1;let _0x394b58=![],_0x56f804=_0x55f241;if(_0x55f241[_0x5f308a(0x19c)](_0x5f308a(0x1b8)))_0x394b58=!![],_0x56f804=_0x55f241[_0x5f308a(0x20a)](0x8);else{if(_0x55f241[_0x5f308a(0x19c)]('attempt:'))_0x394b58=![],_0x56f804=_0x55f241['substring'](0x8);else return console[_0x5f308a(0x1a4)](_0x5f308a(0x1e7)),console[_0x5f308a(0x1a4)](_0x5f308a(0x1a3)),0x1;}try{const _0x8a5ed4=_0x288fdb[_0x5f308a(0x1da)],_0x1e1a82=_0x288fdb['resumeFrom'],_0x2eaed1=_0x288fdb[_0x5f308a(0x1ce)],_0x2faf7a=_0x288fdb[_0x5f308a(0x209)];_0x288fdb[_0x5f308a(0x1b7)]&&(console[_0x5f308a(0x1a4)]('Target:\x20'+(_0x394b58?'session':'attempt')+'\x20'+_0x56f804),_0x8a5ed4&&console['error'](_0x5f308a(0x202)+_0x8a5ed4),_0x1e1a82&&console[_0x5f308a(0x1a4)](_0x5f308a(0x1c6)+_0x1e1a82),_0x2eaed1&&console[_0x5f308a(0x1a4)](_0x5f308a(0x1fe)+_0x2eaed1),_0x2faf7a&&console['error'](_0x5f308a(0x1f2)));let _0x1c0344;if(_0x2eaed1)try{if(_0x2eaed1[_0x5f308a(0x19c)]('@')){const _0x2edcdb=await import(_0x5f308a(0x1d4)),_0x10de58=_0x2eaed1[_0x5f308a(0x20a)](0x1),_0x30ffc2=await _0x2edcdb['readFile'](_0x10de58,_0x5f308a(0x1f4));_0x1c0344=JSON[_0x5f308a(0x1f3)](_0x30ffc2);}else _0x1c0344=JSON[_0x5f308a(0x1f3)](_0x2eaed1);}catch{return console[_0x5f308a(0x1a4)](_0x5f308a(0x1c1)),0x1;}if(!_0x288fdb['yes']){const _0x29f817=await confirm(_0x5f308a(0x208)+(_0x394b58?_0x5f308a(0x201):_0x5f308a(0x1a5))+'\x20'+_0x56f804+'?');if(!_0x29f817)return console[_0x5f308a(0x1a4)](_0x5f308a(0x1e0)),0x0;}let _0x5b5963;_0x394b58?_0x5b5963=await withSpinner(_0x5f308a(0x1d2),()=>_0x32fa20[_0x5f308a(0x1b9)]['retrySession'](_0x56f804,{'fromTask':_0x8a5ed4,'retryParams':_0x1c0344}),{'verbose':_0x288fdb[_0x5f308a(0x1b7)]}):_0x5b5963=await withSpinner('Retrying\x20attempt...',()=>_0x32fa20['workflow']['retryAttempt'](_0x56f804,{'resumeFrom':_0x1e1a82,'retryParams':_0x1c0344,'force':_0x2faf7a}),{'verbose':_0x288fdb[_0x5f308a(0x1b7)]});const _0x508f65=_0x5b5963['data'];return console[_0x5f308a(0x1a4)](_0x5f308a(0x1ad)),console[_0x5f308a(0x1a4)](_0x5f308a(0x1b6)+_0x508f65[_0x5f308a(0x1ed)]),console[_0x5f308a(0x1a4)](_0x5f308a(0x1e8)+_0x508f65['sessionId']),0x0;}catch(_0x251523){if(_0x251523 instanceof SDKError)return console[_0x5f308a(0x1a4)](_0x5f308a(0x1db)+_0x251523[_0x5f308a(0x1b1)]),_0x251523['cause']&&console[_0x5f308a(0x1a4)](_0x5f308a(0x1aa)+_0x251523[_0x5f308a(0x1e6)]),0x1;throw _0x251523;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:download';[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1b4);async['execute'](_0xa1e2e0){const _0x315fbf=a32_0x5464de,{options:_0x34296f,args:_0x33618e,tdx:_0x2a86a5}=_0xa1e2e0,_0x3b3668=_0x33618e[0x0],_0x402c38=_0x33618e[0x1]||'.';if(!_0x3b3668)return console[_0x315fbf(0x1a4)](_0x315fbf(0x1e5)),console[_0x315fbf(0x1a4)](_0x315fbf(0x1fc)),0x1;const _0x34efaf=_0x34296f[_0x315fbf(0x1cb)];_0x34296f[_0x315fbf(0x1b7)]&&(console[_0x315fbf(0x1a4)](_0x315fbf(0x1e9)+_0x3b3668),console[_0x315fbf(0x1a4)](_0x315fbf(0x1dd)+_0x402c38),_0x34efaf&&console[_0x315fbf(0x1a4)](_0x315fbf(0x206)+_0x34efaf));const _0x31e668=await withSpinner(_0x315fbf(0x1bb)+_0x3b3668+'...',()=>_0x2a86a5[_0x315fbf(0x1b9)][_0x315fbf(0x20b)](_0x3b3668,_0x402c38,{'revision':_0x34efaf}),{'verbose':_0x34296f[_0x315fbf(0x1b7)]}),_0x2257b7=_0x31e668[_0x315fbf(0x1d8)];return console[_0x315fbf(0x1a4)](_0x315fbf(0x207)+_0x2257b7[_0x315fbf(0x20f)]),console['error'](_0x315fbf(0x210)+_0x2257b7[_0x315fbf(0x1cb)]),console[_0x315fbf(0x1a4)]('\x20\x20Files\x20extracted:\x20'+_0x2257b7['filesExtracted']),console['error'](_0x315fbf(0x1bf)+_0x402c38+'/'+_0x2257b7[_0x315fbf(0x20f)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';['description']='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a32_0x5464de(0x1d0)](_0x1e70ce){const _0x44219e=a32_0x5464de,{options:_0x476198,args:_0x2df4c2,tdx:_0x55b5d9}=_0x1e70ce;let _0xd6a6f5='.',_0x33091c=_0x476198[_0x44219e(0x1fb)];if(_0x2df4c2[0x0]){const {promises:_0x10871b}=await import('fs');try{const _0x14b7a8=await _0x10871b[_0x44219e(0x1c9)](_0x2df4c2[0x0]);if(_0x14b7a8[_0x44219e(0x200)]())_0xd6a6f5=_0x2df4c2[0x0];else return console[_0x44219e(0x1a4)](_0x44219e(0x1db)+_0x2df4c2[0x0]+_0x44219e(0x204)),0x1;}catch{_0x33091c=_0x2df4c2[0x0],_0xd6a6f5='.';}}const _0x13aa43=_0x476198[_0x44219e(0x1cb)],_0x2e2ab8=_0x476198['skipValidation'];_0x476198['verbose']&&(console[_0x44219e(0x1a4)]('Project\x20directory:\x20'+_0xd6a6f5),_0x33091c&&console[_0x44219e(0x1a4)]('Project\x20name:\x20'+_0x33091c),_0x13aa43&&console[_0x44219e(0x1a4)](_0x44219e(0x206)+_0x13aa43),_0x2e2ab8&&console[_0x44219e(0x1a4)](_0x44219e(0x20c)));const _0x2a3ae9=await withSpinner(_0x44219e(0x1c3),()=>_0x55b5d9[_0x44219e(0x1b9)][_0x44219e(0x1a8)](_0xd6a6f5,{'projectName':_0x33091c,'revision':_0x13aa43,'skipValidation':_0x2e2ab8}),{'verbose':_0x476198[_0x44219e(0x1b7)]}),_0x17c81a=_0x2a3ae9[_0x44219e(0x1d8)];return console[_0x44219e(0x1a4)](_0x44219e(0x1fa)+_0x17c81a['projectName']),console[_0x44219e(0x1a4)](_0x44219e(0x1c4)+_0x17c81a['projectId']),console[_0x44219e(0x1a4)]('\x20\x20Revision:\x20'+_0x17c81a[_0x44219e(0x1cb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x1c8);['description']=a32_0x5464de(0x1c7);async['execute'](_0x3c286f){const _0x42a1e3=a32_0x5464de,{options:_0x170a7b,args:_0x49d958,tdx:_0x23fee0}=_0x3c286f,_0x23d844=_0x49d958[0x0];if(!_0x23d844)return console[_0x42a1e3(0x1a4)](_0x42a1e3(0x211)),console['error'](_0x42a1e3(0x1f7)),0x1;_0x170a7b[_0x42a1e3(0x1b7)]&&console[_0x42a1e3(0x1a4)](_0x42a1e3(0x1e9)+_0x23d844);if(!_0x170a7b[_0x42a1e3(0x1cf)]){const _0x125200=await confirm(_0x42a1e3(0x216)+_0x23d844+_0x42a1e3(0x1f0));if(!_0x125200)return console[_0x42a1e3(0x1a4)](_0x42a1e3(0x1e0)),0x0;}const _0x5739c6=await withSpinner(_0x42a1e3(0x213)+_0x23d844+_0x42a1e3(0x1f5),()=>_0x23fee0['workflow'][_0x42a1e3(0x1f1)](_0x23d844),{'verbose':_0x170a7b[_0x42a1e3(0x1b7)]}),_0x155a56=_0x5739c6[_0x42a1e3(0x1d8)];return console['error'](_0x42a1e3(0x1e1)+_0x155a56[_0x42a1e3(0x20f)]),console[_0x42a1e3(0x1a4)](_0x42a1e3(0x1c4)+_0x155a56[_0x42a1e3(0x1d9)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2baf41,_0x5ec8fb){const _0x5169e1=a33_0x1a44,_0x5ef17e=_0x2baf41();while(!![]){try{const _0x5eeebb=parseInt(_0x5169e1(0xad))/0x1*(-parseInt(_0x5169e1(0xa6))/0x2)+parseInt(_0x5169e1(0xa5))/0x3+-parseInt(_0x5169e1(0xb1))/0x4*(-parseInt(_0x5169e1(0x9e))/0x5)+parseInt(_0x5169e1(0x9b))/0x6*(-parseInt(_0x5169e1(0xae))/0x7)+-parseInt(_0x5169e1(0xa8))/0x8*(parseInt(_0x5169e1(0x9c))/0x9)+-parseInt(_0x5169e1(0x9f))/0xa*(-parseInt(_0x5169e1(0xa9))/0xb)+-parseInt(_0x5169e1(0xb0))/0xc*(-parseInt(_0x5169e1(0xab))/0xd);if(_0x5eeebb===_0x5ec8fb)break;else _0x5ef17e['push'](_0x5ef17e['shift']());}catch(_0x2893d9){_0x5ef17e['push'](_0x5ef17e['shift']());}}}(a33_0x56a7,0xc3047));import{platform}from'os';import{readFileSync}from'fs';function a33_0x1a44(_0x11cb23,_0x152140){const _0x56a7c9=a33_0x56a7();return a33_0x1a44=function(_0x1a4497,_0x4695ed){_0x1a4497=_0x1a4497-0x9a;let _0x2a02a9=_0x56a7c9[_0x1a4497];return _0x2a02a9;},a33_0x1a44(_0x11cb23,_0x152140);}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x2383cb=a33_0x1a44;try{const _0x52947d=fileURLToPath(import.meta[_0x2383cb(0xac)]),_0x190eed=dirname(_0x52947d),_0x2daffb=join(_0x190eed,_0x2383cb(0xa2)),_0x16e93f=JSON[_0x2383cb(0xaf)](readFileSync(_0x2daffb,_0x2383cb(0x9d)));return _0x16e93f[_0x2383cb(0xa3)];}catch{return'0.0.0';}}export function getUserAgent(){const _0x5a37dc=a33_0x1a44,_0x562b61=getVersion(),_0x50b3a9=platform(),_0x16c452=process[_0x5a37dc(0xa3)]['replace']('v','');return _0x5a37dc(0xa7)+_0x562b61+'\x20('+_0x50b3a9+_0x5a37dc(0x9a)+_0x16c452+')';}export function getAuthHeaders(_0x6b9785,_0x2e795f){const _0x964b2c=a33_0x1a44,_0x5bc459=getVersion(),_0x47b04c={'User-Agent':getUserAgent(),'X-TD-Client':_0x964b2c(0xa1),'X-TD-Client-Version':_0x5bc459};return _0x2e795f&&(_0x47b04c['Authorization']=_0x964b2c(0xaa)+_0x2e795f),_0x47b04c;}export function toHeaderRecord(_0x39318f){const _0x59b04d={};for(const [_0x23d16d,_0x7f4b75]of Object['entries'](_0x39318f)){_0x7f4b75!==undefined&&(_0x59b04d[_0x23d16d]=_0x7f4b75);}return _0x59b04d;}function a33_0x56a7(){const _0x5607bd=['104eukGQc','url','647559XArWMk','35uyPKsC','parse','304872vZBKoT','4fCKEfU',';\x20node/','1760370FnSlLG','225lIpENF','utf-8','6823330JpHdUU','1777210LesqkP','Authorization','tdx','../../package.json','version','length','4592217tAHiBt','2eDIyxy','tdx/','457400LihtYY','77UZLgLR','TD1\x20'];a33_0x56a7=function(){return _0x5607bd;};return a33_0x56a7();}export function getTrinoHeaders(_0x2cb3fb,_0x5292d6){const _0x348a6f=a33_0x1a44,_0xe5a9df=getAuthHeaders(_0x2cb3fb,_0x5292d6),_0x6b205d=toHeaderRecord(_0xe5a9df);return delete _0x6b205d[_0x348a6f(0xa0)],_0x5292d6&&(_0x6b205d['X-Trino-User']=_0x5292d6),_0x6b205d;}export function hasAPIKey(_0x476cb6){const _0x366cf7=a33_0x1a44,_0xd16b77=getAPIKey(_0x476cb6);return _0xd16b77!==undefined&&_0xd16b77[_0x366cf7(0xa4)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a39b9,_0x3a85a9){const _0x55af88=a34_0x953f,_0x38370a=_0x1a39b9();while(!![]){try{const _0xc886b6=parseInt(_0x55af88(0x10f))/0x1+-parseInt(_0x55af88(0x106))/0x2+parseInt(_0x55af88(0x108))/0x3+parseInt(_0x55af88(0x12f))/0x4+parseInt(_0x55af88(0x11a))/0x5+-parseInt(_0x55af88(0x117))/0x6*(-parseInt(_0x55af88(0x12d))/0x7)+-parseInt(_0x55af88(0x12a))/0x8;if(_0xc886b6===_0x3a85a9)break;else _0x38370a['push'](_0x38370a['shift']());}catch(_0x1d0ca9){_0x38370a['push'](_0x38370a['shift']());}}}(a34_0x6ac8,0x9cd7b));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x5e00a2 from'node:fs';import*as a34_0x475eb8 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x3f62fb=a34_0x953f;return process[_0x3f62fb(0x138)][_0x3f62fb(0x122)]||join(homedir(),_0x3f62fb(0x119),_0x3f62fb(0x136));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x192bcb=a34_0x953f;return process[_0x192bcb(0x138)][_0x192bcb(0x10d)]||join(homedir(),_0x192bcb(0x12e),'tdx');}export function getLLMProjectCacheFile(){const _0x189ebe=a34_0x953f;return join(getCacheDir(),_0x189ebe(0x11c));}export function readCachedLLMProject(){const _0x44bbe2=a34_0x953f;try{const _0x28cfb7=getLLMProjectCacheFile();if(!existsSync(_0x28cfb7))return null;return readFileSync(_0x28cfb7,_0x44bbe2(0x109))[_0x44bbe2(0x114)]();}catch{return null;}}export function writeCachedLLMProject(_0x184554){const _0xf4d523=a34_0x953f;try{const _0x52e49d=getCacheDir(),_0x2cadab=getLLMProjectCacheFile();!existsSync(_0x52e49d)&&mkdirSync(_0x52e49d,{'recursive':!![]}),writeFileSync(_0x2cadab,_0x184554,_0xf4d523(0x109));}catch(_0x1bd78f){console[_0xf4d523(0x113)](_0xf4d523(0x123),_0x1bd78f);}}function a34_0x953f(_0x443e26,_0x47514b){const _0x6ac8d=a34_0x6ac8();return a34_0x953f=function(_0x953fc4,_0x9cd24f){_0x953fc4=_0x953fc4-0x105;let _0x227730=_0x6ac8d[_0x953fc4];return _0x227730;},a34_0x953f(_0x443e26,_0x47514b);}export function parseEnvFile(_0x458db4){const _0x10cd8c=a34_0x953f,_0x2531b1={};for(const _0x285cee of _0x458db4[_0x10cd8c(0x110)]('\x0a')){const _0x400afb=_0x285cee[_0x10cd8c(0x114)]();if(!_0x400afb||_0x400afb['startsWith']('#'))continue;const _0x22c2a7=_0x400afb[_0x10cd8c(0x11b)](/^([^=]+)=(.*)$/);if(_0x22c2a7){const _0x5162c2=_0x22c2a7[0x1][_0x10cd8c(0x114)]();let _0x54c988=_0x22c2a7[0x2][_0x10cd8c(0x114)]();(_0x54c988[_0x10cd8c(0x124)]('\x22')&&_0x54c988[_0x10cd8c(0x105)]('\x22')||_0x54c988[_0x10cd8c(0x124)]('\x27')&&_0x54c988[_0x10cd8c(0x105)]('\x27'))&&(_0x54c988=_0x54c988[_0x10cd8c(0x118)](0x1,-0x1)),_0x2531b1[_0x5162c2]=_0x54c988;}}return _0x2531b1;}export function readUserConfig(){const _0x41214c=a34_0x953f,_0xd2fbc4=getConfigFile();if(!existsSync(_0xd2fbc4))return{};try{const _0x24b7d9=readFileSync(_0xd2fbc4,'utf-8');return parseEnvFile(_0x24b7d9);}catch(_0x4c4bce){return console[_0x41214c(0x10a)](_0x41214c(0x134)+_0xd2fbc4+':',_0x4c4bce),{};}}export function resolveSite(_0x1f99bb){const _0x2ebfe0=a34_0x953f,_0x133c7a=[_0x2ebfe0(0x121),'jp01',_0x2ebfe0(0x139),'ap02',_0x2ebfe0(0x111),_0x2ebfe0(0x131),_0x2ebfe0(0x130),_0x2ebfe0(0x126),_0x2ebfe0(0x132),'stg-ap03'];if(_0x133c7a[_0x2ebfe0(0x10e)](_0x1f99bb))return _0x1f99bb;if(_0x1f99bb in SITE_ALIASES)return SITE_ALIASES[_0x1f99bb];return console[_0x2ebfe0(0x10a)](_0x2ebfe0(0x107)+_0x1f99bb+_0x2ebfe0(0x115)),_0x2ebfe0(0x121);}let cachedUserConfig=null;function a34_0x6ac8(){const _0x5771bf=['TDX_CONFIG_DIR','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','startsWith','global:\x20','stg-us01','Warning:\x20Failed\x20to\x20load\x20','map','ap02','31703056xSjVtq','TD_API_KEY_','toUpperCase','36092mFFGIy','.cache','4176784jmDrNC','dev-eu01','dev-us01','stg-jp01','stg-ap03','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','apiKeys','tdx','env:\x20TD_API_KEY','env','eu01','TD_API_KEY','endsWith','338554FbIOmn','Warning:\x20Unknown\x20site\x20\x27','3597555zJDqeW','utf-8','warn','existsSync','readFileSync','TDX_CACHE_DIR','includes','138491FaVFUv','split','ap03','replace','error','trim','\x27,\x20defaulting\x20to\x20us01','\x20(TD_API_KEY)','1374yonhZD','slice','.config','6059950KPkWPB','match','llm_default_project','tdx.json','jp01','join','profile:\x20','us01'];a34_0x6ac8=function(){return _0x5771bf;};return a34_0x6ac8();}export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2bd9e1,_0x3919c4){const _0x53641b=a34_0x953f,_0x122590=_0x2bd9e1[_0x53641b(0x12c)]()[_0x53641b(0x112)](/-/g,'_'),_0x14c034=_0x53641b(0x12b)+_0x122590;if(process['env'][_0x14c034])return process['env'][_0x14c034];if(process[_0x53641b(0x138)][_0x53641b(0x13a)])return process[_0x53641b(0x138)][_0x53641b(0x13a)];const _0x32a2b0=_0x3919c4||getActiveProfileName();if(_0x32a2b0){const _0x5e7ba6=loadProfileEnv(_0x32a2b0);if(_0x5e7ba6){if(_0x5e7ba6[_0x14c034])return _0x5e7ba6[_0x14c034];if(_0x5e7ba6[_0x53641b(0x13a)])return _0x5e7ba6[_0x53641b(0x13a)];}}const _0x3f499f=loadUserConfigOnce();if(_0x3f499f[_0x14c034])return _0x3f499f[_0x14c034];if(_0x3f499f[_0x53641b(0x13a)])return _0x3f499f[_0x53641b(0x13a)];return undefined;}export function getAPIKeySource(_0x19e522,_0x2793fd){const _0x333012=a34_0x953f,_0x568da1=_0x333012(0x12b)+_0x19e522['toUpperCase']()[_0x333012(0x112)](/-/g,'_');if(process['env'][_0x568da1])return'env:\x20'+_0x568da1;if(process[_0x333012(0x138)][_0x333012(0x13a)])return _0x333012(0x137);const _0x6bc6c4=_0x2793fd||getActiveProfileName();if(_0x6bc6c4){const _0x114fef=loadProfileEnv(_0x6bc6c4);if(_0x114fef){if(_0x114fef[_0x568da1])return _0x333012(0x120)+_0x6bc6c4+'\x20('+_0x568da1+')';if(_0x114fef['TD_API_KEY'])return _0x333012(0x120)+_0x6bc6c4+_0x333012(0x116);}}const _0x1b2879=loadUserConfigOnce(),_0x2cf826=getConfigFile();if(_0x1b2879[_0x568da1])return _0x333012(0x125)+_0x2cf826+'\x20('+_0x568da1+')';if(_0x1b2879['TD_API_KEY'])return _0x333012(0x125)+_0x2cf826+_0x333012(0x116);return null;}function loadProfileEnv(_0xd29de0){const _0x40edfc=a34_0x953f,_0x52360e=a34_0x475eb8[_0x40edfc(0x11f)](getConfigDir(),'.env.'+_0xd29de0);if(a34_0x5e00a2['existsSync'](_0x52360e)){validateSecureFilePermissions(_0x52360e);try{const _0x2b042a=a34_0x5e00a2[_0x40edfc(0x10c)](_0x52360e,'utf-8');return parseEnvFile(_0x2b042a);}catch(_0x148149){console[_0x40edfc(0x10a)](_0x40edfc(0x127)+_0x52360e+':\x20'+_0x148149);}}const _0x2c1fb7=a34_0x475eb8[_0x40edfc(0x11f)](getConfigDir(),'profiles',_0xd29de0,'.env');if(a34_0x5e00a2[_0x40edfc(0x10b)](_0x2c1fb7)){validateSecureFilePermissions(_0x2c1fb7);try{const _0x14447e=a34_0x5e00a2[_0x40edfc(0x10c)](_0x2c1fb7,'utf-8');return parseEnvFile(_0x14447e);}catch(_0x1fbe7e){return console['warn'](_0x40edfc(0x127)+_0x2c1fb7+':\x20'+_0x1fbe7e),null;}}return null;}function getActiveProfileName(){const _0x10f38d=a34_0x953f,_0x56b597=a34_0x475eb8[_0x10f38d(0x11f)](getConfigDir(),_0x10f38d(0x11d));if(!a34_0x5e00a2[_0x10f38d(0x10b)](_0x56b597))return null;try{const _0x208699=a34_0x5e00a2['readFileSync'](_0x56b597,_0x10f38d(0x109)),_0x26d7fd=JSON['parse'](_0x208699);return _0x26d7fd['profile']||null;}catch{return null;}}export function saveAPIKey(_0x37da66,_0x323d04){const _0x51fa4f=a34_0x953f,_0x1a8730=getConfigDir(),_0x4861aa=getConfigFile();!existsSync(_0x1a8730)&&mkdirSync(_0x1a8730,{'recursive':!![],'mode':0x1c0});const _0x508001=readUserConfig(),_0x3e857b=_0x37da66['toUpperCase']()[_0x51fa4f(0x112)](/-/g,'_');_0x508001[_0x51fa4f(0x12b)+_0x3e857b]=_0x323d04;const _0x3d3d5d=Object['entries'](_0x508001)[_0x51fa4f(0x128)](([_0x2e6af9,_0x370cc0])=>_0x2e6af9+'='+_0x370cc0);writeFileSync(_0x4861aa,_0x3d3d5d['join']('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x251264=a34_0x953f,_0x129c4f={'apiKeys':{},'defaultSite':'us01'},_0x5ecb63=['us01',_0x251264(0x11e),_0x251264(0x139),_0x251264(0x129),_0x251264(0x111),_0x251264(0x131),_0x251264(0x130),_0x251264(0x126),_0x251264(0x132),_0x251264(0x133)];for(const _0x9108a7 of _0x5ecb63){const _0x3e13d0=getAPIKey(_0x9108a7);_0x3e13d0&&(_0x129c4f[_0x251264(0x135)][_0x9108a7]=_0x3e13d0);}return _0x129c4f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x1c7d33=a35_0x11e1;function a35_0x11e1(_0x3469cf,_0x46c4a1){const _0x446b7d=a35_0x446b();return a35_0x11e1=function(_0x11e1fe,_0x23bd4b){_0x11e1fe=_0x11e1fe-0x79;let _0x3bba6d=_0x446b7d[_0x11e1fe];return _0x3bba6d;},a35_0x11e1(_0x3469cf,_0x46c4a1);}(function(_0x1cb943,_0x4d11b6){const _0x59a84c=a35_0x11e1,_0x4b686f=_0x1cb943();while(!![]){try{const _0x1b6fec=parseInt(_0x59a84c(0xb5))/0x1*(-parseInt(_0x59a84c(0x88))/0x2)+parseInt(_0x59a84c(0x7d))/0x3*(parseInt(_0x59a84c(0xaa))/0x4)+-parseInt(_0x59a84c(0x7f))/0x5*(parseInt(_0x59a84c(0xa5))/0x6)+parseInt(_0x59a84c(0xb4))/0x7+parseInt(_0x59a84c(0xab))/0x8*(-parseInt(_0x59a84c(0xb1))/0x9)+parseInt(_0x59a84c(0x8c))/0xa+parseInt(_0x59a84c(0xaf))/0xb;if(_0x1b6fec===_0x4d11b6)break;else _0x4b686f['push'](_0x4b686f['shift']());}catch(_0x135cdd){_0x4b686f['push'](_0x4b686f['shift']());}}}(a35_0x446b,0x5e141));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';import{loadSessionContext}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x58984e from'node:fs';import*as a35_0x22a422 from'node:path';export class GlobalContext{[a35_0x1c7d33(0x85)];['database'];[a35_0x1c7d33(0x91)];[a35_0x1c7d33(0xb9)];[a35_0x1c7d33(0x89)];[a35_0x1c7d33(0x9e)];['verbose'];[a35_0x1c7d33(0xa0)];[a35_0x1c7d33(0x80)];[a35_0x1c7d33(0x94)];[a35_0x1c7d33(0x95)];constructor(_0x4250fe){const _0x5f5c6d=a35_0x1c7d33;this[_0x5f5c6d(0x94)]=_0x4250fe[_0x5f5c6d(0x8d)]||process[_0x5f5c6d(0x9f)][_0x5f5c6d(0xa8)]();const _0x32896d=loadSessionContext(_0x4250fe['session']),_0x1cba4c=loadProjectConfig(),_0x7610a8=this[_0x5f5c6d(0xb2)]();this[_0x5f5c6d(0x80)]=_0x4250fe[_0x5f5c6d(0xb0)]||_0x32896d?.['profile']||_0x7610a8[_0x5f5c6d(0xb0)]||getActiveProfile();const _0x1eb2cc=this[_0x5f5c6d(0x80)]?loadProfile(this[_0x5f5c6d(0x80)]):null,_0x425724=_0x55943d=>{const _0x5cd137=_0x5f5c6d;if(!_0x55943d)return{};const _0xcc2de2=_0x55943d,_0x562256={};for(const [_0xaf34e,_0x2e4eaa]of Object[_0x5cd137(0x97)](_0xcc2de2)){typeof _0x2e4eaa===_0x5cd137(0xa9)&&(_0x562256[_0xaf34e]=_0x2e4eaa);}return _0x562256;},_0x23c2e9={};if(_0x4250fe[_0x5f5c6d(0x85)]&&_0x4250fe[_0x5f5c6d(0x85)]!=='us01')_0x23c2e9[_0x5f5c6d(0x85)]=_0x4250fe[_0x5f5c6d(0x85)];const _0x5e6aed=_0x32896d?.[_0x5f5c6d(0xa4)],_0x3f79b9=_0x1cba4c?.['database'],_0x5f588d=_0x1eb2cc?.[_0x5f5c6d(0xae)]?.[_0x5f5c6d(0xa4)],_0x2719c3=_0x7610a8['database'];_0x4250fe[_0x5f5c6d(0xa4)]&&(_0x4250fe[_0x5f5c6d(0xa4)]!==_0x5e6aed&&_0x4250fe['database']!==_0x3f79b9&&_0x4250fe[_0x5f5c6d(0xa4)]!==_0x5f588d&&_0x4250fe[_0x5f5c6d(0xa4)]!==_0x2719c3)&&(_0x23c2e9[_0x5f5c6d(0xa4)]=_0x4250fe[_0x5f5c6d(0xa4)]);if(_0x4250fe[_0x5f5c6d(0xb3)])_0x23c2e9[_0x5f5c6d(0x91)]=_0x4250fe['parentSegment'];if(_0x4250fe[_0x5f5c6d(0x8a)])_0x23c2e9[_0x5f5c6d(0x89)]=_0x4250fe['llmProject'];if(_0x4250fe[_0x5f5c6d(0xb0)])_0x23c2e9[_0x5f5c6d(0xb0)]=_0x4250fe[_0x5f5c6d(0xb0)];this[_0x5f5c6d(0xa0)]={'cliFlags':_0x23c2e9,'session':_0x425724(_0x32896d),'project':_0x425724(_0x1cba4c),'profile':_0x425724(_0x1eb2cc?.['config']),'global':_0x425724(_0x7610a8)};const _0x235fb9={...this[_0x5f5c6d(0xa0)][_0x5f5c6d(0xa1)],...this[_0x5f5c6d(0xa0)][_0x5f5c6d(0xb0)],...this[_0x5f5c6d(0xa0)][_0x5f5c6d(0x83)],...this[_0x5f5c6d(0xa0)]['session'],...this[_0x5f5c6d(0xa0)]['cliFlags']},_0x2ba0d0=_0x235fb9['site']||_0x5f5c6d(0x99);this['site']=resolveSite(_0x2ba0d0),this[_0x5f5c6d(0xa4)]=_0x235fb9[_0x5f5c6d(0xa4)],this[_0x5f5c6d(0x91)]=_0x235fb9[_0x5f5c6d(0x91)],this[_0x5f5c6d(0xb9)]=_0x235fb9[_0x5f5c6d(0xb9)],this['llm_project']=_0x235fb9[_0x5f5c6d(0x89)],this[_0x5f5c6d(0x84)]=_0x4250fe[_0x5f5c6d(0x84)]||![],this[_0x5f5c6d(0x9e)]=getAPIKey(this[_0x5f5c6d(0x85)],this[_0x5f5c6d(0x80)]||undefined);const _0x458b64=getConfigDir(),_0x17cf45=a35_0x22a422['join'](_0x458b64,_0x5f5c6d(0xba),this['sessionId']+_0x5f5c6d(0xb6)),_0x44442f=findProjectConfigPath(),_0x5184bd=a35_0x22a422['join'](_0x458b64,'tdx.json'),_0x26d07a=a35_0x22a422['join'](_0x458b64,_0x5f5c6d(0x81));let _0x5eb945=null,_0x3d9977=null;this[_0x5f5c6d(0x80)]&&(_0x5eb945=a35_0x22a422[_0x5f5c6d(0x7b)](_0x458b64,_0x5f5c6d(0xa3),this['activeProfile'],_0x5f5c6d(0x9c)),_0x3d9977=a35_0x22a422[_0x5f5c6d(0x7b)](_0x458b64,_0x5f5c6d(0xa3),this[_0x5f5c6d(0x80)],_0x5f5c6d(0x81))),this[_0x5f5c6d(0x95)]={'session':a35_0x58984e[_0x5f5c6d(0x7c)](_0x17cf45)?_0x17cf45:null,'project':_0x44442f,'profile':_0x5eb945&&a35_0x58984e['existsSync'](_0x5eb945)?_0x5eb945:null,'profileCredentials':_0x3d9977&&a35_0x58984e[_0x5f5c6d(0x7c)](_0x3d9977)?_0x3d9977:null,'global':a35_0x58984e[_0x5f5c6d(0x7c)](_0x5184bd)?_0x5184bd:null,'globalCredentials':a35_0x58984e[_0x5f5c6d(0x7c)](_0x26d07a)?_0x26d07a:null};}['getSource'](_0x2d9b8e,_0x335439){const _0x1c4bbd=a35_0x1c7d33;if(!_0x335439)return _0x1c4bbd(0x93);const _0x43ba4d=_0x335439;if(this[_0x1c4bbd(0xa0)][_0x1c4bbd(0x96)][_0x2d9b8e]===_0x43ba4d){if(_0x2d9b8e===_0x1c4bbd(0x85)&&_0x43ba4d===_0x1c4bbd(0x99)&&!this[_0x1c4bbd(0xa0)][_0x1c4bbd(0x8d)][_0x1c4bbd(0x85)]&&!this[_0x1c4bbd(0xa0)][_0x1c4bbd(0x83)][_0x1c4bbd(0x85)]&&!this['layers'][_0x1c4bbd(0xb0)][_0x1c4bbd(0x85)]&&!this['layers'][_0x1c4bbd(0xa1)][_0x1c4bbd(0x85)])return'default';return _0x1c4bbd(0xb8)+_0x2d9b8e[_0x1c4bbd(0x7e)](/_/g,'-');}if(this['layers'][_0x1c4bbd(0x8d)][_0x2d9b8e]===_0x43ba4d)return _0x1c4bbd(0x8d);if(this['layers'][_0x1c4bbd(0x83)][_0x2d9b8e]===_0x43ba4d)return'project';if(this[_0x1c4bbd(0xa0)]['profile'][_0x2d9b8e]===_0x43ba4d)return'profile:\x20'+this['activeProfile'];if(this[_0x1c4bbd(0xa0)][_0x1c4bbd(0xa1)][_0x2d9b8e]===_0x43ba4d)return _0x1c4bbd(0xa1);return'default';}['loadGlobalConfig'](){const _0xc01289=a35_0x1c7d33,_0x5ba792=a35_0x22a422[_0xc01289(0x7b)](getConfigDir(),'tdx.json');if(!a35_0x58984e[_0xc01289(0x7c)](_0x5ba792))return{};try{const _0x301679=a35_0x58984e[_0xc01289(0x8f)](_0x5ba792,'utf-8');return JSON['parse'](_0x301679);}catch{return{};}}[a35_0x1c7d33(0x98)](_0x3b4714){const _0x22b742=a35_0x1c7d33;_0x3b4714['site']=this[_0x22b742(0x85)],!_0x3b4714['database']&&this[_0x22b742(0xa4)]&&(_0x3b4714['database']=this[_0x22b742(0xa4)]),!_0x3b4714[_0x22b742(0xb3)]&&this[_0x22b742(0x91)]&&(_0x3b4714[_0x22b742(0xb3)]=this[_0x22b742(0x91)]),!_0x3b4714['segmentPath']&&this[_0x22b742(0xb9)]&&(_0x3b4714[_0x22b742(0x8e)]=this[_0x22b742(0xb9)]),!_0x3b4714[_0x22b742(0x8a)]&&this['llm_project']&&(_0x3b4714[_0x22b742(0x8a)]=this[_0x22b742(0x89)]);}[a35_0x1c7d33(0x7a)](){const _0x586101=a35_0x1c7d33;return[{'key':_0x586101(0x85),'value':this[_0x586101(0x85)]},{'key':_0x586101(0xa4),'value':this[_0x586101(0xa4)]},{'key':_0x586101(0x91),'value':this[_0x586101(0x91)]},{'key':'segment_path','value':this['segment_path']},{'key':_0x586101(0x89),'value':this['llm_project']},{'key':_0x586101(0xb0),'value':this[_0x586101(0x80)]||undefined}];}[a35_0x1c7d33(0x82)](){const _0x52856b=a35_0x1c7d33;console[_0x52856b(0x92)](_0x52856b(0x87));for(const {key:_0x42dc89,value:_0x4bc526}of this['getParameters']()){_0x4bc526&&console['log'](_0x42dc89+':\x20'+_0x4bc526);}}[a35_0x1c7d33(0xa7)](){const _0x58b0c2=a35_0x1c7d33;console[_0x58b0c2(0x92)](_0x58b0c2(0x87));for(const {key:_0x2d0775,value:_0x424ae4}of this[_0x58b0c2(0x7a)]()){if(_0x424ae4){const _0x532bbc=_0x2d0775===_0x58b0c2(0xb0)?_0x58b0c2(0xac):'('+this[_0x58b0c2(0xa6)](_0x2d0775,_0x424ae4)+')';console[_0x58b0c2(0x92)](_0x2d0775+':\x20'+_0x424ae4+'\x20'+_0x532bbc);}}console['log'](_0x58b0c2(0xad));const _0x7935e0=[{'label':'Session','path':this[_0x58b0c2(0x95)][_0x58b0c2(0x8d)],'extra':_0x58b0c2(0x8b)+this[_0x58b0c2(0x94)]+')'},{'label':_0x58b0c2(0x90),'path':this['configFiles']['project']},{'label':'Profile','path':this[_0x58b0c2(0x95)][_0x58b0c2(0xb0)]},{'label':_0x58b0c2(0x9a),'path':this[_0x58b0c2(0x95)][_0x58b0c2(0xa2)]},{'label':_0x58b0c2(0x86),'path':this['configFiles'][_0x58b0c2(0xa1)]},{'label':_0x58b0c2(0x9b),'path':this[_0x58b0c2(0x95)][_0x58b0c2(0x9d)]}];for(const {label:_0x3b49ba,path:_0x5d497,extra:_0x3fd530}of _0x7935e0){if(_0x5d497)console[_0x58b0c2(0x92)](_0x3b49ba+':\x20'+_0x5d497+'\x20✓'+(_0x3fd530?'\x20'+_0x3fd530:''));else{if(_0x3b49ba==='Session')console[_0x58b0c2(0x92)](_0x3b49ba+_0x58b0c2(0x79)+this[_0x58b0c2(0x94)]+')');else(_0x3b49ba===_0x58b0c2(0x90)||_0x3b49ba===_0x58b0c2(0x86))&&console[_0x58b0c2(0x92)](_0x3b49ba+_0x58b0c2(0xb7));}}}}function a35_0x446b(){const _0x3b6080=[':\x20none\x20(using\x20session:\x20','getParameters','join','existsSync','627QkzTZb','replace','15350bZlUuN','activeProfile','.env','display','project','verbose','site','Global','[context]','3966wBzqQJ','llm_project','llmProject','(session:\x20','2309860fUjLrS','session','segmentPath','readFileSync','Project','parent_segment','log','not\x20set','sessionId','configFiles','cliFlags','entries','injectIntoOptions','us01','Profile\x20Credentials','Global\x20Credentials','tdx.json','globalCredentials','apiKey','ppid','layers','global','profileCredentials','profiles','database','876DyeibC','getSource','displayWithSources','toString','string','10996eIicwY','104teQaSO','(active)','\x0a[configuration\x20files]','config','2926308wrakyy','profile','107271CIrWcY','loadGlobalConfig','parentSegment','3097164btUcmW','265ZFOODN','.json',':\x20none','CLI\x20flag:\x20--','segment_path','sessions'];a35_0x446b=function(){return _0x3b6080;};return a35_0x446b();}
|