@treasuredata/tdx 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.js +1 -1
  5. package/dist/client/llm-client.d.ts +2 -2
  6. package/dist/client/llm-client.d.ts.map +1 -1
  7. package/dist/client/llm-client.js +1 -1
  8. package/dist/client/rate-limiter.js +1 -1
  9. package/dist/client/td-client.js +1 -1
  10. package/dist/client/trino-client.js +1 -1
  11. package/dist/client/workflow-client.js +1 -1
  12. package/dist/commands/activations.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/chat-command.js.map +1 -1
  16. package/dist/commands/claude-command.d.ts.map +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-command.js.map +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/context-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/llm-command.d.ts.map +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-command.js.map +1 -1
  27. package/dist/commands/llm-proxy.d.ts.map +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/llm-proxy.js.map +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pwd-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/global-context.js +1 -1
  47. package/dist/core/profile.js +1 -1
  48. package/dist/core/project-config.js +1 -1
  49. package/dist/core/session.js +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/proxy/anthropic-adapter.d.ts +3 -3
  52. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  53. package/dist/proxy/anthropic-adapter.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js.map +1 -1
  55. package/dist/proxy/server.d.ts +5 -3
  56. package/dist/proxy/server.d.ts.map +1 -1
  57. package/dist/proxy/server.js +1 -1
  58. package/dist/proxy/server.js.map +1 -1
  59. package/dist/sdk/api.js +1 -1
  60. package/dist/sdk/database.js +1 -1
  61. package/dist/sdk/errors.js +1 -1
  62. package/dist/sdk/index.js +1 -1
  63. package/dist/sdk/job.js +1 -1
  64. package/dist/sdk/llm.d.ts +14 -0
  65. package/dist/sdk/llm.d.ts.map +1 -1
  66. package/dist/sdk/llm.js +1 -1
  67. package/dist/sdk/llm.js.map +1 -1
  68. package/dist/sdk/query.js +1 -1
  69. package/dist/sdk/segment.js +1 -1
  70. package/dist/sdk/table.js +1 -1
  71. package/dist/sdk/workflow.js +1 -1
  72. package/dist/types/endpoints.js +1 -1
  73. package/dist/types/index.d.ts +41 -21
  74. package/dist/types/index.d.ts.map +1 -1
  75. package/dist/types/index.js +1 -1
  76. package/dist/utils/agent-ref-parser.js +1 -1
  77. package/dist/utils/chat-cache.js +1 -1
  78. package/dist/utils/colors.d.ts +4 -0
  79. package/dist/utils/colors.d.ts.map +1 -1
  80. package/dist/utils/colors.js +1 -1
  81. package/dist/utils/colors.js.map +1 -1
  82. package/dist/utils/command-output.js +1 -1
  83. package/dist/utils/file-permissions.js +1 -1
  84. package/dist/utils/format-detector.js +1 -1
  85. package/dist/utils/formatters.js +1 -1
  86. package/dist/utils/json-loader.js +1 -1
  87. package/dist/utils/model-aliases.d.ts +15 -0
  88. package/dist/utils/model-aliases.d.ts.map +1 -1
  89. package/dist/utils/model-aliases.js +1 -1
  90. package/dist/utils/model-aliases.js.map +1 -1
  91. package/dist/utils/option-validation.js +1 -1
  92. package/dist/utils/port.js +1 -1
  93. package/dist/utils/process.js +1 -1
  94. package/dist/utils/prompt.js +1 -1
  95. package/dist/utils/segment-path-parser.js +1 -1
  96. package/dist/utils/segment-ref-parser.js +1 -1
  97. package/dist/utils/spinner.js +1 -1
  98. package/dist/utils/sql-parser.js +1 -1
  99. package/dist/utils/sse-parser.d.ts +2 -2
  100. package/dist/utils/sse-parser.d.ts.map +1 -1
  101. package/dist/utils/sse-parser.js +1 -1
  102. package/dist/utils/sse-parser.js.map +1 -1
  103. package/dist/utils/string-utils.js +1 -1
  104. package/dist/utils/table-ref-parser.js +1 -1
  105. package/dist/utils/tree-formatter.js +1 -1
  106. package/dist/utils/version-check.d.ts +28 -0
  107. package/dist/utils/version-check.d.ts.map +1 -0
  108. package/dist/utils/version-check.js +1 -0
  109. package/dist/utils/version-check.js.map +1 -0
  110. package/dist/utils/workflow-utils.js +1 -1
  111. package/package.json +3 -1
