@treasuredata/tdx 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.d.ts +86 -1
- package/dist/client/llm-api-client.d.ts.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/llm-api-client.js.map +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.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-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/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/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +60 -3
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/llm.d.ts +187 -6
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.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
|
-
function
|
|
1
|
+
const a38_0x97a0ef=a38_0x39ef;(function(_0xb9143d,_0x2d530b){const _0x20fa87=a38_0x39ef,_0x1d8d7e=_0xb9143d();while(!![]){try{const _0xfb810a=parseInt(_0x20fa87(0x118))/0x1+-parseInt(_0x20fa87(0x117))/0x2+parseInt(_0x20fa87(0xef))/0x3+parseInt(_0x20fa87(0x116))/0x4+-parseInt(_0x20fa87(0xf4))/0x5*(-parseInt(_0x20fa87(0xf3))/0x6)+-parseInt(_0x20fa87(0xfe))/0x7+-parseInt(_0x20fa87(0x11d))/0x8*(parseInt(_0x20fa87(0x10c))/0x9);if(_0xfb810a===_0x2d530b)break;else _0x1d8d7e['push'](_0x1d8d7e['shift']());}catch(_0x117611){_0x1d8d7e['push'](_0x1d8d7e['shift']());}}}(a38_0x56d5,0x9b576));import{existsSync,statSync}from'fs';import a38_0x1e9cf8 from'chalk';function a38_0x56d5(){const _0x4c5d3d=['parentId','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use:\x20tdx\x20segment\x20use\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','split','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Examples:','verbose','1624544hEFYBe','130082ulbzYY','466769rIZsEO','red','cyan','segments','Site:\x20','180328FfEDrv','segmentPath','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segment','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','log','isAbsolute','join','Resolved\x20relative\x20path\x20to:\x20','data','Target\x20path:\x20','description','1456569XjWKIh','type','Error:\x20Path\x20is\x20required\x0a','✔\x20Context\x20set\x20to:\x20','91068MLtnRa','50oszQyf','length','folderId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','error','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','dim','execute','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','green','3926566pZoitz','Resolved\x20path\x20type:\x20','slice','fullPath','segment:use','parent_segment','site','\x27...','Folder\x20ID:\x20','session','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','99byFuDv'];a38_0x56d5=function(){return _0x4c5d3d;};return a38_0x56d5();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';function a38_0x39ef(_0x3f564c,_0x2c746c){_0x3f564c=_0x3f564c-0xed;const _0x56d5d6=a38_0x56d5();let _0x39efb7=_0x56d5d6[_0x3f564c];return _0x39efb7;}export class SegmentUseCommand extends BaseCommand{['name']=a38_0x97a0ef(0x102);[a38_0x97a0ef(0xee)]=a38_0x97a0ef(0x111);async[a38_0x97a0ef(0xfb)](_0x18d9d4){const _0x15f08e=a38_0x97a0ef,{options:_0x3570ea,args:_0x4d8dab,tdx:_0x2f30a2}=_0x18d9d4;if(_0x4d8dab[_0x15f08e(0xf5)]===0x0)return console[_0x15f08e(0xf8)](a38_0x1e9cf8['red'](_0x15f08e(0xf1))),console[_0x15f08e(0xf8)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x15f08e(0xf8)](_0x15f08e(0x114)),console['error'](_0x15f08e(0x122)),console[_0x15f08e(0xf8)](_0x15f08e(0xf7)),console[_0x15f08e(0xf8)](_0x15f08e(0x108)),console[_0x15f08e(0xf8)](_0x15f08e(0x10e)),0x1;const _0x436fc7=_0x4d8dab[0x0],_0x3e3efb=_0x3570ea[_0x15f08e(0x107)];try{if(_0x436fc7==='/')return saveSessionContext({'segment_path':undefined},_0x3e3efb),console[_0x15f08e(0x123)](a38_0x1e9cf8['green'](_0x15f08e(0x109))),0x0;if(existsSync(_0x436fc7)&&statSync(_0x436fc7)['isDirectory']()){let _0x5dcf9e;try{_0x5dcf9e=findTdxConfig(_0x436fc7);}catch{return console[_0x15f08e(0xf8)](a38_0x1e9cf8[_0x15f08e(0x119)](_0x15f08e(0x11f)+_0x436fc7)),console['error'](a38_0x1e9cf8[_0x15f08e(0x11a)](_0x15f08e(0x10f))),0x1;}const _0x285caf=_0x5dcf9e['config'][_0x15f08e(0x103)];return saveSessionContext({'segment_path':_0x285caf,'parent_segment':_0x285caf},_0x3e3efb),console[_0x15f08e(0x123)](a38_0x1e9cf8[_0x15f08e(0xfd)](_0x15f08e(0xf2)+a38_0x1e9cf8[_0x15f08e(0x11a)](_0x285caf))),0x0;}const _0x552bf2=_0x3570ea[_0x15f08e(0x11e)];let _0x381871=_0x436fc7;const _0x160ecf=parsePath(_0x436fc7);if(!_0x160ecf[_0x15f08e(0x124)]){if(!_0x552bf2)return console[_0x15f08e(0xf8)](a38_0x1e9cf8[_0x15f08e(0x119)](_0x15f08e(0x10a))),console[_0x15f08e(0xf8)](a38_0x1e9cf8['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x436fc7==='..'){const _0x3dcd70=_0x552bf2[_0x15f08e(0x112)]('/')[_0x15f08e(0x100)](0x0,-0x1)[_0x15f08e(0x125)]('/');_0x381871=_0x3dcd70||'/';}else _0x436fc7==='.'?_0x381871=_0x552bf2:_0x381871=_0x552bf2+'/'+_0x436fc7;_0x3570ea['verbose']&&console[_0x15f08e(0xf8)](_0x15f08e(0x126)+_0x381871);}if(_0x381871==='/'||_0x381871==='')return saveSessionContext({'segment_path':undefined},_0x3e3efb),console['log'](a38_0x1e9cf8[_0x15f08e(0xfd)](_0x15f08e(0x109))),0x0;_0x381871=normalizePath(_0x381871);const _0x22818b=parsePath(_0x381871)[_0x15f08e(0x11b)];if(_0x22818b[_0x15f08e(0xf5)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3e3efb),console[_0x15f08e(0x123)](a38_0x1e9cf8['green'](_0x15f08e(0x109))),0x0;_0x3570ea[_0x15f08e(0x115)]&&(console[_0x15f08e(0xf8)](_0x15f08e(0x11c)+_0x3570ea[_0x15f08e(0x104)]),console[_0x15f08e(0xf8)](_0x15f08e(0xed)+_0x381871));const _0x14b184=await withSpinner('Resolving\x20path\x20\x27'+_0x381871+_0x15f08e(0x105),()=>_0x2f30a2[_0x15f08e(0x120)]['resolvePathToResource'](_0x381871),{'verbose':_0x3570ea[_0x15f08e(0x115)]}),_0x35618c=_0x14b184[_0x15f08e(0x127)];_0x3570ea[_0x15f08e(0x115)]&&(console[_0x15f08e(0xf8)](_0x15f08e(0xff)+_0x35618c[_0x15f08e(0xf0)]),console[_0x15f08e(0xf8)](_0x15f08e(0x121)+_0x35618c[_0x15f08e(0x10d)]),_0x35618c[_0x15f08e(0xf6)]&&console[_0x15f08e(0xf8)](_0x15f08e(0x106)+_0x35618c['folderId']));if(_0x35618c[_0x15f08e(0xf0)]===_0x15f08e(0x120))return console['error'](a38_0x1e9cf8[_0x15f08e(0x119)](_0x15f08e(0xf9))),console[_0x15f08e(0xf8)](_0x15f08e(0xfc)),console[_0x15f08e(0xf8)](a38_0x1e9cf8[_0x15f08e(0x11a)](_0x15f08e(0x110)+_0x35618c['parentName']+(_0x35618c['folderPath']?'/'+_0x35618c[_0x15f08e(0x10b)][_0x15f08e(0x125)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x35618c[_0x15f08e(0x101)],'parent_segment':_0x35618c['parentName']},_0x3e3efb),console[_0x15f08e(0x123)](a38_0x1e9cf8[_0x15f08e(0xfd)]('✔\x20Context\x20set\x20to:\x20'+a38_0x1e9cf8[_0x15f08e(0x11a)](_0x35618c[_0x15f08e(0x101)]))),_0x3570ea['verbose']&&(console[_0x15f08e(0xf8)](a38_0x1e9cf8[_0x15f08e(0xfa)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x15f08e(0xf8)](a38_0x1e9cf8['dim'](_0x15f08e(0x113)))),0x0;}catch(_0x23ee75){throw _0x23ee75;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x697b5a=a39_0x44fc;(function(_0x2ea0ea,_0x378ffa){const _0xd5da7e=a39_0x44fc,_0x19591f=_0x2ea0ea();while(!![]){try{const _0x91c5e5=-parseInt(_0xd5da7e(0x152))/0x1*(-parseInt(_0xd5da7e(0x18e))/0x2)+-parseInt(_0xd5da7e(0x16d))/0x3+-parseInt(_0xd5da7e(0x163))/0x4+parseInt(_0xd5da7e(0x16f))/0x5+-parseInt(_0xd5da7e(0x194))/0x6+parseInt(_0xd5da7e(0x184))/0x7*(parseInt(_0xd5da7e(0x16a))/0x8)+-parseInt(_0xd5da7e(0x180))/0x9*(parseInt(_0xd5da7e(0x157))/0xa);if(_0x91c5e5===_0x378ffa)break;else _0x19591f['push'](_0x19591f['shift']());}catch(_0x2935ff){_0x19591f['push'](_0x19591f['shift']());}}}(a39_0x532f,0x916f3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a39_0x44fc(_0x1b5f95,_0x24753b){_0x1b5f95=_0x1b5f95-0x151;const _0x532f11=a39_0x532f();let _0x44fc6d=_0x532f11[_0x1b5f95];return _0x44fc6d;}import{getConsoleNextUrl}from'../types/endpoints.js';function a39_0x532f(){const _0x40b4eb=['log','8WSNJlh','/j/da','listUnified','2630955GdgFXq','resolvePathToResource','1759070eueZAP','includes','all','name','Folder\x20ID:\x20','dim','site','Resolving\x20parent\x20segment\x20\x27','journeyBundleName','listWithPattern','No\x20items\x20match\x20pattern:\x20','\x20folder','Listing\x20folders,\x20segments,\x20and\x20journeys...','message','parentId','(not\x20set)','map','7452981kSABXD','Site:\x20','/app/ps/','sort','7859285cdWdnM','(empty)','cause','Error:\x20','\x27...','format','Resolving\x20path\x20\x27','Folder/pattern\x20arg:\x20','List\x20folders\x20and\x20child\x20segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','65214TRyCqZ','filter','\x20top-level\x20items','\x20journey','verbose','folder','728208lDClJX','segments','\x20segment','\x5c$&','length','test','journey','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','replace','33EDtbLm','jsonl','data','\x20matching\x20\x27','Parent\x20ID:\x20','10TmaAnt','json','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId',',\x20and\x20','segment','Building\x20hierarchy\x20tree...','listRecursive','listJourneysFromParentSegment',']\x20matching\x20\x27','maxDepth','error','513756ZNgDYi','recursive','execute','✔\x20Found\x20','web','/e/'];a39_0x532f=function(){return _0x40b4eb;};return a39_0x532f();}import a39_0x1bde1d from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x697b5a(0x195);['description']=a39_0x697b5a(0x18c);async[a39_0x697b5a(0x165)](_0xa5475c){const _0x1834dc=a39_0x697b5a,{options:_0x1992fd,args:_0x57780e}=_0xa5475c,_0x2f2fc9=_0x1992fd[_0x1834dc(0x164)],_0x1b0a34=_0x57780e[0x0];try{const _0x15e622=_0x1992fd['parentSegment'];_0x1992fd['verbose']&&(console['error'](_0x1834dc(0x181)+_0x1992fd['site']),console['error']('Parent\x20segment\x20context:\x20'+(_0x15e622||_0x1834dc(0x17e))),_0x1b0a34&&console[_0x1834dc(0x162)](_0x1834dc(0x18b)+_0x1b0a34),_0x2f2fc9&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x15e622)return console[_0x1834dc(0x162)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x1834dc(0x162)](_0x1834dc(0x159)),console[_0x1834dc(0x162)](_0x1834dc(0x19b)),console[_0x1834dc(0x162)](_0x1834dc(0x18d)),console['error'](''),console[_0x1834dc(0x162)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x33b7f3=_0x1b0a34&&(_0x1b0a34[_0x1834dc(0x170)]('*')||_0x1b0a34[_0x1834dc(0x170)]('?'));if(_0x33b7f3)return await this['listWithPattern'](_0xa5475c,_0x15e622,_0x1b0a34);const _0x2535af=_0x1b0a34?_0x15e622+'/'+_0x1b0a34:_0x15e622;return _0x2f2fc9?await this[_0x1834dc(0x15e)](_0xa5475c,_0x2535af):await this[_0x1834dc(0x16c)](_0xa5475c,_0x2535af);}catch(_0x5029b9){if(_0x5029b9 instanceof SDKError)return console['error'](_0x1834dc(0x187)+_0x5029b9[_0x1834dc(0x17c)]),_0x5029b9['cause']&&console[_0x1834dc(0x162)]('\x20\x20Cause:\x20'+_0x5029b9[_0x1834dc(0x186)]),0x1;throw _0x5029b9;}}async[a39_0x697b5a(0x178)](_0x1ce700,_0xe91400,_0x5259fa){const _0x4001e0=a39_0x697b5a,{options:_0x5a6e42,tdx:_0x4f5fb9}=_0x1ce700,_0x1916bc=_0x5a6e42[_0x4001e0(0x167)],_0x4c8fa9=await withSpinner(_0x4001e0(0x176)+_0xe91400+'\x27...',()=>_0x4f5fb9['segment'][_0x4001e0(0x16e)](_0xe91400),{'verbose':_0x5a6e42[_0x4001e0(0x192)]}),_0x3d164c=_0x4c8fa9[_0x4001e0(0x154)],_0x5458c6=await withSpinner(_0x4001e0(0x17b),()=>Promise[_0x4001e0(0x171)]([_0x4f5fb9[_0x4001e0(0x15c)][_0x4001e0(0x16c)](_0x3d164c[_0x4001e0(0x17d)],_0x3d164c[_0x4001e0(0x15a)]),_0x4f5fb9['journey'][_0x4001e0(0x15f)](_0x3d164c[_0x4001e0(0x17d)])]),{'verbose':_0x5a6e42[_0x4001e0(0x192)]}),[_0x1e0730,_0x6166f6]=_0x5458c6[_0x4001e0(0x154)],{folders:_0x3f01f2,segments:_0x23e937}=_0x1e0730,_0x237878=_0x5259fa[_0x4001e0(0x151)](/[.+^${}()|[\]\\]/g,_0x4001e0(0x197))[_0x4001e0(0x151)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2aaaa5=new RegExp('^'+_0x237878+'$','i'),_0x10bfee=_0x3f01f2[_0x4001e0(0x18f)](_0x545b3b=>_0x2aaaa5[_0x4001e0(0x199)](_0x545b3b['name'])),_0x2a3d4d=_0x23e937[_0x4001e0(0x18f)](_0x36d29a=>_0x2aaaa5[_0x4001e0(0x199)](_0x36d29a[_0x4001e0(0x172)])),_0x5d0421=_0x6166f6[_0x4001e0(0x18f)](_0x5c3419=>_0x2aaaa5['test'](_0x5c3419['journeyBundleName'])),_0x296de0=_0x10bfee[_0x4001e0(0x198)]+_0x2a3d4d[_0x4001e0(0x198)]+_0x5d0421[_0x4001e0(0x198)];console[_0x4001e0(0x162)](_0x4001e0(0x166)+_0x10bfee['length']+_0x4001e0(0x17a)+(_0x10bfee[_0x4001e0(0x198)]!==0x1?'s':'')+',\x20'+_0x2a3d4d[_0x4001e0(0x198)]+'\x20segment'+(_0x2a3d4d[_0x4001e0(0x198)]!==0x1?'s':'')+_0x4001e0(0x15b)+_0x5d0421[_0x4001e0(0x198)]+_0x4001e0(0x191)+(_0x5d0421[_0x4001e0(0x198)]!==0x1?'s':'')+_0x4001e0(0x155)+_0x5259fa+'\x27');const _0x27293e=_0x166ead=>{const _0x528c3e=_0x4001e0;return getConsoleNextUrl(_0x5a6e42['site'],_0x528c3e(0x182)+_0x3d164c['parentId']+_0x528c3e(0x168)+_0x166ead);},_0x12108b=_0x5a6e42[_0x4001e0(0x189)]===_0x4001e0(0x158)||_0x5a6e42[_0x4001e0(0x189)]===_0x4001e0(0x153);if(_0x12108b){const _0x48a013=[..._0x10bfee[_0x4001e0(0x17f)](_0x481d3f=>({..._0x481d3f,'type':_0x4001e0(0x193)})),..._0x2a3d4d[_0x4001e0(0x17f)](_0x42d664=>({..._0x42d664,'type':_0x4001e0(0x15c),'url':_0x27293e(_0x42d664['id'])})),..._0x5d0421['map'](_0x448859=>({..._0x448859,'name':_0x448859[_0x4001e0(0x177)],'type':_0x4001e0(0x19a)}))][_0x4001e0(0x183)]((_0x5e518c,_0x4e5c3f)=>_0x5e518c['name']['localeCompare'](_0x4e5c3f['name']));await handleSDKOutput(_0x48a013,_0x5a6e42);}else{if(_0x296de0===0x0)console[_0x4001e0(0x169)](_0x4001e0(0x179)+_0x5259fa);else{console[_0x4001e0(0x169)](a39_0x1bde1d['dim']('['+_0xe91400+_0x4001e0(0x160)+_0x5259fa+'\x27'));const _0x593691=formatFlatList(_0x10bfee,_0x2a3d4d,{'showMetadata':!![],'showUrl':_0x1916bc,'getSegmentUrl':_0x27293e},_0x5d0421);console['log'](_0x593691);}}return 0x0;}async[a39_0x697b5a(0x16c)](_0x5d7ea3,_0x23b020){const _0xe21f83=a39_0x697b5a,{options:_0x66cc3c,tdx:_0x13f0ba}=_0x5d7ea3,_0x4f40ae=_0x66cc3c['web'],_0x56ffcd=await withSpinner(_0xe21f83(0x18a)+_0x23b020+_0xe21f83(0x188),()=>_0x13f0ba['segment'][_0xe21f83(0x16e)](_0x23b020),{'verbose':_0x66cc3c[_0xe21f83(0x192)]}),_0x2a4295=_0x56ffcd['data'];_0x66cc3c[_0xe21f83(0x192)]&&(console[_0xe21f83(0x162)](_0xe21f83(0x156)+_0x2a4295[_0xe21f83(0x17d)]),_0x2a4295[_0xe21f83(0x15a)]&&console[_0xe21f83(0x162)](_0xe21f83(0x173)+_0x2a4295['folderId']));const _0x5c139a=await withSpinner(_0xe21f83(0x17b),()=>Promise[_0xe21f83(0x171)]([_0x13f0ba[_0xe21f83(0x15c)]['listUnified'](_0x2a4295['parentId'],_0x2a4295[_0xe21f83(0x15a)]),_0x13f0ba[_0xe21f83(0x19a)][_0xe21f83(0x15f)](_0x2a4295[_0xe21f83(0x17d)])]),{'verbose':_0x66cc3c[_0xe21f83(0x192)]}),[_0x9c14d9,_0x19f538]=_0x5c139a[_0xe21f83(0x154)],{folders:_0x29c6fb,segments:_0x10a535}=_0x9c14d9,_0x17d84d=_0x29c6fb[_0xe21f83(0x198)]+_0x10a535[_0xe21f83(0x198)]+_0x19f538[_0xe21f83(0x198)];console[_0xe21f83(0x162)](_0xe21f83(0x166)+_0x29c6fb[_0xe21f83(0x198)]+_0xe21f83(0x17a)+(_0x29c6fb['length']!==0x1?'s':'')+',\x20'+_0x10a535[_0xe21f83(0x198)]+_0xe21f83(0x196)+(_0x10a535['length']!==0x1?'s':'')+_0xe21f83(0x15b)+_0x19f538[_0xe21f83(0x198)]+_0xe21f83(0x191)+(_0x19f538['length']!==0x1?'s':''));const _0x4318c9=_0x335f02=>{const _0x5ed7c5=_0xe21f83;return getConsoleNextUrl(_0x66cc3c[_0x5ed7c5(0x175)],_0x5ed7c5(0x182)+_0x2a4295[_0x5ed7c5(0x17d)]+_0x5ed7c5(0x168)+_0x335f02);},_0x29faf7=_0x43dea6=>{const _0x384d1b=_0xe21f83;return getConsoleNextUrl(_0x66cc3c[_0x384d1b(0x175)],'/app/ps/'+_0x2a4295[_0x384d1b(0x17d)]+'/e/'+_0x43dea6+_0x384d1b(0x16b));},_0x181466=_0x66cc3c['format']==='json'||_0x66cc3c[_0xe21f83(0x189)]===_0xe21f83(0x153);if(_0x181466){const _0x1d9949=[..._0x29c6fb['map'](_0x286d2f=>({..._0x286d2f,'type':_0xe21f83(0x193)})),..._0x10a535['map'](_0x5af922=>({..._0x5af922,'type':'segment','url':_0x4318c9(_0x5af922['id'])})),..._0x19f538[_0xe21f83(0x17f)](_0x303390=>({..._0x303390,'name':_0x303390[_0xe21f83(0x177)],'type':'journey','url':_0x29faf7(_0x303390['id'])}))]['sort']((_0x2a886f,_0x362a6b)=>_0x2a886f[_0xe21f83(0x172)]['localeCompare'](_0x362a6b['name']));await handleSDKOutput(_0x1d9949,_0x66cc3c);}else{if(_0x17d84d===0x0)console[_0xe21f83(0x169)](a39_0x1bde1d[_0xe21f83(0x174)]('['+_0x23b020+']')),console[_0xe21f83(0x169)](_0xe21f83(0x185));else{console[_0xe21f83(0x169)](a39_0x1bde1d[_0xe21f83(0x174)]('['+_0x23b020+']'));const _0x14d8ad=formatFlatList(_0x29c6fb,_0x10a535,{'showMetadata':!![],'showUrl':_0x4f40ae,'getSegmentUrl':_0x4318c9,'getJourneyUrl':_0x29faf7},_0x19f538);console[_0xe21f83(0x169)](_0x14d8ad);}}return 0x0;}async['listRecursive'](_0x5d7d18,_0xd5cd61){const _0x2a3f3d=a39_0x697b5a,{options:_0x58264d,tdx:_0x29cae5}=_0x5d7d18,_0x2da9c8=_0x58264d[_0x2a3f3d(0x167)],_0x4b9b64=await withSpinner(_0x2a3f3d(0x18a)+_0xd5cd61+'\x27...',()=>_0x29cae5[_0x2a3f3d(0x15c)][_0x2a3f3d(0x16e)](_0xd5cd61),{'verbose':_0x58264d[_0x2a3f3d(0x192)]}),_0x3e00e4=_0x4b9b64[_0x2a3f3d(0x154)];_0x58264d[_0x2a3f3d(0x192)]&&(console[_0x2a3f3d(0x162)](_0x2a3f3d(0x156)+_0x3e00e4[_0x2a3f3d(0x17d)]),_0x3e00e4[_0x2a3f3d(0x15a)]&&console['error']('Folder\x20ID:\x20'+_0x3e00e4[_0x2a3f3d(0x15a)]));const _0xa9cd42=_0x58264d[_0x2a3f3d(0x161)]||0xa,_0x18b113=await withSpinner(_0x2a3f3d(0x15d),()=>_0x29cae5['segment']['listRecursive'](_0x3e00e4['parentId'],_0x3e00e4[_0x2a3f3d(0x15a)],0x0,_0xa9cd42),{'verbose':_0x58264d[_0x2a3f3d(0x192)]}),_0x22ddb0=_0x18b113[_0x2a3f3d(0x154)];console[_0x2a3f3d(0x162)]('✔\x20Built\x20tree\x20with\x20'+_0x22ddb0['length']+_0x2a3f3d(0x190));const _0x39cc82=_0x4e09a6=>{const _0xa212c7=_0x2a3f3d;return getConsoleNextUrl(_0x58264d['site'],'/app/ps/'+_0x3e00e4['parentId']+_0xa212c7(0x168)+_0x4e09a6);};if(_0x58264d[_0x2a3f3d(0x189)]===_0x2a3f3d(0x158)||_0x58264d[_0x2a3f3d(0x189)]===_0x2a3f3d(0x153))await handleSDKOutput(_0x22ddb0,_0x58264d);else{console['log'](a39_0x1bde1d['dim']('['+_0xd5cd61+']'));const _0xe774df=formatTree(_0x22ddb0,{'showMetadata':!![],'showUrl':_0x2da9c8,'getSegmentUrl':_0x39cc82});console['log'](_0xe774df);}return 0x0;}}
|
|
1
|
+
const a39_0x321f27=a39_0x4e60;(function(_0x4ad82d,_0x4139bb){const _0x403b52=a39_0x4e60,_0x25999f=_0x4ad82d();while(!![]){try{const _0x50a567=parseInt(_0x403b52(0x191))/0x1*(-parseInt(_0x403b52(0x1a8))/0x2)+parseInt(_0x403b52(0x1b6))/0x3*(parseInt(_0x403b52(0x1b9))/0x4)+-parseInt(_0x403b52(0x1ab))/0x5*(parseInt(_0x403b52(0x184))/0x6)+-parseInt(_0x403b52(0x18d))/0x7*(parseInt(_0x403b52(0x197))/0x8)+parseInt(_0x403b52(0x194))/0x9+-parseInt(_0x403b52(0x19d))/0xa+-parseInt(_0x403b52(0x1c1))/0xb*(-parseInt(_0x403b52(0x1af))/0xc);if(_0x50a567===_0x4139bb)break;else _0x25999f['push'](_0x25999f['shift']());}catch(_0x46eead){_0x25999f['push'](_0x25999f['shift']());}}}(a39_0x3356,0xc6655));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0x2a8f7d from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x321f27(0x186)]=a39_0x321f27(0x1b5);[a39_0x321f27(0x190)]='List\x20folders\x20and\x20child\x20segments';async[a39_0x321f27(0x18a)](_0x40284f){const _0x466130=a39_0x321f27,{options:_0x2876d0,args:_0x3197e1}=_0x40284f,_0x2909af=_0x2876d0[_0x466130(0x185)],_0x3680c5=_0x3197e1[0x0];try{const _0x3a790a=_0x2876d0[_0x466130(0x1bb)];_0x2876d0['verbose']&&(console['error']('Site:\x20'+_0x2876d0[_0x466130(0x1aa)]),console[_0x466130(0x1a6)](_0x466130(0x1d0)+(_0x3a790a||_0x466130(0x193))),_0x3680c5&&console[_0x466130(0x1a6)]('Folder/pattern\x20arg:\x20'+_0x3680c5),_0x2909af&&console[_0x466130(0x1a6)]('Recursive\x20mode:\x20enabled'));if(!_0x3a790a)return console[_0x466130(0x1a6)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x466130(0x1a6)](_0x466130(0x1ca)),console['error'](_0x466130(0x1c0)),console[_0x466130(0x1a6)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x466130(0x1a6)](''),console[_0x466130(0x1a6)](_0x466130(0x1c3)),0x1;const _0x333155=_0x3680c5&&(_0x3680c5[_0x466130(0x1c4)]('*')||_0x3680c5[_0x466130(0x1c4)]('?'));if(_0x333155)return await this['listWithPattern'](_0x40284f,_0x3a790a,_0x3680c5);const _0x4dee2d=_0x3680c5?_0x3a790a+'/'+_0x3680c5:_0x3a790a;return _0x2909af?await this['listRecursive'](_0x40284f,_0x4dee2d):await this[_0x466130(0x19e)](_0x40284f,_0x4dee2d);}catch(_0x28736c){if(_0x28736c instanceof SDKError)return console[_0x466130(0x1a6)](_0x466130(0x1a4)+_0x28736c[_0x466130(0x1bf)]),_0x28736c[_0x466130(0x187)]&&console['error'](_0x466130(0x18c)+_0x28736c['cause']),0x1;throw _0x28736c;}}async[a39_0x321f27(0x198)](_0x2eea2b,_0x2051e7,_0x1d1b34){const _0x5f3b7f=a39_0x321f27,{options:_0x1d8030,tdx:_0x5d652d}=_0x2eea2b,_0x66a210=_0x1d8030[_0x5f3b7f(0x1a1)],_0xb01c4d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2051e7+_0x5f3b7f(0x18b),()=>_0x5d652d['segment'][_0x5f3b7f(0x19c)](_0x2051e7),{'verbose':_0x1d8030[_0x5f3b7f(0x1ac)]}),_0xb3a29e=_0xb01c4d[_0x5f3b7f(0x19a)],_0x2a96ca=await withSpinner(_0x5f3b7f(0x1a7),()=>Promise['all']([_0x5d652d['segment'][_0x5f3b7f(0x19e)](_0xb3a29e[_0x5f3b7f(0x1c5)],_0xb3a29e[_0x5f3b7f(0x199)]),_0x5d652d[_0x5f3b7f(0x1c2)]['listJourneysFromParentSegment'](_0xb3a29e['parentId'])]),{'verbose':_0x1d8030[_0x5f3b7f(0x1ac)]}),[_0x3adc64,_0x5baec1]=_0x2a96ca[_0x5f3b7f(0x19a)],{folders:_0x45c611,segments:_0x185d14}=_0x3adc64,_0x2ea749=_0x1d1b34[_0x5f3b7f(0x1b3)](/[.+^${}()|[\]\\]/g,_0x5f3b7f(0x18f))[_0x5f3b7f(0x1b3)](/\*/g,'.*')[_0x5f3b7f(0x1b3)](/\?/g,'.'),_0x410b53=new RegExp('^'+_0x2ea749+'$','i'),_0x4a863c=_0x45c611[_0x5f3b7f(0x1cd)](_0x12de49=>_0x410b53[_0x5f3b7f(0x19b)](_0x12de49[_0x5f3b7f(0x186)])),_0x5bce9f=_0x185d14[_0x5f3b7f(0x1cd)](_0x23f9b0=>_0x410b53[_0x5f3b7f(0x19b)](_0x23f9b0[_0x5f3b7f(0x186)])),_0x23f16d=_0x5baec1['filter'](_0x33a9ee=>_0x410b53[_0x5f3b7f(0x19b)](_0x33a9ee[_0x5f3b7f(0x1a3)])),_0xf1ff96=_0x4a863c[_0x5f3b7f(0x1cc)]+_0x5bce9f[_0x5f3b7f(0x1cc)]+_0x23f16d['length'];console['error'](_0x5f3b7f(0x1c6)+_0x4a863c[_0x5f3b7f(0x1cc)]+_0x5f3b7f(0x189)+(_0x4a863c[_0x5f3b7f(0x1cc)]!==0x1?'s':'')+',\x20'+_0x5bce9f[_0x5f3b7f(0x1cc)]+_0x5f3b7f(0x1b2)+(_0x5bce9f[_0x5f3b7f(0x1cc)]!==0x1?'s':'')+_0x5f3b7f(0x18e)+_0x23f16d[_0x5f3b7f(0x1cc)]+_0x5f3b7f(0x1ae)+(_0x23f16d[_0x5f3b7f(0x1cc)]!==0x1?'s':'')+_0x5f3b7f(0x1c7)+_0x1d1b34+'\x27');const _0x267d2d=_0x5c76f6=>{const _0x1c216f=_0x5f3b7f;return getConsoleNextUrl(_0x1d8030['site'],'/app/ps/'+_0xb3a29e[_0x1c216f(0x1c5)]+_0x1c216f(0x1a2)+_0x5c76f6);},_0x2e5b0f=_0x1d8030[_0x5f3b7f(0x1ce)]===_0x5f3b7f(0x195)||_0x1d8030['format']==='jsonl';if(_0x2e5b0f){const _0x3e20fd=[..._0x4a863c[_0x5f3b7f(0x192)](_0x5916a7=>({..._0x5916a7,'type':_0x5f3b7f(0x1b4)})),..._0x5bce9f[_0x5f3b7f(0x192)](_0x3430bb=>({..._0x3430bb,'type':_0x5f3b7f(0x1a9),'url':_0x267d2d(_0x3430bb['id'])})),..._0x23f16d['map'](_0x5f1a82=>({..._0x5f1a82,'name':_0x5f1a82[_0x5f3b7f(0x1a3)],'type':_0x5f3b7f(0x1c2)}))]['sort']((_0x2442f0,_0x165ee3)=>_0x2442f0[_0x5f3b7f(0x186)][_0x5f3b7f(0x1bd)](_0x165ee3[_0x5f3b7f(0x186)]));await handleSDKOutput(_0x3e20fd,_0x1d8030);}else{if(_0xf1ff96===0x0)console[_0x5f3b7f(0x1b8)](_0x5f3b7f(0x19f)+_0x1d1b34);else{console[_0x5f3b7f(0x1b8)](a39_0x2a8f7d[_0x5f3b7f(0x1b0)]('['+_0x2051e7+_0x5f3b7f(0x1a0)+_0x1d1b34+'\x27'));const _0x461fc0=formatFlatList(_0x4a863c,_0x5bce9f,{'showMetadata':!![],'showUrl':_0x66a210,'getSegmentUrl':_0x267d2d},_0x23f16d);console[_0x5f3b7f(0x1b8)](_0x461fc0);}}return 0x0;}async[a39_0x321f27(0x19e)](_0x167261,_0x19b4da){const _0x3cf0ca=a39_0x321f27,{options:_0x2b39a8,tdx:_0x3f8b63}=_0x167261,_0x5e059a=_0x2b39a8[_0x3cf0ca(0x1a1)],_0x10f33a=await withSpinner('Resolving\x20path\x20\x27'+_0x19b4da+_0x3cf0ca(0x18b),()=>_0x3f8b63[_0x3cf0ca(0x1a9)][_0x3cf0ca(0x19c)](_0x19b4da),{'verbose':_0x2b39a8[_0x3cf0ca(0x1ac)]}),_0x3cee1d=_0x10f33a[_0x3cf0ca(0x19a)];_0x2b39a8[_0x3cf0ca(0x1ac)]&&(console[_0x3cf0ca(0x1a6)](_0x3cf0ca(0x1ba)+_0x3cee1d['parentId']),_0x3cee1d[_0x3cf0ca(0x199)]&&console[_0x3cf0ca(0x1a6)](_0x3cf0ca(0x1ad)+_0x3cee1d[_0x3cf0ca(0x199)]));const _0x38d56d=await withSpinner(_0x3cf0ca(0x1a7),()=>Promise[_0x3cf0ca(0x1cf)]([_0x3f8b63[_0x3cf0ca(0x1a9)][_0x3cf0ca(0x19e)](_0x3cee1d[_0x3cf0ca(0x1c5)],_0x3cee1d[_0x3cf0ca(0x199)]),_0x3f8b63['journey'][_0x3cf0ca(0x1c8)](_0x3cee1d['parentId'])]),{'verbose':_0x2b39a8['verbose']}),[_0x3d3d20,_0x2b8b9b]=_0x38d56d[_0x3cf0ca(0x19a)],{folders:_0x12447d,segments:_0xdffc86}=_0x3d3d20,_0x49fd5e=_0x12447d[_0x3cf0ca(0x1cc)]+_0xdffc86['length']+_0x2b8b9b['length'];console[_0x3cf0ca(0x1a6)]('✔\x20Found\x20'+_0x12447d[_0x3cf0ca(0x1cc)]+'\x20folder'+(_0x12447d['length']!==0x1?'s':'')+',\x20'+_0xdffc86[_0x3cf0ca(0x1cc)]+_0x3cf0ca(0x1b2)+(_0xdffc86[_0x3cf0ca(0x1cc)]!==0x1?'s':'')+',\x20and\x20'+_0x2b8b9b[_0x3cf0ca(0x1cc)]+_0x3cf0ca(0x1ae)+(_0x2b8b9b[_0x3cf0ca(0x1cc)]!==0x1?'s':''));const _0x2f4d6a=_0xa99e7a=>{const _0x5b0bf6=_0x3cf0ca;return getConsoleNextUrl(_0x2b39a8['site'],'/app/ps/'+_0x3cee1d[_0x5b0bf6(0x1c5)]+_0x5b0bf6(0x1a2)+_0xa99e7a);},_0x20ffaf=_0x594376=>{const _0x39cbbf=_0x3cf0ca;return getConsoleNextUrl(_0x2b39a8[_0x39cbbf(0x1aa)],_0x39cbbf(0x1c9)+_0x3cee1d[_0x39cbbf(0x1c5)]+_0x39cbbf(0x1a2)+_0x594376+_0x39cbbf(0x1bc));},_0x3829bd=_0x2b39a8[_0x3cf0ca(0x1ce)]===_0x3cf0ca(0x195)||_0x2b39a8['format']===_0x3cf0ca(0x1be);if(_0x3829bd){const _0x4bdfbf=[..._0x12447d[_0x3cf0ca(0x192)](_0x3c5375=>({..._0x3c5375,'type':_0x3cf0ca(0x1b4)})),..._0xdffc86[_0x3cf0ca(0x192)](_0x4766f3=>({..._0x4766f3,'type':_0x3cf0ca(0x1a9),'url':_0x2f4d6a(_0x4766f3['id'])})),..._0x2b8b9b[_0x3cf0ca(0x192)](_0x115353=>({..._0x115353,'name':_0x115353[_0x3cf0ca(0x1a3)],'type':'journey','url':_0x20ffaf(_0x115353['id'])}))]['sort']((_0xb1bbb6,_0x2106a7)=>_0xb1bbb6[_0x3cf0ca(0x186)][_0x3cf0ca(0x1bd)](_0x2106a7[_0x3cf0ca(0x186)]));await handleSDKOutput(_0x4bdfbf,_0x2b39a8);}else{if(_0x49fd5e===0x0)console['log'](a39_0x2a8f7d[_0x3cf0ca(0x1b0)]('['+_0x19b4da+']')),console[_0x3cf0ca(0x1b8)](_0x3cf0ca(0x1a5));else{console[_0x3cf0ca(0x1b8)](a39_0x2a8f7d[_0x3cf0ca(0x1b0)]('['+_0x19b4da+']'));const _0x1ef6e6=formatFlatList(_0x12447d,_0xdffc86,{'showMetadata':!![],'showUrl':_0x5e059a,'getSegmentUrl':_0x2f4d6a,'getJourneyUrl':_0x20ffaf},_0x2b8b9b);console[_0x3cf0ca(0x1b8)](_0x1ef6e6);}}return 0x0;}async[a39_0x321f27(0x1b1)](_0x525fd8,_0x307150){const _0x5cc53b=a39_0x321f27,{options:_0x3f1425,tdx:_0x5ab550}=_0x525fd8,_0xdb632d=_0x3f1425[_0x5cc53b(0x1a1)],_0x5c0fdf=await withSpinner(_0x5cc53b(0x196)+_0x307150+_0x5cc53b(0x18b),()=>_0x5ab550[_0x5cc53b(0x1a9)][_0x5cc53b(0x19c)](_0x307150),{'verbose':_0x3f1425[_0x5cc53b(0x1ac)]}),_0x34d8be=_0x5c0fdf[_0x5cc53b(0x19a)];_0x3f1425['verbose']&&(console[_0x5cc53b(0x1a6)](_0x5cc53b(0x1ba)+_0x34d8be[_0x5cc53b(0x1c5)]),_0x34d8be['folderId']&&console['error']('Folder\x20ID:\x20'+_0x34d8be[_0x5cc53b(0x199)]));const _0x341ded=_0x3f1425[_0x5cc53b(0x1cb)]||0xa,_0x196931=await withSpinner(_0x5cc53b(0x1b7),()=>_0x5ab550[_0x5cc53b(0x1a9)][_0x5cc53b(0x1b1)](_0x34d8be[_0x5cc53b(0x1c5)],_0x34d8be[_0x5cc53b(0x199)],0x0,_0x341ded),{'verbose':_0x3f1425[_0x5cc53b(0x1ac)]}),_0x1e732d=_0x196931['data'];console[_0x5cc53b(0x1a6)]('✔\x20Built\x20tree\x20with\x20'+_0x1e732d[_0x5cc53b(0x1cc)]+_0x5cc53b(0x188));const _0x5d28fd=_0x2d7915=>{const _0x1784b3=_0x5cc53b;return getConsoleNextUrl(_0x3f1425[_0x1784b3(0x1aa)],'/app/ps/'+_0x34d8be[_0x1784b3(0x1c5)]+_0x1784b3(0x1a2)+_0x2d7915);};if(_0x3f1425[_0x5cc53b(0x1ce)]===_0x5cc53b(0x195)||_0x3f1425[_0x5cc53b(0x1ce)]===_0x5cc53b(0x1be))await handleSDKOutput(_0x1e732d,_0x3f1425);else{console[_0x5cc53b(0x1b8)](a39_0x2a8f7d['dim']('['+_0x307150+']'));const _0x1e759e=formatTree(_0x1e732d,{'showMetadata':!![],'showUrl':_0xdb632d,'getSegmentUrl':_0x5d28fd});console[_0x5cc53b(0x1b8)](_0x1e759e);}return 0x0;}}function a39_0x4e60(_0x1228ef,_0x5065e5){_0x1228ef=_0x1228ef-0x184;const _0x3356d9=a39_0x3356();let _0x4e602f=_0x3356d9[_0x1228ef];return _0x4e602f;}function a39_0x3356(){const _0x3a9087=['test','resolvePathToResource','7365670nNFPut','listUnified','No\x20items\x20match\x20pattern:\x20',']\x20matching\x20\x27','web','/e/','journeyBundleName','Error:\x20','(empty)','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','62XOGUpf','segment','site','7521225YYEIih','verbose','Folder\x20ID:\x20','\x20journey','96mKnCoI','dim','listRecursive','\x20segment','replace','folder','segments','3017643fCyskH','Building\x20hierarchy\x20tree...','log','4FGyKop','Parent\x20ID:\x20','parentSegment','/j/da','localeCompare','jsonl','message','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','5548708LHNNPR','journey','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','includes','parentId','✔\x20Found\x20','\x20matching\x20\x27','listJourneysFromParentSegment','/app/ps/','Set\x20a\x20parent\x20segment\x20context\x20first:','maxDepth','length','filter','format','all','Parent\x20segment\x20context:\x20','6mfDdsA','recursive','name','cause','\x20top-level\x20items','\x20folder','execute','\x27...','\x20\x20Cause:\x20','227521WTeQQY',',\x20and\x20','\x5c$&','description','31012UCrTXe','map','(not\x20set)','1585071hHoaKI','json','Resolving\x20path\x20\x27','296rLhdpb','listWithPattern','folderId','data'];a39_0x3356=function(){return _0x3a9087;};return a39_0x3356();}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a40_0x48d2(){const _0x3e81ec=['Querying\x20','validate','1448222UhAXIo','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Usage:\x20tdx\x20show\x20<database.table>','1253200AysDPH','Catalog:\x20','data','verbose','\x20\x20Cause:\x20','query','database','args','5503663FlVuLg','\x20row','3636orKtQp','Error:\x20','9twMTfM','Show\x20table\x20contents','295295svsjkn','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','catalog','3hEanpi','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','length','5299FJWyVU','Limit:\x20','message','show','1643408FKoRsT','10lcZwEw','site','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','error','description','showTable','table','limit','49202ueaAAd','Table:\x20'];a40_0x48d2=function(){return _0x3e81ec;};return a40_0x48d2();}const a40_0x263c80=a40_0x34d0;(function(_0x2b1967,_0x398328){const _0x2e4cb9=a40_0x34d0,_0x41d527=_0x2b1967();while(!![]){try{const _0x5879df=-parseInt(_0x2e4cb9(0xbe))/0x1+-parseInt(_0x2e4cb9(0xc2))/0x2*(parseInt(_0x2e4cb9(0xae))/0x3)+parseInt(_0x2e4cb9(0xc5))/0x4+-parseInt(_0x2e4cb9(0xab))/0x5+parseInt(_0x2e4cb9(0xcf))/0x6*(parseInt(_0x2e4cb9(0xb1))/0x7)+parseInt(_0x2e4cb9(0xb5))/0x8*(parseInt(_0x2e4cb9(0xd1))/0x9)+parseInt(_0x2e4cb9(0xb6))/0xa*(parseInt(_0x2e4cb9(0xcd))/0xb);if(_0x5879df===_0x398328)break;else _0x41d527['push'](_0x41d527['shift']());}catch(_0x37c722){_0x41d527['push'](_0x41d527['shift']());}}}(a40_0x48d2,0x9d935));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';function a40_0x34d0(_0x44c792,_0x2526b8){_0x44c792=_0x44c792-0xaa;const _0x48d2bf=a40_0x48d2();let _0x34d01d=_0x48d2bf[_0x44c792];return _0x34d01d;}export class ShowCommand extends BaseCommand{['name']=a40_0x263c80(0xb4);[a40_0x263c80(0xba)]=a40_0x263c80(0xaa);async['execute'](_0x33c000){return this['showTable'](_0x33c000);}async['showTable'](_0x2d1ec3){const _0x49b068=a40_0x263c80,{options:_0x4da7a8,args:_0x47e78a,tdx:_0x4c56d3}=_0x2d1ec3;let _0x148a6f;try{_0x148a6f=parseTableReference(_0x47e78a[0x0]);const _0x395872=_0x4da7a8[_0x49b068(0xcb)];!_0x148a6f[_0x49b068(0xcb)]&&_0x395872&&(_0x148a6f[_0x49b068(0xcb)]=_0x395872);const _0x913f8e=validateTableDescribeReference(_0x148a6f);if(_0x913f8e)return console['error'](_0x49b068(0xd0)+_0x913f8e),console[_0x49b068(0xb9)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x49b068(0xb9)](_0x49b068(0xc3)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x18d732){return console[_0x49b068(0xb9)]('Error:\x20'+_0x18d732[_0x49b068(0xb3)]),console[_0x49b068(0xb9)](_0x49b068(0xc4)),console[_0x49b068(0xb9)](_0x49b068(0xc3)),console['error'](_0x49b068(0xaf)),0x1;}const _0x1a0e7d=_0x148a6f[_0x49b068(0xad)],_0x2369b6=_0x148a6f[_0x49b068(0xcb)],_0x5518a2=_0x148a6f[_0x49b068(0xbc)],_0x2db3e7=resolveLimit(_0x4da7a8[_0x49b068(0xbd)],DEFAULT_DISPLAY_LIMIT);try{_0x4da7a8[_0x49b068(0xc8)]&&(console[_0x49b068(0xb9)]('Site:\x20'+_0x4da7a8[_0x49b068(0xb7)]),_0x1a0e7d&&console['error'](_0x49b068(0xc6)+_0x1a0e7d),console[_0x49b068(0xb9)]('Database:\x20'+_0x2369b6),console[_0x49b068(0xb9)](_0x49b068(0xbf)+_0x5518a2),console[_0x49b068(0xb9)](_0x49b068(0xb2)+_0x2db3e7));const _0x4d9784=_0x1a0e7d?_0x1a0e7d+'.'+_0x2369b6+'.'+_0x5518a2:_0x2369b6+'.'+_0x5518a2,_0x46818d=await withSpinner(_0x49b068(0xc0)+_0x4d9784+'...',()=>_0x4c56d3[_0x49b068(0xca)][_0x49b068(0xbb)](_0x2369b6,_0x5518a2,_0x2db3e7,_0x1a0e7d),{'verbose':_0x4da7a8[_0x49b068(0xc8)]}),_0x4083d1=_0x46818d['data'],_0x579eb8=_0x4083d1[_0x49b068(0xc7)];return _0x579eb8['length']===0x0?console[_0x49b068(0xb9)](_0x49b068(0xac)):console[_0x49b068(0xb9)]('✔\x20Retrieved\x20'+_0x579eb8['length']+_0x49b068(0xce)+(_0x579eb8[_0x49b068(0xb0)]!==0x1?'s':'')+'\x20from\x20'+_0x4d9784),await handleSDKOutput(_0x579eb8,_0x4da7a8),0x0;}catch(_0x329de7){if(_0x329de7 instanceof SDKError)return console[_0x49b068(0xb9)](_0x49b068(0xd0)+_0x329de7[_0x49b068(0xb3)]),_0x329de7['cause']&&console[_0x49b068(0xb9)](_0x49b068(0xc9)+_0x329de7['cause']),0x1;throw _0x329de7;}}[a40_0x263c80(0xc1)](_0x1f4a57){const _0x1b1295=a40_0x263c80;if(_0x1f4a57[_0x1b1295(0xcc)][_0x1b1295(0xb0)]===0x0)return _0x1b1295(0xb8);if(_0x1f4a57['args'][_0x1b1295(0xb0)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0xf94197=a41_0x2260;(function(_0x5ace00,_0x5b90fb){const _0x5b4fb2=a41_0x2260,_0x3be42f=_0x5ace00();while(!![]){try{const _0xecbadf=-parseInt(_0x5b4fb2(0x205))/0x1+-parseInt(_0x5b4fb2(0x1eb))/0x2+parseInt(_0x5b4fb2(0x206))/0x3+parseInt(_0x5b4fb2(0x1f3))/0x4*(parseInt(_0x5b4fb2(0x1f2))/0x5)+parseInt(_0x5b4fb2(0x20c))/0x6+parseInt(_0x5b4fb2(0x209))/0x7*(-parseInt(_0x5b4fb2(0x1e8))/0x8)+parseInt(_0x5b4fb2(0x20f))/0x9;if(_0xecbadf===_0x5b90fb)break;else _0x3be42f['push'](_0x3be42f['shift']());}catch(_0x306900){_0x3be42f['push'](_0x3be42f['shift']());}}}(a41_0x4dc0,0x44b9f));import{BaseCommand}from'./command.js';function a41_0x2260(_0x2719e4,_0x4aec02){_0x2719e4=_0x2719e4-0x1e2;const _0x4dc0f1=a41_0x4dc0();let _0x2260e8=_0x4dc0f1[_0x2719e4];return _0x2260e8;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';function a41_0x4dc0(){const _0x2c5104=['869972JCPKIW','database','name','Or\x20use\x20--in\x20flag:','\x20table','validate','.*\x22','error','length','Note:\x20\x27','\x27\x20across\x20all\x20databases.','limit','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','verbose','table','includes','data','Error:\x20','404620CdQJEr','1095402iMVcVy','Database\x20\x27','Site:\x20','7zAfLWh','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','listTables','2287374yUjqOz','cause','\x20\x20Cause:\x20','220365WoKcgE','Database:\x20all','\x20\x20Use:\x20tdx\x20tables\x20\x22','List\x20tables\x20in\x20a\x20database','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database:\x20','tables','\x27\x20is\x20ambiguous.','1514984JMUyGS','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20Pattern\x20\x27','225690QYBsjW','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','message','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','✔\x20Found\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','5ZQYRqv'];a41_0x4dc0=function(){return _0x2c5104;};return a41_0x4dc0();}export class TablesCommand extends BaseCommand{[a41_0xf94197(0x1f5)]=a41_0xf94197(0x1e6);['description']=a41_0xf94197(0x1e3);async['execute'](_0x1da3cf){const _0x357d5c=a41_0xf94197,{options:_0x241bc7,args:_0x46c224,tdx:_0x2b5d80}=_0x1da3cf;let _0x352efb;if(_0x46c224[_0x357d5c(0x1fb)]===0x0)_0x352efb={'database':undefined,'table':undefined,'original':''};else{if(_0x46c224[_0x357d5c(0x1fb)]===0x1)try{_0x352efb=parseTableReference(_0x46c224[0x0]);if(_0x352efb[_0x357d5c(0x201)]&&!_0x352efb['database']&&!_0x352efb['table'][_0x357d5c(0x202)]('*')&&!_0x352efb[_0x357d5c(0x201)]['includes']('?'))return console['error'](_0x357d5c(0x1ea)+_0x46c224[0x0]+_0x357d5c(0x1e7)),console[_0x357d5c(0x1fa)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x352efb[_0x357d5c(0x201)]+'\x27?'),console[_0x357d5c(0x1fa)](_0x357d5c(0x1e2)+_0x352efb[_0x357d5c(0x201)]+_0x357d5c(0x1f9)),console[_0x357d5c(0x1fa)](_0x357d5c(0x1ed)+_0x352efb[_0x357d5c(0x201)]),console[_0x357d5c(0x1fa)](_0x357d5c(0x1f1)+_0x352efb[_0x357d5c(0x201)]),console[_0x357d5c(0x1fa)](''),console[_0x357d5c(0x1fa)](_0x357d5c(0x1fc)+_0x46c224[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x352efb[_0x357d5c(0x201)]+_0x357d5c(0x1fd)),0x1;}catch(_0x52e347){return console['error'](_0x357d5c(0x204)+_0x52e347[_0x357d5c(0x1ee)]),0x1;}else return console['error'](_0x357d5c(0x1ef)),console['error'](_0x357d5c(0x1e4)),console[_0x357d5c(0x1fa)](_0x357d5c(0x20a)),console[_0x357d5c(0x1fa)](_0x357d5c(0x1ec)),console[_0x357d5c(0x1fa)](_0x357d5c(0x1ff)),console['error'](_0x357d5c(0x1f6)),console['error']('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x5b2ac3=_0x241bc7[_0x357d5c(0x1f4)];!_0x352efb[_0x357d5c(0x1f4)]&&_0x5b2ac3&&(_0x352efb[_0x357d5c(0x1f4)]=_0x5b2ac3);try{const _0x4d14f8=_0x4eaf2b=>_0x4eaf2b&&(_0x4eaf2b[_0x357d5c(0x202)]('*')||_0x4eaf2b[_0x357d5c(0x202)]('?')),_0xb71f9b=_0x4d14f8(_0x352efb['database']);_0x241bc7[_0x357d5c(0x200)]&&(console[_0x357d5c(0x1fa)](_0x357d5c(0x208)+_0x241bc7['site']),_0x352efb['database']?_0xb71f9b?console['error']('Database\x20pattern:\x20'+_0x352efb['database']):console[_0x357d5c(0x1fa)](_0x357d5c(0x1e5)+_0x352efb['database']):console['error'](_0x357d5c(0x210)),_0x352efb[_0x357d5c(0x201)]&&console[_0x357d5c(0x1fa)]('Table\x20pattern:\x20'+_0x352efb[_0x357d5c(0x201)]));const _0x399795=_0x352efb[_0x357d5c(0x1f4)]&&!_0xb71f9b?_0x352efb[_0x357d5c(0x1f4)]:undefined,_0x375861=_0xb71f9b?_0x352efb['database']:undefined,_0x1bd38e=_0x352efb[_0x357d5c(0x201)],_0x81e1d9=resolveLimit(_0x241bc7[_0x357d5c(0x1fe)],DEFAULT_LISTING_LIMIT),_0x270bc5=await withSpinner('Listing\x20tables...',()=>_0x2b5d80['query'][_0x357d5c(0x20b)](_0x399795,_0x1bd38e,_0x375861,_0x81e1d9),{'verbose':_0x241bc7[_0x357d5c(0x200)]}),_0xf0953b=_0x270bc5[_0x357d5c(0x203)];if(_0xf0953b['length']===0x0&&_0x352efb[_0x357d5c(0x1f4)]&&!_0xb71f9b)return console[_0x357d5c(0x1fa)]('✖\x20No\x20tables\x20found'),console[_0x357d5c(0x1fa)](_0x357d5c(0x207)+_0x352efb[_0x357d5c(0x1f4)]+_0x357d5c(0x1e9)),0x1;return console[_0x357d5c(0x1fa)](_0x357d5c(0x1f0)+_0xf0953b[_0x357d5c(0x1fb)]+_0x357d5c(0x1f7)+(_0xf0953b[_0x357d5c(0x1fb)]!==0x1?'s':'')),await handleSDKOutput(_0xf0953b,{..._0x241bc7,'limit':_0x81e1d9}),0x0;}catch(_0x20d035){if(_0x20d035 instanceof SDKError)return console['error'](_0x357d5c(0x204)+_0x20d035[_0x357d5c(0x1ee)]),_0x20d035[_0x357d5c(0x20d)]&&console[_0x357d5c(0x1fa)](_0x357d5c(0x20e)+_0x20d035[_0x357d5c(0x20d)]),0x1;throw _0x20d035;}}[a41_0xf94197(0x1f8)](_0x16e577){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a42_0x4aff(_0xb937c8,_0x57dc46){_0xb937c8=_0xb937c8-0x169;const _0x1c655b=a42_0x1c65();let _0x4aff38=_0x1c655b[_0xb937c8];return _0x4aff38;}const a42_0x3a8491=a42_0x4aff;(function(_0x3b3779,_0x1995ee){const _0x32ee9a=a42_0x4aff,_0x526651=_0x3b3779();while(!![]){try{const _0x1f086a=-parseInt(_0x32ee9a(0x16e))/0x1*(parseInt(_0x32ee9a(0x180))/0x2)+parseInt(_0x32ee9a(0x170))/0x3*(parseInt(_0x32ee9a(0x199))/0x4)+-parseInt(_0x32ee9a(0x19b))/0x5*(-parseInt(_0x32ee9a(0x18c))/0x6)+parseInt(_0x32ee9a(0x172))/0x7+-parseInt(_0x32ee9a(0x16d))/0x8+-parseInt(_0x32ee9a(0x193))/0x9+parseInt(_0x32ee9a(0x17f))/0xa*(parseInt(_0x32ee9a(0x19c))/0xb);if(_0x1f086a===_0x1995ee)break;else _0x526651['push'](_0x526651['shift']());}catch(_0x2b0053){_0x526651['push'](_0x526651['shift']());}}}(a42_0x1c65,0x8c322));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import a42_0x1fc17b from'chalk';export class UseCommand extends BaseCommand{[a42_0x3a8491(0x196)]=a42_0x3a8491(0x18e);[a42_0x3a8491(0x16c)]=a42_0x3a8491(0x19e);[a42_0x3a8491(0x173)](_0x421901){const _0x21e6ed=a42_0x3a8491,{args:_0x2a7977}=_0x421901;if(_0x2a7977[_0x21e6ed(0x185)]===0x0)return undefined;if(_0x2a7977[_0x21e6ed(0x185)]===0x1)return _0x21e6ed(0x17d)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a'+_0x21e6ed(0x182)+_0x21e6ed(0x189)+_0x21e6ed(0x18d);const _0x16eb53=_0x2a7977[0x0],_0x4b2b34=[_0x21e6ed(0x198),'parent_segment',_0x21e6ed(0x19d),_0x21e6ed(0x17c),_0x21e6ed(0x188),_0x21e6ed(0x17a)];if(!_0x4b2b34[_0x21e6ed(0x18f)](_0x16eb53))return _0x21e6ed(0x184)+_0x16eb53+_0x21e6ed(0x181)+_0x4b2b34[_0x21e6ed(0x19a)](',\x20');return undefined;}async[a42_0x3a8491(0x169)](_0x4d414c){const _0x436f16=a42_0x3a8491,{args:_0xb78392,options:_0x3a6a25}=_0x4d414c,_0x5eeb11=_0x3a6a25['debug'],_0x276c42=_0x3a6a25['clear'];cleanExpiredSessions();try{if(_0x276c42){clearSessionContext(_0x3a6a25[_0x436f16(0x176)]);const _0x347f14=_0x3a6a25[_0x436f16(0x176)]||getCurrentSessionPID()['toString']();return console[_0x436f16(0x186)](_0x436f16(0x16f)+a42_0x1fc17b[_0x436f16(0x179)](_0x436f16(0x187))+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x347f14+')')),0x0;}if(_0xb78392['length']===0x0){const _0x41a506=new GlobalContext(_0x3a6a25);return _0x5eeb11?_0x41a506[_0x436f16(0x177)]():_0x41a506[_0x436f16(0x18b)](),console[_0x436f16(0x186)](a42_0x1fc17b['dim'](_0x436f16(0x178))),console[_0x436f16(0x186)](a42_0x1fc17b[_0x436f16(0x195)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace')),0x0;}const _0xd3f776=_0xb78392[0x0],_0x562f60=_0xb78392[0x1];if(_0xd3f776==='profile'){if(!profileExists(_0x562f60))return console[_0x436f16(0x17e)]('Error:\x20Profile\x20\x27'+_0x562f60+_0x436f16(0x18a)),console['error'](_0x436f16(0x16a)),0x1;const _0x3f41af=_0x3a6a25[_0x436f16(0x176)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x562f60},_0x3a6a25[_0x436f16(0x176)]),console[_0x436f16(0x186)](_0x436f16(0x17b)+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)]('(session:\x20'+_0x3f41af+')')),console[_0x436f16(0x186)](a42_0x1fc17b[_0x436f16(0x195)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x35d93f={},_0x272f92=_0x3a6a25['session']||getCurrentSessionPID()['toString']();switch(_0xd3f776){case _0x436f16(0x198):_0x35d93f['database']=_0x562f60,console['log'](_0x436f16(0x197)+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;case _0x436f16(0x183):_0x35d93f['parent_segment']=_0x562f60,console['log'](_0x436f16(0x192)+a42_0x1fc17b['green'](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;case _0x436f16(0x19d):_0x35d93f['llm_project']=_0x562f60,console[_0x436f16(0x186)]('Session\x20llm_project\x20set\x20to:\x20'+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;case _0x436f16(0x17c):{const {projectName:_0x38cd9c,agentName:_0x100379}=parseAgentRef(_0x562f60);_0x100379?(_0x35d93f[_0x436f16(0x19d)]=_0x38cd9c,_0x35d93f[_0x436f16(0x190)]=_0x100379,console[_0x436f16(0x186)](_0x436f16(0x174)+a42_0x1fc17b[_0x436f16(0x179)](_0x38cd9c)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')')),console[_0x436f16(0x186)](_0x436f16(0x16b)+a42_0x1fc17b['green'](_0x100379)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'))):(_0x35d93f[_0x436f16(0x190)]=_0x562f60,console['log'](_0x436f16(0x16b)+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')')));break;}case _0x436f16(0x17a):_0x35d93f[_0x436f16(0x17a)]=_0x562f60,console[_0x436f16(0x186)]('Session\x20engage_workspace\x20set\x20to:\x20'+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;}return saveSessionContext(_0x35d93f,_0x3a6a25[_0x436f16(0x176)]),console[_0x436f16(0x186)](a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x175))),0x0;}catch(_0x38881d){return _0x38881d instanceof Error&&console[_0x436f16(0x17e)](_0x436f16(0x171)+_0x38881d[_0x436f16(0x191)]),0x1;}}}function a42_0x1c65(){const _0x4e5ed0=['14084170ydthxv','2jXriDs','.\x20Must\x20be\x20one\x20of:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','parent_segment','Invalid\x20resource:\x20','length','log','cleared','profile','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','\x27\x20does\x20not\x20exist','display','120GKkikP','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','use','includes','llm_agent','message','Session\x20parent_segment\x20set\x20to:\x20','4924431RmsjzG','(session:\x20','dim','name','Session\x20database\x20set\x20to:\x20','database','4MPsvkW','join','184290lRobQO','11YVLMqh','llm_project','Set\x20session-level\x20context','execute','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Session\x20agent\x20set\x20to:\x20','description','9007072wajLhr','580840rqeJiJ','Session\x20context\x20','2041734asdJGb','Error:\x20','13790zraztV','validate','Session\x20llm_project\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','session','displayWithSources','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','green','engage_workspace','Session\x20profile\x20set\x20to:\x20','agent','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','error'];a42_0x1c65=function(){return _0x4e5ed0;};return a42_0x1c65();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x4294e1=a43_0x45ba;(function(_0x3b53f9,_0x51a5c3){const _0x1c0841=a43_0x45ba,_0x33499d=_0x3b53f9();while(!![]){try{const _0x5c4077=parseInt(_0x1c0841(0xe6))/0x1*(-parseInt(_0x1c0841(0xe9))/0x2)+parseInt(_0x1c0841(0xdc))/0x3+-parseInt(_0x1c0841(0xf6))/0x4+parseInt(_0x1c0841(0xdd))/0x5+parseInt(_0x1c0841(0xed))/0x6+-parseInt(_0x1c0841(0xe1))/0x7*(-parseInt(_0x1c0841(0xe8))/0x8)+parseInt(_0x1c0841(0xe2))/0x9*(-parseInt(_0x1c0841(0xf1))/0xa);if(_0x5c4077===_0x51a5c3)break;else _0x33499d['push'](_0x33499d['shift']());}catch(_0x46225f){_0x33499d['push'](_0x33499d['shift']());}}}(a43_0x45f7,0xe1a87));function a43_0x45f7(){const _0x32ef2d=['\x20user','message','17038RzkTNg','126JRmTcT','Show\x20current\x20user\x20information','List\x20all\x20users\x20in\x20the\x20account','Fetching\x20user\x20info...','551qahasg','list','2024NnOIrU','3962uPLbVy','execute','user','✔\x20Found\x20','5958858EGrDHd','getCurrent','cause','length','234790TWvBFJ','data','Error:\x20','Listing\x20users...','verbose','2519788lXfpfP','error','user\x20list','3010968TAiZun','1809390lYZKpb','description'];a43_0x45f7=function(){return _0x32ef2d;};return a43_0x45f7();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a43_0x45ba(_0x2e9278,_0x4533f0){_0x2e9278=_0x2e9278-0xdc;const _0x45f7a4=a43_0x45f7();let _0x45ba1a=_0x45f7a4[_0x2e9278];return _0x45ba1a;}export class UserCommand extends BaseCommand{['name']=a43_0x4294e1(0xeb);[a43_0x4294e1(0xde)]=a43_0x4294e1(0xe3);async[a43_0x4294e1(0xea)](_0x16dca1){const _0x298888=a43_0x4294e1,{options:_0x42f994,tdx:_0x204709}=_0x16dca1;try{const _0x57d19b=await withSpinner(_0x298888(0xe5),()=>_0x204709[_0x298888(0xeb)][_0x298888(0xee)](),{'verbose':_0x42f994[_0x298888(0xf5)]}),_0x125309=_0x57d19b[_0x298888(0xf2)];return await handleSingleObjectOutput(_0x125309,_0x42f994),0x0;}catch(_0x3b80b4){if(_0x3b80b4 instanceof SDKError)return console[_0x298888(0xf7)](_0x298888(0xf3)+_0x3b80b4['message']),_0x3b80b4[_0x298888(0xef)]&&console['error']('\x20\x20Cause:\x20'+_0x3b80b4[_0x298888(0xef)]),0x1;throw _0x3b80b4;}}}export class UserListCommand extends BaseCommand{['name']=a43_0x4294e1(0xf8);[a43_0x4294e1(0xde)]=a43_0x4294e1(0xe4);async[a43_0x4294e1(0xea)](_0x3915b9){const _0x3da1c=a43_0x4294e1,{options:_0x14fd1c,tdx:_0x57aa7a}=_0x3915b9;try{const _0x28d8fb=await withSpinner(_0x3da1c(0xf4),()=>_0x57aa7a[_0x3da1c(0xeb)][_0x3da1c(0xe7)](),{'verbose':_0x14fd1c[_0x3da1c(0xf5)]}),_0x20926a=_0x28d8fb[_0x3da1c(0xf2)];return console[_0x3da1c(0xf7)](_0x3da1c(0xec)+_0x20926a[_0x3da1c(0xf0)]+_0x3da1c(0xdf)+(_0x20926a[_0x3da1c(0xf0)]!==0x1?'s':'')),await handleSDKOutput(_0x20926a,_0x14fd1c),0x0;}catch(_0x263704){if(_0x263704 instanceof SDKError)return console[_0x3da1c(0xf7)](_0x3da1c(0xf3)+_0x263704[_0x3da1c(0xe0)]),_0x263704[_0x3da1c(0xef)]&&console[_0x3da1c(0xf7)]('\x20\x20Cause:\x20'+_0x263704[_0x3da1c(0xef)]),0x1;throw _0x263704;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0xe97346=a44_0xecaf;(function(_0x3d7e50,_0x336d78){const _0x1f6e60=a44_0xecaf,_0x1fa35c=_0x3d7e50();while(!![]){try{const _0x2ae61c=-parseInt(_0x1f6e60(0x219))/0x1+parseInt(_0x1f6e60(0x1aa))/0x2+-parseInt(_0x1f6e60(0x20b))/0x3*(parseInt(_0x1f6e60(0x188))/0x4)+parseInt(_0x1f6e60(0x223))/0x5*(-parseInt(_0x1f6e60(0x1e3))/0x6)+parseInt(_0x1f6e60(0x20a))/0x7+parseInt(_0x1f6e60(0x185))/0x8+-parseInt(_0x1f6e60(0x1af))/0x9*(parseInt(_0x1f6e60(0x1f1))/0xa);if(_0x2ae61c===_0x336d78)break;else _0x1fa35c['push'](_0x1fa35c['shift']());}catch(_0x2f4009){_0x1fa35c['push'](_0x1fa35c['shift']());}}}(a44_0x31ca,0x94506));function a44_0xecaf(_0x53b4cf,_0x328c5b){_0x53b4cf=_0x53b4cf-0x180;const _0x31cafc=a44_0x31ca();let _0xecaf4b=_0x31cafc[_0x53b4cf];return _0xecaf4b;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x185a25 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a44_0xe97346(0x228)]='workflow:projects';['description']='List\x20all\x20workflow\x20projects';async['execute'](_0x157e0e){const _0x4bac11=a44_0xe97346,{options:_0x5a5060,args:_0x2af7ba,tdx:_0x425c85}=_0x157e0e,_0x1361e4=_0x2af7ba[0x0];try{_0x5a5060[_0x4bac11(0x1c2)]&&_0x1361e4&&console[_0x4bac11(0x1d0)](_0x4bac11(0x186)+_0x1361e4);const _0x39fc36=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x425c85['workflow'][_0x4bac11(0x198)](_0x1361e4,{'limit':_0x5a5060[_0x4bac11(0x1d3)]}),{'verbose':_0x5a5060[_0x4bac11(0x1c2)]}),_0xa9a5b5=_0x39fc36[_0x4bac11(0x1fb)];return console[_0x4bac11(0x1d0)]('✔\x20Found\x20'+_0xa9a5b5[_0x4bac11(0x1c9)]+_0x4bac11(0x22b)+(_0xa9a5b5['length']!==0x1?'s':'')),await handleSDKOutput(_0xa9a5b5,_0x5a5060),0x0;}catch(_0x2fc013){if(_0x2fc013 instanceof SDKError)return console[_0x4bac11(0x1d0)](_0x4bac11(0x1ce)+_0x2fc013[_0x4bac11(0x1ed)]),_0x2fc013[_0x4bac11(0x1c6)]&&console[_0x4bac11(0x1d0)](_0x4bac11(0x1d1)+_0x2fc013[_0x4bac11(0x1c6)]),0x1;throw _0x2fc013;}}}function a44_0x31ca(){const _0x3b9361=['sessionId','split','Resume\x20from:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:attempts','Including\x20subtasks:\x20yes','2068192YYKZpR','retrySession','Output\x20directory:\x20','revision','Revision:\x20','2817vLvQdt','keys','Getting\x20attempt\x20tasks...','Getting\x20attempt\x20details...','\x20is\x20not\x20a\x20directory','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x22?\x20This\x20cannot\x20be\x20undone.','description','Listing\x20workflow\x20sessions...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Listing\x20workflows...','workflow:workflows','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20attempt','Listing\x20workflow\x20attempts...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','includeSubtasks','index','Start\x20a\x20workflow\x20run','verbose','\x20\x20Project\x20ID:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Include\x20retried:\x20yes','cause','Workflow:\x20','delete','length','workflow:retry','Project:\x20','✔\x20Retry\x20started','retryAttempt','Error:\x20','projectId','error','\x20\x20Cause:\x20','List\x20workflows','limit','fileSize','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Select\x20a\x20task\x20to\x20view\x20logs:','Session\x20time:\x20','createdAt','List\x20workflow\x20execution\x20sessions','\x20\x20Location:\x20','params','task','cancelRequested','force','sessions','map','Kill\x20a\x20running\x20attempt','filesExtracted','10818NtEUyy','finishedAt','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20workflow','logFiles','download','\x20\x20New\x20attempt\x20ID:\x20','Reason:\x20','canceling','skipValidation','message','status','Pushing\x20workflow\x20project...','from','2270Fyfmjo','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','done','workflow:tasks','retryAttemptName','Usage:\x20workflow:delete\x20<project-name-or-id>','attempt:','Force:\x20yes','Downloading\x20project\x20','List\x20workflow\x20attempts','data','Error:\x20Attempt\x20ID\x20is\x20required','utf-8','Downloading\x20logs...','Cancelled','fromTask','Error:\x20Invalid\x20parameter\x20format:\x20','Killing\x20attempt...','stringify','...','From\x20task:\x20','workflow:run','push','workflow:kill','workflow:push','6694345PHaoqr','3RjUxZv','session:','sessionTime','reason','✔\x20Workflow\x20run\x20started','Fetching\x20log\x20files...','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','log','Expected\x20format:\x20--param\x20key=value','fs/promises','isArray','isDirectory','\x20task','json','624495vIVZFf','Parameters:\x20','format','round','Error:\x20Invalid\x20JSON\x20in\x20--params','yes','workflows','projectName','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Show\x20tasks\x20for\x20an\x20attempt','1875cTYlvD','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Project\x20filter:\x20','Error:\x20Workflow\x20identifier\x20is\x20required','Attempt\x20ID:\x20','name','project','Retry\x20a\x20session\x20or\x20attempt','\x20project','includeRetried','run','Project\x20name:\x20','select','stat','taskName','4660648tNUbGY','Pattern:\x20','success','2375388vwGczY','Starting\x20workflow\x20run...','indexOf','attempt','\x20\x20Project:\x20','Error:\x20Project\x20name\x20is\x20required','parse','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:sessions','substring','Retrying\x20attempt...','Status:\x20','getTime','Validation:\x20skipped','\x20session','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','projects','attemptId','Params:\x20','workflow:delete','✔\x20Found\x20','\x20\x20Session\x20ID:\x20','Retrying\x20session...','execute','\x20\x20Revision:\x20','workflow','startsWith'];a44_0x31ca=function(){return _0x3b9361;};return a44_0x31ca();}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x1ba);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1d2);async['execute'](_0x16c196){const _0x10bc50=a44_0xe97346,{options:_0x154053,args:_0xb613f3,tdx:_0x4c097b}=_0x16c196,_0x399755=_0xb613f3[0x0];try{_0x154053['verbose']&&_0x399755&&console[_0x10bc50(0x1d0)](_0x10bc50(0x225)+_0x399755);const _0x252255=await withSpinner(_0x10bc50(0x1b9),()=>_0x4c097b[_0x10bc50(0x1a1)][_0x10bc50(0x21f)](_0x399755,{'limit':_0x154053[_0x10bc50(0x1d3)]}),{'verbose':_0x154053[_0x10bc50(0x1c2)]}),_0x49d0d8=_0x252255[_0x10bc50(0x1fb)];return console[_0x10bc50(0x1d0)](_0x10bc50(0x19c)+_0x49d0d8[_0x10bc50(0x1c9)]+_0x10bc50(0x1e6)+(_0x49d0d8[_0x10bc50(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x49d0d8,_0x154053),0x0;}catch(_0x2fee1b){if(_0x2fee1b instanceof SDKError)return console[_0x10bc50(0x1d0)](_0x10bc50(0x1ce)+_0x2fee1b['message']),_0x2fee1b[_0x10bc50(0x1c6)]&&console[_0x10bc50(0x1d0)](_0x10bc50(0x1d1)+_0x2fee1b[_0x10bc50(0x1c6)]),0x1;throw _0x2fee1b;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a44_0xe97346(0x190);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1d9);async['execute'](_0x178d90){const _0xc97a9e=a44_0xe97346,{options:_0x532323,args:_0x23500f,tdx:_0x323cbb}=_0x178d90;let _0x3143a7,_0x52e260;if(_0x23500f[0x0]){const _0x560b0b=_0x23500f[0x0][_0xc97a9e(0x1a4)]('.');if(_0x560b0b[_0xc97a9e(0x1c9)]===0x1)_0x3143a7=_0x560b0b[0x0];else{if(_0x560b0b[_0xc97a9e(0x1c9)]===0x2)[_0x3143a7,_0x52e260]=_0x560b0b;else return console['error'](_0xc97a9e(0x224)),0x1;}}try{if(_0x532323[_0xc97a9e(0x1c2)]){if(_0x3143a7&&_0x52e260)console[_0xc97a9e(0x1d0)]('Filter:\x20'+_0x3143a7+'.'+_0x52e260);else _0x3143a7&&console[_0xc97a9e(0x1d0)]('Filter:\x20project='+_0x3143a7);const _0x266583=_0x532323['status'];_0x266583&&console['error'](_0xc97a9e(0x193)+_0x266583);}const _0x320a5d=await withSpinner(_0xc97a9e(0x1b7),()=>_0x323cbb[_0xc97a9e(0x1a1)][_0xc97a9e(0x1df)]({'projectName':_0x3143a7,'workflowName':_0x52e260,'status':_0x532323[_0xc97a9e(0x1ee)],'fromTime':_0x532323[_0xc97a9e(0x1f0)],'toTime':_0x532323['to'],'limit':_0x532323[_0xc97a9e(0x1d3)]}),{'verbose':_0x532323[_0xc97a9e(0x1c2)]}),_0x4fb3e3=_0x320a5d[_0xc97a9e(0x1fb)];return console[_0xc97a9e(0x1d0)](_0xc97a9e(0x19c)+_0x4fb3e3[_0xc97a9e(0x1c9)]+_0xc97a9e(0x196)+(_0x4fb3e3[_0xc97a9e(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x4fb3e3,_0x532323),0x0;}catch(_0x226aeb){if(_0x226aeb instanceof SDKError)return console[_0xc97a9e(0x1d0)](_0xc97a9e(0x1ce)+_0x226aeb['message']),_0x226aeb[_0xc97a9e(0x1c6)]&&console[_0xc97a9e(0x1d0)](_0xc97a9e(0x1d1)+_0x226aeb['cause']),0x1;throw _0x226aeb;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x1a8);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1fa);async[a44_0xe97346(0x19f)](_0x4f8fdb){const _0x3f6904=a44_0xe97346,{options:_0x2e2f33,args:_0x5e0107,tdx:_0x145a36}=_0x4f8fdb;let _0x528633,_0xb0bc2d;if(_0x5e0107[0x0]){const _0x3ec8e6=_0x5e0107[0x0][_0x3f6904(0x1a4)]('.');if(_0x3ec8e6['length']===0x1)_0x528633=_0x3ec8e6[0x0];else{if(_0x3ec8e6['length']===0x2)[_0x528633,_0xb0bc2d]=_0x3ec8e6;else return console['error'](_0x3f6904(0x224)),0x1;}}try{const _0x45d761=_0x2e2f33[_0x3f6904(0x22c)];if(_0x2e2f33[_0x3f6904(0x1c2)]){if(_0x528633&&_0xb0bc2d)console[_0x3f6904(0x1d0)]('Filter:\x20'+_0x528633+'.'+_0xb0bc2d);else _0x528633&&console[_0x3f6904(0x1d0)]('Filter:\x20project='+_0x528633);_0x45d761&&console[_0x3f6904(0x1d0)](_0x3f6904(0x1c5));}const _0x3d9b3a=await withSpinner(_0x3f6904(0x1bd),()=>_0x145a36[_0x3f6904(0x1a1)]['attempts']({'projectName':_0x528633,'workflowName':_0xb0bc2d,'includeRetried':_0x45d761,'limit':_0x2e2f33[_0x3f6904(0x1d3)]}),{'verbose':_0x2e2f33[_0x3f6904(0x1c2)]}),_0x2d2296=_0x3d9b3a['data'];return console[_0x3f6904(0x1d0)](_0x3f6904(0x19c)+_0x2d2296[_0x3f6904(0x1c9)]+_0x3f6904(0x1bc)+(_0x2d2296[_0x3f6904(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x2d2296,_0x2e2f33),0x0;}catch(_0x10ba90){if(_0x10ba90 instanceof SDKError)return console[_0x3f6904(0x1d0)](_0x3f6904(0x1ce)+_0x10ba90[_0x3f6904(0x1ed)]),_0x10ba90[_0x3f6904(0x1c6)]&&console[_0x3f6904(0x1d0)](_0x3f6904(0x1d1)+_0x10ba90[_0x3f6904(0x1c6)]),0x1;throw _0x10ba90;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0xe97346(0x228)]='workflow:attempt';[a44_0xe97346(0x1b6)]='Show\x20specific\x20attempt\x20details';async[a44_0xe97346(0x19f)](_0x507b8c){const _0x725131=a44_0xe97346,{options:_0x19e800,args:_0x5667f7,tdx:_0x20a75d}=_0x507b8c,_0x5a6aa1=_0x5667f7[0x0];if(!_0x5a6aa1)return console[_0x725131(0x1d0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x19e800[_0x725131(0x1c2)]&&console[_0x725131(0x1d0)]('Attempt\x20ID:\x20'+_0x5a6aa1);const _0x45f7a3=await withSpinner(_0x725131(0x1b2),()=>_0x20a75d[_0x725131(0x1a1)][_0x725131(0x18b)](_0x5a6aa1),{'verbose':_0x19e800[_0x725131(0x1c2)]}),_0x12590c=_0x45f7a3[_0x725131(0x1fb)];let _0x307810;!_0x12590c[_0x725131(0x1f3)]?_0x307810=_0x12590c[_0x725131(0x1dd)]?_0x725131(0x1eb):'running':_0x307810=_0x12590c[_0x725131(0x187)]?_0x725131(0x187):_0x725131(0x1d0);let _0x35b3ff;if(_0x12590c[_0x725131(0x1d8)]&&_0x12590c[_0x725131(0x1e4)]){const _0x293ebc=new Date(_0x12590c['createdAt'])[_0x725131(0x194)](),_0xc0b3ee=new Date(_0x12590c[_0x725131(0x1e4)])[_0x725131(0x194)]();_0x35b3ff=Math[_0x725131(0x21c)]((_0xc0b3ee-_0x293ebc)/0x3e8);}const _0x79d2b={'attempt_id':_0x12590c['id'],'status':_0x307810,..._0x12590c[_0x725131(0x1c0)]!==undefined&&{'index':_0x12590c['index']},..._0x12590c[_0x725131(0x229)]&&{'project':_0x12590c[_0x725131(0x229)][_0x725131(0x228)]},..._0x12590c[_0x725131(0x1a1)]&&{'workflow':_0x12590c[_0x725131(0x1a1)]['name']},..._0x12590c[_0x725131(0x1a3)]&&{'session_id':_0x12590c['sessionId']},..._0x12590c['sessionTime']&&{'session_time':_0x12590c[_0x725131(0x20d)]},..._0x12590c[_0x725131(0x1f5)]&&{'retry_attempt':_0x12590c[_0x725131(0x1f5)]},..._0x35b3ff!==undefined&&{'duration_sec':_0x35b3ff},..._0x12590c[_0x725131(0x1d8)]&&{'created_at':_0x12590c['createdAt']},..._0x12590c[_0x725131(0x1e4)]&&{'finished_at':_0x12590c['finishedAt']},...Object[_0x725131(0x1b0)](_0x12590c[_0x725131(0x1db)])[_0x725131(0x1c9)]>0x0&&{'params':_0x12590c[_0x725131(0x1db)]}};return await handleSingleObjectOutput(_0x79d2b,_0x19e800),0x0;}catch(_0x585e5a){if(_0x585e5a instanceof SDKError)return console[_0x725131(0x1d0)](_0x725131(0x1ce)+_0x585e5a['message']),_0x585e5a[_0x725131(0x1c6)]&&console[_0x725131(0x1d0)](_0x725131(0x1d1)+_0x585e5a[_0x725131(0x1c6)]),0x1;throw _0x585e5a;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a44_0xe97346(0x1f4);['description']=a44_0xe97346(0x222);async[a44_0xe97346(0x19f)](_0x2ca355){const _0x4c6147=a44_0xe97346,{options:_0x420afd,args:_0x5b120b,tdx:_0x424059}=_0x2ca355,_0x756f8b=_0x5b120b[0x0];if(!_0x756f8b)return console[_0x4c6147(0x1d0)](_0x4c6147(0x1fc)),0x1;try{const _0x10572a=_0x420afd[_0x4c6147(0x1bf)];_0x420afd['verbose']&&(console['error'](_0x4c6147(0x227)+_0x756f8b),_0x10572a&&console[_0x4c6147(0x1d0)](_0x4c6147(0x1a9)));const _0x536681=await withSpinner(_0x4c6147(0x1b1),()=>_0x424059[_0x4c6147(0x1a1)]['tasks'](_0x756f8b,_0x10572a||![]),{'verbose':_0x420afd['verbose']}),_0x1c44f4=_0x536681[_0x4c6147(0x1fb)];return console[_0x4c6147(0x1d0)]('✔\x20Found\x20'+_0x1c44f4[_0x4c6147(0x1c9)]+_0x4c6147(0x217)+(_0x1c44f4[_0x4c6147(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x1c44f4,_0x420afd),0x0;}catch(_0x1ca01d){if(_0x1ca01d instanceof SDKError)return console['error'](_0x4c6147(0x1ce)+_0x1ca01d[_0x4c6147(0x1ed)]),_0x1ca01d[_0x4c6147(0x1c6)]&&console['error'](_0x4c6147(0x1d1)+_0x1ca01d[_0x4c6147(0x1c6)]),0x1;throw _0x1ca01d;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0xe97346(0x228)]='workflow:logs';[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1c4);async['execute'](_0x923dd5){const _0x21f521=a44_0xe97346,{options:_0x1c1272,args:_0x105bcb,tdx:_0x59e222}=_0x923dd5,_0x262f87=_0x105bcb[0x0];let _0x2cb890=_0x105bcb[0x1];if(!_0x262f87)return console['error'](_0x21f521(0x1fc)),0x1;try{_0x1c1272[_0x21f521(0x1c2)]&&(console[_0x21f521(0x1d0)]('Attempt\x20ID:\x20'+_0x262f87),_0x2cb890&&console['error']('Task\x20name:\x20'+_0x2cb890));const _0x436612=await withSpinner(_0x21f521(0x210),()=>_0x59e222[_0x21f521(0x1a1)][_0x21f521(0x1e7)](_0x262f87,_0x2cb890),{'verbose':_0x1c1272[_0x21f521(0x1c2)]}),_0x2478cb=_0x436612[_0x21f521(0x1fb)];if(_0x2478cb['length']===0x0)return console[_0x21f521(0x1d0)](_0x21f521(0x1b4)),0x0;if(!_0x2cb890&&(_0x1c1272[_0x21f521(0x218)]||_0x1c1272[_0x21f521(0x21b)]))return await handleSDKOutput(_0x2478cb,_0x1c1272),0x0;if(!_0x2cb890){const _0x4f1941=_0x2478cb[_0x21f521(0x1e0)](_0x320955=>({'title':_0x320955[_0x21f521(0x184)]+'\x20('+formatBytes(_0x320955[_0x21f521(0x1d4)])+')','value':_0x320955[_0x21f521(0x184)]})),_0x17d3e8=await a44_0x185a25({'type':_0x21f521(0x182),'name':_0x21f521(0x1dc),'message':_0x21f521(0x1d6),'choices':_0x4f1941});if(!_0x17d3e8['task'])return console[_0x21f521(0x1d0)](_0x21f521(0x1ff)),0x0;_0x2cb890=_0x17d3e8['task'];}const _0x1637f7=await withSpinner(_0x21f521(0x1fe),()=>_0x59e222[_0x21f521(0x1a1)]['logs'](_0x262f87,_0x2cb890),{'verbose':_0x1c1272[_0x21f521(0x1c2)]}),_0xc54472=_0x1637f7[_0x21f521(0x1fb)];return _0xc54472?console[_0x21f521(0x212)](_0xc54472):console[_0x21f521(0x1d0)]('No\x20log\x20content\x20found'),0x0;}catch(_0x1f8a87){if(_0x1f8a87 instanceof SDKError)return console[_0x21f521(0x1d0)](_0x21f521(0x1ce)+_0x1f8a87[_0x21f521(0x1ed)]),_0x1f8a87[_0x21f521(0x1c6)]&&console[_0x21f521(0x1d0)](_0x21f521(0x1d1)+_0x1f8a87[_0x21f521(0x1c6)]),0x1;throw _0x1f8a87;}}}export class WorkflowKillCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x208);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1e1);async[a44_0xe97346(0x19f)](_0x5cd6df){const _0x572316=a44_0xe97346,{options:_0x136609,args:_0x5cac5f,tdx:_0x565db5}=_0x5cd6df,_0x4871a2=_0x5cac5f[0x0];if(!_0x4871a2)return console[_0x572316(0x1d0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x37608a=_0x136609[_0x572316(0x20e)];_0x136609[_0x572316(0x1c2)]&&(console[_0x572316(0x1d0)](_0x572316(0x227)+_0x4871a2),_0x37608a&&console[_0x572316(0x1d0)](_0x572316(0x1ea)+_0x37608a));if(!_0x136609[_0x572316(0x21e)]){const _0x1f1f1a=await confirm(_0x572316(0x221)+_0x4871a2+'?');if(!_0x1f1f1a)return console[_0x572316(0x1d0)]('Cancelled'),0x0;}const _0x187d91=await withSpinner(_0x572316(0x202),()=>_0x565db5['workflow']['kill'](_0x4871a2,_0x37608a),{'verbose':_0x136609[_0x572316(0x1c2)]}),_0x1da64e=_0x187d91[_0x572316(0x1fb)];return console[_0x572316(0x1d0)]('✔\x20'+_0x1da64e),0x0;}catch(_0x1a1bf2){if(_0x1a1bf2 instanceof SDKError)return console[_0x572316(0x1d0)]('Error:\x20'+_0x1a1bf2[_0x572316(0x1ed)]),_0x1a1bf2['cause']&&console[_0x572316(0x1d0)](_0x572316(0x1d1)+_0x1a1bf2[_0x572316(0x1c6)]),0x1;throw _0x1a1bf2;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x1ca);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x22a);async[a44_0xe97346(0x19f)](_0xb3208){const _0x56be08=a44_0xe97346,{options:_0x34ed85,args:_0x51c99c,tdx:_0x3fd078}=_0xb3208,_0x1c5295=_0x51c99c[0x0];if(!_0x1c5295)return console[_0x56be08(0x1d0)](_0x56be08(0x1f2)),console[_0x56be08(0x1d0)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x170aef=![],_0x378b97=_0x1c5295;if(_0x1c5295[_0x56be08(0x1a2)](_0x56be08(0x20c)))_0x170aef=!![],_0x378b97=_0x1c5295[_0x56be08(0x191)](0x8);else{if(_0x1c5295[_0x56be08(0x1a2)](_0x56be08(0x1f7)))_0x170aef=![],_0x378b97=_0x1c5295[_0x56be08(0x191)](0x8);else return console[_0x56be08(0x1d0)](_0x56be08(0x18f)),console[_0x56be08(0x1d0)](_0x56be08(0x1e5)),0x1;}try{const _0x2a7a2d=_0x34ed85[_0x56be08(0x200)],_0x253fcb=_0x34ed85['resumeFrom'],_0x10fae7=_0x34ed85['params'],_0x5b563a=_0x34ed85[_0x56be08(0x1de)];_0x34ed85['verbose']&&(console[_0x56be08(0x1d0)]('Target:\x20'+(_0x170aef?'session':_0x56be08(0x18b))+'\x20'+_0x378b97),_0x2a7a2d&&console['error'](_0x56be08(0x205)+_0x2a7a2d),_0x253fcb&&console['error'](_0x56be08(0x1a5)+_0x253fcb),_0x10fae7&&console['error'](_0x56be08(0x19a)+_0x10fae7),_0x5b563a&&console[_0x56be08(0x1d0)](_0x56be08(0x1f8)));let _0x2593e2;if(_0x10fae7)try{if(_0x10fae7[_0x56be08(0x1a2)]('@')){const _0x2c0cd9=await import(_0x56be08(0x214)),_0x37bff9=_0x10fae7['substring'](0x1),_0x4c98a3=await _0x2c0cd9['readFile'](_0x37bff9,_0x56be08(0x1fd));_0x2593e2=JSON['parse'](_0x4c98a3);}else _0x2593e2=JSON[_0x56be08(0x18e)](_0x10fae7);}catch{return console[_0x56be08(0x1d0)](_0x56be08(0x21d)),0x1;}if(!_0x34ed85[_0x56be08(0x21e)]){const _0x29a05e=await confirm(_0x56be08(0x1b8)+(_0x170aef?'session':'attempt')+'\x20'+_0x378b97+'?');if(!_0x29a05e)return console['error']('Cancelled'),0x0;}let _0x430a64;_0x170aef?_0x430a64=await withSpinner(_0x56be08(0x19e),()=>_0x3fd078[_0x56be08(0x1a1)][_0x56be08(0x1ab)](_0x378b97,{'fromTask':_0x2a7a2d,'retryParams':_0x2593e2}),{'verbose':_0x34ed85[_0x56be08(0x1c2)]}):_0x430a64=await withSpinner(_0x56be08(0x192),()=>_0x3fd078[_0x56be08(0x1a1)][_0x56be08(0x1cd)](_0x378b97,{'resumeFrom':_0x253fcb,'retryParams':_0x2593e2,'force':_0x5b563a}),{'verbose':_0x34ed85[_0x56be08(0x1c2)]});const _0x13f1d1=_0x430a64[_0x56be08(0x1fb)];return console['error'](_0x56be08(0x1cc)),console[_0x56be08(0x1d0)](_0x56be08(0x1e9)+_0x13f1d1[_0x56be08(0x199)]),console[_0x56be08(0x1d0)](_0x56be08(0x19d)+_0x13f1d1[_0x56be08(0x1a3)]),0x0;}catch(_0xb962d2){if(_0xb962d2 instanceof SDKError)return console[_0x56be08(0x1d0)](_0x56be08(0x1ce)+_0xb962d2[_0x56be08(0x1ed)]),_0xb962d2['cause']&&console[_0x56be08(0x1d0)]('\x20\x20Cause:\x20'+_0xb962d2['cause']),0x1;throw _0xb962d2;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x206);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1c1);async[a44_0xe97346(0x19f)](_0x10a05c){const _0x2c89be=a44_0xe97346,{options:_0x52e035,args:_0x17c724,tdx:_0x3d598b}=_0x10a05c,_0x9528f8=_0x17c724[0x0];if(!_0x9528f8)return console[_0x2c89be(0x1d0)](_0x2c89be(0x226)),console[_0x2c89be(0x1d0)](_0x2c89be(0x211)),0x1;const _0x1f194c=_0x52e035['param'],_0x1f8acf=_0x52e035['sessionTime'],_0x55921a={};if(_0x1f194c&&Array[_0x2c89be(0x215)](_0x1f194c))for(const _0x4b9d17 of _0x1f194c){const _0x270125=_0x4b9d17[_0x2c89be(0x18a)]('=');if(_0x270125===-0x1)return console['error'](_0x2c89be(0x201)+_0x4b9d17),console[_0x2c89be(0x1d0)](_0x2c89be(0x213)),0x1;const _0x533228=_0x4b9d17[_0x2c89be(0x191)](0x0,_0x270125),_0x3cc31b=_0x4b9d17[_0x2c89be(0x191)](_0x270125+0x1);try{_0x55921a[_0x533228]=JSON[_0x2c89be(0x18e)](_0x3cc31b);}catch{_0x55921a[_0x533228]=_0x3cc31b;}}_0x52e035['verbose']&&(console[_0x2c89be(0x1d0)](_0x2c89be(0x1c7)+_0x9528f8),Object['keys'](_0x55921a)['length']>0x0&&console[_0x2c89be(0x1d0)](_0x2c89be(0x21a)+JSON[_0x2c89be(0x203)](_0x55921a)),_0x1f8acf&&console['error'](_0x2c89be(0x1d7)+_0x1f8acf));const _0x46d736=await withSpinner(_0x2c89be(0x189),()=>_0x3d598b[_0x2c89be(0x1a1)][_0x2c89be(0x180)](_0x9528f8,_0x55921a,{'sessionTime':_0x1f8acf}),{'verbose':_0x52e035[_0x2c89be(0x1c2)]}),_0x5a282f=_0x46d736[_0x2c89be(0x1fb)];return console['error'](_0x2c89be(0x20f)),console[_0x2c89be(0x1d0)]('\x20\x20Attempt\x20ID:\x20'+_0x5a282f['id']),console[_0x2c89be(0x1d0)](_0x2c89be(0x19d)+_0x5a282f['sessionId']),console[_0x2c89be(0x1d0)](_0x2c89be(0x18c)+_0x5a282f[_0x2c89be(0x229)]?.[_0x2c89be(0x228)]),console[_0x2c89be(0x1d0)]('\x20\x20Workflow:\x20'+_0x5a282f[_0x2c89be(0x1a1)]?.[_0x2c89be(0x228)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a44_0xe97346(0x228)]='workflow:download';[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1bb);async[a44_0xe97346(0x19f)](_0x3f8503){const _0x742500=a44_0xe97346,{options:_0x4f3b3c,args:_0x18a20c,tdx:_0x522b2b}=_0x3f8503,_0x37151b=_0x18a20c[0x0],_0x1fd137=_0x18a20c[0x1]||'.';if(!_0x37151b)return console[_0x742500(0x1d0)](_0x742500(0x18d)),console[_0x742500(0x1d0)](_0x742500(0x1be)),0x1;const _0x1a836d=_0x4f3b3c[_0x742500(0x1ad)];_0x4f3b3c['verbose']&&(console[_0x742500(0x1d0)](_0x742500(0x1cb)+_0x37151b),console[_0x742500(0x1d0)](_0x742500(0x1ac)+_0x1fd137),_0x1a836d&&console[_0x742500(0x1d0)]('Revision:\x20'+_0x1a836d));const _0x3570c4=await withSpinner(_0x742500(0x1f9)+_0x37151b+_0x742500(0x204),()=>_0x522b2b[_0x742500(0x1a1)][_0x742500(0x1e8)](_0x37151b,_0x1fd137,{'revision':_0x1a836d}),{'verbose':_0x4f3b3c[_0x742500(0x1c2)]}),_0x273f6d=_0x3570c4[_0x742500(0x1fb)];return console[_0x742500(0x1d0)]('✔\x20Downloaded\x20'+_0x273f6d[_0x742500(0x220)]),console[_0x742500(0x1d0)]('\x20\x20Revision:\x20'+_0x273f6d[_0x742500(0x1ad)]),console[_0x742500(0x1d0)]('\x20\x20Files\x20extracted:\x20'+_0x273f6d[_0x742500(0x1e2)]),console[_0x742500(0x1d0)](_0x742500(0x1da)+_0x1fd137+'/'+_0x273f6d['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x209);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x197);async['execute'](_0x114fb1){const _0x14988c=a44_0xe97346,{options:_0x5a1590,args:_0x4cc5e6,tdx:_0x31874d}=_0x114fb1;let _0x5d2451='.',_0x10be1b=_0x5a1590[_0x14988c(0x228)];if(_0x4cc5e6[0x0]){const {promises:_0x346892}=await import('fs');try{const _0x2823a0=await _0x346892[_0x14988c(0x183)](_0x4cc5e6[0x0]);if(_0x2823a0[_0x14988c(0x216)]())_0x5d2451=_0x4cc5e6[0x0];else return console['error']('Error:\x20'+_0x4cc5e6[0x0]+_0x14988c(0x1b3)),0x1;}catch{_0x10be1b=_0x4cc5e6[0x0],_0x5d2451='.';}}const _0x1caeeb=_0x5a1590[_0x14988c(0x1ad)],_0x121504=_0x5a1590[_0x14988c(0x1ec)];_0x5a1590[_0x14988c(0x1c2)]&&(console[_0x14988c(0x1d0)]('Project\x20directory:\x20'+_0x5d2451),_0x10be1b&&console[_0x14988c(0x1d0)](_0x14988c(0x181)+_0x10be1b),_0x1caeeb&&console['error'](_0x14988c(0x1ae)+_0x1caeeb),_0x121504&&console[_0x14988c(0x1d0)](_0x14988c(0x195)));const _0x13b702=await withSpinner(_0x14988c(0x1ef),()=>_0x31874d[_0x14988c(0x1a1)][_0x14988c(0x207)](_0x5d2451,{'projectName':_0x10be1b,'revision':_0x1caeeb,'skipValidation':_0x121504}),{'verbose':_0x5a1590[_0x14988c(0x1c2)]}),_0x4bdb50=_0x13b702[_0x14988c(0x1fb)];return console['error']('✔\x20Pushed\x20'+_0x4bdb50[_0x14988c(0x220)]),console[_0x14988c(0x1d0)]('\x20\x20Project\x20ID:\x20'+_0x4bdb50[_0x14988c(0x1cf)]),console[_0x14988c(0x1d0)](_0x14988c(0x1a0)+_0x4bdb50['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0xe97346(0x228)]=a44_0xe97346(0x19b);[a44_0xe97346(0x1b6)]=a44_0xe97346(0x1a7);async[a44_0xe97346(0x19f)](_0x1090b7){const _0x94f3c1=a44_0xe97346,{options:_0x5472e0,args:_0x3c0c6b,tdx:_0x5a33ac}=_0x1090b7,_0x101379=_0x3c0c6b[0x0];if(!_0x101379)return console['error'](_0x94f3c1(0x1d5)),console['error'](_0x94f3c1(0x1f6)),0x1;_0x5472e0[_0x94f3c1(0x1c2)]&&console['error']('Project:\x20'+_0x101379);if(!_0x5472e0[_0x94f3c1(0x21e)]){const _0x284a7c=await confirm(_0x94f3c1(0x1a6)+_0x101379+_0x94f3c1(0x1b5));if(!_0x284a7c)return console[_0x94f3c1(0x1d0)]('Cancelled'),0x0;}const _0x1d12c8=await withSpinner('Deleting\x20project\x20'+_0x101379+_0x94f3c1(0x204),()=>_0x5a33ac['workflow'][_0x94f3c1(0x1c8)](_0x101379),{'verbose':_0x5472e0[_0x94f3c1(0x1c2)]}),_0x16ab4b=_0x1d12c8[_0x94f3c1(0x1fb)];return console[_0x94f3c1(0x1d0)]('✔\x20Deleted\x20project\x20'+_0x16ab4b[_0x94f3c1(0x220)]),console['error'](_0x94f3c1(0x1c3)+_0x16ab4b[_0x94f3c1(0x1cf)]),0x0;}}
|
|
1
|
+
const a44_0x5525a1=a44_0x31da;(function(_0x97c196,_0x23190b){const _0xbf111c=a44_0x31da,_0x264ded=_0x97c196();while(!![]){try{const _0x2d0e0a=parseInt(_0xbf111c(0x227))/0x1+-parseInt(_0xbf111c(0x20b))/0x2+parseInt(_0xbf111c(0x1ed))/0x3*(-parseInt(_0xbf111c(0x212))/0x4)+-parseInt(_0xbf111c(0x239))/0x5*(-parseInt(_0xbf111c(0x1b1))/0x6)+parseInt(_0xbf111c(0x1fe))/0x7*(parseInt(_0xbf111c(0x21b))/0x8)+parseInt(_0xbf111c(0x1c2))/0x9+-parseInt(_0xbf111c(0x207))/0xa;if(_0x2d0e0a===_0x23190b)break;else _0x264ded['push'](_0x264ded['shift']());}catch(_0x4c5318){_0x264ded['push'](_0x264ded['shift']());}}}(a44_0x225d,0xbe44a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x31da(_0x35b105,_0x2c6c27){_0x35b105=_0x35b105-0x1b0;const _0x225d53=a44_0x225d();let _0x31da06=_0x225d53[_0x35b105];return _0x31da06;}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x225d(){const _0x507fbe=['Error:\x20Attempt\x20ID\x20is\x20required','Expected\x20format:\x20--param\x20key=value','Show\x20logs\x20for\x20a\x20workflow\x20attempt','name','substring','workflow:run','params','Filter:\x20project=','\x20session','isDirectory','logFiles','workflow:attempt','workflow:logs','\x20\x20Attempt\x20ID:\x20','attempts','List\x20workflows','Show\x20specific\x20attempt\x20details','session','workflows','\x20\x20New\x20attempt\x20ID:\x20','Error:\x20Workflow\x20identifier\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','download','✔\x20Retry\x20started','\x20\x20Files\x20extracted:\x20','\x20task','✔\x20Found\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Project\x20ID:\x20','Filter:\x20','717gOodNB','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','List\x20workflow\x20attempts','workflow:delete','Project\x20name:\x20','message','Error:\x20Invalid\x20JSON\x20in\x20--params','sessionId','Task\x20name:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','logs','yes','success','canceling','\x20\x20Cause:\x20','...','Validation:\x20skipped','9153767VannTt','attempt','verbose','projects','split','project','task','Error:\x20','workflow:projects','3984930yYnnVT','Select\x20a\x20task\x20to\x20view\x20logs:','Usage:\x20workflow:delete\x20<project-name-or-id>','Attempt\x20ID:\x20','2506410aTZpbe','Force:\x20yes','Including\x20subtasks:\x20yes','Params:\x20','List\x20all\x20workflow\x20projects','includeRetried','Session\x20time:\x20','10196VPihPR','stringify','skipValidation','workflow:push','\x20\x20Session\x20ID:\x20','Listing\x20workflows...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','sessions','\x20\x20Revision:\x20','8NGCTdc','\x20project','stat','getTime','Retrying\x20session...','Listing\x20workflow\x20sessions...','Revision:\x20','Starting\x20workflow\x20run...','Pattern:\x20','execute','readFile','revision','1319150eWXnHu','startsWith','\x20\x20Location:\x20','error','session:','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','retrySession','retryAttemptName','param','limit','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','✔\x20Workflow\x20run\x20started','running','description','\x20\x20Workflow:\x20','\x20is\x20not\x20a\x20directory','Retry\x20a\x20session\x20or\x20attempt','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','535CEdFYI','Downloading\x20logs...','Parameters:\x20','fs/promises','isArray','round','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','projectId','Project\x20filter:\x20','Output\x20directory:\x20','Getting\x20attempt\x20details...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','length','\x22?\x20This\x20cannot\x20be\x20undone.','indexOf','keys','Project:\x20','Target:\x20','force','format','workflow','Error:\x20Project\x20name\x20is\x20required','From\x20task:\x20','workflow:attempts','cause','json','Getting\x20attempt\x20tasks...','workflow:workflows','7422sNiZrb','parse','Reason:\x20','utf-8','\x20\x20Project:\x20','index','No\x20log\x20content\x20found','Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Cancelled','✔\x20Pushed\x20','Listing\x20workflow\x20projects...','delete','status','finishedAt','attempt:','filesExtracted','2529513jzHslZ','data','workflow:tasks','select','from','Include\x20retried:\x20yes','createdAt','run','Retrying\x20attempt...','cancelRequested','fromTask','sessionTime','projectName'];a44_0x225d=function(){return _0x507fbe;};return a44_0x225d();}import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x2ce703 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a44_0x5525a1(0x206);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x20f);async[a44_0x5525a1(0x224)](_0x555a72){const _0x18dce0=a44_0x5525a1,{options:_0x5ba918,args:_0x3584af,tdx:_0x50e85}=_0x555a72,_0x136f33=_0x3584af[0x0];try{_0x5ba918[_0x18dce0(0x200)]&&_0x136f33&&console['error'](_0x18dce0(0x223)+_0x136f33);const _0x2f36bb=await withSpinner(_0x18dce0(0x1bc),()=>_0x50e85['workflow'][_0x18dce0(0x201)](_0x136f33,{'limit':_0x5ba918[_0x18dce0(0x230)]}),{'verbose':_0x5ba918[_0x18dce0(0x200)]}),_0x719909=_0x2f36bb['data'];return console[_0x18dce0(0x22a)](_0x18dce0(0x1e9)+_0x719909['length']+_0x18dce0(0x21c)+(_0x719909[_0x18dce0(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x719909,_0x5ba918),0x0;}catch(_0x308acb){if(_0x308acb instanceof SDKError)return console[_0x18dce0(0x22a)]('Error:\x20'+_0x308acb[_0x18dce0(0x1f2)]),_0x308acb[_0x18dce0(0x252)]&&console[_0x18dce0(0x22a)](_0x18dce0(0x1fb)+_0x308acb[_0x18dce0(0x252)]),0x1;throw _0x308acb;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1b0);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1de);async[a44_0x5525a1(0x224)](_0x3a229c){const _0x50ef67=a44_0x5525a1,{options:_0x414d2f,args:_0x3c6cf7,tdx:_0x1cd558}=_0x3a229c,_0x2c468a=_0x3c6cf7[0x0];try{_0x414d2f[_0x50ef67(0x200)]&&_0x2c468a&&console['error'](_0x50ef67(0x241)+_0x2c468a);const _0x597701=await withSpinner(_0x50ef67(0x217),()=>_0x1cd558['workflow'][_0x50ef67(0x1e1)](_0x2c468a,{'limit':_0x414d2f[_0x50ef67(0x230)]}),{'verbose':_0x414d2f[_0x50ef67(0x200)]}),_0x353025=_0x597701['data'];return console['error']('✔\x20Found\x20'+_0x353025[_0x50ef67(0x246)]+'\x20workflow'+(_0x353025[_0x50ef67(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x353025,_0x414d2f),0x0;}catch(_0x65d068){if(_0x65d068 instanceof SDKError)return console[_0x50ef67(0x22a)](_0x50ef67(0x205)+_0x65d068[_0x50ef67(0x1f2)]),_0x65d068[_0x50ef67(0x252)]&&console['error'](_0x50ef67(0x1fb)+_0x65d068['cause']),0x1;throw _0x65d068;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]='workflow:sessions';[a44_0x5525a1(0x234)]='List\x20workflow\x20execution\x20sessions';async[a44_0x5525a1(0x224)](_0x1e93ad){const _0x5b496e=a44_0x5525a1,{options:_0x1583b9,args:_0x2a4744,tdx:_0xabb219}=_0x1e93ad;let _0x51f15f,_0x3df0c6;if(_0x2a4744[0x0]){const _0x4bf160=_0x2a4744[0x0][_0x5b496e(0x202)]('.');if(_0x4bf160[_0x5b496e(0x246)]===0x1)_0x51f15f=_0x4bf160[0x0];else{if(_0x4bf160[_0x5b496e(0x246)]===0x2)[_0x51f15f,_0x3df0c6]=_0x4bf160;else return console[_0x5b496e(0x22a)](_0x5b496e(0x1ee)),0x1;}}try{if(_0x1583b9[_0x5b496e(0x200)]){if(_0x51f15f&&_0x3df0c6)console[_0x5b496e(0x22a)](_0x5b496e(0x1ec)+_0x51f15f+'.'+_0x3df0c6);else _0x51f15f&&console[_0x5b496e(0x22a)]('Filter:\x20project='+_0x51f15f);const _0x18ab7d=_0x1583b9['status'];_0x18ab7d&&console['error']('Status:\x20'+_0x18ab7d);}const _0x27f40a=await withSpinner(_0x5b496e(0x220),()=>_0xabb219[_0x5b496e(0x24e)][_0x5b496e(0x219)]({'projectName':_0x51f15f,'workflowName':_0x3df0c6,'status':_0x1583b9[_0x5b496e(0x1be)],'fromTime':_0x1583b9[_0x5b496e(0x1c6)],'toTime':_0x1583b9['to'],'limit':_0x1583b9[_0x5b496e(0x230)]}),{'verbose':_0x1583b9[_0x5b496e(0x200)]}),_0x52bfd3=_0x27f40a[_0x5b496e(0x1c3)];return console['error']('✔\x20Found\x20'+_0x52bfd3[_0x5b496e(0x246)]+_0x5b496e(0x1d7)+(_0x52bfd3['length']!==0x1?'s':'')),await handleSDKOutput(_0x52bfd3,_0x1583b9),0x0;}catch(_0x148dae){if(_0x148dae instanceof SDKError)return console[_0x5b496e(0x22a)](_0x5b496e(0x205)+_0x148dae[_0x5b496e(0x1f2)]),_0x148dae['cause']&&console[_0x5b496e(0x22a)](_0x5b496e(0x1fb)+_0x148dae['cause']),0x1;throw _0x148dae;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x251);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1ef);async[a44_0x5525a1(0x224)](_0x494031){const _0x18bf1e=a44_0x5525a1,{options:_0x2402aa,args:_0x1b5bea,tdx:_0x4010a6}=_0x494031;let _0x365b65,_0x3fc83e;if(_0x1b5bea[0x0]){const _0x58ef33=_0x1b5bea[0x0][_0x18bf1e(0x202)]('.');if(_0x58ef33[_0x18bf1e(0x246)]===0x1)_0x365b65=_0x58ef33[0x0];else{if(_0x58ef33[_0x18bf1e(0x246)]===0x2)[_0x365b65,_0x3fc83e]=_0x58ef33;else return console[_0x18bf1e(0x22a)](_0x18bf1e(0x1ee)),0x1;}}try{const _0xfbde9b=_0x2402aa[_0x18bf1e(0x210)];if(_0x2402aa[_0x18bf1e(0x200)]){if(_0x365b65&&_0x3fc83e)console[_0x18bf1e(0x22a)](_0x18bf1e(0x1ec)+_0x365b65+'.'+_0x3fc83e);else _0x365b65&&console[_0x18bf1e(0x22a)](_0x18bf1e(0x1d6)+_0x365b65);_0xfbde9b&&console[_0x18bf1e(0x22a)](_0x18bf1e(0x1c7));}const _0x5ef6ba=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x4010a6[_0x18bf1e(0x24e)][_0x18bf1e(0x1dd)]({'projectName':_0x365b65,'workflowName':_0x3fc83e,'includeRetried':_0xfbde9b,'limit':_0x2402aa[_0x18bf1e(0x230)]}),{'verbose':_0x2402aa[_0x18bf1e(0x200)]}),_0x2bcf02=_0x5ef6ba[_0x18bf1e(0x1c3)];return console[_0x18bf1e(0x22a)](_0x18bf1e(0x1e9)+_0x2bcf02[_0x18bf1e(0x246)]+'\x20attempt'+(_0x2bcf02['length']!==0x1?'s':'')),await handleSDKOutput(_0x2bcf02,_0x2402aa),0x0;}catch(_0x1ae297){if(_0x1ae297 instanceof SDKError)return console[_0x18bf1e(0x22a)](_0x18bf1e(0x205)+_0x1ae297[_0x18bf1e(0x1f2)]),_0x1ae297[_0x18bf1e(0x252)]&&console[_0x18bf1e(0x22a)](_0x18bf1e(0x1fb)+_0x1ae297[_0x18bf1e(0x252)]),0x1;throw _0x1ae297;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1da);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1df);async[a44_0x5525a1(0x224)](_0x343fdd){const _0x341b5a=a44_0x5525a1,{options:_0x2bee2a,args:_0x172069,tdx:_0x56c341}=_0x343fdd,_0x26c4b0=_0x172069[0x0];if(!_0x26c4b0)return console[_0x341b5a(0x22a)](_0x341b5a(0x1cf)),0x1;try{_0x2bee2a[_0x341b5a(0x200)]&&console[_0x341b5a(0x22a)](_0x341b5a(0x20a)+_0x26c4b0);const _0x305cb3=await withSpinner(_0x341b5a(0x243),()=>_0x56c341['workflow'][_0x341b5a(0x1ff)](_0x26c4b0),{'verbose':_0x2bee2a[_0x341b5a(0x200)]}),_0x337f3a=_0x305cb3[_0x341b5a(0x1c3)];let _0x372b7a;!_0x337f3a['done']?_0x372b7a=_0x337f3a[_0x341b5a(0x1cb)]?_0x341b5a(0x1fa):_0x341b5a(0x233):_0x372b7a=_0x337f3a[_0x341b5a(0x1f9)]?_0x341b5a(0x1f9):'error';let _0x87c742;if(_0x337f3a[_0x341b5a(0x1c8)]&&_0x337f3a[_0x341b5a(0x1bf)]){const _0x58f2d5=new Date(_0x337f3a[_0x341b5a(0x1c8)])[_0x341b5a(0x21e)](),_0x523d73=new Date(_0x337f3a[_0x341b5a(0x1bf)])[_0x341b5a(0x21e)]();_0x87c742=Math[_0x341b5a(0x23e)]((_0x523d73-_0x58f2d5)/0x3e8);}const _0x14a73e={'attempt_id':_0x337f3a['id'],'status':_0x372b7a,..._0x337f3a[_0x341b5a(0x1b6)]!==undefined&&{'index':_0x337f3a[_0x341b5a(0x1b6)]},..._0x337f3a[_0x341b5a(0x203)]&&{'project':_0x337f3a[_0x341b5a(0x203)][_0x341b5a(0x1d2)]},..._0x337f3a[_0x341b5a(0x24e)]&&{'workflow':_0x337f3a[_0x341b5a(0x24e)][_0x341b5a(0x1d2)]},..._0x337f3a[_0x341b5a(0x1f4)]&&{'session_id':_0x337f3a[_0x341b5a(0x1f4)]},..._0x337f3a[_0x341b5a(0x1cd)]&&{'session_time':_0x337f3a['sessionTime']},..._0x337f3a['retryAttemptName']&&{'retry_attempt':_0x337f3a[_0x341b5a(0x22e)]},..._0x87c742!==undefined&&{'duration_sec':_0x87c742},..._0x337f3a[_0x341b5a(0x1c8)]&&{'created_at':_0x337f3a['createdAt']},..._0x337f3a[_0x341b5a(0x1bf)]&&{'finished_at':_0x337f3a[_0x341b5a(0x1bf)]},...Object[_0x341b5a(0x249)](_0x337f3a[_0x341b5a(0x1d5)])['length']>0x0&&{'params':_0x337f3a[_0x341b5a(0x1d5)]}};return await handleSingleObjectOutput(_0x14a73e,_0x2bee2a),0x0;}catch(_0x2c1374){if(_0x2c1374 instanceof SDKError)return console[_0x341b5a(0x22a)](_0x341b5a(0x205)+_0x2c1374['message']),_0x2c1374[_0x341b5a(0x252)]&&console[_0x341b5a(0x22a)](_0x341b5a(0x1fb)+_0x2c1374['cause']),0x1;throw _0x2c1374;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1c4);[a44_0x5525a1(0x234)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x432148){const _0x13a096=a44_0x5525a1,{options:_0x486e63,args:_0x7481b6,tdx:_0x16444c}=_0x432148,_0x44a01e=_0x7481b6[0x0];if(!_0x44a01e)return console[_0x13a096(0x22a)](_0x13a096(0x1cf)),0x1;try{const _0x14ea17=_0x486e63['includeSubtasks'];_0x486e63[_0x13a096(0x200)]&&(console[_0x13a096(0x22a)](_0x13a096(0x20a)+_0x44a01e),_0x14ea17&&console[_0x13a096(0x22a)](_0x13a096(0x20d)));const _0x3687f7=await withSpinner(_0x13a096(0x254),()=>_0x16444c['workflow']['tasks'](_0x44a01e,_0x14ea17||![]),{'verbose':_0x486e63[_0x13a096(0x200)]}),_0x29511e=_0x3687f7[_0x13a096(0x1c3)];return console[_0x13a096(0x22a)](_0x13a096(0x1e9)+_0x29511e['length']+_0x13a096(0x1e8)+(_0x29511e[_0x13a096(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x29511e,_0x486e63),0x0;}catch(_0x2f5769){if(_0x2f5769 instanceof SDKError)return console[_0x13a096(0x22a)](_0x13a096(0x205)+_0x2f5769['message']),_0x2f5769['cause']&&console['error'](_0x13a096(0x1fb)+_0x2f5769[_0x13a096(0x252)]),0x1;throw _0x2f5769;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1db);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1d1);async[a44_0x5525a1(0x224)](_0x4fed4f){const _0x47405a=a44_0x5525a1,{options:_0x121e48,args:_0x230718,tdx:_0x1c1a54}=_0x4fed4f,_0x102357=_0x230718[0x0];let _0x2a8a29=_0x230718[0x1];if(!_0x102357)return console[_0x47405a(0x22a)](_0x47405a(0x1cf)),0x1;try{_0x121e48[_0x47405a(0x200)]&&(console[_0x47405a(0x22a)](_0x47405a(0x20a)+_0x102357),_0x2a8a29&&console['error'](_0x47405a(0x1f5)+_0x2a8a29));const _0x2439a8=await withSpinner('Fetching\x20log\x20files...',()=>_0x1c1a54[_0x47405a(0x24e)][_0x47405a(0x1d9)](_0x102357,_0x2a8a29),{'verbose':_0x121e48[_0x47405a(0x200)]}),_0xfb55a8=_0x2439a8['data'];if(_0xfb55a8[_0x47405a(0x246)]===0x0)return console[_0x47405a(0x22a)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2a8a29&&(_0x121e48[_0x47405a(0x253)]||_0x121e48[_0x47405a(0x24d)]))return await handleSDKOutput(_0xfb55a8,_0x121e48),0x0;if(!_0x2a8a29){const _0x3a1486=_0xfb55a8['map'](_0x2db09a=>({'title':_0x2db09a['taskName']+'\x20('+formatBytes(_0x2db09a['fileSize'])+')','value':_0x2db09a['taskName']})),_0x18ff62=await a44_0x2ce703({'type':_0x47405a(0x1c5),'name':_0x47405a(0x204),'message':_0x47405a(0x208),'choices':_0x3a1486});if(!_0x18ff62[_0x47405a(0x204)])return console['error'](_0x47405a(0x1ba)),0x0;_0x2a8a29=_0x18ff62[_0x47405a(0x204)];}const _0x260901=await withSpinner(_0x47405a(0x23a),()=>_0x1c1a54[_0x47405a(0x24e)][_0x47405a(0x1f7)](_0x102357,_0x2a8a29),{'verbose':_0x121e48['verbose']}),_0x5e173c=_0x260901[_0x47405a(0x1c3)];return _0x5e173c?console['log'](_0x5e173c):console['error'](_0x47405a(0x1b7)),0x0;}catch(_0x77444a){if(_0x77444a instanceof SDKError)return console[_0x47405a(0x22a)](_0x47405a(0x205)+_0x77444a[_0x47405a(0x1f2)]),_0x77444a[_0x47405a(0x252)]&&console[_0x47405a(0x22a)]('\x20\x20Cause:\x20'+_0x77444a[_0x47405a(0x252)]),0x1;throw _0x77444a;}}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a44_0x5525a1(0x234)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x1ff8ff){const _0x572643=a44_0x5525a1,{options:_0x4faf3d,args:_0x36f5d9,tdx:_0x2ba218}=_0x1ff8ff,_0x97dd53=_0x36f5d9[0x0];if(!_0x97dd53)return console['error'](_0x572643(0x1cf)),0x1;try{const _0x3f29a9=_0x4faf3d['reason'];_0x4faf3d[_0x572643(0x200)]&&(console['error'](_0x572643(0x20a)+_0x97dd53),_0x3f29a9&&console[_0x572643(0x22a)](_0x572643(0x1b3)+_0x3f29a9));if(!_0x4faf3d[_0x572643(0x1f8)]){const _0x41383b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x97dd53+'?');if(!_0x41383b)return console[_0x572643(0x22a)](_0x572643(0x1ba)),0x0;}const _0x1b1b41=await withSpinner('Killing\x20attempt...',()=>_0x2ba218[_0x572643(0x24e)]['kill'](_0x97dd53,_0x3f29a9),{'verbose':_0x4faf3d[_0x572643(0x200)]}),_0x17b44a=_0x1b1b41[_0x572643(0x1c3)];return console[_0x572643(0x22a)]('✔\x20'+_0x17b44a),0x0;}catch(_0x56e9fc){if(_0x56e9fc instanceof SDKError)return console[_0x572643(0x22a)](_0x572643(0x205)+_0x56e9fc[_0x572643(0x1f2)]),_0x56e9fc[_0x572643(0x252)]&&console[_0x572643(0x22a)](_0x572643(0x1fb)+_0x56e9fc[_0x572643(0x252)]),0x1;throw _0x56e9fc;}}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']=a44_0x5525a1(0x237);async[a44_0x5525a1(0x224)](_0x24ef6b){const _0x4572d6=a44_0x5525a1,{options:_0x35e8b5,args:_0x5081c9,tdx:_0x263f99}=_0x24ef6b,_0x2acf4b=_0x5081c9[0x0];if(!_0x2acf4b)return console[_0x4572d6(0x22a)](_0x4572d6(0x1e4)),console[_0x4572d6(0x22a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2b21a8=![],_0x5a90cf=_0x2acf4b;if(_0x2acf4b[_0x4572d6(0x228)](_0x4572d6(0x22b)))_0x2b21a8=!![],_0x5a90cf=_0x2acf4b['substring'](0x8);else{if(_0x2acf4b[_0x4572d6(0x228)](_0x4572d6(0x1c0)))_0x2b21a8=![],_0x5a90cf=_0x2acf4b[_0x4572d6(0x1d3)](0x8);else return console[_0x4572d6(0x22a)](_0x4572d6(0x231)),console['error'](_0x4572d6(0x22c)),0x1;}try{const _0x247209=_0x35e8b5[_0x4572d6(0x1cc)],_0x469575=_0x35e8b5['resumeFrom'],_0x2768b2=_0x35e8b5[_0x4572d6(0x1d5)],_0x332d2b=_0x35e8b5[_0x4572d6(0x24c)];_0x35e8b5[_0x4572d6(0x200)]&&(console['error'](_0x4572d6(0x24b)+(_0x2b21a8?_0x4572d6(0x1e0):_0x4572d6(0x1ff))+'\x20'+_0x5a90cf),_0x247209&&console[_0x4572d6(0x22a)](_0x4572d6(0x250)+_0x247209),_0x469575&&console[_0x4572d6(0x22a)]('Resume\x20from:\x20'+_0x469575),_0x2768b2&&console['error'](_0x4572d6(0x20e)+_0x2768b2),_0x332d2b&&console[_0x4572d6(0x22a)](_0x4572d6(0x20c)));let _0x16d5ff;if(_0x2768b2)try{if(_0x2768b2['startsWith']('@')){const _0x5118c7=await import(_0x4572d6(0x23c)),_0x19dba0=_0x2768b2[_0x4572d6(0x1d3)](0x1),_0x5dfb68=await _0x5118c7[_0x4572d6(0x225)](_0x19dba0,_0x4572d6(0x1b4));_0x16d5ff=JSON['parse'](_0x5dfb68);}else _0x16d5ff=JSON[_0x4572d6(0x1b2)](_0x2768b2);}catch{return console[_0x4572d6(0x22a)](_0x4572d6(0x1f3)),0x1;}if(!_0x35e8b5[_0x4572d6(0x1f8)]){const _0x44fd52=await confirm(_0x4572d6(0x218)+(_0x2b21a8?_0x4572d6(0x1e0):_0x4572d6(0x1ff))+'\x20'+_0x5a90cf+'?');if(!_0x44fd52)return console[_0x4572d6(0x22a)]('Cancelled'),0x0;}let _0x5da4f0;_0x2b21a8?_0x5da4f0=await withSpinner(_0x4572d6(0x21f),()=>_0x263f99[_0x4572d6(0x24e)][_0x4572d6(0x22d)](_0x5a90cf,{'fromTask':_0x247209,'retryParams':_0x16d5ff}),{'verbose':_0x35e8b5[_0x4572d6(0x200)]}):_0x5da4f0=await withSpinner(_0x4572d6(0x1ca),()=>_0x263f99[_0x4572d6(0x24e)]['retryAttempt'](_0x5a90cf,{'resumeFrom':_0x469575,'retryParams':_0x16d5ff,'force':_0x332d2b}),{'verbose':_0x35e8b5[_0x4572d6(0x200)]});const _0x1bf875=_0x5da4f0[_0x4572d6(0x1c3)];return console[_0x4572d6(0x22a)](_0x4572d6(0x1e6)),console[_0x4572d6(0x22a)](_0x4572d6(0x1e2)+_0x1bf875['attemptId']),console[_0x4572d6(0x22a)](_0x4572d6(0x216)+_0x1bf875[_0x4572d6(0x1f4)]),0x0;}catch(_0x33088f){if(_0x33088f instanceof SDKError)return console[_0x4572d6(0x22a)](_0x4572d6(0x205)+_0x33088f[_0x4572d6(0x1f2)]),_0x33088f[_0x4572d6(0x252)]&&console['error'](_0x4572d6(0x1fb)+_0x33088f['cause']),0x1;throw _0x33088f;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1d4);[a44_0x5525a1(0x234)]='Start\x20a\x20workflow\x20run';async[a44_0x5525a1(0x224)](_0x24e253){const _0x23c951=a44_0x5525a1,{options:_0x5c0a46,args:_0x4d6c56,tdx:_0x31e7a2}=_0x24e253,_0x2041db=_0x4d6c56[0x0];if(!_0x2041db)return console[_0x23c951(0x22a)](_0x23c951(0x1e3)),console['error'](_0x23c951(0x245)),0x1;const _0x3d43e9=_0x5c0a46[_0x23c951(0x22f)],_0x4b5ffa=_0x5c0a46['sessionTime'],_0x17e849={};if(_0x3d43e9&&Array[_0x23c951(0x23d)](_0x3d43e9))for(const _0x293b69 of _0x3d43e9){const _0x3328c9=_0x293b69[_0x23c951(0x248)]('=');if(_0x3328c9===-0x1)return console[_0x23c951(0x22a)](_0x23c951(0x1f6)+_0x293b69),console['error'](_0x23c951(0x1d0)),0x1;const _0x487377=_0x293b69[_0x23c951(0x1d3)](0x0,_0x3328c9),_0x15552d=_0x293b69['substring'](_0x3328c9+0x1);try{_0x17e849[_0x487377]=JSON[_0x23c951(0x1b2)](_0x15552d);}catch{_0x17e849[_0x487377]=_0x15552d;}}_0x5c0a46[_0x23c951(0x200)]&&(console['error'](_0x23c951(0x1b8)+_0x2041db),Object['keys'](_0x17e849)[_0x23c951(0x246)]>0x0&&console[_0x23c951(0x22a)](_0x23c951(0x23b)+JSON[_0x23c951(0x213)](_0x17e849)),_0x4b5ffa&&console[_0x23c951(0x22a)](_0x23c951(0x211)+_0x4b5ffa));const _0x27af1e=await withSpinner(_0x23c951(0x222),()=>_0x31e7a2[_0x23c951(0x24e)][_0x23c951(0x1c9)](_0x2041db,_0x17e849,{'sessionTime':_0x4b5ffa}),{'verbose':_0x5c0a46['verbose']}),_0x1ffda2=_0x27af1e[_0x23c951(0x1c3)];return console[_0x23c951(0x22a)](_0x23c951(0x232)),console[_0x23c951(0x22a)](_0x23c951(0x1dc)+_0x1ffda2['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x1ffda2[_0x23c951(0x1f4)]),console[_0x23c951(0x22a)](_0x23c951(0x1b5)+_0x1ffda2[_0x23c951(0x203)]?.['name']),console['error'](_0x23c951(0x235)+_0x1ffda2[_0x23c951(0x24e)]?.[_0x23c951(0x1d2)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]='workflow:download';[a44_0x5525a1(0x234)]=a44_0x5525a1(0x244);async[a44_0x5525a1(0x224)](_0x1adf41){const _0xffacb3=a44_0x5525a1,{options:_0x3c739c,args:_0x57f4fc,tdx:_0xd76216}=_0x1adf41,_0x5dd22d=_0x57f4fc[0x0],_0x582422=_0x57f4fc[0x1]||'.';if(!_0x5dd22d)return console[_0xffacb3(0x22a)](_0xffacb3(0x24f)),console['error'](_0xffacb3(0x238)),0x1;const _0x2089a0=_0x3c739c[_0xffacb3(0x226)];_0x3c739c[_0xffacb3(0x200)]&&(console[_0xffacb3(0x22a)](_0xffacb3(0x24a)+_0x5dd22d),console[_0xffacb3(0x22a)](_0xffacb3(0x242)+_0x582422),_0x2089a0&&console['error']('Revision:\x20'+_0x2089a0));const _0x569880=await withSpinner('Downloading\x20project\x20'+_0x5dd22d+_0xffacb3(0x1fc),()=>_0xd76216[_0xffacb3(0x24e)][_0xffacb3(0x1e5)](_0x5dd22d,_0x582422,{'revision':_0x2089a0}),{'verbose':_0x3c739c[_0xffacb3(0x200)]}),_0x34421b=_0x569880[_0xffacb3(0x1c3)];return console[_0xffacb3(0x22a)]('✔\x20Downloaded\x20'+_0x34421b[_0xffacb3(0x1ce)]),console[_0xffacb3(0x22a)](_0xffacb3(0x21a)+_0x34421b[_0xffacb3(0x226)]),console[_0xffacb3(0x22a)](_0xffacb3(0x1e7)+_0x34421b[_0xffacb3(0x1c1)]),console[_0xffacb3(0x22a)](_0xffacb3(0x229)+_0x582422+'/'+_0x34421b[_0xffacb3(0x1ce)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x215);[a44_0x5525a1(0x234)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a44_0x5525a1(0x224)](_0x3fbdaf){const _0x697190=a44_0x5525a1,{options:_0x2f86d8,args:_0x227533,tdx:_0x1c0a86}=_0x3fbdaf;let _0x1db126='.',_0x474d6e=_0x2f86d8[_0x697190(0x1d2)];if(_0x227533[0x0]){const {promises:_0x514ebf}=await import('fs');try{const _0x528fbc=await _0x514ebf[_0x697190(0x21d)](_0x227533[0x0]);if(_0x528fbc[_0x697190(0x1d8)]())_0x1db126=_0x227533[0x0];else return console[_0x697190(0x22a)](_0x697190(0x205)+_0x227533[0x0]+_0x697190(0x236)),0x1;}catch{_0x474d6e=_0x227533[0x0],_0x1db126='.';}}const _0x41767e=_0x2f86d8[_0x697190(0x226)],_0x30cc5d=_0x2f86d8[_0x697190(0x214)];_0x2f86d8['verbose']&&(console[_0x697190(0x22a)]('Project\x20directory:\x20'+_0x1db126),_0x474d6e&&console[_0x697190(0x22a)](_0x697190(0x1f1)+_0x474d6e),_0x41767e&&console[_0x697190(0x22a)](_0x697190(0x221)+_0x41767e),_0x30cc5d&&console['error'](_0x697190(0x1fd)));const _0x3d1e85=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1c0a86[_0x697190(0x24e)]['push'](_0x1db126,{'projectName':_0x474d6e,'revision':_0x41767e,'skipValidation':_0x30cc5d}),{'verbose':_0x2f86d8[_0x697190(0x200)]}),_0x1fb749=_0x3d1e85[_0x697190(0x1c3)];return console[_0x697190(0x22a)](_0x697190(0x1bb)+_0x1fb749[_0x697190(0x1ce)]),console['error'](_0x697190(0x1eb)+_0x1fb749['projectId']),console[_0x697190(0x22a)](_0x697190(0x21a)+_0x1fb749[_0x697190(0x226)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1f0);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x23f);async[a44_0x5525a1(0x224)](_0x58ca15){const _0x525578=a44_0x5525a1,{options:_0x15974e,args:_0x458c40,tdx:_0x35586a}=_0x58ca15,_0x460f3d=_0x458c40[0x0];if(!_0x460f3d)return console[_0x525578(0x22a)](_0x525578(0x1ea)),console[_0x525578(0x22a)](_0x525578(0x209)),0x1;_0x15974e[_0x525578(0x200)]&&console[_0x525578(0x22a)](_0x525578(0x24a)+_0x460f3d);if(!_0x15974e['yes']){const _0x323254=await confirm(_0x525578(0x1b9)+_0x460f3d+_0x525578(0x247));if(!_0x323254)return console[_0x525578(0x22a)]('Cancelled'),0x0;}const _0x1ae94f=await withSpinner('Deleting\x20project\x20'+_0x460f3d+_0x525578(0x1fc),()=>_0x35586a[_0x525578(0x24e)][_0x525578(0x1bd)](_0x460f3d),{'verbose':_0x15974e[_0x525578(0x200)]}),_0x1b0e68=_0x1ae94f[_0x525578(0x1c3)];return console[_0x525578(0x22a)]('✔\x20Deleted\x20project\x20'+_0x1b0e68['projectName']),console[_0x525578(0x22a)](_0x525578(0x1eb)+_0x1b0e68[_0x525578(0x240)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a4921,_0x2ec841){const _0x3a43d6=a45_0x1d18,_0x3a9a22=_0x3a4921();while(!![]){try{const _0x2bf37b=-parseInt(_0x3a43d6(0x179))/0x1+-parseInt(_0x3a43d6(0x168))/0x2*(parseInt(_0x3a43d6(0x175))/0x3)+-parseInt(_0x3a43d6(0x172))/0x4*(parseInt(_0x3a43d6(0x16f))/0x5)+parseInt(_0x3a43d6(0x16d))/0x6*(parseInt(_0x3a43d6(0x171))/0x7)+parseInt(_0x3a43d6(0x178))/0x8+-parseInt(_0x3a43d6(0x16b))/0x9+parseInt(_0x3a43d6(0x17a))/0xa;if(_0x2bf37b===_0x2ec841)break;else _0x3a9a22['push'](_0x3a9a22['shift']());}catch(_0x17220a){_0x3a9a22['push'](_0x3a9a22['shift']());}}}(a45_0x593d,0xa44bc));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a45_0x593d(){const _0x13416b=['571516hwEGDi','parse','version','4714722QWQNeX','entries','4482ChzKxN','length','8065xEncMz','0.0.0','4837pSuFHF','424zfFwFN','Authorization','../../package.json','6zJDZue','tdx','tdx/','4717560KgZrOe','108708YrAocL','9421440LHJpVT','TD1\x20'];a45_0x593d=function(){return _0x13416b;};return a45_0x593d();}import{getAPIKey}from'./config.js';function a45_0x1d18(_0x23893c,_0x4cedfa){_0x23893c=_0x23893c-0x168;const _0x593ddf=a45_0x593d();let _0x1d18e3=_0x593ddf[_0x23893c];return _0x1d18e3;}export function getVersion(){const _0x184e7f=a45_0x1d18;try{const _0x194173=fileURLToPath(import.meta.url),_0x465b99=dirname(_0x194173),_0x4f087e=join(_0x465b99,_0x184e7f(0x174)),_0x48f937=JSON[_0x184e7f(0x169)](readFileSync(_0x4f087e,'utf-8'));return _0x48f937[_0x184e7f(0x16a)];}catch{return _0x184e7f(0x170);}}export function getUserAgent(){const _0x125fc6=a45_0x1d18,_0x15d5c3=getVersion(),_0xcb013d=platform(),_0xe523bc=process[_0x125fc6(0x16a)]['replace']('v','');return _0x125fc6(0x177)+_0x15d5c3+'\x20('+_0xcb013d+';\x20node/'+_0xe523bc+')';}export function getAuthHeaders(_0x30b5de,_0x143f63){const _0x3bddd6=a45_0x1d18,_0x3333bb=getVersion(),_0x20bdd6={'User-Agent':getUserAgent(),'X-TD-Client':_0x3bddd6(0x176),'X-TD-Client-Version':_0x3333bb};return _0x143f63&&(_0x20bdd6[_0x3bddd6(0x173)]=_0x3bddd6(0x17b)+_0x143f63),_0x20bdd6;}export function toHeaderRecord(_0x485aaf){const _0x4a504e=a45_0x1d18,_0x99efb9={};for(const [_0x3a9294,_0x49e597]of Object[_0x4a504e(0x16c)](_0x485aaf)){_0x49e597!==undefined&&(_0x99efb9[_0x3a9294]=_0x49e597);}return _0x99efb9;}export function getTrinoHeaders(_0x1f68e8,_0x24564a){const _0x32f238=a45_0x1d18,_0x186b8d=getAuthHeaders(_0x1f68e8,_0x24564a),_0x5aff8b=toHeaderRecord(_0x186b8d);return delete _0x5aff8b[_0x32f238(0x173)],_0x24564a&&(_0x5aff8b['X-Trino-User']=_0x24564a),_0x5aff8b;}export function hasAPIKey(_0x739473){const _0x3ee382=a45_0x1d18,_0x2ffddc=getAPIKey(_0x739473);return _0x2ffddc!==undefined&&_0x2ffddc[_0x3ee382(0x16e)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x22ab3a,_0x232a46){const _0x5f290a=a46_0xf41e,_0x485c54=_0x22ab3a();while(!![]){try{const _0x398be7=-parseInt(_0x5f290a(0x187))/0x1+-parseInt(_0x5f290a(0x1bf))/0x2+-parseInt(_0x5f290a(0x19b))/0x3+parseInt(_0x5f290a(0x1ac))/0x4+-parseInt(_0x5f290a(0x199))/0x5+parseInt(_0x5f290a(0x18e))/0x6+-parseInt(_0x5f290a(0x1a3))/0x7*(-parseInt(_0x5f290a(0x1b0))/0x8);if(_0x398be7===_0x232a46)break;else _0x485c54['push'](_0x485c54['shift']());}catch(_0x168a64){_0x485c54['push'](_0x485c54['shift']());}}}(a46_0x2b50,0x49ea2));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';function a46_0x2b50(){const _0x1dfacb=['keychain','jp01','TDX_API_KEY_<PROFILE>','llm_default_project','match','stg-jp01','join','1204418LQGTTp','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','toUpperCase','replace','.env','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','tdx.json','Warning:\x20Unknown\x20site\x20\x27','profile','readFileSync','isDeprecated','Warning:\x20Failed\x20to\x20read\x20','TD_API_KEY_','dev-eu01','TDX_API_KEY_','account_info.','.env.','stg-ap03','string','warn','legacy\x20.env\x20file','existsSync','234212VxwSHv','TDX_API_KEY','utf-8','stg-us01','ap02','yellow','number','3352692oQJCRU','name','includes','profiles','slice','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','map','llm_default_project.','tdx','keychain\x20(profile:\x20','TD_API_KEY','2697470dMsucE','us01','1674702gUiGSm','endsWith','stringify','source','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','some','.json','TDX_CONFIG_DIR','7hCVmgc','accountId','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','filter','ap03','trim','startsWith','legacy\x20.env\x20file\x20(profile:\x20','env','1989712TNLaIe','entries','apiKey','split','9445544YbOyaf','TDX_CACHE_DIR','parse','apiKeys','.cache','eu01','toISOString','site'];a46_0x2b50=function(){return _0x1dfacb;};return a46_0x2b50();}import*as a46_0x108dda from'node:fs';import*as a46_0x12dd06 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a46_0x451a86 from'chalk';export function getConfigDir(){const _0x3ce108=a46_0xf41e;return process[_0x3ce108(0x1ab)][_0x3ce108(0x1a2)]||join(homedir(),'.config',_0x3ce108(0x196));}export function getConfigFile(){const _0x29fb7d=a46_0xf41e;return join(getConfigDir(),_0x29fb7d(0x1c4));}export function getConfigFilePath(_0x4e65ed){const _0x2ecc80=a46_0xf41e,_0x43607a=getConfigDir();return _0x4e65ed?a46_0x12dd06[_0x2ecc80(0x1be)](_0x43607a,_0x2ecc80(0x181)+_0x4e65ed):getConfigFile();}export function getCacheDir(){const _0x821d92=a46_0xf41e;return process[_0x821d92(0x1ab)][_0x821d92(0x1b1)]||join(homedir(),_0x821d92(0x1b4),_0x821d92(0x196));}export function getLLMProjectCacheFile(_0x183156){const _0x13d1e4=a46_0xf41e,_0x29326c=_0x183156?_0x13d1e4(0x195)+_0x183156:_0x13d1e4(0x1bb);return join(getCacheDir(),_0x29326c);}export function readCachedLLMProject(_0x39f9bd){const _0xc15906=a46_0xf41e;try{const _0x31f516=getLLMProjectCacheFile(_0x39f9bd);if(!existsSync(_0x31f516))return null;const _0x255091=readFileSync(_0x31f516,_0xc15906(0x189))[_0xc15906(0x1a8)]();try{const _0x576c7a=JSON[_0xc15906(0x1b2)](_0x255091);if(_0x576c7a&&typeof _0x576c7a['id']===_0xc15906(0x183)&&typeof _0x576c7a[_0xc15906(0x18f)]===_0xc15906(0x183))return _0x576c7a;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x1349e5,_0x24d3ed,_0x34d534){try{const _0x4807e3=getCacheDir(),_0x1aec5f=getLLMProjectCacheFile(_0x34d534);!existsSync(_0x4807e3)&&mkdirSync(_0x4807e3,{'recursive':!![]});const _0x2edb3b={'name':_0x1349e5,'id':_0x24d3ed};writeFileSync(_0x1aec5f,JSON['stringify'](_0x2edb3b),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x84275c){const _0x460672=_0x84275c?'llm_default_agent.'+_0x84275c:'llm_default_agent';return join(getCacheDir(),_0x460672);}export function readCachedLLMAgent(_0xa06f1d){const _0x280ba1=a46_0xf41e;try{const _0x1a4512=getLLMAgentCacheFile(_0xa06f1d);if(!existsSync(_0x1a4512))return null;const _0x3b1dcb=readFileSync(_0x1a4512,_0x280ba1(0x189))[_0x280ba1(0x1a8)]();try{const _0x372c2e=JSON[_0x280ba1(0x1b2)](_0x3b1dcb);if(_0x372c2e&&typeof _0x372c2e['id']===_0x280ba1(0x183)&&typeof _0x372c2e['name']===_0x280ba1(0x183)&&typeof _0x372c2e['projectId']===_0x280ba1(0x183))return _0x372c2e;}catch{}return null;}catch{return null;}}function a46_0xf41e(_0x31eee9,_0x287470){_0x31eee9=_0x31eee9-0x17a;const _0x2b505e=a46_0x2b50();let _0xf41ec3=_0x2b505e[_0x31eee9];return _0xf41ec3;}export function writeCachedLLMAgent(_0x29cca1,_0x395ff2,_0xce8f1b,_0x54f95d){const _0x40d770=a46_0xf41e;try{const _0x45243c=getCacheDir(),_0x4f0a00=getLLMAgentCacheFile(_0x54f95d);!existsSync(_0x45243c)&&mkdirSync(_0x45243c,{'recursive':!![]});const _0x584fc9={'name':_0x29cca1,'id':_0x395ff2,'projectId':_0xce8f1b};writeFileSync(_0x4f0a00,JSON[_0x40d770(0x19d)](_0x584fc9),'utf-8');}catch{}}export function clearCachedLLMAgent(_0x5d1ffd){try{const _0x292d94=getLLMAgentCacheFile(_0x5d1ffd);existsSync(_0x292d94)&&unlinkSync(_0x292d94);}catch{}}export function getAccountInfoCacheFile(_0x4b094a){const _0x25905d=a46_0xf41e,_0x392c78=_0x4b094a?_0x25905d(0x180)+_0x4b094a+_0x25905d(0x1a1):'account_info.json';return join(getCacheDir(),_0x392c78);}export function readCachedAccountInfo(_0x545b3b){const _0x441063=a46_0xf41e;try{const _0x25d4ba=getAccountInfoCacheFile(_0x545b3b);if(!existsSync(_0x25d4ba))return null;const _0x5360f2=readFileSync(_0x25d4ba,_0x441063(0x189))[_0x441063(0x1a8)](),_0xe3c384=JSON['parse'](_0x5360f2);if(_0xe3c384&&typeof _0xe3c384[_0x441063(0x1b7)]===_0x441063(0x183)&&typeof _0xe3c384[_0x441063(0x1a4)]===_0x441063(0x18d))return _0xe3c384;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x4b507e,_0x4606d0,_0x52a89d){const _0x16ee11=a46_0xf41e;try{const _0x5bf89f=getCacheDir(),_0x22c8ed=getAccountInfoCacheFile(_0x52a89d);!existsSync(_0x5bf89f)&&mkdirSync(_0x5bf89f,{'recursive':!![]});const _0x23d6e8={'site':_0x4b507e,'accountId':_0x4606d0,'cachedAt':new Date()[_0x16ee11(0x1b6)]()};writeFileSync(_0x22c8ed,JSON[_0x16ee11(0x19d)](_0x23d6e8),_0x16ee11(0x189));}catch{}}export function parseEnvFile(_0x1ec5fb){const _0x4ff1ea=a46_0xf41e,_0xe95ee2={};for(const _0x2b941f of _0x1ec5fb[_0x4ff1ea(0x1af)]('\x0a')){const _0x3cc4a8=_0x2b941f[_0x4ff1ea(0x1a8)]();if(!_0x3cc4a8||_0x3cc4a8[_0x4ff1ea(0x1a9)]('#'))continue;const _0x362acc=_0x3cc4a8[_0x4ff1ea(0x1bc)](/^([^=]+)=(.*)$/);if(_0x362acc){const _0x4de78f=_0x362acc[0x1]['trim']();let _0x34e256=_0x362acc[0x2][_0x4ff1ea(0x1a8)]();(_0x34e256[_0x4ff1ea(0x1a9)]('\x22')&&_0x34e256[_0x4ff1ea(0x19c)]('\x22')||_0x34e256[_0x4ff1ea(0x1a9)]('\x27')&&_0x34e256['endsWith']('\x27'))&&(_0x34e256=_0x34e256[_0x4ff1ea(0x192)](0x1,-0x1)),_0xe95ee2[_0x4de78f]=_0x34e256;}}return _0xe95ee2;}export function readUserConfig(){const _0x3c28c3=a46_0xf41e,_0x43d641=getConfigFile();if(!existsSync(_0x43d641))return{};try{const _0x999e86=readFileSync(_0x43d641,_0x3c28c3(0x189));return parseEnvFile(_0x999e86);}catch(_0xbc3aef){return console[_0x3c28c3(0x184)](_0x3c28c3(0x193)+_0x43d641+':',_0xbc3aef),{};}}export function resolveSite(_0x260c5d){const _0x36932b=a46_0xf41e,_0x527d81=[_0x36932b(0x19a),_0x36932b(0x1b9),_0x36932b(0x1b5),_0x36932b(0x18b),_0x36932b(0x1a7),'dev-us01',_0x36932b(0x17e),'stg-us01','stg-jp01',_0x36932b(0x182)];if(_0x527d81[_0x36932b(0x190)](_0x260c5d))return _0x260c5d;if(_0x260c5d in SITE_ALIASES)return SITE_ALIASES[_0x260c5d];return console[_0x36932b(0x184)](_0x36932b(0x1c7)+_0x260c5d+'\x27,\x20defaulting\x20to\x20us01'),_0x36932b(0x19a);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x53874f,_0x546007){const _0x30dac2=a46_0xf41e,_0x1d9ae5=_0x546007||getActiveProfileName();if(_0x1d9ae5){const _0x4fec64='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x1d9ae5);if(process[_0x30dac2(0x1ab)][_0x4fec64])return process['env'][_0x4fec64];}if(process[_0x30dac2(0x1ab)][_0x30dac2(0x188)])return process['env'][_0x30dac2(0x188)];if(process['env'][_0x30dac2(0x198)])return process[_0x30dac2(0x1ab)][_0x30dac2(0x198)];const _0x2bf58b=_0x53874f[_0x30dac2(0x1c2)]()[_0x30dac2(0x1c3)](/-/g,'_'),_0xc881ef=_0x30dac2(0x17d)+_0x2bf58b;if(_0x1d9ae5){const _0x43c77c=loadProfileEnv(_0x1d9ae5);if(_0x43c77c){if(_0x43c77c[_0xc881ef])return _0x43c77c[_0xc881ef];if(_0x43c77c['TD_API_KEY'])return _0x43c77c[_0x30dac2(0x198)];}}const _0x48b7cd=loadUserConfigOnce();if(_0x48b7cd[_0xc881ef])return _0x48b7cd[_0xc881ef];if(_0x48b7cd[_0x30dac2(0x198)])return _0x48b7cd['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x157df8){return _0x157df8['toUpperCase']()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x460ad7,_0x1cbf94){const _0x38f2c4=a46_0xf41e,_0x94737=_0x1cbf94||getActiveProfileName()||undefined;if(_0x94737){const _0x29c1db=_0x38f2c4(0x17f)+normalizeProfileForEnvVar(_0x94737);if(process[_0x38f2c4(0x1ab)][_0x29c1db])return{'apiKey':process[_0x38f2c4(0x1ab)][_0x29c1db],'source':_0x29c1db+'\x20env\x20var','isDeprecated':![]};const _0x1977ae=getCachedCredential(_0x460ad7,_0x94737);if(_0x1977ae)return{'apiKey':_0x1977ae,'source':_0x38f2c4(0x197)+_0x94737+')','isDeprecated':![]};const _0x4d6c60=await getKeychainAPIKey(_0x94737);if(_0x4d6c60)return setCachedCredential(_0x4d6c60,_0x460ad7,_0x94737),{'apiKey':_0x4d6c60,'source':'keychain\x20(profile:\x20'+_0x94737+')','isDeprecated':![]};}if(process[_0x38f2c4(0x1ab)][_0x38f2c4(0x188)])return{'apiKey':process[_0x38f2c4(0x1ab)][_0x38f2c4(0x188)],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x94737){const _0x4a7693=getCachedCredential(_0x460ad7,undefined);if(_0x4a7693)return{'apiKey':_0x4a7693,'source':_0x38f2c4(0x1b8),'isDeprecated':![]};const _0x34c868=await getKeychainAPIKey(undefined);if(_0x34c868)return setCachedCredential(_0x34c868,_0x460ad7,undefined),{'apiKey':_0x34c868,'source':'keychain','isDeprecated':![]};}if(process[_0x38f2c4(0x1ab)]['TD_API_KEY'])return{'apiKey':process[_0x38f2c4(0x1ab)]['TD_API_KEY'],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x54a1fa=getLegacyEnvAPIKey(_0x460ad7,_0x94737);if(_0x54a1fa){const _0x44e4ed=await isKeychainAvailable();if(_0x44e4ed)try{await saveKeychainAPIKey(_0x54a1fa,_0x94737),setCachedCredential(_0x54a1fa,_0x460ad7,_0x94737);const _0xa3f7cb=getConfigFilePath(_0x94737);cleanupLegacyEnvFile(_0xa3f7cb)&&console[_0x38f2c4(0x184)](a46_0x451a86['yellow'](_0x38f2c4(0x1c0)));}catch(_0x1ce57e){console[_0x38f2c4(0x184)](a46_0x451a86[_0x38f2c4(0x18c)](_0x38f2c4(0x1c5)+_0x1ce57e));}const _0x1d27e3=_0x94737?_0x38f2c4(0x1aa)+_0x94737+')':_0x38f2c4(0x185);return{'apiKey':_0x54a1fa,'source':_0x1d27e3,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x1df572,_0x16361e,_0x39c8c4=!![]){const _0x525636=a46_0xf41e,_0x4ed08f=await resolveAPIKeyAsync(_0x1df572,_0x16361e);if(!_0x4ed08f)return undefined;if(_0x39c8c4&&_0x4ed08f[_0x525636(0x17b)]&&_0x4ed08f[_0x525636(0x19e)]['includes'](_0x525636(0x198))){const _0x836db7=_0x16361e||getActiveProfileName()||undefined,_0x4b7ccd=_0x836db7?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x836db7):_0x525636(0x1ba);console[_0x525636(0x184)](a46_0x451a86[_0x525636(0x18c)](_0x525636(0x1c1)+(_0x525636(0x1a5)+_0x4b7ccd+').')));}return _0x4ed08f[_0x525636(0x1ae)];}function getLegacyEnvAPIKey(_0x3d0921,_0x4e1d16){const _0x50a3b4=a46_0xf41e,_0xa8857a=_0x3d0921[_0x50a3b4(0x1c2)]()[_0x50a3b4(0x1c3)](/-/g,'_'),_0x28f625='TD_API_KEY_'+_0xa8857a;if(_0x4e1d16){const _0x32c342=loadProfileEnv(_0x4e1d16);if(_0x32c342){if(_0x32c342[_0x28f625])return _0x32c342[_0x28f625];if(_0x32c342[_0x50a3b4(0x198)])return _0x32c342[_0x50a3b4(0x198)];}}const _0x36e59a=loadUserConfigOnce();if(_0x36e59a[_0x28f625])return _0x36e59a[_0x28f625];if(_0x36e59a[_0x50a3b4(0x198)])return _0x36e59a[_0x50a3b4(0x198)];return undefined;}function cleanupLegacyEnvFile(_0x34bac4){const _0x334e02=a46_0xf41e;if(!existsSync(_0x34bac4))return![];try{const _0xbde486=readFileSync(_0x34bac4,_0x334e02(0x189)),_0x549053=_0xbde486[_0x334e02(0x1af)]('\x0a'),_0x48e7c2=_0x549053[_0x334e02(0x1a6)](_0x4d45a7=>{const _0x46278b=_0x334e02,_0xefe18f=_0x4d45a7[_0x46278b(0x1a8)]();if(!_0xefe18f||_0xefe18f[_0x46278b(0x1a9)]('#'))return!![];const [_0x79ea5f]=_0xefe18f[_0x46278b(0x1af)]('=');return!_0x79ea5f[_0x46278b(0x1a9)](_0x46278b(0x198));}),_0x51cc18=_0x48e7c2[_0x334e02(0x1a0)](_0xc8c9a4=>{const _0x20d138=_0x334e02,_0xf59787=_0xc8c9a4[_0x20d138(0x1a8)]();return _0xf59787&&!_0xf59787[_0x20d138(0x1a9)]('#');});if(!_0x51cc18)return unlinkSync(_0x34bac4),!![];return writeFileSync(_0x34bac4,_0x48e7c2[_0x334e02(0x1be)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2ece30){const _0x48b106=a46_0xf41e,_0x242c35=a46_0x12dd06['join'](getConfigDir(),_0x48b106(0x181)+_0x2ece30);if(a46_0x108dda[_0x48b106(0x186)](_0x242c35)){validateSecureFilePermissions(_0x242c35);try{const _0x3399ee=a46_0x108dda[_0x48b106(0x17a)](_0x242c35,_0x48b106(0x189));return parseEnvFile(_0x3399ee);}catch(_0x20dba8){console[_0x48b106(0x184)]('Warning:\x20Failed\x20to\x20load\x20'+_0x242c35+':\x20'+_0x20dba8);}}const _0x4c301d=a46_0x12dd06[_0x48b106(0x1be)](getConfigDir(),_0x48b106(0x191),_0x2ece30,'.env');if(a46_0x108dda[_0x48b106(0x186)](_0x4c301d)){validateSecureFilePermissions(_0x4c301d);try{const _0x3b4e29=a46_0x108dda['readFileSync'](_0x4c301d,_0x48b106(0x189));return parseEnvFile(_0x3b4e29);}catch(_0x1b4663){return console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x4c301d+':\x20'+_0x1b4663),null;}}return null;}function getActiveProfileName(){const _0x509402=a46_0xf41e,_0x2205f2=a46_0x12dd06[_0x509402(0x1be)](getConfigDir(),_0x509402(0x1c6));if(!a46_0x108dda[_0x509402(0x186)](_0x2205f2))return null;try{const _0x344cbb=a46_0x108dda[_0x509402(0x17a)](_0x2205f2,_0x509402(0x189)),_0x1fc407=JSON['parse'](_0x344cbb);return _0x1fc407[_0x509402(0x1c8)]||null;}catch{return null;}}export function saveAPIKey(_0x1d9838,_0x1d1c43,_0x41704d){const _0x4bfc5a=a46_0xf41e,_0x2ed459=getConfigDir(),_0x22d652=getConfigFilePath(_0x41704d);!existsSync(_0x2ed459)&&mkdirSync(_0x2ed459,{'recursive':!![],'mode':0x1c0});let _0xd9e6be={};if(existsSync(_0x22d652))try{const _0x25de05=readFileSync(_0x22d652,_0x4bfc5a(0x189));_0xd9e6be=parseEnvFile(_0x25de05);}catch(_0x506516){console[_0x4bfc5a(0x184)](_0x4bfc5a(0x17c)+_0x22d652+':',_0x506516);}const _0x294fa0=_0x1d9838[_0x4bfc5a(0x1c2)]()['replace'](/-/g,'_');_0xd9e6be[_0x4bfc5a(0x17d)+_0x294fa0]=_0x1d1c43;const _0x425418=Object[_0x4bfc5a(0x1ad)](_0xd9e6be)[_0x4bfc5a(0x194)](([_0x24254f,_0x2ca3e0])=>_0x24254f+'='+_0x2ca3e0);writeFileSync(_0x22d652,_0x425418[_0x4bfc5a(0x1be)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x279829,_0x3de515,_0x573888){const _0x36ea10=a46_0xf41e;await saveKeychainAPIKey(_0x279829,_0x573888),setCachedCredential(_0x279829,_0x3de515,_0x573888);const _0x54a39b=getConfigFilePath(_0x573888);cleanupLegacyEnvFile(_0x54a39b)&&console[_0x36ea10(0x184)](a46_0x451a86[_0x36ea10(0x18c)](_0x36ea10(0x19f)));}export function loadConfig(){const _0x5ea371=a46_0xf41e,_0x26dda1={'apiKeys':{},'defaultSite':_0x5ea371(0x19a)},_0xcf483f=['us01','jp01',_0x5ea371(0x1b5),_0x5ea371(0x18b),_0x5ea371(0x1a7),'dev-us01',_0x5ea371(0x17e),_0x5ea371(0x18a),_0x5ea371(0x1bd),'stg-ap03'];for(const _0x3a5ef6 of _0xcf483f){const _0x38d8f1=getAPIKey(_0x3a5ef6);_0x38d8f1&&(_0x26dda1[_0x5ea371(0x1b3)][_0x3a5ef6]=_0x38d8f1);}return _0x26dda1;}
|
|
1
|
+
(function(_0x5e7f04,_0x2048c3){const _0x347116=a46_0x2771,_0x18f517=_0x5e7f04();while(!![]){try{const _0x4e1482=parseInt(_0x347116(0x1fb))/0x1+parseInt(_0x347116(0x200))/0x2+parseInt(_0x347116(0x230))/0x3*(parseInt(_0x347116(0x211))/0x4)+parseInt(_0x347116(0x21b))/0x5+parseInt(_0x347116(0x20e))/0x6+-parseInt(_0x347116(0x202))/0x7*(-parseInt(_0x347116(0x208))/0x8)+-parseInt(_0x347116(0x22d))/0x9;if(_0x4e1482===_0x2048c3)break;else _0x18f517['push'](_0x18f517['shift']());}catch(_0x4a978d){_0x18f517['push'](_0x18f517['shift']());}}}(a46_0x3730,0x7cf6b));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x617de2 from'node:fs';import*as a46_0x2892f0 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a46_0x5aff50 from'chalk';export function getConfigDir(){const _0x5d50eb=a46_0x2771;return process[_0x5d50eb(0x1fc)][_0x5d50eb(0x1f9)]||join(homedir(),'.config',_0x5d50eb(0x223));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x3e8665){const _0x5108f1=a46_0x2771,_0xd6ec3c=getConfigDir();return _0x3e8665?a46_0x2892f0[_0x5108f1(0x232)](_0xd6ec3c,_0x5108f1(0x21f)+_0x3e8665):getConfigFile();}export function getCacheDir(){const _0x58fe5a=a46_0x2771;return process['env'][_0x58fe5a(0x1fd)]||join(homedir(),_0x58fe5a(0x22c),_0x58fe5a(0x223));}export function getLLMProjectCacheFile(_0x5384fd){const _0xce1dc9=a46_0x2771,_0x3fecd4=_0x5384fd?'llm_default_project.'+_0x5384fd:_0xce1dc9(0x1f2);return join(getCacheDir(),_0x3fecd4);}export function readCachedLLMProject(_0x46fdf7){const _0x39cb7d=a46_0x2771;try{const _0x1160a3=getLLMProjectCacheFile(_0x46fdf7);if(!existsSync(_0x1160a3))return null;const _0x22acd8=readFileSync(_0x1160a3,_0x39cb7d(0x20f))[_0x39cb7d(0x1f3)]();try{const _0x42f0a8=JSON[_0x39cb7d(0x1e8)](_0x22acd8);if(_0x42f0a8&&typeof _0x42f0a8['id']===_0x39cb7d(0x20d)&&typeof _0x42f0a8['name']==='string')return _0x42f0a8;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x155254,_0x2f2a78,_0x108464){try{const _0x5aa63e=getCacheDir(),_0x219f7b=getLLMProjectCacheFile(_0x108464);!existsSync(_0x5aa63e)&&mkdirSync(_0x5aa63e,{'recursive':!![]});const _0x60d416={'name':_0x155254,'id':_0x2f2a78};writeFileSync(_0x219f7b,JSON['stringify'](_0x60d416),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x18ec23){const _0x4476b9=a46_0x2771,_0x14202f=_0x18ec23?_0x4476b9(0x1f4)+_0x18ec23:'llm_default_agent';return join(getCacheDir(),_0x14202f);}export function readCachedLLMAgent(_0x3c8c5e){const _0x1ddd6e=a46_0x2771;try{const _0x1e62e0=getLLMAgentCacheFile(_0x3c8c5e);if(!existsSync(_0x1e62e0))return null;const _0x5aca1f=readFileSync(_0x1e62e0,_0x1ddd6e(0x20f))[_0x1ddd6e(0x1f3)]();try{const _0x47303c=JSON[_0x1ddd6e(0x1e8)](_0x5aca1f);if(_0x47303c&&typeof _0x47303c['id']===_0x1ddd6e(0x20d)&&typeof _0x47303c['name']===_0x1ddd6e(0x20d)&&typeof _0x47303c[_0x1ddd6e(0x1eb)]===_0x1ddd6e(0x20d))return _0x47303c;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x2425cd,_0x46c3a6,_0x16b9c9,_0x29c080){const _0xd47d15=a46_0x2771;try{const _0x2cbc0c=getCacheDir(),_0x1f86b7=getLLMAgentCacheFile(_0x29c080);!existsSync(_0x2cbc0c)&&mkdirSync(_0x2cbc0c,{'recursive':!![]});const _0x280451={'name':_0x2425cd,'id':_0x46c3a6,'projectId':_0x16b9c9};writeFileSync(_0x1f86b7,JSON[_0xd47d15(0x214)](_0x280451),_0xd47d15(0x20f));}catch{}}export function clearCachedLLMAgent(_0x2fe218){try{const _0x5d9879=getLLMAgentCacheFile(_0x2fe218);existsSync(_0x5d9879)&&unlinkSync(_0x5d9879);}catch{}}export function getAccountInfoCacheFile(_0x1a720a){const _0x2f0067=a46_0x2771,_0x5aa396=_0x1a720a?'account_info.'+_0x1a720a+'.json':_0x2f0067(0x222);return join(getCacheDir(),_0x5aa396);}export function readCachedAccountInfo(_0x3ff646){const _0x492662=a46_0x2771;try{const _0x17631e=getAccountInfoCacheFile(_0x3ff646);if(!existsSync(_0x17631e))return null;const _0x2bb5eb=readFileSync(_0x17631e,_0x492662(0x20f))[_0x492662(0x1f3)](),_0x17282e=JSON['parse'](_0x2bb5eb);if(_0x17282e&&typeof _0x17282e[_0x492662(0x204)]==='string'&&typeof _0x17282e[_0x492662(0x21c)]===_0x492662(0x231))return _0x17282e;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x57ec36,_0x523c0d,_0x4a7832){const _0x1e6fb8=a46_0x2771;try{const _0x2646ed=getCacheDir(),_0x3e1743=getAccountInfoCacheFile(_0x4a7832);!existsSync(_0x2646ed)&&mkdirSync(_0x2646ed,{'recursive':!![]});const _0x2c5e5d={'site':_0x57ec36,'accountId':_0x523c0d,'cachedAt':new Date()[_0x1e6fb8(0x21d)]()};writeFileSync(_0x3e1743,JSON[_0x1e6fb8(0x214)](_0x2c5e5d),_0x1e6fb8(0x20f));}catch{}}export function parseEnvFile(_0x5d7ead){const _0x293481=a46_0x2771,_0x59d42e={};for(const _0x1b2088 of _0x5d7ead[_0x293481(0x228)]('\x0a')){const _0x401954=_0x1b2088[_0x293481(0x1f3)]();if(!_0x401954||_0x401954[_0x293481(0x216)]('#'))continue;const _0x380727=_0x401954['match'](/^([^=]+)=(.*)$/);if(_0x380727){const _0xaf5345=_0x380727[0x1]['trim']();let _0xd26b28=_0x380727[0x2][_0x293481(0x1f3)]();(_0xd26b28[_0x293481(0x216)]('\x22')&&_0xd26b28[_0x293481(0x224)]('\x22')||_0xd26b28[_0x293481(0x216)]('\x27')&&_0xd26b28[_0x293481(0x224)]('\x27'))&&(_0xd26b28=_0xd26b28[_0x293481(0x218)](0x1,-0x1)),_0x59d42e[_0xaf5345]=_0xd26b28;}}return _0x59d42e;}export function readUserConfig(){const _0x1e99d4=a46_0x2771,_0x39a64c=getConfigFile();if(!existsSync(_0x39a64c))return{};try{const _0x3853e4=readFileSync(_0x39a64c,'utf-8');return parseEnvFile(_0x3853e4);}catch(_0x6c5b19){return console[_0x1e99d4(0x20a)](_0x1e99d4(0x1ff)+_0x39a64c+':',_0x6c5b19),{};}}export function resolveSite(_0x49a8ce){const _0x3e9cfb=a46_0x2771,_0x4bb24d=[_0x3e9cfb(0x1fe),_0x3e9cfb(0x20c),_0x3e9cfb(0x22f),_0x3e9cfb(0x217),'ap03',_0x3e9cfb(0x229),_0x3e9cfb(0x1ec),'stg-us01','stg-jp01',_0x3e9cfb(0x1ee)];if(_0x4bb24d['includes'](_0x49a8ce))return _0x49a8ce;if(_0x49a8ce in SITE_ALIASES)return SITE_ALIASES[_0x49a8ce];return console[_0x3e9cfb(0x20a)](_0x3e9cfb(0x233)+_0x49a8ce+_0x3e9cfb(0x1f5)),_0x3e9cfb(0x1fe);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4a80da,_0x30f259){const _0x45af9a=a46_0x2771,_0x15fc37=_0x30f259||getActiveProfileName();if(_0x15fc37){const _0x511db2=_0x45af9a(0x207)+normalizeProfileForEnvVar(_0x15fc37);if(process[_0x45af9a(0x1fc)][_0x511db2])return process[_0x45af9a(0x1fc)][_0x511db2];}if(process[_0x45af9a(0x1fc)][_0x45af9a(0x21a)])return process[_0x45af9a(0x1fc)][_0x45af9a(0x21a)];if(process[_0x45af9a(0x1fc)][_0x45af9a(0x209)])return process[_0x45af9a(0x1fc)]['TD_API_KEY'];const _0x4a901e=_0x4a80da['toUpperCase']()[_0x45af9a(0x227)](/-/g,'_'),_0x158188=_0x45af9a(0x234)+_0x4a901e;if(_0x15fc37){const _0xfc4a14=loadProfileEnv(_0x15fc37);if(_0xfc4a14){if(_0xfc4a14[_0x158188])return _0xfc4a14[_0x158188];if(_0xfc4a14[_0x45af9a(0x209)])return _0xfc4a14[_0x45af9a(0x209)];}}const _0x52c637=loadUserConfigOnce();if(_0x52c637[_0x158188])return _0x52c637[_0x158188];if(_0x52c637['TD_API_KEY'])return _0x52c637[_0x45af9a(0x209)];return undefined;}export function normalizeProfileForEnvVar(_0x2f62d2){const _0x5ce1ed=a46_0x2771;return _0x2f62d2[_0x5ce1ed(0x1f1)]()[_0x5ce1ed(0x227)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x41b408,_0x3c09e5){const _0x1f1a6f=a46_0x2771,_0x49b207=_0x3c09e5||getActiveProfileName()||undefined;if(_0x49b207){const _0x2c90c0=_0x1f1a6f(0x207)+normalizeProfileForEnvVar(_0x49b207);if(process[_0x1f1a6f(0x1fc)][_0x2c90c0])return{'apiKey':process[_0x1f1a6f(0x1fc)][_0x2c90c0],'source':_0x2c90c0+_0x1f1a6f(0x226),'isDeprecated':![]};const _0x555f1c=getCachedCredential(_0x41b408,_0x49b207);if(_0x555f1c)return{'apiKey':_0x555f1c,'source':_0x1f1a6f(0x206)+_0x49b207+')','isDeprecated':![]};const _0x3f3d53=await getKeychainAPIKey(_0x49b207);if(_0x3f3d53)return setCachedCredential(_0x3f3d53,_0x41b408,_0x49b207),{'apiKey':_0x3f3d53,'source':_0x1f1a6f(0x206)+_0x49b207+')','isDeprecated':![]};}if(process['env'][_0x1f1a6f(0x21a)])return{'apiKey':process['env'][_0x1f1a6f(0x21a)],'source':_0x1f1a6f(0x20b),'isDeprecated':![]};if(!_0x49b207){const _0x41cdf6=getCachedCredential(_0x41b408,undefined);if(_0x41cdf6)return{'apiKey':_0x41cdf6,'source':_0x1f1a6f(0x212),'isDeprecated':![]};const _0x1ce979=await getKeychainAPIKey(undefined);if(_0x1ce979)return setCachedCredential(_0x1ce979,_0x41b408,undefined),{'apiKey':_0x1ce979,'source':_0x1f1a6f(0x212),'isDeprecated':![]};}if(process[_0x1f1a6f(0x1fc)][_0x1f1a6f(0x209)])return{'apiKey':process[_0x1f1a6f(0x1fc)][_0x1f1a6f(0x209)],'source':_0x1f1a6f(0x22e),'isDeprecated':!![]};const _0x163b30=getLegacyEnvAPIKey(_0x41b408,_0x49b207);if(_0x163b30){const _0x1dab07=await isKeychainAvailable();if(_0x1dab07)try{await saveKeychainAPIKey(_0x163b30,_0x49b207),setCachedCredential(_0x163b30,_0x41b408,_0x49b207);const _0x5dd26d=getConfigFilePath(_0x49b207);cleanupLegacyEnvFile(_0x5dd26d)&&console[_0x1f1a6f(0x20a)](a46_0x5aff50[_0x1f1a6f(0x205)](_0x1f1a6f(0x1e6)));}catch(_0xcb83c1){console[_0x1f1a6f(0x20a)](a46_0x5aff50[_0x1f1a6f(0x205)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0xcb83c1));}const _0x4c818f=_0x49b207?_0x1f1a6f(0x215)+_0x49b207+')':_0x1f1a6f(0x22a);return{'apiKey':_0x163b30,'source':_0x4c818f,'isDeprecated':!![]};}return null;}function a46_0x3730(){const _0x3de4c6=['Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','1695258dvumqR','readFileSync','35084TqVXVI','Warning:\x20Failed\x20to\x20load\x20','site','yellow','keychain\x20(profile:\x20','TDX_API_KEY_','64eDxKnJ','TD_API_KEY','warn','TDX_API_KEY\x20env\x20var','jp01','string','1352076hxAzFU','utf-8','Warning:\x20Failed\x20to\x20read\x20','296DAVjPZ','keychain','profiles','stringify','legacy\x20.env\x20file\x20(profile:\x20','startsWith','ap02','slice','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','TDX_API_KEY','8130qRHUKj','accountId','toISOString','TDX_API_KEY_<PROFILE>','.env.','existsSync','entries','account_info.json','tdx','endsWith','apiKey','\x20env\x20var','replace','split','dev-us01','legacy\x20.env\x20file','filter','.cache','19778382Vdvctn','TD_API_KEY\x20env\x20var\x20(deprecated)','eu01','38061tJyDjo','number','join','Warning:\x20Unknown\x20site\x20\x27','TD_API_KEY_','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','profile','parse','stg-jp01','isDeprecated','projectId','dev-eu01','apiKeys','stg-ap03','map','includes','toUpperCase','llm_default_project','trim','llm_default_agent.','\x27,\x20defaulting\x20to\x20us01','source','ap03','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','TDX_CONFIG_DIR','.env','655914DHxngy','env','TDX_CACHE_DIR','us01'];a46_0x3730=function(){return _0x3de4c6;};return a46_0x3730();}export async function getAPIKeyAsync(_0x533cfc,_0x36f1b1,_0x500723=!![]){const _0x172c74=a46_0x2771,_0x72309b=await resolveAPIKeyAsync(_0x533cfc,_0x36f1b1);if(!_0x72309b)return undefined;if(_0x500723&&_0x72309b[_0x172c74(0x1ea)]&&_0x72309b[_0x172c74(0x1f6)][_0x172c74(0x1f0)]('TD_API_KEY')){const _0x64e2d8=_0x36f1b1||getActiveProfileName()||undefined,_0xb5bdf2=_0x64e2d8?_0x172c74(0x207)+normalizeProfileForEnvVar(_0x64e2d8):_0x172c74(0x21e);console['warn'](a46_0x5aff50['yellow']('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x172c74(0x219)+_0xb5bdf2+').')));}return _0x72309b[_0x172c74(0x225)];}function getLegacyEnvAPIKey(_0x599d83,_0x2a5dde){const _0x1a8937=a46_0x2771,_0x3fb550=_0x599d83[_0x1a8937(0x1f1)]()[_0x1a8937(0x227)](/-/g,'_'),_0x54a2e9=_0x1a8937(0x234)+_0x3fb550;if(_0x2a5dde){const _0x3908f7=loadProfileEnv(_0x2a5dde);if(_0x3908f7){if(_0x3908f7[_0x54a2e9])return _0x3908f7[_0x54a2e9];if(_0x3908f7[_0x1a8937(0x209)])return _0x3908f7[_0x1a8937(0x209)];}}const _0x55e5de=loadUserConfigOnce();if(_0x55e5de[_0x54a2e9])return _0x55e5de[_0x54a2e9];if(_0x55e5de[_0x1a8937(0x209)])return _0x55e5de[_0x1a8937(0x209)];return undefined;}function cleanupLegacyEnvFile(_0x503449){const _0x4b8f15=a46_0x2771;if(!existsSync(_0x503449))return![];try{const _0x9a899f=readFileSync(_0x503449,_0x4b8f15(0x20f)),_0x241300=_0x9a899f[_0x4b8f15(0x228)]('\x0a'),_0x3cf3c3=_0x241300[_0x4b8f15(0x22b)](_0x4cc501=>{const _0x4ae62a=_0x4b8f15,_0x1d4523=_0x4cc501[_0x4ae62a(0x1f3)]();if(!_0x1d4523||_0x1d4523[_0x4ae62a(0x216)]('#'))return!![];const [_0x2c59d7]=_0x1d4523[_0x4ae62a(0x228)]('=');return!_0x2c59d7[_0x4ae62a(0x216)]('TD_API_KEY');}),_0x385dd4=_0x3cf3c3['some'](_0x4d55d9=>{const _0x44a270=_0x4b8f15,_0x24d1c7=_0x4d55d9[_0x44a270(0x1f3)]();return _0x24d1c7&&!_0x24d1c7[_0x44a270(0x216)]('#');});if(!_0x385dd4)return unlinkSync(_0x503449),!![];return writeFileSync(_0x503449,_0x3cf3c3[_0x4b8f15(0x232)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1f1b2d){const _0x5ba574=a46_0x2771,_0x47e5ce=a46_0x2892f0[_0x5ba574(0x232)](getConfigDir(),_0x5ba574(0x21f)+_0x1f1b2d);if(a46_0x617de2[_0x5ba574(0x220)](_0x47e5ce)){validateSecureFilePermissions(_0x47e5ce);try{const _0x43a836=a46_0x617de2[_0x5ba574(0x201)](_0x47e5ce,'utf-8');return parseEnvFile(_0x43a836);}catch(_0x469da2){console['warn'](_0x5ba574(0x203)+_0x47e5ce+':\x20'+_0x469da2);}}const _0x2cffed=a46_0x2892f0[_0x5ba574(0x232)](getConfigDir(),_0x5ba574(0x213),_0x1f1b2d,_0x5ba574(0x1fa));if(a46_0x617de2[_0x5ba574(0x220)](_0x2cffed)){validateSecureFilePermissions(_0x2cffed);try{const _0x21cd76=a46_0x617de2[_0x5ba574(0x201)](_0x2cffed,'utf-8');return parseEnvFile(_0x21cd76);}catch(_0x42faae){return console[_0x5ba574(0x20a)](_0x5ba574(0x203)+_0x2cffed+':\x20'+_0x42faae),null;}}return null;}function getActiveProfileName(){const _0x8a110d=a46_0x2771,_0x3da0a5=a46_0x2892f0[_0x8a110d(0x232)](getConfigDir(),'tdx.json');if(!a46_0x617de2['existsSync'](_0x3da0a5))return null;try{const _0x36b622=a46_0x617de2[_0x8a110d(0x201)](_0x3da0a5,_0x8a110d(0x20f)),_0x440611=JSON['parse'](_0x36b622);return _0x440611[_0x8a110d(0x1e7)]||null;}catch{return null;}}export function saveAPIKey(_0x2e347a,_0x451689,_0x21906b){const _0xcedbd4=a46_0x2771,_0x47b412=getConfigDir(),_0x30f685=getConfigFilePath(_0x21906b);!existsSync(_0x47b412)&&mkdirSync(_0x47b412,{'recursive':!![],'mode':0x1c0});let _0x3145a1={};if(existsSync(_0x30f685))try{const _0x27383d=readFileSync(_0x30f685,_0xcedbd4(0x20f));_0x3145a1=parseEnvFile(_0x27383d);}catch(_0x130be2){console[_0xcedbd4(0x20a)](_0xcedbd4(0x210)+_0x30f685+':',_0x130be2);}const _0x44544b=_0x2e347a[_0xcedbd4(0x1f1)]()['replace'](/-/g,'_');_0x3145a1['TD_API_KEY_'+_0x44544b]=_0x451689;const _0x18bf7a=Object[_0xcedbd4(0x221)](_0x3145a1)[_0xcedbd4(0x1ef)](([_0x25079e,_0x30b8d1])=>_0x25079e+'='+_0x30b8d1);writeFileSync(_0x30f685,_0x18bf7a[_0xcedbd4(0x232)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x58a9bf,_0xf49682,_0x287bec){const _0x3d8b5e=a46_0x2771;await saveKeychainAPIKey(_0x58a9bf,_0x287bec),setCachedCredential(_0x58a9bf,_0xf49682,_0x287bec);const _0xbe1b3d=getConfigFilePath(_0x287bec);cleanupLegacyEnvFile(_0xbe1b3d)&&console[_0x3d8b5e(0x20a)](a46_0x5aff50['yellow'](_0x3d8b5e(0x1f8)));}function a46_0x2771(_0xd7209f,_0x54f474){_0xd7209f=_0xd7209f-0x1e6;const _0x3730eb=a46_0x3730();let _0x277160=_0x3730eb[_0xd7209f];return _0x277160;}export function loadConfig(){const _0x59f403=a46_0x2771,_0x3d08eb={'apiKeys':{},'defaultSite':_0x59f403(0x1fe)},_0x138cf9=[_0x59f403(0x1fe),_0x59f403(0x20c),_0x59f403(0x22f),_0x59f403(0x217),_0x59f403(0x1f7),'dev-us01',_0x59f403(0x1ec),'stg-us01',_0x59f403(0x1e9),'stg-ap03'];for(const _0x265b4b of _0x138cf9){const _0x4ef2f5=getAPIKey(_0x265b4b);_0x4ef2f5&&(_0x3d08eb[_0x59f403(0x1ed)][_0x265b4b]=_0x4ef2f5);}return _0x3d08eb;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3744c9,_0x220d1d){const _0x335ec9=a47_0xa425,_0x4a1633=_0x3744c9();while(!![]){try{const _0x4a0889=parseInt(_0x335ec9(0x106))/0x1*(-parseInt(_0x335ec9(0x102))/0x2)+parseInt(_0x335ec9(0x10a))/0x3+parseInt(_0x335ec9(0x109))/0x4+-parseInt(_0x335ec9(0xfe))/0x5*(-parseInt(_0x335ec9(0x107))/0x6)+-parseInt(_0x335ec9(0x10d))/0x7*(-parseInt(_0x335ec9(0x105))/0x8)+parseInt(_0x335ec9(0x103))/0x9+-parseInt(_0x335ec9(0x10b))/0xa*(parseInt(_0x335ec9(0xff))/0xb);if(_0x4a0889===_0x220d1d)break;else _0x4a1633['push'](_0x4a1633['shift']());}catch(_0x4dadfe){_0x4a1633['push'](_0x4a1633['shift']());}}}(a47_0x122e,0x8c1f6));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a47_0xa425(_0x1185c9,_0x53625a){_0x1185c9=_0x1185c9-0xfe;const _0x122ecb=a47_0x122e();let _0xa42567=_0x122ecb[_0x1185c9];return _0xa42567;}import{join}from'path';import{getCacheDir}from'./config.js';function a47_0x122e(){const _0x1a3e3e=['3464vpKgMn','23smCCCg','850548IbWOOt','connections','2500196YZWJLa','1134966LqqQKT','20BFWDdB','utf-8','11235UvCYWy','30eoIsaO','7638279BqCpyZ','now','stringify','88682RnXRhF','3903111tieIxy','connections-'];a47_0x122e=function(){return _0x1a3e3e;};return a47_0x122e();}function getCacheFilePath(_0x897cdf){const _0xb4a261=a47_0xa425,_0x3a2bc5=_0x897cdf||'default';return join(getCacheDir(),_0xb4a261(0x104)+_0x3a2bc5+'.json');}export function loadCachedConnections(_0x438cd0){const _0x1b127f=a47_0xa425,_0x37a992=getCacheFilePath(_0x438cd0);if(!existsSync(_0x37a992))return null;try{const _0x4883c3=readFileSync(_0x37a992,'utf-8'),_0x1cfc1a=JSON['parse'](_0x4883c3);return _0x1cfc1a[_0x1b127f(0x108)];}catch{return null;}}export function saveCachedConnections(_0x72d0a1,_0x1d80e7){const _0x57d1d0=a47_0xa425,_0x33c890=getCacheDir();!existsSync(_0x33c890)&&mkdirSync(_0x33c890,{'recursive':!![]});const _0x880c05=getCacheFilePath(_0x72d0a1),_0x3275e9={'connections':_0x1d80e7,'cachedAt':Date[_0x57d1d0(0x100)]()};writeFileSync(_0x880c05,JSON[_0x57d1d0(0x101)](_0x3275e9,null,0x2),_0x57d1d0(0x10c));}export function clearConnectionCache(_0x326dd9){const _0x32f666=getCacheFilePath(_0x326dd9);if(existsSync(_0x32f666))try{unlinkSync(_0x32f666);}catch{}}
|