@treasuredata/tdx 0.1.18 → 0.1.19

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 (111) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.js +1 -1
  5. package/dist/client/llm-client.d.ts +2 -2
  6. package/dist/client/llm-client.d.ts.map +1 -1
  7. package/dist/client/llm-client.js +1 -1
  8. package/dist/client/rate-limiter.js +1 -1
  9. package/dist/client/td-client.js +1 -1
  10. package/dist/client/trino-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/chat-command.js +1 -1
  15. package/dist/commands/chat-command.js.map +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/job-command.js +1 -1
  24. package/dist/commands/llm-command.d.ts.map +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-command.js.map +1 -1
  27. package/dist/commands/llm-proxy.d.ts.map +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/llm-proxy.js.map +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pwd-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/global-context.js +1 -1
  47. package/dist/core/profile.js +1 -1
  48. package/dist/core/project-config.js +1 -1
  49. package/dist/core/session.js +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/proxy/anthropic-adapter.d.ts +3 -3
  52. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  53. package/dist/proxy/anthropic-adapter.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js.map +1 -1
  55. package/dist/proxy/server.d.ts +5 -3
  56. package/dist/proxy/server.d.ts.map +1 -1
  57. package/dist/proxy/server.js +1 -1
  58. package/dist/proxy/server.js.map +1 -1
  59. package/dist/sdk/api.js +1 -1
  60. package/dist/sdk/database.js +1 -1
  61. package/dist/sdk/errors.js +1 -1
  62. package/dist/sdk/index.js +1 -1
  63. package/dist/sdk/job.js +1 -1
  64. package/dist/sdk/llm.d.ts +14 -0
  65. package/dist/sdk/llm.d.ts.map +1 -1
  66. package/dist/sdk/llm.js +1 -1
  67. package/dist/sdk/llm.js.map +1 -1
  68. package/dist/sdk/query.js +1 -1
  69. package/dist/sdk/segment.js +1 -1
  70. package/dist/sdk/table.js +1 -1
  71. package/dist/sdk/workflow.js +1 -1
  72. package/dist/types/endpoints.js +1 -1
  73. package/dist/types/index.d.ts +41 -21
  74. package/dist/types/index.d.ts.map +1 -1
  75. package/dist/types/index.js +1 -1
  76. package/dist/utils/agent-ref-parser.js +1 -1
  77. package/dist/utils/chat-cache.js +1 -1
  78. package/dist/utils/colors.d.ts +4 -0
  79. package/dist/utils/colors.d.ts.map +1 -1
  80. package/dist/utils/colors.js +1 -1
  81. package/dist/utils/colors.js.map +1 -1
  82. package/dist/utils/command-output.js +1 -1
  83. package/dist/utils/file-permissions.js +1 -1
  84. package/dist/utils/format-detector.js +1 -1
  85. package/dist/utils/formatters.js +1 -1
  86. package/dist/utils/json-loader.js +1 -1
  87. package/dist/utils/model-aliases.d.ts +15 -0
  88. package/dist/utils/model-aliases.d.ts.map +1 -1
  89. package/dist/utils/model-aliases.js +1 -1
  90. package/dist/utils/model-aliases.js.map +1 -1
  91. package/dist/utils/option-validation.js +1 -1
  92. package/dist/utils/port.js +1 -1
  93. package/dist/utils/process.js +1 -1
  94. package/dist/utils/prompt.js +1 -1
  95. package/dist/utils/segment-path-parser.js +1 -1
  96. package/dist/utils/segment-ref-parser.js +1 -1
  97. package/dist/utils/spinner.js +1 -1
  98. package/dist/utils/sql-parser.js +1 -1
  99. package/dist/utils/sse-parser.d.ts +2 -2
  100. package/dist/utils/sse-parser.d.ts.map +1 -1
  101. package/dist/utils/sse-parser.js +1 -1
  102. package/dist/utils/sse-parser.js.map +1 -1
  103. package/dist/utils/string-utils.js +1 -1
  104. package/dist/utils/table-ref-parser.js +1 -1
  105. package/dist/utils/tree-formatter.js +1 -1
  106. package/dist/utils/version-check.d.ts +28 -0
  107. package/dist/utils/version-check.d.ts.map +1 -0
  108. package/dist/utils/version-check.js +1 -0
  109. package/dist/utils/version-check.js.map +1 -0
  110. package/dist/utils/workflow-utils.js +1 -1
  111. package/package.json +3 -1
