@treasuredata/tdx 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/engage-api-client.js +1 -1
  6. package/dist/client/http-client.js +1 -1
  7. package/dist/client/llm-api-client.js +1 -1
  8. package/dist/client/rate-limiter.js +1 -1
  9. package/dist/client/td-api-client.js +1 -1
  10. package/dist/client/trino-api-client.js +1 -1
  11. package/dist/client/workflow-client.js +1 -1
  12. package/dist/commands/activations.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/auth-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.d.ts.map +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-command.js.map +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/context-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/job-command.js +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-proxy.js +1 -1
  27. package/dist/commands/parent-segment-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pwd-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segments.js +1 -1
  37. package/dist/commands/show.js +1 -1
  38. package/dist/commands/tables.js +1 -1
  39. package/dist/commands/use-command.js +1 -1
  40. package/dist/commands/workflow-command.js +1 -1
  41. package/dist/core/auth.js +1 -1
  42. package/dist/core/config.js +1 -1
  43. package/dist/core/credential-cache.js +1 -1
  44. package/dist/core/global-context.js +1 -1
  45. package/dist/core/keychain.js +1 -1
  46. package/dist/core/profile.js +1 -1
  47. package/dist/core/project-config.js +1 -1
  48. package/dist/core/session.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/proxy/anthropic-adapter.js +1 -1
  51. package/dist/proxy/server.js +1 -1
  52. package/dist/proxy/session-cache.js +1 -1
  53. package/dist/sdk/api.js +1 -1
  54. package/dist/sdk/engage.js +1 -1
  55. package/dist/sdk/errors.js +1 -1
  56. package/dist/sdk/index.js +1 -1
  57. package/dist/sdk/job.js +1 -1
  58. package/dist/sdk/llm.js +1 -1
  59. package/dist/sdk/query.js +1 -1
  60. package/dist/sdk/segment.js +1 -1
  61. package/dist/sdk/workflow.js +1 -1
  62. package/dist/types/endpoints.js +1 -1
  63. package/dist/types/index.js +1 -1
  64. package/dist/utils/agent-ref-parser.js +1 -1
  65. package/dist/utils/chat-cache.js +1 -1
  66. package/dist/utils/colors.js +1 -1
  67. package/dist/utils/command-output.js +1 -1
  68. package/dist/utils/constants.js +1 -1
  69. package/dist/utils/file-permissions.js +1 -1
  70. package/dist/utils/format-detector.js +1 -1
  71. package/dist/utils/formatters.js +1 -1
  72. package/dist/utils/json-loader.js +1 -1
  73. package/dist/utils/llm-backup-utils.js +1 -1
  74. package/dist/utils/model-aliases.js +1 -1
  75. package/dist/utils/option-validation.js +1 -1
  76. package/dist/utils/port.js +1 -1
  77. package/dist/utils/process.js +1 -1
  78. package/dist/utils/prompt.js +1 -1
  79. package/dist/utils/segment-path-parser.js +1 -1
  80. package/dist/utils/segment-ref-parser.js +1 -1
  81. package/dist/utils/spinner.js +1 -1
  82. package/dist/utils/sql-parser.js +1 -1
  83. package/dist/utils/sse-parser.js +1 -1
  84. package/dist/utils/string-utils.js +1 -1
  85. package/dist/utils/table-ref-parser.js +1 -1
  86. package/dist/utils/tdx-logger.js +1 -1
  87. package/dist/utils/tree-formatter.js +1 -1
  88. package/dist/utils/version-check.js +1 -1
  89. package/dist/utils/workflow-utils.js +1 -1
  90. package/package.json +6 -5
