@treasuredata/tdx 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.d.ts +5 -4
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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/llm.js +1 -1
- package/dist/sdk/query.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.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +1 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.d.ts +12 -0
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/endpoints.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.d.ts +1 -0
- package/dist/utils/fields-display.d.ts.map +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/fields-display.js.map +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a34_0x248d73=a34_0x2b43;function a34_0x5ebb(){const _0x86c964=['713503lWsgvB','7550jSwbgy','Parent\x20ID:\x20','slice','Context\x20cleared.\x20Back\x20to\x20root.','split','36130DhDkni','type','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segments','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Usage:\x20tdx\x20segment\x20use\x20<path>','Use:\x20tdx\x20segment\x20use\x20','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','1203594WVqURN','segment','3566136iysYZG','isAbsolute','error','20THMwGc','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Folder\x20ID:\x20','resolvePathToResource','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','name','verbose','fullPath','4708045xMWLZE','16542ffPEKZ','segment:use','Target\x20path:\x20','join','session','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','parentId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segmentPath','40QiGODO','4009592XZnjOq','Site:\x20','length','Error:\x20Path\x20is\x20required'];a34_0x5ebb=function(){return _0x86c964;};return a34_0x5ebb();}function a34_0x2b43(_0x1d0dd3,_0x4e5101){const _0x5ebb38=a34_0x5ebb();return a34_0x2b43=function(_0x2b431f,_0x2658d9){_0x2b431f=_0x2b431f-0x10c;let _0x3cac67=_0x5ebb38[_0x2b431f];return _0x3cac67;},a34_0x2b43(_0x1d0dd3,_0x4e5101);}(function(_0x5ebd94,_0x579af3){const _0x12c906=a34_0x2b43,_0x398543=_0x5ebd94();while(!![]){try{const _0x30e8a8=-parseInt(_0x12c906(0x12d))/0x1*(-parseInt(_0x12c906(0x11a))/0x2)+-parseInt(_0x12c906(0x128))/0x3+parseInt(_0x12c906(0x110))/0x4+parseInt(_0x12c906(0x135))/0x5+parseInt(_0x12c906(0x12a))/0x6+-parseInt(_0x12c906(0x114))/0x7*(parseInt(_0x12c906(0x10f))/0x8)+-parseInt(_0x12c906(0x136))/0x9*(parseInt(_0x12c906(0x115))/0xa);if(_0x30e8a8===_0x579af3)break;else _0x398543['push'](_0x398543['shift']());}catch(_0x4fa3c5){_0x398543['push'](_0x398543['shift']());}}}(a34_0x5ebb,0x92c2a));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a34_0x248d73(0x132)]=a34_0x248d73(0x137);[a34_0x248d73(0x125)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0xc306e9){const _0x791372=a34_0x248d73,{options:_0x4d4fde,args:_0x15ae9a,tdx:_0x28a5d7}=_0xc306e9;if(_0x15ae9a[_0x791372(0x112)]===0x0)return console['error'](_0x791372(0x113)),console['error'](_0x791372(0x123)),console[_0x791372(0x12c)]('Examples:'),console[_0x791372(0x12c)](_0x791372(0x11d)),console['error'](_0x791372(0x10d)),console[_0x791372(0x12c)](_0x791372(0x122)),console[_0x791372(0x12c)](_0x791372(0x131)),0x1;const _0x3bfd19=_0x15ae9a[0x0],_0x37815d=_0x4d4fde[_0x791372(0x13a)];try{if(_0x3bfd19==='/')return saveSessionContext({'segment_path':undefined},_0x37815d),console['log'](_0x791372(0x118)),0x0;const _0x5cac69=_0x4d4fde[_0x791372(0x10e)];let _0xebd14=_0x3bfd19;const _0x370467=parsePath(_0x3bfd19);if(!_0x370467[_0x791372(0x12b)]){if(!_0x5cac69)return console['error'](_0x791372(0x13b)),console[_0x791372(0x12c)](_0x791372(0x11e)),0x1;if(_0x3bfd19==='..'){const _0x1864e8=_0x5cac69[_0x791372(0x119)]('/')[_0x791372(0x117)](0x0,-0x1)['join']('/');_0xebd14=_0x1864e8||'/';}else _0x3bfd19==='.'?_0xebd14=_0x5cac69:_0xebd14=_0x5cac69+'/'+_0x3bfd19;_0x4d4fde[_0x791372(0x133)]&&console[_0x791372(0x12c)]('Resolved\x20relative\x20path\x20to:\x20'+_0xebd14);}if(_0xebd14==='/'||_0xebd14==='')return saveSessionContext({'segment_path':undefined},_0x37815d),console[_0x791372(0x127)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0xebd14=normalizePath(_0xebd14);const _0x376a81=parsePath(_0xebd14)[_0x791372(0x11f)];if(_0x376a81['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x37815d),console[_0x791372(0x127)](_0x791372(0x118)),0x0;_0x4d4fde[_0x791372(0x133)]&&(console[_0x791372(0x12c)](_0x791372(0x111)+_0x4d4fde['site']),console[_0x791372(0x12c)](_0x791372(0x138)+_0xebd14));const _0x2f9c38=await withSpinner('Resolving\x20path\x20\x27'+_0xebd14+'\x27...',()=>_0x28a5d7[_0x791372(0x129)][_0x791372(0x130)](_0xebd14),{'verbose':_0x4d4fde[_0x791372(0x133)]}),_0x297d3f=_0x2f9c38['data'];_0x4d4fde[_0x791372(0x133)]&&(console[_0x791372(0x12c)]('Resolved\x20path\x20type:\x20'+_0x297d3f[_0x791372(0x11b)]),console[_0x791372(0x12c)](_0x791372(0x116)+_0x297d3f[_0x791372(0x10c)]),_0x297d3f['folderId']&&console[_0x791372(0x12c)](_0x791372(0x12f)+_0x297d3f['folderId']));if(_0x297d3f['type']===_0x791372(0x129))return console['error'](_0x791372(0x126)),console[_0x791372(0x12c)](_0x791372(0x120)),console[_0x791372(0x12c)](_0x791372(0x124)+_0x297d3f['parentName']+(_0x297d3f[_0x791372(0x13c)]?'/'+_0x297d3f[_0x791372(0x13c)][_0x791372(0x139)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x297d3f[_0x791372(0x134)],'parent_segment':_0x297d3f[_0x791372(0x11c)]},_0x37815d),console[_0x791372(0x127)](_0x791372(0x121)+_0x297d3f[_0x791372(0x134)]),_0x4d4fde['verbose']&&(console[_0x791372(0x12c)](_0x791372(0x12e)),console[_0x791372(0x12c)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x791372(0x12c)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0xb13ebc){throw _0xb13ebc;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x3e2f03=a35_0x1431;(function(_0x3034e9,_0x1bd188){const _0x4d4997=a35_0x1431,_0x1f85e7=_0x3034e9();while(!![]){try{const _0x29c6a1=parseInt(_0x4d4997(0x196))/0x1*(parseInt(_0x4d4997(0x198))/0x2)+parseInt(_0x4d4997(0x194))/0x3+-parseInt(_0x4d4997(0x1a3))/0x4+parseInt(_0x4d4997(0x1a5))/0x5+parseInt(_0x4d4997(0x192))/0x6*(parseInt(_0x4d4997(0x1a1))/0x7)+-parseInt(_0x4d4997(0x1a6))/0x8*(-parseInt(_0x4d4997(0x1cb))/0x9)+parseInt(_0x4d4997(0x1cd))/0xa*(-parseInt(_0x4d4997(0x1a9))/0xb);if(_0x29c6a1===_0x1bd188)break;else _0x1f85e7['push'](_0x1f85e7['shift']());}catch(_0x6fb4b){_0x1f85e7['push'](_0x1f85e7['shift']());}}}(a35_0x3dce,0x62048));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a35_0x1431(_0x1b6c95,_0x5c260b){const _0x3dce59=a35_0x3dce();return a35_0x1431=function(_0x143131,_0x1b313e){_0x143131=_0x143131-0x18e;let _0x18bb5d=_0x3dce59[_0x143131];return _0x18bb5d;},a35_0x1431(_0x1b6c95,_0x5c260b);}function a35_0x3dce(){const _0x1d7d7e=['7PcWQwv','\x20folder','2608320Btmvhe','map','1299495IJDFbu','6360nsFneP','Parent\x20ID:\x20','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','33bvUfUI','population','✔\x20Found\x20','Listing\x20parent\x20segments...','\x20matching\x20\x27','jsonl','\x27...','format','length','error','recursive','sort','listParentsWithPattern','resolvePathToResource','Folder\x20ID:\x20','localeCompare','dim','Error:\x20','data','name','includes','Listing\x20folders\x20and\x20segments...','[parent\x20segments]','Resolving\x20context\x20path\x20\x27','👥\x20','\x20\x20Cause:\x20','Building\x20hierarchy\x20tree...','listRecursive','folder','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','(empty)','listUnified','Recursive\x20mode:\x20enabled','cause','2466KNTDFA','test','3412770VqeHOu','log','filter','Current\x20context:\x20','execute','listParents','4002756DeXHfX','Path/pattern\x20arg:\x20','1153983AlFcuC','\x20parent\x20segment','547875CwguQJ','site','2ceuutm','attributes','replace','parentId','verbose','segment','folderId','Listing\x20parent\x20segments\x20matching\x20\x27','json'];a35_0x3dce=function(){return _0x1d7d7e;};return a35_0x3dce();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a35_0x348837 from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';['description']='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a35_0x3e2f03(0x190)](_0xd6fc57){const _0x1bf110=a35_0x3e2f03,{options:_0x37778f,args:_0x224e74}=_0xd6fc57,_0x4d117d=_0x37778f[_0x1bf110(0x1b3)],_0x355bad=_0x224e74[0x0];try{const _0x319b2c=_0x37778f['segmentPath'];_0x37778f[_0x1bf110(0x19c)]&&(console[_0x1bf110(0x1b2)]('Site:\x20'+_0x37778f[_0x1bf110(0x197)]),console['error'](_0x1bf110(0x18f)+(_0x319b2c||'/')),_0x355bad&&console[_0x1bf110(0x1b2)](_0x1bf110(0x193)+_0x355bad),_0x4d117d&&console['error'](_0x1bf110(0x1c9)));if(_0x355bad){const _0x3afc13=_0x355bad['includes']('*')||_0x355bad[_0x1bf110(0x1bd)]('?');if(_0x3afc13&&!_0x319b2c)return await this[_0x1bf110(0x1b5)](_0xd6fc57,_0x355bad);else return _0x3afc13?(console[_0x1bf110(0x1b2)](_0x1bf110(0x1a8)),console[_0x1bf110(0x1b2)](_0x1bf110(0x1c6)),0x1):_0x4d117d?await this[_0x1bf110(0x1c4)](_0xd6fc57,_0x355bad):await this['listUnified'](_0xd6fc57,_0x355bad);}if(!_0x319b2c)return await this[_0x1bf110(0x191)](_0xd6fc57);return _0x4d117d?await this[_0x1bf110(0x1c4)](_0xd6fc57,_0x319b2c):await this[_0x1bf110(0x1c8)](_0xd6fc57,_0x319b2c);}catch(_0x216d30){if(_0x216d30 instanceof SDKError)return console[_0x1bf110(0x1b2)](_0x1bf110(0x1ba)+_0x216d30['message']),_0x216d30[_0x1bf110(0x1ca)]&&console[_0x1bf110(0x1b2)](_0x1bf110(0x1c2)+_0x216d30[_0x1bf110(0x1ca)]),0x1;throw _0x216d30;}}async['listParentsWithPattern'](_0x3df1f7,_0x401f3f){const _0x36fb0e=a35_0x3e2f03,{options:_0x446146,tdx:_0x3caed8}=_0x3df1f7,_0xc25f02=await withSpinner(_0x36fb0e(0x19f)+_0x401f3f+'\x27...',()=>_0x3caed8[_0x36fb0e(0x19d)][_0x36fb0e(0x191)](),{'verbose':_0x446146[_0x36fb0e(0x19c)]}),_0x231d58=_0xc25f02[_0x36fb0e(0x1bb)],_0xd24145=_0x401f3f['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x36fb0e(0x19a)](/\?/g,'.'),_0x46d272=new RegExp('^'+_0xd24145+'$','i'),_0x784e5b=_0x231d58[_0x36fb0e(0x18e)](_0xddb1e4=>_0x46d272[_0x36fb0e(0x1cc)](_0xddb1e4[_0x36fb0e(0x199)][_0x36fb0e(0x1bc)]));console[_0x36fb0e(0x1b2)](_0x36fb0e(0x1ab)+_0x784e5b[_0x36fb0e(0x1b1)]+_0x36fb0e(0x195)+(_0x784e5b[_0x36fb0e(0x1b1)]!==0x1?'s':'')+_0x36fb0e(0x1ad)+_0x401f3f+'\x27');if(_0x446146[_0x36fb0e(0x1b0)]===_0x36fb0e(0x1a0)||_0x446146[_0x36fb0e(0x1b0)]===_0x36fb0e(0x1ae))await handleSDKOutput(_0x784e5b,_0x446146);else{if(_0x784e5b[_0x36fb0e(0x1b1)]===0x0)console[_0x36fb0e(0x1ce)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x401f3f);else{console['log'](_0x36fb0e(0x1bf));for(const _0x45ae1a of _0x784e5b){const _0x50ae67=_0x45ae1a['attributes'][_0x36fb0e(0x1aa)]?a35_0x348837[_0x36fb0e(0x1b9)]('\x20('+formatRows(_0x45ae1a[_0x36fb0e(0x199)][_0x36fb0e(0x1aa)])+')'):'';console[_0x36fb0e(0x1ce)](_0x36fb0e(0x1c1)+_0x45ae1a[_0x36fb0e(0x199)][_0x36fb0e(0x1bc)]+_0x50ae67);}}}return 0x0;}async[a35_0x3e2f03(0x191)](_0x30f432){const _0x80e441=a35_0x3e2f03,{options:_0x18e455,tdx:_0x49548f}=_0x30f432,_0x1b1f76=await withSpinner(_0x80e441(0x1ac),()=>_0x49548f['segment'][_0x80e441(0x191)](),{'verbose':_0x18e455[_0x80e441(0x19c)]}),_0x16ac2a=_0x1b1f76[_0x80e441(0x1bb)];console['error'](_0x80e441(0x1ab)+_0x16ac2a['length']+_0x80e441(0x195)+(_0x16ac2a[_0x80e441(0x1b1)]!==0x1?'s':''));if(_0x18e455[_0x80e441(0x1b0)]===_0x80e441(0x1a0)||_0x18e455[_0x80e441(0x1b0)]===_0x80e441(0x1ae))await handleSDKOutput(_0x16ac2a,_0x18e455);else{console['log'](_0x80e441(0x1bf));for(const _0x43972c of _0x16ac2a){const _0x47ac17=_0x43972c['attributes'][_0x80e441(0x1aa)]?a35_0x348837[_0x80e441(0x1b9)]('\x20('+formatRows(_0x43972c[_0x80e441(0x199)][_0x80e441(0x1aa)])+')'):'';console['log'](_0x80e441(0x1c1)+_0x43972c[_0x80e441(0x199)][_0x80e441(0x1bc)]+_0x47ac17);}}return 0x0;}async[a35_0x3e2f03(0x1c8)](_0x591190,_0x5b139d){const _0x136410=a35_0x3e2f03,{options:_0x298eb2,tdx:_0x317cf8}=_0x591190,_0x356612=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x5b139d+_0x136410(0x1af),()=>_0x317cf8['segment'][_0x136410(0x1b6)](_0x5b139d),{'verbose':_0x298eb2['verbose']}),_0x340740=_0x356612[_0x136410(0x1bb)];_0x298eb2[_0x136410(0x19c)]&&(console[_0x136410(0x1b2)]('Parent\x20ID:\x20'+_0x340740[_0x136410(0x19b)]),_0x340740[_0x136410(0x19e)]&&console[_0x136410(0x1b2)](_0x136410(0x1b7)+_0x340740[_0x136410(0x19e)]));const _0x4923d0=await withSpinner(_0x136410(0x1be),()=>_0x317cf8[_0x136410(0x19d)]['listUnified'](_0x340740[_0x136410(0x19b)],_0x340740[_0x136410(0x19e)]),{'verbose':_0x298eb2[_0x136410(0x19c)]}),{folders:_0xef5518,segments:_0x4f1478}=_0x4923d0[_0x136410(0x1bb)],_0x46bd44=_0xef5518[_0x136410(0x1b1)]+_0x4f1478[_0x136410(0x1b1)];console[_0x136410(0x1b2)](_0x136410(0x1ab)+_0xef5518[_0x136410(0x1b1)]+_0x136410(0x1a2)+(_0xef5518['length']!==0x1?'s':'')+'\x20and\x20'+_0x4f1478['length']+'\x20segment'+(_0x4f1478[_0x136410(0x1b1)]!==0x1?'s':''));if(_0x298eb2[_0x136410(0x1b0)]==='json'||_0x298eb2['format']===_0x136410(0x1ae)){const _0x4cdbb5=[..._0xef5518['map'](_0x316f09=>({..._0x316f09,'type':_0x136410(0x1c5)})),..._0x4f1478[_0x136410(0x1a4)](_0x317db1=>({..._0x317db1,'type':_0x136410(0x19d)}))][_0x136410(0x1b4)]((_0x43107f,_0x3e78fc)=>_0x43107f['name'][_0x136410(0x1b8)](_0x3e78fc[_0x136410(0x1bc)]));await handleSDKOutput(_0x4cdbb5,_0x298eb2);}else{if(_0x46bd44===0x0)console[_0x136410(0x1ce)](a35_0x348837[_0x136410(0x1b9)]('[/'+_0x5b139d+']')),console[_0x136410(0x1ce)](_0x136410(0x1c7));else{console['log'](a35_0x348837[_0x136410(0x1b9)]('[/'+_0x5b139d+']'));const _0x4bc453=formatFlatList(_0xef5518,_0x4f1478,{'showMetadata':!![]});console[_0x136410(0x1ce)](_0x4bc453);}}return 0x0;}async['listRecursive'](_0x40d80d,_0x465048){const _0x4adfc6=a35_0x3e2f03,{options:_0x5def86,tdx:_0x49c364}=_0x40d80d,_0x20ee31=await withSpinner(_0x4adfc6(0x1c0)+_0x465048+_0x4adfc6(0x1af),()=>_0x49c364[_0x4adfc6(0x19d)][_0x4adfc6(0x1b6)](_0x465048),{'verbose':_0x5def86['verbose']}),_0x74f388=_0x20ee31[_0x4adfc6(0x1bb)];_0x5def86[_0x4adfc6(0x19c)]&&(console[_0x4adfc6(0x1b2)](_0x4adfc6(0x1a7)+_0x74f388[_0x4adfc6(0x19b)]),_0x74f388['folderId']&&console[_0x4adfc6(0x1b2)](_0x4adfc6(0x1b7)+_0x74f388[_0x4adfc6(0x19e)]));const _0x519ca1=_0x5def86['maxDepth']||0xa,_0x2d8a9a=await withSpinner(_0x4adfc6(0x1c3),()=>_0x49c364[_0x4adfc6(0x19d)][_0x4adfc6(0x1c4)](_0x74f388[_0x4adfc6(0x19b)],_0x74f388[_0x4adfc6(0x19e)],0x0,_0x519ca1),{'verbose':_0x5def86[_0x4adfc6(0x19c)]}),_0x6bdeb3=_0x2d8a9a['data'];console[_0x4adfc6(0x1b2)]('✔\x20Built\x20tree\x20with\x20'+_0x6bdeb3[_0x4adfc6(0x1b1)]+'\x20top-level\x20items');if(_0x5def86[_0x4adfc6(0x1b0)]==='json'||_0x5def86[_0x4adfc6(0x1b0)]===_0x4adfc6(0x1ae))await handleSDKOutput(_0x6bdeb3,_0x5def86);else{console[_0x4adfc6(0x1ce)](a35_0x348837[_0x4adfc6(0x1b9)]('[/'+_0x465048+']'));const _0x5a1ff3=formatTree(_0x6bdeb3,{'showMetadata':!![]});console[_0x4adfc6(0x1ce)](_0x5a1ff3);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x442f59=a36_0x24a8;(function(_0x91a2e2,_0x56b0f1){const _0x689cdd=a36_0x24a8,_0x476f63=_0x91a2e2();while(!![]){try{const _0x1fa2d6=-parseInt(_0x689cdd(0xa4))/0x1*(parseInt(_0x689cdd(0x8f))/0x2)+-parseInt(_0x689cdd(0x8d))/0x3*(parseInt(_0x689cdd(0x99))/0x4)+parseInt(_0x689cdd(0xab))/0x5+-parseInt(_0x689cdd(0x94))/0x6+parseInt(_0x689cdd(0xaa))/0x7*(parseInt(_0x689cdd(0xa1))/0x8)+parseInt(_0x689cdd(0x92))/0x9+parseInt(_0x689cdd(0x90))/0xa;if(_0x1fa2d6===_0x56b0f1)break;else _0x476f63['push'](_0x476f63['shift']());}catch(_0x3340ba){_0x476f63['push'](_0x476f63['shift']());}}}(a36_0x3575,0x7ccd2));function a36_0x3575(){const _0x21a90d=['1734YvTgCY','verbose','346NDclLr','6023760HqyyZh','database','5039937IYpQZx','Usage:\x20tdx\x20show\x20<database.table>','5738400PVFgxJ','error','Querying\x20','table','validate','1844TalrND','length','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','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Table:\x20','show','catalog','Database:\x20','1048YGZXnJ','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','Limit:\x20','2591vWSGuz','cause','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20\x20Cause:\x20','args','Catalog:\x20','8141ciXUuZ','4337825fkqzEl','Show\x20table\x20contents','showTable','query','data','Error:\x20','message','execute','site'];a36_0x3575=function(){return _0x21a90d;};return a36_0x3575();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a36_0x24a8(_0x7561ea,_0x48c467){const _0x3575b9=a36_0x3575();return a36_0x24a8=function(_0x24a8a3,_0x5ab2f0){_0x24a8a3=_0x24a8a3-0x8d;let _0x33d951=_0x3575b9[_0x24a8a3];return _0x33d951;},a36_0x24a8(_0x7561ea,_0x48c467);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a36_0x442f59(0x9e);['description']=a36_0x442f59(0xac);async[a36_0x442f59(0xb2)](_0x15b7f3){const _0x20920f=a36_0x442f59;return this[_0x20920f(0xad)](_0x15b7f3);}async['showTable'](_0x470d08){const _0x575899=a36_0x442f59,{options:_0x4e031d,args:_0x309a5f,tdx:_0xc2430b}=_0x470d08;let _0x42cdf9;try{_0x42cdf9=parseTableReference(_0x309a5f[0x0]);const _0xc1e0d9=_0x4e031d[_0x575899(0x91)];!_0x42cdf9['database']&&_0xc1e0d9&&(_0x42cdf9['database']=_0xc1e0d9);const _0x3ffa81=validateTableDescribeReference(_0x42cdf9);if(_0x3ffa81)return console[_0x575899(0x95)](_0x575899(0xb0)+_0x3ffa81),console[_0x575899(0x95)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x575899(0x95)](_0x575899(0xa6)),console['error'](_0x575899(0x9c)),0x1;}catch(_0x4d99b3){return console[_0x575899(0x95)](_0x575899(0xb0)+_0x4d99b3[_0x575899(0xb1)]),console[_0x575899(0x95)](_0x575899(0x93)),console[_0x575899(0x95)](_0x575899(0xa6)),console[_0x575899(0x95)](_0x575899(0x9c)),0x1;}const _0x352ba5=_0x42cdf9[_0x575899(0x9f)],_0x2888d2=_0x42cdf9[_0x575899(0x91)],_0x385f11=_0x42cdf9[_0x575899(0x97)],_0x309266=resolveLimit(_0x4e031d['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x4e031d[_0x575899(0x8e)]&&(console['error']('Site:\x20'+_0x4e031d[_0x575899(0xb3)]),_0x352ba5&&console['error'](_0x575899(0xa9)+_0x352ba5),console[_0x575899(0x95)](_0x575899(0xa0)+_0x2888d2),console[_0x575899(0x95)](_0x575899(0x9d)+_0x385f11),console['error'](_0x575899(0xa3)+_0x309266));const _0x4eeb08=_0x352ba5?_0x352ba5+'.'+_0x2888d2+'.'+_0x385f11:_0x2888d2+'.'+_0x385f11,_0x1f3e3e=await withSpinner(_0x575899(0x96)+_0x4eeb08+'...',()=>_0xc2430b[_0x575899(0xae)][_0x575899(0xad)](_0x2888d2,_0x385f11,_0x309266,_0x352ba5),{'verbose':_0x4e031d[_0x575899(0x8e)]}),_0x1facac=_0x1f3e3e[_0x575899(0xaf)],_0x128fbd=_0x1facac[_0x575899(0xaf)];return _0x128fbd[_0x575899(0x9a)]===0x0?console[_0x575899(0x95)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x575899(0x95)]('✔\x20Retrieved\x20'+_0x128fbd[_0x575899(0x9a)]+'\x20row'+(_0x128fbd[_0x575899(0x9a)]!==0x1?'s':'')+'\x20from\x20'+_0x4eeb08),await handleSDKOutput(_0x128fbd,_0x4e031d),0x0;}catch(_0x337053){if(_0x337053 instanceof SDKError)return console[_0x575899(0x95)](_0x575899(0xb0)+_0x337053['message']),_0x337053[_0x575899(0xa5)]&&console['error'](_0x575899(0xa7)+_0x337053[_0x575899(0xa5)]),0x1;throw _0x337053;}}[a36_0x442f59(0x98)](_0x295072){const _0x2022c0=a36_0x442f59;if(_0x295072[_0x2022c0(0xa8)][_0x2022c0(0x9a)]===0x0)return _0x2022c0(0x9b);if(_0x295072['args'][_0x2022c0(0x9a)]>0x1)return _0x2022c0(0xa2);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x5cc661=a37_0x1878;(function(_0x142b20,_0x54dbda){const _0x41fc2a=a37_0x1878,_0xcefa25=_0x142b20();while(!![]){try{const _0x593e59=-parseInt(_0x41fc2a(0x124))/0x1+-parseInt(_0x41fc2a(0x122))/0x2*(-parseInt(_0x41fc2a(0x123))/0x3)+-parseInt(_0x41fc2a(0x11f))/0x4+-parseInt(_0x41fc2a(0x10f))/0x5*(parseInt(_0x41fc2a(0x129))/0x6)+-parseInt(_0x41fc2a(0x105))/0x7*(parseInt(_0x41fc2a(0x110))/0x8)+-parseInt(_0x41fc2a(0x120))/0x9*(-parseInt(_0x41fc2a(0x11c))/0xa)+parseInt(_0x41fc2a(0x12d))/0xb;if(_0x593e59===_0x54dbda)break;else _0xcefa25['push'](_0xcefa25['shift']());}catch(_0x41597e){_0xcefa25['push'](_0xcefa25['shift']());}}}(a37_0x48c9,0xd3af8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';function a37_0x48c9(){const _0x193396=['18729645uyHKDX','cause','Table\x20pattern:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','.*\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Cause:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','site','\x20table','178262SoBejD','table','error','Database:\x20all','✖\x20No\x20tables\x20found','Listing\x20tables...','limit','Note:\x20\x27','listTables','Database\x20\x27','15GYmmcf','264XPnwEL','query','Database:\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20','execute','message','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','verbose','length','Or\x20use\x20--in\x20flag:','120GLPtPb','Error:\x20Pattern\x20\x27','\x27\x20is\x20ambiguous.','196012IOvjME','71163TfomEO','tables','14qUwMyV','433737gTATGX','920992szRBQF','✔\x20Found\x20','database','\x27\x20across\x20all\x20databases.','data','264390ppvvik','name','includes','\x20\x20Use:\x20tdx\x20tables\x20\x22'];a37_0x48c9=function(){return _0x193396;};return a37_0x48c9();}function a37_0x1878(_0x2630f5,_0x48d835){const _0x48c9ab=a37_0x48c9();return a37_0x1878=function(_0x187891,_0x3af66b){_0x187891=_0x187891-0x102;let _0x39cc17=_0x48c9ab[_0x187891];return _0x39cc17;},a37_0x1878(_0x2630f5,_0x48d835);}export class TablesCommand extends BaseCommand{[a37_0x5cc661(0x12a)]=a37_0x5cc661(0x121);['description']='List\x20tables\x20in\x20a\x20database';async[a37_0x5cc661(0x116)](_0x1769f0){const _0x5efe05=a37_0x5cc661,{options:_0x5d6210,args:_0x31f77c,tdx:_0x1ebc34}=_0x1769f0;let _0x11fc74;if(_0x31f77c[_0x5efe05(0x11a)]===0x0)_0x11fc74={'database':undefined,'table':undefined,'original':''};else{if(_0x31f77c[_0x5efe05(0x11a)]===0x1)try{_0x11fc74=parseTableReference(_0x31f77c[0x0]);if(_0x11fc74['table']&&!_0x11fc74[_0x5efe05(0x126)]&&!_0x11fc74[_0x5efe05(0x106)]['includes']('*')&&!_0x11fc74['table'][_0x5efe05(0x12b)]('?'))return console[_0x5efe05(0x107)](_0x5efe05(0x11d)+_0x31f77c[0x0]+_0x5efe05(0x11e)),console[_0x5efe05(0x107)](_0x5efe05(0x113)+_0x11fc74[_0x5efe05(0x106)]+'\x27?'),console[_0x5efe05(0x107)](_0x5efe05(0x12c)+_0x11fc74[_0x5efe05(0x106)]+_0x5efe05(0x132)),console[_0x5efe05(0x107)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x11fc74['table']),console[_0x5efe05(0x107)](_0x5efe05(0x102)+_0x11fc74[_0x5efe05(0x106)]),console[_0x5efe05(0x107)](''),console[_0x5efe05(0x107)](_0x5efe05(0x10c)+_0x31f77c[0x0]+_0x5efe05(0x118)+_0x11fc74[_0x5efe05(0x106)]+_0x5efe05(0x127)),0x1;}catch(_0x89a29b){return console['error'](_0x5efe05(0x115)+_0x89a29b[_0x5efe05(0x117)]),0x1;}else return console[_0x5efe05(0x107)](_0x5efe05(0x130)),console[_0x5efe05(0x107)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x5efe05(0x107)](_0x5efe05(0x114)),console[_0x5efe05(0x107)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x5efe05(0x107)](_0x5efe05(0x133)),console[_0x5efe05(0x107)](_0x5efe05(0x11b)),console[_0x5efe05(0x107)](_0x5efe05(0x134)),0x1;}const _0x4e2ea6=_0x5d6210['database'];!_0x11fc74[_0x5efe05(0x126)]&&_0x4e2ea6&&(_0x11fc74['database']=_0x4e2ea6);try{const _0x526f54=_0x430517=>_0x430517&&(_0x430517[_0x5efe05(0x12b)]('*')||_0x430517[_0x5efe05(0x12b)]('?')),_0x2229a3=_0x526f54(_0x11fc74[_0x5efe05(0x126)]);_0x5d6210[_0x5efe05(0x119)]&&(console[_0x5efe05(0x107)]('Site:\x20'+_0x5d6210[_0x5efe05(0x103)]),_0x11fc74[_0x5efe05(0x126)]?_0x2229a3?console[_0x5efe05(0x107)]('Database\x20pattern:\x20'+_0x11fc74[_0x5efe05(0x126)]):console['error'](_0x5efe05(0x112)+_0x11fc74['database']):console[_0x5efe05(0x107)](_0x5efe05(0x108)),_0x11fc74[_0x5efe05(0x106)]&&console[_0x5efe05(0x107)](_0x5efe05(0x12f)+_0x11fc74[_0x5efe05(0x106)]));const _0x1d5871=_0x11fc74[_0x5efe05(0x126)]&&!_0x2229a3?_0x11fc74[_0x5efe05(0x126)]:undefined,_0xb4e708=_0x2229a3?_0x11fc74[_0x5efe05(0x126)]:undefined,_0x2d9f7a=_0x11fc74[_0x5efe05(0x106)],_0x548800=resolveLimit(_0x5d6210[_0x5efe05(0x10b)],DEFAULT_LISTING_LIMIT),_0x42404e=await withSpinner(_0x5efe05(0x10a),()=>_0x1ebc34[_0x5efe05(0x111)][_0x5efe05(0x10d)](_0x1d5871,_0x2d9f7a,_0xb4e708,_0x548800),{'verbose':_0x5d6210[_0x5efe05(0x119)]}),_0x31e01f=_0x42404e[_0x5efe05(0x128)];if(_0x31e01f['length']===0x0&&_0x11fc74[_0x5efe05(0x126)]&&!_0x2229a3)return console[_0x5efe05(0x107)](_0x5efe05(0x109)),console[_0x5efe05(0x107)](_0x5efe05(0x10e)+_0x11fc74[_0x5efe05(0x126)]+_0x5efe05(0x131)),0x1;return console['error'](_0x5efe05(0x125)+_0x31e01f[_0x5efe05(0x11a)]+_0x5efe05(0x104)+(_0x31e01f[_0x5efe05(0x11a)]!==0x1?'s':'')),await handleSDKOutput(_0x31e01f,{..._0x5d6210,'limit':_0x548800}),0x0;}catch(_0x8d8d3e){if(_0x8d8d3e instanceof SDKError)return console[_0x5efe05(0x107)](_0x5efe05(0x115)+_0x8d8d3e[_0x5efe05(0x117)]),_0x8d8d3e[_0x5efe05(0x12e)]&&console[_0x5efe05(0x107)](_0x5efe05(0x135)+_0x8d8d3e[_0x5efe05(0x12e)]),0x1;throw _0x8d8d3e;}}['validate'](_0x99e6df){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x51b6cd=a38_0x47a2;(function(_0x57716b,_0x4097e3){const _0x76f8e3=a38_0x47a2,_0x1b2242=_0x57716b();while(!![]){try{const _0x5cc1fe=parseInt(_0x76f8e3(0x118))/0x1+parseInt(_0x76f8e3(0x123))/0x2*(-parseInt(_0x76f8e3(0x149))/0x3)+parseInt(_0x76f8e3(0x144))/0x4*(-parseInt(_0x76f8e3(0x12b))/0x5)+parseInt(_0x76f8e3(0x139))/0x6*(parseInt(_0x76f8e3(0x134))/0x7)+-parseInt(_0x76f8e3(0x13a))/0x8+-parseInt(_0x76f8e3(0x14a))/0x9*(parseInt(_0x76f8e3(0x117))/0xa)+parseInt(_0x76f8e3(0x142))/0xb;if(_0x5cc1fe===_0x4097e3)break;else _0x1b2242['push'](_0x1b2242['shift']());}catch(_0x2e359b){_0x1b2242['push'](_0x1b2242['shift']());}}}(a38_0x305c,0x8ecc8));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 a38_0x339b25 from'chalk';function a38_0x47a2(_0x5a5596,_0x4ae614){const _0x305c32=a38_0x305c();return a38_0x47a2=function(_0x47a276,_0x2d2dab){_0x47a276=_0x47a276-0x117;let _0x206bfb=_0x305c32[_0x47a276];return _0x206bfb;},a38_0x47a2(_0x5a5596,_0x4ae614);}function a38_0x305c(){const _0x4132f3=['dim','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','2nHtBrC','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20database\x20set\x20to:\x20','validate','cleared','green','5mHQUrs','display','Session\x20profile\x20set\x20to:\x20','clear','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','execute','message','Session\x20llm_project\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','217NuDtvs','use','database','error','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','206580zxlzdV','5162936WoBEAx','Session\x20engage_workspace\x20set\x20to:\x20','includes','displayWithSources','llm_project','Error:\x20Profile\x20\x27','toString','log','8052880YXfwNr','(session:\x20','757608ePqZmd','name','description','parent_segment','\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','3049323vsYJhs','61434xxWnBc','530cROtoi','998482wsRzMM','length','join','Error:\x20','Session\x20context\x20','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','engage_workspace','profile','session'];a38_0x305c=function(){return _0x4132f3;};return a38_0x305c();}export class UseCommand extends BaseCommand{[a38_0x51b6cd(0x145)]=a38_0x51b6cd(0x135);[a38_0x51b6cd(0x146)]='Set\x20session-level\x20context';[a38_0x51b6cd(0x128)](_0x3207ee){const _0x68015e=a38_0x51b6cd,{args:_0x29bc7d}=_0x3207ee;if(_0x29bc7d[_0x68015e(0x119)]===0x0)return undefined;if(_0x29bc7d[_0x68015e(0x119)]===0x1)return _0x68015e(0x124)+_0x68015e(0x148)+_0x68015e(0x125)+_0x68015e(0x11d)+_0x68015e(0x122);const _0x108bda=_0x29bc7d[0x0],_0x2d93b5=[_0x68015e(0x136),_0x68015e(0x147),_0x68015e(0x13e),_0x68015e(0x11f),'engage_workspace'];if(!_0x2d93b5[_0x68015e(0x13c)](_0x108bda))return'Invalid\x20resource:\x20'+_0x108bda+'.\x20Must\x20be\x20one\x20of:\x20'+_0x2d93b5[_0x68015e(0x11a)](',\x20');return undefined;}async[a38_0x51b6cd(0x130)](_0x35d496){const _0x1183a9=a38_0x51b6cd,{args:_0x28194f,options:_0x207d7e}=_0x35d496,_0x5c1eb2=_0x207d7e['debug'],_0x121d9f=_0x207d7e[_0x1183a9(0x12e)];cleanExpiredSessions();try{if(_0x121d9f){clearSessionContext(_0x207d7e[_0x1183a9(0x120)]);const _0x2eeee3=_0x207d7e['session']||getCurrentSessionPID()[_0x1183a9(0x140)]();return console['log'](_0x1183a9(0x11c)+a38_0x339b25[_0x1183a9(0x12a)](_0x1183a9(0x129))+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0x2eeee3+')')),0x0;}if(_0x28194f['length']===0x0){const _0xe8b380=new GlobalContext(_0x207d7e);return _0x5c1eb2?_0xe8b380[_0x1183a9(0x13d)]():_0xe8b380[_0x1183a9(0x12c)](),console[_0x1183a9(0x141)](a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x138))),console[_0x1183a9(0x141)](a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x133))),0x0;}const _0x3dc197=_0x28194f[0x0],_0x299566=_0x28194f[0x1];if(_0x3dc197===_0x1183a9(0x11f)){if(!profileExists(_0x299566))return console[_0x1183a9(0x137)](_0x1183a9(0x13f)+_0x299566+'\x27\x20does\x20not\x20exist'),console[_0x1183a9(0x137)](_0x1183a9(0x12f)),0x1;const _0x1450ad=_0x207d7e[_0x1183a9(0x120)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x299566},_0x207d7e['session']),console[_0x1183a9(0x141)](_0x1183a9(0x12d)+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0x1450ad+')')),console[_0x1183a9(0x141)](a38_0x339b25['dim'](_0x1183a9(0x126))),0x0;}const _0x4acc45={},_0xc3a4ee=_0x207d7e[_0x1183a9(0x120)]||getCurrentSessionPID()[_0x1183a9(0x140)]();switch(_0x3dc197){case _0x1183a9(0x136):_0x4acc45['database']=_0x299566,console[_0x1183a9(0x141)](_0x1183a9(0x127)+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;case _0x1183a9(0x147):_0x4acc45[_0x1183a9(0x147)]=_0x299566,console[_0x1183a9(0x141)]('Session\x20parent_segment\x20set\x20to:\x20'+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;case _0x1183a9(0x13e):_0x4acc45['llm_project']=_0x299566,console[_0x1183a9(0x141)](_0x1183a9(0x132)+a38_0x339b25['green'](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;case _0x1183a9(0x11e):_0x4acc45[_0x1183a9(0x11e)]=_0x299566,console[_0x1183a9(0x141)](_0x1183a9(0x13b)+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;}return saveSessionContext(_0x4acc45,_0x207d7e[_0x1183a9(0x120)]),console[_0x1183a9(0x141)](a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x126))),0x0;}catch(_0x3d88e0){return _0x3d88e0 instanceof Error&&console['error'](_0x1183a9(0x11b)+_0x3d88e0[_0x1183a9(0x131)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a39_0x304c(){const _0x6c7d13=['push','yes','isArray','6325704MQiHvx','10629353cRjgyp','sessionId','✔\x20Deleted\x20project\x20','workflow:workflows','workflow:retry','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20Cause:\x20','cause','verbose','cancelRequested','Getting\x20attempt\x20details...','Project\x20name:\x20','split','5707132fRELBX','Filter:\x20project=','Show\x20logs\x20for\x20a\x20workflow\x20attempt','select','✔\x20Found\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','fs/promises','format','Params:\x20','json','attempt:','Task\x20name:\x20','description','utf-8','stringify','Workflow:\x20','\x20\x20Attempt\x20ID:\x20','Show\x20tasks\x20for\x20an\x20attempt','data','List\x20all\x20workflow\x20projects','✔\x20Workflow\x20run\x20started','taskName','\x20workflow','execute','filesExtracted','workflow:attempt','attempt','session','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflow:download','retryAttemptName','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','run','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','includeSubtasks','createdAt','3556880SXYBaO','workflow:run','Retrying\x20attempt...','✔\x20Pushed\x20','param','status','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20Session\x20ID:\x20','includeRetried','revision','\x22?\x20This\x20cannot\x20be\x20undone.','projects','startsWith','substring','\x20attempt','Status:\x20','getTime','List\x20workflow\x20execution\x20sessions','Start\x20a\x20workflow\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Downloaded\x20','retrySession','\x20\x20Location:\x20','workflow:attempts','Error:\x20Attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','\x20project','Pattern:\x20','finishedAt','\x20\x20Project\x20ID:\x20','Starting\x20workflow\x20run...','Resume\x20from:\x20','\x20\x20Project:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','projectName','round','isDirectory','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','276637wWmkmi','map','Retry\x20a\x20session\x20or\x20attempt','\x20\x20New\x20attempt\x20ID:\x20','workflow:sessions','List\x20workflow\x20attempts','name','running','Reason:\x20','session:','skipValidation','workflow:tasks','fileSize','workflow','delete','canceling','List\x20workflows','\x20\x20Revision:\x20','projectId','readFile','length','project','workflow:delete','Deleting\x20project\x20','Filter:\x20','Include\x20retried:\x20yes','Force:\x20yes','\x20\x20Workflow:\x20','index','Error:\x20Invalid\x20parameter\x20format:\x20','parse','Downloading\x20project\x20','keys','Revision:\x20','Project:\x20','✔\x20Retry\x20started','Pushing\x20workflow\x20project...','Show\x20specific\x20attempt\x20details','Target:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','error','success','reason','attempts','492132OupeQW','sessions','stat','Attempt\x20ID:\x20','Error:\x20Project\x20name\x20is\x20required','from','No\x20log\x20content\x20found','Cancelled','task','\x20task','sessionTime','force','62870AxMGyW','logs','workflow:push','Session\x20time:\x20','Parameters:\x20','Output\x20directory:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Usage:\x20workflow:delete\x20<project-name-or-id>','download','Including\x20subtasks:\x20yes','limit','workflow:kill','tasks','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Validation:\x20skipped','attemptId','params','Fetching\x20log\x20files...','\x20is\x20not\x20a\x20directory','Error:\x20','message','Retrying\x20session...','678hhhWQY'];a39_0x304c=function(){return _0x6c7d13;};return a39_0x304c();}const a39_0x187e55=a39_0x88b5;(function(_0x44a321,_0x234169){const _0x4f81b2=a39_0x88b5,_0x1ab361=_0x44a321();while(!![]){try{const _0x5c23ef=-parseInt(_0x4f81b2(0x127))/0x1+parseInt(_0x4f81b2(0x101))/0x2+parseInt(_0x4f81b2(0x153))/0x3+-parseInt(_0x4f81b2(0xdc))/0x4+parseInt(_0x4f81b2(0x15f))/0x5*(parseInt(_0x4f81b2(0xca))/0x6)+-parseInt(_0x4f81b2(0xcf))/0x7+parseInt(_0x4f81b2(0xce))/0x8;if(_0x5c23ef===_0x234169)break;else _0x1ab361['push'](_0x1ab361['shift']());}catch(_0x15746a){_0x1ab361['push'](_0x1ab361['shift']());}}}(a39_0x304c,0xe3940));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 a39_0x22973d from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x187e55(0x12d)]='workflow:projects';[a39_0x187e55(0xe8)]=a39_0x187e55(0xef);async[a39_0x187e55(0xf3)](_0x16b4e7){const _0x5997db=a39_0x187e55,{options:_0x541da9,args:_0x2f0ece,tdx:_0x97b669}=_0x16b4e7,_0x18fe4d=_0x2f0ece[0x0];try{_0x541da9[_0x5997db(0xd7)]&&_0x18fe4d&&console[_0x5997db(0x14f)](_0x5997db(0x11c)+_0x18fe4d);const _0x1e5dcd=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x97b669[_0x5997db(0x134)][_0x5997db(0x10c)](_0x18fe4d,{'limit':_0x541da9[_0x5997db(0xbe)]}),{'verbose':_0x541da9[_0x5997db(0xd7)]}),_0xef1758=_0x1e5dcd[_0x5997db(0xee)];return console[_0x5997db(0x14f)](_0x5997db(0xe0)+_0xef1758[_0x5997db(0x13b)]+_0x5997db(0x11b)+(_0xef1758['length']!==0x1?'s':'')),await handleSDKOutput(_0xef1758,_0x541da9),0x0;}catch(_0x31f22a){if(_0x31f22a instanceof SDKError)return console[_0x5997db(0x14f)](_0x5997db(0xc7)+_0x31f22a[_0x5997db(0xc8)]),_0x31f22a['cause']&&console[_0x5997db(0x14f)]('\x20\x20Cause:\x20'+_0x31f22a[_0x5997db(0xd6)]),0x1;throw _0x31f22a;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0xd2);['description']=a39_0x187e55(0x137);async[a39_0x187e55(0xf3)](_0x45a254){const _0x47ad09=a39_0x187e55,{options:_0x5851bf,args:_0x22b44b,tdx:_0x39f671}=_0x45a254,_0x14a5a1=_0x22b44b[0x0];try{_0x5851bf[_0x47ad09(0xd7)]&&_0x14a5a1&&console[_0x47ad09(0x14f)]('Project\x20filter:\x20'+_0x14a5a1);const _0x4189fe=await withSpinner('Listing\x20workflows...',()=>_0x39f671[_0x47ad09(0x134)]['workflows'](_0x14a5a1,{'limit':_0x5851bf['limit']}),{'verbose':_0x5851bf[_0x47ad09(0xd7)]}),_0x2fff16=_0x4189fe['data'];return console[_0x47ad09(0x14f)]('✔\x20Found\x20'+_0x2fff16[_0x47ad09(0x13b)]+_0x47ad09(0xf2)+(_0x2fff16[_0x47ad09(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x2fff16,_0x5851bf),0x0;}catch(_0x3ae1bb){if(_0x3ae1bb instanceof SDKError)return console[_0x47ad09(0x14f)](_0x47ad09(0xc7)+_0x3ae1bb[_0x47ad09(0xc8)]),_0x3ae1bb[_0x47ad09(0xd6)]&&console['error'](_0x47ad09(0xd5)+_0x3ae1bb['cause']),0x1;throw _0x3ae1bb;}}}export class WorkflowSessionsCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x12b);['description']=a39_0x187e55(0x112);async['execute'](_0x3f6942){const _0x219ef4=a39_0x187e55,{options:_0x1dfe3d,args:_0x4b2877,tdx:_0x5a2e4d}=_0x3f6942;let _0x4b8823,_0x180ddd;if(_0x4b2877[0x0]){const _0x5fce0b=_0x4b2877[0x0][_0x219ef4(0xdb)]('.');if(_0x5fce0b[_0x219ef4(0x13b)]===0x1)_0x4b8823=_0x5fce0b[0x0];else{if(_0x5fce0b['length']===0x2)[_0x4b8823,_0x180ddd]=_0x5fce0b;else return console[_0x219ef4(0x14f)](_0x219ef4(0xfb)),0x1;}}try{if(_0x1dfe3d[_0x219ef4(0xd7)]){if(_0x4b8823&&_0x180ddd)console[_0x219ef4(0x14f)](_0x219ef4(0x13f)+_0x4b8823+'.'+_0x180ddd);else _0x4b8823&&console[_0x219ef4(0x14f)](_0x219ef4(0xdd)+_0x4b8823);const _0x139318=_0x1dfe3d[_0x219ef4(0x106)];_0x139318&&console['error'](_0x219ef4(0x110)+_0x139318);}const _0x5d4299=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5a2e4d[_0x219ef4(0x134)][_0x219ef4(0x154)]({'projectName':_0x4b8823,'workflowName':_0x180ddd,'status':_0x1dfe3d[_0x219ef4(0x106)],'fromTime':_0x1dfe3d[_0x219ef4(0x158)],'toTime':_0x1dfe3d['to'],'limit':_0x1dfe3d[_0x219ef4(0xbe)]}),{'verbose':_0x1dfe3d[_0x219ef4(0xd7)]}),_0x5b7a7d=_0x5d4299[_0x219ef4(0xee)];return console[_0x219ef4(0x14f)](_0x219ef4(0xe0)+_0x5b7a7d[_0x219ef4(0x13b)]+'\x20session'+(_0x5b7a7d[_0x219ef4(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x5b7a7d,_0x1dfe3d),0x0;}catch(_0x46b58b){if(_0x46b58b instanceof SDKError)return console['error'](_0x219ef4(0xc7)+_0x46b58b['message']),_0x46b58b[_0x219ef4(0xd6)]&&console[_0x219ef4(0x14f)](_0x219ef4(0xd5)+_0x46b58b[_0x219ef4(0xd6)]),0x1;throw _0x46b58b;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x118);[a39_0x187e55(0xe8)]=a39_0x187e55(0x12c);async[a39_0x187e55(0xf3)](_0x474c9f){const _0x36ca5d=a39_0x187e55,{options:_0x1c8779,args:_0x409d6a,tdx:_0x23ef08}=_0x474c9f;let _0x5e4694,_0x598534;if(_0x409d6a[0x0]){const _0x614c64=_0x409d6a[0x0][_0x36ca5d(0xdb)]('.');if(_0x614c64[_0x36ca5d(0x13b)]===0x1)_0x5e4694=_0x614c64[0x0];else{if(_0x614c64[_0x36ca5d(0x13b)]===0x2)[_0x5e4694,_0x598534]=_0x614c64;else return console[_0x36ca5d(0x14f)](_0x36ca5d(0xfb)),0x1;}}try{const _0xab4382=_0x1c8779[_0x36ca5d(0x109)];if(_0x1c8779[_0x36ca5d(0xd7)]){if(_0x5e4694&&_0x598534)console['error']('Filter:\x20'+_0x5e4694+'.'+_0x598534);else _0x5e4694&&console[_0x36ca5d(0x14f)](_0x36ca5d(0xdd)+_0x5e4694);_0xab4382&&console[_0x36ca5d(0x14f)](_0x36ca5d(0x140));}const _0x4cb3cc=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x23ef08[_0x36ca5d(0x134)][_0x36ca5d(0x152)]({'projectName':_0x5e4694,'workflowName':_0x598534,'includeRetried':_0xab4382,'limit':_0x1c8779[_0x36ca5d(0xbe)]}),{'verbose':_0x1c8779[_0x36ca5d(0xd7)]}),_0x1e9bac=_0x4cb3cc[_0x36ca5d(0xee)];return console[_0x36ca5d(0x14f)](_0x36ca5d(0xe0)+_0x1e9bac[_0x36ca5d(0x13b)]+_0x36ca5d(0x10f)+(_0x1e9bac[_0x36ca5d(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x1e9bac,_0x1c8779),0x0;}catch(_0x45e796){if(_0x45e796 instanceof SDKError)return console[_0x36ca5d(0x14f)](_0x36ca5d(0xc7)+_0x45e796[_0x36ca5d(0xc8)]),_0x45e796[_0x36ca5d(0xd6)]&&console[_0x36ca5d(0x14f)](_0x36ca5d(0xd5)+_0x45e796[_0x36ca5d(0xd6)]),0x1;throw _0x45e796;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0xf5);[a39_0x187e55(0xe8)]=a39_0x187e55(0x14c);async[a39_0x187e55(0xf3)](_0x13816d){const _0x64a1f=a39_0x187e55,{options:_0x4a9c0e,args:_0x325bc5,tdx:_0x480181}=_0x13816d,_0x2c24d2=_0x325bc5[0x0];if(!_0x2c24d2)return console['error'](_0x64a1f(0x119)),0x1;try{_0x4a9c0e['verbose']&&console[_0x64a1f(0x14f)](_0x64a1f(0x156)+_0x2c24d2);const _0x499ad4=await withSpinner(_0x64a1f(0xd9),()=>_0x480181[_0x64a1f(0x134)][_0x64a1f(0xf6)](_0x2c24d2),{'verbose':_0x4a9c0e['verbose']}),_0x229655=_0x499ad4[_0x64a1f(0xee)];let _0x4ae785;!_0x229655['done']?_0x4ae785=_0x229655[_0x64a1f(0xd8)]?_0x64a1f(0x136):_0x64a1f(0x12e):_0x4ae785=_0x229655[_0x64a1f(0x150)]?_0x64a1f(0x150):_0x64a1f(0x14f);let _0x3accf5;if(_0x229655[_0x64a1f(0x100)]&&_0x229655[_0x64a1f(0x11d)]){const _0x1b9e53=new Date(_0x229655['createdAt'])[_0x64a1f(0x111)](),_0x5795a2=new Date(_0x229655[_0x64a1f(0x11d)])['getTime']();_0x3accf5=Math[_0x64a1f(0x124)]((_0x5795a2-_0x1b9e53)/0x3e8);}const _0x42565c={'attempt_id':_0x229655['id'],'status':_0x4ae785,..._0x229655[_0x64a1f(0x143)]!==undefined&&{'index':_0x229655[_0x64a1f(0x143)]},..._0x229655[_0x64a1f(0x13c)]&&{'project':_0x229655[_0x64a1f(0x13c)][_0x64a1f(0x12d)]},..._0x229655[_0x64a1f(0x134)]&&{'workflow':_0x229655[_0x64a1f(0x134)]['name']},..._0x229655['sessionId']&&{'session_id':_0x229655[_0x64a1f(0xd0)]},..._0x229655[_0x64a1f(0x15d)]&&{'session_time':_0x229655['sessionTime']},..._0x229655['retryAttemptName']&&{'retry_attempt':_0x229655[_0x64a1f(0xfa)]},..._0x3accf5!==undefined&&{'duration_sec':_0x3accf5},..._0x229655[_0x64a1f(0x100)]&&{'created_at':_0x229655[_0x64a1f(0x100)]},..._0x229655[_0x64a1f(0x11d)]&&{'finished_at':_0x229655[_0x64a1f(0x11d)]},...Object['keys'](_0x229655[_0x64a1f(0xc4)])[_0x64a1f(0x13b)]>0x0&&{'params':_0x229655['params']}};return await handleSingleObjectOutput(_0x42565c,_0x4a9c0e),0x0;}catch(_0x501ec6){if(_0x501ec6 instanceof SDKError)return console['error'](_0x64a1f(0xc7)+_0x501ec6[_0x64a1f(0xc8)]),_0x501ec6[_0x64a1f(0xd6)]&&console[_0x64a1f(0x14f)](_0x64a1f(0xd5)+_0x501ec6[_0x64a1f(0xd6)]),0x1;throw _0x501ec6;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x132);[a39_0x187e55(0xe8)]=a39_0x187e55(0xed);async['execute'](_0x29060c){const _0x3f2507=a39_0x187e55,{options:_0x19e07f,args:_0x513fa4,tdx:_0x343850}=_0x29060c,_0x383bd0=_0x513fa4[0x0];if(!_0x383bd0)return console[_0x3f2507(0x14f)](_0x3f2507(0x119)),0x1;try{const _0x24782e=_0x19e07f[_0x3f2507(0xff)];_0x19e07f[_0x3f2507(0xd7)]&&(console['error'](_0x3f2507(0x156)+_0x383bd0),_0x24782e&&console[_0x3f2507(0x14f)](_0x3f2507(0xbd)));const _0x1f7afc=await withSpinner(_0x3f2507(0x11a),()=>_0x343850[_0x3f2507(0x134)][_0x3f2507(0xc0)](_0x383bd0,_0x24782e||![]),{'verbose':_0x19e07f[_0x3f2507(0xd7)]}),_0x40319d=_0x1f7afc[_0x3f2507(0xee)];return console['error']('✔\x20Found\x20'+_0x40319d[_0x3f2507(0x13b)]+_0x3f2507(0x15c)+(_0x40319d[_0x3f2507(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x40319d,_0x19e07f),0x0;}catch(_0x1a78d7){if(_0x1a78d7 instanceof SDKError)return console[_0x3f2507(0x14f)](_0x3f2507(0xc7)+_0x1a78d7[_0x3f2507(0xc8)]),_0x1a78d7[_0x3f2507(0xd6)]&&console[_0x3f2507(0x14f)]('\x20\x20Cause:\x20'+_0x1a78d7[_0x3f2507(0xd6)]),0x1;throw _0x1a78d7;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x187e55(0x12d)]='workflow:logs';[a39_0x187e55(0xe8)]=a39_0x187e55(0xde);async['execute'](_0x5d2e47){const _0x134b37=a39_0x187e55,{options:_0x4c2439,args:_0x21a864,tdx:_0x317db4}=_0x5d2e47,_0x445394=_0x21a864[0x0];let _0x490470=_0x21a864[0x1];if(!_0x445394)return console[_0x134b37(0x14f)](_0x134b37(0x119)),0x1;try{_0x4c2439[_0x134b37(0xd7)]&&(console[_0x134b37(0x14f)](_0x134b37(0x156)+_0x445394),_0x490470&&console[_0x134b37(0x14f)](_0x134b37(0xe7)+_0x490470));const _0x4b2f75=await withSpinner(_0x134b37(0xc5),()=>_0x317db4[_0x134b37(0x134)][_0x134b37(0xfd)](_0x445394,_0x490470),{'verbose':_0x4c2439[_0x134b37(0xd7)]}),_0x5df1a3=_0x4b2f75[_0x134b37(0xee)];if(_0x5df1a3[_0x134b37(0x13b)]===0x0)return console['error'](_0x134b37(0xd4)),0x0;if(!_0x490470&&(_0x4c2439[_0x134b37(0xe5)]||_0x4c2439[_0x134b37(0xe3)]))return await handleSDKOutput(_0x5df1a3,_0x4c2439),0x0;if(!_0x490470){const _0x19c3a2=_0x5df1a3[_0x134b37(0x128)](_0x3e1150=>({'title':_0x3e1150[_0x134b37(0xf1)]+'\x20('+formatBytes(_0x3e1150[_0x134b37(0x133)])+')','value':_0x3e1150[_0x134b37(0xf1)]})),_0x321064=await a39_0x22973d({'type':_0x134b37(0xdf),'name':'task','message':_0x134b37(0x107),'choices':_0x19c3a2});if(!_0x321064[_0x134b37(0x15b)])return console['error'](_0x134b37(0x15a)),0x0;_0x490470=_0x321064['task'];}const _0x13dd98=await withSpinner('Downloading\x20logs...',()=>_0x317db4[_0x134b37(0x134)][_0x134b37(0x160)](_0x445394,_0x490470),{'verbose':_0x4c2439[_0x134b37(0xd7)]}),_0x599b56=_0x13dd98[_0x134b37(0xee)];return _0x599b56?console['log'](_0x599b56):console[_0x134b37(0x14f)](_0x134b37(0x159)),0x0;}catch(_0x433126){if(_0x433126 instanceof SDKError)return console[_0x134b37(0x14f)]('Error:\x20'+_0x433126[_0x134b37(0xc8)]),_0x433126['cause']&&console[_0x134b37(0x14f)](_0x134b37(0xd5)+_0x433126['cause']),0x1;throw _0x433126;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x187e55(0xbf);[a39_0x187e55(0xe8)]='Kill\x20a\x20running\x20attempt';async[a39_0x187e55(0xf3)](_0x406392){const _0x16ef41=a39_0x187e55,{options:_0x3c5ee5,args:_0x48987c,tdx:_0x151bf7}=_0x406392,_0x1e1513=_0x48987c[0x0];if(!_0x1e1513)return console['error'](_0x16ef41(0x119)),0x1;try{const _0x47a58e=_0x3c5ee5[_0x16ef41(0x151)];_0x3c5ee5[_0x16ef41(0xd7)]&&(console['error']('Attempt\x20ID:\x20'+_0x1e1513),_0x47a58e&&console[_0x16ef41(0x14f)](_0x16ef41(0x12f)+_0x47a58e));if(!_0x3c5ee5['yes']){const _0x392cf4=await confirm(_0x16ef41(0xfe)+_0x1e1513+'?');if(!_0x392cf4)return console['error'](_0x16ef41(0x15a)),0x0;}const _0x3d4d97=await withSpinner('Killing\x20attempt...',()=>_0x151bf7[_0x16ef41(0x134)]['kill'](_0x1e1513,_0x47a58e),{'verbose':_0x3c5ee5['verbose']}),_0x2773b3=_0x3d4d97[_0x16ef41(0xee)];return console[_0x16ef41(0x14f)]('✔\x20'+_0x2773b3),0x0;}catch(_0x3ffff5){if(_0x3ffff5 instanceof SDKError)return console['error'](_0x16ef41(0xc7)+_0x3ffff5['message']),_0x3ffff5[_0x16ef41(0xd6)]&&console['error'](_0x16ef41(0xd5)+_0x3ffff5[_0x16ef41(0xd6)]),0x1;throw _0x3ffff5;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a39_0x187e55(0xd3);['description']=a39_0x187e55(0x129);async[a39_0x187e55(0xf3)](_0x2a464c){const _0x4db2d4=a39_0x187e55,{options:_0x467178,args:_0x2952d8,tdx:_0x27fd96}=_0x2a464c,_0x136367=_0x2952d8[0x0];if(!_0x136367)return console[_0x4db2d4(0x14f)](_0x4db2d4(0x14e)),console[_0x4db2d4(0x14f)](_0x4db2d4(0xe1)),0x1;let _0x466146=![],_0x1c6d25=_0x136367;if(_0x136367[_0x4db2d4(0x10d)](_0x4db2d4(0x130)))_0x466146=!![],_0x1c6d25=_0x136367[_0x4db2d4(0x10e)](0x8);else{if(_0x136367[_0x4db2d4(0x10d)](_0x4db2d4(0xe6)))_0x466146=![],_0x1c6d25=_0x136367[_0x4db2d4(0x10e)](0x8);else return console['error'](_0x4db2d4(0x122)),console[_0x4db2d4(0x14f)](_0x4db2d4(0xe1)),0x1;}try{const _0x52f276=_0x467178['fromTask'],_0x34d998=_0x467178['resumeFrom'],_0x4cd686=_0x467178[_0x4db2d4(0xc4)],_0x2b6995=_0x467178[_0x4db2d4(0x15e)];_0x467178['verbose']&&(console[_0x4db2d4(0x14f)](_0x4db2d4(0x14d)+(_0x466146?_0x4db2d4(0xf7):_0x4db2d4(0xf6))+'\x20'+_0x1c6d25),_0x52f276&&console[_0x4db2d4(0x14f)]('From\x20task:\x20'+_0x52f276),_0x34d998&&console[_0x4db2d4(0x14f)](_0x4db2d4(0x120)+_0x34d998),_0x4cd686&&console[_0x4db2d4(0x14f)](_0x4db2d4(0xe4)+_0x4cd686),_0x2b6995&&console[_0x4db2d4(0x14f)](_0x4db2d4(0x141)));let _0x3b45a2;if(_0x4cd686)try{if(_0x4cd686[_0x4db2d4(0x10d)]('@')){const _0x23e4bc=await import(_0x4db2d4(0xe2)),_0x2d6bff=_0x4cd686['substring'](0x1),_0x46927a=await _0x23e4bc[_0x4db2d4(0x13a)](_0x2d6bff,_0x4db2d4(0xe9));_0x3b45a2=JSON['parse'](_0x46927a);}else _0x3b45a2=JSON['parse'](_0x4cd686);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x467178[_0x4db2d4(0xcc)]){const _0x59e01f=await confirm(_0x4db2d4(0x114)+(_0x466146?_0x4db2d4(0xf7):'attempt')+'\x20'+_0x1c6d25+'?');if(!_0x59e01f)return console[_0x4db2d4(0x14f)](_0x4db2d4(0x15a)),0x0;}let _0x7a214c;_0x466146?_0x7a214c=await withSpinner(_0x4db2d4(0xc9),()=>_0x27fd96['workflow'][_0x4db2d4(0x116)](_0x1c6d25,{'fromTask':_0x52f276,'retryParams':_0x3b45a2}),{'verbose':_0x467178[_0x4db2d4(0xd7)]}):_0x7a214c=await withSpinner(_0x4db2d4(0x103),()=>_0x27fd96['workflow']['retryAttempt'](_0x1c6d25,{'resumeFrom':_0x34d998,'retryParams':_0x3b45a2,'force':_0x2b6995}),{'verbose':_0x467178[_0x4db2d4(0xd7)]});const _0x3b2a84=_0x7a214c[_0x4db2d4(0xee)];return console[_0x4db2d4(0x14f)](_0x4db2d4(0x14a)),console[_0x4db2d4(0x14f)](_0x4db2d4(0x12a)+_0x3b2a84[_0x4db2d4(0xc3)]),console[_0x4db2d4(0x14f)](_0x4db2d4(0x108)+_0x3b2a84[_0x4db2d4(0xd0)]),0x0;}catch(_0x54b5f2){if(_0x54b5f2 instanceof SDKError)return console[_0x4db2d4(0x14f)]('Error:\x20'+_0x54b5f2[_0x4db2d4(0xc8)]),_0x54b5f2[_0x4db2d4(0xd6)]&&console['error'](_0x4db2d4(0xd5)+_0x54b5f2[_0x4db2d4(0xd6)]),0x1;throw _0x54b5f2;}}}export class WorkflowRunCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x102);['description']=a39_0x187e55(0x113);async[a39_0x187e55(0xf3)](_0x3fb345){const _0x4f488d=a39_0x187e55,{options:_0x28c96d,args:_0x160bb3,tdx:_0xa03f42}=_0x3fb345,_0x1fd2e1=_0x160bb3[0x0];if(!_0x1fd2e1)return console[_0x4f488d(0x14f)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x4f488d(0x14f)](_0x4f488d(0xc1)),0x1;const _0x5b9d11=_0x28c96d[_0x4f488d(0x105)],_0x507d51=_0x28c96d[_0x4f488d(0x15d)],_0xa0ef8e={};if(_0x5b9d11&&Array[_0x4f488d(0xcd)](_0x5b9d11))for(const _0x434480 of _0x5b9d11){const _0x3ea520=_0x434480['indexOf']('=');if(_0x3ea520===-0x1)return console[_0x4f488d(0x14f)](_0x4f488d(0x144)+_0x434480),console[_0x4f488d(0x14f)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1ddebe=_0x434480['substring'](0x0,_0x3ea520),_0x46d894=_0x434480[_0x4f488d(0x10e)](_0x3ea520+0x1);try{_0xa0ef8e[_0x1ddebe]=JSON[_0x4f488d(0x145)](_0x46d894);}catch{_0xa0ef8e[_0x1ddebe]=_0x46d894;}}_0x28c96d[_0x4f488d(0xd7)]&&(console['error'](_0x4f488d(0xeb)+_0x1fd2e1),Object[_0x4f488d(0x147)](_0xa0ef8e)[_0x4f488d(0x13b)]>0x0&&console[_0x4f488d(0x14f)](_0x4f488d(0xb8)+JSON[_0x4f488d(0xea)](_0xa0ef8e)),_0x507d51&&console[_0x4f488d(0x14f)](_0x4f488d(0xb7)+_0x507d51));const _0x2fb095=await withSpinner(_0x4f488d(0x11f),()=>_0xa03f42[_0x4f488d(0x134)][_0x4f488d(0xfc)](_0x1fd2e1,_0xa0ef8e,{'sessionTime':_0x507d51}),{'verbose':_0x28c96d[_0x4f488d(0xd7)]}),_0x59cf2c=_0x2fb095['data'];return console[_0x4f488d(0x14f)](_0x4f488d(0xf0)),console[_0x4f488d(0x14f)](_0x4f488d(0xec)+_0x59cf2c['id']),console[_0x4f488d(0x14f)]('\x20\x20Session\x20ID:\x20'+_0x59cf2c[_0x4f488d(0xd0)]),console[_0x4f488d(0x14f)](_0x4f488d(0x121)+_0x59cf2c[_0x4f488d(0x13c)]?.['name']),console[_0x4f488d(0x14f)](_0x4f488d(0x142)+_0x59cf2c[_0x4f488d(0x134)]?.[_0x4f488d(0x12d)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a39_0x187e55(0xf9);[a39_0x187e55(0xe8)]=a39_0x187e55(0xba);async[a39_0x187e55(0xf3)](_0x2acac8){const _0x14e607=a39_0x187e55,{options:_0x3b534f,args:_0x38a01d,tdx:_0x37f602}=_0x2acac8,_0xe5e907=_0x38a01d[0x0],_0x8222e6=_0x38a01d[0x1]||'.';if(!_0xe5e907)return console[_0x14e607(0x14f)](_0x14e607(0x157)),console[_0x14e607(0x14f)](_0x14e607(0x126)),0x1;const _0x4a30f5=_0x3b534f[_0x14e607(0x10a)];_0x3b534f[_0x14e607(0xd7)]&&(console['error'](_0x14e607(0x149)+_0xe5e907),console[_0x14e607(0x14f)](_0x14e607(0xb9)+_0x8222e6),_0x4a30f5&&console[_0x14e607(0x14f)]('Revision:\x20'+_0x4a30f5));const _0x3b0223=await withSpinner(_0x14e607(0x146)+_0xe5e907+'...',()=>_0x37f602[_0x14e607(0x134)][_0x14e607(0xbc)](_0xe5e907,_0x8222e6,{'revision':_0x4a30f5}),{'verbose':_0x3b534f[_0x14e607(0xd7)]}),_0x3e298e=_0x3b0223[_0x14e607(0xee)];return console[_0x14e607(0x14f)](_0x14e607(0x115)+_0x3e298e[_0x14e607(0x123)]),console[_0x14e607(0x14f)](_0x14e607(0x138)+_0x3e298e['revision']),console[_0x14e607(0x14f)]('\x20\x20Files\x20extracted:\x20'+_0x3e298e[_0x14e607(0xf4)]),console[_0x14e607(0x14f)](_0x14e607(0x117)+_0x8222e6+'/'+_0x3e298e[_0x14e607(0x123)]),0x0;}}function a39_0x88b5(_0x39b9e5,_0x30009f){const _0x304c38=a39_0x304c();return a39_0x88b5=function(_0x88b50e,_0x175186){_0x88b50e=_0x88b50e-0xb6;let _0xdfe212=_0x304c38[_0x88b50e];return _0xdfe212;},a39_0x88b5(_0x39b9e5,_0x30009f);}export class WorkflowPushCommand extends BaseCommand{['name']=a39_0x187e55(0xb6);[a39_0x187e55(0xe8)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async['execute'](_0x42bdb3){const _0x2f2dcf=a39_0x187e55,{options:_0x2803fe,args:_0x5806eb,tdx:_0x48347b}=_0x42bdb3;let _0x376f20='.',_0xb3256c=_0x2803fe[_0x2f2dcf(0x12d)];if(_0x5806eb[0x0]){const {promises:_0x135f01}=await import('fs');try{const _0x3d702e=await _0x135f01[_0x2f2dcf(0x155)](_0x5806eb[0x0]);if(_0x3d702e[_0x2f2dcf(0x125)]())_0x376f20=_0x5806eb[0x0];else return console[_0x2f2dcf(0x14f)](_0x2f2dcf(0xc7)+_0x5806eb[0x0]+_0x2f2dcf(0xc6)),0x1;}catch{_0xb3256c=_0x5806eb[0x0],_0x376f20='.';}}const _0x255e42=_0x2803fe[_0x2f2dcf(0x10a)],_0xde8c=_0x2803fe[_0x2f2dcf(0x131)];_0x2803fe[_0x2f2dcf(0xd7)]&&(console[_0x2f2dcf(0x14f)]('Project\x20directory:\x20'+_0x376f20),_0xb3256c&&console[_0x2f2dcf(0x14f)](_0x2f2dcf(0xda)+_0xb3256c),_0x255e42&&console[_0x2f2dcf(0x14f)](_0x2f2dcf(0x148)+_0x255e42),_0xde8c&&console['error'](_0x2f2dcf(0xc2)));const _0x54b48d=await withSpinner(_0x2f2dcf(0x14b),()=>_0x48347b[_0x2f2dcf(0x134)][_0x2f2dcf(0xcb)](_0x376f20,{'projectName':_0xb3256c,'revision':_0x255e42,'skipValidation':_0xde8c}),{'verbose':_0x2803fe[_0x2f2dcf(0xd7)]}),_0x140c7f=_0x54b48d[_0x2f2dcf(0xee)];return console['error'](_0x2f2dcf(0x104)+_0x140c7f[_0x2f2dcf(0x123)]),console[_0x2f2dcf(0x14f)](_0x2f2dcf(0x11e)+_0x140c7f[_0x2f2dcf(0x139)]),console[_0x2f2dcf(0x14f)](_0x2f2dcf(0x138)+_0x140c7f['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x13d);[a39_0x187e55(0xe8)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x187e55(0xf3)](_0x4979e4){const _0x18b525=a39_0x187e55,{options:_0x32eaba,args:_0x4d65bb,tdx:_0x4c70bd}=_0x4979e4,_0x47cf40=_0x4d65bb[0x0];if(!_0x47cf40)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x18b525(0xbb)),0x1;_0x32eaba[_0x18b525(0xd7)]&&console['error'](_0x18b525(0x149)+_0x47cf40);if(!_0x32eaba[_0x18b525(0xcc)]){const _0x713b56=await confirm(_0x18b525(0xf8)+_0x47cf40+_0x18b525(0x10b));if(!_0x713b56)return console['error'](_0x18b525(0x15a)),0x0;}const _0x3e1698=await withSpinner(_0x18b525(0x13e)+_0x47cf40+'...',()=>_0x4c70bd[_0x18b525(0x134)][_0x18b525(0x135)](_0x47cf40),{'verbose':_0x32eaba[_0x18b525(0xd7)]}),_0x26853d=_0x3e1698[_0x18b525(0xee)];return console['error'](_0x18b525(0xd1)+_0x26853d['projectName']),console[_0x18b525(0x14f)]('\x20\x20Project\x20ID:\x20'+_0x26853d[_0x18b525(0x139)]),0x0;}}
|
|
1
|
+
const a39_0x4e4c1b=a39_0x5e09;(function(_0x2b66e2,_0x4b0832){const _0x2897e6=a39_0x5e09,_0x2d4fce=_0x2b66e2();while(!![]){try{const _0x5ca42d=parseInt(_0x2897e6(0xee))/0x1*(parseInt(_0x2897e6(0xc7))/0x2)+parseInt(_0x2897e6(0xe7))/0x3+-parseInt(_0x2897e6(0x100))/0x4+-parseInt(_0x2897e6(0xbe))/0x5*(-parseInt(_0x2897e6(0x124))/0x6)+parseInt(_0x2897e6(0x119))/0x7+-parseInt(_0x2897e6(0xbd))/0x8+parseInt(_0x2897e6(0x116))/0x9;if(_0x5ca42d===_0x4b0832)break;else _0x2d4fce['push'](_0x2d4fce['shift']());}catch(_0x30b4cc){_0x2d4fce['push'](_0x2d4fce['shift']());}}}(a39_0x5dd6,0x892ba));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 a39_0x34e1af from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0x10f);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x12d);async['execute'](_0x4265f7){const _0x30590c=a39_0x4e4c1b,{options:_0x4bda16,args:_0x143001,tdx:_0x43b51c}=_0x4265f7,_0x42c87b=_0x143001[0x0];try{_0x4bda16[_0x30590c(0xcc)]&&_0x42c87b&&console[_0x30590c(0x110)]('Pattern:\x20'+_0x42c87b);const _0x463eee=await withSpinner(_0x30590c(0x122),()=>_0x43b51c[_0x30590c(0x103)][_0x30590c(0xe3)](_0x42c87b,{'limit':_0x4bda16['limit']}),{'verbose':_0x4bda16[_0x30590c(0xcc)]}),_0x1c03c0=_0x463eee[_0x30590c(0x109)];return console[_0x30590c(0x110)](_0x30590c(0xb3)+_0x1c03c0['length']+_0x30590c(0x149)+(_0x1c03c0[_0x30590c(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x1c03c0,_0x4bda16),0x0;}catch(_0x48eaea){if(_0x48eaea instanceof SDKError)return console[_0x30590c(0x110)](_0x30590c(0x118)+_0x48eaea[_0x30590c(0x11f)]),_0x48eaea[_0x30590c(0x102)]&&console[_0x30590c(0x110)](_0x30590c(0xc3)+_0x48eaea[_0x30590c(0x102)]),0x1;throw _0x48eaea;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xf2);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0xfb);async[a39_0x4e4c1b(0xe6)](_0x59c7e6){const _0x218c0f=a39_0x4e4c1b,{options:_0x10bc76,args:_0x2d4f29,tdx:_0x2331ba}=_0x59c7e6,_0x12683f=_0x2d4f29[0x0];try{_0x10bc76[_0x218c0f(0xcc)]&&_0x12683f&&console[_0x218c0f(0x110)](_0x218c0f(0xd6)+_0x12683f);const _0x20ba1=await withSpinner('Listing\x20workflows...',()=>_0x2331ba[_0x218c0f(0x103)][_0x218c0f(0xae)](_0x12683f,{'limit':_0x10bc76[_0x218c0f(0x12b)]}),{'verbose':_0x10bc76[_0x218c0f(0xcc)]}),_0x550718=_0x20ba1[_0x218c0f(0x109)];return console[_0x218c0f(0x110)](_0x218c0f(0xb3)+_0x550718[_0x218c0f(0x10b)]+_0x218c0f(0xb5)+(_0x550718[_0x218c0f(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x550718,_0x10bc76),0x0;}catch(_0x167703){if(_0x167703 instanceof SDKError)return console[_0x218c0f(0x110)](_0x218c0f(0x118)+_0x167703[_0x218c0f(0x11f)]),_0x167703[_0x218c0f(0x102)]&&console[_0x218c0f(0x110)](_0x218c0f(0xc3)+_0x167703[_0x218c0f(0x102)]),0x1;throw _0x167703;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x143);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x13a);async[a39_0x4e4c1b(0xe6)](_0x2279ed){const _0x2228d9=a39_0x4e4c1b,{options:_0x186f10,args:_0x1b3763,tdx:_0xfff9b5}=_0x2279ed;let _0x289230,_0x295577;if(_0x1b3763[0x0]){const _0x26412c=_0x1b3763[0x0][_0x2228d9(0x108)]('.');if(_0x26412c['length']===0x1)_0x289230=_0x26412c[0x0];else{if(_0x26412c[_0x2228d9(0x10b)]===0x2)[_0x289230,_0x295577]=_0x26412c;else return console[_0x2228d9(0x110)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x186f10[_0x2228d9(0xcc)]){if(_0x289230&&_0x295577)console[_0x2228d9(0x110)](_0x2228d9(0xe1)+_0x289230+'.'+_0x295577);else _0x289230&&console[_0x2228d9(0x110)](_0x2228d9(0xc6)+_0x289230);const _0x36ad6e=_0x186f10[_0x2228d9(0xff)];_0x36ad6e&&console[_0x2228d9(0x110)]('Status:\x20'+_0x36ad6e);}const _0x8858e7=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0xfff9b5[_0x2228d9(0x103)][_0x2228d9(0x13e)]({'projectName':_0x289230,'workflowName':_0x295577,'status':_0x186f10['status'],'fromTime':_0x186f10[_0x2228d9(0x135)],'toTime':_0x186f10['to'],'limit':_0x186f10[_0x2228d9(0x12b)]}),{'verbose':_0x186f10[_0x2228d9(0xcc)]}),_0x306190=_0x8858e7['data'];return console['error'](_0x2228d9(0xb3)+_0x306190[_0x2228d9(0x10b)]+'\x20session'+(_0x306190[_0x2228d9(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x306190,_0x186f10),0x0;}catch(_0x56616d){if(_0x56616d instanceof SDKError)return console[_0x2228d9(0x110)](_0x2228d9(0x118)+_0x56616d[_0x2228d9(0x11f)]),_0x56616d[_0x2228d9(0x102)]&&console['error']('\x20\x20Cause:\x20'+_0x56616d[_0x2228d9(0x102)]),0x1;throw _0x56616d;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x147);[a39_0x4e4c1b(0xb0)]='List\x20workflow\x20attempts';async[a39_0x4e4c1b(0xe6)](_0x590086){const _0x4d7f2f=a39_0x4e4c1b,{options:_0x43b478,args:_0x19e5d6,tdx:_0x26dc7f}=_0x590086;let _0xb6af3e,_0x5e694e;if(_0x19e5d6[0x0]){const _0x4f221d=_0x19e5d6[0x0][_0x4d7f2f(0x108)]('.');if(_0x4f221d['length']===0x1)_0xb6af3e=_0x4f221d[0x0];else{if(_0x4f221d[_0x4d7f2f(0x10b)]===0x2)[_0xb6af3e,_0x5e694e]=_0x4f221d;else return console[_0x4d7f2f(0x110)](_0x4d7f2f(0x132)),0x1;}}try{const _0x45b590=_0x43b478[_0x4d7f2f(0x133)];if(_0x43b478[_0x4d7f2f(0xcc)]){if(_0xb6af3e&&_0x5e694e)console['error'](_0x4d7f2f(0xe1)+_0xb6af3e+'.'+_0x5e694e);else _0xb6af3e&&console[_0x4d7f2f(0x110)](_0x4d7f2f(0xc6)+_0xb6af3e);_0x45b590&&console['error'](_0x4d7f2f(0x12e));}const _0x1bf344=await withSpinner(_0x4d7f2f(0xb2),()=>_0x26dc7f['workflow'][_0x4d7f2f(0x107)]({'projectName':_0xb6af3e,'workflowName':_0x5e694e,'includeRetried':_0x45b590,'limit':_0x43b478[_0x4d7f2f(0x12b)]}),{'verbose':_0x43b478[_0x4d7f2f(0xcc)]}),_0x25c99e=_0x1bf344[_0x4d7f2f(0x109)];return console['error'](_0x4d7f2f(0xb3)+_0x25c99e['length']+_0x4d7f2f(0xab)+(_0x25c99e[_0x4d7f2f(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x25c99e,_0x43b478),0x0;}catch(_0x50d800){if(_0x50d800 instanceof SDKError)return console[_0x4d7f2f(0x110)]('Error:\x20'+_0x50d800[_0x4d7f2f(0x11f)]),_0x50d800['cause']&&console[_0x4d7f2f(0x110)](_0x4d7f2f(0xc3)+_0x50d800[_0x4d7f2f(0x102)]),0x1;throw _0x50d800;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xeb);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0xbf);async[a39_0x4e4c1b(0xe6)](_0x1afaf4){const _0x6b57d7=a39_0x4e4c1b,{options:_0x19043f,args:_0x36c1ad,tdx:_0x27132c}=_0x1afaf4,_0x2c288f=_0x36c1ad[0x0];if(!_0x2c288f)return console[_0x6b57d7(0x110)](_0x6b57d7(0xd2)),0x1;try{_0x19043f['verbose']&&console[_0x6b57d7(0x110)](_0x6b57d7(0xad)+_0x2c288f);const _0x3571b6=await withSpinner('Getting\x20attempt\x20details...',()=>_0x27132c[_0x6b57d7(0x103)][_0x6b57d7(0x10a)](_0x2c288f),{'verbose':_0x19043f['verbose']}),_0x40c9ec=_0x3571b6[_0x6b57d7(0x109)];let _0x55b5bd;!_0x40c9ec[_0x6b57d7(0x125)]?_0x55b5bd=_0x40c9ec['cancelRequested']?_0x6b57d7(0xba):'running':_0x55b5bd=_0x40c9ec[_0x6b57d7(0x13f)]?'success':_0x6b57d7(0x110);let _0x565ab9;if(_0x40c9ec[_0x6b57d7(0xf0)]&&_0x40c9ec[_0x6b57d7(0xc4)]){const _0x1ae6f9=new Date(_0x40c9ec[_0x6b57d7(0xf0)])[_0x6b57d7(0x128)](),_0x500497=new Date(_0x40c9ec[_0x6b57d7(0xc4)])['getTime']();_0x565ab9=Math[_0x6b57d7(0x146)]((_0x500497-_0x1ae6f9)/0x3e8);}const _0x13ba41={'attempt_id':_0x40c9ec['id'],'status':_0x55b5bd,..._0x40c9ec[_0x6b57d7(0x127)]!==undefined&&{'index':_0x40c9ec[_0x6b57d7(0x127)]},..._0x40c9ec[_0x6b57d7(0xdc)]&&{'project':_0x40c9ec[_0x6b57d7(0xdc)][_0x6b57d7(0xd5)]},..._0x40c9ec[_0x6b57d7(0x103)]&&{'workflow':_0x40c9ec[_0x6b57d7(0x103)]['name']},..._0x40c9ec[_0x6b57d7(0xf1)]&&{'session_id':_0x40c9ec[_0x6b57d7(0xf1)]},..._0x40c9ec['sessionTime']&&{'session_time':_0x40c9ec['sessionTime']},..._0x40c9ec[_0x6b57d7(0x141)]&&{'retry_attempt':_0x40c9ec[_0x6b57d7(0x141)]},..._0x565ab9!==undefined&&{'duration_sec':_0x565ab9},..._0x40c9ec[_0x6b57d7(0xf0)]&&{'created_at':_0x40c9ec[_0x6b57d7(0xf0)]},..._0x40c9ec[_0x6b57d7(0xc4)]&&{'finished_at':_0x40c9ec[_0x6b57d7(0xc4)]},...Object[_0x6b57d7(0xe0)](_0x40c9ec['params'])[_0x6b57d7(0x10b)]>0x0&&{'params':_0x40c9ec[_0x6b57d7(0x11e)]}};return await handleSingleObjectOutput(_0x13ba41,_0x19043f),0x0;}catch(_0x30c515){if(_0x30c515 instanceof SDKError)return console[_0x6b57d7(0x110)](_0x6b57d7(0x118)+_0x30c515[_0x6b57d7(0x11f)]),_0x30c515[_0x6b57d7(0x102)]&&console[_0x6b57d7(0x110)](_0x6b57d7(0xc3)+_0x30c515['cause']),0x1;throw _0x30c515;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xcd);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x152);async[a39_0x4e4c1b(0xe6)](_0x4f3ac6){const _0x462f86=a39_0x4e4c1b,{options:_0x395c14,args:_0x11db3a,tdx:_0x1e5f7e}=_0x4f3ac6,_0x229daf=_0x11db3a[0x0];if(!_0x229daf)return console[_0x462f86(0x110)](_0x462f86(0xd2)),0x1;try{const _0x31ba70=_0x395c14[_0x462f86(0x12c)];_0x395c14[_0x462f86(0xcc)]&&(console['error'](_0x462f86(0xad)+_0x229daf),_0x31ba70&&console['error'](_0x462f86(0x137)));const _0xae374c=await withSpinner(_0x462f86(0xc2),()=>_0x1e5f7e['workflow'][_0x462f86(0xd8)](_0x229daf,_0x31ba70||![]),{'verbose':_0x395c14[_0x462f86(0xcc)]}),_0x16a5eb=_0xae374c[_0x462f86(0x109)];return console[_0x462f86(0x110)](_0x462f86(0xb3)+_0x16a5eb['length']+_0x462f86(0x13b)+(_0x16a5eb['length']!==0x1?'s':'')),await handleSDKOutput(_0x16a5eb,_0x395c14),0x0;}catch(_0x4cb708){if(_0x4cb708 instanceof SDKError)return console[_0x462f86(0x110)](_0x462f86(0x118)+_0x4cb708[_0x462f86(0x11f)]),_0x4cb708[_0x462f86(0x102)]&&console[_0x462f86(0x110)](_0x462f86(0xc3)+_0x4cb708[_0x462f86(0x102)]),0x1;throw _0x4cb708;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xd9);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x140);async[a39_0x4e4c1b(0xe6)](_0x1b5e60){const _0x466bc3=a39_0x4e4c1b,{options:_0x324539,args:_0x2baf15,tdx:_0x541b73}=_0x1b5e60,_0x145e04=_0x2baf15[0x0];let _0x1f1802=_0x2baf15[0x1];if(!_0x145e04)return console[_0x466bc3(0x110)](_0x466bc3(0xd2)),0x1;try{_0x324539[_0x466bc3(0xcc)]&&(console['error']('Attempt\x20ID:\x20'+_0x145e04),_0x1f1802&&console['error'](_0x466bc3(0x12f)+_0x1f1802));const _0x27eca8=await withSpinner(_0x466bc3(0x14d),()=>_0x541b73[_0x466bc3(0x103)][_0x466bc3(0xd3)](_0x145e04,_0x1f1802),{'verbose':_0x324539[_0x466bc3(0xcc)]}),_0x17af9c=_0x27eca8['data'];if(_0x17af9c[_0x466bc3(0x10b)]===0x0)return console[_0x466bc3(0x110)](_0x466bc3(0xc1)),0x0;if(!_0x1f1802&&(_0x324539[_0x466bc3(0xcb)]||_0x324539[_0x466bc3(0xdf)]))return await handleSDKOutput(_0x17af9c,_0x324539),0x0;if(!_0x1f1802){const _0x382e77=_0x17af9c['map'](_0x11b21d=>({'title':_0x11b21d[_0x466bc3(0xb9)]+'\x20('+formatBytes(_0x11b21d['fileSize'])+')','value':_0x11b21d['taskName']})),_0x1f1c16=await a39_0x34e1af({'type':'select','name':_0x466bc3(0xde),'message':_0x466bc3(0xb1),'choices':_0x382e77});if(!_0x1f1c16[_0x466bc3(0xde)])return console[_0x466bc3(0x110)](_0x466bc3(0xb6)),0x0;_0x1f1802=_0x1f1c16[_0x466bc3(0xde)];}const _0x374118=await withSpinner(_0x466bc3(0x129),()=>_0x541b73['workflow']['logs'](_0x145e04,_0x1f1802),{'verbose':_0x324539[_0x466bc3(0xcc)]}),_0x1d09a1=_0x374118[_0x466bc3(0x109)];return _0x1d09a1?console[_0x466bc3(0x14e)](_0x1d09a1):console[_0x466bc3(0x110)](_0x466bc3(0x144)),0x0;}catch(_0x36f0c1){if(_0x36f0c1 instanceof SDKError)return console[_0x466bc3(0x110)](_0x466bc3(0x118)+_0x36f0c1['message']),_0x36f0c1[_0x466bc3(0x102)]&&console[_0x466bc3(0x110)]('\x20\x20Cause:\x20'+_0x36f0c1[_0x466bc3(0x102)]),0x1;throw _0x36f0c1;}}}function a39_0x5e09(_0x36fcc6,_0x4ac9a1){const _0x5dd61c=a39_0x5dd6();return a39_0x5e09=function(_0x5e0985,_0xd3e7c){_0x5e0985=_0x5e0985-0xa9;let _0x2e7616=_0x5dd61c[_0x5e0985];return _0x2e7616;},a39_0x5e09(_0x36fcc6,_0x4ac9a1);}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x142);['description']=a39_0x4e4c1b(0xc5);async[a39_0x4e4c1b(0xe6)](_0x4eb38e){const _0xc77a65=a39_0x4e4c1b,{options:_0x324fd5,args:_0x3a8993,tdx:_0x4dc401}=_0x4eb38e,_0x4586a2=_0x3a8993[0x0];if(!_0x4586a2)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x94166c=_0x324fd5[_0xc77a65(0xa9)];_0x324fd5[_0xc77a65(0xcc)]&&(console[_0xc77a65(0x110)]('Attempt\x20ID:\x20'+_0x4586a2),_0x94166c&&console[_0xc77a65(0x110)](_0xc77a65(0x145)+_0x94166c));if(!_0x324fd5['yes']){const _0x2e533c=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4586a2+'?');if(!_0x2e533c)return console[_0xc77a65(0x110)](_0xc77a65(0xb6)),0x0;}const _0x4cbca7=await withSpinner(_0xc77a65(0xb4),()=>_0x4dc401[_0xc77a65(0x103)][_0xc77a65(0x14b)](_0x4586a2,_0x94166c),{'verbose':_0x324fd5['verbose']}),_0x2986f9=_0x4cbca7['data'];return console[_0xc77a65(0x110)]('✔\x20'+_0x2986f9),0x0;}catch(_0x20dd87){if(_0x20dd87 instanceof SDKError)return console['error'](_0xc77a65(0x118)+_0x20dd87[_0xc77a65(0x11f)]),_0x20dd87[_0xc77a65(0x102)]&&console[_0xc77a65(0x110)]('\x20\x20Cause:\x20'+_0x20dd87[_0xc77a65(0x102)]),0x1;throw _0x20dd87;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]='workflow:retry';[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x11c);async[a39_0x4e4c1b(0xe6)](_0x2360c0){const _0x274594=a39_0x4e4c1b,{options:_0x231983,args:_0x3a45f9,tdx:_0x27e98f}=_0x2360c0,_0x356a68=_0x3a45f9[0x0];if(!_0x356a68)return console[_0x274594(0x110)](_0x274594(0x111)),console[_0x274594(0x110)](_0x274594(0x123)),0x1;let _0x13595e=![],_0x3eb9c6=_0x356a68;if(_0x356a68[_0x274594(0x120)]('session:'))_0x13595e=!![],_0x3eb9c6=_0x356a68[_0x274594(0x136)](0x8);else{if(_0x356a68[_0x274594(0x120)](_0x274594(0xac)))_0x13595e=![],_0x3eb9c6=_0x356a68['substring'](0x8);else return console[_0x274594(0x110)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x274594(0x110)](_0x274594(0x123)),0x1;}try{const _0x5a44b8=_0x231983[_0x274594(0x126)],_0x5acf5a=_0x231983[_0x274594(0xea)],_0x2e3e7a=_0x231983[_0x274594(0x11e)],_0x242d27=_0x231983[_0x274594(0xaf)];_0x231983[_0x274594(0xcc)]&&(console[_0x274594(0x110)](_0x274594(0x14f)+(_0x13595e?_0x274594(0x153):_0x274594(0x10a))+'\x20'+_0x3eb9c6),_0x5a44b8&&console[_0x274594(0x110)](_0x274594(0xf7)+_0x5a44b8),_0x5acf5a&&console['error'](_0x274594(0xb7)+_0x5acf5a),_0x2e3e7a&&console['error'](_0x274594(0xbc)+_0x2e3e7a),_0x242d27&&console[_0x274594(0x110)](_0x274594(0xf8)));let _0x4ff72d;if(_0x2e3e7a)try{if(_0x2e3e7a[_0x274594(0x120)]('@')){const _0x22e8f2=await import(_0x274594(0x139)),_0x504dee=_0x2e3e7a[_0x274594(0x136)](0x1),_0x2ed75c=await _0x22e8f2[_0x274594(0x130)](_0x504dee,_0x274594(0xd7));_0x4ff72d=JSON[_0x274594(0xc8)](_0x2ed75c);}else _0x4ff72d=JSON[_0x274594(0xc8)](_0x2e3e7a);}catch{return console[_0x274594(0x110)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x231983[_0x274594(0xcf)]){const _0x208ea9=await confirm(_0x274594(0xce)+(_0x13595e?_0x274594(0x153):_0x274594(0x10a))+'\x20'+_0x3eb9c6+'?');if(!_0x208ea9)return console[_0x274594(0x110)](_0x274594(0xb6)),0x0;}let _0x3e1780;_0x13595e?_0x3e1780=await withSpinner(_0x274594(0x13d),()=>_0x27e98f['workflow'][_0x274594(0x104)](_0x3eb9c6,{'fromTask':_0x5a44b8,'retryParams':_0x4ff72d}),{'verbose':_0x231983[_0x274594(0xcc)]}):_0x3e1780=await withSpinner(_0x274594(0xd0),()=>_0x27e98f[_0x274594(0x103)][_0x274594(0xfa)](_0x3eb9c6,{'resumeFrom':_0x5acf5a,'retryParams':_0x4ff72d,'force':_0x242d27}),{'verbose':_0x231983[_0x274594(0xcc)]});const _0x424f15=_0x3e1780[_0x274594(0x109)];return console[_0x274594(0x110)]('✔\x20Retry\x20started'),console[_0x274594(0x110)](_0x274594(0x10c)+_0x424f15[_0x274594(0x14a)]),console[_0x274594(0x110)](_0x274594(0xed)+_0x424f15[_0x274594(0xf1)]),0x0;}catch(_0x9b8118){if(_0x9b8118 instanceof SDKError)return console[_0x274594(0x110)](_0x274594(0x118)+_0x9b8118[_0x274594(0x11f)]),_0x9b8118[_0x274594(0x102)]&&console['error'](_0x274594(0xc3)+_0x9b8118[_0x274594(0x102)]),0x1;throw _0x9b8118;}}}export class WorkflowRunCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]='workflow:run';[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x138);async[a39_0x4e4c1b(0xe6)](_0x55ec11){const _0x32e847=a39_0x4e4c1b,{options:_0x518a52,args:_0x2ceb55,tdx:_0x48ec82}=_0x55ec11,_0x45f675=_0x2ceb55[0x0];if(!_0x45f675)return console[_0x32e847(0x110)](_0x32e847(0x105)),console[_0x32e847(0x110)](_0x32e847(0x13c)),0x1;const _0xa88616=_0x518a52[_0x32e847(0xda)],_0x4e5fa6=_0x518a52[_0x32e847(0x10e)],_0x298509={};if(_0xa88616&&Array[_0x32e847(0xf3)](_0xa88616))for(const _0x115fa3 of _0xa88616){const _0x5c0b3d=_0x115fa3[_0x32e847(0xf5)]('=');if(_0x5c0b3d===-0x1)return console[_0x32e847(0x110)](_0x32e847(0xd1)+_0x115fa3),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1b49c2=_0x115fa3[_0x32e847(0x136)](0x0,_0x5c0b3d),_0x546294=_0x115fa3['substring'](_0x5c0b3d+0x1);try{_0x298509[_0x1b49c2]=JSON[_0x32e847(0xc8)](_0x546294);}catch{_0x298509[_0x1b49c2]=_0x546294;}}_0x518a52[_0x32e847(0xcc)]&&(console[_0x32e847(0x110)](_0x32e847(0xe9)+_0x45f675),Object[_0x32e847(0xe0)](_0x298509)[_0x32e847(0x10b)]>0x0&&console[_0x32e847(0x110)](_0x32e847(0x11a)+JSON[_0x32e847(0x150)](_0x298509)),_0x4e5fa6&&console[_0x32e847(0x110)]('Session\x20time:\x20'+_0x4e5fa6));const _0x594f44=await withSpinner('Starting\x20workflow\x20run...',()=>_0x48ec82[_0x32e847(0x103)][_0x32e847(0x131)](_0x45f675,_0x298509,{'sessionTime':_0x4e5fa6}),{'verbose':_0x518a52[_0x32e847(0xcc)]}),_0x1f8b99=_0x594f44[_0x32e847(0x109)];return console[_0x32e847(0x110)](_0x32e847(0x113)),console[_0x32e847(0x110)](_0x32e847(0xfc)+_0x1f8b99['id']),console[_0x32e847(0x110)]('\x20\x20Session\x20ID:\x20'+_0x1f8b99[_0x32e847(0xf1)]),console['error'](_0x32e847(0xc0)+_0x1f8b99[_0x32e847(0xdc)]?.[_0x32e847(0xd5)]),console[_0x32e847(0x110)]('\x20\x20Workflow:\x20'+_0x1f8b99[_0x32e847(0x103)]?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x134);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x14c);async[a39_0x4e4c1b(0xe6)](_0x442b0f){const _0x5924ff=a39_0x4e4c1b,{options:_0x425a89,args:_0x57afea,tdx:_0xc122be}=_0x442b0f,_0x390742=_0x57afea[0x0],_0x589c2c=_0x57afea[0x1]||'.';if(!_0x390742)return console[_0x5924ff(0x110)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5924ff(0x110)](_0x5924ff(0xaa)),0x1;const _0x5454da=_0x425a89['revision'];_0x425a89[_0x5924ff(0xcc)]&&(console[_0x5924ff(0x110)](_0x5924ff(0xca)+_0x390742),console[_0x5924ff(0x110)](_0x5924ff(0xd4)+_0x589c2c),_0x5454da&&console[_0x5924ff(0x110)](_0x5924ff(0xf6)+_0x5454da));const _0x169095=await withSpinner(_0x5924ff(0xfe)+_0x390742+_0x5924ff(0xdd),()=>_0xc122be[_0x5924ff(0x103)][_0x5924ff(0xfd)](_0x390742,_0x589c2c,{'revision':_0x5454da}),{'verbose':_0x425a89[_0x5924ff(0xcc)]}),_0x4f6cd0=_0x169095['data'];return console['error'](_0x5924ff(0x11d)+_0x4f6cd0[_0x5924ff(0x115)]),console[_0x5924ff(0x110)]('\x20\x20Revision:\x20'+_0x4f6cd0[_0x5924ff(0x12a)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x4f6cd0[_0x5924ff(0xe8)]),console[_0x5924ff(0x110)](_0x5924ff(0xef)+_0x589c2c+'/'+_0x4f6cd0['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0x117);['description']='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async['execute'](_0x209283){const _0x5a5c25=a39_0x4e4c1b,{options:_0x2c041d,args:_0x148e80,tdx:_0x306639}=_0x209283;let _0x244dc8='.',_0x131857=_0x2c041d[_0x5a5c25(0xd5)];if(_0x148e80[0x0]){const {promises:_0x9eb4cf}=await import('fs');try{const _0x4d43a0=await _0x9eb4cf[_0x5a5c25(0x106)](_0x148e80[0x0]);if(_0x4d43a0[_0x5a5c25(0xe4)]())_0x244dc8=_0x148e80[0x0];else return console['error'](_0x5a5c25(0x118)+_0x148e80[0x0]+_0x5a5c25(0xe2)),0x1;}catch{_0x131857=_0x148e80[0x0],_0x244dc8='.';}}const _0x6ffbcc=_0x2c041d['revision'],_0x4668be=_0x2c041d[_0x5a5c25(0x114)];_0x2c041d[_0x5a5c25(0xcc)]&&(console[_0x5a5c25(0x110)](_0x5a5c25(0xe5)+_0x244dc8),_0x131857&&console[_0x5a5c25(0x110)](_0x5a5c25(0xec)+_0x131857),_0x6ffbcc&&console[_0x5a5c25(0x110)](_0x5a5c25(0xf6)+_0x6ffbcc),_0x4668be&&console[_0x5a5c25(0x110)](_0x5a5c25(0x101)));const _0x12d2fe=await withSpinner(_0x5a5c25(0x121),()=>_0x306639['workflow'][_0x5a5c25(0x112)](_0x244dc8,{'projectName':_0x131857,'revision':_0x6ffbcc,'skipValidation':_0x4668be}),{'verbose':_0x2c041d[_0x5a5c25(0xcc)]}),_0x595090=_0x12d2fe['data'];return console[_0x5a5c25(0x110)]('✔\x20Pushed\x20'+_0x595090['projectName']),console[_0x5a5c25(0x110)](_0x5a5c25(0xdb)+_0x595090[_0x5a5c25(0xbb)]),console['error'](_0x5a5c25(0xf9)+_0x595090['revision']),0x0;}}function a39_0x5dd6(){const _0x129b77=['Error:\x20Workflow\x20identifier\x20is\x20required','stat','attempts','split','data','attempt','length','\x20\x20New\x20attempt\x20ID:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','workflow:projects','error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','push','✔\x20Workflow\x20run\x20started','skipValidation','projectName','415809KbezRq','workflow:push','Error:\x20','6505702ZeVzzn','Parameters:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Retry\x20a\x20session\x20or\x20attempt','✔\x20Downloaded\x20','params','message','startsWith','Pushing\x20workflow\x20project...','Listing\x20workflow\x20projects...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','57642RFdebj','done','fromTask','index','getTime','Downloading\x20logs...','revision','limit','includeSubtasks','List\x20all\x20workflow\x20projects','Include\x20retried:\x20yes','Task\x20name:\x20','readFile','run','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','includeRetried','workflow:download','from','substring','Including\x20subtasks:\x20yes','Start\x20a\x20workflow\x20run','fs/promises','List\x20workflow\x20execution\x20sessions','\x20task','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Retrying\x20session...','sessions','success','Show\x20logs\x20for\x20a\x20workflow\x20attempt','retryAttemptName','workflow:kill','workflow:sessions','No\x20log\x20content\x20found','Reason:\x20','round','workflow:attempts','delete','\x20project','attemptId','kill','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Fetching\x20log\x20files...','log','Target:\x20','stringify','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Show\x20tasks\x20for\x20an\x20attempt','session','reason','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20attempt','attempt:','Attempt\x20ID:\x20','workflows','force','description','Select\x20a\x20task\x20to\x20view\x20logs:','Listing\x20workflow\x20attempts...','✔\x20Found\x20','Killing\x20attempt...','\x20workflow','Cancelled','Resume\x20from:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','taskName','canceling','projectId','Params:\x20','7696472YFdQfI','75WVtImN','Show\x20specific\x20attempt\x20details','\x20\x20Project:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Getting\x20attempt\x20tasks...','\x20\x20Cause:\x20','finishedAt','Kill\x20a\x20running\x20attempt','Filter:\x20project=','1321034ffwjin','parse','workflow:delete','Project:\x20','json','verbose','workflow:tasks','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','yes','Retrying\x20attempt...','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Attempt\x20ID\x20is\x20required','logFiles','Output\x20directory:\x20','name','Project\x20filter:\x20','utf-8','tasks','workflow:logs','param','\x20\x20Project\x20ID:\x20','project','...','task','format','keys','Filter:\x20','\x20is\x20not\x20a\x20directory','projects','isDirectory','Project\x20directory:\x20','execute','2124708arloxK','filesExtracted','Workflow:\x20','resumeFrom','workflow:attempt','Project\x20name:\x20','\x20\x20Session\x20ID:\x20','1giXXzZ','\x20\x20Location:\x20','createdAt','sessionId','workflow:workflows','isArray','Usage:\x20workflow:delete\x20<project-name-or-id>','indexOf','Revision:\x20','From\x20task:\x20','Force:\x20yes','\x20\x20Revision:\x20','retryAttempt','List\x20workflows','\x20\x20Attempt\x20ID:\x20','download','Downloading\x20project\x20','status','3858144rLixOf','Validation:\x20skipped','cause','workflow','retrySession'];a39_0x5dd6=function(){return _0x129b77;};return a39_0x5dd6();}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xc9);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x11b);async[a39_0x4e4c1b(0xe6)](_0x95820b){const _0x2a5599=a39_0x4e4c1b,{options:_0x34f149,args:_0x4136d2,tdx:_0x4eae24}=_0x95820b,_0x5cda63=_0x4136d2[0x0];if(!_0x5cda63)return console['error'](_0x2a5599(0xb8)),console['error'](_0x2a5599(0xf4)),0x1;_0x34f149['verbose']&&console[_0x2a5599(0x110)](_0x2a5599(0xca)+_0x5cda63);if(!_0x34f149['yes']){const _0x540e5f=await confirm(_0x2a5599(0x151)+_0x5cda63+_0x2a5599(0x10d));if(!_0x540e5f)return console[_0x2a5599(0x110)](_0x2a5599(0xb6)),0x0;}const _0x247118=await withSpinner('Deleting\x20project\x20'+_0x5cda63+_0x2a5599(0xdd),()=>_0x4eae24[_0x2a5599(0x103)][_0x2a5599(0x148)](_0x5cda63),{'verbose':_0x34f149[_0x2a5599(0xcc)]}),_0x5c3aa3=_0x247118[_0x2a5599(0x109)];return console['error']('✔\x20Deleted\x20project\x20'+_0x5c3aa3[_0x2a5599(0x115)]),console['error'](_0x2a5599(0xdb)+_0x5c3aa3['projectId']),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a40_0x1ec9(_0x11063d,_0x4a468b){const _0x4a5074=a40_0x4a50();return a40_0x1ec9=function(_0x1ec982,_0x3f3c92){_0x1ec982=_0x1ec982-0xa7;let _0x76640c=_0x4a5074[_0x1ec982];return _0x76640c;},a40_0x1ec9(_0x11063d,_0x4a468b);}(function(_0x2f1e7b,_0x1359dd){const _0x22bceb=a40_0x1ec9,_0x4fbee7=_0x2f1e7b();while(!![]){try{const _0x2b947a=parseInt(_0x22bceb(0xab))/0x1*(-parseInt(_0x22bceb(0xb7))/0x2)+-parseInt(_0x22bceb(0xbf))/0x3*(parseInt(_0x22bceb(0xae))/0x4)+parseInt(_0x22bceb(0xbb))/0x5*(-parseInt(_0x22bceb(0xb8))/0x6)+parseInt(_0x22bceb(0xad))/0x7+parseInt(_0x22bceb(0xb3))/0x8*(parseInt(_0x22bceb(0xbe))/0x9)+-parseInt(_0x22bceb(0xbc))/0xa*(parseInt(_0x22bceb(0xba))/0xb)+parseInt(_0x22bceb(0xb5))/0xc*(parseInt(_0x22bceb(0xaf))/0xd);if(_0x2b947a===_0x1359dd)break;else _0x4fbee7['push'](_0x4fbee7['shift']());}catch(_0x465b47){_0x4fbee7['push'](_0x4fbee7['shift']());}}}(a40_0x4a50,0x9e634));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a40_0x4a50(){const _0x344625=['1638455DeVlFI','787292HMjaoj','38357007APFcHL',';\x20node/','utf-8','TD1\x20','9816qqLXUP','../../package.json','12jqvjSg','Authorization','1257518ZyPNSJ','4441542tcRIAo','replace','1353nuXdBy','5mTsFqP','81950PPZqBX','length','7497HhxkqX','18wSaFRP','version','X-Trino-User','0.0.0','tdx','1sbCHmf','parse'];a40_0x4a50=function(){return _0x344625;};return a40_0x4a50();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x3c2c86=a40_0x1ec9;try{const _0x3e0b7b=fileURLToPath(import.meta['url']),_0x53b0a0=dirname(_0x3e0b7b),_0x3798a7=join(_0x53b0a0,_0x3c2c86(0xb4)),_0x46e819=JSON[_0x3c2c86(0xac)](readFileSync(_0x3798a7,_0x3c2c86(0xb1)));return _0x46e819[_0x3c2c86(0xa7)];}catch{return _0x3c2c86(0xa9);}}export function getUserAgent(){const _0x364365=a40_0x1ec9,_0x373dc0=getVersion(),_0x1d904b=platform(),_0x8fb5c8=process[_0x364365(0xa7)][_0x364365(0xb9)]('v','');return'tdx/'+_0x373dc0+'\x20('+_0x1d904b+_0x364365(0xb0)+_0x8fb5c8+')';}export function getAuthHeaders(_0x27da04,_0x5610cf){const _0x2b8619=a40_0x1ec9,_0x479352=getVersion(),_0x41eaa8={'User-Agent':getUserAgent(),'X-TD-Client':_0x2b8619(0xaa),'X-TD-Client-Version':_0x479352};return _0x5610cf&&(_0x41eaa8[_0x2b8619(0xb6)]=_0x2b8619(0xb2)+_0x5610cf),_0x41eaa8;}export function toHeaderRecord(_0x44612b){const _0x5c3255={};for(const [_0x3afad0,_0x3487a5]of Object['entries'](_0x44612b)){_0x3487a5!==undefined&&(_0x5c3255[_0x3afad0]=_0x3487a5);}return _0x5c3255;}export function getTrinoHeaders(_0x5209ef,_0xafa042){const _0x303430=a40_0x1ec9,_0xdc9535=getAuthHeaders(_0x5209ef,_0xafa042),_0x5eb84b=toHeaderRecord(_0xdc9535);return delete _0x5eb84b[_0x303430(0xb6)],_0xafa042&&(_0x5eb84b[_0x303430(0xa8)]=_0xafa042),_0x5eb84b;}export function hasAPIKey(_0x3afd89){const _0x312126=a40_0x1ec9,_0x5dc949=getAPIKey(_0x3afd89);return _0x5dc949!==undefined&&_0x5dc949[_0x312126(0xbd)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x53f680,_0x4ccb06){const _0x473554=a41_0x326e,_0x149932=_0x53f680();while(!![]){try{const _0x12e199=parseInt(_0x473554(0x10b))/0x1+-parseInt(_0x473554(0x13d))/0x2*(parseInt(_0x473554(0x14e))/0x3)+-parseInt(_0x473554(0x14b))/0x4+parseInt(_0x473554(0x11f))/0x5+-parseInt(_0x473554(0x143))/0x6*(-parseInt(_0x473554(0x122))/0x7)+parseInt(_0x473554(0x130))/0x8+parseInt(_0x473554(0x133))/0x9*(-parseInt(_0x473554(0x13b))/0xa);if(_0x12e199===_0x4ccb06)break;else _0x149932['push'](_0x149932['shift']());}catch(_0xb058c7){_0x149932['push'](_0x149932['shift']());}}}(a41_0xba00,0x3d15b));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x2c83f0 from'node:fs';import*as a41_0xd5b29e 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 a41_0x12b6e4 from'chalk';export function getConfigDir(){const _0x2238b5=a41_0x326e;return process['env']['TDX_CONFIG_DIR']||join(homedir(),_0x2238b5(0x11b),_0x2238b5(0x11d));}function a41_0xba00(){const _0x3456f7=['join','includes','readFileSync','.env.','entries','split','keychain','354944tBOWyy','stg-us01','match','1278705nmnRlO','warn','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','profiles','493864yMbdFR','toUpperCase','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','utf-8','us01','jp01','some','TD_API_KEY_','existsSync','yellow','string','replace','trim','stg-jp01','endsWith','dev-eu01','.config','source','tdx','\x20env\x20var','2404645unePTJ','ap02','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','1275477pbHKoz','map','ap03','eu01','env','TDX_API_KEY','TDX_CACHE_DIR','.env','startsWith','slice','legacy\x20.env\x20file\x20(profile:\x20','profile','tdx.json','Warning:\x20Unknown\x20site\x20\x27','3611864YMycow','parse','isDeprecated','200646dVdkJZ','keychain\x20(profile:\x20','TDX_API_KEY_','.cache','Warning:\x20Failed\x20to\x20load\x20','llm_default_project.','TDX_API_KEY_<PROFILE>','TDX_API_KEY\x20env\x20var','460TgCMar','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','2hHbcki','name','stg-ap03','Warning:\x20Failed\x20to\x20read\x20','filter','TD_API_KEY','12HGTflU'];a41_0xba00=function(){return _0x3456f7;};return a41_0xba00();}export function getConfigFile(){const _0x5ab437=a41_0x326e;return join(getConfigDir(),_0x5ab437(0x129));}export function getConfigFilePath(_0xc302e1){const _0x3940ea=a41_0x326e,_0x3a0920=getConfigDir();return _0xc302e1?a41_0xd5b29e[_0x3940ea(0x144)](_0x3a0920,'.env.'+_0xc302e1):getConfigFile();}export function getCacheDir(){const _0x433df8=a41_0x326e;return process[_0x433df8(0x126)][_0x433df8(0x128)]||join(homedir(),_0x433df8(0x136),_0x433df8(0x11d));}export function getLLMProjectCacheFile(_0x31d57c){const _0x369c46=a41_0x326e,_0x549ac4=_0x31d57c?_0x369c46(0x138)+_0x31d57c:'llm_default_project';return join(getCacheDir(),_0x549ac4);}export function readCachedLLMProject(_0xff0e70){const _0x2bb5ec=a41_0x326e;try{const _0xd9c1b4=getLLMProjectCacheFile(_0xff0e70);if(!existsSync(_0xd9c1b4))return null;const _0x449ab2=readFileSync(_0xd9c1b4,_0x2bb5ec(0x10e))[_0x2bb5ec(0x117)]();try{const _0x5cd033=JSON[_0x2bb5ec(0x131)](_0x449ab2);if(_0x5cd033&&typeof _0x5cd033['id']===_0x2bb5ec(0x115)&&typeof _0x5cd033[_0x2bb5ec(0x13e)]===_0x2bb5ec(0x115))return _0x5cd033;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x2e1c81,_0x2eaafa,_0x32fdd9){const _0x4d7c68=a41_0x326e;try{const _0x4a309b=getCacheDir(),_0x3ef088=getLLMProjectCacheFile(_0x32fdd9);!existsSync(_0x4a309b)&&mkdirSync(_0x4a309b,{'recursive':!![]});const _0x322b8b={'name':_0x2e1c81,'id':_0x2eaafa};writeFileSync(_0x3ef088,JSON['stringify'](_0x322b8b),_0x4d7c68(0x10e));}catch{}}export function parseEnvFile(_0x576166){const _0xf7fd64=a41_0x326e,_0x5e699a={};for(const _0x596bba of _0x576166[_0xf7fd64(0x149)]('\x0a')){const _0x4c46ae=_0x596bba[_0xf7fd64(0x117)]();if(!_0x4c46ae||_0x4c46ae[_0xf7fd64(0x12a)]('#'))continue;const _0x5539d5=_0x4c46ae[_0xf7fd64(0x14d)](/^([^=]+)=(.*)$/);if(_0x5539d5){const _0x3daff4=_0x5539d5[0x1][_0xf7fd64(0x117)]();let _0xc362f7=_0x5539d5[0x2]['trim']();(_0xc362f7[_0xf7fd64(0x12a)]('\x22')&&_0xc362f7[_0xf7fd64(0x119)]('\x22')||_0xc362f7[_0xf7fd64(0x12a)]('\x27')&&_0xc362f7[_0xf7fd64(0x119)]('\x27'))&&(_0xc362f7=_0xc362f7[_0xf7fd64(0x12b)](0x1,-0x1)),_0x5e699a[_0x3daff4]=_0xc362f7;}}return _0x5e699a;}export function readUserConfig(){const _0x4ae25f=a41_0x326e,_0x6fdf84=getConfigFile();if(!existsSync(_0x6fdf84))return{};try{const _0x3fe926=readFileSync(_0x6fdf84,_0x4ae25f(0x10e));return parseEnvFile(_0x3fe926);}catch(_0x3e1252){return console['warn'](_0x4ae25f(0x109)+_0x6fdf84+':',_0x3e1252),{};}}export function resolveSite(_0x174b97){const _0x60b93b=a41_0x326e,_0x1b8759=[_0x60b93b(0x10f),'jp01',_0x60b93b(0x125),_0x60b93b(0x120),_0x60b93b(0x124),'dev-us01',_0x60b93b(0x11a),_0x60b93b(0x14c),_0x60b93b(0x118),_0x60b93b(0x13f)];if(_0x1b8759[_0x60b93b(0x145)](_0x174b97))return _0x174b97;if(_0x174b97 in SITE_ALIASES)return SITE_ALIASES[_0x174b97];return console[_0x60b93b(0x14f)](_0x60b93b(0x12f)+_0x174b97+'\x27,\x20defaulting\x20to\x20us01'),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5d3480,_0x4f1567){const _0xa26832=a41_0x326e,_0x126d21=_0x4f1567||getActiveProfileName();if(_0x126d21){const _0x575801=_0xa26832(0x135)+normalizeProfileForEnvVar(_0x126d21);if(process[_0xa26832(0x126)][_0x575801])return process[_0xa26832(0x126)][_0x575801];}if(process[_0xa26832(0x126)][_0xa26832(0x127)])return process[_0xa26832(0x126)][_0xa26832(0x127)];if(process['env'][_0xa26832(0x142)])return process['env']['TD_API_KEY'];const _0xdf00be=_0x5d3480[_0xa26832(0x10c)]()[_0xa26832(0x116)](/-/g,'_'),_0x2a0468=_0xa26832(0x112)+_0xdf00be;if(_0x126d21){const _0x334e13=loadProfileEnv(_0x126d21);if(_0x334e13){if(_0x334e13[_0x2a0468])return _0x334e13[_0x2a0468];if(_0x334e13[_0xa26832(0x142)])return _0x334e13[_0xa26832(0x142)];}}const _0x1a43ef=loadUserConfigOnce();if(_0x1a43ef[_0x2a0468])return _0x1a43ef[_0x2a0468];if(_0x1a43ef[_0xa26832(0x142)])return _0x1a43ef[_0xa26832(0x142)];return undefined;}export function normalizeProfileForEnvVar(_0x4ba555){const _0x59e78e=a41_0x326e;return _0x4ba555[_0x59e78e(0x10c)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3f8ff0,_0x148c4c){const _0x5aaed4=a41_0x326e,_0x1004e2=_0x148c4c||getActiveProfileName()||undefined;if(_0x1004e2){const _0x193ff2=_0x5aaed4(0x135)+normalizeProfileForEnvVar(_0x1004e2);if(process[_0x5aaed4(0x126)][_0x193ff2])return{'apiKey':process['env'][_0x193ff2],'source':_0x193ff2+_0x5aaed4(0x11e),'isDeprecated':![]};const _0x4e416c=getCachedCredential(_0x3f8ff0,_0x1004e2);if(_0x4e416c)return{'apiKey':_0x4e416c,'source':_0x5aaed4(0x134)+_0x1004e2+')','isDeprecated':![]};const _0x5d91f5=await getKeychainAPIKey(_0x1004e2);if(_0x5d91f5)return setCachedCredential(_0x5d91f5,_0x3f8ff0,_0x1004e2),{'apiKey':_0x5d91f5,'source':'keychain\x20(profile:\x20'+_0x1004e2+')','isDeprecated':![]};}if(process[_0x5aaed4(0x126)]['TDX_API_KEY'])return{'apiKey':process[_0x5aaed4(0x126)][_0x5aaed4(0x127)],'source':_0x5aaed4(0x13a),'isDeprecated':![]};if(!_0x1004e2){const _0x505aa9=getCachedCredential(_0x3f8ff0,undefined);if(_0x505aa9)return{'apiKey':_0x505aa9,'source':_0x5aaed4(0x14a),'isDeprecated':![]};const _0x3fa551=await getKeychainAPIKey(undefined);if(_0x3fa551)return setCachedCredential(_0x3fa551,_0x3f8ff0,undefined),{'apiKey':_0x3fa551,'source':_0x5aaed4(0x14a),'isDeprecated':![]};}if(process[_0x5aaed4(0x126)][_0x5aaed4(0x142)])return{'apiKey':process[_0x5aaed4(0x126)]['TD_API_KEY'],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x35a65e=getLegacyEnvAPIKey(_0x3f8ff0,_0x1004e2);if(_0x35a65e){const _0x1b1192=await isKeychainAvailable();if(_0x1b1192)try{await saveKeychainAPIKey(_0x35a65e,_0x1004e2),setCachedCredential(_0x35a65e,_0x3f8ff0,_0x1004e2);const _0x3905d9=getConfigFilePath(_0x1004e2);cleanupLegacyEnvFile(_0x3905d9)&&console[_0x5aaed4(0x14f)](a41_0x12b6e4[_0x5aaed4(0x114)](_0x5aaed4(0x10d)));}catch(_0x531222){console[_0x5aaed4(0x14f)](a41_0x12b6e4[_0x5aaed4(0x114)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x531222));}const _0x37580d=_0x1004e2?_0x5aaed4(0x12c)+_0x1004e2+')':'legacy\x20.env\x20file';return{'apiKey':_0x35a65e,'source':_0x37580d,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x23d775,_0x49bf1d,_0x4c2062=!![]){const _0x3ffe1d=a41_0x326e,_0x2f4e59=await resolveAPIKeyAsync(_0x23d775,_0x49bf1d);if(!_0x2f4e59)return undefined;if(_0x4c2062&&_0x2f4e59[_0x3ffe1d(0x132)]&&_0x2f4e59[_0x3ffe1d(0x11c)][_0x3ffe1d(0x145)](_0x3ffe1d(0x142))){const _0x5a1a9a=_0x49bf1d||getActiveProfileName()||undefined,_0x1ef869=_0x5a1a9a?_0x3ffe1d(0x135)+normalizeProfileForEnvVar(_0x5a1a9a):_0x3ffe1d(0x139);console[_0x3ffe1d(0x14f)](a41_0x12b6e4[_0x3ffe1d(0x114)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x3ffe1d(0x13c)+_0x1ef869+').')));}return _0x2f4e59['apiKey'];}function getLegacyEnvAPIKey(_0x500b5a,_0x496e0a){const _0x248e00=a41_0x326e,_0x564c56=_0x500b5a['toUpperCase']()[_0x248e00(0x116)](/-/g,'_'),_0x3ce839=_0x248e00(0x112)+_0x564c56;if(_0x496e0a){const _0x5a3243=loadProfileEnv(_0x496e0a);if(_0x5a3243){if(_0x5a3243[_0x3ce839])return _0x5a3243[_0x3ce839];if(_0x5a3243['TD_API_KEY'])return _0x5a3243['TD_API_KEY'];}}const _0x4f478f=loadUserConfigOnce();if(_0x4f478f[_0x3ce839])return _0x4f478f[_0x3ce839];if(_0x4f478f[_0x248e00(0x142)])return _0x4f478f[_0x248e00(0x142)];return undefined;}function cleanupLegacyEnvFile(_0x5e02f4){const _0x36fa36=a41_0x326e;if(!existsSync(_0x5e02f4))return![];try{const _0x251229=readFileSync(_0x5e02f4,_0x36fa36(0x10e)),_0x4b611a=_0x251229[_0x36fa36(0x149)]('\x0a'),_0x4ce4be=_0x4b611a[_0x36fa36(0x141)](_0x4d8843=>{const _0x345183=_0x36fa36,_0x1e97e6=_0x4d8843[_0x345183(0x117)]();if(!_0x1e97e6||_0x1e97e6[_0x345183(0x12a)]('#'))return!![];const [_0x2f99c4]=_0x1e97e6['split']('=');return!_0x2f99c4[_0x345183(0x12a)]('TD_API_KEY');}),_0x820665=_0x4ce4be[_0x36fa36(0x111)](_0x39dc1d=>{const _0xad6604=_0x36fa36,_0x15922f=_0x39dc1d[_0xad6604(0x117)]();return _0x15922f&&!_0x15922f[_0xad6604(0x12a)]('#');});if(!_0x820665)return unlinkSync(_0x5e02f4),!![];return writeFileSync(_0x5e02f4,_0x4ce4be['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a41_0x326e(_0x1ed9ab,_0x558672){const _0xba0034=a41_0xba00();return a41_0x326e=function(_0x326ea3,_0x221986){_0x326ea3=_0x326ea3-0x109;let _0x13a643=_0xba0034[_0x326ea3];return _0x13a643;},a41_0x326e(_0x1ed9ab,_0x558672);}function loadProfileEnv(_0xbcd298){const _0x4039c1=a41_0x326e,_0x4f0f12=a41_0xd5b29e[_0x4039c1(0x144)](getConfigDir(),_0x4039c1(0x147)+_0xbcd298);if(a41_0x2c83f0[_0x4039c1(0x113)](_0x4f0f12)){validateSecureFilePermissions(_0x4f0f12);try{const _0x3a4760=a41_0x2c83f0[_0x4039c1(0x146)](_0x4f0f12,'utf-8');return parseEnvFile(_0x3a4760);}catch(_0x5e18b3){console['warn'](_0x4039c1(0x137)+_0x4f0f12+':\x20'+_0x5e18b3);}}const _0x33c174=a41_0xd5b29e[_0x4039c1(0x144)](getConfigDir(),_0x4039c1(0x10a),_0xbcd298,_0x4039c1(0x129));if(a41_0x2c83f0[_0x4039c1(0x113)](_0x33c174)){validateSecureFilePermissions(_0x33c174);try{const _0x3f9668=a41_0x2c83f0[_0x4039c1(0x146)](_0x33c174,_0x4039c1(0x10e));return parseEnvFile(_0x3f9668);}catch(_0x3d7f21){return console['warn'](_0x4039c1(0x137)+_0x33c174+':\x20'+_0x3d7f21),null;}}return null;}function getActiveProfileName(){const _0x40668b=a41_0x326e,_0x3b7db1=a41_0xd5b29e['join'](getConfigDir(),_0x40668b(0x12e));if(!a41_0x2c83f0[_0x40668b(0x113)](_0x3b7db1))return null;try{const _0x38b7f4=a41_0x2c83f0[_0x40668b(0x146)](_0x3b7db1,_0x40668b(0x10e)),_0x2f1c00=JSON[_0x40668b(0x131)](_0x38b7f4);return _0x2f1c00[_0x40668b(0x12d)]||null;}catch{return null;}}export function saveAPIKey(_0x194ea6,_0x30d7b4,_0xa0a66c){const _0x29b0e2=a41_0x326e,_0x39e68b=getConfigDir(),_0x321fc6=getConfigFilePath(_0xa0a66c);!existsSync(_0x39e68b)&&mkdirSync(_0x39e68b,{'recursive':!![],'mode':0x1c0});let _0x12782e={};if(existsSync(_0x321fc6))try{const _0x50f0b9=readFileSync(_0x321fc6,_0x29b0e2(0x10e));_0x12782e=parseEnvFile(_0x50f0b9);}catch(_0xa6bcb4){console[_0x29b0e2(0x14f)](_0x29b0e2(0x140)+_0x321fc6+':',_0xa6bcb4);}const _0xc1cce9=_0x194ea6[_0x29b0e2(0x10c)]()[_0x29b0e2(0x116)](/-/g,'_');_0x12782e[_0x29b0e2(0x112)+_0xc1cce9]=_0x30d7b4;const _0x2e1a8e=Object[_0x29b0e2(0x148)](_0x12782e)[_0x29b0e2(0x123)](([_0x282417,_0x177e01])=>_0x282417+'='+_0x177e01);writeFileSync(_0x321fc6,_0x2e1a8e[_0x29b0e2(0x144)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x432f8e,_0x446030,_0x5ab93d){const _0x415835=a41_0x326e;await saveKeychainAPIKey(_0x432f8e,_0x5ab93d),setCachedCredential(_0x432f8e,_0x446030,_0x5ab93d);const _0x18edcc=getConfigFilePath(_0x5ab93d);cleanupLegacyEnvFile(_0x18edcc)&&console['warn'](a41_0x12b6e4['yellow'](_0x415835(0x121)));}export function loadConfig(){const _0x2a0952=a41_0x326e,_0x326178={'apiKeys':{},'defaultSite':_0x2a0952(0x10f)},_0x321e37=[_0x2a0952(0x10f),_0x2a0952(0x110),_0x2a0952(0x125),_0x2a0952(0x120),_0x2a0952(0x124),'dev-us01',_0x2a0952(0x11a),_0x2a0952(0x14c),'stg-jp01','stg-ap03'];for(const _0x4e6fda of _0x321e37){const _0x28c839=getAPIKey(_0x4e6fda);_0x28c839&&(_0x326178['apiKeys'][_0x4e6fda]=_0x28c839);}return _0x326178;}
|
|
1
|
+
(function(_0x2ec6af,_0x4512bc){const _0x595168=a41_0x45be,_0x2f2e22=_0x2ec6af();while(!![]){try{const _0x25bb55=-parseInt(_0x595168(0x1f5))/0x1*(-parseInt(_0x595168(0x21c))/0x2)+parseInt(_0x595168(0x1f3))/0x3+-parseInt(_0x595168(0x202))/0x4+parseInt(_0x595168(0x204))/0x5+-parseInt(_0x595168(0x211))/0x6+-parseInt(_0x595168(0x225))/0x7+-parseInt(_0x595168(0x207))/0x8*(-parseInt(_0x595168(0x22e))/0x9);if(_0x25bb55===_0x4512bc)break;else _0x2f2e22['push'](_0x2f2e22['shift']());}catch(_0x18eebc){_0x2f2e22['push'](_0x2f2e22['shift']());}}}(a41_0xf5b6,0x98b7e));import{homedir}from'os';import{join}from'path';function a41_0xf5b6(){const _0x11127d=['keychain','TDX_API_KEY_<PROFILE>','llm_default_project.','4307500AEJsjs','parse','5010345cgjNVB','includes','\x27,\x20defaulting\x20to\x20us01','8eUqyZj','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','keychain\x20(profile:\x20','us01','toUpperCase','Warning:\x20Failed\x20to\x20load\x20','Warning:\x20Failed\x20to\x20read\x20','ap03','stg-jp01','isDeprecated','348060wlIaqu','dev-us01','env','TDX_CACHE_DIR','legacy\x20.env\x20file','.env.','match','map','jp01','stg-us01','tdx','344938yqsigF','.cache','tdx.json','stg-ap03','endsWith','profile','apiKeys','TD_API_KEY\x20env\x20var\x20(deprecated)','split','5848129iiBmrv','warn','.config','utf-8','TDX_API_KEY\x20env\x20var','string','readFileSync','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','\x20env\x20var','2451069YNGeeG','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','yellow','existsSync','entries','dev-eu01','TDX_API_KEY','TD_API_KEY','TDX_CONFIG_DIR','stringify','join','.env','342519zuSWty','source','7SgoohW','eu01','trim','TD_API_KEY_','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','filter','TDX_API_KEY_','replace','startsWith','slice'];a41_0xf5b6=function(){return _0x11127d;};return a41_0xf5b6();}import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x51ed9c from'node:fs';import*as a41_0x4d2422 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 a41_0x4caa9c from'chalk';export function getConfigDir(){const _0x531e1=a41_0x45be;return process['env'][_0x531e1(0x1ef)]||join(homedir(),_0x531e1(0x227),_0x531e1(0x21b));}export function getConfigFile(){const _0x2ea40f=a41_0x45be;return join(getConfigDir(),_0x2ea40f(0x1f2));}export function getConfigFilePath(_0x24ec73){const _0x59180e=a41_0x45be,_0x5b7912=getConfigDir();return _0x24ec73?a41_0x4d2422[_0x59180e(0x1f1)](_0x5b7912,_0x59180e(0x216)+_0x24ec73):getConfigFile();}export function getCacheDir(){const _0x21b556=a41_0x45be;return process[_0x21b556(0x213)][_0x21b556(0x214)]||join(homedir(),_0x21b556(0x21d),_0x21b556(0x21b));}export function getLLMProjectCacheFile(_0x598b02){const _0x44c6c5=a41_0x45be,_0x1f94b9=_0x598b02?_0x44c6c5(0x201)+_0x598b02:'llm_default_project';return join(getCacheDir(),_0x1f94b9);}export function readCachedLLMProject(_0x78116f){const _0x39f322=a41_0x45be;try{const _0x2eb251=getLLMProjectCacheFile(_0x78116f);if(!existsSync(_0x2eb251))return null;const _0x167ba7=readFileSync(_0x2eb251,_0x39f322(0x228))[_0x39f322(0x1f7)]();try{const _0x2ecdc6=JSON[_0x39f322(0x203)](_0x167ba7);if(_0x2ecdc6&&typeof _0x2ecdc6['id']===_0x39f322(0x22a)&&typeof _0x2ecdc6['name']==='string')return _0x2ecdc6;}catch{}return null;}catch{return null;}}function a41_0x45be(_0x3f8cad,_0x241071){const _0xf5b6d=a41_0xf5b6();return a41_0x45be=function(_0x45be97,_0x377274){_0x45be97=_0x45be97-0x1ee;let _0x3899ba=_0xf5b6d[_0x45be97];return _0x3899ba;},a41_0x45be(_0x3f8cad,_0x241071);}export function writeCachedLLMProject(_0x47852c,_0x41c630,_0x312bd0){const _0x39dab1=a41_0x45be;try{const _0x1c1006=getCacheDir(),_0x2d2bfd=getLLMProjectCacheFile(_0x312bd0);!existsSync(_0x1c1006)&&mkdirSync(_0x1c1006,{'recursive':!![]});const _0x18dcdc={'name':_0x47852c,'id':_0x41c630};writeFileSync(_0x2d2bfd,JSON[_0x39dab1(0x1f0)](_0x18dcdc),'utf-8');}catch{}}export function parseEnvFile(_0x269027){const _0x2c8590=a41_0x45be,_0x19dc30={};for(const _0x267804 of _0x269027[_0x2c8590(0x224)]('\x0a')){const _0x59f0ad=_0x267804[_0x2c8590(0x1f7)]();if(!_0x59f0ad||_0x59f0ad['startsWith']('#'))continue;const _0x3b91db=_0x59f0ad[_0x2c8590(0x217)](/^([^=]+)=(.*)$/);if(_0x3b91db){const _0x4950b0=_0x3b91db[0x1]['trim']();let _0x228051=_0x3b91db[0x2]['trim']();(_0x228051['startsWith']('\x22')&&_0x228051[_0x2c8590(0x220)]('\x22')||_0x228051[_0x2c8590(0x1fd)]('\x27')&&_0x228051[_0x2c8590(0x220)]('\x27'))&&(_0x228051=_0x228051[_0x2c8590(0x1fe)](0x1,-0x1)),_0x19dc30[_0x4950b0]=_0x228051;}}return _0x19dc30;}export function readUserConfig(){const _0x87d9d6=a41_0x45be,_0x214e93=getConfigFile();if(!existsSync(_0x214e93))return{};try{const _0x35f8c5=readFileSync(_0x214e93,_0x87d9d6(0x228));return parseEnvFile(_0x35f8c5);}catch(_0x760497){return console['warn'](_0x87d9d6(0x22f)+_0x214e93+':',_0x760497),{};}}export function resolveSite(_0x224c65){const _0x3cef75=a41_0x45be,_0x3a17a5=[_0x3cef75(0x20a),_0x3cef75(0x219),_0x3cef75(0x1f6),'ap02',_0x3cef75(0x20e),_0x3cef75(0x212),_0x3cef75(0x233),_0x3cef75(0x21a),_0x3cef75(0x20f),_0x3cef75(0x21f)];if(_0x3a17a5[_0x3cef75(0x205)](_0x224c65))return _0x224c65;if(_0x224c65 in SITE_ALIASES)return SITE_ALIASES[_0x224c65];return console[_0x3cef75(0x226)]('Warning:\x20Unknown\x20site\x20\x27'+_0x224c65+_0x3cef75(0x206)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5b2449,_0x3786e5){const _0xadc5b9=a41_0x45be,_0x5e3ff0=_0x3786e5||getActiveProfileName();if(_0x5e3ff0){const _0x496b06=_0xadc5b9(0x1fb)+normalizeProfileForEnvVar(_0x5e3ff0);if(process[_0xadc5b9(0x213)][_0x496b06])return process[_0xadc5b9(0x213)][_0x496b06];}if(process[_0xadc5b9(0x213)][_0xadc5b9(0x234)])return process['env'][_0xadc5b9(0x234)];if(process[_0xadc5b9(0x213)][_0xadc5b9(0x1ee)])return process['env'][_0xadc5b9(0x1ee)];const _0x4a8782=_0x5b2449[_0xadc5b9(0x20b)]()[_0xadc5b9(0x1fc)](/-/g,'_'),_0x23094a=_0xadc5b9(0x1f8)+_0x4a8782;if(_0x5e3ff0){const _0x1fa8d6=loadProfileEnv(_0x5e3ff0);if(_0x1fa8d6){if(_0x1fa8d6[_0x23094a])return _0x1fa8d6[_0x23094a];if(_0x1fa8d6[_0xadc5b9(0x1ee)])return _0x1fa8d6['TD_API_KEY'];}}const _0x5e44d6=loadUserConfigOnce();if(_0x5e44d6[_0x23094a])return _0x5e44d6[_0x23094a];if(_0x5e44d6['TD_API_KEY'])return _0x5e44d6['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x499615){const _0x38332d=a41_0x45be;return _0x499615[_0x38332d(0x20b)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x1bb9f3,_0x25cf1){const _0x3730d6=a41_0x45be,_0x55f651=_0x25cf1||getActiveProfileName()||undefined;if(_0x55f651){const _0x454b30=_0x3730d6(0x1fb)+normalizeProfileForEnvVar(_0x55f651);if(process[_0x3730d6(0x213)][_0x454b30])return{'apiKey':process[_0x3730d6(0x213)][_0x454b30],'source':_0x454b30+_0x3730d6(0x22d),'isDeprecated':![]};const _0x18f56c=getCachedCredential(_0x1bb9f3,_0x55f651);if(_0x18f56c)return{'apiKey':_0x18f56c,'source':_0x3730d6(0x209)+_0x55f651+')','isDeprecated':![]};const _0x3b4278=await getKeychainAPIKey(_0x55f651);if(_0x3b4278)return setCachedCredential(_0x3b4278,_0x1bb9f3,_0x55f651),{'apiKey':_0x3b4278,'source':_0x3730d6(0x209)+_0x55f651+')','isDeprecated':![]};}if(process['env'][_0x3730d6(0x234)])return{'apiKey':process[_0x3730d6(0x213)]['TDX_API_KEY'],'source':_0x3730d6(0x229),'isDeprecated':![]};if(!_0x55f651){const _0x419f3d=getCachedCredential(_0x1bb9f3,undefined);if(_0x419f3d)return{'apiKey':_0x419f3d,'source':'keychain','isDeprecated':![]};const _0x2536fa=await getKeychainAPIKey(undefined);if(_0x2536fa)return setCachedCredential(_0x2536fa,_0x1bb9f3,undefined),{'apiKey':_0x2536fa,'source':_0x3730d6(0x1ff),'isDeprecated':![]};}if(process[_0x3730d6(0x213)][_0x3730d6(0x1ee)])return{'apiKey':process[_0x3730d6(0x213)][_0x3730d6(0x1ee)],'source':_0x3730d6(0x223),'isDeprecated':!![]};const _0x55f8d0=getLegacyEnvAPIKey(_0x1bb9f3,_0x55f651);if(_0x55f8d0){const _0xf0b245=await isKeychainAvailable();if(_0xf0b245)try{await saveKeychainAPIKey(_0x55f8d0,_0x55f651),setCachedCredential(_0x55f8d0,_0x1bb9f3,_0x55f651);const _0xbd0adb=getConfigFilePath(_0x55f651);cleanupLegacyEnvFile(_0xbd0adb)&&console['warn'](a41_0x4caa9c[_0x3730d6(0x230)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x3d336b){console[_0x3730d6(0x226)](a41_0x4caa9c[_0x3730d6(0x230)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x3d336b));}const _0x3f2c06=_0x55f651?'legacy\x20.env\x20file\x20(profile:\x20'+_0x55f651+')':_0x3730d6(0x215);return{'apiKey':_0x55f8d0,'source':_0x3f2c06,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2cb4cc,_0x124d65,_0x41b527=!![]){const _0x5177b1=a41_0x45be,_0x27cb0f=await resolveAPIKeyAsync(_0x2cb4cc,_0x124d65);if(!_0x27cb0f)return undefined;if(_0x41b527&&_0x27cb0f[_0x5177b1(0x210)]&&_0x27cb0f[_0x5177b1(0x1f4)]['includes'](_0x5177b1(0x1ee))){const _0x38beac=_0x124d65||getActiveProfileName()||undefined,_0x20cb70=_0x38beac?_0x5177b1(0x1fb)+normalizeProfileForEnvVar(_0x38beac):_0x5177b1(0x200);console['warn'](a41_0x4caa9c[_0x5177b1(0x230)](_0x5177b1(0x22c)+(_0x5177b1(0x1f9)+_0x20cb70+').')));}return _0x27cb0f['apiKey'];}function getLegacyEnvAPIKey(_0x177621,_0x582162){const _0x33913a=a41_0x45be,_0x2c7b7d=_0x177621[_0x33913a(0x20b)]()[_0x33913a(0x1fc)](/-/g,'_'),_0x3955f0=_0x33913a(0x1f8)+_0x2c7b7d;if(_0x582162){const _0x3e4ab1=loadProfileEnv(_0x582162);if(_0x3e4ab1){if(_0x3e4ab1[_0x3955f0])return _0x3e4ab1[_0x3955f0];if(_0x3e4ab1['TD_API_KEY'])return _0x3e4ab1[_0x33913a(0x1ee)];}}const _0x49a02c=loadUserConfigOnce();if(_0x49a02c[_0x3955f0])return _0x49a02c[_0x3955f0];if(_0x49a02c['TD_API_KEY'])return _0x49a02c[_0x33913a(0x1ee)];return undefined;}function cleanupLegacyEnvFile(_0x33ff80){const _0x899fe9=a41_0x45be;if(!existsSync(_0x33ff80))return![];try{const _0x6bde02=readFileSync(_0x33ff80,'utf-8'),_0x1fcc0d=_0x6bde02[_0x899fe9(0x224)]('\x0a'),_0x1d9af4=_0x1fcc0d[_0x899fe9(0x1fa)](_0xd7e420=>{const _0x28e54c=_0x899fe9,_0x3214a4=_0xd7e420[_0x28e54c(0x1f7)]();if(!_0x3214a4||_0x3214a4[_0x28e54c(0x1fd)]('#'))return!![];const [_0x1861b8]=_0x3214a4['split']('=');return!_0x1861b8[_0x28e54c(0x1fd)](_0x28e54c(0x1ee));}),_0x1197b4=_0x1d9af4['some'](_0x2ed274=>{const _0x3d0e21=_0x899fe9,_0x35e919=_0x2ed274[_0x3d0e21(0x1f7)]();return _0x35e919&&!_0x35e919[_0x3d0e21(0x1fd)]('#');});if(!_0x1197b4)return unlinkSync(_0x33ff80),!![];return writeFileSync(_0x33ff80,_0x1d9af4['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x569f26){const _0x9b89cb=a41_0x45be,_0x510501=a41_0x4d2422[_0x9b89cb(0x1f1)](getConfigDir(),_0x9b89cb(0x216)+_0x569f26);if(a41_0x51ed9c[_0x9b89cb(0x231)](_0x510501)){validateSecureFilePermissions(_0x510501);try{const _0x1b955c=a41_0x51ed9c['readFileSync'](_0x510501,_0x9b89cb(0x228));return parseEnvFile(_0x1b955c);}catch(_0x393e6d){console['warn'](_0x9b89cb(0x20c)+_0x510501+':\x20'+_0x393e6d);}}const _0x4e3c22=a41_0x4d2422[_0x9b89cb(0x1f1)](getConfigDir(),'profiles',_0x569f26,_0x9b89cb(0x1f2));if(a41_0x51ed9c['existsSync'](_0x4e3c22)){validateSecureFilePermissions(_0x4e3c22);try{const _0x4300ab=a41_0x51ed9c[_0x9b89cb(0x22b)](_0x4e3c22,_0x9b89cb(0x228));return parseEnvFile(_0x4300ab);}catch(_0xac8780){return console[_0x9b89cb(0x226)]('Warning:\x20Failed\x20to\x20load\x20'+_0x4e3c22+':\x20'+_0xac8780),null;}}return null;}function getActiveProfileName(){const _0xf9500=a41_0x45be,_0x138202=a41_0x4d2422['join'](getConfigDir(),_0xf9500(0x21e));if(!a41_0x51ed9c[_0xf9500(0x231)](_0x138202))return null;try{const _0x200fb7=a41_0x51ed9c['readFileSync'](_0x138202,_0xf9500(0x228)),_0x49656d=JSON[_0xf9500(0x203)](_0x200fb7);return _0x49656d[_0xf9500(0x221)]||null;}catch{return null;}}export function saveAPIKey(_0x16ec45,_0x3ea2ea,_0x2f11d3){const _0x228856=a41_0x45be,_0x4c5d6f=getConfigDir(),_0x5f4909=getConfigFilePath(_0x2f11d3);!existsSync(_0x4c5d6f)&&mkdirSync(_0x4c5d6f,{'recursive':!![],'mode':0x1c0});let _0x1aeeec={};if(existsSync(_0x5f4909))try{const _0x3de9d0=readFileSync(_0x5f4909,'utf-8');_0x1aeeec=parseEnvFile(_0x3de9d0);}catch(_0x50c4b7){console[_0x228856(0x226)](_0x228856(0x20d)+_0x5f4909+':',_0x50c4b7);}const _0x597ece=_0x16ec45[_0x228856(0x20b)]()[_0x228856(0x1fc)](/-/g,'_');_0x1aeeec[_0x228856(0x1f8)+_0x597ece]=_0x3ea2ea;const _0x487b0b=Object[_0x228856(0x232)](_0x1aeeec)[_0x228856(0x218)](([_0x289763,_0x29d05d])=>_0x289763+'='+_0x29d05d);writeFileSync(_0x5f4909,_0x487b0b[_0x228856(0x1f1)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x76e3bb,_0x1bdeb4,_0x397c21){const _0xf6bcbe=a41_0x45be;await saveKeychainAPIKey(_0x76e3bb,_0x397c21),setCachedCredential(_0x76e3bb,_0x1bdeb4,_0x397c21);const _0x19b5b5=getConfigFilePath(_0x397c21);cleanupLegacyEnvFile(_0x19b5b5)&&console[_0xf6bcbe(0x226)](a41_0x4caa9c[_0xf6bcbe(0x230)](_0xf6bcbe(0x208)));}export function loadConfig(){const _0x21377e=a41_0x45be,_0x572abc={'apiKeys':{},'defaultSite':_0x21377e(0x20a)},_0x251e74=[_0x21377e(0x20a),_0x21377e(0x219),_0x21377e(0x1f6),'ap02','ap03',_0x21377e(0x212),'dev-eu01',_0x21377e(0x21a),_0x21377e(0x20f),_0x21377e(0x21f)];for(const _0x4edefe of _0x251e74){const _0x135079=getAPIKey(_0x4edefe);_0x135079&&(_0x572abc[_0x21377e(0x222)][_0x4edefe]=_0x135079);}return _0x572abc;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x486d34,_0x71b37d){const _0xd93ae9=a42_0x8e45,_0x72bf7=_0x486d34();while(!![]){try{const _0x54529a=parseInt(_0xd93ae9(0x1c1))/0x1*(parseInt(_0xd93ae9(0x1ca))/0x2)+-parseInt(_0xd93ae9(0x1bd))/0x3*(parseInt(_0xd93ae9(0x1c3))/0x4)+parseInt(_0xd93ae9(0x1c2))/0x5*(parseInt(_0xd93ae9(0x1b9))/0x6)+parseInt(_0xd93ae9(0x1bf))/0x7*(parseInt(_0xd93ae9(0x1cc))/0x8)+-parseInt(_0xd93ae9(0x1ba))/0x9*(-parseInt(_0xd93ae9(0x1c4))/0xa)+parseInt(_0xd93ae9(0x1c0))/0xb*(parseInt(_0xd93ae9(0x1cd))/0xc)+parseInt(_0xd93ae9(0x1bb))/0xd*(-parseInt(_0xd93ae9(0x1cb))/0xe);if(_0x54529a===_0x71b37d)break;else _0x72bf7['push'](_0x72bf7['shift']());}catch(_0xb298d4){_0x72bf7['push'](_0x72bf7['shift']());}}}(a42_0x11c8,0x1e3c2));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a42_0x11c8(){const _0x582724=['set','__default_site__','now','76IpHTAh','6018502jfGEAx','16WVwgZG','48zrgkiB','55578nKrKyK','621BbxkdU','13yqEnkO','delete','130653UboXSs','apiKey','323337HMuimU','606496JYAwUU','4852KrsdQY','15CvPGFf','20cYvsOo','35710MjzlLs','clear','get'];a42_0x11c8=function(){return _0x582724;};return a42_0x11c8();}function getCacheKey(_0x30be8c,_0x48ee7d){const _0x161a68=a42_0x8e45,_0x345cb1=_0x30be8c||_0x161a68(0x1c8),_0x38f37d=_0x48ee7d||'__default_profile__';return _0x345cb1+':'+_0x38f37d;}function a42_0x8e45(_0x8b2b3d,_0x5bbb32){const _0x11c899=a42_0x11c8();return a42_0x8e45=function(_0x8e458,_0xc72a8b){_0x8e458=_0x8e458-0x1b9;let _0x27ed49=_0x11c899[_0x8e458];return _0x27ed49;},a42_0x8e45(_0x8b2b3d,_0x5bbb32);}export function getCachedCredential(_0xe5109b,_0x313f5d){const _0x1595bf=a42_0x8e45,_0x35bc3c=getCacheKey(_0xe5109b,_0x313f5d),_0x211c19=cache[_0x1595bf(0x1c6)](_0x35bc3c);if(!_0x211c19)return null;if(Date[_0x1595bf(0x1c9)]()-_0x211c19['loadedAt']>CACHE_TTL_MS)return cache['delete'](_0x35bc3c),null;return _0x211c19[_0x1595bf(0x1be)];}export function setCachedCredential(_0x16bca5,_0x30faec,_0x15b5c7){const _0x14c8f5=a42_0x8e45,_0x39ebd4=getCacheKey(_0x30faec,_0x15b5c7);cache[_0x14c8f5(0x1c7)](_0x39ebd4,{'apiKey':_0x16bca5,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x1d35f3=a42_0x8e45;cache[_0x1d35f3(0x1c5)]();}export function clearCachedCredential(_0x25d0a0,_0x20de30){const _0x540beb=a42_0x8e45,_0x184f6e=getCacheKey(_0x25d0a0,_0x20de30);cache[_0x540beb(0x1bc)](_0x184f6e);}
|