@@ -1 +1 @@
1
- const a30_0x28aa27=a30_0x37ab;(function(_0x177102,_0x8c15d1){const _0x239dbb=a30_0x37ab,_0x1da8e1=_0x177102();while(!![]){try{const _0x3ad1d1=-parseInt(_0x239dbb(0x165))/0x1+-parseInt(_0x239dbb(0x15d))/0x2*(-parseInt(_0x239dbb(0x16c))/0x3)+parseInt(_0x239dbb(0x173))/0x4*(parseInt(_0x239dbb(0x174))/0x5)+-parseInt(_0x239dbb(0x163))/0x6+parseInt(_0x239dbb(0x162))/0x7*(parseInt(_0x239dbb(0x161))/0x8)+-parseInt(_0x239dbb(0x169))/0x9+parseInt(_0x239dbb(0x166))/0xa;if(_0x3ad1d1===_0x8c15d1)break;else _0x1da8e1['push'](_0x1da8e1['shift']());}catch(_0x45227a){_0x1da8e1['push'](_0x1da8e1['shift']());}}}(a30_0x70c7,0xd07ec));function a30_0x37ab(_0x3eb59b,_0x168a96){const _0x70c72a=a30_0x70c7();return a30_0x37ab=function(_0x37abcf,_0x254e5e){_0x37abcf=_0x37abcf-0x15d;let _0x4d6b2a=_0x70c72a[_0x37abcf];return _0x4d6b2a;},a30_0x37ab(_0x3eb59b,_0x168a96);}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{withSpinner}from'../utils/spinner.js';function a30_0x70c7(){const _0x134223=['✖\x20No\x20tables\x20found','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✔\x20Found\x20','190XISpzi','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','tables','40QsHHEV','2180969GsXxwh','2043894wsXxfc','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','1386452xvsixQ','12053250TamZib','validate','\x20\x20Use:\x20tdx\x20tables\x20\x22','14261535tFfMeb','list','.*\x22','35835JWMSGp','\x27\x20across\x20all\x20databases.','table','\x20table','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20\x27','error','12RqYLOb','446295OmKslc','Database\x20pattern:\x20','Error:\x20','execute','message','database','length','site','Error:\x20Pattern\x20\x27','name','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Or\x20use\x20--in\x20flag:','verbose','includes','description','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'];a30_0x70c7=function(){return _0x134223;};return a30_0x70c7();}export class TablesCommand extends BaseCommand{[a30_0x28aa27(0x17d)]=a30_0x28aa27(0x160);[a30_0x28aa27(0x182)]='List\x20tables\x20in\x20a\x20database';async[a30_0x28aa27(0x177)](_0xdc8b09){const _0x1818d3=a30_0x28aa27,{options:_0x1f9fd3,args:_0x28c8c1,tdx:_0x29dca4}=_0xdc8b09;let _0x23bd49;if(_0x28c8c1[_0x1818d3(0x17a)]===0x0)_0x23bd49={'database':undefined,'table':undefined,'original':''};else{if(_0x28c8c1['length']===0x1)try{_0x23bd49=parseTableReference(_0x28c8c1[0x0]);if(_0x23bd49[_0x1818d3(0x16e)]&&!_0x23bd49['database']&&!_0x23bd49[_0x1818d3(0x16e)][_0x1818d3(0x181)]('*')&&!_0x23bd49[_0x1818d3(0x16e)][_0x1818d3(0x181)]('?'))return console[_0x1818d3(0x172)](_0x1818d3(0x17c)+_0x28c8c1[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x1818d3(0x172)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x23bd49['table']+'\x27?'),console['error'](_0x1818d3(0x168)+_0x23bd49[_0x1818d3(0x16e)]+_0x1818d3(0x16b)),console[_0x1818d3(0x172)](_0x1818d3(0x184)+_0x23bd49[_0x1818d3(0x16e)]),console[_0x1818d3(0x172)](_0x1818d3(0x17e)+_0x23bd49['table']),console[_0x1818d3(0x172)](''),console[_0x1818d3(0x172)]('Note:\x20\x27'+_0x28c8c1[0x0]+_0x1818d3(0x186)+_0x23bd49[_0x1818d3(0x16e)]+_0x1818d3(0x16d)),0x1;}catch(_0xbd64e3){return console[_0x1818d3(0x172)]('Error:\x20'+_0xbd64e3[_0x1818d3(0x178)]),0x1;}else return console[_0x1818d3(0x172)](_0x1818d3(0x164)),console[_0x1818d3(0x172)](_0x1818d3(0x183)),console[_0x1818d3(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x1818d3(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x1818d3(0x15f)),console['error'](_0x1818d3(0x17f)),console[_0x1818d3(0x172)](_0x1818d3(0x170)),0x1;}const _0x18793c=_0x1f9fd3[_0x1818d3(0x179)];!_0x23bd49[_0x1818d3(0x179)]&&_0x18793c&&(_0x23bd49[_0x1818d3(0x179)]=_0x18793c);try{const _0x51aaba=_0x11156e=>_0x11156e&&(_0x11156e['includes']('*')||_0x11156e[_0x1818d3(0x181)]('?')),_0x926b5a=_0x51aaba(_0x23bd49['database']);_0x1f9fd3[_0x1818d3(0x180)]&&(console[_0x1818d3(0x172)]('Site:\x20'+_0x1f9fd3[_0x1818d3(0x17b)]),_0x23bd49[_0x1818d3(0x179)]?_0x926b5a?console[_0x1818d3(0x172)](_0x1818d3(0x175)+_0x23bd49[_0x1818d3(0x179)]):console[_0x1818d3(0x172)]('Database:\x20'+_0x23bd49[_0x1818d3(0x179)]):console['error']('Database:\x20all'),_0x23bd49['table']&&console[_0x1818d3(0x172)]('Table\x20pattern:\x20'+_0x23bd49[_0x1818d3(0x16e)]));const _0x476521=_0x23bd49[_0x1818d3(0x179)]&&!_0x926b5a?_0x23bd49[_0x1818d3(0x179)]:undefined,_0x482a09=_0x926b5a?_0x23bd49[_0x1818d3(0x179)]:undefined,_0x3e53eb=_0x23bd49[_0x1818d3(0x16e)],_0x175e1e=await withSpinner('Listing\x20tables...',()=>_0x29dca4['table'][_0x1818d3(0x16a)](_0x476521,_0x3e53eb,_0x482a09),{'verbose':_0x1f9fd3[_0x1818d3(0x180)]}),_0x4de6ab=_0x175e1e['data'];if(_0x4de6ab[_0x1818d3(0x17a)]===0x0&&_0x23bd49[_0x1818d3(0x179)]&&!_0x926b5a)return console[_0x1818d3(0x172)](_0x1818d3(0x185)),console[_0x1818d3(0x172)](_0x1818d3(0x171)+_0x23bd49[_0x1818d3(0x179)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x1818d3(0x172)](_0x1818d3(0x187)+_0x4de6ab[_0x1818d3(0x17a)]+_0x1818d3(0x16f)+(_0x4de6ab[_0x1818d3(0x17a)]!==0x1?'s':'')),await handleSDKOutput(_0x4de6ab,_0x1f9fd3),0x0;}catch(_0x3d85db){if(_0x3d85db instanceof SDKError)return console[_0x1818d3(0x172)](_0x1818d3(0x176)+_0x3d85db[_0x1818d3(0x178)]),_0x3d85db['cause']&&console['error'](_0x1818d3(0x15e)+_0x3d85db['cause']),0x1;throw _0x3d85db;}}[a30_0x28aa27(0x167)](_0x227976){return undefined;}}
1
+ const a30_0x4dc40f=a30_0x4bd0;(function(_0x4c78c6,_0x1b6fdd){const _0xc9c537=a30_0x4bd0,_0x3c26e6=_0x4c78c6();while(!![]){try{const _0x1b4d84=parseInt(_0xc9c537(0xd0))/0x1+-parseInt(_0xc9c537(0xf8))/0x2+parseInt(_0xc9c537(0xe8))/0x3+parseInt(_0xc9c537(0xd5))/0x4+-parseInt(_0xc9c537(0xf3))/0x5*(parseInt(_0xc9c537(0xd4))/0x6)+parseInt(_0xc9c537(0xde))/0x7*(-parseInt(_0xc9c537(0xe1))/0x8)+-parseInt(_0xc9c537(0xeb))/0x9*(-parseInt(_0xc9c537(0xdb))/0xa);if(_0x1b4d84===_0x1b6fdd)break;else _0x3c26e6['push'](_0x3c26e6['shift']());}catch(_0x2591ab){_0x3c26e6['push'](_0x3c26e6['shift']());}}}(a30_0x1a19,0x18c3f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x4bd0(_0x26d03c,_0x326752){const _0x1a1906=a30_0x1a19();return a30_0x4bd0=function(_0x4bd08c,_0x14f2dc){_0x4bd08c=_0x4bd08c-0xd0;let _0x40b0e0=_0x1a1906[_0x4bd08c];return _0x40b0e0;},a30_0x4bd0(_0x26d03c,_0x326752);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a30_0x1a19(){const _0x5a6954=['.*\x22','description','data','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database\x20\x27','406615NMIUMK','length','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','✔\x20Found\x20','table','43304jYoJCw','Site:\x20','Note:\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Error:\x20Pattern\x20\x27','verbose','execute','107822jXpUFu','validate','✖\x20No\x20tables\x20found','cause','12qvhZZf','435792xDiKjP','message','includes','error','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','30lSAGGM','list','Error:\x20','70QwVWZG','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','33656wkWPSy','database','Table\x20pattern:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','List\x20tables\x20in\x20a\x20database','Or\x20use\x20--in\x20flag:','Listing\x20tables...','46164EsMVJj','tables','\x20\x20Cause:\x20','286947NOwInO','site','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a30_0x1a19=function(){return _0x5a6954;};return a30_0x1a19();}export class TablesCommand extends BaseCommand{['name']=a30_0x4dc40f(0xe9);[a30_0x4dc40f(0xef)]=a30_0x4dc40f(0xe5);async[a30_0x4dc40f(0xfe)](_0x16f2dd){const _0x1c4781=a30_0x4dc40f,{options:_0x3ab05a,args:_0x49e677,tdx:_0x3b496d}=_0x16f2dd;let _0x56ab4b;if(_0x49e677[_0x1c4781(0xf4)]===0x0)_0x56ab4b={'database':undefined,'table':undefined,'original':''};else{if(_0x49e677[_0x1c4781(0xf4)]===0x1)try{_0x56ab4b=parseTableReference(_0x49e677[0x0]);if(_0x56ab4b[_0x1c4781(0xf7)]&&!_0x56ab4b[_0x1c4781(0xe2)]&&!_0x56ab4b[_0x1c4781(0xf7)][_0x1c4781(0xd7)]('*')&&!_0x56ab4b[_0x1c4781(0xf7)][_0x1c4781(0xd7)]('?'))return console['error'](_0x1c4781(0xfc)+_0x49e677[0x0]+'\x27\x20is\x20ambiguous.'),console['error']('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x56ab4b[_0x1c4781(0xf7)]+'\x27?'),console['error']('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x56ab4b[_0x1c4781(0xf7)]+_0x1c4781(0xee)),console[_0x1c4781(0xd8)](_0x1c4781(0xfb)+_0x56ab4b[_0x1c4781(0xf7)]),console['error'](_0x1c4781(0xe0)+_0x56ab4b[_0x1c4781(0xf7)]),console[_0x1c4781(0xd8)](''),console[_0x1c4781(0xd8)](_0x1c4781(0xfa)+_0x49e677[0x0]+_0x1c4781(0xe4)+_0x56ab4b[_0x1c4781(0xf7)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x52226f){return console[_0x1c4781(0xd8)](_0x1c4781(0xdd)+_0x52226f[_0x1c4781(0xd6)]),0x1;}else return console[_0x1c4781(0xd8)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x1c4781(0xd8)](_0x1c4781(0xf5)),console[_0x1c4781(0xd8)](_0x1c4781(0xdf)),console[_0x1c4781(0xd8)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x1c4781(0xda)),console[_0x1c4781(0xd8)](_0x1c4781(0xe6)),console[_0x1c4781(0xd8)](_0x1c4781(0xed)),0x1;}const _0x124d83=_0x3ab05a[_0x1c4781(0xe2)];!_0x56ab4b[_0x1c4781(0xe2)]&&_0x124d83&&(_0x56ab4b[_0x1c4781(0xe2)]=_0x124d83);try{const _0xf64a06=_0x1e396c=>_0x1e396c&&(_0x1e396c[_0x1c4781(0xd7)]('*')||_0x1e396c[_0x1c4781(0xd7)]('?')),_0x346813=_0xf64a06(_0x56ab4b[_0x1c4781(0xe2)]);_0x3ab05a[_0x1c4781(0xfd)]&&(console[_0x1c4781(0xd8)](_0x1c4781(0xf9)+_0x3ab05a[_0x1c4781(0xec)]),_0x56ab4b[_0x1c4781(0xe2)]?_0x346813?console[_0x1c4781(0xd8)](_0x1c4781(0xd9)+_0x56ab4b['database']):console[_0x1c4781(0xd8)]('Database:\x20'+_0x56ab4b['database']):console[_0x1c4781(0xd8)]('Database:\x20all'),_0x56ab4b[_0x1c4781(0xf7)]&&console['error'](_0x1c4781(0xe3)+_0x56ab4b['table']));const _0x433f45=_0x56ab4b[_0x1c4781(0xe2)]&&!_0x346813?_0x56ab4b[_0x1c4781(0xe2)]:undefined,_0x400562=_0x346813?_0x56ab4b['database']:undefined,_0x1241c5=_0x56ab4b['table'],_0x59005b=await withSpinner(_0x1c4781(0xe7),()=>_0x3b496d[_0x1c4781(0xf7)][_0x1c4781(0xdc)](_0x433f45,_0x1241c5,_0x400562),{'verbose':_0x3ab05a[_0x1c4781(0xfd)]}),_0x287dce=_0x59005b[_0x1c4781(0xf0)];if(_0x287dce['length']===0x0&&_0x56ab4b[_0x1c4781(0xe2)]&&!_0x346813)return console['error'](_0x1c4781(0xd2)),console['error'](_0x1c4781(0xf2)+_0x56ab4b[_0x1c4781(0xe2)]+_0x1c4781(0xf1)),0x1;return console[_0x1c4781(0xd8)](_0x1c4781(0xf6)+_0x287dce[_0x1c4781(0xf4)]+'\x20table'+(_0x287dce['length']!==0x1?'s':'')),await handleSDKOutput(_0x287dce,_0x3ab05a),0x0;}catch(_0x52e4b7){if(_0x52e4b7 instanceof SDKError)return console[_0x1c4781(0xd8)](_0x1c4781(0xdd)+_0x52e4b7[_0x1c4781(0xd6)]),_0x52e4b7[_0x1c4781(0xd3)]&&console[_0x1c4781(0xd8)](_0x1c4781(0xea)+_0x52e4b7['cause']),0x1;throw _0x52e4b7;}}[a30_0x4dc40f(0xd1)](_0x1b96de){return undefined;}}
@@ -1 +1 @@
1
- function a31_0x583f(_0x331f96,_0x8cf5e){const _0x7b06f2=a31_0x7b06();return a31_0x583f=function(_0x583f5e,_0x498591){_0x583f5e=_0x583f5e-0x1a9;let _0x4c9617=_0x7b06f2[_0x583f5e];return _0x4c9617;},a31_0x583f(_0x331f96,_0x8cf5e);}const a31_0x1c82eb=a31_0x583f;(function(_0x25de69,_0x348e37){const _0x5aa95f=a31_0x583f,_0x590f31=_0x25de69();while(!![]){try{const _0x33f473=parseInt(_0x5aa95f(0x1c3))/0x1+-parseInt(_0x5aa95f(0x1c8))/0x2+parseInt(_0x5aa95f(0x1af))/0x3*(parseInt(_0x5aa95f(0x1c5))/0x4)+parseInt(_0x5aa95f(0x1ab))/0x5*(parseInt(_0x5aa95f(0x1a9))/0x6)+-parseInt(_0x5aa95f(0x1b1))/0x7+-parseInt(_0x5aa95f(0x1be))/0x8+parseInt(_0x5aa95f(0x1b2))/0x9;if(_0x33f473===_0x348e37)break;else _0x590f31['push'](_0x590f31['shift']());}catch(_0x2df7da){_0x590f31['push'](_0x590f31['shift']());}}}(a31_0x7b06,0xa79fd));import{BaseCommand}from'./command.js';function a31_0x7b06(){const _0x70414f=['description','profile','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','.\x20Must\x20be\x20one\x20of:\x20','llm_project','session','\x20(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x27\x20does\x20not\x20exist','join','log','4266608sFNRCp','Session\x20llm_project\x20set\x20to:\x20','toString','Session\x20profile\x20set\x20to:\x20','name','713426hzMUAL','parent_segment','1583480IzCixv','Set\x20session-level\x20context','Session\x20database\x20set\x20to:\x20','1072792XNwJwW','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','validate','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Invalid\x20resource:\x20','3318744JIAZnW','Session\x20parent_segment\x20set\x20to:\x20','10OLroHB','use','database','error','3uFQijP','execute','7180446QBTKSW','5098905gDmjHy'];a31_0x7b06=function(){return _0x70414f;};return a31_0x7b06();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x1c82eb(0x1c2)]=a31_0x1c82eb(0x1ac);[a31_0x1c82eb(0x1b3)]=a31_0x1c82eb(0x1c6);[a31_0x1c82eb(0x1ca)](_0x5a50e0){const _0x1d5406=a31_0x1c82eb,{args:_0x30428e}=_0x5a50e0;if(_0x30428e['length']<0x2)return _0x1d5406(0x1b5)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x1d5406(0x1cb)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x388efb=_0x30428e[0x0],_0x1bf524=[_0x1d5406(0x1ad),_0x1d5406(0x1c4),_0x1d5406(0x1b7),_0x1d5406(0x1b4)];if(!_0x1bf524['includes'](_0x388efb))return _0x1d5406(0x1cc)+_0x388efb+_0x1d5406(0x1b6)+_0x1bf524[_0x1d5406(0x1bc)](',\x20');return undefined;}async[a31_0x1c82eb(0x1b0)](_0x3ae843){const _0x5d0320=a31_0x1c82eb,{args:_0x6f7bd5,options:_0x140e90}=_0x3ae843;try{const _0x4439e8=_0x6f7bd5[0x0],_0x1e0aa4=_0x6f7bd5[0x1];if(_0x4439e8===_0x5d0320(0x1b4)){if(!profileExists(_0x1e0aa4))return console[_0x5d0320(0x1ae)]('Error:\x20Profile\x20\x27'+_0x1e0aa4+_0x5d0320(0x1bb)),console['error'](_0x5d0320(0x1c9)),0x1;const _0x549967=_0x140e90[_0x5d0320(0x1b8)]||getCurrentSessionPID()[_0x5d0320(0x1c0)]();return saveSessionContext({'profile':_0x1e0aa4},_0x140e90['session']),console[_0x5d0320(0x1bd)](_0x5d0320(0x1c1)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x549967+')'),console['log'](_0x5d0320(0x1ba)),0x0;}const _0x409b07={},_0x5d16ec=_0x140e90[_0x5d0320(0x1b8)]||getCurrentSessionPID()['toString']();switch(_0x4439e8){case _0x5d0320(0x1ad):_0x409b07[_0x5d0320(0x1ad)]=_0x1e0aa4,console['log'](_0x5d0320(0x1c7)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;case _0x5d0320(0x1c4):_0x409b07['parent_segment']=_0x1e0aa4,console[_0x5d0320(0x1bd)](_0x5d0320(0x1aa)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;case _0x5d0320(0x1b7):_0x409b07[_0x5d0320(0x1b7)]=_0x1e0aa4,console[_0x5d0320(0x1bd)](_0x5d0320(0x1bf)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;}return saveSessionContext(_0x409b07,_0x140e90['session']),console['log'](_0x5d0320(0x1ba)),0x0;}catch(_0x34d10f){return _0x34d10f instanceof Error&&console[_0x5d0320(0x1ae)]('Error:\x20'+_0x34d10f['message']),0x1;}}}
1
+ const a31_0x586624=a31_0x3239;(function(_0x3d7d4c,_0x2dc0af){const _0x51a0a8=a31_0x3239,_0x316559=_0x3d7d4c();while(!![]){try{const _0x49bdfa=parseInt(_0x51a0a8(0x17e))/0x1*(-parseInt(_0x51a0a8(0x16e))/0x2)+parseInt(_0x51a0a8(0x171))/0x3*(-parseInt(_0x51a0a8(0x17f))/0x4)+-parseInt(_0x51a0a8(0x184))/0x5*(parseInt(_0x51a0a8(0x186))/0x6)+parseInt(_0x51a0a8(0x192))/0x7*(-parseInt(_0x51a0a8(0x18f))/0x8)+-parseInt(_0x51a0a8(0x18b))/0x9+-parseInt(_0x51a0a8(0x16c))/0xa+-parseInt(_0x51a0a8(0x16d))/0xb*(-parseInt(_0x51a0a8(0x172))/0xc);if(_0x49bdfa===_0x2dc0af)break;else _0x316559['push'](_0x316559['shift']());}catch(_0x96ffbc){_0x316559['push'](_0x316559['shift']());}}}(a31_0x2123,0xf1d8f));function a31_0x3239(_0x2e802f,_0x1c124b){const _0x2123a8=a31_0x2123();return a31_0x3239=function(_0x323953,_0x205988){_0x323953=_0x323953-0x16b;let _0x4fd856=_0x2123a8[_0x323953];return _0x4fd856;},a31_0x3239(_0x2e802f,_0x1c124b);}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a31_0x2123(){const _0x10e509=['description','name','Session\x20parent_segment\x20set\x20to:\x20','Set\x20session-level\x20context','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','1RfkGZo','16kGYPoE','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','log','\x20(session:\x20','toString','5kcOBTa','validate','9962898XZPEtf','error','Error:\x20','execute','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','15939891jbndKl','llm_project','database','parent_segment','24MNDIoA','Invalid\x20resource:\x20','session','407967KEWzIu','join','message','6612730NPmzzG','16766882ToPZrw','2672722rwcYGa','Session\x20llm_project\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','769983wKmZbR','60GQGovO','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','profile','length','includes','use','Error:\x20Profile\x20\x27'];a31_0x2123=function(){return _0x10e509;};return a31_0x2123();}export class UseCommand extends BaseCommand{[a31_0x586624(0x17a)]=a31_0x586624(0x177);[a31_0x586624(0x179)]=a31_0x586624(0x17c);[a31_0x586624(0x185)](_0x53c7ca){const _0x4c7803=a31_0x586624,{args:_0x5c1c16}=_0x53c7ca;if(_0x5c1c16[_0x4c7803(0x175)]<0x2)return _0x4c7803(0x18a)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x4c7803(0x173)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x1da688=_0x5c1c16[0x0],_0x29ef61=[_0x4c7803(0x18d),_0x4c7803(0x18e),'llm_project',_0x4c7803(0x174)];if(!_0x29ef61[_0x4c7803(0x176)](_0x1da688))return _0x4c7803(0x190)+_0x1da688+_0x4c7803(0x170)+_0x29ef61[_0x4c7803(0x193)](',\x20');return undefined;}async[a31_0x586624(0x189)](_0x3f08af){const _0x24a1b8=a31_0x586624,{args:_0x2a9cf9,options:_0x1fbc4a}=_0x3f08af;try{const _0x4e11cc=_0x2a9cf9[0x0],_0x2ba841=_0x2a9cf9[0x1];if(_0x4e11cc===_0x24a1b8(0x174)){if(!profileExists(_0x2ba841))return console['error'](_0x24a1b8(0x178)+_0x2ba841+'\x27\x20does\x20not\x20exist'),console[_0x24a1b8(0x187)](_0x24a1b8(0x17d)),0x1;const _0x434796=_0x1fbc4a[_0x24a1b8(0x191)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2ba841},_0x1fbc4a[_0x24a1b8(0x191)]),console[_0x24a1b8(0x181)]('Session\x20profile\x20set\x20to:\x20'+_0x2ba841+_0x24a1b8(0x182)+_0x434796+')'),console[_0x24a1b8(0x181)](_0x24a1b8(0x180)),0x0;}const _0x1765b4={},_0x4bb27f=_0x1fbc4a[_0x24a1b8(0x191)]||getCurrentSessionPID()[_0x24a1b8(0x183)]();switch(_0x4e11cc){case _0x24a1b8(0x18d):_0x1765b4[_0x24a1b8(0x18d)]=_0x2ba841,console[_0x24a1b8(0x181)]('Session\x20database\x20set\x20to:\x20'+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;case _0x24a1b8(0x18e):_0x1765b4[_0x24a1b8(0x18e)]=_0x2ba841,console[_0x24a1b8(0x181)](_0x24a1b8(0x17b)+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;case _0x24a1b8(0x18c):_0x1765b4[_0x24a1b8(0x18c)]=_0x2ba841,console[_0x24a1b8(0x181)](_0x24a1b8(0x16f)+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;}return saveSessionContext(_0x1765b4,_0x1fbc4a['session']),console['log'](_0x24a1b8(0x180)),0x0;}catch(_0x1ee12d){return _0x1ee12d instanceof Error&&console[_0x24a1b8(0x187)](_0x24a1b8(0x188)+_0x1ee12d[_0x24a1b8(0x16b)]),0x1;}}}
@@ -1 +1 @@
1
- const a32_0x5464de=a32_0x17ba;(function(_0x256e81,_0x2456ca){const _0x10b546=a32_0x17ba,_0x216856=_0x256e81();while(!![]){try{const _0x4669cd=parseInt(_0x10b546(0x19e))/0x1+-parseInt(_0x10b546(0x215))/0x2*(parseInt(_0x10b546(0x1d5))/0x3)+-parseInt(_0x10b546(0x1f6))/0x4*(parseInt(_0x10b546(0x1ba))/0x5)+parseInt(_0x10b546(0x1d6))/0x6+-parseInt(_0x10b546(0x1a6))/0x7+parseInt(_0x10b546(0x1de))/0x8+-parseInt(_0x10b546(0x1ff))/0x9;if(_0x4669cd===_0x2456ca)break;else _0x216856['push'](_0x216856['shift']());}catch(_0x1f9583){_0x216856['push'](_0x216856['shift']());}}}(a32_0x4c91,0xc43bd));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:projects';[a32_0x5464de(0x1a9)]='List\x20all\x20workflow\x20projects';async[a32_0x5464de(0x1d0)](_0x3b2b80){const _0x5be79e=a32_0x5464de,{options:_0x3b27bc,args:_0x463928,tdx:_0x48dcf8}=_0x3b2b80,_0x164548=_0x463928[0x0];try{_0x3b27bc[_0x5be79e(0x1b7)]&&_0x164548&&console['error']('Pattern:\x20'+_0x164548);const _0x1daf38=await withSpinner(_0x5be79e(0x218),()=>_0x48dcf8[_0x5be79e(0x1b9)][_0x5be79e(0x1ac)](_0x164548,{'limit':_0x3b27bc['limit']}),{'verbose':_0x3b27bc[_0x5be79e(0x1b7)]}),_0x4f5cb0=_0x1daf38[_0x5be79e(0x1d8)];return console['error']('✔\x20Found\x20'+_0x4f5cb0['length']+'\x20project'+(_0x4f5cb0['length']!==0x1?'s':'')),await handleSDKOutput(_0x4f5cb0,_0x3b27bc),0x0;}catch(_0x4759cf){if(_0x4759cf instanceof SDKError)return console[_0x5be79e(0x1a4)](_0x5be79e(0x1db)+_0x4759cf[_0x5be79e(0x1b1)]),_0x4759cf[_0x5be79e(0x1e6)]&&console[_0x5be79e(0x1a4)]('\x20\x20Cause:\x20'+_0x4759cf[_0x5be79e(0x1e6)]),0x1;throw _0x4759cf;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x1c5);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x217);async[a32_0x5464de(0x1d0)](_0x144c52){const _0x222a6e=a32_0x5464de,{options:_0x5682c9,args:_0x2e29ec,tdx:_0x51f1f5}=_0x144c52,_0x43d0d6=_0x2e29ec[0x0];try{_0x5682c9[_0x222a6e(0x1b7)]&&_0x43d0d6&&console[_0x222a6e(0x1a4)](_0x222a6e(0x1b3)+_0x43d0d6);const _0xbc5ce9=await withSpinner(_0x222a6e(0x1d3),()=>_0x51f1f5['workflow']['workflows'](_0x43d0d6,{'limit':_0x5682c9['limit']}),{'verbose':_0x5682c9['verbose']}),_0x2a8942=_0xbc5ce9[_0x222a6e(0x1d8)];return console['error'](_0x222a6e(0x1ae)+_0x2a8942[_0x222a6e(0x1ec)]+_0x222a6e(0x203)+(_0x2a8942[_0x222a6e(0x1ec)]!==0x1?'s':'')),await handleSDKOutput(_0x2a8942,_0x5682c9),0x0;}catch(_0x4a62e4){if(_0x4a62e4 instanceof SDKError)return console['error']('Error:\x20'+_0x4a62e4[_0x222a6e(0x1b1)]),_0x4a62e4[_0x222a6e(0x1e6)]&&console[_0x222a6e(0x1a4)](_0x222a6e(0x1aa)+_0x4a62e4['cause']),0x1;throw _0x4a62e4;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:sessions';['description']=a32_0x5464de(0x1ee);async[a32_0x5464de(0x1d0)](_0x4f05f7){const _0x3db96d=a32_0x5464de,{options:_0x5dcc20,args:_0x2ce3b9,tdx:_0xdae82c}=_0x4f05f7;let _0x35c3df,_0x3226ed;if(_0x2ce3b9[0x0]){const _0x569833=_0x2ce3b9[0x0][_0x3db96d(0x1df)]('.');if(_0x569833[_0x3db96d(0x1ec)]===0x1)_0x35c3df=_0x569833[0x0];else{if(_0x569833['length']===0x2)[_0x35c3df,_0x3226ed]=_0x569833;else return console[_0x3db96d(0x1a4)](_0x3db96d(0x214)),0x1;}}try{if(_0x5dcc20[_0x3db96d(0x1b7)]){if(_0x35c3df&&_0x3226ed)console[_0x3db96d(0x1a4)](_0x3db96d(0x1ca)+_0x35c3df+'.'+_0x3226ed);else _0x35c3df&&console[_0x3db96d(0x1a4)](_0x3db96d(0x1dc)+_0x35c3df);const _0x57baa1=_0x5dcc20[_0x3db96d(0x1d7)];_0x57baa1&&console[_0x3db96d(0x1a4)]('Status:\x20'+_0x57baa1);}const _0x555935=await withSpinner(_0x3db96d(0x1a7),()=>_0xdae82c[_0x3db96d(0x1b9)][_0x3db96d(0x1eb)]({'projectName':_0x35c3df,'workflowName':_0x3226ed,'status':_0x5dcc20['status'],'fromTime':_0x5dcc20['from'],'toTime':_0x5dcc20['to'],'limit':_0x5dcc20['limit']}),{'verbose':_0x5dcc20[_0x3db96d(0x1b7)]}),_0x51a58c=_0x555935['data'];return console[_0x3db96d(0x1a4)](_0x3db96d(0x1ae)+_0x51a58c[_0x3db96d(0x1ec)]+'\x20session'+(_0x51a58c[_0x3db96d(0x1ec)]!==0x1?'s':'')),await handleSDKOutput(_0x51a58c,_0x5dcc20),0x0;}catch(_0x4aeebb){if(_0x4aeebb instanceof SDKError)return console[_0x3db96d(0x1a4)]('Error:\x20'+_0x4aeebb[_0x3db96d(0x1b1)]),_0x4aeebb[_0x3db96d(0x1e6)]&&console['error'](_0x3db96d(0x1aa)+_0x4aeebb['cause']),0x1;throw _0x4aeebb;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x212);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1cd);async[a32_0x5464de(0x1d0)](_0x1afe5c){const _0x303ed8=a32_0x5464de,{options:_0x21b9d3,args:_0x3684b9,tdx:_0x4755b7}=_0x1afe5c;let _0x777265,_0x1064bc;if(_0x3684b9[0x0]){const _0x540516=_0x3684b9[0x0][_0x303ed8(0x1df)]('.');if(_0x540516[_0x303ed8(0x1ec)]===0x1)_0x777265=_0x540516[0x0];else{if(_0x540516[_0x303ed8(0x1ec)]===0x2)[_0x777265,_0x1064bc]=_0x540516;else return console[_0x303ed8(0x1a4)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x3dee6b=_0x21b9d3['includeRetried'];if(_0x21b9d3[_0x303ed8(0x1b7)]){if(_0x777265&&_0x1064bc)console[_0x303ed8(0x1a4)]('Filter:\x20'+_0x777265+'.'+_0x1064bc);else _0x777265&&console[_0x303ed8(0x1a4)](_0x303ed8(0x1dc)+_0x777265);_0x3dee6b&&console[_0x303ed8(0x1a4)](_0x303ed8(0x19f));}const _0x4dde43=await withSpinner(_0x303ed8(0x1bd),()=>_0x4755b7[_0x303ed8(0x1b9)][_0x303ed8(0x1d1)]({'projectName':_0x777265,'workflowName':_0x1064bc,'includeRetried':_0x3dee6b,'limit':_0x21b9d3[_0x303ed8(0x20e)]}),{'verbose':_0x21b9d3['verbose']}),_0x592031=_0x4dde43[_0x303ed8(0x1d8)];return console[_0x303ed8(0x1a4)]('✔\x20Found\x20'+_0x592031[_0x303ed8(0x1ec)]+_0x303ed8(0x1be)+(_0x592031[_0x303ed8(0x1ec)]!==0x1?'s':'')),await handleSDKOutput(_0x592031,_0x21b9d3),0x0;}catch(_0x12eefb){if(_0x12eefb instanceof SDKError)return console[_0x303ed8(0x1a4)](_0x303ed8(0x1db)+_0x12eefb[_0x303ed8(0x1b1)]),_0x12eefb[_0x303ed8(0x1e6)]&&console[_0x303ed8(0x1a4)](_0x303ed8(0x1aa)+_0x12eefb['cause']),0x1;throw _0x12eefb;}}}function a32_0x4c91(){const _0x37339a=['logs','479732ercJil','Include\x20retried:\x20yes','includeSubtasks','Reason:\x20','\x20log\x20entr','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','error','attempt','8354689PJngfA','Listing\x20workflow\x20sessions...','push','description','\x20\x20Cause:\x20','\x20task','projects','✔\x20Retry\x20started','✔\x20Found\x20','Getting\x20attempt\x20details...','Getting\x20task\x20logs...','message','workflow:kill','Project\x20filter:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','offset','\x20\x20New\x20attempt\x20ID:\x20','verbose','session:','workflow','10225iEHqkR','Downloading\x20project\x20','workflow:retry','Listing\x20workflow\x20attempts...','\x20attempt','\x20\x20Location:\x20','kill','Error:\x20Invalid\x20JSON\x20in\x20--params','Show\x20logs\x20for\x20a\x20specific\x20task','Pushing\x20workflow\x20project...','\x20\x20Project\x20ID:\x20','workflow:workflows','Resume\x20from:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:delete','stat','Filter:\x20','revision','Attempt\x20ID:\x20','List\x20workflow\x20attempts','params','yes','execute','attempts','Retrying\x20session...','Listing\x20workflows...','fs/promises','503211lxMtMc','9014340dfHOBx','status','data','projectId','fromTask','Error:\x20','Filter:\x20project=','Output\x20directory:\x20','6313056cXDKgH','split','Cancelled','✔\x20Deleted\x20project\x20','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Show\x20specific\x20attempt\x20details','Error:\x20Project\x20name\x20is\x20required','cause','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Session\x20ID:\x20','Project:\x20','tasks','sessions','length','attemptId','List\x20workflow\x20execution\x20sessions','workflow:attempt','\x22?\x20This\x20cannot\x20be\x20undone.','delete','Force:\x20yes','parse','utf-8','...','340cewlbW','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:\x20Attempt\x20ID\x20is\x20required','Task\x20name:\x20','✔\x20Pushed\x20','name','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','reason','Params:\x20','2381895tVUXPb','isDirectory','session','From\x20task:\x20','\x20workflow','\x20is\x20not\x20a\x20directory','workflow:logs','Revision:\x20','✔\x20Downloaded\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','force','substring','download','Validation:\x20skipped','Kill\x20a\x20running\x20attempt','limit','projectName','\x20\x20Revision:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:attempts','Deleting\x20project\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','4mvYmtR','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','List\x20workflows','Listing\x20workflow\x20projects...','Killing\x20attempt...','startsWith'];a32_0x4c91=function(){return _0x37339a;};return a32_0x4c91();}export class WorkflowAttemptCommand extends BaseCommand{['name']=a32_0x5464de(0x1ef);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1e4);async[a32_0x5464de(0x1d0)](_0x5a98dd){const _0x52b81d=a32_0x5464de,{options:_0x16d4d2,args:_0x18849f,tdx:_0x3069c3}=_0x5a98dd,_0x5a9d7a=_0x18849f[0x0];if(!_0x5a9d7a)return console[_0x52b81d(0x1a4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x16d4d2['verbose']&&console['error'](_0x52b81d(0x1cc)+_0x5a9d7a);const _0x16b0a4=await withSpinner(_0x52b81d(0x1af),()=>_0x3069c3[_0x52b81d(0x1b9)][_0x52b81d(0x1a5)](_0x5a9d7a),{'verbose':_0x16d4d2[_0x52b81d(0x1b7)]}),_0x5b06cf=_0x16b0a4[_0x52b81d(0x1d8)];return await handleSDKOutput([_0x5b06cf],_0x16d4d2),0x0;}catch(_0x206b95){if(_0x206b95 instanceof SDKError)return console[_0x52b81d(0x1a4)](_0x52b81d(0x1db)+_0x206b95[_0x52b81d(0x1b1)]),_0x206b95[_0x52b81d(0x1e6)]&&console[_0x52b81d(0x1a4)](_0x52b81d(0x1aa)+_0x206b95['cause']),0x1;throw _0x206b95;}}}export class WorkflowTasksCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:tasks';[a32_0x5464de(0x1a9)]='Show\x20tasks\x20for\x20an\x20attempt';async[a32_0x5464de(0x1d0)](_0x4fbd1b){const _0x5b834f=a32_0x5464de,{options:_0x59b5c3,args:_0x362a50,tdx:_0x4c5b77}=_0x4fbd1b,_0x33c411=_0x362a50[0x0];if(!_0x33c411)return console[_0x5b834f(0x1a4)](_0x5b834f(0x1f8)),0x1;try{const _0x5c97f0=_0x59b5c3[_0x5b834f(0x1a0)];_0x59b5c3['verbose']&&(console[_0x5b834f(0x1a4)](_0x5b834f(0x1cc)+_0x33c411),_0x5c97f0&&console[_0x5b834f(0x1a4)]('Including\x20subtasks:\x20yes'));const _0xffdbe0=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4c5b77[_0x5b834f(0x1b9)][_0x5b834f(0x1ea)](_0x33c411,_0x5c97f0||![]),{'verbose':_0x59b5c3[_0x5b834f(0x1b7)]}),_0x49e35d=_0xffdbe0['data'];return console[_0x5b834f(0x1a4)](_0x5b834f(0x1ae)+_0x49e35d[_0x5b834f(0x1ec)]+_0x5b834f(0x1ab)+(_0x49e35d['length']!==0x1?'s':'')),await handleSDKOutput(_0x49e35d,_0x59b5c3),0x0;}catch(_0x3090ef){if(_0x3090ef instanceof SDKError)return console[_0x5b834f(0x1a4)](_0x5b834f(0x1db)+_0x3090ef[_0x5b834f(0x1b1)]),_0x3090ef[_0x5b834f(0x1e6)]&&console['error'](_0x5b834f(0x1aa)+_0x3090ef[_0x5b834f(0x1e6)]),0x1;throw _0x3090ef;}}}function a32_0x17ba(_0x47d5c2,_0x18a27a){const _0x4c910a=a32_0x4c91();return a32_0x17ba=function(_0x17ba6c,_0x313a98){_0x17ba6c=_0x17ba6c-0x19c;let _0xa50dc=_0x4c910a[_0x17ba6c];return _0xa50dc;},a32_0x17ba(_0x47d5c2,_0x18a27a);}export class WorkflowLogsCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x205);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1c2);async[a32_0x5464de(0x1d0)](_0x5ac784){const _0xb7f34a=a32_0x5464de,{options:_0x4c3587,args:_0x5b700f,tdx:_0x37327b}=_0x5ac784,_0x52576a=_0x5b700f[0x0],_0x1186a2=_0x5b700f[0x1];if(!_0x52576a||!_0x1186a2)return console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1e2)),0x1;try{_0x4c3587[_0xb7f34a(0x1b7)]&&(console['error'](_0xb7f34a(0x1cc)+_0x52576a),console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1f9)+_0x1186a2));const _0x3c86d6=_0x4c3587[_0xb7f34a(0x1b5)],_0x3e710a=await withSpinner(_0xb7f34a(0x1b0),()=>_0x37327b[_0xb7f34a(0x1b9)][_0xb7f34a(0x19d)](_0x52576a,_0x1186a2,{'offset':_0x3c86d6,'limit':_0x4c3587['limit']}),{'verbose':_0x4c3587[_0xb7f34a(0x1b7)]}),_0x295db0=_0x3e710a['data'];return console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1ae)+_0x295db0[_0xb7f34a(0x1ec)]+_0xb7f34a(0x1a2)+(_0x295db0[_0xb7f34a(0x1ec)]!==0x1?'ies':'y')),await handleSDKOutput(_0x295db0,_0x4c3587),0x0;}catch(_0x2b3d70){if(_0x2b3d70 instanceof SDKError)return console[_0xb7f34a(0x1a4)]('Error:\x20'+_0x2b3d70[_0xb7f34a(0x1b1)]),_0x2b3d70[_0xb7f34a(0x1e6)]&&console[_0xb7f34a(0x1a4)](_0xb7f34a(0x1aa)+_0x2b3d70[_0xb7f34a(0x1e6)]),0x1;throw _0x2b3d70;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a32_0x5464de(0x1b2);[a32_0x5464de(0x1a9)]=a32_0x5464de(0x20d);async['execute'](_0xec8d9b){const _0x28ccbb=a32_0x5464de,{options:_0x254112,args:_0x3b487f,tdx:_0x1cec77}=_0xec8d9b,_0x557b84=_0x3b487f[0x0];if(!_0x557b84)return console[_0x28ccbb(0x1a4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x1ea6f9=_0x254112[_0x28ccbb(0x1fd)];_0x254112[_0x28ccbb(0x1b7)]&&(console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1cc)+_0x557b84),_0x1ea6f9&&console['error'](_0x28ccbb(0x1a1)+_0x1ea6f9));if(!_0x254112[_0x28ccbb(0x1cf)]){const _0x53a8d3=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x557b84+'?');if(!_0x53a8d3)return console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1e0)),0x0;}const _0x1d3c66=await withSpinner(_0x28ccbb(0x219),()=>_0x1cec77[_0x28ccbb(0x1b9)][_0x28ccbb(0x1c0)](_0x557b84,_0x1ea6f9),{'verbose':_0x254112[_0x28ccbb(0x1b7)]}),_0x97ec90=_0x1d3c66[_0x28ccbb(0x1d8)];return console[_0x28ccbb(0x1a4)]('✔\x20'+_0x97ec90),0x0;}catch(_0x8932cf){if(_0x8932cf instanceof SDKError)return console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1db)+_0x8932cf[_0x28ccbb(0x1b1)]),_0x8932cf['cause']&&console[_0x28ccbb(0x1a4)](_0x28ccbb(0x1aa)+_0x8932cf['cause']),0x1;throw _0x8932cf;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x5464de(0x1bc);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x5464de(0x1d0)](_0x3738fc){const _0x5f308a=a32_0x5464de,{options:_0x288fdb,args:_0x3ee2d3,tdx:_0x32fa20}=_0x3738fc,_0x55f241=_0x3ee2d3[0x0];if(!_0x55f241)return console[_0x5f308a(0x1a4)](_0x5f308a(0x1e3)),console[_0x5f308a(0x1a4)](_0x5f308a(0x1a3)),0x1;let _0x394b58=![],_0x56f804=_0x55f241;if(_0x55f241[_0x5f308a(0x19c)](_0x5f308a(0x1b8)))_0x394b58=!![],_0x56f804=_0x55f241[_0x5f308a(0x20a)](0x8);else{if(_0x55f241[_0x5f308a(0x19c)]('attempt:'))_0x394b58=![],_0x56f804=_0x55f241['substring'](0x8);else return console[_0x5f308a(0x1a4)](_0x5f308a(0x1e7)),console[_0x5f308a(0x1a4)](_0x5f308a(0x1a3)),0x1;}try{const _0x8a5ed4=_0x288fdb[_0x5f308a(0x1da)],_0x1e1a82=_0x288fdb['resumeFrom'],_0x2eaed1=_0x288fdb[_0x5f308a(0x1ce)],_0x2faf7a=_0x288fdb[_0x5f308a(0x209)];_0x288fdb[_0x5f308a(0x1b7)]&&(console[_0x5f308a(0x1a4)]('Target:\x20'+(_0x394b58?'session':'attempt')+'\x20'+_0x56f804),_0x8a5ed4&&console['error'](_0x5f308a(0x202)+_0x8a5ed4),_0x1e1a82&&console[_0x5f308a(0x1a4)](_0x5f308a(0x1c6)+_0x1e1a82),_0x2eaed1&&console[_0x5f308a(0x1a4)](_0x5f308a(0x1fe)+_0x2eaed1),_0x2faf7a&&console['error'](_0x5f308a(0x1f2)));let _0x1c0344;if(_0x2eaed1)try{if(_0x2eaed1[_0x5f308a(0x19c)]('@')){const _0x2edcdb=await import(_0x5f308a(0x1d4)),_0x10de58=_0x2eaed1[_0x5f308a(0x20a)](0x1),_0x30ffc2=await _0x2edcdb['readFile'](_0x10de58,_0x5f308a(0x1f4));_0x1c0344=JSON[_0x5f308a(0x1f3)](_0x30ffc2);}else _0x1c0344=JSON[_0x5f308a(0x1f3)](_0x2eaed1);}catch{return console[_0x5f308a(0x1a4)](_0x5f308a(0x1c1)),0x1;}if(!_0x288fdb['yes']){const _0x29f817=await confirm(_0x5f308a(0x208)+(_0x394b58?_0x5f308a(0x201):_0x5f308a(0x1a5))+'\x20'+_0x56f804+'?');if(!_0x29f817)return console[_0x5f308a(0x1a4)](_0x5f308a(0x1e0)),0x0;}let _0x5b5963;_0x394b58?_0x5b5963=await withSpinner(_0x5f308a(0x1d2),()=>_0x32fa20[_0x5f308a(0x1b9)]['retrySession'](_0x56f804,{'fromTask':_0x8a5ed4,'retryParams':_0x1c0344}),{'verbose':_0x288fdb[_0x5f308a(0x1b7)]}):_0x5b5963=await withSpinner('Retrying\x20attempt...',()=>_0x32fa20['workflow']['retryAttempt'](_0x56f804,{'resumeFrom':_0x1e1a82,'retryParams':_0x1c0344,'force':_0x2faf7a}),{'verbose':_0x288fdb[_0x5f308a(0x1b7)]});const _0x508f65=_0x5b5963['data'];return console[_0x5f308a(0x1a4)](_0x5f308a(0x1ad)),console[_0x5f308a(0x1a4)](_0x5f308a(0x1b6)+_0x508f65[_0x5f308a(0x1ed)]),console[_0x5f308a(0x1a4)](_0x5f308a(0x1e8)+_0x508f65['sessionId']),0x0;}catch(_0x251523){if(_0x251523 instanceof SDKError)return console[_0x5f308a(0x1a4)](_0x5f308a(0x1db)+_0x251523[_0x5f308a(0x1b1)]),_0x251523['cause']&&console[_0x5f308a(0x1a4)](_0x5f308a(0x1aa)+_0x251523[_0x5f308a(0x1e6)]),0x1;throw _0x251523;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x5464de(0x1fb)]='workflow:download';[a32_0x5464de(0x1a9)]=a32_0x5464de(0x1b4);async['execute'](_0xa1e2e0){const _0x315fbf=a32_0x5464de,{options:_0x34296f,args:_0x33618e,tdx:_0x2a86a5}=_0xa1e2e0,_0x3b3668=_0x33618e[0x0],_0x402c38=_0x33618e[0x1]||'.';if(!_0x3b3668)return console[_0x315fbf(0x1a4)](_0x315fbf(0x1e5)),console[_0x315fbf(0x1a4)](_0x315fbf(0x1fc)),0x1;const _0x34efaf=_0x34296f[_0x315fbf(0x1cb)];_0x34296f[_0x315fbf(0x1b7)]&&(console[_0x315fbf(0x1a4)](_0x315fbf(0x1e9)+_0x3b3668),console[_0x315fbf(0x1a4)](_0x315fbf(0x1dd)+_0x402c38),_0x34efaf&&console[_0x315fbf(0x1a4)](_0x315fbf(0x206)+_0x34efaf));const _0x31e668=await withSpinner(_0x315fbf(0x1bb)+_0x3b3668+'...',()=>_0x2a86a5[_0x315fbf(0x1b9)][_0x315fbf(0x20b)](_0x3b3668,_0x402c38,{'revision':_0x34efaf}),{'verbose':_0x34296f[_0x315fbf(0x1b7)]}),_0x2257b7=_0x31e668[_0x315fbf(0x1d8)];return console[_0x315fbf(0x1a4)](_0x315fbf(0x207)+_0x2257b7[_0x315fbf(0x20f)]),console['error'](_0x315fbf(0x210)+_0x2257b7[_0x315fbf(0x1cb)]),console[_0x315fbf(0x1a4)]('\x20\x20Files\x20extracted:\x20'+_0x2257b7['filesExtracted']),console['error'](_0x315fbf(0x1bf)+_0x402c38+'/'+_0x2257b7[_0x315fbf(0x20f)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';['description']='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a32_0x5464de(0x1d0)](_0x1e70ce){const _0x44219e=a32_0x5464de,{options:_0x476198,args:_0x2df4c2,tdx:_0x55b5d9}=_0x1e70ce;let _0xd6a6f5='.',_0x33091c=_0x476198[_0x44219e(0x1fb)];if(_0x2df4c2[0x0]){const {promises:_0x10871b}=await import('fs');try{const _0x14b7a8=await _0x10871b[_0x44219e(0x1c9)](_0x2df4c2[0x0]);if(_0x14b7a8[_0x44219e(0x200)]())_0xd6a6f5=_0x2df4c2[0x0];else return console[_0x44219e(0x1a4)](_0x44219e(0x1db)+_0x2df4c2[0x0]+_0x44219e(0x204)),0x1;}catch{_0x33091c=_0x2df4c2[0x0],_0xd6a6f5='.';}}const _0x13aa43=_0x476198[_0x44219e(0x1cb)],_0x2e2ab8=_0x476198['skipValidation'];_0x476198['verbose']&&(console[_0x44219e(0x1a4)]('Project\x20directory:\x20'+_0xd6a6f5),_0x33091c&&console[_0x44219e(0x1a4)]('Project\x20name:\x20'+_0x33091c),_0x13aa43&&console[_0x44219e(0x1a4)](_0x44219e(0x206)+_0x13aa43),_0x2e2ab8&&console[_0x44219e(0x1a4)](_0x44219e(0x20c)));const _0x2a3ae9=await withSpinner(_0x44219e(0x1c3),()=>_0x55b5d9[_0x44219e(0x1b9)][_0x44219e(0x1a8)](_0xd6a6f5,{'projectName':_0x33091c,'revision':_0x13aa43,'skipValidation':_0x2e2ab8}),{'verbose':_0x476198[_0x44219e(0x1b7)]}),_0x17c81a=_0x2a3ae9[_0x44219e(0x1d8)];return console[_0x44219e(0x1a4)](_0x44219e(0x1fa)+_0x17c81a['projectName']),console[_0x44219e(0x1a4)](_0x44219e(0x1c4)+_0x17c81a['projectId']),console[_0x44219e(0x1a4)]('\x20\x20Revision:\x20'+_0x17c81a[_0x44219e(0x1cb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x5464de(0x1fb)]=a32_0x5464de(0x1c8);['description']=a32_0x5464de(0x1c7);async['execute'](_0x3c286f){const _0x42a1e3=a32_0x5464de,{options:_0x170a7b,args:_0x49d958,tdx:_0x23fee0}=_0x3c286f,_0x23d844=_0x49d958[0x0];if(!_0x23d844)return console[_0x42a1e3(0x1a4)](_0x42a1e3(0x211)),console['error'](_0x42a1e3(0x1f7)),0x1;_0x170a7b[_0x42a1e3(0x1b7)]&&console[_0x42a1e3(0x1a4)](_0x42a1e3(0x1e9)+_0x23d844);if(!_0x170a7b[_0x42a1e3(0x1cf)]){const _0x125200=await confirm(_0x42a1e3(0x216)+_0x23d844+_0x42a1e3(0x1f0));if(!_0x125200)return console[_0x42a1e3(0x1a4)](_0x42a1e3(0x1e0)),0x0;}const _0x5739c6=await withSpinner(_0x42a1e3(0x213)+_0x23d844+_0x42a1e3(0x1f5),()=>_0x23fee0['workflow'][_0x42a1e3(0x1f1)](_0x23d844),{'verbose':_0x170a7b[_0x42a1e3(0x1b7)]}),_0x155a56=_0x5739c6[_0x42a1e3(0x1d8)];return console['error'](_0x42a1e3(0x1e1)+_0x155a56[_0x42a1e3(0x20f)]),console[_0x42a1e3(0x1a4)](_0x42a1e3(0x1c4)+_0x155a56[_0x42a1e3(0x1d9)]),0x0;}}
1
+ const a32_0x13ff80=a32_0x5a7c;function a32_0x5650(){const _0x239ed5=['1808004FulWes','filesExtracted','Downloading\x20project\x20','stat','...','workflow:retry','attemptId','Validation:\x20skipped','532HfWQDg','workflow:kill','3082408KmOBAi','Listing\x20workflow\x20sessions...','session:','startsWith','includeSubtasks','fromTask','\x20log\x20entr','✔\x20Deleted\x20project\x20','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','workflow:sessions','61554DZgkQR','attempts','1gOtmpy','attempt','workflow:logs','length','session','retrySession','Killing\x20attempt...','\x20\x20Files\x20extracted:\x20','error','from','includeRetried','Cancelled','\x20session','logs','name','6720420qjNbXg','Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','workflow:push','15hfhVpu','cause','workflow:projects','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','split','Task\x20name:\x20','Params:\x20','\x20\x20Cause:\x20','List\x20workflow\x20execution\x20sessions','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','data','fs/promises','skipValidation','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Project\x20directory:\x20','limit','Pattern:\x20','Error:\x20','projectId','\x20is\x20not\x20a\x20directory','reason','Kill\x20a\x20running\x20attempt','Listing\x20workflows...','delete','workflow:download','ies','projects','Project\x20name:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','From\x20task:\x20','verbose','Revision:\x20','params','execute','Including\x20subtasks:\x20yes','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','yes','retryAttempt','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20workflow\x20attempts...','substring','Getting\x20attempt\x20details...','✔\x20Retry\x20started','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','3952201SSTboB','workflow','178348YxHapD','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow:attempts','revision','parse','Filter:\x20project=','9XjZyrE','List\x20workflow\x20attempts','projectName','Listing\x20workflow\x20projects...','workflow:attempt','Error:\x20Attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','\x20\x20Project\x20ID:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Getting\x20task\x20logs...','\x20\x20Location:\x20','✔\x20Found\x20','Project:\x20','sessionId','status','Deleting\x20project\x20','Include\x20retried:\x20yes','readFile','workflow:tasks','Resume\x20from:\x20','workflows','Target:\x20','Reason:\x20','Show\x20logs\x20for\x20a\x20specific\x20task','\x20\x20Session\x20ID:\x20','message','\x20workflow','description','\x22?\x20This\x20cannot\x20be\x20undone.','\x20task','Output\x20directory:\x20','8330440SWjJBP','workflow:workflows','offset'];a32_0x5650=function(){return _0x239ed5;};return a32_0x5650();}(function(_0x38fc14,_0x320c5b){const _0x4d5dd8=a32_0x5a7c,_0x27c79c=_0x38fc14();while(!![]){try{const _0x31442c=-parseInt(_0x4d5dd8(0x111))/0x1*(-parseInt(_0x4d5dd8(0xfb))/0x2)+parseInt(_0x4d5dd8(0x124))/0x3*(parseInt(_0x4d5dd8(0x156))/0x4)+parseInt(_0x4d5dd8(0x120))/0x5+-parseInt(_0x4d5dd8(0x10f))/0x6*(parseInt(_0x4d5dd8(0x103))/0x7)+-parseInt(_0x4d5dd8(0x105))/0x8+parseInt(_0x4d5dd8(0x15c))/0x9*(-parseInt(_0x4d5dd8(0xf8))/0xa)+parseInt(_0x4d5dd8(0x154))/0xb;if(_0x31442c===_0x320c5b)break;else _0x27c79c['push'](_0x27c79c['shift']());}catch(_0x1ca565){_0x27c79c['push'](_0x27c79c['shift']());}}}(a32_0x5650,0xcb31b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x126);[a32_0x13ff80(0xf4)]='List\x20all\x20workflow\x20projects';async[a32_0x13ff80(0x148)](_0x1ae513){const _0x8a1b40=a32_0x13ff80,{options:_0x3794aa,args:_0xb24461,tdx:_0xc37ca}=_0x1ae513,_0x4c8a83=_0xb24461[0x0];try{_0x3794aa[_0x8a1b40(0x145)]&&_0x4c8a83&&console[_0x8a1b40(0x119)](_0x8a1b40(0x137)+_0x4c8a83);const _0x50b48a=await withSpinner(_0x8a1b40(0x15f),()=>_0xc37ca[_0x8a1b40(0x155)][_0x8a1b40(0x141)](_0x4c8a83,{'limit':_0x3794aa[_0x8a1b40(0x136)]}),{'verbose':_0x3794aa[_0x8a1b40(0x145)]}),_0x3c7808=_0x50b48a[_0x8a1b40(0x130)];return console[_0x8a1b40(0x119)](_0x8a1b40(0x167)+_0x3c7808[_0x8a1b40(0x114)]+'\x20project'+(_0x3c7808[_0x8a1b40(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x3c7808,_0x3794aa),0x0;}catch(_0x4e6155){if(_0x4e6155 instanceof SDKError)return console[_0x8a1b40(0x119)](_0x8a1b40(0x138)+_0x4e6155['message']),_0x4e6155['cause']&&console['error'](_0x8a1b40(0x12b)+_0x4e6155[_0x8a1b40(0x125)]),0x1;throw _0x4e6155;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0xf9);[a32_0x13ff80(0xf4)]='List\x20workflows';async[a32_0x13ff80(0x148)](_0x218d40){const _0x35a413=a32_0x13ff80,{options:_0x1c213e,args:_0x32c627,tdx:_0x5e2cd4}=_0x218d40,_0x510e4d=_0x32c627[0x0];try{_0x1c213e[_0x35a413(0x145)]&&_0x510e4d&&console[_0x35a413(0x119)]('Project\x20filter:\x20'+_0x510e4d);const _0x118bfe=await withSpinner(_0x35a413(0x13d),()=>_0x5e2cd4[_0x35a413(0x155)][_0x35a413(0xed)](_0x510e4d,{'limit':_0x1c213e[_0x35a413(0x136)]}),{'verbose':_0x1c213e[_0x35a413(0x145)]}),_0x1e67fe=_0x118bfe['data'];return console[_0x35a413(0x119)]('✔\x20Found\x20'+_0x1e67fe['length']+_0x35a413(0xf3)+(_0x1e67fe[_0x35a413(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x1e67fe,_0x1c213e),0x0;}catch(_0x5ecb87){if(_0x5ecb87 instanceof SDKError)return console[_0x35a413(0x119)](_0x35a413(0x138)+_0x5ecb87['message']),_0x5ecb87[_0x35a413(0x125)]&&console['error'](_0x35a413(0x12b)+_0x5ecb87[_0x35a413(0x125)]),0x1;throw _0x5ecb87;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x10e);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12c);async[a32_0x13ff80(0x148)](_0xaf36fc){const _0x28725c=a32_0x13ff80,{options:_0x5c90a0,args:_0x136d07,tdx:_0x408895}=_0xaf36fc;let _0x47c1e0,_0x20ad01;if(_0x136d07[0x0]){const _0x13e519=_0x136d07[0x0]['split']('.');if(_0x13e519['length']===0x1)_0x47c1e0=_0x13e519[0x0];else{if(_0x13e519['length']===0x2)[_0x47c1e0,_0x20ad01]=_0x13e519;else return console['error']('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5c90a0[_0x28725c(0x145)]){if(_0x47c1e0&&_0x20ad01)console[_0x28725c(0x119)](_0x28725c(0x133)+_0x47c1e0+'.'+_0x20ad01);else _0x47c1e0&&console[_0x28725c(0x119)](_0x28725c(0x15b)+_0x47c1e0);const _0x198866=_0x5c90a0['status'];_0x198866&&console[_0x28725c(0x119)]('Status:\x20'+_0x198866);}const _0x3c0cd1=await withSpinner(_0x28725c(0x106),()=>_0x408895[_0x28725c(0x155)]['sessions']({'projectName':_0x47c1e0,'workflowName':_0x20ad01,'status':_0x5c90a0[_0x28725c(0xe7)],'fromTime':_0x5c90a0[_0x28725c(0x11a)],'toTime':_0x5c90a0['to'],'limit':_0x5c90a0[_0x28725c(0x136)]}),{'verbose':_0x5c90a0[_0x28725c(0x145)]}),_0x5ad890=_0x3c0cd1['data'];return console['error'](_0x28725c(0x167)+_0x5ad890[_0x28725c(0x114)]+_0x28725c(0x11d)+(_0x5ad890[_0x28725c(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x5ad890,_0x5c90a0),0x0;}catch(_0x380fef){if(_0x380fef instanceof SDKError)return console[_0x28725c(0x119)](_0x28725c(0x138)+_0x380fef[_0x28725c(0xf2)]),_0x380fef[_0x28725c(0x125)]&&console[_0x28725c(0x119)](_0x28725c(0x12b)+_0x380fef[_0x28725c(0x125)]),0x1;throw _0x380fef;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x158);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x15d);async[a32_0x13ff80(0x148)](_0x4c98a6){const _0x58e37c=a32_0x13ff80,{options:_0x355e9b,args:_0x107bf8,tdx:_0x56cd15}=_0x4c98a6;let _0x75b718,_0x48a118;if(_0x107bf8[0x0]){const _0xf53be2=_0x107bf8[0x0][_0x58e37c(0x128)]('.');if(_0xf53be2['length']===0x1)_0x75b718=_0xf53be2[0x0];else{if(_0xf53be2['length']===0x2)[_0x75b718,_0x48a118]=_0xf53be2;else return console[_0x58e37c(0x119)](_0x58e37c(0x127)),0x1;}}try{const _0x5408eb=_0x355e9b[_0x58e37c(0x11b)];if(_0x355e9b[_0x58e37c(0x145)]){if(_0x75b718&&_0x48a118)console[_0x58e37c(0x119)](_0x58e37c(0x133)+_0x75b718+'.'+_0x48a118);else _0x75b718&&console['error'](_0x58e37c(0x15b)+_0x75b718);_0x5408eb&&console[_0x58e37c(0x119)](_0x58e37c(0xe9));}const _0x1d3fb0=await withSpinner(_0x58e37c(0x14f),()=>_0x56cd15[_0x58e37c(0x155)][_0x58e37c(0x110)]({'projectName':_0x75b718,'workflowName':_0x48a118,'includeRetried':_0x5408eb,'limit':_0x355e9b[_0x58e37c(0x136)]}),{'verbose':_0x355e9b[_0x58e37c(0x145)]}),_0x2a381a=_0x1d3fb0[_0x58e37c(0x130)];return console[_0x58e37c(0x119)](_0x58e37c(0x167)+_0x2a381a[_0x58e37c(0x114)]+'\x20attempt'+(_0x2a381a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2a381a,_0x355e9b),0x0;}catch(_0x36b994){if(_0x36b994 instanceof SDKError)return console[_0x58e37c(0x119)](_0x58e37c(0x138)+_0x36b994[_0x58e37c(0xf2)]),_0x36b994[_0x58e37c(0x125)]&&console[_0x58e37c(0x119)](_0x58e37c(0x12b)+_0x36b994[_0x58e37c(0x125)]),0x1;throw _0x36b994;}}}function a32_0x5a7c(_0x17f220,_0x46dd2a){const _0x565092=a32_0x5650();return a32_0x5a7c=function(_0x5a7cd3,_0x2aed99){_0x5a7cd3=_0x5a7cd3-0xe7;let _0x288da4=_0x565092[_0x5a7cd3];return _0x288da4;},a32_0x5a7c(_0x17f220,_0x46dd2a);}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x160);['description']='Show\x20specific\x20attempt\x20details';async[a32_0x13ff80(0x148)](_0x4eada8){const _0x3d970f=a32_0x13ff80,{options:_0x3d4748,args:_0x43f41b,tdx:_0xb3d9aa}=_0x4eada8,_0x151153=_0x43f41b[0x0];if(!_0x151153)return console['error'](_0x3d970f(0x161)),0x1;try{_0x3d4748[_0x3d970f(0x145)]&&console[_0x3d970f(0x119)](_0x3d970f(0x121)+_0x151153);const _0x1b0957=await withSpinner(_0x3d970f(0x151),()=>_0xb3d9aa['workflow'][_0x3d970f(0x112)](_0x151153),{'verbose':_0x3d4748[_0x3d970f(0x145)]}),_0x244aef=_0x1b0957[_0x3d970f(0x130)];return await handleSDKOutput([_0x244aef],_0x3d4748),0x0;}catch(_0x55e1cb){if(_0x55e1cb instanceof SDKError)return console['error'](_0x3d970f(0x138)+_0x55e1cb[_0x3d970f(0xf2)]),_0x55e1cb[_0x3d970f(0x125)]&&console[_0x3d970f(0x119)](_0x3d970f(0x12b)+_0x55e1cb[_0x3d970f(0x125)]),0x1;throw _0x55e1cb;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x13ff80(0xeb);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12d);async[a32_0x13ff80(0x148)](_0x411203){const _0x111478=a32_0x13ff80,{options:_0x302353,args:_0x385396,tdx:_0xc9feaa}=_0x411203,_0x248ccf=_0x385396[0x0];if(!_0x248ccf)return console[_0x111478(0x119)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x479ac0=_0x302353[_0x111478(0x109)];_0x302353[_0x111478(0x145)]&&(console[_0x111478(0x119)]('Attempt\x20ID:\x20'+_0x248ccf),_0x479ac0&&console[_0x111478(0x119)](_0x111478(0x149)));const _0x46ab0f=await withSpinner(_0x111478(0x162),()=>_0xc9feaa[_0x111478(0x155)]['tasks'](_0x248ccf,_0x479ac0||![]),{'verbose':_0x302353['verbose']}),_0x565b78=_0x46ab0f[_0x111478(0x130)];return console[_0x111478(0x119)](_0x111478(0x167)+_0x565b78[_0x111478(0x114)]+_0x111478(0xf6)+(_0x565b78[_0x111478(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x565b78,_0x302353),0x0;}catch(_0xcf9d32){if(_0xcf9d32 instanceof SDKError)return console[_0x111478(0x119)](_0x111478(0x138)+_0xcf9d32[_0x111478(0xf2)]),_0xcf9d32['cause']&&console[_0x111478(0x119)](_0x111478(0x12b)+_0xcf9d32[_0x111478(0x125)]),0x1;throw _0xcf9d32;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x113);['description']=a32_0x13ff80(0xf0);async[a32_0x13ff80(0x148)](_0x46ba21){const _0x189977=a32_0x13ff80,{options:_0x23aebc,args:_0x15791d,tdx:_0x319b1b}=_0x46ba21,_0x5f4048=_0x15791d[0x0],_0x1005d7=_0x15791d[0x1];if(!_0x5f4048||!_0x1005d7)return console['error'](_0x189977(0x10d)),0x1;try{_0x23aebc[_0x189977(0x145)]&&(console[_0x189977(0x119)](_0x189977(0x121)+_0x5f4048),console[_0x189977(0x119)](_0x189977(0x129)+_0x1005d7));const _0x2c2c22=_0x23aebc[_0x189977(0xfa)],_0x3e2e39=await withSpinner(_0x189977(0x165),()=>_0x319b1b[_0x189977(0x155)][_0x189977(0x11e)](_0x5f4048,_0x1005d7,{'offset':_0x2c2c22,'limit':_0x23aebc[_0x189977(0x136)]}),{'verbose':_0x23aebc[_0x189977(0x145)]}),_0x457f02=_0x3e2e39[_0x189977(0x130)];return console[_0x189977(0x119)](_0x189977(0x167)+_0x457f02[_0x189977(0x114)]+_0x189977(0x10b)+(_0x457f02[_0x189977(0x114)]!==0x1?_0x189977(0x140):'y')),await handleSDKOutput(_0x457f02,_0x23aebc),0x0;}catch(_0x57e868){if(_0x57e868 instanceof SDKError)return console[_0x189977(0x119)](_0x189977(0x138)+_0x57e868[_0x189977(0xf2)]),_0x57e868['cause']&&console[_0x189977(0x119)](_0x189977(0x12b)+_0x57e868['cause']),0x1;throw _0x57e868;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x104);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x13c);async[a32_0x13ff80(0x148)](_0x291f6c){const _0x20bf25=a32_0x13ff80,{options:_0xad14f5,args:_0x18e9cb,tdx:_0x1ab9ef}=_0x291f6c,_0x1fc624=_0x18e9cb[0x0];if(!_0x1fc624)return console[_0x20bf25(0x119)](_0x20bf25(0x161)),0x1;try{const _0x302565=_0xad14f5[_0x20bf25(0x13b)];_0xad14f5[_0x20bf25(0x145)]&&(console[_0x20bf25(0x119)](_0x20bf25(0x121)+_0x1fc624),_0x302565&&console['error'](_0x20bf25(0xef)+_0x302565));if(!_0xad14f5['yes']){const _0x3d7018=await confirm(_0x20bf25(0x12f)+_0x1fc624+'?');if(!_0x3d7018)return console['error']('Cancelled'),0x0;}const _0x498b51=await withSpinner(_0x20bf25(0x117),()=>_0x1ab9ef['workflow']['kill'](_0x1fc624,_0x302565),{'verbose':_0xad14f5[_0x20bf25(0x145)]}),_0x2a5d24=_0x498b51[_0x20bf25(0x130)];return console[_0x20bf25(0x119)]('✔\x20'+_0x2a5d24),0x0;}catch(_0x244f53){if(_0x244f53 instanceof SDKError)return console[_0x20bf25(0x119)](_0x20bf25(0x138)+_0x244f53[_0x20bf25(0xf2)]),_0x244f53[_0x20bf25(0x125)]&&console[_0x20bf25(0x119)](_0x20bf25(0x12b)+_0x244f53['cause']),0x1;throw _0x244f53;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x100);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x122);async[a32_0x13ff80(0x148)](_0x3a5c9d){const _0x23fe0c=a32_0x13ff80,{options:_0x4d3ab2,args:_0x56c616,tdx:_0x6ec883}=_0x3a5c9d,_0x35135b=_0x56c616[0x0];if(!_0x35135b)return console[_0x23fe0c(0x119)](_0x23fe0c(0x14a)),console[_0x23fe0c(0x119)](_0x23fe0c(0x143)),0x1;let _0x7c7eb4=![],_0x1c7b4b=_0x35135b;if(_0x35135b[_0x23fe0c(0x108)](_0x23fe0c(0x107)))_0x7c7eb4=!![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else{if(_0x35135b[_0x23fe0c(0x108)]('attempt:'))_0x7c7eb4=![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else return console[_0x23fe0c(0x119)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x53b80f=_0x4d3ab2[_0x23fe0c(0x10a)],_0x26dfd7=_0x4d3ab2['resumeFrom'],_0x4f2d6f=_0x4d3ab2[_0x23fe0c(0x147)],_0xf664e8=_0x4d3ab2['force'];_0x4d3ab2[_0x23fe0c(0x145)]&&(console[_0x23fe0c(0x119)](_0x23fe0c(0xee)+(_0x7c7eb4?'session':_0x23fe0c(0x112))+'\x20'+_0x1c7b4b),_0x53b80f&&console['error'](_0x23fe0c(0x144)+_0x53b80f),_0x26dfd7&&console[_0x23fe0c(0x119)](_0x23fe0c(0xec)+_0x26dfd7),_0x4f2d6f&&console[_0x23fe0c(0x119)](_0x23fe0c(0x12a)+_0x4f2d6f),_0xf664e8&&console[_0x23fe0c(0x119)]('Force:\x20yes'));let _0x529e18;if(_0x4f2d6f)try{if(_0x4f2d6f[_0x23fe0c(0x108)]('@')){const _0x481a5c=await import(_0x23fe0c(0x131)),_0x2032f0=_0x4f2d6f[_0x23fe0c(0x150)](0x1),_0x299c2b=await _0x481a5c[_0x23fe0c(0xea)](_0x2032f0,'utf-8');_0x529e18=JSON['parse'](_0x299c2b);}else _0x529e18=JSON[_0x23fe0c(0x15a)](_0x4f2d6f);}catch{return console[_0x23fe0c(0x119)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4d3ab2[_0x23fe0c(0x14b)]){const _0x3afedf=await confirm(_0x23fe0c(0x134)+(_0x7c7eb4?_0x23fe0c(0x115):_0x23fe0c(0x112))+'\x20'+_0x1c7b4b+'?');if(!_0x3afedf)return console[_0x23fe0c(0x119)](_0x23fe0c(0x11c)),0x0;}let _0x10fa48;_0x7c7eb4?_0x10fa48=await withSpinner('Retrying\x20session...',()=>_0x6ec883[_0x23fe0c(0x155)][_0x23fe0c(0x116)](_0x1c7b4b,{'fromTask':_0x53b80f,'retryParams':_0x529e18}),{'verbose':_0x4d3ab2[_0x23fe0c(0x145)]}):_0x10fa48=await withSpinner('Retrying\x20attempt...',()=>_0x6ec883['workflow'][_0x23fe0c(0x14c)](_0x1c7b4b,{'resumeFrom':_0x26dfd7,'retryParams':_0x529e18,'force':_0xf664e8}),{'verbose':_0x4d3ab2['verbose']});const _0x273fbb=_0x10fa48['data'];return console[_0x23fe0c(0x119)](_0x23fe0c(0x152)),console[_0x23fe0c(0x119)](_0x23fe0c(0x14e)+_0x273fbb[_0x23fe0c(0x101)]),console[_0x23fe0c(0x119)](_0x23fe0c(0xf1)+_0x273fbb[_0x23fe0c(0x169)]),0x0;}catch(_0x3c068a){if(_0x3c068a instanceof SDKError)return console[_0x23fe0c(0x119)](_0x23fe0c(0x138)+_0x3c068a[_0x23fe0c(0xf2)]),_0x3c068a['cause']&&console['error'](_0x23fe0c(0x12b)+_0x3c068a[_0x23fe0c(0x125)]),0x1;throw _0x3c068a;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x13ff80(0x13f);[a32_0x13ff80(0xf4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x13ff80(0x148)](_0x569239){const _0x12cd62=a32_0x13ff80,{options:_0x42c0e7,args:_0xc604cb,tdx:_0x3f3c4a}=_0x569239,_0x2cbfa5=_0xc604cb[0x0],_0x3cce60=_0xc604cb[0x1]||'.';if(!_0x2cbfa5)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x12cd62(0x157)),0x1;const _0x1ad6a7=_0x42c0e7[_0x12cd62(0x159)];_0x42c0e7[_0x12cd62(0x145)]&&(console[_0x12cd62(0x119)](_0x12cd62(0x168)+_0x2cbfa5),console['error'](_0x12cd62(0xf7)+_0x3cce60),_0x1ad6a7&&console['error']('Revision:\x20'+_0x1ad6a7));const _0x30aedd=await withSpinner(_0x12cd62(0xfd)+_0x2cbfa5+_0x12cd62(0xff),()=>_0x3f3c4a[_0x12cd62(0x155)]['download'](_0x2cbfa5,_0x3cce60,{'revision':_0x1ad6a7}),{'verbose':_0x42c0e7[_0x12cd62(0x145)]}),_0x5df2f0=_0x30aedd['data'];return console[_0x12cd62(0x119)]('✔\x20Downloaded\x20'+_0x5df2f0['projectName']),console[_0x12cd62(0x119)]('\x20\x20Revision:\x20'+_0x5df2f0[_0x12cd62(0x159)]),console[_0x12cd62(0x119)](_0x12cd62(0x118)+_0x5df2f0[_0x12cd62(0xfc)]),console[_0x12cd62(0x119)](_0x12cd62(0x166)+_0x3cce60+'/'+_0x5df2f0['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a32_0x13ff80(0x123);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x164);async['execute'](_0x15a28a){const _0x371bde=a32_0x13ff80,{options:_0x292120,args:_0x389934,tdx:_0x553069}=_0x15a28a;let _0xb02b5d='.',_0x301b63=_0x292120[_0x371bde(0x11f)];if(_0x389934[0x0]){const {promises:_0x34381f}=await import('fs');try{const _0x90c398=await _0x34381f[_0x371bde(0xfe)](_0x389934[0x0]);if(_0x90c398['isDirectory']())_0xb02b5d=_0x389934[0x0];else return console[_0x371bde(0x119)](_0x371bde(0x138)+_0x389934[0x0]+_0x371bde(0x13a)),0x1;}catch{_0x301b63=_0x389934[0x0],_0xb02b5d='.';}}const _0x598583=_0x292120['revision'],_0x4d0813=_0x292120[_0x371bde(0x132)];_0x292120[_0x371bde(0x145)]&&(console[_0x371bde(0x119)](_0x371bde(0x135)+_0xb02b5d),_0x301b63&&console[_0x371bde(0x119)](_0x371bde(0x142)+_0x301b63),_0x598583&&console[_0x371bde(0x119)](_0x371bde(0x146)+_0x598583),_0x4d0813&&console['error'](_0x371bde(0x102)));const _0x2ce089=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x553069['workflow']['push'](_0xb02b5d,{'projectName':_0x301b63,'revision':_0x598583,'skipValidation':_0x4d0813}),{'verbose':_0x292120[_0x371bde(0x145)]}),_0x24ec96=_0x2ce089['data'];return console[_0x371bde(0x119)]('✔\x20Pushed\x20'+_0x24ec96[_0x371bde(0x15e)]),console[_0x371bde(0x119)](_0x371bde(0x163)+_0x24ec96[_0x371bde(0x139)]),console[_0x371bde(0x119)]('\x20\x20Revision:\x20'+_0x24ec96['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x13ff80(0x11f)]='workflow:delete';[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x153);async[a32_0x13ff80(0x148)](_0xe45c45){const _0x4193ea=a32_0x13ff80,{options:_0x1518c2,args:_0x1c3784,tdx:_0x4620b9}=_0xe45c45,_0x2804e8=_0x1c3784[0x0];if(!_0x2804e8)return console['error'](_0x4193ea(0x12e)),console[_0x4193ea(0x119)](_0x4193ea(0x14d)),0x1;_0x1518c2[_0x4193ea(0x145)]&&console[_0x4193ea(0x119)]('Project:\x20'+_0x2804e8);if(!_0x1518c2['yes']){const _0x1eb0a5=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2804e8+_0x4193ea(0xf5));if(!_0x1eb0a5)return console[_0x4193ea(0x119)](_0x4193ea(0x11c)),0x0;}const _0x205c8f=await withSpinner(_0x4193ea(0xe8)+_0x2804e8+_0x4193ea(0xff),()=>_0x4620b9[_0x4193ea(0x155)][_0x4193ea(0x13e)](_0x2804e8),{'verbose':_0x1518c2['verbose']}),_0x2bac2a=_0x205c8f[_0x4193ea(0x130)];return console[_0x4193ea(0x119)](_0x4193ea(0x10c)+_0x2bac2a[_0x4193ea(0x15e)]),console[_0x4193ea(0x119)]('\x20\x20Project\x20ID:\x20'+_0x2bac2a[_0x4193ea(0x139)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2baf41,_0x5ec8fb){const _0x5169e1=a33_0x1a44,_0x5ef17e=_0x2baf41();while(!![]){try{const _0x5eeebb=parseInt(_0x5169e1(0xad))/0x1*(-parseInt(_0x5169e1(0xa6))/0x2)+parseInt(_0x5169e1(0xa5))/0x3+-parseInt(_0x5169e1(0xb1))/0x4*(-parseInt(_0x5169e1(0x9e))/0x5)+parseInt(_0x5169e1(0x9b))/0x6*(-parseInt(_0x5169e1(0xae))/0x7)+-parseInt(_0x5169e1(0xa8))/0x8*(parseInt(_0x5169e1(0x9c))/0x9)+-parseInt(_0x5169e1(0x9f))/0xa*(-parseInt(_0x5169e1(0xa9))/0xb)+-parseInt(_0x5169e1(0xb0))/0xc*(-parseInt(_0x5169e1(0xab))/0xd);if(_0x5eeebb===_0x5ec8fb)break;else _0x5ef17e['push'](_0x5ef17e['shift']());}catch(_0x2893d9){_0x5ef17e['push'](_0x5ef17e['shift']());}}}(a33_0x56a7,0xc3047));import{platform}from'os';import{readFileSync}from'fs';function a33_0x1a44(_0x11cb23,_0x152140){const _0x56a7c9=a33_0x56a7();return a33_0x1a44=function(_0x1a4497,_0x4695ed){_0x1a4497=_0x1a4497-0x9a;let _0x2a02a9=_0x56a7c9[_0x1a4497];return _0x2a02a9;},a33_0x1a44(_0x11cb23,_0x152140);}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x2383cb=a33_0x1a44;try{const _0x52947d=fileURLToPath(import.meta[_0x2383cb(0xac)]),_0x190eed=dirname(_0x52947d),_0x2daffb=join(_0x190eed,_0x2383cb(0xa2)),_0x16e93f=JSON[_0x2383cb(0xaf)](readFileSync(_0x2daffb,_0x2383cb(0x9d)));return _0x16e93f[_0x2383cb(0xa3)];}catch{return'0.0.0';}}export function getUserAgent(){const _0x5a37dc=a33_0x1a44,_0x562b61=getVersion(),_0x50b3a9=platform(),_0x16c452=process[_0x5a37dc(0xa3)]['replace']('v','');return _0x5a37dc(0xa7)+_0x562b61+'\x20('+_0x50b3a9+_0x5a37dc(0x9a)+_0x16c452+')';}export function getAuthHeaders(_0x6b9785,_0x2e795f){const _0x964b2c=a33_0x1a44,_0x5bc459=getVersion(),_0x47b04c={'User-Agent':getUserAgent(),'X-TD-Client':_0x964b2c(0xa1),'X-TD-Client-Version':_0x5bc459};return _0x2e795f&&(_0x47b04c['Authorization']=_0x964b2c(0xaa)+_0x2e795f),_0x47b04c;}export function toHeaderRecord(_0x39318f){const _0x59b04d={};for(const [_0x23d16d,_0x7f4b75]of Object['entries'](_0x39318f)){_0x7f4b75!==undefined&&(_0x59b04d[_0x23d16d]=_0x7f4b75);}return _0x59b04d;}function a33_0x56a7(){const _0x5607bd=['104eukGQc','url','647559XArWMk','35uyPKsC','parse','304872vZBKoT','4fCKEfU',';\x20node/','1760370FnSlLG','225lIpENF','utf-8','6823330JpHdUU','1777210LesqkP','Authorization','tdx','../../package.json','version','length','4592217tAHiBt','2eDIyxy','tdx/','457400LihtYY','77UZLgLR','TD1\x20'];a33_0x56a7=function(){return _0x5607bd;};return a33_0x56a7();}export function getTrinoHeaders(_0x2cb3fb,_0x5292d6){const _0x348a6f=a33_0x1a44,_0xe5a9df=getAuthHeaders(_0x2cb3fb,_0x5292d6),_0x6b205d=toHeaderRecord(_0xe5a9df);return delete _0x6b205d[_0x348a6f(0xa0)],_0x5292d6&&(_0x6b205d['X-Trino-User']=_0x5292d6),_0x6b205d;}export function hasAPIKey(_0x476cb6){const _0x366cf7=a33_0x1a44,_0xd16b77=getAPIKey(_0x476cb6);return _0xd16b77!==undefined&&_0xd16b77[_0x366cf7(0xa4)]>0x0;}
1
+ (function(_0x51491f,_0xb6c1a1){const _0x50506a=a33_0x2703,_0x1ab7d0=_0x51491f();while(!![]){try{const _0x202a97=parseInt(_0x50506a(0x74))/0x1+-parseInt(_0x50506a(0x80))/0x2+-parseInt(_0x50506a(0x75))/0x3+parseInt(_0x50506a(0x85))/0x4*(-parseInt(_0x50506a(0x79))/0x5)+parseInt(_0x50506a(0x7b))/0x6+parseInt(_0x50506a(0x7e))/0x7*(parseInt(_0x50506a(0x76))/0x8)+-parseInt(_0x50506a(0x82))/0x9;if(_0x202a97===_0xb6c1a1)break;else _0x1ab7d0['push'](_0x1ab7d0['shift']());}catch(_0x26801d){_0x1ab7d0['push'](_0x1ab7d0['shift']());}}}(a33_0x9b54,0xae672));import{platform}from'os';function a33_0x2703(_0x115401,_0x26ca7d){const _0x9b54aa=a33_0x9b54();return a33_0x2703=function(_0x270388,_0x164471){_0x270388=_0x270388-0x72;let _0x3d5c66=_0x9b54aa[_0x270388];return _0x3d5c66;},a33_0x2703(_0x115401,_0x26ca7d);}import{readFileSync}from'fs';function a33_0x9b54(){const _0x1f5366=['5157576LHGDDH','replace','parse','381724ZQIrAC','TD1\x20','tdx','tdx/','1202956FdSitZ','196674qbYtXs','10875688IYxAEd','version','X-Trino-User','55VOJyhU','../../package.json','789888YeXWWn',';\x20node/','0.0.0','7iPrqpO','entries','582696GiLWyN','Authorization'];a33_0x9b54=function(){return _0x1f5366;};return a33_0x9b54();}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x34a74f=a33_0x2703;try{const _0x23754d=fileURLToPath(import.meta['url']),_0x50f3b7=dirname(_0x23754d),_0x43ac12=join(_0x50f3b7,_0x34a74f(0x7a)),_0x12c26b=JSON[_0x34a74f(0x84)](readFileSync(_0x43ac12,'utf-8'));return _0x12c26b[_0x34a74f(0x77)];}catch{return _0x34a74f(0x7d);}}export function getUserAgent(){const _0x131b69=a33_0x2703,_0x199064=getVersion(),_0x179aa8=platform(),_0x45da9e=process[_0x131b69(0x77)][_0x131b69(0x83)]('v','');return _0x131b69(0x73)+_0x199064+'\x20('+_0x179aa8+_0x131b69(0x7c)+_0x45da9e+')';}export function getAuthHeaders(_0x1fd158,_0x2dd082){const _0x262b1a=a33_0x2703,_0x5eed6e=getVersion(),_0x26d7e2={'User-Agent':getUserAgent(),'X-TD-Client':_0x262b1a(0x72),'X-TD-Client-Version':_0x5eed6e};return _0x2dd082&&(_0x26d7e2[_0x262b1a(0x81)]=_0x262b1a(0x86)+_0x2dd082),_0x26d7e2;}export function toHeaderRecord(_0x1c71e6){const _0x59b7c8=a33_0x2703,_0x160c3c={};for(const [_0x90bbb8,_0x557883]of Object[_0x59b7c8(0x7f)](_0x1c71e6)){_0x557883!==undefined&&(_0x160c3c[_0x90bbb8]=_0x557883);}return _0x160c3c;}export function getTrinoHeaders(_0xe12c77,_0x50ea2){const _0x55e0e2=a33_0x2703,_0x4bd014=getAuthHeaders(_0xe12c77,_0x50ea2),_0x2b66f3=toHeaderRecord(_0x4bd014);return delete _0x2b66f3['Authorization'],_0x50ea2&&(_0x2b66f3[_0x55e0e2(0x78)]=_0x50ea2),_0x2b66f3;}export function hasAPIKey(_0x3bcda8){const _0x2dffc4=getAPIKey(_0x3bcda8);return _0x2dffc4!==undefined&&_0x2dffc4['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x1a39b9,_0x3a85a9){const _0x55af88=a34_0x953f,_0x38370a=_0x1a39b9();while(!![]){try{const _0xc886b6=parseInt(_0x55af88(0x10f))/0x1+-parseInt(_0x55af88(0x106))/0x2+parseInt(_0x55af88(0x108))/0x3+parseInt(_0x55af88(0x12f))/0x4+parseInt(_0x55af88(0x11a))/0x5+-parseInt(_0x55af88(0x117))/0x6*(-parseInt(_0x55af88(0x12d))/0x7)+-parseInt(_0x55af88(0x12a))/0x8;if(_0xc886b6===_0x3a85a9)break;else _0x38370a['push'](_0x38370a['shift']());}catch(_0x1d0ca9){_0x38370a['push'](_0x38370a['shift']());}}}(a34_0x6ac8,0x9cd7b));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x5e00a2 from'node:fs';import*as a34_0x475eb8 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x3f62fb=a34_0x953f;return process[_0x3f62fb(0x138)][_0x3f62fb(0x122)]||join(homedir(),_0x3f62fb(0x119),_0x3f62fb(0x136));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x192bcb=a34_0x953f;return process[_0x192bcb(0x138)][_0x192bcb(0x10d)]||join(homedir(),_0x192bcb(0x12e),'tdx');}export function getLLMProjectCacheFile(){const _0x189ebe=a34_0x953f;return join(getCacheDir(),_0x189ebe(0x11c));}export function readCachedLLMProject(){const _0x44bbe2=a34_0x953f;try{const _0x28cfb7=getLLMProjectCacheFile();if(!existsSync(_0x28cfb7))return null;return readFileSync(_0x28cfb7,_0x44bbe2(0x109))[_0x44bbe2(0x114)]();}catch{return null;}}export function writeCachedLLMProject(_0x184554){const _0xf4d523=a34_0x953f;try{const _0x52e49d=getCacheDir(),_0x2cadab=getLLMProjectCacheFile();!existsSync(_0x52e49d)&&mkdirSync(_0x52e49d,{'recursive':!![]}),writeFileSync(_0x2cadab,_0x184554,_0xf4d523(0x109));}catch(_0x1bd78f){console[_0xf4d523(0x113)](_0xf4d523(0x123),_0x1bd78f);}}function a34_0x953f(_0x443e26,_0x47514b){const _0x6ac8d=a34_0x6ac8();return a34_0x953f=function(_0x953fc4,_0x9cd24f){_0x953fc4=_0x953fc4-0x105;let _0x227730=_0x6ac8d[_0x953fc4];return _0x227730;},a34_0x953f(_0x443e26,_0x47514b);}export function parseEnvFile(_0x458db4){const _0x10cd8c=a34_0x953f,_0x2531b1={};for(const _0x285cee of _0x458db4[_0x10cd8c(0x110)]('\x0a')){const _0x400afb=_0x285cee[_0x10cd8c(0x114)]();if(!_0x400afb||_0x400afb['startsWith']('#'))continue;const _0x22c2a7=_0x400afb[_0x10cd8c(0x11b)](/^([^=]+)=(.*)$/);if(_0x22c2a7){const _0x5162c2=_0x22c2a7[0x1][_0x10cd8c(0x114)]();let _0x54c988=_0x22c2a7[0x2][_0x10cd8c(0x114)]();(_0x54c988[_0x10cd8c(0x124)]('\x22')&&_0x54c988[_0x10cd8c(0x105)]('\x22')||_0x54c988[_0x10cd8c(0x124)]('\x27')&&_0x54c988[_0x10cd8c(0x105)]('\x27'))&&(_0x54c988=_0x54c988[_0x10cd8c(0x118)](0x1,-0x1)),_0x2531b1[_0x5162c2]=_0x54c988;}}return _0x2531b1;}export function readUserConfig(){const _0x41214c=a34_0x953f,_0xd2fbc4=getConfigFile();if(!existsSync(_0xd2fbc4))return{};try{const _0x24b7d9=readFileSync(_0xd2fbc4,'utf-8');return parseEnvFile(_0x24b7d9);}catch(_0x4c4bce){return console[_0x41214c(0x10a)](_0x41214c(0x134)+_0xd2fbc4+':',_0x4c4bce),{};}}export function resolveSite(_0x1f99bb){const _0x2ebfe0=a34_0x953f,_0x133c7a=[_0x2ebfe0(0x121),'jp01',_0x2ebfe0(0x139),'ap02',_0x2ebfe0(0x111),_0x2ebfe0(0x131),_0x2ebfe0(0x130),_0x2ebfe0(0x126),_0x2ebfe0(0x132),'stg-ap03'];if(_0x133c7a[_0x2ebfe0(0x10e)](_0x1f99bb))return _0x1f99bb;if(_0x1f99bb in SITE_ALIASES)return SITE_ALIASES[_0x1f99bb];return console[_0x2ebfe0(0x10a)](_0x2ebfe0(0x107)+_0x1f99bb+_0x2ebfe0(0x115)),_0x2ebfe0(0x121);}let cachedUserConfig=null;function a34_0x6ac8(){const _0x5771bf=['TDX_CONFIG_DIR','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','startsWith','global:\x20','stg-us01','Warning:\x20Failed\x20to\x20load\x20','map','ap02','31703056xSjVtq','TD_API_KEY_','toUpperCase','36092mFFGIy','.cache','4176784jmDrNC','dev-eu01','dev-us01','stg-jp01','stg-ap03','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','apiKeys','tdx','env:\x20TD_API_KEY','env','eu01','TD_API_KEY','endsWith','338554FbIOmn','Warning:\x20Unknown\x20site\x20\x27','3597555zJDqeW','utf-8','warn','existsSync','readFileSync','TDX_CACHE_DIR','includes','138491FaVFUv','split','ap03','replace','error','trim','\x27,\x20defaulting\x20to\x20us01','\x20(TD_API_KEY)','1374yonhZD','slice','.config','6059950KPkWPB','match','llm_default_project','tdx.json','jp01','join','profile:\x20','us01'];a34_0x6ac8=function(){return _0x5771bf;};return a34_0x6ac8();}export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2bd9e1,_0x3919c4){const _0x53641b=a34_0x953f,_0x122590=_0x2bd9e1[_0x53641b(0x12c)]()[_0x53641b(0x112)](/-/g,'_'),_0x14c034=_0x53641b(0x12b)+_0x122590;if(process['env'][_0x14c034])return process['env'][_0x14c034];if(process[_0x53641b(0x138)][_0x53641b(0x13a)])return process[_0x53641b(0x138)][_0x53641b(0x13a)];const _0x32a2b0=_0x3919c4||getActiveProfileName();if(_0x32a2b0){const _0x5e7ba6=loadProfileEnv(_0x32a2b0);if(_0x5e7ba6){if(_0x5e7ba6[_0x14c034])return _0x5e7ba6[_0x14c034];if(_0x5e7ba6[_0x53641b(0x13a)])return _0x5e7ba6[_0x53641b(0x13a)];}}const _0x3f499f=loadUserConfigOnce();if(_0x3f499f[_0x14c034])return _0x3f499f[_0x14c034];if(_0x3f499f[_0x53641b(0x13a)])return _0x3f499f[_0x53641b(0x13a)];return undefined;}export function getAPIKeySource(_0x19e522,_0x2793fd){const _0x333012=a34_0x953f,_0x568da1=_0x333012(0x12b)+_0x19e522['toUpperCase']()[_0x333012(0x112)](/-/g,'_');if(process['env'][_0x568da1])return'env:\x20'+_0x568da1;if(process[_0x333012(0x138)][_0x333012(0x13a)])return _0x333012(0x137);const _0x6bc6c4=_0x2793fd||getActiveProfileName();if(_0x6bc6c4){const _0x114fef=loadProfileEnv(_0x6bc6c4);if(_0x114fef){if(_0x114fef[_0x568da1])return _0x333012(0x120)+_0x6bc6c4+'\x20('+_0x568da1+')';if(_0x114fef['TD_API_KEY'])return _0x333012(0x120)+_0x6bc6c4+_0x333012(0x116);}}const _0x1b2879=loadUserConfigOnce(),_0x2cf826=getConfigFile();if(_0x1b2879[_0x568da1])return _0x333012(0x125)+_0x2cf826+'\x20('+_0x568da1+')';if(_0x1b2879['TD_API_KEY'])return _0x333012(0x125)+_0x2cf826+_0x333012(0x116);return null;}function loadProfileEnv(_0xd29de0){const _0x40edfc=a34_0x953f,_0x52360e=a34_0x475eb8[_0x40edfc(0x11f)](getConfigDir(),'.env.'+_0xd29de0);if(a34_0x5e00a2['existsSync'](_0x52360e)){validateSecureFilePermissions(_0x52360e);try{const _0x2b042a=a34_0x5e00a2[_0x40edfc(0x10c)](_0x52360e,'utf-8');return parseEnvFile(_0x2b042a);}catch(_0x148149){console[_0x40edfc(0x10a)](_0x40edfc(0x127)+_0x52360e+':\x20'+_0x148149);}}const _0x2c1fb7=a34_0x475eb8[_0x40edfc(0x11f)](getConfigDir(),'profiles',_0xd29de0,'.env');if(a34_0x5e00a2[_0x40edfc(0x10b)](_0x2c1fb7)){validateSecureFilePermissions(_0x2c1fb7);try{const _0x14447e=a34_0x5e00a2[_0x40edfc(0x10c)](_0x2c1fb7,'utf-8');return parseEnvFile(_0x14447e);}catch(_0x1fbe7e){return console['warn'](_0x40edfc(0x127)+_0x2c1fb7+':\x20'+_0x1fbe7e),null;}}return null;}function getActiveProfileName(){const _0x10f38d=a34_0x953f,_0x56b597=a34_0x475eb8[_0x10f38d(0x11f)](getConfigDir(),_0x10f38d(0x11d));if(!a34_0x5e00a2[_0x10f38d(0x10b)](_0x56b597))return null;try{const _0x208699=a34_0x5e00a2['readFileSync'](_0x56b597,_0x10f38d(0x109)),_0x26d7fd=JSON['parse'](_0x208699);return _0x26d7fd['profile']||null;}catch{return null;}}export function saveAPIKey(_0x37da66,_0x323d04){const _0x51fa4f=a34_0x953f,_0x1a8730=getConfigDir(),_0x4861aa=getConfigFile();!existsSync(_0x1a8730)&&mkdirSync(_0x1a8730,{'recursive':!![],'mode':0x1c0});const _0x508001=readUserConfig(),_0x3e857b=_0x37da66['toUpperCase']()[_0x51fa4f(0x112)](/-/g,'_');_0x508001[_0x51fa4f(0x12b)+_0x3e857b]=_0x323d04;const _0x3d3d5d=Object['entries'](_0x508001)[_0x51fa4f(0x128)](([_0x2e6af9,_0x370cc0])=>_0x2e6af9+'='+_0x370cc0);writeFileSync(_0x4861aa,_0x3d3d5d['join']('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x251264=a34_0x953f,_0x129c4f={'apiKeys':{},'defaultSite':'us01'},_0x5ecb63=['us01',_0x251264(0x11e),_0x251264(0x139),_0x251264(0x129),_0x251264(0x111),_0x251264(0x131),_0x251264(0x130),_0x251264(0x126),_0x251264(0x132),_0x251264(0x133)];for(const _0x9108a7 of _0x5ecb63){const _0x3e13d0=getAPIKey(_0x9108a7);_0x3e13d0&&(_0x129c4f[_0x251264(0x135)][_0x9108a7]=_0x3e13d0);}return _0x129c4f;}
1
+ (function(_0x256c06,_0x26f134){const _0x15e2bf=a34_0x5b66,_0x19a156=_0x256c06();while(!![]){try{const _0x766012=-parseInt(_0x15e2bf(0x12f))/0x1+parseInt(_0x15e2bf(0x123))/0x2+-parseInt(_0x15e2bf(0x107))/0x3+-parseInt(_0x15e2bf(0x10d))/0x4*(-parseInt(_0x15e2bf(0x10a))/0x5)+-parseInt(_0x15e2bf(0x11d))/0x6+-parseInt(_0x15e2bf(0x11e))/0x7*(-parseInt(_0x15e2bf(0x132))/0x8)+parseInt(_0x15e2bf(0x115))/0x9;if(_0x766012===_0x26f134)break;else _0x19a156['push'](_0x19a156['shift']());}catch(_0x497d6a){_0x19a156['push'](_0x19a156['shift']());}}}(a34_0x348d,0xab8a3));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0xf7e83b from'node:fs';import*as a34_0x4e978a from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x38b679=a34_0x5b66;return process[_0x38b679(0x10b)][_0x38b679(0x119)]||join(homedir(),_0x38b679(0x12a),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x46d0f9=a34_0x5b66;return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x46d0f9(0x105));}export function getLLMProjectCacheFile(){const _0x3dd226=a34_0x5b66;return join(getCacheDir(),_0x3dd226(0x116));}export function readCachedLLMProject(){const _0x4da9ff=a34_0x5b66;try{const _0x4c7494=getLLMProjectCacheFile();if(!existsSync(_0x4c7494))return null;return readFileSync(_0x4c7494,_0x4da9ff(0x114))[_0x4da9ff(0x12b)]();}catch{return null;}}export function writeCachedLLMProject(_0xe0c000){const _0x373dbc=a34_0x5b66;try{const _0x11a915=getCacheDir(),_0x168eaa=getLLMProjectCacheFile();!existsSync(_0x11a915)&&mkdirSync(_0x11a915,{'recursive':!![]}),writeFileSync(_0x168eaa,_0xe0c000,_0x373dbc(0x114));}catch(_0x78577a){console[_0x373dbc(0x121)](_0x373dbc(0x10f),_0x78577a);}}export function parseEnvFile(_0x563a69){const _0x238d18=a34_0x5b66,_0xb9a35={};for(const _0x1b1eb0 of _0x563a69[_0x238d18(0x136)]('\x0a')){const _0x58a6aa=_0x1b1eb0[_0x238d18(0x12b)]();if(!_0x58a6aa||_0x58a6aa[_0x238d18(0x10e)]('#'))continue;const _0x4b46e6=_0x58a6aa[_0x238d18(0x11c)](/^([^=]+)=(.*)$/);if(_0x4b46e6){const _0x283953=_0x4b46e6[0x1][_0x238d18(0x12b)]();let _0x285347=_0x4b46e6[0x2][_0x238d18(0x12b)]();(_0x285347[_0x238d18(0x10e)]('\x22')&&_0x285347[_0x238d18(0x125)]('\x22')||_0x285347[_0x238d18(0x10e)]('\x27')&&_0x285347[_0x238d18(0x125)]('\x27'))&&(_0x285347=_0x285347[_0x238d18(0x120)](0x1,-0x1)),_0xb9a35[_0x283953]=_0x285347;}}return _0xb9a35;}export function readUserConfig(){const _0x300db6=a34_0x5b66,_0x222d28=getConfigFile();if(!existsSync(_0x222d28))return{};try{const _0x5c9798=readFileSync(_0x222d28,'utf-8');return parseEnvFile(_0x5c9798);}catch(_0x3243a0){return console[_0x300db6(0x118)](_0x300db6(0x124)+_0x222d28+':',_0x3243a0),{};}}export function resolveSite(_0x3493d3){const _0x3d76a4=a34_0x5b66,_0x38120a=[_0x3d76a4(0x101),_0x3d76a4(0x108),_0x3d76a4(0x117),_0x3d76a4(0x104),_0x3d76a4(0x100),_0x3d76a4(0x12e),_0x3d76a4(0x11a),_0x3d76a4(0x110),_0x3d76a4(0x10c),_0x3d76a4(0x134)];if(_0x38120a[_0x3d76a4(0x103)](_0x3493d3))return _0x3493d3;if(_0x3493d3 in SITE_ALIASES)return SITE_ALIASES[_0x3493d3];return console[_0x3d76a4(0x118)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3493d3+'\x27,\x20defaulting\x20to\x20us01'),_0x3d76a4(0x101);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3857fc,_0x47247e){const _0x1a421e=a34_0x5b66,_0x1aaefa=_0x3857fc[_0x1a421e(0x11f)]()[_0x1a421e(0x11b)](/-/g,'_'),_0x3019da=_0x1a421e(0x111)+_0x1aaefa;if(process[_0x1a421e(0x10b)][_0x3019da])return process['env'][_0x3019da];if(process['env'][_0x1a421e(0x128)])return process['env'][_0x1a421e(0x128)];const _0x1cbdd1=_0x47247e||getActiveProfileName();if(_0x1cbdd1){const _0x2bf240=loadProfileEnv(_0x1cbdd1);if(_0x2bf240){if(_0x2bf240[_0x3019da])return _0x2bf240[_0x3019da];if(_0x2bf240[_0x1a421e(0x128)])return _0x2bf240['TD_API_KEY'];}}const _0x19a71d=loadUserConfigOnce();if(_0x19a71d[_0x3019da])return _0x19a71d[_0x3019da];if(_0x19a71d[_0x1a421e(0x128)])return _0x19a71d[_0x1a421e(0x128)];return undefined;}export function getAPIKeySource(_0xc02085,_0x2a4c0b){const _0x57f580=a34_0x5b66,_0x48750e=_0x57f580(0x111)+_0xc02085[_0x57f580(0x11f)]()[_0x57f580(0x11b)](/-/g,'_');if(process['env'][_0x48750e])return _0x57f580(0x109)+_0x48750e;if(process[_0x57f580(0x10b)]['TD_API_KEY'])return _0x57f580(0x12d);const _0x2befb9=_0x2a4c0b||getActiveProfileName();if(_0x2befb9){const _0x30b12c=loadProfileEnv(_0x2befb9);if(_0x30b12c){if(_0x30b12c[_0x48750e])return _0x57f580(0x102)+_0x2befb9+'\x20('+_0x48750e+')';if(_0x30b12c[_0x57f580(0x128)])return _0x57f580(0x102)+_0x2befb9+_0x57f580(0x112);}}const _0x9b2f2d=loadUserConfigOnce(),_0x284982=getConfigFile();if(_0x9b2f2d[_0x48750e])return _0x57f580(0x122)+_0x284982+'\x20('+_0x48750e+')';if(_0x9b2f2d[_0x57f580(0x128)])return _0x57f580(0x122)+_0x284982+'\x20(TD_API_KEY)';return null;}function loadProfileEnv(_0x596582){const _0x3cfee5=a34_0x5b66,_0x437bbb=a34_0x4e978a['join'](getConfigDir(),_0x3cfee5(0x129)+_0x596582);if(a34_0xf7e83b['existsSync'](_0x437bbb)){validateSecureFilePermissions(_0x437bbb);try{const _0x3a9e9c=a34_0xf7e83b[_0x3cfee5(0x131)](_0x437bbb,_0x3cfee5(0x114));return parseEnvFile(_0x3a9e9c);}catch(_0x410032){console[_0x3cfee5(0x118)](_0x3cfee5(0x12c)+_0x437bbb+':\x20'+_0x410032);}}const _0x388db0=a34_0x4e978a[_0x3cfee5(0x135)](getConfigDir(),_0x3cfee5(0x113),_0x596582,'.env');if(a34_0xf7e83b[_0x3cfee5(0x130)](_0x388db0)){validateSecureFilePermissions(_0x388db0);try{const _0x3238c8=a34_0xf7e83b[_0x3cfee5(0x131)](_0x388db0,'utf-8');return parseEnvFile(_0x3238c8);}catch(_0x2da45a){return console[_0x3cfee5(0x118)](_0x3cfee5(0x12c)+_0x388db0+':\x20'+_0x2da45a),null;}}return null;}function getActiveProfileName(){const _0x2e712d=a34_0x5b66,_0x59e967=a34_0x4e978a['join'](getConfigDir(),'tdx.json');if(!a34_0xf7e83b[_0x2e712d(0x130)](_0x59e967))return null;try{const _0x106592=a34_0xf7e83b[_0x2e712d(0x131)](_0x59e967,'utf-8'),_0x5b80a3=JSON[_0x2e712d(0x106)](_0x106592);return _0x5b80a3[_0x2e712d(0x127)]||null;}catch{return null;}}export function saveAPIKey(_0x1e7bd7,_0x575ce4){const _0x11697e=a34_0x5b66,_0x51c664=getConfigDir(),_0x3242a7=getConfigFile();!existsSync(_0x51c664)&&mkdirSync(_0x51c664,{'recursive':!![],'mode':0x1c0});const _0x1b118c=readUserConfig(),_0x30f4ea=_0x1e7bd7[_0x11697e(0x11f)]()[_0x11697e(0x11b)](/-/g,'_');_0x1b118c[_0x11697e(0x111)+_0x30f4ea]=_0x575ce4;const _0x3518e3=Object['entries'](_0x1b118c)[_0x11697e(0x126)](([_0x433ad8,_0x11b2bd])=>_0x433ad8+'='+_0x11b2bd);writeFileSync(_0x3242a7,_0x3518e3['join']('\x0a')+'\x0a',{'mode':0x180});}function a34_0x5b66(_0x303428,_0x22c55f){const _0x348d20=a34_0x348d();return a34_0x5b66=function(_0x5b6623,_0x16ecf5){_0x5b6623=_0x5b6623-0x100;let _0x188893=_0x348d20[_0x5b6623];return _0x188893;},a34_0x5b66(_0x303428,_0x22c55f);}export function loadConfig(){const _0x3bf834=a34_0x5b66,_0x43462e={'apiKeys':{},'defaultSite':_0x3bf834(0x101)},_0x338dc6=[_0x3bf834(0x101),_0x3bf834(0x108),_0x3bf834(0x117),_0x3bf834(0x104),'ap03','dev-us01',_0x3bf834(0x11a),_0x3bf834(0x110),_0x3bf834(0x10c),_0x3bf834(0x134)];for(const _0x47064c of _0x338dc6){const _0x2ff546=getAPIKey(_0x47064c);_0x2ff546&&(_0x43462e[_0x3bf834(0x133)][_0x47064c]=_0x2ff546);}return _0x43462e;}function a34_0x348d(){const _0x28bd5d=['existsSync','readFileSync','38992nlpOfB','apiKeys','stg-ap03','join','split','ap03','us01','profile:\x20','includes','ap02','tdx','parse','4157544FCdcie','jp01','env:\x20','85sQTjvd','env','stg-jp01','45804WRIzRr','startsWith','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','stg-us01','TD_API_KEY_','\x20(TD_API_KEY)','profiles','utf-8','15238737pEqPEf','llm_default_project','eu01','warn','TDX_CONFIG_DIR','dev-eu01','replace','match','5990292BJreIV','1603ncJtUI','toUpperCase','slice','error','global:\x20','2777608CyleiC','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','endsWith','map','profile','TD_API_KEY','.env.','.config','trim','Warning:\x20Failed\x20to\x20load\x20','env:\x20TD_API_KEY','dev-us01','1305953MaaywJ'];a34_0x348d=function(){return _0x28bd5d;};return a34_0x348d();}
@@ -1 +1 @@
1
- const a35_0x1c7d33=a35_0x11e1;function a35_0x11e1(_0x3469cf,_0x46c4a1){const _0x446b7d=a35_0x446b();return a35_0x11e1=function(_0x11e1fe,_0x23bd4b){_0x11e1fe=_0x11e1fe-0x79;let _0x3bba6d=_0x446b7d[_0x11e1fe];return _0x3bba6d;},a35_0x11e1(_0x3469cf,_0x46c4a1);}(function(_0x1cb943,_0x4d11b6){const _0x59a84c=a35_0x11e1,_0x4b686f=_0x1cb943();while(!![]){try{const _0x1b6fec=parseInt(_0x59a84c(0xb5))/0x1*(-parseInt(_0x59a84c(0x88))/0x2)+parseInt(_0x59a84c(0x7d))/0x3*(parseInt(_0x59a84c(0xaa))/0x4)+-parseInt(_0x59a84c(0x7f))/0x5*(parseInt(_0x59a84c(0xa5))/0x6)+parseInt(_0x59a84c(0xb4))/0x7+parseInt(_0x59a84c(0xab))/0x8*(-parseInt(_0x59a84c(0xb1))/0x9)+parseInt(_0x59a84c(0x8c))/0xa+parseInt(_0x59a84c(0xaf))/0xb;if(_0x1b6fec===_0x4d11b6)break;else _0x4b686f['push'](_0x4b686f['shift']());}catch(_0x135cdd){_0x4b686f['push'](_0x4b686f['shift']());}}}(a35_0x446b,0x5e141));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';import{loadSessionContext}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x58984e from'node:fs';import*as a35_0x22a422 from'node:path';export class GlobalContext{[a35_0x1c7d33(0x85)];['database'];[a35_0x1c7d33(0x91)];[a35_0x1c7d33(0xb9)];[a35_0x1c7d33(0x89)];[a35_0x1c7d33(0x9e)];['verbose'];[a35_0x1c7d33(0xa0)];[a35_0x1c7d33(0x80)];[a35_0x1c7d33(0x94)];[a35_0x1c7d33(0x95)];constructor(_0x4250fe){const _0x5f5c6d=a35_0x1c7d33;this[_0x5f5c6d(0x94)]=_0x4250fe[_0x5f5c6d(0x8d)]||process[_0x5f5c6d(0x9f)][_0x5f5c6d(0xa8)]();const _0x32896d=loadSessionContext(_0x4250fe['session']),_0x1cba4c=loadProjectConfig(),_0x7610a8=this[_0x5f5c6d(0xb2)]();this[_0x5f5c6d(0x80)]=_0x4250fe[_0x5f5c6d(0xb0)]||_0x32896d?.['profile']||_0x7610a8[_0x5f5c6d(0xb0)]||getActiveProfile();const _0x1eb2cc=this[_0x5f5c6d(0x80)]?loadProfile(this[_0x5f5c6d(0x80)]):null,_0x425724=_0x55943d=>{const _0x5cd137=_0x5f5c6d;if(!_0x55943d)return{};const _0xcc2de2=_0x55943d,_0x562256={};for(const [_0xaf34e,_0x2e4eaa]of Object[_0x5cd137(0x97)](_0xcc2de2)){typeof _0x2e4eaa===_0x5cd137(0xa9)&&(_0x562256[_0xaf34e]=_0x2e4eaa);}return _0x562256;},_0x23c2e9={};if(_0x4250fe[_0x5f5c6d(0x85)]&&_0x4250fe[_0x5f5c6d(0x85)]!=='us01')_0x23c2e9[_0x5f5c6d(0x85)]=_0x4250fe[_0x5f5c6d(0x85)];const _0x5e6aed=_0x32896d?.[_0x5f5c6d(0xa4)],_0x3f79b9=_0x1cba4c?.['database'],_0x5f588d=_0x1eb2cc?.[_0x5f5c6d(0xae)]?.[_0x5f5c6d(0xa4)],_0x2719c3=_0x7610a8['database'];_0x4250fe[_0x5f5c6d(0xa4)]&&(_0x4250fe[_0x5f5c6d(0xa4)]!==_0x5e6aed&&_0x4250fe['database']!==_0x3f79b9&&_0x4250fe[_0x5f5c6d(0xa4)]!==_0x5f588d&&_0x4250fe[_0x5f5c6d(0xa4)]!==_0x2719c3)&&(_0x23c2e9[_0x5f5c6d(0xa4)]=_0x4250fe[_0x5f5c6d(0xa4)]);if(_0x4250fe[_0x5f5c6d(0xb3)])_0x23c2e9[_0x5f5c6d(0x91)]=_0x4250fe['parentSegment'];if(_0x4250fe[_0x5f5c6d(0x8a)])_0x23c2e9[_0x5f5c6d(0x89)]=_0x4250fe['llmProject'];if(_0x4250fe[_0x5f5c6d(0xb0)])_0x23c2e9[_0x5f5c6d(0xb0)]=_0x4250fe[_0x5f5c6d(0xb0)];this[_0x5f5c6d(0xa0)]={'cliFlags':_0x23c2e9,'session':_0x425724(_0x32896d),'project':_0x425724(_0x1cba4c),'profile':_0x425724(_0x1eb2cc?.['config']),'global':_0x425724(_0x7610a8)};const _0x235fb9={...this[_0x5f5c6d(0xa0)][_0x5f5c6d(0xa1)],...this[_0x5f5c6d(0xa0)][_0x5f5c6d(0xb0)],...this[_0x5f5c6d(0xa0)][_0x5f5c6d(0x83)],...this[_0x5f5c6d(0xa0)]['session'],...this[_0x5f5c6d(0xa0)]['cliFlags']},_0x2ba0d0=_0x235fb9['site']||_0x5f5c6d(0x99);this['site']=resolveSite(_0x2ba0d0),this[_0x5f5c6d(0xa4)]=_0x235fb9[_0x5f5c6d(0xa4)],this[_0x5f5c6d(0x91)]=_0x235fb9[_0x5f5c6d(0x91)],this[_0x5f5c6d(0xb9)]=_0x235fb9[_0x5f5c6d(0xb9)],this['llm_project']=_0x235fb9[_0x5f5c6d(0x89)],this[_0x5f5c6d(0x84)]=_0x4250fe[_0x5f5c6d(0x84)]||![],this[_0x5f5c6d(0x9e)]=getAPIKey(this[_0x5f5c6d(0x85)],this[_0x5f5c6d(0x80)]||undefined);const _0x458b64=getConfigDir(),_0x17cf45=a35_0x22a422['join'](_0x458b64,_0x5f5c6d(0xba),this['sessionId']+_0x5f5c6d(0xb6)),_0x44442f=findProjectConfigPath(),_0x5184bd=a35_0x22a422['join'](_0x458b64,'tdx.json'),_0x26d07a=a35_0x22a422['join'](_0x458b64,_0x5f5c6d(0x81));let _0x5eb945=null,_0x3d9977=null;this[_0x5f5c6d(0x80)]&&(_0x5eb945=a35_0x22a422[_0x5f5c6d(0x7b)](_0x458b64,_0x5f5c6d(0xa3),this['activeProfile'],_0x5f5c6d(0x9c)),_0x3d9977=a35_0x22a422[_0x5f5c6d(0x7b)](_0x458b64,_0x5f5c6d(0xa3),this[_0x5f5c6d(0x80)],_0x5f5c6d(0x81))),this[_0x5f5c6d(0x95)]={'session':a35_0x58984e[_0x5f5c6d(0x7c)](_0x17cf45)?_0x17cf45:null,'project':_0x44442f,'profile':_0x5eb945&&a35_0x58984e['existsSync'](_0x5eb945)?_0x5eb945:null,'profileCredentials':_0x3d9977&&a35_0x58984e[_0x5f5c6d(0x7c)](_0x3d9977)?_0x3d9977:null,'global':a35_0x58984e[_0x5f5c6d(0x7c)](_0x5184bd)?_0x5184bd:null,'globalCredentials':a35_0x58984e[_0x5f5c6d(0x7c)](_0x26d07a)?_0x26d07a:null};}['getSource'](_0x2d9b8e,_0x335439){const _0x1c4bbd=a35_0x1c7d33;if(!_0x335439)return _0x1c4bbd(0x93);const _0x43ba4d=_0x335439;if(this[_0x1c4bbd(0xa0)][_0x1c4bbd(0x96)][_0x2d9b8e]===_0x43ba4d){if(_0x2d9b8e===_0x1c4bbd(0x85)&&_0x43ba4d===_0x1c4bbd(0x99)&&!this[_0x1c4bbd(0xa0)][_0x1c4bbd(0x8d)][_0x1c4bbd(0x85)]&&!this[_0x1c4bbd(0xa0)][_0x1c4bbd(0x83)][_0x1c4bbd(0x85)]&&!this['layers'][_0x1c4bbd(0xb0)][_0x1c4bbd(0x85)]&&!this['layers'][_0x1c4bbd(0xa1)][_0x1c4bbd(0x85)])return'default';return _0x1c4bbd(0xb8)+_0x2d9b8e[_0x1c4bbd(0x7e)](/_/g,'-');}if(this['layers'][_0x1c4bbd(0x8d)][_0x2d9b8e]===_0x43ba4d)return _0x1c4bbd(0x8d);if(this['layers'][_0x1c4bbd(0x83)][_0x2d9b8e]===_0x43ba4d)return'project';if(this[_0x1c4bbd(0xa0)]['profile'][_0x2d9b8e]===_0x43ba4d)return'profile:\x20'+this['activeProfile'];if(this[_0x1c4bbd(0xa0)][_0x1c4bbd(0xa1)][_0x2d9b8e]===_0x43ba4d)return _0x1c4bbd(0xa1);return'default';}['loadGlobalConfig'](){const _0xc01289=a35_0x1c7d33,_0x5ba792=a35_0x22a422[_0xc01289(0x7b)](getConfigDir(),'tdx.json');if(!a35_0x58984e[_0xc01289(0x7c)](_0x5ba792))return{};try{const _0x301679=a35_0x58984e[_0xc01289(0x8f)](_0x5ba792,'utf-8');return JSON['parse'](_0x301679);}catch{return{};}}[a35_0x1c7d33(0x98)](_0x3b4714){const _0x22b742=a35_0x1c7d33;_0x3b4714['site']=this[_0x22b742(0x85)],!_0x3b4714['database']&&this[_0x22b742(0xa4)]&&(_0x3b4714['database']=this[_0x22b742(0xa4)]),!_0x3b4714[_0x22b742(0xb3)]&&this[_0x22b742(0x91)]&&(_0x3b4714[_0x22b742(0xb3)]=this[_0x22b742(0x91)]),!_0x3b4714['segmentPath']&&this[_0x22b742(0xb9)]&&(_0x3b4714[_0x22b742(0x8e)]=this[_0x22b742(0xb9)]),!_0x3b4714[_0x22b742(0x8a)]&&this['llm_project']&&(_0x3b4714[_0x22b742(0x8a)]=this[_0x22b742(0x89)]);}[a35_0x1c7d33(0x7a)](){const _0x586101=a35_0x1c7d33;return[{'key':_0x586101(0x85),'value':this[_0x586101(0x85)]},{'key':_0x586101(0xa4),'value':this[_0x586101(0xa4)]},{'key':_0x586101(0x91),'value':this[_0x586101(0x91)]},{'key':'segment_path','value':this['segment_path']},{'key':_0x586101(0x89),'value':this['llm_project']},{'key':_0x586101(0xb0),'value':this[_0x586101(0x80)]||undefined}];}[a35_0x1c7d33(0x82)](){const _0x52856b=a35_0x1c7d33;console[_0x52856b(0x92)](_0x52856b(0x87));for(const {key:_0x42dc89,value:_0x4bc526}of this['getParameters']()){_0x4bc526&&console['log'](_0x42dc89+':\x20'+_0x4bc526);}}[a35_0x1c7d33(0xa7)](){const _0x58b0c2=a35_0x1c7d33;console[_0x58b0c2(0x92)](_0x58b0c2(0x87));for(const {key:_0x2d0775,value:_0x424ae4}of this[_0x58b0c2(0x7a)]()){if(_0x424ae4){const _0x532bbc=_0x2d0775===_0x58b0c2(0xb0)?_0x58b0c2(0xac):'('+this[_0x58b0c2(0xa6)](_0x2d0775,_0x424ae4)+')';console[_0x58b0c2(0x92)](_0x2d0775+':\x20'+_0x424ae4+'\x20'+_0x532bbc);}}console['log'](_0x58b0c2(0xad));const _0x7935e0=[{'label':'Session','path':this[_0x58b0c2(0x95)][_0x58b0c2(0x8d)],'extra':_0x58b0c2(0x8b)+this[_0x58b0c2(0x94)]+')'},{'label':_0x58b0c2(0x90),'path':this['configFiles']['project']},{'label':'Profile','path':this[_0x58b0c2(0x95)][_0x58b0c2(0xb0)]},{'label':_0x58b0c2(0x9a),'path':this[_0x58b0c2(0x95)][_0x58b0c2(0xa2)]},{'label':_0x58b0c2(0x86),'path':this['configFiles'][_0x58b0c2(0xa1)]},{'label':_0x58b0c2(0x9b),'path':this[_0x58b0c2(0x95)][_0x58b0c2(0x9d)]}];for(const {label:_0x3b49ba,path:_0x5d497,extra:_0x3fd530}of _0x7935e0){if(_0x5d497)console[_0x58b0c2(0x92)](_0x3b49ba+':\x20'+_0x5d497+'\x20✓'+(_0x3fd530?'\x20'+_0x3fd530:''));else{if(_0x3b49ba==='Session')console[_0x58b0c2(0x92)](_0x3b49ba+_0x58b0c2(0x79)+this[_0x58b0c2(0x94)]+')');else(_0x3b49ba===_0x58b0c2(0x90)||_0x3b49ba===_0x58b0c2(0x86))&&console[_0x58b0c2(0x92)](_0x3b49ba+_0x58b0c2(0xb7));}}}}function a35_0x446b(){const _0x3b6080=[':\x20none\x20(using\x20session:\x20','getParameters','join','existsSync','627QkzTZb','replace','15350bZlUuN','activeProfile','.env','display','project','verbose','site','Global','[context]','3966wBzqQJ','llm_project','llmProject','(session:\x20','2309860fUjLrS','session','segmentPath','readFileSync','Project','parent_segment','log','not\x20set','sessionId','configFiles','cliFlags','entries','injectIntoOptions','us01','Profile\x20Credentials','Global\x20Credentials','tdx.json','globalCredentials','apiKey','ppid','layers','global','profileCredentials','profiles','database','876DyeibC','getSource','displayWithSources','toString','string','10996eIicwY','104teQaSO','(active)','\x0a[configuration\x20files]','config','2926308wrakyy','profile','107271CIrWcY','loadGlobalConfig','parentSegment','3097164btUcmW','265ZFOODN','.json',':\x20none','CLI\x20flag:\x20--','segment_path','sessions'];a35_0x446b=function(){return _0x3b6080;};return a35_0x446b();}
1
+ const a35_0x55e126=a35_0xddc7;(function(_0x5da368,_0x2c5fc0){const _0x32ea73=a35_0xddc7,_0x2212c1=_0x5da368();while(!![]){try{const _0x3d29aa=parseInt(_0x32ea73(0xc5))/0x1+-parseInt(_0x32ea73(0xd7))/0x2*(parseInt(_0x32ea73(0xbb))/0x3)+parseInt(_0x32ea73(0xc0))/0x4+parseInt(_0x32ea73(0xce))/0x5*(parseInt(_0x32ea73(0xbf))/0x6)+parseInt(_0x32ea73(0xbc))/0x7+parseInt(_0x32ea73(0xdf))/0x8+-parseInt(_0x32ea73(0xcf))/0x9;if(_0x3d29aa===_0x2c5fc0)break;else _0x2212c1['push'](_0x2212c1['shift']());}catch(_0x1cf9cf){_0x2212c1['push'](_0x2212c1['shift']());}}}(a35_0x57bb,0xe72bf));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';import{loadSessionContext}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a35_0x57bb(){const _0x549d28=['5fbIeZw','13283424kKstwB','profile:\x20','global','profile','displayWithSources','configFiles','apiKey','join','3397222GLVAgB','log','display','getParameters','Global','Project','.json','not\x20set','5729096NEObXA','default','[context]','session','layers',':\x20none','parent_segment','us01','utf-8','verbose','site','sessions','loadGlobalConfig',':\x20none\x20(using\x20session:\x20','tdx.json','replace','activeProfile','toString','existsSync','.env','Session','sessionId','segmentPath','project','3ToVlun','10704351IplkkA','readFileSync','database','369804nCSEvv','3186048rXpbWN','entries','\x0a[configuration\x20files]','llmProject','cliFlags','1017950oxOaOv','globalCredentials','Profile\x20Credentials','parentSegment','ppid','segment_path','(active)','profiles','llm_project'];a35_0x57bb=function(){return _0x549d28;};return a35_0x57bb();}import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x3da532 from'node:fs';function a35_0xddc7(_0x1148b6,_0x4f624b){const _0x57bbc0=a35_0x57bb();return a35_0xddc7=function(_0xddc73c,_0x6f2a7c){_0xddc73c=_0xddc73c-0xb1;let _0x3ad54e=_0x57bbc0[_0xddc73c];return _0x3ad54e;},a35_0xddc7(_0x1148b6,_0x4f624b);}import*as a35_0x4d5475 from'node:path';export class GlobalContext{[a35_0x55e126(0xe9)];[a35_0x55e126(0xbe)];['parent_segment'];[a35_0x55e126(0xca)];[a35_0x55e126(0xcd)];['apiKey'];[a35_0x55e126(0xe8)];[a35_0x55e126(0xe3)];[a35_0x55e126(0xb3)];[a35_0x55e126(0xb8)];[a35_0x55e126(0xd4)];constructor(_0x341e69){const _0x2ec2cf=a35_0x55e126;this['sessionId']=_0x341e69[_0x2ec2cf(0xe2)]||process[_0x2ec2cf(0xc9)][_0x2ec2cf(0xb4)]();const _0x4e251f=loadSessionContext(_0x341e69[_0x2ec2cf(0xe2)]),_0x14c615=loadProjectConfig(),_0x489b1d=this[_0x2ec2cf(0xeb)]();this[_0x2ec2cf(0xb3)]=_0x341e69['profile']||_0x4e251f?.[_0x2ec2cf(0xd2)]||_0x489b1d[_0x2ec2cf(0xd2)]||getActiveProfile();const _0x5e0d99=this['activeProfile']?loadProfile(this[_0x2ec2cf(0xb3)]):null,_0x5681f8=_0x25c521=>{const _0x23c88c=_0x2ec2cf;if(!_0x25c521)return{};const _0x5e395d=_0x25c521,_0x301f9f={};for(const [_0x18b351,_0x4c70e5]of Object[_0x23c88c(0xc1)](_0x5e395d)){typeof _0x4c70e5==='string'&&(_0x301f9f[_0x18b351]=_0x4c70e5);}return _0x301f9f;},_0x386044={};if(_0x341e69[_0x2ec2cf(0xe9)]&&_0x341e69['site']!==_0x2ec2cf(0xe6))_0x386044['site']=_0x341e69[_0x2ec2cf(0xe9)];const _0x17f5ed=_0x4e251f?.[_0x2ec2cf(0xbe)],_0x45acd3=_0x14c615?.[_0x2ec2cf(0xbe)],_0x4e8747=_0x5e0d99?.['config']?.[_0x2ec2cf(0xbe)],_0x19f0c0=_0x489b1d[_0x2ec2cf(0xbe)];_0x341e69[_0x2ec2cf(0xbe)]&&(_0x341e69[_0x2ec2cf(0xbe)]!==_0x17f5ed&&_0x341e69['database']!==_0x45acd3&&_0x341e69[_0x2ec2cf(0xbe)]!==_0x4e8747&&_0x341e69[_0x2ec2cf(0xbe)]!==_0x19f0c0)&&(_0x386044['database']=_0x341e69[_0x2ec2cf(0xbe)]);if(_0x341e69[_0x2ec2cf(0xc8)])_0x386044[_0x2ec2cf(0xe5)]=_0x341e69[_0x2ec2cf(0xc8)];if(_0x341e69[_0x2ec2cf(0xc3)])_0x386044['llm_project']=_0x341e69[_0x2ec2cf(0xc3)];if(_0x341e69[_0x2ec2cf(0xd2)])_0x386044[_0x2ec2cf(0xd2)]=_0x341e69[_0x2ec2cf(0xd2)];this[_0x2ec2cf(0xe3)]={'cliFlags':_0x386044,'session':_0x5681f8(_0x4e251f),'project':_0x5681f8(_0x14c615),'profile':_0x5681f8(_0x5e0d99?.['config']),'global':_0x5681f8(_0x489b1d)};const _0xb1fa06={...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xd1)],...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xd2)],...this[_0x2ec2cf(0xe3)]['project'],...this[_0x2ec2cf(0xe3)]['session'],...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xc4)]},_0x95af35=_0xb1fa06[_0x2ec2cf(0xe9)]||'us01';this['site']=resolveSite(_0x95af35),this['database']=_0xb1fa06[_0x2ec2cf(0xbe)],this[_0x2ec2cf(0xe5)]=_0xb1fa06[_0x2ec2cf(0xe5)],this[_0x2ec2cf(0xca)]=_0xb1fa06[_0x2ec2cf(0xca)],this[_0x2ec2cf(0xcd)]=_0xb1fa06[_0x2ec2cf(0xcd)],this[_0x2ec2cf(0xe8)]=_0x341e69[_0x2ec2cf(0xe8)]||![],this[_0x2ec2cf(0xd5)]=getAPIKey(this[_0x2ec2cf(0xe9)],this['activeProfile']||undefined);const _0x6ff728=getConfigDir(),_0x24851c=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xea),this['sessionId']+_0x2ec2cf(0xdd)),_0x5ca16c=findProjectConfigPath(),_0x3b7cf5=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xb1)),_0x205660=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xb6));let _0x464ad9=null,_0xdea19d=null;this[_0x2ec2cf(0xb3)]&&(_0x464ad9=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xcc),this[_0x2ec2cf(0xb3)],'tdx.json'),_0xdea19d=a35_0x4d5475['join'](_0x6ff728,_0x2ec2cf(0xcc),this[_0x2ec2cf(0xb3)],_0x2ec2cf(0xb6))),this[_0x2ec2cf(0xd4)]={'session':a35_0x3da532[_0x2ec2cf(0xb5)](_0x24851c)?_0x24851c:null,'project':_0x5ca16c,'profile':_0x464ad9&&a35_0x3da532[_0x2ec2cf(0xb5)](_0x464ad9)?_0x464ad9:null,'profileCredentials':_0xdea19d&&a35_0x3da532['existsSync'](_0xdea19d)?_0xdea19d:null,'global':a35_0x3da532[_0x2ec2cf(0xb5)](_0x3b7cf5)?_0x3b7cf5:null,'globalCredentials':a35_0x3da532[_0x2ec2cf(0xb5)](_0x205660)?_0x205660:null};}['getSource'](_0x2d40f1,_0x10d934){const _0x23f330=a35_0x55e126;if(!_0x10d934)return _0x23f330(0xde);const _0x3d8d74=_0x10d934;if(this['layers']['cliFlags'][_0x2d40f1]===_0x3d8d74){if(_0x2d40f1===_0x23f330(0xe9)&&_0x3d8d74===_0x23f330(0xe6)&&!this[_0x23f330(0xe3)][_0x23f330(0xe2)][_0x23f330(0xe9)]&&!this[_0x23f330(0xe3)][_0x23f330(0xba)]['site']&&!this[_0x23f330(0xe3)][_0x23f330(0xd2)][_0x23f330(0xe9)]&&!this[_0x23f330(0xe3)][_0x23f330(0xd1)][_0x23f330(0xe9)])return _0x23f330(0xe0);return'CLI\x20flag:\x20--'+_0x2d40f1[_0x23f330(0xb2)](/_/g,'-');}if(this['layers'][_0x23f330(0xe2)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xe2);if(this[_0x23f330(0xe3)][_0x23f330(0xba)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xba);if(this[_0x23f330(0xe3)][_0x23f330(0xd2)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xd0)+this[_0x23f330(0xb3)];if(this[_0x23f330(0xe3)][_0x23f330(0xd1)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xd1);return _0x23f330(0xe0);}[a35_0x55e126(0xeb)](){const _0xb93176=a35_0x55e126,_0x29e283=a35_0x4d5475[_0xb93176(0xd6)](getConfigDir(),'tdx.json');if(!a35_0x3da532[_0xb93176(0xb5)](_0x29e283))return{};try{const _0x58d8a8=a35_0x3da532[_0xb93176(0xbd)](_0x29e283,_0xb93176(0xe7));return JSON['parse'](_0x58d8a8);}catch{return{};}}['injectIntoOptions'](_0x19c829){const _0x1e4910=a35_0x55e126;_0x19c829[_0x1e4910(0xe9)]=this[_0x1e4910(0xe9)],!_0x19c829[_0x1e4910(0xbe)]&&this[_0x1e4910(0xbe)]&&(_0x19c829[_0x1e4910(0xbe)]=this[_0x1e4910(0xbe)]),!_0x19c829[_0x1e4910(0xc8)]&&this[_0x1e4910(0xe5)]&&(_0x19c829[_0x1e4910(0xc8)]=this[_0x1e4910(0xe5)]),!_0x19c829[_0x1e4910(0xb9)]&&this[_0x1e4910(0xca)]&&(_0x19c829[_0x1e4910(0xb9)]=this[_0x1e4910(0xca)]),!_0x19c829[_0x1e4910(0xc3)]&&this[_0x1e4910(0xcd)]&&(_0x19c829['llmProject']=this[_0x1e4910(0xcd)]);}[a35_0x55e126(0xda)](){const _0x230eb6=a35_0x55e126;return[{'key':_0x230eb6(0xe9),'value':this[_0x230eb6(0xe9)]},{'key':_0x230eb6(0xbe),'value':this[_0x230eb6(0xbe)]},{'key':_0x230eb6(0xe5),'value':this['parent_segment']},{'key':'segment_path','value':this['segment_path']},{'key':_0x230eb6(0xcd),'value':this[_0x230eb6(0xcd)]},{'key':_0x230eb6(0xd2),'value':this[_0x230eb6(0xb3)]||undefined}];}[a35_0x55e126(0xd9)](){const _0x5812d0=a35_0x55e126;console[_0x5812d0(0xd8)](_0x5812d0(0xe1));for(const {key:_0x25179f,value:_0x29c62f}of this[_0x5812d0(0xda)]()){_0x29c62f&&console[_0x5812d0(0xd8)](_0x25179f+':\x20'+_0x29c62f);}}[a35_0x55e126(0xd3)](){const _0x4f1e41=a35_0x55e126;console[_0x4f1e41(0xd8)](_0x4f1e41(0xe1));for(const {key:_0x5b82f3,value:_0x59814}of this[_0x4f1e41(0xda)]()){if(_0x59814){const _0x39f4bd=_0x5b82f3===_0x4f1e41(0xd2)?_0x4f1e41(0xcb):'('+this['getSource'](_0x5b82f3,_0x59814)+')';console[_0x4f1e41(0xd8)](_0x5b82f3+':\x20'+_0x59814+'\x20'+_0x39f4bd);}}console[_0x4f1e41(0xd8)](_0x4f1e41(0xc2));const _0x32c943=[{'label':_0x4f1e41(0xb7),'path':this[_0x4f1e41(0xd4)]['session'],'extra':'(session:\x20'+this[_0x4f1e41(0xb8)]+')'},{'label':_0x4f1e41(0xdc),'path':this[_0x4f1e41(0xd4)][_0x4f1e41(0xba)]},{'label':'Profile','path':this[_0x4f1e41(0xd4)]['profile']},{'label':_0x4f1e41(0xc7),'path':this[_0x4f1e41(0xd4)]['profileCredentials']},{'label':'Global','path':this[_0x4f1e41(0xd4)]['global']},{'label':'Global\x20Credentials','path':this['configFiles'][_0x4f1e41(0xc6)]}];for(const {label:_0x27f145,path:_0x1e41d2,extra:_0x597ce1}of _0x32c943){if(_0x1e41d2)console[_0x4f1e41(0xd8)](_0x27f145+':\x20'+_0x1e41d2+'\x20✓'+(_0x597ce1?'\x20'+_0x597ce1:''));else{if(_0x27f145==='Session')console['log'](_0x27f145+_0x4f1e41(0xec)+this[_0x4f1e41(0xb8)]+')');else(_0x27f145===_0x4f1e41(0xdc)||_0x27f145===_0x4f1e41(0xdb))&&console[_0x4f1e41(0xd8)](_0x27f145+_0x4f1e41(0xe4));}}}}
@@ -1 +1 @@
1
- function a36_0x5f46(_0x292fd1,_0x41c207){const _0x3f9973=a36_0x3f99();return a36_0x5f46=function(_0x5f461a,_0x1871a6){_0x5f461a=_0x5f461a-0x1c8;let _0x1c532e=_0x3f9973[_0x5f461a];return _0x1c532e;},a36_0x5f46(_0x292fd1,_0x41c207);}(function(_0x476104,_0x27f9a8){const _0x51d8b0=a36_0x5f46,_0x2d1aaa=_0x476104();while(!![]){try{const _0x4077bd=parseInt(_0x51d8b0(0x219))/0x1*(parseInt(_0x51d8b0(0x216))/0x2)+-parseInt(_0x51d8b0(0x20a))/0x3+parseInt(_0x51d8b0(0x1fa))/0x4+-parseInt(_0x51d8b0(0x1f2))/0x5*(-parseInt(_0x51d8b0(0x210))/0x6)+parseInt(_0x51d8b0(0x1e4))/0x7+-parseInt(_0x51d8b0(0x1f9))/0x8+parseInt(_0x51d8b0(0x1db))/0x9*(parseInt(_0x51d8b0(0x1de))/0xa);if(_0x4077bd===_0x27f9a8)break;else _0x2d1aaa['push'](_0x2d1aaa['shift']());}catch(_0x4b20f0){_0x2d1aaa['push'](_0x2d1aaa['shift']());}}}(a36_0x3f99,0xe206e));function a36_0x3f99(){const _0xab73b0=['apiKey','string','description','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','rmSync','message','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','78205DIwfpo','\x27:\x20unknown\x20config\x20key\x20\x27','metadata','has','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','database','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','1861464aKKRLc','512476KLCBtp','find','writeFileSync','warn','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20',':\x20Invalid\x20JSON\x20syntax','\x20\x20mv\x20\x22','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','readFileSync','from','keys','profile','Profile\x20','name','profiles','utf-8','5435382qYBlnl','sort','parse','localeCompare','set','filter','78BmJbIl','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','join','tdx.json','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','\x22\x20\x22','272nGAJrz','site','\x27:\x20config\x20must\x20be\x20an\x20object','845BqdciS','Invalid\x20profile\x20name:\x20','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','api_key','lastUsed','object','push','\x20\x201.\x20Edit:\x20','\x20already\x20exists','test','toISOString','\x27\x20will\x20be\x20ignored','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','\x0aWarning:\x20Failed\x20to\x20parse\x20','values','llm_agent','some','llm_project','Profile\x20\x27','.env.','.env','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','37458LfmgZY','entries','parent_segment','4670qiByUN','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','directory','\x20does\x20not\x20exist','existsSync','local','4061799swiALZ','map','TD_API_KEY','stringify','includes','isDirectory'];a36_0x3f99=function(){return _0xab73b0;};return a36_0x3f99();}import*as a36_0x57ad84 from'node:fs';import*as a36_0xa91e8d 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(_0x54c217){const _0xe466e4=a36_0x5f46,_0x480567={};if(!_0x54c217)return _0x480567;for(const [_0x2ea070,_0x1b997d]of Object[_0xe466e4(0x1dc)](_0x54c217)){_0x2ea070!=='description'&&_0x1b997d!==undefined&&(_0x480567[_0x2ea070]=_0x1b997d);}return _0x480567;}export function getProfilesDir(){const _0xa95f8=a36_0x5f46;return a36_0xa91e8d[_0xa95f8(0x212)](getConfigDir(),'profiles');}function getProfileDir(_0x2293c2){const _0x5c3e49=a36_0x5f46;return a36_0xa91e8d[_0x5c3e49(0x212)](getProfilesDir(),_0x2293c2);}function getProfileConfigPath(_0x315dce){const _0x5f1e26=a36_0x5f46;return a36_0xa91e8d[_0x5f1e26(0x212)](getProfileDir(_0x315dce),_0x5f1e26(0x213));}function getProfileEnvPath(_0xc67b6a){const _0x4d4cde=a36_0x5f46;return a36_0xa91e8d[_0x4d4cde(0x212)](getProfileDir(_0xc67b6a),_0x4d4cde(0x1d9));}function getGlobalConfigPath(){const _0x5df6e9=a36_0x5f46;return a36_0xa91e8d[_0x5df6e9(0x212)](getConfigDir(),_0x5df6e9(0x213));}function validateProfileName(_0x307a81){const _0x430d71=a36_0x5f46;if(!/^[a-zA-Z0-9_-]+$/[_0x430d71(0x1ce)](_0x307a81))throw new Error(_0x430d71(0x21a)+_0x307a81+_0x430d71(0x1f8));}function validateProfileConfig(_0x4aa107,_0x266004){const _0x364a97=a36_0x5f46;if(typeof _0x4aa107!==_0x364a97(0x1ca)||_0x4aa107===null)throw new Error('Profile\x20\x27'+_0x266004+_0x364a97(0x218));const _0x21d699=['description',_0x364a97(0x217),_0x364a97(0x1f7),'parent_segment',_0x364a97(0x1d6),_0x364a97(0x1d4)],_0x5b14c3=_0x4aa107;for(const _0x3bc3cb of Object[_0x364a97(0x204)](_0x5b14c3)){!_0x21d699[_0x364a97(0x1e8)](_0x3bc3cb)&&console[_0x364a97(0x1fd)]('Warning:\x20Profile\x20\x27'+_0x266004+_0x364a97(0x1f3)+_0x3bc3cb+_0x364a97(0x1d0));}if(_0x5b14c3[_0x364a97(0x1ec)]!==undefined&&typeof _0x5b14c3['description']!==_0x364a97(0x1eb))throw new Error(_0x364a97(0x1d7)+_0x266004+_0x364a97(0x1f6));if(_0x5b14c3[_0x364a97(0x217)]!==undefined&&typeof _0x5b14c3[_0x364a97(0x217)]!==_0x364a97(0x1eb))throw new Error(_0x364a97(0x1d7)+_0x266004+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x5b14c3[_0x364a97(0x1f7)]!==undefined&&typeof _0x5b14c3[_0x364a97(0x1f7)]!==_0x364a97(0x1eb))throw new Error('Profile\x20\x27'+_0x266004+_0x364a97(0x211));if(_0x5b14c3[_0x364a97(0x1dd)]!==undefined&&typeof _0x5b14c3[_0x364a97(0x1dd)]!==_0x364a97(0x1eb))throw new Error(_0x364a97(0x1d7)+_0x266004+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x5b14c3[_0x364a97(0x1d6)]!==undefined&&typeof _0x5b14c3[_0x364a97(0x1d6)]!==_0x364a97(0x1eb))throw new Error(_0x364a97(0x1d7)+_0x266004+_0x364a97(0x21b));if(_0x5b14c3[_0x364a97(0x1d4)]!==undefined&&typeof _0x5b14c3[_0x364a97(0x1d4)]!==_0x364a97(0x1eb))throw new Error(_0x364a97(0x1d7)+_0x266004+_0x364a97(0x1ed));return!![];}function loadProfilesFromTdxJson(_0x6539eb,_0x57a323){const _0x2055d9=a36_0x5f46;if(!a36_0x57ad84[_0x2055d9(0x1e2)](_0x6539eb))return[];try{const _0x111502=a36_0x57ad84[_0x2055d9(0x202)](_0x6539eb,_0x2055d9(0x209)),_0x77a697=JSON[_0x2055d9(0x20c)](_0x111502);if(!_0x77a697[_0x2055d9(0x208)]||typeof _0x77a697[_0x2055d9(0x208)]!==_0x2055d9(0x1ca))return[];const _0x3ff35c=[];for(const [_0x31511b,_0x5db841]of Object[_0x2055d9(0x1dc)](_0x77a697[_0x2055d9(0x208)])){try{validateProfileConfig(_0x5db841,_0x31511b);const _0x220895=getNewCredentialPath(_0x31511b),_0x51e16f=getOldCredentialPath(_0x31511b),_0x296fc0=a36_0x57ad84['existsSync'](_0x220895)||a36_0x57ad84[_0x2055d9(0x1e2)](_0x51e16f);_0x3ff35c[_0x2055d9(0x1cb)]({'name':_0x31511b,'config':_0x5db841,'metadata':{'name':_0x31511b,'createdAt':new Date()[_0x2055d9(0x1cf)]()},'hasCredentials':_0x296fc0,'scope':_0x57a323});}catch(_0x100e75){_0x100e75 instanceof Error&&(console[_0x2055d9(0x1fd)](_0x2055d9(0x214)+_0x6539eb+':'),console[_0x2055d9(0x1fd)]('\x20\x20'+_0x100e75[_0x2055d9(0x1f0)]+'\x0a'));}}return _0x3ff35c;}catch(_0x32ee5c){return _0x32ee5c instanceof SyntaxError?(console[_0x2055d9(0x1fd)](_0x2055d9(0x1d2)+_0x6539eb+_0x2055d9(0x1ff)),console[_0x2055d9(0x1fd)]('Error:\x20'+_0x32ee5c[_0x2055d9(0x1f0)]+'\x0a')):console[_0x2055d9(0x1fd)](_0x2055d9(0x1fe)+_0x6539eb+':\x20'+_0x32ee5c+'\x0a'),[];}}export function getNewCredentialPath(_0x5e2654){const _0x2d241c=a36_0x5f46;return a36_0xa91e8d[_0x2d241c(0x212)](getConfigDir(),_0x2d241c(0x1d8)+_0x5e2654);}function getOldCredentialPath(_0x5d9cac){const _0x1f20f4=a36_0x5f46;return a36_0xa91e8d[_0x1f20f4(0x212)](getProfilesDir(),_0x5d9cac,_0x1f20f4(0x1d9));}function loadProfilesFromTdxJsonFiles(){const _0xb7fac8=a36_0x5f46,_0x4ef637=[],_0xeec73c=findProjectConfigPath();_0xeec73c&&_0x4ef637[_0xb7fac8(0x1cb)](...loadProfilesFromTdxJson(_0xeec73c,_0xb7fac8(0x1e3)));const _0x3b5981=a36_0xa91e8d['join'](getConfigDir(),_0xb7fac8(0x213));return _0x4ef637[_0xb7fac8(0x1cb)](...loadProfilesFromTdxJson(_0x3b5981,'user')),_0x4ef637;}function loadProfilesFromDirectories(){const _0xdc99b4=a36_0x5f46,_0x36418b=getProfilesDir();if(!a36_0x57ad84[_0xdc99b4(0x1e2)](_0x36418b))return[];try{return a36_0x57ad84['readdirSync'](_0x36418b,{'withFileTypes':!![]})[_0xdc99b4(0x20f)](_0xf380ff=>_0xf380ff[_0xdc99b4(0x1e9)]())[_0xdc99b4(0x1e5)](_0x2ad8c8=>_0x2ad8c8[_0xdc99b4(0x207)])[_0xdc99b4(0x20f)](_0xef329b=>{const _0x1fad5b=_0xdc99b4,_0x568794=getProfileConfigPath(_0xef329b),_0x13bb14=getProfileEnvPath(_0xef329b);return a36_0x57ad84[_0x1fad5b(0x1e2)](_0x568794)||a36_0x57ad84[_0x1fad5b(0x1e2)](_0x13bb14);})[_0xdc99b4(0x1e5)](_0x3f2a3b=>{const _0x50bd58=_0xdc99b4,_0x319ab0=loadProfileFromDirectory(_0x3f2a3b);if(_0x319ab0)return{..._0x319ab0,'scope':_0x50bd58(0x1e0)};return null;})[_0xdc99b4(0x20f)](_0x1d3192=>_0x1d3192!==null);}catch{return[];}}function loadProfileFromDirectory(_0x16e018){const _0x206511=a36_0x5f46,_0x2d725d=getProfileConfigPath(_0x16e018),_0x21f201=getOldCredentialPath(_0x16e018);if(!a36_0x57ad84['existsSync'](_0x2d725d)&&!a36_0x57ad84['existsSync'](_0x21f201))return null;let _0x54c653={},_0x1969cb={'name':_0x16e018,'createdAt':new Date()[_0x206511(0x1cf)]()};if(a36_0x57ad84[_0x206511(0x1e2)](_0x2d725d))try{const _0x56b89b=a36_0x57ad84[_0x206511(0x202)](_0x2d725d,'utf-8'),_0x32207a=JSON[_0x206511(0x20c)](_0x56b89b),{metadata:_0x5422c7,..._0x57b890}=_0x32207a;_0x54c653=_0x57b890,_0x5422c7&&(_0x1969cb=_0x5422c7);}catch{}return{'name':_0x16e018,'config':_0x54c653,'metadata':_0x1969cb,'hasCredentials':a36_0x57ad84['existsSync'](_0x21f201),'scope':_0x206511(0x1e0)};}export function listProfiles(){const _0x17f33c=a36_0x5f46,_0x23a8b6=loadProfilesFromTdxJsonFiles(),_0x432f4f=loadProfilesFromDirectories();if(_0x432f4f['length']>0x0){const _0x1eff95=_0x432f4f[_0x17f33c(0x1e5)](_0x50abbb=>_0x50abbb[_0x17f33c(0x207)])['join'](',\x20'),_0x56308b=getConfigDir();console[_0x17f33c(0x1fd)](_0x17f33c(0x1f1)+_0x1eff95),console[_0x17f33c(0x1fd)](_0x17f33c(0x1df)),console[_0x17f33c(0x1fd)](_0x17f33c(0x1cc)+a36_0xa91e8d[_0x17f33c(0x212)](_0x56308b,_0x17f33c(0x213))),console[_0x17f33c(0x1fd)](_0x17f33c(0x1ee)),console[_0x17f33c(0x1fd)](_0x17f33c(0x1da));}const _0xb41dc1=[..._0x23a8b6,..._0x432f4f],_0x5b71f4=new Map();for(const _0x4e5cf7 of _0xb41dc1){!_0x5b71f4[_0x17f33c(0x1f5)](_0x4e5cf7['name'])&&_0x5b71f4[_0x17f33c(0x20e)](_0x4e5cf7[_0x17f33c(0x207)],_0x4e5cf7);}return Array[_0x17f33c(0x203)](_0x5b71f4[_0x17f33c(0x1d3)]())[_0x17f33c(0x20b)]((_0x4726d6,_0x55a8ce)=>_0x4726d6[_0x17f33c(0x207)][_0x17f33c(0x20d)](_0x55a8ce[_0x17f33c(0x207)]));}export function profileExists(_0x5b0027){const _0x2410dc=a36_0x5f46,_0x33f9e7=listProfiles();return _0x33f9e7[_0x2410dc(0x1d5)](_0x532bab=>_0x532bab[_0x2410dc(0x207)]===_0x5b0027);}export function loadProfile(_0x3155cb){const _0x377dc6=a36_0x5f46;validateProfileName(_0x3155cb);const _0x559ecd=listProfiles(),_0x54bfa0=_0x559ecd[_0x377dc6(0x1fb)](_0x4d1483=>_0x4d1483['name']===_0x3155cb);return _0x54bfa0||null;}export function saveProfile(_0x233cc6,_0x5c3045,_0x58e733=![]){const _0xf30d96=a36_0x5f46;validateProfileName(_0x233cc6);const _0x333dfb=getProfileDir(_0x233cc6),_0x37fde0=getProfileConfigPath(_0x233cc6);createSecureDirectory(_0x333dfb);let _0x5ad8b2;const _0x38b95f=loadProfile(_0x233cc6);_0x38b95f?(_0x5ad8b2=_0x38b95f[_0xf30d96(0x1f4)],_0x58e733&&(_0x5ad8b2[_0xf30d96(0x1c9)]=new Date()['toISOString']())):_0x5ad8b2={'name':_0x233cc6,'createdAt':new Date()[_0xf30d96(0x1cf)]()};const _0x4ea94d=JSON['stringify'](_0x5c3045);if(_0x4ea94d[_0xf30d96(0x1e8)](_0xf30d96(0x1e6))||_0x4ea94d[_0xf30d96(0x1e8)](_0xf30d96(0x1ea))||_0x4ea94d[_0xf30d96(0x1e8)](_0xf30d96(0x1c8)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.');const _0x498f9e={..._0x5c3045,'metadata':_0x5ad8b2};a36_0x57ad84[_0xf30d96(0x1fc)](_0x37fde0,JSON[_0xf30d96(0x1e7)](_0x498f9e,null,0x2));}export function deleteProfile(_0x3824b7){const _0x30c705=a36_0x5f46;validateProfileName(_0x3824b7);const _0x1e61a1=getProfileDir(_0x3824b7);if(!a36_0x57ad84[_0x30c705(0x1e2)](_0x1e61a1))throw new Error(_0x30c705(0x206)+_0x3824b7+_0x30c705(0x1e1));a36_0x57ad84[_0x30c705(0x1ef)](_0x1e61a1,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x4e856c=a36_0x5f46,_0x313382=getGlobalConfigPath();if(!a36_0x57ad84['existsSync'](_0x313382))return null;try{const _0x1c55bc=a36_0x57ad84[_0x4e856c(0x202)](_0x313382,_0x4e856c(0x209)),_0x399f4c=JSON[_0x4e856c(0x20c)](_0x1c55bc);return _0x399f4c[_0x4e856c(0x205)]||null;}catch{return null;}}export function createProfile(_0x5461a9,_0x6881a9){const _0x39f5c=a36_0x5f46;validateProfileName(_0x5461a9);if(profileExists(_0x5461a9))throw new Error(_0x39f5c(0x206)+_0x5461a9+_0x39f5c(0x1cd));saveProfile(_0x5461a9,_0x6881a9);}export function saveProfileCredentials(_0x2cf13d,_0x5b5b54){const _0x156aa9=a36_0x5f46;validateProfileName(_0x2cf13d);if(!profileExists(_0x2cf13d))throw new Error('Profile\x20'+_0x2cf13d+_0x156aa9(0x1e1));const _0x4ae924=getNewCredentialPath(_0x2cf13d);writeSecureFile(_0x4ae924,_0x5b5b54);}export function loadProfileCredentials(_0x1e06c3){const _0x18711d=a36_0x5f46;validateProfileName(_0x1e06c3);const _0x4bccc0=getNewCredentialPath(_0x1e06c3);if(a36_0x57ad84[_0x18711d(0x1e2)](_0x4bccc0))try{return a36_0x57ad84['readFileSync'](_0x4bccc0,_0x18711d(0x209));}catch{}const _0x2ce07d=getOldCredentialPath(_0x1e06c3);if(a36_0x57ad84['existsSync'](_0x2ce07d)){console[_0x18711d(0x1fd)](_0x18711d(0x1d1)+_0x1e06c3+'\x27'),console['warn']('To\x20migrate:'),console[_0x18711d(0x1fd)](_0x18711d(0x200)+_0x2ce07d+_0x18711d(0x215)+_0x4bccc0+'\x22'),console[_0x18711d(0x1fd)](_0x18711d(0x201));try{return a36_0x57ad84[_0x18711d(0x202)](_0x2ce07d,_0x18711d(0x209));}catch{return null;}}return null;}
1
+ (function(_0x303ff,_0x467e81){const _0x185574=a36_0x9f3a,_0x4897b3=_0x303ff();while(!![]){try{const _0x19f8da=-parseInt(_0x185574(0x8b))/0x1*(-parseInt(_0x185574(0xb6))/0x2)+parseInt(_0x185574(0xcb))/0x3*(-parseInt(_0x185574(0x8d))/0x4)+parseInt(_0x185574(0x9d))/0x5*(-parseInt(_0x185574(0xc1))/0x6)+parseInt(_0x185574(0x97))/0x7+-parseInt(_0x185574(0xc8))/0x8+-parseInt(_0x185574(0x9b))/0x9*(-parseInt(_0x185574(0xa8))/0xa)+-parseInt(_0x185574(0xbc))/0xb*(-parseInt(_0x185574(0xca))/0xc);if(_0x19f8da===_0x467e81)break;else _0x4897b3['push'](_0x4897b3['shift']());}catch(_0x5845a6){_0x4897b3['push'](_0x4897b3['shift']());}}}(a36_0x1076,0x2816b));import*as a36_0x3d02bc from'node:fs';import*as a36_0x44f137 from'node:path';function a36_0x1076(){const _0x4b1a7b=['.env.','\x20\x20mv\x20\x22','toISOString','674dMJcxr','\x20does\x20not\x20exist','52036RuQJIB','.env','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','utf-8','metadata','llm_agent','stringify','parse','sort','description','599361wcZfYh','name','\x27\x20will\x20be\x20ignored','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','9gXGujU','push','6310MnQwab','\x20already\x20exists','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','site','\x27:\x20unknown\x20config\x20key\x20\x27','tdx.json','llm_project','writeFileSync','set','from','Invalid\x20profile\x20name:\x20','1101110ALFBOQ','Profile\x20\x27','map','includes','message',':\x20Invalid\x20JSON\x20syntax','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','object','entries','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','warn','test','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Failed\x20to\x20parse\x20','82YOSRqN','has','database','TD_API_KEY','profiles','Error:\x20','11likyvX','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','find','\x22\x20\x22','\x27:\x20config\x20must\x20be\x20an\x20object','1500ARhFhD','parent_segment','lastUsed','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','join','\x20\x201.\x20Edit:\x20','1778120VayeJu','filter','8709252zMJDbn','57zSvHgk','keys','existsSync','readFileSync','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','Warning:\x20Profile\x20\x27','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','api_key','profile','Profile\x20','directory','readdirSync','local','values','rmSync','string','localeCompare'];a36_0x1076=function(){return _0x4b1a7b;};return a36_0x1076();}import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';export function getProfileParams(_0x2678e8){const _0x35cd4e=a36_0x9f3a,_0x41c684={};if(!_0x2678e8)return _0x41c684;for(const [_0xd00527,_0xf8e0e5]of Object[_0x35cd4e(0xb0)](_0x2678e8)){_0xd00527!=='description'&&_0xf8e0e5!==undefined&&(_0x41c684[_0xd00527]=_0xf8e0e5);}return _0x41c684;}export function getProfilesDir(){const _0x12df90=a36_0x9f3a;return a36_0x44f137[_0x12df90(0xc6)](getConfigDir(),_0x12df90(0xba));}function getProfileDir(_0x570c5e){const _0x1797eb=a36_0x9f3a;return a36_0x44f137[_0x1797eb(0xc6)](getProfilesDir(),_0x570c5e);}function getProfileConfigPath(_0x51767c){const _0x483b35=a36_0x9f3a;return a36_0x44f137[_0x483b35(0xc6)](getProfileDir(_0x51767c),_0x483b35(0xa2));}function getProfileEnvPath(_0x1956a5){const _0x5c3246=a36_0x9f3a;return a36_0x44f137[_0x5c3246(0xc6)](getProfileDir(_0x1956a5),_0x5c3246(0x8e));}function getGlobalConfigPath(){const _0xc926ec=a36_0x9f3a;return a36_0x44f137[_0xc926ec(0xc6)](getConfigDir(),_0xc926ec(0xa2));}function validateProfileName(_0x216759){const _0x2f63ea=a36_0x9f3a;if(!/^[a-zA-Z0-9_-]+$/[_0x2f63ea(0xb3)](_0x216759))throw new Error(_0x2f63ea(0xa7)+_0x216759+_0x2f63ea(0xcf));}function validateProfileConfig(_0x19a0a5,_0x4fafbd){const _0x5d33ff=a36_0x9f3a;if(typeof _0x19a0a5!==_0x5d33ff(0xaf)||_0x19a0a5===null)throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xc0));const _0x937d7a=[_0x5d33ff(0x96),_0x5d33ff(0xa0),_0x5d33ff(0xb8),_0x5d33ff(0xc2),_0x5d33ff(0xa3),_0x5d33ff(0x92)],_0x2a9df3=_0x19a0a5;for(const _0xaa80bc of Object[_0x5d33ff(0xcc)](_0x2a9df3)){!_0x937d7a[_0x5d33ff(0xab)](_0xaa80bc)&&console[_0x5d33ff(0xb2)](_0x5d33ff(0xd0)+_0x4fafbd+_0x5d33ff(0xa1)+_0xaa80bc+_0x5d33ff(0x99));}if(_0x2a9df3['description']!==undefined&&typeof _0x2a9df3[_0x5d33ff(0x96)]!=='string')throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xae));if(_0x2a9df3['site']!==undefined&&typeof _0x2a9df3['site']!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0x9f));if(_0x2a9df3['database']!==undefined&&typeof _0x2a9df3['database']!==_0x5d33ff(0x86))throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xc5));if(_0x2a9df3[_0x5d33ff(0xc2)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0xc2)]!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xb1));if(_0x2a9df3[_0x5d33ff(0xa3)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0xa3)]!==_0x5d33ff(0x86))throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xbd));if(_0x2a9df3[_0x5d33ff(0x92)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0x92)]!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xb4));return!![];}function loadProfilesFromTdxJson(_0x3a8840,_0x156d72){const _0x23eaf7=a36_0x9f3a;if(!a36_0x3d02bc[_0x23eaf7(0xcd)](_0x3a8840))return[];try{const _0xabe833=a36_0x3d02bc[_0x23eaf7(0xce)](_0x3a8840,_0x23eaf7(0x90)),_0x1b1686=JSON[_0x23eaf7(0x94)](_0xabe833);if(!_0x1b1686[_0x23eaf7(0xba)]||typeof _0x1b1686[_0x23eaf7(0xba)]!==_0x23eaf7(0xaf))return[];const _0x39d883=[];for(const [_0x435b22,_0x58db13]of Object[_0x23eaf7(0xb0)](_0x1b1686['profiles'])){try{validateProfileConfig(_0x58db13,_0x435b22);const _0x1abd78=getNewCredentialPath(_0x435b22),_0x14d762=getOldCredentialPath(_0x435b22),_0x3dc4d1=a36_0x3d02bc[_0x23eaf7(0xcd)](_0x1abd78)||a36_0x3d02bc[_0x23eaf7(0xcd)](_0x14d762);_0x39d883['push']({'name':_0x435b22,'config':_0x58db13,'metadata':{'name':_0x435b22,'createdAt':new Date()[_0x23eaf7(0x8a)]()},'hasCredentials':_0x3dc4d1,'scope':_0x156d72});}catch(_0x46c2bf){_0x46c2bf instanceof Error&&(console[_0x23eaf7(0xb2)](_0x23eaf7(0x8f)+_0x3a8840+':'),console[_0x23eaf7(0xb2)]('\x20\x20'+_0x46c2bf[_0x23eaf7(0xac)]+'\x0a'));}}return _0x39d883;}catch(_0x1305b5){return _0x1305b5 instanceof SyntaxError?(console[_0x23eaf7(0xb2)](_0x23eaf7(0xb5)+_0x3a8840+_0x23eaf7(0xad)),console[_0x23eaf7(0xb2)](_0x23eaf7(0xbb)+_0x1305b5[_0x23eaf7(0xac)]+'\x0a')):console['warn'](_0x23eaf7(0xc4)+_0x3a8840+':\x20'+_0x1305b5+'\x0a'),[];}}export function getNewCredentialPath(_0x39269d){const _0x3caaba=a36_0x9f3a;return a36_0x44f137[_0x3caaba(0xc6)](getConfigDir(),_0x3caaba(0x88)+_0x39269d);}function getOldCredentialPath(_0x2d45e3){const _0x318971=a36_0x9f3a;return a36_0x44f137[_0x318971(0xc6)](getProfilesDir(),_0x2d45e3,_0x318971(0x8e));}function loadProfilesFromTdxJsonFiles(){const _0x3ecf37=a36_0x9f3a,_0x328e73=[],_0x3fb43d=findProjectConfigPath();_0x3fb43d&&_0x328e73[_0x3ecf37(0x9c)](...loadProfilesFromTdxJson(_0x3fb43d,_0x3ecf37(0x83)));const _0x24e954=a36_0x44f137['join'](getConfigDir(),_0x3ecf37(0xa2));return _0x328e73['push'](...loadProfilesFromTdxJson(_0x24e954,'user')),_0x328e73;}function loadProfilesFromDirectories(){const _0x419333=a36_0x9f3a,_0x178686=getProfilesDir();if(!a36_0x3d02bc[_0x419333(0xcd)](_0x178686))return[];try{return a36_0x3d02bc[_0x419333(0x82)](_0x178686,{'withFileTypes':!![]})[_0x419333(0xc9)](_0xe9f323=>_0xe9f323['isDirectory']())[_0x419333(0xaa)](_0x5c1625=>_0x5c1625[_0x419333(0x98)])[_0x419333(0xc9)](_0x144c83=>{const _0x1f330b=_0x419333,_0x46d8d0=getProfileConfigPath(_0x144c83),_0x57f78c=getProfileEnvPath(_0x144c83);return a36_0x3d02bc[_0x1f330b(0xcd)](_0x46d8d0)||a36_0x3d02bc[_0x1f330b(0xcd)](_0x57f78c);})[_0x419333(0xaa)](_0x1317cb=>{const _0x1081ef=_0x419333,_0x62f66d=loadProfileFromDirectory(_0x1317cb);if(_0x62f66d)return{..._0x62f66d,'scope':_0x1081ef(0x81)};return null;})['filter'](_0x3117a9=>_0x3117a9!==null);}catch{return[];}}function loadProfileFromDirectory(_0x3ea22b){const _0x495556=a36_0x9f3a,_0xdb0072=getProfileConfigPath(_0x3ea22b),_0x5e5cbb=getOldCredentialPath(_0x3ea22b);if(!a36_0x3d02bc[_0x495556(0xcd)](_0xdb0072)&&!a36_0x3d02bc['existsSync'](_0x5e5cbb))return null;let _0x407957={},_0x63789e={'name':_0x3ea22b,'createdAt':new Date()[_0x495556(0x8a)]()};if(a36_0x3d02bc['existsSync'](_0xdb0072))try{const _0x213da7=a36_0x3d02bc[_0x495556(0xce)](_0xdb0072,'utf-8'),_0x3ef89d=JSON[_0x495556(0x94)](_0x213da7),{metadata:_0x1509ae,..._0x49b739}=_0x3ef89d;_0x407957=_0x49b739,_0x1509ae&&(_0x63789e=_0x1509ae);}catch{}return{'name':_0x3ea22b,'config':_0x407957,'metadata':_0x63789e,'hasCredentials':a36_0x3d02bc[_0x495556(0xcd)](_0x5e5cbb),'scope':_0x495556(0x81)};}export function listProfiles(){const _0x2b6389=a36_0x9f3a,_0x2f71d0=loadProfilesFromTdxJsonFiles(),_0x58ff95=loadProfilesFromDirectories();if(_0x58ff95['length']>0x0){const _0x2f6cfa=_0x58ff95[_0x2b6389(0xaa)](_0x7fe442=>_0x7fe442[_0x2b6389(0x98)])['join'](',\x20'),_0x27f551=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x2f6cfa),console[_0x2b6389(0xb2)](_0x2b6389(0x7d)),console['warn'](_0x2b6389(0xc7)+a36_0x44f137[_0x2b6389(0xc6)](_0x27f551,_0x2b6389(0xa2))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x2b6389(0xb2)](_0x2b6389(0x9a));}const _0x369f9f=[..._0x2f71d0,..._0x58ff95],_0x4eb341=new Map();for(const _0x23a455 of _0x369f9f){!_0x4eb341[_0x2b6389(0xb7)](_0x23a455[_0x2b6389(0x98)])&&_0x4eb341[_0x2b6389(0xa5)](_0x23a455['name'],_0x23a455);}return Array[_0x2b6389(0xa6)](_0x4eb341[_0x2b6389(0x84)]())[_0x2b6389(0x95)]((_0x156530,_0x2b193b)=>_0x156530[_0x2b6389(0x98)][_0x2b6389(0x87)](_0x2b193b[_0x2b6389(0x98)]));}function a36_0x9f3a(_0x46f865,_0x6d1193){const _0x1076e0=a36_0x1076();return a36_0x9f3a=function(_0x9f3a3f,_0xcb55e8){_0x9f3a3f=_0x9f3a3f-0x7d;let _0x2cc4f9=_0x1076e0[_0x9f3a3f];return _0x2cc4f9;},a36_0x9f3a(_0x46f865,_0x6d1193);}export function profileExists(_0x4429c3){const _0x2bfc42=a36_0x9f3a,_0x520b89=listProfiles();return _0x520b89['some'](_0x426d0e=>_0x426d0e[_0x2bfc42(0x98)]===_0x4429c3);}export function loadProfile(_0xfa43e4){const _0x585ca5=a36_0x9f3a;validateProfileName(_0xfa43e4);const _0x12a48e=listProfiles(),_0x9de196=_0x12a48e[_0x585ca5(0xbe)](_0x321464=>_0x321464[_0x585ca5(0x98)]===_0xfa43e4);return _0x9de196||null;}export function saveProfile(_0x10aebd,_0x2b4391,_0x54251e=![]){const _0x52b4cc=a36_0x9f3a;validateProfileName(_0x10aebd);const _0x6790a7=getProfileDir(_0x10aebd),_0x105393=getProfileConfigPath(_0x10aebd);createSecureDirectory(_0x6790a7);let _0x2e3bc7;const _0x31ca22=loadProfile(_0x10aebd);_0x31ca22?(_0x2e3bc7=_0x31ca22[_0x52b4cc(0x91)],_0x54251e&&(_0x2e3bc7[_0x52b4cc(0xc3)]=new Date()['toISOString']())):_0x2e3bc7={'name':_0x10aebd,'createdAt':new Date()['toISOString']()};const _0x4ab33d=JSON[_0x52b4cc(0x93)](_0x2b4391);if(_0x4ab33d[_0x52b4cc(0xab)](_0x52b4cc(0xb9))||_0x4ab33d[_0x52b4cc(0xab)]('apiKey')||_0x4ab33d[_0x52b4cc(0xab)](_0x52b4cc(0x7e)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.');const _0xeff465={..._0x2b4391,'metadata':_0x2e3bc7};a36_0x3d02bc[_0x52b4cc(0xa4)](_0x105393,JSON[_0x52b4cc(0x93)](_0xeff465,null,0x2));}export function deleteProfile(_0x1089ae){const _0x662a18=a36_0x9f3a;validateProfileName(_0x1089ae);const _0x477e84=getProfileDir(_0x1089ae);if(!a36_0x3d02bc['existsSync'](_0x477e84))throw new Error(_0x662a18(0x80)+_0x1089ae+_0x662a18(0x8c));a36_0x3d02bc[_0x662a18(0x85)](_0x477e84,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x17af38=a36_0x9f3a,_0x5c5028=getGlobalConfigPath();if(!a36_0x3d02bc[_0x17af38(0xcd)](_0x5c5028))return null;try{const _0x6d679=a36_0x3d02bc[_0x17af38(0xce)](_0x5c5028,_0x17af38(0x90)),_0x40d6cf=JSON[_0x17af38(0x94)](_0x6d679);return _0x40d6cf[_0x17af38(0x7f)]||null;}catch{return null;}}export function createProfile(_0x188c21,_0x1d12df){const _0x3aa37c=a36_0x9f3a;validateProfileName(_0x188c21);if(profileExists(_0x188c21))throw new Error('Profile\x20'+_0x188c21+_0x3aa37c(0x9e));saveProfile(_0x188c21,_0x1d12df);}export function saveProfileCredentials(_0x896d62,_0x4a18d6){const _0x578411=a36_0x9f3a;validateProfileName(_0x896d62);if(!profileExists(_0x896d62))throw new Error(_0x578411(0x80)+_0x896d62+_0x578411(0x8c));const _0x4fb96f=getNewCredentialPath(_0x896d62);writeSecureFile(_0x4fb96f,_0x4a18d6);}export function loadProfileCredentials(_0x4996df){const _0x234a81=a36_0x9f3a;validateProfileName(_0x4996df);const _0x3b4357=getNewCredentialPath(_0x4996df);if(a36_0x3d02bc[_0x234a81(0xcd)](_0x3b4357))try{return a36_0x3d02bc['readFileSync'](_0x3b4357,_0x234a81(0x90));}catch{}const _0x1f2c9b=getOldCredentialPath(_0x4996df);if(a36_0x3d02bc[_0x234a81(0xcd)](_0x1f2c9b)){console[_0x234a81(0xb2)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x4996df+'\x27'),console[_0x234a81(0xb2)]('To\x20migrate:'),console[_0x234a81(0xb2)](_0x234a81(0x89)+_0x1f2c9b+_0x234a81(0xbf)+_0x3b4357+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a36_0x3d02bc[_0x234a81(0xce)](_0x1f2c9b,_0x234a81(0x90));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a37_0x46deb5=a37_0x4ef2;function a37_0x4ef2(_0x1fdeb9,_0x5d4119){const _0x234f44=a37_0x234f();return a37_0x4ef2=function(_0x4ef2f2,_0x594ad9){_0x4ef2f2=_0x4ef2f2-0x6c;let _0x594ab2=_0x234f44[_0x4ef2f2];return _0x594ab2;},a37_0x4ef2(_0x1fdeb9,_0x5d4119);}(function(_0x28d0c3,_0x2d4dbc){const _0x3abb29=a37_0x4ef2,_0x505951=_0x28d0c3();while(!![]){try{const _0x562447=-parseInt(_0x3abb29(0x7c))/0x1+-parseInt(_0x3abb29(0x7e))/0x2+parseInt(_0x3abb29(0x77))/0x3*(parseInt(_0x3abb29(0x86))/0x4)+parseInt(_0x3abb29(0x79))/0x5*(-parseInt(_0x3abb29(0x78))/0x6)+parseInt(_0x3abb29(0x89))/0x7*(parseInt(_0x3abb29(0x76))/0x8)+-parseInt(_0x3abb29(0x6f))/0x9+-parseInt(_0x3abb29(0x85))/0xa*(-parseInt(_0x3abb29(0x8a))/0xb);if(_0x562447===_0x2d4dbc)break;else _0x505951['push'](_0x505951['shift']());}catch(_0x477ea5){_0x505951['push'](_0x505951['shift']());}}}(a37_0x234f,0xbdee9));import*as a37_0x573aa6 from'node:fs';import*as a37_0x52854e from'node:path';function a37_0x234f(){const _0xb2dc6c=['parse','profile','cwd','warn','410XBiGdN','5386844ibyMnG','ENOENT','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','5616758JaAZIg','652146xjamUN','includes','utf-8','apiKey','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','readFileSync','stringify','10891224FpzmKU','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Warning:\x20\x27profile\x27\x20field\x20in\x20','code','TD_API_KEY','Failed\x20to\x20load\x20project\x20config\x20from\x20','tdx.json','8nTLRiv','3xMIORy','8242062YSvurX','5nprSnw','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','dirname','586885NkKepW','existsSync','1262344ygvgFY',').\x20','join'];a37_0x234f=function(){return _0xb2dc6c;};return a37_0x234f();}const PROJECT_CONFIG_FILENAME=a37_0x46deb5(0x75);export function findProjectConfigPath(_0x4d44a5){const _0x13006d=a37_0x46deb5;let _0x3281ea=_0x4d44a5||process[_0x13006d(0x83)]();while(!![]){const _0x491f43=a37_0x52854e['join'](_0x3281ea,PROJECT_CONFIG_FILENAME);if(a37_0x573aa6[_0x13006d(0x7d)](_0x491f43))return _0x491f43;const _0x1a4398=a37_0x52854e[_0x13006d(0x7b)](_0x3281ea);if(_0x1a4398===_0x3281ea)return null;_0x3281ea=_0x1a4398;}}export function loadProjectConfig(_0x539e3b){const _0x4d096c=a37_0x46deb5,_0x5caac8=findProjectConfigPath(_0x539e3b);if(!_0x5caac8)return null;try{const _0x2ba13f=a37_0x573aa6[_0x4d096c(0x6d)](_0x5caac8,_0x4d096c(0x8c)),_0x3663f4=JSON[_0x4d096c(0x81)](_0x2ba13f),_0x1c5e7f=JSON[_0x4d096c(0x6e)](_0x3663f4);if(_0x1c5e7f[_0x4d096c(0x8b)]('TD_API_KEY')||_0x1c5e7f[_0x4d096c(0x8b)](_0x4d096c(0x8d))||_0x1c5e7f[_0x4d096c(0x8b)]('api_key'))throw new Error(_0x4d096c(0x6c)+_0x5caac8+_0x4d096c(0x7f)+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x3771f7,profile:_0x3b3319,..._0x4d4c96}=_0x3663f4;return _0x3b3319&&console[_0x4d096c(0x84)](_0x4d096c(0x71)+_0x5caac8+'\x20is\x20ignored.\x20'+_0x4d096c(0x7a)),_0x4d4c96;}catch(_0x597ed5){if(_0x597ed5 instanceof Error&&_0x4d096c(0x72)in _0x597ed5&&_0x597ed5[_0x4d096c(0x72)]===_0x4d096c(0x87))return null;throw new Error(_0x4d096c(0x74)+_0x5caac8+':\x20'+_0x597ed5);}}export function saveProjectConfig(_0x25234e,_0x523467){const _0x292758=a37_0x46deb5,_0x57eb61=_0x523467||process[_0x292758(0x83)](),_0x1b34d5=a37_0x52854e[_0x292758(0x80)](_0x57eb61,PROJECT_CONFIG_FILENAME),_0x1cfb86=JSON[_0x292758(0x6e)](_0x25234e);if(_0x1cfb86[_0x292758(0x8b)](_0x292758(0x73))||_0x1cfb86[_0x292758(0x8b)]('apiKey')||_0x1cfb86[_0x292758(0x8b)]('api_key'))throw new Error(_0x292758(0x70));if(_0x292758(0x82)in _0x25234e)throw new Error(_0x292758(0x88));a37_0x573aa6['writeFileSync'](_0x1b34d5,JSON[_0x292758(0x6e)](_0x25234e,null,0x2));}export function hasProjectConfig(_0x13751a){return findProjectConfigPath(_0x13751a)!==null;}export function getProjectRoot(_0x34394f){const _0x2ef6fc=a37_0x46deb5,_0x18774a=findProjectConfigPath(_0x34394f);return _0x18774a?a37_0x52854e[_0x2ef6fc(0x7b)](_0x18774a):null;}
1
+ const a37_0xad7d3f=a37_0x567b;(function(_0x33965e,_0x5476a5){const _0x392e22=a37_0x567b,_0x1f5198=_0x33965e();while(!![]){try{const _0x2f0832=parseInt(_0x392e22(0xc8))/0x1*(parseInt(_0x392e22(0xe2))/0x2)+-parseInt(_0x392e22(0xca))/0x3*(parseInt(_0x392e22(0xe5))/0x4)+-parseInt(_0x392e22(0xd5))/0x5*(-parseInt(_0x392e22(0xd1))/0x6)+parseInt(_0x392e22(0xe1))/0x7*(parseInt(_0x392e22(0xcb))/0x8)+-parseInt(_0x392e22(0xd2))/0x9*(parseInt(_0x392e22(0xd0))/0xa)+-parseInt(_0x392e22(0xe4))/0xb*(-parseInt(_0x392e22(0xdd))/0xc)+-parseInt(_0x392e22(0xc6))/0xd;if(_0x2f0832===_0x5476a5)break;else _0x1f5198['push'](_0x1f5198['shift']());}catch(_0x4cb68a){_0x1f5198['push'](_0x1f5198['shift']());}}}(a37_0x2b9e,0xc102f));import*as a37_0x24a68a from'node:fs';function a37_0x567b(_0x16b7ae,_0x21be30){const _0x2b9eb6=a37_0x2b9e();return a37_0x567b=function(_0x567b88,_0x13452d){_0x567b88=_0x567b88-0xc6;let _0x1d1f51=_0x2b9eb6[_0x567b88];return _0x1d1f51;},a37_0x567b(_0x16b7ae,_0x21be30);}import*as a37_0x4fc7ba from'node:path';const PROJECT_CONFIG_FILENAME=a37_0xad7d3f(0xdb);function a37_0x2b9e(){const _0x4e5381=['Failed\x20to\x20load\x20project\x20config\x20from\x20','7894730PLyMLg','6wfbQgk','9IqWzqC','apiKey','join','1909010WBtwvS','parse','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','cwd','Warning:\x20\x27profile\x27\x20field\x20in\x20','code','tdx.json','readFileSync','1356gywkZW','dirname','api_key','includes','7273DNevNL','162314YeHmRm','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','103004BrJkMq','4UBDriZ','ENOENT','1248650AjKmYS','TD_API_KEY','9wIGjDE','existsSync','1987701DHKNOG','1296xrgrWN',').\x20','stringify','utf-8'];a37_0x2b9e=function(){return _0x4e5381;};return a37_0x2b9e();}export function findProjectConfigPath(_0x5def79){const _0x259713=a37_0xad7d3f;let _0x4631d2=_0x5def79||process[_0x259713(0xd8)]();while(!![]){const _0x6f3f73=a37_0x4fc7ba[_0x259713(0xd4)](_0x4631d2,PROJECT_CONFIG_FILENAME);if(a37_0x24a68a[_0x259713(0xc9)](_0x6f3f73))return _0x6f3f73;const _0x334094=a37_0x4fc7ba[_0x259713(0xde)](_0x4631d2);if(_0x334094===_0x4631d2)return null;_0x4631d2=_0x334094;}}export function loadProjectConfig(_0x454bb5){const _0x2871ec=a37_0xad7d3f,_0x47d105=findProjectConfigPath(_0x454bb5);if(!_0x47d105)return null;try{const _0xbb5442=a37_0x24a68a[_0x2871ec(0xdc)](_0x47d105,_0x2871ec(0xce)),_0x5b1a7c=JSON[_0x2871ec(0xd6)](_0xbb5442),_0x1e9ae6=JSON[_0x2871ec(0xcd)](_0x5b1a7c);if(_0x1e9ae6[_0x2871ec(0xe0)](_0x2871ec(0xc7))||_0x1e9ae6['includes']('apiKey')||_0x1e9ae6[_0x2871ec(0xe0)](_0x2871ec(0xdf)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x47d105+_0x2871ec(0xcc)+_0x2871ec(0xd7));const {metadata:_0x50741b,profile:_0x1314e0,..._0x5576d1}=_0x5b1a7c;return _0x1314e0&&console['warn'](_0x2871ec(0xd9)+_0x47d105+'\x20is\x20ignored.\x20'+_0x2871ec(0xe3)),_0x5576d1;}catch(_0x1e5bb7){if(_0x1e5bb7 instanceof Error&&'code'in _0x1e5bb7&&_0x1e5bb7[_0x2871ec(0xda)]===_0x2871ec(0xe6))return null;throw new Error(_0x2871ec(0xcf)+_0x47d105+':\x20'+_0x1e5bb7);}}export function saveProjectConfig(_0x287861,_0x94a4dc){const _0x2e2244=a37_0xad7d3f,_0x4ceacd=_0x94a4dc||process['cwd'](),_0x140e40=a37_0x4fc7ba[_0x2e2244(0xd4)](_0x4ceacd,PROJECT_CONFIG_FILENAME),_0x57f3a1=JSON[_0x2e2244(0xcd)](_0x287861);if(_0x57f3a1['includes'](_0x2e2244(0xc7))||_0x57f3a1[_0x2e2244(0xe0)](_0x2e2244(0xd3))||_0x57f3a1['includes'](_0x2e2244(0xdf)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if('profile'in _0x287861)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a37_0x24a68a['writeFileSync'](_0x140e40,JSON[_0x2e2244(0xcd)](_0x287861,null,0x2));}export function hasProjectConfig(_0x41b21a){return findProjectConfigPath(_0x41b21a)!==null;}export function getProjectRoot(_0x41658c){const _0x157357=a37_0xad7d3f,_0x22185d=findProjectConfigPath(_0x41658c);return _0x22185d?a37_0x4fc7ba[_0x157357(0xde)](_0x22185d):null;}
@@ -1 +1 @@
1
- (function(_0x19c35a,_0xbe9a99){const _0x42159a=a38_0x4b02,_0x54f87c=_0x19c35a();while(!![]){try{const _0x52c2ad=-parseInt(_0x42159a(0x1f2))/0x1*(parseInt(_0x42159a(0x1fc))/0x2)+-parseInt(_0x42159a(0x204))/0x3+-parseInt(_0x42159a(0x1ee))/0x4+-parseInt(_0x42159a(0x1f3))/0x5+parseInt(_0x42159a(0x1fa))/0x6+parseInt(_0x42159a(0x1fe))/0x7+parseInt(_0x42159a(0x200))/0x8;if(_0x52c2ad===_0xbe9a99)break;else _0x54f87c['push'](_0x54f87c['shift']());}catch(_0x421c4d){_0x54f87c['push'](_0x54f87c['shift']());}}}(a38_0x22f8,0x8afab));import*as a38_0x5aa6e2 from'node:fs';import*as a38_0x2916d4 from'node:path';import*as a38_0x264614 from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x5d1332=a38_0x4b02,_0x1d97d7=process[_0x5d1332(0x1ef)][_0x5d1332(0x1fd)]||a38_0x2916d4['join'](a38_0x264614[_0x5d1332(0x206)](),'.config','tdx');return a38_0x2916d4[_0x5d1332(0x1ff)](_0x1d97d7,_0x5d1332(0x20e));}function getSessionPath(_0x2634d9){const _0x3f1f32=a38_0x4b02;return a38_0x2916d4[_0x3f1f32(0x1ff)](getSessionsDir(),_0x2634d9+_0x3f1f32(0x205));}export function getCurrentSessionPID(){return getPPID();}function a38_0x22f8(){const _0x1eda70=['unlinkSync','TD_API_KEY','1463004FUuwTX','.json','homedir','sort','parse','now','api_key','apiKey','stringify','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','sessions','getTime','toString','createdAt','warn','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','test','replace','3042916rZXRUj','env','existsSync','writeFileSync','1nNnsGR','2232020TnvWAS','.\x20This\x20is\x20insecure.\x20Removing\x20session.','push','toISOString','includes','readFileSync','endsWith','2211180MvYEtk','readdirSync','697702Nhdofz','TDX_CONFIG_DIR','5107459usoibU','join','12117952RCptQK','utf-8'];a38_0x22f8=function(){return _0x1eda70;};return a38_0x22f8();}export function getSessionID(_0x5d900a){const _0x45c5e9=a38_0x4b02;if(_0x5d900a)return _0x5d900a;return getCurrentSessionPID()[_0x45c5e9(0x210)]();}function a38_0x4b02(_0x52b1e1,_0x331dbd){const _0x22f842=a38_0x22f8();return a38_0x4b02=function(_0x4b02ff,_0x2bde60){_0x4b02ff=_0x4b02ff-0x1ec;let _0x5aaf42=_0x22f842[_0x4b02ff];return _0x5aaf42;},a38_0x4b02(_0x52b1e1,_0x331dbd);}export function loadSessionContext(_0x19f55a){const _0x1e3229=a38_0x4b02,_0x1d17a9=_0x19f55a||getCurrentSessionPID()[_0x1e3229(0x210)](),_0x3cb101=/^\d+$/[_0x1e3229(0x1ec)](_0x1d17a9)?parseInt(_0x1d17a9,0xa):null;return _0x3cb101!==null?loadSessionContextByPID(_0x3cb101):loadSessionContextByString(_0x1d17a9);}export function loadSessionContextByPID(_0x4ae6d1){const _0x18d409=a38_0x4b02,_0x352b09=getSessionPath(_0x4ae6d1);if(!a38_0x5aa6e2[_0x18d409(0x1f0)](_0x352b09))return null;try{const _0x518c1c=a38_0x5aa6e2[_0x18d409(0x1f8)](_0x352b09,_0x18d409(0x201)),_0x36909a=JSON[_0x18d409(0x208)](_0x518c1c),_0x2215ad=new Date(_0x36909a[_0x18d409(0x211)])[_0x18d409(0x20f)](),_0x4bbe76=Date[_0x18d409(0x209)]();if(_0x4bbe76-_0x2215ad>SESSION_EXPIRATION_MS)return a38_0x5aa6e2[_0x18d409(0x202)](_0x352b09),null;const _0x27ff08=JSON[_0x18d409(0x20c)](_0x36909a);if(_0x27ff08[_0x18d409(0x1f7)]('TD_API_KEY')||_0x27ff08[_0x18d409(0x1f7)](_0x18d409(0x20b))||_0x27ff08['includes'](_0x18d409(0x20a)))return console[_0x18d409(0x212)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x352b09+_0x18d409(0x1f4)),a38_0x5aa6e2['unlinkSync'](_0x352b09),null;return _0x36909a;}catch{try{a38_0x5aa6e2[_0x18d409(0x202)](_0x352b09);}catch{}return null;}}function loadSessionContextByString(_0x1bce98){const _0x5878d7=a38_0x4b02,_0x416fa6=a38_0x2916d4[_0x5878d7(0x1ff)](getSessionsDir(),_0x1bce98+_0x5878d7(0x205));if(!a38_0x5aa6e2['existsSync'](_0x416fa6))return null;try{const _0x16fb1a=a38_0x5aa6e2['readFileSync'](_0x416fa6,_0x5878d7(0x201)),_0x4997f2=JSON[_0x5878d7(0x208)](_0x16fb1a),_0x3094cd=new Date(_0x4997f2[_0x5878d7(0x211)])['getTime'](),_0x539c60=Date['now']();if(_0x539c60-_0x3094cd>SESSION_EXPIRATION_MS)return a38_0x5aa6e2[_0x5878d7(0x202)](_0x416fa6),null;const _0x1d6fd0=JSON[_0x5878d7(0x20c)](_0x4997f2);if(_0x1d6fd0[_0x5878d7(0x1f7)](_0x5878d7(0x203))||_0x1d6fd0['includes'](_0x5878d7(0x20b))||_0x1d6fd0[_0x5878d7(0x1f7)](_0x5878d7(0x20a)))return console[_0x5878d7(0x212)](_0x5878d7(0x213)+_0x416fa6+_0x5878d7(0x1f4)),a38_0x5aa6e2[_0x5878d7(0x202)](_0x416fa6),null;return _0x4997f2;}catch{try{a38_0x5aa6e2[_0x5878d7(0x202)](_0x416fa6);}catch{}return null;}}export function saveSessionContext(_0x128242,_0x4756ef){const _0xcca3c8=a38_0x4b02,_0x562f52=_0x4756ef||getCurrentSessionPID()['toString'](),_0xd967d6=/^\d+$/[_0xcca3c8(0x1ec)](_0x562f52)?parseInt(_0x562f52,0xa):getCurrentSessionPID(),_0x35e585=a38_0x2916d4[_0xcca3c8(0x1ff)](getSessionsDir(),_0x562f52+'.json'),_0x65d13f=getSessionsDir();createSecureDirectory(_0x65d13f);const _0x2a26e4=JSON[_0xcca3c8(0x20c)](_0x128242);if(_0x2a26e4[_0xcca3c8(0x1f7)]('TD_API_KEY')||_0x2a26e4[_0xcca3c8(0x1f7)](_0xcca3c8(0x20b))||_0x2a26e4[_0xcca3c8(0x1f7)](_0xcca3c8(0x20a)))throw new Error(_0xcca3c8(0x20d));let _0x154e7e;const _0x427d9d=/^\d+$/[_0xcca3c8(0x1ec)](_0x562f52)?loadSessionContextByPID(parseInt(_0x562f52,0xa)):loadSessionContextByString(_0x562f52);_0x427d9d?_0x154e7e={..._0x427d9d,..._0x128242,'pid':_0xd967d6,'sessionId':_0x562f52!==_0xd967d6['toString']()?_0x562f52:undefined,'updatedAt':new Date()[_0xcca3c8(0x1f6)]()}:_0x154e7e={'pid':_0xd967d6,'sessionId':_0x562f52!==_0xd967d6['toString']()?_0x562f52:undefined,..._0x128242,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0xcca3c8(0x1f6)]()},a38_0x5aa6e2[_0xcca3c8(0x1f1)](_0x35e585,JSON[_0xcca3c8(0x20c)](_0x154e7e,null,0x2));}export function clearSessionContext(_0x4bbe79){const _0x53c774=a38_0x4b02,_0x53e2ce=_0x4bbe79||getCurrentSessionPID()[_0x53c774(0x210)](),_0x3e065c=a38_0x2916d4[_0x53c774(0x1ff)](getSessionsDir(),_0x53e2ce+_0x53c774(0x205));a38_0x5aa6e2['existsSync'](_0x3e065c)&&a38_0x5aa6e2[_0x53c774(0x202)](_0x3e065c);}export function cleanExpiredSessions(){const _0x3bb0c0=a38_0x4b02,_0x4e0308=getSessionsDir();if(!a38_0x5aa6e2[_0x3bb0c0(0x1f0)](_0x4e0308))return 0x0;let _0x4570f1=0x0;const _0x44d807=Date[_0x3bb0c0(0x209)]();try{const _0x441e44=a38_0x5aa6e2[_0x3bb0c0(0x1fb)](_0x4e0308);for(const _0x3e92e9 of _0x441e44){if(!_0x3e92e9[_0x3bb0c0(0x1f9)](_0x3bb0c0(0x205)))continue;const _0x42a24c=a38_0x2916d4[_0x3bb0c0(0x1ff)](_0x4e0308,_0x3e92e9),_0x272670=_0x3e92e9[_0x3bb0c0(0x1ed)](_0x3bb0c0(0x205),''),_0x45b960=parseInt(_0x272670,0xa),_0x118cb9=!isNaN(_0x45b960);if(_0x118cb9){if(!isProcessRunning(_0x45b960)){a38_0x5aa6e2[_0x3bb0c0(0x202)](_0x42a24c),_0x4570f1++;continue;}}try{const _0x51a19a=a38_0x5aa6e2[_0x3bb0c0(0x1f8)](_0x42a24c,_0x3bb0c0(0x201)),_0x524e56=JSON[_0x3bb0c0(0x208)](_0x51a19a),_0x39b0e0=new Date(_0x524e56[_0x3bb0c0(0x211)])[_0x3bb0c0(0x20f)]();_0x44d807-_0x39b0e0>SESSION_EXPIRATION_MS&&(a38_0x5aa6e2['unlinkSync'](_0x42a24c),_0x4570f1++);}catch{a38_0x5aa6e2[_0x3bb0c0(0x202)](_0x42a24c),_0x4570f1++;}}}catch{}return _0x4570f1;}export function listActiveSessions(){const _0x3ee63=a38_0x4b02,_0x23b07f=getSessionsDir();if(!a38_0x5aa6e2['existsSync'](_0x23b07f))return[];try{const _0x2a46b5=a38_0x5aa6e2[_0x3ee63(0x1fb)](_0x23b07f),_0x993e7=[];for(const _0x554ab9 of _0x2a46b5){if(!_0x554ab9[_0x3ee63(0x1f9)]('.json'))continue;const _0x19639e=_0x554ab9[_0x3ee63(0x1ed)](_0x3ee63(0x205),''),_0x586a09=parseInt(_0x19639e,0xa);!isNaN(_0x586a09)&&isProcessRunning(_0x586a09)&&_0x993e7[_0x3ee63(0x1f5)](_0x586a09);}return _0x993e7[_0x3ee63(0x207)]((_0x23015b,_0x3b61c9)=>_0x23015b-_0x3b61c9);}catch{return[];}}
1
+ (function(_0xc6d289,_0x5df9b4){const _0x587398=a38_0x4c89,_0x4a7b65=_0xc6d289();while(!![]){try{const _0x430640=parseInt(_0x587398(0x91))/0x1*(-parseInt(_0x587398(0x89))/0x2)+parseInt(_0x587398(0x97))/0x3+parseInt(_0x587398(0x84))/0x4*(-parseInt(_0x587398(0x96))/0x5)+parseInt(_0x587398(0x87))/0x6*(-parseInt(_0x587398(0x78))/0x7)+parseInt(_0x587398(0x9a))/0x8+-parseInt(_0x587398(0xa2))/0x9*(parseInt(_0x587398(0x81))/0xa)+parseInt(_0x587398(0x7b))/0xb;if(_0x430640===_0x5df9b4)break;else _0x4a7b65['push'](_0x4a7b65['shift']());}catch(_0x1156a9){_0x4a7b65['push'](_0x4a7b65['shift']());}}}(a38_0x5de9,0xeef99));import*as a38_0x10485b from'node:fs';import*as a38_0x3a2c43 from'node:path';import*as a38_0x25fe5d from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x45105a=a38_0x4c89,_0x3966b4=process['env'][_0x45105a(0x8e)]||a38_0x3a2c43[_0x45105a(0x8a)](a38_0x25fe5d[_0x45105a(0x7e)](),_0x45105a(0x7f),_0x45105a(0x7d));return a38_0x3a2c43[_0x45105a(0x8a)](_0x3966b4,_0x45105a(0x8d));}function getSessionPath(_0x23b3fd){const _0x51af1d=a38_0x4c89;return a38_0x3a2c43['join'](getSessionsDir(),_0x23b3fd+_0x51af1d(0x9d));}export function getCurrentSessionPID(){return getPPID();}function a38_0x4c89(_0x25a5be,_0x187edc){const _0x5de9f3=a38_0x5de9();return a38_0x4c89=function(_0x4c8908,_0x17f928){_0x4c8908=_0x4c8908-0x78;let _0x179cd3=_0x5de9f3[_0x4c8908];return _0x179cd3;},a38_0x4c89(_0x25a5be,_0x187edc);}export function getSessionID(_0x561e95){const _0x3b7329=a38_0x4c89;if(_0x561e95)return _0x561e95;return getCurrentSessionPID()[_0x3b7329(0x7c)]();}export function loadSessionContext(_0x3463c4){const _0x2448fd=a38_0x4c89,_0x1e9d48=_0x3463c4||getCurrentSessionPID()[_0x2448fd(0x7c)](),_0x1b45e0=/^\d+$/['test'](_0x1e9d48)?parseInt(_0x1e9d48,0xa):null;return _0x1b45e0!==null?loadSessionContextByPID(_0x1b45e0):loadSessionContextByString(_0x1e9d48);}export function loadSessionContextByPID(_0x1f2b46){const _0x667481=a38_0x4c89,_0x51d96d=getSessionPath(_0x1f2b46);if(!a38_0x10485b[_0x667481(0x82)](_0x51d96d))return null;try{const _0x4ca956=a38_0x10485b['readFileSync'](_0x51d96d,'utf-8'),_0x5adac3=JSON['parse'](_0x4ca956),_0x47c279=new Date(_0x5adac3[_0x667481(0x93)])[_0x667481(0x9b)](),_0x2ccecf=Date['now']();if(_0x2ccecf-_0x47c279>SESSION_EXPIRATION_MS)return a38_0x10485b[_0x667481(0x95)](_0x51d96d),null;const _0x6588c9=JSON[_0x667481(0x8f)](_0x5adac3);if(_0x6588c9[_0x667481(0x9f)](_0x667481(0x99))||_0x6588c9[_0x667481(0x9f)](_0x667481(0x80))||_0x6588c9[_0x667481(0x9f)]('api_key'))return console[_0x667481(0xa1)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x51d96d+_0x667481(0x8b)),a38_0x10485b[_0x667481(0x95)](_0x51d96d),null;return _0x5adac3;}catch{try{a38_0x10485b[_0x667481(0x95)](_0x51d96d);}catch{}return null;}}function loadSessionContextByString(_0x303b03){const _0x492fac=a38_0x4c89,_0x21c74d=a38_0x3a2c43[_0x492fac(0x8a)](getSessionsDir(),_0x303b03+_0x492fac(0x9d));if(!a38_0x10485b[_0x492fac(0x82)](_0x21c74d))return null;try{const _0x4977bd=a38_0x10485b[_0x492fac(0x8c)](_0x21c74d,_0x492fac(0x94)),_0x3c64cb=JSON[_0x492fac(0x9c)](_0x4977bd),_0x520fc8=new Date(_0x3c64cb['createdAt'])['getTime'](),_0x18a68e=Date[_0x492fac(0x88)]();if(_0x18a68e-_0x520fc8>SESSION_EXPIRATION_MS)return a38_0x10485b[_0x492fac(0x95)](_0x21c74d),null;const _0x3fb92d=JSON[_0x492fac(0x8f)](_0x3c64cb);if(_0x3fb92d[_0x492fac(0x9f)](_0x492fac(0x99))||_0x3fb92d[_0x492fac(0x9f)]('apiKey')||_0x3fb92d[_0x492fac(0x9f)]('api_key'))return console[_0x492fac(0xa1)](_0x492fac(0x83)+_0x21c74d+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a38_0x10485b[_0x492fac(0x95)](_0x21c74d),null;return _0x3c64cb;}catch{try{a38_0x10485b[_0x492fac(0x95)](_0x21c74d);}catch{}return null;}}export function saveSessionContext(_0x44d98d,_0x29eee4){const _0xc191b4=a38_0x4c89,_0x109f6b=_0x29eee4||getCurrentSessionPID()[_0xc191b4(0x7c)](),_0x15e45a=/^\d+$/[_0xc191b4(0x7a)](_0x109f6b)?parseInt(_0x109f6b,0xa):getCurrentSessionPID(),_0x15afb4=a38_0x3a2c43[_0xc191b4(0x8a)](getSessionsDir(),_0x109f6b+_0xc191b4(0x9d)),_0x4e9795=getSessionsDir();createSecureDirectory(_0x4e9795);const _0x42d903=JSON[_0xc191b4(0x8f)](_0x44d98d);if(_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x99))||_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x80))||_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x85)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x5cf830;const _0x1ad9b5=/^\d+$/['test'](_0x109f6b)?loadSessionContextByPID(parseInt(_0x109f6b,0xa)):loadSessionContextByString(_0x109f6b);_0x1ad9b5?_0x5cf830={..._0x1ad9b5,..._0x44d98d,'pid':_0x15e45a,'sessionId':_0x109f6b!==_0x15e45a[_0xc191b4(0x7c)]()?_0x109f6b:undefined,'updatedAt':new Date()['toISOString']()}:_0x5cf830={'pid':_0x15e45a,'sessionId':_0x109f6b!==_0x15e45a[_0xc191b4(0x7c)]()?_0x109f6b:undefined,..._0x44d98d,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0xc191b4(0x98)]()},a38_0x10485b[_0xc191b4(0x86)](_0x15afb4,JSON[_0xc191b4(0x8f)](_0x5cf830,null,0x2));}export function clearSessionContext(_0x315d48){const _0x26eaac=a38_0x4c89,_0xa1e624=_0x315d48||getCurrentSessionPID()[_0x26eaac(0x7c)](),_0x445779=a38_0x3a2c43[_0x26eaac(0x8a)](getSessionsDir(),_0xa1e624+_0x26eaac(0x9d));a38_0x10485b[_0x26eaac(0x82)](_0x445779)&&a38_0x10485b[_0x26eaac(0x95)](_0x445779);}export function cleanExpiredSessions(){const _0x596866=a38_0x4c89,_0x34e4e1=getSessionsDir();if(!a38_0x10485b[_0x596866(0x82)](_0x34e4e1))return 0x0;let _0xcff8d=0x0;const _0x285254=Date[_0x596866(0x88)]();try{const _0x4a3df4=a38_0x10485b[_0x596866(0x79)](_0x34e4e1);for(const _0x1c4353 of _0x4a3df4){if(!_0x1c4353[_0x596866(0x90)](_0x596866(0x9d)))continue;const _0x1d0cbe=a38_0x3a2c43['join'](_0x34e4e1,_0x1c4353),_0x631cc8=_0x1c4353[_0x596866(0x9e)](_0x596866(0x9d),''),_0x423682=parseInt(_0x631cc8,0xa),_0xbe8b4=!isNaN(_0x423682);if(_0xbe8b4){if(!isProcessRunning(_0x423682)){a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++;continue;}}try{const _0x286c10=a38_0x10485b[_0x596866(0x8c)](_0x1d0cbe,_0x596866(0x94)),_0x5e0229=JSON[_0x596866(0x9c)](_0x286c10),_0x557a0c=new Date(_0x5e0229[_0x596866(0x93)])[_0x596866(0x9b)]();_0x285254-_0x557a0c>SESSION_EXPIRATION_MS&&(a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++);}catch{a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++;}}}catch{}return _0xcff8d;}export function listActiveSessions(){const _0x570b6d=a38_0x4c89,_0x1b6302=getSessionsDir();if(!a38_0x10485b['existsSync'](_0x1b6302))return[];try{const _0x191a3a=a38_0x10485b['readdirSync'](_0x1b6302),_0x4c7f76=[];for(const _0x56e291 of _0x191a3a){if(!_0x56e291['endsWith'](_0x570b6d(0x9d)))continue;const _0x42213d=_0x56e291[_0x570b6d(0x9e)](_0x570b6d(0x9d),''),_0xbd8b7b=parseInt(_0x42213d,0xa);!isNaN(_0xbd8b7b)&&isProcessRunning(_0xbd8b7b)&&_0x4c7f76[_0x570b6d(0x92)](_0xbd8b7b);}return _0x4c7f76[_0x570b6d(0xa0)]((_0x32b98e,_0x45dfbe)=>_0x32b98e-_0x45dfbe);}catch{return[];}}function a38_0x5de9(){const _0x4641ce=['.config','apiKey','650KBtnQv','existsSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','2812OwpMSq','api_key','writeFileSync','88836ylHzRG','now','3368648kaltFx','join','.\x20This\x20is\x20insecure.\x20Removing\x20session.','readFileSync','sessions','TDX_CONFIG_DIR','stringify','endsWith','1IttYPL','push','createdAt','utf-8','unlinkSync','13285wMVjAm','5625081Ozzwyb','toISOString','TD_API_KEY','4464264LcbMZA','getTime','parse','.json','replace','includes','sort','warn','253629cBqPmE','539EjIQaa','readdirSync','test','55767833txBpQm','toString','tdx','homedir'];a38_0x5de9=function(){return _0x4641ce;};return a38_0x5de9();}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x40c198,_0x5c7bc4){var _0xd4cc0a=a39_0xfdf4,_0x2bb128=_0x40c198();while(!![]){try{var _0x3e4b31=-parseInt(_0xd4cc0a(0xc7))/0x1*(parseInt(_0xd4cc0a(0xbd))/0x2)+-parseInt(_0xd4cc0a(0xbe))/0x3*(parseInt(_0xd4cc0a(0xbf))/0x4)+parseInt(_0xd4cc0a(0xc6))/0x5+parseInt(_0xd4cc0a(0xc4))/0x6+parseInt(_0xd4cc0a(0xc5))/0x7+-parseInt(_0xd4cc0a(0xc1))/0x8*(parseInt(_0xd4cc0a(0xc3))/0x9)+-parseInt(_0xd4cc0a(0xc0))/0xa*(-parseInt(_0xd4cc0a(0xc2))/0xb);if(_0x3e4b31===_0x5c7bc4)break;else _0x2bb128['push'](_0x2bb128['shift']());}catch(_0x4ac3cc){_0x2bb128['push'](_0x2bb128['shift']());}}}(a39_0x4b36,0xb48f3));export*from'./types/index.js';export*from'./core/config.js';function a39_0x4b36(){var _0x31e8ba=['8LPstmf','1051380NFOXfU','19832YCcGzR','198GtkqEX','4671zoCKgH','3259188SJNeUn','9631461isvIMQ','1406640cSsKDm','1LMBeHF','1703038wAdRkd','1822863SoBbQS'];a39_0x4b36=function(){return _0x31e8ba;};return a39_0x4b36();}export*from'./core/auth.js';export*from'./client/http-client.js';export*from'./client/td-client.js';export{TrinoClient}from'./client/trino-client.js';function a39_0xfdf4(_0x2ec922,_0x55a6f1){var _0x4b367e=a39_0x4b36();return a39_0xfdf4=function(_0xfdf454,_0x107d67){_0xfdf454=_0xfdf454-0xbd;var _0x49e6de=_0x4b367e[_0xfdf454];return _0x49e6de;},a39_0xfdf4(_0x2ec922,_0x55a6f1);}export*from'./client/rate-limiter.js';export*from'./types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ function a39_0x1b37(){var _0x3224b5=['6pXMkiY','274KGsjiy','28512176cHEmmP','5318978EOsHWc','10722231yJuxRf','1028232mhPUrj','5YHQYTU','9948870hikTgY','1718SzaxPu','7293252UnLEht','8LRJvkh'];a39_0x1b37=function(){return _0x3224b5;};return a39_0x1b37();}(function(_0x50381e,_0x4d5455){var _0x110005=a39_0x5f11,_0x2d7932=_0x50381e();while(!![]){try{var _0x3ed785=parseInt(_0x110005(0x13d))/0x1*(parseInt(_0x110005(0x141))/0x2)+parseInt(_0x110005(0x140))/0x3*(parseInt(_0x110005(0x145))/0x4)+parseInt(_0x110005(0x146))/0x5*(-parseInt(_0x110005(0x13e))/0x6)+parseInt(_0x110005(0x143))/0x7+parseInt(_0x110005(0x13f))/0x8*(-parseInt(_0x110005(0x144))/0x9)+-parseInt(_0x110005(0x13c))/0xa+parseInt(_0x110005(0x142))/0xb;if(_0x3ed785===_0x4d5455)break;else _0x2d7932['push'](_0x2d7932['shift']());}catch(_0x3dc4bf){_0x2d7932['push'](_0x2d7932['shift']());}}}(a39_0x1b37,0xaacac));export*from'./types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./client/http-client.js';export*from'./client/td-client.js';export{TrinoClient}from'./client/trino-client.js';export*from'./client/rate-limiter.js';export*from'./types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';function a39_0x5f11(_0x1fe488,_0x51a1c6){var _0x1b372a=a39_0x1b37();return a39_0x5f11=function(_0x5f117f,_0x2f016a){_0x5f117f=_0x5f117f-0x13c;var _0x25474e=_0x1b372a[_0x5f117f];return _0x25474e;},a39_0x5f11(_0x1fe488,_0x51a1c6);}export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';