@@ -1 +1 @@
1
- function a31_0x33cd(_0x425ec8,_0x29d04b){const _0xb14919=a31_0xb149();return a31_0x33cd=function(_0x33cd88,_0x2b6c86){_0x33cd88=_0x33cd88-0x125;let _0x2bcc52=_0xb14919[_0x33cd88];return _0x2bcc52;},a31_0x33cd(_0x425ec8,_0x29d04b);}function a31_0xb149(){const _0x18ee8f=['418jYtidj','resolvePathToResource','Error:\x20','Listing\x20parent\x20segments...','cause','execute','listUnified','Building\x20hierarchy\x20tree...','\x20parent\x20segment','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','attributes','includes','maxDepth','listRecursive','test','Current\x20context:\x20','name','sort','4660588nLfWtF','\x27...','Listing\x20folders\x20and\x20segments...','5AVQNdX','segments','jsonl','folder','Resolving\x20context\x20path\x20\x27','\x5c$&','279117iCBbpz','population','4687074gTaqid','verbose','2270317yhgLhF','map','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','segment','json','listParents','message','filter','45ZCpSBJ','\x20segment','\x20and\x20','description','14AYMjIt','417810FLVFQk','(empty)','folderId','length','[parent\x20segments]','data','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','✔\x20Found\x20','dim','segmentPath','Parent\x20ID:\x20','parentId','error','replace','format','No\x20parent\x20segments\x20match\x20pattern:\x20','log','Path/pattern\x20arg:\x20','675815XrtqTB','listParentsWithPattern','\x20matching\x20\x27','2645024DKqokD'];a31_0xb149=function(){return _0x18ee8f;};return a31_0xb149();}const a31_0x3472ad=a31_0x33cd;(function(_0x15a493,_0xa21c5){const _0x1b4bc2=a31_0x33cd,_0xfee7e4=_0x15a493();while(!![]){try{const _0x1006fa=parseInt(_0x1b4bc2(0x139))/0x1+-parseInt(_0x1b4bc2(0x126))/0x2*(parseInt(_0x1b4bc2(0x158))/0x3)+-parseInt(_0x1b4bc2(0x14f))/0x4*(parseInt(_0x1b4bc2(0x152))/0x5)+-parseInt(_0x1b4bc2(0x15a))/0x6+-parseInt(_0x1b4bc2(0x15c))/0x7+-parseInt(_0x1b4bc2(0x13c))/0x8*(-parseInt(_0x1b4bc2(0x164))/0x9)+parseInt(_0x1b4bc2(0x127))/0xa*(parseInt(_0x1b4bc2(0x13d))/0xb);if(_0x1006fa===_0xa21c5)break;else _0xfee7e4['push'](_0xfee7e4['shift']());}catch(_0xce0ba0){_0xfee7e4['push'](_0xfee7e4['shift']());}}}(a31_0xb149,0xf2d8f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a31_0x261bf0 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a31_0x3472ad(0x153);[a31_0x3472ad(0x125)]=a31_0x3472ad(0x12d);async[a31_0x3472ad(0x142)](_0x372984){const _0xdd96a6=a31_0x3472ad,{options:_0x8a8f57,args:_0x1bc63c}=_0x372984,_0x5db954=_0x8a8f57['recursive'],_0x538ab9=_0x1bc63c[0x0];try{const _0xa07db0=_0x8a8f57[_0xdd96a6(0x130)];_0x8a8f57['verbose']&&(console['error']('Site:\x20'+_0x8a8f57['site']),console[_0xdd96a6(0x133)](_0xdd96a6(0x14c)+(_0xa07db0||'/')),_0x538ab9&&console[_0xdd96a6(0x133)](_0xdd96a6(0x138)+_0x538ab9),_0x5db954&&console[_0xdd96a6(0x133)]('Recursive\x20mode:\x20enabled'));if(_0x538ab9){const _0x274171=_0x538ab9[_0xdd96a6(0x148)]('*')||_0x538ab9[_0xdd96a6(0x148)]('?');if(_0x274171&&!_0xa07db0)return await this[_0xdd96a6(0x13a)](_0x372984,_0x538ab9);else return _0x274171?(console[_0xdd96a6(0x133)](_0xdd96a6(0x146)),console[_0xdd96a6(0x133)](_0xdd96a6(0x15e)),0x1):_0x5db954?await this['listRecursive'](_0x372984,_0x538ab9):await this['listUnified'](_0x372984,_0x538ab9);}if(!_0xa07db0)return await this['listParents'](_0x372984);return _0x5db954?await this['listRecursive'](_0x372984,_0xa07db0):await this[_0xdd96a6(0x143)](_0x372984,_0xa07db0);}catch(_0x217071){if(_0x217071 instanceof SDKError)return console[_0xdd96a6(0x133)](_0xdd96a6(0x13f)+_0x217071[_0xdd96a6(0x162)]),_0x217071[_0xdd96a6(0x141)]&&console['error']('\x20\x20Cause:\x20'+_0x217071[_0xdd96a6(0x141)]),0x1;throw _0x217071;}}async[a31_0x3472ad(0x13a)](_0x20abfb,_0x18768e){const _0x4b6c2d=a31_0x3472ad,{options:_0xbce650,tdx:_0x365716}=_0x20abfb,_0xc5c9ad=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x18768e+'\x27...',()=>_0x365716[_0x4b6c2d(0x15f)]['listParents'](),{'verbose':_0xbce650[_0x4b6c2d(0x15b)]}),_0x1a035b=_0xc5c9ad[_0x4b6c2d(0x12c)],_0x45bdf1=_0x18768e[_0x4b6c2d(0x134)](/[.+^${}()|[\]\\]/g,_0x4b6c2d(0x157))[_0x4b6c2d(0x134)](/\*/g,'.*')[_0x4b6c2d(0x134)](/\?/g,'.'),_0x12a79c=new RegExp('^'+_0x45bdf1+'$','i'),_0x112942=_0x1a035b[_0x4b6c2d(0x163)](_0x5222d0=>_0x12a79c[_0x4b6c2d(0x14b)](_0x5222d0[_0x4b6c2d(0x147)]['name']));console[_0x4b6c2d(0x133)](_0x4b6c2d(0x12e)+_0x112942[_0x4b6c2d(0x12a)]+_0x4b6c2d(0x145)+(_0x112942[_0x4b6c2d(0x12a)]!==0x1?'s':'')+_0x4b6c2d(0x13b)+_0x18768e+'\x27');if(_0xbce650[_0x4b6c2d(0x135)]===_0x4b6c2d(0x160)||_0xbce650['format']==='jsonl')await handleSDKOutput(_0x112942,_0xbce650);else{if(_0x112942['length']===0x0)console[_0x4b6c2d(0x137)](_0x4b6c2d(0x136)+_0x18768e);else{console[_0x4b6c2d(0x137)](_0x4b6c2d(0x12b));for(const _0x2d0000 of _0x112942){const _0x40d39e=_0x2d0000[_0x4b6c2d(0x147)][_0x4b6c2d(0x159)]?a31_0x261bf0['dim']('\x20('+formatRows(_0x2d0000[_0x4b6c2d(0x147)][_0x4b6c2d(0x159)])+')'):'';console['log']('👥\x20'+_0x2d0000[_0x4b6c2d(0x147)][_0x4b6c2d(0x14d)]+_0x40d39e);}}}return 0x0;}async['listParents'](_0x42cbfd){const _0x477032=a31_0x3472ad,{options:_0x56f054,tdx:_0x84bb66}=_0x42cbfd,_0x21d847=await withSpinner(_0x477032(0x140),()=>_0x84bb66[_0x477032(0x15f)][_0x477032(0x161)](),{'verbose':_0x56f054[_0x477032(0x15b)]}),_0x4aa04d=_0x21d847[_0x477032(0x12c)];console['error'](_0x477032(0x12e)+_0x4aa04d['length']+_0x477032(0x145)+(_0x4aa04d[_0x477032(0x12a)]!==0x1?'s':''));if(_0x56f054[_0x477032(0x135)]===_0x477032(0x160)||_0x56f054['format']===_0x477032(0x154))await handleSDKOutput(_0x4aa04d,_0x56f054);else{console['log'](_0x477032(0x12b));for(const _0x2a3df0 of _0x4aa04d){const _0x57db37=_0x2a3df0[_0x477032(0x147)]['population']?a31_0x261bf0[_0x477032(0x12f)]('\x20('+formatRows(_0x2a3df0['attributes'][_0x477032(0x159)])+')'):'';console[_0x477032(0x137)]('👥\x20'+_0x2a3df0[_0x477032(0x147)][_0x477032(0x14d)]+_0x57db37);}}return 0x0;}async['listUnified'](_0x20788e,_0xf7d658){const _0x3603d7=a31_0x3472ad,{options:_0x57b762,tdx:_0x3e0eda}=_0x20788e,_0x412206=await withSpinner(_0x3603d7(0x156)+_0xf7d658+'\x27...',()=>_0x3e0eda[_0x3603d7(0x15f)][_0x3603d7(0x13e)](_0xf7d658),{'verbose':_0x57b762[_0x3603d7(0x15b)]}),_0xe0f522=_0x412206[_0x3603d7(0x12c)];_0x57b762[_0x3603d7(0x15b)]&&(console['error'](_0x3603d7(0x131)+_0xe0f522[_0x3603d7(0x132)]),_0xe0f522[_0x3603d7(0x129)]&&console['error']('Folder\x20ID:\x20'+_0xe0f522[_0x3603d7(0x129)]));const _0x40a7e7=await withSpinner(_0x3603d7(0x151),()=>_0x3e0eda[_0x3603d7(0x15f)][_0x3603d7(0x143)](_0xe0f522['parentId'],_0xe0f522[_0x3603d7(0x129)]),{'verbose':_0x57b762[_0x3603d7(0x15b)]}),{folders:_0x5772c5,segments:_0x2c3f5f}=_0x40a7e7[_0x3603d7(0x12c)],_0x186497=_0x5772c5['length']+_0x2c3f5f[_0x3603d7(0x12a)];console[_0x3603d7(0x133)](_0x3603d7(0x12e)+_0x5772c5[_0x3603d7(0x12a)]+'\x20folder'+(_0x5772c5['length']!==0x1?'s':'')+_0x3603d7(0x166)+_0x2c3f5f['length']+_0x3603d7(0x165)+(_0x2c3f5f['length']!==0x1?'s':''));if(_0x57b762[_0x3603d7(0x135)]===_0x3603d7(0x160)||_0x57b762[_0x3603d7(0x135)]===_0x3603d7(0x154)){const _0x41fc78=[..._0x5772c5[_0x3603d7(0x15d)](_0x55f783=>({..._0x55f783,'type':_0x3603d7(0x155)})),..._0x2c3f5f[_0x3603d7(0x15d)](_0x278c15=>({..._0x278c15,'type':_0x3603d7(0x15f)}))][_0x3603d7(0x14e)]((_0x2efc06,_0xbcee2c)=>_0x2efc06[_0x3603d7(0x14d)]['localeCompare'](_0xbcee2c['name']));await handleSDKOutput(_0x41fc78,_0x57b762);}else{if(_0x186497===0x0)console[_0x3603d7(0x137)](a31_0x261bf0[_0x3603d7(0x12f)]('[/'+_0xf7d658+']')),console[_0x3603d7(0x137)](_0x3603d7(0x128));else{console[_0x3603d7(0x137)](a31_0x261bf0[_0x3603d7(0x12f)]('[/'+_0xf7d658+']'));const _0x98613a=formatFlatList(_0x5772c5,_0x2c3f5f,{'showMetadata':!![]});console[_0x3603d7(0x137)](_0x98613a);}}return 0x0;}async[a31_0x3472ad(0x14a)](_0x5b8b79,_0x52f306){const _0xae4b77=a31_0x3472ad,{options:_0x413e16,tdx:_0xd6fa5}=_0x5b8b79,_0x5ce794=await withSpinner(_0xae4b77(0x156)+_0x52f306+_0xae4b77(0x150),()=>_0xd6fa5[_0xae4b77(0x15f)][_0xae4b77(0x13e)](_0x52f306),{'verbose':_0x413e16[_0xae4b77(0x15b)]}),_0x1cccf5=_0x5ce794[_0xae4b77(0x12c)];_0x413e16[_0xae4b77(0x15b)]&&(console[_0xae4b77(0x133)](_0xae4b77(0x131)+_0x1cccf5[_0xae4b77(0x132)]),_0x1cccf5[_0xae4b77(0x129)]&&console['error']('Folder\x20ID:\x20'+_0x1cccf5[_0xae4b77(0x129)]));const _0x562c78=_0x413e16[_0xae4b77(0x149)]||0xa,_0x5b696d=await withSpinner(_0xae4b77(0x144),()=>_0xd6fa5[_0xae4b77(0x15f)]['listRecursive'](_0x1cccf5[_0xae4b77(0x132)],_0x1cccf5[_0xae4b77(0x129)],0x0,_0x562c78),{'verbose':_0x413e16[_0xae4b77(0x15b)]}),_0x43825a=_0x5b696d[_0xae4b77(0x12c)];console[_0xae4b77(0x133)]('✔\x20Built\x20tree\x20with\x20'+_0x43825a[_0xae4b77(0x12a)]+'\x20top-level\x20items');if(_0x413e16[_0xae4b77(0x135)]===_0xae4b77(0x160)||_0x413e16[_0xae4b77(0x135)]===_0xae4b77(0x154))await handleSDKOutput(_0x43825a,_0x413e16);else{console[_0xae4b77(0x137)](a31_0x261bf0[_0xae4b77(0x12f)]('[/'+_0x52f306+']'));const _0x1fb913=formatTree(_0x43825a,{'showMetadata':!![]});console['log'](_0x1fb913);}return 0x0;}}
1
+ const a31_0xd97055=a31_0x58a8;function a31_0x58a8(_0x3e88a8,_0x48d2ff){const _0x1855b1=a31_0x1855();return a31_0x58a8=function(_0x58a8ba,_0x18f779){_0x58a8ba=_0x58a8ba-0x182;let _0x76c2d=_0x1855b1[_0x58a8ba];return _0x76c2d;},a31_0x58a8(_0x3e88a8,_0x48d2ff);}(function(_0x3e3b88,_0x50aa0b){const _0xd412af=a31_0x58a8,_0x4c613a=_0x3e3b88();while(!![]){try{const _0x161b57=parseInt(_0xd412af(0x19a))/0x1*(parseInt(_0xd412af(0x1b8))/0x2)+-parseInt(_0xd412af(0x1b0))/0x3*(parseInt(_0xd412af(0x1b2))/0x4)+-parseInt(_0xd412af(0x1b6))/0x5+parseInt(_0xd412af(0x1bc))/0x6+-parseInt(_0xd412af(0x1a2))/0x7+-parseInt(_0xd412af(0x1a7))/0x8*(-parseInt(_0xd412af(0x18a))/0x9)+parseInt(_0xd412af(0x18f))/0xa;if(_0x161b57===_0x50aa0b)break;else _0x4c613a['push'](_0x4c613a['shift']());}catch(_0x557556){_0x4c613a['push'](_0x4c613a['shift']());}}}(a31_0x1855,0x1edbc));function a31_0x1855(){const _0xc4c1c=['876820kDRsFI','cause','50iitLVk','Error:\x20','dim','length','1083810YbZetU','folder','json','listRecursive','filter','map','[parent\x20segments]','replace','No\x20parent\x20segments\x20match\x20pattern:\x20','👥\x20','parentId','listParentsWithPattern','name','(empty)','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','Recursive\x20mode:\x20enabled','jsonl','531JPrUyQ','listUnified','\x20matching\x20\x27','Parent\x20ID:\x20','\x20and\x20','3607230KfwAhX','error','Folder\x20ID:\x20','\x20parent\x20segment','format','segmentPath','population','Path/pattern\x20arg:\x20','Site:\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','recursive','1726DxEpGq','includes','\x27...','Resolving\x20context\x20path\x20\x27','verbose','sort','segment','resolvePathToResource','1590036wLGihX','data','Building\x20hierarchy\x20tree...','\x20\x20Cause:\x20','site','10448ggZjZP','folderId','listParents','Listing\x20parent\x20segments\x20matching\x20\x27','Current\x20context:\x20','Listing\x20folders\x20and\x20segments...','\x20top-level\x20items','description','maxDepth','132654CzQWkn','attributes','12ouewvr','\x5c$&','test','log'];a31_0x1855=function(){return _0xc4c1c;};return a31_0x1855();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a31_0x41a23c from'chalk';export class SegmentsCommand extends BaseCommand{[a31_0xd97055(0x185)]='segments';[a31_0xd97055(0x1ae)]=a31_0xd97055(0x198);async['execute'](_0x3ca6a6){const _0x4f7238=a31_0xd97055,{options:_0xf65e9c,args:_0x273220}=_0x3ca6a6,_0x5da89b=_0xf65e9c[_0x4f7238(0x199)],_0x3a5b38=_0x273220[0x0];try{const _0x47e89b=_0xf65e9c[_0x4f7238(0x194)];_0xf65e9c[_0x4f7238(0x19e)]&&(console[_0x4f7238(0x190)](_0x4f7238(0x197)+_0xf65e9c[_0x4f7238(0x1a6)]),console[_0x4f7238(0x190)](_0x4f7238(0x1ab)+(_0x47e89b||'/')),_0x3a5b38&&console[_0x4f7238(0x190)](_0x4f7238(0x196)+_0x3a5b38),_0x5da89b&&console['error'](_0x4f7238(0x188)));if(_0x3a5b38){const _0x1aa260=_0x3a5b38[_0x4f7238(0x19b)]('*')||_0x3a5b38[_0x4f7238(0x19b)]('?');if(_0x1aa260&&!_0x47e89b)return await this[_0x4f7238(0x184)](_0x3ca6a6,_0x3a5b38);else return _0x1aa260?(console['error'](_0x4f7238(0x187)),console[_0x4f7238(0x190)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x5da89b?await this[_0x4f7238(0x1bf)](_0x3ca6a6,_0x3a5b38):await this[_0x4f7238(0x18b)](_0x3ca6a6,_0x3a5b38);}if(!_0x47e89b)return await this[_0x4f7238(0x1a9)](_0x3ca6a6);return _0x5da89b?await this[_0x4f7238(0x1bf)](_0x3ca6a6,_0x47e89b):await this[_0x4f7238(0x18b)](_0x3ca6a6,_0x47e89b);}catch(_0x537f2e){if(_0x537f2e instanceof SDKError)return console[_0x4f7238(0x190)](_0x4f7238(0x1b9)+_0x537f2e['message']),_0x537f2e[_0x4f7238(0x1b7)]&&console[_0x4f7238(0x190)](_0x4f7238(0x1a5)+_0x537f2e[_0x4f7238(0x1b7)]),0x1;throw _0x537f2e;}}async[a31_0xd97055(0x184)](_0x2285e4,_0x3f54fb){const _0x80155c=a31_0xd97055,{options:_0x42df97,tdx:_0xcdda5f}=_0x2285e4,_0x24cdd3=await withSpinner(_0x80155c(0x1aa)+_0x3f54fb+_0x80155c(0x19c),()=>_0xcdda5f[_0x80155c(0x1a0)][_0x80155c(0x1a9)](),{'verbose':_0x42df97[_0x80155c(0x19e)]}),_0x3dfc80=_0x24cdd3['data'],_0x257927=_0x3f54fb[_0x80155c(0x1c3)](/[.+^${}()|[\]\\]/g,_0x80155c(0x1b3))[_0x80155c(0x1c3)](/\*/g,'.*')[_0x80155c(0x1c3)](/\?/g,'.'),_0x28a4ab=new RegExp('^'+_0x257927+'$','i'),_0x1ddd8e=_0x3dfc80[_0x80155c(0x1c0)](_0x40a2a8=>_0x28a4ab[_0x80155c(0x1b4)](_0x40a2a8[_0x80155c(0x1b1)][_0x80155c(0x185)]));console[_0x80155c(0x190)]('✔\x20Found\x20'+_0x1ddd8e['length']+_0x80155c(0x192)+(_0x1ddd8e['length']!==0x1?'s':'')+_0x80155c(0x18c)+_0x3f54fb+'\x27');if(_0x42df97[_0x80155c(0x193)]===_0x80155c(0x1be)||_0x42df97[_0x80155c(0x193)]===_0x80155c(0x189))await handleSDKOutput(_0x1ddd8e,_0x42df97);else{if(_0x1ddd8e[_0x80155c(0x1bb)]===0x0)console[_0x80155c(0x1b5)](_0x80155c(0x1c4)+_0x3f54fb);else{console[_0x80155c(0x1b5)](_0x80155c(0x1c2));for(const _0x57caf1 of _0x1ddd8e){const _0x25e006=_0x57caf1[_0x80155c(0x1b1)][_0x80155c(0x195)]?a31_0x41a23c['dim']('\x20('+formatRows(_0x57caf1[_0x80155c(0x1b1)][_0x80155c(0x195)])+')'):'';console[_0x80155c(0x1b5)](_0x80155c(0x182)+_0x57caf1[_0x80155c(0x1b1)][_0x80155c(0x185)]+_0x25e006);}}}return 0x0;}async[a31_0xd97055(0x1a9)](_0x4b4adc){const _0x498916=a31_0xd97055,{options:_0x5b1f21,tdx:_0x48b8ad}=_0x4b4adc,_0x3b33a9=await withSpinner('Listing\x20parent\x20segments...',()=>_0x48b8ad[_0x498916(0x1a0)][_0x498916(0x1a9)](),{'verbose':_0x5b1f21['verbose']}),_0x57fee5=_0x3b33a9[_0x498916(0x1a3)];console[_0x498916(0x190)]('✔\x20Found\x20'+_0x57fee5[_0x498916(0x1bb)]+'\x20parent\x20segment'+(_0x57fee5['length']!==0x1?'s':''));if(_0x5b1f21[_0x498916(0x193)]===_0x498916(0x1be)||_0x5b1f21[_0x498916(0x193)]===_0x498916(0x189))await handleSDKOutput(_0x57fee5,_0x5b1f21);else{console[_0x498916(0x1b5)](_0x498916(0x1c2));for(const _0x4e4a31 of _0x57fee5){const _0x49b110=_0x4e4a31['attributes'][_0x498916(0x195)]?a31_0x41a23c['dim']('\x20('+formatRows(_0x4e4a31[_0x498916(0x1b1)][_0x498916(0x195)])+')'):'';console['log']('👥\x20'+_0x4e4a31['attributes'][_0x498916(0x185)]+_0x49b110);}}return 0x0;}async[a31_0xd97055(0x18b)](_0x333146,_0x455eac){const _0x29792b=a31_0xd97055,{options:_0x9c9087,tdx:_0x267a60}=_0x333146,_0x404f55=await withSpinner(_0x29792b(0x19d)+_0x455eac+_0x29792b(0x19c),()=>_0x267a60[_0x29792b(0x1a0)][_0x29792b(0x1a1)](_0x455eac),{'verbose':_0x9c9087[_0x29792b(0x19e)]}),_0x246628=_0x404f55[_0x29792b(0x1a3)];_0x9c9087['verbose']&&(console[_0x29792b(0x190)](_0x29792b(0x18d)+_0x246628[_0x29792b(0x183)]),_0x246628[_0x29792b(0x1a8)]&&console[_0x29792b(0x190)](_0x29792b(0x191)+_0x246628[_0x29792b(0x1a8)]));const _0x14f7bc=await withSpinner(_0x29792b(0x1ac),()=>_0x267a60[_0x29792b(0x1a0)][_0x29792b(0x18b)](_0x246628[_0x29792b(0x183)],_0x246628[_0x29792b(0x1a8)]),{'verbose':_0x9c9087['verbose']}),{folders:_0x47e2a0,segments:_0x2746bf}=_0x14f7bc['data'],_0x52d044=_0x47e2a0[_0x29792b(0x1bb)]+_0x2746bf[_0x29792b(0x1bb)];console['error']('✔\x20Found\x20'+_0x47e2a0['length']+'\x20folder'+(_0x47e2a0[_0x29792b(0x1bb)]!==0x1?'s':'')+_0x29792b(0x18e)+_0x2746bf['length']+'\x20segment'+(_0x2746bf['length']!==0x1?'s':''));if(_0x9c9087[_0x29792b(0x193)]===_0x29792b(0x1be)||_0x9c9087['format']===_0x29792b(0x189)){const _0x5b3efa=[..._0x47e2a0[_0x29792b(0x1c1)](_0x329cbc=>({..._0x329cbc,'type':_0x29792b(0x1bd)})),..._0x2746bf[_0x29792b(0x1c1)](_0x32b26e=>({..._0x32b26e,'type':_0x29792b(0x1a0)}))][_0x29792b(0x19f)]((_0x3a8cfc,_0x864550)=>_0x3a8cfc[_0x29792b(0x185)]['localeCompare'](_0x864550[_0x29792b(0x185)]));await handleSDKOutput(_0x5b3efa,_0x9c9087);}else{if(_0x52d044===0x0)console[_0x29792b(0x1b5)](a31_0x41a23c[_0x29792b(0x1ba)]('[/'+_0x455eac+']')),console[_0x29792b(0x1b5)](_0x29792b(0x186));else{console[_0x29792b(0x1b5)](a31_0x41a23c[_0x29792b(0x1ba)]('[/'+_0x455eac+']'));const _0x23b43e=formatFlatList(_0x47e2a0,_0x2746bf,{'showMetadata':!![]});console[_0x29792b(0x1b5)](_0x23b43e);}}return 0x0;}async['listRecursive'](_0x1ae084,_0x618895){const _0x35f2be=a31_0xd97055,{options:_0x2bb321,tdx:_0x4ec0b6}=_0x1ae084,_0x17c6ee=await withSpinner(_0x35f2be(0x19d)+_0x618895+'\x27...',()=>_0x4ec0b6['segment']['resolvePathToResource'](_0x618895),{'verbose':_0x2bb321['verbose']}),_0x250cc1=_0x17c6ee[_0x35f2be(0x1a3)];_0x2bb321[_0x35f2be(0x19e)]&&(console[_0x35f2be(0x190)]('Parent\x20ID:\x20'+_0x250cc1[_0x35f2be(0x183)]),_0x250cc1['folderId']&&console[_0x35f2be(0x190)](_0x35f2be(0x191)+_0x250cc1[_0x35f2be(0x1a8)]));const _0x226b93=_0x2bb321[_0x35f2be(0x1af)]||0xa,_0xc26d62=await withSpinner(_0x35f2be(0x1a4),()=>_0x4ec0b6[_0x35f2be(0x1a0)][_0x35f2be(0x1bf)](_0x250cc1['parentId'],_0x250cc1[_0x35f2be(0x1a8)],0x0,_0x226b93),{'verbose':_0x2bb321['verbose']}),_0x26c5c0=_0xc26d62[_0x35f2be(0x1a3)];console[_0x35f2be(0x190)]('✔\x20Built\x20tree\x20with\x20'+_0x26c5c0['length']+_0x35f2be(0x1ad));if(_0x2bb321[_0x35f2be(0x193)]===_0x35f2be(0x1be)||_0x2bb321[_0x35f2be(0x193)]===_0x35f2be(0x189))await handleSDKOutput(_0x26c5c0,_0x2bb321);else{console[_0x35f2be(0x1b5)](a31_0x41a23c[_0x35f2be(0x1ba)]('[/'+_0x618895+']'));const _0x1521a7=formatTree(_0x26c5c0,{'showMetadata':!![]});console[_0x35f2be(0x1b5)](_0x1521a7);}return 0x0;}}
@@ -1 +1 @@
1
- function a32_0x1bff(){const _0x364879=['cause','27007640veiJjq','475846WYMPSO','Database:\x20','Limit:\x20','data','5354503AugtQB','Show\x20table\x20contents','\x20row','database','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>','9thvAKU','868236nJbQxG','6217380XSYMPM','371388iNduVq','error','\x20\x20Cause:\x20','1359017wpnRpn','name','Table:\x20','site','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','table','args','validate','Site:\x20','12cKaVHH','message','...','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','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','verbose','limit'];a32_0x1bff=function(){return _0x364879;};return a32_0x1bff();}const a32_0x3ca521=a32_0x3187;function a32_0x3187(_0x4dc7de,_0x527f7a){const _0x1bff1a=a32_0x1bff();return a32_0x3187=function(_0x318748,_0x3fcc9b){_0x318748=_0x318748-0x155;let _0x1fb040=_0x1bff1a[_0x318748];return _0x1fb040;},a32_0x3187(_0x4dc7de,_0x527f7a);}(function(_0x361cd6,_0x133561){const _0x2e9e23=a32_0x3187,_0x5f84ee=_0x361cd6();while(!![]){try{const _0x15bc15=-parseInt(_0x2e9e23(0x165))/0x1+-parseInt(_0x2e9e23(0x155))/0x2+parseInt(_0x2e9e23(0x16f))/0x3*(parseInt(_0x2e9e23(0x160))/0x4)+-parseInt(_0x2e9e23(0x161))/0x5+parseInt(_0x2e9e23(0x162))/0x6+-parseInt(_0x2e9e23(0x159))/0x7+parseInt(_0x2e9e23(0x179))/0x8*(parseInt(_0x2e9e23(0x15f))/0x9);if(_0x15bc15===_0x133561)break;else _0x5f84ee['push'](_0x5f84ee['shift']());}catch(_0x47cbb8){_0x5f84ee['push'](_0x5f84ee['shift']());}}}(a32_0x1bff,0xab148));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a32_0x3ca521(0x166)]='show';['description']=a32_0x3ca521(0x15a);async['execute'](_0x422a23){return this['showTable'](_0x422a23);}async['showTable'](_0x5597ec){const _0x4b74e8=a32_0x3ca521,{options:_0x168d2e,args:_0x411d81,tdx:_0x4a7367}=_0x5597ec;let _0x332b95;try{_0x332b95=parseTableReference(_0x411d81[0x0]);const _0x87583=_0x168d2e[_0x4b74e8(0x15c)];!_0x332b95[_0x4b74e8(0x15c)]&&_0x87583&&(_0x332b95[_0x4b74e8(0x15c)]=_0x87583);const _0x20cf72=validateTableDescribeReference(_0x332b95);if(_0x20cf72)return console[_0x4b74e8(0x163)](_0x4b74e8(0x16a)+_0x20cf72),console[_0x4b74e8(0x163)](_0x4b74e8(0x15e)),console[_0x4b74e8(0x163)](_0x4b74e8(0x169)),console[_0x4b74e8(0x163)](_0x4b74e8(0x174)),0x1;}catch(_0x48f0a5){return console[_0x4b74e8(0x163)](_0x4b74e8(0x16a)+_0x48f0a5[_0x4b74e8(0x170)]),console[_0x4b74e8(0x163)](_0x4b74e8(0x15e)),console[_0x4b74e8(0x163)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x4b74e8(0x174)),0x1;}const _0x101b07=_0x332b95['catalog'],_0x465ec8=_0x332b95['database'],_0x4a76a3=_0x332b95[_0x4b74e8(0x16b)],_0x9ae95d=resolveLimit(_0x168d2e[_0x4b74e8(0x177)],DEFAULT_DISPLAY_LIMIT);try{_0x168d2e[_0x4b74e8(0x176)]&&(console[_0x4b74e8(0x163)](_0x4b74e8(0x16e)+_0x168d2e[_0x4b74e8(0x168)]),_0x101b07&&console[_0x4b74e8(0x163)]('Catalog:\x20'+_0x101b07),console[_0x4b74e8(0x163)](_0x4b74e8(0x156)+_0x465ec8),console[_0x4b74e8(0x163)](_0x4b74e8(0x167)+_0x4a76a3),console[_0x4b74e8(0x163)](_0x4b74e8(0x157)+_0x9ae95d));const _0x4ab16d=_0x101b07?_0x101b07+'.'+_0x465ec8+'.'+_0x4a76a3:_0x465ec8+'.'+_0x4a76a3,_0x5c8c62=await withSpinner('Querying\x20'+_0x4ab16d+_0x4b74e8(0x171),()=>_0x4a7367['query']['showTable'](_0x465ec8,_0x4a76a3,_0x9ae95d,_0x101b07),{'verbose':_0x168d2e[_0x4b74e8(0x176)]}),_0x326480=_0x5c8c62[_0x4b74e8(0x158)],_0x9a70b9=_0x326480[_0x4b74e8(0x158)];return _0x9a70b9[_0x4b74e8(0x173)]===0x0?console[_0x4b74e8(0x163)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x4b74e8(0x163)]('✔\x20Retrieved\x20'+_0x9a70b9[_0x4b74e8(0x173)]+_0x4b74e8(0x15b)+(_0x9a70b9[_0x4b74e8(0x173)]!==0x1?'s':'')+_0x4b74e8(0x15d)+_0x4ab16d),await handleSDKOutput(_0x9a70b9,_0x168d2e),0x0;}catch(_0x154779){if(_0x154779 instanceof SDKError)return console[_0x4b74e8(0x163)](_0x4b74e8(0x16a)+_0x154779[_0x4b74e8(0x170)]),_0x154779[_0x4b74e8(0x178)]&&console[_0x4b74e8(0x163)](_0x4b74e8(0x164)+_0x154779['cause']),0x1;throw _0x154779;}}[a32_0x3ca521(0x16d)](_0x3a1d3d){const _0x57d7d5=a32_0x3ca521;if(_0x3a1d3d[_0x57d7d5(0x16c)]['length']===0x0)return _0x57d7d5(0x172);if(_0x3a1d3d[_0x57d7d5(0x16c)][_0x57d7d5(0x173)]>0x1)return _0x57d7d5(0x175);return undefined;}}
1
+ const a32_0x4369a2=a32_0x26de;(function(_0x26b078,_0x3deefd){const _0xb969b0=a32_0x26de,_0x9faab5=_0x26b078();while(!![]){try{const _0x165bc0=parseInt(_0xb969b0(0x91))/0x1*(parseInt(_0xb969b0(0x86))/0x2)+-parseInt(_0xb969b0(0xaa))/0x3*(-parseInt(_0xb969b0(0x98))/0x4)+-parseInt(_0xb969b0(0x92))/0x5*(-parseInt(_0xb969b0(0xa7))/0x6)+-parseInt(_0xb969b0(0xa5))/0x7*(-parseInt(_0xb969b0(0x94))/0x8)+parseInt(_0xb969b0(0xab))/0x9+parseInt(_0xb969b0(0xaf))/0xa*(parseInt(_0xb969b0(0xb1))/0xb)+-parseInt(_0xb969b0(0x8f))/0xc;if(_0x165bc0===_0x3deefd)break;else _0x9faab5['push'](_0x9faab5['shift']());}catch(_0x4b6b2d){_0x9faab5['push'](_0x9faab5['shift']());}}}(a32_0x1726,0x62bb4));import{BaseCommand}from'./command.js';function a32_0x1726(){const _0x47f193=['2AVLUxV','\x20row','database','description','Querying\x20','error','Error:\x20','showTable','\x20\x20Cause:\x20','29407848iNyLwD','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','447859HziiJz','15320uctaFR','...','40dyTQdy','Database:\x20','Show\x20table\x20contents','\x20from\x20','8xVLebE','execute','catalog','Usage:\x20tdx\x20show\x20<database.table>','table','cause','validate','message','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','Limit:\x20','verbose','name','✔\x20Retrieved\x20','723219kxubMe','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','1308EZcwVj','query','args','641799MhYQGz','1912203QeKYLK','limit','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','length','3170KaBOEe','Site:\x20','20207QeTdwh'];a32_0x1726=function(){return _0x47f193;};return a32_0x1726();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a32_0x26de(_0xb508cf,_0x2b6296){const _0x17266c=a32_0x1726();return a32_0x26de=function(_0x26de3a,_0x4c8239){_0x26de3a=_0x26de3a-0x86;let _0x3b6153=_0x17266c[_0x26de3a];return _0x3b6153;},a32_0x26de(_0xb508cf,_0x2b6296);}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a32_0x4369a2(0xa3)]='show';[a32_0x4369a2(0x89)]=a32_0x4369a2(0x96);async[a32_0x4369a2(0x99)](_0x46ed5d){const _0x3b63c4=a32_0x4369a2;return this[_0x3b63c4(0x8d)](_0x46ed5d);}async[a32_0x4369a2(0x8d)](_0x3667fa){const _0x31ac7f=a32_0x4369a2,{options:_0x85d008,args:_0x8c210a,tdx:_0x253fa7}=_0x3667fa;let _0x171926;try{_0x171926=parseTableReference(_0x8c210a[0x0]);const _0x874948=_0x85d008[_0x31ac7f(0x88)];!_0x171926[_0x31ac7f(0x88)]&&_0x874948&&(_0x171926[_0x31ac7f(0x88)]=_0x874948);const _0x3d51a4=validateTableDescribeReference(_0x171926);if(_0x3d51a4)return console[_0x31ac7f(0x8b)](_0x31ac7f(0x8c)+_0x3d51a4),console[_0x31ac7f(0x8b)](_0x31ac7f(0x9b)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x31ac7f(0x8b)](_0x31ac7f(0x90)),0x1;}catch(_0x5835f6){return console[_0x31ac7f(0x8b)](_0x31ac7f(0x8c)+_0x5835f6[_0x31ac7f(0x9f)]),console[_0x31ac7f(0x8b)](_0x31ac7f(0x9b)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x31ac7f(0x8b)](_0x31ac7f(0x90)),0x1;}const _0xb5ff7e=_0x171926[_0x31ac7f(0x9a)],_0x50e127=_0x171926['database'],_0x442711=_0x171926[_0x31ac7f(0x9c)],_0x28c708=resolveLimit(_0x85d008[_0x31ac7f(0xac)],DEFAULT_DISPLAY_LIMIT);try{_0x85d008['verbose']&&(console[_0x31ac7f(0x8b)](_0x31ac7f(0xb0)+_0x85d008['site']),_0xb5ff7e&&console[_0x31ac7f(0x8b)]('Catalog:\x20'+_0xb5ff7e),console[_0x31ac7f(0x8b)](_0x31ac7f(0x95)+_0x50e127),console[_0x31ac7f(0x8b)]('Table:\x20'+_0x442711),console['error'](_0x31ac7f(0xa1)+_0x28c708));const _0x41a57b=_0xb5ff7e?_0xb5ff7e+'.'+_0x50e127+'.'+_0x442711:_0x50e127+'.'+_0x442711,_0x1d0396=await withSpinner(_0x31ac7f(0x8a)+_0x41a57b+_0x31ac7f(0x93),()=>_0x253fa7[_0x31ac7f(0xa8)][_0x31ac7f(0x8d)](_0x50e127,_0x442711,_0x28c708,_0xb5ff7e),{'verbose':_0x85d008[_0x31ac7f(0xa2)]}),_0x4af628=_0x1d0396['data'],_0x4da985=_0x4af628['data'];return _0x4da985[_0x31ac7f(0xae)]===0x0?console['error'](_0x31ac7f(0xa6)):console[_0x31ac7f(0x8b)](_0x31ac7f(0xa4)+_0x4da985[_0x31ac7f(0xae)]+_0x31ac7f(0x87)+(_0x4da985['length']!==0x1?'s':'')+_0x31ac7f(0x97)+_0x41a57b),await handleSDKOutput(_0x4da985,_0x85d008),0x0;}catch(_0x58a86e){if(_0x58a86e instanceof SDKError)return console[_0x31ac7f(0x8b)](_0x31ac7f(0x8c)+_0x58a86e['message']),_0x58a86e['cause']&&console[_0x31ac7f(0x8b)](_0x31ac7f(0x8e)+_0x58a86e[_0x31ac7f(0x9d)]),0x1;throw _0x58a86e;}}[a32_0x4369a2(0x9e)](_0x35a648){const _0x378a29=a32_0x4369a2;if(_0x35a648[_0x378a29(0xa9)][_0x378a29(0xae)]===0x0)return _0x378a29(0xa0);if(_0x35a648[_0x378a29(0xa9)][_0x378a29(0xae)]>0x1)return _0x378a29(0xad);return undefined;}}
@@ -1 +1 @@
1
- const a33_0x5ce0e7=a33_0x3834;(function(_0xb365a2,_0x355ec1){const _0x3bf592=a33_0x3834,_0x1630a1=_0xb365a2();while(!![]){try{const _0x7a709f=-parseInt(_0x3bf592(0x116))/0x1*(-parseInt(_0x3bf592(0x137))/0x2)+-parseInt(_0x3bf592(0x111))/0x3*(parseInt(_0x3bf592(0x126))/0x4)+-parseInt(_0x3bf592(0x112))/0x5*(-parseInt(_0x3bf592(0x115))/0x6)+parseInt(_0x3bf592(0x10f))/0x7*(-parseInt(_0x3bf592(0x134))/0x8)+-parseInt(_0x3bf592(0x12c))/0x9*(-parseInt(_0x3bf592(0x113))/0xa)+parseInt(_0x3bf592(0x13c))/0xb*(-parseInt(_0x3bf592(0x12b))/0xc)+parseInt(_0x3bf592(0x118))/0xd;if(_0x7a709f===_0x355ec1)break;else _0x1630a1['push'](_0x1630a1['shift']());}catch(_0x3912f2){_0x1630a1['push'](_0x1630a1['shift']());}}}(a33_0x4a95,0x72f99));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a33_0x4a95(){const _0x1afac9=['\x20table','List\x20tables\x20in\x20a\x20database','Note:\x20\x27','Database\x20pattern:\x20','1293492wJRMYK','Table\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','error','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','815304jvdydV','747450dCRjAs','includes','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','query','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','cause','.*\x22','limit','24uRmYPv','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','name','36AjbRSQ','Site:\x20','listTables','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','55CCVqmv','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','✔\x20Found\x20','445403jchHRt','length','3GfZswQ','1180mlVGUp','50abjKAM','validate','11958psVgfe','14834bUBxeR','execute','2239861DMcmQr','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','table','\x27\x20is\x20ambiguous.','data','database','Error:\x20Pattern\x20\x27','message','Error:\x20','Database:\x20all'];a33_0x4a95=function(){return _0x1afac9;};return a33_0x4a95();}import{withSpinner}from'../utils/spinner.js';function a33_0x3834(_0x4cf22e,_0x76cabf){const _0x4a9591=a33_0x4a95();return a33_0x3834=function(_0x38342a,_0x4c2eb6){_0x38342a=_0x38342a-0x10f;let _0x2d2246=_0x4a9591[_0x38342a];return _0x2d2246;},a33_0x3834(_0x4cf22e,_0x76cabf);}export class TablesCommand extends BaseCommand{[a33_0x5ce0e7(0x136)]='tables';['description']=a33_0x5ce0e7(0x123);async[a33_0x5ce0e7(0x117)](_0x486628){const _0x4589e7=a33_0x5ce0e7,{options:_0x1a41dd,args:_0x33cb9b,tdx:_0x52c051}=_0x486628;let _0x2e29f2;if(_0x33cb9b[_0x4589e7(0x110)]===0x0)_0x2e29f2={'database':undefined,'table':undefined,'original':''};else{if(_0x33cb9b[_0x4589e7(0x110)]===0x1)try{_0x2e29f2=parseTableReference(_0x33cb9b[0x0]);if(_0x2e29f2[_0x4589e7(0x11a)]&&!_0x2e29f2['database']&&!_0x2e29f2[_0x4589e7(0x11a)][_0x4589e7(0x12d)]('*')&&!_0x2e29f2[_0x4589e7(0x11a)][_0x4589e7(0x12d)]('?'))return console[_0x4589e7(0x129)](_0x4589e7(0x11e)+_0x33cb9b[0x0]+_0x4589e7(0x11b)),console[_0x4589e7(0x129)](_0x4589e7(0x135)+_0x2e29f2[_0x4589e7(0x11a)]+'\x27?'),console[_0x4589e7(0x129)](_0x4589e7(0x13a)+_0x2e29f2[_0x4589e7(0x11a)]+_0x4589e7(0x132)),console['error'](_0x4589e7(0x119)+_0x2e29f2[_0x4589e7(0x11a)]),console[_0x4589e7(0x129)](_0x4589e7(0x12a)+_0x2e29f2['table']),console[_0x4589e7(0x129)](''),console[_0x4589e7(0x129)](_0x4589e7(0x124)+_0x33cb9b[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x2e29f2[_0x4589e7(0x11a)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x3d735f){return console[_0x4589e7(0x129)](_0x4589e7(0x120)+_0x3d735f[_0x4589e7(0x11f)]),0x1;}else return console[_0x4589e7(0x129)](_0x4589e7(0x13d)),console['error'](_0x4589e7(0x12e)),console[_0x4589e7(0x129)](_0x4589e7(0x13b)),console[_0x4589e7(0x129)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x4589e7(0x129)](_0x4589e7(0x128)),console[_0x4589e7(0x129)]('Or\x20use\x20--in\x20flag:'),console[_0x4589e7(0x129)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x32971e=_0x1a41dd['database'];!_0x2e29f2[_0x4589e7(0x11d)]&&_0x32971e&&(_0x2e29f2[_0x4589e7(0x11d)]=_0x32971e);try{const _0x437961=_0x310e71=>_0x310e71&&(_0x310e71['includes']('*')||_0x310e71['includes']('?')),_0x2204d2=_0x437961(_0x2e29f2[_0x4589e7(0x11d)]);_0x1a41dd['verbose']&&(console['error'](_0x4589e7(0x138)+_0x1a41dd['site']),_0x2e29f2[_0x4589e7(0x11d)]?_0x2204d2?console[_0x4589e7(0x129)](_0x4589e7(0x125)+_0x2e29f2[_0x4589e7(0x11d)]):console[_0x4589e7(0x129)]('Database:\x20'+_0x2e29f2[_0x4589e7(0x11d)]):console[_0x4589e7(0x129)](_0x4589e7(0x121)),_0x2e29f2[_0x4589e7(0x11a)]&&console[_0x4589e7(0x129)](_0x4589e7(0x127)+_0x2e29f2[_0x4589e7(0x11a)]));const _0x3df4a8=_0x2e29f2['database']&&!_0x2204d2?_0x2e29f2['database']:undefined,_0x7e88c7=_0x2204d2?_0x2e29f2[_0x4589e7(0x11d)]:undefined,_0xd35ece=_0x2e29f2[_0x4589e7(0x11a)],_0x1a76db=resolveLimit(_0x1a41dd[_0x4589e7(0x133)],DEFAULT_LISTING_LIMIT),_0x59d0eb=await withSpinner('Listing\x20tables...',()=>_0x52c051[_0x4589e7(0x12f)][_0x4589e7(0x139)](_0x3df4a8,_0xd35ece,_0x7e88c7,_0x1a76db),{'verbose':_0x1a41dd['verbose']}),_0x498739=_0x59d0eb[_0x4589e7(0x11c)];if(_0x498739[_0x4589e7(0x110)]===0x0&&_0x2e29f2[_0x4589e7(0x11d)]&&!_0x2204d2)return console[_0x4589e7(0x129)]('✖\x20No\x20tables\x20found'),console[_0x4589e7(0x129)]('Database\x20\x27'+_0x2e29f2[_0x4589e7(0x11d)]+_0x4589e7(0x130)),0x1;return console[_0x4589e7(0x129)](_0x4589e7(0x13e)+_0x498739[_0x4589e7(0x110)]+_0x4589e7(0x122)+(_0x498739[_0x4589e7(0x110)]!==0x1?'s':'')),await handleSDKOutput(_0x498739,{..._0x1a41dd,'limit':_0x1a76db}),0x0;}catch(_0x3dd599){if(_0x3dd599 instanceof SDKError)return console['error'](_0x4589e7(0x120)+_0x3dd599[_0x4589e7(0x11f)]),_0x3dd599[_0x4589e7(0x131)]&&console['error']('\x20\x20Cause:\x20'+_0x3dd599['cause']),0x1;throw _0x3dd599;}}[a33_0x5ce0e7(0x114)](_0xb7edf0){return undefined;}}
1
+ const a33_0x86fbad=a33_0x39d6;(function(_0x195541,_0x445c3b){const _0x1375dc=a33_0x39d6,_0x4f98a0=_0x195541();while(!![]){try{const _0x4936b9=-parseInt(_0x1375dc(0x11b))/0x1+parseInt(_0x1375dc(0x120))/0x2*(-parseInt(_0x1375dc(0x12e))/0x3)+-parseInt(_0x1375dc(0x118))/0x4+parseInt(_0x1375dc(0x114))/0x5*(-parseInt(_0x1375dc(0x12f))/0x6)+-parseInt(_0x1375dc(0x122))/0x7+-parseInt(_0x1375dc(0x124))/0x8+parseInt(_0x1375dc(0x109))/0x9;if(_0x4936b9===_0x445c3b)break;else _0x4f98a0['push'](_0x4f98a0['shift']());}catch(_0x406a1c){_0x4f98a0['push'](_0x4f98a0['shift']());}}}(a33_0x4937,0x72f62));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';function a33_0x39d6(_0x4e10b5,_0x3e525e){const _0x493732=a33_0x4937();return a33_0x39d6=function(_0x39d6ba,_0x33479a){_0x39d6ba=_0x39d6ba-0x102;let _0x5af5df=_0x493732[_0x39d6ba];return _0x5af5df;},a33_0x39d6(_0x4e10b5,_0x3e525e);}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a33_0x86fbad(0x10d)]=a33_0x86fbad(0x110);[a33_0x86fbad(0x12d)]=a33_0x86fbad(0x123);async[a33_0x86fbad(0x129)](_0x338d56){const _0xd9b5e4=a33_0x86fbad,{options:_0x1d6e33,args:_0xb7959,tdx:_0x1b72c6}=_0x338d56;let _0x57f4d9;if(_0xb7959[_0xd9b5e4(0x11f)]===0x0)_0x57f4d9={'database':undefined,'table':undefined,'original':''};else{if(_0xb7959['length']===0x1)try{_0x57f4d9=parseTableReference(_0xb7959[0x0]);if(_0x57f4d9[_0xd9b5e4(0x121)]&&!_0x57f4d9[_0xd9b5e4(0x12b)]&&!_0x57f4d9[_0xd9b5e4(0x121)][_0xd9b5e4(0x10b)]('*')&&!_0x57f4d9[_0xd9b5e4(0x121)][_0xd9b5e4(0x10b)]('?'))return console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x10a)+_0xb7959[0x0]+_0xd9b5e4(0x128)),console[_0xd9b5e4(0x10e)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x57f4d9[_0xd9b5e4(0x121)]+'\x27?'),console[_0xd9b5e4(0x10e)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x57f4d9[_0xd9b5e4(0x121)]+_0xd9b5e4(0x102)),console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x104)+_0x57f4d9[_0xd9b5e4(0x121)]),console['error'](_0xd9b5e4(0x125)+_0x57f4d9[_0xd9b5e4(0x121)]),console['error'](''),console[_0xd9b5e4(0x10e)]('Note:\x20\x27'+_0xb7959[0x0]+_0xd9b5e4(0x106)+_0x57f4d9['table']+_0xd9b5e4(0x107)),0x1;}catch(_0x6d427e){return console['error'](_0xd9b5e4(0x130)+_0x6d427e[_0xd9b5e4(0x108)]),0x1;}else return console[_0xd9b5e4(0x10e)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x113)),console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x12a)),console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x126)),console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x10c)),console['error'](_0xd9b5e4(0x111)),console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x119)),0x1;}const _0x807032=_0x1d6e33['database'];!_0x57f4d9[_0xd9b5e4(0x12b)]&&_0x807032&&(_0x57f4d9[_0xd9b5e4(0x12b)]=_0x807032);try{const _0x181656=_0x3f0d9c=>_0x3f0d9c&&(_0x3f0d9c[_0xd9b5e4(0x10b)]('*')||_0x3f0d9c['includes']('?')),_0x4e9d81=_0x181656(_0x57f4d9[_0xd9b5e4(0x12b)]);_0x1d6e33[_0xd9b5e4(0x117)]&&(console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x105)+_0x1d6e33[_0xd9b5e4(0x10f)]),_0x57f4d9['database']?_0x4e9d81?console[_0xd9b5e4(0x10e)]('Database\x20pattern:\x20'+_0x57f4d9[_0xd9b5e4(0x12b)]):console[_0xd9b5e4(0x10e)]('Database:\x20'+_0x57f4d9[_0xd9b5e4(0x12b)]):console[_0xd9b5e4(0x10e)]('Database:\x20all'),_0x57f4d9[_0xd9b5e4(0x121)]&&console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x115)+_0x57f4d9['table']));const _0x51a8c4=_0x57f4d9[_0xd9b5e4(0x12b)]&&!_0x4e9d81?_0x57f4d9[_0xd9b5e4(0x12b)]:undefined,_0x5d70cd=_0x4e9d81?_0x57f4d9['database']:undefined,_0x1a4843=_0x57f4d9['table'],_0x48111d=resolveLimit(_0x1d6e33[_0xd9b5e4(0x103)],DEFAULT_LISTING_LIMIT),_0x55d185=await withSpinner(_0xd9b5e4(0x112),()=>_0x1b72c6['query']['listTables'](_0x51a8c4,_0x1a4843,_0x5d70cd,_0x48111d),{'verbose':_0x1d6e33[_0xd9b5e4(0x117)]}),_0xb0e5af=_0x55d185[_0xd9b5e4(0x116)];if(_0xb0e5af[_0xd9b5e4(0x11f)]===0x0&&_0x57f4d9[_0xd9b5e4(0x12b)]&&!_0x4e9d81)return console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x11a)),console['error'](_0xd9b5e4(0x127)+_0x57f4d9[_0xd9b5e4(0x12b)]+_0xd9b5e4(0x11d)),0x1;return console['error'](_0xd9b5e4(0x12c)+_0xb0e5af[_0xd9b5e4(0x11f)]+'\x20table'+(_0xb0e5af[_0xd9b5e4(0x11f)]!==0x1?'s':'')),await handleSDKOutput(_0xb0e5af,{..._0x1d6e33,'limit':_0x48111d}),0x0;}catch(_0x2a7dd3){if(_0x2a7dd3 instanceof SDKError)return console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x130)+_0x2a7dd3[_0xd9b5e4(0x108)]),_0x2a7dd3['cause']&&console[_0xd9b5e4(0x10e)](_0xd9b5e4(0x11c)+_0x2a7dd3[_0xd9b5e4(0x11e)]),0x1;throw _0x2a7dd3;}}['validate'](_0x5e6508){return undefined;}}function a33_0x4937(){const _0x21e6a9=['\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','5Myalhr','Table\x20pattern:\x20','data','verbose','1847096SpaOSq','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','✖\x20No\x20tables\x20found','581371WsIoZq','\x20\x20Cause:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','cause','length','325546khaJHB','table','5693212cPNuBr','List\x20tables\x20in\x20a\x20database','4282592tJVDog','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Database\x20\x27','\x27\x20is\x20ambiguous.','execute','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','database','✔\x20Found\x20','description','9lohBjZ','2501202kLlUWX','Error:\x20','.*\x22','limit','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Site:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x27\x20across\x20all\x20databases.','message','33910677RRAuHD','Error:\x20Pattern\x20\x27','includes','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','name','error','site','tables','Or\x20use\x20--in\x20flag:','Listing\x20tables...'];a33_0x4937=function(){return _0x21e6a9;};return a33_0x4937();}
@@ -1 +1 @@
1
- function a34_0x4a18(_0x272dbf,_0x3f6dc8){const _0x4290c0=a34_0x4290();return a34_0x4a18=function(_0x4a1823,_0x87e3a6){_0x4a1823=_0x4a1823-0xef;let _0x5411cc=_0x4290c0[_0x4a1823];return _0x5411cc;},a34_0x4a18(_0x272dbf,_0x3f6dc8);}const a34_0x113830=a34_0x4a18;function a34_0x4290(){const _0x59f721=['engage_workspace','use','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','606240xeemvC','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','388258jwhyQH','1cckcJo','Session\x20engage_workspace\x20set\x20to:\x20','416FoBjUF','message','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','llm_project','Session\x20llm_project\x20set\x20to:\x20','Error:\x20','Session\x20parent_segment\x20set\x20to:\x20','includes','Invalid\x20resource:\x20','log','description','273880rHZwHC','name','\x20(session:\x20','database','length','session','1391964zBItga','profile','Session\x20profile\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','Error:\x20Profile\x20\x27','612900bgMLbS','Set\x20session-level\x20context','6430rXDUxh','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','166854QPZQlx','parent_segment','error','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'];a34_0x4290=function(){return _0x59f721;};return a34_0x4290();}(function(_0xd4efb,_0xe2eeab){const _0x4389f6=a34_0x4a18,_0xb76948=_0xd4efb();while(!![]){try{const _0x230c89=parseInt(_0x4389f6(0xfc))/0x1*(parseInt(_0x4389f6(0xfb))/0x2)+parseInt(_0x4389f6(0xf2))/0x3+-parseInt(_0x4389f6(0xfe))/0x4*(parseInt(_0x4389f6(0xf0))/0x5)+-parseInt(_0x4389f6(0xf9))/0x6+parseInt(_0x4389f6(0x110))/0x7+-parseInt(_0x4389f6(0x10a))/0x8+-parseInt(_0x4389f6(0x115))/0x9;if(_0x230c89===_0xe2eeab)break;else _0xb76948['push'](_0xb76948['shift']());}catch(_0x204d62){_0xb76948['push'](_0xb76948['shift']());}}}(a34_0x4290,0x1b378));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a34_0x113830(0x10b)]=a34_0x113830(0xf7);[a34_0x113830(0x109)]=a34_0x113830(0xef);['validate'](_0x310383){const _0x52be40=a34_0x113830,{args:_0x359a5c}=_0x310383;if(_0x359a5c[_0x52be40(0x10e)]<0x2)return _0x52be40(0xf8)+_0x52be40(0x113)+_0x52be40(0xf5)+_0x52be40(0x100);const _0xcdb549=_0x359a5c[0x0],_0x242ca6=[_0x52be40(0x10d),_0x52be40(0xf3),_0x52be40(0x102),'profile',_0x52be40(0xf6)];if(!_0x242ca6[_0x52be40(0x106)](_0xcdb549))return _0x52be40(0x107)+_0xcdb549+'.\x20Must\x20be\x20one\x20of:\x20'+_0x242ca6[_0x52be40(0x101)](',\x20');return undefined;}async['execute'](_0x27760d){const _0x5290b3=a34_0x113830,{args:_0x4819de,options:_0x5677dc}=_0x27760d;try{const _0xa62d5b=_0x4819de[0x0],_0x521477=_0x4819de[0x1];if(_0xa62d5b===_0x5290b3(0x111)){if(!profileExists(_0x521477))return console[_0x5290b3(0xf4)](_0x5290b3(0x114)+_0x521477+'\x27\x20does\x20not\x20exist'),console['error'](_0x5290b3(0xf1)),0x1;const _0x3bd5b5=_0x5677dc[_0x5290b3(0x10f)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x521477},_0x5677dc[_0x5290b3(0x10f)]),console[_0x5290b3(0x108)](_0x5290b3(0x112)+_0x521477+_0x5290b3(0x10c)+_0x3bd5b5+')'),console['log'](_0x5290b3(0xfa)),0x0;}const _0x4bf4a0={},_0x3b4243=_0x5677dc[_0x5290b3(0x10f)]||getCurrentSessionPID()['toString']();switch(_0xa62d5b){case _0x5290b3(0x10d):_0x4bf4a0['database']=_0x521477,console[_0x5290b3(0x108)]('Session\x20database\x20set\x20to:\x20'+_0x521477+_0x5290b3(0x10c)+_0x3b4243+')');break;case'parent_segment':_0x4bf4a0[_0x5290b3(0xf3)]=_0x521477,console[_0x5290b3(0x108)](_0x5290b3(0x105)+_0x521477+_0x5290b3(0x10c)+_0x3b4243+')');break;case _0x5290b3(0x102):_0x4bf4a0[_0x5290b3(0x102)]=_0x521477,console[_0x5290b3(0x108)](_0x5290b3(0x103)+_0x521477+_0x5290b3(0x10c)+_0x3b4243+')');break;case _0x5290b3(0xf6):_0x4bf4a0['engage_workspace']=_0x521477,console['log'](_0x5290b3(0xfd)+_0x521477+'\x20(session:\x20'+_0x3b4243+')');break;}return saveSessionContext(_0x4bf4a0,_0x5677dc[_0x5290b3(0x10f)]),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x41ab0e){return _0x41ab0e instanceof Error&&console[_0x5290b3(0xf4)](_0x5290b3(0x104)+_0x41ab0e[_0x5290b3(0xff)]),0x1;}}}
1
+ const a34_0x5b7cb0=a34_0x5e51;function a34_0x5e51(_0xb60a67,_0x39d419){const _0x247f0e=a34_0x247f();return a34_0x5e51=function(_0x5e51d4,_0x56e27d){_0x5e51d4=_0x5e51d4-0x1b1;let _0x3dd76b=_0x247f0e[_0x5e51d4];return _0x3dd76b;},a34_0x5e51(_0xb60a67,_0x39d419);}(function(_0x17a03b,_0x3578bc){const _0x566e1f=a34_0x5e51,_0x3cb0ab=_0x17a03b();while(!![]){try{const _0x474bbe=parseInt(_0x566e1f(0x1b1))/0x1+parseInt(_0x566e1f(0x1c3))/0x2*(-parseInt(_0x566e1f(0x1cc))/0x3)+-parseInt(_0x566e1f(0x1b7))/0x4+-parseInt(_0x566e1f(0x1b2))/0x5*(-parseInt(_0x566e1f(0x1cd))/0x6)+parseInt(_0x566e1f(0x1b9))/0x7+-parseInt(_0x566e1f(0x1d4))/0x8+-parseInt(_0x566e1f(0x1c0))/0x9;if(_0x474bbe===_0x3578bc)break;else _0x3cb0ab['push'](_0x3cb0ab['shift']());}catch(_0x117956){_0x3cb0ab['push'](_0x3cb0ab['shift']());}}}(a34_0x247f,0x42697));function a34_0x247f(){const _0x40f752=['.\x20Must\x20be\x20one\x20of:\x20','profile','parent_segment','includes','\x20(session:\x20','112644hCNQfk','log','use','43324rGCeKw','Invalid\x20resource:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','\x27\x20does\x20not\x20exist','Session\x20parent_segment\x20set\x20to:\x20','error','toString','message','session','48AafVjw','107598wTSxLa','llm_project','join','database','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage_workspace','execute','230872Vxkrdf','248507SBHtZc','145MIcENL','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','description','Session\x20database\x20set\x20to:\x20','Error:\x20Profile\x20\x27','1164788dtKFfH','name','1278361dZndPX','Set\x20session-level\x20context'];a34_0x247f=function(){return _0x40f752;};return a34_0x247f();}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a34_0x5b7cb0(0x1b8)]=a34_0x5b7cb0(0x1c2);[a34_0x5b7cb0(0x1b4)]=a34_0x5b7cb0(0x1ba);['validate'](_0x743afa){const _0x191c13=a34_0x5b7cb0,{args:_0x2652d}=_0x743afa;if(_0x2652d['length']<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x191c13(0x1c5)+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x481457=_0x2652d[0x0],_0x4a88e3=[_0x191c13(0x1d0),_0x191c13(0x1bd),_0x191c13(0x1ce),_0x191c13(0x1bc),'engage_workspace'];if(!_0x4a88e3[_0x191c13(0x1be)](_0x481457))return _0x191c13(0x1c4)+_0x481457+_0x191c13(0x1bb)+_0x4a88e3[_0x191c13(0x1cf)](',\x20');return undefined;}async[a34_0x5b7cb0(0x1d3)](_0xe6cefa){const _0x527d19=a34_0x5b7cb0,{args:_0x3e3b4d,options:_0xd2c28f}=_0xe6cefa;try{const _0x21df80=_0x3e3b4d[0x0],_0x15c4d9=_0x3e3b4d[0x1];if(_0x21df80===_0x527d19(0x1bc)){if(!profileExists(_0x15c4d9))return console[_0x527d19(0x1c8)](_0x527d19(0x1b6)+_0x15c4d9+_0x527d19(0x1c6)),console[_0x527d19(0x1c8)](_0x527d19(0x1b3)),0x1;const _0x31f10d=_0xd2c28f[_0x527d19(0x1cb)]||getCurrentSessionPID()[_0x527d19(0x1c9)]();return saveSessionContext({'profile':_0x15c4d9},_0xd2c28f[_0x527d19(0x1cb)]),console[_0x527d19(0x1c1)]('Session\x20profile\x20set\x20to:\x20'+_0x15c4d9+'\x20(session:\x20'+_0x31f10d+')'),console[_0x527d19(0x1c1)](_0x527d19(0x1d1)),0x0;}const _0x532068={},_0x9ab737=_0xd2c28f[_0x527d19(0x1cb)]||getCurrentSessionPID()[_0x527d19(0x1c9)]();switch(_0x21df80){case _0x527d19(0x1d0):_0x532068[_0x527d19(0x1d0)]=_0x15c4d9,console['log'](_0x527d19(0x1b5)+_0x15c4d9+_0x527d19(0x1bf)+_0x9ab737+')');break;case _0x527d19(0x1bd):_0x532068[_0x527d19(0x1bd)]=_0x15c4d9,console[_0x527d19(0x1c1)](_0x527d19(0x1c7)+_0x15c4d9+'\x20(session:\x20'+_0x9ab737+')');break;case _0x527d19(0x1ce):_0x532068[_0x527d19(0x1ce)]=_0x15c4d9,console[_0x527d19(0x1c1)]('Session\x20llm_project\x20set\x20to:\x20'+_0x15c4d9+_0x527d19(0x1bf)+_0x9ab737+')');break;case _0x527d19(0x1d2):_0x532068[_0x527d19(0x1d2)]=_0x15c4d9,console['log']('Session\x20engage_workspace\x20set\x20to:\x20'+_0x15c4d9+_0x527d19(0x1bf)+_0x9ab737+')');break;}return saveSessionContext(_0x532068,_0xd2c28f[_0x527d19(0x1cb)]),console[_0x527d19(0x1c1)](_0x527d19(0x1d1)),0x0;}catch(_0x1b209a){return _0x1b209a instanceof Error&&console[_0x527d19(0x1c8)]('Error:\x20'+_0x1b209a[_0x527d19(0x1ca)]),0x1;}}}
@@ -1 +1 @@
1
- const a35_0x20fa8f=a35_0x595c;(function(_0x454bec,_0x5bf8f0){const _0x1f263e=a35_0x595c,_0x1744ef=_0x454bec();while(!![]){try{const _0xb662c1=-parseInt(_0x1f263e(0x105))/0x1+parseInt(_0x1f263e(0x158))/0x2+parseInt(_0x1f263e(0x103))/0x3+-parseInt(_0x1f263e(0x113))/0x4+-parseInt(_0x1f263e(0x162))/0x5*(parseInt(_0x1f263e(0x123))/0x6)+parseInt(_0x1f263e(0x11f))/0x7*(parseInt(_0x1f263e(0x146))/0x8)+parseInt(_0x1f263e(0x17c))/0x9;if(_0xb662c1===_0x5bf8f0)break;else _0x1744ef['push'](_0x1744ef['shift']());}catch(_0xeca878){_0x1744ef['push'](_0x1744ef['shift']());}}}(a35_0x422a,0x72cbb));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';function a35_0x595c(_0x52c162,_0x26491c){const _0x422a2c=a35_0x422a();return a35_0x595c=function(_0x595ccc,_0x1eea62){_0x595ccc=_0x595ccc-0xef;let _0xaa68d4=_0x422a2c[_0x595ccc];return _0xaa68d4;},a35_0x595c(_0x52c162,_0x26491c);}import{formatBytes}from'../utils/formatters.js';import a35_0x1cc267 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a35_0x20fa8f(0x166);[a35_0x20fa8f(0x10a)]='List\x20all\x20workflow\x20projects';async[a35_0x20fa8f(0x149)](_0xef4e9e){const _0x4cbdd4=a35_0x20fa8f,{options:_0x161f09,args:_0x5f54ae,tdx:_0x2b9452}=_0xef4e9e,_0x420064=_0x5f54ae[0x0];try{_0x161f09['verbose']&&_0x420064&&console[_0x4cbdd4(0x130)]('Pattern:\x20'+_0x420064);const _0x5865b7=await withSpinner(_0x4cbdd4(0x120),()=>_0x2b9452[_0x4cbdd4(0x100)][_0x4cbdd4(0x15e)](_0x420064,{'limit':_0x161f09[_0x4cbdd4(0xfe)]}),{'verbose':_0x161f09[_0x4cbdd4(0x12b)]}),_0x16bc88=_0x5865b7[_0x4cbdd4(0x14f)];return console[_0x4cbdd4(0x130)](_0x4cbdd4(0x110)+_0x16bc88['length']+_0x4cbdd4(0x16f)+(_0x16bc88['length']!==0x1?'s':'')),await handleSDKOutput(_0x16bc88,_0x161f09),0x0;}catch(_0x3abb76){if(_0x3abb76 instanceof SDKError)return console[_0x4cbdd4(0x130)](_0x4cbdd4(0x12f)+_0x3abb76[_0x4cbdd4(0x102)]),_0x3abb76[_0x4cbdd4(0x173)]&&console[_0x4cbdd4(0x130)](_0x4cbdd4(0x107)+_0x3abb76['cause']),0x1;throw _0x3abb76;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x127);['description']=a35_0x20fa8f(0x154);async[a35_0x20fa8f(0x149)](_0x13d607){const _0x502803=a35_0x20fa8f,{options:_0x56d3a7,args:_0x385089,tdx:_0x25df7b}=_0x13d607,_0x18a1ec=_0x385089[0x0];try{_0x56d3a7[_0x502803(0x12b)]&&_0x18a1ec&&console[_0x502803(0x130)]('Project\x20filter:\x20'+_0x18a1ec);const _0xc866b=await withSpinner(_0x502803(0x18a),()=>_0x25df7b[_0x502803(0x100)]['workflows'](_0x18a1ec,{'limit':_0x56d3a7['limit']}),{'verbose':_0x56d3a7[_0x502803(0x12b)]}),_0x57c373=_0xc866b[_0x502803(0x14f)];return console[_0x502803(0x130)](_0x502803(0x110)+_0x57c373[_0x502803(0x14c)]+_0x502803(0x187)+(_0x57c373[_0x502803(0x14c)]!==0x1?'s':'')),await handleSDKOutput(_0x57c373,_0x56d3a7),0x0;}catch(_0x15333c){if(_0x15333c instanceof SDKError)return console[_0x502803(0x130)](_0x502803(0x12f)+_0x15333c[_0x502803(0x102)]),_0x15333c[_0x502803(0x173)]&&console['error']('\x20\x20Cause:\x20'+_0x15333c[_0x502803(0x173)]),0x1;throw _0x15333c;}}}export class WorkflowSessionsCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x14a);[a35_0x20fa8f(0x10a)]=a35_0x20fa8f(0x10d);async[a35_0x20fa8f(0x149)](_0x5e6d13){const _0x1cf963=a35_0x20fa8f,{options:_0x2a877b,args:_0x113fba,tdx:_0xc0b026}=_0x5e6d13;let _0x721d0f,_0x2bc1ec;if(_0x113fba[0x0]){const _0x512a57=_0x113fba[0x0][_0x1cf963(0x182)]('.');if(_0x512a57['length']===0x1)_0x721d0f=_0x512a57[0x0];else{if(_0x512a57[_0x1cf963(0x14c)]===0x2)[_0x721d0f,_0x2bc1ec]=_0x512a57;else return console[_0x1cf963(0x130)](_0x1cf963(0x159)),0x1;}}try{if(_0x2a877b[_0x1cf963(0x12b)]){if(_0x721d0f&&_0x2bc1ec)console['error']('Filter:\x20'+_0x721d0f+'.'+_0x2bc1ec);else _0x721d0f&&console[_0x1cf963(0x130)](_0x1cf963(0x138)+_0x721d0f);const _0x4f2b38=_0x2a877b[_0x1cf963(0x18e)];_0x4f2b38&&console['error'](_0x1cf963(0x137)+_0x4f2b38);}const _0x4d1f1c=await withSpinner(_0x1cf963(0x14b),()=>_0xc0b026[_0x1cf963(0x100)][_0x1cf963(0xf7)]({'projectName':_0x721d0f,'workflowName':_0x2bc1ec,'status':_0x2a877b['status'],'fromTime':_0x2a877b[_0x1cf963(0x183)],'toTime':_0x2a877b['to'],'limit':_0x2a877b[_0x1cf963(0xfe)]}),{'verbose':_0x2a877b[_0x1cf963(0x12b)]}),_0x26fc98=_0x4d1f1c[_0x1cf963(0x14f)];return console['error'](_0x1cf963(0x110)+_0x26fc98[_0x1cf963(0x14c)]+_0x1cf963(0x16e)+(_0x26fc98[_0x1cf963(0x14c)]!==0x1?'s':'')),await handleSDKOutput(_0x26fc98,_0x2a877b),0x0;}catch(_0x1f5f68){if(_0x1f5f68 instanceof SDKError)return console['error'](_0x1cf963(0x12f)+_0x1f5f68['message']),_0x1f5f68['cause']&&console['error'](_0x1cf963(0x107)+_0x1f5f68['cause']),0x1;throw _0x1f5f68;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a35_0x20fa8f(0x126);['description']=a35_0x20fa8f(0x16d);async[a35_0x20fa8f(0x149)](_0x1feacf){const _0x18d9b7=a35_0x20fa8f,{options:_0x5c80aa,args:_0x66aef0,tdx:_0x37ec34}=_0x1feacf;let _0x3c18c5,_0x3b6929;if(_0x66aef0[0x0]){const _0x5045ac=_0x66aef0[0x0]['split']('.');if(_0x5045ac[_0x18d9b7(0x14c)]===0x1)_0x3c18c5=_0x5045ac[0x0];else{if(_0x5045ac['length']===0x2)[_0x3c18c5,_0x3b6929]=_0x5045ac;else return console[_0x18d9b7(0x130)](_0x18d9b7(0x159)),0x1;}}try{const _0x35c840=_0x5c80aa[_0x18d9b7(0x109)];if(_0x5c80aa[_0x18d9b7(0x12b)]){if(_0x3c18c5&&_0x3b6929)console[_0x18d9b7(0x130)](_0x18d9b7(0x18c)+_0x3c18c5+'.'+_0x3b6929);else _0x3c18c5&&console[_0x18d9b7(0x130)](_0x18d9b7(0x138)+_0x3c18c5);_0x35c840&&console[_0x18d9b7(0x130)](_0x18d9b7(0x106));}const _0x3e9c91=await withSpinner(_0x18d9b7(0x176),()=>_0x37ec34[_0x18d9b7(0x100)][_0x18d9b7(0x11d)]({'projectName':_0x3c18c5,'workflowName':_0x3b6929,'includeRetried':_0x35c840,'limit':_0x5c80aa[_0x18d9b7(0xfe)]}),{'verbose':_0x5c80aa[_0x18d9b7(0x12b)]}),_0x1bcb22=_0x3e9c91[_0x18d9b7(0x14f)];return console['error']('✔\x20Found\x20'+_0x1bcb22['length']+'\x20attempt'+(_0x1bcb22[_0x18d9b7(0x14c)]!==0x1?'s':'')),await handleSDKOutput(_0x1bcb22,_0x5c80aa),0x0;}catch(_0x2a5d01){if(_0x2a5d01 instanceof SDKError)return console[_0x18d9b7(0x130)](_0x18d9b7(0x12f)+_0x2a5d01[_0x18d9b7(0x102)]),_0x2a5d01[_0x18d9b7(0x173)]&&console[_0x18d9b7(0x130)](_0x18d9b7(0x107)+_0x2a5d01['cause']),0x1;throw _0x2a5d01;}}}export class WorkflowAttemptCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x129);['description']='Show\x20specific\x20attempt\x20details';async[a35_0x20fa8f(0x149)](_0x3a9f63){const _0x44de79=a35_0x20fa8f,{options:_0x27796b,args:_0x566ffe,tdx:_0x342703}=_0x3a9f63,_0x488c42=_0x566ffe[0x0];if(!_0x488c42)return console['error'](_0x44de79(0x170)),0x1;try{_0x27796b[_0x44de79(0x12b)]&&console[_0x44de79(0x130)]('Attempt\x20ID:\x20'+_0x488c42);const _0x7b99d8=await withSpinner(_0x44de79(0x163),()=>_0x342703[_0x44de79(0x100)][_0x44de79(0x114)](_0x488c42),{'verbose':_0x27796b[_0x44de79(0x12b)]}),_0x4ba5f9=_0x7b99d8['data'];let _0x176099;!_0x4ba5f9['done']?_0x176099=_0x4ba5f9[_0x44de79(0xf9)]?_0x44de79(0x17b):_0x44de79(0x11c):_0x176099=_0x4ba5f9[_0x44de79(0x140)]?_0x44de79(0x140):'error';let _0x514fa3;if(_0x4ba5f9[_0x44de79(0x147)]&&_0x4ba5f9[_0x44de79(0x153)]){const _0x17fa75=new Date(_0x4ba5f9[_0x44de79(0x147)])[_0x44de79(0x189)](),_0x59cdc4=new Date(_0x4ba5f9[_0x44de79(0x153)])['getTime']();_0x514fa3=Math[_0x44de79(0xef)]((_0x59cdc4-_0x17fa75)/0x3e8);}const _0x47026e={'attempt_id':_0x4ba5f9['id'],'status':_0x176099,..._0x4ba5f9['index']!==undefined&&{'index':_0x4ba5f9['index']},..._0x4ba5f9[_0x44de79(0xf4)]&&{'project':_0x4ba5f9['project']['name']},..._0x4ba5f9[_0x44de79(0x100)]&&{'workflow':_0x4ba5f9[_0x44de79(0x100)][_0x44de79(0x124)]},..._0x4ba5f9['sessionId']&&{'session_id':_0x4ba5f9[_0x44de79(0xff)]},..._0x4ba5f9[_0x44de79(0x155)]&&{'session_time':_0x4ba5f9[_0x44de79(0x155)]},..._0x4ba5f9[_0x44de79(0x139)]&&{'retry_attempt':_0x4ba5f9['retryAttemptName']},..._0x514fa3!==undefined&&{'duration_sec':_0x514fa3},..._0x4ba5f9[_0x44de79(0x147)]&&{'created_at':_0x4ba5f9['createdAt']},..._0x4ba5f9[_0x44de79(0x153)]&&{'finished_at':_0x4ba5f9[_0x44de79(0x153)]},...Object['keys'](_0x4ba5f9[_0x44de79(0x132)])['length']>0x0&&{'params':_0x4ba5f9['params']}};return await handleSingleObjectOutput(_0x47026e,_0x27796b),0x0;}catch(_0x13fc60){if(_0x13fc60 instanceof SDKError)return console['error'](_0x44de79(0x12f)+_0x13fc60['message']),_0x13fc60['cause']&&console[_0x44de79(0x130)](_0x44de79(0x107)+_0x13fc60[_0x44de79(0x173)]),0x1;throw _0x13fc60;}}}export class WorkflowTasksCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x190);[a35_0x20fa8f(0x10a)]='Show\x20tasks\x20for\x20an\x20attempt';async[a35_0x20fa8f(0x149)](_0x291a3c){const _0x222236=a35_0x20fa8f,{options:_0x3a06ca,args:_0x2474c1,tdx:_0x2a7f88}=_0x291a3c,_0x5c8c97=_0x2474c1[0x0];if(!_0x5c8c97)return console[_0x222236(0x130)](_0x222236(0x170)),0x1;try{const _0x4c4f18=_0x3a06ca[_0x222236(0xf0)];_0x3a06ca['verbose']&&(console[_0x222236(0x130)]('Attempt\x20ID:\x20'+_0x5c8c97),_0x4c4f18&&console[_0x222236(0x130)](_0x222236(0x141)));const _0x7e02fa=await withSpinner(_0x222236(0xf5),()=>_0x2a7f88[_0x222236(0x100)][_0x222236(0x15b)](_0x5c8c97,_0x4c4f18||![]),{'verbose':_0x3a06ca[_0x222236(0x12b)]}),_0x1520d7=_0x7e02fa[_0x222236(0x14f)];return console[_0x222236(0x130)]('✔\x20Found\x20'+_0x1520d7[_0x222236(0x14c)]+_0x222236(0x117)+(_0x1520d7['length']!==0x1?'s':'')),await handleSDKOutput(_0x1520d7,_0x3a06ca),0x0;}catch(_0x1c373a){if(_0x1c373a instanceof SDKError)return console[_0x222236(0x130)](_0x222236(0x12f)+_0x1c373a['message']),_0x1c373a[_0x222236(0x173)]&&console['error'](_0x222236(0x107)+_0x1c373a[_0x222236(0x173)]),0x1;throw _0x1c373a;}}}export class WorkflowLogsCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x112);[a35_0x20fa8f(0x10a)]=a35_0x20fa8f(0x172);async[a35_0x20fa8f(0x149)](_0x3c800e){const _0x4bb1ac=a35_0x20fa8f,{options:_0x70159b,args:_0x1e62ea,tdx:_0x2df84d}=_0x3c800e,_0x2174a2=_0x1e62ea[0x0];let _0x3de448=_0x1e62ea[0x1];if(!_0x2174a2)return console[_0x4bb1ac(0x130)](_0x4bb1ac(0x170)),0x1;try{_0x70159b['verbose']&&(console[_0x4bb1ac(0x130)]('Attempt\x20ID:\x20'+_0x2174a2),_0x3de448&&console[_0x4bb1ac(0x130)]('Task\x20name:\x20'+_0x3de448));const _0xcba0dd=await withSpinner(_0x4bb1ac(0x171),()=>_0x2df84d['workflow'][_0x4bb1ac(0x134)](_0x2174a2,_0x3de448),{'verbose':_0x70159b[_0x4bb1ac(0x12b)]}),_0x54930d=_0xcba0dd[_0x4bb1ac(0x14f)];if(_0x54930d['length']===0x0)return console[_0x4bb1ac(0x130)](_0x4bb1ac(0x118)),0x0;if(!_0x3de448&&(_0x70159b[_0x4bb1ac(0x151)]||_0x70159b[_0x4bb1ac(0x108)]))return await handleSDKOutput(_0x54930d,_0x70159b),0x0;if(!_0x3de448){const _0x342d71=_0x54930d['map'](_0x345d5b=>({'title':_0x345d5b[_0x4bb1ac(0x148)]+'\x20('+formatBytes(_0x345d5b['fileSize'])+')','value':_0x345d5b['taskName']})),_0xc1a6e6=await a35_0x1cc267({'type':_0x4bb1ac(0x133),'name':_0x4bb1ac(0x10f),'message':_0x4bb1ac(0x16b),'choices':_0x342d71});if(!_0xc1a6e6[_0x4bb1ac(0x10f)])return console['error'](_0x4bb1ac(0xfa)),0x0;_0x3de448=_0xc1a6e6[_0x4bb1ac(0x10f)];}const _0x37acf0=await withSpinner('Downloading\x20logs...',()=>_0x2df84d['workflow'][_0x4bb1ac(0x180)](_0x2174a2,_0x3de448),{'verbose':_0x70159b[_0x4bb1ac(0x12b)]}),_0x5d66c1=_0x37acf0[_0x4bb1ac(0x14f)];return _0x5d66c1?console[_0x4bb1ac(0x17e)](_0x5d66c1):console[_0x4bb1ac(0x130)]('No\x20log\x20content\x20found'),0x0;}catch(_0x17b0c6){if(_0x17b0c6 instanceof SDKError)return console['error'](_0x4bb1ac(0x12f)+_0x17b0c6[_0x4bb1ac(0x102)]),_0x17b0c6[_0x4bb1ac(0x173)]&&console[_0x4bb1ac(0x130)]('\x20\x20Cause:\x20'+_0x17b0c6['cause']),0x1;throw _0x17b0c6;}}}export class WorkflowKillCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x17d);[a35_0x20fa8f(0x10a)]=a35_0x20fa8f(0x122);async[a35_0x20fa8f(0x149)](_0x394737){const _0x5ce714=a35_0x20fa8f,{options:_0x36991d,args:_0x2c6107,tdx:_0x3550df}=_0x394737,_0x3a08b2=_0x2c6107[0x0];if(!_0x3a08b2)return console[_0x5ce714(0x130)](_0x5ce714(0x170)),0x1;try{const _0xcc36fd=_0x36991d[_0x5ce714(0x116)];_0x36991d['verbose']&&(console[_0x5ce714(0x130)](_0x5ce714(0x174)+_0x3a08b2),_0xcc36fd&&console[_0x5ce714(0x130)]('Reason:\x20'+_0xcc36fd));if(!_0x36991d[_0x5ce714(0x175)]){const _0x54ea9c=await confirm(_0x5ce714(0xf1)+_0x3a08b2+'?');if(!_0x54ea9c)return console[_0x5ce714(0x130)](_0x5ce714(0xfa)),0x0;}const _0xf8e25=await withSpinner('Killing\x20attempt...',()=>_0x3550df['workflow'][_0x5ce714(0x10e)](_0x3a08b2,_0xcc36fd),{'verbose':_0x36991d[_0x5ce714(0x12b)]}),_0x5f1fb9=_0xf8e25[_0x5ce714(0x14f)];return console[_0x5ce714(0x130)]('✔\x20'+_0x5f1fb9),0x0;}catch(_0x26af0){if(_0x26af0 instanceof SDKError)return console[_0x5ce714(0x130)](_0x5ce714(0x12f)+_0x26af0[_0x5ce714(0x102)]),_0x26af0['cause']&&console[_0x5ce714(0x130)]('\x20\x20Cause:\x20'+_0x26af0['cause']),0x1;throw _0x26af0;}}}export class WorkflowRetryCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x104);[a35_0x20fa8f(0x10a)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x1a6e34){const _0x357ce3=a35_0x20fa8f,{options:_0x12abf2,args:_0x369856,tdx:_0x3a2f53}=_0x1a6e34,_0x5e1891=_0x369856[0x0];if(!_0x5e1891)return console[_0x357ce3(0x130)](_0x357ce3(0x131)),console[_0x357ce3(0x130)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x504143=![],_0x572ea3=_0x5e1891;if(_0x5e1891[_0x357ce3(0x13b)](_0x357ce3(0x144)))_0x504143=!![],_0x572ea3=_0x5e1891['substring'](0x8);else{if(_0x5e1891[_0x357ce3(0x13b)](_0x357ce3(0x150)))_0x504143=![],_0x572ea3=_0x5e1891['substring'](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x357ce3(0x130)](_0x357ce3(0x136)),0x1;}try{const _0x4babee=_0x12abf2[_0x357ce3(0x14e)],_0x52777e=_0x12abf2[_0x357ce3(0x15a)],_0x25d7df=_0x12abf2[_0x357ce3(0x132)],_0x7cf3ed=_0x12abf2[_0x357ce3(0xf6)];_0x12abf2['verbose']&&(console[_0x357ce3(0x130)]('Target:\x20'+(_0x504143?'session':_0x357ce3(0x114))+'\x20'+_0x572ea3),_0x4babee&&console[_0x357ce3(0x130)](_0x357ce3(0x142)+_0x4babee),_0x52777e&&console[_0x357ce3(0x130)](_0x357ce3(0x145)+_0x52777e),_0x25d7df&&console['error'](_0x357ce3(0x178)+_0x25d7df),_0x7cf3ed&&console[_0x357ce3(0x130)](_0x357ce3(0x167)));let _0x374ffc;if(_0x25d7df)try{if(_0x25d7df[_0x357ce3(0x13b)]('@')){const _0x1da13a=await import(_0x357ce3(0xfc)),_0x256088=_0x25d7df['substring'](0x1),_0x93b6f=await _0x1da13a[_0x357ce3(0x160)](_0x256088,_0x357ce3(0x12a));_0x374ffc=JSON['parse'](_0x93b6f);}else _0x374ffc=JSON[_0x357ce3(0x16a)](_0x25d7df);}catch{return console[_0x357ce3(0x130)](_0x357ce3(0x10b)),0x1;}if(!_0x12abf2[_0x357ce3(0x175)]){const _0x4c2e99=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x504143?_0x357ce3(0xfd):'attempt')+'\x20'+_0x572ea3+'?');if(!_0x4c2e99)return console[_0x357ce3(0x130)]('Cancelled'),0x0;}let _0x3c9b87;_0x504143?_0x3c9b87=await withSpinner(_0x357ce3(0x14d),()=>_0x3a2f53[_0x357ce3(0x100)]['retrySession'](_0x572ea3,{'fromTask':_0x4babee,'retryParams':_0x374ffc}),{'verbose':_0x12abf2[_0x357ce3(0x12b)]}):_0x3c9b87=await withSpinner('Retrying\x20attempt...',()=>_0x3a2f53[_0x357ce3(0x100)][_0x357ce3(0x125)](_0x572ea3,{'resumeFrom':_0x52777e,'retryParams':_0x374ffc,'force':_0x7cf3ed}),{'verbose':_0x12abf2[_0x357ce3(0x12b)]});const _0x1ff7b8=_0x3c9b87[_0x357ce3(0x14f)];return console['error'](_0x357ce3(0x179)),console['error'](_0x357ce3(0xf2)+_0x1ff7b8[_0x357ce3(0x121)]),console[_0x357ce3(0x130)](_0x357ce3(0xf8)+_0x1ff7b8[_0x357ce3(0xff)]),0x0;}catch(_0x2e0d54){if(_0x2e0d54 instanceof SDKError)return console[_0x357ce3(0x130)](_0x357ce3(0x12f)+_0x2e0d54[_0x357ce3(0x102)]),_0x2e0d54[_0x357ce3(0x173)]&&console[_0x357ce3(0x130)](_0x357ce3(0x107)+_0x2e0d54[_0x357ce3(0x173)]),0x1;throw _0x2e0d54;}}}export class WorkflowRunCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x12e);[a35_0x20fa8f(0x10a)]=a35_0x20fa8f(0x10c);async['execute'](_0x4f864b){const _0x57e63d=a35_0x20fa8f,{options:_0x3053ab,args:_0x576dae,tdx:_0x24e398}=_0x4f864b,_0xcb3923=_0x576dae[0x0];if(!_0xcb3923)return console['error']('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x57e63d(0x130)](_0x57e63d(0x165)),0x1;const _0x484f5f=_0x3053ab[_0x57e63d(0x111)],_0x410158=_0x3053ab[_0x57e63d(0x155)],_0x148de9={};if(_0x484f5f&&Array[_0x57e63d(0x169)](_0x484f5f))for(const _0x3fa521 of _0x484f5f){const _0x33f4fd=_0x3fa521[_0x57e63d(0x13a)]('=');if(_0x33f4fd===-0x1)return console[_0x57e63d(0x130)](_0x57e63d(0x11e)+_0x3fa521),console[_0x57e63d(0x130)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x51eda9=_0x3fa521[_0x57e63d(0x152)](0x0,_0x33f4fd),_0x1f0cab=_0x3fa521[_0x57e63d(0x152)](_0x33f4fd+0x1);try{_0x148de9[_0x51eda9]=JSON[_0x57e63d(0x16a)](_0x1f0cab);}catch{_0x148de9[_0x51eda9]=_0x1f0cab;}}_0x3053ab[_0x57e63d(0x12b)]&&(console['error'](_0x57e63d(0x101)+_0xcb3923),Object['keys'](_0x148de9)['length']>0x0&&console[_0x57e63d(0x130)](_0x57e63d(0x13d)+JSON[_0x57e63d(0x13f)](_0x148de9)),_0x410158&&console[_0x57e63d(0x130)](_0x57e63d(0x13c)+_0x410158));const _0x3a3154=await withSpinner('Starting\x20workflow\x20run...',()=>_0x24e398['workflow']['run'](_0xcb3923,_0x148de9,{'sessionTime':_0x410158}),{'verbose':_0x3053ab[_0x57e63d(0x12b)]}),_0x289cb6=_0x3a3154['data'];return console[_0x57e63d(0x130)](_0x57e63d(0x11b)),console[_0x57e63d(0x130)](_0x57e63d(0x17f)+_0x289cb6['id']),console[_0x57e63d(0x130)](_0x57e63d(0xf8)+_0x289cb6[_0x57e63d(0xff)]),console[_0x57e63d(0x130)]('\x20\x20Project:\x20'+_0x289cb6[_0x57e63d(0xf4)]?.['name']),console[_0x57e63d(0x130)](_0x57e63d(0x186)+_0x289cb6[_0x57e63d(0x100)]?.[_0x57e63d(0x124)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a35_0x20fa8f(0x124)]=a35_0x20fa8f(0x168);[a35_0x20fa8f(0x10a)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a35_0x20fa8f(0x149)](_0x16529f){const _0x1d64cf=a35_0x20fa8f,{options:_0x8a19ae,args:_0x49c41,tdx:_0x34db01}=_0x16529f,_0x32013d=_0x49c41[0x0],_0x5cdd4b=_0x49c41[0x1]||'.';if(!_0x32013d)return console[_0x1d64cf(0x130)](_0x1d64cf(0x164)),console[_0x1d64cf(0x130)](_0x1d64cf(0x185)),0x1;const _0x4c05c4=_0x8a19ae['revision'];_0x8a19ae['verbose']&&(console['error']('Project:\x20'+_0x32013d),console[_0x1d64cf(0x130)](_0x1d64cf(0x15c)+_0x5cdd4b),_0x4c05c4&&console[_0x1d64cf(0x130)](_0x1d64cf(0x115)+_0x4c05c4));const _0x3d489b=await withSpinner(_0x1d64cf(0x188)+_0x32013d+_0x1d64cf(0x12d),()=>_0x34db01[_0x1d64cf(0x100)]['download'](_0x32013d,_0x5cdd4b,{'revision':_0x4c05c4}),{'verbose':_0x8a19ae['verbose']}),_0x6ac38=_0x3d489b['data'];return console[_0x1d64cf(0x130)]('✔\x20Downloaded\x20'+_0x6ac38[_0x1d64cf(0x156)]),console['error'](_0x1d64cf(0x143)+_0x6ac38['revision']),console[_0x1d64cf(0x130)](_0x1d64cf(0x18b)+_0x6ac38[_0x1d64cf(0x12c)]),console[_0x1d64cf(0x130)]('\x20\x20Location:\x20'+_0x5cdd4b+'/'+_0x6ac38[_0x1d64cf(0x156)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a35_0x20fa8f(0x124)]='workflow:push';[a35_0x20fa8f(0x10a)]=a35_0x20fa8f(0x16c);async[a35_0x20fa8f(0x149)](_0x5baf3f){const _0x1a567c=a35_0x20fa8f,{options:_0x1d7d22,args:_0x1277c7,tdx:_0x381082}=_0x5baf3f;let _0x33af7c='.',_0x2a3331=_0x1d7d22['name'];if(_0x1277c7[0x0]){const {promises:_0x3b1cdc}=await import('fs');try{const _0x593245=await _0x3b1cdc['stat'](_0x1277c7[0x0]);if(_0x593245[_0x1a567c(0x181)]())_0x33af7c=_0x1277c7[0x0];else return console[_0x1a567c(0x130)](_0x1a567c(0x12f)+_0x1277c7[0x0]+_0x1a567c(0x17a)),0x1;}catch{_0x2a3331=_0x1277c7[0x0],_0x33af7c='.';}}const _0x4faf46=_0x1d7d22[_0x1a567c(0x15f)],_0xf0b255=_0x1d7d22[_0x1a567c(0x18d)];_0x1d7d22[_0x1a567c(0x12b)]&&(console[_0x1a567c(0x130)](_0x1a567c(0x177)+_0x33af7c),_0x2a3331&&console[_0x1a567c(0x130)](_0x1a567c(0x135)+_0x2a3331),_0x4faf46&&console[_0x1a567c(0x130)](_0x1a567c(0x115)+_0x4faf46),_0xf0b255&&console['error']('Validation:\x20skipped'));const _0x1a03fb=await withSpinner(_0x1a567c(0x161),()=>_0x381082[_0x1a567c(0x100)]['push'](_0x33af7c,{'projectName':_0x2a3331,'revision':_0x4faf46,'skipValidation':_0xf0b255}),{'verbose':_0x1d7d22[_0x1a567c(0x12b)]}),_0x20a674=_0x1a03fb[_0x1a567c(0x14f)];return console[_0x1a567c(0x130)](_0x1a567c(0x119)+_0x20a674[_0x1a567c(0x156)]),console[_0x1a567c(0x130)](_0x1a567c(0x128)+_0x20a674[_0x1a567c(0x11a)]),console['error'](_0x1a567c(0x143)+_0x20a674[_0x1a567c(0x15f)]),0x0;}}function a35_0x422a(){const _0x2f3d3a=['yes','Listing\x20workflow\x20attempts...','Project\x20directory:\x20','Params:\x20','✔\x20Retry\x20started','\x20is\x20not\x20a\x20directory','canceling','4643802OVRjJC','workflow:kill','log','\x20\x20Attempt\x20ID:\x20','logs','isDirectory','split','from','workflow:delete','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20\x20Workflow:\x20','\x20workflow','Downloading\x20project\x20','getTime','Listing\x20workflows...','\x20\x20Files\x20extracted:\x20','Filter:\x20','skipValidation','status','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflow:tasks','round','includeSubtasks','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20New\x20attempt\x20ID:\x20','Deleting\x20project\x20','project','Getting\x20attempt\x20tasks...','force','sessions','\x20\x20Session\x20ID:\x20','cancelRequested','Cancelled','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','fs/promises','session','limit','sessionId','workflow','Workflow:\x20','message','2371977kClBjs','workflow:retry','633313psHziX','Include\x20retried:\x20yes','\x20\x20Cause:\x20','format','includeRetried','description','Error:\x20Invalid\x20JSON\x20in\x20--params','Start\x20a\x20workflow\x20run','List\x20workflow\x20execution\x20sessions','kill','task','✔\x20Found\x20','param','workflow:logs','3334296DQaous','attempt','Revision:\x20','reason','\x20task','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Pushed\x20','projectId','✔\x20Workflow\x20run\x20started','running','attempts','Error:\x20Invalid\x20parameter\x20format:\x20','7uYLnUl','Listing\x20workflow\x20projects...','attemptId','Kill\x20a\x20running\x20attempt','23118jyxlaC','name','retryAttempt','workflow:attempts','workflow:workflows','\x20\x20Project\x20ID:\x20','workflow:attempt','utf-8','verbose','filesExtracted','...','workflow:run','Error:\x20','error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','params','select','logFiles','Project\x20name:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Status:\x20','Filter:\x20project=','retryAttemptName','indexOf','startsWith','Session\x20time:\x20','Parameters:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','stringify','success','Including\x20subtasks:\x20yes','From\x20task:\x20','\x20\x20Revision:\x20','session:','Resume\x20from:\x20','6861112fZbVsP','createdAt','taskName','execute','workflow:sessions','Listing\x20workflow\x20sessions...','length','Retrying\x20session...','fromTask','data','attempt:','json','substring','finishedAt','List\x20workflows','sessionTime','projectName','Project:\x20','801706hsiHCZ','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','resumeFrom','tasks','Output\x20directory:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','projects','revision','readFile','Pushing\x20workflow\x20project...','815bGiifj','Getting\x20attempt\x20details...','Error:\x20Project\x20name\x20is\x20required','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','workflow:projects','Force:\x20yes','workflow:download','isArray','parse','Select\x20a\x20task\x20to\x20view\x20logs:','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','List\x20workflow\x20attempts','\x20session','\x20project','Error:\x20Attempt\x20ID\x20is\x20required','Fetching\x20log\x20files...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','cause','Attempt\x20ID:\x20'];a35_0x422a=function(){return _0x2f3d3a;};return a35_0x422a();}export class WorkflowDeleteCommand extends BaseCommand{['name']=a35_0x20fa8f(0x184);[a35_0x20fa8f(0x10a)]=a35_0x20fa8f(0x15d);async[a35_0x20fa8f(0x149)](_0x2eae91){const _0x38c91b=a35_0x20fa8f,{options:_0x1a089c,args:_0x5e27bc,tdx:_0x47d377}=_0x2eae91,_0x49d2be=_0x5e27bc[0x0];if(!_0x49d2be)return console[_0x38c91b(0x130)](_0x38c91b(0xfb)),console[_0x38c91b(0x130)](_0x38c91b(0x13e)),0x1;_0x1a089c[_0x38c91b(0x12b)]&&console[_0x38c91b(0x130)](_0x38c91b(0x157)+_0x49d2be);if(!_0x1a089c[_0x38c91b(0x175)]){const _0x4373d8=await confirm(_0x38c91b(0x18f)+_0x49d2be+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x4373d8)return console[_0x38c91b(0x130)](_0x38c91b(0xfa)),0x0;}const _0x3e26fa=await withSpinner(_0x38c91b(0xf3)+_0x49d2be+_0x38c91b(0x12d),()=>_0x47d377[_0x38c91b(0x100)]['delete'](_0x49d2be),{'verbose':_0x1a089c[_0x38c91b(0x12b)]}),_0x368584=_0x3e26fa['data'];return console[_0x38c91b(0x130)]('✔\x20Deleted\x20project\x20'+_0x368584[_0x38c91b(0x156)]),console[_0x38c91b(0x130)](_0x38c91b(0x128)+_0x368584[_0x38c91b(0x11a)]),0x0;}}
1
+ function a35_0xd85e(_0x2fbe9c,_0x51d1a6){const _0x45620f=a35_0x4562();return a35_0xd85e=function(_0xd85efe,_0x3c3a74){_0xd85efe=_0xd85efe-0xb7;let _0x1f9547=_0x45620f[_0xd85efe];return _0x1f9547;},a35_0xd85e(_0x2fbe9c,_0x51d1a6);}const a35_0x41fd43=a35_0xd85e;(function(_0xeea529,_0x2c0eac){const _0x2454b1=a35_0xd85e,_0x3e4050=_0xeea529();while(!![]){try{const _0x2c5558=-parseInt(_0x2454b1(0x11a))/0x1*(parseInt(_0x2454b1(0x131))/0x2)+-parseInt(_0x2454b1(0x153))/0x3+-parseInt(_0x2454b1(0xec))/0x4+-parseInt(_0x2454b1(0x12e))/0x5*(-parseInt(_0x2454b1(0xc7))/0x6)+parseInt(_0x2454b1(0xc5))/0x7+-parseInt(_0x2454b1(0xe0))/0x8+parseInt(_0x2454b1(0x116))/0x9;if(_0x2c5558===_0x2c0eac)break;else _0x3e4050['push'](_0x3e4050['shift']());}catch(_0x21fc1b){_0x3e4050['push'](_0x3e4050['shift']());}}}(a35_0x4562,0x249be));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a35_0x2452eb from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xf1);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xf3);async[a35_0x41fd43(0x10a)](_0x14417d){const _0xa74ae8=a35_0x41fd43,{options:_0x414c3e,args:_0x4bd90f,tdx:_0x248053}=_0x14417d,_0x4395d9=_0x4bd90f[0x0];try{_0x414c3e[_0xa74ae8(0xeb)]&&_0x4395d9&&console['error'](_0xa74ae8(0x133)+_0x4395d9);const _0x143c0e=await withSpinner(_0xa74ae8(0x136),()=>_0x248053['workflow'][_0xa74ae8(0x104)](_0x4395d9,{'limit':_0x414c3e[_0xa74ae8(0x10c)]}),{'verbose':_0x414c3e[_0xa74ae8(0xeb)]}),_0x2b27bd=_0x143c0e[_0xa74ae8(0x113)];return console[_0xa74ae8(0xee)]('✔\x20Found\x20'+_0x2b27bd[_0xa74ae8(0x155)]+_0xa74ae8(0x146)+(_0x2b27bd[_0xa74ae8(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x2b27bd,_0x414c3e),0x0;}catch(_0x4fe018){if(_0x4fe018 instanceof SDKError)return console['error'](_0xa74ae8(0x138)+_0x4fe018[_0xa74ae8(0x119)]),_0x4fe018['cause']&&console[_0xa74ae8(0xee)](_0xa74ae8(0x115)+_0x4fe018['cause']),0x1;throw _0x4fe018;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xca);[a35_0x41fd43(0x137)]='List\x20workflows';async['execute'](_0x1d2436){const _0x4c45e8=a35_0x41fd43,{options:_0x5b19cc,args:_0x5bbe48,tdx:_0x406e07}=_0x1d2436,_0xb8d481=_0x5bbe48[0x0];try{_0x5b19cc[_0x4c45e8(0xeb)]&&_0xb8d481&&console['error']('Project\x20filter:\x20'+_0xb8d481);const _0x4c5854=await withSpinner('Listing\x20workflows...',()=>_0x406e07[_0x4c45e8(0x141)][_0x4c45e8(0x140)](_0xb8d481,{'limit':_0x5b19cc[_0x4c45e8(0x10c)]}),{'verbose':_0x5b19cc['verbose']}),_0x1660ed=_0x4c5854[_0x4c45e8(0x113)];return console[_0x4c45e8(0xee)](_0x4c45e8(0x13a)+_0x1660ed[_0x4c45e8(0x155)]+_0x4c45e8(0xbd)+(_0x1660ed[_0x4c45e8(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x1660ed,_0x5b19cc),0x0;}catch(_0x451f9c){if(_0x451f9c instanceof SDKError)return console[_0x4c45e8(0xee)](_0x4c45e8(0x138)+_0x451f9c[_0x4c45e8(0x119)]),_0x451f9c['cause']&&console[_0x4c45e8(0xee)]('\x20\x20Cause:\x20'+_0x451f9c[_0x4c45e8(0xea)]),0x1;throw _0x451f9c;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a35_0x41fd43(0xbf);[a35_0x41fd43(0x137)]='List\x20workflow\x20execution\x20sessions';async[a35_0x41fd43(0x10a)](_0x2a7226){const _0x5ab1e7=a35_0x41fd43,{options:_0x57da2a,args:_0x44f635,tdx:_0x2bb57a}=_0x2a7226;let _0x33deee,_0x30db47;if(_0x44f635[0x0]){const _0xf926ce=_0x44f635[0x0][_0x5ab1e7(0xf4)]('.');if(_0xf926ce[_0x5ab1e7(0x155)]===0x1)_0x33deee=_0xf926ce[0x0];else{if(_0xf926ce['length']===0x2)[_0x33deee,_0x30db47]=_0xf926ce;else return console[_0x5ab1e7(0xee)](_0x5ab1e7(0x13e)),0x1;}}try{if(_0x57da2a['verbose']){if(_0x33deee&&_0x30db47)console[_0x5ab1e7(0xee)]('Filter:\x20'+_0x33deee+'.'+_0x30db47);else _0x33deee&&console[_0x5ab1e7(0xee)](_0x5ab1e7(0xc3)+_0x33deee);const _0x520ba6=_0x57da2a[_0x5ab1e7(0x12f)];_0x520ba6&&console[_0x5ab1e7(0xee)](_0x5ab1e7(0xb9)+_0x520ba6);}const _0x493de1=await withSpinner(_0x5ab1e7(0xbb),()=>_0x2bb57a[_0x5ab1e7(0x141)][_0x5ab1e7(0xb8)]({'projectName':_0x33deee,'workflowName':_0x30db47,'status':_0x57da2a[_0x5ab1e7(0x12f)],'fromTime':_0x57da2a[_0x5ab1e7(0x11f)],'toTime':_0x57da2a['to'],'limit':_0x57da2a['limit']}),{'verbose':_0x57da2a[_0x5ab1e7(0xeb)]}),_0x3144af=_0x493de1['data'];return console[_0x5ab1e7(0xee)](_0x5ab1e7(0x13a)+_0x3144af[_0x5ab1e7(0x155)]+_0x5ab1e7(0xcc)+(_0x3144af[_0x5ab1e7(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x3144af,_0x57da2a),0x0;}catch(_0x52e663){if(_0x52e663 instanceof SDKError)return console[_0x5ab1e7(0xee)]('Error:\x20'+_0x52e663[_0x5ab1e7(0x119)]),_0x52e663[_0x5ab1e7(0xea)]&&console[_0x5ab1e7(0xee)](_0x5ab1e7(0x115)+_0x52e663[_0x5ab1e7(0xea)]),0x1;throw _0x52e663;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a35_0x41fd43(0x120);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xfb);async[a35_0x41fd43(0x10a)](_0x5ac752){const _0x389a80=a35_0x41fd43,{options:_0xd4591c,args:_0x402cc2,tdx:_0x13375c}=_0x5ac752;let _0x55825b,_0x4db95f;if(_0x402cc2[0x0]){const _0x1cb6f7=_0x402cc2[0x0][_0x389a80(0xf4)]('.');if(_0x1cb6f7[_0x389a80(0x155)]===0x1)_0x55825b=_0x1cb6f7[0x0];else{if(_0x1cb6f7[_0x389a80(0x155)]===0x2)[_0x55825b,_0x4db95f]=_0x1cb6f7;else return console[_0x389a80(0xee)](_0x389a80(0x13e)),0x1;}}try{const _0x482abc=_0xd4591c['includeRetried'];if(_0xd4591c[_0x389a80(0xeb)]){if(_0x55825b&&_0x4db95f)console[_0x389a80(0xee)]('Filter:\x20'+_0x55825b+'.'+_0x4db95f);else _0x55825b&&console[_0x389a80(0xee)](_0x389a80(0xc3)+_0x55825b);_0x482abc&&console['error']('Include\x20retried:\x20yes');}const _0x12f6c3=await withSpinner(_0x389a80(0xf7),()=>_0x13375c[_0x389a80(0x141)]['attempts']({'projectName':_0x55825b,'workflowName':_0x4db95f,'includeRetried':_0x482abc,'limit':_0xd4591c[_0x389a80(0x10c)]}),{'verbose':_0xd4591c[_0x389a80(0xeb)]}),_0x1931f3=_0x12f6c3[_0x389a80(0x113)];return console[_0x389a80(0xee)]('✔\x20Found\x20'+_0x1931f3[_0x389a80(0x155)]+_0x389a80(0x144)+(_0x1931f3[_0x389a80(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x1931f3,_0xd4591c),0x0;}catch(_0x46f8ed){if(_0x46f8ed instanceof SDKError)return console['error'](_0x389a80(0x138)+_0x46f8ed[_0x389a80(0x119)]),_0x46f8ed[_0x389a80(0xea)]&&console[_0x389a80(0xee)](_0x389a80(0x115)+_0x46f8ed[_0x389a80(0xea)]),0x1;throw _0x46f8ed;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a35_0x41fd43(0x10d);[a35_0x41fd43(0x137)]=a35_0x41fd43(0x14a);async['execute'](_0x3df091){const _0x42ad80=a35_0x41fd43,{options:_0x1a28f2,args:_0x2b2220,tdx:_0x57cb6c}=_0x3df091,_0x13cca7=_0x2b2220[0x0];if(!_0x13cca7)return console[_0x42ad80(0xee)](_0x42ad80(0x128)),0x1;try{_0x1a28f2[_0x42ad80(0xeb)]&&console[_0x42ad80(0xee)]('Attempt\x20ID:\x20'+_0x13cca7);const _0x2b53af=await withSpinner(_0x42ad80(0xd2),()=>_0x57cb6c[_0x42ad80(0x141)][_0x42ad80(0x139)](_0x13cca7),{'verbose':_0x1a28f2[_0x42ad80(0xeb)]}),_0x2d33d2=_0x2b53af['data'];let _0x29512a;!_0x2d33d2[_0x42ad80(0x145)]?_0x29512a=_0x2d33d2[_0x42ad80(0x14b)]?_0x42ad80(0xe2):_0x42ad80(0xc4):_0x29512a=_0x2d33d2[_0x42ad80(0xc2)]?_0x42ad80(0xc2):_0x42ad80(0xee);let _0x1bb3d6;if(_0x2d33d2[_0x42ad80(0x14d)]&&_0x2d33d2[_0x42ad80(0xfc)]){const _0x366c0b=new Date(_0x2d33d2[_0x42ad80(0x14d)])[_0x42ad80(0x152)](),_0x340f9b=new Date(_0x2d33d2['finishedAt'])[_0x42ad80(0x152)]();_0x1bb3d6=Math[_0x42ad80(0x112)]((_0x340f9b-_0x366c0b)/0x3e8);}const _0x4c3a38={'attempt_id':_0x2d33d2['id'],'status':_0x29512a,..._0x2d33d2['index']!==undefined&&{'index':_0x2d33d2['index']},..._0x2d33d2[_0x42ad80(0xf5)]&&{'project':_0x2d33d2[_0x42ad80(0xf5)][_0x42ad80(0x123)]},..._0x2d33d2[_0x42ad80(0x141)]&&{'workflow':_0x2d33d2['workflow'][_0x42ad80(0x123)]},..._0x2d33d2[_0x42ad80(0xc9)]&&{'session_id':_0x2d33d2[_0x42ad80(0xc9)]},..._0x2d33d2[_0x42ad80(0x157)]&&{'session_time':_0x2d33d2[_0x42ad80(0x157)]},..._0x2d33d2[_0x42ad80(0xda)]&&{'retry_attempt':_0x2d33d2[_0x42ad80(0xda)]},..._0x1bb3d6!==undefined&&{'duration_sec':_0x1bb3d6},..._0x2d33d2['createdAt']&&{'created_at':_0x2d33d2[_0x42ad80(0x14d)]},..._0x2d33d2[_0x42ad80(0xfc)]&&{'finished_at':_0x2d33d2['finishedAt']},...Object[_0x42ad80(0xd0)](_0x2d33d2[_0x42ad80(0x106)])[_0x42ad80(0x155)]>0x0&&{'params':_0x2d33d2['params']}};return await handleSingleObjectOutput(_0x4c3a38,_0x1a28f2),0x0;}catch(_0x598d88){if(_0x598d88 instanceof SDKError)return console[_0x42ad80(0xee)](_0x42ad80(0x138)+_0x598d88[_0x42ad80(0x119)]),_0x598d88['cause']&&console[_0x42ad80(0xee)](_0x42ad80(0x115)+_0x598d88[_0x42ad80(0xea)]),0x1;throw _0x598d88;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a35_0x41fd43(0xba);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xf8);async[a35_0x41fd43(0x10a)](_0x46681b){const _0x12dc4b=a35_0x41fd43,{options:_0x551d09,args:_0x8c0e22,tdx:_0x2a3ddb}=_0x46681b,_0x22efee=_0x8c0e22[0x0];if(!_0x22efee)return console[_0x12dc4b(0xee)](_0x12dc4b(0x128)),0x1;try{const _0x175f43=_0x551d09[_0x12dc4b(0xb7)];_0x551d09[_0x12dc4b(0xeb)]&&(console[_0x12dc4b(0xee)](_0x12dc4b(0x13d)+_0x22efee),_0x175f43&&console['error'](_0x12dc4b(0xd4)));const _0x26d9ca=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x2a3ddb[_0x12dc4b(0x141)][_0x12dc4b(0x13b)](_0x22efee,_0x175f43||![]),{'verbose':_0x551d09['verbose']}),_0x732d00=_0x26d9ca[_0x12dc4b(0x113)];return console[_0x12dc4b(0xee)](_0x12dc4b(0x13a)+_0x732d00[_0x12dc4b(0x155)]+'\x20task'+(_0x732d00[_0x12dc4b(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x732d00,_0x551d09),0x0;}catch(_0x5af2e7){if(_0x5af2e7 instanceof SDKError)return console[_0x12dc4b(0xee)](_0x12dc4b(0x138)+_0x5af2e7['message']),_0x5af2e7[_0x12dc4b(0xea)]&&console[_0x12dc4b(0xee)](_0x12dc4b(0x115)+_0x5af2e7[_0x12dc4b(0xea)]),0x1;throw _0x5af2e7;}}}export class WorkflowLogsCommand extends BaseCommand{['name']=a35_0x41fd43(0x110);[a35_0x41fd43(0x137)]=a35_0x41fd43(0xf2);async['execute'](_0x18705b){const _0x5adf3f=a35_0x41fd43,{options:_0x5965f1,args:_0x4f506a,tdx:_0x4911c6}=_0x18705b,_0x384acd=_0x4f506a[0x0];let _0x246e6e=_0x4f506a[0x1];if(!_0x384acd)return console['error'](_0x5adf3f(0x128)),0x1;try{_0x5965f1[_0x5adf3f(0xeb)]&&(console[_0x5adf3f(0xee)]('Attempt\x20ID:\x20'+_0x384acd),_0x246e6e&&console[_0x5adf3f(0xee)](_0x5adf3f(0x107)+_0x246e6e));const _0x1cdbdf=await withSpinner(_0x5adf3f(0xd7),()=>_0x4911c6[_0x5adf3f(0x141)]['logFiles'](_0x384acd,_0x246e6e),{'verbose':_0x5965f1['verbose']}),_0x54ef94=_0x1cdbdf['data'];if(_0x54ef94[_0x5adf3f(0x155)]===0x0)return console[_0x5adf3f(0xee)](_0x5adf3f(0xd9)),0x0;if(!_0x246e6e&&(_0x5965f1['json']||_0x5965f1[_0x5adf3f(0xf6)]))return await handleSDKOutput(_0x54ef94,_0x5965f1),0x0;if(!_0x246e6e){const _0x5c4b27=_0x54ef94['map'](_0x3edde3=>({'title':_0x3edde3[_0x5adf3f(0xdd)]+'\x20('+formatBytes(_0x3edde3[_0x5adf3f(0xc6)])+')','value':_0x3edde3[_0x5adf3f(0xdd)]})),_0x23c2ff=await a35_0x2452eb({'type':_0x5adf3f(0x10e),'name':_0x5adf3f(0xfa),'message':_0x5adf3f(0xd1),'choices':_0x5c4b27});if(!_0x23c2ff[_0x5adf3f(0xfa)])return console['error'](_0x5adf3f(0x143)),0x0;_0x246e6e=_0x23c2ff[_0x5adf3f(0xfa)];}const _0x4860c7=await withSpinner(_0x5adf3f(0xd5),()=>_0x4911c6[_0x5adf3f(0x141)][_0x5adf3f(0xbc)](_0x384acd,_0x246e6e),{'verbose':_0x5965f1['verbose']}),_0x53818c=_0x4860c7[_0x5adf3f(0x113)];return _0x53818c?console['log'](_0x53818c):console['error']('No\x20log\x20content\x20found'),0x0;}catch(_0x462c25){if(_0x462c25 instanceof SDKError)return console['error']('Error:\x20'+_0x462c25[_0x5adf3f(0x119)]),_0x462c25[_0x5adf3f(0xea)]&&console[_0x5adf3f(0xee)](_0x5adf3f(0x115)+_0x462c25[_0x5adf3f(0xea)]),0x1;throw _0x462c25;}}}export class WorkflowKillCommand extends BaseCommand{[a35_0x41fd43(0x123)]='workflow:kill';[a35_0x41fd43(0x137)]=a35_0x41fd43(0x15a);async['execute'](_0x1c4af5){const _0x4a077d=a35_0x41fd43,{options:_0x2eb3f0,args:_0x40e023,tdx:_0x345a79}=_0x1c4af5,_0x3842ab=_0x40e023[0x0];if(!_0x3842ab)return console[_0x4a077d(0xee)](_0x4a077d(0x128)),0x1;try{const _0x57b929=_0x2eb3f0[_0x4a077d(0x121)];_0x2eb3f0[_0x4a077d(0xeb)]&&(console[_0x4a077d(0xee)](_0x4a077d(0x13d)+_0x3842ab),_0x57b929&&console[_0x4a077d(0xee)]('Reason:\x20'+_0x57b929));if(!_0x2eb3f0[_0x4a077d(0xfe)]){const _0x25fa3a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3842ab+'?');if(!_0x25fa3a)return console[_0x4a077d(0xee)](_0x4a077d(0x143)),0x0;}const _0x31cfb8=await withSpinner(_0x4a077d(0x13c),()=>_0x345a79[_0x4a077d(0x141)][_0x4a077d(0xf9)](_0x3842ab,_0x57b929),{'verbose':_0x2eb3f0['verbose']}),_0x566e8a=_0x31cfb8['data'];return console[_0x4a077d(0xee)]('✔\x20'+_0x566e8a),0x0;}catch(_0x13ef70){if(_0x13ef70 instanceof SDKError)return console['error'](_0x4a077d(0x138)+_0x13ef70[_0x4a077d(0x119)]),_0x13ef70['cause']&&console[_0x4a077d(0xee)]('\x20\x20Cause:\x20'+_0x13ef70[_0x4a077d(0xea)]),0x1;throw _0x13ef70;}}}export class WorkflowRetryCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xe1);[a35_0x41fd43(0x137)]='Retry\x20a\x20session\x20or\x20attempt';async[a35_0x41fd43(0x10a)](_0x5e82c5){const _0x8d78af=a35_0x41fd43,{options:_0xe87798,args:_0x3addd6,tdx:_0x475c20}=_0x5e82c5,_0x4ac33d=_0x3addd6[0x0];if(!_0x4ac33d)return console[_0x8d78af(0xee)](_0x8d78af(0x11c)),console['error'](_0x8d78af(0x11e)),0x1;let _0x21c4af=![],_0x41073c=_0x4ac33d;if(_0x4ac33d[_0x8d78af(0x12c)]('session:'))_0x21c4af=!![],_0x41073c=_0x4ac33d['substring'](0x8);else{if(_0x4ac33d[_0x8d78af(0x12c)](_0x8d78af(0xed)))_0x21c4af=![],_0x41073c=_0x4ac33d[_0x8d78af(0x11b)](0x8);else return console['error'](_0x8d78af(0x117)),console[_0x8d78af(0xee)](_0x8d78af(0x11e)),0x1;}try{const _0x39c7ec=_0xe87798['fromTask'],_0x75b519=_0xe87798['resumeFrom'],_0x46a9c2=_0xe87798[_0x8d78af(0x106)],_0x163c89=_0xe87798[_0x8d78af(0x118)];_0xe87798[_0x8d78af(0xeb)]&&(console[_0x8d78af(0xee)]('Target:\x20'+(_0x21c4af?_0x8d78af(0x132):_0x8d78af(0x139))+'\x20'+_0x41073c),_0x39c7ec&&console[_0x8d78af(0xee)](_0x8d78af(0x105)+_0x39c7ec),_0x75b519&&console[_0x8d78af(0xee)](_0x8d78af(0xde)+_0x75b519),_0x46a9c2&&console[_0x8d78af(0xee)](_0x8d78af(0xc0)+_0x46a9c2),_0x163c89&&console['error'](_0x8d78af(0x114)));let _0x4d9b6a;if(_0x46a9c2)try{if(_0x46a9c2[_0x8d78af(0x12c)]('@')){const _0x1c9cf6=await import('fs/promises'),_0x55269c=_0x46a9c2[_0x8d78af(0x11b)](0x1),_0x4b24d7=await _0x1c9cf6[_0x8d78af(0xcb)](_0x55269c,_0x8d78af(0x135));_0x4d9b6a=JSON[_0x8d78af(0xc8)](_0x4b24d7);}else _0x4d9b6a=JSON[_0x8d78af(0xc8)](_0x46a9c2);}catch{return console[_0x8d78af(0xee)](_0x8d78af(0x10f)),0x1;}if(!_0xe87798[_0x8d78af(0xfe)]){const _0x188307=await confirm(_0x8d78af(0xd6)+(_0x21c4af?_0x8d78af(0x132):_0x8d78af(0x139))+'\x20'+_0x41073c+'?');if(!_0x188307)return console[_0x8d78af(0xee)](_0x8d78af(0x143)),0x0;}let _0x509180;_0x21c4af?_0x509180=await withSpinner(_0x8d78af(0x14f),()=>_0x475c20['workflow']['retrySession'](_0x41073c,{'fromTask':_0x39c7ec,'retryParams':_0x4d9b6a}),{'verbose':_0xe87798[_0x8d78af(0xeb)]}):_0x509180=await withSpinner(_0x8d78af(0xef),()=>_0x475c20['workflow']['retryAttempt'](_0x41073c,{'resumeFrom':_0x75b519,'retryParams':_0x4d9b6a,'force':_0x163c89}),{'verbose':_0xe87798[_0x8d78af(0xeb)]});const _0x133a87=_0x509180['data'];return console[_0x8d78af(0xee)](_0x8d78af(0x12b)),console['error'](_0x8d78af(0x150)+_0x133a87[_0x8d78af(0xdb)]),console[_0x8d78af(0xee)](_0x8d78af(0xd3)+_0x133a87['sessionId']),0x0;}catch(_0x261e11){if(_0x261e11 instanceof SDKError)return console[_0x8d78af(0xee)](_0x8d78af(0x138)+_0x261e11['message']),_0x261e11[_0x8d78af(0xea)]&&console['error'](_0x8d78af(0x115)+_0x261e11[_0x8d78af(0xea)]),0x1;throw _0x261e11;}}}export class WorkflowRunCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0x127);[a35_0x41fd43(0x137)]='Start\x20a\x20workflow\x20run';async[a35_0x41fd43(0x10a)](_0x35b955){const _0x27b943=a35_0x41fd43,{options:_0x11a5a9,args:_0x2cd433,tdx:_0x375b23}=_0x35b955,_0x38558c=_0x2cd433[0x0];if(!_0x38558c)return console[_0x27b943(0xee)](_0x27b943(0x124)),console['error'](_0x27b943(0x158)),0x1;const _0x1529db=_0x11a5a9[_0x27b943(0xe5)],_0x4ec947=_0x11a5a9[_0x27b943(0x157)],_0x2ea1c1={};if(_0x1529db&&Array[_0x27b943(0x101)](_0x1529db))for(const _0x3eec86 of _0x1529db){const _0x300e18=_0x3eec86['indexOf']('=');if(_0x300e18===-0x1)return console[_0x27b943(0xee)](_0x27b943(0x149)+_0x3eec86),console[_0x27b943(0xee)](_0x27b943(0x130)),0x1;const _0x518dfe=_0x3eec86[_0x27b943(0x11b)](0x0,_0x300e18),_0x43b701=_0x3eec86[_0x27b943(0x11b)](_0x300e18+0x1);try{_0x2ea1c1[_0x518dfe]=JSON[_0x27b943(0xc8)](_0x43b701);}catch{_0x2ea1c1[_0x518dfe]=_0x43b701;}}_0x11a5a9['verbose']&&(console[_0x27b943(0xee)](_0x27b943(0xc1)+_0x38558c),Object[_0x27b943(0xd0)](_0x2ea1c1)[_0x27b943(0x155)]>0x0&&console[_0x27b943(0xee)](_0x27b943(0xf0)+JSON[_0x27b943(0xdf)](_0x2ea1c1)),_0x4ec947&&console['error'](_0x27b943(0xe7)+_0x4ec947));const _0x3e48c5=await withSpinner('Starting\x20workflow\x20run...',()=>_0x375b23['workflow']['run'](_0x38558c,_0x2ea1c1,{'sessionTime':_0x4ec947}),{'verbose':_0x11a5a9[_0x27b943(0xeb)]}),_0x5bba8e=_0x3e48c5[_0x27b943(0x113)];return console[_0x27b943(0xee)](_0x27b943(0x156)),console[_0x27b943(0xee)](_0x27b943(0x100)+_0x5bba8e['id']),console[_0x27b943(0xee)](_0x27b943(0xd3)+_0x5bba8e['sessionId']),console[_0x27b943(0xee)]('\x20\x20Project:\x20'+_0x5bba8e[_0x27b943(0xf5)]?.[_0x27b943(0x123)]),console['error'](_0x27b943(0x125)+_0x5bba8e[_0x27b943(0x141)]?.[_0x27b943(0x123)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xe4);[a35_0x41fd43(0x137)]=a35_0x41fd43(0x147);async[a35_0x41fd43(0x10a)](_0x55cb9c){const _0x167d72=a35_0x41fd43,{options:_0x4eb352,args:_0x4a64c2,tdx:_0x4d278f}=_0x55cb9c,_0x4f91a1=_0x4a64c2[0x0],_0x1d1e40=_0x4a64c2[0x1]||'.';if(!_0x4f91a1)return console[_0x167d72(0xee)](_0x167d72(0x151)),console[_0x167d72(0xee)](_0x167d72(0x111)),0x1;const _0xabe1dc=_0x4eb352['revision'];_0x4eb352['verbose']&&(console[_0x167d72(0xee)](_0x167d72(0x102)+_0x4f91a1),console['error']('Output\x20directory:\x20'+_0x1d1e40),_0xabe1dc&&console[_0x167d72(0xee)](_0x167d72(0x13f)+_0xabe1dc));const _0x12aa90=await withSpinner(_0x167d72(0x108)+_0x4f91a1+_0x167d72(0x10b),()=>_0x4d278f[_0x167d72(0x141)]['download'](_0x4f91a1,_0x1d1e40,{'revision':_0xabe1dc}),{'verbose':_0x4eb352[_0x167d72(0xeb)]}),_0x1b3382=_0x12aa90[_0x167d72(0x113)];return console[_0x167d72(0xee)](_0x167d72(0xe9)+_0x1b3382[_0x167d72(0x134)]),console['error'](_0x167d72(0x159)+_0x1b3382['revision']),console[_0x167d72(0xee)](_0x167d72(0xe8)+_0x1b3382[_0x167d72(0x154)]),console['error'](_0x167d72(0x126)+_0x1d1e40+'/'+_0x1b3382[_0x167d72(0x134)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0xe3);[a35_0x41fd43(0x137)]=a35_0x41fd43(0x12a);async[a35_0x41fd43(0x10a)](_0x4e6781){const _0x451e73=a35_0x41fd43,{options:_0x40ef3f,args:_0x2dcbc7,tdx:_0x5b7f31}=_0x4e6781;let _0x118651='.',_0x4e44c6=_0x40ef3f[_0x451e73(0x123)];if(_0x2dcbc7[0x0]){const {promises:_0x3bc404}=await import('fs');try{const _0x172cd6=await _0x3bc404['stat'](_0x2dcbc7[0x0]);if(_0x172cd6[_0x451e73(0xd8)]())_0x118651=_0x2dcbc7[0x0];else return console[_0x451e73(0xee)](_0x451e73(0x138)+_0x2dcbc7[0x0]+_0x451e73(0x14c)),0x1;}catch{_0x4e44c6=_0x2dcbc7[0x0],_0x118651='.';}}const _0x2a173a=_0x40ef3f['revision'],_0x356465=_0x40ef3f[_0x451e73(0xfd)];_0x40ef3f[_0x451e73(0xeb)]&&(console[_0x451e73(0xee)](_0x451e73(0xff)+_0x118651),_0x4e44c6&&console[_0x451e73(0xee)](_0x451e73(0xcf)+_0x4e44c6),_0x2a173a&&console[_0x451e73(0xee)](_0x451e73(0x13f)+_0x2a173a),_0x356465&&console['error'](_0x451e73(0x14e)));const _0x93a8c3=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x5b7f31[_0x451e73(0x141)][_0x451e73(0x148)](_0x118651,{'projectName':_0x4e44c6,'revision':_0x2a173a,'skipValidation':_0x356465}),{'verbose':_0x40ef3f[_0x451e73(0xeb)]}),_0x1b29b7=_0x93a8c3['data'];return console[_0x451e73(0xee)](_0x451e73(0xbe)+_0x1b29b7['projectName']),console[_0x451e73(0xee)](_0x451e73(0x11d)+_0x1b29b7['projectId']),console[_0x451e73(0xee)](_0x451e73(0x159)+_0x1b29b7[_0x451e73(0xe6)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a35_0x41fd43(0x123)]=a35_0x41fd43(0x103);[a35_0x41fd43(0x137)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a35_0x41fd43(0x10a)](_0x328ecd){const _0x2ea9eb=a35_0x41fd43,{options:_0x18e573,args:_0x5822d7,tdx:_0x127b27}=_0x328ecd,_0x2b8b1a=_0x5822d7[0x0];if(!_0x2b8b1a)return console['error'](_0x2ea9eb(0x129)),console[_0x2ea9eb(0xee)](_0x2ea9eb(0x12d)),0x1;_0x18e573[_0x2ea9eb(0xeb)]&&console[_0x2ea9eb(0xee)](_0x2ea9eb(0x102)+_0x2b8b1a);if(!_0x18e573[_0x2ea9eb(0xfe)]){const _0x3c15ff=await confirm(_0x2ea9eb(0x142)+_0x2b8b1a+_0x2ea9eb(0x109));if(!_0x3c15ff)return console[_0x2ea9eb(0xee)]('Cancelled'),0x0;}const _0x36d1c9=await withSpinner(_0x2ea9eb(0x122)+_0x2b8b1a+_0x2ea9eb(0x10b),()=>_0x127b27[_0x2ea9eb(0x141)][_0x2ea9eb(0xce)](_0x2b8b1a),{'verbose':_0x18e573[_0x2ea9eb(0xeb)]}),_0x3cbd4a=_0x36d1c9[_0x2ea9eb(0x113)];return console['error'](_0x2ea9eb(0xcd)+_0x3cbd4a[_0x2ea9eb(0x134)]),console[_0x2ea9eb(0xee)](_0x2ea9eb(0x11d)+_0x3cbd4a[_0x2ea9eb(0xdc)]),0x0;}}function a35_0x4562(){const _0x3ed161=['running','1631672XnlltT','fileSize','39372XQWKgP','parse','sessionId','workflow:workflows','readFile','\x20session','✔\x20Deleted\x20project\x20','delete','Project\x20name:\x20','keys','Select\x20a\x20task\x20to\x20view\x20logs:','Getting\x20attempt\x20details...','\x20\x20Session\x20ID:\x20','Including\x20subtasks:\x20yes','Downloading\x20logs...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Fetching\x20log\x20files...','isDirectory','No\x20log\x20files\x20found\x20for\x20this\x20attempt','retryAttemptName','attemptId','projectId','taskName','Resume\x20from:\x20','stringify','2362512UEnQuI','workflow:retry','canceling','workflow:push','workflow:download','param','revision','Session\x20time:\x20','\x20\x20Files\x20extracted:\x20','✔\x20Downloaded\x20','cause','verbose','321932EPBVdP','attempt:','error','Retrying\x20attempt...','Parameters:\x20','workflow:projects','Show\x20logs\x20for\x20a\x20workflow\x20attempt','List\x20all\x20workflow\x20projects','split','project','format','Listing\x20workflow\x20attempts...','Show\x20tasks\x20for\x20an\x20attempt','kill','task','List\x20workflow\x20attempts','finishedAt','skipValidation','yes','Project\x20directory:\x20','\x20\x20Attempt\x20ID:\x20','isArray','Project:\x20','workflow:delete','projects','From\x20task:\x20','params','Task\x20name:\x20','Downloading\x20project\x20','\x22?\x20This\x20cannot\x20be\x20undone.','execute','...','limit','workflow:attempt','select','Error:\x20Invalid\x20JSON\x20in\x20--params','workflow:logs','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','round','data','Force:\x20yes','\x20\x20Cause:\x20','3177405KGqqNV','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','force','message','60068oJhSzR','substring','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Project\x20ID:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','from','workflow:attempts','reason','Deleting\x20project\x20','name','Error:\x20Workflow\x20identifier\x20is\x20required','\x20\x20Workflow:\x20','\x20\x20Location:\x20','workflow:run','Error:\x20Attempt\x20ID\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','✔\x20Retry\x20started','startsWith','Usage:\x20workflow:delete\x20<project-name-or-id>','125QplUSo','status','Expected\x20format:\x20--param\x20key=value','6CdlSjP','session','Pattern:\x20','projectName','utf-8','Listing\x20workflow\x20projects...','description','Error:\x20','attempt','✔\x20Found\x20','tasks','Killing\x20attempt...','Attempt\x20ID:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Revision:\x20','workflows','workflow','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Cancelled','\x20attempt','done','\x20project','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','push','Error:\x20Invalid\x20parameter\x20format:\x20','Show\x20specific\x20attempt\x20details','cancelRequested','\x20is\x20not\x20a\x20directory','createdAt','Validation:\x20skipped','Retrying\x20session...','\x20\x20New\x20attempt\x20ID:\x20','Error:\x20Project\x20name\x20is\x20required','getTime','132720lwjUqG','filesExtracted','length','✔\x20Workflow\x20run\x20started','sessionTime','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','\x20\x20Revision:\x20','Kill\x20a\x20running\x20attempt','includeSubtasks','sessions','Status:\x20','workflow:tasks','Listing\x20workflow\x20sessions...','logs','\x20workflow','✔\x20Pushed\x20','workflow:sessions','Params:\x20','Workflow:\x20','success','Filter:\x20project='];a35_0x4562=function(){return _0x3ed161;};return a35_0x4562();}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5d1725,_0x2deedd){const _0x557e46=a36_0x4605,_0x31221b=_0x5d1725();while(!![]){try{const _0x4fb2c7=parseInt(_0x557e46(0xa1))/0x1*(parseInt(_0x557e46(0x9d))/0x2)+-parseInt(_0x557e46(0x92))/0x3+-parseInt(_0x557e46(0xa0))/0x4*(parseInt(_0x557e46(0x8a))/0x5)+-parseInt(_0x557e46(0x8b))/0x6*(-parseInt(_0x557e46(0x8d))/0x7)+parseInt(_0x557e46(0x93))/0x8+parseInt(_0x557e46(0x9a))/0x9*(-parseInt(_0x557e46(0x91))/0xa)+parseInt(_0x557e46(0x97))/0xb*(parseInt(_0x557e46(0x9f))/0xc);if(_0x4fb2c7===_0x2deedd)break;else _0x31221b['push'](_0x31221b['shift']());}catch(_0x45b0b4){_0x31221b['push'](_0x31221b['shift']());}}}(a36_0x264c,0xd2643));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x42323a=a36_0x4605;try{const _0x23c785=fileURLToPath(import.meta[_0x42323a(0x9c)]),_0x35577d=dirname(_0x23c785),_0xf49962=join(_0x35577d,_0x42323a(0x8e)),_0x505ef5=JSON[_0x42323a(0x8c)](readFileSync(_0xf49962,_0x42323a(0x90)));return _0x505ef5[_0x42323a(0x94)];}catch{return _0x42323a(0x8f);}}export function getUserAgent(){const _0x3132e1=a36_0x4605,_0x118ad1=getVersion(),_0x18e943=platform(),_0x283f5b=process['version'][_0x3132e1(0x95)]('v','');return'tdx/'+_0x118ad1+'\x20('+_0x18e943+_0x3132e1(0x96)+_0x283f5b+')';}function a36_0x4605(_0x1ea302,_0x36263f){const _0x264c96=a36_0x264c();return a36_0x4605=function(_0x460573,_0x24c699){_0x460573=_0x460573-0x8a;let _0x47b31b=_0x264c96[_0x460573];return _0x47b31b;},a36_0x4605(_0x1ea302,_0x36263f);}export function getAuthHeaders(_0x4453a2,_0xeb4db9){const _0x1f3c58=a36_0x4605,_0xab07db=getVersion(),_0x3feccd={'User-Agent':getUserAgent(),'X-TD-Client':_0x1f3c58(0xa2),'X-TD-Client-Version':_0xab07db};return _0xeb4db9&&(_0x3feccd[_0x1f3c58(0x99)]=_0x1f3c58(0x9e)+_0xeb4db9),_0x3feccd;}export function toHeaderRecord(_0x411e72){const _0x3293ef=a36_0x4605,_0x5e5f2a={};for(const [_0x349c7c,_0x5abf41]of Object[_0x3293ef(0x9b)](_0x411e72)){_0x5abf41!==undefined&&(_0x5e5f2a[_0x349c7c]=_0x5abf41);}return _0x5e5f2a;}function a36_0x264c(){const _0x4ef541=['276532PZgVWu','1267835nqhwbo','tdx','65wsGDWD','13854bpWohm','parse','1015UiOCWw','../../package.json','0.0.0','utf-8','1423700zjHrPg','3359220eCCqnF','200464JjUUqt','version','replace',';\x20node/','2992yTOSzJ','length','Authorization','45yzDYya','entries','url','2fzVvsv','TD1\x20','86664ryFKxI'];a36_0x264c=function(){return _0x4ef541;};return a36_0x264c();}export function getTrinoHeaders(_0x4c62fe,_0x2b8ae9){const _0x3a6421=a36_0x4605,_0x5938f7=getAuthHeaders(_0x4c62fe,_0x2b8ae9),_0x1c567a=toHeaderRecord(_0x5938f7);return delete _0x1c567a[_0x3a6421(0x99)],_0x2b8ae9&&(_0x1c567a['X-Trino-User']=_0x2b8ae9),_0x1c567a;}export function hasAPIKey(_0x59d55f){const _0x360b27=a36_0x4605,_0x2bec5e=getAPIKey(_0x59d55f);return _0x2bec5e!==undefined&&_0x2bec5e[_0x360b27(0x98)]>0x0;}
1
+ (function(_0x38d6b3,_0x2427b1){const _0x26fde7=a36_0x19fc,_0x259832=_0x38d6b3();while(!![]){try{const _0xb190d6=parseInt(_0x26fde7(0x1e2))/0x1*(-parseInt(_0x26fde7(0x1de))/0x2)+parseInt(_0x26fde7(0x1e7))/0x3*(-parseInt(_0x26fde7(0x1e8))/0x4)+parseInt(_0x26fde7(0x1ea))/0x5*(-parseInt(_0x26fde7(0x1e3))/0x6)+parseInt(_0x26fde7(0x1e5))/0x7*(parseInt(_0x26fde7(0x1e6))/0x8)+-parseInt(_0x26fde7(0x1dd))/0x9+-parseInt(_0x26fde7(0x1e0))/0xa*(parseInt(_0x26fde7(0x1f0))/0xb)+parseInt(_0x26fde7(0x1f2))/0xc;if(_0xb190d6===_0x2427b1)break;else _0x259832['push'](_0x259832['shift']());}catch(_0x2572c6){_0x259832['push'](_0x259832['shift']());}}}(a36_0x4759,0x31964));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a36_0x19fc(_0x14a4a7,_0x456d6c){const _0x475912=a36_0x4759();return a36_0x19fc=function(_0x19fcd2,_0x190f23){_0x19fcd2=_0x19fcd2-0x1dd;let _0x4a903=_0x475912[_0x19fcd2];return _0x4a903;},a36_0x19fc(_0x14a4a7,_0x456d6c);}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x3d5c37=a36_0x19fc;try{const _0x331f18=fileURLToPath(import.meta[_0x3d5c37(0x1f1)]),_0x5d47a5=dirname(_0x331f18),_0x438fd1=join(_0x5d47a5,_0x3d5c37(0x1e1)),_0x11247f=JSON[_0x3d5c37(0x1ef)](readFileSync(_0x438fd1,_0x3d5c37(0x1ee)));return _0x11247f[_0x3d5c37(0x1ed)];}catch{return _0x3d5c37(0x1ec);}}export function getUserAgent(){const _0x1c511b=a36_0x19fc,_0x4f1f4f=getVersion(),_0x1cde20=platform(),_0x336999=process[_0x1c511b(0x1ed)][_0x1c511b(0x1e4)]('v','');return'tdx/'+_0x4f1f4f+'\x20('+_0x1cde20+_0x1c511b(0x1eb)+_0x336999+')';}export function getAuthHeaders(_0x1f7591,_0x56c5cc){const _0x2a146b=a36_0x19fc,_0x56e82a=getVersion(),_0x10d1a1={'User-Agent':getUserAgent(),'X-TD-Client':_0x2a146b(0x1df),'X-TD-Client-Version':_0x56e82a};return _0x56c5cc&&(_0x10d1a1['Authorization']='TD1\x20'+_0x56c5cc),_0x10d1a1;}export function toHeaderRecord(_0x3519d2){const _0x580c93={};for(const [_0x1fc78e,_0x2ea899]of Object['entries'](_0x3519d2)){_0x2ea899!==undefined&&(_0x580c93[_0x1fc78e]=_0x2ea899);}return _0x580c93;}export function getTrinoHeaders(_0x2df430,_0x47f706){const _0x326570=a36_0x19fc,_0x48a403=getAuthHeaders(_0x2df430,_0x47f706),_0x1a4ab2=toHeaderRecord(_0x48a403);return delete _0x1a4ab2[_0x326570(0x1e9)],_0x47f706&&(_0x1a4ab2['X-Trino-User']=_0x47f706),_0x1a4ab2;}function a36_0x4759(){const _0x872816=['tdx','206430zTqlek','../../package.json','5btFNwb','6zpsDYM','replace','7kJPsIv','955432TKEyFr','3dPGfbf','72104dlVArv','Authorization','1075565RDyWun',';\x20node/','0.0.0','version','utf-8','parse','121saSSGv','url','13246308eMQNEY','2919177jioFAW','94246dtrEvx'];a36_0x4759=function(){return _0x872816;};return a36_0x4759();}export function hasAPIKey(_0x23bc36){const _0x3ef867=getAPIKey(_0x23bc36);return _0x3ef867!==undefined&&_0x3ef867['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x390a99,_0x333ec8){const _0x1465ac=a37_0x2176,_0x1bb99b=_0x390a99();while(!![]){try{const _0x5263fc=-parseInt(_0x1465ac(0x1e9))/0x1+-parseInt(_0x1465ac(0x203))/0x2+parseInt(_0x1465ac(0x1fe))/0x3*(parseInt(_0x1465ac(0x1e8))/0x4)+-parseInt(_0x1465ac(0x1f9))/0x5*(-parseInt(_0x1465ac(0x211))/0x6)+parseInt(_0x1465ac(0x214))/0x7*(-parseInt(_0x1465ac(0x1f7))/0x8)+parseInt(_0x1465ac(0x1ef))/0x9+parseInt(_0x1465ac(0x209))/0xa;if(_0x5263fc===_0x333ec8)break;else _0x1bb99b['push'](_0x1bb99b['shift']());}catch(_0x257e6a){_0x1bb99b['push'](_0x1bb99b['shift']());}}}(a37_0x1bc6,0x8219c));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a37_0x1aefaf from'node:fs';import*as a37_0x2bcb39 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 a37_0x711bed from'chalk';export function getConfigDir(){const _0x14bb6e=a37_0x2176;return process[_0x14bb6e(0x205)]['TDX_CONFIG_DIR']||join(homedir(),_0x14bb6e(0x20e),_0x14bb6e(0x215));}export function getConfigFile(){const _0x34d773=a37_0x2176;return join(getConfigDir(),_0x34d773(0x20f));}export function getConfigFilePath(_0x4fd3ab){const _0x5de132=a37_0x2176,_0x963b1b=getConfigDir();return _0x4fd3ab?a37_0x2bcb39[_0x5de132(0x1e2)](_0x963b1b,_0x5de132(0x218)+_0x4fd3ab):getConfigFile();}export function getCacheDir(){const _0x3d021a=a37_0x2176;return process[_0x3d021a(0x205)][_0x3d021a(0x21b)]||join(homedir(),_0x3d021a(0x1e0),'tdx');}export function getLLMProjectCacheFile(){const _0x53b21a=a37_0x2176;return join(getCacheDir(),_0x53b21a(0x1e1));}function a37_0x2176(_0x5c19c6,_0x149573){const _0x1bc631=a37_0x1bc6();return a37_0x2176=function(_0x2176a4,_0x349374){_0x2176a4=_0x2176a4-0x1dd;let _0xb8c2=_0x1bc631[_0x2176a4];return _0xb8c2;},a37_0x2176(_0x5c19c6,_0x149573);}export function readCachedLLMProject(){try{const _0x2aa976=getLLMProjectCacheFile();if(!existsSync(_0x2aa976))return null;return readFileSync(_0x2aa976,'utf-8')['trim']();}catch{return null;}}export function writeCachedLLMProject(_0x525296){const _0x11fdc0=a37_0x2176;try{const _0x3f907a=getCacheDir(),_0x530fd4=getLLMProjectCacheFile();!existsSync(_0x3f907a)&&mkdirSync(_0x3f907a,{'recursive':!![]}),writeFileSync(_0x530fd4,_0x525296,'utf-8');}catch(_0x2cca6e){console[_0x11fdc0(0x217)](_0x11fdc0(0x20b),_0x2cca6e);}}export function parseEnvFile(_0x578395){const _0x2bc33b=a37_0x2176,_0x1ce44c={};for(const _0x428a89 of _0x578395[_0x2bc33b(0x1ff)]('\x0a')){const _0x2d3fa5=_0x428a89[_0x2bc33b(0x1f2)]();if(!_0x2d3fa5||_0x2d3fa5[_0x2bc33b(0x1df)]('#'))continue;const _0xfe6048=_0x2d3fa5[_0x2bc33b(0x1f5)](/^([^=]+)=(.*)$/);if(_0xfe6048){const _0x5deb55=_0xfe6048[0x1][_0x2bc33b(0x1f2)]();let _0x31b628=_0xfe6048[0x2][_0x2bc33b(0x1f2)]();(_0x31b628[_0x2bc33b(0x1df)]('\x22')&&_0x31b628[_0x2bc33b(0x1ea)]('\x22')||_0x31b628[_0x2bc33b(0x1df)]('\x27')&&_0x31b628[_0x2bc33b(0x1ea)]('\x27'))&&(_0x31b628=_0x31b628[_0x2bc33b(0x1e4)](0x1,-0x1)),_0x1ce44c[_0x5deb55]=_0x31b628;}}return _0x1ce44c;}function a37_0x1bc6(){const _0x2ea597=['12906nlJiSr','env:\x20','warn','trim','includes','existsSync','match','dev-eu01','8hmjjgH','utf-8','4543745FPrfRj','env:\x20TD_API_KEY','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','TD_API_KEY','tdx.json','1068213lqbNlw','split','\x27,\x20defaulting\x20to\x20us01','eu01','apiKeys','772494bvwVLP','stg-ap03','env','entries','dev-us01','toUpperCase','4412120CvDgQH','replace','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','ap02','\x20(TD_API_KEY)','.config','.env','stg-jp01','6SSSOdR','stg-us01','ap03','3811451UTxZun','tdx','profile','error','.env.','profiles','yellow','TDX_CACHE_DIR','readFileSync','global:\x20','startsWith','.cache','llm_default_project','join','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','slice','TD_API_KEY_','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20load\x20','4DVnBFg','243834YFIXyV','endsWith','jp01','profile:\x20','us01','parse'];a37_0x1bc6=function(){return _0x2ea597;};return a37_0x1bc6();}export function readUserConfig(){const _0x5cbbb5=a37_0x2176,_0x5ee16f=getConfigFile();if(!existsSync(_0x5ee16f))return{};try{const _0x316b9a=readFileSync(_0x5ee16f,_0x5cbbb5(0x1f8));return parseEnvFile(_0x316b9a);}catch(_0x24f4c6){return console['warn'](_0x5cbbb5(0x1e3)+_0x5ee16f+':',_0x24f4c6),{};}}export function resolveSite(_0xcff8bf){const _0x573c6c=a37_0x2176,_0x1047ec=[_0x573c6c(0x1ed),_0x573c6c(0x1eb),'eu01',_0x573c6c(0x20c),'ap03',_0x573c6c(0x207),_0x573c6c(0x1f6),_0x573c6c(0x212),_0x573c6c(0x210),_0x573c6c(0x204)];if(_0x1047ec[_0x573c6c(0x1f3)](_0xcff8bf))return _0xcff8bf;if(_0xcff8bf in SITE_ALIASES)return SITE_ALIASES[_0xcff8bf];return console[_0x573c6c(0x1f1)]('Warning:\x20Unknown\x20site\x20\x27'+_0xcff8bf+_0x573c6c(0x200)),_0x573c6c(0x1ed);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x18f9b4,_0x428b08){const _0xd11f90=a37_0x2176,_0x1bd0d4=_0x18f9b4['toUpperCase']()[_0xd11f90(0x20a)](/-/g,'_'),_0x499eed=_0xd11f90(0x1e5)+_0x1bd0d4;if(process[_0xd11f90(0x205)][_0x499eed])return process[_0xd11f90(0x205)][_0x499eed];if(process['env']['TD_API_KEY'])return process[_0xd11f90(0x205)][_0xd11f90(0x1fc)];const _0x3e9d60=_0x428b08||getActiveProfileName();if(_0x3e9d60){const _0x42081d=loadProfileEnv(_0x3e9d60);if(_0x42081d){if(_0x42081d[_0x499eed])return _0x42081d[_0x499eed];if(_0x42081d[_0xd11f90(0x1fc)])return _0x42081d[_0xd11f90(0x1fc)];}}const _0x3474f9=loadUserConfigOnce();if(_0x3474f9[_0x499eed])return _0x3474f9[_0x499eed];if(_0x3474f9[_0xd11f90(0x1fc)])return _0x3474f9['TD_API_KEY'];return undefined;}export async function getAPIKeyAsync(_0x36f91f,_0x1caf14){const _0x170912=a37_0x2176,_0x33c8eb=_0x36f91f[_0x170912(0x208)]()[_0x170912(0x20a)](/-/g,'_'),_0x3969f7=_0x170912(0x1e5)+_0x33c8eb;if(process[_0x170912(0x205)][_0x3969f7])return process[_0x170912(0x205)][_0x3969f7];if(process[_0x170912(0x205)][_0x170912(0x1fc)])return process[_0x170912(0x205)][_0x170912(0x1fc)];const _0x5cea8b=_0x1caf14||getActiveProfileName()||undefined,_0x46fe6e=getCachedCredential(_0x36f91f,_0x5cea8b);if(_0x46fe6e)return _0x46fe6e;const _0x10b833=await getKeychainAPIKey(_0x5cea8b);if(_0x10b833)return setCachedCredential(_0x10b833,_0x36f91f,_0x5cea8b),_0x10b833;const _0x4540cb=getLegacyEnvAPIKey(_0x36f91f,_0x5cea8b);if(_0x4540cb){const _0x3f639d=await isKeychainAvailable();if(_0x3f639d)try{await saveKeychainAPIKey(_0x4540cb,_0x5cea8b),setCachedCredential(_0x4540cb,_0x36f91f,_0x5cea8b);const _0x438521=getConfigFilePath(_0x5cea8b);cleanupLegacyEnvFile(_0x438521)&&console[_0x170912(0x1f1)](a37_0x711bed[_0x170912(0x21a)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x2523a2){console[_0x170912(0x1f1)](a37_0x711bed['yellow'](_0x170912(0x1fb)+_0x2523a2));}return _0x4540cb;}return undefined;}function getLegacyEnvAPIKey(_0x461b30,_0x1ecb1e){const _0x46a99c=a37_0x2176,_0x2ff4af=_0x461b30[_0x46a99c(0x208)]()[_0x46a99c(0x20a)](/-/g,'_'),_0x581068='TD_API_KEY_'+_0x2ff4af;if(_0x1ecb1e){const _0x464c0e=loadProfileEnv(_0x1ecb1e);if(_0x464c0e){if(_0x464c0e[_0x581068])return _0x464c0e[_0x581068];if(_0x464c0e[_0x46a99c(0x1fc)])return _0x464c0e[_0x46a99c(0x1fc)];}}const _0x2560fb=loadUserConfigOnce();if(_0x2560fb[_0x581068])return _0x2560fb[_0x581068];if(_0x2560fb[_0x46a99c(0x1fc)])return _0x2560fb[_0x46a99c(0x1fc)];return undefined;}function cleanupLegacyEnvFile(_0xfc990c){const _0x42c3cc=a37_0x2176;if(!existsSync(_0xfc990c))return![];try{const _0x508a17=readFileSync(_0xfc990c,_0x42c3cc(0x1f8)),_0x4578ef=_0x508a17['split']('\x0a'),_0x2771df=_0x4578ef['filter'](_0x2ad63a=>{const _0x12b3d0=_0x42c3cc,_0x5462cd=_0x2ad63a[_0x12b3d0(0x1f2)]();if(!_0x5462cd||_0x5462cd[_0x12b3d0(0x1df)]('#'))return!![];const [_0x1d50a7]=_0x5462cd[_0x12b3d0(0x1ff)]('=');return!_0x1d50a7[_0x12b3d0(0x1df)](_0x12b3d0(0x1fc));}),_0x1cc0d5=_0x2771df['some'](_0x58af2f=>{const _0x2f6cbe=_0x42c3cc,_0x102dfd=_0x58af2f[_0x2f6cbe(0x1f2)]();return _0x102dfd&&!_0x102dfd['startsWith']('#');});if(!_0x1cc0d5)return unlinkSync(_0xfc990c),!![];return writeFileSync(_0xfc990c,_0x2771df[_0x42c3cc(0x1e2)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x5a07f0,_0x43f76b){const _0x4c0939=a37_0x2176,_0x4872bf=_0x4c0939(0x1e5)+_0x5a07f0[_0x4c0939(0x208)]()[_0x4c0939(0x20a)](/-/g,'_');if(process[_0x4c0939(0x205)][_0x4872bf])return _0x4c0939(0x1f0)+_0x4872bf;if(process['env'][_0x4c0939(0x1fc)])return _0x4c0939(0x1fa);const _0x139689=_0x43f76b||getActiveProfileName();if(_0x139689){const _0x11a576=loadProfileEnv(_0x139689);if(_0x11a576){if(_0x11a576[_0x4872bf])return _0x4c0939(0x1ec)+_0x139689+'\x20('+_0x4872bf+')';if(_0x11a576[_0x4c0939(0x1fc)])return _0x4c0939(0x1ec)+_0x139689+_0x4c0939(0x20d);}}const _0x6ac8ca=loadUserConfigOnce(),_0x37d3ac=getConfigFile();if(_0x6ac8ca[_0x4872bf])return _0x4c0939(0x1de)+_0x37d3ac+'\x20('+_0x4872bf+')';if(_0x6ac8ca[_0x4c0939(0x1fc)])return'global:\x20'+_0x37d3ac+_0x4c0939(0x20d);return null;}function loadProfileEnv(_0x3420c0){const _0xf8977e=a37_0x2176,_0xd1b32=a37_0x2bcb39[_0xf8977e(0x1e2)](getConfigDir(),_0xf8977e(0x218)+_0x3420c0);if(a37_0x1aefaf[_0xf8977e(0x1f4)](_0xd1b32)){validateSecureFilePermissions(_0xd1b32);try{const _0x348dc1=a37_0x1aefaf[_0xf8977e(0x1dd)](_0xd1b32,'utf-8');return parseEnvFile(_0x348dc1);}catch(_0x57eae5){console['warn'](_0xf8977e(0x1e7)+_0xd1b32+':\x20'+_0x57eae5);}}const _0x52ad0b=a37_0x2bcb39[_0xf8977e(0x1e2)](getConfigDir(),_0xf8977e(0x219),_0x3420c0,_0xf8977e(0x20f));if(a37_0x1aefaf[_0xf8977e(0x1f4)](_0x52ad0b)){validateSecureFilePermissions(_0x52ad0b);try{const _0x323621=a37_0x1aefaf[_0xf8977e(0x1dd)](_0x52ad0b,'utf-8');return parseEnvFile(_0x323621);}catch(_0x3e0e9f){return console[_0xf8977e(0x1f1)](_0xf8977e(0x1e7)+_0x52ad0b+':\x20'+_0x3e0e9f),null;}}return null;}function getActiveProfileName(){const _0x4b28fe=a37_0x2176,_0x5b07df=a37_0x2bcb39[_0x4b28fe(0x1e2)](getConfigDir(),_0x4b28fe(0x1fd));if(!a37_0x1aefaf['existsSync'](_0x5b07df))return null;try{const _0x13adb2=a37_0x1aefaf[_0x4b28fe(0x1dd)](_0x5b07df,_0x4b28fe(0x1f8)),_0x323fac=JSON[_0x4b28fe(0x1ee)](_0x13adb2);return _0x323fac[_0x4b28fe(0x216)]||null;}catch{return null;}}export function saveAPIKey(_0x16fcff,_0x78511a,_0x520934){const _0x922356=a37_0x2176,_0x25656f=getConfigDir(),_0xe9c339=getConfigFilePath(_0x520934);!existsSync(_0x25656f)&&mkdirSync(_0x25656f,{'recursive':!![],'mode':0x1c0});let _0x32cdd9={};if(existsSync(_0xe9c339))try{const _0x1cef2e=readFileSync(_0xe9c339,_0x922356(0x1f8));_0x32cdd9=parseEnvFile(_0x1cef2e);}catch(_0x3bd700){console[_0x922356(0x1f1)]('Warning:\x20Failed\x20to\x20read\x20'+_0xe9c339+':',_0x3bd700);}const _0x2dd255=_0x16fcff[_0x922356(0x208)]()[_0x922356(0x20a)](/-/g,'_');_0x32cdd9[_0x922356(0x1e5)+_0x2dd255]=_0x78511a;const _0x2c8e06=Object[_0x922356(0x206)](_0x32cdd9)['map'](([_0x4544d2,_0x1dbe00])=>_0x4544d2+'='+_0x1dbe00);writeFileSync(_0xe9c339,_0x2c8e06[_0x922356(0x1e2)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x190acb,_0x1645ea,_0x17dc41){const _0x4ac0f9=a37_0x2176;await saveKeychainAPIKey(_0x190acb,_0x17dc41),setCachedCredential(_0x190acb,_0x1645ea,_0x17dc41);const _0x2f445b=getConfigFilePath(_0x17dc41);cleanupLegacyEnvFile(_0x2f445b)&&console[_0x4ac0f9(0x1f1)](a37_0x711bed[_0x4ac0f9(0x21a)](_0x4ac0f9(0x1e6)));}export function loadConfig(){const _0x2ecba9=a37_0x2176,_0x4c0f71={'apiKeys':{},'defaultSite':_0x2ecba9(0x1ed)},_0x1b8588=['us01',_0x2ecba9(0x1eb),_0x2ecba9(0x201),_0x2ecba9(0x20c),_0x2ecba9(0x213),_0x2ecba9(0x207),_0x2ecba9(0x1f6),'stg-us01',_0x2ecba9(0x210),_0x2ecba9(0x204)];for(const _0x181055 of _0x1b8588){const _0x360998=getAPIKey(_0x181055);_0x360998&&(_0x4c0f71[_0x2ecba9(0x202)][_0x181055]=_0x360998);}return _0x4c0f71;}
1
+ (function(_0x1fdb22,_0x52e38c){const _0x2b684a=a37_0x26ac,_0xa891f4=_0x1fdb22();while(!![]){try{const _0x57c101=parseInt(_0x2b684a(0x1a8))/0x1+-parseInt(_0x2b684a(0x1a9))/0x2+parseInt(_0x2b684a(0x1a3))/0x3+-parseInt(_0x2b684a(0x1b3))/0x4+parseInt(_0x2b684a(0x1a4))/0x5+-parseInt(_0x2b684a(0x1da))/0x6+parseInt(_0x2b684a(0x1d2))/0x7*(parseInt(_0x2b684a(0x1d9))/0x8);if(_0x57c101===_0x52e38c)break;else _0xa891f4['push'](_0xa891f4['shift']());}catch(_0x406903){_0xa891f4['push'](_0xa891f4['shift']());}}}(a37_0x27d1,0x4d243));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a37_0x5cc80d from'node:fs';import*as a37_0x624760 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';function a37_0x26ac(_0x380a2c,_0x1a5b2d){const _0x27d139=a37_0x27d1();return a37_0x26ac=function(_0x26ac02,_0x3325ab){_0x26ac02=_0x26ac02-0x19e;let _0x5d022a=_0x27d139[_0x26ac02];return _0x5d022a;},a37_0x26ac(_0x380a2c,_0x1a5b2d);}import a37_0x553907 from'chalk';export function getConfigDir(){const _0x4f01e1=a37_0x26ac;return process[_0x4f01e1(0x1c5)]['TDX_CONFIG_DIR']||join(homedir(),_0x4f01e1(0x19f),_0x4f01e1(0x1ce));}export function getConfigFile(){const _0x19cc1b=a37_0x26ac;return join(getConfigDir(),_0x19cc1b(0x1c8));}export function getConfigFilePath(_0x40dccf){const _0xa60964=a37_0x26ac,_0x44b465=getConfigDir();return _0x40dccf?a37_0x624760[_0xa60964(0x1d4)](_0x44b465,_0xa60964(0x1b0)+_0x40dccf):getConfigFile();}export function getCacheDir(){const _0x957f8f=a37_0x26ac;return process[_0x957f8f(0x1c5)][_0x957f8f(0x1b4)]||join(homedir(),_0x957f8f(0x1af),_0x957f8f(0x1ce));}export function getLLMProjectCacheFile(){const _0x250e73=a37_0x26ac;return join(getCacheDir(),_0x250e73(0x1c2));}export function readCachedLLMProject(){const _0x3c3400=a37_0x26ac;try{const _0x3a287f=getLLMProjectCacheFile();if(!existsSync(_0x3a287f))return null;return readFileSync(_0x3a287f,_0x3c3400(0x1bd))[_0x3c3400(0x1bf)]();}catch{return null;}}export function writeCachedLLMProject(_0x4fddef){const _0x4fc6d6=a37_0x26ac;try{const _0x5dfc34=getCacheDir(),_0x56de67=getLLMProjectCacheFile();!existsSync(_0x5dfc34)&&mkdirSync(_0x5dfc34,{'recursive':!![]}),writeFileSync(_0x56de67,_0x4fddef,_0x4fc6d6(0x1bd));}catch(_0x1cd89a){console[_0x4fc6d6(0x1c6)](_0x4fc6d6(0x1cc),_0x1cd89a);}}export function parseEnvFile(_0x2cba27){const _0x2e9bb5=a37_0x26ac,_0x5eca7f={};for(const _0xcd494c of _0x2cba27['split']('\x0a')){const _0x5e36fd=_0xcd494c[_0x2e9bb5(0x1bf)]();if(!_0x5e36fd||_0x5e36fd[_0x2e9bb5(0x1a2)]('#'))continue;const _0x48d5c3=_0x5e36fd['match'](/^([^=]+)=(.*)$/);if(_0x48d5c3){const _0x60b881=_0x48d5c3[0x1][_0x2e9bb5(0x1bf)]();let _0x31522c=_0x48d5c3[0x2][_0x2e9bb5(0x1bf)]();(_0x31522c[_0x2e9bb5(0x1a2)]('\x22')&&_0x31522c['endsWith']('\x22')||_0x31522c[_0x2e9bb5(0x1a2)]('\x27')&&_0x31522c[_0x2e9bb5(0x1ae)]('\x27'))&&(_0x31522c=_0x31522c[_0x2e9bb5(0x1cb)](0x1,-0x1)),_0x5eca7f[_0x60b881]=_0x31522c;}}return _0x5eca7f;}export function readUserConfig(){const _0x244c61=a37_0x26ac,_0x2e82ce=getConfigFile();if(!existsSync(_0x2e82ce))return{};try{const _0x1e7dde=readFileSync(_0x2e82ce,_0x244c61(0x1bd));return parseEnvFile(_0x1e7dde);}catch(_0x4519d9){return console['warn'](_0x244c61(0x1d7)+_0x2e82ce+':',_0x4519d9),{};}}export function resolveSite(_0x31880a){const _0x4c8442=a37_0x26ac,_0x2dba46=[_0x4c8442(0x1bc),_0x4c8442(0x1ca),'eu01',_0x4c8442(0x1a1),_0x4c8442(0x1b7),_0x4c8442(0x1d3),_0x4c8442(0x1a7),_0x4c8442(0x1d5),_0x4c8442(0x1cd),_0x4c8442(0x1ad)];if(_0x2dba46[_0x4c8442(0x1d1)](_0x31880a))return _0x31880a;if(_0x31880a in SITE_ALIASES)return SITE_ALIASES[_0x31880a];return console[_0x4c8442(0x1b9)](_0x4c8442(0x1d8)+_0x31880a+'\x27,\x20defaulting\x20to\x20us01'),_0x4c8442(0x1bc);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x373742,_0x5d00e4){const _0x25dfb1=a37_0x26ac,_0x87101f=_0x373742[_0x25dfb1(0x1a0)]()[_0x25dfb1(0x1ab)](/-/g,'_'),_0x1fe13f=_0x25dfb1(0x1a6)+_0x87101f;if(process[_0x25dfb1(0x1c5)][_0x1fe13f])return process[_0x25dfb1(0x1c5)][_0x1fe13f];if(process['env'][_0x25dfb1(0x1d0)])return process['env']['TD_API_KEY'];const _0x54d074=_0x5d00e4||getActiveProfileName();if(_0x54d074){const _0x2c8276=loadProfileEnv(_0x54d074);if(_0x2c8276){if(_0x2c8276[_0x1fe13f])return _0x2c8276[_0x1fe13f];if(_0x2c8276[_0x25dfb1(0x1d0)])return _0x2c8276['TD_API_KEY'];}}const _0x3eaea9=loadUserConfigOnce();if(_0x3eaea9[_0x1fe13f])return _0x3eaea9[_0x1fe13f];if(_0x3eaea9[_0x25dfb1(0x1d0)])return _0x3eaea9[_0x25dfb1(0x1d0)];return undefined;}export async function getAPIKeyAsync(_0x30ab63,_0x1ee4f3){const _0x268be2=a37_0x26ac,_0xe8b292=_0x30ab63[_0x268be2(0x1a0)]()['replace'](/-/g,'_'),_0x3689bb='TD_API_KEY_'+_0xe8b292;if(process[_0x268be2(0x1c5)][_0x3689bb])return process[_0x268be2(0x1c5)][_0x3689bb];if(process['env'][_0x268be2(0x1d0)])return process[_0x268be2(0x1c5)]['TD_API_KEY'];const _0x13c242=_0x1ee4f3||getActiveProfileName()||undefined,_0x286851=getCachedCredential(_0x30ab63,_0x13c242);if(_0x286851)return _0x286851;const _0x4aee0f=await getKeychainAPIKey(_0x13c242);if(_0x4aee0f)return setCachedCredential(_0x4aee0f,_0x30ab63,_0x13c242),_0x4aee0f;const _0x295e02=getLegacyEnvAPIKey(_0x30ab63,_0x13c242);if(_0x295e02){const _0x5b75fd=await isKeychainAvailable();if(_0x5b75fd)try{await saveKeychainAPIKey(_0x295e02,_0x13c242),setCachedCredential(_0x295e02,_0x30ab63,_0x13c242);const _0x33a75b=getConfigFilePath(_0x13c242);cleanupLegacyEnvFile(_0x33a75b)&&console[_0x268be2(0x1b9)](a37_0x553907['yellow'](_0x268be2(0x1c1)));}catch(_0x45f43b){console[_0x268be2(0x1b9)](a37_0x553907[_0x268be2(0x1b2)](_0x268be2(0x1c3)+_0x45f43b));}return _0x295e02;}return undefined;}function getLegacyEnvAPIKey(_0x4184db,_0x462535){const _0x363e7a=a37_0x26ac,_0xb25643=_0x4184db[_0x363e7a(0x1a0)]()[_0x363e7a(0x1ab)](/-/g,'_'),_0x5f0cf7='TD_API_KEY_'+_0xb25643;if(_0x462535){const _0x336c04=loadProfileEnv(_0x462535);if(_0x336c04){if(_0x336c04[_0x5f0cf7])return _0x336c04[_0x5f0cf7];if(_0x336c04[_0x363e7a(0x1d0)])return _0x336c04[_0x363e7a(0x1d0)];}}const _0x474436=loadUserConfigOnce();if(_0x474436[_0x5f0cf7])return _0x474436[_0x5f0cf7];if(_0x474436['TD_API_KEY'])return _0x474436[_0x363e7a(0x1d0)];return undefined;}function a37_0x27d1(){const _0x4afa04=['apiKeys','ap03','filter','warn','profile','Warning:\x20Failed\x20to\x20read\x20','us01','utf-8','split','trim','readFileSync','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','llm_default_project','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','existsSync','env','error','map','.env','env:\x20','jp01','slice','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','stg-jp01','tdx','\x20(TD_API_KEY)','TD_API_KEY','includes','72877ZfsheE','dev-us01','join','stg-us01','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','Warning:\x20Unknown\x20site\x20\x27','96KlNrTm','2984712iusynt','tdx.json','global:\x20','profiles','.config','toUpperCase','ap02','startsWith','1224981nfDspE','3107780OjLIKj','profile:\x20','TD_API_KEY_','dev-eu01','333292hWlcue','762668kEOExq','eu01','replace','env:\x20TD_API_KEY','stg-ap03','endsWith','.cache','.env.','parse','yellow','1173400UnOJQo','TDX_CACHE_DIR','some'];a37_0x27d1=function(){return _0x4afa04;};return a37_0x27d1();}function cleanupLegacyEnvFile(_0x202caa){const _0x1a2b91=a37_0x26ac;if(!existsSync(_0x202caa))return![];try{const _0x87a73c=readFileSync(_0x202caa,'utf-8'),_0x2cc5f1=_0x87a73c[_0x1a2b91(0x1be)]('\x0a'),_0x3a8805=_0x2cc5f1[_0x1a2b91(0x1b8)](_0x5ad7f2=>{const _0x62641a=_0x1a2b91,_0x4ba290=_0x5ad7f2[_0x62641a(0x1bf)]();if(!_0x4ba290||_0x4ba290[_0x62641a(0x1a2)]('#'))return!![];const [_0x15adad]=_0x4ba290[_0x62641a(0x1be)]('=');return!_0x15adad[_0x62641a(0x1a2)](_0x62641a(0x1d0));}),_0x9e9cd6=_0x3a8805[_0x1a2b91(0x1b5)](_0x5f7299=>{const _0x572f39=_0x1a2b91,_0x4e0525=_0x5f7299[_0x572f39(0x1bf)]();return _0x4e0525&&!_0x4e0525[_0x572f39(0x1a2)]('#');});if(!_0x9e9cd6)return unlinkSync(_0x202caa),!![];return writeFileSync(_0x202caa,_0x3a8805[_0x1a2b91(0x1d4)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x1206a5,_0x1a54dd){const _0x2a840d=a37_0x26ac,_0x5173d6=_0x2a840d(0x1a6)+_0x1206a5['toUpperCase']()[_0x2a840d(0x1ab)](/-/g,'_');if(process['env'][_0x5173d6])return _0x2a840d(0x1c9)+_0x5173d6;if(process['env'][_0x2a840d(0x1d0)])return _0x2a840d(0x1ac);const _0x97c0bf=_0x1a54dd||getActiveProfileName();if(_0x97c0bf){const _0x4ff61a=loadProfileEnv(_0x97c0bf);if(_0x4ff61a){if(_0x4ff61a[_0x5173d6])return _0x2a840d(0x1a5)+_0x97c0bf+'\x20('+_0x5173d6+')';if(_0x4ff61a[_0x2a840d(0x1d0)])return _0x2a840d(0x1a5)+_0x97c0bf+_0x2a840d(0x1cf);}}const _0x539577=loadUserConfigOnce(),_0x21de60=getConfigFile();if(_0x539577[_0x5173d6])return _0x2a840d(0x1dc)+_0x21de60+'\x20('+_0x5173d6+')';if(_0x539577[_0x2a840d(0x1d0)])return _0x2a840d(0x1dc)+_0x21de60+_0x2a840d(0x1cf);return null;}function loadProfileEnv(_0x11f860){const _0x51c038=a37_0x26ac,_0x10bf24=a37_0x624760[_0x51c038(0x1d4)](getConfigDir(),'.env.'+_0x11f860);if(a37_0x5cc80d[_0x51c038(0x1c4)](_0x10bf24)){validateSecureFilePermissions(_0x10bf24);try{const _0x1b87f9=a37_0x5cc80d[_0x51c038(0x1c0)](_0x10bf24,_0x51c038(0x1bd));return parseEnvFile(_0x1b87f9);}catch(_0x17db62){console[_0x51c038(0x1b9)]('Warning:\x20Failed\x20to\x20load\x20'+_0x10bf24+':\x20'+_0x17db62);}}const _0x362d43=a37_0x624760[_0x51c038(0x1d4)](getConfigDir(),_0x51c038(0x19e),_0x11f860,_0x51c038(0x1c8));if(a37_0x5cc80d[_0x51c038(0x1c4)](_0x362d43)){validateSecureFilePermissions(_0x362d43);try{const _0x28b872=a37_0x5cc80d[_0x51c038(0x1c0)](_0x362d43,_0x51c038(0x1bd));return parseEnvFile(_0x28b872);}catch(_0x28ac33){return console[_0x51c038(0x1b9)]('Warning:\x20Failed\x20to\x20load\x20'+_0x362d43+':\x20'+_0x28ac33),null;}}return null;}function getActiveProfileName(){const _0x370629=a37_0x26ac,_0x4cc010=a37_0x624760[_0x370629(0x1d4)](getConfigDir(),_0x370629(0x1db));if(!a37_0x5cc80d[_0x370629(0x1c4)](_0x4cc010))return null;try{const _0x390d05=a37_0x5cc80d[_0x370629(0x1c0)](_0x4cc010,'utf-8'),_0xe05c58=JSON[_0x370629(0x1b1)](_0x390d05);return _0xe05c58[_0x370629(0x1ba)]||null;}catch{return null;}}export function saveAPIKey(_0x3957a1,_0x5280b1,_0x6aa40f){const _0x372446=a37_0x26ac,_0x28f24f=getConfigDir(),_0x7057e1=getConfigFilePath(_0x6aa40f);!existsSync(_0x28f24f)&&mkdirSync(_0x28f24f,{'recursive':!![],'mode':0x1c0});let _0x255ab4={};if(existsSync(_0x7057e1))try{const _0x1e512c=readFileSync(_0x7057e1,_0x372446(0x1bd));_0x255ab4=parseEnvFile(_0x1e512c);}catch(_0x335a43){console['warn'](_0x372446(0x1bb)+_0x7057e1+':',_0x335a43);}const _0xf04cda=_0x3957a1['toUpperCase']()[_0x372446(0x1ab)](/-/g,'_');_0x255ab4[_0x372446(0x1a6)+_0xf04cda]=_0x5280b1;const _0x3e6cf9=Object['entries'](_0x255ab4)[_0x372446(0x1c7)](([_0x928a53,_0x31e031])=>_0x928a53+'='+_0x31e031);writeFileSync(_0x7057e1,_0x3e6cf9[_0x372446(0x1d4)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x21484e,_0x6f6cf9,_0xb03426){const _0x52447d=a37_0x26ac;await saveKeychainAPIKey(_0x21484e,_0xb03426),setCachedCredential(_0x21484e,_0x6f6cf9,_0xb03426);const _0x49f60f=getConfigFilePath(_0xb03426);cleanupLegacyEnvFile(_0x49f60f)&&console[_0x52447d(0x1b9)](a37_0x553907['yellow'](_0x52447d(0x1d6)));}export function loadConfig(){const _0x3ad12f=a37_0x26ac,_0x32c977={'apiKeys':{},'defaultSite':'us01'},_0x45d1b5=[_0x3ad12f(0x1bc),_0x3ad12f(0x1ca),_0x3ad12f(0x1aa),'ap02',_0x3ad12f(0x1b7),'dev-us01',_0x3ad12f(0x1a7),_0x3ad12f(0x1d5),_0x3ad12f(0x1cd),_0x3ad12f(0x1ad)];for(const _0x310c2f of _0x45d1b5){const _0x22ff59=getAPIKey(_0x310c2f);_0x22ff59&&(_0x32c977[_0x3ad12f(0x1b6)][_0x310c2f]=_0x22ff59);}return _0x32c977;}
@@ -1 +1 @@
1
- (function(_0x152cd5,_0x2064ef){const _0x31f6cc=a38_0x6ae2,_0x2a5f7d=_0x152cd5();while(!![]){try{const _0x32074a=-parseInt(_0x31f6cc(0x95))/0x1*(-parseInt(_0x31f6cc(0x9d))/0x2)+-parseInt(_0x31f6cc(0xa4))/0x3*(-parseInt(_0x31f6cc(0xa0))/0x4)+parseInt(_0x31f6cc(0xa3))/0x5+-parseInt(_0x31f6cc(0x9b))/0x6*(-parseInt(_0x31f6cc(0x9e))/0x7)+parseInt(_0x31f6cc(0xa2))/0x8+parseInt(_0x31f6cc(0xa1))/0x9+-parseInt(_0x31f6cc(0x9f))/0xa;if(_0x32074a===_0x2064ef)break;else _0x2a5f7d['push'](_0x2a5f7d['shift']());}catch(_0x186f79){_0x2a5f7d['push'](_0x2a5f7d['shift']());}}}(a38_0x2aeb,0x97380));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x5568ff,_0x1c4023){const _0x56850e=a38_0x6ae2,_0x4c2e1f=_0x5568ff||_0x56850e(0xa5),_0x2f57aa=_0x1c4023||_0x56850e(0x96);return _0x4c2e1f+':'+_0x2f57aa;}export function getCachedCredential(_0x44103f,_0x165b00){const _0x51507f=a38_0x6ae2,_0x20f823=getCacheKey(_0x44103f,_0x165b00),_0x359f5b=cache[_0x51507f(0xa7)](_0x20f823);if(!_0x359f5b)return null;if(Date[_0x51507f(0x97)]()-_0x359f5b[_0x51507f(0x98)]>CACHE_TTL_MS)return cache['delete'](_0x20f823),null;return _0x359f5b[_0x51507f(0x9a)];}function a38_0x6ae2(_0x1b9b80,_0x559ac2){const _0x2aebdc=a38_0x2aeb();return a38_0x6ae2=function(_0x6ae291,_0xa919e){_0x6ae291=_0x6ae291-0x95;let _0x5baaf4=_0x2aebdc[_0x6ae291];return _0x5baaf4;},a38_0x6ae2(_0x1b9b80,_0x559ac2);}export function setCachedCredential(_0x6ce78a,_0x5834f6,_0x166c23){const _0xc5f93f=a38_0x6ae2,_0x5f03ec=getCacheKey(_0x5834f6,_0x166c23);cache[_0xc5f93f(0x99)](_0x5f03ec,{'apiKey':_0x6ce78a,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x2fdee7=a38_0x6ae2;cache[_0x2fdee7(0x9c)]();}export function clearCachedCredential(_0x4373e2,_0x5bb5ca){const _0x450d29=a38_0x6ae2,_0x44088c=getCacheKey(_0x4373e2,_0x5bb5ca);cache[_0x450d29(0xa6)](_0x44088c);}function a38_0x2aeb(){const _0x178cd8=['loadedAt','set','apiKey','10926RXLgKL','clear','115274NauVUT','3759zwQAdg','39291430ZgYnek','1095220PSsoWc','4642731JHsXwr','6462464iRnsaK','859710jjEYYK','12ZOEcaN','__default_site__','delete','get','17cMrDmV','__default_profile__','now'];a38_0x2aeb=function(){return _0x178cd8;};return a38_0x2aeb();}
1
+ (function(_0xc1eca8,_0x141935){const _0x1b683b=a38_0x28d1,_0x3d7182=_0xc1eca8();while(!![]){try{const _0x3e432b=-parseInt(_0x1b683b(0x100))/0x1*(parseInt(_0x1b683b(0x10b))/0x2)+parseInt(_0x1b683b(0x10c))/0x3+parseInt(_0x1b683b(0x101))/0x4+-parseInt(_0x1b683b(0x103))/0x5*(-parseInt(_0x1b683b(0x108))/0x6)+-parseInt(_0x1b683b(0xff))/0x7+-parseInt(_0x1b683b(0xfd))/0x8*(-parseInt(_0x1b683b(0x105))/0x9)+-parseInt(_0x1b683b(0x102))/0xa;if(_0x3e432b===_0x141935)break;else _0x3d7182['push'](_0x3d7182['shift']());}catch(_0x2e8d09){_0x3d7182['push'](_0x3d7182['shift']());}}}(a38_0x5ce3,0x217ac));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x4b4cef,_0x20cd9e){const _0x287d6c=a38_0x28d1,_0x52f8c7=_0x4b4cef||_0x287d6c(0x107),_0xadb32f=_0x20cd9e||_0x287d6c(0x10a);return _0x52f8c7+':'+_0xadb32f;}function a38_0x28d1(_0x5c692e,_0x57b3db){const _0x5ce3b7=a38_0x5ce3();return a38_0x28d1=function(_0x28d1a7,_0x59d570){_0x28d1a7=_0x28d1a7-0xfd;let _0x4ddbef=_0x5ce3b7[_0x28d1a7];return _0x4ddbef;},a38_0x28d1(_0x5c692e,_0x57b3db);}export function getCachedCredential(_0x6d7199,_0x2ba07b){const _0x503698=a38_0x28d1,_0x56cb42=getCacheKey(_0x6d7199,_0x2ba07b),_0x4aa67f=cache[_0x503698(0x104)](_0x56cb42);if(!_0x4aa67f)return null;if(Date[_0x503698(0xfe)]()-_0x4aa67f[_0x503698(0x109)]>CACHE_TTL_MS)return cache[_0x503698(0x106)](_0x56cb42),null;return _0x4aa67f['apiKey'];}export function setCachedCredential(_0x520258,_0xe4885f,_0x423be1){const _0x3e76d4=a38_0x28d1,_0xe9d7f5=getCacheKey(_0xe4885f,_0x423be1);cache['set'](_0xe9d7f5,{'apiKey':_0x520258,'loadedAt':Date[_0x3e76d4(0xfe)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x19fd30,_0x2b13d2){const _0x4c6309=a38_0x28d1,_0x15e740=getCacheKey(_0x19fd30,_0x2b13d2);cache[_0x4c6309(0x106)](_0x15e740);}function a38_0x5ce3(){const _0x91bfea=['144jgAQnb','delete','__default_site__','601422gmsOXU','loadedAt','__default_profile__','2PCPyGC','540555pNJYDZ','113888deABqT','now','1423933IOYxAW','121677qGGclt','649868fbdGix','2084370jaYRxW','5SrolwB','get'];a38_0x5ce3=function(){return _0x91bfea;};return a38_0x5ce3();}
@@ -1 +1 @@
1
- const a39_0x146272=a39_0x5519;(function(_0x507626,_0x459846){const _0x434da1=a39_0x5519,_0x23d865=_0x507626();while(!![]){try{const _0x39f842=-parseInt(_0x434da1(0x206))/0x1+-parseInt(_0x434da1(0x212))/0x2+-parseInt(_0x434da1(0x202))/0x3*(parseInt(_0x434da1(0x21a))/0x4)+-parseInt(_0x434da1(0x1fd))/0x5+-parseInt(_0x434da1(0x1f8))/0x6*(-parseInt(_0x434da1(0x1f4))/0x7)+parseInt(_0x434da1(0x1f0))/0x8+-parseInt(_0x434da1(0x217))/0x9*(-parseInt(_0x434da1(0x200))/0xa);if(_0x39f842===_0x459846)break;else _0x23d865['push'](_0x23d865['shift']());}catch(_0x58fc96){_0x23d865['push'](_0x23d865['shift']());}}}(a39_0x5c04,0xcf810));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';function a39_0x5519(_0x4f1033,_0x4b4090){const _0x5c04be=a39_0x5c04();return a39_0x5519=function(_0x5519f0,_0xf6785e){_0x5519f0=_0x5519f0-0x1de;let _0x9b65d6=_0x5c04be[_0x5519f0];return _0x9b65d6;},a39_0x5519(_0x4f1033,_0x4b4090);}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';function a39_0x5c04(){const _0x13453f=['config','readFileSync','display','5121370gFZqLZ','existsSync','Profile','35320620jRKbej','llmProject','62556HTpuMM','Profile\x20Credentials','getParameters','displayWithSources','796278jkSMom','(session:\x20','llm_project','getSource','global','cliFlags','CLI\x20flag:\x20--','sessions','[context]',':\x20none\x20(using\x20session:\x20','profile','profiles','3149152kGoopV','loadGlobalConfig','segmentPath','profileCredentials','us01','9ksLAzQ','session','Project','316LmFdCM','tdx.json','log','activeProfile','verbose','site','layers','sessionId','Global','parse','segment_path','database','apiKey','Session','resolveAPIKeyAsync',':\x20none','parentSegment','parent_segment','configFiles','utf-8','default','project','not\x20set','.env','8306896Liceoq','logLevel','createAsync','.json','644BWbtHc','Global\x20Credentials','join','globalCredentials','86214ddSWZB','toString'];a39_0x5c04=function(){return _0x13453f;};return a39_0x5c04();}import{LogLevel}from'../utils/tdx-logger.js';import*as a39_0x14af5d from'node:fs';import*as a39_0x45cf38 from'node:path';export class GlobalContext{[a39_0x146272(0x21f)];[a39_0x146272(0x1e3)];[a39_0x146272(0x1e9)];[a39_0x146272(0x1e2)];['llm_project'];[a39_0x146272(0x1e4)];[a39_0x146272(0x21e)];[a39_0x146272(0x1f1)];[a39_0x146272(0x1de)];['activeProfile'];[a39_0x146272(0x1df)];[a39_0x146272(0x1ea)];constructor(_0x461908){const _0x2f298c=a39_0x146272;this[_0x2f298c(0x1df)]=_0x461908[_0x2f298c(0x218)]||getCurrentSessionPID()[_0x2f298c(0x1f9)]();const _0x42d688=loadSessionContext(_0x461908['session']),_0x5eb6f6=loadProjectConfig(),_0x91aa60=this[_0x2f298c(0x213)]();this['activeProfile']=_0x461908[_0x2f298c(0x210)]||_0x42d688?.[_0x2f298c(0x210)]||_0x91aa60[_0x2f298c(0x210)]||getActiveProfile();const _0x585d3a=this[_0x2f298c(0x21d)]?loadProfile(this[_0x2f298c(0x21d)]):null,_0x1a21f7=_0x5cc563=>{if(!_0x5cc563)return{};const _0xc5f687=_0x5cc563,_0x528c00={};for(const [_0x22906e,_0x4f7aa3]of Object['entries'](_0xc5f687)){typeof _0x4f7aa3==='string'&&(_0x528c00[_0x22906e]=_0x4f7aa3);}return _0x528c00;},_0x42c548={};if(_0x461908[_0x2f298c(0x21f)]&&_0x461908[_0x2f298c(0x21f)]!==_0x2f298c(0x216))_0x42c548[_0x2f298c(0x21f)]=_0x461908[_0x2f298c(0x21f)];const _0x56befc=_0x42d688?.[_0x2f298c(0x1e3)],_0x867091=_0x5eb6f6?.[_0x2f298c(0x1e3)],_0x330f65=_0x585d3a?.['config']?.['database'],_0x40b4fd=_0x91aa60[_0x2f298c(0x1e3)];_0x461908['database']&&(_0x461908['database']!==_0x56befc&&_0x461908['database']!==_0x867091&&_0x461908[_0x2f298c(0x1e3)]!==_0x330f65&&_0x461908[_0x2f298c(0x1e3)]!==_0x40b4fd)&&(_0x42c548[_0x2f298c(0x1e3)]=_0x461908['database']);if(_0x461908[_0x2f298c(0x1e8)])_0x42c548['parent_segment']=_0x461908['parentSegment'];if(_0x461908[_0x2f298c(0x201)])_0x42c548[_0x2f298c(0x208)]=_0x461908[_0x2f298c(0x201)];if(_0x461908[_0x2f298c(0x210)])_0x42c548[_0x2f298c(0x210)]=_0x461908['profile'];this[_0x2f298c(0x1de)]={'cliFlags':_0x42c548,'session':_0x1a21f7(_0x42d688),'project':_0x1a21f7(_0x5eb6f6),'profile':_0x1a21f7(_0x585d3a?.[_0x2f298c(0x1fa)]),'global':_0x1a21f7(_0x91aa60)};const _0x85a48f={...this[_0x2f298c(0x1de)][_0x2f298c(0x20a)],...this['layers'][_0x2f298c(0x210)],...this[_0x2f298c(0x1de)][_0x2f298c(0x1ed)],...this[_0x2f298c(0x1de)]['session'],...this[_0x2f298c(0x1de)][_0x2f298c(0x20b)]},_0xe3161=_0x85a48f['site']||_0x2f298c(0x216);this[_0x2f298c(0x21f)]=resolveSite(_0xe3161),this['database']=_0x85a48f[_0x2f298c(0x1e3)],this[_0x2f298c(0x1e9)]=_0x85a48f[_0x2f298c(0x1e9)],this[_0x2f298c(0x1e2)]=_0x85a48f[_0x2f298c(0x1e2)],this[_0x2f298c(0x208)]=_0x85a48f['llm_project'],this[_0x2f298c(0x21e)]=_0x461908['verbose']||![],this[_0x2f298c(0x1f1)]=_0x461908['logLevel']??LogLevel['INFO'],this['apiKey']=getAPIKey(this[_0x2f298c(0x21f)],this[_0x2f298c(0x21d)]||undefined);const _0x14520a=getConfigDir(),_0x222c92=a39_0x45cf38[_0x2f298c(0x1f6)](_0x14520a,_0x2f298c(0x20d),this[_0x2f298c(0x1df)]+_0x2f298c(0x1f3)),_0x8804cb=findProjectConfigPath(),_0x2cfa67=a39_0x45cf38[_0x2f298c(0x1f6)](_0x14520a,'tdx.json'),_0x56bda8=a39_0x45cf38[_0x2f298c(0x1f6)](_0x14520a,_0x2f298c(0x1ef));let _0x183410=null,_0x2b1b76=null;this[_0x2f298c(0x21d)]&&(_0x183410=a39_0x45cf38[_0x2f298c(0x1f6)](_0x14520a,_0x2f298c(0x211),this['activeProfile'],_0x2f298c(0x21b)),_0x2b1b76=a39_0x45cf38['join'](_0x14520a,_0x2f298c(0x211),this[_0x2f298c(0x21d)],_0x2f298c(0x1ef))),this['configFiles']={'session':a39_0x14af5d[_0x2f298c(0x1fe)](_0x222c92)?_0x222c92:null,'project':_0x8804cb,'profile':_0x183410&&a39_0x14af5d['existsSync'](_0x183410)?_0x183410:null,'profileCredentials':_0x2b1b76&&a39_0x14af5d[_0x2f298c(0x1fe)](_0x2b1b76)?_0x2b1b76:null,'global':a39_0x14af5d['existsSync'](_0x2cfa67)?_0x2cfa67:null,'globalCredentials':a39_0x14af5d[_0x2f298c(0x1fe)](_0x56bda8)?_0x56bda8:null};}[a39_0x146272(0x209)](_0x4e8703,_0x468f45){const _0x289844=a39_0x146272;if(!_0x468f45)return _0x289844(0x1ee);const _0x56f8ee=_0x468f45;if(this[_0x289844(0x1de)]['cliFlags'][_0x4e8703]===_0x56f8ee){if(_0x4e8703===_0x289844(0x21f)&&_0x56f8ee===_0x289844(0x216)&&!this[_0x289844(0x1de)][_0x289844(0x218)][_0x289844(0x21f)]&&!this['layers'][_0x289844(0x1ed)][_0x289844(0x21f)]&&!this['layers'][_0x289844(0x210)][_0x289844(0x21f)]&&!this[_0x289844(0x1de)][_0x289844(0x20a)]['site'])return _0x289844(0x1ec);return _0x289844(0x20c)+_0x4e8703['replace'](/_/g,'-');}if(this[_0x289844(0x1de)][_0x289844(0x218)][_0x4e8703]===_0x56f8ee)return _0x289844(0x218);if(this['layers'][_0x289844(0x1ed)][_0x4e8703]===_0x56f8ee)return'project';if(this[_0x289844(0x1de)][_0x289844(0x210)][_0x4e8703]===_0x56f8ee)return'profile:\x20'+this[_0x289844(0x21d)];if(this[_0x289844(0x1de)][_0x289844(0x20a)][_0x4e8703]===_0x56f8ee)return _0x289844(0x20a);return _0x289844(0x1ec);}[a39_0x146272(0x213)](){const _0xd6dea5=a39_0x146272,_0x3a645c=a39_0x45cf38[_0xd6dea5(0x1f6)](getConfigDir(),_0xd6dea5(0x21b));if(!a39_0x14af5d[_0xd6dea5(0x1fe)](_0x3a645c))return{};try{const _0x4c51c9=a39_0x14af5d[_0xd6dea5(0x1fb)](_0x3a645c,_0xd6dea5(0x1eb));return JSON[_0xd6dea5(0x1e1)](_0x4c51c9);}catch{return{};}}['injectIntoOptions'](_0x4d6271){const _0x5bf5f7=a39_0x146272;_0x4d6271[_0x5bf5f7(0x21f)]=this[_0x5bf5f7(0x21f)],!_0x4d6271['database']&&this[_0x5bf5f7(0x1e3)]&&(_0x4d6271['database']=this[_0x5bf5f7(0x1e3)]),!_0x4d6271[_0x5bf5f7(0x1e8)]&&this[_0x5bf5f7(0x1e9)]&&(_0x4d6271[_0x5bf5f7(0x1e8)]=this[_0x5bf5f7(0x1e9)]),!_0x4d6271[_0x5bf5f7(0x214)]&&this[_0x5bf5f7(0x1e2)]&&(_0x4d6271[_0x5bf5f7(0x214)]=this['segment_path']),!_0x4d6271['llmProject']&&this[_0x5bf5f7(0x208)]&&(_0x4d6271[_0x5bf5f7(0x201)]=this[_0x5bf5f7(0x208)]);}['getParameters'](){const _0x2b2c45=a39_0x146272;return[{'key':_0x2b2c45(0x21f),'value':this['site']},{'key':_0x2b2c45(0x1e3),'value':this[_0x2b2c45(0x1e3)]},{'key':_0x2b2c45(0x1e9),'value':this[_0x2b2c45(0x1e9)]},{'key':_0x2b2c45(0x1e2),'value':this[_0x2b2c45(0x1e2)]},{'key':'llm_project','value':this[_0x2b2c45(0x208)]},{'key':_0x2b2c45(0x210),'value':this[_0x2b2c45(0x21d)]||undefined}];}[a39_0x146272(0x1fc)](){const _0x914f87=a39_0x146272;console[_0x914f87(0x21c)]('[context]');for(const {key:_0x2233ae,value:_0xc8704e}of this[_0x914f87(0x204)]()){_0xc8704e&&console[_0x914f87(0x21c)](_0x2233ae+':\x20'+_0xc8704e);}}[a39_0x146272(0x205)](){const _0x1ab8b5=a39_0x146272;console['log'](_0x1ab8b5(0x20e));for(const {key:_0x3a99fc,value:_0x21b55c}of this[_0x1ab8b5(0x204)]()){if(_0x21b55c){const _0x581ed=_0x3a99fc===_0x1ab8b5(0x210)?'(active)':'('+this['getSource'](_0x3a99fc,_0x21b55c)+')';console[_0x1ab8b5(0x21c)](_0x3a99fc+':\x20'+_0x21b55c+'\x20'+_0x581ed);}}console[_0x1ab8b5(0x21c)]('\x0a[configuration\x20files]');const _0x293fd7=[{'label':_0x1ab8b5(0x1e5),'path':this['configFiles'][_0x1ab8b5(0x218)],'extra':_0x1ab8b5(0x207)+this[_0x1ab8b5(0x1df)]+')'},{'label':'Project','path':this[_0x1ab8b5(0x1ea)][_0x1ab8b5(0x1ed)]},{'label':_0x1ab8b5(0x1ff),'path':this[_0x1ab8b5(0x1ea)][_0x1ab8b5(0x210)]},{'label':_0x1ab8b5(0x203),'path':this['configFiles'][_0x1ab8b5(0x215)]},{'label':_0x1ab8b5(0x1e0),'path':this[_0x1ab8b5(0x1ea)][_0x1ab8b5(0x20a)]},{'label':_0x1ab8b5(0x1f5),'path':this[_0x1ab8b5(0x1ea)][_0x1ab8b5(0x1f7)]}];for(const {label:_0x5c3d29,path:_0x3c661c,extra:_0x4491cd}of _0x293fd7){if(_0x3c661c)console[_0x1ab8b5(0x21c)](_0x5c3d29+':\x20'+_0x3c661c+'\x20✓'+(_0x4491cd?'\x20'+_0x4491cd:''));else{if(_0x5c3d29===_0x1ab8b5(0x1e5))console[_0x1ab8b5(0x21c)](_0x5c3d29+_0x1ab8b5(0x20f)+this[_0x1ab8b5(0x1df)]+')');else(_0x5c3d29===_0x1ab8b5(0x219)||_0x5c3d29===_0x1ab8b5(0x1e0))&&console[_0x1ab8b5(0x21c)](_0x5c3d29+_0x1ab8b5(0x1e7));}}}async[a39_0x146272(0x1e6)](){const _0x10690f=a39_0x146272;return this[_0x10690f(0x1e4)]=await getAPIKeyAsync(this[_0x10690f(0x21f)],this['activeProfile']||undefined),this['apiKey'];}static async[a39_0x146272(0x1f2)](_0x1a9d60){const _0x1f511e=new GlobalContext(_0x1a9d60);return await _0x1f511e['resolveAPIKeyAsync'](),_0x1f511e;}}
1
+ const a39_0x40ada9=a39_0x5495;(function(_0xb96569,_0x5c6833){const _0x4696a4=a39_0x5495,_0xc7df5c=_0xb96569();while(!![]){try{const _0x472317=parseInt(_0x4696a4(0xee))/0x1*(parseInt(_0x4696a4(0x114))/0x2)+-parseInt(_0x4696a4(0xfa))/0x3+parseInt(_0x4696a4(0x112))/0x4+parseInt(_0x4696a4(0xfb))/0x5+parseInt(_0x4696a4(0xd8))/0x6*(parseInt(_0x4696a4(0xd7))/0x7)+parseInt(_0x4696a4(0xfe))/0x8+-parseInt(_0x4696a4(0x107))/0x9;if(_0x472317===_0x5c6833)break;else _0xc7df5c['push'](_0xc7df5c['shift']());}catch(_0x1d69f6){_0xc7df5c['push'](_0xc7df5c['shift']());}}}(a39_0x50f6,0x6ce5f));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a39_0x5495(_0x5df58a,_0x5687f7){const _0x50f61c=a39_0x50f6();return a39_0x5495=function(_0x549581,_0x29101b){_0x549581=_0x549581-0xd2;let _0x285107=_0x50f61c[_0x549581];return _0x285107;},a39_0x5495(_0x5df58a,_0x5687f7);}import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';function a39_0x50f6(){const _0x304bb9=['logLevel','us01',':\x20none','layers','segment_path','config','segmentPath','verbose','14728248HdUGmQ','[context]','not\x20set','utf-8','(active)','site','display','project','tdx.json','global','injectIntoOptions','1242092KwfoEs','Global\x20Credentials','2ilkEsK','existsSync','resolveAPIKeyAsync','.env','profile:\x20','parentSegment','1906499dDLWFP','12kCOwSa','getSource','sessionId','CLI\x20flag:\x20--','string','session','llmProject','entries','default','loadGlobalConfig','profileCredentials','Profile','cliFlags','Project','\x0a[configuration\x20files]','log','Profile\x20Credentials','activeProfile','replace','configFiles','join','apiKey','334784tcTNaD','profile','Global','getParameters','Session','llm_project','.json','createAsync','parse','globalCredentials','INFO','database','522705oDEqLV','3749300jRsOnL','parent_segment',':\x20none\x20(using\x20session:\x20','2534984PEmvpa'];a39_0x50f6=function(){return _0x304bb9;};return a39_0x50f6();}import*as a39_0x47198b from'node:fs';import*as a39_0x45a7e5 from'node:path';export class GlobalContext{['site'];[a39_0x40ada9(0xf9)];['parent_segment'];[a39_0x40ada9(0x103)];['llm_project'];[a39_0x40ada9(0xed)];[a39_0x40ada9(0x106)];[a39_0x40ada9(0xff)];[a39_0x40ada9(0x102)];[a39_0x40ada9(0xe9)];['sessionId'];[a39_0x40ada9(0xeb)];constructor(_0x2a3459){const _0x499966=a39_0x40ada9;this[_0x499966(0xda)]=_0x2a3459[_0x499966(0xdd)]||getCurrentSessionPID()['toString']();const _0x26db54=loadSessionContext(_0x2a3459[_0x499966(0xdd)]),_0x486df5=loadProjectConfig(),_0x9f233f=this[_0x499966(0xe1)]();this[_0x499966(0xe9)]=_0x2a3459[_0x499966(0xef)]||_0x26db54?.['profile']||_0x9f233f['profile']||getActiveProfile();const _0x4cdef4=this[_0x499966(0xe9)]?loadProfile(this['activeProfile']):null,_0x3e8202=_0x5b4c5a=>{const _0x26204d=_0x499966;if(!_0x5b4c5a)return{};const _0x2713c2=_0x5b4c5a,_0x6e0181={};for(const [_0x38471a,_0x1caa85]of Object[_0x26204d(0xdf)](_0x2713c2)){typeof _0x1caa85===_0x26204d(0xdc)&&(_0x6e0181[_0x38471a]=_0x1caa85);}return _0x6e0181;},_0x51f93a={};if(_0x2a3459[_0x499966(0x10c)]&&_0x2a3459[_0x499966(0x10c)]!=='us01')_0x51f93a[_0x499966(0x10c)]=_0x2a3459[_0x499966(0x10c)];const _0x5d09f7=_0x26db54?.[_0x499966(0xf9)],_0x4c66b9=_0x486df5?.['database'],_0x2cf7ab=_0x4cdef4?.['config']?.[_0x499966(0xf9)],_0x370022=_0x9f233f[_0x499966(0xf9)];_0x2a3459[_0x499966(0xf9)]&&(_0x2a3459['database']!==_0x5d09f7&&_0x2a3459['database']!==_0x4c66b9&&_0x2a3459[_0x499966(0xf9)]!==_0x2cf7ab&&_0x2a3459[_0x499966(0xf9)]!==_0x370022)&&(_0x51f93a[_0x499966(0xf9)]=_0x2a3459[_0x499966(0xf9)]);if(_0x2a3459['parentSegment'])_0x51f93a[_0x499966(0xfc)]=_0x2a3459[_0x499966(0xd6)];if(_0x2a3459['llmProject'])_0x51f93a[_0x499966(0xf3)]=_0x2a3459['llmProject'];if(_0x2a3459[_0x499966(0xef)])_0x51f93a[_0x499966(0xef)]=_0x2a3459[_0x499966(0xef)];this['layers']={'cliFlags':_0x51f93a,'session':_0x3e8202(_0x26db54),'project':_0x3e8202(_0x486df5),'profile':_0x3e8202(_0x4cdef4?.[_0x499966(0x104)]),'global':_0x3e8202(_0x9f233f)};const _0x566c6e={...this[_0x499966(0x102)]['global'],...this[_0x499966(0x102)][_0x499966(0xef)],...this[_0x499966(0x102)][_0x499966(0x10e)],...this[_0x499966(0x102)][_0x499966(0xdd)],...this['layers']['cliFlags']},_0x5a4c04=_0x566c6e[_0x499966(0x10c)]||_0x499966(0x100);this['site']=resolveSite(_0x5a4c04),this[_0x499966(0xf9)]=_0x566c6e[_0x499966(0xf9)],this[_0x499966(0xfc)]=_0x566c6e['parent_segment'],this[_0x499966(0x103)]=_0x566c6e[_0x499966(0x103)],this['llm_project']=_0x566c6e['llm_project'],this[_0x499966(0x106)]=_0x2a3459[_0x499966(0x106)]||![],this[_0x499966(0xff)]=_0x2a3459[_0x499966(0xff)]??LogLevel[_0x499966(0xf8)],this[_0x499966(0xed)]=getAPIKey(this[_0x499966(0x10c)],this[_0x499966(0xe9)]||undefined);const _0x5d04d2=getConfigDir(),_0x347d6a=a39_0x45a7e5[_0x499966(0xec)](_0x5d04d2,'sessions',this[_0x499966(0xda)]+_0x499966(0xf4)),_0xc92bc6=findProjectConfigPath(),_0x1af45c=a39_0x45a7e5['join'](_0x5d04d2,_0x499966(0x10f)),_0x41d297=a39_0x45a7e5[_0x499966(0xec)](_0x5d04d2,_0x499966(0xd4));let _0x5b6217=null,_0x3bc0e4=null;this[_0x499966(0xe9)]&&(_0x5b6217=a39_0x45a7e5[_0x499966(0xec)](_0x5d04d2,'profiles',this[_0x499966(0xe9)],_0x499966(0x10f)),_0x3bc0e4=a39_0x45a7e5['join'](_0x5d04d2,'profiles',this[_0x499966(0xe9)],_0x499966(0xd4))),this[_0x499966(0xeb)]={'session':a39_0x47198b[_0x499966(0xd2)](_0x347d6a)?_0x347d6a:null,'project':_0xc92bc6,'profile':_0x5b6217&&a39_0x47198b['existsSync'](_0x5b6217)?_0x5b6217:null,'profileCredentials':_0x3bc0e4&&a39_0x47198b[_0x499966(0xd2)](_0x3bc0e4)?_0x3bc0e4:null,'global':a39_0x47198b['existsSync'](_0x1af45c)?_0x1af45c:null,'globalCredentials':a39_0x47198b[_0x499966(0xd2)](_0x41d297)?_0x41d297:null};}[a39_0x40ada9(0xd9)](_0x1d0e01,_0x40e582){const _0x1bbcf8=a39_0x40ada9;if(!_0x40e582)return _0x1bbcf8(0x109);const _0x2cb6f6=_0x40e582;if(this[_0x1bbcf8(0x102)][_0x1bbcf8(0xe4)][_0x1d0e01]===_0x2cb6f6){if(_0x1d0e01===_0x1bbcf8(0x10c)&&_0x2cb6f6===_0x1bbcf8(0x100)&&!this[_0x1bbcf8(0x102)][_0x1bbcf8(0xdd)][_0x1bbcf8(0x10c)]&&!this[_0x1bbcf8(0x102)][_0x1bbcf8(0x10e)]['site']&&!this[_0x1bbcf8(0x102)][_0x1bbcf8(0xef)][_0x1bbcf8(0x10c)]&&!this[_0x1bbcf8(0x102)]['global']['site'])return _0x1bbcf8(0xe0);return _0x1bbcf8(0xdb)+_0x1d0e01[_0x1bbcf8(0xea)](/_/g,'-');}if(this[_0x1bbcf8(0x102)][_0x1bbcf8(0xdd)][_0x1d0e01]===_0x2cb6f6)return _0x1bbcf8(0xdd);if(this[_0x1bbcf8(0x102)][_0x1bbcf8(0x10e)][_0x1d0e01]===_0x2cb6f6)return _0x1bbcf8(0x10e);if(this[_0x1bbcf8(0x102)]['profile'][_0x1d0e01]===_0x2cb6f6)return _0x1bbcf8(0xd5)+this[_0x1bbcf8(0xe9)];if(this[_0x1bbcf8(0x102)][_0x1bbcf8(0x110)][_0x1d0e01]===_0x2cb6f6)return _0x1bbcf8(0x110);return _0x1bbcf8(0xe0);}[a39_0x40ada9(0xe1)](){const _0x500907=a39_0x40ada9,_0x3a91f7=a39_0x45a7e5[_0x500907(0xec)](getConfigDir(),_0x500907(0x10f));if(!a39_0x47198b['existsSync'](_0x3a91f7))return{};try{const _0x9150df=a39_0x47198b['readFileSync'](_0x3a91f7,_0x500907(0x10a));return JSON[_0x500907(0xf6)](_0x9150df);}catch{return{};}}[a39_0x40ada9(0x111)](_0x662dae){const _0x208cbc=a39_0x40ada9;_0x662dae[_0x208cbc(0x10c)]=this[_0x208cbc(0x10c)],!_0x662dae[_0x208cbc(0xf9)]&&this[_0x208cbc(0xf9)]&&(_0x662dae[_0x208cbc(0xf9)]=this[_0x208cbc(0xf9)]),!_0x662dae[_0x208cbc(0xd6)]&&this[_0x208cbc(0xfc)]&&(_0x662dae[_0x208cbc(0xd6)]=this[_0x208cbc(0xfc)]),!_0x662dae[_0x208cbc(0x105)]&&this[_0x208cbc(0x103)]&&(_0x662dae[_0x208cbc(0x105)]=this[_0x208cbc(0x103)]),!_0x662dae[_0x208cbc(0xde)]&&this[_0x208cbc(0xf3)]&&(_0x662dae[_0x208cbc(0xde)]=this[_0x208cbc(0xf3)]);}['getParameters'](){const _0x20524b=a39_0x40ada9;return[{'key':_0x20524b(0x10c),'value':this['site']},{'key':_0x20524b(0xf9),'value':this[_0x20524b(0xf9)]},{'key':_0x20524b(0xfc),'value':this[_0x20524b(0xfc)]},{'key':_0x20524b(0x103),'value':this['segment_path']},{'key':_0x20524b(0xf3),'value':this[_0x20524b(0xf3)]},{'key':'profile','value':this[_0x20524b(0xe9)]||undefined}];}[a39_0x40ada9(0x10d)](){const _0x1f631d=a39_0x40ada9;console[_0x1f631d(0xe7)](_0x1f631d(0x108));for(const {key:_0x20769c,value:_0x24d11c}of this['getParameters']()){_0x24d11c&&console[_0x1f631d(0xe7)](_0x20769c+':\x20'+_0x24d11c);}}['displayWithSources'](){const _0x50a564=a39_0x40ada9;console[_0x50a564(0xe7)](_0x50a564(0x108));for(const {key:_0xa81d0c,value:_0x35751b}of this[_0x50a564(0xf1)]()){if(_0x35751b){const _0xb9d609=_0xa81d0c===_0x50a564(0xef)?_0x50a564(0x10b):'('+this[_0x50a564(0xd9)](_0xa81d0c,_0x35751b)+')';console['log'](_0xa81d0c+':\x20'+_0x35751b+'\x20'+_0xb9d609);}}console[_0x50a564(0xe7)](_0x50a564(0xe6));const _0x56f452=[{'label':_0x50a564(0xf2),'path':this['configFiles'][_0x50a564(0xdd)],'extra':'(session:\x20'+this[_0x50a564(0xda)]+')'},{'label':_0x50a564(0xe5),'path':this[_0x50a564(0xeb)][_0x50a564(0x10e)]},{'label':_0x50a564(0xe3),'path':this['configFiles'][_0x50a564(0xef)]},{'label':_0x50a564(0xe8),'path':this[_0x50a564(0xeb)][_0x50a564(0xe2)]},{'label':_0x50a564(0xf0),'path':this['configFiles']['global']},{'label':_0x50a564(0x113),'path':this['configFiles'][_0x50a564(0xf7)]}];for(const {label:_0x27e1bd,path:_0x5566d3,extra:_0x14930b}of _0x56f452){if(_0x5566d3)console[_0x50a564(0xe7)](_0x27e1bd+':\x20'+_0x5566d3+'\x20✓'+(_0x14930b?'\x20'+_0x14930b:''));else{if(_0x27e1bd===_0x50a564(0xf2))console[_0x50a564(0xe7)](_0x27e1bd+_0x50a564(0xfd)+this['sessionId']+')');else(_0x27e1bd==='Project'||_0x27e1bd===_0x50a564(0xf0))&&console['log'](_0x27e1bd+_0x50a564(0x101));}}}async[a39_0x40ada9(0xd3)](){const _0x3adad5=a39_0x40ada9;return this[_0x3adad5(0xed)]=await getAPIKeyAsync(this[_0x3adad5(0x10c)],this[_0x3adad5(0xe9)]||undefined),this[_0x3adad5(0xed)];}static async[a39_0x40ada9(0xf5)](_0xfd5d6a){const _0x58d9d7=new GlobalContext(_0xfd5d6a);return await _0x58d9d7['resolveAPIKeyAsync'](),_0x58d9d7;}}