@treasuredata/tdx 0.1.15 → 0.1.17

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 (85) hide show
  1. package/README.md +10 -0
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-client.js +1 -1
  9. package/dist/client/trino-client.js +1 -1
  10. package/dist/client/workflow-client.js +1 -1
  11. package/dist/commands/activations.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/llm-command.js +1 -1
  22. package/dist/commands/llm-proxy.js +1 -1
  23. package/dist/commands/parent-segment-command.js +1 -1
  24. package/dist/commands/profiles-command.js +1 -1
  25. package/dist/commands/query-command.js +1 -1
  26. package/dist/commands/segment-command.js +1 -1
  27. package/dist/commands/segment-create-command.js +1 -1
  28. package/dist/commands/segment-fields-command.js +1 -1
  29. package/dist/commands/segment-pwd-command.js +1 -1
  30. package/dist/commands/segment-update-command.js +1 -1
  31. package/dist/commands/segment-use-command.js +1 -1
  32. package/dist/commands/segments.js +1 -1
  33. package/dist/commands/show.js +1 -1
  34. package/dist/commands/tables.js +1 -1
  35. package/dist/commands/use-command.js +1 -1
  36. package/dist/commands/workflow-command.js +1 -1
  37. package/dist/core/auth.js +1 -1
  38. package/dist/core/config.js +1 -1
  39. package/dist/core/global-context.js +1 -1
  40. package/dist/core/profile.js +1 -1
  41. package/dist/core/project-config.js +1 -1
  42. package/dist/core/session.js +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/proxy/anthropic-adapter.d.ts +21 -2
  45. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  46. package/dist/proxy/anthropic-adapter.js +1 -1
  47. package/dist/proxy/anthropic-adapter.js.map +1 -1
  48. package/dist/proxy/server.d.ts.map +1 -1
  49. package/dist/proxy/server.js +1 -1
  50. package/dist/proxy/server.js.map +1 -1
  51. package/dist/sdk/api.js +1 -1
  52. package/dist/sdk/database.js +1 -1
  53. package/dist/sdk/errors.js +1 -1
  54. package/dist/sdk/index.js +1 -1
  55. package/dist/sdk/job.js +1 -1
  56. package/dist/sdk/llm.js +1 -1
  57. package/dist/sdk/query.js +1 -1
  58. package/dist/sdk/segment.js +1 -1
  59. package/dist/sdk/table.js +1 -1
  60. package/dist/sdk/workflow.js +1 -1
  61. package/dist/types/endpoints.js +1 -1
  62. package/dist/types/index.js +1 -1
  63. package/dist/utils/agent-ref-parser.js +1 -1
  64. package/dist/utils/chat-cache.js +1 -1
  65. package/dist/utils/colors.js +1 -1
  66. package/dist/utils/command-output.js +1 -1
  67. package/dist/utils/file-permissions.js +1 -1
  68. package/dist/utils/format-detector.js +1 -1
  69. package/dist/utils/formatters.js +1 -1
  70. package/dist/utils/json-loader.js +1 -1
  71. package/dist/utils/model-aliases.js +1 -1
  72. package/dist/utils/option-validation.js +1 -1
  73. package/dist/utils/port.js +1 -1
  74. package/dist/utils/process.js +1 -1
  75. package/dist/utils/prompt.js +1 -1
  76. package/dist/utils/segment-path-parser.js +1 -1
  77. package/dist/utils/segment-ref-parser.js +1 -1
  78. package/dist/utils/spinner.js +1 -1
  79. package/dist/utils/sql-parser.js +1 -1
  80. package/dist/utils/sse-parser.js +1 -1
  81. package/dist/utils/string-utils.js +1 -1
  82. package/dist/utils/table-ref-parser.js +1 -1
  83. package/dist/utils/tree-formatter.js +1 -1
  84. package/dist/utils/workflow-utils.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- const a32_0x1beda1=a32_0x3086;(function(_0x2fd3cc,_0x526b3f){const _0x5ba895=a32_0x3086,_0x2f9f75=_0x2fd3cc();while(!![]){try{const _0x3eb4b4=parseInt(_0x5ba895(0xa5))/0x1+-parseInt(_0x5ba895(0x89))/0x2+parseInt(_0x5ba895(0xdd))/0x3+parseInt(_0x5ba895(0xfd))/0x4*(parseInt(_0x5ba895(0xb8))/0x5)+-parseInt(_0x5ba895(0xe9))/0x6+parseInt(_0x5ba895(0x97))/0x7*(-parseInt(_0x5ba895(0xe2))/0x8)+parseInt(_0x5ba895(0xf8))/0x9;if(_0x3eb4b4===_0x526b3f)break;else _0x2f9f75['push'](_0x2f9f75['shift']());}catch(_0x36aad4){_0x2f9f75['push'](_0x2f9f75['shift']());}}}(a32_0x1186,0x532d3));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_0x1beda1(0x92)]='workflow:projects';['description']=a32_0x1beda1(0x8b);async['execute'](_0x1a95db){const _0x245293=a32_0x1beda1,{options:_0x5b7c39,args:_0x29b04a,tdx:_0x172190}=_0x1a95db,_0x10a886=_0x29b04a[0x0];try{_0x5b7c39[_0x245293(0xa2)]&&_0x10a886&&console[_0x245293(0xba)]('Pattern:\x20'+_0x10a886);const _0xa905f7=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x172190[_0x245293(0xcc)]['projects'](_0x10a886,{'limit':_0x5b7c39[_0x245293(0xaa)]}),{'verbose':_0x5b7c39[_0x245293(0xa2)]}),_0x57fc43=_0xa905f7[_0x245293(0xdf)];return console[_0x245293(0xba)]('✔\x20Found\x20'+_0x57fc43['length']+'\x20project'+(_0x57fc43[_0x245293(0xa7)]!==0x1?'s':'')),await handleSDKOutput(_0x57fc43,_0x5b7c39),0x0;}catch(_0x32ef27){if(_0x32ef27 instanceof SDKError)return console[_0x245293(0xba)]('Error:\x20'+_0x32ef27[_0x245293(0xe0)]),_0x32ef27['cause']&&console[_0x245293(0xba)](_0x245293(0xaf)+_0x32ef27[_0x245293(0xd6)]),0x1;throw _0x32ef27;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0x96);['description']='List\x20workflows';async['execute'](_0x4cc66a){const _0x4a261b=a32_0x1beda1,{options:_0x15ac58,args:_0x88dab3,tdx:_0x51b37a}=_0x4cc66a,_0x1dd055=_0x88dab3[0x0];try{_0x15ac58['verbose']&&_0x1dd055&&console[_0x4a261b(0xba)]('Project\x20filter:\x20'+_0x1dd055);const _0xde1583=await withSpinner(_0x4a261b(0xd4),()=>_0x51b37a[_0x4a261b(0xcc)][_0x4a261b(0xe5)](_0x1dd055,{'limit':_0x15ac58[_0x4a261b(0xaa)]}),{'verbose':_0x15ac58[_0x4a261b(0xa2)]}),_0x390e68=_0xde1583['data'];return console[_0x4a261b(0xba)](_0x4a261b(0xde)+_0x390e68['length']+_0x4a261b(0xdc)+(_0x390e68[_0x4a261b(0xa7)]!==0x1?'s':'')),await handleSDKOutput(_0x390e68,_0x15ac58),0x0;}catch(_0x4f4078){if(_0x4f4078 instanceof SDKError)return console[_0x4a261b(0xba)](_0x4a261b(0xe8)+_0x4f4078[_0x4a261b(0xe0)]),_0x4f4078[_0x4a261b(0xd6)]&&console[_0x4a261b(0xba)](_0x4a261b(0xaf)+_0x4f4078[_0x4a261b(0xd6)]),0x1;throw _0x4f4078;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x1beda1(0x92)]='workflow:sessions';[a32_0x1beda1(0xff)]='List\x20workflow\x20execution\x20sessions';async[a32_0x1beda1(0x84)](_0x576087){const _0x2c4c9c=a32_0x1beda1,{options:_0x65c073,args:_0x204f70,tdx:_0x23144d}=_0x576087;let _0x4b10d6,_0x567f9a;if(_0x204f70[0x0]){const _0x5e5dcb=_0x204f70[0x0][_0x2c4c9c(0x94)]('.');if(_0x5e5dcb[_0x2c4c9c(0xa7)]===0x1)_0x4b10d6=_0x5e5dcb[0x0];else{if(_0x5e5dcb[_0x2c4c9c(0xa7)]===0x2)[_0x4b10d6,_0x567f9a]=_0x5e5dcb;else return console[_0x2c4c9c(0xba)](_0x2c4c9c(0xc4)),0x1;}}try{if(_0x65c073[_0x2c4c9c(0xa2)]){if(_0x4b10d6&&_0x567f9a)console[_0x2c4c9c(0xba)](_0x2c4c9c(0x90)+_0x4b10d6+'.'+_0x567f9a);else _0x4b10d6&&console[_0x2c4c9c(0xba)](_0x2c4c9c(0x87)+_0x4b10d6);const _0x3a0777=_0x65c073[_0x2c4c9c(0xc2)];_0x3a0777&&console[_0x2c4c9c(0xba)](_0x2c4c9c(0xf5)+_0x3a0777);}const _0x2d9dc9=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x23144d[_0x2c4c9c(0xcc)][_0x2c4c9c(0x8c)]({'projectName':_0x4b10d6,'workflowName':_0x567f9a,'status':_0x65c073[_0x2c4c9c(0xc2)],'fromTime':_0x65c073[_0x2c4c9c(0xb9)],'toTime':_0x65c073['to'],'limit':_0x65c073[_0x2c4c9c(0xaa)]}),{'verbose':_0x65c073[_0x2c4c9c(0xa2)]}),_0x14ea06=_0x2d9dc9['data'];return console[_0x2c4c9c(0xba)](_0x2c4c9c(0xde)+_0x14ea06[_0x2c4c9c(0xa7)]+_0x2c4c9c(0xd9)+(_0x14ea06['length']!==0x1?'s':'')),await handleSDKOutput(_0x14ea06,_0x65c073),0x0;}catch(_0x2cfd68){if(_0x2cfd68 instanceof SDKError)return console[_0x2c4c9c(0xba)]('Error:\x20'+_0x2cfd68['message']),_0x2cfd68[_0x2c4c9c(0xd6)]&&console['error']('\x20\x20Cause:\x20'+_0x2cfd68[_0x2c4c9c(0xd6)]),0x1;throw _0x2cfd68;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xed);['description']=a32_0x1beda1(0xf0);async[a32_0x1beda1(0x84)](_0x1bffeb){const _0xb71afd=a32_0x1beda1,{options:_0x16a6d7,args:_0x5e5650,tdx:_0x96937a}=_0x1bffeb;let _0x2c2b19,_0x2da148;if(_0x5e5650[0x0]){const _0x169d45=_0x5e5650[0x0][_0xb71afd(0x94)]('.');if(_0x169d45[_0xb71afd(0xa7)]===0x1)_0x2c2b19=_0x169d45[0x0];else{if(_0x169d45[_0xb71afd(0xa7)]===0x2)[_0x2c2b19,_0x2da148]=_0x169d45;else return console[_0xb71afd(0xba)](_0xb71afd(0xc4)),0x1;}}try{const _0x372dd5=_0x16a6d7['includeRetried'];if(_0x16a6d7[_0xb71afd(0xa2)]){if(_0x2c2b19&&_0x2da148)console[_0xb71afd(0xba)](_0xb71afd(0x90)+_0x2c2b19+'.'+_0x2da148);else _0x2c2b19&&console[_0xb71afd(0xba)](_0xb71afd(0x87)+_0x2c2b19);_0x372dd5&&console[_0xb71afd(0xba)](_0xb71afd(0xc7));}const _0x2787a9=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x96937a[_0xb71afd(0xcc)]['attempts']({'projectName':_0x2c2b19,'workflowName':_0x2da148,'includeRetried':_0x372dd5,'limit':_0x16a6d7[_0xb71afd(0xaa)]}),{'verbose':_0x16a6d7[_0xb71afd(0xa2)]}),_0x55189c=_0x2787a9['data'];return console[_0xb71afd(0xba)](_0xb71afd(0xde)+_0x55189c[_0xb71afd(0xa7)]+'\x20attempt'+(_0x55189c['length']!==0x1?'s':'')),await handleSDKOutput(_0x55189c,_0x16a6d7),0x0;}catch(_0xedb67a){if(_0xedb67a instanceof SDKError)return console['error']('Error:\x20'+_0xedb67a[_0xb71afd(0xe0)]),_0xedb67a[_0xb71afd(0xd6)]&&console[_0xb71afd(0xba)](_0xb71afd(0xaf)+_0xedb67a[_0xb71afd(0xd6)]),0x1;throw _0xedb67a;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a32_0x1beda1(0xea);[a32_0x1beda1(0xff)]='Show\x20specific\x20attempt\x20details';async[a32_0x1beda1(0x84)](_0x3930bd){const _0x59c8ef=a32_0x1beda1,{options:_0x4b3b41,args:_0x3aa951,tdx:_0x59837d}=_0x3930bd,_0x59e934=_0x3aa951[0x0];if(!_0x59e934)return console[_0x59c8ef(0xba)](_0x59c8ef(0x91)),0x1;try{_0x4b3b41[_0x59c8ef(0xa2)]&&console[_0x59c8ef(0xba)](_0x59c8ef(0xbe)+_0x59e934);const _0x2b1053=await withSpinner(_0x59c8ef(0xca),()=>_0x59837d['workflow']['attempt'](_0x59e934),{'verbose':_0x4b3b41[_0x59c8ef(0xa2)]}),_0x70bfa9=_0x2b1053[_0x59c8ef(0xdf)];return await handleSDKOutput([_0x70bfa9],_0x4b3b41),0x0;}catch(_0x1c572e){if(_0x1c572e instanceof SDKError)return console[_0x59c8ef(0xba)](_0x59c8ef(0xe8)+_0x1c572e[_0x59c8ef(0xe0)]),_0x1c572e['cause']&&console[_0x59c8ef(0xba)](_0x59c8ef(0xaf)+_0x1c572e[_0x59c8ef(0xd6)]),0x1;throw _0x1c572e;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a32_0x1beda1(0xff)]=a32_0x1beda1(0x88);async['execute'](_0x2ee953){const _0x5ca35a=a32_0x1beda1,{options:_0x393601,args:_0x2e7d6f,tdx:_0x32d91d}=_0x2ee953,_0x49ca40=_0x2e7d6f[0x0];if(!_0x49ca40)return console[_0x5ca35a(0xba)](_0x5ca35a(0x91)),0x1;try{const _0x227e96=_0x393601[_0x5ca35a(0xfc)];_0x393601[_0x5ca35a(0xa2)]&&(console[_0x5ca35a(0xba)](_0x5ca35a(0xbe)+_0x49ca40),_0x227e96&&console[_0x5ca35a(0xba)](_0x5ca35a(0xa8)));const _0x5c0b18=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x32d91d[_0x5ca35a(0xcc)][_0x5ca35a(0x86)](_0x49ca40,_0x227e96||![]),{'verbose':_0x393601['verbose']}),_0x5b2c4c=_0x5c0b18[_0x5ca35a(0xdf)];return console[_0x5ca35a(0xba)](_0x5ca35a(0xde)+_0x5b2c4c[_0x5ca35a(0xa7)]+'\x20task'+(_0x5b2c4c[_0x5ca35a(0xa7)]!==0x1?'s':'')),await handleSDKOutput(_0x5b2c4c,_0x393601),0x0;}catch(_0x2db4b2){if(_0x2db4b2 instanceof SDKError)return console['error'](_0x5ca35a(0xe8)+_0x2db4b2[_0x5ca35a(0xe0)]),_0x2db4b2[_0x5ca35a(0xd6)]&&console[_0x5ca35a(0xba)]('\x20\x20Cause:\x20'+_0x2db4b2[_0x5ca35a(0xd6)]),0x1;throw _0x2db4b2;}}}function a32_0x3086(_0x841e55,_0x5dd4d2){const _0x118661=a32_0x1186();return a32_0x3086=function(_0x3086a0,_0x24863f){_0x3086a0=_0x3086a0-0x83;let _0x7268b2=_0x118661[_0x3086a0];return _0x7268b2;},a32_0x3086(_0x841e55,_0x5dd4d2);}export class WorkflowLogsCommand extends BaseCommand{[a32_0x1beda1(0x92)]='workflow:logs';[a32_0x1beda1(0xff)]=a32_0x1beda1(0xf3);async[a32_0x1beda1(0x84)](_0x4cb8b1){const _0x2e26c3=a32_0x1beda1,{options:_0x2e647e,args:_0x486f36,tdx:_0x57320f}=_0x4cb8b1,_0x3cc726=_0x486f36[0x0],_0x27b6a8=_0x486f36[0x1];if(!_0x3cc726||!_0x27b6a8)return console[_0x2e26c3(0xba)](_0x2e26c3(0xc8)),0x1;try{_0x2e647e[_0x2e26c3(0xa2)]&&(console[_0x2e26c3(0xba)](_0x2e26c3(0xbe)+_0x3cc726),console['error'](_0x2e26c3(0x99)+_0x27b6a8));const _0x3c6090=_0x2e647e[_0x2e26c3(0x98)],_0x4f5db2=await withSpinner(_0x2e26c3(0xac),()=>_0x57320f[_0x2e26c3(0xcc)][_0x2e26c3(0x95)](_0x3cc726,_0x27b6a8,{'offset':_0x3c6090,'limit':_0x2e647e[_0x2e26c3(0xaa)]}),{'verbose':_0x2e647e['verbose']}),_0x1bb2b6=_0x4f5db2[_0x2e26c3(0xdf)];return console[_0x2e26c3(0xba)](_0x2e26c3(0xde)+_0x1bb2b6[_0x2e26c3(0xa7)]+'\x20log\x20entr'+(_0x1bb2b6[_0x2e26c3(0xa7)]!==0x1?_0x2e26c3(0xce):'y')),await handleSDKOutput(_0x1bb2b6,_0x2e647e),0x0;}catch(_0x80c2ac){if(_0x80c2ac instanceof SDKError)return console['error']('Error:\x20'+_0x80c2ac[_0x2e26c3(0xe0)]),_0x80c2ac['cause']&&console[_0x2e26c3(0xba)](_0x2e26c3(0xaf)+_0x80c2ac[_0x2e26c3(0xd6)]),0x1;throw _0x80c2ac;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xc0);[a32_0x1beda1(0xff)]=a32_0x1beda1(0x8a);async[a32_0x1beda1(0x84)](_0x3a7e7f){const _0x266adf=a32_0x1beda1,{options:_0x483c8d,args:_0x12dc95,tdx:_0x1cd750}=_0x3a7e7f,_0x538e1d=_0x12dc95[0x0];if(!_0x538e1d)return console[_0x266adf(0xba)](_0x266adf(0x91)),0x1;try{const _0x1a3c15=_0x483c8d[_0x266adf(0xb3)];_0x483c8d['verbose']&&(console[_0x266adf(0xba)](_0x266adf(0xbe)+_0x538e1d),_0x1a3c15&&console['error']('Reason:\x20'+_0x1a3c15));if(!_0x483c8d[_0x266adf(0xe6)]){const _0x307432=await confirm(_0x266adf(0xc3)+_0x538e1d+'?');if(!_0x307432)return console[_0x266adf(0xba)](_0x266adf(0xcf)),0x0;}const _0x2033dd=await withSpinner(_0x266adf(0xe7),()=>_0x1cd750[_0x266adf(0xcc)]['kill'](_0x538e1d,_0x1a3c15),{'verbose':_0x483c8d[_0x266adf(0xa2)]}),_0xcc4b81=_0x2033dd['data'];return console['error']('✔\x20'+_0xcc4b81),0x0;}catch(_0x1edf34){if(_0x1edf34 instanceof SDKError)return console[_0x266adf(0xba)](_0x266adf(0xe8)+_0x1edf34[_0x266adf(0xe0)]),_0x1edf34[_0x266adf(0xd6)]&&console[_0x266adf(0xba)]('\x20\x20Cause:\x20'+_0x1edf34['cause']),0x1;throw _0x1edf34;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xb7);[a32_0x1beda1(0xff)]=a32_0x1beda1(0xae);async['execute'](_0x128cd2){const _0x4a1b7a=a32_0x1beda1,{options:_0x5b58cd,args:_0x29bba2,tdx:_0x34d5e9}=_0x128cd2,_0x3cf964=_0x29bba2[0x0];if(!_0x3cf964)return console[_0x4a1b7a(0xba)](_0x4a1b7a(0xe4)),console[_0x4a1b7a(0xba)](_0x4a1b7a(0x8d)),0x1;let _0x1d7c29=![],_0x5273af=_0x3cf964;if(_0x3cf964['startsWith'](_0x4a1b7a(0xbc)))_0x1d7c29=!![],_0x5273af=_0x3cf964[_0x4a1b7a(0xa1)](0x8);else{if(_0x3cf964[_0x4a1b7a(0xd5)](_0x4a1b7a(0x85)))_0x1d7c29=![],_0x5273af=_0x3cf964[_0x4a1b7a(0xa1)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x4a1b7a(0xba)](_0x4a1b7a(0x8d)),0x1;}try{const _0x325724=_0x5b58cd[_0x4a1b7a(0xdb)],_0xcf05bb=_0x5b58cd[_0x4a1b7a(0xc6)],_0x4a9b55=_0x5b58cd[_0x4a1b7a(0xef)],_0x37d19b=_0x5b58cd['force'];_0x5b58cd[_0x4a1b7a(0xa2)]&&(console[_0x4a1b7a(0xba)](_0x4a1b7a(0xa9)+(_0x1d7c29?_0x4a1b7a(0xb6):_0x4a1b7a(0x83))+'\x20'+_0x5273af),_0x325724&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xb5)+_0x325724),_0xcf05bb&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xa3)+_0xcf05bb),_0x4a9b55&&console['error']('Params:\x20'+_0x4a9b55),_0x37d19b&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xfa)));let _0x598591;if(_0x4a9b55)try{if(_0x4a9b55[_0x4a1b7a(0xd5)]('@')){const _0x2df587=await import(_0x4a1b7a(0xf6)),_0x41de86=_0x4a9b55['substring'](0x1),_0x217380=await _0x2df587[_0x4a1b7a(0x8f)](_0x41de86,_0x4a1b7a(0xbb));_0x598591=JSON[_0x4a1b7a(0xd0)](_0x217380);}else _0x598591=JSON['parse'](_0x4a9b55);}catch{return console[_0x4a1b7a(0xba)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x5b58cd[_0x4a1b7a(0xe6)]){const _0x476458=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x1d7c29?_0x4a1b7a(0xb6):'attempt')+'\x20'+_0x5273af+'?');if(!_0x476458)return console[_0x4a1b7a(0xba)](_0x4a1b7a(0xcf)),0x0;}let _0x268694;_0x1d7c29?_0x268694=await withSpinner(_0x4a1b7a(0x9f),()=>_0x34d5e9[_0x4a1b7a(0xcc)][_0x4a1b7a(0x93)](_0x5273af,{'fromTask':_0x325724,'retryParams':_0x598591}),{'verbose':_0x5b58cd[_0x4a1b7a(0xa2)]}):_0x268694=await withSpinner(_0x4a1b7a(0xda),()=>_0x34d5e9['workflow'][_0x4a1b7a(0x9c)](_0x5273af,{'resumeFrom':_0xcf05bb,'retryParams':_0x598591,'force':_0x37d19b}),{'verbose':_0x5b58cd['verbose']});const _0x2ed374=_0x268694[_0x4a1b7a(0xdf)];return console['error'](_0x4a1b7a(0xeb)),console[_0x4a1b7a(0xba)](_0x4a1b7a(0xfe)+_0x2ed374[_0x4a1b7a(0x9a)]),console['error'](_0x4a1b7a(0xb0)+_0x2ed374[_0x4a1b7a(0xd2)]),0x0;}catch(_0x201d86){if(_0x201d86 instanceof SDKError)return console[_0x4a1b7a(0xba)](_0x4a1b7a(0xe8)+_0x201d86[_0x4a1b7a(0xe0)]),_0x201d86['cause']&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xaf)+_0x201d86[_0x4a1b7a(0xd6)]),0x1;throw _0x201d86;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xab);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x1beda1(0x84)](_0x109b12){const _0x3b7288=a32_0x1beda1,{options:_0x3d4b5e,args:_0x43bc44,tdx:_0x44e541}=_0x109b12,_0x5653d8=_0x43bc44[0x0],_0x33f3d9=_0x43bc44[0x1]||'.';if(!_0x5653d8)return console['error'](_0x3b7288(0x9d)),console[_0x3b7288(0xba)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x5d5442=_0x3d4b5e[_0x3b7288(0xf2)];_0x3d4b5e[_0x3b7288(0xa2)]&&(console[_0x3b7288(0xba)](_0x3b7288(0xad)+_0x5653d8),console['error'](_0x3b7288(0xb1)+_0x33f3d9),_0x5d5442&&console[_0x3b7288(0xba)](_0x3b7288(0xc5)+_0x5d5442));const _0x227799=await withSpinner(_0x3b7288(0xf4)+_0x5653d8+_0x3b7288(0xb4),()=>_0x44e541[_0x3b7288(0xcc)][_0x3b7288(0x9b)](_0x5653d8,_0x33f3d9,{'revision':_0x5d5442}),{'verbose':_0x3d4b5e['verbose']}),_0x51655b=_0x227799[_0x3b7288(0xdf)];return console['error'](_0x3b7288(0xd7)+_0x51655b[_0x3b7288(0xbf)]),console['error']('\x20\x20Revision:\x20'+_0x51655b[_0x3b7288(0xf2)]),console[_0x3b7288(0xba)](_0x3b7288(0xc9)+_0x51655b[_0x3b7288(0x8e)]),console[_0x3b7288(0xba)](_0x3b7288(0xee)+_0x33f3d9+'/'+_0x51655b[_0x3b7288(0xbf)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a32_0x1beda1(0xf1);['description']=a32_0x1beda1(0xe3);async[a32_0x1beda1(0x84)](_0x526942){const _0x500ee8=a32_0x1beda1,{options:_0x144368,args:_0x338346,tdx:_0x913bd7}=_0x526942;let _0x2de593='.',_0x225409=_0x144368['name'];if(_0x338346[0x0]){const {promises:_0x20d5bd}=await import('fs');try{const _0x1c58a6=await _0x20d5bd[_0x500ee8(0xa4)](_0x338346[0x0]);if(_0x1c58a6[_0x500ee8(0xf9)]())_0x2de593=_0x338346[0x0];else return console[_0x500ee8(0xba)](_0x500ee8(0xe8)+_0x338346[0x0]+_0x500ee8(0xd8)),0x1;}catch{_0x225409=_0x338346[0x0],_0x2de593='.';}}const _0x5bc5fd=_0x144368[_0x500ee8(0xf2)],_0x2cfc1d=_0x144368[_0x500ee8(0xb2)];_0x144368[_0x500ee8(0xa2)]&&(console[_0x500ee8(0xba)]('Project\x20directory:\x20'+_0x2de593),_0x225409&&console['error']('Project\x20name:\x20'+_0x225409),_0x5bc5fd&&console[_0x500ee8(0xba)](_0x500ee8(0xc5)+_0x5bc5fd),_0x2cfc1d&&console[_0x500ee8(0xba)](_0x500ee8(0xa6)));const _0x9389da=await withSpinner(_0x500ee8(0xcb),()=>_0x913bd7[_0x500ee8(0xcc)][_0x500ee8(0xfb)](_0x2de593,{'projectName':_0x225409,'revision':_0x5bc5fd,'skipValidation':_0x2cfc1d}),{'verbose':_0x144368[_0x500ee8(0xa2)]}),_0x3e2393=_0x9389da['data'];return console[_0x500ee8(0xba)]('✔\x20Pushed\x20'+_0x3e2393[_0x500ee8(0xbf)]),console[_0x500ee8(0xba)](_0x500ee8(0xc1)+_0x3e2393[_0x500ee8(0xec)]),console[_0x500ee8(0xba)](_0x500ee8(0x9e)+_0x3e2393[_0x500ee8(0xf2)]),0x0;}}function a32_0x1186(){const _0x289ccc=['name','retrySession','split','logs','workflow:workflows','406tZGsib','offset','Task\x20name:\x20','attemptId','download','retryAttempt','Error:\x20Project\x20name\x20is\x20required','\x20\x20Revision:\x20','Retrying\x20session...','\x22?\x20This\x20cannot\x20be\x20undone.','substring','verbose','Resume\x20from:\x20','stat','637603pakcIg','Validation:\x20skipped','length','Including\x20subtasks:\x20yes','Target:\x20','limit','workflow:download','Getting\x20task\x20logs...','Project:\x20','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Cause:\x20','\x20\x20Session\x20ID:\x20','Output\x20directory:\x20','skipValidation','reason','...','From\x20task:\x20','session','workflow:retry','5ZItKrn','from','error','utf-8','session:','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Attempt\x20ID:\x20','projectName','workflow:kill','\x20\x20Project\x20ID:\x20','status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Revision:\x20','resumeFrom','Include\x20retried:\x20yes','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','\x20\x20Files\x20extracted:\x20','Getting\x20attempt\x20details...','Pushing\x20workflow\x20project...','workflow','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','ies','Cancelled','parse','workflow:delete','sessionId','Usage:\x20workflow:delete\x20<project-name-or-id>','Listing\x20workflows...','startsWith','cause','✔\x20Downloaded\x20','\x20is\x20not\x20a\x20directory','\x20session','Retrying\x20attempt...','fromTask','\x20workflow','918945NGkHTe','✔\x20Found\x20','data','message','Deleting\x20project\x20','13880sYOwMq','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflows','yes','Killing\x20attempt...','Error:\x20','3988194kQXhjo','workflow:attempt','✔\x20Retry\x20started','projectId','workflow:attempts','\x20\x20Location:\x20','params','List\x20workflow\x20attempts','workflow:push','revision','Show\x20logs\x20for\x20a\x20specific\x20task','Downloading\x20project\x20','Status:\x20','fs/promises','✔\x20Deleted\x20project\x20','1060794LkPgOH','isDirectory','Force:\x20yes','push','includeSubtasks','1747304sOKdGK','\x20\x20New\x20attempt\x20ID:\x20','description','attempt','execute','attempt:','tasks','Filter:\x20project=','Show\x20tasks\x20for\x20an\x20attempt','785180wjkATu','Kill\x20a\x20running\x20attempt','List\x20all\x20workflow\x20projects','sessions','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','filesExtracted','readFile','Filter:\x20','Error:\x20Attempt\x20ID\x20is\x20required'];a32_0x1186=function(){return _0x289ccc;};return a32_0x1186();}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xd1);[a32_0x1beda1(0xff)]=a32_0x1beda1(0xbd);async[a32_0x1beda1(0x84)](_0x21bb06){const _0x10e76c=a32_0x1beda1,{options:_0x4a45e0,args:_0x52c63f,tdx:_0x10bbca}=_0x21bb06,_0x2b7082=_0x52c63f[0x0];if(!_0x2b7082)return console[_0x10e76c(0xba)](_0x10e76c(0xcd)),console[_0x10e76c(0xba)](_0x10e76c(0xd3)),0x1;_0x4a45e0[_0x10e76c(0xa2)]&&console[_0x10e76c(0xba)](_0x10e76c(0xad)+_0x2b7082);if(!_0x4a45e0[_0x10e76c(0xe6)]){const _0x500162=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2b7082+_0x10e76c(0xa0));if(!_0x500162)return console[_0x10e76c(0xba)]('Cancelled'),0x0;}const _0x1f7922=await withSpinner(_0x10e76c(0xe1)+_0x2b7082+_0x10e76c(0xb4),()=>_0x10bbca['workflow']['delete'](_0x2b7082),{'verbose':_0x4a45e0[_0x10e76c(0xa2)]}),_0x915d0d=_0x1f7922[_0x10e76c(0xdf)];return console[_0x10e76c(0xba)](_0x10e76c(0xf7)+_0x915d0d['projectName']),console[_0x10e76c(0xba)](_0x10e76c(0xc1)+_0x915d0d[_0x10e76c(0xec)]),0x0;}}
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();}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x4987bc,_0x5072a2){const _0x1ae149=a33_0x5e88,_0x4da669=_0x4987bc();while(!![]){try{const _0x4ff33d=-parseInt(_0x1ae149(0xd0))/0x1*(-parseInt(_0x1ae149(0xcb))/0x2)+-parseInt(_0x1ae149(0xd6))/0x3*(parseInt(_0x1ae149(0xc6))/0x4)+-parseInt(_0x1ae149(0xc7))/0x5*(-parseInt(_0x1ae149(0xca))/0x6)+parseInt(_0x1ae149(0xc0))/0x7+-parseInt(_0x1ae149(0xc3))/0x8*(-parseInt(_0x1ae149(0xc9))/0x9)+-parseInt(_0x1ae149(0xd5))/0xa*(-parseInt(_0x1ae149(0xd3))/0xb)+-parseInt(_0x1ae149(0xd2))/0xc;if(_0x4ff33d===_0x5072a2)break;else _0x4da669['push'](_0x4da669['shift']());}catch(_0x45b394){_0x4da669['push'](_0x4da669['shift']());}}}(a33_0x54d2,0x1f026));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a33_0x54d2(){const _0x2d6ca6=['2QhcYaJ','tdx','TD1\x20','../../package.json','entries','61518zJUDBW','replace','6315264lvKDKF','359194vraEvM','length','10deMkXN','633qXTuIz','X-Trino-User','1546741MvFexv','parse','utf-8','40CIeJxC','version','Authorization','888MVZQNz','5Qbuggv','url','239787NShDaj','1510668KIExaT'];a33_0x54d2=function(){return _0x2d6ca6;};return a33_0x54d2();}import{getAPIKey}from'./config.js';export function getVersion(){const _0x5f074a=a33_0x5e88;try{const _0x58ddd3=fileURLToPath(import.meta[_0x5f074a(0xc8)]),_0x7dc0fa=dirname(_0x58ddd3),_0x1ae5db=join(_0x7dc0fa,_0x5f074a(0xce)),_0x5312d3=JSON[_0x5f074a(0xc1)](readFileSync(_0x1ae5db,_0x5f074a(0xc2)));return _0x5312d3['version'];}catch{return'0.0.0';}}function a33_0x5e88(_0x29dd1f,_0x7e97){const _0x54d261=a33_0x54d2();return a33_0x5e88=function(_0x5e8866,_0x15fcf3){_0x5e8866=_0x5e8866-0xbf;let _0x170738=_0x54d261[_0x5e8866];return _0x170738;},a33_0x5e88(_0x29dd1f,_0x7e97);}export function getUserAgent(){const _0x69223b=a33_0x5e88,_0x2d445a=getVersion(),_0x1b3a87=platform(),_0x1d14d5=process[_0x69223b(0xc4)][_0x69223b(0xd1)]('v','');return'tdx/'+_0x2d445a+'\x20('+_0x1b3a87+';\x20node/'+_0x1d14d5+')';}export function getAuthHeaders(_0x553238,_0x3671a5){const _0xb35b98=a33_0x5e88,_0x37a9e6=getVersion(),_0x552ae6={'User-Agent':getUserAgent(),'X-TD-Client':_0xb35b98(0xcc),'X-TD-Client-Version':_0x37a9e6};return _0x3671a5&&(_0x552ae6['Authorization']=_0xb35b98(0xcd)+_0x3671a5),_0x552ae6;}export function toHeaderRecord(_0x57106a){const _0x1d0d74=a33_0x5e88,_0x735bc8={};for(const [_0x81e25e,_0x2a70c5]of Object[_0x1d0d74(0xcf)](_0x57106a)){_0x2a70c5!==undefined&&(_0x735bc8[_0x81e25e]=_0x2a70c5);}return _0x735bc8;}export function getTrinoHeaders(_0x3280bd,_0x893b5b){const _0x362aa0=a33_0x5e88,_0x501a0c=getAuthHeaders(_0x3280bd,_0x893b5b),_0x2e1bac=toHeaderRecord(_0x501a0c);return delete _0x2e1bac[_0x362aa0(0xc5)],_0x893b5b&&(_0x2e1bac[_0x362aa0(0xbf)]=_0x893b5b),_0x2e1bac;}export function hasAPIKey(_0xeec7){const _0x5b20fc=a33_0x5e88,_0x32e5fd=getAPIKey(_0xeec7);return _0x32e5fd!==undefined&&_0x32e5fd[_0x5b20fc(0xd4)]>0x0;}
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 +1 @@
1
- (function(_0x4ce0f7,_0x1040b7){const _0x4df924=a34_0x1044,_0x37ff33=_0x4ce0f7();while(!![]){try{const _0x304d57=parseInt(_0x4df924(0xdd))/0x1+-parseInt(_0x4df924(0xcb))/0x2+-parseInt(_0x4df924(0xc9))/0x3*(-parseInt(_0x4df924(0xc7))/0x4)+-parseInt(_0x4df924(0xe1))/0x5*(parseInt(_0x4df924(0xbe))/0x6)+parseInt(_0x4df924(0xd8))/0x7*(parseInt(_0x4df924(0xb1))/0x8)+parseInt(_0x4df924(0xd7))/0x9+-parseInt(_0x4df924(0xce))/0xa*(-parseInt(_0x4df924(0xe2))/0xb);if(_0x304d57===_0x1040b7)break;else _0x37ff33['push'](_0x37ff33['shift']());}catch(_0x1e1c9e){_0x37ff33['push'](_0x37ff33['shift']());}}}(a34_0x2ab3,0x781b3));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x3709ec from'node:fs';import*as a34_0x2eb08a from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x126a98=a34_0x1044;return process[_0x126a98(0xc2)][_0x126a98(0xcf)]||join(homedir(),_0x126a98(0xd1),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x45dee0=a34_0x1044;return process[_0x45dee0(0xc2)][_0x45dee0(0xb8)]||join(homedir(),_0x45dee0(0xbf),'tdx');}export function getLLMProjectCacheFile(){return join(getCacheDir(),'llm_default_project');}export function readCachedLLMProject(){const _0x3a7339=a34_0x1044;try{const _0x4bb3d9=getLLMProjectCacheFile();if(!existsSync(_0x4bb3d9))return null;return readFileSync(_0x4bb3d9,_0x3a7339(0xe0))[_0x3a7339(0xb0)]();}catch{return null;}}function a34_0x1044(_0xb28d2f,_0x410c9c){const _0x2ab3b6=a34_0x2ab3();return a34_0x1044=function(_0x10445e,_0x1b0ad4){_0x10445e=_0x10445e-0xaa;let _0x24c955=_0x2ab3b6[_0x10445e];return _0x24c955;},a34_0x1044(_0xb28d2f,_0x410c9c);}export function writeCachedLLMProject(_0x18add7){const _0x10513d=a34_0x1044;try{const _0x1a186b=getCacheDir(),_0x64c5a1=getLLMProjectCacheFile();!existsSync(_0x1a186b)&&mkdirSync(_0x1a186b,{'recursive':!![]}),writeFileSync(_0x64c5a1,_0x18add7,_0x10513d(0xe0));}catch(_0x58163e){console['error']('Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:',_0x58163e);}}export function parseEnvFile(_0x171990){const _0x547dba=a34_0x1044,_0x50219d={};for(const _0x30e490 of _0x171990[_0x547dba(0xd2)]('\x0a')){const _0x29190e=_0x30e490[_0x547dba(0xb0)]();if(!_0x29190e||_0x29190e[_0x547dba(0xb2)]('#'))continue;const _0x169cc1=_0x29190e[_0x547dba(0xc6)](/^([^=]+)=(.*)$/);if(_0x169cc1){const _0x15c4fb=_0x169cc1[0x1][_0x547dba(0xb0)]();let _0x277450=_0x169cc1[0x2][_0x547dba(0xb0)]();(_0x277450[_0x547dba(0xb2)]('\x22')&&_0x277450['endsWith']('\x22')||_0x277450[_0x547dba(0xb2)]('\x27')&&_0x277450[_0x547dba(0xde)]('\x27'))&&(_0x277450=_0x277450[_0x547dba(0xb6)](0x1,-0x1)),_0x50219d[_0x15c4fb]=_0x277450;}}return _0x50219d;}export function readUserConfig(){const _0x1314bb=a34_0x1044,_0x2e154f=getConfigFile();if(!existsSync(_0x2e154f))return{};try{const _0x87c009=readFileSync(_0x2e154f,_0x1314bb(0xe0));return parseEnvFile(_0x87c009);}catch(_0x113dfa){return console['warn'](_0x1314bb(0xb5)+_0x2e154f+':',_0x113dfa),{};}}export function resolveSite(_0x17dbf8){const _0x5bea27=a34_0x1044,_0xe374ce=['us01',_0x5bea27(0xac),'eu01',_0x5bea27(0xdf),_0x5bea27(0xb3),_0x5bea27(0xc8),_0x5bea27(0xd0),_0x5bea27(0xbb),_0x5bea27(0xc3),_0x5bea27(0xb9)];if(_0xe374ce['includes'](_0x17dbf8))return _0x17dbf8;if(_0x17dbf8 in SITE_ALIASES)return SITE_ALIASES[_0x17dbf8];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x17dbf8+_0x5bea27(0xae)),_0x5bea27(0xc4);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x59db52,_0x3732f2){const _0x1ec6c8=a34_0x1044,_0x3e7d47=_0x59db52['toUpperCase']()['replace'](/-/g,'_'),_0x227407=_0x1ec6c8(0xdc)+_0x3e7d47;if(process[_0x1ec6c8(0xc2)][_0x227407])return process[_0x1ec6c8(0xc2)][_0x227407];if(process[_0x1ec6c8(0xc2)]['TD_API_KEY'])return process['env'][_0x1ec6c8(0xd5)];const _0x33b4e5=_0x3732f2||getActiveProfileName();if(_0x33b4e5){const _0x1947b5=loadProfileEnv(_0x33b4e5);if(_0x1947b5){if(_0x1947b5[_0x227407])return _0x1947b5[_0x227407];if(_0x1947b5['TD_API_KEY'])return _0x1947b5[_0x1ec6c8(0xd5)];}}const _0x286519=loadUserConfigOnce();if(_0x286519[_0x227407])return _0x286519[_0x227407];if(_0x286519['TD_API_KEY'])return _0x286519['TD_API_KEY'];return undefined;}export function getAPIKeySource(_0x103d1f,_0x480154){const _0x51faef=a34_0x1044,_0x1db738=_0x51faef(0xdc)+_0x103d1f[_0x51faef(0xab)]()[_0x51faef(0xd4)](/-/g,'_');if(process[_0x51faef(0xc2)][_0x1db738])return _0x51faef(0xca)+_0x1db738;if(process[_0x51faef(0xc2)][_0x51faef(0xd5)])return _0x51faef(0xbd);const _0x1a0e21=_0x480154||getActiveProfileName();if(_0x1a0e21){const _0xcedaca=loadProfileEnv(_0x1a0e21);if(_0xcedaca){if(_0xcedaca[_0x1db738])return _0x51faef(0xd3)+_0x1a0e21+'\x20('+_0x1db738+')';if(_0xcedaca[_0x51faef(0xd5)])return'profile:\x20'+_0x1a0e21+_0x51faef(0xad);}}const _0x4911e7=loadUserConfigOnce(),_0x3fcace=getConfigFile();if(_0x4911e7[_0x1db738])return'global:\x20'+_0x3fcace+'\x20('+_0x1db738+')';if(_0x4911e7['TD_API_KEY'])return _0x51faef(0xcc)+_0x3fcace+'\x20(TD_API_KEY)';return null;}function a34_0x2ab3(){const _0xf172f7=['174174xciEGL','existsSync','toUpperCase','jp01','\x20(TD_API_KEY)','\x27,\x20defaulting\x20to\x20us01','readFileSync','trim','8MxKRYK','startsWith','ap03','Warning:\x20Failed\x20to\x20load\x20','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','slice','apiKeys','TDX_CACHE_DIR','stg-ap03','profiles','stg-us01','parse','env:\x20TD_API_KEY','120SiwpgE','.cache','.env.','warn','env','stg-jp01','us01','eu01','match','22972WUEWOZ','dev-us01','246eRWWbf','env:\x20','1403400bKKkYQ','global:\x20','map','280xsxuJk','TDX_CONFIG_DIR','dev-eu01','.config','split','profile:\x20','replace','TD_API_KEY','.env','506745AnRXZr','4659536RclDfR','profile','tdx.json','join','TD_API_KEY_','396264ltdRuA','endsWith','ap02','utf-8','209710zTwmPI'];a34_0x2ab3=function(){return _0xf172f7;};return a34_0x2ab3();}function loadProfileEnv(_0x29f8c9){const _0x1b5fa6=a34_0x1044,_0x2b6dd4=a34_0x2eb08a[_0x1b5fa6(0xdb)](getConfigDir(),_0x1b5fa6(0xc0)+_0x29f8c9);if(a34_0x3709ec[_0x1b5fa6(0xaa)](_0x2b6dd4)){validateSecureFilePermissions(_0x2b6dd4);try{const _0x435d5e=a34_0x3709ec['readFileSync'](_0x2b6dd4,_0x1b5fa6(0xe0));return parseEnvFile(_0x435d5e);}catch(_0x54e21e){console[_0x1b5fa6(0xc1)](_0x1b5fa6(0xb4)+_0x2b6dd4+':\x20'+_0x54e21e);}}const _0x5ac53c=a34_0x2eb08a['join'](getConfigDir(),_0x1b5fa6(0xba),_0x29f8c9,_0x1b5fa6(0xd6));if(a34_0x3709ec[_0x1b5fa6(0xaa)](_0x5ac53c)){validateSecureFilePermissions(_0x5ac53c);try{const _0x12afbb=a34_0x3709ec[_0x1b5fa6(0xaf)](_0x5ac53c,_0x1b5fa6(0xe0));return parseEnvFile(_0x12afbb);}catch(_0x250ed7){return console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x5ac53c+':\x20'+_0x250ed7),null;}}return null;}function getActiveProfileName(){const _0x334f88=a34_0x1044,_0x2e27c0=a34_0x2eb08a[_0x334f88(0xdb)](getConfigDir(),_0x334f88(0xda));if(!a34_0x3709ec[_0x334f88(0xaa)](_0x2e27c0))return null;try{const _0x4c58e2=a34_0x3709ec['readFileSync'](_0x2e27c0,_0x334f88(0xe0)),_0x1c7242=JSON[_0x334f88(0xbc)](_0x4c58e2);return _0x1c7242[_0x334f88(0xd9)]||null;}catch{return null;}}export function saveAPIKey(_0x1bdb31,_0x64c341){const _0x556f4f=a34_0x1044,_0x455154=getConfigDir(),_0x14b57c=getConfigFile();!existsSync(_0x455154)&&mkdirSync(_0x455154,{'recursive':!![],'mode':0x1c0});const _0x41904e=readUserConfig(),_0x53e70a=_0x1bdb31[_0x556f4f(0xab)]()[_0x556f4f(0xd4)](/-/g,'_');_0x41904e['TD_API_KEY_'+_0x53e70a]=_0x64c341;const _0x22e4d3=Object['entries'](_0x41904e)[_0x556f4f(0xcd)](([_0x26432a,_0x24846c])=>_0x26432a+'='+_0x24846c);writeFileSync(_0x14b57c,_0x22e4d3['join']('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x2f1bea=a34_0x1044,_0x48966e={'apiKeys':{},'defaultSite':'us01'},_0x338ead=[_0x2f1bea(0xc4),_0x2f1bea(0xac),_0x2f1bea(0xc5),_0x2f1bea(0xdf),_0x2f1bea(0xb3),_0x2f1bea(0xc8),_0x2f1bea(0xd0),'stg-us01',_0x2f1bea(0xc3),_0x2f1bea(0xb9)];for(const _0x309dfb of _0x338ead){const _0x43f334=getAPIKey(_0x309dfb);_0x43f334&&(_0x48966e[_0x2f1bea(0xb7)][_0x309dfb]=_0x43f334);}return _0x48966e;}
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 +1 @@
1
- const a35_0x33eb43=a35_0xe772;(function(_0x431ab5,_0x299388){const _0x528ce9=a35_0xe772,_0x2f8c31=_0x431ab5();while(!![]){try{const _0x56a296=-parseInt(_0x528ce9(0x18b))/0x1*(parseInt(_0x528ce9(0x17e))/0x2)+-parseInt(_0x528ce9(0x188))/0x3*(parseInt(_0x528ce9(0x180))/0x4)+-parseInt(_0x528ce9(0x196))/0x5+-parseInt(_0x528ce9(0x197))/0x6+parseInt(_0x528ce9(0x193))/0x7*(parseInt(_0x528ce9(0x190))/0x8)+-parseInt(_0x528ce9(0x1b0))/0x9+parseInt(_0x528ce9(0x1ac))/0xa;if(_0x56a296===_0x299388)break;else _0x2f8c31['push'](_0x2f8c31['shift']());}catch(_0x5e3daa){_0x2f8c31['push'](_0x2f8c31['shift']());}}}(a35_0x5e1f,0x35e02));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';function a35_0xe772(_0x17026b,_0x45d262){const _0x5e1fd6=a35_0x5e1f();return a35_0xe772=function(_0xe772c0,_0x5ed432){_0xe772c0=_0xe772c0-0x174;let _0x28b5f6=_0x5e1fd6[_0xe772c0];return _0x28b5f6;},a35_0xe772(_0x17026b,_0x45d262);}import{loadSessionContext}from'./session.js';function a35_0x5e1f(){const _0x1a6c15=['log','(active)','display','profile:\x20','join','profiles','replace','Profile','profile','toString','Global\x20Credentials','loadGlobalConfig','.env','globalCredentials',':\x20none\x20(using\x20session:\x20','sessionId','\x0a[configuration\x20files]','Project','getSource','14181770CdFrkD',':\x20none','site','verbose','2826882aOHrcQ','.json','session','global','Profile\x20Credentials','segmentPath','apiKey','Session','sessions','us01','llm_project','ppid','profileCredentials','default','injectIntoOptions','[context]','1778kspNwx','configFiles','383164AJOSEK','database','cliFlags','segment_path','parent_segment','existsSync','project','Global','9boXbfn','utf-8','tdx.json','319fohgUx','activeProfile','parse','llmProject','getParameters','8KMuUjy','layers','config','491897EArnwT','CLI\x20flag:\x20--','readFileSync','925295hzXJhr','1185918pPxSCl','parentSegment'];a35_0x5e1f=function(){return _0x1a6c15;};return a35_0x5e1f();}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x334c5d from'node:fs';import*as a35_0x43c68e from'node:path';export class GlobalContext{[a35_0x33eb43(0x1ae)];[a35_0x33eb43(0x181)];[a35_0x33eb43(0x184)];[a35_0x33eb43(0x183)];['llm_project'];[a35_0x33eb43(0x174)];[a35_0x33eb43(0x1af)];[a35_0x33eb43(0x191)];[a35_0x33eb43(0x18c)];['sessionId'];['configFiles'];constructor(_0x2a7d9d){const _0x50226b=a35_0x33eb43;this['sessionId']=_0x2a7d9d[_0x50226b(0x1b2)]||process[_0x50226b(0x179)][_0x50226b(0x1a2)]();const _0xd36e22=loadSessionContext(_0x2a7d9d[_0x50226b(0x1b2)]),_0x3d453d=loadProjectConfig(),_0x524a24=this['loadGlobalConfig']();this[_0x50226b(0x18c)]=_0x2a7d9d[_0x50226b(0x1a1)]||_0xd36e22?.[_0x50226b(0x1a1)]||_0x524a24[_0x50226b(0x1a1)]||getActiveProfile();const _0x449264=this['activeProfile']?loadProfile(this[_0x50226b(0x18c)]):null,_0x5a90f7=_0x13f710=>{if(!_0x13f710)return{};const _0x5d6be5=_0x13f710,_0x215885={};for(const [_0x1a56f0,_0x10aa9c]of Object['entries'](_0x5d6be5)){typeof _0x10aa9c==='string'&&(_0x215885[_0x1a56f0]=_0x10aa9c);}return _0x215885;},_0x469179={};if(_0x2a7d9d[_0x50226b(0x1ae)]&&_0x2a7d9d[_0x50226b(0x1ae)]!==_0x50226b(0x177))_0x469179['site']=_0x2a7d9d['site'];const _0x4245ee=_0xd36e22?.[_0x50226b(0x181)],_0x46dfaf=_0x3d453d?.[_0x50226b(0x181)],_0x2944a0=_0x449264?.[_0x50226b(0x192)]?.['database'],_0x47df19=_0x524a24[_0x50226b(0x181)];_0x2a7d9d[_0x50226b(0x181)]&&(_0x2a7d9d[_0x50226b(0x181)]!==_0x4245ee&&_0x2a7d9d[_0x50226b(0x181)]!==_0x46dfaf&&_0x2a7d9d[_0x50226b(0x181)]!==_0x2944a0&&_0x2a7d9d[_0x50226b(0x181)]!==_0x47df19)&&(_0x469179[_0x50226b(0x181)]=_0x2a7d9d[_0x50226b(0x181)]);if(_0x2a7d9d['parentSegment'])_0x469179['parent_segment']=_0x2a7d9d['parentSegment'];if(_0x2a7d9d['llmProject'])_0x469179['llm_project']=_0x2a7d9d[_0x50226b(0x18e)];if(_0x2a7d9d[_0x50226b(0x1a1)])_0x469179[_0x50226b(0x1a1)]=_0x2a7d9d[_0x50226b(0x1a1)];this['layers']={'cliFlags':_0x469179,'session':_0x5a90f7(_0xd36e22),'project':_0x5a90f7(_0x3d453d),'profile':_0x5a90f7(_0x449264?.['config']),'global':_0x5a90f7(_0x524a24)};const _0x3bf070={...this[_0x50226b(0x191)][_0x50226b(0x1b3)],...this[_0x50226b(0x191)]['profile'],...this['layers']['project'],...this[_0x50226b(0x191)][_0x50226b(0x1b2)],...this[_0x50226b(0x191)][_0x50226b(0x182)]},_0x7f870e=_0x3bf070[_0x50226b(0x1ae)]||'us01';this[_0x50226b(0x1ae)]=resolveSite(_0x7f870e),this['database']=_0x3bf070['database'],this['parent_segment']=_0x3bf070[_0x50226b(0x184)],this[_0x50226b(0x183)]=_0x3bf070[_0x50226b(0x183)],this[_0x50226b(0x178)]=_0x3bf070['llm_project'],this[_0x50226b(0x1af)]=_0x2a7d9d[_0x50226b(0x1af)]||![],this[_0x50226b(0x174)]=getAPIKey(this[_0x50226b(0x1ae)],this['activeProfile']||undefined);const _0x3e6e77=getConfigDir(),_0x27837b=a35_0x43c68e['join'](_0x3e6e77,_0x50226b(0x176),this[_0x50226b(0x1a8)]+_0x50226b(0x1b1)),_0x142bd8=findProjectConfigPath(),_0x31291a=a35_0x43c68e[_0x50226b(0x19d)](_0x3e6e77,'tdx.json'),_0x122c2b=a35_0x43c68e[_0x50226b(0x19d)](_0x3e6e77,_0x50226b(0x1a5));let _0x14642a=null,_0x56a2f5=null;this['activeProfile']&&(_0x14642a=a35_0x43c68e[_0x50226b(0x19d)](_0x3e6e77,_0x50226b(0x19e),this[_0x50226b(0x18c)],_0x50226b(0x18a)),_0x56a2f5=a35_0x43c68e[_0x50226b(0x19d)](_0x3e6e77,_0x50226b(0x19e),this[_0x50226b(0x18c)],'.env')),this[_0x50226b(0x17f)]={'session':a35_0x334c5d[_0x50226b(0x185)](_0x27837b)?_0x27837b:null,'project':_0x142bd8,'profile':_0x14642a&&a35_0x334c5d[_0x50226b(0x185)](_0x14642a)?_0x14642a:null,'profileCredentials':_0x56a2f5&&a35_0x334c5d['existsSync'](_0x56a2f5)?_0x56a2f5:null,'global':a35_0x334c5d[_0x50226b(0x185)](_0x31291a)?_0x31291a:null,'globalCredentials':a35_0x334c5d[_0x50226b(0x185)](_0x122c2b)?_0x122c2b:null};}[a35_0x33eb43(0x1ab)](_0x20fdcf,_0x1e4bce){const _0x355877=a35_0x33eb43;if(!_0x1e4bce)return'not\x20set';const _0xde94b9=_0x1e4bce;if(this[_0x355877(0x191)][_0x355877(0x182)][_0x20fdcf]===_0xde94b9){if(_0x20fdcf===_0x355877(0x1ae)&&_0xde94b9==='us01'&&!this[_0x355877(0x191)][_0x355877(0x1b2)][_0x355877(0x1ae)]&&!this[_0x355877(0x191)][_0x355877(0x186)][_0x355877(0x1ae)]&&!this[_0x355877(0x191)][_0x355877(0x1a1)][_0x355877(0x1ae)]&&!this['layers']['global'][_0x355877(0x1ae)])return'default';return _0x355877(0x194)+_0x20fdcf[_0x355877(0x19f)](/_/g,'-');}if(this[_0x355877(0x191)][_0x355877(0x1b2)][_0x20fdcf]===_0xde94b9)return _0x355877(0x1b2);if(this[_0x355877(0x191)][_0x355877(0x186)][_0x20fdcf]===_0xde94b9)return _0x355877(0x186);if(this[_0x355877(0x191)][_0x355877(0x1a1)][_0x20fdcf]===_0xde94b9)return _0x355877(0x19c)+this[_0x355877(0x18c)];if(this[_0x355877(0x191)][_0x355877(0x1b3)][_0x20fdcf]===_0xde94b9)return _0x355877(0x1b3);return _0x355877(0x17b);}[a35_0x33eb43(0x1a4)](){const _0x5e016d=a35_0x33eb43,_0x3097c7=a35_0x43c68e['join'](getConfigDir(),_0x5e016d(0x18a));if(!a35_0x334c5d[_0x5e016d(0x185)](_0x3097c7))return{};try{const _0x116d2e=a35_0x334c5d[_0x5e016d(0x195)](_0x3097c7,_0x5e016d(0x189));return JSON[_0x5e016d(0x18d)](_0x116d2e);}catch{return{};}}[a35_0x33eb43(0x17c)](_0x256181){const _0x4d47c9=a35_0x33eb43;_0x256181[_0x4d47c9(0x1ae)]=this[_0x4d47c9(0x1ae)],!_0x256181[_0x4d47c9(0x181)]&&this[_0x4d47c9(0x181)]&&(_0x256181[_0x4d47c9(0x181)]=this['database']),!_0x256181[_0x4d47c9(0x198)]&&this[_0x4d47c9(0x184)]&&(_0x256181[_0x4d47c9(0x198)]=this[_0x4d47c9(0x184)]),!_0x256181[_0x4d47c9(0x1b5)]&&this[_0x4d47c9(0x183)]&&(_0x256181[_0x4d47c9(0x1b5)]=this['segment_path']),!_0x256181[_0x4d47c9(0x18e)]&&this[_0x4d47c9(0x178)]&&(_0x256181['llmProject']=this[_0x4d47c9(0x178)]);}['getParameters'](){const _0x2e5514=a35_0x33eb43;return[{'key':_0x2e5514(0x1ae),'value':this[_0x2e5514(0x1ae)]},{'key':_0x2e5514(0x181),'value':this[_0x2e5514(0x181)]},{'key':_0x2e5514(0x184),'value':this[_0x2e5514(0x184)]},{'key':_0x2e5514(0x183),'value':this[_0x2e5514(0x183)]},{'key':_0x2e5514(0x178),'value':this['llm_project']},{'key':_0x2e5514(0x1a1),'value':this['activeProfile']||undefined}];}[a35_0x33eb43(0x19b)](){const _0x54f68b=a35_0x33eb43;console[_0x54f68b(0x199)](_0x54f68b(0x17d));for(const {key:_0x3d463a,value:_0x2961c8}of this[_0x54f68b(0x18f)]()){_0x2961c8&&console['log'](_0x3d463a+':\x20'+_0x2961c8);}}['displayWithSources'](){const _0x500212=a35_0x33eb43;console[_0x500212(0x199)]('[context]');for(const {key:_0xe4d500,value:_0x2cba14}of this[_0x500212(0x18f)]()){if(_0x2cba14){const _0x20c469=_0xe4d500==='profile'?_0x500212(0x19a):'('+this['getSource'](_0xe4d500,_0x2cba14)+')';console[_0x500212(0x199)](_0xe4d500+':\x20'+_0x2cba14+'\x20'+_0x20c469);}}console['log'](_0x500212(0x1a9));const _0x314709=[{'label':_0x500212(0x175),'path':this[_0x500212(0x17f)][_0x500212(0x1b2)],'extra':'(session:\x20'+this[_0x500212(0x1a8)]+')'},{'label':_0x500212(0x1aa),'path':this[_0x500212(0x17f)][_0x500212(0x186)]},{'label':_0x500212(0x1a0),'path':this[_0x500212(0x17f)][_0x500212(0x1a1)]},{'label':_0x500212(0x1b4),'path':this[_0x500212(0x17f)][_0x500212(0x17a)]},{'label':'Global','path':this[_0x500212(0x17f)]['global']},{'label':_0x500212(0x1a3),'path':this[_0x500212(0x17f)][_0x500212(0x1a6)]}];for(const {label:_0x32406a,path:_0x2936c2,extra:_0x6fec7f}of _0x314709){if(_0x2936c2)console['log'](_0x32406a+':\x20'+_0x2936c2+'\x20✓'+(_0x6fec7f?'\x20'+_0x6fec7f:''));else{if(_0x32406a===_0x500212(0x175))console['log'](_0x32406a+_0x500212(0x1a7)+this[_0x500212(0x1a8)]+')');else(_0x32406a===_0x500212(0x1aa)||_0x32406a===_0x500212(0x187))&&console[_0x500212(0x199)](_0x32406a+_0x500212(0x1ad));}}}}
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 +1 @@
1
- (function(_0xa63abf,_0x2e5b18){const _0xc32a61=a36_0x5e8a,_0x5633ac=_0xa63abf();while(!![]){try{const _0x45285c=parseInt(_0xc32a61(0x1ae))/0x1*(-parseInt(_0xc32a61(0x1a3))/0x2)+parseInt(_0xc32a61(0x1e7))/0x3+parseInt(_0xc32a61(0x1d1))/0x4+-parseInt(_0xc32a61(0x1d7))/0x5*(parseInt(_0xc32a61(0x1a2))/0x6)+-parseInt(_0xc32a61(0x1b9))/0x7*(parseInt(_0xc32a61(0x1c9))/0x8)+-parseInt(_0xc32a61(0x1c6))/0x9+parseInt(_0xc32a61(0x1c4))/0xa;if(_0x45285c===_0x2e5b18)break;else _0x5633ac['push'](_0x5633ac['shift']());}catch(_0x3f71d6){_0x5633ac['push'](_0x5633ac['shift']());}}}(a36_0x284a,0xa8010));import*as a36_0x42b385 from'node:fs';import*as a36_0x246f57 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(_0x54f78b){const _0x3a2bab=a36_0x5e8a,_0x25b416={};if(!_0x54f78b)return _0x25b416;for(const [_0x1be855,_0x3e42a3]of Object[_0x3a2bab(0x1a9)](_0x54f78b)){_0x1be855!==_0x3a2bab(0x1b0)&&_0x3e42a3!==undefined&&(_0x25b416[_0x1be855]=_0x3e42a3);}return _0x25b416;}export function getProfilesDir(){const _0x30ccae=a36_0x5e8a;return a36_0x246f57[_0x30ccae(0x19f)](getConfigDir(),_0x30ccae(0x1a0));}function getProfileDir(_0x5a624f){const _0xb754be=a36_0x5e8a;return a36_0x246f57[_0xb754be(0x19f)](getProfilesDir(),_0x5a624f);}function getProfileConfigPath(_0x5374de){return a36_0x246f57['join'](getProfileDir(_0x5374de),'tdx.json');}function getProfileEnvPath(_0x4dafd4){return a36_0x246f57['join'](getProfileDir(_0x4dafd4),'.env');}function getGlobalConfigPath(){const _0x341913=a36_0x5e8a;return a36_0x246f57['join'](getConfigDir(),_0x341913(0x1da));}function validateProfileName(_0x4319ce){const _0x48af9d=a36_0x5e8a;if(!/^[a-zA-Z0-9_-]+$/[_0x48af9d(0x1cb)](_0x4319ce))throw new Error(_0x48af9d(0x1a1)+_0x4319ce+_0x48af9d(0x1ca));}function validateProfileConfig(_0x16ae87,_0x4a179b){const _0x13bb07=a36_0x5e8a;if(typeof _0x16ae87!=='object'||_0x16ae87===null)throw new Error('Profile\x20\x27'+_0x4a179b+_0x13bb07(0x1bc));const _0x4763be=[_0x13bb07(0x1b0),_0x13bb07(0x1ec),'database',_0x13bb07(0x1dc),_0x13bb07(0x1d4),_0x13bb07(0x1d3)],_0x41f41b=_0x16ae87;for(const _0x150a59 of Object[_0x13bb07(0x1b6)](_0x41f41b)){!_0x4763be[_0x13bb07(0x1d9)](_0x150a59)&&console[_0x13bb07(0x1cf)](_0x13bb07(0x1cd)+_0x4a179b+_0x13bb07(0x1e1)+_0x150a59+_0x13bb07(0x1b8));}if(_0x41f41b[_0x13bb07(0x1b0)]!==undefined&&typeof _0x41f41b[_0x13bb07(0x1b0)]!=='string')throw new Error(_0x13bb07(0x1be)+_0x4a179b+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x41f41b['site']!==undefined&&typeof _0x41f41b['site']!==_0x13bb07(0x1bb))throw new Error(_0x13bb07(0x1be)+_0x4a179b+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x41f41b[_0x13bb07(0x1a4)]!==undefined&&typeof _0x41f41b[_0x13bb07(0x1a4)]!==_0x13bb07(0x1bb))throw new Error(_0x13bb07(0x1be)+_0x4a179b+_0x13bb07(0x19d));if(_0x41f41b[_0x13bb07(0x1dc)]!==undefined&&typeof _0x41f41b[_0x13bb07(0x1dc)]!==_0x13bb07(0x1bb))throw new Error(_0x13bb07(0x1be)+_0x4a179b+_0x13bb07(0x1ce));if(_0x41f41b[_0x13bb07(0x1d4)]!==undefined&&typeof _0x41f41b['llm_project']!==_0x13bb07(0x1bb))throw new Error(_0x13bb07(0x1be)+_0x4a179b+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x41f41b[_0x13bb07(0x1d3)]!==undefined&&typeof _0x41f41b[_0x13bb07(0x1d3)]!=='string')throw new Error(_0x13bb07(0x1be)+_0x4a179b+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x27592a,_0x5783f9){const _0x16578f=a36_0x5e8a;if(!a36_0x42b385[_0x16578f(0x1b4)](_0x27592a))return[];try{const _0x3ef8d5=a36_0x42b385['readFileSync'](_0x27592a,_0x16578f(0x1ac)),_0x321a5a=JSON['parse'](_0x3ef8d5);if(!_0x321a5a['profiles']||typeof _0x321a5a[_0x16578f(0x1a0)]!==_0x16578f(0x1d5))return[];const _0x1406e8=[];for(const [_0x307e60,_0x19e4e2]of Object[_0x16578f(0x1a9)](_0x321a5a['profiles'])){try{validateProfileConfig(_0x19e4e2,_0x307e60);const _0x14b50e=getNewCredentialPath(_0x307e60),_0x9b7176=getOldCredentialPath(_0x307e60),_0x4defad=a36_0x42b385[_0x16578f(0x1b4)](_0x14b50e)||a36_0x42b385[_0x16578f(0x1b4)](_0x9b7176);_0x1406e8[_0x16578f(0x1d0)]({'name':_0x307e60,'config':_0x19e4e2,'metadata':{'name':_0x307e60,'createdAt':new Date()[_0x16578f(0x1af)]()},'hasCredentials':_0x4defad,'scope':_0x5783f9});}catch(_0x1bf44b){_0x1bf44b instanceof Error&&(console[_0x16578f(0x1cf)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x27592a+':'),console[_0x16578f(0x1cf)]('\x20\x20'+_0x1bf44b[_0x16578f(0x1bf)]+'\x0a'));}}return _0x1406e8;}catch(_0x4d6106){return _0x4d6106 instanceof SyntaxError?(console[_0x16578f(0x1cf)](_0x16578f(0x1c7)+_0x27592a+_0x16578f(0x1e2)),console[_0x16578f(0x1cf)](_0x16578f(0x1a6)+_0x4d6106['message']+'\x0a')):console[_0x16578f(0x1cf)](_0x16578f(0x1ad)+_0x27592a+':\x20'+_0x4d6106+'\x0a'),[];}}export function getNewCredentialPath(_0x3ce38c){const _0x4dc38d=a36_0x5e8a;return a36_0x246f57[_0x4dc38d(0x19f)](getConfigDir(),_0x4dc38d(0x1e9)+_0x3ce38c);}function getOldCredentialPath(_0x22ce4e){const _0x6f6a0d=a36_0x5e8a;return a36_0x246f57[_0x6f6a0d(0x19f)](getProfilesDir(),_0x22ce4e,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x36bac0=a36_0x5e8a,_0x1d7567=[],_0x1b7d7a=findProjectConfigPath();_0x1b7d7a&&_0x1d7567['push'](...loadProfilesFromTdxJson(_0x1b7d7a,_0x36bac0(0x1b1)));const _0x34e603=a36_0x246f57[_0x36bac0(0x19f)](getConfigDir(),_0x36bac0(0x1da));return _0x1d7567[_0x36bac0(0x1d0)](...loadProfilesFromTdxJson(_0x34e603,_0x36bac0(0x1e4))),_0x1d7567;}function loadProfilesFromDirectories(){const _0x2c4cb4=a36_0x5e8a,_0x4900e7=getProfilesDir();if(!a36_0x42b385['existsSync'](_0x4900e7))return[];try{return a36_0x42b385[_0x2c4cb4(0x1df)](_0x4900e7,{'withFileTypes':!![]})[_0x2c4cb4(0x1b2)](_0x188cfe=>_0x188cfe['isDirectory']())[_0x2c4cb4(0x1d6)](_0x43e8ab=>_0x43e8ab[_0x2c4cb4(0x1a5)])['filter'](_0x46527b=>{const _0x205a5d=_0x2c4cb4,_0x20ef9b=getProfileConfigPath(_0x46527b),_0x170249=getProfileEnvPath(_0x46527b);return a36_0x42b385['existsSync'](_0x20ef9b)||a36_0x42b385[_0x205a5d(0x1b4)](_0x170249);})[_0x2c4cb4(0x1d6)](_0xb683af=>{const _0x32e8e7=loadProfileFromDirectory(_0xb683af);if(_0x32e8e7)return{..._0x32e8e7,'scope':'directory'};return null;})[_0x2c4cb4(0x1b2)](_0x272053=>_0x272053!==null);}catch{return[];}}function loadProfileFromDirectory(_0x3c9147){const _0x1449ad=a36_0x5e8a,_0x136d44=getProfileConfigPath(_0x3c9147),_0x226fe5=getOldCredentialPath(_0x3c9147);if(!a36_0x42b385[_0x1449ad(0x1b4)](_0x136d44)&&!a36_0x42b385['existsSync'](_0x226fe5))return null;let _0x3d4a10={},_0x81de0b={'name':_0x3c9147,'createdAt':new Date()[_0x1449ad(0x1af)]()};if(a36_0x42b385['existsSync'](_0x136d44))try{const _0x21e418=a36_0x42b385[_0x1449ad(0x1e0)](_0x136d44,_0x1449ad(0x1ac)),_0x4eb82b=JSON[_0x1449ad(0x1eb)](_0x21e418),{metadata:_0x399791,..._0x3e0145}=_0x4eb82b;_0x3d4a10=_0x3e0145,_0x399791&&(_0x81de0b=_0x399791);}catch{}return{'name':_0x3c9147,'config':_0x3d4a10,'metadata':_0x81de0b,'hasCredentials':a36_0x42b385['existsSync'](_0x226fe5),'scope':_0x1449ad(0x1dd)};}export function listProfiles(){const _0x1d1297=a36_0x5e8a,_0x483089=loadProfilesFromTdxJsonFiles(),_0x1c781b=loadProfilesFromDirectories();if(_0x1c781b[_0x1d1297(0x1b5)]>0x0){const _0x206241=_0x1c781b['map'](_0x2ba67e=>_0x2ba67e['name'])['join'](',\x20'),_0x167a8f=getConfigDir();console[_0x1d1297(0x1cf)](_0x1d1297(0x1cc)+_0x206241),console[_0x1d1297(0x1cf)](_0x1d1297(0x1d2)),console[_0x1d1297(0x1cf)]('\x20\x201.\x20Edit:\x20'+a36_0x246f57[_0x1d1297(0x19f)](_0x167a8f,_0x1d1297(0x1da))),console[_0x1d1297(0x1cf)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x1d1297(0x1cf)](_0x1d1297(0x1c5));}const _0x355216=[..._0x483089,..._0x1c781b],_0x106ae2=new Map();for(const _0x1a469a of _0x355216){!_0x106ae2[_0x1d1297(0x1bd)](_0x1a469a[_0x1d1297(0x1a5)])&&_0x106ae2[_0x1d1297(0x19c)](_0x1a469a[_0x1d1297(0x1a5)],_0x1a469a);}return Array[_0x1d1297(0x1e3)](_0x106ae2[_0x1d1297(0x1ba)]())[_0x1d1297(0x1c8)]((_0x3c15f9,_0x3e374f)=>_0x3c15f9[_0x1d1297(0x1a5)][_0x1d1297(0x1ea)](_0x3e374f[_0x1d1297(0x1a5)]));}function a36_0x5e8a(_0x22fede,_0x16bddf){const _0x284a88=a36_0x284a();return a36_0x5e8a=function(_0x5e8a40,_0x2f8c89){_0x5e8a40=_0x5e8a40-0x19c;let _0x2bc3d7=_0x284a88[_0x5e8a40];return _0x2bc3d7;},a36_0x5e8a(_0x22fede,_0x16bddf);}export function profileExists(_0x512c03){const _0x303b69=a36_0x5e8a,_0x2ce8ef=listProfiles();return _0x2ce8ef[_0x303b69(0x1e6)](_0x2359a5=>_0x2359a5[_0x303b69(0x1a5)]===_0x512c03);}export function loadProfile(_0x2f54a8){const _0x589d4e=a36_0x5e8a;validateProfileName(_0x2f54a8);const _0x21eb00=listProfiles(),_0x453f59=_0x21eb00[_0x589d4e(0x1c0)](_0x16333e=>_0x16333e[_0x589d4e(0x1a5)]===_0x2f54a8);return _0x453f59||null;}function a36_0x284a(){const _0x41d5c0=['Profile\x20\x27','message','find','\x20already\x20exists','rmSync','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','20237640wITsjN','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','2977011qqJuGi','\x0aWarning:\x20Failed\x20to\x20parse\x20','sort','32wRSQnH','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','test','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','Warning:\x20Profile\x20\x27','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','warn','push','5309648UhcejF','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','llm_agent','llm_project','object','map','1465mqEytP','\x22\x20\x22','includes','tdx.json','stringify','parent_segment','directory','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','readdirSync','readFileSync','\x27:\x20unknown\x20config\x20key\x20\x27',':\x20Invalid\x20JSON\x20syntax','from','user','metadata','some','2207463BIGYBF','To\x20migrate:','.env.','localeCompare','parse','site','set','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.','join','profiles','Invalid\x20profile\x20name:\x20','27366LqwWlS','2iZeazj','database','name','Error:\x20','apiKey','\x20\x20mv\x20\x22','entries','api_key','TD_API_KEY','utf-8','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','887033ybeNdR','toISOString','description','local','filter','lastUsed','existsSync','length','keys','Profile\x20','\x27\x20will\x20be\x20ignored','1478169JTwoHg','values','string','\x27:\x20config\x20must\x20be\x20an\x20object','has'];a36_0x284a=function(){return _0x41d5c0;};return a36_0x284a();}export function saveProfile(_0x40fecb,_0x5434ae,_0x2bc2bf=![]){const _0x45cfb3=a36_0x5e8a;validateProfileName(_0x40fecb);const _0x17eb14=getProfileDir(_0x40fecb),_0x2e06f7=getProfileConfigPath(_0x40fecb);createSecureDirectory(_0x17eb14);let _0x43ecc3;const _0x3bedd8=loadProfile(_0x40fecb);_0x3bedd8?(_0x43ecc3=_0x3bedd8[_0x45cfb3(0x1e5)],_0x2bc2bf&&(_0x43ecc3[_0x45cfb3(0x1b3)]=new Date()[_0x45cfb3(0x1af)]())):_0x43ecc3={'name':_0x40fecb,'createdAt':new Date()['toISOString']()};const _0x2767fa=JSON[_0x45cfb3(0x1db)](_0x5434ae);if(_0x2767fa[_0x45cfb3(0x1d9)](_0x45cfb3(0x1ab))||_0x2767fa[_0x45cfb3(0x1d9)](_0x45cfb3(0x1a7))||_0x2767fa[_0x45cfb3(0x1d9)](_0x45cfb3(0x1aa)))throw new Error(_0x45cfb3(0x19e));const _0x1cd747={..._0x5434ae,'metadata':_0x43ecc3};a36_0x42b385['writeFileSync'](_0x2e06f7,JSON[_0x45cfb3(0x1db)](_0x1cd747,null,0x2));}export function deleteProfile(_0x574e7d){const _0x17d28d=a36_0x5e8a;validateProfileName(_0x574e7d);const _0x1a3d0b=getProfileDir(_0x574e7d);if(!a36_0x42b385['existsSync'](_0x1a3d0b))throw new Error('Profile\x20'+_0x574e7d+'\x20does\x20not\x20exist');a36_0x42b385[_0x17d28d(0x1c2)](_0x1a3d0b,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x2671a4=a36_0x5e8a,_0x1fc03a=getGlobalConfigPath();if(!a36_0x42b385[_0x2671a4(0x1b4)](_0x1fc03a))return null;try{const _0x541bc6=a36_0x42b385[_0x2671a4(0x1e0)](_0x1fc03a,'utf-8'),_0x2d4650=JSON[_0x2671a4(0x1eb)](_0x541bc6);return _0x2d4650['profile']||null;}catch{return null;}}export function createProfile(_0x59fb5a,_0x173cfd){const _0x2a63f4=a36_0x5e8a;validateProfileName(_0x59fb5a);if(profileExists(_0x59fb5a))throw new Error(_0x2a63f4(0x1b7)+_0x59fb5a+_0x2a63f4(0x1c1));saveProfile(_0x59fb5a,_0x173cfd);}export function saveProfileCredentials(_0x1fe5a6,_0x1e59d3){const _0x535b49=a36_0x5e8a;validateProfileName(_0x1fe5a6);if(!profileExists(_0x1fe5a6))throw new Error(_0x535b49(0x1b7)+_0x1fe5a6+'\x20does\x20not\x20exist');const _0x22294b=getNewCredentialPath(_0x1fe5a6);writeSecureFile(_0x22294b,_0x1e59d3);}export function loadProfileCredentials(_0x632786){const _0x58a894=a36_0x5e8a;validateProfileName(_0x632786);const _0x2788c9=getNewCredentialPath(_0x632786);if(a36_0x42b385[_0x58a894(0x1b4)](_0x2788c9))try{return a36_0x42b385[_0x58a894(0x1e0)](_0x2788c9,_0x58a894(0x1ac));}catch{}const _0x25df6a=getOldCredentialPath(_0x632786);if(a36_0x42b385[_0x58a894(0x1b4)](_0x25df6a)){console['warn'](_0x58a894(0x1de)+_0x632786+'\x27'),console[_0x58a894(0x1cf)](_0x58a894(0x1e8)),console[_0x58a894(0x1cf)](_0x58a894(0x1a8)+_0x25df6a+_0x58a894(0x1d8)+_0x2788c9+'\x22'),console[_0x58a894(0x1cf)](_0x58a894(0x1c3));try{return a36_0x42b385[_0x58a894(0x1e0)](_0x25df6a,_0x58a894(0x1ac));}catch{return null;}}return null;}
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 +1 @@
1
- const a37_0x2d5b8d=a37_0x5904;(function(_0x367420,_0x316783){const _0x4fa885=a37_0x5904,_0x58c35f=_0x367420();while(!![]){try{const _0x18ef5c=-parseInt(_0x4fa885(0x75))/0x1*(parseInt(_0x4fa885(0x6f))/0x2)+-parseInt(_0x4fa885(0x88))/0x3*(parseInt(_0x4fa885(0x7c))/0x4)+parseInt(_0x4fa885(0x77))/0x5*(parseInt(_0x4fa885(0x6d))/0x6)+parseInt(_0x4fa885(0x71))/0x7+-parseInt(_0x4fa885(0x78))/0x8*(-parseInt(_0x4fa885(0x7a))/0x9)+-parseInt(_0x4fa885(0x86))/0xa*(-parseInt(_0x4fa885(0x72))/0xb)+-parseInt(_0x4fa885(0x87))/0xc*(parseInt(_0x4fa885(0x6b))/0xd);if(_0x18ef5c===_0x316783)break;else _0x58c35f['push'](_0x58c35f['shift']());}catch(_0x133394){_0x58c35f['push'](_0x58c35f['shift']());}}}(a37_0x5ce5,0xde842));function a37_0x5904(_0x8da56,_0x2098fe){const _0x5ce5d1=a37_0x5ce5();return a37_0x5904=function(_0x59048b,_0x4b6a33){_0x59048b=_0x59048b-0x68;let _0x2f32c8=_0x5ce5d1[_0x59048b];return _0x2f32c8;},a37_0x5904(_0x8da56,_0x2098fe);}import*as a37_0x3e7067 from'node:fs';import*as a37_0x190ed7 from'node:path';const PROJECT_CONFIG_FILENAME=a37_0x2d5b8d(0x6a);export function findProjectConfigPath(_0x156749){const _0x20bc06=a37_0x2d5b8d;let _0x36016d=_0x156749||process[_0x20bc06(0x69)]();while(!![]){const _0x2a720b=a37_0x190ed7['join'](_0x36016d,PROJECT_CONFIG_FILENAME);if(a37_0x3e7067['existsSync'](_0x2a720b))return _0x2a720b;const _0x5c272d=a37_0x190ed7[_0x20bc06(0x85)](_0x36016d);if(_0x5c272d===_0x36016d)return null;_0x36016d=_0x5c272d;}}function a37_0x5ce5(){const _0xbaba0a=['includes','readFileSync','27034gCgitf','Failed\x20to\x20load\x20project\x20config\x20from\x20','180UMqMAB','8XSwpHL','TD_API_KEY','12569202MNrRCu','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','132MFQphM',').\x20','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','utf-8','code','ENOENT','stringify','apiKey','api_key','dirname','170UBrCGG','2865120lvOtTf','164643LyOqBv','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','cwd','tdx.json','130yxadmz','profile','181728JTeqmX','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','16yhNrqH','parse','8026312msgeuu','1095347nTfaQo'];a37_0x5ce5=function(){return _0xbaba0a;};return a37_0x5ce5();}export function loadProjectConfig(_0xacc3d1){const _0x3dde0b=a37_0x2d5b8d,_0x1fbcfb=findProjectConfigPath(_0xacc3d1);if(!_0x1fbcfb)return null;try{const _0x3ea4af=a37_0x3e7067[_0x3dde0b(0x74)](_0x1fbcfb,_0x3dde0b(0x7f)),_0x2458bc=JSON[_0x3dde0b(0x70)](_0x3ea4af),_0x703c0a=JSON[_0x3dde0b(0x82)](_0x2458bc);if(_0x703c0a[_0x3dde0b(0x73)]('TD_API_KEY')||_0x703c0a['includes'](_0x3dde0b(0x83))||_0x703c0a[_0x3dde0b(0x73)](_0x3dde0b(0x84)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x1fbcfb+_0x3dde0b(0x7d)+_0x3dde0b(0x7e));const {metadata:_0x432e73,profile:_0x49544a,..._0x10342f}=_0x2458bc;return _0x49544a&&console['warn']('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x1fbcfb+'\x20is\x20ignored.\x20'+_0x3dde0b(0x7b)),_0x10342f;}catch(_0x351260){if(_0x351260 instanceof Error&&_0x3dde0b(0x80)in _0x351260&&_0x351260['code']===_0x3dde0b(0x81))return null;throw new Error(_0x3dde0b(0x76)+_0x1fbcfb+':\x20'+_0x351260);}}export function saveProjectConfig(_0x2a05e0,_0x1dafa1){const _0x478388=a37_0x2d5b8d,_0xe7c3f4=_0x1dafa1||process[_0x478388(0x69)](),_0x52f57d=a37_0x190ed7['join'](_0xe7c3f4,PROJECT_CONFIG_FILENAME),_0x3ecd11=JSON[_0x478388(0x82)](_0x2a05e0);if(_0x3ecd11[_0x478388(0x73)](_0x478388(0x79))||_0x3ecd11[_0x478388(0x73)](_0x478388(0x83))||_0x3ecd11[_0x478388(0x73)](_0x478388(0x84)))throw new Error(_0x478388(0x6e));if(_0x478388(0x6c)in _0x2a05e0)throw new Error(_0x478388(0x68));a37_0x3e7067['writeFileSync'](_0x52f57d,JSON[_0x478388(0x82)](_0x2a05e0,null,0x2));}export function hasProjectConfig(_0x37cc3d){return findProjectConfigPath(_0x37cc3d)!==null;}export function getProjectRoot(_0x391795){const _0x384e67=a37_0x2d5b8d,_0x21fb5f=findProjectConfigPath(_0x391795);return _0x21fb5f?a37_0x190ed7[_0x384e67(0x85)](_0x21fb5f):null;}
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 +1 @@
1
- (function(_0x4aa712,_0x78a1e6){const _0x44aa53=a38_0x3af4,_0x2afbf5=_0x4aa712();while(!![]){try{const _0x40a6f9=parseInt(_0x44aa53(0x172))/0x1*(-parseInt(_0x44aa53(0x171))/0x2)+-parseInt(_0x44aa53(0x184))/0x3*(-parseInt(_0x44aa53(0x174))/0x4)+parseInt(_0x44aa53(0x189))/0x5*(parseInt(_0x44aa53(0x182))/0x6)+parseInt(_0x44aa53(0x176))/0x7*(parseInt(_0x44aa53(0x165))/0x8)+-parseInt(_0x44aa53(0x181))/0x9*(-parseInt(_0x44aa53(0x166))/0xa)+-parseInt(_0x44aa53(0x178))/0xb*(-parseInt(_0x44aa53(0x16b))/0xc)+-parseInt(_0x44aa53(0x17b))/0xd;if(_0x40a6f9===_0x78a1e6)break;else _0x2afbf5['push'](_0x2afbf5['shift']());}catch(_0x567d1d){_0x2afbf5['push'](_0x2afbf5['shift']());}}}(a38_0x528b,0x3ac03));import*as a38_0xf926e from'node:fs';import*as a38_0x4b1797 from'node:path';import*as a38_0x5e3074 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 _0x3ddeda=a38_0x3af4,_0x5acae9=process['env'][_0x3ddeda(0x16d)]||a38_0x4b1797[_0x3ddeda(0x17f)](a38_0x5e3074[_0x3ddeda(0x17a)](),_0x3ddeda(0x179),_0x3ddeda(0x18a));return a38_0x4b1797[_0x3ddeda(0x17f)](_0x5acae9,_0x3ddeda(0x168));}function getSessionPath(_0x4e61ba){const _0x1978b1=a38_0x3af4;return a38_0x4b1797[_0x1978b1(0x17f)](getSessionsDir(),_0x4e61ba+_0x1978b1(0x160));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x44d550){const _0x31c37c=a38_0x3af4;if(_0x44d550)return _0x44d550;return getCurrentSessionPID()[_0x31c37c(0x17c)]();}export function loadSessionContext(_0x25215b){const _0x38389f=a38_0x3af4,_0x141384=_0x25215b||getCurrentSessionPID()[_0x38389f(0x17c)](),_0x5d4769=/^\d+$/[_0x38389f(0x185)](_0x141384)?parseInt(_0x141384,0xa):null;return _0x5d4769!==null?loadSessionContextByPID(_0x5d4769):loadSessionContextByString(_0x141384);}export function loadSessionContextByPID(_0x22869b){const _0x31f9e3=a38_0x3af4,_0x46c1f9=getSessionPath(_0x22869b);if(!a38_0xf926e[_0x31f9e3(0x17e)](_0x46c1f9))return null;try{const _0x3ac6a5=a38_0xf926e[_0x31f9e3(0x187)](_0x46c1f9,'utf-8'),_0x518843=JSON[_0x31f9e3(0x17d)](_0x3ac6a5),_0x580df7=new Date(_0x518843[_0x31f9e3(0x161)])[_0x31f9e3(0x162)](),_0x27f0de=Date[_0x31f9e3(0x163)]();if(_0x27f0de-_0x580df7>SESSION_EXPIRATION_MS)return a38_0xf926e[_0x31f9e3(0x170)](_0x46c1f9),null;const _0x48afd4=JSON[_0x31f9e3(0x18b)](_0x518843);if(_0x48afd4[_0x31f9e3(0x16a)](_0x31f9e3(0x177))||_0x48afd4[_0x31f9e3(0x16a)](_0x31f9e3(0x164))||_0x48afd4[_0x31f9e3(0x16a)](_0x31f9e3(0x16f)))return console[_0x31f9e3(0x188)](_0x31f9e3(0x173)+_0x46c1f9+_0x31f9e3(0x169)),a38_0xf926e['unlinkSync'](_0x46c1f9),null;return _0x518843;}catch{try{a38_0xf926e[_0x31f9e3(0x170)](_0x46c1f9);}catch{}return null;}}function a38_0x528b(){const _0x3d7171=['stringify','toISOString','.json','createdAt','getTime','now','apiKey','2008Rficgt','190iqVGFI','push','sessions','.\x20This\x20is\x20insecure.\x20Removing\x20session.','includes','1087428iWPeJn','replace','TDX_CONFIG_DIR','writeFileSync','api_key','unlinkSync','5882hrNWbj','106iJbpXg','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','991228mHzrvN','endsWith','9121aPYVdc','TD_API_KEY','11ayGVVM','.config','homedir','6376045zuayVG','toString','parse','existsSync','join','utf-8','78201boWCcf','6XRxdfp','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','3dahKZt','test','readdirSync','readFileSync','warn','1061420venuUe','tdx'];a38_0x528b=function(){return _0x3d7171;};return a38_0x528b();}function loadSessionContextByString(_0x19438d){const _0x29d242=a38_0x3af4,_0x54d094=a38_0x4b1797[_0x29d242(0x17f)](getSessionsDir(),_0x19438d+_0x29d242(0x160));if(!a38_0xf926e['existsSync'](_0x54d094))return null;try{const _0x5813c2=a38_0xf926e[_0x29d242(0x187)](_0x54d094,_0x29d242(0x180)),_0x16b001=JSON[_0x29d242(0x17d)](_0x5813c2),_0x30d3d2=new Date(_0x16b001[_0x29d242(0x161)])[_0x29d242(0x162)](),_0x5ec9ea=Date[_0x29d242(0x163)]();if(_0x5ec9ea-_0x30d3d2>SESSION_EXPIRATION_MS)return a38_0xf926e['unlinkSync'](_0x54d094),null;const _0x3cce91=JSON[_0x29d242(0x18b)](_0x16b001);if(_0x3cce91[_0x29d242(0x16a)](_0x29d242(0x177))||_0x3cce91[_0x29d242(0x16a)](_0x29d242(0x164))||_0x3cce91[_0x29d242(0x16a)](_0x29d242(0x16f)))return console[_0x29d242(0x188)](_0x29d242(0x173)+_0x54d094+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a38_0xf926e['unlinkSync'](_0x54d094),null;return _0x16b001;}catch{try{a38_0xf926e[_0x29d242(0x170)](_0x54d094);}catch{}return null;}}export function saveSessionContext(_0x57b324,_0x52667c){const _0x445253=a38_0x3af4,_0x35797a=_0x52667c||getCurrentSessionPID()[_0x445253(0x17c)](),_0x2a5ba6=/^\d+$/['test'](_0x35797a)?parseInt(_0x35797a,0xa):getCurrentSessionPID(),_0x556e5b=a38_0x4b1797[_0x445253(0x17f)](getSessionsDir(),_0x35797a+_0x445253(0x160)),_0x4a9e3e=getSessionsDir();createSecureDirectory(_0x4a9e3e);const _0x35c06c=JSON['stringify'](_0x57b324);if(_0x35c06c[_0x445253(0x16a)](_0x445253(0x177))||_0x35c06c[_0x445253(0x16a)](_0x445253(0x164))||_0x35c06c[_0x445253(0x16a)](_0x445253(0x16f)))throw new Error(_0x445253(0x183));let _0x44ea0c;const _0x31a5d2=/^\d+$/[_0x445253(0x185)](_0x35797a)?loadSessionContextByPID(parseInt(_0x35797a,0xa)):loadSessionContextByString(_0x35797a);_0x31a5d2?_0x44ea0c={..._0x31a5d2,..._0x57b324,'pid':_0x2a5ba6,'sessionId':_0x35797a!==_0x2a5ba6[_0x445253(0x17c)]()?_0x35797a:undefined,'updatedAt':new Date()[_0x445253(0x18c)]()}:_0x44ea0c={'pid':_0x2a5ba6,'sessionId':_0x35797a!==_0x2a5ba6[_0x445253(0x17c)]()?_0x35797a:undefined,..._0x57b324,'createdAt':new Date()[_0x445253(0x18c)](),'updatedAt':new Date()[_0x445253(0x18c)]()},a38_0xf926e[_0x445253(0x16e)](_0x556e5b,JSON[_0x445253(0x18b)](_0x44ea0c,null,0x2));}export function clearSessionContext(_0x4060b9){const _0x23c864=a38_0x3af4,_0x5e1105=_0x4060b9||getCurrentSessionPID()['toString'](),_0x4ca4c6=a38_0x4b1797[_0x23c864(0x17f)](getSessionsDir(),_0x5e1105+_0x23c864(0x160));a38_0xf926e['existsSync'](_0x4ca4c6)&&a38_0xf926e['unlinkSync'](_0x4ca4c6);}export function cleanExpiredSessions(){const _0x4c7f65=a38_0x3af4,_0x154124=getSessionsDir();if(!a38_0xf926e[_0x4c7f65(0x17e)](_0x154124))return 0x0;let _0x2e255d=0x0;const _0x2c8059=Date[_0x4c7f65(0x163)]();try{const _0x3aec67=a38_0xf926e[_0x4c7f65(0x186)](_0x154124);for(const _0x4bb5c8 of _0x3aec67){if(!_0x4bb5c8['endsWith'](_0x4c7f65(0x160)))continue;const _0x530295=a38_0x4b1797['join'](_0x154124,_0x4bb5c8),_0x5f5661=_0x4bb5c8[_0x4c7f65(0x16c)](_0x4c7f65(0x160),''),_0x44e437=parseInt(_0x5f5661,0xa),_0x1d094=!isNaN(_0x44e437);if(_0x1d094){if(!isProcessRunning(_0x44e437)){a38_0xf926e[_0x4c7f65(0x170)](_0x530295),_0x2e255d++;continue;}}try{const _0x4b3a52=a38_0xf926e[_0x4c7f65(0x187)](_0x530295,'utf-8'),_0x2249c4=JSON[_0x4c7f65(0x17d)](_0x4b3a52),_0xf4232c=new Date(_0x2249c4[_0x4c7f65(0x161)])['getTime']();_0x2c8059-_0xf4232c>SESSION_EXPIRATION_MS&&(a38_0xf926e[_0x4c7f65(0x170)](_0x530295),_0x2e255d++);}catch{a38_0xf926e['unlinkSync'](_0x530295),_0x2e255d++;}}}catch{}return _0x2e255d;}function a38_0x3af4(_0x5c423b,_0x169243){const _0x528be6=a38_0x528b();return a38_0x3af4=function(_0x3af435,_0xff07b2){_0x3af435=_0x3af435-0x160;let _0x2841f7=_0x528be6[_0x3af435];return _0x2841f7;},a38_0x3af4(_0x5c423b,_0x169243);}export function listActiveSessions(){const _0x8f27a8=a38_0x3af4,_0xcbde57=getSessionsDir();if(!a38_0xf926e['existsSync'](_0xcbde57))return[];try{const _0xc7f622=a38_0xf926e['readdirSync'](_0xcbde57),_0x48a817=[];for(const _0x168f64 of _0xc7f622){if(!_0x168f64[_0x8f27a8(0x175)](_0x8f27a8(0x160)))continue;const _0x568010=_0x168f64[_0x8f27a8(0x16c)](_0x8f27a8(0x160),''),_0x584c81=parseInt(_0x568010,0xa);!isNaN(_0x584c81)&&isProcessRunning(_0x584c81)&&_0x48a817[_0x8f27a8(0x167)](_0x584c81);}return _0x48a817['sort']((_0x49bc8b,_0x29e112)=>_0x49bc8b-_0x29e112);}catch{return[];}}
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[];}}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function a39_0x5e1b(_0x5446d8,_0x524103){var _0x18f76e=a39_0x18f7();return a39_0x5e1b=function(_0x5e1b91,_0x4c14e1){_0x5e1b91=_0x5e1b91-0x1e8;var _0x1eeede=_0x18f76e[_0x5e1b91];return _0x1eeede;},a39_0x5e1b(_0x5446d8,_0x524103);}(function(_0xa82682,_0x58655a){var _0x61a7f5=a39_0x5e1b,_0x4da937=_0xa82682();while(!![]){try{var _0x5f8d22=parseInt(_0x61a7f5(0x1eb))/0x1*(parseInt(_0x61a7f5(0x1f1))/0x2)+parseInt(_0x61a7f5(0x1f0))/0x3*(parseInt(_0x61a7f5(0x1ed))/0x4)+-parseInt(_0x61a7f5(0x1ef))/0x5+-parseInt(_0x61a7f5(0x1e8))/0x6+parseInt(_0x61a7f5(0x1ee))/0x7+-parseInt(_0x61a7f5(0x1ea))/0x8*(-parseInt(_0x61a7f5(0x1ec))/0x9)+-parseInt(_0x61a7f5(0x1e9))/0xa;if(_0x5f8d22===_0x58655a)break;else _0x4da937['push'](_0x4da937['shift']());}catch(_0x17bf4e){_0x4da937['push'](_0x4da937['shift']());}}}(a39_0x18f7,0xc85ee));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';function a39_0x18f7(){var _0x2cb4a2=['64HhSswm','3160794bISZSG','7402240SlabGO','218598REChRz','2blvNIl','1085814zRsyWN','15258530WdLnZC','1154024NMuORy','803807rFRTGR','99QlrSAn'];a39_0x18f7=function(){return _0x2cb4a2;};return a39_0x18f7();}export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_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,5 +1,20 @@
1
1
  /**
2
2
  * API translation layer for converting between Anthropic Messages API and TD LLM API formats
3
+ *
4
+ * Markdown Format Conventions:
5
+ *
6
+ * This module uses markdown code blocks instead of XML for all instruction formats
7
+ * to improve LLM parsing robustness and reduce special character escaping issues.
8
+ *
9
+ * Format Specifications:
10
+ * - Tool definitions: ```tools ... ``` (contains tool list and usage instructions)
11
+ * - Tool use (LLM output): ```tool_use\n{"tool_use":{"id":"...","name":"...","input":{...}}}\n```
12
+ * - Tool results: ```tool_result tool_use_id=xxx\n(result content)\n```
13
+ * - Error results: ```tool_result tool_use_id=xxx error=true\n(error content)\n```
14
+ *
15
+ * Escaping:
16
+ * - Triple backticks within content are escaped as \`\`\` to prevent breaking code blocks
17
+ * - No XML entity escaping needed (<, >, &, ", ' are preserved as-is)
3
18
  */
4
19
  import type { AnthropicMessage, AnthropicMessagesRequest, AnthropicStreamEvent, AnthropicTool } from '../types/anthropic.js';
5
20
  import type { SSEEvent } from '../types/index.js';
@@ -42,16 +57,20 @@ export declare function formatAnthropicSSE(event: AnthropicStreamEvent): string;
42
57
  export declare function mapAnthropicModelToTD(anthropicModel: string): string;
43
58
  /**
44
59
  * Generate tool instruction prompt from Anthropic tool definitions
45
- * This prompt instructs the LLM to output tool calls as JSON
60
+ * This prompt instructs the LLM to output tool calls as JSON in markdown format
46
61
  */
47
62
  export declare function generateToolPrompt(tools: AnthropicTool[]): string;
48
63
  /**
49
64
  * Extract tool results from Anthropic messages and format for TD API
50
- * Converts tool_result content blocks into continuation prompt
65
+ * Converts tool_result content blocks into continuation prompt using markdown format
51
66
  */
52
67
  export declare function extractToolResults(messages: AnthropicMessage[]): string;
53
68
  /**
54
69
  * Parse tool call JSON from text content
70
+ * Supports both markdown code block format and raw JSON
71
+ * Supports multiple JSON formats:
72
+ * - Official: {"tool_use":{"id":"...","name":"...","input":{...}}}
73
+ * - Simplified: {"name":"...","arguments":{...}} or {"name":"...","input":{...}}
55
74
  * Returns parsed tool call with start/end indices, or null if not found
56
75
  */
57
76
  export declare function parseToolCallFromText(text: string): {
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic-adapter.d.ts","sourceRoot":"","sources":["../../src/proxy/anthropic-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EAOpB,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAoD,MAAM,mBAAmB,CAAC;AAEpG;;GAEG;AACH,iBAAS,iBAAiB,IAAI,MAAM,CAEnC;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAUjF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,gBAAgB,EAAE,EACnC,gBAAgB,EAAE,gBAAgB,EAAE,GACnC,gBAAgB,EAAE,CAYpB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,wBAAwB,EACjC,gBAAgB,EAAE,gBAAgB,EAAE,GACnC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAgB5D;AAED;;;GAGG;AACH,wBAAuB,4BAA4B,CACjD,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EACjD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,cAAc,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAwGrD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAiBpE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CA2CjE;AAcD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAmCvE;AA6CD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAmCP;AAED;;;GAGG;AACH,wBAAiB,sBAAsB,CACrC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EACtE,YAAY,EAAE,MAAM,GACnB,SAAS,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAoDhD;AAED;;;GAGG;AACH,wBAAuB,kCAAkC,CACvD,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EACjD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,cAAc,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAoPrD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"anthropic-adapter.d.ts","sourceRoot":"","sources":["../../src/proxy/anthropic-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EAOpB,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAoD,MAAM,mBAAmB,CAAC;AAEpG;;GAEG;AACH,iBAAS,iBAAiB,IAAI,MAAM,CAEnC;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAUjF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,gBAAgB,EAAE,EACnC,gBAAgB,EAAE,gBAAgB,EAAE,GACnC,gBAAgB,EAAE,CAYpB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,wBAAwB,EACjC,gBAAgB,EAAE,gBAAgB,EAAE,GACnC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAgB5D;AAED;;;GAGG;AACH,wBAAuB,4BAA4B,CACjD,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EACjD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,cAAc,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAwGrD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAiBpE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CAuDjE;AAWD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAmCvE;AAoDD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAgFP;AAED;;;GAGG;AACH,wBAAiB,sBAAsB,CACrC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EACtE,YAAY,EAAE,MAAM,GACnB,SAAS,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAoDhD;AAED;;;GAGG;AACH,wBAAuB,kCAAkC,CACvD,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EACjD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,cAAc,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAsSrD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}