@@ -1 +1 @@
1
- const a30_0x5e2a56=a30_0x424d;(function(_0x318d62,_0x1accfb){const _0x3f7d72=a30_0x424d,_0x390a1d=_0x318d62();while(!![]){try{const _0x2362a4=-parseInt(_0x3f7d72(0xf0))/0x1*(-parseInt(_0x3f7d72(0x106))/0x2)+-parseInt(_0x3f7d72(0xf2))/0x3*(-parseInt(_0x3f7d72(0xdc))/0x4)+-parseInt(_0x3f7d72(0xd8))/0x5*(parseInt(_0x3f7d72(0xdd))/0x6)+parseInt(_0x3f7d72(0xd7))/0x7*(-parseInt(_0x3f7d72(0xe9))/0x8)+parseInt(_0x3f7d72(0x101))/0x9+parseInt(_0x3f7d72(0xfa))/0xa*(-parseInt(_0x3f7d72(0x108))/0xb)+-parseInt(_0x3f7d72(0xf4))/0xc*(-parseInt(_0x3f7d72(0x10b))/0xd);if(_0x2362a4===_0x1accfb)break;else _0x390a1d['push'](_0x390a1d['shift']());}catch(_0x1a67db){_0x390a1d['push'](_0x390a1d['shift']());}}}(a30_0x47dd,0xaed9c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x47dd(){const _0xc92794=['name','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','table','Error:\x20Pattern\x20\x27','\x27\x20is\x20ambiguous.','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','1152056OJSXWe','\x27\x20across\x20all\x20databases.','verbose','length','message','Database:\x20','database','606201GtUQxw','Or\x20use\x20--in\x20flag:','2567043TnxRiU','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','2388xUlXaz','tables','Site:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✔\x20Found\x20','Error:\x20','3992750AMbpfI','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','includes','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','execute','Database:\x20all','5024898UXCZXV','list','data','site','description','2gPzQNB','\x20table','33pSawiE','Database\x20\x27','validate','72475eZqLIf','cause','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','14bGtBUw','356770JszBUK','\x20\x20Cause:\x20','Note:\x20\x27','Listing\x20tables...','4JDIjAc','78jWjimP','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','✖\x20No\x20tables\x20found','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a30_0x47dd=function(){return _0xc92794;};return a30_0x47dd();}function a30_0x424d(_0x3e734b,_0x1c4d0b){const _0x47dd61=a30_0x47dd();return a30_0x424d=function(_0x424dd1,_0x50462c){_0x424dd1=_0x424dd1-0xd6;let _0x398ec4=_0x47dd61[_0x424dd1];return _0x398ec4;},a30_0x424d(_0x3e734b,_0x1c4d0b);}import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x5e2a56(0xe3)]=a30_0x5e2a56(0xf5);[a30_0x5e2a56(0x105)]='List\x20tables\x20in\x20a\x20database';async[a30_0x5e2a56(0xff)](_0x16f315){const _0x1eb65d=a30_0x5e2a56,{options:_0x2c8067,args:_0x53af21,tdx:_0x5b6802}=_0x16f315;let _0x4576f4;if(_0x53af21[_0x1eb65d(0xec)]===0x0)_0x4576f4={'database':undefined,'table':undefined,'original':''};else{if(_0x53af21[_0x1eb65d(0xec)]===0x1)try{_0x4576f4=parseTableReference(_0x53af21[0x0]);if(_0x4576f4[_0x1eb65d(0xe5)]&&!_0x4576f4['database']&&!_0x4576f4['table'][_0x1eb65d(0xfd)]('*')&&!_0x4576f4[_0x1eb65d(0xe5)][_0x1eb65d(0xfd)]('?'))return console['error'](_0x1eb65d(0xe6)+_0x53af21[0x0]+_0x1eb65d(0xe7)),console[_0x1eb65d(0xde)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x4576f4['table']+'\x27?'),console[_0x1eb65d(0xde)](_0x1eb65d(0xdf)+_0x4576f4[_0x1eb65d(0xe5)]+'.*\x22'),console[_0x1eb65d(0xde)](_0x1eb65d(0xe1)+_0x4576f4[_0x1eb65d(0xe5)]),console[_0x1eb65d(0xde)](_0x1eb65d(0xe8)+_0x4576f4[_0x1eb65d(0xe5)]),console[_0x1eb65d(0xde)](''),console['error'](_0x1eb65d(0xda)+_0x53af21[0x0]+_0x1eb65d(0xf7)+_0x4576f4[_0x1eb65d(0xe5)]+_0x1eb65d(0xea)),0x1;}catch(_0x5095fa){return console[_0x1eb65d(0xde)]('Error:\x20'+_0x5095fa[_0x1eb65d(0xed)]),0x1;}else return console['error'](_0x1eb65d(0xe4)),console['error'](_0x1eb65d(0xfe)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x1eb65d(0xde)](_0x1eb65d(0xf3)),console[_0x1eb65d(0xde)](_0x1eb65d(0xfc)),console[_0x1eb65d(0xde)](_0x1eb65d(0xf1)),console[_0x1eb65d(0xde)](_0x1eb65d(0xe2)),0x1;}const _0x5e984e=_0x2c8067[_0x1eb65d(0xef)];!_0x4576f4[_0x1eb65d(0xef)]&&_0x5e984e&&(_0x4576f4[_0x1eb65d(0xef)]=_0x5e984e);try{const _0x44c759=_0x393f6d=>_0x393f6d&&(_0x393f6d[_0x1eb65d(0xfd)]('*')||_0x393f6d[_0x1eb65d(0xfd)]('?')),_0x20b1ff=_0x44c759(_0x4576f4[_0x1eb65d(0xef)]);_0x2c8067['verbose']&&(console[_0x1eb65d(0xde)](_0x1eb65d(0xf6)+_0x2c8067[_0x1eb65d(0x104)]),_0x4576f4[_0x1eb65d(0xef)]?_0x20b1ff?console[_0x1eb65d(0xde)](_0x1eb65d(0xfb)+_0x4576f4['database']):console[_0x1eb65d(0xde)](_0x1eb65d(0xee)+_0x4576f4['database']):console[_0x1eb65d(0xde)](_0x1eb65d(0x100)),_0x4576f4[_0x1eb65d(0xe5)]&&console[_0x1eb65d(0xde)]('Table\x20pattern:\x20'+_0x4576f4[_0x1eb65d(0xe5)]));const _0x6cb1f5=_0x4576f4['database']&&!_0x20b1ff?_0x4576f4['database']:undefined,_0x492d63=_0x20b1ff?_0x4576f4['database']:undefined,_0x32a5d6=_0x4576f4[_0x1eb65d(0xe5)],_0x3b79ea=await withSpinner(_0x1eb65d(0xdb),()=>_0x5b6802[_0x1eb65d(0xe5)][_0x1eb65d(0x102)](_0x6cb1f5,_0x32a5d6,_0x492d63),{'verbose':_0x2c8067[_0x1eb65d(0xeb)]}),_0x3c2c65=_0x3b79ea[_0x1eb65d(0x103)];if(_0x3c2c65['length']===0x0&&_0x4576f4[_0x1eb65d(0xef)]&&!_0x20b1ff)return console[_0x1eb65d(0xde)](_0x1eb65d(0xe0)),console[_0x1eb65d(0xde)](_0x1eb65d(0x109)+_0x4576f4['database']+_0x1eb65d(0xd6)),0x1;return console[_0x1eb65d(0xde)](_0x1eb65d(0xf8)+_0x3c2c65[_0x1eb65d(0xec)]+_0x1eb65d(0x107)+(_0x3c2c65[_0x1eb65d(0xec)]!==0x1?'s':'')),await handleSDKOutput(_0x3c2c65,_0x2c8067),0x0;}catch(_0x3fa4ba){if(_0x3fa4ba instanceof SDKError)return console[_0x1eb65d(0xde)](_0x1eb65d(0xf9)+_0x3fa4ba[_0x1eb65d(0xed)]),_0x3fa4ba[_0x1eb65d(0x10c)]&&console[_0x1eb65d(0xde)](_0x1eb65d(0xd9)+_0x3fa4ba[_0x1eb65d(0x10c)]),0x1;throw _0x3fa4ba;}}[a30_0x5e2a56(0x10a)](_0x222dab){return undefined;}}
1
+ const a30_0x4dc40f=a30_0x4bd0;(function(_0x4c78c6,_0x1b6fdd){const _0xc9c537=a30_0x4bd0,_0x3c26e6=_0x4c78c6();while(!![]){try{const _0x1b4d84=parseInt(_0xc9c537(0xd0))/0x1+-parseInt(_0xc9c537(0xf8))/0x2+parseInt(_0xc9c537(0xe8))/0x3+parseInt(_0xc9c537(0xd5))/0x4+-parseInt(_0xc9c537(0xf3))/0x5*(parseInt(_0xc9c537(0xd4))/0x6)+parseInt(_0xc9c537(0xde))/0x7*(-parseInt(_0xc9c537(0xe1))/0x8)+-parseInt(_0xc9c537(0xeb))/0x9*(-parseInt(_0xc9c537(0xdb))/0xa);if(_0x1b4d84===_0x1b6fdd)break;else _0x3c26e6['push'](_0x3c26e6['shift']());}catch(_0x2591ab){_0x3c26e6['push'](_0x3c26e6['shift']());}}}(a30_0x1a19,0x18c3f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x4bd0(_0x26d03c,_0x326752){const _0x1a1906=a30_0x1a19();return a30_0x4bd0=function(_0x4bd08c,_0x14f2dc){_0x4bd08c=_0x4bd08c-0xd0;let _0x40b0e0=_0x1a1906[_0x4bd08c];return _0x40b0e0;},a30_0x4bd0(_0x26d03c,_0x326752);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a30_0x1a19(){const _0x5a6954=['.*\x22','description','data','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database\x20\x27','406615NMIUMK','length','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','✔\x20Found\x20','table','43304jYoJCw','Site:\x20','Note:\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Error:\x20Pattern\x20\x27','verbose','execute','107822jXpUFu','validate','✖\x20No\x20tables\x20found','cause','12qvhZZf','435792xDiKjP','message','includes','error','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','30lSAGGM','list','Error:\x20','70QwVWZG','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','33656wkWPSy','database','Table\x20pattern:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','List\x20tables\x20in\x20a\x20database','Or\x20use\x20--in\x20flag:','Listing\x20tables...','46164EsMVJj','tables','\x20\x20Cause:\x20','286947NOwInO','site','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a30_0x1a19=function(){return _0x5a6954;};return a30_0x1a19();}export class TablesCommand extends BaseCommand{['name']=a30_0x4dc40f(0xe9);[a30_0x4dc40f(0xef)]=a30_0x4dc40f(0xe5);async[a30_0x4dc40f(0xfe)](_0x16f2dd){const _0x1c4781=a30_0x4dc40f,{options:_0x3ab05a,args:_0x49e677,tdx:_0x3b496d}=_0x16f2dd;let _0x56ab4b;if(_0x49e677[_0x1c4781(0xf4)]===0x0)_0x56ab4b={'database':undefined,'table':undefined,'original':''};else{if(_0x49e677[_0x1c4781(0xf4)]===0x1)try{_0x56ab4b=parseTableReference(_0x49e677[0x0]);if(_0x56ab4b[_0x1c4781(0xf7)]&&!_0x56ab4b[_0x1c4781(0xe2)]&&!_0x56ab4b[_0x1c4781(0xf7)][_0x1c4781(0xd7)]('*')&&!_0x56ab4b[_0x1c4781(0xf7)][_0x1c4781(0xd7)]('?'))return console['error'](_0x1c4781(0xfc)+_0x49e677[0x0]+'\x27\x20is\x20ambiguous.'),console['error']('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x56ab4b[_0x1c4781(0xf7)]+'\x27?'),console['error']('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x56ab4b[_0x1c4781(0xf7)]+_0x1c4781(0xee)),console[_0x1c4781(0xd8)](_0x1c4781(0xfb)+_0x56ab4b[_0x1c4781(0xf7)]),console['error'](_0x1c4781(0xe0)+_0x56ab4b[_0x1c4781(0xf7)]),console[_0x1c4781(0xd8)](''),console[_0x1c4781(0xd8)](_0x1c4781(0xfa)+_0x49e677[0x0]+_0x1c4781(0xe4)+_0x56ab4b[_0x1c4781(0xf7)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x52226f){return console[_0x1c4781(0xd8)](_0x1c4781(0xdd)+_0x52226f[_0x1c4781(0xd6)]),0x1;}else return console[_0x1c4781(0xd8)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x1c4781(0xd8)](_0x1c4781(0xf5)),console[_0x1c4781(0xd8)](_0x1c4781(0xdf)),console[_0x1c4781(0xd8)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x1c4781(0xda)),console[_0x1c4781(0xd8)](_0x1c4781(0xe6)),console[_0x1c4781(0xd8)](_0x1c4781(0xed)),0x1;}const _0x124d83=_0x3ab05a[_0x1c4781(0xe2)];!_0x56ab4b[_0x1c4781(0xe2)]&&_0x124d83&&(_0x56ab4b[_0x1c4781(0xe2)]=_0x124d83);try{const _0xf64a06=_0x1e396c=>_0x1e396c&&(_0x1e396c[_0x1c4781(0xd7)]('*')||_0x1e396c[_0x1c4781(0xd7)]('?')),_0x346813=_0xf64a06(_0x56ab4b[_0x1c4781(0xe2)]);_0x3ab05a[_0x1c4781(0xfd)]&&(console[_0x1c4781(0xd8)](_0x1c4781(0xf9)+_0x3ab05a[_0x1c4781(0xec)]),_0x56ab4b[_0x1c4781(0xe2)]?_0x346813?console[_0x1c4781(0xd8)](_0x1c4781(0xd9)+_0x56ab4b['database']):console[_0x1c4781(0xd8)]('Database:\x20'+_0x56ab4b['database']):console[_0x1c4781(0xd8)]('Database:\x20all'),_0x56ab4b[_0x1c4781(0xf7)]&&console['error'](_0x1c4781(0xe3)+_0x56ab4b['table']));const _0x433f45=_0x56ab4b[_0x1c4781(0xe2)]&&!_0x346813?_0x56ab4b[_0x1c4781(0xe2)]:undefined,_0x400562=_0x346813?_0x56ab4b['database']:undefined,_0x1241c5=_0x56ab4b['table'],_0x59005b=await withSpinner(_0x1c4781(0xe7),()=>_0x3b496d[_0x1c4781(0xf7)][_0x1c4781(0xdc)](_0x433f45,_0x1241c5,_0x400562),{'verbose':_0x3ab05a[_0x1c4781(0xfd)]}),_0x287dce=_0x59005b[_0x1c4781(0xf0)];if(_0x287dce['length']===0x0&&_0x56ab4b[_0x1c4781(0xe2)]&&!_0x346813)return console['error'](_0x1c4781(0xd2)),console['error'](_0x1c4781(0xf2)+_0x56ab4b[_0x1c4781(0xe2)]+_0x1c4781(0xf1)),0x1;return console[_0x1c4781(0xd8)](_0x1c4781(0xf6)+_0x287dce[_0x1c4781(0xf4)]+'\x20table'+(_0x287dce['length']!==0x1?'s':'')),await handleSDKOutput(_0x287dce,_0x3ab05a),0x0;}catch(_0x52e4b7){if(_0x52e4b7 instanceof SDKError)return console[_0x1c4781(0xd8)](_0x1c4781(0xdd)+_0x52e4b7[_0x1c4781(0xd6)]),_0x52e4b7[_0x1c4781(0xd3)]&&console[_0x1c4781(0xd8)](_0x1c4781(0xea)+_0x52e4b7['cause']),0x1;throw _0x52e4b7;}}[a30_0x4dc40f(0xd1)](_0x1b96de){return undefined;}}
@@ -1 +1 @@
1
- function a31_0x1721(_0x3ce16a,_0x1d4c6b){const _0xe38504=a31_0xe385();return a31_0x1721=function(_0x172102,_0x2aa969){_0x172102=_0x172102-0x14c;let _0x1c8ad4=_0xe38504[_0x172102];return _0x1c8ad4;},a31_0x1721(_0x3ce16a,_0x1d4c6b);}const a31_0x3d0a2e=a31_0x1721;(function(_0x33c59e,_0x508e3a){const _0x42ca3b=a31_0x1721,_0x529809=_0x33c59e();while(!![]){try{const _0x543ba=-parseInt(_0x42ca3b(0x14d))/0x1+parseInt(_0x42ca3b(0x159))/0x2+-parseInt(_0x42ca3b(0x14e))/0x3+-parseInt(_0x42ca3b(0x15e))/0x4*(-parseInt(_0x42ca3b(0x16b))/0x5)+parseInt(_0x42ca3b(0x161))/0x6+parseInt(_0x42ca3b(0x154))/0x7*(parseInt(_0x42ca3b(0x14c))/0x8)+parseInt(_0x42ca3b(0x153))/0x9*(-parseInt(_0x42ca3b(0x164))/0xa);if(_0x543ba===_0x508e3a)break;else _0x529809['push'](_0x529809['shift']());}catch(_0x12d5d6){_0x529809['push'](_0x529809['shift']());}}}(a31_0xe385,0xd9483));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a31_0xe385(){const _0x12d837=['\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','log','31044yVIBwr','Session\x20database\x20set\x20to:\x20','validate','5344692wGjInQ','name','length','6927380KjbEJB','database','join','Invalid\x20resource:\x20','llm_project','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','includes','395GQJvxv','session','use','\x27\x20does\x20not\x20exist','Error:\x20','description','toString','\x20(session:\x20','8ARYOUC','1284699eXgkfj','3414780FAJZhG','.\x20Must\x20be\x20one\x20of:\x20','execute','error','message','9VTReSU','9161579ygoVeO','profile','Set\x20session-level\x20context','Error:\x20Profile\x20\x27','parent_segment','2385972snbyRF','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'];a31_0xe385=function(){return _0x12d837;};return a31_0xe385();}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x3d0a2e(0x162)]=a31_0x3d0a2e(0x16d);[a31_0x3d0a2e(0x170)]=a31_0x3d0a2e(0x156);[a31_0x3d0a2e(0x160)](_0x2c95bc){const _0x5e2afe=a31_0x3d0a2e,{args:_0x174992}=_0x2c95bc;if(_0x174992[_0x5e2afe(0x163)]<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x5e2afe(0x15a)+_0x5e2afe(0x15c);const _0x5d0394=_0x174992[0x0],_0x3f3e9b=[_0x5e2afe(0x165),_0x5e2afe(0x158),_0x5e2afe(0x168),_0x5e2afe(0x155)];if(!_0x3f3e9b[_0x5e2afe(0x16a)](_0x5d0394))return _0x5e2afe(0x167)+_0x5d0394+_0x5e2afe(0x14f)+_0x3f3e9b[_0x5e2afe(0x166)](',\x20');return undefined;}async[a31_0x3d0a2e(0x150)](_0x25c628){const _0xa799e8=a31_0x3d0a2e,{args:_0x2470cc,options:_0x417dfb}=_0x25c628;try{const _0x2b1275=_0x2470cc[0x0],_0xaabab3=_0x2470cc[0x1];if(_0x2b1275==='profile'){if(!profileExists(_0xaabab3))return console['error'](_0xa799e8(0x157)+_0xaabab3+_0xa799e8(0x16e)),console[_0xa799e8(0x151)](_0xa799e8(0x15b)),0x1;const _0x34b1be=_0x417dfb[_0xa799e8(0x16c)]||getCurrentSessionPID()[_0xa799e8(0x171)]();return saveSessionContext({'profile':_0xaabab3},_0x417dfb[_0xa799e8(0x16c)]),console[_0xa799e8(0x15d)]('Session\x20profile\x20set\x20to:\x20'+_0xaabab3+_0xa799e8(0x172)+_0x34b1be+')'),console[_0xa799e8(0x15d)](_0xa799e8(0x169)),0x0;}const _0x52565e={},_0xe178c6=_0x417dfb['session']||getCurrentSessionPID()['toString']();switch(_0x2b1275){case'database':_0x52565e[_0xa799e8(0x165)]=_0xaabab3,console[_0xa799e8(0x15d)](_0xa799e8(0x15f)+_0xaabab3+_0xa799e8(0x172)+_0xe178c6+')');break;case _0xa799e8(0x158):_0x52565e[_0xa799e8(0x158)]=_0xaabab3,console['log']('Session\x20parent_segment\x20set\x20to:\x20'+_0xaabab3+_0xa799e8(0x172)+_0xe178c6+')');break;case'llm_project':_0x52565e['llm_project']=_0xaabab3,console[_0xa799e8(0x15d)]('Session\x20llm_project\x20set\x20to:\x20'+_0xaabab3+_0xa799e8(0x172)+_0xe178c6+')');break;}return saveSessionContext(_0x52565e,_0x417dfb[_0xa799e8(0x16c)]),console[_0xa799e8(0x15d)](_0xa799e8(0x169)),0x0;}catch(_0x4f8c18){return _0x4f8c18 instanceof Error&&console[_0xa799e8(0x151)](_0xa799e8(0x16f)+_0x4f8c18[_0xa799e8(0x152)]),0x1;}}}
1
+ const a31_0x586624=a31_0x3239;(function(_0x3d7d4c,_0x2dc0af){const _0x51a0a8=a31_0x3239,_0x316559=_0x3d7d4c();while(!![]){try{const _0x49bdfa=parseInt(_0x51a0a8(0x17e))/0x1*(-parseInt(_0x51a0a8(0x16e))/0x2)+parseInt(_0x51a0a8(0x171))/0x3*(-parseInt(_0x51a0a8(0x17f))/0x4)+-parseInt(_0x51a0a8(0x184))/0x5*(parseInt(_0x51a0a8(0x186))/0x6)+parseInt(_0x51a0a8(0x192))/0x7*(-parseInt(_0x51a0a8(0x18f))/0x8)+-parseInt(_0x51a0a8(0x18b))/0x9+-parseInt(_0x51a0a8(0x16c))/0xa+-parseInt(_0x51a0a8(0x16d))/0xb*(-parseInt(_0x51a0a8(0x172))/0xc);if(_0x49bdfa===_0x2dc0af)break;else _0x316559['push'](_0x316559['shift']());}catch(_0x96ffbc){_0x316559['push'](_0x316559['shift']());}}}(a31_0x2123,0xf1d8f));function a31_0x3239(_0x2e802f,_0x1c124b){const _0x2123a8=a31_0x2123();return a31_0x3239=function(_0x323953,_0x205988){_0x323953=_0x323953-0x16b;let _0x4fd856=_0x2123a8[_0x323953];return _0x4fd856;},a31_0x3239(_0x2e802f,_0x1c124b);}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a31_0x2123(){const _0x10e509=['description','name','Session\x20parent_segment\x20set\x20to:\x20','Set\x20session-level\x20context','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','1RfkGZo','16kGYPoE','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','log','\x20(session:\x20','toString','5kcOBTa','validate','9962898XZPEtf','error','Error:\x20','execute','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','15939891jbndKl','llm_project','database','parent_segment','24MNDIoA','Invalid\x20resource:\x20','session','407967KEWzIu','join','message','6612730NPmzzG','16766882ToPZrw','2672722rwcYGa','Session\x20llm_project\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','769983wKmZbR','60GQGovO','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','profile','length','includes','use','Error:\x20Profile\x20\x27'];a31_0x2123=function(){return _0x10e509;};return a31_0x2123();}export class UseCommand extends BaseCommand{[a31_0x586624(0x17a)]=a31_0x586624(0x177);[a31_0x586624(0x179)]=a31_0x586624(0x17c);[a31_0x586624(0x185)](_0x53c7ca){const _0x4c7803=a31_0x586624,{args:_0x5c1c16}=_0x53c7ca;if(_0x5c1c16[_0x4c7803(0x175)]<0x2)return _0x4c7803(0x18a)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x4c7803(0x173)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x1da688=_0x5c1c16[0x0],_0x29ef61=[_0x4c7803(0x18d),_0x4c7803(0x18e),'llm_project',_0x4c7803(0x174)];if(!_0x29ef61[_0x4c7803(0x176)](_0x1da688))return _0x4c7803(0x190)+_0x1da688+_0x4c7803(0x170)+_0x29ef61[_0x4c7803(0x193)](',\x20');return undefined;}async[a31_0x586624(0x189)](_0x3f08af){const _0x24a1b8=a31_0x586624,{args:_0x2a9cf9,options:_0x1fbc4a}=_0x3f08af;try{const _0x4e11cc=_0x2a9cf9[0x0],_0x2ba841=_0x2a9cf9[0x1];if(_0x4e11cc===_0x24a1b8(0x174)){if(!profileExists(_0x2ba841))return console['error'](_0x24a1b8(0x178)+_0x2ba841+'\x27\x20does\x20not\x20exist'),console[_0x24a1b8(0x187)](_0x24a1b8(0x17d)),0x1;const _0x434796=_0x1fbc4a[_0x24a1b8(0x191)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2ba841},_0x1fbc4a[_0x24a1b8(0x191)]),console[_0x24a1b8(0x181)]('Session\x20profile\x20set\x20to:\x20'+_0x2ba841+_0x24a1b8(0x182)+_0x434796+')'),console[_0x24a1b8(0x181)](_0x24a1b8(0x180)),0x0;}const _0x1765b4={},_0x4bb27f=_0x1fbc4a[_0x24a1b8(0x191)]||getCurrentSessionPID()[_0x24a1b8(0x183)]();switch(_0x4e11cc){case _0x24a1b8(0x18d):_0x1765b4[_0x24a1b8(0x18d)]=_0x2ba841,console[_0x24a1b8(0x181)]('Session\x20database\x20set\x20to:\x20'+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;case _0x24a1b8(0x18e):_0x1765b4[_0x24a1b8(0x18e)]=_0x2ba841,console[_0x24a1b8(0x181)](_0x24a1b8(0x17b)+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;case _0x24a1b8(0x18c):_0x1765b4[_0x24a1b8(0x18c)]=_0x2ba841,console[_0x24a1b8(0x181)](_0x24a1b8(0x16f)+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;}return saveSessionContext(_0x1765b4,_0x1fbc4a['session']),console['log'](_0x24a1b8(0x180)),0x0;}catch(_0x1ee12d){return _0x1ee12d instanceof Error&&console[_0x24a1b8(0x187)](_0x24a1b8(0x188)+_0x1ee12d[_0x24a1b8(0x16b)]),0x1;}}}
@@ -1 +1 @@
1
- const a32_0x1d683a=a32_0x453f;function a32_0x453f(_0x2174ae,_0x53c72c){const _0x4c65dc=a32_0x4c65();return a32_0x453f=function(_0x453f3b,_0x3d2202){_0x453f3b=_0x453f3b-0x1d1;let _0x32ce42=_0x4c65dc[_0x453f3b];return _0x32ce42;},a32_0x453f(_0x2174ae,_0x53c72c);}(function(_0x4e4227,_0x41a6b5){const _0x17603f=a32_0x453f,_0x42aa87=_0x4e4227();while(!![]){try{const _0x3b3199=-parseInt(_0x17603f(0x20c))/0x1*(-parseInt(_0x17603f(0x1d1))/0x2)+parseInt(_0x17603f(0x243))/0x3+parseInt(_0x17603f(0x1f3))/0x4*(parseInt(_0x17603f(0x1d6))/0x5)+-parseInt(_0x17603f(0x21a))/0x6*(-parseInt(_0x17603f(0x1d5))/0x7)+-parseInt(_0x17603f(0x20d))/0x8*(-parseInt(_0x17603f(0x231))/0x9)+-parseInt(_0x17603f(0x235))/0xa+-parseInt(_0x17603f(0x203))/0xb*(parseInt(_0x17603f(0x1e4))/0xc);if(_0x3b3199===_0x41a6b5)break;else _0x42aa87['push'](_0x42aa87['shift']());}catch(_0x146f48){_0x42aa87['push'](_0x42aa87['shift']());}}}(a32_0x4c65,0x9ed01));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_0x1d683a(0x242)]='workflow:projects';[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1dd);async[a32_0x1d683a(0x23c)](_0xb295c7){const _0x2e921d=a32_0x1d683a,{options:_0x35b80b,args:_0x90cc5b,tdx:_0x2c40d}=_0xb295c7,_0x29de17=_0x90cc5b[0x0];try{_0x35b80b[_0x2e921d(0x1e3)]&&_0x29de17&&console[_0x2e921d(0x220)]('Pattern:\x20'+_0x29de17);const _0x2d0ffd=await withSpinner(_0x2e921d(0x1d7),()=>_0x2c40d[_0x2e921d(0x227)][_0x2e921d(0x216)](_0x29de17,{'limit':_0x35b80b[_0x2e921d(0x1f2)]}),{'verbose':_0x35b80b[_0x2e921d(0x1e3)]}),_0x21a2bc=_0x2d0ffd['data'];return console[_0x2e921d(0x220)]('✔\x20Found\x20'+_0x21a2bc[_0x2e921d(0x1e2)]+_0x2e921d(0x1f0)+(_0x21a2bc[_0x2e921d(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x21a2bc,_0x35b80b),0x0;}catch(_0x2eb68d){if(_0x2eb68d instanceof SDKError)return console[_0x2e921d(0x220)](_0x2e921d(0x20f)+_0x2eb68d[_0x2e921d(0x223)]),_0x2eb68d['cause']&&console['error'](_0x2e921d(0x1df)+_0x2eb68d['cause']),0x1;throw _0x2eb68d;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']='workflow:workflows';[a32_0x1d683a(0x244)]='List\x20workflows';async[a32_0x1d683a(0x23c)](_0x7d1624){const _0x11c2b1=a32_0x1d683a,{options:_0x13811e,args:_0x5bcf1b,tdx:_0x3e079f}=_0x7d1624,_0x32193d=_0x5bcf1b[0x0];try{_0x13811e[_0x11c2b1(0x1e3)]&&_0x32193d&&console['error'](_0x11c2b1(0x1d3)+_0x32193d);const _0x177288=await withSpinner(_0x11c2b1(0x211),()=>_0x3e079f['workflow'][_0x11c2b1(0x236)](_0x32193d,{'limit':_0x13811e[_0x11c2b1(0x1f2)]}),{'verbose':_0x13811e[_0x11c2b1(0x1e3)]}),_0x5386dc=_0x177288[_0x11c2b1(0x1d9)];return console[_0x11c2b1(0x220)]('✔\x20Found\x20'+_0x5386dc[_0x11c2b1(0x1e2)]+_0x11c2b1(0x1ed)+(_0x5386dc['length']!==0x1?'s':'')),await handleSDKOutput(_0x5386dc,_0x13811e),0x0;}catch(_0x22f3fa){if(_0x22f3fa instanceof SDKError)return console[_0x11c2b1(0x220)]('Error:\x20'+_0x22f3fa[_0x11c2b1(0x223)]),_0x22f3fa[_0x11c2b1(0x1f6)]&&console[_0x11c2b1(0x220)](_0x11c2b1(0x1df)+_0x22f3fa[_0x11c2b1(0x1f6)]),0x1;throw _0x22f3fa;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x217);[a32_0x1d683a(0x244)]='List\x20workflow\x20execution\x20sessions';async[a32_0x1d683a(0x23c)](_0x1d0991){const _0x20950c=a32_0x1d683a,{options:_0x562271,args:_0x7f8c92,tdx:_0x21ceb9}=_0x1d0991;let _0x4cd9a9,_0x56a864;if(_0x7f8c92[0x0]){const _0x29b09e=_0x7f8c92[0x0][_0x20950c(0x21c)]('.');if(_0x29b09e['length']===0x1)_0x4cd9a9=_0x29b09e[0x0];else{if(_0x29b09e[_0x20950c(0x1e2)]===0x2)[_0x4cd9a9,_0x56a864]=_0x29b09e;else return console['error'](_0x20950c(0x248)),0x1;}}try{if(_0x562271[_0x20950c(0x1e3)]){if(_0x4cd9a9&&_0x56a864)console[_0x20950c(0x220)](_0x20950c(0x23f)+_0x4cd9a9+'.'+_0x56a864);else _0x4cd9a9&&console[_0x20950c(0x220)](_0x20950c(0x224)+_0x4cd9a9);const _0x159c8a=_0x562271[_0x20950c(0x1f5)];_0x159c8a&&console[_0x20950c(0x220)](_0x20950c(0x21f)+_0x159c8a);}const _0x33d68d=await withSpinner(_0x20950c(0x249),()=>_0x21ceb9['workflow']['sessions']({'projectName':_0x4cd9a9,'workflowName':_0x56a864,'status':_0x562271['status'],'fromTime':_0x562271[_0x20950c(0x1f8)],'toTime':_0x562271['to'],'limit':_0x562271['limit']}),{'verbose':_0x562271['verbose']}),_0x311a02=_0x33d68d[_0x20950c(0x1d9)];return console[_0x20950c(0x220)](_0x20950c(0x1ec)+_0x311a02[_0x20950c(0x1e2)]+'\x20session'+(_0x311a02[_0x20950c(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x311a02,_0x562271),0x0;}catch(_0x4c8683){if(_0x4c8683 instanceof SDKError)return console[_0x20950c(0x220)](_0x20950c(0x20f)+_0x4c8683['message']),_0x4c8683['cause']&&console['error'](_0x20950c(0x1df)+_0x4c8683[_0x20950c(0x1f6)]),0x1;throw _0x4c8683;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x22a);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x201);async[a32_0x1d683a(0x23c)](_0x173491){const _0x571b8e=a32_0x1d683a,{options:_0x184af7,args:_0x50adf0,tdx:_0xb58681}=_0x173491;let _0x5680ea,_0xb1a261;if(_0x50adf0[0x0]){const _0x56d63a=_0x50adf0[0x0][_0x571b8e(0x21c)]('.');if(_0x56d63a[_0x571b8e(0x1e2)]===0x1)_0x5680ea=_0x56d63a[0x0];else{if(_0x56d63a['length']===0x2)[_0x5680ea,_0xb1a261]=_0x56d63a;else return console[_0x571b8e(0x220)](_0x571b8e(0x248)),0x1;}}try{const _0x3fc716=_0x184af7[_0x571b8e(0x1ff)];if(_0x184af7[_0x571b8e(0x1e3)]){if(_0x5680ea&&_0xb1a261)console[_0x571b8e(0x220)](_0x571b8e(0x23f)+_0x5680ea+'.'+_0xb1a261);else _0x5680ea&&console[_0x571b8e(0x220)](_0x571b8e(0x224)+_0x5680ea);_0x3fc716&&console[_0x571b8e(0x220)]('Include\x20retried:\x20yes');}const _0x119b12=await withSpinner(_0x571b8e(0x20e),()=>_0xb58681[_0x571b8e(0x227)][_0x571b8e(0x212)]({'projectName':_0x5680ea,'workflowName':_0xb1a261,'includeRetried':_0x3fc716,'limit':_0x184af7[_0x571b8e(0x1f2)]}),{'verbose':_0x184af7[_0x571b8e(0x1e3)]}),_0x3b6cf6=_0x119b12['data'];return console['error'](_0x571b8e(0x1ec)+_0x3b6cf6[_0x571b8e(0x1e2)]+_0x571b8e(0x1e6)+(_0x3b6cf6[_0x571b8e(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x3b6cf6,_0x184af7),0x0;}catch(_0x5f5682){if(_0x5f5682 instanceof SDKError)return console['error'](_0x571b8e(0x20f)+_0x5f5682['message']),_0x5f5682['cause']&&console['error'](_0x571b8e(0x1df)+_0x5f5682[_0x571b8e(0x1f6)]),0x1;throw _0x5f5682;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x1d683a(0x242)]='workflow:attempt';['description']=a32_0x1d683a(0x24d);async[a32_0x1d683a(0x23c)](_0x2c2147){const _0x40d79a=a32_0x1d683a,{options:_0x3a5ada,args:_0x17f60a,tdx:_0x1ffa2d}=_0x2c2147,_0x441e18=_0x17f60a[0x0];if(!_0x441e18)return console['error'](_0x40d79a(0x1e8)),0x1;try{_0x3a5ada['verbose']&&console['error'](_0x40d79a(0x241)+_0x441e18);const _0x1165e9=await withSpinner('Getting\x20attempt\x20details...',()=>_0x1ffa2d[_0x40d79a(0x227)][_0x40d79a(0x1d2)](_0x441e18),{'verbose':_0x3a5ada[_0x40d79a(0x1e3)]}),_0x5a3703=_0x1165e9[_0x40d79a(0x1d9)];return await handleSDKOutput([_0x5a3703],_0x3a5ada),0x0;}catch(_0x5c54d2){if(_0x5c54d2 instanceof SDKError)return console[_0x40d79a(0x220)](_0x40d79a(0x20f)+_0x5c54d2['message']),_0x5c54d2[_0x40d79a(0x1f6)]&&console[_0x40d79a(0x220)](_0x40d79a(0x1df)+_0x5c54d2[_0x40d79a(0x1f6)]),0x1;throw _0x5c54d2;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x1d683a(0x24c);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x225);async[a32_0x1d683a(0x23c)](_0x42c0c6){const _0x23d57a=a32_0x1d683a,{options:_0x1673bc,args:_0x359baa,tdx:_0x1886d6}=_0x42c0c6,_0x9b5a70=_0x359baa[0x0];if(!_0x9b5a70)return console[_0x23d57a(0x220)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x383ca1=_0x1673bc[_0x23d57a(0x221)];_0x1673bc[_0x23d57a(0x1e3)]&&(console['error']('Attempt\x20ID:\x20'+_0x9b5a70),_0x383ca1&&console['error'](_0x23d57a(0x1e7)));const _0x13e538=await withSpinner(_0x23d57a(0x219),()=>_0x1886d6[_0x23d57a(0x227)]['tasks'](_0x9b5a70,_0x383ca1||![]),{'verbose':_0x1673bc['verbose']}),_0x1163e7=_0x13e538[_0x23d57a(0x1d9)];return console[_0x23d57a(0x220)](_0x23d57a(0x1ec)+_0x1163e7[_0x23d57a(0x1e2)]+'\x20task'+(_0x1163e7[_0x23d57a(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x1163e7,_0x1673bc),0x0;}catch(_0x2dd345){if(_0x2dd345 instanceof SDKError)return console[_0x23d57a(0x220)](_0x23d57a(0x20f)+_0x2dd345['message']),_0x2dd345[_0x23d57a(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x2dd345[_0x23d57a(0x1f6)]),0x1;throw _0x2dd345;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x232);[a32_0x1d683a(0x244)]='Show\x20logs\x20for\x20a\x20specific\x20task';async['execute'](_0x27ed65){const _0x3b8f46=a32_0x1d683a,{options:_0x2b7dfb,args:_0x287b26,tdx:_0x3dae73}=_0x27ed65,_0x464ec2=_0x287b26[0x0],_0x4106da=_0x287b26[0x1];if(!_0x464ec2||!_0x4106da)return console['error']('Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required'),0x1;try{_0x2b7dfb[_0x3b8f46(0x1e3)]&&(console[_0x3b8f46(0x220)]('Attempt\x20ID:\x20'+_0x464ec2),console['error'](_0x3b8f46(0x1ea)+_0x4106da));const _0x2a737c=_0x2b7dfb[_0x3b8f46(0x20b)],_0x286e39=await withSpinner('Getting\x20task\x20logs...',()=>_0x3dae73['workflow'][_0x3b8f46(0x208)](_0x464ec2,_0x4106da,{'offset':_0x2a737c,'limit':_0x2b7dfb[_0x3b8f46(0x1f2)]}),{'verbose':_0x2b7dfb['verbose']}),_0x1a192f=_0x286e39['data'];return console[_0x3b8f46(0x220)]('✔\x20Found\x20'+_0x1a192f[_0x3b8f46(0x1e2)]+_0x3b8f46(0x1e0)+(_0x1a192f['length']!==0x1?'ies':'y')),await handleSDKOutput(_0x1a192f,_0x2b7dfb),0x0;}catch(_0x290813){if(_0x290813 instanceof SDKError)return console['error'](_0x3b8f46(0x20f)+_0x290813[_0x3b8f46(0x223)]),_0x290813[_0x3b8f46(0x1f6)]&&console[_0x3b8f46(0x220)](_0x3b8f46(0x1df)+_0x290813['cause']),0x1;throw _0x290813;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x23d);[a32_0x1d683a(0x244)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x119564){const _0x265bdd=a32_0x1d683a,{options:_0xf59173,args:_0x57645c,tdx:_0x1ec766}=_0x119564,_0x3eaee6=_0x57645c[0x0];if(!_0x3eaee6)return console[_0x265bdd(0x220)](_0x265bdd(0x1e8)),0x1;try{const _0x27663f=_0xf59173[_0x265bdd(0x230)];_0xf59173[_0x265bdd(0x1e3)]&&(console[_0x265bdd(0x220)](_0x265bdd(0x241)+_0x3eaee6),_0x27663f&&console['error'](_0x265bdd(0x1d4)+_0x27663f));if(!_0xf59173['yes']){const _0x46b5fd=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3eaee6+'?');if(!_0x46b5fd)return console[_0x265bdd(0x220)](_0x265bdd(0x22c)),0x0;}const _0x19b415=await withSpinner('Killing\x20attempt...',()=>_0x1ec766[_0x265bdd(0x227)]['kill'](_0x3eaee6,_0x27663f),{'verbose':_0xf59173[_0x265bdd(0x1e3)]}),_0x5c245b=_0x19b415[_0x265bdd(0x1d9)];return console[_0x265bdd(0x220)]('✔\x20'+_0x5c245b),0x0;}catch(_0x54d4a5){if(_0x54d4a5 instanceof SDKError)return console['error'](_0x265bdd(0x20f)+_0x54d4a5[_0x265bdd(0x223)]),_0x54d4a5[_0x265bdd(0x1f6)]&&console[_0x265bdd(0x220)](_0x265bdd(0x1df)+_0x54d4a5[_0x265bdd(0x1f6)]),0x1;throw _0x54d4a5;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x210);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x1d683a(0x23c)](_0x3d6476){const _0x535a9e=a32_0x1d683a,{options:_0x4bcf1a,args:_0x4e6285,tdx:_0x4ad7d4}=_0x3d6476,_0x3c8506=_0x4e6285[0x0];if(!_0x3c8506)return console['error'](_0x535a9e(0x218)),console[_0x535a9e(0x220)](_0x535a9e(0x246)),0x1;let _0x5d82b6=![],_0x12dd8f=_0x3c8506;if(_0x3c8506[_0x535a9e(0x22b)](_0x535a9e(0x1fb)))_0x5d82b6=!![],_0x12dd8f=_0x3c8506[_0x535a9e(0x1e5)](0x8);else{if(_0x3c8506[_0x535a9e(0x22b)](_0x535a9e(0x1fa)))_0x5d82b6=![],_0x12dd8f=_0x3c8506[_0x535a9e(0x1e5)](0x8);else return console[_0x535a9e(0x220)](_0x535a9e(0x240)),console['error'](_0x535a9e(0x246)),0x1;}try{const _0x39a0f9=_0x4bcf1a[_0x535a9e(0x1f4)],_0x58458d=_0x4bcf1a[_0x535a9e(0x239)],_0x5405e4=_0x4bcf1a[_0x535a9e(0x204)],_0x4fbbf9=_0x4bcf1a['force'];_0x4bcf1a[_0x535a9e(0x1e3)]&&(console[_0x535a9e(0x220)](_0x535a9e(0x1f7)+(_0x5d82b6?_0x535a9e(0x24b):_0x535a9e(0x1d2))+'\x20'+_0x12dd8f),_0x39a0f9&&console[_0x535a9e(0x220)]('From\x20task:\x20'+_0x39a0f9),_0x58458d&&console[_0x535a9e(0x220)](_0x535a9e(0x22e)+_0x58458d),_0x5405e4&&console[_0x535a9e(0x220)](_0x535a9e(0x21e)+_0x5405e4),_0x4fbbf9&&console[_0x535a9e(0x220)](_0x535a9e(0x213)));let _0x4a88d2;if(_0x5405e4)try{if(_0x5405e4[_0x535a9e(0x22b)]('@')){const _0x57ae48=await import(_0x535a9e(0x1da)),_0x5106c4=_0x5405e4[_0x535a9e(0x1e5)](0x1),_0x54938f=await _0x57ae48['readFile'](_0x5106c4,_0x535a9e(0x23e));_0x4a88d2=JSON[_0x535a9e(0x209)](_0x54938f);}else _0x4a88d2=JSON[_0x535a9e(0x209)](_0x5405e4);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4bcf1a[_0x535a9e(0x233)]){const _0x5f52c5=await confirm(_0x535a9e(0x1db)+(_0x5d82b6?_0x535a9e(0x24b):_0x535a9e(0x1d2))+'\x20'+_0x12dd8f+'?');if(!_0x5f52c5)return console[_0x535a9e(0x220)](_0x535a9e(0x22c)),0x0;}let _0x233fbb;_0x5d82b6?_0x233fbb=await withSpinner(_0x535a9e(0x22d),()=>_0x4ad7d4[_0x535a9e(0x227)]['retrySession'](_0x12dd8f,{'fromTask':_0x39a0f9,'retryParams':_0x4a88d2}),{'verbose':_0x4bcf1a[_0x535a9e(0x1e3)]}):_0x233fbb=await withSpinner(_0x535a9e(0x21d),()=>_0x4ad7d4[_0x535a9e(0x227)]['retryAttempt'](_0x12dd8f,{'resumeFrom':_0x58458d,'retryParams':_0x4a88d2,'force':_0x4fbbf9}),{'verbose':_0x4bcf1a[_0x535a9e(0x1e3)]});const _0x10fa05=_0x233fbb[_0x535a9e(0x1d9)];return console[_0x535a9e(0x220)]('✔\x20Retry\x20started'),console[_0x535a9e(0x220)](_0x535a9e(0x228)+_0x10fa05[_0x535a9e(0x1fc)]),console[_0x535a9e(0x220)](_0x535a9e(0x23a)+_0x10fa05[_0x535a9e(0x24a)]),0x0;}catch(_0x37d845){if(_0x37d845 instanceof SDKError)return console[_0x535a9e(0x220)](_0x535a9e(0x20f)+_0x37d845[_0x535a9e(0x223)]),_0x37d845[_0x535a9e(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x37d845['cause']),0x1;throw _0x37d845;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x222);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1e9);async[a32_0x1d683a(0x23c)](_0x52f8d7){const _0x10df88=a32_0x1d683a,{options:_0x153e50,args:_0x41cdda,tdx:_0x2876cc}=_0x52f8d7,_0x1d9670=_0x41cdda[0x0],_0x31fa59=_0x41cdda[0x1]||'.';if(!_0x1d9670)return console[_0x10df88(0x220)](_0x10df88(0x1fd)),console[_0x10df88(0x220)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x4703fa=_0x153e50[_0x10df88(0x238)];_0x153e50[_0x10df88(0x1e3)]&&(console[_0x10df88(0x220)](_0x10df88(0x21b)+_0x1d9670),console[_0x10df88(0x220)]('Output\x20directory:\x20'+_0x31fa59),_0x4703fa&&console[_0x10df88(0x220)](_0x10df88(0x1dc)+_0x4703fa));const _0x44b089=await withSpinner(_0x10df88(0x205)+_0x1d9670+'...',()=>_0x2876cc['workflow'][_0x10df88(0x1eb)](_0x1d9670,_0x31fa59,{'revision':_0x4703fa}),{'verbose':_0x153e50[_0x10df88(0x1e3)]}),_0x9f34ca=_0x44b089[_0x10df88(0x1d9)];return console[_0x10df88(0x220)](_0x10df88(0x202)+_0x9f34ca[_0x10df88(0x229)]),console['error'](_0x10df88(0x226)+_0x9f34ca[_0x10df88(0x238)]),console[_0x10df88(0x220)](_0x10df88(0x1f9)+_0x9f34ca['filesExtracted']),console['error']('\x20\x20Location:\x20'+_0x31fa59+'/'+_0x9f34ca[_0x10df88(0x229)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x207);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1ee);async[a32_0x1d683a(0x23c)](_0x56fe58){const _0x38c6ae=a32_0x1d683a,{options:_0x1276cb,args:_0x2d510c,tdx:_0x350bb9}=_0x56fe58;let _0x570b49='.',_0x25c4f1=_0x1276cb[_0x38c6ae(0x242)];if(_0x2d510c[0x0]){const {promises:_0xdf59b3}=await import('fs');try{const _0x25679d=await _0xdf59b3[_0x38c6ae(0x23b)](_0x2d510c[0x0]);if(_0x25679d[_0x38c6ae(0x214)]())_0x570b49=_0x2d510c[0x0];else return console[_0x38c6ae(0x220)](_0x38c6ae(0x20f)+_0x2d510c[0x0]+_0x38c6ae(0x1ef)),0x1;}catch{_0x25c4f1=_0x2d510c[0x0],_0x570b49='.';}}const _0x59d379=_0x1276cb[_0x38c6ae(0x238)],_0x3d3dcf=_0x1276cb['skipValidation'];_0x1276cb[_0x38c6ae(0x1e3)]&&(console[_0x38c6ae(0x220)]('Project\x20directory:\x20'+_0x570b49),_0x25c4f1&&console['error'](_0x38c6ae(0x200)+_0x25c4f1),_0x59d379&&console[_0x38c6ae(0x220)](_0x38c6ae(0x1dc)+_0x59d379),_0x3d3dcf&&console['error'](_0x38c6ae(0x22f)));const _0x1d23db=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x350bb9[_0x38c6ae(0x227)][_0x38c6ae(0x1d8)](_0x570b49,{'projectName':_0x25c4f1,'revision':_0x59d379,'skipValidation':_0x3d3dcf}),{'verbose':_0x1276cb['verbose']}),_0x52c408=_0x1d23db['data'];return console[_0x38c6ae(0x220)](_0x38c6ae(0x245)+_0x52c408[_0x38c6ae(0x229)]),console[_0x38c6ae(0x220)]('\x20\x20Project\x20ID:\x20'+_0x52c408['projectId']),console[_0x38c6ae(0x220)](_0x38c6ae(0x226)+_0x52c408[_0x38c6ae(0x238)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a32_0x1d683a(0x1fe);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x247);async['execute'](_0x1ff859){const _0x49260e=a32_0x1d683a,{options:_0x31e053,args:_0x553c27,tdx:_0x13a715}=_0x1ff859,_0xf912c5=_0x553c27[0x0];if(!_0xf912c5)return console['error'](_0x49260e(0x1de)),console[_0x49260e(0x220)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x31e053[_0x49260e(0x1e3)]&&console[_0x49260e(0x220)](_0x49260e(0x21b)+_0xf912c5);if(!_0x31e053[_0x49260e(0x233)]){const _0x4ee724=await confirm(_0x49260e(0x234)+_0xf912c5+_0x49260e(0x20a));if(!_0x4ee724)return console[_0x49260e(0x220)](_0x49260e(0x22c)),0x0;}const _0x31476d=await withSpinner(_0x49260e(0x1e1)+_0xf912c5+_0x49260e(0x1f1),()=>_0x13a715[_0x49260e(0x227)][_0x49260e(0x215)](_0xf912c5),{'verbose':_0x31e053[_0x49260e(0x1e3)]}),_0x441dd7=_0x31476d[_0x49260e(0x1d9)];return console['error']('✔\x20Deleted\x20project\x20'+_0x441dd7[_0x49260e(0x229)]),console[_0x49260e(0x220)](_0x49260e(0x237)+_0x441dd7[_0x49260e(0x206)]),0x0;}}function a32_0x4c65(){const _0x5996fb=['Attempt\x20ID:\x20','name','649248AohEFb','description','✔\x20Pushed\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Listing\x20workflow\x20sessions...','sessionId','session','workflow:tasks','Show\x20specific\x20attempt\x20details','837524YhOZrY','attempt','Project\x20filter:\x20','Reason:\x20','7CKyfZy','55qvYpOo','Listing\x20workflow\x20projects...','push','data','fs/promises','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Revision:\x20','List\x20all\x20workflow\x20projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Cause:\x20','\x20log\x20entr','Deleting\x20project\x20','length','verbose','2388OCOIjP','substring','\x20attempt','Including\x20subtasks:\x20yes','Error:\x20Attempt\x20ID\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Task\x20name:\x20','download','✔\x20Found\x20','\x20workflow','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','\x20is\x20not\x20a\x20directory','\x20project','...','limit','328912LUouzU','fromTask','status','cause','Target:\x20','from','\x20\x20Files\x20extracted:\x20','attempt:','session:','attemptId','Error:\x20Project\x20name\x20is\x20required','workflow:delete','includeRetried','Project\x20name:\x20','List\x20workflow\x20attempts','✔\x20Downloaded\x20','126929vhbecz','params','Downloading\x20project\x20','projectId','workflow:push','logs','parse','\x22?\x20This\x20cannot\x20be\x20undone.','offset','1wXQoxw','3336280goCEfR','Listing\x20workflow\x20attempts...','Error:\x20','workflow:retry','Listing\x20workflows...','attempts','Force:\x20yes','isDirectory','delete','projects','workflow:sessions','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','4508556CsDxaL','Project:\x20','split','Retrying\x20attempt...','Params:\x20','Status:\x20','error','includeSubtasks','workflow:download','message','Filter:\x20project=','Show\x20tasks\x20for\x20an\x20attempt','\x20\x20Revision:\x20','workflow','\x20\x20New\x20attempt\x20ID:\x20','projectName','workflow:attempts','startsWith','Cancelled','Retrying\x20session...','Resume\x20from:\x20','Validation:\x20skipped','reason','27HIRpqL','workflow:logs','yes','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','5954590moClOB','workflows','\x20\x20Project\x20ID:\x20','revision','resumeFrom','\x20\x20Session\x20ID:\x20','stat','execute','workflow:kill','utf-8','Filter:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'];a32_0x4c65=function(){return _0x5996fb;};return a32_0x4c65();}
1
+ const a32_0x13ff80=a32_0x5a7c;function a32_0x5650(){const _0x239ed5=['1808004FulWes','filesExtracted','Downloading\x20project\x20','stat','...','workflow:retry','attemptId','Validation:\x20skipped','532HfWQDg','workflow:kill','3082408KmOBAi','Listing\x20workflow\x20sessions...','session:','startsWith','includeSubtasks','fromTask','\x20log\x20entr','✔\x20Deleted\x20project\x20','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','workflow:sessions','61554DZgkQR','attempts','1gOtmpy','attempt','workflow:logs','length','session','retrySession','Killing\x20attempt...','\x20\x20Files\x20extracted:\x20','error','from','includeRetried','Cancelled','\x20session','logs','name','6720420qjNbXg','Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','workflow:push','15hfhVpu','cause','workflow:projects','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','split','Task\x20name:\x20','Params:\x20','\x20\x20Cause:\x20','List\x20workflow\x20execution\x20sessions','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','data','fs/promises','skipValidation','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Project\x20directory:\x20','limit','Pattern:\x20','Error:\x20','projectId','\x20is\x20not\x20a\x20directory','reason','Kill\x20a\x20running\x20attempt','Listing\x20workflows...','delete','workflow:download','ies','projects','Project\x20name:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','From\x20task:\x20','verbose','Revision:\x20','params','execute','Including\x20subtasks:\x20yes','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','yes','retryAttempt','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20workflow\x20attempts...','substring','Getting\x20attempt\x20details...','✔\x20Retry\x20started','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','3952201SSTboB','workflow','178348YxHapD','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow:attempts','revision','parse','Filter:\x20project=','9XjZyrE','List\x20workflow\x20attempts','projectName','Listing\x20workflow\x20projects...','workflow:attempt','Error:\x20Attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','\x20\x20Project\x20ID:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Getting\x20task\x20logs...','\x20\x20Location:\x20','✔\x20Found\x20','Project:\x20','sessionId','status','Deleting\x20project\x20','Include\x20retried:\x20yes','readFile','workflow:tasks','Resume\x20from:\x20','workflows','Target:\x20','Reason:\x20','Show\x20logs\x20for\x20a\x20specific\x20task','\x20\x20Session\x20ID:\x20','message','\x20workflow','description','\x22?\x20This\x20cannot\x20be\x20undone.','\x20task','Output\x20directory:\x20','8330440SWjJBP','workflow:workflows','offset'];a32_0x5650=function(){return _0x239ed5;};return a32_0x5650();}(function(_0x38fc14,_0x320c5b){const _0x4d5dd8=a32_0x5a7c,_0x27c79c=_0x38fc14();while(!![]){try{const _0x31442c=-parseInt(_0x4d5dd8(0x111))/0x1*(-parseInt(_0x4d5dd8(0xfb))/0x2)+parseInt(_0x4d5dd8(0x124))/0x3*(parseInt(_0x4d5dd8(0x156))/0x4)+parseInt(_0x4d5dd8(0x120))/0x5+-parseInt(_0x4d5dd8(0x10f))/0x6*(parseInt(_0x4d5dd8(0x103))/0x7)+-parseInt(_0x4d5dd8(0x105))/0x8+parseInt(_0x4d5dd8(0x15c))/0x9*(-parseInt(_0x4d5dd8(0xf8))/0xa)+parseInt(_0x4d5dd8(0x154))/0xb;if(_0x31442c===_0x320c5b)break;else _0x27c79c['push'](_0x27c79c['shift']());}catch(_0x1ca565){_0x27c79c['push'](_0x27c79c['shift']());}}}(a32_0x5650,0xcb31b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x126);[a32_0x13ff80(0xf4)]='List\x20all\x20workflow\x20projects';async[a32_0x13ff80(0x148)](_0x1ae513){const _0x8a1b40=a32_0x13ff80,{options:_0x3794aa,args:_0xb24461,tdx:_0xc37ca}=_0x1ae513,_0x4c8a83=_0xb24461[0x0];try{_0x3794aa[_0x8a1b40(0x145)]&&_0x4c8a83&&console[_0x8a1b40(0x119)](_0x8a1b40(0x137)+_0x4c8a83);const _0x50b48a=await withSpinner(_0x8a1b40(0x15f),()=>_0xc37ca[_0x8a1b40(0x155)][_0x8a1b40(0x141)](_0x4c8a83,{'limit':_0x3794aa[_0x8a1b40(0x136)]}),{'verbose':_0x3794aa[_0x8a1b40(0x145)]}),_0x3c7808=_0x50b48a[_0x8a1b40(0x130)];return console[_0x8a1b40(0x119)](_0x8a1b40(0x167)+_0x3c7808[_0x8a1b40(0x114)]+'\x20project'+(_0x3c7808[_0x8a1b40(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x3c7808,_0x3794aa),0x0;}catch(_0x4e6155){if(_0x4e6155 instanceof SDKError)return console[_0x8a1b40(0x119)](_0x8a1b40(0x138)+_0x4e6155['message']),_0x4e6155['cause']&&console['error'](_0x8a1b40(0x12b)+_0x4e6155[_0x8a1b40(0x125)]),0x1;throw _0x4e6155;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0xf9);[a32_0x13ff80(0xf4)]='List\x20workflows';async[a32_0x13ff80(0x148)](_0x218d40){const _0x35a413=a32_0x13ff80,{options:_0x1c213e,args:_0x32c627,tdx:_0x5e2cd4}=_0x218d40,_0x510e4d=_0x32c627[0x0];try{_0x1c213e[_0x35a413(0x145)]&&_0x510e4d&&console[_0x35a413(0x119)]('Project\x20filter:\x20'+_0x510e4d);const _0x118bfe=await withSpinner(_0x35a413(0x13d),()=>_0x5e2cd4[_0x35a413(0x155)][_0x35a413(0xed)](_0x510e4d,{'limit':_0x1c213e[_0x35a413(0x136)]}),{'verbose':_0x1c213e[_0x35a413(0x145)]}),_0x1e67fe=_0x118bfe['data'];return console[_0x35a413(0x119)]('✔\x20Found\x20'+_0x1e67fe['length']+_0x35a413(0xf3)+(_0x1e67fe[_0x35a413(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x1e67fe,_0x1c213e),0x0;}catch(_0x5ecb87){if(_0x5ecb87 instanceof SDKError)return console[_0x35a413(0x119)](_0x35a413(0x138)+_0x5ecb87['message']),_0x5ecb87[_0x35a413(0x125)]&&console['error'](_0x35a413(0x12b)+_0x5ecb87[_0x35a413(0x125)]),0x1;throw _0x5ecb87;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x10e);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12c);async[a32_0x13ff80(0x148)](_0xaf36fc){const _0x28725c=a32_0x13ff80,{options:_0x5c90a0,args:_0x136d07,tdx:_0x408895}=_0xaf36fc;let _0x47c1e0,_0x20ad01;if(_0x136d07[0x0]){const _0x13e519=_0x136d07[0x0]['split']('.');if(_0x13e519['length']===0x1)_0x47c1e0=_0x13e519[0x0];else{if(_0x13e519['length']===0x2)[_0x47c1e0,_0x20ad01]=_0x13e519;else return console['error']('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5c90a0[_0x28725c(0x145)]){if(_0x47c1e0&&_0x20ad01)console[_0x28725c(0x119)](_0x28725c(0x133)+_0x47c1e0+'.'+_0x20ad01);else _0x47c1e0&&console[_0x28725c(0x119)](_0x28725c(0x15b)+_0x47c1e0);const _0x198866=_0x5c90a0['status'];_0x198866&&console[_0x28725c(0x119)]('Status:\x20'+_0x198866);}const _0x3c0cd1=await withSpinner(_0x28725c(0x106),()=>_0x408895[_0x28725c(0x155)]['sessions']({'projectName':_0x47c1e0,'workflowName':_0x20ad01,'status':_0x5c90a0[_0x28725c(0xe7)],'fromTime':_0x5c90a0[_0x28725c(0x11a)],'toTime':_0x5c90a0['to'],'limit':_0x5c90a0[_0x28725c(0x136)]}),{'verbose':_0x5c90a0[_0x28725c(0x145)]}),_0x5ad890=_0x3c0cd1['data'];return console['error'](_0x28725c(0x167)+_0x5ad890[_0x28725c(0x114)]+_0x28725c(0x11d)+(_0x5ad890[_0x28725c(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x5ad890,_0x5c90a0),0x0;}catch(_0x380fef){if(_0x380fef instanceof SDKError)return console[_0x28725c(0x119)](_0x28725c(0x138)+_0x380fef[_0x28725c(0xf2)]),_0x380fef[_0x28725c(0x125)]&&console[_0x28725c(0x119)](_0x28725c(0x12b)+_0x380fef[_0x28725c(0x125)]),0x1;throw _0x380fef;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x158);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x15d);async[a32_0x13ff80(0x148)](_0x4c98a6){const _0x58e37c=a32_0x13ff80,{options:_0x355e9b,args:_0x107bf8,tdx:_0x56cd15}=_0x4c98a6;let _0x75b718,_0x48a118;if(_0x107bf8[0x0]){const _0xf53be2=_0x107bf8[0x0][_0x58e37c(0x128)]('.');if(_0xf53be2['length']===0x1)_0x75b718=_0xf53be2[0x0];else{if(_0xf53be2['length']===0x2)[_0x75b718,_0x48a118]=_0xf53be2;else return console[_0x58e37c(0x119)](_0x58e37c(0x127)),0x1;}}try{const _0x5408eb=_0x355e9b[_0x58e37c(0x11b)];if(_0x355e9b[_0x58e37c(0x145)]){if(_0x75b718&&_0x48a118)console[_0x58e37c(0x119)](_0x58e37c(0x133)+_0x75b718+'.'+_0x48a118);else _0x75b718&&console['error'](_0x58e37c(0x15b)+_0x75b718);_0x5408eb&&console[_0x58e37c(0x119)](_0x58e37c(0xe9));}const _0x1d3fb0=await withSpinner(_0x58e37c(0x14f),()=>_0x56cd15[_0x58e37c(0x155)][_0x58e37c(0x110)]({'projectName':_0x75b718,'workflowName':_0x48a118,'includeRetried':_0x5408eb,'limit':_0x355e9b[_0x58e37c(0x136)]}),{'verbose':_0x355e9b[_0x58e37c(0x145)]}),_0x2a381a=_0x1d3fb0[_0x58e37c(0x130)];return console[_0x58e37c(0x119)](_0x58e37c(0x167)+_0x2a381a[_0x58e37c(0x114)]+'\x20attempt'+(_0x2a381a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2a381a,_0x355e9b),0x0;}catch(_0x36b994){if(_0x36b994 instanceof SDKError)return console[_0x58e37c(0x119)](_0x58e37c(0x138)+_0x36b994[_0x58e37c(0xf2)]),_0x36b994[_0x58e37c(0x125)]&&console[_0x58e37c(0x119)](_0x58e37c(0x12b)+_0x36b994[_0x58e37c(0x125)]),0x1;throw _0x36b994;}}}function a32_0x5a7c(_0x17f220,_0x46dd2a){const _0x565092=a32_0x5650();return a32_0x5a7c=function(_0x5a7cd3,_0x2aed99){_0x5a7cd3=_0x5a7cd3-0xe7;let _0x288da4=_0x565092[_0x5a7cd3];return _0x288da4;},a32_0x5a7c(_0x17f220,_0x46dd2a);}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x160);['description']='Show\x20specific\x20attempt\x20details';async[a32_0x13ff80(0x148)](_0x4eada8){const _0x3d970f=a32_0x13ff80,{options:_0x3d4748,args:_0x43f41b,tdx:_0xb3d9aa}=_0x4eada8,_0x151153=_0x43f41b[0x0];if(!_0x151153)return console['error'](_0x3d970f(0x161)),0x1;try{_0x3d4748[_0x3d970f(0x145)]&&console[_0x3d970f(0x119)](_0x3d970f(0x121)+_0x151153);const _0x1b0957=await withSpinner(_0x3d970f(0x151),()=>_0xb3d9aa['workflow'][_0x3d970f(0x112)](_0x151153),{'verbose':_0x3d4748[_0x3d970f(0x145)]}),_0x244aef=_0x1b0957[_0x3d970f(0x130)];return await handleSDKOutput([_0x244aef],_0x3d4748),0x0;}catch(_0x55e1cb){if(_0x55e1cb instanceof SDKError)return console['error'](_0x3d970f(0x138)+_0x55e1cb[_0x3d970f(0xf2)]),_0x55e1cb[_0x3d970f(0x125)]&&console[_0x3d970f(0x119)](_0x3d970f(0x12b)+_0x55e1cb[_0x3d970f(0x125)]),0x1;throw _0x55e1cb;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x13ff80(0xeb);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12d);async[a32_0x13ff80(0x148)](_0x411203){const _0x111478=a32_0x13ff80,{options:_0x302353,args:_0x385396,tdx:_0xc9feaa}=_0x411203,_0x248ccf=_0x385396[0x0];if(!_0x248ccf)return console[_0x111478(0x119)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x479ac0=_0x302353[_0x111478(0x109)];_0x302353[_0x111478(0x145)]&&(console[_0x111478(0x119)]('Attempt\x20ID:\x20'+_0x248ccf),_0x479ac0&&console[_0x111478(0x119)](_0x111478(0x149)));const _0x46ab0f=await withSpinner(_0x111478(0x162),()=>_0xc9feaa[_0x111478(0x155)]['tasks'](_0x248ccf,_0x479ac0||![]),{'verbose':_0x302353['verbose']}),_0x565b78=_0x46ab0f[_0x111478(0x130)];return console[_0x111478(0x119)](_0x111478(0x167)+_0x565b78[_0x111478(0x114)]+_0x111478(0xf6)+(_0x565b78[_0x111478(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x565b78,_0x302353),0x0;}catch(_0xcf9d32){if(_0xcf9d32 instanceof SDKError)return console[_0x111478(0x119)](_0x111478(0x138)+_0xcf9d32[_0x111478(0xf2)]),_0xcf9d32['cause']&&console[_0x111478(0x119)](_0x111478(0x12b)+_0xcf9d32[_0x111478(0x125)]),0x1;throw _0xcf9d32;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x113);['description']=a32_0x13ff80(0xf0);async[a32_0x13ff80(0x148)](_0x46ba21){const _0x189977=a32_0x13ff80,{options:_0x23aebc,args:_0x15791d,tdx:_0x319b1b}=_0x46ba21,_0x5f4048=_0x15791d[0x0],_0x1005d7=_0x15791d[0x1];if(!_0x5f4048||!_0x1005d7)return console['error'](_0x189977(0x10d)),0x1;try{_0x23aebc[_0x189977(0x145)]&&(console[_0x189977(0x119)](_0x189977(0x121)+_0x5f4048),console[_0x189977(0x119)](_0x189977(0x129)+_0x1005d7));const _0x2c2c22=_0x23aebc[_0x189977(0xfa)],_0x3e2e39=await withSpinner(_0x189977(0x165),()=>_0x319b1b[_0x189977(0x155)][_0x189977(0x11e)](_0x5f4048,_0x1005d7,{'offset':_0x2c2c22,'limit':_0x23aebc[_0x189977(0x136)]}),{'verbose':_0x23aebc[_0x189977(0x145)]}),_0x457f02=_0x3e2e39[_0x189977(0x130)];return console[_0x189977(0x119)](_0x189977(0x167)+_0x457f02[_0x189977(0x114)]+_0x189977(0x10b)+(_0x457f02[_0x189977(0x114)]!==0x1?_0x189977(0x140):'y')),await handleSDKOutput(_0x457f02,_0x23aebc),0x0;}catch(_0x57e868){if(_0x57e868 instanceof SDKError)return console[_0x189977(0x119)](_0x189977(0x138)+_0x57e868[_0x189977(0xf2)]),_0x57e868['cause']&&console[_0x189977(0x119)](_0x189977(0x12b)+_0x57e868['cause']),0x1;throw _0x57e868;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x104);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x13c);async[a32_0x13ff80(0x148)](_0x291f6c){const _0x20bf25=a32_0x13ff80,{options:_0xad14f5,args:_0x18e9cb,tdx:_0x1ab9ef}=_0x291f6c,_0x1fc624=_0x18e9cb[0x0];if(!_0x1fc624)return console[_0x20bf25(0x119)](_0x20bf25(0x161)),0x1;try{const _0x302565=_0xad14f5[_0x20bf25(0x13b)];_0xad14f5[_0x20bf25(0x145)]&&(console[_0x20bf25(0x119)](_0x20bf25(0x121)+_0x1fc624),_0x302565&&console['error'](_0x20bf25(0xef)+_0x302565));if(!_0xad14f5['yes']){const _0x3d7018=await confirm(_0x20bf25(0x12f)+_0x1fc624+'?');if(!_0x3d7018)return console['error']('Cancelled'),0x0;}const _0x498b51=await withSpinner(_0x20bf25(0x117),()=>_0x1ab9ef['workflow']['kill'](_0x1fc624,_0x302565),{'verbose':_0xad14f5[_0x20bf25(0x145)]}),_0x2a5d24=_0x498b51[_0x20bf25(0x130)];return console[_0x20bf25(0x119)]('✔\x20'+_0x2a5d24),0x0;}catch(_0x244f53){if(_0x244f53 instanceof SDKError)return console[_0x20bf25(0x119)](_0x20bf25(0x138)+_0x244f53[_0x20bf25(0xf2)]),_0x244f53[_0x20bf25(0x125)]&&console[_0x20bf25(0x119)](_0x20bf25(0x12b)+_0x244f53['cause']),0x1;throw _0x244f53;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x100);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x122);async[a32_0x13ff80(0x148)](_0x3a5c9d){const _0x23fe0c=a32_0x13ff80,{options:_0x4d3ab2,args:_0x56c616,tdx:_0x6ec883}=_0x3a5c9d,_0x35135b=_0x56c616[0x0];if(!_0x35135b)return console[_0x23fe0c(0x119)](_0x23fe0c(0x14a)),console[_0x23fe0c(0x119)](_0x23fe0c(0x143)),0x1;let _0x7c7eb4=![],_0x1c7b4b=_0x35135b;if(_0x35135b[_0x23fe0c(0x108)](_0x23fe0c(0x107)))_0x7c7eb4=!![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else{if(_0x35135b[_0x23fe0c(0x108)]('attempt:'))_0x7c7eb4=![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else return console[_0x23fe0c(0x119)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x53b80f=_0x4d3ab2[_0x23fe0c(0x10a)],_0x26dfd7=_0x4d3ab2['resumeFrom'],_0x4f2d6f=_0x4d3ab2[_0x23fe0c(0x147)],_0xf664e8=_0x4d3ab2['force'];_0x4d3ab2[_0x23fe0c(0x145)]&&(console[_0x23fe0c(0x119)](_0x23fe0c(0xee)+(_0x7c7eb4?'session':_0x23fe0c(0x112))+'\x20'+_0x1c7b4b),_0x53b80f&&console['error'](_0x23fe0c(0x144)+_0x53b80f),_0x26dfd7&&console[_0x23fe0c(0x119)](_0x23fe0c(0xec)+_0x26dfd7),_0x4f2d6f&&console[_0x23fe0c(0x119)](_0x23fe0c(0x12a)+_0x4f2d6f),_0xf664e8&&console[_0x23fe0c(0x119)]('Force:\x20yes'));let _0x529e18;if(_0x4f2d6f)try{if(_0x4f2d6f[_0x23fe0c(0x108)]('@')){const _0x481a5c=await import(_0x23fe0c(0x131)),_0x2032f0=_0x4f2d6f[_0x23fe0c(0x150)](0x1),_0x299c2b=await _0x481a5c[_0x23fe0c(0xea)](_0x2032f0,'utf-8');_0x529e18=JSON['parse'](_0x299c2b);}else _0x529e18=JSON[_0x23fe0c(0x15a)](_0x4f2d6f);}catch{return console[_0x23fe0c(0x119)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4d3ab2[_0x23fe0c(0x14b)]){const _0x3afedf=await confirm(_0x23fe0c(0x134)+(_0x7c7eb4?_0x23fe0c(0x115):_0x23fe0c(0x112))+'\x20'+_0x1c7b4b+'?');if(!_0x3afedf)return console[_0x23fe0c(0x119)](_0x23fe0c(0x11c)),0x0;}let _0x10fa48;_0x7c7eb4?_0x10fa48=await withSpinner('Retrying\x20session...',()=>_0x6ec883[_0x23fe0c(0x155)][_0x23fe0c(0x116)](_0x1c7b4b,{'fromTask':_0x53b80f,'retryParams':_0x529e18}),{'verbose':_0x4d3ab2[_0x23fe0c(0x145)]}):_0x10fa48=await withSpinner('Retrying\x20attempt...',()=>_0x6ec883['workflow'][_0x23fe0c(0x14c)](_0x1c7b4b,{'resumeFrom':_0x26dfd7,'retryParams':_0x529e18,'force':_0xf664e8}),{'verbose':_0x4d3ab2['verbose']});const _0x273fbb=_0x10fa48['data'];return console[_0x23fe0c(0x119)](_0x23fe0c(0x152)),console[_0x23fe0c(0x119)](_0x23fe0c(0x14e)+_0x273fbb[_0x23fe0c(0x101)]),console[_0x23fe0c(0x119)](_0x23fe0c(0xf1)+_0x273fbb[_0x23fe0c(0x169)]),0x0;}catch(_0x3c068a){if(_0x3c068a instanceof SDKError)return console[_0x23fe0c(0x119)](_0x23fe0c(0x138)+_0x3c068a[_0x23fe0c(0xf2)]),_0x3c068a['cause']&&console['error'](_0x23fe0c(0x12b)+_0x3c068a[_0x23fe0c(0x125)]),0x1;throw _0x3c068a;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x13ff80(0x13f);[a32_0x13ff80(0xf4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x13ff80(0x148)](_0x569239){const _0x12cd62=a32_0x13ff80,{options:_0x42c0e7,args:_0xc604cb,tdx:_0x3f3c4a}=_0x569239,_0x2cbfa5=_0xc604cb[0x0],_0x3cce60=_0xc604cb[0x1]||'.';if(!_0x2cbfa5)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x12cd62(0x157)),0x1;const _0x1ad6a7=_0x42c0e7[_0x12cd62(0x159)];_0x42c0e7[_0x12cd62(0x145)]&&(console[_0x12cd62(0x119)](_0x12cd62(0x168)+_0x2cbfa5),console['error'](_0x12cd62(0xf7)+_0x3cce60),_0x1ad6a7&&console['error']('Revision:\x20'+_0x1ad6a7));const _0x30aedd=await withSpinner(_0x12cd62(0xfd)+_0x2cbfa5+_0x12cd62(0xff),()=>_0x3f3c4a[_0x12cd62(0x155)]['download'](_0x2cbfa5,_0x3cce60,{'revision':_0x1ad6a7}),{'verbose':_0x42c0e7[_0x12cd62(0x145)]}),_0x5df2f0=_0x30aedd['data'];return console[_0x12cd62(0x119)]('✔\x20Downloaded\x20'+_0x5df2f0['projectName']),console[_0x12cd62(0x119)]('\x20\x20Revision:\x20'+_0x5df2f0[_0x12cd62(0x159)]),console[_0x12cd62(0x119)](_0x12cd62(0x118)+_0x5df2f0[_0x12cd62(0xfc)]),console[_0x12cd62(0x119)](_0x12cd62(0x166)+_0x3cce60+'/'+_0x5df2f0['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a32_0x13ff80(0x123);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x164);async['execute'](_0x15a28a){const _0x371bde=a32_0x13ff80,{options:_0x292120,args:_0x389934,tdx:_0x553069}=_0x15a28a;let _0xb02b5d='.',_0x301b63=_0x292120[_0x371bde(0x11f)];if(_0x389934[0x0]){const {promises:_0x34381f}=await import('fs');try{const _0x90c398=await _0x34381f[_0x371bde(0xfe)](_0x389934[0x0]);if(_0x90c398['isDirectory']())_0xb02b5d=_0x389934[0x0];else return console[_0x371bde(0x119)](_0x371bde(0x138)+_0x389934[0x0]+_0x371bde(0x13a)),0x1;}catch{_0x301b63=_0x389934[0x0],_0xb02b5d='.';}}const _0x598583=_0x292120['revision'],_0x4d0813=_0x292120[_0x371bde(0x132)];_0x292120[_0x371bde(0x145)]&&(console[_0x371bde(0x119)](_0x371bde(0x135)+_0xb02b5d),_0x301b63&&console[_0x371bde(0x119)](_0x371bde(0x142)+_0x301b63),_0x598583&&console[_0x371bde(0x119)](_0x371bde(0x146)+_0x598583),_0x4d0813&&console['error'](_0x371bde(0x102)));const _0x2ce089=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x553069['workflow']['push'](_0xb02b5d,{'projectName':_0x301b63,'revision':_0x598583,'skipValidation':_0x4d0813}),{'verbose':_0x292120[_0x371bde(0x145)]}),_0x24ec96=_0x2ce089['data'];return console[_0x371bde(0x119)]('✔\x20Pushed\x20'+_0x24ec96[_0x371bde(0x15e)]),console[_0x371bde(0x119)](_0x371bde(0x163)+_0x24ec96[_0x371bde(0x139)]),console[_0x371bde(0x119)]('\x20\x20Revision:\x20'+_0x24ec96['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x13ff80(0x11f)]='workflow:delete';[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x153);async[a32_0x13ff80(0x148)](_0xe45c45){const _0x4193ea=a32_0x13ff80,{options:_0x1518c2,args:_0x1c3784,tdx:_0x4620b9}=_0xe45c45,_0x2804e8=_0x1c3784[0x0];if(!_0x2804e8)return console['error'](_0x4193ea(0x12e)),console[_0x4193ea(0x119)](_0x4193ea(0x14d)),0x1;_0x1518c2[_0x4193ea(0x145)]&&console[_0x4193ea(0x119)]('Project:\x20'+_0x2804e8);if(!_0x1518c2['yes']){const _0x1eb0a5=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2804e8+_0x4193ea(0xf5));if(!_0x1eb0a5)return console[_0x4193ea(0x119)](_0x4193ea(0x11c)),0x0;}const _0x205c8f=await withSpinner(_0x4193ea(0xe8)+_0x2804e8+_0x4193ea(0xff),()=>_0x4620b9[_0x4193ea(0x155)][_0x4193ea(0x13e)](_0x2804e8),{'verbose':_0x1518c2['verbose']}),_0x2bac2a=_0x205c8f[_0x4193ea(0x130)];return console[_0x4193ea(0x119)](_0x4193ea(0x10c)+_0x2bac2a[_0x4193ea(0x15e)]),console[_0x4193ea(0x119)]('\x20\x20Project\x20ID:\x20'+_0x2bac2a[_0x4193ea(0x139)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x280620,_0x42820d){const _0x4992dd=a33_0x499c,_0x37b961=_0x280620();while(!![]){try{const _0x36c6b1=parseInt(_0x4992dd(0x16f))/0x1*(-parseInt(_0x4992dd(0x170))/0x2)+parseInt(_0x4992dd(0x177))/0x3*(-parseInt(_0x4992dd(0x169))/0x4)+-parseInt(_0x4992dd(0x175))/0x5*(parseInt(_0x4992dd(0x17f))/0x6)+-parseInt(_0x4992dd(0x17c))/0x7*(parseInt(_0x4992dd(0x17e))/0x8)+-parseInt(_0x4992dd(0x16d))/0x9+-parseInt(_0x4992dd(0x180))/0xa+-parseInt(_0x4992dd(0x16b))/0xb*(-parseInt(_0x4992dd(0x173))/0xc);if(_0x36c6b1===_0x42820d)break;else _0x37b961['push'](_0x37b961['shift']());}catch(_0x19c3f6){_0x37b961['push'](_0x37b961['shift']());}}}(a33_0x2efc,0x922f1));function a33_0x499c(_0x93dd61,_0x2359b1){const _0x2efc5d=a33_0x2efc();return a33_0x499c=function(_0x499c66,_0x4e2ca5){_0x499c66=_0x499c66-0x168;let _0x4d749e=_0x2efc5d[_0x499c66];return _0x4d749e;},a33_0x499c(_0x93dd61,_0x2359b1);}import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x5b52e3=a33_0x499c;try{const _0x4eba19=fileURLToPath(import.meta[_0x5b52e3(0x16c)]),_0x18bb53=dirname(_0x4eba19),_0x20bc1f=join(_0x18bb53,'../../package.json'),_0x2cd343=JSON[_0x5b52e3(0x17b)](readFileSync(_0x20bc1f,_0x5b52e3(0x172)));return _0x2cd343['version'];}catch{return'0.0.0';}}export function getUserAgent(){const _0x5d84f2=a33_0x499c,_0x18ace5=getVersion(),_0x51006e=platform(),_0x12c017=process[_0x5d84f2(0x179)][_0x5d84f2(0x17d)]('v','');return _0x5d84f2(0x171)+_0x18ace5+'\x20('+_0x51006e+_0x5d84f2(0x168)+_0x12c017+')';}export function getAuthHeaders(_0x5024c2,_0x245931){const _0x15e272=a33_0x499c,_0x14a841=getVersion(),_0x1ba3e3={'User-Agent':getUserAgent(),'X-TD-Client':_0x15e272(0x17a),'X-TD-Client-Version':_0x14a841};return _0x245931&&(_0x1ba3e3['Authorization']=_0x15e272(0x16a)+_0x245931),_0x1ba3e3;}function a33_0x2efc(){const _0x228a43=['82804IOgEpY','TD1\x20','628342lhWJlN','url','658089GJWosn','entries','39XGDdKz','52504gVtpbK','tdx/','utf-8','744jlenDz','length','20nNcxPe','X-Trino-User','57zeHySR','Authorization','version','tdx','parse','1777951WOMbFE','replace','24RBcrBc','204054uzyAED','5545120pacbwh',';\x20node/'];a33_0x2efc=function(){return _0x228a43;};return a33_0x2efc();}export function toHeaderRecord(_0x8db591){const _0x39e9c7=a33_0x499c,_0x90e32b={};for(const [_0x4b01a5,_0x25f822]of Object[_0x39e9c7(0x16e)](_0x8db591)){_0x25f822!==undefined&&(_0x90e32b[_0x4b01a5]=_0x25f822);}return _0x90e32b;}export function getTrinoHeaders(_0x14c2cd,_0x408741){const _0x7167aa=a33_0x499c,_0xfa2435=getAuthHeaders(_0x14c2cd,_0x408741),_0x516083=toHeaderRecord(_0xfa2435);return delete _0x516083[_0x7167aa(0x178)],_0x408741&&(_0x516083[_0x7167aa(0x176)]=_0x408741),_0x516083;}export function hasAPIKey(_0x68d8f3){const _0x49646f=a33_0x499c,_0x259909=getAPIKey(_0x68d8f3);return _0x259909!==undefined&&_0x259909[_0x49646f(0x174)]>0x0;}
1
+ (function(_0x51491f,_0xb6c1a1){const _0x50506a=a33_0x2703,_0x1ab7d0=_0x51491f();while(!![]){try{const _0x202a97=parseInt(_0x50506a(0x74))/0x1+-parseInt(_0x50506a(0x80))/0x2+-parseInt(_0x50506a(0x75))/0x3+parseInt(_0x50506a(0x85))/0x4*(-parseInt(_0x50506a(0x79))/0x5)+parseInt(_0x50506a(0x7b))/0x6+parseInt(_0x50506a(0x7e))/0x7*(parseInt(_0x50506a(0x76))/0x8)+-parseInt(_0x50506a(0x82))/0x9;if(_0x202a97===_0xb6c1a1)break;else _0x1ab7d0['push'](_0x1ab7d0['shift']());}catch(_0x26801d){_0x1ab7d0['push'](_0x1ab7d0['shift']());}}}(a33_0x9b54,0xae672));import{platform}from'os';function a33_0x2703(_0x115401,_0x26ca7d){const _0x9b54aa=a33_0x9b54();return a33_0x2703=function(_0x270388,_0x164471){_0x270388=_0x270388-0x72;let _0x3d5c66=_0x9b54aa[_0x270388];return _0x3d5c66;},a33_0x2703(_0x115401,_0x26ca7d);}import{readFileSync}from'fs';function a33_0x9b54(){const _0x1f5366=['5157576LHGDDH','replace','parse','381724ZQIrAC','TD1\x20','tdx','tdx/','1202956FdSitZ','196674qbYtXs','10875688IYxAEd','version','X-Trino-User','55VOJyhU','../../package.json','789888YeXWWn',';\x20node/','0.0.0','7iPrqpO','entries','582696GiLWyN','Authorization'];a33_0x9b54=function(){return _0x1f5366;};return a33_0x9b54();}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x34a74f=a33_0x2703;try{const _0x23754d=fileURLToPath(import.meta['url']),_0x50f3b7=dirname(_0x23754d),_0x43ac12=join(_0x50f3b7,_0x34a74f(0x7a)),_0x12c26b=JSON[_0x34a74f(0x84)](readFileSync(_0x43ac12,'utf-8'));return _0x12c26b[_0x34a74f(0x77)];}catch{return _0x34a74f(0x7d);}}export function getUserAgent(){const _0x131b69=a33_0x2703,_0x199064=getVersion(),_0x179aa8=platform(),_0x45da9e=process[_0x131b69(0x77)][_0x131b69(0x83)]('v','');return _0x131b69(0x73)+_0x199064+'\x20('+_0x179aa8+_0x131b69(0x7c)+_0x45da9e+')';}export function getAuthHeaders(_0x1fd158,_0x2dd082){const _0x262b1a=a33_0x2703,_0x5eed6e=getVersion(),_0x26d7e2={'User-Agent':getUserAgent(),'X-TD-Client':_0x262b1a(0x72),'X-TD-Client-Version':_0x5eed6e};return _0x2dd082&&(_0x26d7e2[_0x262b1a(0x81)]=_0x262b1a(0x86)+_0x2dd082),_0x26d7e2;}export function toHeaderRecord(_0x1c71e6){const _0x59b7c8=a33_0x2703,_0x160c3c={};for(const [_0x90bbb8,_0x557883]of Object[_0x59b7c8(0x7f)](_0x1c71e6)){_0x557883!==undefined&&(_0x160c3c[_0x90bbb8]=_0x557883);}return _0x160c3c;}export function getTrinoHeaders(_0xe12c77,_0x50ea2){const _0x55e0e2=a33_0x2703,_0x4bd014=getAuthHeaders(_0xe12c77,_0x50ea2),_0x2b66f3=toHeaderRecord(_0x4bd014);return delete _0x2b66f3['Authorization'],_0x50ea2&&(_0x2b66f3[_0x55e0e2(0x78)]=_0x50ea2),_0x2b66f3;}export function hasAPIKey(_0x3bcda8){const _0x2dffc4=getAPIKey(_0x3bcda8);return _0x2dffc4!==undefined&&_0x2dffc4['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x23e5b1,_0x40c3e7){const _0x16f6a0=a34_0x1bcc,_0x536251=_0x23e5b1();while(!![]){try{const _0x35fa00=parseInt(_0x16f6a0(0x126))/0x1+-parseInt(_0x16f6a0(0x103))/0x2+-parseInt(_0x16f6a0(0x12f))/0x3+-parseInt(_0x16f6a0(0x122))/0x4*(parseInt(_0x16f6a0(0x129))/0x5)+-parseInt(_0x16f6a0(0x127))/0x6+-parseInt(_0x16f6a0(0x10e))/0x7*(parseInt(_0x16f6a0(0x106))/0x8)+parseInt(_0x16f6a0(0x10b))/0x9*(parseInt(_0x16f6a0(0x124))/0xa);if(_0x35fa00===_0x40c3e7)break;else _0x536251['push'](_0x536251['shift']());}catch(_0x46f54b){_0x536251['push'](_0x536251['shift']());}}}(a34_0x2a73,0xa9c89));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x5282d9 from'node:fs';import*as a34_0x5090dd from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x27c40b=a34_0x1bcc;return process[_0x27c40b(0x12e)][_0x27c40b(0x125)]||join(homedir(),_0x27c40b(0x115),_0x27c40b(0x10a));}export function getConfigFile(){const _0x407f18=a34_0x1bcc;return join(getConfigDir(),_0x407f18(0x108));}export function getCacheDir(){const _0x4cfb42=a34_0x1bcc;return process[_0x4cfb42(0x12e)]['TDX_CACHE_DIR']||join(homedir(),_0x4cfb42(0x12b),_0x4cfb42(0x10a));}export function getLLMProjectCacheFile(){const _0x2c8b48=a34_0x1bcc;return join(getCacheDir(),_0x2c8b48(0x132));}export function readCachedLLMProject(){const _0x88f579=a34_0x1bcc;try{const _0x55e839=getLLMProjectCacheFile();if(!existsSync(_0x55e839))return null;return readFileSync(_0x55e839,_0x88f579(0x121))['trim']();}catch{return null;}}export function writeCachedLLMProject(_0x39841d){const _0x2ee53e=a34_0x1bcc;try{const _0x278214=getCacheDir(),_0x18702e=getLLMProjectCacheFile();!existsSync(_0x278214)&&mkdirSync(_0x278214,{'recursive':!![]}),writeFileSync(_0x18702e,_0x39841d,'utf-8');}catch(_0x3b6691){console[_0x2ee53e(0x113)]('Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:',_0x3b6691);}}export function parseEnvFile(_0x1dc166){const _0x2e8bde=a34_0x1bcc,_0x18f6a4={};for(const _0x50052e of _0x1dc166[_0x2e8bde(0x11a)]('\x0a')){const _0x8a9c26=_0x50052e['trim']();if(!_0x8a9c26||_0x8a9c26[_0x2e8bde(0x131)]('#'))continue;const _0x1e1555=_0x8a9c26['match'](/^([^=]+)=(.*)$/);if(_0x1e1555){const _0x13fdb7=_0x1e1555[0x1][_0x2e8bde(0x12d)]();let _0x3e1282=_0x1e1555[0x2][_0x2e8bde(0x12d)]();(_0x3e1282[_0x2e8bde(0x131)]('\x22')&&_0x3e1282[_0x2e8bde(0x120)]('\x22')||_0x3e1282[_0x2e8bde(0x131)]('\x27')&&_0x3e1282[_0x2e8bde(0x120)]('\x27'))&&(_0x3e1282=_0x3e1282[_0x2e8bde(0x102)](0x1,-0x1)),_0x18f6a4[_0x13fdb7]=_0x3e1282;}}return _0x18f6a4;}export function readUserConfig(){const _0x383f5f=a34_0x1bcc,_0x41376b=getConfigFile();if(!existsSync(_0x41376b))return{};try{const _0x1d8e14=readFileSync(_0x41376b,'utf-8');return parseEnvFile(_0x1d8e14);}catch(_0xc69d74){return console[_0x383f5f(0x107)](_0x383f5f(0x12c)+_0x41376b+':',_0xc69d74),{};}}function a34_0x2a73(){const _0x3f8ce6=['ap02','dev-us01','parse','profile:\x20','existsSync','env:\x20','map','slice','2432366DgzbHI','TD_API_KEY_','\x20(TD_API_KEY)','8GzuNHs','warn','.env','stg-ap03','tdx','19615563Zxtxjo','stg-us01','us01','622755MbTYWZ','readFileSync','entries','Warning:\x20Unknown\x20site\x20\x27','apiKeys','error','ap03','.config','\x27,\x20defaulting\x20to\x20us01','eu01','join','stg-jp01','split','Warning:\x20Failed\x20to\x20load\x20','replace','jp01','includes','dev-eu01','endsWith','utf-8','618200mJhuZJ','global:\x20','10joMnmQ','TDX_CONFIG_DIR','1323140oRqXxH','2917212ArDPDf','toUpperCase','5GoTMeH','TD_API_KEY','.cache','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','trim','env','2583942mYQFXK','profiles','startsWith','llm_default_project'];a34_0x2a73=function(){return _0x3f8ce6;};return a34_0x2a73();}export function resolveSite(_0x1f5482){const _0x5cf6e0=a34_0x1bcc,_0x538e23=[_0x5cf6e0(0x10d),_0x5cf6e0(0x11d),_0x5cf6e0(0x117),_0x5cf6e0(0xfb),_0x5cf6e0(0x114),_0x5cf6e0(0xfc),_0x5cf6e0(0x11f),'stg-us01',_0x5cf6e0(0x119),'stg-ap03'];if(_0x538e23[_0x5cf6e0(0x11e)](_0x1f5482))return _0x1f5482;if(_0x1f5482 in SITE_ALIASES)return SITE_ALIASES[_0x1f5482];return console[_0x5cf6e0(0x107)](_0x5cf6e0(0x111)+_0x1f5482+_0x5cf6e0(0x116)),_0x5cf6e0(0x10d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4b83a6,_0x98050c){const _0x3f32b8=a34_0x1bcc,_0x56fd17=_0x4b83a6[_0x3f32b8(0x128)]()[_0x3f32b8(0x11c)](/-/g,'_'),_0x46de1a=_0x3f32b8(0x104)+_0x56fd17;if(process[_0x3f32b8(0x12e)][_0x46de1a])return process[_0x3f32b8(0x12e)][_0x46de1a];if(process['env'][_0x3f32b8(0x12a)])return process['env'][_0x3f32b8(0x12a)];const _0x52c0a0=_0x98050c||getActiveProfileName();if(_0x52c0a0){const _0x4fda57=loadProfileEnv(_0x52c0a0);if(_0x4fda57){if(_0x4fda57[_0x46de1a])return _0x4fda57[_0x46de1a];if(_0x4fda57['TD_API_KEY'])return _0x4fda57[_0x3f32b8(0x12a)];}}const _0x2c57b1=loadUserConfigOnce();if(_0x2c57b1[_0x46de1a])return _0x2c57b1[_0x46de1a];if(_0x2c57b1[_0x3f32b8(0x12a)])return _0x2c57b1[_0x3f32b8(0x12a)];return undefined;}function a34_0x1bcc(_0x5bf21d,_0x2af37f){const _0x2a7335=a34_0x2a73();return a34_0x1bcc=function(_0x1bcca1,_0x5427e3){_0x1bcca1=_0x1bcca1-0xfb;let _0x20df3b=_0x2a7335[_0x1bcca1];return _0x20df3b;},a34_0x1bcc(_0x5bf21d,_0x2af37f);}export function getAPIKeySource(_0x409d2c,_0x34b8c9){const _0x44f9bf=a34_0x1bcc,_0x149ea6=_0x44f9bf(0x104)+_0x409d2c[_0x44f9bf(0x128)]()[_0x44f9bf(0x11c)](/-/g,'_');if(process[_0x44f9bf(0x12e)][_0x149ea6])return _0x44f9bf(0x100)+_0x149ea6;if(process[_0x44f9bf(0x12e)][_0x44f9bf(0x12a)])return'env:\x20TD_API_KEY';const _0x272193=_0x34b8c9||getActiveProfileName();if(_0x272193){const _0x5536b2=loadProfileEnv(_0x272193);if(_0x5536b2){if(_0x5536b2[_0x149ea6])return _0x44f9bf(0xfe)+_0x272193+'\x20('+_0x149ea6+')';if(_0x5536b2['TD_API_KEY'])return _0x44f9bf(0xfe)+_0x272193+_0x44f9bf(0x105);}}const _0xaa111a=loadUserConfigOnce(),_0x39c073=getConfigFile();if(_0xaa111a[_0x149ea6])return _0x44f9bf(0x123)+_0x39c073+'\x20('+_0x149ea6+')';if(_0xaa111a[_0x44f9bf(0x12a)])return'global:\x20'+_0x39c073+_0x44f9bf(0x105);return null;}function loadProfileEnv(_0x496bd6){const _0x48eaee=a34_0x1bcc,_0x2621b3=a34_0x5090dd['join'](getConfigDir(),'.env.'+_0x496bd6);if(a34_0x5282d9['existsSync'](_0x2621b3)){validateSecureFilePermissions(_0x2621b3);try{const _0x1141e3=a34_0x5282d9['readFileSync'](_0x2621b3,_0x48eaee(0x121));return parseEnvFile(_0x1141e3);}catch(_0x58b362){console[_0x48eaee(0x107)]('Warning:\x20Failed\x20to\x20load\x20'+_0x2621b3+':\x20'+_0x58b362);}}const _0x4f0e2b=a34_0x5090dd[_0x48eaee(0x118)](getConfigDir(),_0x48eaee(0x130),_0x496bd6,_0x48eaee(0x108));if(a34_0x5282d9[_0x48eaee(0xff)](_0x4f0e2b)){validateSecureFilePermissions(_0x4f0e2b);try{const _0x284c22=a34_0x5282d9[_0x48eaee(0x10f)](_0x4f0e2b,'utf-8');return parseEnvFile(_0x284c22);}catch(_0x52722c){return console['warn'](_0x48eaee(0x11b)+_0x4f0e2b+':\x20'+_0x52722c),null;}}return null;}function getActiveProfileName(){const _0x5a281a=a34_0x1bcc,_0x2fd4be=a34_0x5090dd['join'](getConfigDir(),'tdx.json');if(!a34_0x5282d9[_0x5a281a(0xff)](_0x2fd4be))return null;try{const _0x315078=a34_0x5282d9[_0x5a281a(0x10f)](_0x2fd4be,_0x5a281a(0x121)),_0x406315=JSON[_0x5a281a(0xfd)](_0x315078);return _0x406315['profile']||null;}catch{return null;}}export function saveAPIKey(_0x2ca070,_0x35cf41){const _0x26e813=a34_0x1bcc,_0x46f383=getConfigDir(),_0x12b496=getConfigFile();!existsSync(_0x46f383)&&mkdirSync(_0x46f383,{'recursive':!![],'mode':0x1c0});const _0x2b2d42=readUserConfig(),_0x3c0c50=_0x2ca070[_0x26e813(0x128)]()['replace'](/-/g,'_');_0x2b2d42[_0x26e813(0x104)+_0x3c0c50]=_0x35cf41;const _0x50ed43=Object[_0x26e813(0x110)](_0x2b2d42)[_0x26e813(0x101)](([_0x45c10e,_0x2bcc06])=>_0x45c10e+'='+_0x2bcc06);writeFileSync(_0x12b496,_0x50ed43[_0x26e813(0x118)]('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x8ec9fe=a34_0x1bcc,_0x18cd6f={'apiKeys':{},'defaultSite':_0x8ec9fe(0x10d)},_0x4852b1=[_0x8ec9fe(0x10d),_0x8ec9fe(0x11d),_0x8ec9fe(0x117),_0x8ec9fe(0xfb),_0x8ec9fe(0x114),'dev-us01','dev-eu01',_0x8ec9fe(0x10c),_0x8ec9fe(0x119),_0x8ec9fe(0x109)];for(const _0x476d15 of _0x4852b1){const _0x3dd6e8=getAPIKey(_0x476d15);_0x3dd6e8&&(_0x18cd6f[_0x8ec9fe(0x112)][_0x476d15]=_0x3dd6e8);}return _0x18cd6f;}
1
+ (function(_0x256c06,_0x26f134){const _0x15e2bf=a34_0x5b66,_0x19a156=_0x256c06();while(!![]){try{const _0x766012=-parseInt(_0x15e2bf(0x12f))/0x1+parseInt(_0x15e2bf(0x123))/0x2+-parseInt(_0x15e2bf(0x107))/0x3+-parseInt(_0x15e2bf(0x10d))/0x4*(-parseInt(_0x15e2bf(0x10a))/0x5)+-parseInt(_0x15e2bf(0x11d))/0x6+-parseInt(_0x15e2bf(0x11e))/0x7*(-parseInt(_0x15e2bf(0x132))/0x8)+parseInt(_0x15e2bf(0x115))/0x9;if(_0x766012===_0x26f134)break;else _0x19a156['push'](_0x19a156['shift']());}catch(_0x497d6a){_0x19a156['push'](_0x19a156['shift']());}}}(a34_0x348d,0xab8a3));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0xf7e83b from'node:fs';import*as a34_0x4e978a from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x38b679=a34_0x5b66;return process[_0x38b679(0x10b)][_0x38b679(0x119)]||join(homedir(),_0x38b679(0x12a),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x46d0f9=a34_0x5b66;return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x46d0f9(0x105));}export function getLLMProjectCacheFile(){const _0x3dd226=a34_0x5b66;return join(getCacheDir(),_0x3dd226(0x116));}export function readCachedLLMProject(){const _0x4da9ff=a34_0x5b66;try{const _0x4c7494=getLLMProjectCacheFile();if(!existsSync(_0x4c7494))return null;return readFileSync(_0x4c7494,_0x4da9ff(0x114))[_0x4da9ff(0x12b)]();}catch{return null;}}export function writeCachedLLMProject(_0xe0c000){const _0x373dbc=a34_0x5b66;try{const _0x11a915=getCacheDir(),_0x168eaa=getLLMProjectCacheFile();!existsSync(_0x11a915)&&mkdirSync(_0x11a915,{'recursive':!![]}),writeFileSync(_0x168eaa,_0xe0c000,_0x373dbc(0x114));}catch(_0x78577a){console[_0x373dbc(0x121)](_0x373dbc(0x10f),_0x78577a);}}export function parseEnvFile(_0x563a69){const _0x238d18=a34_0x5b66,_0xb9a35={};for(const _0x1b1eb0 of _0x563a69[_0x238d18(0x136)]('\x0a')){const _0x58a6aa=_0x1b1eb0[_0x238d18(0x12b)]();if(!_0x58a6aa||_0x58a6aa[_0x238d18(0x10e)]('#'))continue;const _0x4b46e6=_0x58a6aa[_0x238d18(0x11c)](/^([^=]+)=(.*)$/);if(_0x4b46e6){const _0x283953=_0x4b46e6[0x1][_0x238d18(0x12b)]();let _0x285347=_0x4b46e6[0x2][_0x238d18(0x12b)]();(_0x285347[_0x238d18(0x10e)]('\x22')&&_0x285347[_0x238d18(0x125)]('\x22')||_0x285347[_0x238d18(0x10e)]('\x27')&&_0x285347[_0x238d18(0x125)]('\x27'))&&(_0x285347=_0x285347[_0x238d18(0x120)](0x1,-0x1)),_0xb9a35[_0x283953]=_0x285347;}}return _0xb9a35;}export function readUserConfig(){const _0x300db6=a34_0x5b66,_0x222d28=getConfigFile();if(!existsSync(_0x222d28))return{};try{const _0x5c9798=readFileSync(_0x222d28,'utf-8');return parseEnvFile(_0x5c9798);}catch(_0x3243a0){return console[_0x300db6(0x118)](_0x300db6(0x124)+_0x222d28+':',_0x3243a0),{};}}export function resolveSite(_0x3493d3){const _0x3d76a4=a34_0x5b66,_0x38120a=[_0x3d76a4(0x101),_0x3d76a4(0x108),_0x3d76a4(0x117),_0x3d76a4(0x104),_0x3d76a4(0x100),_0x3d76a4(0x12e),_0x3d76a4(0x11a),_0x3d76a4(0x110),_0x3d76a4(0x10c),_0x3d76a4(0x134)];if(_0x38120a[_0x3d76a4(0x103)](_0x3493d3))return _0x3493d3;if(_0x3493d3 in SITE_ALIASES)return SITE_ALIASES[_0x3493d3];return console[_0x3d76a4(0x118)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3493d3+'\x27,\x20defaulting\x20to\x20us01'),_0x3d76a4(0x101);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3857fc,_0x47247e){const _0x1a421e=a34_0x5b66,_0x1aaefa=_0x3857fc[_0x1a421e(0x11f)]()[_0x1a421e(0x11b)](/-/g,'_'),_0x3019da=_0x1a421e(0x111)+_0x1aaefa;if(process[_0x1a421e(0x10b)][_0x3019da])return process['env'][_0x3019da];if(process['env'][_0x1a421e(0x128)])return process['env'][_0x1a421e(0x128)];const _0x1cbdd1=_0x47247e||getActiveProfileName();if(_0x1cbdd1){const _0x2bf240=loadProfileEnv(_0x1cbdd1);if(_0x2bf240){if(_0x2bf240[_0x3019da])return _0x2bf240[_0x3019da];if(_0x2bf240[_0x1a421e(0x128)])return _0x2bf240['TD_API_KEY'];}}const _0x19a71d=loadUserConfigOnce();if(_0x19a71d[_0x3019da])return _0x19a71d[_0x3019da];if(_0x19a71d[_0x1a421e(0x128)])return _0x19a71d[_0x1a421e(0x128)];return undefined;}export function getAPIKeySource(_0xc02085,_0x2a4c0b){const _0x57f580=a34_0x5b66,_0x48750e=_0x57f580(0x111)+_0xc02085[_0x57f580(0x11f)]()[_0x57f580(0x11b)](/-/g,'_');if(process['env'][_0x48750e])return _0x57f580(0x109)+_0x48750e;if(process[_0x57f580(0x10b)]['TD_API_KEY'])return _0x57f580(0x12d);const _0x2befb9=_0x2a4c0b||getActiveProfileName();if(_0x2befb9){const _0x30b12c=loadProfileEnv(_0x2befb9);if(_0x30b12c){if(_0x30b12c[_0x48750e])return _0x57f580(0x102)+_0x2befb9+'\x20('+_0x48750e+')';if(_0x30b12c[_0x57f580(0x128)])return _0x57f580(0x102)+_0x2befb9+_0x57f580(0x112);}}const _0x9b2f2d=loadUserConfigOnce(),_0x284982=getConfigFile();if(_0x9b2f2d[_0x48750e])return _0x57f580(0x122)+_0x284982+'\x20('+_0x48750e+')';if(_0x9b2f2d[_0x57f580(0x128)])return _0x57f580(0x122)+_0x284982+'\x20(TD_API_KEY)';return null;}function loadProfileEnv(_0x596582){const _0x3cfee5=a34_0x5b66,_0x437bbb=a34_0x4e978a['join'](getConfigDir(),_0x3cfee5(0x129)+_0x596582);if(a34_0xf7e83b['existsSync'](_0x437bbb)){validateSecureFilePermissions(_0x437bbb);try{const _0x3a9e9c=a34_0xf7e83b[_0x3cfee5(0x131)](_0x437bbb,_0x3cfee5(0x114));return parseEnvFile(_0x3a9e9c);}catch(_0x410032){console[_0x3cfee5(0x118)](_0x3cfee5(0x12c)+_0x437bbb+':\x20'+_0x410032);}}const _0x388db0=a34_0x4e978a[_0x3cfee5(0x135)](getConfigDir(),_0x3cfee5(0x113),_0x596582,'.env');if(a34_0xf7e83b[_0x3cfee5(0x130)](_0x388db0)){validateSecureFilePermissions(_0x388db0);try{const _0x3238c8=a34_0xf7e83b[_0x3cfee5(0x131)](_0x388db0,'utf-8');return parseEnvFile(_0x3238c8);}catch(_0x2da45a){return console[_0x3cfee5(0x118)](_0x3cfee5(0x12c)+_0x388db0+':\x20'+_0x2da45a),null;}}return null;}function getActiveProfileName(){const _0x2e712d=a34_0x5b66,_0x59e967=a34_0x4e978a['join'](getConfigDir(),'tdx.json');if(!a34_0xf7e83b[_0x2e712d(0x130)](_0x59e967))return null;try{const _0x106592=a34_0xf7e83b[_0x2e712d(0x131)](_0x59e967,'utf-8'),_0x5b80a3=JSON[_0x2e712d(0x106)](_0x106592);return _0x5b80a3[_0x2e712d(0x127)]||null;}catch{return null;}}export function saveAPIKey(_0x1e7bd7,_0x575ce4){const _0x11697e=a34_0x5b66,_0x51c664=getConfigDir(),_0x3242a7=getConfigFile();!existsSync(_0x51c664)&&mkdirSync(_0x51c664,{'recursive':!![],'mode':0x1c0});const _0x1b118c=readUserConfig(),_0x30f4ea=_0x1e7bd7[_0x11697e(0x11f)]()[_0x11697e(0x11b)](/-/g,'_');_0x1b118c[_0x11697e(0x111)+_0x30f4ea]=_0x575ce4;const _0x3518e3=Object['entries'](_0x1b118c)[_0x11697e(0x126)](([_0x433ad8,_0x11b2bd])=>_0x433ad8+'='+_0x11b2bd);writeFileSync(_0x3242a7,_0x3518e3['join']('\x0a')+'\x0a',{'mode':0x180});}function a34_0x5b66(_0x303428,_0x22c55f){const _0x348d20=a34_0x348d();return a34_0x5b66=function(_0x5b6623,_0x16ecf5){_0x5b6623=_0x5b6623-0x100;let _0x188893=_0x348d20[_0x5b6623];return _0x188893;},a34_0x5b66(_0x303428,_0x22c55f);}export function loadConfig(){const _0x3bf834=a34_0x5b66,_0x43462e={'apiKeys':{},'defaultSite':_0x3bf834(0x101)},_0x338dc6=[_0x3bf834(0x101),_0x3bf834(0x108),_0x3bf834(0x117),_0x3bf834(0x104),'ap03','dev-us01',_0x3bf834(0x11a),_0x3bf834(0x110),_0x3bf834(0x10c),_0x3bf834(0x134)];for(const _0x47064c of _0x338dc6){const _0x2ff546=getAPIKey(_0x47064c);_0x2ff546&&(_0x43462e[_0x3bf834(0x133)][_0x47064c]=_0x2ff546);}return _0x43462e;}function a34_0x348d(){const _0x28bd5d=['existsSync','readFileSync','38992nlpOfB','apiKeys','stg-ap03','join','split','ap03','us01','profile:\x20','includes','ap02','tdx','parse','4157544FCdcie','jp01','env:\x20','85sQTjvd','env','stg-jp01','45804WRIzRr','startsWith','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','stg-us01','TD_API_KEY_','\x20(TD_API_KEY)','profiles','utf-8','15238737pEqPEf','llm_default_project','eu01','warn','TDX_CONFIG_DIR','dev-eu01','replace','match','5990292BJreIV','1603ncJtUI','toUpperCase','slice','error','global:\x20','2777608CyleiC','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','endsWith','map','profile','TD_API_KEY','.env.','.config','trim','Warning:\x20Failed\x20to\x20load\x20','env:\x20TD_API_KEY','dev-us01','1305953MaaywJ'];a34_0x348d=function(){return _0x28bd5d;};return a34_0x348d();}
@@ -1 +1 @@
1
- const a35_0x29a16e=a35_0x191b;function a35_0x5368(){const _0x13ad62=['string','getParameters',':\x20none\x20(using\x20session:\x20','111PGwqEK','existsSync','profiles','6nBAUYy','32ndvpvn','join','globalCredentials','log','4938FdoRUE','activeProfile','4540851aPHwSl','database','.env','us01','displayWithSources','12rWhUtw','11cchvII','sessionId','display','configFiles','cliFlags','segmentPath','[context]','global','layers','profile',':\x20none','parentSegment','2251767ZOrLLK','Global','20HUkUiA','parent_segment','CLI\x20flag:\x20--','565112fJexIE','verbose','Profile','entries','llmProject','sessions','site','Session','ppid','.json','project','default','config','loadGlobalConfig','Project','segment_path','parse','not\x20set','replace','tdx.json','profile:\x20','(session:\x20','session','1355355CuIIwv','llm_project','injectIntoOptions','10611530lnEPdx','apiKey','7681167ODUQRn','getSource','Profile\x20Credentials','utf-8'];a35_0x5368=function(){return _0x13ad62;};return a35_0x5368();}(function(_0x4f2271,_0x4b8ab8){const _0x4b4ae5=a35_0x191b,_0x1adf20=_0x4f2271();while(!![]){try{const _0x4a7b5a=-parseInt(_0x4b4ae5(0x124))/0x1*(-parseInt(_0x4b4ae5(0x12c))/0x2)+-parseInt(_0x4b4ae5(0xfc))/0x3+parseInt(_0x4b4ae5(0x101))/0x4*(-parseInt(_0x4b4ae5(0xfe))/0x5)+-parseInt(_0x4b4ae5(0x127))/0x6*(-parseInt(_0x4b4ae5(0x12e))/0x7)+parseInt(_0x4b4ae5(0x128))/0x8*(parseInt(_0x4b4ae5(0x118))/0x9)+-parseInt(_0x4b4ae5(0x11b))/0xa*(-parseInt(_0x4b4ae5(0xf0))/0xb)+parseInt(_0x4b4ae5(0xef))/0xc*(-parseInt(_0x4b4ae5(0x11d))/0xd);if(_0x4a7b5a===_0x4b8ab8)break;else _0x1adf20['push'](_0x1adf20['shift']());}catch(_0x4b494f){_0x1adf20['push'](_0x1adf20['shift']());}}}(a35_0x5368,0xa5f2d));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_0x28afff from'node:fs';function a35_0x191b(_0x40bc0f,_0xb23ba8){const _0x53686b=a35_0x5368();return a35_0x191b=function(_0x191b6,_0x3d5b5f){_0x191b6=_0x191b6-0xee;let _0x2c4190=_0x53686b[_0x191b6];return _0x2c4190;},a35_0x191b(_0x40bc0f,_0xb23ba8);}import*as a35_0x47ce12 from'node:path';export class GlobalContext{[a35_0x29a16e(0x107)];[a35_0x29a16e(0x12f)];[a35_0x29a16e(0xff)];[a35_0x29a16e(0x110)];[a35_0x29a16e(0x119)];[a35_0x29a16e(0x11c)];[a35_0x29a16e(0x102)];[a35_0x29a16e(0xf8)];[a35_0x29a16e(0x12d)];[a35_0x29a16e(0xf1)];[a35_0x29a16e(0xf3)];constructor(_0x238b74){const _0x94fe50=a35_0x29a16e;this[_0x94fe50(0xf1)]=_0x238b74[_0x94fe50(0x117)]||process[_0x94fe50(0x109)]['toString']();const _0x31baf5=loadSessionContext(_0x238b74['session']),_0x6b7ca7=loadProjectConfig(),_0x456cdb=this[_0x94fe50(0x10e)]();this['activeProfile']=_0x238b74['profile']||_0x31baf5?.['profile']||_0x456cdb[_0x94fe50(0xf9)]||getActiveProfile();const _0x18cbb8=this[_0x94fe50(0x12d)]?loadProfile(this['activeProfile']):null,_0x3ce77b=_0x3b803b=>{const _0x40f686=_0x94fe50;if(!_0x3b803b)return{};const _0xb75c00=_0x3b803b,_0x49f1c0={};for(const [_0x4ccaca,_0x51582b]of Object[_0x40f686(0x104)](_0xb75c00)){typeof _0x51582b===_0x40f686(0x121)&&(_0x49f1c0[_0x4ccaca]=_0x51582b);}return _0x49f1c0;},_0x374437={};if(_0x238b74[_0x94fe50(0x107)]&&_0x238b74[_0x94fe50(0x107)]!==_0x94fe50(0x131))_0x374437['site']=_0x238b74[_0x94fe50(0x107)];const _0x41bd2c=_0x31baf5?.['database'],_0x337553=_0x6b7ca7?.[_0x94fe50(0x12f)],_0x37493b=_0x18cbb8?.[_0x94fe50(0x10d)]?.[_0x94fe50(0x12f)],_0x1be197=_0x456cdb[_0x94fe50(0x12f)];_0x238b74['database']&&(_0x238b74[_0x94fe50(0x12f)]!==_0x41bd2c&&_0x238b74['database']!==_0x337553&&_0x238b74[_0x94fe50(0x12f)]!==_0x37493b&&_0x238b74[_0x94fe50(0x12f)]!==_0x1be197)&&(_0x374437[_0x94fe50(0x12f)]=_0x238b74[_0x94fe50(0x12f)]);if(_0x238b74['parentSegment'])_0x374437[_0x94fe50(0xff)]=_0x238b74['parentSegment'];if(_0x238b74[_0x94fe50(0x105)])_0x374437[_0x94fe50(0x119)]=_0x238b74[_0x94fe50(0x105)];if(_0x238b74[_0x94fe50(0xf9)])_0x374437[_0x94fe50(0xf9)]=_0x238b74[_0x94fe50(0xf9)];this[_0x94fe50(0xf8)]={'cliFlags':_0x374437,'session':_0x3ce77b(_0x31baf5),'project':_0x3ce77b(_0x6b7ca7),'profile':_0x3ce77b(_0x18cbb8?.[_0x94fe50(0x10d)]),'global':_0x3ce77b(_0x456cdb)};const _0x123f11={...this[_0x94fe50(0xf8)][_0x94fe50(0xf7)],...this[_0x94fe50(0xf8)][_0x94fe50(0xf9)],...this[_0x94fe50(0xf8)]['project'],...this[_0x94fe50(0xf8)][_0x94fe50(0x117)],...this['layers'][_0x94fe50(0xf4)]},_0xca071d=_0x123f11[_0x94fe50(0x107)]||_0x94fe50(0x131);this[_0x94fe50(0x107)]=resolveSite(_0xca071d),this[_0x94fe50(0x12f)]=_0x123f11[_0x94fe50(0x12f)],this[_0x94fe50(0xff)]=_0x123f11['parent_segment'],this[_0x94fe50(0x110)]=_0x123f11[_0x94fe50(0x110)],this[_0x94fe50(0x119)]=_0x123f11[_0x94fe50(0x119)],this['verbose']=_0x238b74[_0x94fe50(0x102)]||![],this['apiKey']=getAPIKey(this[_0x94fe50(0x107)],this['activeProfile']||undefined);const _0xde2d88=getConfigDir(),_0x3ab6ab=a35_0x47ce12['join'](_0xde2d88,_0x94fe50(0x106),this[_0x94fe50(0xf1)]+_0x94fe50(0x10a)),_0x2487ec=findProjectConfigPath(),_0x5acc3c=a35_0x47ce12[_0x94fe50(0x129)](_0xde2d88,_0x94fe50(0x114)),_0xaf0c0b=a35_0x47ce12[_0x94fe50(0x129)](_0xde2d88,_0x94fe50(0x130));let _0x3ee6b2=null,_0xc4d0e2=null;this['activeProfile']&&(_0x3ee6b2=a35_0x47ce12[_0x94fe50(0x129)](_0xde2d88,'profiles',this[_0x94fe50(0x12d)],_0x94fe50(0x114)),_0xc4d0e2=a35_0x47ce12['join'](_0xde2d88,_0x94fe50(0x126),this[_0x94fe50(0x12d)],_0x94fe50(0x130))),this[_0x94fe50(0xf3)]={'session':a35_0x28afff['existsSync'](_0x3ab6ab)?_0x3ab6ab:null,'project':_0x2487ec,'profile':_0x3ee6b2&&a35_0x28afff['existsSync'](_0x3ee6b2)?_0x3ee6b2:null,'profileCredentials':_0xc4d0e2&&a35_0x28afff['existsSync'](_0xc4d0e2)?_0xc4d0e2:null,'global':a35_0x28afff[_0x94fe50(0x125)](_0x5acc3c)?_0x5acc3c:null,'globalCredentials':a35_0x28afff[_0x94fe50(0x125)](_0xaf0c0b)?_0xaf0c0b:null};}[a35_0x29a16e(0x11e)](_0x8e0576,_0x42d0b2){const _0x2a86c6=a35_0x29a16e;if(!_0x42d0b2)return _0x2a86c6(0x112);const _0x31a716=_0x42d0b2;if(this[_0x2a86c6(0xf8)][_0x2a86c6(0xf4)][_0x8e0576]===_0x31a716){if(_0x8e0576===_0x2a86c6(0x107)&&_0x31a716===_0x2a86c6(0x131)&&!this[_0x2a86c6(0xf8)][_0x2a86c6(0x117)]['site']&&!this['layers'][_0x2a86c6(0x10b)]['site']&&!this['layers']['profile'][_0x2a86c6(0x107)]&&!this[_0x2a86c6(0xf8)][_0x2a86c6(0xf7)]['site'])return'default';return _0x2a86c6(0x100)+_0x8e0576[_0x2a86c6(0x113)](/_/g,'-');}if(this['layers']['session'][_0x8e0576]===_0x31a716)return _0x2a86c6(0x117);if(this[_0x2a86c6(0xf8)]['project'][_0x8e0576]===_0x31a716)return _0x2a86c6(0x10b);if(this['layers']['profile'][_0x8e0576]===_0x31a716)return _0x2a86c6(0x115)+this[_0x2a86c6(0x12d)];if(this[_0x2a86c6(0xf8)][_0x2a86c6(0xf7)][_0x8e0576]===_0x31a716)return _0x2a86c6(0xf7);return _0x2a86c6(0x10c);}[a35_0x29a16e(0x10e)](){const _0x44521c=a35_0x29a16e,_0x5a2026=a35_0x47ce12[_0x44521c(0x129)](getConfigDir(),_0x44521c(0x114));if(!a35_0x28afff['existsSync'](_0x5a2026))return{};try{const _0x357b0d=a35_0x28afff['readFileSync'](_0x5a2026,_0x44521c(0x120));return JSON[_0x44521c(0x111)](_0x357b0d);}catch{return{};}}[a35_0x29a16e(0x11a)](_0x26405f){const _0x185882=a35_0x29a16e;_0x26405f[_0x185882(0x107)]=this[_0x185882(0x107)],!_0x26405f[_0x185882(0x12f)]&&this['database']&&(_0x26405f['database']=this[_0x185882(0x12f)]),!_0x26405f[_0x185882(0xfb)]&&this[_0x185882(0xff)]&&(_0x26405f['parentSegment']=this[_0x185882(0xff)]),!_0x26405f[_0x185882(0xf5)]&&this[_0x185882(0x110)]&&(_0x26405f[_0x185882(0xf5)]=this[_0x185882(0x110)]),!_0x26405f[_0x185882(0x105)]&&this[_0x185882(0x119)]&&(_0x26405f[_0x185882(0x105)]=this[_0x185882(0x119)]);}[a35_0x29a16e(0x122)](){const _0x2de3f2=a35_0x29a16e;return[{'key':_0x2de3f2(0x107),'value':this[_0x2de3f2(0x107)]},{'key':_0x2de3f2(0x12f),'value':this['database']},{'key':'parent_segment','value':this['parent_segment']},{'key':'segment_path','value':this[_0x2de3f2(0x110)]},{'key':'llm_project','value':this[_0x2de3f2(0x119)]},{'key':_0x2de3f2(0xf9),'value':this[_0x2de3f2(0x12d)]||undefined}];}[a35_0x29a16e(0xf2)](){const _0x4bc0db=a35_0x29a16e;console[_0x4bc0db(0x12b)](_0x4bc0db(0xf6));for(const {key:_0x316ae3,value:_0x286d55}of this['getParameters']()){_0x286d55&&console[_0x4bc0db(0x12b)](_0x316ae3+':\x20'+_0x286d55);}}[a35_0x29a16e(0xee)](){const _0xe0f763=a35_0x29a16e;console['log'](_0xe0f763(0xf6));for(const {key:_0x2775fc,value:_0x310078}of this[_0xe0f763(0x122)]()){if(_0x310078){const _0xc4e20b=_0x2775fc===_0xe0f763(0xf9)?'(active)':'('+this[_0xe0f763(0x11e)](_0x2775fc,_0x310078)+')';console[_0xe0f763(0x12b)](_0x2775fc+':\x20'+_0x310078+'\x20'+_0xc4e20b);}}console[_0xe0f763(0x12b)]('\x0a[configuration\x20files]');const _0x37948c=[{'label':'Session','path':this[_0xe0f763(0xf3)][_0xe0f763(0x117)],'extra':_0xe0f763(0x116)+this['sessionId']+')'},{'label':_0xe0f763(0x10f),'path':this[_0xe0f763(0xf3)][_0xe0f763(0x10b)]},{'label':_0xe0f763(0x103),'path':this['configFiles'][_0xe0f763(0xf9)]},{'label':_0xe0f763(0x11f),'path':this[_0xe0f763(0xf3)]['profileCredentials']},{'label':_0xe0f763(0xfd),'path':this[_0xe0f763(0xf3)][_0xe0f763(0xf7)]},{'label':'Global\x20Credentials','path':this['configFiles'][_0xe0f763(0x12a)]}];for(const {label:_0x41b3d7,path:_0x135e07,extra:_0x351972}of _0x37948c){if(_0x135e07)console[_0xe0f763(0x12b)](_0x41b3d7+':\x20'+_0x135e07+'\x20✓'+(_0x351972?'\x20'+_0x351972:''));else{if(_0x41b3d7===_0xe0f763(0x108))console['log'](_0x41b3d7+_0xe0f763(0x123)+this['sessionId']+')');else(_0x41b3d7==='Project'||_0x41b3d7==='Global')&&console[_0xe0f763(0x12b)](_0x41b3d7+_0xe0f763(0xfa));}}}}
1
+ const a35_0x55e126=a35_0xddc7;(function(_0x5da368,_0x2c5fc0){const _0x32ea73=a35_0xddc7,_0x2212c1=_0x5da368();while(!![]){try{const _0x3d29aa=parseInt(_0x32ea73(0xc5))/0x1+-parseInt(_0x32ea73(0xd7))/0x2*(parseInt(_0x32ea73(0xbb))/0x3)+parseInt(_0x32ea73(0xc0))/0x4+parseInt(_0x32ea73(0xce))/0x5*(parseInt(_0x32ea73(0xbf))/0x6)+parseInt(_0x32ea73(0xbc))/0x7+parseInt(_0x32ea73(0xdf))/0x8+-parseInt(_0x32ea73(0xcf))/0x9;if(_0x3d29aa===_0x2c5fc0)break;else _0x2212c1['push'](_0x2212c1['shift']());}catch(_0x1cf9cf){_0x2212c1['push'](_0x2212c1['shift']());}}}(a35_0x57bb,0xe72bf));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';import{loadSessionContext}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a35_0x57bb(){const _0x549d28=['5fbIeZw','13283424kKstwB','profile:\x20','global','profile','displayWithSources','configFiles','apiKey','join','3397222GLVAgB','log','display','getParameters','Global','Project','.json','not\x20set','5729096NEObXA','default','[context]','session','layers',':\x20none','parent_segment','us01','utf-8','verbose','site','sessions','loadGlobalConfig',':\x20none\x20(using\x20session:\x20','tdx.json','replace','activeProfile','toString','existsSync','.env','Session','sessionId','segmentPath','project','3ToVlun','10704351IplkkA','readFileSync','database','369804nCSEvv','3186048rXpbWN','entries','\x0a[configuration\x20files]','llmProject','cliFlags','1017950oxOaOv','globalCredentials','Profile\x20Credentials','parentSegment','ppid','segment_path','(active)','profiles','llm_project'];a35_0x57bb=function(){return _0x549d28;};return a35_0x57bb();}import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x3da532 from'node:fs';function a35_0xddc7(_0x1148b6,_0x4f624b){const _0x57bbc0=a35_0x57bb();return a35_0xddc7=function(_0xddc73c,_0x6f2a7c){_0xddc73c=_0xddc73c-0xb1;let _0x3ad54e=_0x57bbc0[_0xddc73c];return _0x3ad54e;},a35_0xddc7(_0x1148b6,_0x4f624b);}import*as a35_0x4d5475 from'node:path';export class GlobalContext{[a35_0x55e126(0xe9)];[a35_0x55e126(0xbe)];['parent_segment'];[a35_0x55e126(0xca)];[a35_0x55e126(0xcd)];['apiKey'];[a35_0x55e126(0xe8)];[a35_0x55e126(0xe3)];[a35_0x55e126(0xb3)];[a35_0x55e126(0xb8)];[a35_0x55e126(0xd4)];constructor(_0x341e69){const _0x2ec2cf=a35_0x55e126;this['sessionId']=_0x341e69[_0x2ec2cf(0xe2)]||process[_0x2ec2cf(0xc9)][_0x2ec2cf(0xb4)]();const _0x4e251f=loadSessionContext(_0x341e69[_0x2ec2cf(0xe2)]),_0x14c615=loadProjectConfig(),_0x489b1d=this[_0x2ec2cf(0xeb)]();this[_0x2ec2cf(0xb3)]=_0x341e69['profile']||_0x4e251f?.[_0x2ec2cf(0xd2)]||_0x489b1d[_0x2ec2cf(0xd2)]||getActiveProfile();const _0x5e0d99=this['activeProfile']?loadProfile(this[_0x2ec2cf(0xb3)]):null,_0x5681f8=_0x25c521=>{const _0x23c88c=_0x2ec2cf;if(!_0x25c521)return{};const _0x5e395d=_0x25c521,_0x301f9f={};for(const [_0x18b351,_0x4c70e5]of Object[_0x23c88c(0xc1)](_0x5e395d)){typeof _0x4c70e5==='string'&&(_0x301f9f[_0x18b351]=_0x4c70e5);}return _0x301f9f;},_0x386044={};if(_0x341e69[_0x2ec2cf(0xe9)]&&_0x341e69['site']!==_0x2ec2cf(0xe6))_0x386044['site']=_0x341e69[_0x2ec2cf(0xe9)];const _0x17f5ed=_0x4e251f?.[_0x2ec2cf(0xbe)],_0x45acd3=_0x14c615?.[_0x2ec2cf(0xbe)],_0x4e8747=_0x5e0d99?.['config']?.[_0x2ec2cf(0xbe)],_0x19f0c0=_0x489b1d[_0x2ec2cf(0xbe)];_0x341e69[_0x2ec2cf(0xbe)]&&(_0x341e69[_0x2ec2cf(0xbe)]!==_0x17f5ed&&_0x341e69['database']!==_0x45acd3&&_0x341e69[_0x2ec2cf(0xbe)]!==_0x4e8747&&_0x341e69[_0x2ec2cf(0xbe)]!==_0x19f0c0)&&(_0x386044['database']=_0x341e69[_0x2ec2cf(0xbe)]);if(_0x341e69[_0x2ec2cf(0xc8)])_0x386044[_0x2ec2cf(0xe5)]=_0x341e69[_0x2ec2cf(0xc8)];if(_0x341e69[_0x2ec2cf(0xc3)])_0x386044['llm_project']=_0x341e69[_0x2ec2cf(0xc3)];if(_0x341e69[_0x2ec2cf(0xd2)])_0x386044[_0x2ec2cf(0xd2)]=_0x341e69[_0x2ec2cf(0xd2)];this[_0x2ec2cf(0xe3)]={'cliFlags':_0x386044,'session':_0x5681f8(_0x4e251f),'project':_0x5681f8(_0x14c615),'profile':_0x5681f8(_0x5e0d99?.['config']),'global':_0x5681f8(_0x489b1d)};const _0xb1fa06={...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xd1)],...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xd2)],...this[_0x2ec2cf(0xe3)]['project'],...this[_0x2ec2cf(0xe3)]['session'],...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xc4)]},_0x95af35=_0xb1fa06[_0x2ec2cf(0xe9)]||'us01';this['site']=resolveSite(_0x95af35),this['database']=_0xb1fa06[_0x2ec2cf(0xbe)],this[_0x2ec2cf(0xe5)]=_0xb1fa06[_0x2ec2cf(0xe5)],this[_0x2ec2cf(0xca)]=_0xb1fa06[_0x2ec2cf(0xca)],this[_0x2ec2cf(0xcd)]=_0xb1fa06[_0x2ec2cf(0xcd)],this[_0x2ec2cf(0xe8)]=_0x341e69[_0x2ec2cf(0xe8)]||![],this[_0x2ec2cf(0xd5)]=getAPIKey(this[_0x2ec2cf(0xe9)],this['activeProfile']||undefined);const _0x6ff728=getConfigDir(),_0x24851c=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xea),this['sessionId']+_0x2ec2cf(0xdd)),_0x5ca16c=findProjectConfigPath(),_0x3b7cf5=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xb1)),_0x205660=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xb6));let _0x464ad9=null,_0xdea19d=null;this[_0x2ec2cf(0xb3)]&&(_0x464ad9=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xcc),this[_0x2ec2cf(0xb3)],'tdx.json'),_0xdea19d=a35_0x4d5475['join'](_0x6ff728,_0x2ec2cf(0xcc),this[_0x2ec2cf(0xb3)],_0x2ec2cf(0xb6))),this[_0x2ec2cf(0xd4)]={'session':a35_0x3da532[_0x2ec2cf(0xb5)](_0x24851c)?_0x24851c:null,'project':_0x5ca16c,'profile':_0x464ad9&&a35_0x3da532[_0x2ec2cf(0xb5)](_0x464ad9)?_0x464ad9:null,'profileCredentials':_0xdea19d&&a35_0x3da532['existsSync'](_0xdea19d)?_0xdea19d:null,'global':a35_0x3da532[_0x2ec2cf(0xb5)](_0x3b7cf5)?_0x3b7cf5:null,'globalCredentials':a35_0x3da532[_0x2ec2cf(0xb5)](_0x205660)?_0x205660:null};}['getSource'](_0x2d40f1,_0x10d934){const _0x23f330=a35_0x55e126;if(!_0x10d934)return _0x23f330(0xde);const _0x3d8d74=_0x10d934;if(this['layers']['cliFlags'][_0x2d40f1]===_0x3d8d74){if(_0x2d40f1===_0x23f330(0xe9)&&_0x3d8d74===_0x23f330(0xe6)&&!this[_0x23f330(0xe3)][_0x23f330(0xe2)][_0x23f330(0xe9)]&&!this[_0x23f330(0xe3)][_0x23f330(0xba)]['site']&&!this[_0x23f330(0xe3)][_0x23f330(0xd2)][_0x23f330(0xe9)]&&!this[_0x23f330(0xe3)][_0x23f330(0xd1)][_0x23f330(0xe9)])return _0x23f330(0xe0);return'CLI\x20flag:\x20--'+_0x2d40f1[_0x23f330(0xb2)](/_/g,'-');}if(this['layers'][_0x23f330(0xe2)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xe2);if(this[_0x23f330(0xe3)][_0x23f330(0xba)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xba);if(this[_0x23f330(0xe3)][_0x23f330(0xd2)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xd0)+this[_0x23f330(0xb3)];if(this[_0x23f330(0xe3)][_0x23f330(0xd1)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xd1);return _0x23f330(0xe0);}[a35_0x55e126(0xeb)](){const _0xb93176=a35_0x55e126,_0x29e283=a35_0x4d5475[_0xb93176(0xd6)](getConfigDir(),'tdx.json');if(!a35_0x3da532[_0xb93176(0xb5)](_0x29e283))return{};try{const _0x58d8a8=a35_0x3da532[_0xb93176(0xbd)](_0x29e283,_0xb93176(0xe7));return JSON['parse'](_0x58d8a8);}catch{return{};}}['injectIntoOptions'](_0x19c829){const _0x1e4910=a35_0x55e126;_0x19c829[_0x1e4910(0xe9)]=this[_0x1e4910(0xe9)],!_0x19c829[_0x1e4910(0xbe)]&&this[_0x1e4910(0xbe)]&&(_0x19c829[_0x1e4910(0xbe)]=this[_0x1e4910(0xbe)]),!_0x19c829[_0x1e4910(0xc8)]&&this[_0x1e4910(0xe5)]&&(_0x19c829[_0x1e4910(0xc8)]=this[_0x1e4910(0xe5)]),!_0x19c829[_0x1e4910(0xb9)]&&this[_0x1e4910(0xca)]&&(_0x19c829[_0x1e4910(0xb9)]=this[_0x1e4910(0xca)]),!_0x19c829[_0x1e4910(0xc3)]&&this[_0x1e4910(0xcd)]&&(_0x19c829['llmProject']=this[_0x1e4910(0xcd)]);}[a35_0x55e126(0xda)](){const _0x230eb6=a35_0x55e126;return[{'key':_0x230eb6(0xe9),'value':this[_0x230eb6(0xe9)]},{'key':_0x230eb6(0xbe),'value':this[_0x230eb6(0xbe)]},{'key':_0x230eb6(0xe5),'value':this['parent_segment']},{'key':'segment_path','value':this['segment_path']},{'key':_0x230eb6(0xcd),'value':this[_0x230eb6(0xcd)]},{'key':_0x230eb6(0xd2),'value':this[_0x230eb6(0xb3)]||undefined}];}[a35_0x55e126(0xd9)](){const _0x5812d0=a35_0x55e126;console[_0x5812d0(0xd8)](_0x5812d0(0xe1));for(const {key:_0x25179f,value:_0x29c62f}of this[_0x5812d0(0xda)]()){_0x29c62f&&console[_0x5812d0(0xd8)](_0x25179f+':\x20'+_0x29c62f);}}[a35_0x55e126(0xd3)](){const _0x4f1e41=a35_0x55e126;console[_0x4f1e41(0xd8)](_0x4f1e41(0xe1));for(const {key:_0x5b82f3,value:_0x59814}of this[_0x4f1e41(0xda)]()){if(_0x59814){const _0x39f4bd=_0x5b82f3===_0x4f1e41(0xd2)?_0x4f1e41(0xcb):'('+this['getSource'](_0x5b82f3,_0x59814)+')';console[_0x4f1e41(0xd8)](_0x5b82f3+':\x20'+_0x59814+'\x20'+_0x39f4bd);}}console[_0x4f1e41(0xd8)](_0x4f1e41(0xc2));const _0x32c943=[{'label':_0x4f1e41(0xb7),'path':this[_0x4f1e41(0xd4)]['session'],'extra':'(session:\x20'+this[_0x4f1e41(0xb8)]+')'},{'label':_0x4f1e41(0xdc),'path':this[_0x4f1e41(0xd4)][_0x4f1e41(0xba)]},{'label':'Profile','path':this[_0x4f1e41(0xd4)]['profile']},{'label':_0x4f1e41(0xc7),'path':this[_0x4f1e41(0xd4)]['profileCredentials']},{'label':'Global','path':this[_0x4f1e41(0xd4)]['global']},{'label':'Global\x20Credentials','path':this['configFiles'][_0x4f1e41(0xc6)]}];for(const {label:_0x27f145,path:_0x1e41d2,extra:_0x597ce1}of _0x32c943){if(_0x1e41d2)console[_0x4f1e41(0xd8)](_0x27f145+':\x20'+_0x1e41d2+'\x20✓'+(_0x597ce1?'\x20'+_0x597ce1:''));else{if(_0x27f145==='Session')console['log'](_0x27f145+_0x4f1e41(0xec)+this[_0x4f1e41(0xb8)]+')');else(_0x27f145===_0x4f1e41(0xdc)||_0x27f145===_0x4f1e41(0xdb))&&console[_0x4f1e41(0xd8)](_0x27f145+_0x4f1e41(0xe4));}}}}
@@ -1 +1 @@
1
- (function(_0x285938,_0x365251){const _0x170986=a36_0x4313,_0x55452c=_0x285938();while(!![]){try{const _0x941da1=-parseInt(_0x170986(0xd7))/0x1+-parseInt(_0x170986(0xcb))/0x2+-parseInt(_0x170986(0x9d))/0x3+-parseInt(_0x170986(0xce))/0x4*(parseInt(_0x170986(0x98))/0x5)+parseInt(_0x170986(0xb8))/0x6+-parseInt(_0x170986(0xc4))/0x7+parseInt(_0x170986(0xb3))/0x8*(parseInt(_0x170986(0xca))/0x9);if(_0x941da1===_0x365251)break;else _0x55452c['push'](_0x55452c['shift']());}catch(_0x32dcb8){_0x55452c['push'](_0x55452c['shift']());}}}(a36_0x1951,0x770a2));import*as a36_0x3e6cb7 from'node:fs';import*as a36_0x2db0d7 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(_0x5ea232){const _0x1c4eee={};if(!_0x5ea232)return _0x1c4eee;for(const [_0x419cb2,_0x56dec5]of Object['entries'](_0x5ea232)){_0x419cb2!=='description'&&_0x56dec5!==undefined&&(_0x1c4eee[_0x419cb2]=_0x56dec5);}return _0x1c4eee;}export function getProfilesDir(){const _0x24eaad=a36_0x4313;return a36_0x2db0d7[_0x24eaad(0x9a)](getConfigDir(),_0x24eaad(0xa8));}function getProfileDir(_0x1b42bd){const _0x1f4b4e=a36_0x4313;return a36_0x2db0d7[_0x1f4b4e(0x9a)](getProfilesDir(),_0x1b42bd);}function getProfileConfigPath(_0x2f0b22){const _0x4cb190=a36_0x4313;return a36_0x2db0d7['join'](getProfileDir(_0x2f0b22),_0x4cb190(0xdb));}function getProfileEnvPath(_0x3f0888){const _0x51f735=a36_0x4313;return a36_0x2db0d7[_0x51f735(0x9a)](getProfileDir(_0x3f0888),_0x51f735(0xe2));}function getGlobalConfigPath(){return a36_0x2db0d7['join'](getConfigDir(),'tdx.json');}function validateProfileName(_0x3ee3c2){const _0x2ce566=a36_0x4313;if(!/^[a-zA-Z0-9_-]+$/[_0x2ce566(0xd1)](_0x3ee3c2))throw new Error('Invalid\x20profile\x20name:\x20'+_0x3ee3c2+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.');}function validateProfileConfig(_0x1cd1e8,_0x4d9760){const _0x40d26d=a36_0x4313;if(typeof _0x1cd1e8!==_0x40d26d(0xa7)||_0x1cd1e8===null)throw new Error('Profile\x20\x27'+_0x4d9760+_0x40d26d(0xc1));const _0x38c25d=['description',_0x40d26d(0xcd),_0x40d26d(0xd6),_0x40d26d(0xba),_0x40d26d(0xad),_0x40d26d(0xda)],_0x287b81=_0x1cd1e8;for(const _0x4ef549 of Object[_0x40d26d(0xb2)](_0x287b81)){!_0x38c25d[_0x40d26d(0xe3)](_0x4ef549)&&console[_0x40d26d(0xa1)]('Warning:\x20Profile\x20\x27'+_0x4d9760+_0x40d26d(0xa9)+_0x4ef549+_0x40d26d(0xb6));}if(_0x287b81[_0x40d26d(0xbc)]!==undefined&&typeof _0x287b81[_0x40d26d(0xbc)]!==_0x40d26d(0xde))throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xb0));if(_0x287b81[_0x40d26d(0xcd)]!==undefined&&typeof _0x287b81[_0x40d26d(0xcd)]!==_0x40d26d(0xde))throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xc6));if(_0x287b81[_0x40d26d(0xd6)]!==undefined&&typeof _0x287b81[_0x40d26d(0xd6)]!==_0x40d26d(0xde))throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xd0));if(_0x287b81[_0x40d26d(0xba)]!==undefined&&typeof _0x287b81[_0x40d26d(0xba)]!=='string')throw new Error(_0x40d26d(0xc9)+_0x4d9760+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x287b81[_0x40d26d(0xad)]!==undefined&&typeof _0x287b81[_0x40d26d(0xad)]!=='string')throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xcf));if(_0x287b81['llm_agent']!==undefined&&typeof _0x287b81[_0x40d26d(0xda)]!==_0x40d26d(0xde))throw new Error('Profile\x20\x27'+_0x4d9760+_0x40d26d(0x9c));return!![];}function loadProfilesFromTdxJson(_0xdc63c6,_0x1ad69e){const _0x3f68c6=a36_0x4313;if(!a36_0x3e6cb7[_0x3f68c6(0x9b)](_0xdc63c6))return[];try{const _0x748b87=a36_0x3e6cb7[_0x3f68c6(0xd8)](_0xdc63c6,_0x3f68c6(0xa6)),_0x90f745=JSON[_0x3f68c6(0xae)](_0x748b87);if(!_0x90f745[_0x3f68c6(0xa8)]||typeof _0x90f745['profiles']!==_0x3f68c6(0xa7))return[];const _0x24afee=[];for(const [_0x2a7bbe,_0x432d4d]of Object['entries'](_0x90f745[_0x3f68c6(0xa8)])){try{validateProfileConfig(_0x432d4d,_0x2a7bbe);const _0x2f24b4=getNewCredentialPath(_0x2a7bbe),_0x811535=getOldCredentialPath(_0x2a7bbe),_0x125269=a36_0x3e6cb7[_0x3f68c6(0x9b)](_0x2f24b4)||a36_0x3e6cb7[_0x3f68c6(0x9b)](_0x811535);_0x24afee[_0x3f68c6(0xd4)]({'name':_0x2a7bbe,'config':_0x432d4d,'metadata':{'name':_0x2a7bbe,'createdAt':new Date()[_0x3f68c6(0xa2)]()},'hasCredentials':_0x125269,'scope':_0x1ad69e});}catch(_0x486fb0){_0x486fb0 instanceof Error&&(console[_0x3f68c6(0xa1)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0xdc63c6+':'),console['warn']('\x20\x20'+_0x486fb0['message']+'\x0a'));}}return _0x24afee;}catch(_0x1f3e93){return _0x1f3e93 instanceof SyntaxError?(console[_0x3f68c6(0xa1)](_0x3f68c6(0xd3)+_0xdc63c6+_0x3f68c6(0xb7)),console[_0x3f68c6(0xa1)](_0x3f68c6(0xbb)+_0x1f3e93[_0x3f68c6(0xbd)]+'\x0a')):console[_0x3f68c6(0xa1)](_0x3f68c6(0xb9)+_0xdc63c6+':\x20'+_0x1f3e93+'\x0a'),[];}}function a36_0x4313(_0x4241b7,_0x156557){const _0x195140=a36_0x1951();return a36_0x4313=function(_0x43131d,_0x11fbe2){_0x43131d=_0x43131d-0x98;let _0x17c187=_0x195140[_0x43131d];return _0x17c187;},a36_0x4313(_0x4241b7,_0x156557);}export function getNewCredentialPath(_0x2ace4d){const _0x176ff0=a36_0x4313;return a36_0x2db0d7[_0x176ff0(0x9a)](getConfigDir(),_0x176ff0(0xc7)+_0x2ace4d);}function getOldCredentialPath(_0x32e9b7){const _0x16143d=a36_0x4313;return a36_0x2db0d7[_0x16143d(0x9a)](getProfilesDir(),_0x32e9b7,_0x16143d(0xe2));}function loadProfilesFromTdxJsonFiles(){const _0x50952f=a36_0x4313,_0x2f6a60=[],_0x2a3459=findProjectConfigPath();_0x2a3459&&_0x2f6a60[_0x50952f(0xd4)](...loadProfilesFromTdxJson(_0x2a3459,_0x50952f(0xe4)));const _0x59df24=a36_0x2db0d7['join'](getConfigDir(),_0x50952f(0xdb));return _0x2f6a60[_0x50952f(0xd4)](...loadProfilesFromTdxJson(_0x59df24,_0x50952f(0xb4))),_0x2f6a60;}function loadProfilesFromDirectories(){const _0x3ae9d6=a36_0x4313,_0x4adceb=getProfilesDir();if(!a36_0x3e6cb7[_0x3ae9d6(0x9b)](_0x4adceb))return[];try{return a36_0x3e6cb7[_0x3ae9d6(0xc8)](_0x4adceb,{'withFileTypes':!![]})[_0x3ae9d6(0xa5)](_0x44209d=>_0x44209d[_0x3ae9d6(0xc2)]())['map'](_0x30d09c=>_0x30d09c[_0x3ae9d6(0xdc)])[_0x3ae9d6(0xa5)](_0x157e46=>{const _0x2f583d=_0x3ae9d6,_0x26a4e3=getProfileConfigPath(_0x157e46),_0x27d98a=getProfileEnvPath(_0x157e46);return a36_0x3e6cb7['existsSync'](_0x26a4e3)||a36_0x3e6cb7[_0x2f583d(0x9b)](_0x27d98a);})[_0x3ae9d6(0xd9)](_0x4a5a1b=>{const _0x263dc5=_0x3ae9d6,_0xa53447=loadProfileFromDirectory(_0x4a5a1b);if(_0xa53447)return{..._0xa53447,'scope':_0x263dc5(0xbe)};return null;})[_0x3ae9d6(0xa5)](_0xc5efbd=>_0xc5efbd!==null);}catch{return[];}}function a36_0x1951(){const _0x529cb3=['readFileSync','map','llm_agent','tdx.json','name','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.','string','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x20already\x20exists','lastUsed','.env','includes','local','5GRcben','To\x20migrate:','join','existsSync','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','2075487uJQyMf','profile','apiKey','sort','warn','toISOString','Profile\x20','length','filter','utf-8','object','profiles','\x27:\x20unknown\x20config\x20key\x20\x27','stringify','has','some','llm_project','parse','api_key','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','writeFileSync','keys','24doeHYc','user','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x27\x20will\x20be\x20ignored',':\x20Invalid\x20JSON\x20syntax','123744tFnRbd','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','parent_segment','Error:\x20','description','message','directory','find','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x27:\x20config\x20must\x20be\x20an\x20object','isDirectory','\x20\x201.\x20Edit:\x20','6430746lQIVHP','\x20\x20mv\x20\x22','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','.env.','readdirSync','Profile\x20\x27','8996229wDRXdF','317450HVicDe','\x20does\x20not\x20exist','site','257156VewnbY','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','test','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x0aWarning:\x20Failed\x20to\x20parse\x20','push','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','database','698260befgFM'];a36_0x1951=function(){return _0x529cb3;};return a36_0x1951();}function loadProfileFromDirectory(_0xb2ed4){const _0x2faf42=a36_0x4313,_0x3e14b6=getProfileConfigPath(_0xb2ed4),_0x4bfd3d=getOldCredentialPath(_0xb2ed4);if(!a36_0x3e6cb7[_0x2faf42(0x9b)](_0x3e14b6)&&!a36_0x3e6cb7[_0x2faf42(0x9b)](_0x4bfd3d))return null;let _0x1cd11f={},_0x260b85={'name':_0xb2ed4,'createdAt':new Date()[_0x2faf42(0xa2)]()};if(a36_0x3e6cb7[_0x2faf42(0x9b)](_0x3e14b6))try{const _0x582157=a36_0x3e6cb7[_0x2faf42(0xd8)](_0x3e14b6,_0x2faf42(0xa6)),_0x14ab6a=JSON[_0x2faf42(0xae)](_0x582157),{metadata:_0x1c8e93,..._0x1ce5a2}=_0x14ab6a;_0x1cd11f=_0x1ce5a2,_0x1c8e93&&(_0x260b85=_0x1c8e93);}catch{}return{'name':_0xb2ed4,'config':_0x1cd11f,'metadata':_0x260b85,'hasCredentials':a36_0x3e6cb7['existsSync'](_0x4bfd3d),'scope':_0x2faf42(0xbe)};}export function listProfiles(){const _0x53e563=a36_0x4313,_0x442320=loadProfilesFromTdxJsonFiles(),_0x114f81=loadProfilesFromDirectories();if(_0x114f81[_0x53e563(0xa4)]>0x0){const _0x2a7798=_0x114f81['map'](_0x29be0a=>_0x29be0a['name'])['join'](',\x20'),_0x41a822=getConfigDir();console[_0x53e563(0xa1)](_0x53e563(0xb5)+_0x2a7798),console[_0x53e563(0xa1)](_0x53e563(0xdf)),console[_0x53e563(0xa1)](_0x53e563(0xc3)+a36_0x2db0d7[_0x53e563(0x9a)](_0x41a822,_0x53e563(0xdb))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x53e563(0xa1)](_0x53e563(0xc0));}const _0x139867=[..._0x442320,..._0x114f81],_0x2b0897=new Map();for(const _0x427ea4 of _0x139867){!_0x2b0897[_0x53e563(0xab)](_0x427ea4[_0x53e563(0xdc)])&&_0x2b0897['set'](_0x427ea4['name'],_0x427ea4);}return Array['from'](_0x2b0897['values']())[_0x53e563(0xa0)]((_0xe73813,_0x27d178)=>_0xe73813[_0x53e563(0xdc)]['localeCompare'](_0x27d178[_0x53e563(0xdc)]));}export function profileExists(_0x13fe6f){const _0x29a784=a36_0x4313,_0x35ac58=listProfiles();return _0x35ac58[_0x29a784(0xac)](_0x20e953=>_0x20e953[_0x29a784(0xdc)]===_0x13fe6f);}export function loadProfile(_0x5e2d87){const _0x2f0355=a36_0x4313;validateProfileName(_0x5e2d87);const _0x4f61da=listProfiles(),_0x45e6cb=_0x4f61da[_0x2f0355(0xbf)](_0x59f457=>_0x59f457[_0x2f0355(0xdc)]===_0x5e2d87);return _0x45e6cb||null;}export function saveProfile(_0x38433a,_0x5a32fc,_0x1cd75e=![]){const _0x4b061f=a36_0x4313;validateProfileName(_0x38433a);const _0x9c7711=getProfileDir(_0x38433a),_0x42504c=getProfileConfigPath(_0x38433a);createSecureDirectory(_0x9c7711);let _0x148bca;const _0x5e60fd=loadProfile(_0x38433a);_0x5e60fd?(_0x148bca=_0x5e60fd['metadata'],_0x1cd75e&&(_0x148bca[_0x4b061f(0xe1)]=new Date()[_0x4b061f(0xa2)]())):_0x148bca={'name':_0x38433a,'createdAt':new Date()[_0x4b061f(0xa2)]()};const _0x119c3f=JSON[_0x4b061f(0xaa)](_0x5a32fc);if(_0x119c3f[_0x4b061f(0xe3)]('TD_API_KEY')||_0x119c3f['includes'](_0x4b061f(0x9f))||_0x119c3f[_0x4b061f(0xe3)](_0x4b061f(0xaf)))throw new Error(_0x4b061f(0xdd));const _0x323d5b={..._0x5a32fc,'metadata':_0x148bca};a36_0x3e6cb7[_0x4b061f(0xb1)](_0x42504c,JSON[_0x4b061f(0xaa)](_0x323d5b,null,0x2));}export function deleteProfile(_0x393bcf){const _0x159f66=a36_0x4313;validateProfileName(_0x393bcf);const _0x5d5fdd=getProfileDir(_0x393bcf);if(!a36_0x3e6cb7['existsSync'](_0x5d5fdd))throw new Error(_0x159f66(0xa3)+_0x393bcf+_0x159f66(0xcc));a36_0x3e6cb7['rmSync'](_0x5d5fdd,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x142ce2=a36_0x4313,_0x48c486=getGlobalConfigPath();if(!a36_0x3e6cb7['existsSync'](_0x48c486))return null;try{const _0x344f6e=a36_0x3e6cb7['readFileSync'](_0x48c486,_0x142ce2(0xa6)),_0x5ad12e=JSON[_0x142ce2(0xae)](_0x344f6e);return _0x5ad12e[_0x142ce2(0x9e)]||null;}catch{return null;}}export function createProfile(_0x2cbc18,_0x2e2aec){const _0x41212b=a36_0x4313;validateProfileName(_0x2cbc18);if(profileExists(_0x2cbc18))throw new Error(_0x41212b(0xa3)+_0x2cbc18+_0x41212b(0xe0));saveProfile(_0x2cbc18,_0x2e2aec);}export function saveProfileCredentials(_0x5e30c2,_0x1650a2){const _0x4cae2d=a36_0x4313;validateProfileName(_0x5e30c2);if(!profileExists(_0x5e30c2))throw new Error(_0x4cae2d(0xa3)+_0x5e30c2+'\x20does\x20not\x20exist');const _0x44d257=getNewCredentialPath(_0x5e30c2);writeSecureFile(_0x44d257,_0x1650a2);}export function loadProfileCredentials(_0xf07f54){const _0x2e0fc1=a36_0x4313;validateProfileName(_0xf07f54);const _0xd0d153=getNewCredentialPath(_0xf07f54);if(a36_0x3e6cb7['existsSync'](_0xd0d153))try{return a36_0x3e6cb7['readFileSync'](_0xd0d153,_0x2e0fc1(0xa6));}catch{}const _0x1354dd=getOldCredentialPath(_0xf07f54);if(a36_0x3e6cb7[_0x2e0fc1(0x9b)](_0x1354dd)){console[_0x2e0fc1(0xa1)](_0x2e0fc1(0xd5)+_0xf07f54+'\x27'),console['warn'](_0x2e0fc1(0x99)),console[_0x2e0fc1(0xa1)](_0x2e0fc1(0xc5)+_0x1354dd+'\x22\x20\x22'+_0xd0d153+'\x22'),console[_0x2e0fc1(0xa1)](_0x2e0fc1(0xd2));try{return a36_0x3e6cb7[_0x2e0fc1(0xd8)](_0x1354dd,'utf-8');}catch{return null;}}return null;}
1
+ (function(_0x303ff,_0x467e81){const _0x185574=a36_0x9f3a,_0x4897b3=_0x303ff();while(!![]){try{const _0x19f8da=-parseInt(_0x185574(0x8b))/0x1*(-parseInt(_0x185574(0xb6))/0x2)+parseInt(_0x185574(0xcb))/0x3*(-parseInt(_0x185574(0x8d))/0x4)+parseInt(_0x185574(0x9d))/0x5*(-parseInt(_0x185574(0xc1))/0x6)+parseInt(_0x185574(0x97))/0x7+-parseInt(_0x185574(0xc8))/0x8+-parseInt(_0x185574(0x9b))/0x9*(-parseInt(_0x185574(0xa8))/0xa)+-parseInt(_0x185574(0xbc))/0xb*(-parseInt(_0x185574(0xca))/0xc);if(_0x19f8da===_0x467e81)break;else _0x4897b3['push'](_0x4897b3['shift']());}catch(_0x5845a6){_0x4897b3['push'](_0x4897b3['shift']());}}}(a36_0x1076,0x2816b));import*as a36_0x3d02bc from'node:fs';import*as a36_0x44f137 from'node:path';function a36_0x1076(){const _0x4b1a7b=['.env.','\x20\x20mv\x20\x22','toISOString','674dMJcxr','\x20does\x20not\x20exist','52036RuQJIB','.env','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','utf-8','metadata','llm_agent','stringify','parse','sort','description','599361wcZfYh','name','\x27\x20will\x20be\x20ignored','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','9gXGujU','push','6310MnQwab','\x20already\x20exists','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','site','\x27:\x20unknown\x20config\x20key\x20\x27','tdx.json','llm_project','writeFileSync','set','from','Invalid\x20profile\x20name:\x20','1101110ALFBOQ','Profile\x20\x27','map','includes','message',':\x20Invalid\x20JSON\x20syntax','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','object','entries','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','warn','test','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Failed\x20to\x20parse\x20','82YOSRqN','has','database','TD_API_KEY','profiles','Error:\x20','11likyvX','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','find','\x22\x20\x22','\x27:\x20config\x20must\x20be\x20an\x20object','1500ARhFhD','parent_segment','lastUsed','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','join','\x20\x201.\x20Edit:\x20','1778120VayeJu','filter','8709252zMJDbn','57zSvHgk','keys','existsSync','readFileSync','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','Warning:\x20Profile\x20\x27','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','api_key','profile','Profile\x20','directory','readdirSync','local','values','rmSync','string','localeCompare'];a36_0x1076=function(){return _0x4b1a7b;};return a36_0x1076();}import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';export function getProfileParams(_0x2678e8){const _0x35cd4e=a36_0x9f3a,_0x41c684={};if(!_0x2678e8)return _0x41c684;for(const [_0xd00527,_0xf8e0e5]of Object[_0x35cd4e(0xb0)](_0x2678e8)){_0xd00527!=='description'&&_0xf8e0e5!==undefined&&(_0x41c684[_0xd00527]=_0xf8e0e5);}return _0x41c684;}export function getProfilesDir(){const _0x12df90=a36_0x9f3a;return a36_0x44f137[_0x12df90(0xc6)](getConfigDir(),_0x12df90(0xba));}function getProfileDir(_0x570c5e){const _0x1797eb=a36_0x9f3a;return a36_0x44f137[_0x1797eb(0xc6)](getProfilesDir(),_0x570c5e);}function getProfileConfigPath(_0x51767c){const _0x483b35=a36_0x9f3a;return a36_0x44f137[_0x483b35(0xc6)](getProfileDir(_0x51767c),_0x483b35(0xa2));}function getProfileEnvPath(_0x1956a5){const _0x5c3246=a36_0x9f3a;return a36_0x44f137[_0x5c3246(0xc6)](getProfileDir(_0x1956a5),_0x5c3246(0x8e));}function getGlobalConfigPath(){const _0xc926ec=a36_0x9f3a;return a36_0x44f137[_0xc926ec(0xc6)](getConfigDir(),_0xc926ec(0xa2));}function validateProfileName(_0x216759){const _0x2f63ea=a36_0x9f3a;if(!/^[a-zA-Z0-9_-]+$/[_0x2f63ea(0xb3)](_0x216759))throw new Error(_0x2f63ea(0xa7)+_0x216759+_0x2f63ea(0xcf));}function validateProfileConfig(_0x19a0a5,_0x4fafbd){const _0x5d33ff=a36_0x9f3a;if(typeof _0x19a0a5!==_0x5d33ff(0xaf)||_0x19a0a5===null)throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xc0));const _0x937d7a=[_0x5d33ff(0x96),_0x5d33ff(0xa0),_0x5d33ff(0xb8),_0x5d33ff(0xc2),_0x5d33ff(0xa3),_0x5d33ff(0x92)],_0x2a9df3=_0x19a0a5;for(const _0xaa80bc of Object[_0x5d33ff(0xcc)](_0x2a9df3)){!_0x937d7a[_0x5d33ff(0xab)](_0xaa80bc)&&console[_0x5d33ff(0xb2)](_0x5d33ff(0xd0)+_0x4fafbd+_0x5d33ff(0xa1)+_0xaa80bc+_0x5d33ff(0x99));}if(_0x2a9df3['description']!==undefined&&typeof _0x2a9df3[_0x5d33ff(0x96)]!=='string')throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xae));if(_0x2a9df3['site']!==undefined&&typeof _0x2a9df3['site']!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0x9f));if(_0x2a9df3['database']!==undefined&&typeof _0x2a9df3['database']!==_0x5d33ff(0x86))throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xc5));if(_0x2a9df3[_0x5d33ff(0xc2)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0xc2)]!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xb1));if(_0x2a9df3[_0x5d33ff(0xa3)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0xa3)]!==_0x5d33ff(0x86))throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xbd));if(_0x2a9df3[_0x5d33ff(0x92)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0x92)]!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xb4));return!![];}function loadProfilesFromTdxJson(_0x3a8840,_0x156d72){const _0x23eaf7=a36_0x9f3a;if(!a36_0x3d02bc[_0x23eaf7(0xcd)](_0x3a8840))return[];try{const _0xabe833=a36_0x3d02bc[_0x23eaf7(0xce)](_0x3a8840,_0x23eaf7(0x90)),_0x1b1686=JSON[_0x23eaf7(0x94)](_0xabe833);if(!_0x1b1686[_0x23eaf7(0xba)]||typeof _0x1b1686[_0x23eaf7(0xba)]!==_0x23eaf7(0xaf))return[];const _0x39d883=[];for(const [_0x435b22,_0x58db13]of Object[_0x23eaf7(0xb0)](_0x1b1686['profiles'])){try{validateProfileConfig(_0x58db13,_0x435b22);const _0x1abd78=getNewCredentialPath(_0x435b22),_0x14d762=getOldCredentialPath(_0x435b22),_0x3dc4d1=a36_0x3d02bc[_0x23eaf7(0xcd)](_0x1abd78)||a36_0x3d02bc[_0x23eaf7(0xcd)](_0x14d762);_0x39d883['push']({'name':_0x435b22,'config':_0x58db13,'metadata':{'name':_0x435b22,'createdAt':new Date()[_0x23eaf7(0x8a)]()},'hasCredentials':_0x3dc4d1,'scope':_0x156d72});}catch(_0x46c2bf){_0x46c2bf instanceof Error&&(console[_0x23eaf7(0xb2)](_0x23eaf7(0x8f)+_0x3a8840+':'),console[_0x23eaf7(0xb2)]('\x20\x20'+_0x46c2bf[_0x23eaf7(0xac)]+'\x0a'));}}return _0x39d883;}catch(_0x1305b5){return _0x1305b5 instanceof SyntaxError?(console[_0x23eaf7(0xb2)](_0x23eaf7(0xb5)+_0x3a8840+_0x23eaf7(0xad)),console[_0x23eaf7(0xb2)](_0x23eaf7(0xbb)+_0x1305b5[_0x23eaf7(0xac)]+'\x0a')):console['warn'](_0x23eaf7(0xc4)+_0x3a8840+':\x20'+_0x1305b5+'\x0a'),[];}}export function getNewCredentialPath(_0x39269d){const _0x3caaba=a36_0x9f3a;return a36_0x44f137[_0x3caaba(0xc6)](getConfigDir(),_0x3caaba(0x88)+_0x39269d);}function getOldCredentialPath(_0x2d45e3){const _0x318971=a36_0x9f3a;return a36_0x44f137[_0x318971(0xc6)](getProfilesDir(),_0x2d45e3,_0x318971(0x8e));}function loadProfilesFromTdxJsonFiles(){const _0x3ecf37=a36_0x9f3a,_0x328e73=[],_0x3fb43d=findProjectConfigPath();_0x3fb43d&&_0x328e73[_0x3ecf37(0x9c)](...loadProfilesFromTdxJson(_0x3fb43d,_0x3ecf37(0x83)));const _0x24e954=a36_0x44f137['join'](getConfigDir(),_0x3ecf37(0xa2));return _0x328e73['push'](...loadProfilesFromTdxJson(_0x24e954,'user')),_0x328e73;}function loadProfilesFromDirectories(){const _0x419333=a36_0x9f3a,_0x178686=getProfilesDir();if(!a36_0x3d02bc[_0x419333(0xcd)](_0x178686))return[];try{return a36_0x3d02bc[_0x419333(0x82)](_0x178686,{'withFileTypes':!![]})[_0x419333(0xc9)](_0xe9f323=>_0xe9f323['isDirectory']())[_0x419333(0xaa)](_0x5c1625=>_0x5c1625[_0x419333(0x98)])[_0x419333(0xc9)](_0x144c83=>{const _0x1f330b=_0x419333,_0x46d8d0=getProfileConfigPath(_0x144c83),_0x57f78c=getProfileEnvPath(_0x144c83);return a36_0x3d02bc[_0x1f330b(0xcd)](_0x46d8d0)||a36_0x3d02bc[_0x1f330b(0xcd)](_0x57f78c);})[_0x419333(0xaa)](_0x1317cb=>{const _0x1081ef=_0x419333,_0x62f66d=loadProfileFromDirectory(_0x1317cb);if(_0x62f66d)return{..._0x62f66d,'scope':_0x1081ef(0x81)};return null;})['filter'](_0x3117a9=>_0x3117a9!==null);}catch{return[];}}function loadProfileFromDirectory(_0x3ea22b){const _0x495556=a36_0x9f3a,_0xdb0072=getProfileConfigPath(_0x3ea22b),_0x5e5cbb=getOldCredentialPath(_0x3ea22b);if(!a36_0x3d02bc[_0x495556(0xcd)](_0xdb0072)&&!a36_0x3d02bc['existsSync'](_0x5e5cbb))return null;let _0x407957={},_0x63789e={'name':_0x3ea22b,'createdAt':new Date()[_0x495556(0x8a)]()};if(a36_0x3d02bc['existsSync'](_0xdb0072))try{const _0x213da7=a36_0x3d02bc[_0x495556(0xce)](_0xdb0072,'utf-8'),_0x3ef89d=JSON[_0x495556(0x94)](_0x213da7),{metadata:_0x1509ae,..._0x49b739}=_0x3ef89d;_0x407957=_0x49b739,_0x1509ae&&(_0x63789e=_0x1509ae);}catch{}return{'name':_0x3ea22b,'config':_0x407957,'metadata':_0x63789e,'hasCredentials':a36_0x3d02bc[_0x495556(0xcd)](_0x5e5cbb),'scope':_0x495556(0x81)};}export function listProfiles(){const _0x2b6389=a36_0x9f3a,_0x2f71d0=loadProfilesFromTdxJsonFiles(),_0x58ff95=loadProfilesFromDirectories();if(_0x58ff95['length']>0x0){const _0x2f6cfa=_0x58ff95[_0x2b6389(0xaa)](_0x7fe442=>_0x7fe442[_0x2b6389(0x98)])['join'](',\x20'),_0x27f551=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x2f6cfa),console[_0x2b6389(0xb2)](_0x2b6389(0x7d)),console['warn'](_0x2b6389(0xc7)+a36_0x44f137[_0x2b6389(0xc6)](_0x27f551,_0x2b6389(0xa2))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x2b6389(0xb2)](_0x2b6389(0x9a));}const _0x369f9f=[..._0x2f71d0,..._0x58ff95],_0x4eb341=new Map();for(const _0x23a455 of _0x369f9f){!_0x4eb341[_0x2b6389(0xb7)](_0x23a455[_0x2b6389(0x98)])&&_0x4eb341[_0x2b6389(0xa5)](_0x23a455['name'],_0x23a455);}return Array[_0x2b6389(0xa6)](_0x4eb341[_0x2b6389(0x84)]())[_0x2b6389(0x95)]((_0x156530,_0x2b193b)=>_0x156530[_0x2b6389(0x98)][_0x2b6389(0x87)](_0x2b193b[_0x2b6389(0x98)]));}function a36_0x9f3a(_0x46f865,_0x6d1193){const _0x1076e0=a36_0x1076();return a36_0x9f3a=function(_0x9f3a3f,_0xcb55e8){_0x9f3a3f=_0x9f3a3f-0x7d;let _0x2cc4f9=_0x1076e0[_0x9f3a3f];return _0x2cc4f9;},a36_0x9f3a(_0x46f865,_0x6d1193);}export function profileExists(_0x4429c3){const _0x2bfc42=a36_0x9f3a,_0x520b89=listProfiles();return _0x520b89['some'](_0x426d0e=>_0x426d0e[_0x2bfc42(0x98)]===_0x4429c3);}export function loadProfile(_0xfa43e4){const _0x585ca5=a36_0x9f3a;validateProfileName(_0xfa43e4);const _0x12a48e=listProfiles(),_0x9de196=_0x12a48e[_0x585ca5(0xbe)](_0x321464=>_0x321464[_0x585ca5(0x98)]===_0xfa43e4);return _0x9de196||null;}export function saveProfile(_0x10aebd,_0x2b4391,_0x54251e=![]){const _0x52b4cc=a36_0x9f3a;validateProfileName(_0x10aebd);const _0x6790a7=getProfileDir(_0x10aebd),_0x105393=getProfileConfigPath(_0x10aebd);createSecureDirectory(_0x6790a7);let _0x2e3bc7;const _0x31ca22=loadProfile(_0x10aebd);_0x31ca22?(_0x2e3bc7=_0x31ca22[_0x52b4cc(0x91)],_0x54251e&&(_0x2e3bc7[_0x52b4cc(0xc3)]=new Date()['toISOString']())):_0x2e3bc7={'name':_0x10aebd,'createdAt':new Date()['toISOString']()};const _0x4ab33d=JSON[_0x52b4cc(0x93)](_0x2b4391);if(_0x4ab33d[_0x52b4cc(0xab)](_0x52b4cc(0xb9))||_0x4ab33d[_0x52b4cc(0xab)]('apiKey')||_0x4ab33d[_0x52b4cc(0xab)](_0x52b4cc(0x7e)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.');const _0xeff465={..._0x2b4391,'metadata':_0x2e3bc7};a36_0x3d02bc[_0x52b4cc(0xa4)](_0x105393,JSON[_0x52b4cc(0x93)](_0xeff465,null,0x2));}export function deleteProfile(_0x1089ae){const _0x662a18=a36_0x9f3a;validateProfileName(_0x1089ae);const _0x477e84=getProfileDir(_0x1089ae);if(!a36_0x3d02bc['existsSync'](_0x477e84))throw new Error(_0x662a18(0x80)+_0x1089ae+_0x662a18(0x8c));a36_0x3d02bc[_0x662a18(0x85)](_0x477e84,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x17af38=a36_0x9f3a,_0x5c5028=getGlobalConfigPath();if(!a36_0x3d02bc[_0x17af38(0xcd)](_0x5c5028))return null;try{const _0x6d679=a36_0x3d02bc[_0x17af38(0xce)](_0x5c5028,_0x17af38(0x90)),_0x40d6cf=JSON[_0x17af38(0x94)](_0x6d679);return _0x40d6cf[_0x17af38(0x7f)]||null;}catch{return null;}}export function createProfile(_0x188c21,_0x1d12df){const _0x3aa37c=a36_0x9f3a;validateProfileName(_0x188c21);if(profileExists(_0x188c21))throw new Error('Profile\x20'+_0x188c21+_0x3aa37c(0x9e));saveProfile(_0x188c21,_0x1d12df);}export function saveProfileCredentials(_0x896d62,_0x4a18d6){const _0x578411=a36_0x9f3a;validateProfileName(_0x896d62);if(!profileExists(_0x896d62))throw new Error(_0x578411(0x80)+_0x896d62+_0x578411(0x8c));const _0x4fb96f=getNewCredentialPath(_0x896d62);writeSecureFile(_0x4fb96f,_0x4a18d6);}export function loadProfileCredentials(_0x4996df){const _0x234a81=a36_0x9f3a;validateProfileName(_0x4996df);const _0x3b4357=getNewCredentialPath(_0x4996df);if(a36_0x3d02bc[_0x234a81(0xcd)](_0x3b4357))try{return a36_0x3d02bc['readFileSync'](_0x3b4357,_0x234a81(0x90));}catch{}const _0x1f2c9b=getOldCredentialPath(_0x4996df);if(a36_0x3d02bc[_0x234a81(0xcd)](_0x1f2c9b)){console[_0x234a81(0xb2)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x4996df+'\x27'),console[_0x234a81(0xb2)]('To\x20migrate:'),console[_0x234a81(0xb2)](_0x234a81(0x89)+_0x1f2c9b+_0x234a81(0xbf)+_0x3b4357+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a36_0x3d02bc[_0x234a81(0xce)](_0x1f2c9b,_0x234a81(0x90));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- (function(_0x151f72,_0x182fdf){const _0x3ab9d8=a37_0x2bf1,_0x32b977=_0x151f72();while(!![]){try{const _0x51bec2=-parseInt(_0x3ab9d8(0x153))/0x1*(parseInt(_0x3ab9d8(0x164))/0x2)+parseInt(_0x3ab9d8(0x169))/0x3*(parseInt(_0x3ab9d8(0x16e))/0x4)+parseInt(_0x3ab9d8(0x161))/0x5+parseInt(_0x3ab9d8(0x16d))/0x6*(-parseInt(_0x3ab9d8(0x165))/0x7)+parseInt(_0x3ab9d8(0x15c))/0x8*(-parseInt(_0x3ab9d8(0x14f))/0x9)+-parseInt(_0x3ab9d8(0x166))/0xa*(-parseInt(_0x3ab9d8(0x16a))/0xb)+parseInt(_0x3ab9d8(0x15e))/0xc*(parseInt(_0x3ab9d8(0x162))/0xd);if(_0x51bec2===_0x182fdf)break;else _0x32b977['push'](_0x32b977['shift']());}catch(_0x1bc354){_0x32b977['push'](_0x32b977['shift']());}}}(a37_0xd06c,0x44ea0));import*as a37_0x2d4aba from'node:fs';function a37_0x2bf1(_0x21badc,_0x5c063d){const _0xd06c31=a37_0xd06c();return a37_0x2bf1=function(_0x2bf1aa,_0x33ab67){_0x2bf1aa=_0x2bf1aa-0x14e;let _0x55c4c5=_0xd06c31[_0x2bf1aa];return _0x55c4c5;},a37_0x2bf1(_0x21badc,_0x5c063d);}import*as a37_0x44650a from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x2d0ffd){const _0x273aac=a37_0x2bf1;let _0x41aaec=_0x2d0ffd||process[_0x273aac(0x168)]();while(!![]){const _0x211ee9=a37_0x44650a[_0x273aac(0x16c)](_0x41aaec,PROJECT_CONFIG_FILENAME);if(a37_0x2d4aba[_0x273aac(0x154)](_0x211ee9))return _0x211ee9;const _0x34ed26=a37_0x44650a[_0x273aac(0x167)](_0x41aaec);if(_0x34ed26===_0x41aaec)return null;_0x41aaec=_0x34ed26;}}export function loadProjectConfig(_0x206505){const _0x147cef=a37_0x2bf1,_0x35a596=findProjectConfigPath(_0x206505);if(!_0x35a596)return null;try{const _0x5c5fca=a37_0x2d4aba[_0x147cef(0x15b)](_0x35a596,_0x147cef(0x158)),_0x3f599b=JSON[_0x147cef(0x16b)](_0x5c5fca),_0x1d3030=JSON[_0x147cef(0x163)](_0x3f599b);if(_0x1d3030['includes'](_0x147cef(0x155))||_0x1d3030['includes'](_0x147cef(0x15f))||_0x1d3030[_0x147cef(0x151)]('api_key'))throw new Error(_0x147cef(0x16f)+_0x35a596+').\x20'+_0x147cef(0x160));const {metadata:_0x20b260,profile:_0x7a31f4,..._0x11fdd9}=_0x3f599b;return _0x7a31f4&&console[_0x147cef(0x150)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x35a596+_0x147cef(0x171)+_0x147cef(0x15d)),_0x11fdd9;}catch(_0x50b57c){if(_0x50b57c instanceof Error&&_0x147cef(0x170)in _0x50b57c&&_0x50b57c[_0x147cef(0x170)]===_0x147cef(0x14e))return null;throw new Error(_0x147cef(0x157)+_0x35a596+':\x20'+_0x50b57c);}}export function saveProjectConfig(_0x5b0891,_0x422bb6){const _0x4ba21a=a37_0x2bf1,_0x5008d4=_0x422bb6||process[_0x4ba21a(0x168)](),_0x5258a2=a37_0x44650a[_0x4ba21a(0x16c)](_0x5008d4,PROJECT_CONFIG_FILENAME),_0x77f951=JSON[_0x4ba21a(0x163)](_0x5b0891);if(_0x77f951[_0x4ba21a(0x151)](_0x4ba21a(0x155))||_0x77f951['includes'](_0x4ba21a(0x15f))||_0x77f951[_0x4ba21a(0x151)](_0x4ba21a(0x15a)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x4ba21a(0x152)in _0x5b0891)throw new Error(_0x4ba21a(0x156));a37_0x2d4aba[_0x4ba21a(0x159)](_0x5258a2,JSON['stringify'](_0x5b0891,null,0x2));}function a37_0xd06c(){const _0x4a05d8=['51108NAXEOd','existsSync','TD_API_KEY','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','Failed\x20to\x20load\x20project\x20config\x20from\x20','utf-8','writeFileSync','api_key','readFileSync','152YUROeV','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','261768rusJEn','apiKey','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','826200lJPSPb','221gARgEN','stringify','2TsQPpf','13853YFmwDy','10XNKAWo','dirname','cwd','27iHZnFh','5535915LeUBrr','parse','join','618byZIFk','6108MBUCuZ','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','code','\x20is\x20ignored.\x20','ENOENT','244359gKTbfx','warn','includes','profile'];a37_0xd06c=function(){return _0x4a05d8;};return a37_0xd06c();}export function hasProjectConfig(_0x1768e0){return findProjectConfigPath(_0x1768e0)!==null;}export function getProjectRoot(_0x1d0bc4){const _0x1d8643=a37_0x2bf1,_0x331cc3=findProjectConfigPath(_0x1d0bc4);return _0x331cc3?a37_0x44650a[_0x1d8643(0x167)](_0x331cc3):null;}
1
+ const a37_0xad7d3f=a37_0x567b;(function(_0x33965e,_0x5476a5){const _0x392e22=a37_0x567b,_0x1f5198=_0x33965e();while(!![]){try{const _0x2f0832=parseInt(_0x392e22(0xc8))/0x1*(parseInt(_0x392e22(0xe2))/0x2)+-parseInt(_0x392e22(0xca))/0x3*(parseInt(_0x392e22(0xe5))/0x4)+-parseInt(_0x392e22(0xd5))/0x5*(-parseInt(_0x392e22(0xd1))/0x6)+parseInt(_0x392e22(0xe1))/0x7*(parseInt(_0x392e22(0xcb))/0x8)+-parseInt(_0x392e22(0xd2))/0x9*(parseInt(_0x392e22(0xd0))/0xa)+-parseInt(_0x392e22(0xe4))/0xb*(-parseInt(_0x392e22(0xdd))/0xc)+-parseInt(_0x392e22(0xc6))/0xd;if(_0x2f0832===_0x5476a5)break;else _0x1f5198['push'](_0x1f5198['shift']());}catch(_0x4cb68a){_0x1f5198['push'](_0x1f5198['shift']());}}}(a37_0x2b9e,0xc102f));import*as a37_0x24a68a from'node:fs';function a37_0x567b(_0x16b7ae,_0x21be30){const _0x2b9eb6=a37_0x2b9e();return a37_0x567b=function(_0x567b88,_0x13452d){_0x567b88=_0x567b88-0xc6;let _0x1d1f51=_0x2b9eb6[_0x567b88];return _0x1d1f51;},a37_0x567b(_0x16b7ae,_0x21be30);}import*as a37_0x4fc7ba from'node:path';const PROJECT_CONFIG_FILENAME=a37_0xad7d3f(0xdb);function a37_0x2b9e(){const _0x4e5381=['Failed\x20to\x20load\x20project\x20config\x20from\x20','7894730PLyMLg','6wfbQgk','9IqWzqC','apiKey','join','1909010WBtwvS','parse','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','cwd','Warning:\x20\x27profile\x27\x20field\x20in\x20','code','tdx.json','readFileSync','1356gywkZW','dirname','api_key','includes','7273DNevNL','162314YeHmRm','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','103004BrJkMq','4UBDriZ','ENOENT','1248650AjKmYS','TD_API_KEY','9wIGjDE','existsSync','1987701DHKNOG','1296xrgrWN',').\x20','stringify','utf-8'];a37_0x2b9e=function(){return _0x4e5381;};return a37_0x2b9e();}export function findProjectConfigPath(_0x5def79){const _0x259713=a37_0xad7d3f;let _0x4631d2=_0x5def79||process[_0x259713(0xd8)]();while(!![]){const _0x6f3f73=a37_0x4fc7ba[_0x259713(0xd4)](_0x4631d2,PROJECT_CONFIG_FILENAME);if(a37_0x24a68a[_0x259713(0xc9)](_0x6f3f73))return _0x6f3f73;const _0x334094=a37_0x4fc7ba[_0x259713(0xde)](_0x4631d2);if(_0x334094===_0x4631d2)return null;_0x4631d2=_0x334094;}}export function loadProjectConfig(_0x454bb5){const _0x2871ec=a37_0xad7d3f,_0x47d105=findProjectConfigPath(_0x454bb5);if(!_0x47d105)return null;try{const _0xbb5442=a37_0x24a68a[_0x2871ec(0xdc)](_0x47d105,_0x2871ec(0xce)),_0x5b1a7c=JSON[_0x2871ec(0xd6)](_0xbb5442),_0x1e9ae6=JSON[_0x2871ec(0xcd)](_0x5b1a7c);if(_0x1e9ae6[_0x2871ec(0xe0)](_0x2871ec(0xc7))||_0x1e9ae6['includes']('apiKey')||_0x1e9ae6[_0x2871ec(0xe0)](_0x2871ec(0xdf)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x47d105+_0x2871ec(0xcc)+_0x2871ec(0xd7));const {metadata:_0x50741b,profile:_0x1314e0,..._0x5576d1}=_0x5b1a7c;return _0x1314e0&&console['warn'](_0x2871ec(0xd9)+_0x47d105+'\x20is\x20ignored.\x20'+_0x2871ec(0xe3)),_0x5576d1;}catch(_0x1e5bb7){if(_0x1e5bb7 instanceof Error&&'code'in _0x1e5bb7&&_0x1e5bb7[_0x2871ec(0xda)]===_0x2871ec(0xe6))return null;throw new Error(_0x2871ec(0xcf)+_0x47d105+':\x20'+_0x1e5bb7);}}export function saveProjectConfig(_0x287861,_0x94a4dc){const _0x2e2244=a37_0xad7d3f,_0x4ceacd=_0x94a4dc||process['cwd'](),_0x140e40=a37_0x4fc7ba[_0x2e2244(0xd4)](_0x4ceacd,PROJECT_CONFIG_FILENAME),_0x57f3a1=JSON[_0x2e2244(0xcd)](_0x287861);if(_0x57f3a1['includes'](_0x2e2244(0xc7))||_0x57f3a1[_0x2e2244(0xe0)](_0x2e2244(0xd3))||_0x57f3a1['includes'](_0x2e2244(0xdf)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if('profile'in _0x287861)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a37_0x24a68a['writeFileSync'](_0x140e40,JSON[_0x2e2244(0xcd)](_0x287861,null,0x2));}export function hasProjectConfig(_0x41b21a){return findProjectConfigPath(_0x41b21a)!==null;}export function getProjectRoot(_0x41658c){const _0x157357=a37_0xad7d3f,_0x22185d=findProjectConfigPath(_0x41658c);return _0x22185d?a37_0x4fc7ba[_0x157357(0xde)](_0x22185d):null;}
@@ -1 +1 @@
1
- (function(_0x493184,_0x34b322){const _0x2053be=a38_0x5966,_0x3721a7=_0x493184();while(!![]){try{const _0x5a4d31=parseInt(_0x2053be(0x12a))/0x1+-parseInt(_0x2053be(0x12e))/0x2+-parseInt(_0x2053be(0x13c))/0x3+parseInt(_0x2053be(0x138))/0x4*(-parseInt(_0x2053be(0x126))/0x5)+parseInt(_0x2053be(0x141))/0x6+-parseInt(_0x2053be(0x13d))/0x7*(parseInt(_0x2053be(0x139))/0x8)+parseInt(_0x2053be(0x14c))/0x9;if(_0x5a4d31===_0x34b322)break;else _0x3721a7['push'](_0x3721a7['shift']());}catch(_0xa866c2){_0x3721a7['push'](_0x3721a7['shift']());}}}(a38_0x7e9e,0xe51d3));function a38_0x7e9e(){const _0x330d71=['21599082guFrJE','env','endsWith','stringify','2976390EvwuHX','push','.json','TD_API_KEY','31423GwzazC','readdirSync','sessions','TDX_CONFIG_DIR','1823294mKDaJT','tdx','utf-8','warn','readFileSync','test','includes','replace','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','getTime','4BPvZVU','8296sCieHc','homedir','parse','124524upXOGo','6769sABwrG','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','createdAt','now','6350052FXJkcR','apiKey','unlinkSync','.\x20This\x20is\x20insecure.\x20Removing\x20session.','writeFileSync','toString','toISOString','join','api_key','sort','existsSync'];a38_0x7e9e=function(){return _0x330d71;};return a38_0x7e9e();}function a38_0x5966(_0x3b6171,_0x5e83ee){const _0x7e9e3b=a38_0x7e9e();return a38_0x5966=function(_0x5966df,_0x4e5f93){_0x5966df=_0x5966df-0x123;let _0x57569f=_0x7e9e3b[_0x5966df];return _0x57569f;},a38_0x5966(_0x3b6171,_0x5e83ee);}import*as a38_0x5cae22 from'node:fs';import*as a38_0x3f42d7 from'node:path';import*as a38_0x75de0e 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 _0x441d66=a38_0x5966,_0x14c4f5=process[_0x441d66(0x123)][_0x441d66(0x12d)]||a38_0x3f42d7[_0x441d66(0x148)](a38_0x75de0e[_0x441d66(0x13a)](),'.config',_0x441d66(0x12f));return a38_0x3f42d7[_0x441d66(0x148)](_0x14c4f5,_0x441d66(0x12c));}function getSessionPath(_0x4c5fe2){const _0x48a56c=a38_0x5966;return a38_0x3f42d7[_0x48a56c(0x148)](getSessionsDir(),_0x4c5fe2+_0x48a56c(0x128));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x1ebccf){if(_0x1ebccf)return _0x1ebccf;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x40c6fd){const _0x3be079=a38_0x5966,_0x24d9c8=_0x40c6fd||getCurrentSessionPID()[_0x3be079(0x146)](),_0x50165b=/^\d+$/[_0x3be079(0x133)](_0x24d9c8)?parseInt(_0x24d9c8,0xa):null;return _0x50165b!==null?loadSessionContextByPID(_0x50165b):loadSessionContextByString(_0x24d9c8);}export function loadSessionContextByPID(_0x3b5c32){const _0x339124=a38_0x5966,_0x1127c7=getSessionPath(_0x3b5c32);if(!a38_0x5cae22[_0x339124(0x14b)](_0x1127c7))return null;try{const _0x17699e=a38_0x5cae22[_0x339124(0x132)](_0x1127c7,_0x339124(0x130)),_0x441dd5=JSON['parse'](_0x17699e),_0x415fa7=new Date(_0x441dd5['createdAt'])[_0x339124(0x137)](),_0x3ae8a3=Date[_0x339124(0x140)]();if(_0x3ae8a3-_0x415fa7>SESSION_EXPIRATION_MS)return a38_0x5cae22[_0x339124(0x143)](_0x1127c7),null;const _0x638b52=JSON[_0x339124(0x125)](_0x441dd5);if(_0x638b52[_0x339124(0x134)](_0x339124(0x129))||_0x638b52[_0x339124(0x134)](_0x339124(0x142))||_0x638b52[_0x339124(0x134)](_0x339124(0x149)))return console[_0x339124(0x131)](_0x339124(0x136)+_0x1127c7+_0x339124(0x144)),a38_0x5cae22[_0x339124(0x143)](_0x1127c7),null;return _0x441dd5;}catch{try{a38_0x5cae22[_0x339124(0x143)](_0x1127c7);}catch{}return null;}}function loadSessionContextByString(_0x356728){const _0x2a5ac8=a38_0x5966,_0x627c0=a38_0x3f42d7['join'](getSessionsDir(),_0x356728+'.json');if(!a38_0x5cae22[_0x2a5ac8(0x14b)](_0x627c0))return null;try{const _0x3354d3=a38_0x5cae22[_0x2a5ac8(0x132)](_0x627c0,_0x2a5ac8(0x130)),_0x2b4017=JSON[_0x2a5ac8(0x13b)](_0x3354d3),_0xc2bb50=new Date(_0x2b4017[_0x2a5ac8(0x13f)])[_0x2a5ac8(0x137)](),_0x2f0451=Date['now']();if(_0x2f0451-_0xc2bb50>SESSION_EXPIRATION_MS)return a38_0x5cae22[_0x2a5ac8(0x143)](_0x627c0),null;const _0x5238f9=JSON[_0x2a5ac8(0x125)](_0x2b4017);if(_0x5238f9['includes'](_0x2a5ac8(0x129))||_0x5238f9[_0x2a5ac8(0x134)]('apiKey')||_0x5238f9[_0x2a5ac8(0x134)]('api_key'))return console['warn'](_0x2a5ac8(0x136)+_0x627c0+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a38_0x5cae22[_0x2a5ac8(0x143)](_0x627c0),null;return _0x2b4017;}catch{try{a38_0x5cae22['unlinkSync'](_0x627c0);}catch{}return null;}}export function saveSessionContext(_0x5cd2c0,_0x121924){const _0x52fc6d=a38_0x5966,_0x2ae862=_0x121924||getCurrentSessionPID()[_0x52fc6d(0x146)](),_0xa9ab69=/^\d+$/['test'](_0x2ae862)?parseInt(_0x2ae862,0xa):getCurrentSessionPID(),_0x449d70=a38_0x3f42d7[_0x52fc6d(0x148)](getSessionsDir(),_0x2ae862+_0x52fc6d(0x128)),_0xa0d5d6=getSessionsDir();createSecureDirectory(_0xa0d5d6);const _0x2ae81c=JSON['stringify'](_0x5cd2c0);if(_0x2ae81c[_0x52fc6d(0x134)](_0x52fc6d(0x129))||_0x2ae81c[_0x52fc6d(0x134)](_0x52fc6d(0x142))||_0x2ae81c[_0x52fc6d(0x134)](_0x52fc6d(0x149)))throw new Error(_0x52fc6d(0x13e));let _0x4c619f;const _0x5db13d=/^\d+$/[_0x52fc6d(0x133)](_0x2ae862)?loadSessionContextByPID(parseInt(_0x2ae862,0xa)):loadSessionContextByString(_0x2ae862);_0x5db13d?_0x4c619f={..._0x5db13d,..._0x5cd2c0,'pid':_0xa9ab69,'sessionId':_0x2ae862!==_0xa9ab69['toString']()?_0x2ae862:undefined,'updatedAt':new Date()[_0x52fc6d(0x147)]()}:_0x4c619f={'pid':_0xa9ab69,'sessionId':_0x2ae862!==_0xa9ab69['toString']()?_0x2ae862:undefined,..._0x5cd2c0,'createdAt':new Date()[_0x52fc6d(0x147)](),'updatedAt':new Date()[_0x52fc6d(0x147)]()},a38_0x5cae22[_0x52fc6d(0x145)](_0x449d70,JSON[_0x52fc6d(0x125)](_0x4c619f,null,0x2));}export function clearSessionContext(_0x4d1373){const _0x51df3d=a38_0x5966,_0x3c1d94=_0x4d1373||getCurrentSessionPID()[_0x51df3d(0x146)](),_0x175261=a38_0x3f42d7[_0x51df3d(0x148)](getSessionsDir(),_0x3c1d94+_0x51df3d(0x128));a38_0x5cae22[_0x51df3d(0x14b)](_0x175261)&&a38_0x5cae22[_0x51df3d(0x143)](_0x175261);}export function cleanExpiredSessions(){const _0x3294f0=a38_0x5966,_0xeb32ef=getSessionsDir();if(!a38_0x5cae22[_0x3294f0(0x14b)](_0xeb32ef))return 0x0;let _0x4ad1fa=0x0;const _0x6ce796=Date[_0x3294f0(0x140)]();try{const _0x1195b9=a38_0x5cae22[_0x3294f0(0x12b)](_0xeb32ef);for(const _0x22c39b of _0x1195b9){if(!_0x22c39b[_0x3294f0(0x124)](_0x3294f0(0x128)))continue;const _0x290160=a38_0x3f42d7['join'](_0xeb32ef,_0x22c39b),_0x1068d9=_0x22c39b[_0x3294f0(0x135)](_0x3294f0(0x128),''),_0x215623=parseInt(_0x1068d9,0xa),_0x3b800c=!isNaN(_0x215623);if(_0x3b800c){if(!isProcessRunning(_0x215623)){a38_0x5cae22[_0x3294f0(0x143)](_0x290160),_0x4ad1fa++;continue;}}try{const _0x320290=a38_0x5cae22[_0x3294f0(0x132)](_0x290160,'utf-8'),_0x3257b2=JSON[_0x3294f0(0x13b)](_0x320290),_0x36fea5=new Date(_0x3257b2[_0x3294f0(0x13f)])[_0x3294f0(0x137)]();_0x6ce796-_0x36fea5>SESSION_EXPIRATION_MS&&(a38_0x5cae22[_0x3294f0(0x143)](_0x290160),_0x4ad1fa++);}catch{a38_0x5cae22[_0x3294f0(0x143)](_0x290160),_0x4ad1fa++;}}}catch{}return _0x4ad1fa;}export function listActiveSessions(){const _0x4ac97e=a38_0x5966,_0x453ee9=getSessionsDir();if(!a38_0x5cae22[_0x4ac97e(0x14b)](_0x453ee9))return[];try{const _0x1b8815=a38_0x5cae22[_0x4ac97e(0x12b)](_0x453ee9),_0x63c808=[];for(const _0x1db446 of _0x1b8815){if(!_0x1db446[_0x4ac97e(0x124)]('.json'))continue;const _0x59164a=_0x1db446[_0x4ac97e(0x135)](_0x4ac97e(0x128),''),_0x3c5c81=parseInt(_0x59164a,0xa);!isNaN(_0x3c5c81)&&isProcessRunning(_0x3c5c81)&&_0x63c808[_0x4ac97e(0x127)](_0x3c5c81);}return _0x63c808[_0x4ac97e(0x14a)]((_0x1ce065,_0x4b55c6)=>_0x1ce065-_0x4b55c6);}catch{return[];}}
1
+ (function(_0xc6d289,_0x5df9b4){const _0x587398=a38_0x4c89,_0x4a7b65=_0xc6d289();while(!![]){try{const _0x430640=parseInt(_0x587398(0x91))/0x1*(-parseInt(_0x587398(0x89))/0x2)+parseInt(_0x587398(0x97))/0x3+parseInt(_0x587398(0x84))/0x4*(-parseInt(_0x587398(0x96))/0x5)+parseInt(_0x587398(0x87))/0x6*(-parseInt(_0x587398(0x78))/0x7)+parseInt(_0x587398(0x9a))/0x8+-parseInt(_0x587398(0xa2))/0x9*(parseInt(_0x587398(0x81))/0xa)+parseInt(_0x587398(0x7b))/0xb;if(_0x430640===_0x5df9b4)break;else _0x4a7b65['push'](_0x4a7b65['shift']());}catch(_0x1156a9){_0x4a7b65['push'](_0x4a7b65['shift']());}}}(a38_0x5de9,0xeef99));import*as a38_0x10485b from'node:fs';import*as a38_0x3a2c43 from'node:path';import*as a38_0x25fe5d from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x45105a=a38_0x4c89,_0x3966b4=process['env'][_0x45105a(0x8e)]||a38_0x3a2c43[_0x45105a(0x8a)](a38_0x25fe5d[_0x45105a(0x7e)](),_0x45105a(0x7f),_0x45105a(0x7d));return a38_0x3a2c43[_0x45105a(0x8a)](_0x3966b4,_0x45105a(0x8d));}function getSessionPath(_0x23b3fd){const _0x51af1d=a38_0x4c89;return a38_0x3a2c43['join'](getSessionsDir(),_0x23b3fd+_0x51af1d(0x9d));}export function getCurrentSessionPID(){return getPPID();}function a38_0x4c89(_0x25a5be,_0x187edc){const _0x5de9f3=a38_0x5de9();return a38_0x4c89=function(_0x4c8908,_0x17f928){_0x4c8908=_0x4c8908-0x78;let _0x179cd3=_0x5de9f3[_0x4c8908];return _0x179cd3;},a38_0x4c89(_0x25a5be,_0x187edc);}export function getSessionID(_0x561e95){const _0x3b7329=a38_0x4c89;if(_0x561e95)return _0x561e95;return getCurrentSessionPID()[_0x3b7329(0x7c)]();}export function loadSessionContext(_0x3463c4){const _0x2448fd=a38_0x4c89,_0x1e9d48=_0x3463c4||getCurrentSessionPID()[_0x2448fd(0x7c)](),_0x1b45e0=/^\d+$/['test'](_0x1e9d48)?parseInt(_0x1e9d48,0xa):null;return _0x1b45e0!==null?loadSessionContextByPID(_0x1b45e0):loadSessionContextByString(_0x1e9d48);}export function loadSessionContextByPID(_0x1f2b46){const _0x667481=a38_0x4c89,_0x51d96d=getSessionPath(_0x1f2b46);if(!a38_0x10485b[_0x667481(0x82)](_0x51d96d))return null;try{const _0x4ca956=a38_0x10485b['readFileSync'](_0x51d96d,'utf-8'),_0x5adac3=JSON['parse'](_0x4ca956),_0x47c279=new Date(_0x5adac3[_0x667481(0x93)])[_0x667481(0x9b)](),_0x2ccecf=Date['now']();if(_0x2ccecf-_0x47c279>SESSION_EXPIRATION_MS)return a38_0x10485b[_0x667481(0x95)](_0x51d96d),null;const _0x6588c9=JSON[_0x667481(0x8f)](_0x5adac3);if(_0x6588c9[_0x667481(0x9f)](_0x667481(0x99))||_0x6588c9[_0x667481(0x9f)](_0x667481(0x80))||_0x6588c9[_0x667481(0x9f)]('api_key'))return console[_0x667481(0xa1)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x51d96d+_0x667481(0x8b)),a38_0x10485b[_0x667481(0x95)](_0x51d96d),null;return _0x5adac3;}catch{try{a38_0x10485b[_0x667481(0x95)](_0x51d96d);}catch{}return null;}}function loadSessionContextByString(_0x303b03){const _0x492fac=a38_0x4c89,_0x21c74d=a38_0x3a2c43[_0x492fac(0x8a)](getSessionsDir(),_0x303b03+_0x492fac(0x9d));if(!a38_0x10485b[_0x492fac(0x82)](_0x21c74d))return null;try{const _0x4977bd=a38_0x10485b[_0x492fac(0x8c)](_0x21c74d,_0x492fac(0x94)),_0x3c64cb=JSON[_0x492fac(0x9c)](_0x4977bd),_0x520fc8=new Date(_0x3c64cb['createdAt'])['getTime'](),_0x18a68e=Date[_0x492fac(0x88)]();if(_0x18a68e-_0x520fc8>SESSION_EXPIRATION_MS)return a38_0x10485b[_0x492fac(0x95)](_0x21c74d),null;const _0x3fb92d=JSON[_0x492fac(0x8f)](_0x3c64cb);if(_0x3fb92d[_0x492fac(0x9f)](_0x492fac(0x99))||_0x3fb92d[_0x492fac(0x9f)]('apiKey')||_0x3fb92d[_0x492fac(0x9f)]('api_key'))return console[_0x492fac(0xa1)](_0x492fac(0x83)+_0x21c74d+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a38_0x10485b[_0x492fac(0x95)](_0x21c74d),null;return _0x3c64cb;}catch{try{a38_0x10485b[_0x492fac(0x95)](_0x21c74d);}catch{}return null;}}export function saveSessionContext(_0x44d98d,_0x29eee4){const _0xc191b4=a38_0x4c89,_0x109f6b=_0x29eee4||getCurrentSessionPID()[_0xc191b4(0x7c)](),_0x15e45a=/^\d+$/[_0xc191b4(0x7a)](_0x109f6b)?parseInt(_0x109f6b,0xa):getCurrentSessionPID(),_0x15afb4=a38_0x3a2c43[_0xc191b4(0x8a)](getSessionsDir(),_0x109f6b+_0xc191b4(0x9d)),_0x4e9795=getSessionsDir();createSecureDirectory(_0x4e9795);const _0x42d903=JSON[_0xc191b4(0x8f)](_0x44d98d);if(_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x99))||_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x80))||_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x85)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x5cf830;const _0x1ad9b5=/^\d+$/['test'](_0x109f6b)?loadSessionContextByPID(parseInt(_0x109f6b,0xa)):loadSessionContextByString(_0x109f6b);_0x1ad9b5?_0x5cf830={..._0x1ad9b5,..._0x44d98d,'pid':_0x15e45a,'sessionId':_0x109f6b!==_0x15e45a[_0xc191b4(0x7c)]()?_0x109f6b:undefined,'updatedAt':new Date()['toISOString']()}:_0x5cf830={'pid':_0x15e45a,'sessionId':_0x109f6b!==_0x15e45a[_0xc191b4(0x7c)]()?_0x109f6b:undefined,..._0x44d98d,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0xc191b4(0x98)]()},a38_0x10485b[_0xc191b4(0x86)](_0x15afb4,JSON[_0xc191b4(0x8f)](_0x5cf830,null,0x2));}export function clearSessionContext(_0x315d48){const _0x26eaac=a38_0x4c89,_0xa1e624=_0x315d48||getCurrentSessionPID()[_0x26eaac(0x7c)](),_0x445779=a38_0x3a2c43[_0x26eaac(0x8a)](getSessionsDir(),_0xa1e624+_0x26eaac(0x9d));a38_0x10485b[_0x26eaac(0x82)](_0x445779)&&a38_0x10485b[_0x26eaac(0x95)](_0x445779);}export function cleanExpiredSessions(){const _0x596866=a38_0x4c89,_0x34e4e1=getSessionsDir();if(!a38_0x10485b[_0x596866(0x82)](_0x34e4e1))return 0x0;let _0xcff8d=0x0;const _0x285254=Date[_0x596866(0x88)]();try{const _0x4a3df4=a38_0x10485b[_0x596866(0x79)](_0x34e4e1);for(const _0x1c4353 of _0x4a3df4){if(!_0x1c4353[_0x596866(0x90)](_0x596866(0x9d)))continue;const _0x1d0cbe=a38_0x3a2c43['join'](_0x34e4e1,_0x1c4353),_0x631cc8=_0x1c4353[_0x596866(0x9e)](_0x596866(0x9d),''),_0x423682=parseInt(_0x631cc8,0xa),_0xbe8b4=!isNaN(_0x423682);if(_0xbe8b4){if(!isProcessRunning(_0x423682)){a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++;continue;}}try{const _0x286c10=a38_0x10485b[_0x596866(0x8c)](_0x1d0cbe,_0x596866(0x94)),_0x5e0229=JSON[_0x596866(0x9c)](_0x286c10),_0x557a0c=new Date(_0x5e0229[_0x596866(0x93)])[_0x596866(0x9b)]();_0x285254-_0x557a0c>SESSION_EXPIRATION_MS&&(a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++);}catch{a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++;}}}catch{}return _0xcff8d;}export function listActiveSessions(){const _0x570b6d=a38_0x4c89,_0x1b6302=getSessionsDir();if(!a38_0x10485b['existsSync'](_0x1b6302))return[];try{const _0x191a3a=a38_0x10485b['readdirSync'](_0x1b6302),_0x4c7f76=[];for(const _0x56e291 of _0x191a3a){if(!_0x56e291['endsWith'](_0x570b6d(0x9d)))continue;const _0x42213d=_0x56e291[_0x570b6d(0x9e)](_0x570b6d(0x9d),''),_0xbd8b7b=parseInt(_0x42213d,0xa);!isNaN(_0xbd8b7b)&&isProcessRunning(_0xbd8b7b)&&_0x4c7f76[_0x570b6d(0x92)](_0xbd8b7b);}return _0x4c7f76[_0x570b6d(0xa0)]((_0x32b98e,_0x45dfbe)=>_0x32b98e-_0x45dfbe);}catch{return[];}}function a38_0x5de9(){const _0x4641ce=['.config','apiKey','650KBtnQv','existsSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','2812OwpMSq','api_key','writeFileSync','88836ylHzRG','now','3368648kaltFx','join','.\x20This\x20is\x20insecure.\x20Removing\x20session.','readFileSync','sessions','TDX_CONFIG_DIR','stringify','endsWith','1IttYPL','push','createdAt','utf-8','unlinkSync','13285wMVjAm','5625081Ozzwyb','toISOString','TD_API_KEY','4464264LcbMZA','getTime','parse','.json','replace','includes','sort','warn','253629cBqPmE','539EjIQaa','readdirSync','test','55767833txBpQm','toString','tdx','homedir'];a38_0x5de9=function(){return _0x4641ce;};return a38_0x5de9();}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x4d15c1,_0x562772){var _0x24d2dd=a39_0x4a5e,_0x452196=_0x4d15c1();while(!![]){try{var _0x141a26=-parseInt(_0x24d2dd(0x153))/0x1*(parseInt(_0x24d2dd(0x150))/0x2)+parseInt(_0x24d2dd(0x14e))/0x3*(-parseInt(_0x24d2dd(0x157))/0x4)+-parseInt(_0x24d2dd(0x154))/0x5*(-parseInt(_0x24d2dd(0x152))/0x6)+parseInt(_0x24d2dd(0x156))/0x7+parseInt(_0x24d2dd(0x151))/0x8+-parseInt(_0x24d2dd(0x158))/0x9*(parseInt(_0x24d2dd(0x155))/0xa)+parseInt(_0x24d2dd(0x159))/0xb*(parseInt(_0x24d2dd(0x14f))/0xc);if(_0x141a26===_0x562772)break;else _0x452196['push'](_0x452196['shift']());}catch(_0x1af662){_0x452196['push'](_0x452196['shift']());}}}(a39_0x9166,0x3f82a));export*from'./types/index.js';function a39_0x4a5e(_0x3e7a2e,_0xc93bd3){var _0x91665d=a39_0x9166();return a39_0x4a5e=function(_0x4a5ee5,_0xfd55e8){_0x4a5ee5=_0x4a5ee5-0x14e;var _0x2edccf=_0x91665d[_0x4a5ee5];return _0x2edccf;},a39_0x4a5e(_0x3e7a2e,_0xc93bd3);}export*from'./core/config.js';export*from'./core/auth.js';export*from'./client/http-client.js';export*from'./client/td-client.js';export{TrinoClient}from'./client/trino-client.js';export*from'./client/rate-limiter.js';export*from'./types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';function a39_0x9166(){var _0x51916a=['1812496hVUbBT','514968kFnpTp','234VlzLMQ','600820mOykkb','9CWrtWI','84EjioZp','2004FcnNAB','1049376JDkJZn','411210jZIval','78mrHOCz','10HCdvej','71150wLuRco'];a39_0x9166=function(){return _0x51916a;};return a39_0x9166();}export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ function a39_0x1b37(){var _0x3224b5=['6pXMkiY','274KGsjiy','28512176cHEmmP','5318978EOsHWc','10722231yJuxRf','1028232mhPUrj','5YHQYTU','9948870hikTgY','1718SzaxPu','7293252UnLEht','8LRJvkh'];a39_0x1b37=function(){return _0x3224b5;};return a39_0x1b37();}(function(_0x50381e,_0x4d5455){var _0x110005=a39_0x5f11,_0x2d7932=_0x50381e();while(!![]){try{var _0x3ed785=parseInt(_0x110005(0x13d))/0x1*(parseInt(_0x110005(0x141))/0x2)+parseInt(_0x110005(0x140))/0x3*(parseInt(_0x110005(0x145))/0x4)+parseInt(_0x110005(0x146))/0x5*(-parseInt(_0x110005(0x13e))/0x6)+parseInt(_0x110005(0x143))/0x7+parseInt(_0x110005(0x13f))/0x8*(-parseInt(_0x110005(0x144))/0x9)+-parseInt(_0x110005(0x13c))/0xa+parseInt(_0x110005(0x142))/0xb;if(_0x3ed785===_0x4d5455)break;else _0x2d7932['push'](_0x2d7932['shift']());}catch(_0x3dc4bf){_0x2d7932['push'](_0x2d7932['shift']());}}}(a39_0x1b37,0xaacac));export*from'./types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./client/http-client.js';export*from'./client/td-client.js';export{TrinoClient}from'./client/trino-client.js';export*from'./client/rate-limiter.js';export*from'./types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';function a39_0x5f11(_0x1fe488,_0x51a1c6){var _0x1b372a=a39_0x1b37();return a39_0x5f11=function(_0x5f117f,_0x2f016a){_0x5f117f=_0x5f117f-0x13c;var _0x25474e=_0x1b372a[_0x5f117f];return _0x25474e;},a39_0x5f11(_0x1fe488,_0x51a1c6);}export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';