@treasuredata/tdx 0.1.18 → 0.1.20

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 (115) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-client.d.ts +2 -2
  7. package/dist/client/llm-client.d.ts.map +1 -1
  8. package/dist/client/llm-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-client.js +1 -1
  11. package/dist/client/trino-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/chat-command.js.map +1 -1
  17. package/dist/commands/claude-command.d.ts.map +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-command.js.map +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/context-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/job-command.js +1 -1
  25. package/dist/commands/llm-command.d.ts.map +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/llm-command.js.map +1 -1
  28. package/dist/commands/llm-proxy.d.ts.map +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/llm-proxy.js.map +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pwd-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/global-context.js +1 -1
  48. package/dist/core/profile.js +1 -1
  49. package/dist/core/project-config.js +1 -1
  50. package/dist/core/session.js +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/proxy/anthropic-adapter.d.ts +3 -3
  53. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  54. package/dist/proxy/anthropic-adapter.js +1 -1
  55. package/dist/proxy/anthropic-adapter.js.map +1 -1
  56. package/dist/proxy/server.d.ts +5 -3
  57. package/dist/proxy/server.d.ts.map +1 -1
  58. package/dist/proxy/server.js +1 -1
  59. package/dist/proxy/server.js.map +1 -1
  60. package/dist/sdk/api.js +1 -1
  61. package/dist/sdk/database.js +1 -1
  62. package/dist/sdk/errors.d.ts +3 -1
  63. package/dist/sdk/errors.d.ts.map +1 -1
  64. package/dist/sdk/errors.js +1 -1
  65. package/dist/sdk/errors.js.map +1 -1
  66. package/dist/sdk/index.js +1 -1
  67. package/dist/sdk/job.js +1 -1
  68. package/dist/sdk/llm.d.ts +14 -0
  69. package/dist/sdk/llm.d.ts.map +1 -1
  70. package/dist/sdk/llm.js +1 -1
  71. package/dist/sdk/llm.js.map +1 -1
  72. package/dist/sdk/query.js +1 -1
  73. package/dist/sdk/segment.js +1 -1
  74. package/dist/sdk/table.js +1 -1
  75. package/dist/sdk/workflow.js +1 -1
  76. package/dist/types/endpoints.js +1 -1
  77. package/dist/types/index.d.ts +41 -21
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/dist/types/index.js +1 -1
  80. package/dist/utils/agent-ref-parser.js +1 -1
  81. package/dist/utils/chat-cache.js +1 -1
  82. package/dist/utils/colors.d.ts +4 -0
  83. package/dist/utils/colors.d.ts.map +1 -1
  84. package/dist/utils/colors.js +1 -1
  85. package/dist/utils/colors.js.map +1 -1
  86. package/dist/utils/command-output.js +1 -1
  87. package/dist/utils/file-permissions.js +1 -1
  88. package/dist/utils/format-detector.js +1 -1
  89. package/dist/utils/formatters.js +1 -1
  90. package/dist/utils/json-loader.js +1 -1
  91. package/dist/utils/model-aliases.d.ts +15 -0
  92. package/dist/utils/model-aliases.d.ts.map +1 -1
  93. package/dist/utils/model-aliases.js +1 -1
  94. package/dist/utils/model-aliases.js.map +1 -1
  95. package/dist/utils/option-validation.js +1 -1
  96. package/dist/utils/port.js +1 -1
  97. package/dist/utils/process.js +1 -1
  98. package/dist/utils/prompt.js +1 -1
  99. package/dist/utils/segment-path-parser.js +1 -1
  100. package/dist/utils/segment-ref-parser.js +1 -1
  101. package/dist/utils/spinner.js +1 -1
  102. package/dist/utils/sql-parser.js +1 -1
  103. package/dist/utils/sse-parser.d.ts +2 -2
  104. package/dist/utils/sse-parser.d.ts.map +1 -1
  105. package/dist/utils/sse-parser.js +1 -1
  106. package/dist/utils/sse-parser.js.map +1 -1
  107. package/dist/utils/string-utils.js +1 -1
  108. package/dist/utils/table-ref-parser.js +1 -1
  109. package/dist/utils/tree-formatter.js +1 -1
  110. package/dist/utils/version-check.d.ts +28 -0
  111. package/dist/utils/version-check.d.ts.map +1 -0
  112. package/dist/utils/version-check.js +1 -0
  113. package/dist/utils/version-check.js.map +1 -0
  114. package/dist/utils/workflow-utils.js +1 -1
  115. 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_0x57ce4f=a30_0x66f7;(function(_0x4fb914,_0x3b4879){const _0x440eb3=a30_0x66f7,_0x177ee0=_0x4fb914();while(!![]){try{const _0x57524e=-parseInt(_0x440eb3(0x1e5))/0x1*(-parseInt(_0x440eb3(0x20a))/0x2)+parseInt(_0x440eb3(0x1fb))/0x3+-parseInt(_0x440eb3(0x1f5))/0x4*(parseInt(_0x440eb3(0x1eb))/0x5)+-parseInt(_0x440eb3(0x1dd))/0x6*(-parseInt(_0x440eb3(0x1f4))/0x7)+parseInt(_0x440eb3(0x1e9))/0x8*(-parseInt(_0x440eb3(0x1ec))/0x9)+-parseInt(_0x440eb3(0x1f7))/0xa+parseInt(_0x440eb3(0x1fa))/0xb*(parseInt(_0x440eb3(0x1ff))/0xc);if(_0x57524e===_0x3b4879)break;else _0x177ee0['push'](_0x177ee0['shift']());}catch(_0x3bbc0c){_0x177ee0['push'](_0x177ee0['shift']());}}}(a30_0x3843,0x7fb0b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x66f7(_0x1adf66,_0x199bef){const _0x3843eb=a30_0x3843();return a30_0x66f7=function(_0x66f787,_0x10d051){_0x66f787=_0x66f787-0x1dc;let _0x12d822=_0x3843eb[_0x66f787];return _0x12d822;},a30_0x66f7(_0x1adf66,_0x199bef);}function a30_0x3843(){const _0x40fdd9=['6712gNGSAD','Error:\x20','470580aLmLIt','6219EzzUOa','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','error','Database:\x20','verbose','List\x20tables\x20in\x20a\x20database','list','length','189JEazLb','44OEfIxg','\x20table','2979870ixckPV','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x27\x20across\x20all\x20databases.','33flXInI','1225131dQsRUx','execute','database','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','4161408OqbIzd','message','includes','table','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','✖\x20No\x20tables\x20found','tables','data','\x27\x20is\x20ambiguous.','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','34welyso','Or\x20use\x20--in\x20flag:','113430wRpiwo','cause','Site:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Cause:\x20','\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--database\x20','validate','28051JOJrya','Listing\x20tables...','\x20\x20Use:\x20tdx\x20tables\x20\x22','name'];a30_0x3843=function(){return _0x40fdd9;};return a30_0x3843();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x57ce4f(0x1e8)]=a30_0x57ce4f(0x205);['description']=a30_0x57ce4f(0x1f1);async[a30_0x57ce4f(0x1fc)](_0x36511f){const _0x2b99b5=a30_0x57ce4f,{options:_0x299824,args:_0x12ef74,tdx:_0x270f70}=_0x36511f;let _0x10bf38;if(_0x12ef74[_0x2b99b5(0x1f3)]===0x0)_0x10bf38={'database':undefined,'table':undefined,'original':''};else{if(_0x12ef74['length']===0x1)try{_0x10bf38=parseTableReference(_0x12ef74[0x0]);if(_0x10bf38[_0x2b99b5(0x202)]&&!_0x10bf38[_0x2b99b5(0x1fd)]&&!_0x10bf38['table'][_0x2b99b5(0x201)]('*')&&!_0x10bf38[_0x2b99b5(0x202)][_0x2b99b5(0x201)]('?'))return console[_0x2b99b5(0x1ee)]('Error:\x20Pattern\x20\x27'+_0x12ef74[0x0]+_0x2b99b5(0x207)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1fe)+_0x10bf38['table']+'\x27?'),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e7)+_0x10bf38[_0x2b99b5(0x202)]+'.*\x22'),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x209)+_0x10bf38[_0x2b99b5(0x202)]),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e3)+_0x10bf38[_0x2b99b5(0x202)]),console[_0x2b99b5(0x1ee)](''),console['error']('Note:\x20\x27'+_0x12ef74[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x10bf38[_0x2b99b5(0x202)]+_0x2b99b5(0x1f9)),0x1;}catch(_0x258a29){return console[_0x2b99b5(0x1ee)]('Error:\x20'+_0x258a29[_0x2b99b5(0x200)]),0x1;}else return console['error'](_0x2b99b5(0x1e0)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e2)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x203)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1ed)),console['error'](_0x2b99b5(0x1f8)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1dc)),console[_0x2b99b5(0x1ee)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x463c0b=_0x299824['database'];!_0x10bf38['database']&&_0x463c0b&&(_0x10bf38[_0x2b99b5(0x1fd)]=_0x463c0b);try{const _0x2a8625=_0x49649e=>_0x49649e&&(_0x49649e[_0x2b99b5(0x201)]('*')||_0x49649e[_0x2b99b5(0x201)]('?')),_0x406835=_0x2a8625(_0x10bf38[_0x2b99b5(0x1fd)]);_0x299824[_0x2b99b5(0x1f0)]&&(console['error'](_0x2b99b5(0x1df)+_0x299824['site']),_0x10bf38['database']?_0x406835?console[_0x2b99b5(0x1ee)]('Database\x20pattern:\x20'+_0x10bf38['database']):console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1ef)+_0x10bf38[_0x2b99b5(0x1fd)]):console['error']('Database:\x20all'),_0x10bf38[_0x2b99b5(0x202)]&&console[_0x2b99b5(0x1ee)]('Table\x20pattern:\x20'+_0x10bf38[_0x2b99b5(0x202)]));const _0x1b1f44=_0x10bf38[_0x2b99b5(0x1fd)]&&!_0x406835?_0x10bf38[_0x2b99b5(0x1fd)]:undefined,_0x136fff=_0x406835?_0x10bf38[_0x2b99b5(0x1fd)]:undefined,_0x1380ae=_0x10bf38[_0x2b99b5(0x202)],_0x11ace5=await withSpinner(_0x2b99b5(0x1e6),()=>_0x270f70[_0x2b99b5(0x202)][_0x2b99b5(0x1f2)](_0x1b1f44,_0x1380ae,_0x136fff),{'verbose':_0x299824[_0x2b99b5(0x1f0)]}),_0x342b37=_0x11ace5[_0x2b99b5(0x206)];if(_0x342b37[_0x2b99b5(0x1f3)]===0x0&&_0x10bf38[_0x2b99b5(0x1fd)]&&!_0x406835)return console[_0x2b99b5(0x1ee)](_0x2b99b5(0x204)),console[_0x2b99b5(0x1ee)]('Database\x20\x27'+_0x10bf38[_0x2b99b5(0x1fd)]+_0x2b99b5(0x208)),0x1;return console[_0x2b99b5(0x1ee)]('✔\x20Found\x20'+_0x342b37[_0x2b99b5(0x1f3)]+_0x2b99b5(0x1f6)+(_0x342b37[_0x2b99b5(0x1f3)]!==0x1?'s':'')),await handleSDKOutput(_0x342b37,_0x299824),0x0;}catch(_0x533898){if(_0x533898 instanceof SDKError)return console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1ea)+_0x533898[_0x2b99b5(0x200)]),_0x533898[_0x2b99b5(0x1de)]&&console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e1)+_0x533898[_0x2b99b5(0x1de)]),0x1;throw _0x533898;}}[a30_0x57ce4f(0x1e4)](_0xd6b237){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
+ function a31_0x44d7(){const _0x59ae44=['includes','log','use','9952QfqHaA','6396840jrPHVn','length','database','40611ERWCXx','Session\x20database\x20set\x20to:\x20','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Invalid\x20resource:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','8yKuCgy','toString','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','description','validate','parent_segment','23480ATCwVj','18pJyAju','message','profile','\x20(session:\x20','execute','495890ZbdZxx','166329wtekMo','776044nZotsV','error','\x27\x20does\x20not\x20exist','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','56ljHYiI','session','join','3916cocIwo','llm_project'];a31_0x44d7=function(){return _0x59ae44;};return a31_0x44d7();}const a31_0x28a7c0=a31_0x4895;(function(_0x296314,_0x313378){const _0x4212c2=a31_0x4895,_0x48c865=_0x296314();while(!![]){try{const _0x40eedf=parseInt(_0x4212c2(0x186))/0x1+parseInt(_0x4212c2(0x19d))/0x2*(-parseInt(_0x4212c2(0x198))/0x3)+parseInt(_0x4212c2(0x187))/0x4+parseInt(_0x4212c2(0x1a9))/0x5*(parseInt(_0x4212c2(0x1a4))/0x6)+parseInt(_0x4212c2(0x18c))/0x7*(parseInt(_0x4212c2(0x194))/0x8)+parseInt(_0x4212c2(0x195))/0x9+parseInt(_0x4212c2(0x1a3))/0xa*(-parseInt(_0x4212c2(0x18f))/0xb);if(_0x40eedf===_0x313378)break;else _0x48c865['push'](_0x48c865['shift']());}catch(_0x276242){_0x48c865['push'](_0x48c865['shift']());}}}(a31_0x44d7,0x77466));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a31_0x4895(_0x2ca8d7,_0x473e04){const _0x44d782=a31_0x44d7();return a31_0x4895=function(_0x48956f,_0x1058fa){_0x48956f=_0x48956f-0x186;let _0x57ad4=_0x44d782[_0x48956f];return _0x57ad4;},a31_0x4895(_0x2ca8d7,_0x473e04);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{['name']=a31_0x28a7c0(0x193);[a31_0x28a7c0(0x1a0)]='Set\x20session-level\x20context';[a31_0x28a7c0(0x1a1)](_0x37af02){const _0x5a8e9c=a31_0x28a7c0,{args:_0x5a019e}=_0x37af02;if(_0x5a019e[_0x5a8e9c(0x196)]<0x2)return _0x5a8e9c(0x18a)+_0x5a8e9c(0x19c)+_0x5a8e9c(0x19a)+_0x5a8e9c(0x19f);const _0x14fa7b=_0x5a019e[0x0],_0x3a21f1=['database','parent_segment',_0x5a8e9c(0x190),_0x5a8e9c(0x1a6)];if(!_0x3a21f1[_0x5a8e9c(0x191)](_0x14fa7b))return _0x5a8e9c(0x19b)+_0x14fa7b+'.\x20Must\x20be\x20one\x20of:\x20'+_0x3a21f1[_0x5a8e9c(0x18e)](',\x20');return undefined;}async[a31_0x28a7c0(0x1a8)](_0x2678c2){const _0x2da156=a31_0x28a7c0,{args:_0xc4f6c5,options:_0x2598dc}=_0x2678c2;try{const _0x326bab=_0xc4f6c5[0x0],_0x10fe52=_0xc4f6c5[0x1];if(_0x326bab===_0x2da156(0x1a6)){if(!profileExists(_0x10fe52))return console[_0x2da156(0x188)]('Error:\x20Profile\x20\x27'+_0x10fe52+_0x2da156(0x189)),console[_0x2da156(0x188)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x3374a8=_0x2598dc[_0x2da156(0x18d)]||getCurrentSessionPID()[_0x2da156(0x19e)]();return saveSessionContext({'profile':_0x10fe52},_0x2598dc[_0x2da156(0x18d)]),console[_0x2da156(0x192)]('Session\x20profile\x20set\x20to:\x20'+_0x10fe52+_0x2da156(0x1a7)+_0x3374a8+')'),console['log'](_0x2da156(0x18b)),0x0;}const _0x5cc6ec={},_0x1f9cfc=_0x2598dc[_0x2da156(0x18d)]||getCurrentSessionPID()[_0x2da156(0x19e)]();switch(_0x326bab){case _0x2da156(0x197):_0x5cc6ec['database']=_0x10fe52,console[_0x2da156(0x192)](_0x2da156(0x199)+_0x10fe52+'\x20(session:\x20'+_0x1f9cfc+')');break;case _0x2da156(0x1a2):_0x5cc6ec[_0x2da156(0x1a2)]=_0x10fe52,console[_0x2da156(0x192)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x10fe52+_0x2da156(0x1a7)+_0x1f9cfc+')');break;case _0x2da156(0x190):_0x5cc6ec[_0x2da156(0x190)]=_0x10fe52,console['log']('Session\x20llm_project\x20set\x20to:\x20'+_0x10fe52+'\x20(session:\x20'+_0x1f9cfc+')');break;}return saveSessionContext(_0x5cc6ec,_0x2598dc['session']),console[_0x2da156(0x192)](_0x2da156(0x18b)),0x0;}catch(_0x195e86){return _0x195e86 instanceof Error&&console[_0x2da156(0x188)]('Error:\x20'+_0x195e86[_0x2da156(0x1a5)]),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_0x5b5461=a32_0xe2d5;(function(_0x3485a8,_0x25379c){const _0x22b278=a32_0xe2d5,_0x2820d8=_0x3485a8();while(!![]){try{const _0x544298=-parseInt(_0x22b278(0xf4))/0x1+parseInt(_0x22b278(0xf3))/0x2*(-parseInt(_0x22b278(0x113))/0x3)+parseInt(_0x22b278(0x131))/0x4+parseInt(_0x22b278(0xf1))/0x5*(parseInt(_0x22b278(0xe2))/0x6)+parseInt(_0x22b278(0xfe))/0x7+-parseInt(_0x22b278(0xd7))/0x8*(-parseInt(_0x22b278(0xde))/0x9)+-parseInt(_0x22b278(0x10c))/0xa;if(_0x544298===_0x25379c)break;else _0x2820d8['push'](_0x2820d8['shift']());}catch(_0x7ce750){_0x2820d8['push'](_0x2820d8['shift']());}}}(a32_0x2d8f,0x9515e));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{['name']=a32_0x5b5461(0x12d);['description']=a32_0x5b5461(0xd6);async['execute'](_0x5bd498){const _0x596ef1=a32_0x5b5461,{options:_0x108ffe,args:_0x579e0d,tdx:_0x2572d9}=_0x5bd498,_0x30e5bd=_0x579e0d[0x0];try{_0x108ffe[_0x596ef1(0x108)]&&_0x30e5bd&&console[_0x596ef1(0x12a)](_0x596ef1(0xd5)+_0x30e5bd);const _0x1ff21b=await withSpinner(_0x596ef1(0xcf),()=>_0x2572d9[_0x596ef1(0xd1)][_0x596ef1(0xed)](_0x30e5bd,{'limit':_0x108ffe[_0x596ef1(0x120)]}),{'verbose':_0x108ffe['verbose']}),_0x39dfe7=_0x1ff21b[_0x596ef1(0x13f)];return console[_0x596ef1(0x12a)](_0x596ef1(0x121)+_0x39dfe7[_0x596ef1(0x130)]+_0x596ef1(0x142)+(_0x39dfe7[_0x596ef1(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x39dfe7,_0x108ffe),0x0;}catch(_0x296d7a){if(_0x296d7a instanceof SDKError)return console['error'](_0x596ef1(0xdd)+_0x296d7a['message']),_0x296d7a[_0x596ef1(0x135)]&&console[_0x596ef1(0x12a)](_0x596ef1(0x102)+_0x296d7a['cause']),0x1;throw _0x296d7a;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x5b5461(0x126)]='workflow:workflows';[a32_0x5b5461(0x123)]=a32_0x5b5461(0x103);async[a32_0x5b5461(0x101)](_0x32483b){const _0x498118=a32_0x5b5461,{options:_0x25a848,args:_0x5ed856,tdx:_0x358239}=_0x32483b,_0x314694=_0x5ed856[0x0];try{_0x25a848[_0x498118(0x108)]&&_0x314694&&console[_0x498118(0x12a)](_0x498118(0xfb)+_0x314694);const _0xdda83d=await withSpinner(_0x498118(0xf8),()=>_0x358239[_0x498118(0xd1)][_0x498118(0xea)](_0x314694,{'limit':_0x25a848['limit']}),{'verbose':_0x25a848[_0x498118(0x108)]}),_0x4679fc=_0xdda83d[_0x498118(0x13f)];return console['error'](_0x498118(0x121)+_0x4679fc[_0x498118(0x130)]+_0x498118(0x128)+(_0x4679fc[_0x498118(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x4679fc,_0x25a848),0x0;}catch(_0x2c57b5){if(_0x2c57b5 instanceof SDKError)return console['error'](_0x498118(0xdd)+_0x2c57b5[_0x498118(0xd8)]),_0x2c57b5['cause']&&console[_0x498118(0x12a)]('\x20\x20Cause:\x20'+_0x2c57b5[_0x498118(0x135)]),0x1;throw _0x2c57b5;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0xf6);['description']=a32_0x5b5461(0x116);async[a32_0x5b5461(0x101)](_0x32fa05){const _0x5d0f96=a32_0x5b5461,{options:_0x2c413d,args:_0x30df00,tdx:_0x5850c8}=_0x32fa05;let _0x26e0c8,_0x535b00;if(_0x30df00[0x0]){const _0x5622ba=_0x30df00[0x0][_0x5d0f96(0xe8)]('.');if(_0x5622ba[_0x5d0f96(0x130)]===0x1)_0x26e0c8=_0x5622ba[0x0];else{if(_0x5622ba[_0x5d0f96(0x130)]===0x2)[_0x26e0c8,_0x535b00]=_0x5622ba;else return console[_0x5d0f96(0x12a)](_0x5d0f96(0x132)),0x1;}}try{if(_0x2c413d[_0x5d0f96(0x108)]){if(_0x26e0c8&&_0x535b00)console[_0x5d0f96(0x12a)](_0x5d0f96(0x148)+_0x26e0c8+'.'+_0x535b00);else _0x26e0c8&&console[_0x5d0f96(0x12a)]('Filter:\x20project='+_0x26e0c8);const _0x5d6280=_0x2c413d[_0x5d0f96(0xcd)];_0x5d6280&&console['error'](_0x5d0f96(0xf0)+_0x5d6280);}const _0x2eeab0=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5850c8[_0x5d0f96(0xd1)][_0x5d0f96(0xd0)]({'projectName':_0x26e0c8,'workflowName':_0x535b00,'status':_0x2c413d[_0x5d0f96(0xcd)],'fromTime':_0x2c413d[_0x5d0f96(0x11c)],'toTime':_0x2c413d['to'],'limit':_0x2c413d[_0x5d0f96(0x120)]}),{'verbose':_0x2c413d[_0x5d0f96(0x108)]}),_0x278f38=_0x2eeab0['data'];return console['error'](_0x5d0f96(0x121)+_0x278f38[_0x5d0f96(0x130)]+_0x5d0f96(0x12c)+(_0x278f38[_0x5d0f96(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x278f38,_0x2c413d),0x0;}catch(_0x3af399){if(_0x3af399 instanceof SDKError)return console[_0x5d0f96(0x12a)]('Error:\x20'+_0x3af399[_0x5d0f96(0xd8)]),_0x3af399[_0x5d0f96(0x135)]&&console[_0x5d0f96(0x12a)](_0x5d0f96(0x102)+_0x3af399[_0x5d0f96(0x135)]),0x1;throw _0x3af399;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a32_0x5b5461(0x109);[a32_0x5b5461(0x123)]=a32_0x5b5461(0xcb);async[a32_0x5b5461(0x101)](_0x4a4db3){const _0x259d58=a32_0x5b5461,{options:_0x2676d2,args:_0x4c4857,tdx:_0xe63ab7}=_0x4a4db3;let _0xf92844,_0x20b103;if(_0x4c4857[0x0]){const _0x2115d3=_0x4c4857[0x0][_0x259d58(0xe8)]('.');if(_0x2115d3[_0x259d58(0x130)]===0x1)_0xf92844=_0x2115d3[0x0];else{if(_0x2115d3[_0x259d58(0x130)]===0x2)[_0xf92844,_0x20b103]=_0x2115d3;else return console[_0x259d58(0x12a)](_0x259d58(0x132)),0x1;}}try{const _0x207b27=_0x2676d2[_0x259d58(0x11a)];if(_0x2676d2[_0x259d58(0x108)]){if(_0xf92844&&_0x20b103)console[_0x259d58(0x12a)](_0x259d58(0x148)+_0xf92844+'.'+_0x20b103);else _0xf92844&&console[_0x259d58(0x12a)](_0x259d58(0xd9)+_0xf92844);_0x207b27&&console[_0x259d58(0x12a)](_0x259d58(0x111));}const _0x52656f=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0xe63ab7[_0x259d58(0xd1)]['attempts']({'projectName':_0xf92844,'workflowName':_0x20b103,'includeRetried':_0x207b27,'limit':_0x2676d2[_0x259d58(0x120)]}),{'verbose':_0x2676d2['verbose']}),_0x267007=_0x52656f[_0x259d58(0x13f)];return console[_0x259d58(0x12a)](_0x259d58(0x121)+_0x267007[_0x259d58(0x130)]+'\x20attempt'+(_0x267007[_0x259d58(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x267007,_0x2676d2),0x0;}catch(_0x272463){if(_0x272463 instanceof SDKError)return console[_0x259d58(0x12a)](_0x259d58(0xdd)+_0x272463['message']),_0x272463[_0x259d58(0x135)]&&console[_0x259d58(0x12a)](_0x259d58(0x102)+_0x272463[_0x259d58(0x135)]),0x1;throw _0x272463;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x5b5461(0x126)]='workflow:attempt';[a32_0x5b5461(0x123)]=a32_0x5b5461(0x125);async[a32_0x5b5461(0x101)](_0x5f2558){const _0x4eecc0=a32_0x5b5461,{options:_0x132e38,args:_0x845f9b,tdx:_0x40e17a}=_0x5f2558,_0x5e030c=_0x845f9b[0x0];if(!_0x5e030c)return console[_0x4eecc0(0x12a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x132e38['verbose']&&console[_0x4eecc0(0x12a)](_0x4eecc0(0x115)+_0x5e030c);const _0x268cd0=await withSpinner('Getting\x20attempt\x20details...',()=>_0x40e17a[_0x4eecc0(0xd1)][_0x4eecc0(0xd3)](_0x5e030c),{'verbose':_0x132e38[_0x4eecc0(0x108)]}),_0x271bef=_0x268cd0['data'];return await handleSDKOutput([_0x271bef],_0x132e38),0x0;}catch(_0x1b647e){if(_0x1b647e instanceof SDKError)return console[_0x4eecc0(0x12a)](_0x4eecc0(0xdd)+_0x1b647e[_0x4eecc0(0xd8)]),_0x1b647e[_0x4eecc0(0x135)]&&console['error'](_0x4eecc0(0x102)+_0x1b647e[_0x4eecc0(0x135)]),0x1;throw _0x1b647e;}}}export class WorkflowTasksCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0x13a);[a32_0x5b5461(0x123)]='Show\x20tasks\x20for\x20an\x20attempt';async[a32_0x5b5461(0x101)](_0x3193b0){const _0x59cf73=a32_0x5b5461,{options:_0x5634a2,args:_0x2e7e32,tdx:_0x4eb8f0}=_0x3193b0,_0x39ab5e=_0x2e7e32[0x0];if(!_0x39ab5e)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x41f35e=_0x5634a2['includeSubtasks'];_0x5634a2['verbose']&&(console[_0x59cf73(0x12a)](_0x59cf73(0x115)+_0x39ab5e),_0x41f35e&&console['error']('Including\x20subtasks:\x20yes'));const _0x284ae2=await withSpinner(_0x59cf73(0xdc),()=>_0x4eb8f0[_0x59cf73(0xd1)][_0x59cf73(0xf9)](_0x39ab5e,_0x41f35e||![]),{'verbose':_0x5634a2['verbose']}),_0xf08d6=_0x284ae2[_0x59cf73(0x13f)];return console[_0x59cf73(0x12a)](_0x59cf73(0x121)+_0xf08d6[_0x59cf73(0x130)]+'\x20task'+(_0xf08d6['length']!==0x1?'s':'')),await handleSDKOutput(_0xf08d6,_0x5634a2),0x0;}catch(_0x46bc9b){if(_0x46bc9b instanceof SDKError)return console[_0x59cf73(0x12a)](_0x59cf73(0xdd)+_0x46bc9b[_0x59cf73(0xd8)]),_0x46bc9b[_0x59cf73(0x135)]&&console[_0x59cf73(0x12a)](_0x59cf73(0x102)+_0x46bc9b['cause']),0x1;throw _0x46bc9b;}}}function a32_0x2d8f(){const _0x50b2dc=['Usage:\x20workflow:delete\x20<project-name-or-id>','From\x20task:\x20','length','3125564sWmZHm','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:retry','Output\x20directory:\x20','cause','Error:\x20Project\x20name\x20is\x20required','readFile','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','attemptId','workflow:tasks','revision','Task\x20name:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','data','Error:\x20Invalid\x20JSON\x20in\x20--params','parse','\x20project','✔\x20Pushed\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Deleting\x20project\x20','✔\x20Retry\x20started','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Filter:\x20','Killing\x20attempt...','projectId','Show\x20logs\x20for\x20a\x20specific\x20task','List\x20workflow\x20attempts','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','status','\x20\x20Revision:\x20','Listing\x20workflow\x20projects...','sessions','workflow','...','attempt','skipValidation','Pattern:\x20','List\x20all\x20workflow\x20projects','144VhItmW','message','Filter:\x20project=','offset','Validation:\x20skipped','Getting\x20attempt\x20tasks...','Error:\x20','74133nwQKEj','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','startsWith','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','1842phZvLX','retryAttempt','ies','session','filesExtracted','\x20\x20Project\x20ID:\x20','split','\x20\x20New\x20attempt\x20ID:\x20','workflows','retrySession','resumeFrom','projects','sessionId','isDirectory','Status:\x20','18110vUZmjd','session:','34PqSbBa','813269ohAyYx','params','workflow:sessions','Cancelled','Listing\x20workflows...','tasks','workflow:delete','Project\x20filter:\x20','reason','Error:\x20Attempt\x20ID\x20is\x20required','6541423SdWKak','\x20\x20Files\x20extracted:\x20','projectName','execute','\x20\x20Cause:\x20','List\x20workflows','attempt:','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','delete','Downloading\x20project\x20','verbose','workflow:attempts','\x20\x20Session\x20ID:\x20','workflow:download','9398200ZLsjAu','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','yes','✔\x20Deleted\x20project\x20','Force:\x20yes','Include\x20retried:\x20yes','Project:\x20','108063WxKEAF','fromTask','Attempt\x20ID:\x20','List\x20workflow\x20execution\x20sessions','Reason:\x20','Getting\x20task\x20logs...','push','includeRetried','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','from','substring','workflow:logs','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','limit','✔\x20Found\x20','Retrying\x20attempt...','description','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Show\x20specific\x20attempt\x20details','name','Revision:\x20','\x20workflow','stat','error','Resume\x20from:\x20','\x20session','workflow:projects'];a32_0x2d8f=function(){return _0x50b2dc;};return a32_0x2d8f();}export class WorkflowLogsCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0x11e);[a32_0x5b5461(0x123)]=a32_0x5b5461(0x14b);async[a32_0x5b5461(0x101)](_0x53888a){const _0x2d77b3=a32_0x5b5461,{options:_0x508472,args:_0x189840,tdx:_0x1e9df3}=_0x53888a,_0x117754=_0x189840[0x0],_0x46194=_0x189840[0x1];if(!_0x117754||!_0x46194)return console[_0x2d77b3(0x12a)](_0x2d77b3(0x105)),0x1;try{_0x508472[_0x2d77b3(0x108)]&&(console[_0x2d77b3(0x12a)](_0x2d77b3(0x115)+_0x117754),console[_0x2d77b3(0x12a)](_0x2d77b3(0x13c)+_0x46194));const _0x4cef2d=_0x508472[_0x2d77b3(0xda)],_0x50b1f4=await withSpinner(_0x2d77b3(0x118),()=>_0x1e9df3['workflow']['logs'](_0x117754,_0x46194,{'offset':_0x4cef2d,'limit':_0x508472[_0x2d77b3(0x120)]}),{'verbose':_0x508472['verbose']}),_0x800e72=_0x50b1f4['data'];return console[_0x2d77b3(0x12a)](_0x2d77b3(0x121)+_0x800e72['length']+'\x20log\x20entr'+(_0x800e72[_0x2d77b3(0x130)]!==0x1?_0x2d77b3(0xe4):'y')),await handleSDKOutput(_0x800e72,_0x508472),0x0;}catch(_0x3c7f9d){if(_0x3c7f9d instanceof SDKError)return console[_0x2d77b3(0x12a)](_0x2d77b3(0xdd)+_0x3c7f9d[_0x2d77b3(0xd8)]),_0x3c7f9d[_0x2d77b3(0x135)]&&console[_0x2d77b3(0x12a)](_0x2d77b3(0x102)+_0x3c7f9d['cause']),0x1;throw _0x3c7f9d;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x5b5461(0x126)]='workflow:kill';[a32_0x5b5461(0x123)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x5db412){const _0x10e89e=a32_0x5b5461,{options:_0x4398ce,args:_0x2f6697,tdx:_0x200867}=_0x5db412,_0x2d92b9=_0x2f6697[0x0];if(!_0x2d92b9)return console[_0x10e89e(0x12a)](_0x10e89e(0xfd)),0x1;try{const _0x52ac7d=_0x4398ce[_0x10e89e(0xfc)];_0x4398ce[_0x10e89e(0x108)]&&(console[_0x10e89e(0x12a)]('Attempt\x20ID:\x20'+_0x2d92b9),_0x52ac7d&&console['error'](_0x10e89e(0x117)+_0x52ac7d));if(!_0x4398ce['yes']){const _0xbe267a=await confirm(_0x10e89e(0x124)+_0x2d92b9+'?');if(!_0xbe267a)return console[_0x10e89e(0x12a)](_0x10e89e(0xf7)),0x0;}const _0x1ca29a=await withSpinner(_0x10e89e(0x149),()=>_0x200867[_0x10e89e(0xd1)]['kill'](_0x2d92b9,_0x52ac7d),{'verbose':_0x4398ce['verbose']}),_0x49622e=_0x1ca29a['data'];return console[_0x10e89e(0x12a)]('✔\x20'+_0x49622e),0x0;}catch(_0x2c28b0){if(_0x2c28b0 instanceof SDKError)return console[_0x10e89e(0x12a)](_0x10e89e(0xdd)+_0x2c28b0[_0x10e89e(0xd8)]),_0x2c28b0[_0x10e89e(0x135)]&&console[_0x10e89e(0x12a)](_0x10e89e(0x102)+_0x2c28b0['cause']),0x1;throw _0x2c28b0;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x5b5461(0x133);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x5b5461(0x101)](_0x3fb1ba){const _0x33dd78=a32_0x5b5461,{options:_0x5e15d1,args:_0x156af1,tdx:_0x2953a0}=_0x3fb1ba,_0x4430cc=_0x156af1[0x0];if(!_0x4430cc)return console['error'](_0x33dd78(0xdf)),console[_0x33dd78(0x12a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x14ac69=![],_0x351e35=_0x4430cc;if(_0x4430cc[_0x33dd78(0xe0)](_0x33dd78(0xf2)))_0x14ac69=!![],_0x351e35=_0x4430cc['substring'](0x8);else{if(_0x4430cc[_0x33dd78(0xe0)](_0x33dd78(0x104)))_0x14ac69=![],_0x351e35=_0x4430cc[_0x33dd78(0x11d)](0x8);else return console[_0x33dd78(0x12a)](_0x33dd78(0x13e)),console[_0x33dd78(0x12a)](_0x33dd78(0x11b)),0x1;}try{const _0x360263=_0x5e15d1[_0x33dd78(0x114)],_0x5d1623=_0x5e15d1[_0x33dd78(0xec)],_0x55b610=_0x5e15d1[_0x33dd78(0xf5)],_0x57f378=_0x5e15d1['force'];_0x5e15d1[_0x33dd78(0x108)]&&(console[_0x33dd78(0x12a)]('Target:\x20'+(_0x14ac69?_0x33dd78(0xe5):_0x33dd78(0xd3))+'\x20'+_0x351e35),_0x360263&&console[_0x33dd78(0x12a)](_0x33dd78(0x12f)+_0x360263),_0x5d1623&&console['error'](_0x33dd78(0x12b)+_0x5d1623),_0x55b610&&console[_0x33dd78(0x12a)]('Params:\x20'+_0x55b610),_0x57f378&&console[_0x33dd78(0x12a)](_0x33dd78(0x110)));let _0x401235;if(_0x55b610)try{if(_0x55b610['startsWith']('@')){const _0x4a8f06=await import('fs/promises'),_0x9bd2f5=_0x55b610[_0x33dd78(0x11d)](0x1),_0x37ad23=await _0x4a8f06[_0x33dd78(0x137)](_0x9bd2f5,'utf-8');_0x401235=JSON[_0x33dd78(0x141)](_0x37ad23);}else _0x401235=JSON[_0x33dd78(0x141)](_0x55b610);}catch{return console[_0x33dd78(0x12a)](_0x33dd78(0x140)),0x1;}if(!_0x5e15d1['yes']){const _0x8c3740=await confirm(_0x33dd78(0x147)+(_0x14ac69?'session':_0x33dd78(0xd3))+'\x20'+_0x351e35+'?');if(!_0x8c3740)return console['error'](_0x33dd78(0xf7)),0x0;}let _0xa02ee5;_0x14ac69?_0xa02ee5=await withSpinner('Retrying\x20session...',()=>_0x2953a0['workflow'][_0x33dd78(0xeb)](_0x351e35,{'fromTask':_0x360263,'retryParams':_0x401235}),{'verbose':_0x5e15d1[_0x33dd78(0x108)]}):_0xa02ee5=await withSpinner(_0x33dd78(0x122),()=>_0x2953a0['workflow'][_0x33dd78(0xe3)](_0x351e35,{'resumeFrom':_0x5d1623,'retryParams':_0x401235,'force':_0x57f378}),{'verbose':_0x5e15d1['verbose']});const _0x16d256=_0xa02ee5['data'];return console[_0x33dd78(0x12a)](_0x33dd78(0x146)),console[_0x33dd78(0x12a)](_0x33dd78(0xe9)+_0x16d256[_0x33dd78(0x139)]),console[_0x33dd78(0x12a)](_0x33dd78(0x10a)+_0x16d256[_0x33dd78(0xee)]),0x0;}catch(_0x520c7e){if(_0x520c7e instanceof SDKError)return console[_0x33dd78(0x12a)]('Error:\x20'+_0x520c7e[_0x33dd78(0xd8)]),_0x520c7e[_0x33dd78(0x135)]&&console['error'](_0x33dd78(0x102)+_0x520c7e['cause']),0x1;throw _0x520c7e;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0x10b);['description']=a32_0x5b5461(0xe1);async[a32_0x5b5461(0x101)](_0x14785e){const _0x180417=a32_0x5b5461,{options:_0x2279d9,args:_0x3e2cec,tdx:_0xac173d}=_0x14785e,_0x5b9755=_0x3e2cec[0x0],_0x525ac9=_0x3e2cec[0x1]||'.';if(!_0x5b9755)return console['error'](_0x180417(0x136)),console['error'](_0x180417(0x10d)),0x1;const _0x2ca220=_0x2279d9['revision'];_0x2279d9[_0x180417(0x108)]&&(console['error'](_0x180417(0x112)+_0x5b9755),console[_0x180417(0x12a)](_0x180417(0x134)+_0x525ac9),_0x2ca220&&console['error'](_0x180417(0x127)+_0x2ca220));const _0xa4eafb=await withSpinner(_0x180417(0x107)+_0x5b9755+'...',()=>_0xac173d[_0x180417(0xd1)]['download'](_0x5b9755,_0x525ac9,{'revision':_0x2ca220}),{'verbose':_0x2279d9[_0x180417(0x108)]}),_0x1eae64=_0xa4eafb[_0x180417(0x13f)];return console[_0x180417(0x12a)]('✔\x20Downloaded\x20'+_0x1eae64[_0x180417(0x100)]),console[_0x180417(0x12a)](_0x180417(0xce)+_0x1eae64[_0x180417(0x13b)]),console[_0x180417(0x12a)](_0x180417(0xff)+_0x1eae64[_0x180417(0xe6)]),console['error']('\x20\x20Location:\x20'+_0x525ac9+'/'+_0x1eae64['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';['description']=a32_0x5b5461(0xcc);async[a32_0x5b5461(0x101)](_0x564029){const _0x172551=a32_0x5b5461,{options:_0x523c06,args:_0x1a641f,tdx:_0x248290}=_0x564029;let _0x45750d='.',_0x4e7c19=_0x523c06[_0x172551(0x126)];if(_0x1a641f[0x0]){const {promises:_0x3b7d53}=await import('fs');try{const _0x337112=await _0x3b7d53[_0x172551(0x129)](_0x1a641f[0x0]);if(_0x337112[_0x172551(0xef)]())_0x45750d=_0x1a641f[0x0];else return console[_0x172551(0x12a)]('Error:\x20'+_0x1a641f[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x4e7c19=_0x1a641f[0x0],_0x45750d='.';}}const _0x434fb4=_0x523c06[_0x172551(0x13b)],_0x2ea97a=_0x523c06[_0x172551(0xd4)];_0x523c06[_0x172551(0x108)]&&(console[_0x172551(0x12a)]('Project\x20directory:\x20'+_0x45750d),_0x4e7c19&&console['error']('Project\x20name:\x20'+_0x4e7c19),_0x434fb4&&console[_0x172551(0x12a)]('Revision:\x20'+_0x434fb4),_0x2ea97a&&console[_0x172551(0x12a)](_0x172551(0xdb)));const _0x51a75c=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x248290[_0x172551(0xd1)][_0x172551(0x119)](_0x45750d,{'projectName':_0x4e7c19,'revision':_0x434fb4,'skipValidation':_0x2ea97a}),{'verbose':_0x523c06[_0x172551(0x108)]}),_0x5909bf=_0x51a75c[_0x172551(0x13f)];return console['error'](_0x172551(0x143)+_0x5909bf[_0x172551(0x100)]),console[_0x172551(0x12a)](_0x172551(0xe7)+_0x5909bf['projectId']),console[_0x172551(0x12a)](_0x172551(0xce)+_0x5909bf[_0x172551(0x13b)]),0x0;}}function a32_0xe2d5(_0x4aa0ca,_0x33417d){const _0x2d8ff1=a32_0x2d8f();return a32_0xe2d5=function(_0xe2d5ac,_0x4dd646){_0xe2d5ac=_0xe2d5ac-0xcb;let _0x1d23d0=_0x2d8ff1[_0xe2d5ac];return _0x1d23d0;},a32_0xe2d5(_0x4aa0ca,_0x33417d);}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0xfa);[a32_0x5b5461(0x123)]=a32_0x5b5461(0x144);async['execute'](_0x55af6f){const _0x5ea8f3=a32_0x5b5461,{options:_0xf78f2f,args:_0x1cf046,tdx:_0x441f4b}=_0x55af6f,_0x4daff0=_0x1cf046[0x0];if(!_0x4daff0)return console[_0x5ea8f3(0x12a)](_0x5ea8f3(0x138)),console['error'](_0x5ea8f3(0x12e)),0x1;_0xf78f2f['verbose']&&console[_0x5ea8f3(0x12a)]('Project:\x20'+_0x4daff0);if(!_0xf78f2f[_0x5ea8f3(0x10e)]){const _0x205d70=await confirm(_0x5ea8f3(0x11f)+_0x4daff0+_0x5ea8f3(0x13d));if(!_0x205d70)return console[_0x5ea8f3(0x12a)](_0x5ea8f3(0xf7)),0x0;}const _0x4cb097=await withSpinner(_0x5ea8f3(0x145)+_0x4daff0+_0x5ea8f3(0xd2),()=>_0x441f4b[_0x5ea8f3(0xd1)][_0x5ea8f3(0x106)](_0x4daff0),{'verbose':_0xf78f2f[_0x5ea8f3(0x108)]}),_0x472af6=_0x4cb097[_0x5ea8f3(0x13f)];return console['error'](_0x5ea8f3(0x10f)+_0x472af6[_0x5ea8f3(0x100)]),console['error'](_0x5ea8f3(0xe7)+_0x472af6[_0x5ea8f3(0x14a)]),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(_0x29fa8d,_0x5c06a4){const _0x102387=a33_0x732b,_0x187463=_0x29fa8d();while(!![]){try{const _0x1a2b0d=-parseInt(_0x102387(0x1cf))/0x1+parseInt(_0x102387(0x1dc))/0x2*(parseInt(_0x102387(0x1d8))/0x3)+-parseInt(_0x102387(0x1d2))/0x4*(-parseInt(_0x102387(0x1d9))/0x5)+-parseInt(_0x102387(0x1d0))/0x6*(parseInt(_0x102387(0x1d7))/0x7)+parseInt(_0x102387(0x1cb))/0x8+-parseInt(_0x102387(0x1da))/0x9*(parseInt(_0x102387(0x1d4))/0xa)+-parseInt(_0x102387(0x1cd))/0xb*(parseInt(_0x102387(0x1d6))/0xc);if(_0x1a2b0d===_0x5c06a4)break;else _0x187463['push'](_0x187463['shift']());}catch(_0x2517d1){_0x187463['push'](_0x187463['shift']());}}}(a33_0x3524,0x4cc21));import{platform}from'os';function a33_0x732b(_0x3372cc,_0xf3d538){const _0x3524d4=a33_0x3524();return a33_0x732b=function(_0x732b09,_0x3cde92){_0x732b09=_0x732b09-0x1c8;let _0x3e0f94=_0x3524d4[_0x732b09];return _0x3e0f94;},a33_0x732b(_0x3372cc,_0xf3d538);}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a33_0x3524(){const _0x192dc2=['350PnkQIz','18ruCgVJ',';\x20node/','268TRWNtd','Authorization','0.0.0','utf-8','tdx','3523616SokCrt','X-Trino-User','14806cawlvF','parse','185916YqAJWc','917646sQETWm','version','35408UPEKMy','TD1\x20','2404210ozKiZW','entries','2868lqpOFt','7ZiUaVl','8859aAdAxi'];a33_0x3524=function(){return _0x192dc2;};return a33_0x3524();}import{getAPIKey}from'./config.js';export function getVersion(){const _0x3f7052=a33_0x732b;try{const _0x429521=fileURLToPath(import.meta['url']),_0x383889=dirname(_0x429521),_0x495f10=join(_0x383889,'../../package.json'),_0x3bbcf1=JSON[_0x3f7052(0x1ce)](readFileSync(_0x495f10,_0x3f7052(0x1c9)));return _0x3bbcf1[_0x3f7052(0x1d1)];}catch{return _0x3f7052(0x1c8);}}export function getUserAgent(){const _0x1f9edc=a33_0x732b,_0x2d87e4=getVersion(),_0x4f463d=platform(),_0x356da9=process[_0x1f9edc(0x1d1)]['replace']('v','');return'tdx/'+_0x2d87e4+'\x20('+_0x4f463d+_0x1f9edc(0x1db)+_0x356da9+')';}export function getAuthHeaders(_0x573404,_0x30c2ec){const _0x4c198d=a33_0x732b,_0x20aa10=getVersion(),_0x1cd34b={'User-Agent':getUserAgent(),'X-TD-Client':_0x4c198d(0x1ca),'X-TD-Client-Version':_0x20aa10};return _0x30c2ec&&(_0x1cd34b[_0x4c198d(0x1dd)]=_0x4c198d(0x1d3)+_0x30c2ec),_0x1cd34b;}export function toHeaderRecord(_0x3baf30){const _0x55b7bc=a33_0x732b,_0x535d3d={};for(const [_0x2674df,_0x247de7]of Object[_0x55b7bc(0x1d5)](_0x3baf30)){_0x247de7!==undefined&&(_0x535d3d[_0x2674df]=_0x247de7);}return _0x535d3d;}export function getTrinoHeaders(_0x271c9f,_0xdf354){const _0xde2d69=a33_0x732b,_0x136dbd=getAuthHeaders(_0x271c9f,_0xdf354),_0x54f389=toHeaderRecord(_0x136dbd);return delete _0x54f389[_0xde2d69(0x1dd)],_0xdf354&&(_0x54f389[_0xde2d69(0x1cc)]=_0xdf354),_0x54f389;}export function hasAPIKey(_0x5060f9){const _0x2381d1=getAPIKey(_0x5060f9);return _0x2381d1!==undefined&&_0x2381d1['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(_0x51981e,_0x354989){const _0x7c1fae=a34_0x4ec4,_0x3dcbc5=_0x51981e();while(!![]){try{const _0x5bde26=parseInt(_0x7c1fae(0x1eb))/0x1+parseInt(_0x7c1fae(0x20e))/0x2*(parseInt(_0x7c1fae(0x212))/0x3)+-parseInt(_0x7c1fae(0x21d))/0x4*(parseInt(_0x7c1fae(0x220))/0x5)+parseInt(_0x7c1fae(0x1f9))/0x6+-parseInt(_0x7c1fae(0x1fa))/0x7+parseInt(_0x7c1fae(0x1f0))/0x8*(parseInt(_0x7c1fae(0x222))/0x9)+-parseInt(_0x7c1fae(0x208))/0xa;if(_0x5bde26===_0x354989)break;else _0x3dcbc5['push'](_0x3dcbc5['shift']());}catch(_0x24b645){_0x3dcbc5['push'](_0x3dcbc5['shift']());}}}(a34_0x7891,0x2e27a));import{homedir}from'os';function a34_0x7891(){const _0x6ae049=['Warning:\x20Failed\x20to\x20load\x20','includes','2818140QDdYBr','parse','join','env:\x20','ap03','profiles','2lnvksU','error','eu01','profile:\x20','537831IzaSMV','dev-us01','.env','\x20(TD_API_KEY)','.cache','jp01','split','match','profile','tdx','stg-ap03','11740VRKEhC','TD_API_KEY','\x27,\x20defaulting\x20to\x20us01','445TrbQDc','endsWith','52830GstMwf','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','dev-eu01','278098heKYZV','.config','env','ap02','TDX_CACHE_DIR','256CcjJRV','apiKeys','us01','env:\x20TD_API_KEY','stg-us01','readFileSync','replace','map','tdx.json','1441818NqAmpR','1074073iYyUsS','warn','TD_API_KEY_','existsSync','stg-jp01','trim','toUpperCase','global:\x20','.env.','startsWith','utf-8','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:'];a34_0x7891=function(){return _0x6ae049;};return a34_0x7891();}import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x5eb77a from'node:fs';import*as a34_0x39b6dc from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x1b2166=a34_0x4ec4;return process[_0x1b2166(0x1ed)]['TDX_CONFIG_DIR']||join(homedir(),_0x1b2166(0x1ec),_0x1b2166(0x21b));}export function getConfigFile(){const _0x4e78c4=a34_0x4ec4;return join(getConfigDir(),_0x4e78c4(0x214));}export function getCacheDir(){const _0x2bee4b=a34_0x4ec4;return process[_0x2bee4b(0x1ed)][_0x2bee4b(0x1ef)]||join(homedir(),_0x2bee4b(0x216),_0x2bee4b(0x21b));}export function getLLMProjectCacheFile(){return join(getCacheDir(),'llm_default_project');}export function readCachedLLMProject(){const _0x375001=a34_0x4ec4;try{const _0x4b8c2e=getLLMProjectCacheFile();if(!existsSync(_0x4b8c2e))return null;return readFileSync(_0x4b8c2e,_0x375001(0x204))[_0x375001(0x1ff)]();}catch{return null;}}export function writeCachedLLMProject(_0x3d1b69){const _0x1781be=a34_0x4ec4;try{const _0x505e1d=getCacheDir(),_0x27ba28=getLLMProjectCacheFile();!existsSync(_0x505e1d)&&mkdirSync(_0x505e1d,{'recursive':!![]}),writeFileSync(_0x27ba28,_0x3d1b69,_0x1781be(0x204));}catch(_0x48dc24){console[_0x1781be(0x20f)](_0x1781be(0x205),_0x48dc24);}}export function parseEnvFile(_0x1fd159){const _0x24128e=a34_0x4ec4,_0x4cdc02={};for(const _0x3dedab of _0x1fd159[_0x24128e(0x218)]('\x0a')){const _0x45d07e=_0x3dedab[_0x24128e(0x1ff)]();if(!_0x45d07e||_0x45d07e[_0x24128e(0x203)]('#'))continue;const _0x38fb06=_0x45d07e[_0x24128e(0x219)](/^([^=]+)=(.*)$/);if(_0x38fb06){const _0x1d0eba=_0x38fb06[0x1][_0x24128e(0x1ff)]();let _0x47ec92=_0x38fb06[0x2]['trim']();(_0x47ec92['startsWith']('\x22')&&_0x47ec92[_0x24128e(0x221)]('\x22')||_0x47ec92[_0x24128e(0x203)]('\x27')&&_0x47ec92[_0x24128e(0x221)]('\x27'))&&(_0x47ec92=_0x47ec92['slice'](0x1,-0x1)),_0x4cdc02[_0x1d0eba]=_0x47ec92;}}return _0x4cdc02;}export function readUserConfig(){const _0x19f6cc=a34_0x4ec4,_0x3b1c7d=getConfigFile();if(!existsSync(_0x3b1c7d))return{};try{const _0xdafb49=readFileSync(_0x3b1c7d,_0x19f6cc(0x204));return parseEnvFile(_0xdafb49);}catch(_0x5aea1a){return console[_0x19f6cc(0x1fb)](_0x19f6cc(0x223)+_0x3b1c7d+':',_0x5aea1a),{};}}export function resolveSite(_0x3c2bfe){const _0x330f93=a34_0x4ec4,_0x4d0abc=[_0x330f93(0x1f2),_0x330f93(0x217),_0x330f93(0x210),_0x330f93(0x1ee),_0x330f93(0x20c),_0x330f93(0x213),_0x330f93(0x224),_0x330f93(0x1f4),_0x330f93(0x1fe),_0x330f93(0x21c)];if(_0x4d0abc[_0x330f93(0x207)](_0x3c2bfe))return _0x3c2bfe;if(_0x3c2bfe in SITE_ALIASES)return SITE_ALIASES[_0x3c2bfe];return console[_0x330f93(0x1fb)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3c2bfe+_0x330f93(0x21f)),_0x330f93(0x1f2);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}function a34_0x4ec4(_0x4694fc,_0x21dcc9){const _0x789108=a34_0x7891();return a34_0x4ec4=function(_0x4ec40d,_0x26f2db){_0x4ec40d=_0x4ec40d-0x1eb;let _0x198f57=_0x789108[_0x4ec40d];return _0x198f57;},a34_0x4ec4(_0x4694fc,_0x21dcc9);}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3fdc96,_0x46db07){const _0x14b89c=a34_0x4ec4,_0x3bd6b5=_0x3fdc96['toUpperCase']()[_0x14b89c(0x1f6)](/-/g,'_'),_0x5403fd=_0x14b89c(0x1fc)+_0x3bd6b5;if(process[_0x14b89c(0x1ed)][_0x5403fd])return process[_0x14b89c(0x1ed)][_0x5403fd];if(process[_0x14b89c(0x1ed)][_0x14b89c(0x21e)])return process['env'][_0x14b89c(0x21e)];const _0x87980a=_0x46db07||getActiveProfileName();if(_0x87980a){const _0x17de6d=loadProfileEnv(_0x87980a);if(_0x17de6d){if(_0x17de6d[_0x5403fd])return _0x17de6d[_0x5403fd];if(_0x17de6d[_0x14b89c(0x21e)])return _0x17de6d[_0x14b89c(0x21e)];}}const _0x324a90=loadUserConfigOnce();if(_0x324a90[_0x5403fd])return _0x324a90[_0x5403fd];if(_0x324a90[_0x14b89c(0x21e)])return _0x324a90['TD_API_KEY'];return undefined;}export function getAPIKeySource(_0x489efe,_0x4849cd){const _0x144682=a34_0x4ec4,_0x8953ad=_0x144682(0x1fc)+_0x489efe[_0x144682(0x200)]()[_0x144682(0x1f6)](/-/g,'_');if(process['env'][_0x8953ad])return _0x144682(0x20b)+_0x8953ad;if(process[_0x144682(0x1ed)][_0x144682(0x21e)])return _0x144682(0x1f3);const _0x5268e6=_0x4849cd||getActiveProfileName();if(_0x5268e6){const _0x1ceff6=loadProfileEnv(_0x5268e6);if(_0x1ceff6){if(_0x1ceff6[_0x8953ad])return _0x144682(0x211)+_0x5268e6+'\x20('+_0x8953ad+')';if(_0x1ceff6['TD_API_KEY'])return _0x144682(0x211)+_0x5268e6+_0x144682(0x215);}}const _0x345436=loadUserConfigOnce(),_0xb13289=getConfigFile();if(_0x345436[_0x8953ad])return _0x144682(0x201)+_0xb13289+'\x20('+_0x8953ad+')';if(_0x345436[_0x144682(0x21e)])return'global:\x20'+_0xb13289+'\x20(TD_API_KEY)';return null;}function loadProfileEnv(_0x327368){const _0x2510e2=a34_0x4ec4,_0x95728a=a34_0x39b6dc[_0x2510e2(0x20a)](getConfigDir(),_0x2510e2(0x202)+_0x327368);if(a34_0x5eb77a['existsSync'](_0x95728a)){validateSecureFilePermissions(_0x95728a);try{const _0x2cd9aa=a34_0x5eb77a[_0x2510e2(0x1f5)](_0x95728a,_0x2510e2(0x204));return parseEnvFile(_0x2cd9aa);}catch(_0x301ecf){console[_0x2510e2(0x1fb)](_0x2510e2(0x206)+_0x95728a+':\x20'+_0x301ecf);}}const _0x48306a=a34_0x39b6dc[_0x2510e2(0x20a)](getConfigDir(),_0x2510e2(0x20d),_0x327368,'.env');if(a34_0x5eb77a[_0x2510e2(0x1fd)](_0x48306a)){validateSecureFilePermissions(_0x48306a);try{const _0x332f7a=a34_0x5eb77a[_0x2510e2(0x1f5)](_0x48306a,_0x2510e2(0x204));return parseEnvFile(_0x332f7a);}catch(_0x5520f8){return console[_0x2510e2(0x1fb)](_0x2510e2(0x206)+_0x48306a+':\x20'+_0x5520f8),null;}}return null;}function getActiveProfileName(){const _0xe57096=a34_0x4ec4,_0x3999eb=a34_0x39b6dc['join'](getConfigDir(),_0xe57096(0x1f8));if(!a34_0x5eb77a[_0xe57096(0x1fd)](_0x3999eb))return null;try{const _0x5fd2a7=a34_0x5eb77a[_0xe57096(0x1f5)](_0x3999eb,_0xe57096(0x204)),_0x5a40a4=JSON[_0xe57096(0x209)](_0x5fd2a7);return _0x5a40a4[_0xe57096(0x21a)]||null;}catch{return null;}}export function saveAPIKey(_0xb87bde,_0x270329){const _0xff843d=a34_0x4ec4,_0x51c576=getConfigDir(),_0x20c9d7=getConfigFile();!existsSync(_0x51c576)&&mkdirSync(_0x51c576,{'recursive':!![],'mode':0x1c0});const _0xb670c4=readUserConfig(),_0x32e0f9=_0xb87bde[_0xff843d(0x200)]()[_0xff843d(0x1f6)](/-/g,'_');_0xb670c4[_0xff843d(0x1fc)+_0x32e0f9]=_0x270329;const _0x3411e2=Object['entries'](_0xb670c4)[_0xff843d(0x1f7)](([_0x58d477,_0x52b4f7])=>_0x58d477+'='+_0x52b4f7);writeFileSync(_0x20c9d7,_0x3411e2[_0xff843d(0x20a)]('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x5be56a=a34_0x4ec4,_0x328a25={'apiKeys':{},'defaultSite':_0x5be56a(0x1f2)},_0x53bc80=[_0x5be56a(0x1f2),'jp01','eu01','ap02',_0x5be56a(0x20c),_0x5be56a(0x213),_0x5be56a(0x224),_0x5be56a(0x1f4),_0x5be56a(0x1fe),_0x5be56a(0x21c)];for(const _0xa28a45 of _0x53bc80){const _0x24f83a=getAPIKey(_0xa28a45);_0x24f83a&&(_0x328a25[_0x5be56a(0x1f1)][_0xa28a45]=_0x24f83a);}return _0x328a25;}
@@ -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_0x27612b=a35_0x4899;(function(_0x5e7c48,_0x3cd67b){const _0x304c8d=a35_0x4899,_0xad5df3=_0x5e7c48();while(!![]){try{const _0x298c08=parseInt(_0x304c8d(0x1ee))/0x1+parseInt(_0x304c8d(0x211))/0x2+parseInt(_0x304c8d(0x201))/0x3*(-parseInt(_0x304c8d(0x1de))/0x4)+parseInt(_0x304c8d(0x218))/0x5+-parseInt(_0x304c8d(0x1e6))/0x6*(parseInt(_0x304c8d(0x210))/0x7)+parseInt(_0x304c8d(0x202))/0x8+parseInt(_0x304c8d(0x219))/0x9;if(_0x298c08===_0x3cd67b)break;else _0xad5df3['push'](_0xad5df3['shift']());}catch(_0xd006da){_0xad5df3['push'](_0xad5df3['shift']());}}}(a35_0x29d6,0x9c408));function a35_0x29d6(){const _0x4ee56b=['.json','injectIntoOptions','segmentPath','activeProfile','(active)','7dyxLLP','1310584TcZAga','project','parent_segment','(session:\x20','segment_path','profiles','CLI\x20flag:\x20--','946850fbuPNj','5987493OhmKiL','Project','configFiles','getParameters','52GZkDrS','ppid','apiKey','config','Global','profileCredentials','existsSync','loadGlobalConfig','6511926SMaFia','globalCredentials','join','us01','verbose','not\x20set','displayWithSources','utf-8','669893CxqpKG','toString','global','Profile','profile','Session','profile:\x20','llmProject','.env','llm_project','database','tdx.json','string','log','parse','session','Profile\x20Credentials','sessions','getSource','262623sawLFD','5468240oRnbAF','Global\x20Credentials','sessionId','default','cliFlags','[context]','site','parentSegment','layers'];a35_0x29d6=function(){return _0x4ee56b;};return a35_0x29d6();}function a35_0x4899(_0xc6e584,_0x25db98){const _0x29d63e=a35_0x29d6();return a35_0x4899=function(_0x489937,_0x2c5aad){_0x489937=_0x489937-0x1dc;let _0x373ae5=_0x29d63e[_0x489937];return _0x373ae5;},a35_0x4899(_0xc6e584,_0x25db98);}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_0x565ff0 from'node:fs';import*as a35_0x2ba9a7 from'node:path';export class GlobalContext{['site'];['database'];[a35_0x27612b(0x213)];[a35_0x27612b(0x215)];[a35_0x27612b(0x1f7)];[a35_0x27612b(0x1e0)];[a35_0x27612b(0x1ea)];[a35_0x27612b(0x20a)];[a35_0x27612b(0x20e)];[a35_0x27612b(0x204)];['configFiles'];constructor(_0x5b0d75){const _0x2ba4ce=a35_0x27612b;this[_0x2ba4ce(0x204)]=_0x5b0d75[_0x2ba4ce(0x1fd)]||process[_0x2ba4ce(0x1df)][_0x2ba4ce(0x1ef)]();const _0x90b20b=loadSessionContext(_0x5b0d75[_0x2ba4ce(0x1fd)]),_0x20d94e=loadProjectConfig(),_0x558fad=this[_0x2ba4ce(0x1e5)]();this[_0x2ba4ce(0x20e)]=_0x5b0d75[_0x2ba4ce(0x1f2)]||_0x90b20b?.[_0x2ba4ce(0x1f2)]||_0x558fad[_0x2ba4ce(0x1f2)]||getActiveProfile();const _0x48b5e2=this[_0x2ba4ce(0x20e)]?loadProfile(this[_0x2ba4ce(0x20e)]):null,_0x313590=_0x351ae2=>{const _0x2210e2=_0x2ba4ce;if(!_0x351ae2)return{};const _0x415881=_0x351ae2,_0x19c297={};for(const [_0x399fbe,_0x433095]of Object['entries'](_0x415881)){typeof _0x433095===_0x2210e2(0x1fa)&&(_0x19c297[_0x399fbe]=_0x433095);}return _0x19c297;},_0x14b7d5={};if(_0x5b0d75[_0x2ba4ce(0x208)]&&_0x5b0d75[_0x2ba4ce(0x208)]!==_0x2ba4ce(0x1e9))_0x14b7d5[_0x2ba4ce(0x208)]=_0x5b0d75[_0x2ba4ce(0x208)];const _0x5e7466=_0x90b20b?.[_0x2ba4ce(0x1f8)],_0x18916f=_0x20d94e?.[_0x2ba4ce(0x1f8)],_0x2c4413=_0x48b5e2?.[_0x2ba4ce(0x1e1)]?.[_0x2ba4ce(0x1f8)],_0x54fc39=_0x558fad[_0x2ba4ce(0x1f8)];_0x5b0d75[_0x2ba4ce(0x1f8)]&&(_0x5b0d75['database']!==_0x5e7466&&_0x5b0d75[_0x2ba4ce(0x1f8)]!==_0x18916f&&_0x5b0d75[_0x2ba4ce(0x1f8)]!==_0x2c4413&&_0x5b0d75[_0x2ba4ce(0x1f8)]!==_0x54fc39)&&(_0x14b7d5[_0x2ba4ce(0x1f8)]=_0x5b0d75['database']);if(_0x5b0d75[_0x2ba4ce(0x209)])_0x14b7d5['parent_segment']=_0x5b0d75[_0x2ba4ce(0x209)];if(_0x5b0d75[_0x2ba4ce(0x1f5)])_0x14b7d5[_0x2ba4ce(0x1f7)]=_0x5b0d75[_0x2ba4ce(0x1f5)];if(_0x5b0d75[_0x2ba4ce(0x1f2)])_0x14b7d5[_0x2ba4ce(0x1f2)]=_0x5b0d75['profile'];this['layers']={'cliFlags':_0x14b7d5,'session':_0x313590(_0x90b20b),'project':_0x313590(_0x20d94e),'profile':_0x313590(_0x48b5e2?.[_0x2ba4ce(0x1e1)]),'global':_0x313590(_0x558fad)};const _0x5ab785={...this[_0x2ba4ce(0x20a)][_0x2ba4ce(0x1f0)],...this[_0x2ba4ce(0x20a)][_0x2ba4ce(0x1f2)],...this['layers'][_0x2ba4ce(0x212)],...this[_0x2ba4ce(0x20a)][_0x2ba4ce(0x1fd)],...this[_0x2ba4ce(0x20a)]['cliFlags']},_0x250fab=_0x5ab785[_0x2ba4ce(0x208)]||_0x2ba4ce(0x1e9);this[_0x2ba4ce(0x208)]=resolveSite(_0x250fab),this[_0x2ba4ce(0x1f8)]=_0x5ab785[_0x2ba4ce(0x1f8)],this[_0x2ba4ce(0x213)]=_0x5ab785[_0x2ba4ce(0x213)],this[_0x2ba4ce(0x215)]=_0x5ab785[_0x2ba4ce(0x215)],this[_0x2ba4ce(0x1f7)]=_0x5ab785[_0x2ba4ce(0x1f7)],this[_0x2ba4ce(0x1ea)]=_0x5b0d75[_0x2ba4ce(0x1ea)]||![],this['apiKey']=getAPIKey(this[_0x2ba4ce(0x208)],this[_0x2ba4ce(0x20e)]||undefined);const _0x205439=getConfigDir(),_0x38b155=a35_0x2ba9a7['join'](_0x205439,_0x2ba4ce(0x1ff),this['sessionId']+_0x2ba4ce(0x20b)),_0x5571da=findProjectConfigPath(),_0x3eb8a6=a35_0x2ba9a7[_0x2ba4ce(0x1e8)](_0x205439,_0x2ba4ce(0x1f9)),_0x976747=a35_0x2ba9a7[_0x2ba4ce(0x1e8)](_0x205439,'.env');let _0x48ced0=null,_0x5a53e4=null;this[_0x2ba4ce(0x20e)]&&(_0x48ced0=a35_0x2ba9a7[_0x2ba4ce(0x1e8)](_0x205439,_0x2ba4ce(0x216),this[_0x2ba4ce(0x20e)],_0x2ba4ce(0x1f9)),_0x5a53e4=a35_0x2ba9a7[_0x2ba4ce(0x1e8)](_0x205439,_0x2ba4ce(0x216),this[_0x2ba4ce(0x20e)],_0x2ba4ce(0x1f6))),this[_0x2ba4ce(0x1dc)]={'session':a35_0x565ff0[_0x2ba4ce(0x1e4)](_0x38b155)?_0x38b155:null,'project':_0x5571da,'profile':_0x48ced0&&a35_0x565ff0['existsSync'](_0x48ced0)?_0x48ced0:null,'profileCredentials':_0x5a53e4&&a35_0x565ff0[_0x2ba4ce(0x1e4)](_0x5a53e4)?_0x5a53e4:null,'global':a35_0x565ff0[_0x2ba4ce(0x1e4)](_0x3eb8a6)?_0x3eb8a6:null,'globalCredentials':a35_0x565ff0[_0x2ba4ce(0x1e4)](_0x976747)?_0x976747:null};}['getSource'](_0x37c561,_0x2cf1b3){const _0x2c26a2=a35_0x27612b;if(!_0x2cf1b3)return _0x2c26a2(0x1eb);const _0x4bdd4c=_0x2cf1b3;if(this['layers'][_0x2c26a2(0x206)][_0x37c561]===_0x4bdd4c){if(_0x37c561===_0x2c26a2(0x208)&&_0x4bdd4c===_0x2c26a2(0x1e9)&&!this['layers']['session']['site']&&!this['layers'][_0x2c26a2(0x212)][_0x2c26a2(0x208)]&&!this['layers'][_0x2c26a2(0x1f2)]['site']&&!this['layers'][_0x2c26a2(0x1f0)]['site'])return _0x2c26a2(0x205);return _0x2c26a2(0x217)+_0x37c561['replace'](/_/g,'-');}if(this[_0x2c26a2(0x20a)][_0x2c26a2(0x1fd)][_0x37c561]===_0x4bdd4c)return _0x2c26a2(0x1fd);if(this[_0x2c26a2(0x20a)][_0x2c26a2(0x212)][_0x37c561]===_0x4bdd4c)return _0x2c26a2(0x212);if(this[_0x2c26a2(0x20a)][_0x2c26a2(0x1f2)][_0x37c561]===_0x4bdd4c)return _0x2c26a2(0x1f4)+this[_0x2c26a2(0x20e)];if(this[_0x2c26a2(0x20a)][_0x2c26a2(0x1f0)][_0x37c561]===_0x4bdd4c)return _0x2c26a2(0x1f0);return _0x2c26a2(0x205);}[a35_0x27612b(0x1e5)](){const _0x4ec839=a35_0x27612b,_0x12d743=a35_0x2ba9a7['join'](getConfigDir(),_0x4ec839(0x1f9));if(!a35_0x565ff0[_0x4ec839(0x1e4)](_0x12d743))return{};try{const _0x2b17db=a35_0x565ff0['readFileSync'](_0x12d743,_0x4ec839(0x1ed));return JSON[_0x4ec839(0x1fc)](_0x2b17db);}catch{return{};}}[a35_0x27612b(0x20c)](_0x22cbdd){const _0x19e677=a35_0x27612b;_0x22cbdd[_0x19e677(0x208)]=this[_0x19e677(0x208)],!_0x22cbdd['database']&&this[_0x19e677(0x1f8)]&&(_0x22cbdd['database']=this[_0x19e677(0x1f8)]),!_0x22cbdd[_0x19e677(0x209)]&&this[_0x19e677(0x213)]&&(_0x22cbdd[_0x19e677(0x209)]=this['parent_segment']),!_0x22cbdd[_0x19e677(0x20d)]&&this[_0x19e677(0x215)]&&(_0x22cbdd[_0x19e677(0x20d)]=this['segment_path']),!_0x22cbdd[_0x19e677(0x1f5)]&&this[_0x19e677(0x1f7)]&&(_0x22cbdd['llmProject']=this[_0x19e677(0x1f7)]);}[a35_0x27612b(0x1dd)](){const _0x15cf3b=a35_0x27612b;return[{'key':_0x15cf3b(0x208),'value':this['site']},{'key':'database','value':this[_0x15cf3b(0x1f8)]},{'key':'parent_segment','value':this['parent_segment']},{'key':_0x15cf3b(0x215),'value':this[_0x15cf3b(0x215)]},{'key':_0x15cf3b(0x1f7),'value':this[_0x15cf3b(0x1f7)]},{'key':'profile','value':this['activeProfile']||undefined}];}['display'](){const _0x3a66a0=a35_0x27612b;console[_0x3a66a0(0x1fb)](_0x3a66a0(0x207));for(const {key:_0x1ad24c,value:_0x1b238e}of this['getParameters']()){_0x1b238e&&console['log'](_0x1ad24c+':\x20'+_0x1b238e);}}[a35_0x27612b(0x1ec)](){const _0x2323d7=a35_0x27612b;console[_0x2323d7(0x1fb)](_0x2323d7(0x207));for(const {key:_0x1e6286,value:_0x5cb700}of this[_0x2323d7(0x1dd)]()){if(_0x5cb700){const _0x12e04e=_0x1e6286===_0x2323d7(0x1f2)?_0x2323d7(0x20f):'('+this[_0x2323d7(0x200)](_0x1e6286,_0x5cb700)+')';console[_0x2323d7(0x1fb)](_0x1e6286+':\x20'+_0x5cb700+'\x20'+_0x12e04e);}}console[_0x2323d7(0x1fb)]('\x0a[configuration\x20files]');const _0x2bd13e=[{'label':_0x2323d7(0x1f3),'path':this['configFiles']['session'],'extra':_0x2323d7(0x214)+this[_0x2323d7(0x204)]+')'},{'label':_0x2323d7(0x21a),'path':this[_0x2323d7(0x1dc)][_0x2323d7(0x212)]},{'label':_0x2323d7(0x1f1),'path':this[_0x2323d7(0x1dc)][_0x2323d7(0x1f2)]},{'label':_0x2323d7(0x1fe),'path':this[_0x2323d7(0x1dc)][_0x2323d7(0x1e3)]},{'label':_0x2323d7(0x1e2),'path':this['configFiles']['global']},{'label':_0x2323d7(0x203),'path':this[_0x2323d7(0x1dc)][_0x2323d7(0x1e7)]}];for(const {label:_0x1e4250,path:_0x5c2265,extra:_0x112f66}of _0x2bd13e){if(_0x5c2265)console[_0x2323d7(0x1fb)](_0x1e4250+':\x20'+_0x5c2265+'\x20✓'+(_0x112f66?'\x20'+_0x112f66:''));else{if(_0x1e4250==='Session')console[_0x2323d7(0x1fb)](_0x1e4250+':\x20none\x20(using\x20session:\x20'+this[_0x2323d7(0x204)]+')');else(_0x1e4250===_0x2323d7(0x21a)||_0x1e4250==='Global')&&console[_0x2323d7(0x1fb)](_0x1e4250+':\x20none');}}}}
@@ -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 a36_0x567e(){const _0x9aaacc=['llm_agent','local','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','5678240zbpBJM','existsSync','find','apiKey','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','2643570cELxPt','metadata','database','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','string','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','TD_API_KEY','11394512WCcaQH','8903658NUkmpi','filter','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','rmSync','description','tdx.json','\x22\x20\x22','\x20\x20mv\x20\x22','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','Error:\x20','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','directory','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','test','Profile\x20','includes','api_key','join','\x20already\x20exists','stringify','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','message','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','has','warn','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','name','utf-8','78484JXiznL','site','2sPlgcL','.env','8888265rxePmU','.env.','lastUsed','llm_project','readdirSync','map','\x27:\x20config\x20must\x20be\x20an\x20object','parse','\x20does\x20not\x20exist','keys','readFileSync','isDirectory','toISOString','length','Warning:\x20Profile\x20\x27','from','some','\x0aWarning:\x20Failed\x20to\x20parse\x20','object','set','170AJdZdk','parent_segment','\x27\x20will\x20be\x20ignored','localeCompare',':\x20Invalid\x20JSON\x20syntax','writeFileSync','profiles','push','\x27:\x20unknown\x20config\x20key\x20\x27','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','899233sUWHNS','7dKdokZ','Profile\x20\x27'];a36_0x567e=function(){return _0x9aaacc;};return a36_0x567e();}(function(_0x504a32,_0x27cbcb){const _0x203da1=a36_0x2603,_0x3336df=_0x504a32();while(!![]){try{const _0x51abb9=-parseInt(_0x203da1(0xab))/0x1*(-parseInt(_0x203da1(0x8b))/0x2)+parseInt(_0x203da1(0xb6))/0x3+parseInt(_0x203da1(0x89))/0x4*(-parseInt(_0x203da1(0xa1))/0x5)+parseInt(_0x203da1(0xbe))/0x6*(parseInt(_0x203da1(0xac))/0x7)+-parseInt(_0x203da1(0xbd))/0x8+-parseInt(_0x203da1(0x8d))/0x9+parseInt(_0x203da1(0xb1))/0xa;if(_0x51abb9===_0x27cbcb)break;else _0x3336df['push'](_0x3336df['shift']());}catch(_0x11cafb){_0x3336df['push'](_0x3336df['shift']());}}}(a36_0x567e,0xb7e19));import*as a36_0xd730d2 from'node:fs';import*as a36_0x4d8eeb from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';function a36_0x2603(_0x299fb3,_0x2ced31){const _0x567eec=a36_0x567e();return a36_0x2603=function(_0x260329,_0x51d65d){_0x260329=_0x260329-0x80;let _0x3e2e2a=_0x567eec[_0x260329];return _0x3e2e2a;},a36_0x2603(_0x299fb3,_0x2ced31);}export function getProfileParams(_0x33f0c9){const _0x37aaa2={};if(!_0x33f0c9)return _0x37aaa2;for(const [_0x6976b7,_0x19e2e2]of Object['entries'](_0x33f0c9)){_0x6976b7!=='description'&&_0x19e2e2!==undefined&&(_0x37aaa2[_0x6976b7]=_0x19e2e2);}return _0x37aaa2;}export function getProfilesDir(){const _0xa493a2=a36_0x2603;return a36_0x4d8eeb[_0xa493a2(0xd1)](getConfigDir(),_0xa493a2(0xa7));}function getProfileDir(_0x543180){const _0x2333eb=a36_0x2603;return a36_0x4d8eeb[_0x2333eb(0xd1)](getProfilesDir(),_0x543180);}function getProfileConfigPath(_0x4d67a1){const _0x8cb91a=a36_0x2603;return a36_0x4d8eeb[_0x8cb91a(0xd1)](getProfileDir(_0x4d67a1),'tdx.json');}function getProfileEnvPath(_0x554eb1){const _0xdfcbc9=a36_0x2603;return a36_0x4d8eeb[_0xdfcbc9(0xd1)](getProfileDir(_0x554eb1),_0xdfcbc9(0x8c));}function getGlobalConfigPath(){const _0x339707=a36_0x2603;return a36_0x4d8eeb[_0x339707(0xd1)](getConfigDir(),_0x339707(0xc4));}function validateProfileName(_0x12e93c){const _0x644d96=a36_0x2603;if(!/^[a-zA-Z0-9_-]+$/[_0x644d96(0xcd)](_0x12e93c))throw new Error('Invalid\x20profile\x20name:\x20'+_0x12e93c+_0x644d96(0xaa));}function validateProfileConfig(_0x194049,_0x42b67d){const _0x4b0595=a36_0x2603;if(typeof _0x194049!==_0x4b0595(0x9f)||_0x194049===null)throw new Error('Profile\x20\x27'+_0x42b67d+_0x4b0595(0x93));const _0xf78bc8=[_0x4b0595(0xc3),_0x4b0595(0x8a),_0x4b0595(0xb8),_0x4b0595(0xa2),'llm_project',_0x4b0595(0xae)],_0x4b7ff4=_0x194049;for(const _0x153499 of Object[_0x4b0595(0x96)](_0x4b7ff4)){!_0xf78bc8[_0x4b0595(0xcf)](_0x153499)&&console['warn'](_0x4b0595(0x9b)+_0x42b67d+_0x4b0595(0xa9)+_0x153499+_0x4b0595(0xa3));}if(_0x4b7ff4[_0x4b0595(0xc3)]!==undefined&&typeof _0x4b7ff4[_0x4b0595(0xc3)]!==_0x4b0595(0xba))throw new Error(_0x4b0595(0xad)+_0x42b67d+_0x4b0595(0xbb));if(_0x4b7ff4[_0x4b0595(0x8a)]!==undefined&&typeof _0x4b7ff4[_0x4b0595(0x8a)]!==_0x4b0595(0xba))throw new Error(_0x4b0595(0xad)+_0x42b67d+_0x4b0595(0xc9));if(_0x4b7ff4['database']!==undefined&&typeof _0x4b7ff4['database']!==_0x4b0595(0xba))throw new Error('Profile\x20\x27'+_0x42b67d+_0x4b0595(0xcc));if(_0x4b7ff4['parent_segment']!==undefined&&typeof _0x4b7ff4['parent_segment']!==_0x4b0595(0xba))throw new Error(_0x4b0595(0xad)+_0x42b67d+_0x4b0595(0x83));if(_0x4b7ff4[_0x4b0595(0x90)]!==undefined&&typeof _0x4b7ff4[_0x4b0595(0x90)]!==_0x4b0595(0xba))throw new Error(_0x4b0595(0xad)+_0x42b67d+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x4b7ff4[_0x4b0595(0xae)]!==undefined&&typeof _0x4b7ff4[_0x4b0595(0xae)]!=='string')throw new Error(_0x4b0595(0xad)+_0x42b67d+_0x4b0595(0x81));return!![];}function loadProfilesFromTdxJson(_0x13e336,_0x3b656b){const _0x2f510d=a36_0x2603;if(!a36_0xd730d2['existsSync'](_0x13e336))return[];try{const _0x5e3f24=a36_0xd730d2[_0x2f510d(0x97)](_0x13e336,_0x2f510d(0x88)),_0x7c9af5=JSON['parse'](_0x5e3f24);if(!_0x7c9af5[_0x2f510d(0xa7)]||typeof _0x7c9af5['profiles']!==_0x2f510d(0x9f))return[];const _0x51e526=[];for(const [_0x692720,_0xabd3b6]of Object['entries'](_0x7c9af5['profiles'])){try{validateProfileConfig(_0xabd3b6,_0x692720);const _0x5cf2b4=getNewCredentialPath(_0x692720),_0x5d2521=getOldCredentialPath(_0x692720),_0x13cf95=a36_0xd730d2['existsSync'](_0x5cf2b4)||a36_0xd730d2['existsSync'](_0x5d2521);_0x51e526['push']({'name':_0x692720,'config':_0xabd3b6,'metadata':{'name':_0x692720,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x13cf95,'scope':_0x3b656b});}catch(_0x11d8f6){_0x11d8f6 instanceof Error&&(console[_0x2f510d(0x85)](_0x2f510d(0xb0)+_0x13e336+':'),console[_0x2f510d(0x85)]('\x20\x20'+_0x11d8f6['message']+'\x0a'));}}return _0x51e526;}catch(_0x59594c){return _0x59594c instanceof SyntaxError?(console['warn'](_0x2f510d(0x9e)+_0x13e336+_0x2f510d(0xa5)),console[_0x2f510d(0x85)](_0x2f510d(0xc8)+_0x59594c[_0x2f510d(0x82)]+'\x0a')):console[_0x2f510d(0x85)](_0x2f510d(0xc1)+_0x13e336+':\x20'+_0x59594c+'\x0a'),[];}}export function getNewCredentialPath(_0x2135f0){const _0x5210b7=a36_0x2603;return a36_0x4d8eeb[_0x5210b7(0xd1)](getConfigDir(),_0x5210b7(0x8e)+_0x2135f0);}function getOldCredentialPath(_0x3e935d){const _0x4d6767=a36_0x2603;return a36_0x4d8eeb[_0x4d6767(0xd1)](getProfilesDir(),_0x3e935d,_0x4d6767(0x8c));}function loadProfilesFromTdxJsonFiles(){const _0x456710=a36_0x2603,_0x457abc=[],_0x144275=findProjectConfigPath();_0x144275&&_0x457abc[_0x456710(0xa8)](...loadProfilesFromTdxJson(_0x144275,_0x456710(0xaf)));const _0x52fab2=a36_0x4d8eeb[_0x456710(0xd1)](getConfigDir(),'tdx.json');return _0x457abc[_0x456710(0xa8)](...loadProfilesFromTdxJson(_0x52fab2,'user')),_0x457abc;}function loadProfilesFromDirectories(){const _0x595498=a36_0x2603,_0x20cc22=getProfilesDir();if(!a36_0xd730d2[_0x595498(0xb2)](_0x20cc22))return[];try{return a36_0xd730d2[_0x595498(0x91)](_0x20cc22,{'withFileTypes':!![]})[_0x595498(0xbf)](_0x2ee6b8=>_0x2ee6b8[_0x595498(0x98)]())[_0x595498(0x92)](_0x492fdd=>_0x492fdd[_0x595498(0x87)])[_0x595498(0xbf)](_0x206883=>{const _0x4b9e75=_0x595498,_0x40b8a8=getProfileConfigPath(_0x206883),_0x3e0444=getProfileEnvPath(_0x206883);return a36_0xd730d2[_0x4b9e75(0xb2)](_0x40b8a8)||a36_0xd730d2[_0x4b9e75(0xb2)](_0x3e0444);})['map'](_0x22ef95=>{const _0x3712c9=loadProfileFromDirectory(_0x22ef95);if(_0x3712c9)return{..._0x3712c9,'scope':'directory'};return null;})[_0x595498(0xbf)](_0x35c886=>_0x35c886!==null);}catch{return[];}}function loadProfileFromDirectory(_0x557dba){const _0x885d2b=a36_0x2603,_0x6bb013=getProfileConfigPath(_0x557dba),_0x591064=getOldCredentialPath(_0x557dba);if(!a36_0xd730d2['existsSync'](_0x6bb013)&&!a36_0xd730d2[_0x885d2b(0xb2)](_0x591064))return null;let _0x460443={},_0x4cb7f5={'name':_0x557dba,'createdAt':new Date()['toISOString']()};if(a36_0xd730d2[_0x885d2b(0xb2)](_0x6bb013))try{const _0x11a9d5=a36_0xd730d2[_0x885d2b(0x97)](_0x6bb013,'utf-8'),_0x362e66=JSON['parse'](_0x11a9d5),{metadata:_0x4ded3b,..._0x5c1e5f}=_0x362e66;_0x460443=_0x5c1e5f,_0x4ded3b&&(_0x4cb7f5=_0x4ded3b);}catch{}return{'name':_0x557dba,'config':_0x460443,'metadata':_0x4cb7f5,'hasCredentials':a36_0xd730d2['existsSync'](_0x591064),'scope':_0x885d2b(0xcb)};}export function listProfiles(){const _0x2e5576=a36_0x2603,_0x1ade10=loadProfilesFromTdxJsonFiles(),_0x2247c7=loadProfilesFromDirectories();if(_0x2247c7[_0x2e5576(0x9a)]>0x0){const _0x35c1ec=_0x2247c7[_0x2e5576(0x92)](_0x1a19e1=>_0x1a19e1['name'])['join'](',\x20'),_0x5978b8=getConfigDir();console['warn'](_0x2e5576(0xc7)+_0x35c1ec),console['warn'](_0x2e5576(0x86)),console[_0x2e5576(0x85)]('\x20\x201.\x20Edit:\x20'+a36_0x4d8eeb[_0x2e5576(0xd1)](_0x5978b8,_0x2e5576(0xc4))),console[_0x2e5576(0x85)](_0x2e5576(0xb5)),console[_0x2e5576(0x85)](_0x2e5576(0xca));}const _0x4d8d73=[..._0x1ade10,..._0x2247c7],_0x49a3b4=new Map();for(const _0x181a52 of _0x4d8d73){!_0x49a3b4[_0x2e5576(0x84)](_0x181a52[_0x2e5576(0x87)])&&_0x49a3b4[_0x2e5576(0xa0)](_0x181a52[_0x2e5576(0x87)],_0x181a52);}return Array[_0x2e5576(0x9c)](_0x49a3b4['values']())['sort']((_0x414316,_0x329f6b)=>_0x414316['name'][_0x2e5576(0xa4)](_0x329f6b[_0x2e5576(0x87)]));}export function profileExists(_0x34e1f8){const _0xfba9df=a36_0x2603,_0x347b1f=listProfiles();return _0x347b1f[_0xfba9df(0x9d)](_0x15a647=>_0x15a647['name']===_0x34e1f8);}export function loadProfile(_0x13d2ba){const _0x29d205=a36_0x2603;validateProfileName(_0x13d2ba);const _0x264846=listProfiles(),_0xbae133=_0x264846[_0x29d205(0xb3)](_0x5ca3f5=>_0x5ca3f5['name']===_0x13d2ba);return _0xbae133||null;}export function saveProfile(_0x4cb93a,_0x430508,_0x461f06=![]){const _0x28aafe=a36_0x2603;validateProfileName(_0x4cb93a);const _0x1a4891=getProfileDir(_0x4cb93a),_0x2f47cd=getProfileConfigPath(_0x4cb93a);createSecureDirectory(_0x1a4891);let _0x16056c;const _0x5aa116=loadProfile(_0x4cb93a);_0x5aa116?(_0x16056c=_0x5aa116[_0x28aafe(0xb7)],_0x461f06&&(_0x16056c[_0x28aafe(0x8f)]=new Date()[_0x28aafe(0x99)]())):_0x16056c={'name':_0x4cb93a,'createdAt':new Date()[_0x28aafe(0x99)]()};const _0x486003=JSON[_0x28aafe(0x80)](_0x430508);if(_0x486003[_0x28aafe(0xcf)](_0x28aafe(0xbc))||_0x486003[_0x28aafe(0xcf)](_0x28aafe(0xb4))||_0x486003[_0x28aafe(0xcf)](_0x28aafe(0xd0)))throw new Error(_0x28aafe(0xc0));const _0x379295={..._0x430508,'metadata':_0x16056c};a36_0xd730d2[_0x28aafe(0xa6)](_0x2f47cd,JSON['stringify'](_0x379295,null,0x2));}export function deleteProfile(_0x3bd543){const _0x57461e=a36_0x2603;validateProfileName(_0x3bd543);const _0x3f0707=getProfileDir(_0x3bd543);if(!a36_0xd730d2[_0x57461e(0xb2)](_0x3f0707))throw new Error(_0x57461e(0xce)+_0x3bd543+_0x57461e(0x95));a36_0xd730d2[_0x57461e(0xc2)](_0x3f0707,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x323a7a=a36_0x2603,_0x21be4c=getGlobalConfigPath();if(!a36_0xd730d2['existsSync'](_0x21be4c))return null;try{const _0x37f64b=a36_0xd730d2[_0x323a7a(0x97)](_0x21be4c,_0x323a7a(0x88)),_0x2416ec=JSON[_0x323a7a(0x94)](_0x37f64b);return _0x2416ec['profile']||null;}catch{return null;}}export function createProfile(_0x122fe2,_0x5dbd10){const _0x4e11bf=a36_0x2603;validateProfileName(_0x122fe2);if(profileExists(_0x122fe2))throw new Error(_0x4e11bf(0xce)+_0x122fe2+_0x4e11bf(0xd2));saveProfile(_0x122fe2,_0x5dbd10);}export function saveProfileCredentials(_0x541a0b,_0x24ae0c){const _0x58cae2=a36_0x2603;validateProfileName(_0x541a0b);if(!profileExists(_0x541a0b))throw new Error(_0x58cae2(0xce)+_0x541a0b+_0x58cae2(0x95));const _0x4c0b8e=getNewCredentialPath(_0x541a0b);writeSecureFile(_0x4c0b8e,_0x24ae0c);}export function loadProfileCredentials(_0x2de3aa){const _0x43b2db=a36_0x2603;validateProfileName(_0x2de3aa);const _0x2d409d=getNewCredentialPath(_0x2de3aa);if(a36_0xd730d2[_0x43b2db(0xb2)](_0x2d409d))try{return a36_0xd730d2['readFileSync'](_0x2d409d,'utf-8');}catch{}const _0x57cb57=getOldCredentialPath(_0x2de3aa);if(a36_0xd730d2[_0x43b2db(0xb2)](_0x57cb57)){console[_0x43b2db(0x85)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x2de3aa+'\x27'),console['warn']('To\x20migrate:'),console[_0x43b2db(0x85)](_0x43b2db(0xc6)+_0x57cb57+_0x43b2db(0xc5)+_0x2d409d+'\x22'),console[_0x43b2db(0x85)](_0x43b2db(0xb9));try{return a36_0xd730d2[_0x43b2db(0x97)](_0x57cb57,_0x43b2db(0x88));}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_0x5973da=a37_0x4504;(function(_0x27b444,_0xe86c7a){const _0x4372ae=a37_0x4504,_0x5a09b6=_0x27b444();while(!![]){try{const _0x179854=parseInt(_0x4372ae(0x119))/0x1*(-parseInt(_0x4372ae(0x106))/0x2)+-parseInt(_0x4372ae(0xfe))/0x3+-parseInt(_0x4372ae(0xfd))/0x4+-parseInt(_0x4372ae(0xfc))/0x5+parseInt(_0x4372ae(0x116))/0x6*(parseInt(_0x4372ae(0xff))/0x7)+-parseInt(_0x4372ae(0x102))/0x8+parseInt(_0x4372ae(0x10c))/0x9;if(_0x179854===_0xe86c7a)break;else _0x5a09b6['push'](_0x5a09b6['shift']());}catch(_0xe2cca1){_0x5a09b6['push'](_0x5a09b6['shift']());}}}(a37_0x25ff,0xce0fc));function a37_0x4504(_0x139b97,_0x30c8cd){const _0x25ffff=a37_0x25ff();return a37_0x4504=function(_0x45040d,_0x2ab21f){_0x45040d=_0x45040d-0xfc;let _0xed3a3f=_0x25ffff[_0x45040d];return _0xed3a3f;},a37_0x4504(_0x139b97,_0x30c8cd);}import*as a37_0x312fa3 from'node:fs';import*as a37_0x4abf16 from'node:path';const PROJECT_CONFIG_FILENAME=a37_0x5973da(0x107);export function findProjectConfigPath(_0x3f495e){const _0x1762b3=a37_0x5973da;let _0x2957b6=_0x3f495e||process[_0x1762b3(0x100)]();while(!![]){const _0x26637b=a37_0x4abf16[_0x1762b3(0x10f)](_0x2957b6,PROJECT_CONFIG_FILENAME);if(a37_0x312fa3['existsSync'](_0x26637b))return _0x26637b;const _0x46daec=a37_0x4abf16[_0x1762b3(0x115)](_0x2957b6);if(_0x46daec===_0x2957b6)return null;_0x2957b6=_0x46daec;}}export function loadProjectConfig(_0x11a8aa){const _0x4ac0f1=a37_0x5973da,_0x4acbed=findProjectConfigPath(_0x11a8aa);if(!_0x4acbed)return null;try{const _0x251279=a37_0x312fa3[_0x4ac0f1(0x111)](_0x4acbed,_0x4ac0f1(0x10e)),_0x1fd2b7=JSON[_0x4ac0f1(0x10a)](_0x251279),_0x22d9fc=JSON[_0x4ac0f1(0x109)](_0x1fd2b7);if(_0x22d9fc[_0x4ac0f1(0x103)](_0x4ac0f1(0x105))||_0x22d9fc[_0x4ac0f1(0x103)](_0x4ac0f1(0x108))||_0x22d9fc[_0x4ac0f1(0x103)](_0x4ac0f1(0x11a)))throw new Error(_0x4ac0f1(0x110)+_0x4acbed+_0x4ac0f1(0x113)+_0x4ac0f1(0x118));const {metadata:_0x4e6ac7,profile:_0x404f5f,..._0x335409}=_0x1fd2b7;return _0x404f5f&&console['warn'](_0x4ac0f1(0x117)+_0x4acbed+_0x4ac0f1(0x10d)+_0x4ac0f1(0x104)),_0x335409;}catch(_0x41adec){if(_0x41adec instanceof Error&&_0x4ac0f1(0x114)in _0x41adec&&_0x41adec[_0x4ac0f1(0x114)]===_0x4ac0f1(0x10b))return null;throw new Error(_0x4ac0f1(0x112)+_0x4acbed+':\x20'+_0x41adec);}}export function saveProjectConfig(_0x12e00e,_0x18591a){const _0x2069d6=a37_0x5973da,_0xebc25=_0x18591a||process[_0x2069d6(0x100)](),_0xd70928=a37_0x4abf16['join'](_0xebc25,PROJECT_CONFIG_FILENAME),_0x57cd16=JSON['stringify'](_0x12e00e);if(_0x57cd16[_0x2069d6(0x103)](_0x2069d6(0x105))||_0x57cd16['includes'](_0x2069d6(0x108))||_0x57cd16[_0x2069d6(0x103)](_0x2069d6(0x11a)))throw new Error(_0x2069d6(0x101));if('profile'in _0x12e00e)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a37_0x312fa3['writeFileSync'](_0xd70928,JSON[_0x2069d6(0x109)](_0x12e00e,null,0x2));}function a37_0x25ff(){const _0x1e719d=[').\x20','code','dirname','114yBQucW','Warning:\x20\x27profile\x27\x20field\x20in\x20','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','673jRjWfJ','api_key','7957625tDosgS','3923888agyYfX','2083896kCnATY','214781qHcabE','cwd','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','11854672WWzXhj','includes','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','TD_API_KEY','4388EIzTyv','tdx.json','apiKey','stringify','parse','ENOENT','58379184YHxigp','\x20is\x20ignored.\x20','utf-8','join','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','readFileSync','Failed\x20to\x20load\x20project\x20config\x20from\x20'];a37_0x25ff=function(){return _0x1e719d;};return a37_0x25ff();}export function hasProjectConfig(_0x313078){return findProjectConfigPath(_0x313078)!==null;}export function getProjectRoot(_0x5e941d){const _0x26508d=findProjectConfigPath(_0x5e941d);return _0x26508d?a37_0x4abf16['dirname'](_0x26508d):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(_0x3858a4,_0x2aebf7){const _0x4316ec=a38_0xe624,_0x8885c6=_0x3858a4();while(!![]){try{const _0x29462a=-parseInt(_0x4316ec(0x1c8))/0x1*(-parseInt(_0x4316ec(0x1ce))/0x2)+-parseInt(_0x4316ec(0x1b1))/0x3*(-parseInt(_0x4316ec(0x1b3))/0x4)+-parseInt(_0x4316ec(0x1b5))/0x5+-parseInt(_0x4316ec(0x1b4))/0x6*(-parseInt(_0x4316ec(0x1ca))/0x7)+-parseInt(_0x4316ec(0x1b2))/0x8*(-parseInt(_0x4316ec(0x1cb))/0x9)+parseInt(_0x4316ec(0x1d9))/0xa*(-parseInt(_0x4316ec(0x1cd))/0xb)+-parseInt(_0x4316ec(0x1b0))/0xc*(parseInt(_0x4316ec(0x1c4))/0xd);if(_0x29462a===_0x2aebf7)break;else _0x8885c6['push'](_0x8885c6['shift']());}catch(_0x1e5b60){_0x8885c6['push'](_0x8885c6['shift']());}}}(a38_0x24c4,0xde5d4));import*as a38_0x1459e2 from'node:fs';import*as a38_0x510ef5 from'node:path';import*as a38_0x2bdceb from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';function a38_0xe624(_0x2a8073,_0x28d33c){const _0x24c461=a38_0x24c4();return a38_0xe624=function(_0xe624b2,_0x228278){_0xe624b2=_0xe624b2-0x1af;let _0x244db7=_0x24c461[_0xe624b2];return _0x244db7;},a38_0xe624(_0x2a8073,_0x28d33c);}const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x2ed732=a38_0xe624,_0x233a60=process[_0x2ed732(0x1c2)][_0x2ed732(0x1c5)]||a38_0x510ef5['join'](a38_0x2bdceb['homedir'](),_0x2ed732(0x1bd),'tdx');return a38_0x510ef5[_0x2ed732(0x1c0)](_0x233a60,_0x2ed732(0x1d2));}function getSessionPath(_0x2765b1){const _0x42cbc3=a38_0xe624;return a38_0x510ef5[_0x42cbc3(0x1c0)](getSessionsDir(),_0x2765b1+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x2eee45){if(_0x2eee45)return _0x2eee45;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x3a9240){const _0x570972=a38_0xe624,_0x4515c3=_0x3a9240||getCurrentSessionPID()[_0x570972(0x1d3)](),_0x524c96=/^\d+$/[_0x570972(0x1cf)](_0x4515c3)?parseInt(_0x4515c3,0xa):null;return _0x524c96!==null?loadSessionContextByPID(_0x524c96):loadSessionContextByString(_0x4515c3);}export function loadSessionContextByPID(_0x5d6ba9){const _0x2bbe84=a38_0xe624,_0xf022f7=getSessionPath(_0x5d6ba9);if(!a38_0x1459e2[_0x2bbe84(0x1d8)](_0xf022f7))return null;try{const _0x422f6d=a38_0x1459e2[_0x2bbe84(0x1be)](_0xf022f7,_0x2bbe84(0x1d6)),_0x1bd02a=JSON['parse'](_0x422f6d),_0x17f64e=new Date(_0x1bd02a[_0x2bbe84(0x1d7)])[_0x2bbe84(0x1b9)](),_0x4e3b68=Date[_0x2bbe84(0x1ba)]();if(_0x4e3b68-_0x17f64e>SESSION_EXPIRATION_MS)return a38_0x1459e2['unlinkSync'](_0xf022f7),null;const _0x4ef9c6=JSON[_0x2bbe84(0x1d4)](_0x1bd02a);if(_0x4ef9c6[_0x2bbe84(0x1c9)](_0x2bbe84(0x1bb))||_0x4ef9c6['includes']('apiKey')||_0x4ef9c6['includes'](_0x2bbe84(0x1cc)))return console[_0x2bbe84(0x1b8)](_0x2bbe84(0x1bf)+_0xf022f7+_0x2bbe84(0x1af)),a38_0x1459e2[_0x2bbe84(0x1c7)](_0xf022f7),null;return _0x1bd02a;}catch{try{a38_0x1459e2['unlinkSync'](_0xf022f7);}catch{}return null;}}function a38_0x24c4(){const _0x2ac3e5=['includes','2821GQgOTe','14709501ovcfKj','api_key','133243SZHmWl','2984206xftYzU','test','readdirSync','writeFileSync','sessions','toString','stringify','toISOString','utf-8','createdAt','existsSync','570zlitbx','endsWith','.\x20This\x20is\x20insecure.\x20Removing\x20session.','38225232RkzhWL','48bGZqCn','8BTFUhf','415580rQJTmQ','25446skPsXl','8556270WHplEE','replace','push','warn','getTime','now','TD_API_KEY','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','.config','readFileSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','join','parse','env','apiKey','13eOddIn','TDX_CONFIG_DIR','.json','unlinkSync','1UtcxXG'];a38_0x24c4=function(){return _0x2ac3e5;};return a38_0x24c4();}function loadSessionContextByString(_0x5732e2){const _0x12c364=a38_0xe624,_0x7a5279=a38_0x510ef5[_0x12c364(0x1c0)](getSessionsDir(),_0x5732e2+_0x12c364(0x1c6));if(!a38_0x1459e2[_0x12c364(0x1d8)](_0x7a5279))return null;try{const _0x43004f=a38_0x1459e2[_0x12c364(0x1be)](_0x7a5279,'utf-8'),_0x7756d9=JSON['parse'](_0x43004f),_0x3f0e5a=new Date(_0x7756d9[_0x12c364(0x1d7)])['getTime'](),_0x2d3a77=Date[_0x12c364(0x1ba)]();if(_0x2d3a77-_0x3f0e5a>SESSION_EXPIRATION_MS)return a38_0x1459e2[_0x12c364(0x1c7)](_0x7a5279),null;const _0x5f56cb=JSON[_0x12c364(0x1d4)](_0x7756d9);if(_0x5f56cb['includes']('TD_API_KEY')||_0x5f56cb['includes']('apiKey')||_0x5f56cb[_0x12c364(0x1c9)](_0x12c364(0x1cc)))return console[_0x12c364(0x1b8)](_0x12c364(0x1bf)+_0x7a5279+_0x12c364(0x1af)),a38_0x1459e2[_0x12c364(0x1c7)](_0x7a5279),null;return _0x7756d9;}catch{try{a38_0x1459e2['unlinkSync'](_0x7a5279);}catch{}return null;}}export function saveSessionContext(_0x3a951b,_0x59172c){const _0x1c90bf=a38_0xe624,_0x3f7fef=_0x59172c||getCurrentSessionPID()[_0x1c90bf(0x1d3)](),_0xdc9b25=/^\d+$/[_0x1c90bf(0x1cf)](_0x3f7fef)?parseInt(_0x3f7fef,0xa):getCurrentSessionPID(),_0x3d6107=a38_0x510ef5['join'](getSessionsDir(),_0x3f7fef+_0x1c90bf(0x1c6)),_0x24f891=getSessionsDir();createSecureDirectory(_0x24f891);const _0x1ebb19=JSON['stringify'](_0x3a951b);if(_0x1ebb19[_0x1c90bf(0x1c9)](_0x1c90bf(0x1bb))||_0x1ebb19['includes'](_0x1c90bf(0x1c3))||_0x1ebb19[_0x1c90bf(0x1c9)](_0x1c90bf(0x1cc)))throw new Error(_0x1c90bf(0x1bc));let _0x400eab;const _0x1b5807=/^\d+$/[_0x1c90bf(0x1cf)](_0x3f7fef)?loadSessionContextByPID(parseInt(_0x3f7fef,0xa)):loadSessionContextByString(_0x3f7fef);_0x1b5807?_0x400eab={..._0x1b5807,..._0x3a951b,'pid':_0xdc9b25,'sessionId':_0x3f7fef!==_0xdc9b25[_0x1c90bf(0x1d3)]()?_0x3f7fef:undefined,'updatedAt':new Date()[_0x1c90bf(0x1d5)]()}:_0x400eab={'pid':_0xdc9b25,'sessionId':_0x3f7fef!==_0xdc9b25[_0x1c90bf(0x1d3)]()?_0x3f7fef:undefined,..._0x3a951b,'createdAt':new Date()[_0x1c90bf(0x1d5)](),'updatedAt':new Date()[_0x1c90bf(0x1d5)]()},a38_0x1459e2[_0x1c90bf(0x1d1)](_0x3d6107,JSON[_0x1c90bf(0x1d4)](_0x400eab,null,0x2));}export function clearSessionContext(_0x3effc8){const _0x201cce=a38_0xe624,_0x49747d=_0x3effc8||getCurrentSessionPID()['toString'](),_0x1411ad=a38_0x510ef5['join'](getSessionsDir(),_0x49747d+_0x201cce(0x1c6));a38_0x1459e2[_0x201cce(0x1d8)](_0x1411ad)&&a38_0x1459e2[_0x201cce(0x1c7)](_0x1411ad);}export function cleanExpiredSessions(){const _0x2f75b8=a38_0xe624,_0x804c1e=getSessionsDir();if(!a38_0x1459e2[_0x2f75b8(0x1d8)](_0x804c1e))return 0x0;let _0xc2f852=0x0;const _0x4cfb30=Date[_0x2f75b8(0x1ba)]();try{const _0x397873=a38_0x1459e2[_0x2f75b8(0x1d0)](_0x804c1e);for(const _0x150ab7 of _0x397873){if(!_0x150ab7['endsWith']('.json'))continue;const _0x3ef02a=a38_0x510ef5['join'](_0x804c1e,_0x150ab7),_0x1262e1=_0x150ab7['replace'](_0x2f75b8(0x1c6),''),_0x4601f3=parseInt(_0x1262e1,0xa),_0x28affd=!isNaN(_0x4601f3);if(_0x28affd){if(!isProcessRunning(_0x4601f3)){a38_0x1459e2[_0x2f75b8(0x1c7)](_0x3ef02a),_0xc2f852++;continue;}}try{const _0x4b00ce=a38_0x1459e2[_0x2f75b8(0x1be)](_0x3ef02a,'utf-8'),_0x2c2d14=JSON[_0x2f75b8(0x1c1)](_0x4b00ce),_0x50cefd=new Date(_0x2c2d14[_0x2f75b8(0x1d7)])[_0x2f75b8(0x1b9)]();_0x4cfb30-_0x50cefd>SESSION_EXPIRATION_MS&&(a38_0x1459e2[_0x2f75b8(0x1c7)](_0x3ef02a),_0xc2f852++);}catch{a38_0x1459e2[_0x2f75b8(0x1c7)](_0x3ef02a),_0xc2f852++;}}}catch{}return _0xc2f852;}export function listActiveSessions(){const _0x4b1d0e=a38_0xe624,_0x25a9a1=getSessionsDir();if(!a38_0x1459e2['existsSync'](_0x25a9a1))return[];try{const _0x4fb564=a38_0x1459e2[_0x4b1d0e(0x1d0)](_0x25a9a1),_0x32c5bd=[];for(const _0x4e0c72 of _0x4fb564){if(!_0x4e0c72[_0x4b1d0e(0x1da)]('.json'))continue;const _0x3dea24=_0x4e0c72[_0x4b1d0e(0x1b6)](_0x4b1d0e(0x1c6),''),_0x347731=parseInt(_0x3dea24,0xa);!isNaN(_0x347731)&&isProcessRunning(_0x347731)&&_0x32c5bd[_0x4b1d0e(0x1b7)](_0x347731);}return _0x32c5bd['sort']((_0x34ce89,_0x30f5ee)=>_0x34ce89-_0x30f5ee);}catch{return[];}}
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(_0x285553,_0x171c48){var _0x11174d=a39_0x2968,_0x2cc138=_0x285553();while(!![]){try{var _0x34d73e=-parseInt(_0x11174d(0x11b))/0x1*(-parseInt(_0x11174d(0x116))/0x2)+parseInt(_0x11174d(0x11f))/0x3*(parseInt(_0x11174d(0x11e))/0x4)+-parseInt(_0x11174d(0x119))/0x5*(-parseInt(_0x11174d(0x115))/0x6)+parseInt(_0x11174d(0x11a))/0x7+-parseInt(_0x11174d(0x117))/0x8+-parseInt(_0x11174d(0x118))/0x9*(-parseInt(_0x11174d(0x11d))/0xa)+-parseInt(_0x11174d(0x114))/0xb*(parseInt(_0x11174d(0x11c))/0xc);if(_0x34d73e===_0x171c48)break;else _0x2cc138['push'](_0x2cc138['shift']());}catch(_0x1fa162){_0x2cc138['push'](_0x2cc138['shift']());}}}(a39_0x99ad,0x8f9c0));export*from'./types/index.js';export*from'./core/config.js';export*from'./core/auth.js';function a39_0x99ad(){var _0x17c896=['3230055OVefrK','8199898vVDyHA','41xUSyxt','29544JyxMVU','6392830sAENiT','6824ZSxRNy','477YJTehO','10901FNXmWX','6qlOtxK','28642iywArz','2296456GmCtGB','9RpavBv'];a39_0x99ad=function(){return _0x17c896;};return a39_0x99ad();}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';function a39_0x2968(_0x506b2c,_0x5d56e0){var _0x99adba=a39_0x99ad();return a39_0x2968=function(_0x29686a,_0x3be699){_0x29686a=_0x29686a-0x114;var _0x263c91=_0x99adba[_0x29686a];return _0x263c91;},a39_0x2968(_0x506b2c,_0x5d56e0);}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';