@treasuredata/tdx 0.4.6 → 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
- const a33_0x5b9b7b=a33_0x18d8;function a33_0x8550(){const _0x26de10=['\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','1031217STmtgp','Database:\x20','✔\x20Found\x20','error','\x27\x20across\x20all\x20databases.','Or\x20use\x20--in\x20flag:','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','validate','6ObgCNU','Error:\x20','name','database','Table\x20pattern:\x20','query','50880kBkSCH','verbose','483556vdfNjf','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','63vRIhlX','\x27\x20is\x20ambiguous.','Database:\x20all','Database\x20\x27','242568wFFVcN','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','128469qCDRsu','tables','description','execute','719411lUURTR','Note:\x20\x27','.*\x22','table','cause','1382064BudLSv','length','includes','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','data','site','message','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','✖\x20No\x20tables\x20found','Site:\x20','Database\x20pattern:\x20'];a33_0x8550=function(){return _0x26de10;};return a33_0x8550();}(function(_0x5ec1f9,_0xd1b881){const _0x3e048a=a33_0x18d8,_0x40e3e7=_0x5ec1f9();while(!![]){try{const _0x53b230=parseInt(_0x3e048a(0x13e))/0x1+-parseInt(_0x3e048a(0x135))/0x2+-parseInt(_0x3e048a(0x125))/0x3+parseInt(_0x3e048a(0x147))/0x4+parseInt(_0x3e048a(0x133))/0x5*(-parseInt(_0x3e048a(0x12d))/0x6)+parseInt(_0x3e048a(0x142))/0x7+-parseInt(_0x3e048a(0x13b))/0x8*(-parseInt(_0x3e048a(0x137))/0x9);if(_0x53b230===_0xd1b881)break;else _0x40e3e7['push'](_0x40e3e7['shift']());}catch(_0xa3932c){_0x40e3e7['push'](_0x40e3e7['shift']());}}}(a33_0x8550,0x2f320));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';function a33_0x18d8(_0x26f590,_0x59a023){const _0x855063=a33_0x8550();return a33_0x18d8=function(_0x18d81c,_0x3c0c35){_0x18d81c=_0x18d81c-0x11e;let _0x4bcdc2=_0x855063[_0x18d81c];return _0x4bcdc2;},a33_0x18d8(_0x26f590,_0x59a023);}export class TablesCommand extends BaseCommand{[a33_0x5b9b7b(0x12f)]=a33_0x5b9b7b(0x13f);[a33_0x5b9b7b(0x140)]='List\x20tables\x20in\x20a\x20database';async[a33_0x5b9b7b(0x141)](_0x246d69){const _0x380b6e=a33_0x5b9b7b,{options:_0x3bbc2a,args:_0x1e0ce5,tdx:_0xbec6b0}=_0x246d69;let _0x328ca7;if(_0x1e0ce5[_0x380b6e(0x148)]===0x0)_0x328ca7={'database':undefined,'table':undefined,'original':''};else{if(_0x1e0ce5[_0x380b6e(0x148)]===0x1)try{_0x328ca7=parseTableReference(_0x1e0ce5[0x0]);if(_0x328ca7[_0x380b6e(0x145)]&&!_0x328ca7[_0x380b6e(0x130)]&&!_0x328ca7[_0x380b6e(0x145)][_0x380b6e(0x149)]('*')&&!_0x328ca7[_0x380b6e(0x145)][_0x380b6e(0x149)]('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x1e0ce5[0x0]+_0x380b6e(0x138)),console[_0x380b6e(0x128)](_0x380b6e(0x14a)+_0x328ca7[_0x380b6e(0x145)]+'\x27?'),console['error'](_0x380b6e(0x13c)+_0x328ca7[_0x380b6e(0x145)]+_0x380b6e(0x144)),console[_0x380b6e(0x128)](_0x380b6e(0x13d)+_0x328ca7[_0x380b6e(0x145)]),console[_0x380b6e(0x128)](_0x380b6e(0x136)+_0x328ca7['table']),console[_0x380b6e(0x128)](''),console[_0x380b6e(0x128)](_0x380b6e(0x143)+_0x1e0ce5[0x0]+_0x380b6e(0x12b)+_0x328ca7['table']+_0x380b6e(0x129)),0x1;}catch(_0x5bc60f){return console[_0x380b6e(0x128)]('Error:\x20'+_0x5bc60f[_0x380b6e(0x11f)]),0x1;}else return console[_0x380b6e(0x128)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x380b6e(0x128)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x380b6e(0x128)](_0x380b6e(0x124)),console[_0x380b6e(0x128)](_0x380b6e(0x120)),console[_0x380b6e(0x128)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console['error'](_0x380b6e(0x12a)),console[_0x380b6e(0x128)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0xbe853f=_0x3bbc2a[_0x380b6e(0x130)];!_0x328ca7['database']&&_0xbe853f&&(_0x328ca7[_0x380b6e(0x130)]=_0xbe853f);try{const _0xdff1fe=_0x3dc05c=>_0x3dc05c&&(_0x3dc05c[_0x380b6e(0x149)]('*')||_0x3dc05c[_0x380b6e(0x149)]('?')),_0x441cd0=_0xdff1fe(_0x328ca7[_0x380b6e(0x130)]);_0x3bbc2a[_0x380b6e(0x134)]&&(console[_0x380b6e(0x128)](_0x380b6e(0x122)+_0x3bbc2a[_0x380b6e(0x11e)]),_0x328ca7[_0x380b6e(0x130)]?_0x441cd0?console[_0x380b6e(0x128)](_0x380b6e(0x123)+_0x328ca7[_0x380b6e(0x130)]):console['error'](_0x380b6e(0x126)+_0x328ca7[_0x380b6e(0x130)]):console[_0x380b6e(0x128)](_0x380b6e(0x139)),_0x328ca7[_0x380b6e(0x145)]&&console['error'](_0x380b6e(0x131)+_0x328ca7[_0x380b6e(0x145)]));const _0x20fd12=_0x328ca7['database']&&!_0x441cd0?_0x328ca7[_0x380b6e(0x130)]:undefined,_0xd09209=_0x441cd0?_0x328ca7[_0x380b6e(0x130)]:undefined,_0x4a1e9f=_0x328ca7[_0x380b6e(0x145)],_0x47dd5c=resolveLimit(_0x3bbc2a['limit'],DEFAULT_LISTING_LIMIT),_0x6a62f5=await withSpinner('Listing\x20tables...',()=>_0xbec6b0[_0x380b6e(0x132)]['listTables'](_0x20fd12,_0x4a1e9f,_0xd09209,_0x47dd5c),{'verbose':_0x3bbc2a[_0x380b6e(0x134)]}),_0xa7bdd0=_0x6a62f5[_0x380b6e(0x14b)];if(_0xa7bdd0[_0x380b6e(0x148)]===0x0&&_0x328ca7['database']&&!_0x441cd0)return console['error'](_0x380b6e(0x121)),console[_0x380b6e(0x128)](_0x380b6e(0x13a)+_0x328ca7[_0x380b6e(0x130)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x380b6e(0x128)](_0x380b6e(0x127)+_0xa7bdd0[_0x380b6e(0x148)]+'\x20table'+(_0xa7bdd0[_0x380b6e(0x148)]!==0x1?'s':'')),await handleSDKOutput(_0xa7bdd0,{..._0x3bbc2a,'limit':_0x47dd5c}),0x0;}catch(_0x78befa){if(_0x78befa instanceof SDKError)return console['error'](_0x380b6e(0x12e)+_0x78befa[_0x380b6e(0x11f)]),_0x78befa[_0x380b6e(0x146)]&&console[_0x380b6e(0x128)]('\x20\x20Cause:\x20'+_0x78befa[_0x380b6e(0x146)]),0x1;throw _0x78befa;}}[a33_0x5b9b7b(0x12c)](_0x491898){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
- const a34_0x32ce9d=a34_0x1a64;(function(_0x5ffe8e,_0x289c29){const _0x267e52=a34_0x1a64,_0x199e60=_0x5ffe8e();while(!![]){try{const _0x444d0b=-parseInt(_0x267e52(0x134))/0x1*(-parseInt(_0x267e52(0x12d))/0x2)+parseInt(_0x267e52(0x122))/0x3+parseInt(_0x267e52(0x11f))/0x4*(-parseInt(_0x267e52(0x110))/0x5)+-parseInt(_0x267e52(0x129))/0x6*(parseInt(_0x267e52(0x11c))/0x7)+-parseInt(_0x267e52(0x113))/0x8+parseInt(_0x267e52(0x111))/0x9*(parseInt(_0x267e52(0x120))/0xa)+-parseInt(_0x267e52(0x126))/0xb*(-parseInt(_0x267e52(0x130))/0xc);if(_0x444d0b===_0x289c29)break;else _0x199e60['push'](_0x199e60['shift']());}catch(_0x5ed447){_0x199e60['push'](_0x199e60['shift']());}}}(a34_0x2de0,0x9dd9b));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a34_0x1a64(_0x366c60,_0xcb2cd3){const _0x2de04c=a34_0x2de0();return a34_0x1a64=function(_0x1a64e6,_0x21f3fc){_0x1a64e6=_0x1a64e6-0x10e;let _0x15a9b3=_0x2de04c[_0x1a64e6];return _0x15a9b3;},a34_0x1a64(_0x366c60,_0xcb2cd3);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{['name']='use';[a34_0x32ce9d(0x132)]=a34_0x32ce9d(0x116);[a34_0x32ce9d(0x12a)](_0x45161f){const _0x3816ad=a34_0x32ce9d,{args:_0x53054b}=_0x45161f;if(_0x53054b['length']<0x2)return _0x3816ad(0x11e)+_0x3816ad(0x127)+_0x3816ad(0x11a)+_0x3816ad(0x12c);const _0x21f7db=_0x53054b[0x0],_0x5236e9=[_0x3816ad(0x125),_0x3816ad(0x117),_0x3816ad(0x112),_0x3816ad(0x131),_0x3816ad(0x118)];if(!_0x5236e9[_0x3816ad(0x124)](_0x21f7db))return'Invalid\x20resource:\x20'+_0x21f7db+_0x3816ad(0x133)+_0x5236e9[_0x3816ad(0x115)](',\x20');return undefined;}async[a34_0x32ce9d(0x135)](_0x57be73){const _0x4a226e=a34_0x32ce9d,{args:_0x21b640,options:_0x2ba6b9}=_0x57be73;try{const _0x3f8b3e=_0x21b640[0x0],_0x3b247b=_0x21b640[0x1];if(_0x3f8b3e===_0x4a226e(0x131)){if(!profileExists(_0x3b247b))return console[_0x4a226e(0x12e)](_0x4a226e(0x12f)+_0x3b247b+_0x4a226e(0x123)),console[_0x4a226e(0x12e)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x113b4d=_0x2ba6b9[_0x4a226e(0x121)]||getCurrentSessionPID()[_0x4a226e(0x12b)]();return saveSessionContext({'profile':_0x3b247b},_0x2ba6b9[_0x4a226e(0x121)]),console[_0x4a226e(0x10e)](_0x4a226e(0x119)+_0x3b247b+_0x4a226e(0x114)+_0x113b4d+')'),console['log'](_0x4a226e(0x11d)),0x0;}const _0x5703ec={},_0x4c64c7=_0x2ba6b9[_0x4a226e(0x121)]||getCurrentSessionPID()[_0x4a226e(0x12b)]();switch(_0x3f8b3e){case _0x4a226e(0x125):_0x5703ec['database']=_0x3b247b,console['log']('Session\x20database\x20set\x20to:\x20'+_0x3b247b+'\x20(session:\x20'+_0x4c64c7+')');break;case _0x4a226e(0x117):_0x5703ec['parent_segment']=_0x3b247b,console['log'](_0x4a226e(0x128)+_0x3b247b+_0x4a226e(0x114)+_0x4c64c7+')');break;case _0x4a226e(0x112):_0x5703ec[_0x4a226e(0x112)]=_0x3b247b,console[_0x4a226e(0x10e)]('Session\x20llm_project\x20set\x20to:\x20'+_0x3b247b+'\x20(session:\x20'+_0x4c64c7+')');break;case _0x4a226e(0x118):_0x5703ec[_0x4a226e(0x118)]=_0x3b247b,console[_0x4a226e(0x10e)](_0x4a226e(0x10f)+_0x3b247b+'\x20(session:\x20'+_0x4c64c7+')');break;}return saveSessionContext(_0x5703ec,_0x2ba6b9[_0x4a226e(0x121)]),console[_0x4a226e(0x10e)](_0x4a226e(0x11d)),0x0;}catch(_0x39d5ac){return _0x39d5ac instanceof Error&&console[_0x4a226e(0x12e)](_0x4a226e(0x11b)+_0x39d5ac['message']),0x1;}}}function a34_0x2de0(){const _0x3e73e3=['Error:\x20Profile\x20\x27','37788BIMdWl','profile','description','.\x20Must\x20be\x20one\x20of:\x20','442324lOgKzO','execute','log','Session\x20engage_workspace\x20set\x20to:\x20','365nLszFh','4203VugKYX','llm_project','9465896wdNwaU','\x20(session:\x20','join','Set\x20session-level\x20context','parent_segment','engage_workspace','Session\x20profile\x20set\x20to:\x20','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Error:\x20','175tgqyoo','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','11596lashdD','12290CgIsuW','session','1161105ExCnWT','\x27\x20does\x20not\x20exist','includes','database','5027oeXAXR','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','Session\x20parent_segment\x20set\x20to:\x20','298392OFJdDK','validate','toString','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','4FHUGUG','error'];a34_0x2de0=function(){return _0x3e73e3;};return a34_0x2de0();}
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_0x254837=a35_0x4aad;function a35_0x4aad(_0xa72fa5,_0x5485d8){const _0x4dce67=a35_0x4dce();return a35_0x4aad=function(_0x4aad6e,_0x3fffce){_0x4aad6e=_0x4aad6e-0x17e;let _0x224aca=_0x4dce67[_0x4aad6e];return _0x224aca;},a35_0x4aad(_0xa72fa5,_0x5485d8);}(function(_0x51ebdb,_0x3d6d5b){const _0x1f38be=a35_0x4aad,_0x4d40e9=_0x51ebdb();while(!![]){try{const _0x49981e=-parseInt(_0x1f38be(0x19c))/0x1*(-parseInt(_0x1f38be(0x199))/0x2)+parseInt(_0x1f38be(0x214))/0x3+parseInt(_0x1f38be(0x1b5))/0x4*(parseInt(_0x1f38be(0x1e8))/0x5)+parseInt(_0x1f38be(0x209))/0x6*(-parseInt(_0x1f38be(0x21e))/0x7)+-parseInt(_0x1f38be(0x1a4))/0x8*(-parseInt(_0x1f38be(0x1f3))/0x9)+-parseInt(_0x1f38be(0x1f5))/0xa+parseInt(_0x1f38be(0x1ad))/0xb*(parseInt(_0x1f38be(0x1f9))/0xc);if(_0x49981e===_0x3d6d5b)break;else _0x4d40e9['push'](_0x4d40e9['shift']());}catch(_0x1837ff){_0x4d40e9['push'](_0x4d40e9['shift']());}}}(a35_0x4dce,0x96771));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_0x32181b from'prompts';function a35_0x4dce(){const _0x180e04=['Project\x20directory:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','stat','error','✔\x20Found\x20','fileSize','stringify','workflow:projects','map','List\x20all\x20workflow\x20projects','\x20attempt','startsWith','Kill\x20a\x20running\x20attempt','round','data','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','\x20project','Error:\x20Project\x20name\x20is\x20required','workflow:workflows','json','session:','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','logFiles','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Listing\x20workflow\x20attempts...','✔\x20Pushed\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:logs','isArray','format','Retrying\x20session...','901245LuHuft','Start\x20a\x20workflow\x20run','Including\x20subtasks:\x20yes','Project\x20name:\x20','verbose','workflows','reason','canceling','createdAt','push','workflow','216819reImFA','tasks','12243600tzIMYS','Getting\x20attempt\x20details...','Status:\x20','readFile','60KrcMmr','workflow:delete','\x20\x20Attempt\x20ID:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','filesExtracted','Target:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','sessionTime','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20Project\x20ID:\x20','\x20session','getTime','\x20\x20Files\x20extracted:\x20','Pushing\x20workflow\x20project...','Filter:\x20project=','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','438AaXHDS','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','download','Session\x20time:\x20','✔\x20Retry\x20started','limit','\x20\x20Project:\x20','Project:\x20','split','\x20\x20Cause:\x20','keys','1142202oCFxqb','includeRetried','...','attemptId','Error:\x20Attempt\x20ID\x20is\x20required','fromTask','substring','Cancelled','session','resumeFrom','115976poOhBJ','Include\x20retried:\x20yes','description','\x20\x20Session\x20ID:\x20','Listing\x20workflow\x20projects...','Params:\x20','status','select','project','execute','\x20\x20Location:\x20','attempt:','from','includeSubtasks','\x20\x20New\x20attempt\x20ID:\x20','utf-8','Revision:\x20','Error:\x20','running','workflow:attempt','skipValidation','taskName','log','Starting\x20workflow\x20run...','Listing\x20workflows...','force','workflow:download','Validation:\x20skipped','workflow:kill','projectId','\x20task','Deleting\x20project\x20','Expected\x20format:\x20--param\x20key=value','workflow:sessions','16958zMZCtM','Killing\x20attempt...','task','36CkVQGZ','params','message','cause','retrySession','success','Error:\x20Workflow\x20identifier\x20is\x20required','finishedAt','296dcmwEj','✔\x20Downloaded\x20','Retrying\x20attempt...','Force:\x20yes','Resume\x20from:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','projects','List\x20workflow\x20attempts','Task\x20name:\x20','2843577zzABJj','retryAttemptName','Parameters:\x20','param','workflow:attempts','revision','parse','projectName','4cCpHrX','delete','attempt','Listing\x20workflow\x20sessions...','Pattern:\x20','Getting\x20attempt\x20tasks...','sessionId','Usage:\x20workflow:delete\x20<project-name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','name','done','\x20\x20Revision:\x20','yes','List\x20workflows','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','kill','workflow:retry','length','Attempt\x20ID:\x20','sessions'];a35_0x4dce=function(){return _0x180e04;};return a35_0x4dce();}export class WorkflowProjectsCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x1d0);[a35_0x254837(0x220)]=a35_0x254837(0x1d2);async[a35_0x254837(0x180)](_0x5ff385){const _0x48fcdb=a35_0x254837,{options:_0x19f2f5,args:_0x114943,tdx:_0x386b00}=_0x5ff385,_0x25c07b=_0x114943[0x0];try{_0x19f2f5[_0x48fcdb(0x1ec)]&&_0x25c07b&&console[_0x48fcdb(0x1cc)](_0x48fcdb(0x1b9)+_0x25c07b);const _0x1f1105=await withSpinner(_0x48fcdb(0x222),()=>_0x386b00[_0x48fcdb(0x1f2)][_0x48fcdb(0x1aa)](_0x25c07b,{'limit':_0x19f2f5['limit']}),{'verbose':_0x19f2f5[_0x48fcdb(0x1ec)]}),_0x503483=_0x1f1105[_0x48fcdb(0x1d7)];return console['error'](_0x48fcdb(0x1cd)+_0x503483[_0x48fcdb(0x1c6)]+_0x48fcdb(0x1d9)+(_0x503483[_0x48fcdb(0x1c6)]!==0x1?'s':'')),await handleSDKOutput(_0x503483,_0x19f2f5),0x0;}catch(_0x519a2e){if(_0x519a2e instanceof SDKError)return console['error'](_0x48fcdb(0x188)+_0x519a2e[_0x48fcdb(0x19e)]),_0x519a2e[_0x48fcdb(0x19f)]&&console[_0x48fcdb(0x1cc)](_0x48fcdb(0x212)+_0x519a2e[_0x48fcdb(0x19f)]),0x1;throw _0x519a2e;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x1db);[a35_0x254837(0x220)]=a35_0x254837(0x1c2);async[a35_0x254837(0x180)](_0x204b2e){const _0x25f62c=a35_0x254837,{options:_0x55bb8c,args:_0x147c56,tdx:_0x5ebf68}=_0x204b2e,_0x3f5538=_0x147c56[0x0];try{_0x55bb8c[_0x25f62c(0x1ec)]&&_0x3f5538&&console[_0x25f62c(0x1cc)]('Project\x20filter:\x20'+_0x3f5538);const _0x6a9705=await withSpinner(_0x25f62c(0x18f),()=>_0x5ebf68[_0x25f62c(0x1f2)][_0x25f62c(0x1ed)](_0x3f5538,{'limit':_0x55bb8c[_0x25f62c(0x20e)]}),{'verbose':_0x55bb8c['verbose']}),_0x5808c1=_0x6a9705[_0x25f62c(0x1d7)];return console['error'](_0x25f62c(0x1cd)+_0x5808c1[_0x25f62c(0x1c6)]+'\x20workflow'+(_0x5808c1['length']!==0x1?'s':'')),await handleSDKOutput(_0x5808c1,_0x55bb8c),0x0;}catch(_0x3c8c37){if(_0x3c8c37 instanceof SDKError)return console['error'](_0x25f62c(0x188)+_0x3c8c37[_0x25f62c(0x19e)]),_0x3c8c37['cause']&&console[_0x25f62c(0x1cc)]('\x20\x20Cause:\x20'+_0x3c8c37[_0x25f62c(0x19f)]),0x1;throw _0x3c8c37;}}}export class WorkflowSessionsCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x198);['description']='List\x20workflow\x20execution\x20sessions';async[a35_0x254837(0x180)](_0x29ac63){const _0x1300c2=a35_0x254837,{options:_0x9b7fc0,args:_0x40dc35,tdx:_0x5e661b}=_0x29ac63;let _0x47f05a,_0x401375;if(_0x40dc35[0x0]){const _0x1849bf=_0x40dc35[0x0]['split']('.');if(_0x1849bf[_0x1300c2(0x1c6)]===0x1)_0x47f05a=_0x1849bf[0x0];else{if(_0x1849bf['length']===0x2)[_0x47f05a,_0x401375]=_0x1849bf;else return console[_0x1300c2(0x1cc)](_0x1300c2(0x1a9)),0x1;}}try{if(_0x9b7fc0['verbose']){if(_0x47f05a&&_0x401375)console['error']('Filter:\x20'+_0x47f05a+'.'+_0x401375);else _0x47f05a&&console[_0x1300c2(0x1cc)](_0x1300c2(0x207)+_0x47f05a);const _0x59cb81=_0x9b7fc0[_0x1300c2(0x224)];_0x59cb81&&console[_0x1300c2(0x1cc)](_0x1300c2(0x1f7)+_0x59cb81);}const _0x5791c0=await withSpinner(_0x1300c2(0x1b8),()=>_0x5e661b[_0x1300c2(0x1f2)][_0x1300c2(0x1c8)]({'projectName':_0x47f05a,'workflowName':_0x401375,'status':_0x9b7fc0[_0x1300c2(0x224)],'fromTime':_0x9b7fc0[_0x1300c2(0x183)],'toTime':_0x9b7fc0['to'],'limit':_0x9b7fc0[_0x1300c2(0x20e)]}),{'verbose':_0x9b7fc0[_0x1300c2(0x1ec)]}),_0x37354e=_0x5791c0[_0x1300c2(0x1d7)];return console[_0x1300c2(0x1cc)](_0x1300c2(0x1cd)+_0x37354e[_0x1300c2(0x1c6)]+_0x1300c2(0x203)+(_0x37354e['length']!==0x1?'s':'')),await handleSDKOutput(_0x37354e,_0x9b7fc0),0x0;}catch(_0x4bc068){if(_0x4bc068 instanceof SDKError)return console[_0x1300c2(0x1cc)](_0x1300c2(0x188)+_0x4bc068['message']),_0x4bc068['cause']&&console[_0x1300c2(0x1cc)]('\x20\x20Cause:\x20'+_0x4bc068[_0x1300c2(0x19f)]),0x1;throw _0x4bc068;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a35_0x254837(0x1b1);['description']=a35_0x254837(0x1ab);async['execute'](_0x2f12b6){const _0x4962d4=a35_0x254837,{options:_0x55f6e5,args:_0x4afd5c,tdx:_0x58fb81}=_0x2f12b6;let _0x2a6143,_0x43f0f8;if(_0x4afd5c[0x0]){const _0x225886=_0x4afd5c[0x0][_0x4962d4(0x211)]('.');if(_0x225886[_0x4962d4(0x1c6)]===0x1)_0x2a6143=_0x225886[0x0];else{if(_0x225886['length']===0x2)[_0x2a6143,_0x43f0f8]=_0x225886;else return console[_0x4962d4(0x1cc)](_0x4962d4(0x1a9)),0x1;}}try{const _0x22fced=_0x55f6e5[_0x4962d4(0x215)];if(_0x55f6e5[_0x4962d4(0x1ec)]){if(_0x2a6143&&_0x43f0f8)console[_0x4962d4(0x1cc)]('Filter:\x20'+_0x2a6143+'.'+_0x43f0f8);else _0x2a6143&&console['error'](_0x4962d4(0x207)+_0x2a6143);_0x22fced&&console['error'](_0x4962d4(0x21f));}const _0x1a3cfb=await withSpinner(_0x4962d4(0x1e1),()=>_0x58fb81[_0x4962d4(0x1f2)]['attempts']({'projectName':_0x2a6143,'workflowName':_0x43f0f8,'includeRetried':_0x22fced,'limit':_0x55f6e5[_0x4962d4(0x20e)]}),{'verbose':_0x55f6e5[_0x4962d4(0x1ec)]}),_0x3d6ddd=_0x1a3cfb[_0x4962d4(0x1d7)];return console[_0x4962d4(0x1cc)]('✔\x20Found\x20'+_0x3d6ddd[_0x4962d4(0x1c6)]+_0x4962d4(0x1d3)+(_0x3d6ddd[_0x4962d4(0x1c6)]!==0x1?'s':'')),await handleSDKOutput(_0x3d6ddd,_0x55f6e5),0x0;}catch(_0x553288){if(_0x553288 instanceof SDKError)return console[_0x4962d4(0x1cc)]('Error:\x20'+_0x553288['message']),_0x553288[_0x4962d4(0x19f)]&&console[_0x4962d4(0x1cc)](_0x4962d4(0x212)+_0x553288[_0x4962d4(0x19f)]),0x1;throw _0x553288;}}}export class WorkflowAttemptCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x18a);['description']='Show\x20specific\x20attempt\x20details';async[a35_0x254837(0x180)](_0x1adbb8){const _0x5f9fe=a35_0x254837,{options:_0x2dbbda,args:_0x103d14,tdx:_0x55d624}=_0x1adbb8,_0x341980=_0x103d14[0x0];if(!_0x341980)return console[_0x5f9fe(0x1cc)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x2dbbda[_0x5f9fe(0x1ec)]&&console['error']('Attempt\x20ID:\x20'+_0x341980);const _0x560984=await withSpinner(_0x5f9fe(0x1f6),()=>_0x55d624[_0x5f9fe(0x1f2)][_0x5f9fe(0x1b7)](_0x341980),{'verbose':_0x2dbbda[_0x5f9fe(0x1ec)]}),_0x1a1587=_0x560984[_0x5f9fe(0x1d7)];let _0x4cc04c;!_0x1a1587[_0x5f9fe(0x1bf)]?_0x4cc04c=_0x1a1587['cancelRequested']?_0x5f9fe(0x1ef):_0x5f9fe(0x189):_0x4cc04c=_0x1a1587[_0x5f9fe(0x1a1)]?'success':'error';let _0x31f172;if(_0x1a1587[_0x5f9fe(0x1f0)]&&_0x1a1587[_0x5f9fe(0x1a3)]){const _0x5dbbe8=new Date(_0x1a1587[_0x5f9fe(0x1f0)])['getTime'](),_0x102d6c=new Date(_0x1a1587[_0x5f9fe(0x1a3)])[_0x5f9fe(0x204)]();_0x31f172=Math[_0x5f9fe(0x1d6)]((_0x102d6c-_0x5dbbe8)/0x3e8);}const _0x46587a={'attempt_id':_0x1a1587['id'],'status':_0x4cc04c,..._0x1a1587['index']!==undefined&&{'index':_0x1a1587['index']},..._0x1a1587['project']&&{'project':_0x1a1587[_0x5f9fe(0x17f)][_0x5f9fe(0x1be)]},..._0x1a1587[_0x5f9fe(0x1f2)]&&{'workflow':_0x1a1587[_0x5f9fe(0x1f2)][_0x5f9fe(0x1be)]},..._0x1a1587[_0x5f9fe(0x1bb)]&&{'session_id':_0x1a1587[_0x5f9fe(0x1bb)]},..._0x1a1587[_0x5f9fe(0x200)]&&{'session_time':_0x1a1587[_0x5f9fe(0x200)]},..._0x1a1587[_0x5f9fe(0x1ae)]&&{'retry_attempt':_0x1a1587[_0x5f9fe(0x1ae)]},..._0x31f172!==undefined&&{'duration_sec':_0x31f172},..._0x1a1587['createdAt']&&{'created_at':_0x1a1587[_0x5f9fe(0x1f0)]},..._0x1a1587['finishedAt']&&{'finished_at':_0x1a1587[_0x5f9fe(0x1a3)]},...Object[_0x5f9fe(0x213)](_0x1a1587[_0x5f9fe(0x19d)])['length']>0x0&&{'params':_0x1a1587[_0x5f9fe(0x19d)]}};return await handleSingleObjectOutput(_0x46587a,_0x2dbbda),0x0;}catch(_0x46494c){if(_0x46494c instanceof SDKError)return console[_0x5f9fe(0x1cc)](_0x5f9fe(0x188)+_0x46494c[_0x5f9fe(0x19e)]),_0x46494c[_0x5f9fe(0x19f)]&&console[_0x5f9fe(0x1cc)]('\x20\x20Cause:\x20'+_0x46494c['cause']),0x1;throw _0x46494c;}}}export class WorkflowTasksCommand extends BaseCommand{[a35_0x254837(0x1be)]='workflow:tasks';['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a35_0x254837(0x180)](_0x5c8c01){const _0xdf8ea2=a35_0x254837,{options:_0x2afe7d,args:_0x64a30f,tdx:_0x488659}=_0x5c8c01,_0x5abd91=_0x64a30f[0x0];if(!_0x5abd91)return console['error'](_0xdf8ea2(0x218)),0x1;try{const _0x2f0aea=_0x2afe7d[_0xdf8ea2(0x184)];_0x2afe7d[_0xdf8ea2(0x1ec)]&&(console['error'](_0xdf8ea2(0x1c7)+_0x5abd91),_0x2f0aea&&console[_0xdf8ea2(0x1cc)](_0xdf8ea2(0x1ea)));const _0x2d8f65=await withSpinner(_0xdf8ea2(0x1ba),()=>_0x488659[_0xdf8ea2(0x1f2)][_0xdf8ea2(0x1f4)](_0x5abd91,_0x2f0aea||![]),{'verbose':_0x2afe7d[_0xdf8ea2(0x1ec)]}),_0x51dbea=_0x2d8f65[_0xdf8ea2(0x1d7)];return console[_0xdf8ea2(0x1cc)](_0xdf8ea2(0x1cd)+_0x51dbea[_0xdf8ea2(0x1c6)]+_0xdf8ea2(0x195)+(_0x51dbea[_0xdf8ea2(0x1c6)]!==0x1?'s':'')),await handleSDKOutput(_0x51dbea,_0x2afe7d),0x0;}catch(_0x383b42){if(_0x383b42 instanceof SDKError)return console['error'](_0xdf8ea2(0x188)+_0x383b42['message']),_0x383b42['cause']&&console[_0xdf8ea2(0x1cc)](_0xdf8ea2(0x212)+_0x383b42[_0xdf8ea2(0x19f)]),0x1;throw _0x383b42;}}}export class WorkflowLogsCommand extends BaseCommand{['name']=a35_0x254837(0x1e4);[a35_0x254837(0x220)]=a35_0x254837(0x1e0);async[a35_0x254837(0x180)](_0x285548){const _0x5a31a2=a35_0x254837,{options:_0x17a17d,args:_0x270444,tdx:_0x1d9b59}=_0x285548,_0x4bb2d9=_0x270444[0x0];let _0x38d346=_0x270444[0x1];if(!_0x4bb2d9)return console[_0x5a31a2(0x1cc)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x17a17d[_0x5a31a2(0x1ec)]&&(console[_0x5a31a2(0x1cc)](_0x5a31a2(0x1c7)+_0x4bb2d9),_0x38d346&&console['error'](_0x5a31a2(0x1ac)+_0x38d346));const _0x4f94f9=await withSpinner('Fetching\x20log\x20files...',()=>_0x1d9b59[_0x5a31a2(0x1f2)][_0x5a31a2(0x1df)](_0x4bb2d9,_0x38d346),{'verbose':_0x17a17d[_0x5a31a2(0x1ec)]}),_0xef2837=_0x4f94f9['data'];if(_0xef2837[_0x5a31a2(0x1c6)]===0x0)return console[_0x5a31a2(0x1cc)](_0x5a31a2(0x201)),0x0;if(!_0x38d346&&(_0x17a17d[_0x5a31a2(0x1dc)]||_0x17a17d[_0x5a31a2(0x1e6)]))return await handleSDKOutput(_0xef2837,_0x17a17d),0x0;if(!_0x38d346){const _0x525373=_0xef2837[_0x5a31a2(0x1d1)](_0x21d1af=>({'title':_0x21d1af[_0x5a31a2(0x18c)]+'\x20('+formatBytes(_0x21d1af[_0x5a31a2(0x1ce)])+')','value':_0x21d1af['taskName']})),_0x3b110b=await a35_0x32181b({'type':_0x5a31a2(0x17e),'name':_0x5a31a2(0x19b),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x525373});if(!_0x3b110b['task'])return console[_0x5a31a2(0x1cc)](_0x5a31a2(0x21b)),0x0;_0x38d346=_0x3b110b[_0x5a31a2(0x19b)];}const _0x5b72db=await withSpinner('Downloading\x20logs...',()=>_0x1d9b59[_0x5a31a2(0x1f2)]['logs'](_0x4bb2d9,_0x38d346),{'verbose':_0x17a17d[_0x5a31a2(0x1ec)]}),_0x438a4d=_0x5b72db['data'];return _0x438a4d?console[_0x5a31a2(0x18d)](_0x438a4d):console['error']('No\x20log\x20content\x20found'),0x0;}catch(_0x579df7){if(_0x579df7 instanceof SDKError)return console[_0x5a31a2(0x1cc)](_0x5a31a2(0x188)+_0x579df7[_0x5a31a2(0x19e)]),_0x579df7[_0x5a31a2(0x19f)]&&console['error'](_0x5a31a2(0x212)+_0x579df7[_0x5a31a2(0x19f)]),0x1;throw _0x579df7;}}}export class WorkflowKillCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x193);[a35_0x254837(0x220)]=a35_0x254837(0x1d5);async[a35_0x254837(0x180)](_0x5dea77){const _0xdff6fb=a35_0x254837,{options:_0x1edc88,args:_0x3b8f41,tdx:_0x349d12}=_0x5dea77,_0x1696b0=_0x3b8f41[0x0];if(!_0x1696b0)return console[_0xdff6fb(0x1cc)](_0xdff6fb(0x218)),0x1;try{const _0x4d6d70=_0x1edc88[_0xdff6fb(0x1ee)];_0x1edc88[_0xdff6fb(0x1ec)]&&(console['error']('Attempt\x20ID:\x20'+_0x1696b0),_0x4d6d70&&console['error']('Reason:\x20'+_0x4d6d70));if(!_0x1edc88[_0xdff6fb(0x1c1)]){const _0x4db6ca=await confirm(_0xdff6fb(0x1bd)+_0x1696b0+'?');if(!_0x4db6ca)return console[_0xdff6fb(0x1cc)](_0xdff6fb(0x21b)),0x0;}const _0x14c41b=await withSpinner(_0xdff6fb(0x19a),()=>_0x349d12[_0xdff6fb(0x1f2)][_0xdff6fb(0x1c4)](_0x1696b0,_0x4d6d70),{'verbose':_0x1edc88[_0xdff6fb(0x1ec)]}),_0x4342d6=_0x14c41b['data'];return console[_0xdff6fb(0x1cc)]('✔\x20'+_0x4342d6),0x0;}catch(_0x54fb36){if(_0x54fb36 instanceof SDKError)return console[_0xdff6fb(0x1cc)](_0xdff6fb(0x188)+_0x54fb36[_0xdff6fb(0x19e)]),_0x54fb36['cause']&&console[_0xdff6fb(0x1cc)](_0xdff6fb(0x212)+_0x54fb36[_0xdff6fb(0x19f)]),0x1;throw _0x54fb36;}}}export class WorkflowRetryCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x1c5);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a35_0x254837(0x180)](_0x26816c){const _0x2f5dd2=a35_0x254837,{options:_0x131be2,args:_0x73cc77,tdx:_0x3794f0}=_0x26816c,_0xb470b9=_0x73cc77[0x0];if(!_0xb470b9)return console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x1ff)),console[_0x2f5dd2(0x1cc)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x4cf609=![],_0x2485a9=_0xb470b9;if(_0xb470b9[_0x2f5dd2(0x1d4)](_0x2f5dd2(0x1dd)))_0x4cf609=!![],_0x2485a9=_0xb470b9['substring'](0x8);else{if(_0xb470b9[_0x2f5dd2(0x1d4)](_0x2f5dd2(0x182)))_0x4cf609=![],_0x2485a9=_0xb470b9[_0x2f5dd2(0x21a)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x1e3)),0x1;}try{const _0x3f7c26=_0x131be2[_0x2f5dd2(0x219)],_0x171dde=_0x131be2[_0x2f5dd2(0x21d)],_0x4fc5f4=_0x131be2[_0x2f5dd2(0x19d)],_0x438d04=_0x131be2[_0x2f5dd2(0x190)];_0x131be2[_0x2f5dd2(0x1ec)]&&(console['error'](_0x2f5dd2(0x1fe)+(_0x4cf609?'session':_0x2f5dd2(0x1b7))+'\x20'+_0x2485a9),_0x3f7c26&&console[_0x2f5dd2(0x1cc)]('From\x20task:\x20'+_0x3f7c26),_0x171dde&&console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x1a8)+_0x171dde),_0x4fc5f4&&console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x223)+_0x4fc5f4),_0x438d04&&console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x1a7)));let _0x2efbf0;if(_0x4fc5f4)try{if(_0x4fc5f4[_0x2f5dd2(0x1d4)]('@')){const _0x331bf4=await import('fs/promises'),_0x320151=_0x4fc5f4[_0x2f5dd2(0x21a)](0x1),_0x124bbb=await _0x331bf4[_0x2f5dd2(0x1f8)](_0x320151,_0x2f5dd2(0x186));_0x2efbf0=JSON[_0x2f5dd2(0x1b3)](_0x124bbb);}else _0x2efbf0=JSON[_0x2f5dd2(0x1b3)](_0x4fc5f4);}catch{return console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x1fc)),0x1;}if(!_0x131be2[_0x2f5dd2(0x1c1)]){const _0x16f37d=await confirm(_0x2f5dd2(0x208)+(_0x4cf609?_0x2f5dd2(0x21c):_0x2f5dd2(0x1b7))+'\x20'+_0x2485a9+'?');if(!_0x16f37d)return console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x21b)),0x0;}let _0x3771fd;_0x4cf609?_0x3771fd=await withSpinner(_0x2f5dd2(0x1e7),()=>_0x3794f0[_0x2f5dd2(0x1f2)][_0x2f5dd2(0x1a0)](_0x2485a9,{'fromTask':_0x3f7c26,'retryParams':_0x2efbf0}),{'verbose':_0x131be2[_0x2f5dd2(0x1ec)]}):_0x3771fd=await withSpinner(_0x2f5dd2(0x1a6),()=>_0x3794f0[_0x2f5dd2(0x1f2)]['retryAttempt'](_0x2485a9,{'resumeFrom':_0x171dde,'retryParams':_0x2efbf0,'force':_0x438d04}),{'verbose':_0x131be2[_0x2f5dd2(0x1ec)]});const _0xa8ec85=_0x3771fd[_0x2f5dd2(0x1d7)];return console['error'](_0x2f5dd2(0x20d)),console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x185)+_0xa8ec85[_0x2f5dd2(0x217)]),console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x221)+_0xa8ec85[_0x2f5dd2(0x1bb)]),0x0;}catch(_0xd2e690){if(_0xd2e690 instanceof SDKError)return console['error'](_0x2f5dd2(0x188)+_0xd2e690['message']),_0xd2e690[_0x2f5dd2(0x19f)]&&console[_0x2f5dd2(0x1cc)](_0x2f5dd2(0x212)+_0xd2e690['cause']),0x1;throw _0xd2e690;}}}export class WorkflowRunCommand extends BaseCommand{['name']='workflow:run';[a35_0x254837(0x220)]=a35_0x254837(0x1e9);async[a35_0x254837(0x180)](_0x2071ff){const _0x436073=a35_0x254837,{options:_0x1f8f33,args:_0x3c06ab,tdx:_0x28c72d}=_0x2071ff,_0xca1b62=_0x3c06ab[0x0];if(!_0xca1b62)return console[_0x436073(0x1cc)](_0x436073(0x1a2)),console[_0x436073(0x1cc)](_0x436073(0x1c3)),0x1;const _0x280074=_0x1f8f33[_0x436073(0x1b0)],_0xd83aab=_0x1f8f33[_0x436073(0x200)],_0x568e3d={};if(_0x280074&&Array[_0x436073(0x1e5)](_0x280074))for(const _0x8194c7 of _0x280074){const _0x450991=_0x8194c7['indexOf']('=');if(_0x450991===-0x1)return console[_0x436073(0x1cc)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x8194c7),console['error'](_0x436073(0x197)),0x1;const _0x295cf2=_0x8194c7[_0x436073(0x21a)](0x0,_0x450991),_0x3db56e=_0x8194c7['substring'](_0x450991+0x1);try{_0x568e3d[_0x295cf2]=JSON[_0x436073(0x1b3)](_0x3db56e);}catch{_0x568e3d[_0x295cf2]=_0x3db56e;}}_0x1f8f33[_0x436073(0x1ec)]&&(console[_0x436073(0x1cc)]('Workflow:\x20'+_0xca1b62),Object['keys'](_0x568e3d)[_0x436073(0x1c6)]>0x0&&console['error'](_0x436073(0x1af)+JSON[_0x436073(0x1cf)](_0x568e3d)),_0xd83aab&&console[_0x436073(0x1cc)](_0x436073(0x20c)+_0xd83aab));const _0x672b76=await withSpinner(_0x436073(0x18e),()=>_0x28c72d[_0x436073(0x1f2)]['run'](_0xca1b62,_0x568e3d,{'sessionTime':_0xd83aab}),{'verbose':_0x1f8f33['verbose']}),_0x4c51e6=_0x672b76[_0x436073(0x1d7)];return console[_0x436073(0x1cc)]('✔\x20Workflow\x20run\x20started'),console[_0x436073(0x1cc)](_0x436073(0x1fb)+_0x4c51e6['id']),console[_0x436073(0x1cc)](_0x436073(0x221)+_0x4c51e6[_0x436073(0x1bb)]),console['error'](_0x436073(0x20f)+_0x4c51e6[_0x436073(0x17f)]?.['name']),console[_0x436073(0x1cc)]('\x20\x20Workflow:\x20'+_0x4c51e6[_0x436073(0x1f2)]?.[_0x436073(0x1be)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x191);['description']=a35_0x254837(0x20a);async[a35_0x254837(0x180)](_0x229248){const _0x192db6=a35_0x254837,{options:_0x2789c8,args:_0x398319,tdx:_0x5eb52e}=_0x229248,_0x52094a=_0x398319[0x0],_0x306ea4=_0x398319[0x1]||'.';if(!_0x52094a)return console[_0x192db6(0x1cc)](_0x192db6(0x1da)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x5c1177=_0x2789c8[_0x192db6(0x1b2)];_0x2789c8[_0x192db6(0x1ec)]&&(console[_0x192db6(0x1cc)]('Project:\x20'+_0x52094a),console[_0x192db6(0x1cc)]('Output\x20directory:\x20'+_0x306ea4),_0x5c1177&&console[_0x192db6(0x1cc)](_0x192db6(0x187)+_0x5c1177));const _0x1339b8=await withSpinner('Downloading\x20project\x20'+_0x52094a+_0x192db6(0x216),()=>_0x5eb52e['workflow'][_0x192db6(0x20b)](_0x52094a,_0x306ea4,{'revision':_0x5c1177}),{'verbose':_0x2789c8['verbose']}),_0x1188ca=_0x1339b8[_0x192db6(0x1d7)];return console[_0x192db6(0x1cc)](_0x192db6(0x1a5)+_0x1188ca['projectName']),console[_0x192db6(0x1cc)](_0x192db6(0x1c0)+_0x1188ca[_0x192db6(0x1b2)]),console[_0x192db6(0x1cc)](_0x192db6(0x205)+_0x1188ca[_0x192db6(0x1fd)]),console[_0x192db6(0x1cc)](_0x192db6(0x181)+_0x306ea4+'/'+_0x1188ca[_0x192db6(0x1b4)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a35_0x254837(0x1be)]='workflow:push';['description']=a35_0x254837(0x1d8);async[a35_0x254837(0x180)](_0x528b90){const _0x2e42f4=a35_0x254837,{options:_0x15769b,args:_0xb795c2,tdx:_0x2e5a79}=_0x528b90;let _0x4cfaa8='.',_0x16f059=_0x15769b[_0x2e42f4(0x1be)];if(_0xb795c2[0x0]){const {promises:_0x3f7f1e}=await import('fs');try{const _0x19638d=await _0x3f7f1e[_0x2e42f4(0x1cb)](_0xb795c2[0x0]);if(_0x19638d['isDirectory']())_0x4cfaa8=_0xb795c2[0x0];else return console['error'](_0x2e42f4(0x188)+_0xb795c2[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x16f059=_0xb795c2[0x0],_0x4cfaa8='.';}}const _0x30da61=_0x15769b[_0x2e42f4(0x1b2)],_0x14a7b4=_0x15769b[_0x2e42f4(0x18b)];_0x15769b[_0x2e42f4(0x1ec)]&&(console[_0x2e42f4(0x1cc)](_0x2e42f4(0x1c9)+_0x4cfaa8),_0x16f059&&console[_0x2e42f4(0x1cc)](_0x2e42f4(0x1eb)+_0x16f059),_0x30da61&&console['error']('Revision:\x20'+_0x30da61),_0x14a7b4&&console[_0x2e42f4(0x1cc)](_0x2e42f4(0x192)));const _0x5dd65a=await withSpinner(_0x2e42f4(0x206),()=>_0x2e5a79[_0x2e42f4(0x1f2)][_0x2e42f4(0x1f1)](_0x4cfaa8,{'projectName':_0x16f059,'revision':_0x30da61,'skipValidation':_0x14a7b4}),{'verbose':_0x15769b[_0x2e42f4(0x1ec)]}),_0x797ca0=_0x5dd65a[_0x2e42f4(0x1d7)];return console[_0x2e42f4(0x1cc)](_0x2e42f4(0x1e2)+_0x797ca0[_0x2e42f4(0x1b4)]),console[_0x2e42f4(0x1cc)](_0x2e42f4(0x202)+_0x797ca0['projectId']),console['error'](_0x2e42f4(0x1c0)+_0x797ca0['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a35_0x254837(0x1be)]=a35_0x254837(0x1fa);[a35_0x254837(0x220)]=a35_0x254837(0x1de);async[a35_0x254837(0x180)](_0x43ec05){const _0x55a3a9=a35_0x254837,{options:_0x4676f3,args:_0x4cb46c,tdx:_0x3eb0fb}=_0x43ec05,_0x3e4df5=_0x4cb46c[0x0];if(!_0x3e4df5)return console[_0x55a3a9(0x1cc)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x55a3a9(0x1cc)](_0x55a3a9(0x1bc)),0x1;_0x4676f3['verbose']&&console[_0x55a3a9(0x1cc)](_0x55a3a9(0x210)+_0x3e4df5);if(!_0x4676f3['yes']){const _0x24d22a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x3e4df5+_0x55a3a9(0x1ca));if(!_0x24d22a)return console[_0x55a3a9(0x1cc)]('Cancelled'),0x0;}const _0x57ddff=await withSpinner(_0x55a3a9(0x196)+_0x3e4df5+_0x55a3a9(0x216),()=>_0x3eb0fb[_0x55a3a9(0x1f2)][_0x55a3a9(0x1b6)](_0x3e4df5),{'verbose':_0x4676f3[_0x55a3a9(0x1ec)]}),_0x39a0e0=_0x57ddff[_0x55a3a9(0x1d7)];return console[_0x55a3a9(0x1cc)]('✔\x20Deleted\x20project\x20'+_0x39a0e0[_0x55a3a9(0x1b4)]),console['error'](_0x55a3a9(0x202)+_0x39a0e0[_0x55a3a9(0x194)]),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(_0xb550ff,_0x156bc9){const _0x4b8d3e=a36_0x1804,_0x4e6c08=_0xb550ff();while(!![]){try{const _0x1eef34=-parseInt(_0x4b8d3e(0xdf))/0x1*(parseInt(_0x4b8d3e(0xef))/0x2)+-parseInt(_0x4b8d3e(0xf3))/0x3*(-parseInt(_0x4b8d3e(0xea))/0x4)+-parseInt(_0x4b8d3e(0xe6))/0x5+-parseInt(_0x4b8d3e(0xe4))/0x6*(-parseInt(_0x4b8d3e(0xde))/0x7)+-parseInt(_0x4b8d3e(0xf1))/0x8+-parseInt(_0x4b8d3e(0xe0))/0x9+parseInt(_0x4b8d3e(0xe8))/0xa*(parseInt(_0x4b8d3e(0xf0))/0xb);if(_0x1eef34===_0x156bc9)break;else _0x4e6c08['push'](_0x4e6c08['shift']());}catch(_0x2b60ae){_0x4e6c08['push'](_0x4e6c08['shift']());}}}(a36_0x1b63,0xbc279));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a36_0x1804(_0x4e583,_0x2b8f08){const _0x1b6338=a36_0x1b63();return a36_0x1804=function(_0x180424,_0x16b7a1){_0x180424=_0x180424-0xdc;let _0x308e7e=_0x1b6338[_0x180424];return _0x308e7e;},a36_0x1804(_0x4e583,_0x2b8f08);}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x311d43=a36_0x1804;try{const _0x238509=fileURLToPath(import.meta[_0x311d43(0xe3)]),_0x146577=dirname(_0x238509),_0x5f1e07=join(_0x146577,_0x311d43(0xec)),_0x7eba9f=JSON[_0x311d43(0xe1)](readFileSync(_0x5f1e07,_0x311d43(0xdd)));return _0x7eba9f[_0x311d43(0xed)];}catch{return _0x311d43(0xe7);}}export function getUserAgent(){const _0x2592b2=a36_0x1804,_0x1ec14a=getVersion(),_0x286b18=platform(),_0x23d8e1=process['version']['replace']('v','');return _0x2592b2(0xe2)+_0x1ec14a+'\x20('+_0x286b18+_0x2592b2(0xeb)+_0x23d8e1+')';}export function getAuthHeaders(_0x37abfd,_0x47a671){const _0x5a6e96=a36_0x1804,_0x24dd2c=getVersion(),_0x1aabfc={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x24dd2c};return _0x47a671&&(_0x1aabfc[_0x5a6e96(0xee)]=_0x5a6e96(0xe9)+_0x47a671),_0x1aabfc;}export function toHeaderRecord(_0x3e6843){const _0x37635d=a36_0x1804,_0x2fd1ae={};for(const [_0x25b032,_0x4c670e]of Object[_0x37635d(0xdc)](_0x3e6843)){_0x4c670e!==undefined&&(_0x2fd1ae[_0x25b032]=_0x4c670e);}return _0x2fd1ae;}export function getTrinoHeaders(_0x5d6202,_0x3ed3da){const _0x16f7bf=a36_0x1804,_0x5149ba=getAuthHeaders(_0x5d6202,_0x3ed3da),_0x39ae1e=toHeaderRecord(_0x5149ba);return delete _0x39ae1e[_0x16f7bf(0xee)],_0x3ed3da&&(_0x39ae1e[_0x16f7bf(0xf2)]=_0x3ed3da),_0x39ae1e;}export function hasAPIKey(_0x5de1b7){const _0x474c5e=a36_0x1804,_0x5330d9=getAPIKey(_0x5de1b7);return _0x5330d9!==undefined&&_0x5330d9[_0x474c5e(0xe5)]>0x0;}function a36_0x1b63(){const _0x573de4=['TD1\x20','16AQDmie',';\x20node/','../../package.json','version','Authorization','92802XYfiIh','3452196deSbjI','5997008tRchRN','X-Trino-User','127761JBnSfd','entries','utf-8','290269HkBLMr','3hyRDWt','12452562uFfYoP','parse','tdx/','url','30pWCatK','length','3933755nbnxVO','0.0.0','110dcEGEW'];a36_0x1b63=function(){return _0x573de4;};return a36_0x1b63();}
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(_0xe3308f,_0x34f7af){const _0x4235e0=a37_0x5ec0,_0x397029=_0xe3308f();while(!![]){try{const _0x4f21a4=parseInt(_0x4235e0(0xcc))/0x1+parseInt(_0x4235e0(0xb7))/0x2*(parseInt(_0x4235e0(0xb0))/0x3)+-parseInt(_0x4235e0(0xcd))/0x4+-parseInt(_0x4235e0(0xb4))/0x5*(-parseInt(_0x4235e0(0xc4))/0x6)+-parseInt(_0x4235e0(0xa5))/0x7+parseInt(_0x4235e0(0xbb))/0x8+parseInt(_0x4235e0(0xaa))/0x9*(-parseInt(_0x4235e0(0xa6))/0xa);if(_0x4f21a4===_0x34f7af)break;else _0x397029['push'](_0x397029['shift']());}catch(_0x4d6959){_0x397029['push'](_0x397029['shift']());}}}(a37_0x371e,0x38584));import{homedir}from'os';function a37_0x371e(){const _0x1746a2=['split','ap03','toUpperCase','existsSync','tdx','.cache','startsWith','entries','TD_API_KEY_','join','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','error','3226734TEzNEm','8890HFvVYz','ap02','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','llm_default_project','3906UUTDNA','trim','\x20(TD_API_KEY)','parse','jp01','us01','103470xNtiBA','profile','env','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','4145MpADND','utf-8','TDX_CACHE_DIR','18AgWqBm','map','includes','stg-ap03','2406872jELcEp','.env.','.config','yellow','stg-jp01','replace','stg-us01','Warning:\x20Failed\x20to\x20read\x20','.env','1524fuHTtt','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','tdx.json','Warning:\x20Failed\x20to\x20load\x20','match','TD_API_KEY','eu01','apiKeys','440563tAXasp','739288oSKqeS','profiles','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','global:\x20','\x27,\x20defaulting\x20to\x20us01','readFileSync','dev-eu01','warn','slice'];a37_0x371e=function(){return _0x1746a2;};return a37_0x371e();}import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a37_0x328f52 from'node:fs';import*as a37_0x4a6338 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';function a37_0x5ec0(_0x82cceb,_0x2a9b5a){const _0x371efc=a37_0x371e();return a37_0x5ec0=function(_0x5ec0b5,_0x237f4c){_0x5ec0b5=_0x5ec0b5-0x9b;let _0x1c9522=_0x371efc[_0x5ec0b5];return _0x1c9522;},a37_0x5ec0(_0x82cceb,_0x2a9b5a);}import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a37_0x3cb57c from'chalk';export function getConfigDir(){const _0x281eb5=a37_0x5ec0;return process[_0x281eb5(0xb2)]['TDX_CONFIG_DIR']||join(homedir(),_0x281eb5(0xbd),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x580da6){const _0xce3052=a37_0x5ec0,_0x7089aa=getConfigDir();return _0x580da6?a37_0x4a6338[_0xce3052(0xa2)](_0x7089aa,_0xce3052(0xbc)+_0x580da6):getConfigFile();}export function getCacheDir(){const _0xe4d130=a37_0x5ec0;return process['env'][_0xe4d130(0xb6)]||join(homedir(),_0xe4d130(0x9e),_0xe4d130(0x9d));}export function getLLMProjectCacheFile(){const _0x578d30=a37_0x5ec0;return join(getCacheDir(),_0x578d30(0xa9));}export function readCachedLLMProject(){const _0x1c1b0d=a37_0x5ec0;try{const _0x992422=getLLMProjectCacheFile();if(!existsSync(_0x992422))return null;return readFileSync(_0x992422,_0x1c1b0d(0xb5))[_0x1c1b0d(0xab)]();}catch{return null;}}export function writeCachedLLMProject(_0x5a1960){const _0x1c6ba2=a37_0x5ec0;try{const _0x18cdaa=getCacheDir(),_0x3e35dc=getLLMProjectCacheFile();!existsSync(_0x18cdaa)&&mkdirSync(_0x18cdaa,{'recursive':!![]}),writeFileSync(_0x3e35dc,_0x5a1960,_0x1c6ba2(0xb5));}catch(_0x1c2831){console[_0x1c6ba2(0xa4)](_0x1c6ba2(0xcf),_0x1c2831);}}export function parseEnvFile(_0x2b5674){const _0x42334e=a37_0x5ec0,_0x388322={};for(const _0x2a1412 of _0x2b5674[_0x42334e(0xd6)]('\x0a')){const _0x44a531=_0x2a1412['trim']();if(!_0x44a531||_0x44a531['startsWith']('#'))continue;const _0x15e8da=_0x44a531[_0x42334e(0xc8)](/^([^=]+)=(.*)$/);if(_0x15e8da){const _0x2f8bfc=_0x15e8da[0x1][_0x42334e(0xab)]();let _0x46fc64=_0x15e8da[0x2][_0x42334e(0xab)]();(_0x46fc64['startsWith']('\x22')&&_0x46fc64['endsWith']('\x22')||_0x46fc64['startsWith']('\x27')&&_0x46fc64['endsWith']('\x27'))&&(_0x46fc64=_0x46fc64[_0x42334e(0xd5)](0x1,-0x1)),_0x388322[_0x2f8bfc]=_0x46fc64;}}return _0x388322;}export function readUserConfig(){const _0x2c820a=a37_0x5ec0,_0xaa6e94=getConfigFile();if(!existsSync(_0xaa6e94))return{};try{const _0x3db294=readFileSync(_0xaa6e94,_0x2c820a(0xb5));return parseEnvFile(_0x3db294);}catch(_0x3aa655){return console[_0x2c820a(0xd4)](_0x2c820a(0xa8)+_0xaa6e94+':',_0x3aa655),{};}}export function resolveSite(_0x53890c){const _0x187b0f=a37_0x5ec0,_0x3d0067=[_0x187b0f(0xaf),_0x187b0f(0xae),_0x187b0f(0xca),_0x187b0f(0xa7),_0x187b0f(0xd7),'dev-us01',_0x187b0f(0xd3),_0x187b0f(0xc1),_0x187b0f(0xbf),_0x187b0f(0xba)];if(_0x3d0067[_0x187b0f(0xb9)](_0x53890c))return _0x53890c;if(_0x53890c in SITE_ALIASES)return SITE_ALIASES[_0x53890c];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x53890c+_0x187b0f(0xd1)),_0x187b0f(0xaf);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3afb4a,_0x1e1175){const _0x8c5483=a37_0x5ec0,_0x19975e=_0x3afb4a[_0x8c5483(0x9b)]()[_0x8c5483(0xc0)](/-/g,'_'),_0x352e7c='TD_API_KEY_'+_0x19975e;if(process[_0x8c5483(0xb2)][_0x352e7c])return process[_0x8c5483(0xb2)][_0x352e7c];if(process['env'][_0x8c5483(0xc9)])return process[_0x8c5483(0xb2)][_0x8c5483(0xc9)];const _0x1e67cd=_0x1e1175||getActiveProfileName();if(_0x1e67cd){const _0x426dbc=loadProfileEnv(_0x1e67cd);if(_0x426dbc){if(_0x426dbc[_0x352e7c])return _0x426dbc[_0x352e7c];if(_0x426dbc['TD_API_KEY'])return _0x426dbc[_0x8c5483(0xc9)];}}const _0x4965d2=loadUserConfigOnce();if(_0x4965d2[_0x352e7c])return _0x4965d2[_0x352e7c];if(_0x4965d2['TD_API_KEY'])return _0x4965d2[_0x8c5483(0xc9)];return undefined;}export async function getAPIKeyAsync(_0x5d8d8f,_0x59eb09){const _0x3658e9=a37_0x5ec0,_0x24d48c=_0x5d8d8f[_0x3658e9(0x9b)]()[_0x3658e9(0xc0)](/-/g,'_'),_0xb35e02='TD_API_KEY_'+_0x24d48c;if(process[_0x3658e9(0xb2)][_0xb35e02])return process[_0x3658e9(0xb2)][_0xb35e02];if(process[_0x3658e9(0xb2)][_0x3658e9(0xc9)])return process['env'][_0x3658e9(0xc9)];const _0x256364=_0x59eb09||getActiveProfileName()||undefined,_0x1da34b=getCachedCredential(_0x5d8d8f,_0x256364);if(_0x1da34b)return _0x1da34b;const _0x33b958=await getKeychainAPIKey(_0x256364);if(_0x33b958)return setCachedCredential(_0x33b958,_0x5d8d8f,_0x256364),_0x33b958;const _0x5ef4fc=getLegacyEnvAPIKey(_0x5d8d8f,_0x256364);if(_0x5ef4fc){const _0x21c76c=await isKeychainAvailable();if(_0x21c76c)try{await saveKeychainAPIKey(_0x5ef4fc,_0x256364),setCachedCredential(_0x5ef4fc,_0x5d8d8f,_0x256364);const _0x4dbc73=getConfigFilePath(_0x256364);cleanupLegacyEnvFile(_0x4dbc73)&&console[_0x3658e9(0xd4)](a37_0x3cb57c[_0x3658e9(0xbe)](_0x3658e9(0xc5)));}catch(_0x193888){console[_0x3658e9(0xd4)](a37_0x3cb57c[_0x3658e9(0xbe)](_0x3658e9(0xb3)+_0x193888));}return _0x5ef4fc;}return undefined;}function getLegacyEnvAPIKey(_0x117ea3,_0x3988e3){const _0x34b30d=a37_0x5ec0,_0x53bce4=_0x117ea3['toUpperCase']()['replace'](/-/g,'_'),_0x2825fd='TD_API_KEY_'+_0x53bce4;if(_0x3988e3){const _0x28752b=loadProfileEnv(_0x3988e3);if(_0x28752b){if(_0x28752b[_0x2825fd])return _0x28752b[_0x2825fd];if(_0x28752b[_0x34b30d(0xc9)])return _0x28752b['TD_API_KEY'];}}const _0x25c763=loadUserConfigOnce();if(_0x25c763[_0x2825fd])return _0x25c763[_0x2825fd];if(_0x25c763['TD_API_KEY'])return _0x25c763[_0x34b30d(0xc9)];return undefined;}function cleanupLegacyEnvFile(_0x1aa593){const _0x159960=a37_0x5ec0;if(!existsSync(_0x1aa593))return![];try{const _0x4ef93e=readFileSync(_0x1aa593,_0x159960(0xb5)),_0x41d8db=_0x4ef93e[_0x159960(0xd6)]('\x0a'),_0xc7513e=_0x41d8db['filter'](_0x1eb3ea=>{const _0x3b15d2=_0x159960,_0x6033a=_0x1eb3ea[_0x3b15d2(0xab)]();if(!_0x6033a||_0x6033a[_0x3b15d2(0x9f)]('#'))return!![];const [_0x1161bd]=_0x6033a[_0x3b15d2(0xd6)]('=');return!_0x1161bd['startsWith']('TD_API_KEY');}),_0x21cdb4=_0xc7513e['some'](_0x3b786e=>{const _0x3c3011=_0x159960,_0x5afbc5=_0x3b786e[_0x3c3011(0xab)]();return _0x5afbc5&&!_0x5afbc5[_0x3c3011(0x9f)]('#');});if(!_0x21cdb4)return unlinkSync(_0x1aa593),!![];return writeFileSync(_0x1aa593,_0xc7513e['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x1e31c4,_0x440a72){const _0x521a52=a37_0x5ec0,_0x55f58c=_0x521a52(0xa1)+_0x1e31c4[_0x521a52(0x9b)]()[_0x521a52(0xc0)](/-/g,'_');if(process[_0x521a52(0xb2)][_0x55f58c])return'env:\x20'+_0x55f58c;if(process[_0x521a52(0xb2)][_0x521a52(0xc9)])return'env:\x20TD_API_KEY';const _0x48e0d9=_0x440a72||getActiveProfileName();if(_0x48e0d9){const _0x4502cc=loadProfileEnv(_0x48e0d9);if(_0x4502cc){if(_0x4502cc[_0x55f58c])return'profile:\x20'+_0x48e0d9+'\x20('+_0x55f58c+')';if(_0x4502cc['TD_API_KEY'])return'profile:\x20'+_0x48e0d9+_0x521a52(0xac);}}const _0x46700c=loadUserConfigOnce(),_0x39f933=getConfigFile();if(_0x46700c[_0x55f58c])return _0x521a52(0xd0)+_0x39f933+'\x20('+_0x55f58c+')';if(_0x46700c[_0x521a52(0xc9)])return _0x521a52(0xd0)+_0x39f933+'\x20(TD_API_KEY)';return null;}function loadProfileEnv(_0x18fe10){const _0x313020=a37_0x5ec0,_0x356e2e=a37_0x4a6338[_0x313020(0xa2)](getConfigDir(),_0x313020(0xbc)+_0x18fe10);if(a37_0x328f52[_0x313020(0x9c)](_0x356e2e)){validateSecureFilePermissions(_0x356e2e);try{const _0x31d398=a37_0x328f52[_0x313020(0xd2)](_0x356e2e,_0x313020(0xb5));return parseEnvFile(_0x31d398);}catch(_0x177c1d){console['warn'](_0x313020(0xc7)+_0x356e2e+':\x20'+_0x177c1d);}}const _0x49fc37=a37_0x4a6338['join'](getConfigDir(),_0x313020(0xce),_0x18fe10,_0x313020(0xc3));if(a37_0x328f52[_0x313020(0x9c)](_0x49fc37)){validateSecureFilePermissions(_0x49fc37);try{const _0x14a343=a37_0x328f52[_0x313020(0xd2)](_0x49fc37,_0x313020(0xb5));return parseEnvFile(_0x14a343);}catch(_0x1b2c8c){return console[_0x313020(0xd4)](_0x313020(0xc7)+_0x49fc37+':\x20'+_0x1b2c8c),null;}}return null;}function getActiveProfileName(){const _0x38bad4=a37_0x5ec0,_0x4ac43f=a37_0x4a6338[_0x38bad4(0xa2)](getConfigDir(),_0x38bad4(0xc6));if(!a37_0x328f52[_0x38bad4(0x9c)](_0x4ac43f))return null;try{const _0x1ad77a=a37_0x328f52[_0x38bad4(0xd2)](_0x4ac43f,'utf-8'),_0x24f500=JSON[_0x38bad4(0xad)](_0x1ad77a);return _0x24f500[_0x38bad4(0xb1)]||null;}catch{return null;}}export function saveAPIKey(_0x219a05,_0x5e3e16,_0x471db8){const _0x5b7e43=a37_0x5ec0,_0x34c355=getConfigDir(),_0x450b01=getConfigFilePath(_0x471db8);!existsSync(_0x34c355)&&mkdirSync(_0x34c355,{'recursive':!![],'mode':0x1c0});let _0x14cc28={};if(existsSync(_0x450b01))try{const _0x4206d5=readFileSync(_0x450b01,_0x5b7e43(0xb5));_0x14cc28=parseEnvFile(_0x4206d5);}catch(_0x8a3845){console[_0x5b7e43(0xd4)](_0x5b7e43(0xc2)+_0x450b01+':',_0x8a3845);}const _0x369259=_0x219a05[_0x5b7e43(0x9b)]()[_0x5b7e43(0xc0)](/-/g,'_');_0x14cc28['TD_API_KEY_'+_0x369259]=_0x5e3e16;const _0x47f9d9=Object[_0x5b7e43(0xa0)](_0x14cc28)[_0x5b7e43(0xb8)](([_0x264c3b,_0x51e2dd])=>_0x264c3b+'='+_0x51e2dd);writeFileSync(_0x450b01,_0x47f9d9['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x33bc99,_0x32049f,_0x395e0f){const _0x4ed20a=a37_0x5ec0;await saveKeychainAPIKey(_0x33bc99,_0x395e0f),setCachedCredential(_0x33bc99,_0x32049f,_0x395e0f);const _0x214a21=getConfigFilePath(_0x395e0f);cleanupLegacyEnvFile(_0x214a21)&&console[_0x4ed20a(0xd4)](a37_0x3cb57c[_0x4ed20a(0xbe)](_0x4ed20a(0xa3)));}export function loadConfig(){const _0x15d7f6=a37_0x5ec0,_0x5c9fe6={'apiKeys':{},'defaultSite':_0x15d7f6(0xaf)},_0x116270=[_0x15d7f6(0xaf),_0x15d7f6(0xae),_0x15d7f6(0xca),_0x15d7f6(0xa7),_0x15d7f6(0xd7),'dev-us01',_0x15d7f6(0xd3),_0x15d7f6(0xc1),_0x15d7f6(0xbf),_0x15d7f6(0xba)];for(const _0x15979b of _0x116270){const _0x238129=getAPIKey(_0x15979b);_0x238129&&(_0x5c9fe6[_0x15d7f6(0xcb)][_0x15979b]=_0x238129);}return _0x5c9fe6;}
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(_0x3cc236,_0x2592b9){const _0x236db1=a38_0x292f,_0x13f368=_0x3cc236();while(!![]){try{const _0x422a18=-parseInt(_0x236db1(0xb6))/0x1*(parseInt(_0x236db1(0xb7))/0x2)+-parseInt(_0x236db1(0xbf))/0x3*(-parseInt(_0x236db1(0xbb))/0x4)+parseInt(_0x236db1(0xbc))/0x5+-parseInt(_0x236db1(0xb3))/0x6*(-parseInt(_0x236db1(0xb5))/0x7)+-parseInt(_0x236db1(0xb9))/0x8+parseInt(_0x236db1(0xc0))/0x9+-parseInt(_0x236db1(0xb2))/0xa;if(_0x422a18===_0x2592b9)break;else _0x13f368['push'](_0x13f368['shift']());}catch(_0x13ee1a){_0x13f368['push'](_0x13f368['shift']());}}}(a38_0xa8d7,0x2efcc));function a38_0xa8d7(){const _0x4dcdd3=['clear','12OXDoQg','2840931rXVZpU','5735770ZxkoYy','807102frHVgp','now','14UClWNo','1wzVeyW','341344bqSQFN','delete','1386080OBHCyy','loadedAt','179572sLeTlY','1728520lOHXIY','__default_profile__'];a38_0xa8d7=function(){return _0x4dcdd3;};return a38_0xa8d7();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x1fa8e5,_0x3636de){const _0x58196a=a38_0x292f,_0x4b25c5=_0x1fa8e5||'__default_site__',_0x337a08=_0x3636de||_0x58196a(0xbd);return _0x4b25c5+':'+_0x337a08;}function a38_0x292f(_0x4398bd,_0x11e5f3){const _0xa8d787=a38_0xa8d7();return a38_0x292f=function(_0x292f99,_0x44144f){_0x292f99=_0x292f99-0xb2;let _0x3dcc13=_0xa8d787[_0x292f99];return _0x3dcc13;},a38_0x292f(_0x4398bd,_0x11e5f3);}export function getCachedCredential(_0x581ea6,_0x37f479){const _0xad968a=a38_0x292f,_0x4650cc=getCacheKey(_0x581ea6,_0x37f479),_0x5818c7=cache['get'](_0x4650cc);if(!_0x5818c7)return null;if(Date[_0xad968a(0xb4)]()-_0x5818c7[_0xad968a(0xba)]>CACHE_TTL_MS)return cache[_0xad968a(0xb8)](_0x4650cc),null;return _0x5818c7['apiKey'];}export function setCachedCredential(_0x59185a,_0x2aba41,_0x597508){const _0x969e64=a38_0x292f,_0x1503d2=getCacheKey(_0x2aba41,_0x597508);cache['set'](_0x1503d2,{'apiKey':_0x59185a,'loadedAt':Date[_0x969e64(0xb4)]()});}export function clearCredentialCache(){const _0x58f227=a38_0x292f;cache[_0x58f227(0xbe)]();}export function clearCachedCredential(_0x28b5d1,_0x446371){const _0x367ad9=a38_0x292f,_0x5d6375=getCacheKey(_0x28b5d1,_0x446371);cache[_0x367ad9(0xb8)](_0x5d6375);}
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_0x2ebea7=a39_0x68d0;(function(_0x3d9ccd,_0x29bfe0){const _0x14ea8a=a39_0x68d0,_0x45829e=_0x3d9ccd();while(!![]){try{const _0x374f19=parseInt(_0x14ea8a(0xac))/0x1*(-parseInt(_0x14ea8a(0x80))/0x2)+parseInt(_0x14ea8a(0xab))/0x3+-parseInt(_0x14ea8a(0x9b))/0x4*(parseInt(_0x14ea8a(0x7f))/0x5)+-parseInt(_0x14ea8a(0xba))/0x6+parseInt(_0x14ea8a(0x98))/0x7+parseInt(_0x14ea8a(0x7e))/0x8+-parseInt(_0x14ea8a(0x91))/0x9;if(_0x374f19===_0x29bfe0)break;else _0x45829e['push'](_0x45829e['shift']());}catch(_0x2558c6){_0x45829e['push'](_0x45829e['shift']());}}}(a39_0x3010,0xbe8ec));function a39_0x68d0(_0x10d61,_0x39c891){const _0x3010a8=a39_0x3010();return a39_0x68d0=function(_0x68d043,_0x20f592){_0x68d043=_0x68d043-0x7c;let _0x500235=_0x3010a8[_0x68d043];return _0x500235;},a39_0x68d0(_0x10d61,_0x39c891);}import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';function a39_0x3010(){const _0x215a80=['configFiles','config','replace','apiKey','log','12176952UmDpJp','2850VqeJlm','1398AWvRwj','llm_project','default','(active)','Project','segment_path','profiles','sessionId','Profile','displayWithSources','createAsync','profileCredentials','getSource','Session','activeProfile','global','parentSegment','552636posScF','session','layers','existsSync','getParameters','Global','sessions','5643134XRMklc','profile:\x20','Global\x20Credentials','9444BIdGQT','INFO','us01','parent_segment','\x0a[configuration\x20files]','(session:\x20','globalCredentials','.env','site','.json','profile','parse','[context]','database','logLevel','string','1681767vqyrbw','936huEklN','tdx.json','utf-8','CLI\x20flag:\x20--','loadGlobalConfig','join','llmProject','Profile\x20Credentials',':\x20none','display','resolveAPIKeyAsync','verbose','project','entries','281448YAXmKk','cliFlags','injectIntoOptions'];a39_0x3010=function(){return _0x215a80;};return a39_0x3010();}import{LogLevel}from'../utils/tdx-logger.js';import*as a39_0x3157e1 from'node:fs';import*as a39_0x51daee from'node:path';export class GlobalContext{[a39_0x2ebea7(0xa3)];[a39_0x2ebea7(0xa8)];[a39_0x2ebea7(0x9e)];[a39_0x2ebea7(0x85)];[a39_0x2ebea7(0x81)];[a39_0x2ebea7(0x7c)];[a39_0x2ebea7(0xb7)];[a39_0x2ebea7(0xa9)];['layers'];[a39_0x2ebea7(0x8e)];[a39_0x2ebea7(0x87)];[a39_0x2ebea7(0xbd)];constructor(_0x174305){const _0x13eb0=a39_0x2ebea7;this[_0x13eb0(0x87)]=_0x174305['session']||getCurrentSessionPID()['toString']();const _0x46bce2=loadSessionContext(_0x174305[_0x13eb0(0x92)]),_0x1e17cb=loadProjectConfig(),_0x589e0d=this[_0x13eb0(0xb0)]();this['activeProfile']=_0x174305['profile']||_0x46bce2?.[_0x13eb0(0xa5)]||_0x589e0d[_0x13eb0(0xa5)]||getActiveProfile();const _0x3f242b=this['activeProfile']?loadProfile(this[_0x13eb0(0x8e)]):null,_0x2518c7=_0x284872=>{const _0x326249=_0x13eb0;if(!_0x284872)return{};const _0xf13d12=_0x284872,_0x549797={};for(const [_0x97c790,_0x5c4d65]of Object[_0x326249(0xb9)](_0xf13d12)){typeof _0x5c4d65===_0x326249(0xaa)&&(_0x549797[_0x97c790]=_0x5c4d65);}return _0x549797;},_0x563723={};if(_0x174305['site']&&_0x174305[_0x13eb0(0xa3)]!==_0x13eb0(0x9d))_0x563723[_0x13eb0(0xa3)]=_0x174305[_0x13eb0(0xa3)];const _0x5cd4f4=_0x46bce2?.[_0x13eb0(0xa8)],_0x2b5631=_0x1e17cb?.[_0x13eb0(0xa8)],_0x166ef2=_0x3f242b?.[_0x13eb0(0xbe)]?.[_0x13eb0(0xa8)],_0x22f1a3=_0x589e0d[_0x13eb0(0xa8)];_0x174305[_0x13eb0(0xa8)]&&(_0x174305[_0x13eb0(0xa8)]!==_0x5cd4f4&&_0x174305[_0x13eb0(0xa8)]!==_0x2b5631&&_0x174305[_0x13eb0(0xa8)]!==_0x166ef2&&_0x174305['database']!==_0x22f1a3)&&(_0x563723[_0x13eb0(0xa8)]=_0x174305[_0x13eb0(0xa8)]);if(_0x174305['parentSegment'])_0x563723[_0x13eb0(0x9e)]=_0x174305[_0x13eb0(0x90)];if(_0x174305[_0x13eb0(0xb2)])_0x563723[_0x13eb0(0x81)]=_0x174305[_0x13eb0(0xb2)];if(_0x174305['profile'])_0x563723[_0x13eb0(0xa5)]=_0x174305['profile'];this[_0x13eb0(0x93)]={'cliFlags':_0x563723,'session':_0x2518c7(_0x46bce2),'project':_0x2518c7(_0x1e17cb),'profile':_0x2518c7(_0x3f242b?.[_0x13eb0(0xbe)]),'global':_0x2518c7(_0x589e0d)};const _0x588c41={...this[_0x13eb0(0x93)][_0x13eb0(0x8f)],...this[_0x13eb0(0x93)]['profile'],...this[_0x13eb0(0x93)][_0x13eb0(0xb8)],...this['layers'][_0x13eb0(0x92)],...this[_0x13eb0(0x93)][_0x13eb0(0xbb)]},_0x50a339=_0x588c41['site']||_0x13eb0(0x9d);this['site']=resolveSite(_0x50a339),this[_0x13eb0(0xa8)]=_0x588c41[_0x13eb0(0xa8)],this['parent_segment']=_0x588c41['parent_segment'],this[_0x13eb0(0x85)]=_0x588c41['segment_path'],this[_0x13eb0(0x81)]=_0x588c41[_0x13eb0(0x81)],this['verbose']=_0x174305[_0x13eb0(0xb7)]||![],this[_0x13eb0(0xa9)]=_0x174305[_0x13eb0(0xa9)]??LogLevel[_0x13eb0(0x9c)],this[_0x13eb0(0x7c)]=getAPIKey(this[_0x13eb0(0xa3)],this[_0x13eb0(0x8e)]||undefined);const _0x3280c8=getConfigDir(),_0x15e5dc=a39_0x51daee[_0x13eb0(0xb1)](_0x3280c8,_0x13eb0(0x97),this['sessionId']+_0x13eb0(0xa4)),_0x13f34d=findProjectConfigPath(),_0x10c17c=a39_0x51daee[_0x13eb0(0xb1)](_0x3280c8,'tdx.json'),_0x85ae92=a39_0x51daee[_0x13eb0(0xb1)](_0x3280c8,_0x13eb0(0xa2));let _0x59ade5=null,_0x326217=null;this[_0x13eb0(0x8e)]&&(_0x59ade5=a39_0x51daee[_0x13eb0(0xb1)](_0x3280c8,_0x13eb0(0x86),this[_0x13eb0(0x8e)],_0x13eb0(0xad)),_0x326217=a39_0x51daee[_0x13eb0(0xb1)](_0x3280c8,_0x13eb0(0x86),this[_0x13eb0(0x8e)],_0x13eb0(0xa2))),this[_0x13eb0(0xbd)]={'session':a39_0x3157e1[_0x13eb0(0x94)](_0x15e5dc)?_0x15e5dc:null,'project':_0x13f34d,'profile':_0x59ade5&&a39_0x3157e1[_0x13eb0(0x94)](_0x59ade5)?_0x59ade5:null,'profileCredentials':_0x326217&&a39_0x3157e1[_0x13eb0(0x94)](_0x326217)?_0x326217:null,'global':a39_0x3157e1[_0x13eb0(0x94)](_0x10c17c)?_0x10c17c:null,'globalCredentials':a39_0x3157e1[_0x13eb0(0x94)](_0x85ae92)?_0x85ae92:null};}['getSource'](_0x3ca614,_0x2061aa){const _0x344ba4=a39_0x2ebea7;if(!_0x2061aa)return'not\x20set';const _0x378ef4=_0x2061aa;if(this['layers'][_0x344ba4(0xbb)][_0x3ca614]===_0x378ef4){if(_0x3ca614===_0x344ba4(0xa3)&&_0x378ef4===_0x344ba4(0x9d)&&!this[_0x344ba4(0x93)]['session'][_0x344ba4(0xa3)]&&!this[_0x344ba4(0x93)][_0x344ba4(0xb8)][_0x344ba4(0xa3)]&&!this['layers'][_0x344ba4(0xa5)]['site']&&!this[_0x344ba4(0x93)][_0x344ba4(0x8f)][_0x344ba4(0xa3)])return _0x344ba4(0x82);return _0x344ba4(0xaf)+_0x3ca614[_0x344ba4(0xbf)](/_/g,'-');}if(this[_0x344ba4(0x93)][_0x344ba4(0x92)][_0x3ca614]===_0x378ef4)return _0x344ba4(0x92);if(this['layers'][_0x344ba4(0xb8)][_0x3ca614]===_0x378ef4)return _0x344ba4(0xb8);if(this[_0x344ba4(0x93)][_0x344ba4(0xa5)][_0x3ca614]===_0x378ef4)return _0x344ba4(0x99)+this['activeProfile'];if(this['layers'][_0x344ba4(0x8f)][_0x3ca614]===_0x378ef4)return'global';return'default';}[a39_0x2ebea7(0xb0)](){const _0x49d23d=a39_0x2ebea7,_0x4e6799=a39_0x51daee[_0x49d23d(0xb1)](getConfigDir(),_0x49d23d(0xad));if(!a39_0x3157e1[_0x49d23d(0x94)](_0x4e6799))return{};try{const _0x2f45b0=a39_0x3157e1['readFileSync'](_0x4e6799,_0x49d23d(0xae));return JSON[_0x49d23d(0xa6)](_0x2f45b0);}catch{return{};}}[a39_0x2ebea7(0xbc)](_0x4e6be3){const _0xabc497=a39_0x2ebea7;_0x4e6be3[_0xabc497(0xa3)]=this[_0xabc497(0xa3)],!_0x4e6be3[_0xabc497(0xa8)]&&this['database']&&(_0x4e6be3['database']=this[_0xabc497(0xa8)]),!_0x4e6be3[_0xabc497(0x90)]&&this['parent_segment']&&(_0x4e6be3['parentSegment']=this['parent_segment']),!_0x4e6be3['segmentPath']&&this[_0xabc497(0x85)]&&(_0x4e6be3['segmentPath']=this[_0xabc497(0x85)]),!_0x4e6be3['llmProject']&&this[_0xabc497(0x81)]&&(_0x4e6be3[_0xabc497(0xb2)]=this[_0xabc497(0x81)]);}[a39_0x2ebea7(0x95)](){const _0x5db549=a39_0x2ebea7;return[{'key':_0x5db549(0xa3),'value':this['site']},{'key':_0x5db549(0xa8),'value':this['database']},{'key':_0x5db549(0x9e),'value':this[_0x5db549(0x9e)]},{'key':_0x5db549(0x85),'value':this[_0x5db549(0x85)]},{'key':_0x5db549(0x81),'value':this['llm_project']},{'key':_0x5db549(0xa5),'value':this[_0x5db549(0x8e)]||undefined}];}[a39_0x2ebea7(0xb5)](){const _0x3f3ad2=a39_0x2ebea7;console['log'](_0x3f3ad2(0xa7));for(const {key:_0x476748,value:_0xb436cb}of this[_0x3f3ad2(0x95)]()){_0xb436cb&&console[_0x3f3ad2(0x7d)](_0x476748+':\x20'+_0xb436cb);}}[a39_0x2ebea7(0x89)](){const _0x27139f=a39_0x2ebea7;console[_0x27139f(0x7d)](_0x27139f(0xa7));for(const {key:_0x639bf1,value:_0x5f5cf9}of this[_0x27139f(0x95)]()){if(_0x5f5cf9){const _0x527f6b=_0x639bf1==='profile'?_0x27139f(0x83):'('+this[_0x27139f(0x8c)](_0x639bf1,_0x5f5cf9)+')';console[_0x27139f(0x7d)](_0x639bf1+':\x20'+_0x5f5cf9+'\x20'+_0x527f6b);}}console['log'](_0x27139f(0x9f));const _0x32c956=[{'label':_0x27139f(0x8d),'path':this[_0x27139f(0xbd)]['session'],'extra':_0x27139f(0xa0)+this[_0x27139f(0x87)]+')'},{'label':'Project','path':this[_0x27139f(0xbd)][_0x27139f(0xb8)]},{'label':_0x27139f(0x88),'path':this[_0x27139f(0xbd)][_0x27139f(0xa5)]},{'label':_0x27139f(0xb3),'path':this[_0x27139f(0xbd)][_0x27139f(0x8b)]},{'label':_0x27139f(0x96),'path':this['configFiles'][_0x27139f(0x8f)]},{'label':_0x27139f(0x9a),'path':this[_0x27139f(0xbd)][_0x27139f(0xa1)]}];for(const {label:_0x3858a6,path:_0x2c1c16,extra:_0x20a535}of _0x32c956){if(_0x2c1c16)console[_0x27139f(0x7d)](_0x3858a6+':\x20'+_0x2c1c16+'\x20✓'+(_0x20a535?'\x20'+_0x20a535:''));else{if(_0x3858a6===_0x27139f(0x8d))console['log'](_0x3858a6+':\x20none\x20(using\x20session:\x20'+this['sessionId']+')');else(_0x3858a6===_0x27139f(0x84)||_0x3858a6===_0x27139f(0x96))&&console['log'](_0x3858a6+_0x27139f(0xb4));}}}async['resolveAPIKeyAsync'](){const _0x3f83aa=a39_0x2ebea7;return this[_0x3f83aa(0x7c)]=await getAPIKeyAsync(this[_0x3f83aa(0xa3)],this[_0x3f83aa(0x8e)]||undefined),this['apiKey'];}static async[a39_0x2ebea7(0x8a)](_0x28d8c8){const _0xa400a7=a39_0x2ebea7,_0x128132=new GlobalContext(_0x28d8c8);return await _0x128132[_0xa400a7(0xb6)](),_0x128132;}}
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;}}
@@ -1 +1 @@
1
- (function(_0x1d7614,_0x2ae9f7){const _0x559739=a40_0x3e44,_0x4d47f7=_0x1d7614();while(!![]){try{const _0x1eefae=-parseInt(_0x559739(0xa0))/0x1*(parseInt(_0x559739(0x93))/0x2)+-parseInt(_0x559739(0x8a))/0x3*(-parseInt(_0x559739(0x96))/0x4)+-parseInt(_0x559739(0x99))/0x5*(-parseInt(_0x559739(0xa5))/0x6)+parseInt(_0x559739(0x8c))/0x7*(-parseInt(_0x559739(0x95))/0x8)+parseInt(_0x559739(0x8b))/0x9*(-parseInt(_0x559739(0x9b))/0xa)+parseInt(_0x559739(0x84))/0xb*(-parseInt(_0x559739(0x85))/0xc)+parseInt(_0x559739(0x9a))/0xd;if(_0x1eefae===_0x2ae9f7)break;else _0x4d47f7['push'](_0x4d47f7['shift']());}catch(_0x1eb5c4){_0x4d47f7['push'](_0x4d47f7['shift']());}}}(a40_0x31d0,0xe2634));const SERVICE_NAME='tdx';let keyringModule=null,keyringLoadError=null;function a40_0x31d0(){const _0x143a44=['includes','not\x20found','deletePassword','1595764YdSpLH','not_found','16VEETUe','113996dnHzcl','success','could\x20not\x20be\x20found','5HHrTCo','34203377hJezcc','1370NPlghk','Warning:\x20','getPassword','System\x20keychain\x20is\x20not\x20available','@zowe/secrets-for-zowe-sdk','1qImzBp','message','keyring','toLowerCase','reason','4462422mAIzBi','setPassword','9683531mcBEmW','12LqSHRU','error','restricted','unavailable','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','87EMDEXC','65268IzfXXZ','2107791BnQXZf','access','not\x20available','-25293'];a40_0x31d0=function(){return _0x143a44;};return a40_0x31d0();}async function getKeyring(){const _0x473165=a40_0x3e44;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x7eee19=await import(_0x473165(0x9f));return keyringModule=_0x7eee19[_0x473165(0xa2)],keyringModule;}catch(_0x5306a4){return keyringLoadError=_0x5306a4 instanceof Error?_0x5306a4:new Error(String(_0x5306a4)),null;}}function getAccountName(_0x123bdd){const _0x1e05e0=_0x123bdd||'';return'profile:'+_0x1e05e0+':api_key';}export async function getKeychainAPIKey(_0x49c59a){const _0x50f9b7=a40_0x3e44,_0x37a7a5=await getKeychainAPIKeyWithStatus(_0x49c59a);if(_0x37a7a5[_0x50f9b7(0x97)])return _0x37a7a5['value'];return _0x37a7a5[_0x50f9b7(0xa4)]==='access_denied'&&console[_0x50f9b7(0x86)](_0x50f9b7(0x9c)+_0x37a7a5['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x4e45aa){const _0x23efa3=a40_0x3e44;try{const _0x4af308=await getKeyring();if(!_0x4af308)return{'success':![],'reason':_0x23efa3(0x88)};const _0x2959d3=getAccountName(_0x4e45aa),_0x40ee0f=await _0x4af308[_0x23efa3(0x9d)](SERVICE_NAME,_0x2959d3);if(_0x40ee0f)return{'success':!![],'value':_0x40ee0f};return{'success':![],'reason':'not_found'};}catch(_0x566abb){const _0x53eed7=_0x566abb instanceof Error?_0x566abb[_0x23efa3(0xa1)]:String(_0x566abb);if(_0x53eed7[_0x23efa3(0x90)]('-25300')||_0x53eed7[_0x23efa3(0xa3)]()[_0x23efa3(0x90)](_0x23efa3(0x98))||_0x53eed7['toLowerCase']()[_0x23efa3(0x90)](_0x23efa3(0x91)))return{'success':![],'reason':_0x23efa3(0x94)};if(_0x53eed7[_0x23efa3(0x90)](_0x23efa3(0x8f))||_0x53eed7[_0x23efa3(0xa3)]()[_0x23efa3(0x90)](_0x23efa3(0x87))||_0x53eed7[_0x23efa3(0xa3)]()['includes'](_0x23efa3(0x8d)))return{'success':![],'reason':'access_denied','message':_0x23efa3(0x89)};return{'success':![],'reason':_0x23efa3(0x88),'message':_0x53eed7};}}export async function saveKeychainAPIKey(_0x5a758b,_0x186d89){const _0x159ae2=a40_0x3e44,_0x36b22f=await getKeyring();if(!_0x36b22f)throw new Error(_0x159ae2(0x9e));const _0x519042=getAccountName(_0x186d89);await _0x36b22f[_0x159ae2(0x83)](SERVICE_NAME,_0x519042,_0x5a758b);}export async function deleteKeychainAPIKey(_0x3dc48e){const _0x487522=a40_0x3e44;try{const _0x3c6bb8=await getKeyring();if(!_0x3c6bb8)return![];const _0x819db5=getAccountName(_0x3dc48e);return await _0x3c6bb8[_0x487522(0x92)](SERVICE_NAME,_0x819db5);}catch{return![];}}function a40_0x3e44(_0x3ad081,_0xfdac84){const _0x31d04c=a40_0x31d0();return a40_0x3e44=function(_0x3e4498,_0x25943b){_0x3e4498=_0x3e4498-0x83;let _0x3e070e=_0x31d04c[_0x3e4498];return _0x3e070e;},a40_0x3e44(_0x3ad081,_0xfdac84);}export async function isKeychainAvailable(){const _0x12e111=a40_0x3e44;try{const _0x2a06d7=await getKeyring();if(!_0x2a06d7)return![];return await _0x2a06d7[_0x12e111(0x9d)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x3fd950){const _0x1850fa=_0x3fd950 instanceof Error?_0x3fd950[_0x12e111(0xa1)]['toLowerCase']():'';if(_0x1850fa[_0x12e111(0x90)](_0x12e111(0x8e))||_0x1850fa[_0x12e111(0x90)]('not\x20supported')||_0x1850fa[_0x12e111(0x90)]('cannot\x20find'))return![];return!![];}}
1
+ (function(_0x1a2ebf,_0x26e384){const _0x59ef73=a40_0x586f,_0x226d0a=_0x1a2ebf();while(!![]){try{const _0x551d31=parseInt(_0x59ef73(0x181))/0x1*(-parseInt(_0x59ef73(0x16a))/0x2)+parseInt(_0x59ef73(0x185))/0x3+parseInt(_0x59ef73(0x16f))/0x4*(-parseInt(_0x59ef73(0x176))/0x5)+parseInt(_0x59ef73(0x18b))/0x6*(parseInt(_0x59ef73(0x184))/0x7)+parseInt(_0x59ef73(0x17f))/0x8+parseInt(_0x59ef73(0x174))/0x9+parseInt(_0x59ef73(0x17c))/0xa*(-parseInt(_0x59ef73(0x17d))/0xb);if(_0x551d31===_0x26e384)break;else _0x226d0a['push'](_0x226d0a['shift']());}catch(_0x164220){_0x226d0a['push'](_0x226d0a['shift']());}}}(a40_0x390c,0xae8eb));const SERVICE_NAME='tdx';let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x891d4a=a40_0x586f;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x3b7049=await import(_0x891d4a(0x187));return keyringModule=_0x3b7049[_0x891d4a(0x16c)],keyringModule;}catch(_0x13fb31){return keyringLoadError=_0x13fb31 instanceof Error?_0x13fb31:new Error(String(_0x13fb31)),null;}}function getAccountName(_0x19a5f2){const _0x52bdcc=a40_0x586f,_0x3f4a0a=_0x19a5f2||'';return _0x52bdcc(0x18a)+_0x3f4a0a+_0x52bdcc(0x178);}export async function getKeychainAPIKey(_0x5b1512){const _0x1542e8=a40_0x586f,_0x586fb2=await getKeychainAPIKeyWithStatus(_0x5b1512);if(_0x586fb2[_0x1542e8(0x16d)])return _0x586fb2[_0x1542e8(0x173)];return _0x586fb2[_0x1542e8(0x180)]===_0x1542e8(0x186)&&console[_0x1542e8(0x188)](_0x1542e8(0x171)+_0x586fb2[_0x1542e8(0x172)]),null;}export async function getKeychainAPIKeyWithStatus(_0x39489d){const _0x5d7eb6=a40_0x586f;try{const _0x36a6a2=await getKeyring();if(!_0x36a6a2)return{'success':![],'reason':_0x5d7eb6(0x17e)};const _0x1da758=getAccountName(_0x39489d),_0x372e01=await _0x36a6a2['getPassword'](SERVICE_NAME,_0x1da758);if(_0x372e01)return{'success':!![],'value':_0x372e01};return{'success':![],'reason':_0x5d7eb6(0x170)};}catch(_0x4dcf7e){const _0x547e75=_0x4dcf7e instanceof Error?_0x4dcf7e[_0x5d7eb6(0x172)]:String(_0x4dcf7e);if(_0x547e75[_0x5d7eb6(0x179)](_0x5d7eb6(0x16b))||_0x547e75[_0x5d7eb6(0x168)]()[_0x5d7eb6(0x179)](_0x5d7eb6(0x166))||_0x547e75['toLowerCase']()[_0x5d7eb6(0x179)](_0x5d7eb6(0x18c)))return{'success':![],'reason':_0x5d7eb6(0x170)};if(_0x547e75[_0x5d7eb6(0x179)](_0x5d7eb6(0x169))||_0x547e75[_0x5d7eb6(0x168)]()[_0x5d7eb6(0x179)](_0x5d7eb6(0x17a))||_0x547e75['toLowerCase']()['includes']('access'))return{'success':![],'reason':_0x5d7eb6(0x186),'message':_0x5d7eb6(0x16e)};return{'success':![],'reason':_0x5d7eb6(0x17e),'message':_0x547e75};}}export async function saveKeychainAPIKey(_0xa2bca6,_0x11f824){const _0x32abba=a40_0x586f,_0x3cdda1=await getKeyring();if(!_0x3cdda1)throw new Error(_0x32abba(0x17b));const _0x2b9f46=getAccountName(_0x11f824);await _0x3cdda1['setPassword'](SERVICE_NAME,_0x2b9f46,_0xa2bca6);}export async function deleteKeychainAPIKey(_0xcddb1a){const _0x65cdca=a40_0x586f;try{const _0x3f0b19=await getKeyring();if(!_0x3f0b19)return![];const _0x46ea9b=getAccountName(_0xcddb1a);return await _0x3f0b19[_0x65cdca(0x182)](SERVICE_NAME,_0x46ea9b);}catch{return![];}}function a40_0x390c(){const _0x38ca35=['-25300','keyring','success','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','4MyrLTT','not_found','Warning:\x20','message','value','9891594ppcUYX','not\x20supported','2065530hVDPxs','__keychain_test__',':api_key','includes','restricted','System\x20keychain\x20is\x20not\x20available','375890kGSUHX','407nbYOoa','unavailable','6813904jAGqml','reason','21878nfwFQm','deletePassword','getPassword','7XLccBb','792573XglihX','access_denied','@zowe/secrets-for-zowe-sdk','error','not\x20available','profile:','3267294PYQQDk','not\x20found','could\x20not\x20be\x20found','cannot\x20find','toLowerCase','-25293','22aZslZi'];a40_0x390c=function(){return _0x38ca35;};return a40_0x390c();}function a40_0x586f(_0x1c9005,_0x365e76){const _0x390ccb=a40_0x390c();return a40_0x586f=function(_0x586f6f,_0x3cfb6b){_0x586f6f=_0x586f6f-0x166;let _0x2c1c49=_0x390ccb[_0x586f6f];return _0x2c1c49;},a40_0x586f(_0x1c9005,_0x365e76);}export async function isKeychainAvailable(){const _0x27fd68=a40_0x586f;try{const _0x18f321=await getKeyring();if(!_0x18f321)return![];return await _0x18f321[_0x27fd68(0x183)](SERVICE_NAME,_0x27fd68(0x177)),!![];}catch(_0x5055a3){const _0x22821e=_0x5055a3 instanceof Error?_0x5055a3[_0x27fd68(0x172)][_0x27fd68(0x168)]():'';if(_0x22821e['includes'](_0x27fd68(0x189))||_0x22821e[_0x27fd68(0x179)](_0x27fd68(0x175))||_0x22821e[_0x27fd68(0x179)](_0x27fd68(0x167)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x84a4e7,_0x547dd6){const _0x38eff3=a41_0x1ae3,_0xf65d2b=_0x84a4e7();while(!![]){try{const _0x27edf3=-parseInt(_0x38eff3(0x180))/0x1*(-parseInt(_0x38eff3(0x196))/0x2)+parseInt(_0x38eff3(0x186))/0x3+parseInt(_0x38eff3(0x194))/0x4*(-parseInt(_0x38eff3(0x177))/0x5)+-parseInt(_0x38eff3(0x176))/0x6+parseInt(_0x38eff3(0x172))/0x7+-parseInt(_0x38eff3(0x190))/0x8*(parseInt(_0x38eff3(0x18b))/0x9)+-parseInt(_0x38eff3(0x17a))/0xa*(-parseInt(_0x38eff3(0x18f))/0xb);if(_0x27edf3===_0x547dd6)break;else _0xf65d2b['push'](_0xf65d2b['shift']());}catch(_0x52cf45){_0xf65d2b['push'](_0xf65d2b['shift']());}}}(a41_0x17b7,0x4219a));import*as a41_0x4190b6 from'node:fs';import*as a41_0x419479 from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';export function getProfileParams(_0x2674aa){const _0x4167e8=a41_0x1ae3,_0x8e8d47={};if(!_0x2674aa)return _0x8e8d47;for(const [_0x5e6138,_0x440bab]of Object[_0x4167e8(0x18c)](_0x2674aa)){_0x5e6138!==_0x4167e8(0x1a8)&&_0x440bab!==undefined&&(_0x8e8d47[_0x5e6138]=_0x440bab);}return _0x8e8d47;}export function getProfilesDir(){const _0x24d00d=a41_0x1ae3;return a41_0x419479[_0x24d00d(0x1a0)](getConfigDir(),_0x24d00d(0x1a3));}function getProfileDir(_0x1433c9){const _0x16f59c=a41_0x1ae3;return a41_0x419479[_0x16f59c(0x1a0)](getProfilesDir(),_0x1433c9);}function getProfileConfigPath(_0x51f3c6){const _0x269d55=a41_0x1ae3;return a41_0x419479[_0x269d55(0x1a0)](getProfileDir(_0x51f3c6),'tdx.json');}function getProfileEnvPath(_0x56991){const _0x39110b=a41_0x1ae3;return a41_0x419479['join'](getProfileDir(_0x56991),_0x39110b(0x15d));}function getGlobalConfigPath(){const _0x6bc1d2=a41_0x1ae3;return a41_0x419479[_0x6bc1d2(0x1a0)](getConfigDir(),_0x6bc1d2(0x18e));}function validateProfileName(_0x15421){const _0x52f187=a41_0x1ae3;if(!/^[a-zA-Z0-9_-]+$/[_0x52f187(0x170)](_0x15421))throw new Error(_0x52f187(0x19f)+_0x15421+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.');}function validateProfileConfig(_0x2f6795,_0xaf3156){const _0x59a5b2=a41_0x1ae3;if(typeof _0x2f6795!==_0x59a5b2(0x168)||_0x2f6795===null)throw new Error(_0x59a5b2(0x18d)+_0xaf3156+_0x59a5b2(0x16d));const _0x1a5e48=[_0x59a5b2(0x1a8),_0x59a5b2(0x178),_0x59a5b2(0x184),_0x59a5b2(0x182),_0x59a5b2(0x165),_0x59a5b2(0x19c)],_0x1d599f=_0x2f6795;for(const _0x18a2b9 of Object['keys'](_0x1d599f)){!_0x1a5e48[_0x59a5b2(0x187)](_0x18a2b9)&&console[_0x59a5b2(0x1aa)]('Warning:\x20Profile\x20\x27'+_0xaf3156+_0x59a5b2(0x17b)+_0x18a2b9+_0x59a5b2(0x174));}if(_0x1d599f[_0x59a5b2(0x1a8)]!==undefined&&typeof _0x1d599f['description']!==_0x59a5b2(0x17c))throw new Error(_0x59a5b2(0x18d)+_0xaf3156+_0x59a5b2(0x160));if(_0x1d599f[_0x59a5b2(0x178)]!==undefined&&typeof _0x1d599f['site']!=='string')throw new Error('Profile\x20\x27'+_0xaf3156+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x1d599f[_0x59a5b2(0x184)]!==undefined&&typeof _0x1d599f[_0x59a5b2(0x184)]!==_0x59a5b2(0x17c))throw new Error('Profile\x20\x27'+_0xaf3156+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x1d599f[_0x59a5b2(0x182)]!==undefined&&typeof _0x1d599f[_0x59a5b2(0x182)]!==_0x59a5b2(0x17c))throw new Error(_0x59a5b2(0x18d)+_0xaf3156+_0x59a5b2(0x15e));if(_0x1d599f['llm_project']!==undefined&&typeof _0x1d599f[_0x59a5b2(0x165)]!==_0x59a5b2(0x17c))throw new Error(_0x59a5b2(0x18d)+_0xaf3156+_0x59a5b2(0x15c));if(_0x1d599f[_0x59a5b2(0x19c)]!==undefined&&typeof _0x1d599f[_0x59a5b2(0x19c)]!==_0x59a5b2(0x17c))throw new Error('Profile\x20\x27'+_0xaf3156+_0x59a5b2(0x17f));return!![];}function loadProfilesFromTdxJson(_0x1f5827,_0x21fdd6){const _0x1e939e=a41_0x1ae3;if(!a41_0x4190b6[_0x1e939e(0x1a1)](_0x1f5827))return[];try{const _0x381889=a41_0x4190b6[_0x1e939e(0x19e)](_0x1f5827,_0x1e939e(0x17e)),_0x151e48=JSON['parse'](_0x381889);if(!_0x151e48[_0x1e939e(0x1a3)]||typeof _0x151e48['profiles']!==_0x1e939e(0x168))return[];const _0x51f7b0=[];for(const [_0x34bf8a,_0x1e9d69]of Object[_0x1e939e(0x18c)](_0x151e48[_0x1e939e(0x1a3)])){try{validateProfileConfig(_0x1e9d69,_0x34bf8a);const _0x1ad693=getNewCredentialPath(_0x34bf8a),_0x15466f=getOldCredentialPath(_0x34bf8a),_0x27d7ef=a41_0x4190b6[_0x1e939e(0x1a1)](_0x1ad693)||a41_0x4190b6[_0x1e939e(0x1a1)](_0x15466f);_0x51f7b0[_0x1e939e(0x18a)]({'name':_0x34bf8a,'config':_0x1e9d69,'metadata':{'name':_0x34bf8a,'createdAt':new Date()[_0x1e939e(0x169)]()},'hasCredentials':_0x27d7ef,'scope':_0x21fdd6});}catch(_0x1698e4){_0x1698e4 instanceof Error&&(console[_0x1e939e(0x1aa)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x1f5827+':'),console[_0x1e939e(0x1aa)]('\x20\x20'+_0x1698e4[_0x1e939e(0x179)]+'\x0a'));}}return _0x51f7b0;}catch(_0x87af66){return _0x87af66 instanceof SyntaxError?(console[_0x1e939e(0x1aa)](_0x1e939e(0x1a7)+_0x1f5827+_0x1e939e(0x199)),console[_0x1e939e(0x1aa)](_0x1e939e(0x197)+_0x87af66[_0x1e939e(0x179)]+'\x0a')):console['warn'](_0x1e939e(0x17d)+_0x1f5827+':\x20'+_0x87af66+'\x0a'),[];}}export function getNewCredentialPath(_0x265dc6){const _0x233414=a41_0x1ae3;return a41_0x419479[_0x233414(0x1a0)](getConfigDir(),_0x233414(0x181)+_0x265dc6);}function getOldCredentialPath(_0x549eb5){const _0x4c0ba9=a41_0x1ae3;return a41_0x419479[_0x4c0ba9(0x1a0)](getProfilesDir(),_0x549eb5,_0x4c0ba9(0x15d));}function loadProfilesFromTdxJsonFiles(){const _0x37ba8c=a41_0x1ae3,_0x1b8124=[],_0x33d864=findProjectConfigPath();_0x33d864&&_0x1b8124['push'](...loadProfilesFromTdxJson(_0x33d864,_0x37ba8c(0x166)));const _0x187dec=a41_0x419479['join'](getConfigDir(),_0x37ba8c(0x18e));return _0x1b8124[_0x37ba8c(0x18a)](...loadProfilesFromTdxJson(_0x187dec,_0x37ba8c(0x16f))),_0x1b8124;}function loadProfilesFromDirectories(){const _0x56d3d5=a41_0x1ae3,_0x2e7495=getProfilesDir();if(!a41_0x4190b6[_0x56d3d5(0x1a1)](_0x2e7495))return[];try{return a41_0x4190b6[_0x56d3d5(0x191)](_0x2e7495,{'withFileTypes':!![]})['filter'](_0x428142=>_0x428142['isDirectory']())[_0x56d3d5(0x171)](_0x1de160=>_0x1de160[_0x56d3d5(0x193)])[_0x56d3d5(0x164)](_0x4d7828=>{const _0x59ad6b=_0x56d3d5,_0x1ded6c=getProfileConfigPath(_0x4d7828),_0x46d0f4=getProfileEnvPath(_0x4d7828);return a41_0x4190b6[_0x59ad6b(0x1a1)](_0x1ded6c)||a41_0x4190b6[_0x59ad6b(0x1a1)](_0x46d0f4);})[_0x56d3d5(0x171)](_0x597e38=>{const _0x522683=_0x56d3d5,_0x376588=loadProfileFromDirectory(_0x597e38);if(_0x376588)return{..._0x376588,'scope':_0x522683(0x19a)};return null;})[_0x56d3d5(0x164)](_0x306982=>_0x306982!==null);}catch{return[];}}function loadProfileFromDirectory(_0x27efa2){const _0x5bded2=a41_0x1ae3,_0x5bd7b7=getProfileConfigPath(_0x27efa2),_0x37f9a3=getOldCredentialPath(_0x27efa2);if(!a41_0x4190b6[_0x5bded2(0x1a1)](_0x5bd7b7)&&!a41_0x4190b6['existsSync'](_0x37f9a3))return null;let _0x29cece={},_0x394d2b={'name':_0x27efa2,'createdAt':new Date()[_0x5bded2(0x169)]()};if(a41_0x4190b6[_0x5bded2(0x1a1)](_0x5bd7b7))try{const _0x39ff81=a41_0x4190b6['readFileSync'](_0x5bd7b7,_0x5bded2(0x17e)),_0x5e5ec4=JSON[_0x5bded2(0x16a)](_0x39ff81),{metadata:_0x4c4a40,..._0x230311}=_0x5e5ec4;_0x29cece=_0x230311,_0x4c4a40&&(_0x394d2b=_0x4c4a40);}catch{}return{'name':_0x27efa2,'config':_0x29cece,'metadata':_0x394d2b,'hasCredentials':a41_0x4190b6[_0x5bded2(0x1a1)](_0x37f9a3),'scope':_0x5bded2(0x19a)};}function a41_0x1ae3(_0x52fd06,_0x3c351b){const _0x17b7f4=a41_0x17b7();return a41_0x1ae3=function(_0x1ae3e9,_0x3e003e){_0x1ae3e9=_0x1ae3e9-0x15c;let _0x447ed1=_0x17b7f4[_0x1ae3e9];return _0x447ed1;},a41_0x1ae3(_0x52fd06,_0x3c351b);}export function listProfiles(){const _0x2414ae=a41_0x1ae3,_0x50e15e=loadProfilesFromTdxJsonFiles(),_0xb77831=loadProfilesFromDirectories();if(_0xb77831[_0x2414ae(0x1a4)]>0x0){const _0x27a91f=_0xb77831[_0x2414ae(0x171)](_0x116a5f=>_0x116a5f[_0x2414ae(0x193)])['join'](',\x20'),_0x1b4c7f=getConfigDir();console[_0x2414ae(0x1aa)](_0x2414ae(0x16c)+_0x27a91f),console['warn'](_0x2414ae(0x19b)),console['warn'](_0x2414ae(0x192)+a41_0x419479[_0x2414ae(0x1a0)](_0x1b4c7f,_0x2414ae(0x18e))),console['warn'](_0x2414ae(0x175)),console[_0x2414ae(0x1aa)](_0x2414ae(0x1ab));}const _0x51c091=[..._0x50e15e,..._0xb77831],_0x1b2127=new Map();for(const _0x8eadae of _0x51c091){!_0x1b2127[_0x2414ae(0x15f)](_0x8eadae['name'])&&_0x1b2127[_0x2414ae(0x183)](_0x8eadae[_0x2414ae(0x193)],_0x8eadae);}return Array[_0x2414ae(0x1a9)](_0x1b2127[_0x2414ae(0x163)]())[_0x2414ae(0x195)]((_0x191837,_0x174755)=>_0x191837['name'][_0x2414ae(0x16e)](_0x174755[_0x2414ae(0x193)]));}export function profileExists(_0x140b8b){const _0x2622a2=a41_0x1ae3,_0x507d8c=listProfiles();return _0x507d8c[_0x2622a2(0x16b)](_0x4b8c64=>_0x4b8c64[_0x2622a2(0x193)]===_0x140b8b);}export function loadProfile(_0x2407e0){const _0x32abca=a41_0x1ae3;validateProfileName(_0x2407e0);const _0x2780c2=listProfiles(),_0x5f269d=_0x2780c2[_0x32abca(0x162)](_0x1196b6=>_0x1196b6[_0x32abca(0x193)]===_0x2407e0);return _0x5f269d||null;}export function saveProfile(_0x147fc9,_0x920c6c,_0x5389d4=![]){saveProfileToUserConfig(_0x147fc9,_0x920c6c);}export function deleteProfile(_0x38c099){const _0x5a5f65=a41_0x1ae3;validateProfileName(_0x38c099);const _0x5b0e23=getProfileDir(_0x38c099);if(!a41_0x4190b6[_0x5a5f65(0x1a1)](_0x5b0e23))throw new Error(_0x5a5f65(0x185)+_0x38c099+_0x5a5f65(0x198));a41_0x4190b6[_0x5a5f65(0x19d)](_0x5b0e23,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x743b73,_0x20c33b){const _0x14905f=a41_0x1ae3;validateProfileName(_0x743b73);const _0x205d92=getGlobalConfigPath(),_0x3fd0b0=getConfigDir();!a41_0x4190b6['existsSync'](_0x3fd0b0)&&createSecureDirectory(_0x3fd0b0);let _0x58ad4d={};if(a41_0x4190b6[_0x14905f(0x1a1)](_0x205d92))try{const _0x520ff1=a41_0x4190b6['readFileSync'](_0x205d92,'utf-8');_0x58ad4d=JSON['parse'](_0x520ff1);}catch{console[_0x14905f(0x1aa)](_0x14905f(0x1a5)+_0x205d92+_0x14905f(0x173));}!_0x58ad4d[_0x14905f(0x1a3)]&&(_0x58ad4d[_0x14905f(0x1a3)]={}),_0x58ad4d[_0x14905f(0x1a3)][_0x743b73]=_0x20c33b,writeSecureFile(_0x205d92,JSON[_0x14905f(0x161)](_0x58ad4d,null,0x2));}function a41_0x17b7(){const _0x4e7978=['Invalid\x20profile\x20name:\x20','join','existsSync','\x22\x20\x22','profiles','length','Warning:\x20Failed\x20to\x20parse\x20','profile','\x0aWarning:\x20Failed\x20to\x20parse\x20','description','from','warn','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','.env','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','has','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','stringify','find','values','filter','llm_project','local','To\x20migrate:','object','toISOString','parse','some','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x27:\x20config\x20must\x20be\x20an\x20object','localeCompare','user','test','map','1445899ZtnfXb',',\x20creating\x20new\x20file','\x27\x20will\x20be\x20ignored','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','643326TaSBvd','59835DmlEbM','site','message','2007370dYnGoJ','\x27:\x20unknown\x20config\x20key\x20\x27','string','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','utf-8','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','9OZdIBf','.env.','parent_segment','set','database','Profile\x20','823173vTKISi','includes','\x20\x20mv\x20\x22','\x20already\x20exists','push','18hCuwnk','entries','Profile\x20\x27','tdx.json','11ppEjET','995176WKYDYq','readdirSync','\x20\x201.\x20Edit:\x20','name','100HPOXXL','sort','54278bomnbx','Error:\x20','\x20does\x20not\x20exist',':\x20Invalid\x20JSON\x20syntax','directory','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','llm_agent','rmSync','readFileSync'];a41_0x17b7=function(){return _0x4e7978;};return a41_0x17b7();}export function getActiveProfile(){const _0x4161bc=a41_0x1ae3,_0xef754c=getGlobalConfigPath();if(!a41_0x4190b6[_0x4161bc(0x1a1)](_0xef754c))return null;try{const _0x4aa40c=a41_0x4190b6[_0x4161bc(0x19e)](_0xef754c,'utf-8'),_0x51e403=JSON['parse'](_0x4aa40c);return _0x51e403[_0x4161bc(0x1a6)]||null;}catch{return null;}}export function createProfile(_0x4ebd67,_0x1f7b5e){const _0x313d2b=a41_0x1ae3;validateProfileName(_0x4ebd67);if(profileExists(_0x4ebd67))throw new Error('Profile\x20'+_0x4ebd67+_0x313d2b(0x189));saveProfile(_0x4ebd67,_0x1f7b5e);}export function saveProfileCredentials(_0x475c45,_0x439615){const _0x564b1e=a41_0x1ae3;validateProfileName(_0x475c45);if(!profileExists(_0x475c45))throw new Error(_0x564b1e(0x185)+_0x475c45+_0x564b1e(0x198));const _0x5e0a57=getNewCredentialPath(_0x475c45);writeSecureFile(_0x5e0a57,_0x439615);}export function loadProfileCredentials(_0x2ee6dc){const _0x2e04f7=a41_0x1ae3;validateProfileName(_0x2ee6dc);const _0x448238=getNewCredentialPath(_0x2ee6dc);if(a41_0x4190b6[_0x2e04f7(0x1a1)](_0x448238))try{return a41_0x4190b6[_0x2e04f7(0x19e)](_0x448238,_0x2e04f7(0x17e));}catch{}const _0x43e293=getOldCredentialPath(_0x2ee6dc);if(a41_0x4190b6[_0x2e04f7(0x1a1)](_0x43e293)){console[_0x2e04f7(0x1aa)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x2ee6dc+'\x27'),console[_0x2e04f7(0x1aa)](_0x2e04f7(0x167)),console[_0x2e04f7(0x1aa)](_0x2e04f7(0x188)+_0x43e293+_0x2e04f7(0x1a2)+_0x448238+'\x22'),console[_0x2e04f7(0x1aa)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a41_0x4190b6['readFileSync'](_0x43e293,_0x2e04f7(0x17e));}catch{return null;}}return null;}
1
+ (function(_0x2f77d6,_0x633fa1){const _0x5a8717=a41_0x32bf,_0x58a479=_0x2f77d6();while(!![]){try{const _0x293d22=-parseInt(_0x5a8717(0x8f))/0x1+-parseInt(_0x5a8717(0x8a))/0x2+parseInt(_0x5a8717(0x9d))/0x3*(parseInt(_0x5a8717(0x7d))/0x4)+-parseInt(_0x5a8717(0xb6))/0x5+-parseInt(_0x5a8717(0xa2))/0x6+-parseInt(_0x5a8717(0x75))/0x7*(parseInt(_0x5a8717(0x8b))/0x8)+parseInt(_0x5a8717(0xa3))/0x9;if(_0x293d22===_0x633fa1)break;else _0x58a479['push'](_0x58a479['shift']());}catch(_0x586736){_0x58a479['push'](_0x58a479['shift']());}}}(a41_0x173a,0x77b60));import*as a41_0x40d147 from'node:fs';import*as a41_0x5ea2ab from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';export function getProfileParams(_0x450ab5){const _0x2b7f95=a41_0x32bf,_0x48bb4c={};if(!_0x450ab5)return _0x48bb4c;for(const [_0x2234a0,_0x4b07eb]of Object[_0x2b7f95(0x92)](_0x450ab5)){_0x2234a0!=='description'&&_0x4b07eb!==undefined&&(_0x48bb4c[_0x2234a0]=_0x4b07eb);}return _0x48bb4c;}export function getProfilesDir(){const _0x15f50b=a41_0x32bf;return a41_0x5ea2ab['join'](getConfigDir(),_0x15f50b(0x7c));}function getProfileDir(_0x33d013){const _0x6d1651=a41_0x32bf;return a41_0x5ea2ab[_0x6d1651(0x7a)](getProfilesDir(),_0x33d013);}function getProfileConfigPath(_0x5e18bb){return a41_0x5ea2ab['join'](getProfileDir(_0x5e18bb),'tdx.json');}function getProfileEnvPath(_0x1cc52e){const _0x13efc4=a41_0x32bf;return a41_0x5ea2ab[_0x13efc4(0x7a)](getProfileDir(_0x1cc52e),_0x13efc4(0xb3));}function getGlobalConfigPath(){const _0x2d4a28=a41_0x32bf;return a41_0x5ea2ab[_0x2d4a28(0x7a)](getConfigDir(),_0x2d4a28(0x77));}function validateProfileName(_0x3e97ff){const _0x2d5880=a41_0x32bf;if(!/^[a-zA-Z0-9_-]+$/[_0x2d5880(0xae)](_0x3e97ff))throw new Error(_0x2d5880(0xa1)+_0x3e97ff+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.');}function validateProfileConfig(_0x3f564f,_0xebd884){const _0x185500=a41_0x32bf;if(typeof _0x3f564f!==_0x185500(0x9f)||_0x3f564f===null)throw new Error(_0x185500(0x9b)+_0xebd884+_0x185500(0x82));const _0x2f58d5=[_0x185500(0xb8),_0x185500(0xac),_0x185500(0xb0),'parent_segment',_0x185500(0x9e),'llm_agent'],_0x3eb00a=_0x3f564f;for(const _0x515e84 of Object[_0x185500(0xb5)](_0x3eb00a)){!_0x2f58d5[_0x185500(0x90)](_0x515e84)&&console[_0x185500(0x79)](_0x185500(0x89)+_0xebd884+_0x185500(0x7e)+_0x515e84+'\x27\x20will\x20be\x20ignored');}if(_0x3eb00a[_0x185500(0xb8)]!==undefined&&typeof _0x3eb00a[_0x185500(0xb8)]!==_0x185500(0xa7))throw new Error(_0x185500(0x9b)+_0xebd884+_0x185500(0xa9));if(_0x3eb00a['site']!==undefined&&typeof _0x3eb00a[_0x185500(0xac)]!==_0x185500(0xa7))throw new Error('Profile\x20\x27'+_0xebd884+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x3eb00a[_0x185500(0xb0)]!==undefined&&typeof _0x3eb00a['database']!==_0x185500(0xa7))throw new Error(_0x185500(0x9b)+_0xebd884+_0x185500(0xa0));if(_0x3eb00a[_0x185500(0x95)]!==undefined&&typeof _0x3eb00a[_0x185500(0x95)]!==_0x185500(0xa7))throw new Error(_0x185500(0x9b)+_0xebd884+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x3eb00a[_0x185500(0x9e)]!==undefined&&typeof _0x3eb00a[_0x185500(0x9e)]!=='string')throw new Error(_0x185500(0x9b)+_0xebd884+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x3eb00a['llm_agent']!==undefined&&typeof _0x3eb00a['llm_agent']!==_0x185500(0xa7))throw new Error(_0x185500(0x9b)+_0xebd884+_0x185500(0xb4));return!![];}function loadProfilesFromTdxJson(_0x34accc,_0x54ee83){const _0x35c221=a41_0x32bf;if(!a41_0x40d147[_0x35c221(0x93)](_0x34accc))return[];try{const _0x1f055d=a41_0x40d147[_0x35c221(0x73)](_0x34accc,'utf-8'),_0x16369d=JSON['parse'](_0x1f055d);if(!_0x16369d[_0x35c221(0x7c)]||typeof _0x16369d[_0x35c221(0x7c)]!=='object')return[];const _0x5665d3=[];for(const [_0x27feb0,_0x381789]of Object['entries'](_0x16369d[_0x35c221(0x7c)])){try{validateProfileConfig(_0x381789,_0x27feb0);const _0x10d539=getNewCredentialPath(_0x27feb0),_0x3c866b=getOldCredentialPath(_0x27feb0),_0x56d89b=a41_0x40d147[_0x35c221(0x93)](_0x10d539)||a41_0x40d147[_0x35c221(0x93)](_0x3c866b);_0x5665d3[_0x35c221(0x74)]({'name':_0x27feb0,'config':_0x381789,'metadata':{'name':_0x27feb0,'createdAt':new Date()[_0x35c221(0xb7)]()},'hasCredentials':_0x56d89b,'scope':_0x54ee83});}catch(_0x59318c){_0x59318c instanceof Error&&(console[_0x35c221(0x79)](_0x35c221(0x88)+_0x34accc+':'),console[_0x35c221(0x79)]('\x20\x20'+_0x59318c[_0x35c221(0xab)]+'\x0a'));}}return _0x5665d3;}catch(_0x2371eb){return _0x2371eb instanceof SyntaxError?(console[_0x35c221(0x79)]('\x0aWarning:\x20Failed\x20to\x20parse\x20'+_0x34accc+_0x35c221(0x9c)),console[_0x35c221(0x79)](_0x35c221(0x9a)+_0x2371eb['message']+'\x0a')):console['warn'](_0x35c221(0x76)+_0x34accc+':\x20'+_0x2371eb+'\x0a'),[];}}export function getNewCredentialPath(_0x1bd9ab){const _0x289455=a41_0x32bf;return a41_0x5ea2ab[_0x289455(0x7a)](getConfigDir(),'.env.'+_0x1bd9ab);}function a41_0x173a(){const _0x4aef72=['readFileSync','push','7uLbjBJ','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','tdx.json','length','warn','join','Warning:\x20Failed\x20to\x20parse\x20','profiles','83996KqlLjS','\x27:\x20unknown\x20config\x20key\x20\x27','readdirSync','directory','\x20\x20mv\x20\x22','\x27:\x20config\x20must\x20be\x20an\x20object','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','Profile\x20','map','some','name','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','Warning:\x20Profile\x20\x27','1609490DpzAdX','1600824YHFAJZ','localeCompare','utf-8','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','52964dVMury','includes','parse','entries','existsSync','isDirectory','parent_segment','values',',\x20creating\x20new\x20file','find','\x20\x201.\x20Edit:\x20','Error:\x20','Profile\x20\x27',':\x20Invalid\x20JSON\x20syntax','6WATjFN','llm_project','object','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','Invalid\x20profile\x20name:\x20','1421088VZaFik','19409076AChyxX','\x20already\x20exists','\x22\x20\x22','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','string','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','profile','message','site','from','test','local','database','To\x20migrate:','rmSync','.env','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','keys','2067830bSlDum','toISOString','description','set','stringify','has'];a41_0x173a=function(){return _0x4aef72;};return a41_0x173a();}function getOldCredentialPath(_0x1061c9){const _0x28fa75=a41_0x32bf;return a41_0x5ea2ab[_0x28fa75(0x7a)](getProfilesDir(),_0x1061c9,_0x28fa75(0xb3));}function a41_0x32bf(_0x3633cc,_0x51167e){const _0x173a96=a41_0x173a();return a41_0x32bf=function(_0x32bf96,_0x462796){_0x32bf96=_0x32bf96-0x72;let _0x470931=_0x173a96[_0x32bf96];return _0x470931;},a41_0x32bf(_0x3633cc,_0x51167e);}function loadProfilesFromTdxJsonFiles(){const _0x19f83b=a41_0x32bf,_0x249c1b=[],_0x3b6a2e=findProjectConfigPath();_0x3b6a2e&&_0x249c1b['push'](...loadProfilesFromTdxJson(_0x3b6a2e,_0x19f83b(0xaf)));const _0x783506=a41_0x5ea2ab[_0x19f83b(0x7a)](getConfigDir(),_0x19f83b(0x77));return _0x249c1b['push'](...loadProfilesFromTdxJson(_0x783506,'user')),_0x249c1b;}function loadProfilesFromDirectories(){const _0x3809c4=a41_0x32bf,_0x4d6ad8=getProfilesDir();if(!a41_0x40d147[_0x3809c4(0x93)](_0x4d6ad8))return[];try{return a41_0x40d147[_0x3809c4(0x7f)](_0x4d6ad8,{'withFileTypes':!![]})['filter'](_0x3b7b6d=>_0x3b7b6d[_0x3809c4(0x94)]())[_0x3809c4(0x85)](_0x2b5d01=>_0x2b5d01[_0x3809c4(0x87)])['filter'](_0x2bf571=>{const _0x434695=_0x3809c4,_0x52af12=getProfileConfigPath(_0x2bf571),_0x37af0c=getProfileEnvPath(_0x2bf571);return a41_0x40d147[_0x434695(0x93)](_0x52af12)||a41_0x40d147[_0x434695(0x93)](_0x37af0c);})['map'](_0xb8eaf2=>{const _0x1401f9=_0x3809c4,_0x3e9ee6=loadProfileFromDirectory(_0xb8eaf2);if(_0x3e9ee6)return{..._0x3e9ee6,'scope':_0x1401f9(0x80)};return null;})['filter'](_0x4079f9=>_0x4079f9!==null);}catch{return[];}}function loadProfileFromDirectory(_0x2ab8b4){const _0x2aa8e3=a41_0x32bf,_0x32cdf3=getProfileConfigPath(_0x2ab8b4),_0x721a4d=getOldCredentialPath(_0x2ab8b4);if(!a41_0x40d147[_0x2aa8e3(0x93)](_0x32cdf3)&&!a41_0x40d147[_0x2aa8e3(0x93)](_0x721a4d))return null;let _0xfb6438={},_0x30aa37={'name':_0x2ab8b4,'createdAt':new Date()['toISOString']()};if(a41_0x40d147['existsSync'](_0x32cdf3))try{const _0x23a0c7=a41_0x40d147['readFileSync'](_0x32cdf3,'utf-8'),_0x30789b=JSON[_0x2aa8e3(0x91)](_0x23a0c7),{metadata:_0x17701b,..._0x30274d}=_0x30789b;_0xfb6438=_0x30274d,_0x17701b&&(_0x30aa37=_0x17701b);}catch{}return{'name':_0x2ab8b4,'config':_0xfb6438,'metadata':_0x30aa37,'hasCredentials':a41_0x40d147[_0x2aa8e3(0x93)](_0x721a4d),'scope':'directory'};}export function listProfiles(){const _0x67f40b=a41_0x32bf,_0x8db290=loadProfilesFromTdxJsonFiles(),_0x1fbdae=loadProfilesFromDirectories();if(_0x1fbdae[_0x67f40b(0x78)]>0x0){const _0x4d981b=_0x1fbdae['map'](_0x86a1b0=>_0x86a1b0[_0x67f40b(0x87)])[_0x67f40b(0x7a)](',\x20'),_0x525f8c=getConfigDir();console[_0x67f40b(0x79)](_0x67f40b(0x83)+_0x4d981b),console[_0x67f40b(0x79)]('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x67f40b(0x79)](_0x67f40b(0x99)+a41_0x5ea2ab['join'](_0x525f8c,_0x67f40b(0x77))),console[_0x67f40b(0x79)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console['warn'](_0x67f40b(0xa6));}const _0x48bc60=[..._0x8db290,..._0x1fbdae],_0x914d4a=new Map();for(const _0x1bbcf4 of _0x48bc60){!_0x914d4a[_0x67f40b(0x72)](_0x1bbcf4[_0x67f40b(0x87)])&&_0x914d4a[_0x67f40b(0xb9)](_0x1bbcf4['name'],_0x1bbcf4);}return Array[_0x67f40b(0xad)](_0x914d4a[_0x67f40b(0x96)]())['sort']((_0x2336ec,_0x48328f)=>_0x2336ec[_0x67f40b(0x87)][_0x67f40b(0x8c)](_0x48328f[_0x67f40b(0x87)]));}export function profileExists(_0x35019c){const _0x5cf422=a41_0x32bf,_0x1d8ea1=listProfiles();return _0x1d8ea1[_0x5cf422(0x86)](_0x5a9ec3=>_0x5a9ec3['name']===_0x35019c);}export function loadProfile(_0xdf01fc){const _0x3fb54f=a41_0x32bf;validateProfileName(_0xdf01fc);const _0xc30724=listProfiles(),_0x5cb3b7=_0xc30724[_0x3fb54f(0x98)](_0x3fddcd=>_0x3fddcd[_0x3fb54f(0x87)]===_0xdf01fc);return _0x5cb3b7||null;}export function saveProfile(_0x2c9fb3,_0x502b43,_0x1cbd1c=![]){saveProfileToUserConfig(_0x2c9fb3,_0x502b43);}export function deleteProfile(_0x3c219a){const _0x4f852a=a41_0x32bf;validateProfileName(_0x3c219a);const _0x3b6e3d=getProfileDir(_0x3c219a);if(!a41_0x40d147[_0x4f852a(0x93)](_0x3b6e3d))throw new Error(_0x4f852a(0x84)+_0x3c219a+'\x20does\x20not\x20exist');a41_0x40d147[_0x4f852a(0xb2)](_0x3b6e3d,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x190228,_0x260aad){const _0x5ee411=a41_0x32bf;validateProfileName(_0x190228);const _0x13b472=getGlobalConfigPath(),_0x4a9f79=getConfigDir();!a41_0x40d147[_0x5ee411(0x93)](_0x4a9f79)&&createSecureDirectory(_0x4a9f79);let _0x54df4d={};if(a41_0x40d147[_0x5ee411(0x93)](_0x13b472))try{const _0x2b67e7=a41_0x40d147[_0x5ee411(0x73)](_0x13b472,'utf-8');_0x54df4d=JSON['parse'](_0x2b67e7);}catch{console[_0x5ee411(0x79)](_0x5ee411(0x7b)+_0x13b472+_0x5ee411(0x97));}!_0x54df4d[_0x5ee411(0x7c)]&&(_0x54df4d[_0x5ee411(0x7c)]={}),_0x54df4d['profiles'][_0x190228]=_0x260aad,writeSecureFile(_0x13b472,JSON[_0x5ee411(0xba)](_0x54df4d,null,0x2));}export function getActiveProfile(){const _0x55105b=a41_0x32bf,_0x5d248a=getGlobalConfigPath();if(!a41_0x40d147[_0x55105b(0x93)](_0x5d248a))return null;try{const _0x396eaf=a41_0x40d147[_0x55105b(0x73)](_0x5d248a,'utf-8'),_0x372249=JSON[_0x55105b(0x91)](_0x396eaf);return _0x372249[_0x55105b(0xaa)]||null;}catch{return null;}}export function createProfile(_0xd503dd,_0x41bba9){const _0x12fd17=a41_0x32bf;validateProfileName(_0xd503dd);if(profileExists(_0xd503dd))throw new Error('Profile\x20'+_0xd503dd+_0x12fd17(0xa4));saveProfile(_0xd503dd,_0x41bba9);}export function saveProfileCredentials(_0x32cb94,_0x341bd7){const _0x341f62=a41_0x32bf;validateProfileName(_0x32cb94);if(!profileExists(_0x32cb94))throw new Error(_0x341f62(0x84)+_0x32cb94+'\x20does\x20not\x20exist');const _0x5d70dd=getNewCredentialPath(_0x32cb94);writeSecureFile(_0x5d70dd,_0x341bd7);}export function loadProfileCredentials(_0xb7c847){const _0x5f4c63=a41_0x32bf;validateProfileName(_0xb7c847);const _0x308c09=getNewCredentialPath(_0xb7c847);if(a41_0x40d147[_0x5f4c63(0x93)](_0x308c09))try{return a41_0x40d147[_0x5f4c63(0x73)](_0x308c09,_0x5f4c63(0x8d));}catch{}const _0x4ed01c=getOldCredentialPath(_0xb7c847);if(a41_0x40d147[_0x5f4c63(0x93)](_0x4ed01c)){console[_0x5f4c63(0x79)](_0x5f4c63(0xa8)+_0xb7c847+'\x27'),console[_0x5f4c63(0x79)](_0x5f4c63(0xb1)),console[_0x5f4c63(0x79)](_0x5f4c63(0x81)+_0x4ed01c+_0x5f4c63(0xa5)+_0x308c09+'\x22'),console[_0x5f4c63(0x79)](_0x5f4c63(0x8e));try{return a41_0x40d147[_0x5f4c63(0x73)](_0x4ed01c,_0x5f4c63(0x8d));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a42_0x5e03d7=a42_0x464d;(function(_0x326ab4,_0x203a17){const _0x2acc2d=a42_0x464d,_0x39059c=_0x326ab4();while(!![]){try{const _0x5f3809=parseInt(_0x2acc2d(0xc3))/0x1+parseInt(_0x2acc2d(0xce))/0x2*(parseInt(_0x2acc2d(0xb8))/0x3)+parseInt(_0x2acc2d(0xc2))/0x4*(-parseInt(_0x2acc2d(0xc1))/0x5)+-parseInt(_0x2acc2d(0xb3))/0x6+-parseInt(_0x2acc2d(0xc9))/0x7+-parseInt(_0x2acc2d(0xc0))/0x8+parseInt(_0x2acc2d(0xbe))/0x9;if(_0x5f3809===_0x203a17)break;else _0x39059c['push'](_0x39059c['shift']());}catch(_0x44ace5){_0x39059c['push'](_0x39059c['shift']());}}}(a42_0x299a,0xbf75a));import*as a42_0x207c0a from'node:fs';function a42_0x299a(){const _0x10b883=['10hpqfAn','apiKey','parse','dirname','tdx.json','readFileSync','7440402CimhpU','code','warn','TD_API_KEY','includes','355587aZYFHw','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','ENOENT','existsSync','join','Failed\x20to\x20load\x20project\x20config\x20from\x20','34245900lqRVNH','cwd','831680hbCoVJ','50juVGPI','559484ogdTtC','268897rivmnn','profile','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','utf-8','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','7977809OrwrAf','Warning:\x20\x27profile\x27\x20field\x20in\x20',').\x20','api_key','stringify'];a42_0x299a=function(){return _0x10b883;};return a42_0x299a();}import*as a42_0xf14b8a from'node:path';const PROJECT_CONFIG_FILENAME=a42_0x5e03d7(0xd2);export function findProjectConfigPath(_0x57586e){const _0x514292=a42_0x5e03d7;let _0x4dac74=_0x57586e||process[_0x514292(0xbf)]();while(!![]){const _0x3dde83=a42_0xf14b8a['join'](_0x4dac74,PROJECT_CONFIG_FILENAME);if(a42_0x207c0a[_0x514292(0xbb)](_0x3dde83))return _0x3dde83;const _0x2a167a=a42_0xf14b8a[_0x514292(0xd1)](_0x4dac74);if(_0x2a167a===_0x4dac74)return null;_0x4dac74=_0x2a167a;}}export function loadProjectConfig(_0x4d8dac){const _0x57945b=a42_0x5e03d7,_0xc072ea=findProjectConfigPath(_0x4d8dac);if(!_0xc072ea)return null;try{const _0x2e4c85=a42_0x207c0a[_0x57945b(0xd3)](_0xc072ea,_0x57945b(0xc7)),_0x3d2c6a=JSON[_0x57945b(0xd0)](_0x2e4c85),_0x2b7a0b=JSON['stringify'](_0x3d2c6a);if(_0x2b7a0b[_0x57945b(0xb7)](_0x57945b(0xb6))||_0x2b7a0b['includes'](_0x57945b(0xcf))||_0x2b7a0b['includes'](_0x57945b(0xcc)))throw new Error(_0x57945b(0xc8)+_0xc072ea+_0x57945b(0xcb)+_0x57945b(0xc5));const {metadata:_0x55294a,profile:_0x6dfc7,..._0x41612a}=_0x3d2c6a;return _0x6dfc7&&console[_0x57945b(0xb5)](_0x57945b(0xca)+_0xc072ea+'\x20is\x20ignored.\x20'+_0x57945b(0xb9)),_0x41612a;}catch(_0x42e925){if(_0x42e925 instanceof Error&&_0x57945b(0xb4)in _0x42e925&&_0x42e925[_0x57945b(0xb4)]===_0x57945b(0xba))return null;throw new Error(_0x57945b(0xbd)+_0xc072ea+':\x20'+_0x42e925);}}export function saveProjectConfig(_0x1aacb2,_0x435abc){const _0x4d892f=a42_0x5e03d7,_0x352f27=_0x435abc||process[_0x4d892f(0xbf)](),_0x58ea3e=a42_0xf14b8a[_0x4d892f(0xbc)](_0x352f27,PROJECT_CONFIG_FILENAME),_0x3d3976=JSON['stringify'](_0x1aacb2);if(_0x3d3976[_0x4d892f(0xb7)](_0x4d892f(0xb6))||_0x3d3976[_0x4d892f(0xb7)](_0x4d892f(0xcf))||_0x3d3976[_0x4d892f(0xb7)](_0x4d892f(0xcc)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x4d892f(0xc4)in _0x1aacb2)throw new Error(_0x4d892f(0xc6));a42_0x207c0a['writeFileSync'](_0x58ea3e,JSON[_0x4d892f(0xcd)](_0x1aacb2,null,0x2));}function a42_0x464d(_0x2d76b4,_0x52cfff){const _0x299a43=a42_0x299a();return a42_0x464d=function(_0x464d58,_0x58d83c){_0x464d58=_0x464d58-0xb3;let _0x29cbf2=_0x299a43[_0x464d58];return _0x29cbf2;},a42_0x464d(_0x2d76b4,_0x52cfff);}export function hasProjectConfig(_0x477ce6){return findProjectConfigPath(_0x477ce6)!==null;}export function getProjectRoot(_0x51e1de){const _0x548bfa=findProjectConfigPath(_0x51e1de);return _0x548bfa?a42_0xf14b8a['dirname'](_0x548bfa):null;}
1
+ const a42_0x40303b=a42_0x2e77;(function(_0x465ad9,_0x249e0d){const _0x467306=a42_0x2e77,_0x5e5124=_0x465ad9();while(!![]){try{const _0x311815=parseInt(_0x467306(0x1d1))/0x1+-parseInt(_0x467306(0x1c8))/0x2+-parseInt(_0x467306(0x1d4))/0x3*(parseInt(_0x467306(0x1e2))/0x4)+parseInt(_0x467306(0x1e0))/0x5+-parseInt(_0x467306(0x1df))/0x6*(-parseInt(_0x467306(0x1cb))/0x7)+parseInt(_0x467306(0x1c9))/0x8+-parseInt(_0x467306(0x1ce))/0x9*(-parseInt(_0x467306(0x1c7))/0xa);if(_0x311815===_0x249e0d)break;else _0x5e5124['push'](_0x5e5124['shift']());}catch(_0x47a00f){_0x5e5124['push'](_0x5e5124['shift']());}}}(a42_0x4195,0x45ae4));import*as a42_0x3baa35 from'node:fs';import*as a42_0x36d015 from'node:path';const PROJECT_CONFIG_FILENAME=a42_0x40303b(0x1e1);function a42_0x2e77(_0x350dad,_0x189c47){const _0x4195e5=a42_0x4195();return a42_0x2e77=function(_0x2e77ca,_0x56bfd9){_0x2e77ca=_0x2e77ca-0x1c6;let _0x5e051a=_0x4195e5[_0x2e77ca];return _0x5e051a;},a42_0x2e77(_0x350dad,_0x189c47);}export function findProjectConfigPath(_0x272cdb){const _0x344c62=a42_0x40303b;let _0x1630e3=_0x272cdb||process[_0x344c62(0x1de)]();while(!![]){const _0xa6931b=a42_0x36d015[_0x344c62(0x1cf)](_0x1630e3,PROJECT_CONFIG_FILENAME);if(a42_0x3baa35[_0x344c62(0x1db)](_0xa6931b))return _0xa6931b;const _0x49ea5a=a42_0x36d015[_0x344c62(0x1d7)](_0x1630e3);if(_0x49ea5a===_0x1630e3)return null;_0x1630e3=_0x49ea5a;}}export function loadProjectConfig(_0x62add){const _0x44da47=a42_0x40303b,_0x2af897=findProjectConfigPath(_0x62add);if(!_0x2af897)return null;try{const _0x4228de=a42_0x3baa35[_0x44da47(0x1da)](_0x2af897,_0x44da47(0x1cd)),_0x2a46d0=JSON['parse'](_0x4228de),_0x4b1377=JSON[_0x44da47(0x1d6)](_0x2a46d0);if(_0x4b1377[_0x44da47(0x1dc)]('TD_API_KEY')||_0x4b1377['includes']('apiKey')||_0x4b1377[_0x44da47(0x1dc)](_0x44da47(0x1d2)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x2af897+_0x44da47(0x1d9)+_0x44da47(0x1d3));const {metadata:_0x10652f,profile:_0x48c442,..._0xa9a36}=_0x2a46d0;return _0x48c442&&console[_0x44da47(0x1d8)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x2af897+'\x20is\x20ignored.\x20'+_0x44da47(0x1c6)),_0xa9a36;}catch(_0x4cc757){if(_0x4cc757 instanceof Error&&_0x44da47(0x1cc)in _0x4cc757&&_0x4cc757[_0x44da47(0x1cc)]===_0x44da47(0x1dd))return null;throw new Error(_0x44da47(0x1ca)+_0x2af897+':\x20'+_0x4cc757);}}export function saveProjectConfig(_0x42a081,_0x1dfbad){const _0x4a557a=a42_0x40303b,_0x33cb72=_0x1dfbad||process['cwd'](),_0x54374f=a42_0x36d015[_0x4a557a(0x1cf)](_0x33cb72,PROJECT_CONFIG_FILENAME),_0x3d35ac=JSON[_0x4a557a(0x1d6)](_0x42a081);if(_0x3d35ac['includes']('TD_API_KEY')||_0x3d35ac[_0x4a557a(0x1dc)]('apiKey')||_0x3d35ac[_0x4a557a(0x1dc)](_0x4a557a(0x1d2)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x4a557a(0x1d5)in _0x42a081)throw new Error(_0x4a557a(0x1d0));a42_0x3baa35['writeFileSync'](_0x54374f,JSON['stringify'](_0x42a081,null,0x2));}export function hasProjectConfig(_0x23f6e8){return findProjectConfigPath(_0x23f6e8)!==null;}export function getProjectRoot(_0xc9e53b){const _0x5d0e69=findProjectConfigPath(_0xc9e53b);return _0x5d0e69?a42_0x36d015['dirname'](_0x5d0e69):null;}function a42_0x4195(){const _0x5aea1a=['includes','ENOENT','cwd','102AcUaWZ','1397895uozHWb','tdx.json','1727756dEngpb','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','10bUiFfc','1126794xeAfXi','897136dONWlA','Failed\x20to\x20load\x20project\x20config\x20from\x20','181027XmfIXZ','code','utf-8','267336JsCDOE','join','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','419686rBpmpQ','api_key','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','3Yhiwyp','profile','stringify','dirname','warn',').\x20','readFileSync','existsSync'];a42_0x4195=function(){return _0x5aea1a;};return a42_0x4195();}