@treasuredata/tdx 0.2.5 → 0.2.7
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/build-info.json +2 -2
- 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/llm-client.js.map +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/proxy/session-cache.d.ts +3 -1
- package/dist/proxy/session-cache.d.ts.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/session-cache.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/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/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/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x27bad5=a26_0xa4cd;(function(_0x1096a7,_0x3b189e){const _0x234133=a26_0xa4cd,_0x1cb4ea=_0x1096a7();while(!![]){try{const _0x3d3497=parseInt(_0x234133(0x13c))/0x1*(parseInt(_0x234133(0x12e))/0x2)+parseInt(_0x234133(0x147))/0x3+parseInt(_0x234133(0x121))/0x4*(parseInt(_0x234133(0x134))/0x5)+parseInt(_0x234133(0x125))/0x6+-parseInt(_0x234133(0x12f))/0x7*(parseInt(_0x234133(0x122))/0x8)+parseInt(_0x234133(0x144))/0x9+parseInt(_0x234133(0x13b))/0xa*(-parseInt(_0x234133(0x135))/0xb);if(_0x3d3497===_0x3b189e)break;else _0x1cb4ea['push'](_0x1cb4ea['shift']());}catch(_0x36ad1d){_0x1cb4ea['push'](_0x1cb4ea['shift']());}}}(a26_0x3ce2,0xa1994));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0xa4cd(_0x5b7b24,_0x7e6692){const _0x3ce251=a26_0x3ce2();return a26_0xa4cd=function(_0xa4cd6b,_0x466158){_0xa4cd6b=_0xa4cd6b-0x11f;let _0x424a28=_0x3ce251[_0xa4cd6b];return _0x424a28;},a26_0xa4cd(_0x5b7b24,_0x7e6692);}import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x3ce2(){const _0x16df35=['8ALDUIT','8696XuHPPN','rule','Resolved\x20folder\x20ID:\x20','3068604xIhjTk','length','Updating\x20segment\x20\x27','folder','updateSegmentById','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','parentId','description','✔\x20Updated\x20segment\x20\x27','502ccOugv','6335eRHcHx','\x20\x20\x20Path:\x20','includes','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','name','291755eKLszM','77fHUXjX','\x27...','data','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','verbose','type','1268430tzkrzx','3807XKXjSN','Resolved\x20type:\x20','Error:\x20Cannot\x20update\x20','resolveFolderId','segment:update','INTERNAL','Resolving\x20folder\x20\x27','resolvePathToResource','2554092kqOWWo','Update\x20existing\x20child\x20segment','error','1998189vmZEfX','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','Examples:','Parent\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','execute','segmentPath','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','ruleFile','segment'];a26_0x3ce2=function(){return _0x16df35;};return a26_0x3ce2();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x27bad5(0x133)]=a26_0x27bad5(0x140);[a26_0x27bad5(0x12c)]=a26_0x27bad5(0x145);async[a26_0x27bad5(0x14d)](_0x4a977e){const _0x3c2a84=a26_0x27bad5,{options:_0x3208a5,args:_0x1ca44d,tdx:_0x27b9a0}=_0x4a977e,_0x55eeb5=_0x3208a5;if(_0x1ca44d[_0x3c2a84(0x126)]===0x0)return console[_0x3c2a84(0x146)](_0x3c2a84(0x148)),console[_0x3c2a84(0x146)](_0x3c2a84(0x138)),console['error'](_0x3c2a84(0x14a)),console[_0x3c2a84(0x146)](_0x3c2a84(0x12a)),console[_0x3c2a84(0x146)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x391204=_0x1ca44d[0x0],_0xd72586=_0x3208a5[_0x3c2a84(0x14e)];let _0x249df9=_0x391204;_0xd72586&&!_0x391204[_0x3c2a84(0x131)]('/')&&(_0x249df9=_0xd72586+'/'+_0x391204,_0x55eeb5[_0x3c2a84(0x139)]&&console[_0x3c2a84(0x146)](_0x3c2a84(0x14c)+_0x249df9));const _0xf44a2c=await withSpinner('Resolving\x20path\x20\x27'+_0x249df9+_0x3c2a84(0x136),()=>_0x27b9a0[_0x3c2a84(0x120)][_0x3c2a84(0x143)](_0x249df9),{'verbose':_0x55eeb5[_0x3c2a84(0x139)]}),_0x1b8eb2=_0xf44a2c[_0x3c2a84(0x137)];_0x55eeb5['verbose']&&console['error'](_0x3c2a84(0x13d)+_0x1b8eb2[_0x3c2a84(0x13a)]);if(_0x1b8eb2[_0x3c2a84(0x13a)]!==_0x3c2a84(0x120))return console[_0x3c2a84(0x146)](_0x3c2a84(0x13e)+_0x1b8eb2['type']+_0x3c2a84(0x132)),console['error'](_0x3c2a84(0x14f)),0x1;if(!_0x1b8eb2['segmentId'])throw new SDKError(ErrorCode[_0x3c2a84(0x141)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2206f9=_0x1b8eb2[_0x3c2a84(0x12b)],_0x12b6ef=_0x1b8eb2['segmentId'];_0x55eeb5[_0x3c2a84(0x139)]&&(console['error'](_0x3c2a84(0x14b)+_0x2206f9),console[_0x3c2a84(0x146)]('Segment\x20ID:\x20'+_0x12b6ef));let _0x2de92b;if(_0x55eeb5[_0x3c2a84(0x128)]){const _0x167bcf=_0x55eeb5[_0x3c2a84(0x128)],_0x1bd111=await withSpinner(_0x3c2a84(0x142)+_0x167bcf+_0x3c2a84(0x136),()=>_0x27b9a0[_0x3c2a84(0x120)][_0x3c2a84(0x13f)](_0x2206f9,_0x167bcf),{'verbose':_0x55eeb5['verbose']});_0x2de92b=parseInt(_0x1bd111[_0x3c2a84(0x137)],0xa),_0x55eeb5[_0x3c2a84(0x139)]&&console[_0x3c2a84(0x146)](_0x3c2a84(0x124)+_0x2de92b);}const _0x27af9e=await loadJSONFromOptions(_0x55eeb5[_0x3c2a84(0x123)],_0x55eeb5[_0x3c2a84(0x11f)]),_0x90d7b6={'name':_0x55eeb5[_0x3c2a84(0x133)],'description':_0x55eeb5[_0x3c2a84(0x12c)],'rule':_0x27af9e,'kind':_0x55eeb5['kind']!==undefined?parseInt(_0x55eeb5[_0x3c2a84(0x149)],0xa):undefined,'segmentFolderId':_0x2de92b},_0x31d812=await withSpinner(_0x3c2a84(0x127)+_0x1b8eb2['segmentName']+_0x3c2a84(0x136),()=>_0x27b9a0[_0x3c2a84(0x120)][_0x3c2a84(0x129)](_0x2206f9,_0x12b6ef,_0x90d7b6),{'verbose':_0x55eeb5[_0x3c2a84(0x139)]}),_0x3acccd=_0x31d812[_0x3c2a84(0x137)];return console[_0x3c2a84(0x146)](_0x3c2a84(0x12d)+_0x3acccd['name']+'\x27'),_0x249df9!==_0x391204&&console['error'](_0x3c2a84(0x130)+_0x249df9),await handleSDKOutput([_0x3acccd],_0x55eeb5),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x4a5dea=a27_0x50d3;(function(_0x23c70f,_0x4a0bad){const _0x11c891=a27_0x50d3,_0x4e0eb0=_0x23c70f();while(!![]){try{const _0x36081b=-parseInt(_0x11c891(0x1b8))/0x1+-parseInt(_0x11c891(0x1b0))/0x2*(parseInt(_0x11c891(0x1b1))/0x3)+parseInt(_0x11c891(0x1ad))/0x4*(parseInt(_0x11c891(0x194))/0x5)+parseInt(_0x11c891(0x1ac))/0x6*(-parseInt(_0x11c891(0x198))/0x7)+-parseInt(_0x11c891(0x1a9))/0x8+-parseInt(_0x11c891(0x1a5))/0x9*(parseInt(_0x11c891(0x1b9))/0xa)+parseInt(_0x11c891(0x1a8))/0xb;if(_0x36081b===_0x4a0bad)break;else _0x4e0eb0['push'](_0x4e0eb0['shift']());}catch(_0x27c9b5){_0x4e0eb0['push'](_0x4e0eb0['shift']());}}}(a27_0xcfa2,0x403f5));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a27_0x50d3(_0x2f903d,_0x2871c2){const _0xcfa2fd=a27_0xcfa2();return a27_0x50d3=function(_0x50d356,_0x4525aa){_0x50d356=_0x50d356-0x18e;let _0x21d5c0=_0xcfa2fd[_0x50d356];return _0x21d5c0;},a27_0x50d3(_0x2f903d,_0x2871c2);}function a27_0xcfa2(){const _0x24472b=['238446qWdZyw','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','19069655ebdcLX','2065288cxSyUB','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segment:use','42750IMHUOs','2552rplUeu','parentId','segment','2YIDbvD','1149090tpRDgP','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Resolved\x20relative\x20path\x20to:\x20','log','Examples:','234446aGzQoi','90Cuwnjo','Target\x20path:\x20','error','segmentPath','type','length','name','split','725upnZlZ','session','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolving\x20path\x20\x27','441ShpfOB','join','verbose','site','slice','segments','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','parentName','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','data','resolvePathToResource','Set\x20current\x20segment/folder\x20context\x20for\x20navigation'];a27_0xcfa2=function(){return _0x24472b;};return a27_0xcfa2();}import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0x4a5dea(0x192)]=a27_0x4a5dea(0x1ab);['description']=a27_0x4a5dea(0x1a4);async['execute'](_0x357143){const _0x3b897b=a27_0x4a5dea,{options:_0x5f2696,args:_0x499a0a,tdx:_0x30d09d}=_0x357143;if(_0x499a0a['length']===0x0)return console[_0x3b897b(0x18e)]('Error:\x20Path\x20is\x20required'),console[_0x3b897b(0x18e)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3b897b(0x18e)](_0x3b897b(0x1b7)),console['error'](_0x3b897b(0x1b2)),console['error'](_0x3b897b(0x1aa)),console[_0x3b897b(0x18e)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x3b897b(0x18e)](_0x3b897b(0x1b4)),0x1;const _0x480755=_0x499a0a[0x0],_0x377990=_0x5f2696[_0x3b897b(0x195)];try{if(_0x480755==='/')return saveSessionContext({'segment_path':undefined},_0x377990),console[_0x3b897b(0x1b6)](_0x3b897b(0x1b3)),0x0;const _0x29080b=_0x5f2696[_0x3b897b(0x18f)];let _0xaa8b62=_0x480755;const _0x1911ae=parsePath(_0x480755);if(!_0x1911ae['isAbsolute']){if(!_0x29080b)return console[_0x3b897b(0x18e)](_0x3b897b(0x1a6)),console['error'](_0x3b897b(0x196)),0x1;if(_0x480755==='..'){const _0x59a0d6=_0x29080b[_0x3b897b(0x193)]('/')[_0x3b897b(0x19c)](0x0,-0x1)[_0x3b897b(0x199)]('/');_0xaa8b62=_0x59a0d6||'/';}else _0x480755==='.'?_0xaa8b62=_0x29080b:_0xaa8b62=_0x29080b+'/'+_0x480755;_0x5f2696['verbose']&&console[_0x3b897b(0x18e)](_0x3b897b(0x1b5)+_0xaa8b62);}if(_0xaa8b62==='/'||_0xaa8b62==='')return saveSessionContext({'segment_path':undefined},_0x377990),console[_0x3b897b(0x1b6)](_0x3b897b(0x1b3)),0x0;_0xaa8b62=normalizePath(_0xaa8b62);const _0x24c07d=parsePath(_0xaa8b62)[_0x3b897b(0x19d)];if(_0x24c07d[_0x3b897b(0x191)]===0x0)return saveSessionContext({'segment_path':undefined},_0x377990),console[_0x3b897b(0x1b6)](_0x3b897b(0x1b3)),0x0;_0x5f2696[_0x3b897b(0x19a)]&&(console[_0x3b897b(0x18e)]('Site:\x20'+_0x5f2696[_0x3b897b(0x19b)]),console[_0x3b897b(0x18e)](_0x3b897b(0x1ba)+_0xaa8b62));const _0x46a257=await withSpinner(_0x3b897b(0x197)+_0xaa8b62+'\x27...',()=>_0x30d09d[_0x3b897b(0x1af)][_0x3b897b(0x1a3)](_0xaa8b62),{'verbose':_0x5f2696['verbose']}),_0xb721b=_0x46a257[_0x3b897b(0x1a2)];_0x5f2696[_0x3b897b(0x19a)]&&(console[_0x3b897b(0x18e)]('Resolved\x20path\x20type:\x20'+_0xb721b[_0x3b897b(0x190)]),console[_0x3b897b(0x18e)]('Parent\x20ID:\x20'+_0xb721b[_0x3b897b(0x1ae)]),_0xb721b['folderId']&&console[_0x3b897b(0x18e)]('Folder\x20ID:\x20'+_0xb721b['folderId']));if(_0xb721b[_0x3b897b(0x190)]==='segment')return console[_0x3b897b(0x18e)](_0x3b897b(0x19e)),console[_0x3b897b(0x18e)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error']('Use:\x20tdx\x20segment\x20use\x20'+_0xb721b[_0x3b897b(0x1a0)]+(_0xb721b['folderPath']?'/'+_0xb721b['folderPath'][_0x3b897b(0x199)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xb721b['fullPath'],'parent_segment':_0xb721b[_0x3b897b(0x1a0)]},_0x377990),console[_0x3b897b(0x1b6)]('Context\x20set\x20to:\x20'+_0xb721b['fullPath']),_0x5f2696[_0x3b897b(0x19a)]&&(console[_0x3b897b(0x18e)](_0x3b897b(0x1a7)),console[_0x3b897b(0x18e)](_0x3b897b(0x1a1)),console['error'](_0x3b897b(0x19f))),0x0;}catch(_0x752b2a){throw _0x752b2a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x103ceb=a28_0x4ece;(function(_0x14af50,_0x263ce3){const _0x1b37e2=a28_0x4ece,_0x3772d1=_0x14af50();while(!![]){try{const _0xc5cca5=-parseInt(_0x1b37e2(0x14e))/0x1+-parseInt(_0x1b37e2(0x160))/0x2*(-parseInt(_0x1b37e2(0x151))/0x3)+-parseInt(_0x1b37e2(0x180))/0x4*(parseInt(_0x1b37e2(0x15e))/0x5)+-parseInt(_0x1b37e2(0x158))/0x6+parseInt(_0x1b37e2(0x14b))/0x7*(parseInt(_0x1b37e2(0x164))/0x8)+parseInt(_0x1b37e2(0x15f))/0x9+parseInt(_0x1b37e2(0x168))/0xa;if(_0xc5cca5===_0x263ce3)break;else _0x3772d1['push'](_0x3772d1['shift']());}catch(_0xd3d704){_0x3772d1['push'](_0x3772d1['shift']());}}}(a28_0xfe0d,0xe61a1));import{BaseCommand}from'./command.js';function a28_0x4ece(_0x4d3ab3,_0x4b39fa){const _0xfe0dc2=a28_0xfe0d();return a28_0x4ece=function(_0x4ece5a,_0x229c66){_0x4ece5a=_0x4ece5a-0x149;let _0xd46cd3=_0xfe0dc2[_0x4ece5a];return _0xd46cd3;},a28_0x4ece(_0x4d3ab3,_0x4b39fa);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x3e6116 from'chalk';function a28_0xfe0d(){const _0x3d059d=['listRecursive','cause','17304aebSgl','dim','✔\x20Found\x20','161986aCyYYU','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','verbose','3426186kmpXWa','execute','\x20and\x20','Listing\x20parent\x20segments\x20matching\x20\x27','folderId','[parent\x20segments]','No\x20parent\x20segments\x20match\x20pattern:\x20','7177206warpKv','length','includes','description','sort','localeCompare','264965vYUXPd','1467936RnBVRO','2FaoWZF','Recursive\x20mode:\x20enabled','resolvePathToResource','segment','96KaHWGD','\x20matching\x20\x27','data','message','10188470stiYRq','(empty)','listUnified','filter','\x27...','replace','parentId','\x20parent\x20segment','attributes','Parent\x20ID:\x20','log','👥\x20','Resolving\x20context\x20path\x20\x27','error','population','name','jsonl','Error:\x20','\x20top-level\x20items','Building\x20hierarchy\x20tree...','json','listParents','format','\x20folder','4MktlIh','Path/pattern\x20arg:\x20','\x20\x20Cause:\x20','Site:\x20','site','listParentsWithPattern','\x5c$&'];a28_0xfe0d=function(){return _0x3d059d;};return a28_0xfe0d();}export class SegmentsCommand extends BaseCommand{[a28_0x103ceb(0x177)]='segments';[a28_0x103ceb(0x15b)]=a28_0x103ceb(0x14f);async[a28_0x103ceb(0x152)](_0xcdc542){const _0x5053dd=a28_0x103ceb,{options:_0x5e451b,args:_0x17a766}=_0xcdc542,_0x5d709e=_0x5e451b['recursive'],_0x1a616f=_0x17a766[0x0];try{const _0x3084b8=_0x5e451b['segmentPath'];_0x5e451b['verbose']&&(console[_0x5053dd(0x175)](_0x5053dd(0x183)+_0x5e451b[_0x5053dd(0x184)]),console[_0x5053dd(0x175)]('Current\x20context:\x20'+(_0x3084b8||'/')),_0x1a616f&&console[_0x5053dd(0x175)](_0x5053dd(0x181)+_0x1a616f),_0x5d709e&&console[_0x5053dd(0x175)](_0x5053dd(0x161)));if(_0x1a616f){const _0x245b7e=_0x1a616f[_0x5053dd(0x15a)]('*')||_0x1a616f[_0x5053dd(0x15a)]('?');if(_0x245b7e&&!_0x3084b8)return await this[_0x5053dd(0x185)](_0xcdc542,_0x1a616f);else return _0x245b7e?(console[_0x5053dd(0x175)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console['error']('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x5d709e?await this[_0x5053dd(0x149)](_0xcdc542,_0x1a616f):await this[_0x5053dd(0x16a)](_0xcdc542,_0x1a616f);}if(!_0x3084b8)return await this[_0x5053dd(0x17d)](_0xcdc542);return _0x5d709e?await this[_0x5053dd(0x149)](_0xcdc542,_0x3084b8):await this[_0x5053dd(0x16a)](_0xcdc542,_0x3084b8);}catch(_0x4af9c9){if(_0x4af9c9 instanceof SDKError)return console[_0x5053dd(0x175)](_0x5053dd(0x179)+_0x4af9c9[_0x5053dd(0x167)]),_0x4af9c9[_0x5053dd(0x14a)]&&console[_0x5053dd(0x175)](_0x5053dd(0x182)+_0x4af9c9[_0x5053dd(0x14a)]),0x1;throw _0x4af9c9;}}async[a28_0x103ceb(0x185)](_0x55cea6,_0x15e570){const _0x257b81=a28_0x103ceb,{options:_0x453009,tdx:_0x583b67}=_0x55cea6,_0x28b1a8=await withSpinner(_0x257b81(0x154)+_0x15e570+'\x27...',()=>_0x583b67[_0x257b81(0x163)][_0x257b81(0x17d)](),{'verbose':_0x453009[_0x257b81(0x150)]}),_0x354c6c=_0x28b1a8[_0x257b81(0x166)],_0x3e6cfe=_0x15e570[_0x257b81(0x16d)](/[.+^${}()|[\]\\]/g,_0x257b81(0x186))[_0x257b81(0x16d)](/\*/g,'.*')[_0x257b81(0x16d)](/\?/g,'.'),_0x5f219e=new RegExp('^'+_0x3e6cfe+'$','i'),_0x5c72d5=_0x354c6c[_0x257b81(0x16b)](_0x5061a1=>_0x5f219e['test'](_0x5061a1[_0x257b81(0x170)][_0x257b81(0x177)]));console[_0x257b81(0x175)]('✔\x20Found\x20'+_0x5c72d5['length']+_0x257b81(0x16f)+(_0x5c72d5[_0x257b81(0x159)]!==0x1?'s':'')+_0x257b81(0x165)+_0x15e570+'\x27');if(_0x453009[_0x257b81(0x17e)]===_0x257b81(0x17c)||_0x453009[_0x257b81(0x17e)]==='jsonl')await handleSDKOutput(_0x5c72d5,_0x453009);else{if(_0x5c72d5['length']===0x0)console[_0x257b81(0x172)](_0x257b81(0x157)+_0x15e570);else{console['log']('[parent\x20segments]');for(const _0x14f1ad of _0x5c72d5){const _0x1b4313=_0x14f1ad['attributes'][_0x257b81(0x176)]?a28_0x3e6116[_0x257b81(0x14c)]('\x20('+formatRows(_0x14f1ad[_0x257b81(0x170)]['population'])+')'):'';console['log'](_0x257b81(0x173)+_0x14f1ad['attributes'][_0x257b81(0x177)]+_0x1b4313);}}}return 0x0;}async[a28_0x103ceb(0x17d)](_0x57cd64){const _0x1ee200=a28_0x103ceb,{options:_0x26bb0e,tdx:_0x3dd696}=_0x57cd64,_0x490303=await withSpinner('Listing\x20parent\x20segments...',()=>_0x3dd696[_0x1ee200(0x163)][_0x1ee200(0x17d)](),{'verbose':_0x26bb0e[_0x1ee200(0x150)]}),_0x9ef7bc=_0x490303['data'];console[_0x1ee200(0x175)](_0x1ee200(0x14d)+_0x9ef7bc['length']+_0x1ee200(0x16f)+(_0x9ef7bc[_0x1ee200(0x159)]!==0x1?'s':''));if(_0x26bb0e[_0x1ee200(0x17e)]===_0x1ee200(0x17c)||_0x26bb0e[_0x1ee200(0x17e)]===_0x1ee200(0x178))await handleSDKOutput(_0x9ef7bc,_0x26bb0e);else{console[_0x1ee200(0x172)](_0x1ee200(0x156));for(const _0x11ea7d of _0x9ef7bc){const _0x422697=_0x11ea7d[_0x1ee200(0x170)][_0x1ee200(0x176)]?a28_0x3e6116[_0x1ee200(0x14c)]('\x20('+formatRows(_0x11ea7d['attributes'][_0x1ee200(0x176)])+')'):'';console['log']('👥\x20'+_0x11ea7d['attributes'][_0x1ee200(0x177)]+_0x422697);}}return 0x0;}async[a28_0x103ceb(0x16a)](_0x1a3261,_0x47d039){const _0x3f7732=a28_0x103ceb,{options:_0x5783b4,tdx:_0x4b515a}=_0x1a3261,_0x163698=await withSpinner(_0x3f7732(0x174)+_0x47d039+'\x27...',()=>_0x4b515a[_0x3f7732(0x163)][_0x3f7732(0x162)](_0x47d039),{'verbose':_0x5783b4['verbose']}),_0x1d5f53=_0x163698[_0x3f7732(0x166)];_0x5783b4[_0x3f7732(0x150)]&&(console['error']('Parent\x20ID:\x20'+_0x1d5f53['parentId']),_0x1d5f53[_0x3f7732(0x155)]&&console[_0x3f7732(0x175)]('Folder\x20ID:\x20'+_0x1d5f53['folderId']));const _0x3af563=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x4b515a[_0x3f7732(0x163)][_0x3f7732(0x16a)](_0x1d5f53[_0x3f7732(0x16e)],_0x1d5f53[_0x3f7732(0x155)]),{'verbose':_0x5783b4[_0x3f7732(0x150)]}),{folders:_0xd3f056,segments:_0x6832ca}=_0x3af563[_0x3f7732(0x166)],_0x553fba=_0xd3f056[_0x3f7732(0x159)]+_0x6832ca[_0x3f7732(0x159)];console[_0x3f7732(0x175)]('✔\x20Found\x20'+_0xd3f056[_0x3f7732(0x159)]+_0x3f7732(0x17f)+(_0xd3f056[_0x3f7732(0x159)]!==0x1?'s':'')+_0x3f7732(0x153)+_0x6832ca['length']+'\x20segment'+(_0x6832ca[_0x3f7732(0x159)]!==0x1?'s':''));if(_0x5783b4[_0x3f7732(0x17e)]===_0x3f7732(0x17c)||_0x5783b4[_0x3f7732(0x17e)]===_0x3f7732(0x178)){const _0x2cbbfb=[..._0xd3f056['map'](_0x2952a4=>({..._0x2952a4,'type':'folder'})),..._0x6832ca['map'](_0x2c3660=>({..._0x2c3660,'type':_0x3f7732(0x163)}))][_0x3f7732(0x15c)]((_0x570e6d,_0x4ffe78)=>_0x570e6d[_0x3f7732(0x177)][_0x3f7732(0x15d)](_0x4ffe78[_0x3f7732(0x177)]));await handleSDKOutput(_0x2cbbfb,_0x5783b4);}else{if(_0x553fba===0x0)console['log'](a28_0x3e6116[_0x3f7732(0x14c)]('[/'+_0x47d039+']')),console['log'](_0x3f7732(0x169));else{console[_0x3f7732(0x172)](a28_0x3e6116[_0x3f7732(0x14c)]('[/'+_0x47d039+']'));const _0x2d7841=formatFlatList(_0xd3f056,_0x6832ca,{'showMetadata':!![]});console[_0x3f7732(0x172)](_0x2d7841);}}return 0x0;}async[a28_0x103ceb(0x149)](_0x33e686,_0x1c935f){const _0x583df1=a28_0x103ceb,{options:_0x4d7781,tdx:_0x46bd09}=_0x33e686,_0x5e4e82=await withSpinner(_0x583df1(0x174)+_0x1c935f+_0x583df1(0x16c),()=>_0x46bd09[_0x583df1(0x163)][_0x583df1(0x162)](_0x1c935f),{'verbose':_0x4d7781[_0x583df1(0x150)]}),_0x13c765=_0x5e4e82[_0x583df1(0x166)];_0x4d7781['verbose']&&(console['error'](_0x583df1(0x171)+_0x13c765[_0x583df1(0x16e)]),_0x13c765[_0x583df1(0x155)]&&console[_0x583df1(0x175)]('Folder\x20ID:\x20'+_0x13c765['folderId']));const _0x332a32=_0x4d7781['maxDepth']||0xa,_0x181cd6=await withSpinner(_0x583df1(0x17b),()=>_0x46bd09['segment'][_0x583df1(0x149)](_0x13c765[_0x583df1(0x16e)],_0x13c765['folderId'],0x0,_0x332a32),{'verbose':_0x4d7781[_0x583df1(0x150)]}),_0x4f6228=_0x181cd6[_0x583df1(0x166)];console[_0x583df1(0x175)]('✔\x20Built\x20tree\x20with\x20'+_0x4f6228[_0x583df1(0x159)]+_0x583df1(0x17a));if(_0x4d7781[_0x583df1(0x17e)]==='json'||_0x4d7781[_0x583df1(0x17e)]===_0x583df1(0x178))await handleSDKOutput(_0x4f6228,_0x4d7781);else{console[_0x583df1(0x172)](a28_0x3e6116[_0x583df1(0x14c)]('[/'+_0x1c935f+']'));const _0x215c65=formatTree(_0x4f6228,{'showMetadata':!![]});console[_0x583df1(0x172)](_0x215c65);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x4bfb(_0x18d691,_0x58ab1b){const _0xf5b57b=a29_0xf5b5();return a29_0x4bfb=function(_0x4bfb00,_0x5ee638){_0x4bfb00=_0x4bfb00-0x10c;let _0x371760=_0xf5b57b[_0x4bfb00];return _0x371760;},a29_0x4bfb(_0x18d691,_0x58ab1b);}const a29_0x4f388f=a29_0x4bfb;(function(_0x56c55e,_0x13b3dd){const _0x3e6594=a29_0x4bfb,_0x5a375f=_0x56c55e();while(!![]){try{const _0x2d7dd4=parseInt(_0x3e6594(0x131))/0x1+-parseInt(_0x3e6594(0x12d))/0x2+-parseInt(_0x3e6594(0x126))/0x3+parseInt(_0x3e6594(0x121))/0x4*(-parseInt(_0x3e6594(0x128))/0x5)+parseInt(_0x3e6594(0x129))/0x6+parseInt(_0x3e6594(0x115))/0x7+parseInt(_0x3e6594(0x12f))/0x8*(parseInt(_0x3e6594(0x120))/0x9);if(_0x2d7dd4===_0x13b3dd)break;else _0x5a375f['push'](_0x5a375f['shift']());}catch(_0x4495b8){_0x5a375f['push'](_0x5a375f['shift']());}}}(a29_0xf5b5,0x94bfe));function a29_0xf5b5(){const _0x420736=['...','395SjUije','3176256ieAocm','\x20from\x20','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','args','1266226bnYMYv','cause','1896256sddxMT','data','731707JXTLlX','verbose','Catalog:\x20','description','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','name','Database:\x20','error','showTable','validate','table','2149371gfzEDD','execute','show','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','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','length','Error:\x20','Usage:\x20tdx\x20show\x20<database.table>','Site:\x20','database','Show\x20table\x20contents','9zyIMcG','22452NEbhGb','\x20\x20Cause:\x20','site','catalog','limit','358050vTATxh'];a29_0xf5b5=function(){return _0x420736;};return a29_0xf5b5();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a29_0x4f388f(0x10f)]=a29_0x4f388f(0x117);[a29_0x4f388f(0x10c)]=a29_0x4f388f(0x11f);async[a29_0x4f388f(0x116)](_0x30bf4b){const _0x3e6f36=a29_0x4f388f;return this[_0x3e6f36(0x112)](_0x30bf4b);}async[a29_0x4f388f(0x112)](_0x1cd87b){const _0x4195e3=a29_0x4f388f,{options:_0xdd131b,args:_0x10b341,tdx:_0xea5863}=_0x1cd87b;let _0x318d91;try{_0x318d91=parseTableReference(_0x10b341[0x0]);const _0x4b6abd=_0xdd131b['database'];!_0x318d91['database']&&_0x4b6abd&&(_0x318d91[_0x4195e3(0x11e)]=_0x4b6abd);const _0x17ba41=validateTableDescribeReference(_0x318d91);if(_0x17ba41)return console[_0x4195e3(0x111)](_0x4195e3(0x11b)+_0x17ba41),console[_0x4195e3(0x111)](_0x4195e3(0x11c)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4195e3(0x111)](_0x4195e3(0x10d)),0x1;}catch(_0x6b6cf8){return console[_0x4195e3(0x111)]('Error:\x20'+_0x6b6cf8['message']),console[_0x4195e3(0x111)](_0x4195e3(0x11c)),console['error'](_0x4195e3(0x10e)),console[_0x4195e3(0x111)](_0x4195e3(0x10d)),0x1;}const _0x3ae19f=_0x318d91[_0x4195e3(0x124)],_0x4ddb16=_0x318d91[_0x4195e3(0x11e)],_0xed4b01=_0x318d91[_0x4195e3(0x114)],_0x223328=resolveLimit(_0xdd131b[_0x4195e3(0x125)],DEFAULT_DISPLAY_LIMIT);try{_0xdd131b[_0x4195e3(0x132)]&&(console[_0x4195e3(0x111)](_0x4195e3(0x11d)+_0xdd131b[_0x4195e3(0x123)]),_0x3ae19f&&console[_0x4195e3(0x111)](_0x4195e3(0x133)+_0x3ae19f),console[_0x4195e3(0x111)](_0x4195e3(0x110)+_0x4ddb16),console[_0x4195e3(0x111)]('Table:\x20'+_0xed4b01),console['error']('Limit:\x20'+_0x223328));const _0x571447=_0x3ae19f?_0x3ae19f+'.'+_0x4ddb16+'.'+_0xed4b01:_0x4ddb16+'.'+_0xed4b01,_0x4e65b7=await withSpinner('Querying\x20'+_0x571447+_0x4195e3(0x127),()=>_0xea5863['table']['show'](_0x4ddb16,_0xed4b01,_0x223328,_0x3ae19f),{'verbose':_0xdd131b[_0x4195e3(0x132)]}),_0x4614c2=_0x4e65b7[_0x4195e3(0x130)],_0x4447a6=_0x4614c2['data'];return _0x4447a6[_0x4195e3(0x11a)]===0x0?console['error'](_0x4195e3(0x118)):console['error']('✔\x20Retrieved\x20'+_0x4447a6[_0x4195e3(0x11a)]+'\x20row'+(_0x4447a6[_0x4195e3(0x11a)]!==0x1?'s':'')+_0x4195e3(0x12a)+_0x571447),await handleSDKOutput(_0x4447a6,_0xdd131b),0x0;}catch(_0x4a83b1){if(_0x4a83b1 instanceof SDKError)return console[_0x4195e3(0x111)](_0x4195e3(0x11b)+_0x4a83b1['message']),_0x4a83b1['cause']&&console[_0x4195e3(0x111)](_0x4195e3(0x122)+_0x4a83b1[_0x4195e3(0x12e)]),0x1;throw _0x4a83b1;}}[a29_0x4f388f(0x113)](_0x52b60f){const _0x3bdc23=a29_0x4f388f;if(_0x52b60f['args'][_0x3bdc23(0x11a)]===0x0)return _0x3bdc23(0x119);if(_0x52b60f[_0x3bdc23(0x12c)][_0x3bdc23(0x11a)]>0x1)return _0x3bdc23(0x12b);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0xb8138=a30_0x308f;(function(_0xfe9169,_0x2d5fc2){const _0x21f506=a30_0x308f,_0x2dff68=_0xfe9169();while(!![]){try{const _0x18f3a7=-parseInt(_0x21f506(0x15d))/0x1+parseInt(_0x21f506(0x172))/0x2*(-parseInt(_0x21f506(0x174))/0x3)+parseInt(_0x21f506(0x17b))/0x4+parseInt(_0x21f506(0x155))/0x5+-parseInt(_0x21f506(0x169))/0x6+-parseInt(_0x21f506(0x182))/0x7*(parseInt(_0x21f506(0x15a))/0x8)+parseInt(_0x21f506(0x180))/0x9;if(_0x18f3a7===_0x2d5fc2)break;else _0x2dff68['push'](_0x2dff68['shift']());}catch(_0x371bcd){_0x2dff68['push'](_0x2dff68['shift']());}}}(a30_0x54ba,0x6c652));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a30_0x54ba(){const _0x5a41b7=['\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','1778300SeMjLh','✖\x20No\x20tables\x20found','✔\x20Found\x20','table','database','195656pLHcaI','length','Listing\x20tables...','67670JNyqgp','tables','\x20table','Error:\x20Pattern\x20\x27','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','name','data','error','Or\x20use\x20--in\x20flag:','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','.*\x22','5214636AGnVSX','site','Error:\x20','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','validate','includes','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','execute','890992ggdBqg','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','3lhGFNn','Database\x20\x27','verbose','limit','description','\x20\x20Cause:\x20','Table\x20pattern:\x20','34072FQhMGj','cause','\x27\x20is\x20ambiguous.','Note:\x20\x27','message','18001206RLdtYi','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','154inCfIH','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','list'];a30_0x54ba=function(){return _0x5a41b7;};return a30_0x54ba();}function a30_0x308f(_0x59e2f9,_0x25fa2b){const _0x54ba9d=a30_0x54ba();return a30_0x308f=function(_0x308fb9,_0x2d27ed){_0x308fb9=_0x308fb9-0x152;let _0x26c874=_0x54ba9d[_0x308fb9];return _0x26c874;},a30_0x308f(_0x59e2f9,_0x25fa2b);}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0xb8138(0x163)]=a30_0xb8138(0x15e);[a30_0xb8138(0x178)]='List\x20tables\x20in\x20a\x20database';async[a30_0xb8138(0x171)](_0x515c68){const _0x3ba231=a30_0xb8138,{options:_0xa813bf,args:_0xe70c4b,tdx:_0x1b716f}=_0x515c68;let _0x217998;if(_0xe70c4b[_0x3ba231(0x15b)]===0x0)_0x217998={'database':undefined,'table':undefined,'original':''};else{if(_0xe70c4b[_0x3ba231(0x15b)]===0x1)try{_0x217998=parseTableReference(_0xe70c4b[0x0]);if(_0x217998[_0x3ba231(0x158)]&&!_0x217998['database']&&!_0x217998[_0x3ba231(0x158)][_0x3ba231(0x16e)]('*')&&!_0x217998[_0x3ba231(0x158)][_0x3ba231(0x16e)]('?'))return console[_0x3ba231(0x165)](_0x3ba231(0x160)+_0xe70c4b[0x0]+_0x3ba231(0x17d)),console[_0x3ba231(0x165)](_0x3ba231(0x170)+_0x217998[_0x3ba231(0x158)]+'\x27?'),console[_0x3ba231(0x165)](_0x3ba231(0x161)+_0x217998['table']+_0x3ba231(0x168)),console[_0x3ba231(0x165)](_0x3ba231(0x173)+_0x217998['table']),console[_0x3ba231(0x165)](_0x3ba231(0x183)+_0x217998[_0x3ba231(0x158)]),console[_0x3ba231(0x165)](''),console[_0x3ba231(0x165)](_0x3ba231(0x17e)+_0xe70c4b[0x0]+_0x3ba231(0x16f)+_0x217998[_0x3ba231(0x158)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x207386){return console[_0x3ba231(0x165)](_0x3ba231(0x16b)+_0x207386[_0x3ba231(0x17f)]),0x1;}else return console[_0x3ba231(0x165)](_0x3ba231(0x181)),console[_0x3ba231(0x165)](_0x3ba231(0x154)),console[_0x3ba231(0x165)](_0x3ba231(0x162)),console[_0x3ba231(0x165)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x3ba231(0x165)](_0x3ba231(0x153)),console[_0x3ba231(0x165)](_0x3ba231(0x166)),console[_0x3ba231(0x165)](_0x3ba231(0x16c)),0x1;}const _0x26be40=_0xa813bf[_0x3ba231(0x159)];!_0x217998['database']&&_0x26be40&&(_0x217998[_0x3ba231(0x159)]=_0x26be40);try{const _0x7780ff=_0x517769=>_0x517769&&(_0x517769[_0x3ba231(0x16e)]('*')||_0x517769[_0x3ba231(0x16e)]('?')),_0x22bc49=_0x7780ff(_0x217998[_0x3ba231(0x159)]);_0xa813bf[_0x3ba231(0x176)]&&(console['error']('Site:\x20'+_0xa813bf[_0x3ba231(0x16a)]),_0x217998[_0x3ba231(0x159)]?_0x22bc49?console[_0x3ba231(0x165)]('Database\x20pattern:\x20'+_0x217998['database']):console[_0x3ba231(0x165)]('Database:\x20'+_0x217998[_0x3ba231(0x159)]):console['error']('Database:\x20all'),_0x217998[_0x3ba231(0x158)]&&console[_0x3ba231(0x165)](_0x3ba231(0x17a)+_0x217998[_0x3ba231(0x158)]));const _0x109fe7=_0x217998[_0x3ba231(0x159)]&&!_0x22bc49?_0x217998[_0x3ba231(0x159)]:undefined,_0x36587c=_0x22bc49?_0x217998[_0x3ba231(0x159)]:undefined,_0x4d041e=_0x217998[_0x3ba231(0x158)],_0x5561f5=resolveLimit(_0xa813bf[_0x3ba231(0x177)],DEFAULT_LISTING_LIMIT),_0x467da6=await withSpinner(_0x3ba231(0x15c),()=>_0x1b716f['table'][_0x3ba231(0x152)](_0x109fe7,_0x4d041e,_0x36587c,_0x5561f5),{'verbose':_0xa813bf[_0x3ba231(0x176)]}),_0x3442a6=_0x467da6[_0x3ba231(0x164)];if(_0x3442a6[_0x3ba231(0x15b)]===0x0&&_0x217998[_0x3ba231(0x159)]&&!_0x22bc49)return console['error'](_0x3ba231(0x156)),console[_0x3ba231(0x165)](_0x3ba231(0x175)+_0x217998[_0x3ba231(0x159)]+_0x3ba231(0x167)),0x1;return console[_0x3ba231(0x165)](_0x3ba231(0x157)+_0x3442a6[_0x3ba231(0x15b)]+_0x3ba231(0x15f)+(_0x3442a6[_0x3ba231(0x15b)]!==0x1?'s':'')),await handleSDKOutput(_0x3442a6,{..._0xa813bf,'limit':_0x5561f5}),0x0;}catch(_0x1d7e07){if(_0x1d7e07 instanceof SDKError)return console[_0x3ba231(0x165)](_0x3ba231(0x16b)+_0x1d7e07[_0x3ba231(0x17f)]),_0x1d7e07[_0x3ba231(0x17c)]&&console[_0x3ba231(0x165)](_0x3ba231(0x179)+_0x1d7e07[_0x3ba231(0x17c)]),0x1;throw _0x1d7e07;}}[a30_0xb8138(0x16d)](_0x37ae88){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a31_0x716a(){const _0x569efe=['Error:\x20','execute','log','4761MhEHdQ','profile','7lrDlJj','llm_project','Session\x20profile\x20set\x20to:\x20','1236998qWsyKp','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','.\x20Must\x20be\x20one\x20of:\x20','6680EcIstj','1188492vVvmkM','message','parent_segment','15nxbRiG','error','1314668MEtZir','4250xSKzuu','database','use','description','includes','name','Session\x20llm_project\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','44pUQGIK','Set\x20session-level\x20context','2670AjpwwC','\x20(session:\x20','\x27\x20does\x20not\x20exist','Invalid\x20resource:\x20','14035624HudSpM','1042680IGHZnG','toString','session'];a31_0x716a=function(){return _0x569efe;};return a31_0x716a();}const a31_0x4b76cd=a31_0xd8eb;(function(_0x496e27,_0x5724af){const _0x4784c9=a31_0xd8eb,_0x2a3998=_0x496e27();while(!![]){try{const _0x1c3d6f=parseInt(_0x4784c9(0xa6))/0x1+parseInt(_0x4784c9(0x9b))/0x2+parseInt(_0x4784c9(0xae))/0x3*(parseInt(_0x4784c9(0xb0))/0x4)+parseInt(_0x4784c9(0xaa))/0x5*(-parseInt(_0x4784c9(0x96))/0x6)+-parseInt(_0x4784c9(0xa3))/0x7*(parseInt(_0x4784c9(0x9a))/0x8)+parseInt(_0x4784c9(0xa1))/0x9*(parseInt(_0x4784c9(0xb1))/0xa)+parseInt(_0x4784c9(0x94))/0xb*(-parseInt(_0x4784c9(0xab))/0xc);if(_0x1c3d6f===_0x5724af)break;else _0x2a3998['push'](_0x2a3998['shift']());}catch(_0x32b484){_0x2a3998['push'](_0x2a3998['shift']());}}}(a31_0x716a,0xd72d1));function a31_0xd8eb(_0x6de34b,_0x377785){const _0x716a93=a31_0x716a();return a31_0xd8eb=function(_0xd8eb73,_0x32477f){_0xd8eb73=_0xd8eb73-0x8d;let _0x2926b9=_0x716a93[_0xd8eb73];return _0x2926b9;},a31_0xd8eb(_0x6de34b,_0x377785);}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x4b76cd(0x91)]=a31_0x4b76cd(0x8e);[a31_0x4b76cd(0x8f)]=a31_0x4b76cd(0x95);['validate'](_0x378d6f){const _0x1d8bad=a31_0x4b76cd,{args:_0x37d86b}=_0x378d6f;if(_0x37d86b['length']<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x1d8bad(0x93)+_0x1d8bad(0xa8)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x269747=_0x37d86b[0x0],_0x5285e0=['database',_0x1d8bad(0xad),'llm_project',_0x1d8bad(0xa2)];if(!_0x5285e0[_0x1d8bad(0x90)](_0x269747))return _0x1d8bad(0x99)+_0x269747+_0x1d8bad(0xa9)+_0x5285e0['join'](',\x20');return undefined;}async[a31_0x4b76cd(0x9f)](_0x14c253){const _0x4e2fd8=a31_0x4b76cd,{args:_0x1ee3eb,options:_0x1d002f}=_0x14c253;try{const _0x103dd5=_0x1ee3eb[0x0],_0x2c55cd=_0x1ee3eb[0x1];if(_0x103dd5===_0x4e2fd8(0xa2)){if(!profileExists(_0x2c55cd))return console[_0x4e2fd8(0xaf)]('Error:\x20Profile\x20\x27'+_0x2c55cd+_0x4e2fd8(0x98)),console[_0x4e2fd8(0xaf)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x1dc563=_0x1d002f[_0x4e2fd8(0x9d)]||getCurrentSessionPID()[_0x4e2fd8(0x9c)]();return saveSessionContext({'profile':_0x2c55cd},_0x1d002f[_0x4e2fd8(0x9d)]),console[_0x4e2fd8(0xa0)](_0x4e2fd8(0xa5)+_0x2c55cd+_0x4e2fd8(0x97)+_0x1dc563+')'),console['log'](_0x4e2fd8(0xa7)),0x0;}const _0x2bc6d9={},_0x325589=_0x1d002f[_0x4e2fd8(0x9d)]||getCurrentSessionPID()[_0x4e2fd8(0x9c)]();switch(_0x103dd5){case _0x4e2fd8(0x8d):_0x2bc6d9[_0x4e2fd8(0x8d)]=_0x2c55cd,console[_0x4e2fd8(0xa0)]('Session\x20database\x20set\x20to:\x20'+_0x2c55cd+'\x20(session:\x20'+_0x325589+')');break;case'parent_segment':_0x2bc6d9[_0x4e2fd8(0xad)]=_0x2c55cd,console[_0x4e2fd8(0xa0)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x2c55cd+_0x4e2fd8(0x97)+_0x325589+')');break;case _0x4e2fd8(0xa4):_0x2bc6d9['llm_project']=_0x2c55cd,console['log'](_0x4e2fd8(0x92)+_0x2c55cd+'\x20(session:\x20'+_0x325589+')');break;}return saveSessionContext(_0x2bc6d9,_0x1d002f[_0x4e2fd8(0x9d)]),console[_0x4e2fd8(0xa0)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x5ae4a6){return _0x5ae4a6 instanceof Error&&console[_0x4e2fd8(0xaf)](_0x4e2fd8(0x9e)+_0x5ae4a6[_0x4e2fd8(0xac)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x4580ee=a32_0x267e;(function(_0x5a9c6e,_0x146e4e){const _0x1eb316=a32_0x267e,_0x5112dd=_0x5a9c6e();while(!![]){try{const _0x8963e2=parseInt(_0x1eb316(0x1a1))/0x1*(parseInt(_0x1eb316(0x1c0))/0x2)+-parseInt(_0x1eb316(0x1f5))/0x3+-parseInt(_0x1eb316(0x1ee))/0x4*(parseInt(_0x1eb316(0x1f1))/0x5)+-parseInt(_0x1eb316(0x19e))/0x6*(-parseInt(_0x1eb316(0x1c9))/0x7)+parseInt(_0x1eb316(0x1d0))/0x8*(parseInt(_0x1eb316(0x195))/0x9)+-parseInt(_0x1eb316(0x19f))/0xa+parseInt(_0x1eb316(0x1e4))/0xb*(parseInt(_0x1eb316(0x1c4))/0xc);if(_0x8963e2===_0x146e4e)break;else _0x5112dd['push'](_0x5112dd['shift']());}catch(_0x2c66e9){_0x5112dd['push'](_0x5112dd['shift']());}}}(a32_0x583e,0x69054));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{['name']=a32_0x4580ee(0x1b6);[a32_0x4580ee(0x18a)]='List\x20all\x20workflow\x20projects';async[a32_0x4580ee(0x17d)](_0x4d9650){const _0x275e38=a32_0x4580ee,{options:_0x4d34f9,args:_0x36d016,tdx:_0x110972}=_0x4d9650,_0x3d3cc9=_0x36d016[0x0];try{_0x4d34f9[_0x275e38(0x1d1)]&&_0x3d3cc9&&console[_0x275e38(0x1dd)](_0x275e38(0x1c2)+_0x3d3cc9);const _0x3b4cee=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x110972[_0x275e38(0x1d9)][_0x275e38(0x1ec)](_0x3d3cc9,{'limit':_0x4d34f9[_0x275e38(0x1ef)]}),{'verbose':_0x4d34f9[_0x275e38(0x1d1)]}),_0x280a92=_0x3b4cee[_0x275e38(0x199)];return console[_0x275e38(0x1dd)](_0x275e38(0x1a3)+_0x280a92[_0x275e38(0x1a6)]+_0x275e38(0x1a4)+(_0x280a92[_0x275e38(0x1a6)]!==0x1?'s':'')),await handleSDKOutput(_0x280a92,_0x4d34f9),0x0;}catch(_0x4bbf85){if(_0x4bbf85 instanceof SDKError)return console[_0x275e38(0x1dd)](_0x275e38(0x1cb)+_0x4bbf85[_0x275e38(0x191)]),_0x4bbf85[_0x275e38(0x179)]&&console['error'](_0x275e38(0x1b5)+_0x4bbf85['cause']),0x1;throw _0x4bbf85;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x4580ee(0x178)]='workflow:workflows';['description']=a32_0x4580ee(0x18e);async[a32_0x4580ee(0x17d)](_0x38510a){const _0x4ccc16=a32_0x4580ee,{options:_0x27ec01,args:_0x30139d,tdx:_0x5bb779}=_0x38510a,_0x5d1fa5=_0x30139d[0x0];try{_0x27ec01[_0x4ccc16(0x1d1)]&&_0x5d1fa5&&console[_0x4ccc16(0x1dd)](_0x4ccc16(0x1be)+_0x5d1fa5);const _0xdc17b2=await withSpinner(_0x4ccc16(0x1f0),()=>_0x5bb779['workflow'][_0x4ccc16(0x173)](_0x5d1fa5,{'limit':_0x27ec01['limit']}),{'verbose':_0x27ec01[_0x4ccc16(0x1d1)]}),_0x1e9258=_0xdc17b2['data'];return console['error'](_0x4ccc16(0x1a3)+_0x1e9258['length']+_0x4ccc16(0x1d2)+(_0x1e9258['length']!==0x1?'s':'')),await handleSDKOutput(_0x1e9258,_0x27ec01),0x0;}catch(_0x1276ff){if(_0x1276ff instanceof SDKError)return console['error'](_0x4ccc16(0x1cb)+_0x1276ff['message']),_0x1276ff[_0x4ccc16(0x179)]&&console[_0x4ccc16(0x1dd)](_0x4ccc16(0x1b5)+_0x1276ff[_0x4ccc16(0x179)]),0x1;throw _0x1276ff;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1f2);async[a32_0x4580ee(0x17d)](_0x48ab9c){const _0x12d267=a32_0x4580ee,{options:_0x6bf134,args:_0x5a993d,tdx:_0x495fb7}=_0x48ab9c;let _0x1d4c1a,_0x169fce;if(_0x5a993d[0x0]){const _0x4a35b1=_0x5a993d[0x0]['split']('.');if(_0x4a35b1[_0x12d267(0x1a6)]===0x1)_0x1d4c1a=_0x4a35b1[0x0];else{if(_0x4a35b1[_0x12d267(0x1a6)]===0x2)[_0x1d4c1a,_0x169fce]=_0x4a35b1;else return console[_0x12d267(0x1dd)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x6bf134['verbose']){if(_0x1d4c1a&&_0x169fce)console['error'](_0x12d267(0x1ab)+_0x1d4c1a+'.'+_0x169fce);else _0x1d4c1a&&console['error'](_0x12d267(0x1df)+_0x1d4c1a);const _0x27d314=_0x6bf134[_0x12d267(0x1dc)];_0x27d314&&console[_0x12d267(0x1dd)](_0x12d267(0x17f)+_0x27d314);}const _0x283363=await withSpinner(_0x12d267(0x1ea),()=>_0x495fb7[_0x12d267(0x1d9)][_0x12d267(0x1a0)]({'projectName':_0x1d4c1a,'workflowName':_0x169fce,'status':_0x6bf134[_0x12d267(0x1dc)],'fromTime':_0x6bf134[_0x12d267(0x1cf)],'toTime':_0x6bf134['to'],'limit':_0x6bf134['limit']}),{'verbose':_0x6bf134['verbose']}),_0x14790a=_0x283363[_0x12d267(0x199)];return console[_0x12d267(0x1dd)](_0x12d267(0x1a3)+_0x14790a[_0x12d267(0x1a6)]+_0x12d267(0x1f4)+(_0x14790a['length']!==0x1?'s':'')),await handleSDKOutput(_0x14790a,_0x6bf134),0x0;}catch(_0x19ad0a){if(_0x19ad0a instanceof SDKError)return console['error'](_0x12d267(0x1cb)+_0x19ad0a['message']),_0x19ad0a['cause']&&console[_0x12d267(0x1dd)](_0x12d267(0x1b5)+_0x19ad0a[_0x12d267(0x179)]),0x1;throw _0x19ad0a;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a32_0x4580ee(0x1ac);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1aa);async['execute'](_0x5c6a88){const _0x3c8653=a32_0x4580ee,{options:_0x5ba02d,args:_0x5f05fc,tdx:_0x3e46e7}=_0x5c6a88;let _0x545001,_0x5e1773;if(_0x5f05fc[0x0]){const _0x337581=_0x5f05fc[0x0][_0x3c8653(0x1fb)]('.');if(_0x337581[_0x3c8653(0x1a6)]===0x1)_0x545001=_0x337581[0x0];else{if(_0x337581[_0x3c8653(0x1a6)]===0x2)[_0x545001,_0x5e1773]=_0x337581;else return console['error'](_0x3c8653(0x1db)),0x1;}}try{const _0x4d2593=_0x5ba02d[_0x3c8653(0x17a)];if(_0x5ba02d[_0x3c8653(0x1d1)]){if(_0x545001&&_0x5e1773)console[_0x3c8653(0x1dd)](_0x3c8653(0x1ab)+_0x545001+'.'+_0x5e1773);else _0x545001&&console['error'](_0x3c8653(0x1df)+_0x545001);_0x4d2593&&console['error'](_0x3c8653(0x1f6));}const _0x779020=await withSpinner(_0x3c8653(0x189),()=>_0x3e46e7[_0x3c8653(0x1d9)][_0x3c8653(0x1ba)]({'projectName':_0x545001,'workflowName':_0x5e1773,'includeRetried':_0x4d2593,'limit':_0x5ba02d['limit']}),{'verbose':_0x5ba02d[_0x3c8653(0x1d1)]}),_0x1b1ce0=_0x779020[_0x3c8653(0x199)];return console[_0x3c8653(0x1dd)](_0x3c8653(0x1a3)+_0x1b1ce0['length']+_0x3c8653(0x1f8)+(_0x1b1ce0['length']!==0x1?'s':'')),await handleSDKOutput(_0x1b1ce0,_0x5ba02d),0x0;}catch(_0x2f06a1){if(_0x2f06a1 instanceof SDKError)return console[_0x3c8653(0x1dd)](_0x3c8653(0x1cb)+_0x2f06a1['message']),_0x2f06a1[_0x3c8653(0x179)]&&console[_0x3c8653(0x1dd)](_0x3c8653(0x1b5)+_0x2f06a1[_0x3c8653(0x179)]),0x1;throw _0x2f06a1;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x1b9);[a32_0x4580ee(0x18a)]='Show\x20specific\x20attempt\x20details';async[a32_0x4580ee(0x17d)](_0x57b273){const _0x184a7a=a32_0x4580ee,{options:_0x45c2a4,args:_0x3a3ea3,tdx:_0x236516}=_0x57b273,_0x72f76a=_0x3a3ea3[0x0];if(!_0x72f76a)return console[_0x184a7a(0x1dd)](_0x184a7a(0x1ce)),0x1;try{_0x45c2a4[_0x184a7a(0x1d1)]&&console[_0x184a7a(0x1dd)]('Attempt\x20ID:\x20'+_0x72f76a);const _0x393d52=await withSpinner(_0x184a7a(0x1bc),()=>_0x236516[_0x184a7a(0x1d9)][_0x184a7a(0x18b)](_0x72f76a),{'verbose':_0x45c2a4[_0x184a7a(0x1d1)]}),_0x2743b2=_0x393d52[_0x184a7a(0x199)];return await handleSDKOutput([_0x2743b2],_0x45c2a4),0x0;}catch(_0x514e93){if(_0x514e93 instanceof SDKError)return console['error'](_0x184a7a(0x1cb)+_0x514e93[_0x184a7a(0x191)]),_0x514e93[_0x184a7a(0x179)]&&console[_0x184a7a(0x1dd)](_0x184a7a(0x1b5)+_0x514e93[_0x184a7a(0x179)]),0x1;throw _0x514e93;}}}function a32_0x267e(_0x26aad9,_0x2e9996){const _0x583e7b=a32_0x583e();return a32_0x267e=function(_0x267ece,_0xf90018){_0x267ece=_0x267ece-0x173;let _0xb4a06a=_0x583e7b[_0x267ece];return _0xb4a06a;},a32_0x267e(_0x26aad9,_0x2e9996);}export class WorkflowTasksCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x1b8);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x184);async[a32_0x4580ee(0x17d)](_0x4022ea){const _0x64cdcb=a32_0x4580ee,{options:_0x10f0db,args:_0x458d9b,tdx:_0x128920}=_0x4022ea,_0x385b70=_0x458d9b[0x0];if(!_0x385b70)return console['error'](_0x64cdcb(0x1ce)),0x1;try{const _0x2d8824=_0x10f0db[_0x64cdcb(0x196)];_0x10f0db[_0x64cdcb(0x1d1)]&&(console[_0x64cdcb(0x1dd)](_0x64cdcb(0x183)+_0x385b70),_0x2d8824&&console[_0x64cdcb(0x1dd)]('Including\x20subtasks:\x20yes'));const _0x68361b=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x128920['workflow'][_0x64cdcb(0x1a5)](_0x385b70,_0x2d8824||![]),{'verbose':_0x10f0db[_0x64cdcb(0x1d1)]}),_0xd0d796=_0x68361b['data'];return console[_0x64cdcb(0x1dd)](_0x64cdcb(0x1a3)+_0xd0d796[_0x64cdcb(0x1a6)]+_0x64cdcb(0x187)+(_0xd0d796[_0x64cdcb(0x1a6)]!==0x1?'s':'')),await handleSDKOutput(_0xd0d796,_0x10f0db),0x0;}catch(_0x36aab3){if(_0x36aab3 instanceof SDKError)return console[_0x64cdcb(0x1dd)](_0x64cdcb(0x1cb)+_0x36aab3[_0x64cdcb(0x191)]),_0x36aab3['cause']&&console[_0x64cdcb(0x1dd)](_0x64cdcb(0x1b5)+_0x36aab3[_0x64cdcb(0x179)]),0x1;throw _0x36aab3;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x19d);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x180);async[a32_0x4580ee(0x17d)](_0x438959){const _0x49d900=a32_0x4580ee,{options:_0x4c5f3b,args:_0x4c0e66,tdx:_0x4128f0}=_0x438959,_0x2b07b4=_0x4c0e66[0x0],_0x2ae2b6=_0x4c0e66[0x1];if(!_0x2b07b4||!_0x2ae2b6)return console['error'](_0x49d900(0x18c)),0x1;try{_0x4c5f3b['verbose']&&(console[_0x49d900(0x1dd)](_0x49d900(0x183)+_0x2b07b4),console[_0x49d900(0x1dd)](_0x49d900(0x186)+_0x2ae2b6));const _0x24f333=_0x4c5f3b['offset'],_0x3a3874=await withSpinner(_0x49d900(0x1c3),()=>_0x4128f0[_0x49d900(0x1d9)][_0x49d900(0x1eb)](_0x2b07b4,_0x2ae2b6,{'offset':_0x24f333,'limit':_0x4c5f3b['limit']}),{'verbose':_0x4c5f3b[_0x49d900(0x1d1)]}),_0x3477d3=_0x3a3874[_0x49d900(0x199)];return console[_0x49d900(0x1dd)](_0x49d900(0x1a3)+_0x3477d3[_0x49d900(0x1a6)]+_0x49d900(0x19a)+(_0x3477d3[_0x49d900(0x1a6)]!==0x1?_0x49d900(0x1f9):'y')),await handleSDKOutput(_0x3477d3,_0x4c5f3b),0x0;}catch(_0x3e9032){if(_0x3e9032 instanceof SDKError)return console[_0x49d900(0x1dd)](_0x49d900(0x1cb)+_0x3e9032['message']),_0x3e9032[_0x49d900(0x179)]&&console[_0x49d900(0x1dd)](_0x49d900(0x1b5)+_0x3e9032['cause']),0x1;throw _0x3e9032;}}}function a32_0x583e(){const _0x458448=['Error:\x20Project\x20name\x20is\x20required','✔\x20Pushed\x20','List\x20workflow\x20attempts','Filter:\x20','workflow:attempts','yes','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Reason:\x20','retryAttempt','Validation:\x20skipped','skipValidation','workflow:delete','\x20\x20Cause:\x20','workflow:projects','reason','workflow:tasks','workflow:attempt','attempts','\x20is\x20not\x20a\x20directory','Getting\x20attempt\x20details...','projectId','Project\x20filter:\x20','Cancelled','70744FdmXuJ','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Pattern:\x20','Getting\x20task\x20logs...','5538684yGprCz','resumeFrom','startsWith','projectName','workflow:kill','14QsUiHA','\x20\x20Project\x20ID:\x20','Error:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:\x20Attempt\x20ID\x20is\x20required','from','1673624yNBVxc','verbose','\x20workflow','stat','fs/promises','isDirectory','\x20\x20New\x20attempt\x20ID:\x20','Project\x20name:\x20','workflow:retry','workflow','session:','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','status','error','params','Filter:\x20project=','fromTask','Project\x20directory:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','filesExtracted','22rlnyZv','push','Params:\x20','workflow:download','Retrying\x20attempt...','Pushing\x20workflow\x20project...','Listing\x20workflow\x20sessions...','logs','projects','retrySession','12rONXuL','limit','Listing\x20workflows...','714785YGwGxD','List\x20workflow\x20execution\x20sessions','Kill\x20a\x20running\x20attempt','\x20session','1727052vgHRzm','Include\x20retried:\x20yes','Retry\x20a\x20session\x20or\x20attempt','\x20attempt','ies','Project:\x20','split','✔\x20Deleted\x20project\x20','workflows','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','...','workflow:push','Force:\x20yes','name','cause','includeRetried','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','revision','execute','\x20\x20Location:\x20','Status:\x20','Show\x20logs\x20for\x20a\x20specific\x20task','utf-8','Resume\x20from:\x20','Attempt\x20ID:\x20','Show\x20tasks\x20for\x20an\x20attempt','✔\x20Downloaded\x20','Task\x20name:\x20','\x20task','substring','Listing\x20workflow\x20attempts...','description','attempt','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','Output\x20directory:\x20','List\x20workflows','delete','Downloading\x20project\x20','message','download','Deleting\x20project\x20','attempt:','36DWpQhm','includeSubtasks','parse','session','data','\x20log\x20entr','Revision:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:logs','218850EAefuT','4689010VoIHlA','sessions','2amVQmR','\x20\x20Revision:\x20','✔\x20Found\x20','\x20project','tasks','length','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'];a32_0x583e=function(){return _0x458448;};return a32_0x583e();}export class WorkflowKillCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x1c8);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1f3);async[a32_0x4580ee(0x17d)](_0x25f53e){const _0x322b15=a32_0x4580ee,{options:_0x32293e,args:_0x55bec7,tdx:_0x14fa95}=_0x25f53e,_0x2bf901=_0x55bec7[0x0];if(!_0x2bf901)return console[_0x322b15(0x1dd)](_0x322b15(0x1ce)),0x1;try{const _0x2ae250=_0x32293e[_0x322b15(0x1b7)];_0x32293e['verbose']&&(console[_0x322b15(0x1dd)](_0x322b15(0x183)+_0x2bf901),_0x2ae250&&console['error'](_0x322b15(0x1b0)+_0x2ae250));if(!_0x32293e[_0x322b15(0x1ad)]){const _0x5cd021=await confirm(_0x322b15(0x174)+_0x2bf901+'?');if(!_0x5cd021)return console[_0x322b15(0x1dd)]('Cancelled'),0x0;}const _0xcb2989=await withSpinner('Killing\x20attempt...',()=>_0x14fa95['workflow']['kill'](_0x2bf901,_0x2ae250),{'verbose':_0x32293e[_0x322b15(0x1d1)]}),_0x4f94e3=_0xcb2989[_0x322b15(0x199)];return console[_0x322b15(0x1dd)]('✔\x20'+_0x4f94e3),0x0;}catch(_0x5d29da){if(_0x5d29da instanceof SDKError)return console[_0x322b15(0x1dd)]('Error:\x20'+_0x5d29da[_0x322b15(0x191)]),_0x5d29da[_0x322b15(0x179)]&&console[_0x322b15(0x1dd)](_0x322b15(0x1b5)+_0x5d29da[_0x322b15(0x179)]),0x1;throw _0x5d29da;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x4580ee(0x1d8);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1f7);async[a32_0x4580ee(0x17d)](_0x4ab6bc){const _0x3a9e45=a32_0x4580ee,{options:_0x274d81,args:_0x426970,tdx:_0x15172c}=_0x4ab6bc,_0x354e1b=_0x426970[0x0];if(!_0x354e1b)return console[_0x3a9e45(0x1dd)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3a9e45(0x1dd)](_0x3a9e45(0x19c)),0x1;let _0x2dc01e=![],_0x5f0063=_0x354e1b;if(_0x354e1b[_0x3a9e45(0x1c6)](_0x3a9e45(0x1da)))_0x2dc01e=!![],_0x5f0063=_0x354e1b[_0x3a9e45(0x188)](0x8);else{if(_0x354e1b[_0x3a9e45(0x1c6)](_0x3a9e45(0x194)))_0x2dc01e=![],_0x5f0063=_0x354e1b[_0x3a9e45(0x188)](0x8);else return console[_0x3a9e45(0x1dd)](_0x3a9e45(0x17b)),console[_0x3a9e45(0x1dd)](_0x3a9e45(0x19c)),0x1;}try{const _0x534513=_0x274d81[_0x3a9e45(0x1e0)],_0x1d57a2=_0x274d81[_0x3a9e45(0x1c5)],_0x5343e9=_0x274d81[_0x3a9e45(0x1de)],_0x321218=_0x274d81['force'];_0x274d81['verbose']&&(console[_0x3a9e45(0x1dd)]('Target:\x20'+(_0x2dc01e?'session':_0x3a9e45(0x18b))+'\x20'+_0x5f0063),_0x534513&&console['error']('From\x20task:\x20'+_0x534513),_0x1d57a2&&console[_0x3a9e45(0x1dd)](_0x3a9e45(0x182)+_0x1d57a2),_0x5343e9&&console[_0x3a9e45(0x1dd)](_0x3a9e45(0x1e6)+_0x5343e9),_0x321218&&console[_0x3a9e45(0x1dd)](_0x3a9e45(0x177)));let _0x1969d3;if(_0x5343e9)try{if(_0x5343e9[_0x3a9e45(0x1c6)]('@')){const _0x523525=await import(_0x3a9e45(0x1d4)),_0x4be7b5=_0x5343e9[_0x3a9e45(0x188)](0x1),_0x29b5e1=await _0x523525['readFile'](_0x4be7b5,_0x3a9e45(0x181));_0x1969d3=JSON[_0x3a9e45(0x197)](_0x29b5e1);}else _0x1969d3=JSON['parse'](_0x5343e9);}catch{return console[_0x3a9e45(0x1dd)](_0x3a9e45(0x1cc)),0x1;}if(!_0x274d81[_0x3a9e45(0x1ad)]){const _0x24505c=await confirm(_0x3a9e45(0x1af)+(_0x2dc01e?_0x3a9e45(0x198):_0x3a9e45(0x18b))+'\x20'+_0x5f0063+'?');if(!_0x24505c)return console[_0x3a9e45(0x1dd)]('Cancelled'),0x0;}let _0x2e1811;_0x2dc01e?_0x2e1811=await withSpinner('Retrying\x20session...',()=>_0x15172c[_0x3a9e45(0x1d9)][_0x3a9e45(0x1ed)](_0x5f0063,{'fromTask':_0x534513,'retryParams':_0x1969d3}),{'verbose':_0x274d81[_0x3a9e45(0x1d1)]}):_0x2e1811=await withSpinner(_0x3a9e45(0x1e8),()=>_0x15172c['workflow'][_0x3a9e45(0x1b1)](_0x5f0063,{'resumeFrom':_0x1d57a2,'retryParams':_0x1969d3,'force':_0x321218}),{'verbose':_0x274d81[_0x3a9e45(0x1d1)]});const _0x25c90e=_0x2e1811[_0x3a9e45(0x199)];return console[_0x3a9e45(0x1dd)]('✔\x20Retry\x20started'),console[_0x3a9e45(0x1dd)](_0x3a9e45(0x1d6)+_0x25c90e['attemptId']),console[_0x3a9e45(0x1dd)]('\x20\x20Session\x20ID:\x20'+_0x25c90e['sessionId']),0x0;}catch(_0x21510b){if(_0x21510b instanceof SDKError)return console['error'](_0x3a9e45(0x1cb)+_0x21510b[_0x3a9e45(0x191)]),_0x21510b[_0x3a9e45(0x179)]&&console[_0x3a9e45(0x1dd)]('\x20\x20Cause:\x20'+_0x21510b[_0x3a9e45(0x179)]),0x1;throw _0x21510b;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x4580ee(0x1e7);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1c1);async[a32_0x4580ee(0x17d)](_0x534480){const _0x5e2da7=a32_0x4580ee,{options:_0x161722,args:_0x2fb3ee,tdx:_0x501481}=_0x534480,_0x20f1ce=_0x2fb3ee[0x0],_0x5ae72d=_0x2fb3ee[0x1]||'.';if(!_0x20f1ce)return console[_0x5e2da7(0x1dd)](_0x5e2da7(0x1a8)),console['error'](_0x5e2da7(0x1ae)),0x1;const _0x534ca3=_0x161722['revision'];_0x161722[_0x5e2da7(0x1d1)]&&(console[_0x5e2da7(0x1dd)]('Project:\x20'+_0x20f1ce),console['error'](_0x5e2da7(0x18d)+_0x5ae72d),_0x534ca3&&console[_0x5e2da7(0x1dd)]('Revision:\x20'+_0x534ca3));const _0x3e3a7e=await withSpinner(_0x5e2da7(0x190)+_0x20f1ce+_0x5e2da7(0x175),()=>_0x501481[_0x5e2da7(0x1d9)][_0x5e2da7(0x192)](_0x20f1ce,_0x5ae72d,{'revision':_0x534ca3}),{'verbose':_0x161722[_0x5e2da7(0x1d1)]}),_0x1931d9=_0x3e3a7e[_0x5e2da7(0x199)];return console[_0x5e2da7(0x1dd)](_0x5e2da7(0x185)+_0x1931d9[_0x5e2da7(0x1c7)]),console[_0x5e2da7(0x1dd)]('\x20\x20Revision:\x20'+_0x1931d9[_0x5e2da7(0x17c)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x1931d9[_0x5e2da7(0x1e3)]),console[_0x5e2da7(0x1dd)](_0x5e2da7(0x17e)+_0x5ae72d+'/'+_0x1931d9[_0x5e2da7(0x1c7)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x176);[a32_0x4580ee(0x18a)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a32_0x4580ee(0x17d)](_0x73a31){const _0x52be1e=a32_0x4580ee,{options:_0x2c50af,args:_0xfabb92,tdx:_0x2b41cf}=_0x73a31;let _0x435bb6='.',_0x362e86=_0x2c50af[_0x52be1e(0x178)];if(_0xfabb92[0x0]){const {promises:_0x2a56ce}=await import('fs');try{const _0xa9b061=await _0x2a56ce[_0x52be1e(0x1d3)](_0xfabb92[0x0]);if(_0xa9b061[_0x52be1e(0x1d5)]())_0x435bb6=_0xfabb92[0x0];else return console[_0x52be1e(0x1dd)]('Error:\x20'+_0xfabb92[0x0]+_0x52be1e(0x1bb)),0x1;}catch{_0x362e86=_0xfabb92[0x0],_0x435bb6='.';}}const _0x59a6d4=_0x2c50af[_0x52be1e(0x17c)],_0x32a792=_0x2c50af[_0x52be1e(0x1b3)];_0x2c50af['verbose']&&(console[_0x52be1e(0x1dd)](_0x52be1e(0x1e1)+_0x435bb6),_0x362e86&&console[_0x52be1e(0x1dd)](_0x52be1e(0x1d7)+_0x362e86),_0x59a6d4&&console['error'](_0x52be1e(0x19b)+_0x59a6d4),_0x32a792&&console['error'](_0x52be1e(0x1b2)));const _0x38d87d=await withSpinner(_0x52be1e(0x1e9),()=>_0x2b41cf[_0x52be1e(0x1d9)][_0x52be1e(0x1e5)](_0x435bb6,{'projectName':_0x362e86,'revision':_0x59a6d4,'skipValidation':_0x32a792}),{'verbose':_0x2c50af[_0x52be1e(0x1d1)]}),_0x112b1f=_0x38d87d[_0x52be1e(0x199)];return console[_0x52be1e(0x1dd)](_0x52be1e(0x1a9)+_0x112b1f['projectName']),console[_0x52be1e(0x1dd)]('\x20\x20Project\x20ID:\x20'+_0x112b1f[_0x52be1e(0x1bd)]),console[_0x52be1e(0x1dd)](_0x52be1e(0x1a2)+_0x112b1f['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a32_0x4580ee(0x1b4);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1e2);async[a32_0x4580ee(0x17d)](_0x1492ee){const _0x2e797d=a32_0x4580ee,{options:_0xc48492,args:_0x1256f8,tdx:_0x549ea5}=_0x1492ee,_0x611f88=_0x1256f8[0x0];if(!_0x611f88)return console['error'](_0x2e797d(0x1a7)),console[_0x2e797d(0x1dd)](_0x2e797d(0x1cd)),0x1;_0xc48492[_0x2e797d(0x1d1)]&&console[_0x2e797d(0x1dd)](_0x2e797d(0x1fa)+_0x611f88);if(!_0xc48492['yes']){const _0x42a990=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x611f88+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x42a990)return console[_0x2e797d(0x1dd)](_0x2e797d(0x1bf)),0x0;}const _0x1c06ec=await withSpinner(_0x2e797d(0x193)+_0x611f88+_0x2e797d(0x175),()=>_0x549ea5[_0x2e797d(0x1d9)][_0x2e797d(0x18f)](_0x611f88),{'verbose':_0xc48492['verbose']}),_0x22e196=_0x1c06ec[_0x2e797d(0x199)];return console[_0x2e797d(0x1dd)](_0x2e797d(0x1fc)+_0x22e196[_0x2e797d(0x1c7)]),console['error'](_0x2e797d(0x1ca)+_0x22e196[_0x2e797d(0x1bd)]),0x0;}}
|
|
1
|
+
const a32_0x316af0=a32_0x5e8d;(function(_0x487ce0,_0x4fb9f9){const _0x4314a6=a32_0x5e8d,_0x4fbfe0=_0x487ce0();while(!![]){try{const _0xaac1dd=-parseInt(_0x4314a6(0xcd))/0x1+-parseInt(_0x4314a6(0x115))/0x2+-parseInt(_0x4314a6(0xc5))/0x3*(parseInt(_0x4314a6(0x103))/0x4)+-parseInt(_0x4314a6(0xba))/0x5+-parseInt(_0x4314a6(0xe6))/0x6+-parseInt(_0x4314a6(0x114))/0x7*(-parseInt(_0x4314a6(0x11c))/0x8)+-parseInt(_0x4314a6(0xbd))/0x9*(-parseInt(_0x4314a6(0xe8))/0xa);if(_0xaac1dd===_0x4fb9f9)break;else _0x4fbfe0['push'](_0x4fbfe0['shift']());}catch(_0x2e1678){_0x4fbfe0['push'](_0x4fbfe0['shift']());}}}(a32_0x7370,0xbf8ca));function a32_0x7370(){const _0x48ebef=['kill','\x20\x20Project\x20ID:\x20','attemptId','Task\x20name:\x20','data','3613800ePuWjU','Pushing\x20workflow\x20project...','\x20workflow','18HVQTIw','Show\x20specific\x20attempt\x20details','Cancelled','retryAttempt','attempt','stat','logs','\x20attempt','289353IFCtXN','...','Filter:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','verbose','workflow:download','Resume\x20from:\x20','\x20is\x20not\x20a\x20directory','1027229rBWNfK','params','fs/promises','✔\x20Found\x20','Project\x20directory:\x20','ies','Revision:\x20','workflow:retry','revision','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Retry\x20a\x20session\x20or\x20attempt','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','session:','attempts','cause','Usage:\x20workflow:delete\x20<project-name-or-id>','workflow:workflows','projectId','Params:\x20','parse','✔\x20Pushed\x20','Kill\x20a\x20running\x20attempt','Including\x20subtasks:\x20yes','description','workflows','1804086fzniul','Show\x20logs\x20for\x20a\x20specific\x20task','8320100qpEiLZ','Project\x20filter:\x20','workflow:delete','status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Project:\x20','session','delete','Validation:\x20skipped','List\x20workflow\x20attempts','workflow:tasks','\x20\x20Session\x20ID:\x20','Reason:\x20','workflow:attempt','name','\x20\x20Revision:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20project','from','startsWith','Retrying\x20attempt...','workflow:projects','Project\x20name:\x20','Retrying\x20session...','Filter:\x20project=','sessionId','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','12dtuOrQ','Status:\x20','\x20log\x20entr','List\x20workflow\x20execution\x20sessions','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Downloading\x20project\x20','projects','skipValidation','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','yes','substring','limit','tasks','execute','download','retrySession','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','28532zQhPaW','21694TWVDpe','Error:\x20','\x20\x20Cause:\x20','resumeFrom','\x20\x20Location:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:attempts','2888qnXouj','error','message','Killing\x20attempt...','offset','List\x20workflows','Listing\x20workflow\x20projects...','includeSubtasks','\x20task','Getting\x20attempt\x20details...','force','\x20\x20Files\x20extracted:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow','List\x20all\x20workflow\x20projects','Error:\x20Attempt\x20ID\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Deleted\x20project\x20','split','Attempt\x20ID:\x20','length','projectName','✔\x20Retry\x20started','readFile'];a32_0x7370=function(){return _0x48ebef;};return a32_0x7370();}function a32_0x5e8d(_0x4307e2,_0xf7cf5){const _0x7370f2=a32_0x7370();return a32_0x5e8d=function(_0x5e8de7,_0x13b922){_0x5e8de7=_0x5e8de7-0xb3;let _0x41101b=_0x7370f2[_0x5e8de7];return _0x41101b;},a32_0x5e8d(_0x4307e2,_0xf7cf5);}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{['name']=a32_0x316af0(0xfd);['description']=a32_0x316af0(0x12a);async[a32_0x316af0(0x110)](_0x2050ef){const _0x2cb9d5=a32_0x316af0,{options:_0x9e7b5b,args:_0x4311f8,tdx:_0x1fc6cc}=_0x2050ef,_0x5949bc=_0x4311f8[0x0];try{_0x9e7b5b[_0x2cb9d5(0xc9)]&&_0x5949bc&&console['error']('Pattern:\x20'+_0x5949bc);const _0x10bab1=await withSpinner(_0x2cb9d5(0x122),()=>_0x1fc6cc[_0x2cb9d5(0x129)][_0x2cb9d5(0x109)](_0x5949bc,{'limit':_0x9e7b5b[_0x2cb9d5(0x10e)]}),{'verbose':_0x9e7b5b[_0x2cb9d5(0xc9)]}),_0x405660=_0x10bab1[_0x2cb9d5(0xb9)];return console[_0x2cb9d5(0x11d)](_0x2cb9d5(0xd0)+_0x405660[_0x2cb9d5(0x130)]+_0x2cb9d5(0xf9)+(_0x405660['length']!==0x1?'s':'')),await handleSDKOutput(_0x405660,_0x9e7b5b),0x0;}catch(_0x58ac07){if(_0x58ac07 instanceof SDKError)return console[_0x2cb9d5(0x11d)](_0x2cb9d5(0x116)+_0x58ac07[_0x2cb9d5(0x11e)]),_0x58ac07['cause']&&console[_0x2cb9d5(0x11d)]('\x20\x20Cause:\x20'+_0x58ac07[_0x2cb9d5(0xdb)]),0x1;throw _0x58ac07;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xdd);[a32_0x316af0(0xe4)]=a32_0x316af0(0x121);async['execute'](_0x101d43){const _0x471b83=a32_0x316af0,{options:_0xd34849,args:_0x10b2c4,tdx:_0xfa0d55}=_0x101d43,_0x3fcc7e=_0x10b2c4[0x0];try{_0xd34849[_0x471b83(0xc9)]&&_0x3fcc7e&&console[_0x471b83(0x11d)](_0x471b83(0xe9)+_0x3fcc7e);const _0x469066=await withSpinner('Listing\x20workflows...',()=>_0xfa0d55[_0x471b83(0x129)][_0x471b83(0xe5)](_0x3fcc7e,{'limit':_0xd34849[_0x471b83(0x10e)]}),{'verbose':_0xd34849['verbose']}),_0x20af73=_0x469066[_0x471b83(0xb9)];return console[_0x471b83(0x11d)](_0x471b83(0xd0)+_0x20af73[_0x471b83(0x130)]+_0x471b83(0xbc)+(_0x20af73[_0x471b83(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x20af73,_0xd34849),0x0;}catch(_0x3b170b){if(_0x3b170b instanceof SDKError)return console['error'](_0x471b83(0x116)+_0x3b170b['message']),_0x3b170b[_0x471b83(0xdb)]&&console[_0x471b83(0x11d)](_0x471b83(0x117)+_0x3b170b[_0x471b83(0xdb)]),0x1;throw _0x3b170b;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';[a32_0x316af0(0xe4)]=a32_0x316af0(0x106);async[a32_0x316af0(0x110)](_0x5eb038){const _0x5a4e6e=a32_0x316af0,{options:_0x3064de,args:_0x2e00e0,tdx:_0x4845a7}=_0x5eb038;let _0x5708fe,_0xbc4cda;if(_0x2e00e0[0x0]){const _0x13017d=_0x2e00e0[0x0]['split']('.');if(_0x13017d[_0x5a4e6e(0x130)]===0x1)_0x5708fe=_0x13017d[0x0];else{if(_0x13017d[_0x5a4e6e(0x130)]===0x2)[_0x5708fe,_0xbc4cda]=_0x13017d;else return console[_0x5a4e6e(0x11d)](_0x5a4e6e(0x10b)),0x1;}}try{if(_0x3064de[_0x5a4e6e(0xc9)]){if(_0x5708fe&&_0xbc4cda)console['error']('Filter:\x20'+_0x5708fe+'.'+_0xbc4cda);else _0x5708fe&&console['error']('Filter:\x20project='+_0x5708fe);const _0x45c159=_0x3064de[_0x5a4e6e(0xeb)];_0x45c159&&console[_0x5a4e6e(0x11d)](_0x5a4e6e(0x104)+_0x45c159);}const _0x24caa5=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x4845a7['workflow']['sessions']({'projectName':_0x5708fe,'workflowName':_0xbc4cda,'status':_0x3064de['status'],'fromTime':_0x3064de[_0x5a4e6e(0xfa)],'toTime':_0x3064de['to'],'limit':_0x3064de['limit']}),{'verbose':_0x3064de[_0x5a4e6e(0xc9)]}),_0x3c6573=_0x24caa5[_0x5a4e6e(0xb9)];return console[_0x5a4e6e(0x11d)]('✔\x20Found\x20'+_0x3c6573[_0x5a4e6e(0x130)]+'\x20session'+(_0x3c6573[_0x5a4e6e(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x3c6573,_0x3064de),0x0;}catch(_0x3c161e){if(_0x3c161e instanceof SDKError)return console['error'](_0x5a4e6e(0x116)+_0x3c161e[_0x5a4e6e(0x11e)]),_0x3c161e['cause']&&console[_0x5a4e6e(0x11d)](_0x5a4e6e(0x117)+_0x3c161e['cause']),0x1;throw _0x3c161e;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0x11b);['description']=a32_0x316af0(0xf1);async[a32_0x316af0(0x110)](_0x4975b0){const _0x4e12ab=a32_0x316af0,{options:_0x5b60be,args:_0x405dc1,tdx:_0x7af3e3}=_0x4975b0;let _0xda83ab,_0x3af5d5;if(_0x405dc1[0x0]){const _0x578853=_0x405dc1[0x0][_0x4e12ab(0x12e)]('.');if(_0x578853[_0x4e12ab(0x130)]===0x1)_0xda83ab=_0x578853[0x0];else{if(_0x578853[_0x4e12ab(0x130)]===0x2)[_0xda83ab,_0x3af5d5]=_0x578853;else return console[_0x4e12ab(0x11d)](_0x4e12ab(0x10b)),0x1;}}try{const _0x2cf557=_0x5b60be['includeRetried'];if(_0x5b60be[_0x4e12ab(0xc9)]){if(_0xda83ab&&_0x3af5d5)console[_0x4e12ab(0x11d)](_0x4e12ab(0xc7)+_0xda83ab+'.'+_0x3af5d5);else _0xda83ab&&console[_0x4e12ab(0x11d)](_0x4e12ab(0x100)+_0xda83ab);_0x2cf557&&console[_0x4e12ab(0x11d)]('Include\x20retried:\x20yes');}const _0x33c63b=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x7af3e3[_0x4e12ab(0x129)][_0x4e12ab(0xda)]({'projectName':_0xda83ab,'workflowName':_0x3af5d5,'includeRetried':_0x2cf557,'limit':_0x5b60be[_0x4e12ab(0x10e)]}),{'verbose':_0x5b60be[_0x4e12ab(0xc9)]}),_0x421868=_0x33c63b[_0x4e12ab(0xb9)];return console[_0x4e12ab(0x11d)](_0x4e12ab(0xd0)+_0x421868[_0x4e12ab(0x130)]+_0x4e12ab(0xc4)+(_0x421868[_0x4e12ab(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x421868,_0x5b60be),0x0;}catch(_0x4712de){if(_0x4712de instanceof SDKError)return console[_0x4e12ab(0x11d)](_0x4e12ab(0x116)+_0x4712de[_0x4e12ab(0x11e)]),_0x4712de['cause']&&console[_0x4e12ab(0x11d)](_0x4e12ab(0x117)+_0x4712de[_0x4e12ab(0xdb)]),0x1;throw _0x4712de;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xf5);[a32_0x316af0(0xe4)]=a32_0x316af0(0xbe);async['execute'](_0x5e4335){const _0x28a989=a32_0x316af0,{options:_0x3253bb,args:_0x52905d,tdx:_0x363fb0}=_0x5e4335,_0xeba356=_0x52905d[0x0];if(!_0xeba356)return console[_0x28a989(0x11d)](_0x28a989(0x12b)),0x1;try{_0x3253bb[_0x28a989(0xc9)]&&console[_0x28a989(0x11d)](_0x28a989(0x12f)+_0xeba356);const _0x49b039=await withSpinner(_0x28a989(0x125),()=>_0x363fb0[_0x28a989(0x129)][_0x28a989(0xc1)](_0xeba356),{'verbose':_0x3253bb[_0x28a989(0xc9)]}),_0x501bdc=_0x49b039[_0x28a989(0xb9)];return await handleSDKOutput([_0x501bdc],_0x3253bb),0x0;}catch(_0xecf5e1){if(_0xecf5e1 instanceof SDKError)return console['error']('Error:\x20'+_0xecf5e1[_0x28a989(0x11e)]),_0xecf5e1[_0x28a989(0xdb)]&&console[_0x28a989(0x11d)]('\x20\x20Cause:\x20'+_0xecf5e1[_0x28a989(0xdb)]),0x1;throw _0xecf5e1;}}}export class WorkflowTasksCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xf2);['description']='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x6cd323){const _0x2f41ac=a32_0x316af0,{options:_0x219a11,args:_0x227378,tdx:_0x46ba0c}=_0x6cd323,_0x3ecaf6=_0x227378[0x0];if(!_0x3ecaf6)return console['error'](_0x2f41ac(0x12b)),0x1;try{const _0x2444b7=_0x219a11[_0x2f41ac(0x123)];_0x219a11[_0x2f41ac(0xc9)]&&(console[_0x2f41ac(0x11d)](_0x2f41ac(0x12f)+_0x3ecaf6),_0x2444b7&&console['error'](_0x2f41ac(0xe3)));const _0x5109ef=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x46ba0c[_0x2f41ac(0x129)][_0x2f41ac(0x10f)](_0x3ecaf6,_0x2444b7||![]),{'verbose':_0x219a11[_0x2f41ac(0xc9)]}),_0x29e1da=_0x5109ef[_0x2f41ac(0xb9)];return console[_0x2f41ac(0x11d)](_0x2f41ac(0xd0)+_0x29e1da['length']+_0x2f41ac(0x124)+(_0x29e1da[_0x2f41ac(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x29e1da,_0x219a11),0x0;}catch(_0x359216){if(_0x359216 instanceof SDKError)return console[_0x2f41ac(0x11d)](_0x2f41ac(0x116)+_0x359216[_0x2f41ac(0x11e)]),_0x359216[_0x2f41ac(0xdb)]&&console[_0x2f41ac(0x11d)]('\x20\x20Cause:\x20'+_0x359216[_0x2f41ac(0xdb)]),0x1;throw _0x359216;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x316af0(0xf6)]='workflow:logs';[a32_0x316af0(0xe4)]=a32_0x316af0(0xe7);async[a32_0x316af0(0x110)](_0x1bf65b){const _0x47cf21=a32_0x316af0,{options:_0x5785c2,args:_0x2d107d,tdx:_0x4276c2}=_0x1bf65b,_0x22bd08=_0x2d107d[0x0],_0x3685df=_0x2d107d[0x1];if(!_0x22bd08||!_0x3685df)return console[_0x47cf21(0x11d)](_0x47cf21(0xd8)),0x1;try{_0x5785c2[_0x47cf21(0xc9)]&&(console[_0x47cf21(0x11d)](_0x47cf21(0x12f)+_0x22bd08),console[_0x47cf21(0x11d)](_0x47cf21(0xb8)+_0x3685df));const _0xea347=_0x5785c2[_0x47cf21(0x120)],_0x5348c2=await withSpinner('Getting\x20task\x20logs...',()=>_0x4276c2['workflow'][_0x47cf21(0xc3)](_0x22bd08,_0x3685df,{'offset':_0xea347,'limit':_0x5785c2[_0x47cf21(0x10e)]}),{'verbose':_0x5785c2[_0x47cf21(0xc9)]}),_0x44aabb=_0x5348c2['data'];return console[_0x47cf21(0x11d)]('✔\x20Found\x20'+_0x44aabb[_0x47cf21(0x130)]+_0x47cf21(0x105)+(_0x44aabb[_0x47cf21(0x130)]!==0x1?_0x47cf21(0xd2):'y')),await handleSDKOutput(_0x44aabb,_0x5785c2),0x0;}catch(_0x3fbc23){if(_0x3fbc23 instanceof SDKError)return console[_0x47cf21(0x11d)](_0x47cf21(0x116)+_0x3fbc23[_0x47cf21(0x11e)]),_0x3fbc23[_0x47cf21(0xdb)]&&console[_0x47cf21(0x11d)](_0x47cf21(0x117)+_0x3fbc23['cause']),0x1;throw _0x3fbc23;}}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a32_0x316af0(0xe4)]=a32_0x316af0(0xe2);async[a32_0x316af0(0x110)](_0x6d8a6b){const _0x3eef29=a32_0x316af0,{options:_0x3eb46f,args:_0x158a21,tdx:_0x3a30ea}=_0x6d8a6b,_0x484f1a=_0x158a21[0x0];if(!_0x484f1a)return console[_0x3eef29(0x11d)](_0x3eef29(0x12b)),0x1;try{const _0x42ef9e=_0x3eb46f['reason'];_0x3eb46f['verbose']&&(console[_0x3eef29(0x11d)](_0x3eef29(0x12f)+_0x484f1a),_0x42ef9e&&console[_0x3eef29(0x11d)](_0x3eef29(0xf4)+_0x42ef9e));if(!_0x3eb46f[_0x3eef29(0x10c)]){const _0x475f5b=await confirm(_0x3eef29(0xec)+_0x484f1a+'?');if(!_0x475f5b)return console[_0x3eef29(0x11d)](_0x3eef29(0xbf)),0x0;}const _0x5284e2=await withSpinner(_0x3eef29(0x11f),()=>_0x3a30ea[_0x3eef29(0x129)][_0x3eef29(0xb5)](_0x484f1a,_0x42ef9e),{'verbose':_0x3eb46f['verbose']}),_0x142ce8=_0x5284e2[_0x3eef29(0xb9)];return console[_0x3eef29(0x11d)]('✔\x20'+_0x142ce8),0x0;}catch(_0x1a5a68){if(_0x1a5a68 instanceof SDKError)return console['error'](_0x3eef29(0x116)+_0x1a5a68['message']),_0x1a5a68['cause']&&console[_0x3eef29(0x11d)](_0x3eef29(0x117)+_0x1a5a68[_0x3eef29(0xdb)]),0x1;throw _0x1a5a68;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x316af0(0xd4);[a32_0x316af0(0xe4)]=a32_0x316af0(0xd7);async[a32_0x316af0(0x110)](_0x12a087){const _0x1f3a5d=a32_0x316af0,{options:_0x561ac2,args:_0x28a179,tdx:_0x141174}=_0x12a087,_0x510fc7=_0x28a179[0x0];if(!_0x510fc7)return console[_0x1f3a5d(0x11d)](_0x1f3a5d(0x113)),console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xd6)),0x1;let _0xff224d=![],_0x3d9552=_0x510fc7;if(_0x510fc7[_0x1f3a5d(0xfb)](_0x1f3a5d(0xd9)))_0xff224d=!![],_0x3d9552=_0x510fc7[_0x1f3a5d(0x10d)](0x8);else{if(_0x510fc7[_0x1f3a5d(0xfb)]('attempt:'))_0xff224d=![],_0x3d9552=_0x510fc7[_0x1f3a5d(0x10d)](0x8);else return console[_0x1f3a5d(0x11d)](_0x1f3a5d(0x107)),console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xd6)),0x1;}try{const _0x588993=_0x561ac2['fromTask'],_0x355a46=_0x561ac2[_0x1f3a5d(0x118)],_0x29d00c=_0x561ac2[_0x1f3a5d(0xce)],_0x352448=_0x561ac2[_0x1f3a5d(0x126)];_0x561ac2[_0x1f3a5d(0xc9)]&&(console[_0x1f3a5d(0x11d)]('Target:\x20'+(_0xff224d?_0x1f3a5d(0xee):_0x1f3a5d(0xc1))+'\x20'+_0x3d9552),_0x588993&&console[_0x1f3a5d(0x11d)]('From\x20task:\x20'+_0x588993),_0x355a46&&console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xcb)+_0x355a46),_0x29d00c&&console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xdf)+_0x29d00c),_0x352448&&console[_0x1f3a5d(0x11d)]('Force:\x20yes'));let _0xe0aa4f;if(_0x29d00c)try{if(_0x29d00c[_0x1f3a5d(0xfb)]('@')){const _0x1354f2=await import(_0x1f3a5d(0xcf)),_0x76531f=_0x29d00c[_0x1f3a5d(0x10d)](0x1),_0x35b42e=await _0x1354f2[_0x1f3a5d(0xb4)](_0x76531f,'utf-8');_0xe0aa4f=JSON[_0x1f3a5d(0xe0)](_0x35b42e);}else _0xe0aa4f=JSON[_0x1f3a5d(0xe0)](_0x29d00c);}catch{return console[_0x1f3a5d(0x11d)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x561ac2[_0x1f3a5d(0x10c)]){const _0x1f0940=await confirm(_0x1f3a5d(0x11a)+(_0xff224d?'session':_0x1f3a5d(0xc1))+'\x20'+_0x3d9552+'?');if(!_0x1f0940)return console[_0x1f3a5d(0x11d)]('Cancelled'),0x0;}let _0x46759f;_0xff224d?_0x46759f=await withSpinner(_0x1f3a5d(0xff),()=>_0x141174['workflow'][_0x1f3a5d(0x112)](_0x3d9552,{'fromTask':_0x588993,'retryParams':_0xe0aa4f}),{'verbose':_0x561ac2[_0x1f3a5d(0xc9)]}):_0x46759f=await withSpinner(_0x1f3a5d(0xfc),()=>_0x141174[_0x1f3a5d(0x129)][_0x1f3a5d(0xc0)](_0x3d9552,{'resumeFrom':_0x355a46,'retryParams':_0xe0aa4f,'force':_0x352448}),{'verbose':_0x561ac2['verbose']});const _0x6b1251=_0x46759f[_0x1f3a5d(0xb9)];return console['error'](_0x1f3a5d(0xb3)),console[_0x1f3a5d(0x11d)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x6b1251[_0x1f3a5d(0xb7)]),console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xf3)+_0x6b1251[_0x1f3a5d(0x101)]),0x0;}catch(_0x5f11c1){if(_0x5f11c1 instanceof SDKError)return console['error'](_0x1f3a5d(0x116)+_0x5f11c1['message']),_0x5f11c1[_0x1f3a5d(0xdb)]&&console[_0x1f3a5d(0x11d)]('\x20\x20Cause:\x20'+_0x5f11c1[_0x1f3a5d(0xdb)]),0x1;throw _0x5f11c1;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xca);[a32_0x316af0(0xe4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x316af0(0x110)](_0x2ad1fc){const _0x561784=a32_0x316af0,{options:_0x553a3a,args:_0x41c8d5,tdx:_0x22586e}=_0x2ad1fc,_0x3610bb=_0x41c8d5[0x0],_0x344ade=_0x41c8d5[0x1]||'.';if(!_0x3610bb)return console[_0x561784(0x11d)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x561784(0x11d)](_0x561784(0xf8)),0x1;const _0x4adef5=_0x553a3a[_0x561784(0xd5)];_0x553a3a[_0x561784(0xc9)]&&(console[_0x561784(0x11d)](_0x561784(0xed)+_0x3610bb),console[_0x561784(0x11d)]('Output\x20directory:\x20'+_0x344ade),_0x4adef5&&console[_0x561784(0x11d)](_0x561784(0xd3)+_0x4adef5));const _0x3236ca=await withSpinner(_0x561784(0x108)+_0x3610bb+_0x561784(0xc6),()=>_0x22586e[_0x561784(0x129)][_0x561784(0x111)](_0x3610bb,_0x344ade,{'revision':_0x4adef5}),{'verbose':_0x553a3a['verbose']}),_0x28f603=_0x3236ca[_0x561784(0xb9)];return console['error']('✔\x20Downloaded\x20'+_0x28f603['projectName']),console[_0x561784(0x11d)](_0x561784(0xf7)+_0x28f603['revision']),console[_0x561784(0x11d)](_0x561784(0x127)+_0x28f603['filesExtracted']),console[_0x561784(0x11d)](_0x561784(0x119)+_0x344ade+'/'+_0x28f603['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';['description']=a32_0x316af0(0x102);async[a32_0x316af0(0x110)](_0x4761d8){const _0x4934ba=a32_0x316af0,{options:_0x1f3569,args:_0x95ae3e,tdx:_0x21a692}=_0x4761d8;let _0x132ee7='.',_0x5681f4=_0x1f3569[_0x4934ba(0xf6)];if(_0x95ae3e[0x0]){const {promises:_0x1bb73e}=await import('fs');try{const _0x499c32=await _0x1bb73e[_0x4934ba(0xc2)](_0x95ae3e[0x0]);if(_0x499c32['isDirectory']())_0x132ee7=_0x95ae3e[0x0];else return console[_0x4934ba(0x11d)](_0x4934ba(0x116)+_0x95ae3e[0x0]+_0x4934ba(0xcc)),0x1;}catch{_0x5681f4=_0x95ae3e[0x0],_0x132ee7='.';}}const _0x10c58e=_0x1f3569[_0x4934ba(0xd5)],_0x17fcf2=_0x1f3569[_0x4934ba(0x10a)];_0x1f3569['verbose']&&(console[_0x4934ba(0x11d)](_0x4934ba(0xd1)+_0x132ee7),_0x5681f4&&console[_0x4934ba(0x11d)](_0x4934ba(0xfe)+_0x5681f4),_0x10c58e&&console['error'](_0x4934ba(0xd3)+_0x10c58e),_0x17fcf2&&console[_0x4934ba(0x11d)](_0x4934ba(0xf0)));const _0x7e07d7=await withSpinner(_0x4934ba(0xbb),()=>_0x21a692[_0x4934ba(0x129)]['push'](_0x132ee7,{'projectName':_0x5681f4,'revision':_0x10c58e,'skipValidation':_0x17fcf2}),{'verbose':_0x1f3569[_0x4934ba(0xc9)]}),_0x16e0c0=_0x7e07d7[_0x4934ba(0xb9)];return console[_0x4934ba(0x11d)](_0x4934ba(0xe1)+_0x16e0c0[_0x4934ba(0x131)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x16e0c0[_0x4934ba(0xde)]),console[_0x4934ba(0x11d)](_0x4934ba(0xf7)+_0x16e0c0['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xea);[a32_0x316af0(0xe4)]=a32_0x316af0(0x128);async[a32_0x316af0(0x110)](_0x3ded61){const _0x1371ee=a32_0x316af0,{options:_0x2db1e6,args:_0x922e79,tdx:_0x4e525d}=_0x3ded61,_0x1c4856=_0x922e79[0x0];if(!_0x1c4856)return console['error'](_0x1371ee(0x12c)),console[_0x1371ee(0x11d)](_0x1371ee(0xdc)),0x1;_0x2db1e6['verbose']&&console[_0x1371ee(0x11d)](_0x1371ee(0xed)+_0x1c4856);if(!_0x2db1e6[_0x1371ee(0x10c)]){const _0x5e359f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x1c4856+_0x1371ee(0xc8));if(!_0x5e359f)return console['error'](_0x1371ee(0xbf)),0x0;}const _0x48278e=await withSpinner('Deleting\x20project\x20'+_0x1c4856+_0x1371ee(0xc6),()=>_0x4e525d[_0x1371ee(0x129)][_0x1371ee(0xef)](_0x1c4856),{'verbose':_0x2db1e6[_0x1371ee(0xc9)]}),_0x3ecaba=_0x48278e[_0x1371ee(0xb9)];return console[_0x1371ee(0x11d)](_0x1371ee(0x12d)+_0x3ecaba[_0x1371ee(0x131)]),console[_0x1371ee(0x11d)](_0x1371ee(0xb6)+_0x3ecaba[_0x1371ee(0xde)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2e96f2,_0x5898cb){const _0x11a6bf=a33_0x31db,_0x1e0e08=_0x2e96f2();while(!![]){try{const _0x396794=-parseInt(_0x11a6bf(0x133))/0x1+-parseInt(_0x11a6bf(0x135))/0x2*(parseInt(_0x11a6bf(0x129))/0x3)+parseInt(_0x11a6bf(0x132))/0x4*(-parseInt(_0x11a6bf(0x12a))/0x5)+-parseInt(_0x11a6bf(0x128))/0x6*(parseInt(_0x11a6bf(0x12e))/0x7)+parseInt(_0x11a6bf(0x131))/0x8+-parseInt(_0x11a6bf(0x123))/0x9*(parseInt(_0x11a6bf(0x130))/0xa)+-parseInt(_0x11a6bf(0x127))/0xb*(-parseInt(_0x11a6bf(0x124))/0xc);if(_0x396794===_0x5898cb)break;else _0x1e0e08['push'](_0x1e0e08['shift']());}catch(_0xd384a1){_0x1e0e08['push'](_0x1e0e08['shift']());}}}(a33_0x2ad6,0xd1cef));function a33_0x2ad6(){const _0x497496=['182FBeJHH','version','parse','Authorization','1071JNpKuj','26868eSboID','TD1\x20','utf-8','23265rMYCkW','1181406rMEGOf','36291aTwAOM','3577855sanmuh','replace','entries',';\x20node/','49uxJRrh','../../package.json','143370gjGPCZ','9117592UfCIpj','4yICUFB','115001NYmRAZ','tdx'];a33_0x2ad6=function(){return _0x497496;};return a33_0x2ad6();}import{platform}from'os';import{readFileSync}from'fs';function a33_0x31db(_0x43f288,_0x5b0bdc){const _0x2ad6b4=a33_0x2ad6();return a33_0x31db=function(_0x31dba3,_0x3670bc){_0x31dba3=_0x31dba3-0x123;let _0x1da6f0=_0x2ad6b4[_0x31dba3];return _0x1da6f0;},a33_0x31db(_0x43f288,_0x5b0bdc);}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x2ae2dd=a33_0x31db;try{const _0x3fe9ab=fileURLToPath(import.meta['url']),_0x2180be=dirname(_0x3fe9ab),_0x21fdbf=join(_0x2180be,_0x2ae2dd(0x12f)),_0x4fc09e=JSON[_0x2ae2dd(0x137)](readFileSync(_0x21fdbf,_0x2ae2dd(0x126)));return _0x4fc09e[_0x2ae2dd(0x136)];}catch{return'0.0.0';}}export function getUserAgent(){const _0x18345a=a33_0x31db,_0x2f433f=getVersion(),_0x68405f=platform(),_0x5a02c9=process[_0x18345a(0x136)][_0x18345a(0x12b)]('v','');return'tdx/'+_0x2f433f+'\x20('+_0x68405f+_0x18345a(0x12d)+_0x5a02c9+')';}export function getAuthHeaders(_0x3857f6,_0x3225a1){const _0x2f07d0=a33_0x31db,_0xaebdcc=getVersion(),_0x2caa18={'User-Agent':getUserAgent(),'X-TD-Client':_0x2f07d0(0x134),'X-TD-Client-Version':_0xaebdcc};return _0x3225a1&&(_0x2caa18['Authorization']=_0x2f07d0(0x125)+_0x3225a1),_0x2caa18;}export function toHeaderRecord(_0x1aa17b){const _0x49d0c2=a33_0x31db,_0x21232b={};for(const [_0x2e9ee1,_0x5f164b]of Object[_0x49d0c2(0x12c)](_0x1aa17b)){_0x5f164b!==undefined&&(_0x21232b[_0x2e9ee1]=_0x5f164b);}return _0x21232b;}export function getTrinoHeaders(_0x595f2f,_0x51310c){const _0x2aa491=a33_0x31db,_0x19ead9=getAuthHeaders(_0x595f2f,_0x51310c),_0x4915e6=toHeaderRecord(_0x19ead9);return delete _0x4915e6[_0x2aa491(0x138)],_0x51310c&&(_0x4915e6['X-Trino-User']=_0x51310c),_0x4915e6;}export function hasAPIKey(_0x14d825){const _0x389c1f=getAPIKey(_0x14d825);return _0x389c1f!==undefined&&_0x389c1f['length']>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fa4b6,_0x5d0eae){const _0x12948f=a34_0x5602,_0x3211bb=_0x1fa4b6();while(!![]){try{const _0x5f0ec6=parseInt(_0x12948f(0x1f0))/0x1*(parseInt(_0x12948f(0x1d1))/0x2)+parseInt(_0x12948f(0x1c2))/0x3+parseInt(_0x12948f(0x1c1))/0x4+-parseInt(_0x12948f(0x1c8))/0x5+parseInt(_0x12948f(0x1ca))/0x6*(-parseInt(_0x12948f(0x1f1))/0x7)+-parseInt(_0x12948f(0x1bf))/0x8+-parseInt(_0x12948f(0x1e3))/0x9*(-parseInt(_0x12948f(0x1e4))/0xa);if(_0x5f0ec6===_0x5d0eae)break;else _0x3211bb['push'](_0x3211bb['shift']());}catch(_0x49f8cb){_0x3211bb['push'](_0x3211bb['shift']());}}}(a34_0x46fe,0x3cbcf));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x132a27 from'node:fs';import*as a34_0x5aa37b from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x285a5f=a34_0x5602;return process[_0x285a5f(0x1ef)]['TDX_CONFIG_DIR']||join(homedir(),_0x285a5f(0x1ec),_0x285a5f(0x1eb));}export function getConfigFile(){const _0x2743f5=a34_0x5602;return join(getConfigDir(),_0x2743f5(0x1dc));}export function getCacheDir(){const _0x5766e7=a34_0x5602;return process[_0x5766e7(0x1ef)][_0x5766e7(0x1c7)]||join(homedir(),'.cache',_0x5766e7(0x1eb));}function a34_0x46fe(){const _0x4cf528=['TD_API_KEY','Warning:\x20Failed\x20to\x20load\x20','readFileSync','stg-jp01','stg-ap03','34680xfYHWB','us01','global:\x20','\x27,\x20defaulting\x20to\x20us01','dev-us01','warn','endsWith','map','llm_default_project','error','dev-eu01','.env','trim','slice','utf-8','apiKeys','Warning:\x20Unknown\x20site\x20\x27','ap03','2369061rwFLDI','10OhsoxG','jp01','.env.','tdx.json','env:\x20','toUpperCase','entries','tdx','.config','includes','TD_API_KEY_','env','12roSHGC','84OupPci','join','startsWith','2132584rzzuGC','existsSync','1107448rVolyK','636486JHIQNp','env:\x20TD_API_KEY','replace','profiles','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','TDX_CACHE_DIR','687625WRVNPm','split','153726LXNaZz','profile:\x20'];a34_0x46fe=function(){return _0x4cf528;};return a34_0x46fe();}export function getLLMProjectCacheFile(){const _0x32339f=a34_0x5602;return join(getCacheDir(),_0x32339f(0x1d9));}export function readCachedLLMProject(){const _0x55efcc=a34_0x5602;try{const _0x350916=getLLMProjectCacheFile();if(!existsSync(_0x350916))return null;return readFileSync(_0x350916,_0x55efcc(0x1df))['trim']();}catch{return null;}}export function writeCachedLLMProject(_0x56ea60){const _0x41ac4f=a34_0x5602;try{const _0x28fc7c=getCacheDir(),_0x1e353c=getLLMProjectCacheFile();!existsSync(_0x28fc7c)&&mkdirSync(_0x28fc7c,{'recursive':!![]}),writeFileSync(_0x1e353c,_0x56ea60,'utf-8');}catch(_0x4f5798){console[_0x41ac4f(0x1da)]('Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:',_0x4f5798);}}export function parseEnvFile(_0xb7c46b){const _0x1803c4=a34_0x5602,_0x75a0c7={};for(const _0x3f7bca of _0xb7c46b[_0x1803c4(0x1c9)]('\x0a')){const _0x5f4b74=_0x3f7bca[_0x1803c4(0x1dd)]();if(!_0x5f4b74||_0x5f4b74[_0x1803c4(0x1be)]('#'))continue;const _0x39aae9=_0x5f4b74['match'](/^([^=]+)=(.*)$/);if(_0x39aae9){const _0x263ee=_0x39aae9[0x1][_0x1803c4(0x1dd)]();let _0x1d3c6e=_0x39aae9[0x2][_0x1803c4(0x1dd)]();(_0x1d3c6e[_0x1803c4(0x1be)]('\x22')&&_0x1d3c6e[_0x1803c4(0x1d7)]('\x22')||_0x1d3c6e[_0x1803c4(0x1be)]('\x27')&&_0x1d3c6e[_0x1803c4(0x1d7)]('\x27'))&&(_0x1d3c6e=_0x1d3c6e[_0x1803c4(0x1de)](0x1,-0x1)),_0x75a0c7[_0x263ee]=_0x1d3c6e;}}return _0x75a0c7;}export function readUserConfig(){const _0x5105a4=a34_0x5602,_0x20de75=getConfigFile();if(!existsSync(_0x20de75))return{};try{const _0x338294=readFileSync(_0x20de75,_0x5105a4(0x1df));return parseEnvFile(_0x338294);}catch(_0x1576c9){return console['warn'](_0x5105a4(0x1c6)+_0x20de75+':',_0x1576c9),{};}}export function resolveSite(_0x519794){const _0x4c4c1d=a34_0x5602,_0x18d6be=[_0x4c4c1d(0x1d2),_0x4c4c1d(0x1e5),'eu01','ap02',_0x4c4c1d(0x1e2),_0x4c4c1d(0x1d5),_0x4c4c1d(0x1db),'stg-us01',_0x4c4c1d(0x1cf),'stg-ap03'];if(_0x18d6be[_0x4c4c1d(0x1ed)](_0x519794))return _0x519794;if(_0x519794 in SITE_ALIASES)return SITE_ALIASES[_0x519794];return console['warn'](_0x4c4c1d(0x1e1)+_0x519794+_0x4c4c1d(0x1d4)),_0x4c4c1d(0x1d2);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x51a627,_0x23fa04){const _0x42cdad=a34_0x5602,_0xbf30f3=_0x51a627['toUpperCase']()[_0x42cdad(0x1c4)](/-/g,'_'),_0x4b4918=_0x42cdad(0x1ee)+_0xbf30f3;if(process[_0x42cdad(0x1ef)][_0x4b4918])return process[_0x42cdad(0x1ef)][_0x4b4918];if(process[_0x42cdad(0x1ef)]['TD_API_KEY'])return process['env']['TD_API_KEY'];const _0x18fe17=_0x23fa04||getActiveProfileName();if(_0x18fe17){const _0x1d3180=loadProfileEnv(_0x18fe17);if(_0x1d3180){if(_0x1d3180[_0x4b4918])return _0x1d3180[_0x4b4918];if(_0x1d3180[_0x42cdad(0x1cc)])return _0x1d3180[_0x42cdad(0x1cc)];}}const _0x1c3cee=loadUserConfigOnce();if(_0x1c3cee[_0x4b4918])return _0x1c3cee[_0x4b4918];if(_0x1c3cee[_0x42cdad(0x1cc)])return _0x1c3cee[_0x42cdad(0x1cc)];return undefined;}export function getAPIKeySource(_0x3eba14,_0x3ac7ef){const _0x359632=a34_0x5602,_0x258545=_0x359632(0x1ee)+_0x3eba14[_0x359632(0x1e9)]()['replace'](/-/g,'_');if(process[_0x359632(0x1ef)][_0x258545])return _0x359632(0x1e8)+_0x258545;if(process[_0x359632(0x1ef)][_0x359632(0x1cc)])return _0x359632(0x1c3);const _0x2c2f9b=_0x3ac7ef||getActiveProfileName();if(_0x2c2f9b){const _0x597140=loadProfileEnv(_0x2c2f9b);if(_0x597140){if(_0x597140[_0x258545])return _0x359632(0x1cb)+_0x2c2f9b+'\x20('+_0x258545+')';if(_0x597140['TD_API_KEY'])return'profile:\x20'+_0x2c2f9b+'\x20(TD_API_KEY)';}}const _0x130034=loadUserConfigOnce(),_0x875443=getConfigFile();if(_0x130034[_0x258545])return _0x359632(0x1d3)+_0x875443+'\x20('+_0x258545+')';if(_0x130034['TD_API_KEY'])return _0x359632(0x1d3)+_0x875443+'\x20(TD_API_KEY)';return null;}function loadProfileEnv(_0x1ad7f9){const _0x28b5fa=a34_0x5602,_0x3b85c2=a34_0x5aa37b[_0x28b5fa(0x1bd)](getConfigDir(),_0x28b5fa(0x1e6)+_0x1ad7f9);if(a34_0x132a27[_0x28b5fa(0x1c0)](_0x3b85c2)){validateSecureFilePermissions(_0x3b85c2);try{const _0x8f2c22=a34_0x132a27[_0x28b5fa(0x1ce)](_0x3b85c2,'utf-8');return parseEnvFile(_0x8f2c22);}catch(_0x5220ab){console['warn'](_0x28b5fa(0x1cd)+_0x3b85c2+':\x20'+_0x5220ab);}}const _0x536c5a=a34_0x5aa37b[_0x28b5fa(0x1bd)](getConfigDir(),_0x28b5fa(0x1c5),_0x1ad7f9,_0x28b5fa(0x1dc));if(a34_0x132a27[_0x28b5fa(0x1c0)](_0x536c5a)){validateSecureFilePermissions(_0x536c5a);try{const _0x55b4a2=a34_0x132a27['readFileSync'](_0x536c5a,_0x28b5fa(0x1df));return parseEnvFile(_0x55b4a2);}catch(_0x58f0aa){return console[_0x28b5fa(0x1d6)](_0x28b5fa(0x1cd)+_0x536c5a+':\x20'+_0x58f0aa),null;}}return null;}function getActiveProfileName(){const _0x18949a=a34_0x5602,_0x1312a0=a34_0x5aa37b[_0x18949a(0x1bd)](getConfigDir(),_0x18949a(0x1e7));if(!a34_0x132a27[_0x18949a(0x1c0)](_0x1312a0))return null;try{const _0x45e681=a34_0x132a27[_0x18949a(0x1ce)](_0x1312a0,_0x18949a(0x1df)),_0x2995a8=JSON['parse'](_0x45e681);return _0x2995a8['profile']||null;}catch{return null;}}function a34_0x5602(_0x30106b,_0x252b46){const _0x46fed7=a34_0x46fe();return a34_0x5602=function(_0x56023e,_0x1516ee){_0x56023e=_0x56023e-0x1bd;let _0xfc9141=_0x46fed7[_0x56023e];return _0xfc9141;},a34_0x5602(_0x30106b,_0x252b46);}export function saveAPIKey(_0x4cbbe1,_0x22a239){const _0x39d715=a34_0x5602,_0x5119c7=getConfigDir(),_0x76852=getConfigFile();!existsSync(_0x5119c7)&&mkdirSync(_0x5119c7,{'recursive':!![],'mode':0x1c0});const _0x5e911f=readUserConfig(),_0x93399a=_0x4cbbe1['toUpperCase']()['replace'](/-/g,'_');_0x5e911f['TD_API_KEY_'+_0x93399a]=_0x22a239;const _0x1145f5=Object[_0x39d715(0x1ea)](_0x5e911f)[_0x39d715(0x1d8)](([_0x383916,_0x338011])=>_0x383916+'='+_0x338011);writeFileSync(_0x76852,_0x1145f5[_0x39d715(0x1bd)]('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x25b6f7=a34_0x5602,_0x244479={'apiKeys':{},'defaultSite':'us01'},_0x5574b7=[_0x25b6f7(0x1d2),_0x25b6f7(0x1e5),'eu01','ap02',_0x25b6f7(0x1e2),_0x25b6f7(0x1d5),'dev-eu01','stg-us01',_0x25b6f7(0x1cf),_0x25b6f7(0x1d0)];for(const _0x2213bf of _0x5574b7){const _0x92bf53=getAPIKey(_0x2213bf);_0x92bf53&&(_0x244479[_0x25b6f7(0x1e0)][_0x2213bf]=_0x92bf53);}return _0x244479;}
|