@treasuredata/tdx 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/connection-validator.js +1 -1
  67. package/dist/sdk/connection.js +1 -1
  68. package/dist/sdk/engage.js +1 -1
  69. package/dist/sdk/errors.js +1 -1
  70. package/dist/sdk/index.js +1 -1
  71. package/dist/sdk/job.js +1 -1
  72. package/dist/sdk/journey.js +1 -1
  73. package/dist/sdk/llm.js +1 -1
  74. package/dist/sdk/query.js +1 -1
  75. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  76. package/dist/sdk/segment/journey-yaml.d.ts +17 -11
  77. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  78. package/dist/sdk/segment/journey-yaml.js +1 -1
  79. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  80. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  81. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  82. package/dist/sdk/segment.js +1 -1
  83. package/dist/sdk/user.js +1 -1
  84. package/dist/sdk/workflow.js +1 -1
  85. package/dist/types/endpoints.js +1 -1
  86. package/dist/types/index.js +1 -1
  87. package/dist/utils/agent-config.js +1 -1
  88. package/dist/utils/agent-ref-parser.js +1 -1
  89. package/dist/utils/async.js +1 -1
  90. package/dist/utils/chat-cache.js +1 -1
  91. package/dist/utils/colors.js +1 -1
  92. package/dist/utils/command-output.js +1 -1
  93. package/dist/utils/constants.js +1 -1
  94. package/dist/utils/diff.js +1 -1
  95. package/dist/utils/fields-display.js +1 -1
  96. package/dist/utils/file-permissions.js +1 -1
  97. package/dist/utils/format-detector.js +1 -1
  98. package/dist/utils/formatters.js +1 -1
  99. package/dist/utils/journey-utils.d.ts +30 -0
  100. package/dist/utils/journey-utils.d.ts.map +1 -1
  101. package/dist/utils/journey-utils.js +1 -1
  102. package/dist/utils/journey-utils.js.map +1 -1
  103. package/dist/utils/json-loader.js +1 -1
  104. package/dist/utils/llm-backup-utils.js +1 -1
  105. package/dist/utils/model-aliases.js +1 -1
  106. package/dist/utils/model-factors.js +1 -1
  107. package/dist/utils/option-validation.js +1 -1
  108. package/dist/utils/port.js +1 -1
  109. package/dist/utils/process.js +1 -1
  110. package/dist/utils/prompt.js +1 -1
  111. package/dist/utils/segment-path-parser.js +1 -1
  112. package/dist/utils/segment-ref-parser.js +1 -1
  113. package/dist/utils/spinner.js +1 -1
  114. package/dist/utils/sql-parser.js +1 -1
  115. package/dist/utils/sse-parser.js +1 -1
  116. package/dist/utils/string-utils.js +1 -1
  117. package/dist/utils/table-ref-parser.js +1 -1
  118. package/dist/utils/tdx-config.js +1 -1
  119. package/dist/utils/tdx-logger.js +1 -1
  120. package/dist/utils/tree-formatter.js +1 -1
  121. package/dist/utils/version-check.js +1 -1
  122. package/dist/utils/workflow-utils.js +1 -1
  123. package/package.json +1 -1
@@ -1 +1 @@
1
- const a10_0x5106de=a10_0x443d;(function(_0x315b4b,_0x6c816){const _0x2fff36=a10_0x443d,_0x50983f=_0x315b4b();while(!![]){try{const _0x41eb87=-parseInt(_0x2fff36(0x1b4))/0x1*(parseInt(_0x2fff36(0x1e2))/0x2)+parseInt(_0x2fff36(0x1e4))/0x3*(-parseInt(_0x2fff36(0x1d1))/0x4)+-parseInt(_0x2fff36(0x19d))/0x5+-parseInt(_0x2fff36(0x1a4))/0x6+parseInt(_0x2fff36(0x1d7))/0x7*(-parseInt(_0x2fff36(0x1ef))/0x8)+-parseInt(_0x2fff36(0x1bd))/0x9*(parseInt(_0x2fff36(0x1c9))/0xa)+parseInt(_0x2fff36(0x1d0))/0xb;if(_0x41eb87===_0x6c816)break;else _0x50983f['push'](_0x50983f['shift']());}catch(_0x16eb77){_0x50983f['push'](_0x50983f['shift']());}}}(a10_0xfb46,0x85ebc));function a10_0xfb46(){const _0x5ce84b=['5068950wjRmuS','project_name','allowQueueing','site','/api/sessions','listLogFiles','/api/sessions/','642156dmlBDU','listAttempts','resume_from','from_task','POST','clear_schedule','/api/workflows?','projectName','/api/projects','to_time','/api/attempts','status','readFile','retry_params','workflowName','name_pattern','4IHptnG','tasks','attempts','offset','revision','/api/projects?','/logs','task','/api/logs/','9iBqakt','request','search_project_name','workflow','application/gzip','append','writeFile','PUT','scheduleFrom','project_id','include_retried','getTaskLogs','39630MjEmHp','project','/api/workflows','arraybuffer','schedule_from','/api/attempts?','/api/projects/','38711904vReOPz','56splVIt','killAttempt','retryAttempt','/archive','/tasks/','include_subtasks','1029giBWoB','workflow_name','/tasks?','params','startAttempt','filter','/logs?','downloadProjectArchive','DELETE','/files','clear_schedule_all','349802yMnKAT','/sessions','41493oRAOIy','true','sessionTime','httpClient','reason','workflows','limit','retryAttemptName','workflowId','getAttempt','listProjects','51848VboNAE','replace','toString','listWorkflows','authHeaders','GET','clearSchedule','last_id','/kill','/api/attempts/','/archive?','apiKey','/retry','/files?','lastId','name','projects','from_time','force'];a10_0xfb46=function(){return _0x5ce84b;};return a10_0xfb46();}import{HTTPClient}from'./http-client.js';function a10_0x443d(_0x1454b5,_0x474c26){_0x1454b5=_0x1454b5-0x190;const _0xfb46f5=a10_0xfb46();let _0x443d9a=_0xfb46f5[_0x1454b5];return _0x443d9a;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{matchGlobPattern}from'../utils/string-utils.js';export class WorkflowApiClient{['httpClient'];[a10_0x5106de(0x1f3)];constructor(_0x2aaeb9,_0x4b9c91){const _0x5cedb2=a10_0x5106de,_0x67fe94=getEndpoint(_0x2aaeb9['site'],'workflow');this[_0x5cedb2(0x1f3)]=toHeaderRecord(getAuthHeaders(_0x2aaeb9[_0x5cedb2(0x1a0)],_0x2aaeb9[_0x5cedb2(0x195)])),this[_0x5cedb2(0x1e7)]=new HTTPClient(_0x67fe94,this[_0x5cedb2(0x1f3)],_0x4b9c91);}async[a10_0x5106de(0x1ee)](_0x2d158e){const _0x34077b=a10_0x5106de,_0x4dbc81=new URLSearchParams();if(_0x2d158e?.[_0x34077b(0x1ea)])_0x4dbc81[_0x34077b(0x1c2)]('limit',String(_0x2d158e[_0x34077b(0x1ea)]));if(_0x2d158e?.[_0x34077b(0x191)])_0x4dbc81[_0x34077b(0x1c2)](_0x34077b(0x191),_0x2d158e[_0x34077b(0x191)]);if(_0x2d158e?.[_0x34077b(0x1b3)]){const _0x18c77a=_0x2d158e[_0x34077b(0x1b3)][_0x34077b(0x1f0)](/[*?]/g,'');_0x18c77a&&_0x4dbc81['append'](_0x34077b(0x1b3),_0x18c77a);}const _0x252d87=_0x4dbc81[_0x34077b(0x1f1)](),_0x4684b6=_0x252d87?_0x34077b(0x1b9)+_0x252d87:_0x34077b(0x1ac),_0x1086bb=await this[_0x34077b(0x1e7)][_0x34077b(0x1be)](_0x34077b(0x1f4),_0x4684b6);let _0x4933e6=_0x1086bb[_0x34077b(0x19a)]||[];return _0x2d158e?.['name_pattern']&&(_0x4933e6=_0x4933e6[_0x34077b(0x1dc)](_0x522597=>{const _0x45d55b=_0x34077b;return matchGlobPattern(_0x522597[_0x45d55b(0x199)],_0x2d158e['name_pattern']);})),{'data':_0x4933e6,'lastId':_0x1086bb['lastId']};}async[a10_0x5106de(0x1f2)](_0x4fb978){const _0x162369=a10_0x5106de,_0x7424d5=new URLSearchParams();if(_0x4fb978?.['limit'])_0x7424d5[_0x162369(0x1c2)](_0x162369(0x1ea),String(_0x4fb978['limit']));if(_0x4fb978?.[_0x162369(0x191)])_0x7424d5['append'](_0x162369(0x191),_0x4fb978[_0x162369(0x191)]);if(_0x4fb978?.[_0x162369(0x19e)]){const _0x5e6dd8=_0x4fb978[_0x162369(0x19e)][_0x162369(0x1f0)](/[*?]/g,'');_0x5e6dd8&&(_0x7424d5['append'](_0x162369(0x1b3),_0x5e6dd8),_0x7424d5[_0x162369(0x1c2)](_0x162369(0x1bf),'true'));}const _0x559289=_0x7424d5[_0x162369(0x1f1)](),_0x3f2619=_0x559289?_0x162369(0x1aa)+_0x559289:_0x162369(0x1cb),_0x19a48c=await this[_0x162369(0x1e7)][_0x162369(0x1be)](_0x162369(0x1f4),_0x3f2619);let _0x35cf51=_0x19a48c[_0x162369(0x1e9)]||[];return _0x4fb978?.[_0x162369(0x19e)]&&(_0x35cf51=_0x35cf51['filter'](_0x547b3f=>{const _0x59577f=_0x162369,_0x1ff8e9=_0x547b3f[_0x59577f(0x1ca)]?.[_0x59577f(0x199)];if(!_0x1ff8e9)return![];return matchGlobPattern(_0x1ff8e9,_0x4fb978[_0x59577f(0x19e)]);})),{'data':_0x35cf51,'lastId':_0x19a48c[_0x162369(0x198)]};}async['listSessions'](_0x501983){const _0x2c5ff9=a10_0x5106de;let _0x442f69=_0x2c5ff9(0x1a1);_0x501983?.[_0x2c5ff9(0x1c6)]&&(_0x442f69=_0x2c5ff9(0x1cf)+encodeURIComponent(_0x501983[_0x2c5ff9(0x1c6)])+_0x2c5ff9(0x1e3));const _0x2065f5=new URLSearchParams();if(_0x501983?.[_0x2c5ff9(0x1d8)])_0x2065f5[_0x2c5ff9(0x1c2)](_0x2c5ff9(0x1c0),_0x501983[_0x2c5ff9(0x1d8)]);if(_0x501983?.['status'])_0x2065f5[_0x2c5ff9(0x1c2)](_0x2c5ff9(0x1af),_0x501983[_0x2c5ff9(0x1af)]);if(_0x501983?.[_0x2c5ff9(0x19b)])_0x2065f5['append'](_0x2c5ff9(0x19b),_0x501983[_0x2c5ff9(0x19b)]);if(_0x501983?.[_0x2c5ff9(0x1ad)])_0x2065f5[_0x2c5ff9(0x1c2)](_0x2c5ff9(0x1ad),_0x501983[_0x2c5ff9(0x1ad)]);if(_0x501983?.[_0x2c5ff9(0x1ea)])_0x2065f5['append']('limit',String(_0x501983['limit']));if(_0x501983?.[_0x2c5ff9(0x191)])_0x2065f5[_0x2c5ff9(0x1c2)](_0x2c5ff9(0x191),_0x501983['last_id']);const _0x10c2f3=_0x2065f5['toString']();_0x10c2f3&&(_0x442f69=_0x442f69+'?'+_0x10c2f3);const _0x555e9b=await this[_0x2c5ff9(0x1e7)]['request'](_0x2c5ff9(0x1f4),_0x442f69);return{'data':_0x555e9b['sessions']||[],'lastId':_0x555e9b['lastId']};}async[a10_0x5106de(0x1a5)](_0x32feec){const _0x17585e=a10_0x5106de,_0x12079b=new URLSearchParams();if(_0x32feec?.[_0x17585e(0x19e)])_0x12079b[_0x17585e(0x1c2)]('project',_0x32feec[_0x17585e(0x19e)]);if(_0x32feec?.[_0x17585e(0x1d8)])_0x12079b[_0x17585e(0x1c2)](_0x17585e(0x1c0),_0x32feec[_0x17585e(0x1d8)]);if(_0x32feec?.[_0x17585e(0x1c7)])_0x12079b[_0x17585e(0x1c2)](_0x17585e(0x1c7),'1');if(_0x32feec?.[_0x17585e(0x1ea)])_0x12079b[_0x17585e(0x1c2)](_0x17585e(0x1ea),String(_0x32feec[_0x17585e(0x1ea)]));if(_0x32feec?.[_0x17585e(0x191)])_0x12079b[_0x17585e(0x1c2)](_0x17585e(0x191),_0x32feec[_0x17585e(0x191)]);const _0x3bdb7f=_0x12079b[_0x17585e(0x1f1)](),_0x580745=_0x3bdb7f?_0x17585e(0x1ce)+_0x3bdb7f:_0x17585e(0x1ae),_0x4ffec4=await this[_0x17585e(0x1e7)][_0x17585e(0x1be)](_0x17585e(0x1f4),_0x580745);return{'data':_0x4ffec4[_0x17585e(0x1b6)]||[],'lastId':_0x4ffec4[_0x17585e(0x198)]};}async[a10_0x5106de(0x1ed)](_0x3fd8fa){const _0xfca72c=a10_0x5106de;return await this[_0xfca72c(0x1e7)][_0xfca72c(0x1be)](_0xfca72c(0x1f4),'/api/attempts/'+encodeURIComponent(_0x3fd8fa));}async['getAttemptTasks'](_0x3b6537,_0x1da6a2=![]){const _0xfee755=a10_0x5106de,_0x7f352e=new URLSearchParams();_0x1da6a2&&_0x7f352e[_0xfee755(0x1c2)](_0xfee755(0x1d6),_0xfee755(0x1e5));const _0x219153=_0x7f352e[_0xfee755(0x1f1)](),_0x31add4=_0x219153?'/api/attempts/'+encodeURIComponent(_0x3b6537)+_0xfee755(0x1d9)+_0x219153:'/api/attempts/'+encodeURIComponent(_0x3b6537)+'/tasks',_0x135d68=await this[_0xfee755(0x1e7)][_0xfee755(0x1be)](_0xfee755(0x1f4),_0x31add4);return _0x135d68[_0xfee755(0x1b5)]||[];}async[a10_0x5106de(0x1c8)](_0x3c8a9b,_0xa576d9,_0x53973e){const _0x4a69b8=a10_0x5106de,_0x46c4a7=new URLSearchParams();_0x53973e?.[_0x4a69b8(0x1b7)]!==undefined&&_0x46c4a7[_0x4a69b8(0x1c2)]('offset',String(_0x53973e['offset']));_0x53973e?.[_0x4a69b8(0x1ea)]!==undefined&&_0x46c4a7['append'](_0x4a69b8(0x1ea),String(_0x53973e['limit']));const _0x3cfb0a=_0x46c4a7['toString'](),_0x42fe8c=_0x3cfb0a?_0x4a69b8(0x193)+encodeURIComponent(_0x3c8a9b)+_0x4a69b8(0x1d5)+encodeURIComponent(_0xa576d9)+_0x4a69b8(0x1dd)+_0x3cfb0a:_0x4a69b8(0x193)+encodeURIComponent(_0x3c8a9b)+_0x4a69b8(0x1d5)+encodeURIComponent(_0xa576d9)+_0x4a69b8(0x1ba),_0x505be1=await this[_0x4a69b8(0x1e7)]['request'](_0x4a69b8(0x1f4),_0x42fe8c);return _0x505be1['logs']||[];}async[a10_0x5106de(0x1a2)](_0x354a1a,_0xe0034){const _0x1bfb1d=a10_0x5106de,_0x1eefaa=new URLSearchParams();_0xe0034&&_0x1eefaa[_0x1bfb1d(0x1c2)](_0x1bfb1d(0x1bb),_0xe0034);const _0x2fa2e7=_0x1eefaa[_0x1bfb1d(0x1f1)](),_0x105e37=_0x2fa2e7?_0x1bfb1d(0x1bc)+encodeURIComponent(_0x354a1a)+_0x1bfb1d(0x197)+_0x2fa2e7:_0x1bfb1d(0x1bc)+encodeURIComponent(_0x354a1a)+_0x1bfb1d(0x1e0),_0x978b49=await this['httpClient'][_0x1bfb1d(0x1be)]('GET',_0x105e37);return _0x978b49['files']||[];}async[a10_0x5106de(0x1d2)](_0x579bec,_0x242717){const _0x46ca72=a10_0x5106de,_0x1fff4d={};return _0x242717&&(_0x1fff4d[_0x46ca72(0x1e8)]=_0x242717),await this[_0x46ca72(0x1e7)]['request'](_0x46ca72(0x1a8),_0x46ca72(0x193)+encodeURIComponent(_0x579bec)+_0x46ca72(0x192),{'body':_0x1fff4d});}async['retrySession'](_0x332566,_0x1c3b45){const _0x3e3595=a10_0x5106de,_0x48930b={};return _0x1c3b45?.[_0x3e3595(0x1a7)]&&(_0x48930b['from_task']=_0x1c3b45[_0x3e3595(0x1a7)]),_0x1c3b45?.['retry_params']&&(_0x48930b[_0x3e3595(0x1b1)]=_0x1c3b45[_0x3e3595(0x1b1)]),await this[_0x3e3595(0x1e7)][_0x3e3595(0x1be)](_0x3e3595(0x1a8),_0x3e3595(0x1a3)+encodeURIComponent(_0x332566)+_0x3e3595(0x196),{'body':_0x48930b});}async[a10_0x5106de(0x1d3)](_0x137a9c,_0x399b7f){const _0x394d3c=a10_0x5106de,_0x2ea3f2={};return _0x399b7f?.[_0x394d3c(0x1a6)]&&(_0x2ea3f2[_0x394d3c(0x1a6)]=_0x399b7f[_0x394d3c(0x1a6)]),_0x399b7f?.['retry_params']&&(_0x2ea3f2['retry_params']=_0x399b7f[_0x394d3c(0x1b1)]),_0x399b7f?.[_0x394d3c(0x19c)]&&(_0x2ea3f2['force']=_0x399b7f[_0x394d3c(0x19c)]),await this[_0x394d3c(0x1e7)][_0x394d3c(0x1be)]('POST',_0x394d3c(0x193)+encodeURIComponent(_0x137a9c)+_0x394d3c(0x196),{'body':_0x2ea3f2});}async[a10_0x5106de(0x1db)](_0x172362){const _0x4ba5f9=a10_0x5106de,_0x21eaeb={'sessionTime':_0x172362[_0x4ba5f9(0x1e6)],'params':_0x172362[_0x4ba5f9(0x1da)]};return _0x172362[_0x4ba5f9(0x1ec)]&&(_0x21eaeb[_0x4ba5f9(0x1ec)]=_0x172362[_0x4ba5f9(0x1ec)]),_0x172362[_0x4ba5f9(0x1ab)]&&(_0x21eaeb[_0x4ba5f9(0x1ab)]=_0x172362[_0x4ba5f9(0x1ab)]),_0x172362[_0x4ba5f9(0x1b2)]&&(_0x21eaeb[_0x4ba5f9(0x1b2)]=_0x172362[_0x4ba5f9(0x1b2)]),_0x172362[_0x4ba5f9(0x1eb)]&&(_0x21eaeb[_0x4ba5f9(0x1eb)]=_0x172362['retryAttemptName']),_0x172362[_0x4ba5f9(0x19f)]!==undefined&&(_0x21eaeb[_0x4ba5f9(0x19f)]=_0x172362[_0x4ba5f9(0x19f)]),await this[_0x4ba5f9(0x1e7)][_0x4ba5f9(0x1be)](_0x4ba5f9(0x1c4),_0x4ba5f9(0x1ae),{'body':_0x21eaeb});}async[a10_0x5106de(0x1de)](_0x1af1d7,_0x2ecbaf,_0x3fa5b9){const _0x22c813=a10_0x5106de,{promises:_0x44c779}=await import('fs'),_0x389a9d=new URLSearchParams();_0x3fa5b9&&_0x389a9d['append'](_0x22c813(0x1b8),_0x3fa5b9);const _0x52e1db=_0x389a9d[_0x22c813(0x1f1)](),_0x1a2c4e=_0x52e1db?_0x22c813(0x1cf)+encodeURIComponent(_0x1af1d7)+_0x22c813(0x194)+_0x52e1db:'/api/projects/'+encodeURIComponent(_0x1af1d7)+_0x22c813(0x1d4),_0x138110=await this['httpClient']['request'](_0x22c813(0x1f4),_0x1a2c4e,{'headers':{'Accept':_0x22c813(0x1c1)},'responseType':_0x22c813(0x1cc)});return await _0x44c779[_0x22c813(0x1c3)](_0x2ecbaf,_0x138110),_0x2ecbaf;}async['uploadProjectArchive'](_0x296c44,_0x2a9556,_0x26f637,_0x5a8862){const _0x542b47=a10_0x5106de,{promises:_0xb8ef63}=await import('fs'),_0x118198=new URLSearchParams();_0x118198[_0x542b47(0x1c2)](_0x542b47(0x1ca),_0x296c44),_0x118198[_0x542b47(0x1c2)](_0x542b47(0x1b8),_0x2a9556);_0x5a8862?.[_0x542b47(0x1c5)]&&_0x118198[_0x542b47(0x1c2)](_0x542b47(0x1cd),_0x5a8862[_0x542b47(0x1c5)]);_0x5a8862?.[_0x542b47(0x190)]&&_0x5a8862[_0x542b47(0x190)]['forEach'](_0xd03390=>{const _0x5d64bd=_0x542b47;_0x118198[_0x5d64bd(0x1c2)](_0x5d64bd(0x1a9),_0xd03390);});_0x5a8862?.['clearScheduleAll']&&_0x118198[_0x542b47(0x1c2)](_0x542b47(0x1e1),_0x542b47(0x1e5));const _0x3922c3=_0x118198[_0x542b47(0x1f1)](),_0x5c3917=_0x542b47(0x1b9)+_0x3922c3,_0x4904d3=await _0xb8ef63[_0x542b47(0x1b0)](_0x26f637);return await this['httpClient'][_0x542b47(0x1be)]('PUT',_0x5c3917,{'body':_0x4904d3,'headers':{'Content-Type':'application/gzip'}});}async['deleteProject'](_0x16702e){const _0x599f96=a10_0x5106de;return await this[_0x599f96(0x1e7)][_0x599f96(0x1be)](_0x599f96(0x1df),_0x599f96(0x1cf)+encodeURIComponent(_0x16702e));}}
1
+ const a10_0x3b4d52=a10_0x3367;function a10_0x2a43(){const _0x55c5e6=['listAttempts','2576355BJrVlv','/api/workflows','task','sessionTime','retryAttemptName','last_id','status','/api/logs/','/api/projects?','request','GET','3980165cASYJv','project_name','limit','params','name','toString','to_time','append','/api/sessions','workflow','uploadProjectArchive','/files','name_pattern','project_id','from_time','httpClient','projectName','allowQueueing','projects','search_project_name','/sessions','POST','clearSchedule','/logs','lastId','48zJLNiF','retryAttempt','/archive?','deleteProject','/tasks','listSessions','listLogFiles','/archive','true','808800AuUXmC','filter','10bCYIAe','142142zjjWlc','/tasks/','from_task','schedule_from','listProjects','startAttempt','getAttempt','authHeaders','clear_schedule','/api/attempts','killAttempt','include_retried','PUT','readFile','/api/workflows?','clear_schedule_all','application/gzip','/api/attempts/','sessions','offset','tasks','getAttemptTasks','/api/sessions/','logs','837456hVqOEx','/files?','files','workflowName','retry_params','downloadProjectArchive','revision','force','/api/projects/','retrySession','/logs?','listWorkflows','replace','reason','/tasks?','include_subtasks','scheduleFrom','clearScheduleAll','2118476pINAuW','writeFile','workflowId','resume_from','/retry','1618524NvQipz','project','workflow_name','/api/projects','attempts'];a10_0x2a43=function(){return _0x55c5e6;};return a10_0x2a43();}(function(_0x5522dd,_0x269f29){const _0x219d0b=a10_0x3367,_0x594612=_0x5522dd();while(!![]){try{const _0x5228c2=parseInt(_0x219d0b(0x127))/0x1*(-parseInt(_0x219d0b(0x126))/0x2)+parseInt(_0x219d0b(0xf7))/0x3+-parseInt(_0x219d0b(0x151))/0x4+parseInt(_0x219d0b(0x124))/0x5+parseInt(_0x219d0b(0x13f))/0x6+-parseInt(_0x219d0b(0x102))/0x7+parseInt(_0x219d0b(0x11b))/0x8*(parseInt(_0x219d0b(0xf1))/0x9);if(_0x5228c2===_0x269f29)break;else _0x594612['push'](_0x594612['shift']());}catch(_0x43da33){_0x594612['push'](_0x594612['shift']());}}}(a10_0x2a43,0x69085));import{HTTPClient}from'./http-client.js';function a10_0x3367(_0x18e762,_0x12dc89){_0x18e762=_0x18e762-0xef;const _0x2a439d=a10_0x2a43();let _0x336764=_0x2a439d[_0x18e762];return _0x336764;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{matchGlobPattern}from'../utils/string-utils.js';export class WorkflowApiClient{[a10_0x3b4d52(0x111)];['authHeaders'];constructor(_0x8ecf3d,_0x22f6ff){const _0x3e4f24=a10_0x3b4d52,_0x4ec65d=getEndpoint(_0x8ecf3d['site'],_0x3e4f24(0x10b));this[_0x3e4f24(0x12e)]=toHeaderRecord(getAuthHeaders(_0x8ecf3d['site'],_0x8ecf3d['apiKey'])),this[_0x3e4f24(0x111)]=new HTTPClient(_0x4ec65d,this['authHeaders'],_0x22f6ff);}async[a10_0x3b4d52(0x12b)](_0x6d05d5){const _0x35c22=a10_0x3b4d52,_0x3525a9=new URLSearchParams();if(_0x6d05d5?.['limit'])_0x3525a9[_0x35c22(0x109)](_0x35c22(0x104),String(_0x6d05d5[_0x35c22(0x104)]));if(_0x6d05d5?.[_0x35c22(0xfc)])_0x3525a9[_0x35c22(0x109)](_0x35c22(0xfc),_0x6d05d5['last_id']);if(_0x6d05d5?.[_0x35c22(0x10e)]){const _0x16850f=_0x6d05d5[_0x35c22(0x10e)][_0x35c22(0x14b)](/[*?]/g,'');_0x16850f&&_0x3525a9[_0x35c22(0x109)](_0x35c22(0x10e),_0x16850f);}const _0x5d5f19=_0x3525a9['toString'](),_0x1e9c64=_0x5d5f19?_0x35c22(0xff)+_0x5d5f19:_0x35c22(0xf4),_0x3a81df=await this[_0x35c22(0x111)]['request'](_0x35c22(0x101),_0x1e9c64);let _0x1c980c=_0x3a81df[_0x35c22(0x114)]||[];return _0x6d05d5?.[_0x35c22(0x10e)]&&(_0x1c980c=_0x1c980c['filter'](_0x296949=>{const _0x4fca06=_0x35c22;return matchGlobPattern(_0x296949[_0x4fca06(0x106)],_0x6d05d5[_0x4fca06(0x10e)]);})),{'data':_0x1c980c,'lastId':_0x3a81df['lastId']};}async[a10_0x3b4d52(0x14a)](_0x359cbe){const _0x5bb27a=a10_0x3b4d52,_0x539bac=new URLSearchParams();if(_0x359cbe?.['limit'])_0x539bac['append'](_0x5bb27a(0x104),String(_0x359cbe['limit']));if(_0x359cbe?.['last_id'])_0x539bac[_0x5bb27a(0x109)](_0x5bb27a(0xfc),_0x359cbe[_0x5bb27a(0xfc)]);if(_0x359cbe?.[_0x5bb27a(0x103)]){const _0x4f8a29=_0x359cbe[_0x5bb27a(0x103)][_0x5bb27a(0x14b)](/[*?]/g,'');_0x4f8a29&&(_0x539bac['append'](_0x5bb27a(0x10e),_0x4f8a29),_0x539bac[_0x5bb27a(0x109)](_0x5bb27a(0x115),_0x5bb27a(0x123)));}const _0xeb8730=_0x539bac[_0x5bb27a(0x107)](),_0x3fdde7=_0xeb8730?_0x5bb27a(0x135)+_0xeb8730:_0x5bb27a(0xf8),_0x5a7e44=await this[_0x5bb27a(0x111)][_0x5bb27a(0x100)](_0x5bb27a(0x101),_0x3fdde7);let _0x38eee4=_0x5a7e44['workflows']||[];return _0x359cbe?.['project_name']&&(_0x38eee4=_0x38eee4[_0x5bb27a(0x125)](_0x55594d=>{const _0x4f9904=_0x5bb27a,_0x322716=_0x55594d[_0x4f9904(0xf2)]?.[_0x4f9904(0x106)];if(!_0x322716)return![];return matchGlobPattern(_0x322716,_0x359cbe['project_name']);})),{'data':_0x38eee4,'lastId':_0x5a7e44[_0x5bb27a(0x11a)]};}async[a10_0x3b4d52(0x120)](_0x1ba516){const _0x6bc0bf=a10_0x3b4d52;let _0x17542c=_0x6bc0bf(0x10a);_0x1ba516?.[_0x6bc0bf(0x10f)]&&(_0x17542c=_0x6bc0bf(0x147)+encodeURIComponent(_0x1ba516[_0x6bc0bf(0x10f)])+_0x6bc0bf(0x116));const _0x4d9591=new URLSearchParams();if(_0x1ba516?.[_0x6bc0bf(0xf3)])_0x4d9591['append'](_0x6bc0bf(0x10b),_0x1ba516[_0x6bc0bf(0xf3)]);if(_0x1ba516?.[_0x6bc0bf(0xfd)])_0x4d9591[_0x6bc0bf(0x109)](_0x6bc0bf(0xfd),_0x1ba516[_0x6bc0bf(0xfd)]);if(_0x1ba516?.[_0x6bc0bf(0x110)])_0x4d9591[_0x6bc0bf(0x109)]('from_time',_0x1ba516[_0x6bc0bf(0x110)]);if(_0x1ba516?.[_0x6bc0bf(0x108)])_0x4d9591[_0x6bc0bf(0x109)]('to_time',_0x1ba516[_0x6bc0bf(0x108)]);if(_0x1ba516?.[_0x6bc0bf(0x104)])_0x4d9591[_0x6bc0bf(0x109)](_0x6bc0bf(0x104),String(_0x1ba516[_0x6bc0bf(0x104)]));if(_0x1ba516?.[_0x6bc0bf(0xfc)])_0x4d9591[_0x6bc0bf(0x109)](_0x6bc0bf(0xfc),_0x1ba516[_0x6bc0bf(0xfc)]);const _0x183b00=_0x4d9591[_0x6bc0bf(0x107)]();_0x183b00&&(_0x17542c=_0x17542c+'?'+_0x183b00);const _0x2f47c0=await this[_0x6bc0bf(0x111)][_0x6bc0bf(0x100)]('GET',_0x17542c);return{'data':_0x2f47c0[_0x6bc0bf(0x139)]||[],'lastId':_0x2f47c0['lastId']};}async[a10_0x3b4d52(0xf6)](_0x4a8ed4){const _0x351653=a10_0x3b4d52,_0x55daa6=new URLSearchParams();if(_0x4a8ed4?.[_0x351653(0x103)])_0x55daa6[_0x351653(0x109)](_0x351653(0xf2),_0x4a8ed4[_0x351653(0x103)]);if(_0x4a8ed4?.['workflow_name'])_0x55daa6['append']('workflow',_0x4a8ed4['workflow_name']);if(_0x4a8ed4?.[_0x351653(0x132)])_0x55daa6[_0x351653(0x109)]('include_retried','1');if(_0x4a8ed4?.[_0x351653(0x104)])_0x55daa6[_0x351653(0x109)](_0x351653(0x104),String(_0x4a8ed4[_0x351653(0x104)]));if(_0x4a8ed4?.[_0x351653(0xfc)])_0x55daa6['append']('last_id',_0x4a8ed4['last_id']);const _0x415d8f=_0x55daa6[_0x351653(0x107)](),_0x2ee687=_0x415d8f?'/api/attempts?'+_0x415d8f:_0x351653(0x130),_0x20f2b4=await this[_0x351653(0x111)]['request'](_0x351653(0x101),_0x2ee687);return{'data':_0x20f2b4[_0x351653(0xf5)]||[],'lastId':_0x20f2b4[_0x351653(0x11a)]};}async[a10_0x3b4d52(0x12d)](_0x3dbe19){const _0x1dcfdc=a10_0x3b4d52;return await this[_0x1dcfdc(0x111)][_0x1dcfdc(0x100)]('GET',_0x1dcfdc(0x138)+encodeURIComponent(_0x3dbe19));}async[a10_0x3b4d52(0x13c)](_0x3c3591,_0x3675ff=![]){const _0x29a440=a10_0x3b4d52,_0x3a4ae8=new URLSearchParams();_0x3675ff&&_0x3a4ae8[_0x29a440(0x109)](_0x29a440(0x14e),_0x29a440(0x123));const _0x7f0e30=_0x3a4ae8['toString'](),_0x4cf593=_0x7f0e30?_0x29a440(0x138)+encodeURIComponent(_0x3c3591)+_0x29a440(0x14d)+_0x7f0e30:'/api/attempts/'+encodeURIComponent(_0x3c3591)+_0x29a440(0x11f),_0x6d5c70=await this['httpClient']['request'](_0x29a440(0x101),_0x4cf593);return _0x6d5c70[_0x29a440(0x13b)]||[];}async['getTaskLogs'](_0x547945,_0x11d57b,_0xee58c3){const _0x2694b3=a10_0x3b4d52,_0x3ad019=new URLSearchParams();_0xee58c3?.[_0x2694b3(0x13a)]!==undefined&&_0x3ad019[_0x2694b3(0x109)](_0x2694b3(0x13a),String(_0xee58c3[_0x2694b3(0x13a)]));_0xee58c3?.['limit']!==undefined&&_0x3ad019[_0x2694b3(0x109)](_0x2694b3(0x104),String(_0xee58c3[_0x2694b3(0x104)]));const _0x602097=_0x3ad019[_0x2694b3(0x107)](),_0x2859f2=_0x602097?_0x2694b3(0x138)+encodeURIComponent(_0x547945)+_0x2694b3(0x128)+encodeURIComponent(_0x11d57b)+_0x2694b3(0x149)+_0x602097:_0x2694b3(0x138)+encodeURIComponent(_0x547945)+'/tasks/'+encodeURIComponent(_0x11d57b)+_0x2694b3(0x119),_0x4da2ca=await this[_0x2694b3(0x111)][_0x2694b3(0x100)](_0x2694b3(0x101),_0x2859f2);return _0x4da2ca[_0x2694b3(0x13e)]||[];}async[a10_0x3b4d52(0x121)](_0x2aab1f,_0xec5e0f){const _0x319012=a10_0x3b4d52,_0x4fcd60=new URLSearchParams();_0xec5e0f&&_0x4fcd60[_0x319012(0x109)](_0x319012(0xf9),_0xec5e0f);const _0x5eff7e=_0x4fcd60[_0x319012(0x107)](),_0x38059a=_0x5eff7e?_0x319012(0xfe)+encodeURIComponent(_0x2aab1f)+_0x319012(0x140)+_0x5eff7e:_0x319012(0xfe)+encodeURIComponent(_0x2aab1f)+_0x319012(0x10d),_0x58d55d=await this[_0x319012(0x111)][_0x319012(0x100)](_0x319012(0x101),_0x38059a);return _0x58d55d[_0x319012(0x141)]||[];}async[a10_0x3b4d52(0x131)](_0x3d73a9,_0x38110c){const _0x336e3e=a10_0x3b4d52,_0x8807db={};return _0x38110c&&(_0x8807db[_0x336e3e(0x14c)]=_0x38110c),await this[_0x336e3e(0x111)][_0x336e3e(0x100)](_0x336e3e(0x117),_0x336e3e(0x138)+encodeURIComponent(_0x3d73a9)+'/kill',{'body':_0x8807db});}async[a10_0x3b4d52(0x148)](_0x4532ee,_0x1d764a){const _0x25ad23=a10_0x3b4d52,_0x496536={};return _0x1d764a?.[_0x25ad23(0x129)]&&(_0x496536[_0x25ad23(0x129)]=_0x1d764a['from_task']),_0x1d764a?.[_0x25ad23(0x143)]&&(_0x496536[_0x25ad23(0x143)]=_0x1d764a['retry_params']),await this[_0x25ad23(0x111)]['request']('POST',_0x25ad23(0x13d)+encodeURIComponent(_0x4532ee)+_0x25ad23(0xf0),{'body':_0x496536});}async[a10_0x3b4d52(0x11c)](_0x21ec76,_0x3f4605){const _0x40979f=a10_0x3b4d52,_0x31f649={};return _0x3f4605?.[_0x40979f(0xef)]&&(_0x31f649['resume_from']=_0x3f4605['resume_from']),_0x3f4605?.[_0x40979f(0x143)]&&(_0x31f649['retry_params']=_0x3f4605[_0x40979f(0x143)]),_0x3f4605?.['force']&&(_0x31f649[_0x40979f(0x146)]=_0x3f4605[_0x40979f(0x146)]),await this[_0x40979f(0x111)]['request'](_0x40979f(0x117),_0x40979f(0x138)+encodeURIComponent(_0x21ec76)+'/retry',{'body':_0x31f649});}async[a10_0x3b4d52(0x12c)](_0x1b8213){const _0x2e44d0=a10_0x3b4d52,_0x10cbf0={'sessionTime':_0x1b8213[_0x2e44d0(0xfa)],'params':_0x1b8213[_0x2e44d0(0x105)]};return _0x1b8213[_0x2e44d0(0x153)]&&(_0x10cbf0[_0x2e44d0(0x153)]=_0x1b8213[_0x2e44d0(0x153)]),_0x1b8213[_0x2e44d0(0x112)]&&(_0x10cbf0[_0x2e44d0(0x112)]=_0x1b8213[_0x2e44d0(0x112)]),_0x1b8213['workflowName']&&(_0x10cbf0[_0x2e44d0(0x142)]=_0x1b8213[_0x2e44d0(0x142)]),_0x1b8213[_0x2e44d0(0xfb)]&&(_0x10cbf0[_0x2e44d0(0xfb)]=_0x1b8213['retryAttemptName']),_0x1b8213[_0x2e44d0(0x113)]!==undefined&&(_0x10cbf0[_0x2e44d0(0x113)]=_0x1b8213[_0x2e44d0(0x113)]),await this[_0x2e44d0(0x111)][_0x2e44d0(0x100)](_0x2e44d0(0x133),'/api/attempts',{'body':_0x10cbf0});}async[a10_0x3b4d52(0x144)](_0x428991,_0x15dc6c,_0x1b0240){const _0x59bf05=a10_0x3b4d52,{promises:_0x38c1cd}=await import('fs'),_0x4b73bb=new URLSearchParams();_0x1b0240&&_0x4b73bb['append']('revision',_0x1b0240);const _0x34815b=_0x4b73bb['toString'](),_0x45f24a=_0x34815b?_0x59bf05(0x147)+encodeURIComponent(_0x428991)+_0x59bf05(0x11d)+_0x34815b:_0x59bf05(0x147)+encodeURIComponent(_0x428991)+_0x59bf05(0x122),_0x1ff63d=await this[_0x59bf05(0x111)][_0x59bf05(0x100)](_0x59bf05(0x101),_0x45f24a,{'headers':{'Accept':_0x59bf05(0x137)},'responseType':'arraybuffer'});return await _0x38c1cd[_0x59bf05(0x152)](_0x15dc6c,_0x1ff63d),_0x15dc6c;}async[a10_0x3b4d52(0x10c)](_0xebf74b,_0x5db86b,_0x5a66f9,_0x189abc){const _0x5a0bc3=a10_0x3b4d52,{promises:_0x4a80a2}=await import('fs'),_0x198288=new URLSearchParams();_0x198288[_0x5a0bc3(0x109)](_0x5a0bc3(0xf2),_0xebf74b),_0x198288[_0x5a0bc3(0x109)](_0x5a0bc3(0x145),_0x5db86b);_0x189abc?.[_0x5a0bc3(0x14f)]&&_0x198288[_0x5a0bc3(0x109)](_0x5a0bc3(0x12a),_0x189abc[_0x5a0bc3(0x14f)]);_0x189abc?.['clearSchedule']&&_0x189abc[_0x5a0bc3(0x118)]['forEach'](_0x14cfe7=>{const _0x23355a=_0x5a0bc3;_0x198288['append'](_0x23355a(0x12f),_0x14cfe7);});_0x189abc?.[_0x5a0bc3(0x150)]&&_0x198288[_0x5a0bc3(0x109)](_0x5a0bc3(0x136),_0x5a0bc3(0x123));const _0x3ea0e6=_0x198288[_0x5a0bc3(0x107)](),_0x9a07f2=_0x5a0bc3(0xff)+_0x3ea0e6,_0x387f6a=await _0x4a80a2[_0x5a0bc3(0x134)](_0x5a66f9);return await this[_0x5a0bc3(0x111)][_0x5a0bc3(0x100)]('PUT',_0x9a07f2,{'body':_0x387f6a,'headers':{'Content-Type':_0x5a0bc3(0x137)}});}async[a10_0x3b4d52(0x11e)](_0x244d51){const _0x49ae96=a10_0x3b4d52;return await this[_0x49ae96(0x111)][_0x49ae96(0x100)]('DELETE','/api/projects/'+encodeURIComponent(_0x244d51));}}
@@ -1 +1 @@
1
- const a11_0x4c66ba=a11_0x3326;(function(_0x5f44ec,_0x426d3d){const _0x3a06c1=a11_0x3326,_0x2591fc=_0x5f44ec();while(!![]){try{const _0x4dd31a=parseInt(_0x3a06c1(0xe0))/0x1+-parseInt(_0x3a06c1(0xdd))/0x2+parseInt(_0x3a06c1(0xe7))/0x3+parseInt(_0x3a06c1(0xc8))/0x4*(parseInt(_0x3a06c1(0xd9))/0x5)+parseInt(_0x3a06c1(0xc9))/0x6*(-parseInt(_0x3a06c1(0xd2))/0x7)+-parseInt(_0x3a06c1(0xdf))/0x8*(-parseInt(_0x3a06c1(0xd5))/0x9)+-parseInt(_0x3a06c1(0xe9))/0xa*(parseInt(_0x3a06c1(0xdc))/0xb);if(_0x4dd31a===_0x426d3d)break;else _0x2591fc['push'](_0x2591fc['shift']());}catch(_0x3d89bd){_0x2591fc['push'](_0x2591fc['shift']());}}}(a11_0x320f,0xda486));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{parseSegmentRef}from'../utils/segment-ref-parser.js';function a11_0x3326(_0x13e975,_0x3104e7){_0x13e975=_0x13e975-0xc5;const _0x320f6b=a11_0x320f();let _0x3326b6=_0x320f6b[_0x13e975];return _0x3326b6;}function a11_0x320f(){const _0x54cdc8=['Resolved\x20parent\x20ID:\x20','message','name','List\x20activations\x20for\x20a\x20segment','Site:\x20','4415496zGCppW','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','30PxsVaz','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','site','✔\x20Found\x20','984OSCmPS','6gVItds','Resolving\x20child\x20segment\x20\x27','\x27...','\x20activation','error','resolveSegmentId','Error:\x20Segment\x20name\x20is\x20required','Listing\x20activations\x20for\x20segment\x20\x27','data','1080233TBHjLJ','Child\x20name:\x20','segment','18xKhVWK','Resolved\x20child\x20ID:\x20','verbose','cause','1735tJWOuM','length','\x20\x20Cause:\x20','2888105lMiBvb','2255664zxkTXz','resolveParentId','1579328WWAfPk','1011876lqCyOK','Resolving\x20parent\x20segment\x20\x27'];a11_0x320f=function(){return _0x54cdc8;};return a11_0x320f();}export class ActivationsCommand extends BaseCommand{[a11_0x4c66ba(0xe4)]='activations';['description']=a11_0x4c66ba(0xe5);async['execute'](_0x20d662){const _0x3b4901=a11_0x4c66ba,{options:_0xabb485,args:_0x59ee88,tdx:_0x1093fb}=_0x20d662;if(_0x59ee88[_0x3b4901(0xda)]===0x0)return console[_0x3b4901(0xcd)](_0x3b4901(0xcf)),console[_0x3b4901(0xcd)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x48f35a,childId:_0x87e505}=parseSegmentRef(_0x59ee88[0x0]);if(!_0x87e505)return console[_0x3b4901(0xcd)](_0x3b4901(0xc5)),console[_0x3b4901(0xcd)](_0x3b4901(0xe8)),0x1;_0xabb485[_0x3b4901(0xd7)]&&(console[_0x3b4901(0xcd)](_0x3b4901(0xe6)+_0xabb485[_0x3b4901(0xc6)]),console[_0x3b4901(0xcd)]('Parent\x20name:\x20'+_0x48f35a),console[_0x3b4901(0xcd)](_0x3b4901(0xd3)+_0x87e505));const _0x35e446=await withSpinner(_0x3b4901(0xe1)+_0x48f35a+_0x3b4901(0xcb),()=>_0x1093fb[_0x3b4901(0xd4)][_0x3b4901(0xde)](_0x48f35a),{'verbose':_0xabb485['verbose']}),_0x3bbf2e=_0x35e446['data'];_0xabb485[_0x3b4901(0xd7)]&&console[_0x3b4901(0xcd)](_0x3b4901(0xe2)+_0x3bbf2e);const _0x32b769=await withSpinner(_0x3b4901(0xca)+_0x87e505+'\x27...',()=>_0x1093fb['segment'][_0x3b4901(0xce)](_0x3bbf2e,_0x87e505),{'verbose':_0xabb485['verbose']}),_0x301e28=_0x32b769[_0x3b4901(0xd1)];_0xabb485[_0x3b4901(0xd7)]&&console[_0x3b4901(0xcd)](_0x3b4901(0xd6)+_0x301e28);const _0x784bf8=await withSpinner(_0x3b4901(0xd0)+_0x87e505+'\x27...',()=>_0x1093fb[_0x3b4901(0xd4)]['listActivations'](_0x3bbf2e,_0x301e28),{'verbose':_0xabb485[_0x3b4901(0xd7)]}),_0x1507e8=_0x784bf8[_0x3b4901(0xd1)];return console[_0x3b4901(0xcd)](_0x3b4901(0xc7)+_0x1507e8[_0x3b4901(0xda)]+_0x3b4901(0xcc)+(_0x1507e8[_0x3b4901(0xda)]!==0x1?'s':'')),await handleSDKOutput(_0x1507e8,_0xabb485),0x0;}catch(_0xe95840){if(_0xe95840 instanceof SDKError)return console['error']('Error:\x20'+_0xe95840[_0x3b4901(0xe3)]),_0xe95840[_0x3b4901(0xd8)]&&console[_0x3b4901(0xcd)](_0x3b4901(0xdb)+_0xe95840[_0x3b4901(0xd8)]),0x1;throw _0xe95840;}}}
1
+ const a11_0x480036=a11_0x2cbf;(function(_0x309e42,_0x2f79fd){const _0x222994=a11_0x2cbf,_0x1aa81e=_0x309e42();while(!![]){try{const _0x3d9129=-parseInt(_0x222994(0x1d7))/0x1+-parseInt(_0x222994(0x1d0))/0x2*(-parseInt(_0x222994(0x1c2))/0x3)+parseInt(_0x222994(0x1e5))/0x4+parseInt(_0x222994(0x1c3))/0x5+parseInt(_0x222994(0x1c7))/0x6+parseInt(_0x222994(0x1d6))/0x7*(parseInt(_0x222994(0x1e1))/0x8)+-parseInt(_0x222994(0x1c0))/0x9;if(_0x3d9129===_0x2f79fd)break;else _0x1aa81e['push'](_0x1aa81e['shift']());}catch(_0x471e2e){_0x1aa81e['push'](_0x1aa81e['shift']());}}}(a11_0x3399,0xa596f));import{BaseCommand}from'./command.js';function a11_0x2cbf(_0x30e06c,_0x2148ec){_0x30e06c=_0x30e06c-0x1c0;const _0x33997f=a11_0x3399();let _0x2cbfbf=_0x33997f[_0x30e06c];return _0x2cbfbf;}function a11_0x3399(){const _0x2e4eef=['List\x20activations\x20for\x20a\x20segment','cause','8bDxPEC','Resolving\x20parent\x20segment\x20\x27','description','Resolved\x20parent\x20ID:\x20','973784cNmqzr','11512224GQNcWk','error','14859mOxksK','6216745lCGbgj','name','listActivations','Listing\x20activations\x20for\x20segment\x20\x27','1166244NKidVY','Site:\x20','✔\x20Found\x20','\x27...','Resolving\x20child\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Segment\x20name\x20is\x20required','site','\x20activation','536hooNIP','Child\x20name:\x20','\x20\x20Cause:\x20','length','data','segment','1285039XIxHVb','1234759LlSBDH','resolveSegmentId','verbose','Parent\x20name:\x20','message','activations','Resolved\x20child\x20ID:\x20','Error:\x20'];a11_0x3399=function(){return _0x2e4eef;};return a11_0x3399();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a11_0x480036(0x1c4)]=a11_0x480036(0x1dc);[a11_0x480036(0x1e3)]=a11_0x480036(0x1df);async['execute'](_0x3c8a2c){const _0x19b228=a11_0x480036,{options:_0x5a3967,args:_0x319311,tdx:_0x3e0b01}=_0x3c8a2c;if(_0x319311['length']===0x0)return console[_0x19b228(0x1c1)](_0x19b228(0x1cd)),console[_0x19b228(0x1c1)](_0x19b228(0x1cc)),0x1;try{const {parentId:_0x1e31ab,childId:_0x56f322}=parseSegmentRef(_0x319311[0x0]);if(!_0x56f322)return console[_0x19b228(0x1c1)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x19b228(0x1c1)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x5a3967['verbose']&&(console[_0x19b228(0x1c1)](_0x19b228(0x1c8)+_0x5a3967[_0x19b228(0x1ce)]),console[_0x19b228(0x1c1)](_0x19b228(0x1da)+_0x1e31ab),console[_0x19b228(0x1c1)](_0x19b228(0x1d1)+_0x56f322));const _0x30a540=await withSpinner(_0x19b228(0x1e2)+_0x1e31ab+_0x19b228(0x1ca),()=>_0x3e0b01[_0x19b228(0x1d5)]['resolveParentId'](_0x1e31ab),{'verbose':_0x5a3967[_0x19b228(0x1d9)]}),_0x41b21=_0x30a540[_0x19b228(0x1d4)];_0x5a3967[_0x19b228(0x1d9)]&&console[_0x19b228(0x1c1)](_0x19b228(0x1e4)+_0x41b21);const _0x5d7d40=await withSpinner(_0x19b228(0x1cb)+_0x56f322+'\x27...',()=>_0x3e0b01[_0x19b228(0x1d5)][_0x19b228(0x1d8)](_0x41b21,_0x56f322),{'verbose':_0x5a3967[_0x19b228(0x1d9)]}),_0x33d53f=_0x5d7d40[_0x19b228(0x1d4)];_0x5a3967[_0x19b228(0x1d9)]&&console[_0x19b228(0x1c1)](_0x19b228(0x1dd)+_0x33d53f);const _0xf3f1cd=await withSpinner(_0x19b228(0x1c6)+_0x56f322+_0x19b228(0x1ca),()=>_0x3e0b01[_0x19b228(0x1d5)][_0x19b228(0x1c5)](_0x41b21,_0x33d53f),{'verbose':_0x5a3967['verbose']}),_0x4811da=_0xf3f1cd[_0x19b228(0x1d4)];return console[_0x19b228(0x1c1)](_0x19b228(0x1c9)+_0x4811da[_0x19b228(0x1d3)]+_0x19b228(0x1cf)+(_0x4811da[_0x19b228(0x1d3)]!==0x1?'s':'')),await handleSDKOutput(_0x4811da,_0x5a3967),0x0;}catch(_0x464b38){if(_0x464b38 instanceof SDKError)return console['error'](_0x19b228(0x1de)+_0x464b38[_0x19b228(0x1db)]),_0x464b38[_0x19b228(0x1e0)]&&console[_0x19b228(0x1c1)](_0x19b228(0x1d2)+_0x464b38['cause']),0x1;throw _0x464b38;}}}
@@ -1 +1 @@
1
- const a12_0x58e27b=a12_0x5625;(function(_0x57fdf6,_0x2a67f8){const _0x3ce209=a12_0x5625,_0x2ba9ff=_0x57fdf6();while(!![]){try{const _0x1ac9d5=parseInt(_0x3ce209(0x126))/0x1*(parseInt(_0x3ce209(0x104))/0x2)+parseInt(_0x3ce209(0xd8))/0x3*(-parseInt(_0x3ce209(0x143))/0x4)+parseInt(_0x3ce209(0x10a))/0x5+-parseInt(_0x3ce209(0x111))/0x6+-parseInt(_0x3ce209(0x125))/0x7*(parseInt(_0x3ce209(0x11a))/0x8)+-parseInt(_0x3ce209(0x109))/0x9+-parseInt(_0x3ce209(0xca))/0xa*(-parseInt(_0x3ce209(0x10d))/0xb);if(_0x1ac9d5===_0x2a67f8)break;else _0x2ba9ff['push'](_0x2ba9ff['shift']());}catch(_0x3aa5b1){_0x2ba9ff['push'](_0x2ba9ff['shift']());}}}(a12_0x1f12,0x87a87));import a12_0x26b355 from'chalk';import a12_0x10b840 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../utils/agent-config.js';import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';function a12_0x5625(_0x6693d5,_0xebbfbc){_0x6693d5=_0x6693d5-0xc5;const _0x1f12c3=a12_0x1f12();let _0x562550=_0x1f12c3[_0x6693d5];return _0x562550;}function formatCountSummary(_0xff738f){const _0x2cacf7=a12_0x5625,_0x3cb864=[];if(_0xff738f[_0x2cacf7(0x13d)]!==undefined)_0x3cb864[_0x2cacf7(0x11f)](_0xff738f[_0x2cacf7(0x13d)]+_0x2cacf7(0x10c));if(_0xff738f[_0x2cacf7(0xe0)]!==undefined&&_0xff738f[_0x2cacf7(0xe0)]>0x0)_0x3cb864[_0x2cacf7(0x11f)](a12_0x26b355[_0x2cacf7(0x119)](_0xff738f[_0x2cacf7(0xe0)]+'\x20new'));if(_0xff738f[_0x2cacf7(0xd9)]!==undefined&&_0xff738f[_0x2cacf7(0xd9)]>0x0)_0x3cb864[_0x2cacf7(0x11f)](a12_0x26b355[_0x2cacf7(0x119)](_0xff738f[_0x2cacf7(0xd9)]+_0x2cacf7(0xf6)));if(_0xff738f[_0x2cacf7(0x12c)]!==undefined&&_0xff738f[_0x2cacf7(0x12c)]>0x0)_0x3cb864[_0x2cacf7(0x11f)](a12_0x26b355['yellow'](_0xff738f['updated']+_0x2cacf7(0x118)));if(_0xff738f['unchanged']!==undefined&&_0xff738f[_0x2cacf7(0xf1)]>0x0)_0x3cb864[_0x2cacf7(0x11f)](a12_0x26b355[_0x2cacf7(0x10b)](_0xff738f['unchanged']+_0x2cacf7(0x103)));if(_0xff738f[_0x2cacf7(0xd2)]!==undefined&&_0xff738f['errors']>0x0)_0x3cb864['push'](a12_0x26b355[_0x2cacf7(0xe7)](_0xff738f['errors']+_0x2cacf7(0xe2)));return _0x3cb864['join'](',\x20');}function displayDiffs(_0x376712,_0x2a352e,_0x1b1642,_0x46dc4d){const _0x1b08d4=a12_0x5625;for(const _0x3b7e82 of _0x376712){if(_0x3b7e82[_0x1b08d4(0x12f)]){const _0x30e79b=_0x3b7e82[_0x1b08d4(0xf5)]||_0x3b7e82[_0x1b08d4(0x11e)];console[_0x1b08d4(0xf0)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x30e79b+'\x27:'),console[_0x1b08d4(0xf0)]('─'[_0x1b08d4(0xc7)](0x3c)),console[_0x1b08d4(0xf0)](_0x3b7e82[_0x1b08d4(0x12f)]),console['log']('─'[_0x1b08d4(0xc7)](0x3c));}}for(const _0x483eb7 of _0x2a352e){_0x483eb7['diff']&&(console[_0x1b08d4(0xf0)](_0x1b08d4(0xf7)+_0x483eb7[_0x1b08d4(0x11e)]+'\x27:'),console['log']('─'[_0x1b08d4(0xc7)](0x3c)),console[_0x1b08d4(0xf0)](_0x483eb7['diff']),console[_0x1b08d4(0xf0)]('─'['repeat'](0x3c)));}for(const _0x21b20b of _0x1b1642){_0x21b20b[_0x1b08d4(0x12f)]&&(console['log'](_0x1b08d4(0x108)+_0x21b20b[_0x1b08d4(0x11e)]+'\x27:'),console[_0x1b08d4(0xf0)]('─'[_0x1b08d4(0xc7)](0x3c)),console[_0x1b08d4(0xf0)](_0x21b20b[_0x1b08d4(0x12f)]),console[_0x1b08d4(0xf0)]('─'[_0x1b08d4(0xc7)](0x3c)));}for(const _0x135b0b of _0x46dc4d){_0x135b0b[_0x1b08d4(0x12f)]&&(console['log'](_0x1b08d4(0xed)+_0x135b0b[_0x1b08d4(0x11e)]+'\x27:'),console['log']('─'[_0x1b08d4(0xc7)](0x3c)),console[_0x1b08d4(0xf0)](_0x135b0b[_0x1b08d4(0x12f)]),console[_0x1b08d4(0xf0)]('─'[_0x1b08d4(0xc7)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a12_0x58e27b(0x138);[a12_0x58e27b(0x136)]=a12_0x58e27b(0x115);async[a12_0x58e27b(0x101)](_0x282d57){const _0x25f992=a12_0x58e27b,{options:_0x52dafa,args:_0x408ce4,tdx:_0x3ad2fd}=_0x282d57,_0x2997fc=_0x408ce4[0x0],_0x46c80d=_0x408ce4[0x1],_0x247fd9=_0x52dafa[_0x25f992(0x110)],_0x5a9634=_0x52dafa[_0x25f992(0xf3)],_0x3387c2=_0x52dafa['force'],_0x1bc1ac=_0x52dafa['yes'],_0x401832=_0x52dafa[_0x25f992(0xce)];let _0x2b5c5e,_0x1c4251;const _0x4a947c=findAgentConfigPath(process[_0x25f992(0x10e)]());if(_0x2997fc){const _0x17f33b=a12_0x10b840[_0x25f992(0x149)](_0x2997fc,_0x25f992(0x106));if(existsSync(_0x17f33b))try{const _0x341092=JSON[_0x25f992(0xe3)](readFileSync(_0x17f33b,'utf-8'));_0x2b5c5e=_0x341092[_0x25f992(0xfa)],_0x1c4251=_0x2997fc,console[_0x25f992(0xf0)](a12_0x26b355[_0x25f992(0xd3)](_0x25f992(0x152)+_0x17f33b+':\x20'+_0x2b5c5e));}catch{_0x2b5c5e=_0x2997fc;}else _0x2b5c5e=_0x2997fc;}else{if(_0x4a947c)try{const _0x1e11e1=JSON[_0x25f992(0xe3)](readFileSync(_0x4a947c,'utf-8'));_0x2b5c5e=_0x1e11e1[_0x25f992(0xfa)],_0x1c4251=a12_0x10b840['dirname'](_0x4a947c),console[_0x25f992(0xf0)](a12_0x26b355['dim'](_0x25f992(0x156)+_0x2b5c5e));}catch{_0x2b5c5e=_0x401832;}else _0x2b5c5e=_0x401832;}if(!_0x2b5c5e)return console[_0x25f992(0xf0)](a12_0x26b355[_0x25f992(0x135)](_0x25f992(0x160))),console[_0x25f992(0xf0)](_0x25f992(0x14c)),console[_0x25f992(0xf0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x25f992(0xf0)](_0x25f992(0x14d)),console[_0x25f992(0xf0)](_0x25f992(0xd7)),0x1;if(_0x46c80d){const {data:_0x503155}=await withSpinner(_0x25f992(0xe9)+_0x46c80d+'\x22\x20from\x20project\x20\x22'+_0x2b5c5e+_0x25f992(0x14f),()=>_0x3ad2fd['llm'][_0x25f992(0x13b)](_0x2b5c5e,_0x46c80d,_0x247fd9,{'dryRun':_0x5a9634,'force':_0x3387c2}));if(_0x5a9634)return console[_0x25f992(0xf0)](a12_0x26b355[_0x25f992(0x135)](_0x25f992(0x107))),console[_0x25f992(0xf0)]('Would\x20pull\x20agent:\x20'+_0x503155[_0x25f992(0xf5)]),console[_0x25f992(0xf0)](_0x25f992(0x146)+_0x503155[_0x25f992(0x151)]),_0x503155[_0x25f992(0x12f)]&&(console[_0x25f992(0xf0)](_0x25f992(0x139)),console[_0x25f992(0xf0)]('─'['repeat'](0x3c)),console['log'](_0x503155[_0x25f992(0x12f)]),console[_0x25f992(0xf0)]('─'[_0x25f992(0xc7)](0x3c))),0x0;return console[_0x25f992(0xf0)](a12_0x26b355['green'](_0x25f992(0xc8))),console[_0x25f992(0xf0)]('Agent:\x20'+_0x503155['agentName']),console[_0x25f992(0xf0)](_0x25f992(0x148)+_0x503155['outputPath']),console[_0x25f992(0xf0)]('Status:\x20'+(_0x503155['isNew']?a12_0x26b355[_0x25f992(0x119)](_0x25f992(0xe0)):_0x503155['hasChanges']?a12_0x26b355['yellow'](_0x25f992(0x12c)):a12_0x26b355['gray'](_0x25f992(0xf1)))),0x0;}const _0x4088e6=_0x1c4251||_0x247fd9,{data:_0x2b29be}=await withSpinner(_0x25f992(0x141)+_0x2b5c5e+'\x22...',()=>_0x3ad2fd[_0x25f992(0x105)]['pullProject'](_0x2b5c5e,_0x4088e6,{'dryRun':!![]})),_0x3fe570=_0x2b29be[_0x25f992(0x121)][_0x25f992(0xe5)]['new']+_0x2b29be['counts'][_0x25f992(0xcf)]['new']+_0x2b29be['counts']['textKnowledgeBases'][_0x25f992(0xe0)]+_0x2b29be[_0x25f992(0x121)][_0x25f992(0x122)][_0x25f992(0xe0)],_0x2ba005=_0x2b29be[_0x25f992(0x121)]['agents']['updated']+_0x2b29be[_0x25f992(0x121)][_0x25f992(0xcf)][_0x25f992(0x12c)]+_0x2b29be[_0x25f992(0x121)][_0x25f992(0xd5)][_0x25f992(0x12c)]+_0x2b29be[_0x25f992(0x121)][_0x25f992(0x122)]['updated'],_0x102699=_0x2b29be[_0x25f992(0x121)][_0x25f992(0xe5)]['unchanged']+_0x2b29be[_0x25f992(0x121)][_0x25f992(0xcf)]['unchanged']+_0x2b29be[_0x25f992(0x121)][_0x25f992(0xd5)][_0x25f992(0xf1)]+_0x2b29be[_0x25f992(0x121)][_0x25f992(0x122)][_0x25f992(0xf1)];console[_0x25f992(0xf0)](_0x25f992(0x142)+_0x2b29be[_0x25f992(0xee)]+'\x27:'),console[_0x25f992(0xf0)]('\x20\x20'+a12_0x26b355[_0x25f992(0x119)]('+\x20'+_0x3fe570+_0x25f992(0x157))+'\x20|\x20'+a12_0x26b355[_0x25f992(0x135)]('~\x20'+_0x2ba005+_0x25f992(0xde))+_0x25f992(0xfe)+a12_0x26b355['dim']('=\x20'+_0x102699+_0x25f992(0x103))),console[_0x25f992(0xf0)]('\x20\x20Agents:\x20'+formatCountSummary(_0x2b29be[_0x25f992(0x121)][_0x25f992(0xe5)])),console[_0x25f992(0xf0)](_0x25f992(0x145)+formatCountSummary(_0x2b29be[_0x25f992(0x121)]['knowledgeBases'])),console['log'](_0x25f992(0xd6)+formatCountSummary(_0x2b29be[_0x25f992(0x121)]['textKnowledgeBases'])),console[_0x25f992(0xf0)](_0x25f992(0xff)+formatCountSummary(_0x2b29be[_0x25f992(0x121)][_0x25f992(0x122)])),console['log']('\x20\x20Target:\x20'+a12_0x26b355[_0x25f992(0x159)](_0x2b29be[_0x25f992(0x153)])),displayDiffs(_0x2b29be[_0x25f992(0xe5)],_0x2b29be[_0x25f992(0xcf)],_0x2b29be[_0x25f992(0xd5)],_0x2b29be[_0x25f992(0x122)]);if(_0x5a9634)return console[_0x25f992(0xf0)](a12_0x26b355[_0x25f992(0x135)](_0x25f992(0x124))),0x0;if(_0x3fe570===0x0&&_0x2ba005===0x0)return console[_0x25f992(0xf0)](a12_0x26b355[_0x25f992(0x119)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x2b29be[_0x25f992(0xee)]},_0x52dafa[_0x25f992(0xcb)]),console[_0x25f992(0xf0)](a12_0x26b355[_0x25f992(0x119)](_0x25f992(0x114)+a12_0x26b355[_0x25f992(0xd3)](_0x25f992(0xfa))+_0x25f992(0x133)+a12_0x26b355[_0x25f992(0x159)](_0x2b29be[_0x25f992(0xee)]))),0x0;if(!_0x1bc1ac&&!_0x3387c2){const _0x3c0232=await confirmKey(_0x25f992(0x155)+(_0x3fe570+_0x2ba005)+'\x20files?');if(!_0x3c0232)return console[_0x25f992(0xf0)](_0x25f992(0xe4)),0x0;}const {data:_0x51a481}=await withSpinner(_0x25f992(0xdf),()=>_0x3ad2fd[_0x25f992(0x105)]['pullProject'](_0x2b5c5e,_0x4088e6,{'force':_0x3387c2}));return console[_0x25f992(0xf0)](a12_0x26b355['green'](_0x25f992(0x13c)+(_0x3fe570+_0x2ba005)+'\x20files\x20to\x20'+_0x51a481['outputDir'])),saveSessionContext({'llm_project':_0x51a481['projectName']},_0x52dafa[_0x25f992(0xcb)]),console[_0x25f992(0xf0)](a12_0x26b355['green'](_0x25f992(0x114)+a12_0x26b355[_0x25f992(0xd3)](_0x25f992(0xfa))+_0x25f992(0x133)+a12_0x26b355['cyan'](_0x51a481[_0x25f992(0xee)]))),0x0;}}function a12_0x1f12(){const _0x3f0ee4=['\x20resources\x20to\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','knowledgeBases','<new-name>','Dry\x20run\x20-\x20no\x20changes\x20made','errors','dim','\x22\x20to\x20new\x20project\x20\x22','textKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','512157xpQZCT','created','Using\x20context\x20project:\x20','\x20\x20Knowledge\x20Base\x20\x22','error','projectId','\x20changed','Writing\x20files...','new','\x20resources?','\x20errors','parse','Pull\x20cancelled','agents','Would\x20clone:','red','Cloning\x20\x22','Pulling\x20agent\x20\x22','\x0a✔\x20Pushed\x20','INVALID_ARGUMENT','Clone\x20cancelled','\x0aChanges\x20to\x20prompt\x20\x27','projectName','profile','log','unchanged','\x27\x20to\x20create\x20the\x20folder\x20structure.','dryRun','yes','agentName','\x20created','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','llm_project','\x20\x20Text\x20Knowledge\x20Base\x20\x22','sourceProjectName','pushProject','\x20|\x20','\x20\x20Prompts:\x20','\x0aProject\x20pushed\x20with\x20errors','execute','Push\x20cancelled','\x20unchanged','1084iUPCuq','llm','tdx.json','Dry\x20run\x20-\x20no\x20files\x20written','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','724023HRrBvw','858925IBdwlh','gray','\x20total','33sURSwL','cwd','Project\x20cloned\x20successfully','output','2111580ZxKXSW','Pushing\x20to\x20project...','New\x20project\x20name\x20is\x20required','✔\x20Context\x20set:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','dirname','site','\x20updated','green','36056szpSlV','Using\x20current\x20project:\x20','Project:\x20','\x0aPush\x20','name','push','\x20successfully','counts','prompts','agent.yml','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','518fbbSiD','680eZRZKZ','\x20\x20tdx\x20agent\x20pull\x20','Current\x20context\x20has\x20llm_project=\x22','Summary:','newProjectId','Source:\x20','updated','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Source:\x20','diff','Context\x20set:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22\x20to\x20\x22','\x20=\x20','Agent:\x20','yellow','description','New\x20project:\x20','agent:pull','\x0aChanges:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','pullAgent','\x0a✔\x20Pulled\x20','total','Project\x20cloned\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Agent\x20\x22','Analyzing\x20project\x20\x22','\x0aPull\x20summary\x20for\x20\x27','4LrUPkx','agentId','\x20\x20Knowledge\x20Bases:\x20','Output\x20path:\x20','action','Output:\x20','join','\x20\x20Agents:\x20','No\x20tdx.json\x20found\x20in\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','cloneProject','\x22...','\x20\x20tdx\x20agent\x20clone\x20agents/','outputPath','Using\x20project\x20from\x20','outputDir','Failed\x20to\x20push\x20agent:\x20','\x0aWrite\x20','Using\x20project:\x20','\x20new','Analyzing\x20changes\x20to\x20push...','cyan','\x20--name\x20','agent:clone','Would\x20push\x20agent:\x20','Pushing\x20agent\x20from\x20\x22','Errors:','New\x20project\x20ID:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Prompt\x20\x22','newProjectName','Using\x20local\x20project:\x20','repeat','Agent\x20pulled\x20successfully','\x20--profile\x20','3173080GTdbcf','session'];a12_0x1f12=function(){return _0x3f0ee4;};return a12_0x1f12();}export class AgentCloneCommand extends BaseCommand{[a12_0x58e27b(0x11e)]=a12_0x58e27b(0x15b);[a12_0x58e27b(0x136)]=a12_0x58e27b(0x12d);async[a12_0x58e27b(0x101)](_0x41573c){const _0x58780d=a12_0x58e27b,{options:_0x387ebe,args:_0x57c8dc,tdx:_0x3c88cc}=_0x41573c,_0x121ec3=_0x57c8dc[0x0],_0x22e3ec=_0x387ebe[_0x58780d(0x11e)],_0x3fbf1a=_0x387ebe[_0x58780d(0xf3)],_0x39f994=_0x387ebe[_0x58780d(0xf4)],_0x4fec39=_0x387ebe['site'],_0x30cf97=_0x387ebe[_0x58780d(0xce)];let _0x34542d;const _0x34150f=findAgentConfigPath(process['cwd']());if(_0x121ec3){const _0x10e326=a12_0x10b840[_0x58780d(0x149)](_0x121ec3,_0x58780d(0x106));existsSync(_0x10e326)?(_0x34542d=_0x121ec3,console['log'](a12_0x26b355[_0x58780d(0xd3)](_0x58780d(0xc6)+_0x121ec3))):_0x34542d=_0x121ec3;}else{if(_0x34150f)_0x34542d=a12_0x10b840[_0x58780d(0x116)](_0x34150f),console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0xd3)](_0x58780d(0x11b)+_0x34542d));else{if(_0x30cf97){const _0x3471a2=normalizeName(_0x30cf97),_0x1f5616=a12_0x10b840[_0x58780d(0x149)](process['cwd'](),_0x58780d(0xe5),_0x3471a2,'tdx.json');if(existsSync(_0x1f5616))_0x34542d=a12_0x10b840[_0x58780d(0x116)](_0x1f5616),console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0xd3)](_0x58780d(0xc6)+_0x34542d));else{const _0x14fa43=_0x387ebe[_0x58780d(0xef)];if(_0x14fa43)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x30cf97+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x58780d(0x127)+_0x30cf97+'\x0a')+(_0x58780d(0x150)+_0x3471a2+_0x58780d(0x15a)+(_0x22e3ec||_0x58780d(0xd0))+_0x58780d(0xc9)+_0x14fa43)});_0x34542d=_0x30cf97,console[_0x58780d(0xf0)](a12_0x26b355['dim'](_0x58780d(0xda)+_0x30cf97));}}}}if(!_0x34542d)return console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0x135)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x58780d(0x13a)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x58780d(0x13f)),console[_0x58780d(0xf0)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x22e3ec)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x58780d(0x113),undefined,{'helpText':_0x58780d(0xcd)});if(!_0x39f994&&!_0x3fbf1a){const _0x4aea37=await confirmKey('Clone\x20\x22'+_0x34542d+_0x58780d(0xd4)+_0x22e3ec+'\x22?');if(!_0x4aea37)return console[_0x58780d(0xf0)](_0x58780d(0xec)),0x0;}const {data:_0x1e7210}=await withSpinner(_0x58780d(0xe8)+_0x34542d+_0x58780d(0x132)+_0x22e3ec+_0x58780d(0x14f),()=>_0x3c88cc[_0x58780d(0x105)][_0x58780d(0x14e)](_0x34542d,_0x22e3ec,{'dryRun':_0x3fbf1a}));if(_0x3fbf1a)return console[_0x58780d(0xf0)](a12_0x26b355['yellow'](_0x58780d(0xd1))),console[_0x58780d(0xf0)]('Source:\x20'+_0x1e7210[_0x58780d(0xfc)]),console['log'](_0x58780d(0x137)+_0x22e3ec),console['log'](_0x58780d(0xe6)),console[_0x58780d(0xf0)](_0x58780d(0x14a)+_0x1e7210[_0x58780d(0x121)][_0x58780d(0xe5)]['created']),console[_0x58780d(0xf0)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1e7210[_0x58780d(0x121)]['knowledgeBases'][_0x58780d(0xd9)]),console[_0x58780d(0xf0)](_0x58780d(0xff)+_0x1e7210[_0x58780d(0x121)]['prompts'][_0x58780d(0xd9)]),0x0;const _0x44c184=_0x1e7210[_0x58780d(0x121)]['agents'][_0x58780d(0xd2)]>0x0||_0x1e7210[_0x58780d(0x121)][_0x58780d(0xcf)][_0x58780d(0xd2)]>0x0||_0x1e7210[_0x58780d(0x121)][_0x58780d(0x122)][_0x58780d(0xd2)]>0x0;_0x44c184?console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0x135)](_0x58780d(0x13e))):console['log'](a12_0x26b355[_0x58780d(0x119)](_0x58780d(0x10f)));console[_0x58780d(0xf0)](_0x58780d(0x12b)+_0x1e7210['sourceProjectName']),console['log']('New\x20project:\x20'+_0x1e7210['newProjectName']),console['log'](_0x58780d(0x15f)+_0x1e7210[_0x58780d(0x12a)]),console[_0x58780d(0xf0)](),console[_0x58780d(0xf0)](_0x58780d(0x129)),console[_0x58780d(0xf0)](_0x58780d(0x14a)+formatCountSummary(_0x1e7210[_0x58780d(0x121)][_0x58780d(0xe5)])),console['log'](_0x58780d(0x145)+formatCountSummary(_0x1e7210[_0x58780d(0x121)][_0x58780d(0xcf)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x1e7210[_0x58780d(0x121)][_0x58780d(0x122)]));if(_0x44c184){console[_0x58780d(0xf0)](),console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0xe7)](_0x58780d(0x15e)));for(const _0x35b6ff of _0x1e7210[_0x58780d(0xe5)]){_0x35b6ff[_0x58780d(0x147)]===_0x58780d(0xdc)&&console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0xe7)](_0x58780d(0x140)+_0x35b6ff[_0x58780d(0xf5)]+'\x22:\x20'+_0x35b6ff[_0x58780d(0xdc)]));}for(const _0x5e7c9d of _0x1e7210[_0x58780d(0xcf)]){_0x5e7c9d['action']===_0x58780d(0xdc)&&console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0xe7)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x5e7c9d[_0x58780d(0x11e)]+_0x58780d(0xf8)+_0x5e7c9d[_0x58780d(0xdc)]));}for(const _0xd460d7 of _0x1e7210['prompts']){_0xd460d7[_0x58780d(0x147)]===_0x58780d(0xdc)&&console['log'](a12_0x26b355[_0x58780d(0xe7)](_0x58780d(0x161)+_0xd460d7['name']+_0x58780d(0xf8)+_0xd460d7['error']));}return 0x1;}saveSessionContext({'llm_project':_0x1e7210[_0x58780d(0xc5)]},_0x387ebe['session']),console[_0x58780d(0xf0)](),console[_0x58780d(0xf0)](a12_0x26b355[_0x58780d(0x119)](_0x58780d(0x130)+a12_0x26b355['dim']('llm_project')+_0x58780d(0x133)+a12_0x26b355[_0x58780d(0x159)](_0x1e7210[_0x58780d(0xc5)])));const _0x2c05ab=getLLMProjectUrl(_0x4fec39,_0x1e7210['newProjectId']);return console['log'](_0x58780d(0x11c)+a12_0x26b355['cyan'](_0x2c05ab)),0x0;}}export class AgentPushCommand extends BaseCommand{[a12_0x58e27b(0x11e)]='agent:push';[a12_0x58e27b(0x136)]=a12_0x58e27b(0xf9);async[a12_0x58e27b(0x101)](_0x5edb8d){const _0x3599fc=a12_0x58e27b,{options:_0x3c581c,args:_0x47cc40,tdx:_0x159839}=_0x5edb8d;let _0x2b1bf1=_0x47cc40[0x0]||process['cwd']();const _0x1a34a2=_0x3c581c[_0x3599fc(0xf3)],_0x4d44b9=_0x3c581c['force'],_0x2574c=_0x3c581c[_0x3599fc(0xf4)],_0x2bbed4=_0x3c581c[_0x3599fc(0x117)],_0x5495c1=a12_0x10b840[_0x3599fc(0x149)](_0x2b1bf1,_0x3599fc(0x123)),_0x3369f4=existsSync(_0x5495c1);if(_0x3369f4){const {data:_0xbb42f9}=await withSpinner(_0x3599fc(0x15d)+_0x2b1bf1+_0x3599fc(0x14f),()=>_0x159839[_0x3599fc(0x105)]['pushAgent'](_0x2b1bf1,{'dryRun':_0x1a34a2,'force':_0x4d44b9}));if(_0x1a34a2)return console[_0x3599fc(0xf0)](a12_0x26b355[_0x3599fc(0x135)](_0x3599fc(0xd1))),console['log'](_0x3599fc(0x15c)+_0xbb42f9[_0x3599fc(0xf5)]),0x0;if(_0xbb42f9[_0x3599fc(0x147)]===_0x3599fc(0xdc))return console['log'](a12_0x26b355[_0x3599fc(0xe7)](_0x3599fc(0x154)+_0xbb42f9[_0x3599fc(0xdc)])),0x1;console[_0x3599fc(0xf0)](a12_0x26b355['green']('Agent\x20'+_0xbb42f9[_0x3599fc(0x147)]+_0x3599fc(0x120))),console[_0x3599fc(0xf0)](_0x3599fc(0x134)+_0xbb42f9[_0x3599fc(0xf5)]);if(_0xbb42f9[_0x3599fc(0x144)]&&_0xbb42f9['projectId']){const _0x271c0b=getLLMAgentChatUrl(_0x2bbed4,_0xbb42f9[_0x3599fc(0xdd)],_0xbb42f9[_0x3599fc(0x144)]);console['log']('Chat:\x20'+a12_0x26b355[_0x3599fc(0x159)](_0x271c0b));}return 0x0;}let _0x57ca2e=a12_0x10b840[_0x3599fc(0x149)](_0x2b1bf1,'tdx.json');if(!existsSync(_0x57ca2e)){const _0x2164c7=findAgentConfigPath(_0x2b1bf1);if(_0x2164c7)_0x2b1bf1=a12_0x10b840[_0x3599fc(0x116)](_0x2164c7),_0x57ca2e=_0x2164c7,console['log'](a12_0x26b355[_0x3599fc(0xd3)](_0x3599fc(0x156)+_0x2b1bf1));else{const _0x59b7df=_0x3c581c['llmProject'];if(_0x59b7df){const _0x19cd54=normalizeName(_0x59b7df),_0x384d40=a12_0x10b840[_0x3599fc(0x149)](_0x2b1bf1,_0x3599fc(0xe5)),_0x13587d=a12_0x10b840[_0x3599fc(0x149)](_0x384d40,_0x19cd54,_0x3599fc(0x106));existsSync(_0x13587d)&&(_0x2b1bf1=a12_0x10b840['dirname'](_0x13587d),_0x57ca2e=_0x13587d,console[_0x3599fc(0xf0)](a12_0x26b355['dim'](_0x3599fc(0x156)+_0x2b1bf1)));}if(!existsSync(_0x57ca2e)){let _0x296ad5=_0x3599fc(0x131);_0x59b7df&&(_0x296ad5=_0x3599fc(0x128)+_0x59b7df+'\x22\x20but\x20no\x20local\x20folder\x20found.\x0a'+('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x59b7df+_0x3599fc(0xf2)));throw new SDKError(ErrorCode[_0x3599fc(0xeb)],_0x3599fc(0x14b)+_0x2b1bf1,undefined,{'helpText':_0x296ad5});}}}const {data:_0x1e8cdf}=await withSpinner(_0x3599fc(0x158),()=>_0x159839[_0x3599fc(0x105)]['pushProject'](_0x2b1bf1,{'dryRun':!![]})),_0xbbaf2e=_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xe5)]['errors']>0x0;if(_0xbbaf2e){console[_0x3599fc(0xf0)](a12_0x26b355[_0x3599fc(0xe7)]('\x0aErrors\x20found:'));for(const _0x263c9e of _0x1e8cdf[_0x3599fc(0xe5)]){_0x263c9e[_0x3599fc(0x147)]==='error'&&console['log'](a12_0x26b355[_0x3599fc(0xe7)](_0x3599fc(0x140)+_0x263c9e[_0x3599fc(0xf5)]+_0x3599fc(0xf8)+_0x263c9e[_0x3599fc(0xdc)]));}return 0x1;}const _0x4ca03f=_0x1e8cdf['counts'][_0x3599fc(0xe5)][_0x3599fc(0xd9)]+_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xcf)][_0x3599fc(0xd9)]+_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xd5)]['created']+_0x1e8cdf['counts'][_0x3599fc(0x122)][_0x3599fc(0xd9)],_0x93188a=_0x1e8cdf['counts'][_0x3599fc(0xe5)][_0x3599fc(0x12c)]+_0x1e8cdf[_0x3599fc(0x121)]['knowledgeBases'][_0x3599fc(0x12c)]+_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xd5)]['updated']+_0x1e8cdf[_0x3599fc(0x121)]['prompts']['updated'],_0x51f97e=_0x1e8cdf['counts']['agents'][_0x3599fc(0xf1)]+_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xcf)][_0x3599fc(0xf1)]+_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xd5)][_0x3599fc(0xf1)]+_0x1e8cdf[_0x3599fc(0x121)]['prompts'][_0x3599fc(0xf1)];console[_0x3599fc(0xf0)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1e8cdf['projectName']+'\x27:'),console[_0x3599fc(0xf0)]('\x20\x20'+a12_0x26b355['green']('+\x20'+_0x4ca03f+_0x3599fc(0x157))+_0x3599fc(0xfe)+a12_0x26b355[_0x3599fc(0x135)]('~\x20'+_0x93188a+'\x20changed')+'\x20|\x20'+a12_0x26b355[_0x3599fc(0xd3)]('=\x20'+_0x51f97e+_0x3599fc(0x103))),console[_0x3599fc(0xf0)](_0x3599fc(0x14a)+formatCountSummary(_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xe5)])),console['log'](_0x3599fc(0x145)+formatCountSummary(_0x1e8cdf[_0x3599fc(0x121)]['knowledgeBases'])),console[_0x3599fc(0xf0)](_0x3599fc(0xd6)+formatCountSummary(_0x1e8cdf[_0x3599fc(0x121)][_0x3599fc(0xd5)])),console[_0x3599fc(0xf0)](_0x3599fc(0xff)+formatCountSummary(_0x1e8cdf[_0x3599fc(0x121)]['prompts'])),console[_0x3599fc(0xf0)](_0x3599fc(0x12e)+a12_0x26b355['cyan'](_0x2b1bf1)),displayDiffs(_0x1e8cdf['agents'],_0x1e8cdf['knowledgeBases'],_0x1e8cdf[_0x3599fc(0xd5)],_0x1e8cdf[_0x3599fc(0x122)]);if(_0x1a34a2)return console[_0x3599fc(0xf0)](a12_0x26b355[_0x3599fc(0x135)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x4ca03f===0x0&&_0x93188a===0x0){console['log'](a12_0x26b355['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x405492=getLLMProjectUrl(_0x2bbed4,_0x1e8cdf['projectId']);return console[_0x3599fc(0xf0)](_0x3599fc(0x11c)+a12_0x26b355[_0x3599fc(0x159)](_0x405492)),0x0;}if(!_0x2574c&&!_0x4d44b9){const _0x342162=await confirmKey(_0x3599fc(0x11d)+(_0x4ca03f+_0x93188a)+_0x3599fc(0xe1));if(!_0x342162)return console['log'](_0x3599fc(0x102)),0x0;}const {data:_0x3d6380}=await withSpinner(_0x3599fc(0x112),()=>_0x159839[_0x3599fc(0x105)][_0x3599fc(0xfd)](_0x2b1bf1,{'force':_0x4d44b9})),_0x57dc10=_0x3d6380[_0x3599fc(0x121)][_0x3599fc(0xe5)]['errors']>0x0||_0x3d6380['counts'][_0x3599fc(0xcf)]['errors']>0x0||_0x3d6380[_0x3599fc(0x121)]['textKnowledgeBases']['errors']>0x0||_0x3d6380['counts'][_0x3599fc(0x122)][_0x3599fc(0xd2)]>0x0;if(_0x57dc10){console['log'](a12_0x26b355[_0x3599fc(0x135)](_0x3599fc(0x100))),console['log'](),console[_0x3599fc(0xf0)](a12_0x26b355[_0x3599fc(0xe7)](_0x3599fc(0x15e)));for(const _0x420688 of _0x3d6380[_0x3599fc(0xe5)]){_0x420688['action']===_0x3599fc(0xdc)&&console[_0x3599fc(0xf0)](a12_0x26b355['red'](_0x3599fc(0x140)+_0x420688[_0x3599fc(0xf5)]+_0x3599fc(0xf8)+_0x420688['error']));}for(const _0x529b94 of _0x3d6380[_0x3599fc(0xcf)]){_0x529b94['action']===_0x3599fc(0xdc)&&console['log'](a12_0x26b355['red'](_0x3599fc(0xdb)+_0x529b94[_0x3599fc(0x11e)]+_0x3599fc(0xf8)+_0x529b94[_0x3599fc(0xdc)]));}for(const _0x3ea515 of _0x3d6380[_0x3599fc(0xd5)]){_0x3ea515['action']===_0x3599fc(0xdc)&&console['log'](a12_0x26b355[_0x3599fc(0xe7)](_0x3599fc(0xfb)+_0x3ea515['name']+_0x3599fc(0xf8)+_0x3ea515[_0x3599fc(0xdc)]));}for(const _0x33a94b of _0x3d6380['prompts']){_0x33a94b[_0x3599fc(0x147)]===_0x3599fc(0xdc)&&console['log'](a12_0x26b355[_0x3599fc(0xe7)](_0x3599fc(0x161)+_0x33a94b[_0x3599fc(0x11e)]+_0x3599fc(0xf8)+_0x33a94b[_0x3599fc(0xdc)]));}return 0x1;}console[_0x3599fc(0xf0)](a12_0x26b355[_0x3599fc(0x119)](_0x3599fc(0xea)+(_0x4ca03f+_0x93188a)+_0x3599fc(0xcc)+_0x3d6380[_0x3599fc(0xee)]+'\x27'));const _0x367e66=getLLMProjectUrl(_0x2bbed4,_0x3d6380['projectId']);return console[_0x3599fc(0xf0)](_0x3599fc(0x11c)+a12_0x26b355['cyan'](_0x367e66)),0x0;}}
1
+ const a12_0x3068e7=a12_0x31fe;(function(_0x484de9,_0x4b2347){const _0x3a9424=a12_0x31fe,_0x27d179=_0x484de9();while(!![]){try{const _0x31ba4e=parseInt(_0x3a9424(0x137))/0x1*(-parseInt(_0x3a9424(0xf6))/0x2)+-parseInt(_0x3a9424(0x112))/0x3*(parseInt(_0x3a9424(0x167))/0x4)+parseInt(_0x3a9424(0x115))/0x5+-parseInt(_0x3a9424(0x17e))/0x6+parseInt(_0x3a9424(0x152))/0x7+parseInt(_0x3a9424(0x18a))/0x8+-parseInt(_0x3a9424(0x142))/0x9*(-parseInt(_0x3a9424(0x157))/0xa);if(_0x31ba4e===_0x4b2347)break;else _0x27d179['push'](_0x27d179['shift']());}catch(_0x43c90b){_0x27d179['push'](_0x27d179['shift']());}}}(a12_0x21d9,0xa98f1));function a12_0x31fe(_0x49ed15,_0x5b04b4){_0x49ed15=_0x49ed15-0xf5;const _0x21d9d7=a12_0x21d9();let _0x31fe59=_0x21d9d7[_0x49ed15];return _0x31fe59;}import a12_0x47c8b5 from'chalk';import a12_0x2188e8 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../utils/agent-config.js';import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';function a12_0x21d9(){const _0x22d4b0=['push','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Pull\x20cancelled','\x20total','Analyzing\x20changes\x20to\x20push...','agents','Dry\x20run\x20-\x20no\x20changes\x20made','yes','\x20files?','\x22\x20to\x20\x22','isNew','3hYYIgN','site','Source:\x20','2648425DjAFRG','agentName','Using\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','New\x20project:\x20','Using\x20project\x20from\x20','Agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','updated','output','Pulling\x20agent\x20\x22','newProjectId','\x20resources?','Project:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','\x0aPull\x20summary\x20for\x20\x27','repeat','\x20\x20Text\x20Knowledge\x20Base\x20\x22','agent:push','Pushing\x20agent\x20from\x20\x22','green','session','\x0aPush\x20summary\x20for\x20\x27','llmProject','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a','\x20\x20Knowledge\x20Base\x20\x22','hasChanges','cloneProject','cyan','\x22\x20to\x20new\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20=\x20','New\x20project\x20ID:\x20','1wMeKkM','New\x20project\x20name\x20is\x20required','error','\x20|\x20','Would\x20pull\x20agent:\x20','✔\x20Context\x20set:\x20','Context\x20set:\x20','Chat:\x20','gray','Using\x20local\x20project:\x20','Current\x20context\x20has\x20llm_project=\x22','15237iBsVUL','llm_project','description','\x20\x20Prompt\x20\x22','created','\x20\x20Source:\x20','INVALID_ARGUMENT','Output\x20path:\x20','dim','\x20--name\x20','prompts','Output:\x20','Push\x20cancelled','Analyzing\x20project\x20\x22','textKnowledgeBases','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','6991334NmmwKV','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','utf-8','force','Dry\x20run\x20-\x20no\x20files\x20written','5750DNksWz','Errors:','profile','\x20\x20Agents:\x20','\x20resources\x20to\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','projectName','dirname','\x0a✔\x20Pulled\x20','Run\x20\x27tdx\x20agent\x20pull\x20','agentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Failed\x20to\x20push\x20agent:\x20','sourceProjectName','\x22...','errors','3225436mUyXBi','\x20--profile\x20','\x20\x20Target:\x20','newProjectName','\x20\x20Agent\x20\x22','new','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','projectId','Summary:','pushProject','\x20updated','yellow','\x20\x20Text\x20Knowledge\x20Bases:\x20','log','tdx.json','Would\x20push\x20agent:\x20','Pushing\x20to\x20project...','name','diff','Using\x20context\x20project:\x20','execute','\x20changed','\x0aChanges\x20to\x20prompt\x20\x27','4949346pGTKNp','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','unchanged','cwd','Agent\x20','\x20created','Writing\x20files...','outputPath','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPush\x20','join','knowledgeBases','8582304rEjqjh','action','\x20unchanged','\x0aProject\x20pushed\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','MISSING_ARGUMENT','\x20new','<new-name>','Status:\x20','pullAgent','2497894cmwvqr','counts','\x20files\x20to\x20','No\x20tdx.json\x20found\x20in\x20','\x22:\x20','\x22\x20to\x20a\x20different\x20profile','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x27\x20to\x20create\x20the\x20folder\x20structure.','Project\x20cloned\x20successfully','outputDir','llm','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','dryRun','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','parse','Cloning\x20\x22','red'];a12_0x21d9=function(){return _0x22d4b0;};return a12_0x21d9();}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';function formatCountSummary(_0x2fef32){const _0x47a029=a12_0x31fe,_0x3ea4e6=[];if(_0x2fef32['total']!==undefined)_0x3ea4e6[_0x47a029(0x107)](_0x2fef32['total']+_0x47a029(0x10a));if(_0x2fef32[_0x47a029(0x16c)]!==undefined&&_0x2fef32[_0x47a029(0x16c)]>0x0)_0x3ea4e6[_0x47a029(0x107)](a12_0x47c8b5[_0x47a029(0x12a)](_0x2fef32['new']+_0x47a029(0x190)));if(_0x2fef32[_0x47a029(0x146)]!==undefined&&_0x2fef32[_0x47a029(0x146)]>0x0)_0x3ea4e6[_0x47a029(0x107)](a12_0x47c8b5[_0x47a029(0x12a)](_0x2fef32[_0x47a029(0x146)]+_0x47a029(0x183)));if(_0x2fef32[_0x47a029(0x11d)]!==undefined&&_0x2fef32['updated']>0x0)_0x3ea4e6['push'](a12_0x47c8b5[_0x47a029(0x172)](_0x2fef32[_0x47a029(0x11d)]+_0x47a029(0x171)));if(_0x2fef32[_0x47a029(0x180)]!==undefined&&_0x2fef32[_0x47a029(0x180)]>0x0)_0x3ea4e6[_0x47a029(0x107)](a12_0x47c8b5['gray'](_0x2fef32[_0x47a029(0x180)]+_0x47a029(0x18c)));if(_0x2fef32['errors']!==undefined&&_0x2fef32[_0x47a029(0x166)]>0x0)_0x3ea4e6[_0x47a029(0x107)](a12_0x47c8b5['red'](_0x2fef32[_0x47a029(0x166)]+'\x20errors'));return _0x3ea4e6[_0x47a029(0x188)](',\x20');}function displayDiffs(_0x4758c2,_0x252ea9,_0x50b889,_0xcb2e8c){const _0x4793b9=a12_0x31fe;for(const _0x282dea of _0x4758c2){if(_0x282dea[_0x4793b9(0x179)]){const _0x244265=_0x282dea[_0x4793b9(0x116)]||_0x282dea['name'];console[_0x4793b9(0x174)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x244265+'\x27:'),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c)),console[_0x4793b9(0x174)](_0x282dea[_0x4793b9(0x179)]),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c));}}for(const _0x17c384 of _0x252ea9){_0x17c384[_0x4793b9(0x179)]&&(console[_0x4793b9(0x174)](_0x4793b9(0x123)+_0x17c384[_0x4793b9(0x178)]+'\x27:'),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c)),console[_0x4793b9(0x174)](_0x17c384['diff']),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c)));}for(const _0x53a4b9 of _0x50b889){_0x53a4b9[_0x4793b9(0x179)]&&(console[_0x4793b9(0x174)](_0x4793b9(0x108)+_0x53a4b9[_0x4793b9(0x178)]+'\x27:'),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c)),console['log'](_0x53a4b9[_0x4793b9(0x179)]),console['log']('─'[_0x4793b9(0x126)](0x3c)));}for(const _0x56baf1 of _0xcb2e8c){_0x56baf1[_0x4793b9(0x179)]&&(console['log'](_0x4793b9(0x17d)+_0x56baf1[_0x4793b9(0x178)]+'\x27:'),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c)),console[_0x4793b9(0x174)](_0x56baf1[_0x4793b9(0x179)]),console[_0x4793b9(0x174)]('─'[_0x4793b9(0x126)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a12_0x3068e7(0x178)]='agent:pull';['description']=a12_0x3068e7(0x17f);async[a12_0x3068e7(0x17b)](_0x430e03){const _0x4d5465=a12_0x3068e7,{options:_0x3c01eb,args:_0x58bb7e,tdx:_0x2b0dcf}=_0x430e03,_0x3b8a08=_0x58bb7e[0x0],_0x3df3ee=_0x58bb7e[0x1],_0x480591=_0x3c01eb[_0x4d5465(0x11e)],_0x7dfad0=_0x3c01eb[_0x4d5465(0x102)],_0x299b86=_0x3c01eb[_0x4d5465(0x155)],_0x2e2111=_0x3c01eb[_0x4d5465(0x10e)],_0xed5012=_0x3c01eb['llmProject'];let _0x39df7d,_0xbdc79a;const _0x23235=findAgentConfigPath(process[_0x4d5465(0x181)]());if(_0x3b8a08){const _0x41d0bf=a12_0x2188e8[_0x4d5465(0x188)](_0x3b8a08,'tdx.json');if(existsSync(_0x41d0bf))try{const _0x50d6ab=JSON['parse'](readFileSync(_0x41d0bf,_0x4d5465(0x154)));_0x39df7d=_0x50d6ab[_0x4d5465(0x143)],_0xbdc79a=_0x3b8a08,console[_0x4d5465(0x174)](a12_0x47c8b5['dim'](_0x4d5465(0x11a)+_0x41d0bf+':\x20'+_0x39df7d));}catch{_0x39df7d=_0x3b8a08;}else _0x39df7d=_0x3b8a08;}else{if(_0x23235)try{const _0x5d7e67=JSON[_0x4d5465(0x104)](readFileSync(_0x23235,_0x4d5465(0x154)));_0x39df7d=_0x5d7e67[_0x4d5465(0x143)],_0xbdc79a=a12_0x2188e8[_0x4d5465(0x15e)](_0x23235),console[_0x4d5465(0x174)](a12_0x47c8b5[_0x4d5465(0x14a)](_0x4d5465(0x117)+_0x39df7d));}catch{_0x39df7d=_0xed5012;}else _0x39df7d=_0xed5012;}if(!_0x39df7d)return console['log'](a12_0x47c8b5[_0x4d5465(0x172)](_0x4d5465(0x16d))),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4d5465(0x174)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x4d5465(0x174)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x4d5465(0x174)](_0x4d5465(0x162)),0x1;if(_0x3df3ee){const {data:_0x455c1e}=await withSpinner(_0x4d5465(0x11f)+_0x3df3ee+'\x22\x20from\x20project\x20\x22'+_0x39df7d+_0x4d5465(0x165),()=>_0x2b0dcf['llm'][_0x4d5465(0xf5)](_0x39df7d,_0x3df3ee,_0x480591,{'dryRun':_0x7dfad0,'force':_0x299b86}));if(_0x7dfad0)return console['log'](a12_0x47c8b5[_0x4d5465(0x172)](_0x4d5465(0x156))),console[_0x4d5465(0x174)](_0x4d5465(0x13b)+_0x455c1e[_0x4d5465(0x116)]),console[_0x4d5465(0x174)](_0x4d5465(0x149)+_0x455c1e[_0x4d5465(0x185)]),_0x455c1e['diff']&&(console[_0x4d5465(0x174)]('\x0aChanges:'),console[_0x4d5465(0x174)]('─'[_0x4d5465(0x126)](0x3c)),console[_0x4d5465(0x174)](_0x455c1e['diff']),console[_0x4d5465(0x174)]('─'[_0x4d5465(0x126)](0x3c))),0x0;return console['log'](a12_0x47c8b5[_0x4d5465(0x12a)]('Agent\x20pulled\x20successfully')),console['log'](_0x4d5465(0x11b)+_0x455c1e[_0x4d5465(0x116)]),console[_0x4d5465(0x174)](_0x4d5465(0x14d)+_0x455c1e[_0x4d5465(0x185)]),console['log'](_0x4d5465(0x192)+(_0x455c1e[_0x4d5465(0x111)]?a12_0x47c8b5[_0x4d5465(0x12a)]('new'):_0x455c1e[_0x4d5465(0x130)]?a12_0x47c8b5[_0x4d5465(0x172)](_0x4d5465(0x11d)):a12_0x47c8b5[_0x4d5465(0x13f)](_0x4d5465(0x180)))),0x0;}const _0x5698a8=_0xbdc79a||_0x480591,{data:_0x25bff7}=await withSpinner(_0x4d5465(0x14f)+_0x39df7d+_0x4d5465(0x165),()=>_0x2b0dcf[_0x4d5465(0x100)]['pullProject'](_0x39df7d,_0x5698a8,{'dryRun':!![]})),_0x488ecf=_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x10c)][_0x4d5465(0x16c)]+_0x25bff7['counts'][_0x4d5465(0x189)][_0x4d5465(0x16c)]+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x150)][_0x4d5465(0x16c)]+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x14c)][_0x4d5465(0x16c)],_0x27efe2=_0x25bff7[_0x4d5465(0xf7)]['agents'][_0x4d5465(0x11d)]+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x189)][_0x4d5465(0x11d)]+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x150)][_0x4d5465(0x11d)]+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x14c)]['updated'],_0x50e886=_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x10c)][_0x4d5465(0x180)]+_0x25bff7[_0x4d5465(0xf7)]['knowledgeBases']['unchanged']+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x150)]['unchanged']+_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x14c)][_0x4d5465(0x180)];console[_0x4d5465(0x174)](_0x4d5465(0x125)+_0x25bff7['projectName']+'\x27:'),console[_0x4d5465(0x174)]('\x20\x20'+a12_0x47c8b5['green']('+\x20'+_0x488ecf+'\x20new')+'\x20|\x20'+a12_0x47c8b5[_0x4d5465(0x172)]('~\x20'+_0x27efe2+_0x4d5465(0x17c))+_0x4d5465(0x13a)+a12_0x47c8b5[_0x4d5465(0x14a)]('=\x20'+_0x50e886+_0x4d5465(0x18c))),console[_0x4d5465(0x174)]('\x20\x20Agents:\x20'+formatCountSummary(_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x10c)])),console['log'](_0x4d5465(0x118)+formatCountSummary(_0x25bff7[_0x4d5465(0xf7)]['knowledgeBases'])),console[_0x4d5465(0x174)](_0x4d5465(0x173)+formatCountSummary(_0x25bff7['counts'][_0x4d5465(0x150)])),console[_0x4d5465(0x174)](_0x4d5465(0x124)+formatCountSummary(_0x25bff7[_0x4d5465(0xf7)][_0x4d5465(0x14c)])),console[_0x4d5465(0x174)](_0x4d5465(0x169)+a12_0x47c8b5[_0x4d5465(0x132)](_0x25bff7[_0x4d5465(0xff)])),displayDiffs(_0x25bff7[_0x4d5465(0x10c)],_0x25bff7[_0x4d5465(0x189)],_0x25bff7['textKnowledgeBases'],_0x25bff7[_0x4d5465(0x14c)]);if(_0x7dfad0)return console[_0x4d5465(0x174)](a12_0x47c8b5[_0x4d5465(0x172)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x488ecf===0x0&&_0x27efe2===0x0)return console[_0x4d5465(0x174)](a12_0x47c8b5[_0x4d5465(0x12a)](_0x4d5465(0x186))),saveSessionContext({'llm_project':_0x25bff7['projectName']},_0x3c01eb['session']),console['log'](a12_0x47c8b5['green']('✔\x20Context\x20set:\x20'+a12_0x47c8b5[_0x4d5465(0x14a)](_0x4d5465(0x143))+_0x4d5465(0x135)+a12_0x47c8b5[_0x4d5465(0x132)](_0x25bff7[_0x4d5465(0x15d)]))),0x0;if(!_0x2e2111&&!_0x299b86){const _0x57dfa5=await confirmKey('\x0aWrite\x20'+(_0x488ecf+_0x27efe2)+_0x4d5465(0x10f));if(!_0x57dfa5)return console[_0x4d5465(0x174)](_0x4d5465(0x109)),0x0;}const {data:_0x2f8445}=await withSpinner(_0x4d5465(0x184),()=>_0x2b0dcf['llm']['pullProject'](_0x39df7d,_0x5698a8,{'force':_0x299b86}));return console[_0x4d5465(0x174)](a12_0x47c8b5[_0x4d5465(0x12a)](_0x4d5465(0x15f)+(_0x488ecf+_0x27efe2)+_0x4d5465(0xf8)+_0x2f8445['outputDir'])),saveSessionContext({'llm_project':_0x2f8445[_0x4d5465(0x15d)]},_0x3c01eb['session']),console[_0x4d5465(0x174)](a12_0x47c8b5[_0x4d5465(0x12a)](_0x4d5465(0x13c)+a12_0x47c8b5['dim'](_0x4d5465(0x143))+_0x4d5465(0x135)+a12_0x47c8b5[_0x4d5465(0x132)](_0x2f8445[_0x4d5465(0x15d)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a12_0x3068e7(0x178)]='agent:clone';[a12_0x3068e7(0x144)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a12_0x3068e7(0x17b)](_0x220bee){const _0x3a1280=a12_0x3068e7,{options:_0x335570,args:_0x2af62c,tdx:_0x4c1a3c}=_0x220bee,_0x20eea0=_0x2af62c[0x0],_0x292eac=_0x335570[_0x3a1280(0x178)],_0x6627ee=_0x335570[_0x3a1280(0x102)],_0x6f65ed=_0x335570['yes'],_0x11c826=_0x335570[_0x3a1280(0x113)],_0x6ebcd6=_0x335570[_0x3a1280(0x12d)];let _0x5d9a24;const _0x58ef4e=findAgentConfigPath(process['cwd']());if(_0x20eea0){const _0x3fa75d=a12_0x2188e8['join'](_0x20eea0,_0x3a1280(0x175));existsSync(_0x3fa75d)?(_0x5d9a24=_0x20eea0,console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x14a)](_0x3a1280(0x140)+_0x20eea0))):_0x5d9a24=_0x20eea0;}else{if(_0x58ef4e)_0x5d9a24=a12_0x2188e8[_0x3a1280(0x15e)](_0x58ef4e),console[_0x3a1280(0x174)](a12_0x47c8b5['dim']('Using\x20current\x20project:\x20'+_0x5d9a24));else{if(_0x6ebcd6){const _0x14ea53=normalizeName(_0x6ebcd6),_0x45380f=a12_0x2188e8[_0x3a1280(0x188)](process[_0x3a1280(0x181)](),'agents',_0x14ea53,_0x3a1280(0x175));if(existsSync(_0x45380f))_0x5d9a24=a12_0x2188e8[_0x3a1280(0x15e)](_0x45380f),console['log'](a12_0x47c8b5[_0x3a1280(0x14a)](_0x3a1280(0x140)+_0x5d9a24));else{const _0xe0c1a7=_0x335570[_0x3a1280(0x159)];if(_0xe0c1a7)throw new SDKError(ErrorCode[_0x3a1280(0x148)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x6ebcd6+_0x3a1280(0xfb),undefined,{'helpText':_0x3a1280(0x134)+_0x3a1280(0x151)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x6ebcd6+'\x0a')+(_0x3a1280(0x11c)+_0x14ea53+_0x3a1280(0x14b)+(_0x292eac||_0x3a1280(0x191))+_0x3a1280(0x168)+_0xe0c1a7)});_0x5d9a24=_0x6ebcd6,console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x14a)](_0x3a1280(0x17a)+_0x6ebcd6));}}}}if(!_0x5d9a24)return console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x172)](_0x3a1280(0x153))),console[_0x3a1280(0x174)](_0x3a1280(0x18e)),console[_0x3a1280(0x174)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x3a1280(0x174)](_0x3a1280(0x103)),console[_0x3a1280(0x174)](_0x3a1280(0x15c)),0x1;if(!_0x292eac)throw new SDKError(ErrorCode[_0x3a1280(0x18f)],_0x3a1280(0x138),undefined,{'helpText':_0x3a1280(0xfc)});if(!_0x6f65ed&&!_0x6627ee){const _0x5d2b87=await confirmKey('Clone\x20\x22'+_0x5d9a24+_0x3a1280(0x133)+_0x292eac+'\x22?');if(!_0x5d2b87)return console[_0x3a1280(0x174)]('Clone\x20cancelled'),0x0;}const {data:_0x323820}=await withSpinner(_0x3a1280(0x105)+_0x5d9a24+_0x3a1280(0x110)+_0x292eac+_0x3a1280(0x165),()=>_0x4c1a3c['llm'][_0x3a1280(0x131)](_0x5d9a24,_0x292eac,{'dryRun':_0x6627ee}));if(_0x6627ee)return console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x172)](_0x3a1280(0x10d))),console[_0x3a1280(0x174)](_0x3a1280(0x114)+_0x323820[_0x3a1280(0x164)]),console[_0x3a1280(0x174)](_0x3a1280(0x119)+_0x292eac),console[_0x3a1280(0x174)]('Would\x20clone:'),console[_0x3a1280(0x174)]('\x20\x20Agents:\x20'+_0x323820[_0x3a1280(0xf7)][_0x3a1280(0x10c)][_0x3a1280(0x146)]),console[_0x3a1280(0x174)](_0x3a1280(0x118)+_0x323820[_0x3a1280(0xf7)]['knowledgeBases']['created']),console[_0x3a1280(0x174)]('\x20\x20Prompts:\x20'+_0x323820[_0x3a1280(0xf7)][_0x3a1280(0x14c)]['created']),0x0;const _0x589956=_0x323820[_0x3a1280(0xf7)][_0x3a1280(0x10c)][_0x3a1280(0x166)]>0x0||_0x323820[_0x3a1280(0xf7)][_0x3a1280(0x189)][_0x3a1280(0x166)]>0x0||_0x323820[_0x3a1280(0xf7)][_0x3a1280(0x14c)][_0x3a1280(0x166)]>0x0;_0x589956?console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x172)]('Project\x20cloned\x20with\x20errors')):console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x12a)](_0x3a1280(0xfe)));console[_0x3a1280(0x174)]('Source:\x20'+_0x323820['sourceProjectName']),console['log'](_0x3a1280(0x119)+_0x323820['newProjectName']),console[_0x3a1280(0x174)](_0x3a1280(0x136)+_0x323820[_0x3a1280(0x120)]),console[_0x3a1280(0x174)](),console['log'](_0x3a1280(0x16f)),console[_0x3a1280(0x174)](_0x3a1280(0x15a)+formatCountSummary(_0x323820[_0x3a1280(0xf7)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x323820[_0x3a1280(0xf7)][_0x3a1280(0x189)])),console[_0x3a1280(0x174)](_0x3a1280(0x124)+formatCountSummary(_0x323820[_0x3a1280(0xf7)]['prompts']));if(_0x589956){console[_0x3a1280(0x174)](),console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x106)](_0x3a1280(0x158)));for(const _0x5ac3e0 of _0x323820[_0x3a1280(0x10c)]){_0x5ac3e0[_0x3a1280(0x18b)]===_0x3a1280(0x139)&&console['log'](a12_0x47c8b5['red']('\x20\x20Agent\x20\x22'+_0x5ac3e0[_0x3a1280(0x116)]+_0x3a1280(0xfa)+_0x5ac3e0[_0x3a1280(0x139)]));}for(const _0x488374 of _0x323820[_0x3a1280(0x189)]){_0x488374[_0x3a1280(0x18b)]===_0x3a1280(0x139)&&console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x106)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x488374['name']+_0x3a1280(0xfa)+_0x488374['error']));}for(const _0xfdc85f of _0x323820[_0x3a1280(0x14c)]){_0xfdc85f[_0x3a1280(0x18b)]===_0x3a1280(0x139)&&console[_0x3a1280(0x174)](a12_0x47c8b5['red'](_0x3a1280(0x145)+_0xfdc85f[_0x3a1280(0x178)]+_0x3a1280(0xfa)+_0xfdc85f[_0x3a1280(0x139)]));}return 0x1;}saveSessionContext({'llm_project':_0x323820[_0x3a1280(0x16a)]},_0x335570[_0x3a1280(0x12b)]),console[_0x3a1280(0x174)](),console[_0x3a1280(0x174)](a12_0x47c8b5[_0x3a1280(0x12a)](_0x3a1280(0x13d)+a12_0x47c8b5[_0x3a1280(0x14a)]('llm_project')+_0x3a1280(0x135)+a12_0x47c8b5[_0x3a1280(0x132)](_0x323820[_0x3a1280(0x16a)])));const _0x5d7932=getLLMProjectUrl(_0x11c826,_0x323820[_0x3a1280(0x120)]);return console[_0x3a1280(0x174)]('Project:\x20'+a12_0x47c8b5[_0x3a1280(0x132)](_0x5d7932)),0x0;}}export class AgentPushCommand extends BaseCommand{[a12_0x3068e7(0x178)]=a12_0x3068e7(0x128);[a12_0x3068e7(0x144)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a12_0x3068e7(0x17b)](_0x10fb5b){const _0x47409e=a12_0x3068e7,{options:_0x33f7bb,args:_0x499adc,tdx:_0x2b192f}=_0x10fb5b;let _0x1e0368=_0x499adc[0x0]||process[_0x47409e(0x181)]();const _0x5ebae1=_0x33f7bb[_0x47409e(0x102)],_0x31c754=_0x33f7bb[_0x47409e(0x155)],_0x48681b=_0x33f7bb[_0x47409e(0x10e)],_0x3759a4=_0x33f7bb[_0x47409e(0x113)],_0x579091=a12_0x2188e8[_0x47409e(0x188)](_0x1e0368,'agent.yml'),_0x371a12=existsSync(_0x579091);if(_0x371a12){const {data:_0x9ac4a2}=await withSpinner(_0x47409e(0x129)+_0x1e0368+'\x22...',()=>_0x2b192f[_0x47409e(0x100)]['pushAgent'](_0x1e0368,{'dryRun':_0x5ebae1,'force':_0x31c754}));if(_0x5ebae1)return console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x172)](_0x47409e(0x10d))),console[_0x47409e(0x174)](_0x47409e(0x176)+_0x9ac4a2['agentName']),0x0;if(_0x9ac4a2[_0x47409e(0x18b)]===_0x47409e(0x139))return console['log'](a12_0x47c8b5[_0x47409e(0x106)](_0x47409e(0x163)+_0x9ac4a2['error'])),0x1;console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x12a)](_0x47409e(0x182)+_0x9ac4a2[_0x47409e(0x18b)]+'\x20successfully')),console['log'](_0x47409e(0x11b)+_0x9ac4a2[_0x47409e(0x116)]);if(_0x9ac4a2['agentId']&&_0x9ac4a2[_0x47409e(0x16e)]){const _0x34d6d0=getLLMAgentChatUrl(_0x3759a4,_0x9ac4a2[_0x47409e(0x16e)],_0x9ac4a2[_0x47409e(0x161)]);console[_0x47409e(0x174)](_0x47409e(0x13e)+a12_0x47c8b5['cyan'](_0x34d6d0));}return 0x0;}let _0x1392b1=a12_0x2188e8['join'](_0x1e0368,'tdx.json');if(!existsSync(_0x1392b1)){const _0x52fc42=findAgentConfigPath(_0x1e0368);if(_0x52fc42)_0x1e0368=a12_0x2188e8[_0x47409e(0x15e)](_0x52fc42),_0x1392b1=_0x52fc42,console[_0x47409e(0x174)](a12_0x47c8b5['dim'](_0x47409e(0x117)+_0x1e0368));else{const _0x148932=_0x33f7bb['llmProject'];if(_0x148932){const _0x344adb=normalizeName(_0x148932),_0x53854d=a12_0x2188e8[_0x47409e(0x188)](_0x1e0368,_0x47409e(0x10c)),_0x370c3a=a12_0x2188e8['join'](_0x53854d,_0x344adb,_0x47409e(0x175));existsSync(_0x370c3a)&&(_0x1e0368=a12_0x2188e8[_0x47409e(0x15e)](_0x370c3a),_0x1392b1=_0x370c3a,console[_0x47409e(0x174)](a12_0x47c8b5['dim'](_0x47409e(0x117)+_0x1e0368)));}if(!existsSync(_0x1392b1)){let _0x5d86e2='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x148932&&(_0x5d86e2=_0x47409e(0x141)+_0x148932+_0x47409e(0x12e)+(_0x47409e(0x160)+_0x148932+_0x47409e(0xfd)));throw new SDKError(ErrorCode[_0x47409e(0x148)],_0x47409e(0xf9)+_0x1e0368,undefined,{'helpText':_0x5d86e2});}}}const {data:_0x2ab01b}=await withSpinner(_0x47409e(0x10b),()=>_0x2b192f['llm']['pushProject'](_0x1e0368,{'dryRun':!![]})),_0x17e1ff=_0x2ab01b['counts']['agents'][_0x47409e(0x166)]>0x0;if(_0x17e1ff){console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x106)]('\x0aErrors\x20found:'));for(const _0x5c0aef of _0x2ab01b[_0x47409e(0x10c)]){_0x5c0aef['action']===_0x47409e(0x139)&&console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x106)](_0x47409e(0x16b)+_0x5c0aef[_0x47409e(0x116)]+_0x47409e(0xfa)+_0x5c0aef[_0x47409e(0x139)]));}return 0x1;}const _0x2fcc07=_0x2ab01b['counts'][_0x47409e(0x10c)][_0x47409e(0x146)]+_0x2ab01b[_0x47409e(0xf7)][_0x47409e(0x189)][_0x47409e(0x146)]+_0x2ab01b['counts'][_0x47409e(0x150)][_0x47409e(0x146)]+_0x2ab01b[_0x47409e(0xf7)]['prompts'][_0x47409e(0x146)],_0x59022d=_0x2ab01b['counts']['agents'][_0x47409e(0x11d)]+_0x2ab01b[_0x47409e(0xf7)]['knowledgeBases']['updated']+_0x2ab01b[_0x47409e(0xf7)][_0x47409e(0x150)][_0x47409e(0x11d)]+_0x2ab01b[_0x47409e(0xf7)]['prompts'][_0x47409e(0x11d)],_0x581b43=_0x2ab01b[_0x47409e(0xf7)][_0x47409e(0x10c)][_0x47409e(0x180)]+_0x2ab01b[_0x47409e(0xf7)]['knowledgeBases'][_0x47409e(0x180)]+_0x2ab01b[_0x47409e(0xf7)][_0x47409e(0x150)]['unchanged']+_0x2ab01b['counts'][_0x47409e(0x14c)][_0x47409e(0x180)];console[_0x47409e(0x174)](_0x47409e(0x12c)+_0x2ab01b[_0x47409e(0x15d)]+'\x27:'),console['log']('\x20\x20'+a12_0x47c8b5['green']('+\x20'+_0x2fcc07+_0x47409e(0x190))+_0x47409e(0x13a)+a12_0x47c8b5[_0x47409e(0x172)]('~\x20'+_0x59022d+_0x47409e(0x17c))+_0x47409e(0x13a)+a12_0x47c8b5[_0x47409e(0x14a)]('=\x20'+_0x581b43+'\x20unchanged')),console['log'](_0x47409e(0x15a)+formatCountSummary(_0x2ab01b[_0x47409e(0xf7)]['agents'])),console['log'](_0x47409e(0x118)+formatCountSummary(_0x2ab01b['counts'][_0x47409e(0x189)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2ab01b[_0x47409e(0xf7)][_0x47409e(0x150)])),console[_0x47409e(0x174)](_0x47409e(0x124)+formatCountSummary(_0x2ab01b['counts'][_0x47409e(0x14c)])),console['log'](_0x47409e(0x147)+a12_0x47c8b5[_0x47409e(0x132)](_0x1e0368)),displayDiffs(_0x2ab01b[_0x47409e(0x10c)],_0x2ab01b[_0x47409e(0x189)],_0x2ab01b['textKnowledgeBases'],_0x2ab01b[_0x47409e(0x14c)]);if(_0x5ebae1)return console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x172)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2fcc07===0x0&&_0x59022d===0x0){console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x12a)](_0x47409e(0x101)));const _0x409f7a=getLLMProjectUrl(_0x3759a4,_0x2ab01b[_0x47409e(0x16e)]);return console[_0x47409e(0x174)](_0x47409e(0x122)+a12_0x47c8b5['cyan'](_0x409f7a)),0x0;}if(!_0x48681b&&!_0x31c754){const _0x25529f=await confirmKey(_0x47409e(0x187)+(_0x2fcc07+_0x59022d)+_0x47409e(0x121));if(!_0x25529f)return console[_0x47409e(0x174)](_0x47409e(0x14e)),0x0;}const {data:_0x5ea680}=await withSpinner(_0x47409e(0x177),()=>_0x2b192f['llm'][_0x47409e(0x170)](_0x1e0368,{'force':_0x31c754})),_0x5eae19=_0x5ea680['counts'][_0x47409e(0x10c)][_0x47409e(0x166)]>0x0||_0x5ea680[_0x47409e(0xf7)][_0x47409e(0x189)][_0x47409e(0x166)]>0x0||_0x5ea680[_0x47409e(0xf7)]['textKnowledgeBases']['errors']>0x0||_0x5ea680['counts'][_0x47409e(0x14c)][_0x47409e(0x166)]>0x0;if(_0x5eae19){console['log'](a12_0x47c8b5[_0x47409e(0x172)](_0x47409e(0x18d))),console[_0x47409e(0x174)](),console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x106)](_0x47409e(0x158)));for(const _0xdaf7ec of _0x5ea680[_0x47409e(0x10c)]){_0xdaf7ec[_0x47409e(0x18b)]===_0x47409e(0x139)&&console[_0x47409e(0x174)](a12_0x47c8b5['red'](_0x47409e(0x16b)+_0xdaf7ec[_0x47409e(0x116)]+_0x47409e(0xfa)+_0xdaf7ec[_0x47409e(0x139)]));}for(const _0x1923aa of _0x5ea680[_0x47409e(0x189)]){_0x1923aa[_0x47409e(0x18b)]===_0x47409e(0x139)&&console[_0x47409e(0x174)](a12_0x47c8b5['red'](_0x47409e(0x12f)+_0x1923aa[_0x47409e(0x178)]+_0x47409e(0xfa)+_0x1923aa['error']));}for(const _0xe81b42 of _0x5ea680['textKnowledgeBases']){_0xe81b42[_0x47409e(0x18b)]===_0x47409e(0x139)&&console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x106)](_0x47409e(0x127)+_0xe81b42['name']+_0x47409e(0xfa)+_0xe81b42[_0x47409e(0x139)]));}for(const _0x1b92a7 of _0x5ea680[_0x47409e(0x14c)]){_0x1b92a7[_0x47409e(0x18b)]===_0x47409e(0x139)&&console['log'](a12_0x47c8b5['red'](_0x47409e(0x145)+_0x1b92a7[_0x47409e(0x178)]+_0x47409e(0xfa)+_0x1b92a7[_0x47409e(0x139)]));}return 0x1;}console[_0x47409e(0x174)](a12_0x47c8b5[_0x47409e(0x12a)]('\x0a✔\x20Pushed\x20'+(_0x2fcc07+_0x59022d)+_0x47409e(0x15b)+_0x5ea680[_0x47409e(0x15d)]+'\x27'));const _0x377391=getLLMProjectUrl(_0x3759a4,_0x5ea680[_0x47409e(0x16e)]);return console[_0x47409e(0x174)](_0x47409e(0x122)+a12_0x47c8b5[_0x47409e(0x132)](_0x377391)),0x0;}}
@@ -1 +1 @@
1
- function a13_0x34a2(){const _0x2d7204=['GET','authorization','file','toUpperCase','PATCH','79950INfsWT','keys','set-cookie','log','status','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','14yGvKmI','message','isArray','cdp','Invalid\x20header\x20format:\x20\x22','x-xsrf-token','includes','color','1683605Oyxquh','llm','method','100577vGcZvP','noColor','1100770gjMToZ','toLowerCase','error','PUT','type','join','423OuRSwv','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','proxy-authorization','length','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','description','31350uQzzDv','30920JDfIQV','x-auth-token','name','\x0aStack\x20trace:\x0a','request','stack','POST','validate','api','readBodyFromFile','body','.\x20Valid\x20methods:\x20','trim','Invalid\x20API\x20type:\x20','entries','data','verbose','set-cookie2','output','trino','execute','workflow','header','cookie','16jhOCwN','Invalid\x20HTTP\x20method:\x20','Error:\x20','headers','62619VXtCFs'];a13_0x34a2=function(){return _0x2d7204;};return a13_0x34a2();}const a13_0x2adbae=a13_0x2f69;(function(_0x3e0346,_0x201b91){const _0x4e4af4=a13_0x2f69,_0x112155=_0x3e0346();while(!![]){try{const _0xff7d3=parseInt(_0x4e4af4(0x1ce))/0x1+parseInt(_0x4e4af4(0x1c3))/0x2*(parseInt(_0x4e4af4(0x1f9))/0x3)+-parseInt(_0x4e4af4(0x1f5))/0x4*(-parseInt(_0x4e4af4(0x1bd))/0x5)+-parseInt(_0x4e4af4(0x1dc))/0x6+-parseInt(_0x4e4af4(0x1cb))/0x7+-parseInt(_0x4e4af4(0x1dd))/0x8*(-parseInt(_0x4e4af4(0x1d6))/0x9)+-parseInt(_0x4e4af4(0x1d0))/0xa;if(_0xff7d3===_0x201b91)break;else _0x112155['push'](_0x112155['shift']());}catch(_0x238c70){_0x112155['push'](_0x112155['shift']());}}}(a13_0x34a2,0x21526));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a13_0x2f69(_0x1e3796,_0x1f6280){_0x1e3796=_0x1e3796-0x1bd;const _0x34a280=a13_0x34a2();let _0x2f69dd=_0x34a280[_0x1e3796];return _0x2f69dd;}const SENSITIVE_HEADERS=new Set([a13_0x2adbae(0x1fb),a13_0x2adbae(0x1d8),a13_0x2adbae(0x1f4),a13_0x2adbae(0x1bf),a13_0x2adbae(0x1ee),a13_0x2adbae(0x1c8),a13_0x2adbae(0x1de),'x-trino-user']);function isSensitiveHeader(_0x5a5d94){const _0x54b518=a13_0x2adbae;return SENSITIVE_HEADERS['has'](_0x5a5d94[_0x54b518(0x1d1)]());}function parseHeader(_0xdff06){const _0x4f2fe4=a13_0x2adbae,_0x399f55=_0xdff06['indexOf'](':');if(_0x399f55===-0x1)throw new Error(_0x4f2fe4(0x1c7)+_0xdff06+'\x22.\x20'+_0x4f2fe4(0x1c2));const _0x13513d=_0xdff06['substring'](0x0,_0x399f55)[_0x4f2fe4(0x1e9)](),_0x503ea3=_0xdff06['substring'](_0x399f55+0x1)[_0x4f2fe4(0x1e9)]();if(!_0x13513d)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0xdff06+'\x22');return[_0x13513d,_0x503ea3];}export class ApiCommand extends BaseCommand{[a13_0x2adbae(0x1df)]=a13_0x2adbae(0x1e5);[a13_0x2adbae(0x1db)]=a13_0x2adbae(0x1da);[a13_0x2adbae(0x1e4)](_0x45f565){const _0x5797ff=a13_0x2adbae,{args:_0x2ab472,options:_0x4a1bfa}=_0x45f565,_0x16ef03=_0x4a1bfa;if(_0x2ab472[_0x5797ff(0x1d9)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2a6b5b=_0x2ab472[0x0];if(!_0x2a6b5b['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x2a6b5b;const _0x453379=_0x16ef03[_0x5797ff(0x1ec)],_0x38c1f1=_0x16ef03['file'];if(_0x453379&&_0x38c1f1)return _0x5797ff(0x1d7);const _0xe6204=_0x16ef03[_0x5797ff(0x1cd)]||_0x5797ff(0x1fa),_0x19c900=[_0x5797ff(0x1fa),_0x5797ff(0x1e3),_0x5797ff(0x1d3),'DELETE',_0x5797ff(0x1fe)];if(!_0x19c900['includes'](_0xe6204[_0x5797ff(0x1fd)]()))return _0x5797ff(0x1f6)+_0xe6204+_0x5797ff(0x1e8)+_0x19c900[_0x5797ff(0x1d5)](',\x20');const _0x43079f=_0x16ef03[_0x5797ff(0x1d4)]||'td',_0x947642=['td',_0x5797ff(0x1c6),_0x5797ff(0x1f2),_0x5797ff(0x1f0),_0x5797ff(0x1cc)];if(!_0x947642[_0x5797ff(0x1c9)](_0x43079f))return _0x5797ff(0x1ea)+_0x43079f+'.\x20Valid\x20types:\x20'+_0x947642[_0x5797ff(0x1d5)](',\x20');return undefined;}async[a13_0x2adbae(0x1f1)](_0x48396e){const _0x384d47=a13_0x2adbae,{options:_0x424e27,args:_0xc8af2a,tdx:_0x183bda}=_0x48396e,_0x5c75f8=_0x424e27,_0x35f8a9=_0xc8af2a[0x0],_0x47b354=(_0x5c75f8[_0x384d47(0x1cd)]||_0x384d47(0x1fa))[_0x384d47(0x1fd)](),_0xa08d03=_0x5c75f8[_0x384d47(0x1ec)],_0x21f24e=_0x5c75f8[_0x384d47(0x1fc)],_0x36d959=_0x5c75f8[_0x384d47(0x1f3)],_0x1417ec=_0x5c75f8[_0x384d47(0x1d4)]||'td';try{const _0x7e1c0={};if(_0x36d959){const _0x461307=Array[_0x384d47(0x1c5)](_0x36d959)?_0x36d959:[_0x36d959];for(const _0x2c67b7 of _0x461307){const [_0x158d64,_0x4cbe93]=parseHeader(_0x2c67b7);_0x7e1c0[_0x158d64]=_0x4cbe93;}}let _0x1f85fe;if(_0xa08d03)_0x1f85fe=_0xa08d03;else{if(_0x21f24e)try{_0x1f85fe=RawAPI[_0x384d47(0x1e6)](_0x21f24e);}catch(_0x10d80e){return console[_0x384d47(0x1d2)](_0x384d47(0x1f7)+(_0x10d80e instanceof Error?_0x10d80e['message']:String(_0x10d80e))),0x1;}}const _0x2ce470={'method':_0x47b354,'apiType':_0x1417ec,'includeHeaders':_0x424e27[_0x384d47(0x1ed)]};_0x1f85fe&&(_0x2ce470[_0x384d47(0x1e7)]=_0x1f85fe);Object[_0x384d47(0x1be)](_0x7e1c0)[_0x384d47(0x1d9)]>0x0&&(_0x2ce470[_0x384d47(0x1f8)]=_0x7e1c0);if(_0x424e27[_0x384d47(0x1ed)]){const _0x5656bc=resolveSite(_0x424e27['site']),_0xa52943=getEndpoint(_0x5656bc,_0x1417ec),_0x6d31c4=''+_0xa52943+_0x35f8a9;console[_0x384d47(0x1d2)]('>\x20'+_0x47b354+'\x20'+_0x6d31c4);const _0x10589f=getAuthHeaders(_0x5656bc),_0x255540={..._0x10589f,..._0x7e1c0};for(const [_0x42027a,_0x46bd97]of Object[_0x384d47(0x1eb)](_0x255540)){!isSensitiveHeader(_0x42027a)&&console[_0x384d47(0x1d2)]('>\x20'+_0x42027a+':\x20'+_0x46bd97);}_0x1f85fe&&console[_0x384d47(0x1d2)]('>'),console[_0x384d47(0x1d2)]('');}const _0x12f993=await _0x183bda[_0x384d47(0x1e5)][_0x384d47(0x1e1)](_0x35f8a9,_0x2ce470);if(_0x424e27[_0x384d47(0x1ed)]&&_0x12f993[_0x384d47(0x1f8)]){console[_0x384d47(0x1d2)]('<\x20HTTP/1.1\x20'+_0x12f993[_0x384d47(0x1c1)]);for(const [_0x144a30,_0x312e1f]of Object[_0x384d47(0x1eb)](_0x12f993[_0x384d47(0x1f8)])){!isSensitiveHeader(_0x144a30)&&console['error']('<\x20'+_0x144a30+':\x20'+_0x312e1f);}console[_0x384d47(0x1d2)]('');}const _0xcebe7c=Boolean(_0x424e27[_0x384d47(0x1ef)]),_0x4b4c9c={'color':_0x424e27[_0x384d47(0x1ca)],'noColor':_0x424e27[_0x384d47(0x1cf)]||_0xcebe7c&&!_0x424e27['color']},_0x2a93af=colorizeJSON(_0x12f993['data'],_0x4b4c9c);return _0x424e27[_0x384d47(0x1ef)]?(writeFileSync(_0x424e27['output'],_0x2a93af),console[_0x384d47(0x1d2)]('Results\x20saved\x20to\x20'+_0x424e27['output'])):console[_0x384d47(0x1c0)](_0x2a93af),0x0;}catch(_0x3cd334){return _0x3cd334 instanceof Error?(console['error'](_0x384d47(0x1f7)+_0x3cd334[_0x384d47(0x1c4)]),_0x424e27['verbose']&&_0x3cd334[_0x384d47(0x1e2)]&&console['error'](_0x384d47(0x1e0)+_0x3cd334['stack'])):console[_0x384d47(0x1d2)](_0x384d47(0x1f7)+String(_0x3cd334)),0x1;}}}
1
+ const a13_0x350866=a13_0x3fbf;(function(_0x1b8ae2,_0x507cd3){const _0xcf4532=a13_0x3fbf,_0x20a3e2=_0x1b8ae2();while(!![]){try{const _0x4b8228=-parseInt(_0xcf4532(0x18a))/0x1*(parseInt(_0xcf4532(0x1b7))/0x2)+parseInt(_0xcf4532(0x188))/0x3+parseInt(_0xcf4532(0x195))/0x4+-parseInt(_0xcf4532(0x19f))/0x5+-parseInt(_0xcf4532(0x1a5))/0x6*(parseInt(_0xcf4532(0x1b3))/0x7)+parseInt(_0xcf4532(0x1a3))/0x8*(parseInt(_0xcf4532(0x178))/0x9)+-parseInt(_0xcf4532(0x185))/0xa*(-parseInt(_0xcf4532(0x17f))/0xb);if(_0x4b8228===_0x507cd3)break;else _0x20a3e2['push'](_0x20a3e2['shift']());}catch(_0x22ba1a){_0x20a3e2['push'](_0x20a3e2['shift']());}}}(a13_0x455d,0xd3794));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a13_0x3fbf(_0x1e753e,_0x1ade85){_0x1e753e=_0x1e753e-0x16f;const _0x455de9=a13_0x455d();let _0x3fbfef=_0x455de9[_0x1e753e];return _0x3fbfef;}import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a13_0x350866(0x1a4),a13_0x350866(0x17a),a13_0x350866(0x1b1),a13_0x350866(0x172),a13_0x350866(0x1a7),a13_0x350866(0x186),a13_0x350866(0x194),a13_0x350866(0x1b0)]);function a13_0x455d(){const _0x5447f6=['color','output','.\x20Valid\x20methods:\x20','GET','workflow','83010FvuXWY','x-xsrf-token','Endpoint\x20must\x20start\x20with\x20/:\x20','551187iFOBoE','method','103924MwZuTP','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','keys','entries','join','toUpperCase','startsWith','validate','description','DELETE','x-auth-token','4805552jCfekb','includes','headers','stack','isArray','toLowerCase','Invalid\x20API\x20type:\x20','header','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','status','4072535zXsPjw','has','name','error','222448IqJgyW','authorization','28206KLlVvB','file','set-cookie2','type','readBodyFromFile','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','message','log','.\x20Valid\x20types:\x20','llm','\x22.\x20','x-trino-user','cookie','api','2569rcHchk','PATCH','<\x20HTTP/1.1\x20','request','4PuviJh','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','verbose','length','set-cookie','\x0aStack\x20trace:\x0a','cdp','POST','data','indexOf','450wYCCox','body','proxy-authorization','Invalid\x20header\x20format:\x20\x22','site','substring','Error:\x20','1111cwCsZO'];a13_0x455d=function(){return _0x5447f6;};return a13_0x455d();}function isSensitiveHeader(_0x3b4dc9){const _0x404e81=a13_0x350866;return SENSITIVE_HEADERS[_0x404e81(0x1a0)](_0x3b4dc9[_0x404e81(0x19a)]());}function parseHeader(_0x465951){const _0x5aae9b=a13_0x350866,_0x6e68c3=_0x465951[_0x5aae9b(0x177)](':');if(_0x6e68c3===-0x1)throw new Error(_0x5aae9b(0x17b)+_0x465951+_0x5aae9b(0x1af)+_0x5aae9b(0x16f));const _0x595b11=_0x465951[_0x5aae9b(0x17d)](0x0,_0x6e68c3)['trim'](),_0x33554b=_0x465951['substring'](_0x6e68c3+0x1)['trim']();if(!_0x595b11)throw new Error(_0x5aae9b(0x18b)+_0x465951+'\x22');return[_0x595b11,_0x33554b];}export class ApiCommand extends BaseCommand{[a13_0x350866(0x1a1)]='api';[a13_0x350866(0x192)]=a13_0x350866(0x19d);[a13_0x350866(0x191)](_0x1a6d7c){const _0x4f75e3=a13_0x350866,{args:_0x3db89f,options:_0x21c768}=_0x1a6d7c,_0x3d298e=_0x21c768;if(_0x3db89f[_0x4f75e3(0x171)]===0x0)return _0x4f75e3(0x1aa);const _0x508eeb=_0x3db89f[0x0];if(!_0x508eeb[_0x4f75e3(0x190)]('/'))return _0x4f75e3(0x187)+_0x508eeb;const _0x4490a3=_0x3d298e[_0x4f75e3(0x176)],_0x1b1501=_0x3d298e['file'];if(_0x4490a3&&_0x1b1501)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x117777=_0x3d298e[_0x4f75e3(0x189)]||_0x4f75e3(0x183),_0x499637=['GET',_0x4f75e3(0x175),'PUT',_0x4f75e3(0x193),_0x4f75e3(0x1b4)];if(!_0x499637[_0x4f75e3(0x196)](_0x117777[_0x4f75e3(0x18f)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x117777+_0x4f75e3(0x182)+_0x499637[_0x4f75e3(0x18e)](',\x20');const _0x87d621=_0x3d298e[_0x4f75e3(0x1a8)]||'td',_0x5dc05f=['td',_0x4f75e3(0x174),_0x4f75e3(0x184),'trino',_0x4f75e3(0x1ae)];if(!_0x5dc05f[_0x4f75e3(0x196)](_0x87d621))return _0x4f75e3(0x19b)+_0x87d621+_0x4f75e3(0x1ad)+_0x5dc05f[_0x4f75e3(0x18e)](',\x20');return undefined;}async['execute'](_0x662106){const _0xf30c64=a13_0x350866,{options:_0xec3fc8,args:_0x5e563a,tdx:_0x719487}=_0x662106,_0x452f15=_0xec3fc8,_0x14bd81=_0x5e563a[0x0],_0x3d0e45=(_0x452f15[_0xf30c64(0x189)]||_0xf30c64(0x183))['toUpperCase'](),_0x3b410d=_0x452f15[_0xf30c64(0x176)],_0x4bcd05=_0x452f15[_0xf30c64(0x1a6)],_0x2ab050=_0x452f15[_0xf30c64(0x19c)],_0x126956=_0x452f15[_0xf30c64(0x1a8)]||'td';try{const _0xc8969c={};if(_0x2ab050){const _0x1f1dcf=Array[_0xf30c64(0x199)](_0x2ab050)?_0x2ab050:[_0x2ab050];for(const _0x312485 of _0x1f1dcf){const [_0xb3d178,_0x176d09]=parseHeader(_0x312485);_0xc8969c[_0xb3d178]=_0x176d09;}}let _0x597b99;if(_0x3b410d)_0x597b99=_0x3b410d;else{if(_0x4bcd05)try{_0x597b99=RawAPI[_0xf30c64(0x1a9)](_0x4bcd05);}catch(_0x3a8b0c){return console['error'](_0xf30c64(0x17e)+(_0x3a8b0c instanceof Error?_0x3a8b0c[_0xf30c64(0x1ab)]:String(_0x3a8b0c))),0x1;}}const _0x4e5607={'method':_0x3d0e45,'apiType':_0x126956,'includeHeaders':_0xec3fc8[_0xf30c64(0x170)]};_0x597b99&&(_0x4e5607[_0xf30c64(0x179)]=_0x597b99);Object[_0xf30c64(0x18c)](_0xc8969c)['length']>0x0&&(_0x4e5607['headers']=_0xc8969c);if(_0xec3fc8[_0xf30c64(0x170)]){const _0x28fad5=resolveSite(_0xec3fc8[_0xf30c64(0x17c)]),_0x181283=getEndpoint(_0x28fad5,_0x126956),_0x2f6f5f=''+_0x181283+_0x14bd81;console[_0xf30c64(0x1a2)]('>\x20'+_0x3d0e45+'\x20'+_0x2f6f5f);const _0x2ebb16=getAuthHeaders(_0x28fad5),_0x143083={..._0x2ebb16,..._0xc8969c};for(const [_0x29ae66,_0x3d79e5]of Object[_0xf30c64(0x18d)](_0x143083)){!isSensitiveHeader(_0x29ae66)&&console[_0xf30c64(0x1a2)]('>\x20'+_0x29ae66+':\x20'+_0x3d79e5);}_0x597b99&&console[_0xf30c64(0x1a2)]('>'),console[_0xf30c64(0x1a2)]('');}const _0x5b438c=await _0x719487[_0xf30c64(0x1b2)][_0xf30c64(0x1b6)](_0x14bd81,_0x4e5607);if(_0xec3fc8[_0xf30c64(0x170)]&&_0x5b438c['headers']){console[_0xf30c64(0x1a2)](_0xf30c64(0x1b5)+_0x5b438c[_0xf30c64(0x19e)]);for(const [_0x232944,_0x4cc93c]of Object['entries'](_0x5b438c[_0xf30c64(0x197)])){!isSensitiveHeader(_0x232944)&&console[_0xf30c64(0x1a2)]('<\x20'+_0x232944+':\x20'+_0x4cc93c);}console['error']('');}const _0x39edea=Boolean(_0xec3fc8['output']),_0x77fb2={'color':_0xec3fc8[_0xf30c64(0x180)],'noColor':_0xec3fc8['noColor']||_0x39edea&&!_0xec3fc8[_0xf30c64(0x180)]},_0x4849e5=colorizeJSON(_0x5b438c[_0xf30c64(0x176)],_0x77fb2);return _0xec3fc8[_0xf30c64(0x181)]?(writeFileSync(_0xec3fc8[_0xf30c64(0x181)],_0x4849e5),console[_0xf30c64(0x1a2)]('Results\x20saved\x20to\x20'+_0xec3fc8[_0xf30c64(0x181)])):console[_0xf30c64(0x1ac)](_0x4849e5),0x0;}catch(_0x200c8b){return _0x200c8b instanceof Error?(console[_0xf30c64(0x1a2)](_0xf30c64(0x17e)+_0x200c8b[_0xf30c64(0x1ab)]),_0xec3fc8[_0xf30c64(0x170)]&&_0x200c8b[_0xf30c64(0x198)]&&console[_0xf30c64(0x1a2)](_0xf30c64(0x173)+_0x200c8b[_0xf30c64(0x198)])):console[_0xf30c64(0x1a2)](_0xf30c64(0x17e)+String(_0x200c8b)),0x1;}}}
@@ -1 +1 @@
1
- const a14_0x594931=a14_0x3cc0;(function(_0x544e13,_0x5c7838){const _0x37378a=a14_0x3cc0,_0x2da54f=_0x544e13();while(!![]){try{const _0x26c236=-parseInt(_0x37378a(0x130))/0x1*(parseInt(_0x37378a(0x13e))/0x2)+-parseInt(_0x37378a(0x136))/0x3*(parseInt(_0x37378a(0x109))/0x4)+-parseInt(_0x37378a(0x150))/0x5+-parseInt(_0x37378a(0x12d))/0x6+parseInt(_0x37378a(0x12a))/0x7+parseInt(_0x37378a(0x122))/0x8*(-parseInt(_0x37378a(0x12e))/0x9)+parseInt(_0x37378a(0x134))/0xa;if(_0x26c236===_0x5c7838)break;else _0x2da54f['push'](_0x2da54f['shift']());}catch(_0x461668){_0x2da54f['push'](_0x2da54f['shift']());}}}(a14_0x25e9,0x85c58));function a14_0x25e9(){const _0x41e473=['first_name','name','ERROR','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20--profile\x20','No\x20credential\x20found','error','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Profile\x20\x27','\x20for\x20profile:\x20','status','select','Enter\x20your\x20TD\x20API\x20key:','profile','tdx:\x20auth\x20clear','Enter\x20custom\x20site','No\x20API\x20key\x20found\x20in\x20keychain','/app/mp/ak','trim','site','jp01','\x20(site:\x20','5345768cczwos','email','last_name','push','System\x20keychain\x20is\x20not\x20available','Select\x20your\x20Treasure\x20Data\x20site:','warn','value','4129867sceEku','message','\x20\x20tdx','6397830emlBGg','9qygvAV','✗\x20Validation\x20failed:\x20','851303bRwnCm','jobs','log','green','35404280pQnqlU','red','303raiPPO','ap02','Setup\x20API\x20key\x20authentication\x20interactively','customSite','test','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','filter','us01','2jMTlVW','yellow','apiKey','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','auth','text','create','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x0aSetup\x20cancelled','\x20(profile:\x20','findIndex','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Validating\x20API\x20key...','description','Site\x20name\x20cannot\x20be\x20empty','getUserInfo','3631375rzqcIV','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','ap02\x20-\x20Korea','password','execute','us\x20\x20\x20-\x20United\x20States','✓\x20Authentication\x20successful\x0a','10708CWIYqb','join'];a14_0x25e9=function(){return _0x41e473;};return a14_0x25e9();}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../types/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a14_0x309960 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a14_0x466179 from'chalk';function a14_0x3cc0(_0x37084b,_0x27f001){_0x37084b=_0x37084b-0x109;const _0x25e9ff=a14_0x25e9();let _0x3cc0be=_0x25e9ff[_0x37084b];return _0x3cc0be;}export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a14_0x594931(0x14d)]=a14_0x594931(0x138);async[a14_0x594931(0x154)](_0x1d9052){const _0xe1be30=a14_0x594931,{options:_0x5441d8}=_0x1d9052,_0x3a202e=_0x5441d8[_0xe1be30(0x119)];console[_0xe1be30(0x132)](a14_0x466179['bold']('tdx:\x20auth\x20setup'));const _0x5d4fff=_0x5441d8[_0xe1be30(0x11f)]||'us01',_0x16d877=[{'title':_0xe1be30(0x155),'value':_0xe1be30(0x13d)},{'title':'jp\x20\x20\x20-\x20Japan','value':_0xe1be30(0x120)},{'title':'eu\x20\x20\x20-\x20Europe','value':'eu01'},{'title':_0xe1be30(0x152),'value':_0xe1be30(0x137)}];let _0x4b1ac4=_0x16d877[_0xe1be30(0x148)](_0x126646=>_0x126646[_0xe1be30(0x129)]===_0x5d4fff);_0x4b1ac4===-0x1&&_0x5d4fff!==_0xe1be30(0x13d)&&(_0x16d877[_0xe1be30(0x125)]({'title':_0x5d4fff,'value':_0x5d4fff}),_0x4b1ac4=_0x16d877['length']-0x1);_0x16d877[_0xe1be30(0x125)]({'title':_0xe1be30(0x11b),'value':'other'});const _0x49e93d=_0x3a202e?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x3a202e+'):':_0xe1be30(0x127),_0x3827aa=await a14_0x309960({'type':_0xe1be30(0x117),'name':_0xe1be30(0x11f),'message':_0x49e93d,'choices':_0x16d877,'initial':_0x4b1ac4>=0x0?_0x4b1ac4:0x0});if(!_0x3827aa['site'])return console[_0xe1be30(0x132)](_0xe1be30(0x146)),0x1;let _0x1d3d5e;if(_0x3827aa[_0xe1be30(0x11f)]==='other'){const _0x10f9f2=await a14_0x309960({'type':_0xe1be30(0x143),'name':_0xe1be30(0x139),'message':'Enter\x20site\x20name:','initial':_0xe1be30(0x13d),'validate':_0x5e9a4e=>{const _0x4ebace=_0xe1be30;if(!_0x5e9a4e||!_0x5e9a4e[_0x4ebace(0x11e)]())return _0x4ebace(0x14e);if(!/^[a-z0-9-]+$/[_0x4ebace(0x13a)](_0x5e9a4e[_0x4ebace(0x11e)]()))return _0x4ebace(0x151);return!![];}});if(!_0x10f9f2[_0xe1be30(0x139)])return console[_0xe1be30(0x132)](_0xe1be30(0x146)),0x1;_0x1d3d5e=_0x10f9f2[_0xe1be30(0x139)];}else _0x1d3d5e=_0x3827aa['site'];const _0x4a791e=resolveSite(_0x1d3d5e);console[_0xe1be30(0x132)](_0xe1be30(0x112)+_0x4a791e),console[_0xe1be30(0x132)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0xe1be30(0x132)]('\x20\x20'+getConsoleUrl(_0x4a791e,_0xe1be30(0x11d)));const _0x28fe4a=await a14_0x309960({'type':_0xe1be30(0x153),'name':_0xe1be30(0x140),'message':_0xe1be30(0x118),'validate':_0x4aa74c=>{const _0xd26659=_0xe1be30;if(!_0x4aa74c||!_0x4aa74c[_0xd26659(0x11e)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x28fe4a[_0xe1be30(0x140)])return console[_0xe1be30(0x132)](_0xe1be30(0x146)),0x1;const _0x180fe3=_0x28fe4a['apiKey'];console['log'](_0xe1be30(0x14c));try{const _0x3b44dd=TDX[_0xe1be30(0x144)]({'site':_0x4a791e,'apiKey':_0x180fe3[_0xe1be30(0x11e)](),'logLevel':_0x5441d8['logLevel']??LogLevel[_0xe1be30(0x10d)]}),_0x49a61=await _0x3b44dd[_0xe1be30(0x131)][_0xe1be30(0x14f)]();console['log'](_0xe1be30(0x14a)+_0x49a61[_0xe1be30(0x123)]+')');const _0x221112=await isKeychainAvailable();_0x221112?(await saveAPIKeyAsync(_0x180fe3[_0xe1be30(0x11e)](),_0x4a791e,_0x3a202e),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x3a202e?_0xe1be30(0x147)+_0x3a202e+')':''))):(console[_0xe1be30(0x128)](a14_0x466179[_0xe1be30(0x13f)](_0xe1be30(0x14b))),console[_0xe1be30(0x128)](a14_0x466179[_0xe1be30(0x13f)](_0xe1be30(0x141))));if(_0x3a202e){const _0x1644af={'site':_0x4a791e};saveProfileToUserConfig(_0x3a202e,_0x1644af),console[_0xe1be30(0x132)](_0xe1be30(0x114)+_0x3a202e+'\x27\x20registered');}const _0x2f072a=_0x3a202e?_0xe1be30(0x10f)+_0x3a202e:'';return console[_0xe1be30(0x132)](),console[_0xe1be30(0x132)](_0xe1be30(0x10e)),console[_0xe1be30(0x132)]('\x20\x20tdx'+_0x2f072a+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xe1be30(0x132)](_0xe1be30(0x12c)+_0x2f072a+_0xe1be30(0x113)),0x0;}catch(_0x4846cf){if(_0x4846cf instanceof HTTPClientError&&_0x4846cf[_0xe1be30(0x116)]===0x191)return printAuthError(_0x4846cf),0x1;return console[_0xe1be30(0x111)](a14_0x466179[_0xe1be30(0x135)]('✗\x20Validation\x20failed:\x20'+(_0x4846cf instanceof Error?_0x4846cf['message']:String(_0x4846cf)))),console[_0xe1be30(0x111)](_0xe1be30(0x13b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a14_0x594931(0x10c)]=a14_0x594931(0x142);[a14_0x594931(0x14d)]=a14_0x594931(0x145);async[a14_0x594931(0x154)](_0x2ac282){const _0x35c3b6=a14_0x594931,{options:_0xd61c87,tdx:_0x2e8567}=_0x2ac282,_0x1012f1=_0xd61c87[_0x35c3b6(0x11f)],_0x65a051=_0xd61c87['profile'],_0x506f72=_0x65a051?_0x65a051:'N/A';console[_0x35c3b6(0x132)]('tdx\x20profile:\x20'+_0x506f72+_0x35c3b6(0x121)+_0x1012f1+')');const _0x2e5668=await resolveAPIKeyAsync(_0x1012f1,_0x65a051);if(_0x2e5668){const {source:_0x117526,isDeprecated:_0x5d0b6f}=_0x2e5668,_0x10d14a='Read\x20credential\x20from\x20'+_0x117526;console[_0x35c3b6(0x132)](_0x5d0b6f?a14_0x466179[_0x35c3b6(0x13f)](_0x10d14a):_0x10d14a);}else console[_0x35c3b6(0x132)](a14_0x466179[_0x35c3b6(0x13f)](_0x35c3b6(0x110)));try{const _0x24a72d=await _0x2e8567[_0x35c3b6(0x131)][_0x35c3b6(0x14f)]();return console[_0x35c3b6(0x132)](a14_0x466179[_0x35c3b6(0x133)](_0x35c3b6(0x156))),console[_0x35c3b6(0x132)]('User:\x20'+_0x24a72d[_0x35c3b6(0x123)]),(_0x24a72d[_0x35c3b6(0x10b)]||_0x24a72d[_0x35c3b6(0x124)])&&console['log']('Name:\x20'+[_0x24a72d['first_name'],_0x24a72d[_0x35c3b6(0x124)]][_0x35c3b6(0x13c)](Boolean)[_0x35c3b6(0x10a)]('\x20')),0x0;}catch(_0x53819b){return _0x53819b instanceof HTTPClientError&&_0x53819b[_0x35c3b6(0x116)]===0x191?printAuthError(_0x53819b,!![],_0x65a051):console[_0x35c3b6(0x111)](a14_0x466179['red'](_0x35c3b6(0x12f)+(_0x53819b instanceof Error?_0x53819b[_0x35c3b6(0x12b)]:String(_0x53819b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a14_0x594931(0x10c)]='auth:clear';['description']=a14_0x594931(0x149);async[a14_0x594931(0x154)](_0x37be49){const _0x8526c4=a14_0x594931,{options:_0x50193c}=_0x37be49,_0x25741a=_0x50193c[_0x8526c4(0x119)];console['log'](a14_0x466179['bold'](_0x8526c4(0x11a)));const _0x46223d=await isKeychainAvailable();if(!_0x46223d)return console['error'](a14_0x466179[_0x8526c4(0x135)](_0x8526c4(0x126))),0x1;const _0x1ac396=await deleteKeychainAPIKey(_0x25741a);return _0x1ac396?(clearCredentialCache(),console[_0x8526c4(0x132)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x25741a?_0x8526c4(0x147)+_0x25741a+')':'')),0x0):(console[_0x8526c4(0x132)](_0x8526c4(0x11c)+(_0x25741a?_0x8526c4(0x115)+_0x25741a:'')),0x1);}}
1
+ const a14_0x11fd5e=a14_0x3748;(function(_0x1cf2da,_0x157c95){const _0x370ac0=a14_0x3748,_0x355c35=_0x1cf2da();while(!![]){try{const _0x1efc54=parseInt(_0x370ac0(0x1e2))/0x1*(-parseInt(_0x370ac0(0x1e9))/0x2)+parseInt(_0x370ac0(0x1a3))/0x3*(parseInt(_0x370ac0(0x1a1))/0x4)+-parseInt(_0x370ac0(0x1c3))/0x5+-parseInt(_0x370ac0(0x1e4))/0x6+-parseInt(_0x370ac0(0x1d3))/0x7*(parseInt(_0x370ac0(0x1b2))/0x8)+-parseInt(_0x370ac0(0x1e1))/0x9+parseInt(_0x370ac0(0x1cb))/0xa;if(_0x1efc54===_0x157c95)break;else _0x355c35['push'](_0x355c35['shift']());}catch(_0x32b688){_0x355c35['push'](_0x355c35['shift']());}}}(a14_0x521d,0x2bafd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../types/endpoints.js';function a14_0x521d(){const _0xc94783=['✓\x20Profile\x20\x27','jp01','bold','System\x20keychain\x20is\x20not\x20available','2941542aLlgqH','31136pHxVhY','green','581274ybcglf','value','Enter\x20custom\x20site','Select\x20your\x20Treasure\x20Data\x20site:','getUserInfo','18itiKmE','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','No\x20API\x20key\x20found\x20in\x20keychain','log','Remove\x20API\x20key\x20from\x20system\x20keychain','auth:clear','\x20(profile:\x20','trim','N/A','API\x20key\x20cannot\x20be\x20empty','auth','ERROR','length','235444GOhehU','findIndex','3zengXi','description','tdx:\x20auth\x20setup','eu\x20\x20\x20-\x20Europe','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','warn','apiKey','Enter\x20your\x20TD\x20API\x20key:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','first_name','password','site','Site\x20name\x20cannot\x20be\x20empty','tdx:\x20auth\x20clear','\x0aSetup\x20cancelled','16jvwAka','Enter\x20site\x20name:','ap02','push','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','red','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','You\x20can\x20find\x20your\x20API\x20key\x20at:','Name:\x20','\x20(site:\x20','ap02\x20-\x20Korea','auth:setup','us01','\x20--profile\x20','select','email','1218105sknHuG','\x20\x20tdx','jp\x20\x20\x20-\x20Japan','customSite','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Authentication\x20successful\x0a','User:\x20','logLevel','12522460QWvJnV','profile','✗\x20Validation\x20failed:\x20','execute','\x27\x20registered','status','message','jobs','646114RfAIyE','test','Setup\x20API\x20key\x20authentication\x20interactively','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','join','/app/mp/ak','error','filter','yellow','✓\x20API\x20key\x20removed\x20from\x20keychain'];a14_0x521d=function(){return _0xc94783;};return a14_0x521d();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a14_0x686596 from'prompts';import{HTTPClientError}from'../client/http-client.js';function a14_0x3748(_0x46df68,_0x91d233){_0x46df68=_0x46df68-0x196;const _0x521dad=a14_0x521d();let _0x374875=_0x521dad[_0x46df68];return _0x374875;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a14_0x4eccc2 from'chalk';export class AuthSetupCommand extends BaseCommand{[a14_0x11fd5e(0x1b8)]=a14_0x11fd5e(0x1be);['description']=a14_0x11fd5e(0x1d5);async[a14_0x11fd5e(0x1ce)](_0x5ca557){const _0x7c845e=a14_0x11fd5e,{options:_0x1bb855}=_0x5ca557,_0x47669a=_0x1bb855[_0x7c845e(0x1cc)];console[_0x7c845e(0x197)](a14_0x4eccc2[_0x7c845e(0x1df)](_0x7c845e(0x1a5)));const _0x3b4a2d=_0x1bb855[_0x7c845e(0x1ae)]||_0x7c845e(0x1bf),_0x9d7d81=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x7c845e(0x1bf)},{'title':_0x7c845e(0x1c5),'value':_0x7c845e(0x1de)},{'title':_0x7c845e(0x1a6),'value':'eu01'},{'title':_0x7c845e(0x1bd),'value':_0x7c845e(0x1b4)}];let _0x45c784=_0x9d7d81[_0x7c845e(0x1a2)](_0x128628=>_0x128628[_0x7c845e(0x1e5)]===_0x3b4a2d);_0x45c784===-0x1&&_0x3b4a2d!==_0x7c845e(0x1bf)&&(_0x9d7d81[_0x7c845e(0x1b5)]({'title':_0x3b4a2d,'value':_0x3b4a2d}),_0x45c784=_0x9d7d81[_0x7c845e(0x1a0)]-0x1);_0x9d7d81[_0x7c845e(0x1b5)]({'title':_0x7c845e(0x1e6),'value':'other'});const _0x29e0a0=_0x47669a?_0x7c845e(0x1ea)+_0x47669a+'):':_0x7c845e(0x1e7),_0x6c8dda=await a14_0x686596({'type':_0x7c845e(0x1c1),'name':'site','message':_0x29e0a0,'choices':_0x9d7d81,'initial':_0x45c784>=0x0?_0x45c784:0x0});if(!_0x6c8dda[_0x7c845e(0x1ae)])return console[_0x7c845e(0x197)]('\x0aSetup\x20cancelled'),0x1;let _0x5adbec;if(_0x6c8dda[_0x7c845e(0x1ae)]==='other'){const _0x1770af=await a14_0x686596({'type':'text','name':_0x7c845e(0x1c6),'message':_0x7c845e(0x1b3),'initial':'us01','validate':_0x4a89f3=>{const _0x5e67f9=_0x7c845e;if(!_0x4a89f3||!_0x4a89f3[_0x5e67f9(0x19b)]())return _0x5e67f9(0x1af);if(!/^[a-z0-9-]+$/[_0x5e67f9(0x1d4)](_0x4a89f3[_0x5e67f9(0x19b)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x1770af[_0x7c845e(0x1c6)])return console[_0x7c845e(0x197)]('\x0aSetup\x20cancelled'),0x1;_0x5adbec=_0x1770af[_0x7c845e(0x1c6)];}else _0x5adbec=_0x6c8dda['site'];const _0x179c3c=resolveSite(_0x5adbec);console[_0x7c845e(0x197)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x179c3c),console[_0x7c845e(0x197)](_0x7c845e(0x1ba)),console['log']('\x20\x20'+getConsoleUrl(_0x179c3c,_0x7c845e(0x1d8)));const _0x2993a5=await a14_0x686596({'type':_0x7c845e(0x1ad),'name':_0x7c845e(0x1a9),'message':_0x7c845e(0x1aa),'validate':_0x267380=>{const _0x1de983=_0x7c845e;if(!_0x267380||!_0x267380['trim']())return _0x1de983(0x19d);return!![];}});if(!_0x2993a5[_0x7c845e(0x1a9)])return console[_0x7c845e(0x197)](_0x7c845e(0x1b1)),0x1;const _0x50feba=_0x2993a5[_0x7c845e(0x1a9)];console[_0x7c845e(0x197)]('Validating\x20API\x20key...');try{const _0x5ebc26=TDX['create']({'site':_0x179c3c,'apiKey':_0x50feba[_0x7c845e(0x19b)](),'logLevel':_0x1bb855[_0x7c845e(0x1ca)]??LogLevel[_0x7c845e(0x19f)]}),_0x42fac7=await _0x5ebc26[_0x7c845e(0x1d2)][_0x7c845e(0x1e8)]();console[_0x7c845e(0x197)](_0x7c845e(0x1ab)+_0x42fac7[_0x7c845e(0x1c2)]+')');const _0x28973f=await isKeychainAvailable();_0x28973f?(await saveAPIKeyAsync(_0x50feba['trim'](),_0x179c3c,_0x47669a),console[_0x7c845e(0x197)](_0x7c845e(0x1b6)+(_0x47669a?_0x7c845e(0x19a)+_0x47669a+')':''))):(console[_0x7c845e(0x1a8)](a14_0x4eccc2[_0x7c845e(0x1db)](_0x7c845e(0x1a7))),console['warn'](a14_0x4eccc2[_0x7c845e(0x1db)](_0x7c845e(0x1c7))));if(_0x47669a){const _0x43410={'site':_0x179c3c};saveProfileToUserConfig(_0x47669a,_0x43410),console[_0x7c845e(0x197)](_0x7c845e(0x1dd)+_0x47669a+_0x7c845e(0x1cf));}const _0x55ae2d=_0x47669a?_0x7c845e(0x1c0)+_0x47669a:'';return console[_0x7c845e(0x197)](),console[_0x7c845e(0x197)](_0x7c845e(0x1b9)),console['log'](_0x7c845e(0x1c4)+_0x55ae2d+_0x7c845e(0x1d6)),console['log'](_0x7c845e(0x1c4)+_0x55ae2d+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x51e1a9){if(_0x51e1a9 instanceof HTTPClientError&&_0x51e1a9['status']===0x191)return printAuthError(_0x51e1a9),0x1;return console[_0x7c845e(0x1d9)](a14_0x4eccc2[_0x7c845e(0x1b7)](_0x7c845e(0x1cd)+(_0x51e1a9 instanceof Error?_0x51e1a9[_0x7c845e(0x1d1)]:String(_0x51e1a9)))),console[_0x7c845e(0x1d9)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a14_0x11fd5e(0x1b8)]=a14_0x11fd5e(0x19e);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a14_0x11fd5e(0x1ce)](_0x539602){const _0x2c553a=a14_0x11fd5e,{options:_0x39dddb,tdx:_0x150a1b}=_0x539602,_0x37b7ca=_0x39dddb[_0x2c553a(0x1ae)],_0x588fd3=_0x39dddb['profile'],_0x3580de=_0x588fd3?_0x588fd3:_0x2c553a(0x19c);console[_0x2c553a(0x197)]('tdx\x20profile:\x20'+_0x3580de+_0x2c553a(0x1bc)+_0x37b7ca+')');const _0xa5e4c6=await resolveAPIKeyAsync(_0x37b7ca,_0x588fd3);if(_0xa5e4c6){const {source:_0xc91bbc,isDeprecated:_0x5c93d0}=_0xa5e4c6,_0x5788b4='Read\x20credential\x20from\x20'+_0xc91bbc;console[_0x2c553a(0x197)](_0x5c93d0?a14_0x4eccc2['yellow'](_0x5788b4):_0x5788b4);}else console[_0x2c553a(0x197)](a14_0x4eccc2[_0x2c553a(0x1db)]('No\x20credential\x20found'));try{const _0x18adc3=await _0x150a1b['jobs'][_0x2c553a(0x1e8)]();return console['log'](a14_0x4eccc2[_0x2c553a(0x1e3)](_0x2c553a(0x1c8))),console['log'](_0x2c553a(0x1c9)+_0x18adc3[_0x2c553a(0x1c2)]),(_0x18adc3['first_name']||_0x18adc3['last_name'])&&console[_0x2c553a(0x197)](_0x2c553a(0x1bb)+[_0x18adc3[_0x2c553a(0x1ac)],_0x18adc3['last_name']][_0x2c553a(0x1da)](Boolean)[_0x2c553a(0x1d7)]('\x20')),0x0;}catch(_0x1fce28){return _0x1fce28 instanceof HTTPClientError&&_0x1fce28[_0x2c553a(0x1d0)]===0x191?printAuthError(_0x1fce28,!![],_0x588fd3):console[_0x2c553a(0x1d9)](a14_0x4eccc2[_0x2c553a(0x1b7)](_0x2c553a(0x1cd)+(_0x1fce28 instanceof Error?_0x1fce28[_0x2c553a(0x1d1)]:String(_0x1fce28)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a14_0x11fd5e(0x1b8)]=a14_0x11fd5e(0x199);[a14_0x11fd5e(0x1a4)]=a14_0x11fd5e(0x198);async['execute'](_0xd0445b){const _0x39a6d2=a14_0x11fd5e,{options:_0x7267bf}=_0xd0445b,_0xea5bca=_0x7267bf[_0x39a6d2(0x1cc)];console[_0x39a6d2(0x197)](a14_0x4eccc2[_0x39a6d2(0x1df)](_0x39a6d2(0x1b0)));const _0x29dbfa=await isKeychainAvailable();if(!_0x29dbfa)return console[_0x39a6d2(0x1d9)](a14_0x4eccc2[_0x39a6d2(0x1b7)](_0x39a6d2(0x1e0))),0x1;const _0x12ad7a=await deleteKeychainAPIKey(_0xea5bca);return _0x12ad7a?(clearCredentialCache(),console['log'](_0x39a6d2(0x1dc)+(_0xea5bca?_0x39a6d2(0x19a)+_0xea5bca+')':'')),0x0):(console['log'](_0x39a6d2(0x196)+(_0xea5bca?'\x20for\x20profile:\x20'+_0xea5bca:'')),0x1);}}
@@ -1 +1 @@
1
- const a15_0x27d988=a15_0x1675;(function(_0x12ee75,_0x2eddd5){const _0x2e024e=a15_0x1675,_0x45ea99=_0x12ee75();while(!![]){try{const _0x511fab=-parseInt(_0x2e024e(0x15b))/0x1*(parseInt(_0x2e024e(0x143))/0x2)+parseInt(_0x2e024e(0x14d))/0x3+-parseInt(_0x2e024e(0x157))/0x4+parseInt(_0x2e024e(0x12a))/0x5+parseInt(_0x2e024e(0x12c))/0x6*(-parseInt(_0x2e024e(0x14e))/0x7)+-parseInt(_0x2e024e(0x140))/0x8*(parseInt(_0x2e024e(0x139))/0x9)+parseInt(_0x2e024e(0x136))/0xa*(parseInt(_0x2e024e(0x14c))/0xb);if(_0x511fab===_0x2eddd5)break;else _0x45ea99['push'](_0x45ea99['shift']());}catch(_0x1ac2d5){_0x45ea99['push'](_0x45ea99['shift']());}}}(a15_0x5bc4,0x7fe72));function a15_0x5bc4(){const _0x1190e2=['996932znxQbr','cause','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','CHAT_NOT_FOUND','31BlxKpk','session\x20context','event','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','getAgentId','handleChatEvent','execute','404','672940DqDhGI','Resolving\x20agent\x20\x27','24972lHlkTq','content','name','Getting\x20default\x20agent...','\x27...','Using\x20agent\x20from\x20','includes','stack','Using\x20cached\x20default\x20agent:\x20','type','73130CXiMJN','chat','resolveProjectId','135Hxkxuj','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','chatId','description','Resolving\x20project\x20\x27','validate','resolveAgentId','48624SUZDPF','\x0aError:\x20','write','62252gRLEdA','code','agent','llmProject','llm','data','streamChat','error','verbose','2981OpbymY','349506jOnObZ','679Mkrklm','\x0aStack\x20trace:','Continuing\x20chat:\x20','metadata','message','join','Chat\x20session:\x20','Error:\x20','getDefaultAgent'];a15_0x5bc4=function(){return _0x1190e2;};return a15_0x5bc4();}import{BaseCommand}from'./command.js';function a15_0x1675(_0x3d0b,_0x2a7bd9){_0x3d0b=_0x3d0b-0x124;const _0x5bc4d6=a15_0x5bc4();let _0x1675d1=_0x5bc4d6[_0x3d0b];return _0x1675d1;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';function handleSDKError(_0x107fba,_0x389dfe){const _0x13a8b3=a15_0x1675;if(_0x107fba instanceof SDKError)console[_0x13a8b3(0x14a)](_0x13a8b3(0x155)+_0x107fba[_0x13a8b3(0x152)]),_0x389dfe[_0x13a8b3(0x14b)]&&(_0x107fba[_0x13a8b3(0x158)]&&console[_0x13a8b3(0x14a)]('\x20\x20Cause:\x20'+_0x107fba[_0x13a8b3(0x158)]),_0x107fba[_0x13a8b3(0x133)]&&(console[_0x13a8b3(0x14a)](_0x13a8b3(0x14f)),console[_0x13a8b3(0x14a)](_0x107fba[_0x13a8b3(0x133)])));else throw _0x107fba;}export class ChatCommand extends BaseCommand{[a15_0x27d988(0x12e)]='chat';[a15_0x27d988(0x13c)]=a15_0x27d988(0x159);[a15_0x27d988(0x13e)](_0x3142a3){const _0x3ed550=a15_0x27d988,_0x8afae3=_0x3142a3['args'][_0x3ed550(0x153)]('\x20');if(!_0x8afae3)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a15_0x27d988(0x149)](_0x4e4a38,_0x3b8745,_0x3989cd,_0x4b198c,_0x50fd57){const _0x34aa32=a15_0x27d988;for await(const _0x29dde7 of _0x4e4a38[_0x34aa32(0x147)][_0x34aa32(0x137)](_0x3b8745,{'agentId':_0x3989cd,'chatId':_0x4b198c})){if(_0x29dde7[_0x34aa32(0x135)]===_0x34aa32(0x151)){const _0x85d1b9=_0x29dde7[_0x34aa32(0x148)][_0x34aa32(0x13b)];saveLastChatId(_0x85d1b9),_0x50fd57&&console[_0x34aa32(0x14a)](_0x34aa32(0x154)+_0x85d1b9);}else _0x29dde7[_0x34aa32(0x135)]===_0x34aa32(0x124)&&this[_0x34aa32(0x127)](_0x29dde7[_0x34aa32(0x148)]);}}async[a15_0x27d988(0x126)](_0x1ec426,_0x3d3faa,_0x195f0a,_0x4913de,_0x406e46){const _0x2a779d=a15_0x27d988,_0x24b151=_0x3d3faa||_0x195f0a;if(_0x24b151){const {projectName:_0x3f7019,agentName:_0x3f9635}=parseAgentRef(_0x24b151),_0x5b5152=_0x3f9635||_0x24b151,_0x244be7=_0x3f9635?_0x3f7019:_0x4913de;if(!_0x244be7)throw new Error(_0x2a779d(0x13a));if(_0x406e46){const _0x27be86=_0x3d3faa?'--agent\x20flag':_0x2a779d(0x15c);console[_0x2a779d(0x14a)](_0x2a779d(0x131)+_0x27be86+':\x20'+_0x244be7+'/'+_0x5b5152);}const _0x1898e2=await withSpinner(_0x2a779d(0x13d)+_0x244be7+_0x2a779d(0x130),()=>_0x1ec426[_0x2a779d(0x147)][_0x2a779d(0x138)](_0x244be7),{'verbose':_0x406e46}),_0x4335e9=await withSpinner(_0x2a779d(0x12b)+_0x5b5152+'\x27...',()=>_0x1ec426[_0x2a779d(0x147)][_0x2a779d(0x13f)](_0x5b5152,_0x1898e2['data']),{'verbose':_0x406e46});return _0x4335e9[_0x2a779d(0x148)];}else{const _0x58a36e=_0x1ec426[_0x2a779d(0x147)][_0x2a779d(0x156)]();if(_0x58a36e)return _0x406e46&&console[_0x2a779d(0x14a)](_0x2a779d(0x134)+_0x58a36e['name']),_0x58a36e['id'];const _0xeb7ec4=await withSpinner(_0x2a779d(0x12f),()=>_0x1ec426[_0x2a779d(0x147)]['getOrCreateDefaultAgent']('claude-4.5-haiku',0x0),{'verbose':_0x406e46});return _0xeb7ec4[_0x2a779d(0x148)]['id'];}}async[a15_0x27d988(0x128)](_0x4dbfe3){const _0x17498c=a15_0x27d988,{options:_0x3bbfaa,args:_0xeb61e3,tdx:_0x3e9674}=_0x4dbfe3,_0x14188b=_0xeb61e3[_0x17498c(0x153)]('\x20'),_0x545a46=_0x3bbfaa,_0x5bd187=_0x545a46[_0x17498c(0x145)],_0x4b6ff5=_0x545a46['llmAgent'],_0x104855=_0x545a46[_0x17498c(0x146)],_0x8af37d=_0x545a46['new'];try{let _0x24a83c,_0x19e53a;!_0x8af37d&&(_0x19e53a=loadLastChatId(),_0x19e53a&&_0x3bbfaa[_0x17498c(0x14b)]&&console['error'](_0x17498c(0x150)+_0x19e53a));(_0x8af37d||!_0x19e53a)&&(_0x24a83c=await this['getAgentId'](_0x3e9674,_0x5bd187,_0x4b6ff5,_0x104855,_0x3bbfaa[_0x17498c(0x14b)]));try{await this[_0x17498c(0x149)](_0x3e9674,_0x14188b,_0x24a83c,_0x19e53a,_0x3bbfaa[_0x17498c(0x14b)]);}catch(_0x21d10c){const _0x41c205=_0x21d10c instanceof SDKError&&_0x21d10c[_0x17498c(0x144)]===ErrorCode[_0x17498c(0x15a)]||_0x21d10c instanceof Error&&_0x21d10c[_0x17498c(0x152)][_0x17498c(0x132)](_0x17498c(0x129));if(_0x41c205)_0x3bbfaa[_0x17498c(0x14b)]&&console[_0x17498c(0x14a)](_0x17498c(0x125)),!_0x24a83c&&(_0x24a83c=await this['getAgentId'](_0x3e9674,_0x5bd187,_0x4b6ff5,_0x104855,_0x3bbfaa[_0x17498c(0x14b)])),await this[_0x17498c(0x149)](_0x3e9674,_0x14188b,_0x24a83c,undefined,_0x3bbfaa[_0x17498c(0x14b)]);else throw _0x21d10c;}return console['log'](),0x0;}catch(_0x54cc54){return console['error'](),handleSDKError(_0x54cc54,_0x3bbfaa),0x1;}}['handleChatEvent'](_0x5e8289){const _0x2e18fd=a15_0x27d988;if('content'in _0x5e8289)process['stdout'][_0x2e18fd(0x142)](_0x5e8289[_0x2e18fd(0x12d)]);else _0x2e18fd(0x14a)in _0x5e8289&&console[_0x2e18fd(0x14a)](_0x2e18fd(0x141)+_0x5e8289[_0x2e18fd(0x14a)]);}}
1
+ const a15_0x2dbbf0=a15_0x3d21;(function(_0x522fe7,_0x4e040d){const _0x3e91e1=a15_0x3d21,_0x46ed1a=_0x522fe7();while(!![]){try{const _0x1db418=-parseInt(_0x3e91e1(0xd3))/0x1+-parseInt(_0x3e91e1(0xd0))/0x2*(parseInt(_0x3e91e1(0xb4))/0x3)+parseInt(_0x3e91e1(0xbc))/0x4+parseInt(_0x3e91e1(0xb2))/0x5*(-parseInt(_0x3e91e1(0xd6))/0x6)+parseInt(_0x3e91e1(0xcb))/0x7+-parseInt(_0x3e91e1(0xe0))/0x8*(-parseInt(_0x3e91e1(0xb3))/0x9)+parseInt(_0x3e91e1(0xb9))/0xa;if(_0x1db418===_0x4e040d)break;else _0x46ed1a['push'](_0x46ed1a['shift']());}catch(_0x588db8){_0x46ed1a['push'](_0x46ed1a['shift']());}}}(a15_0x5847,0x9f3b4));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a15_0x3d21(_0x30a7c7,_0x28b158){_0x30a7c7=_0x30a7c7-0xaf;const _0x5847b6=a15_0x5847();let _0x3d21b4=_0x5847b6[_0x30a7c7];return _0x3d21b4;}import{parseAgentRef}from'../utils/agent-ref-parser.js';function a15_0x5847(){const _0x351ff4=['claude-4.5-haiku','name','metadata','\x27...','error','\x0aError:\x20','validate','2126605VTjnAg','364365DXcjJu','286053LocuLr','chat','Using\x20agent\x20from\x20','CHAT_NOT_FOUND','getDefaultAgent','18971210qtmkEY','join','includes','2665032qWsGZi','agent','getAgentId','Chat\x20session:\x20','Resolving\x20agent\x20\x27','type','stdout','data','stack','message','new','chatId','args','--agent\x20flag','\x0aStack\x20trace:','4884551sdtkPV','cause','getOrCreateDefaultAgent','event','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','20NeRGjs','llmProject','\x20\x20Cause:\x20','1007233pLumvY','llmAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','12qZXSgP','handleChatEvent','resolveAgentId','resolveProjectId','llm','Error:\x20','execute','verbose','Getting\x20default\x20agent...','streamChat','40QJstYl','write'];a15_0x5847=function(){return _0x351ff4;};return a15_0x5847();}import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';function handleSDKError(_0xbac4ec,_0x4cabba){const _0xcdb3d8=a15_0x3d21;if(_0xbac4ec instanceof SDKError)console[_0xcdb3d8(0xaf)](_0xcdb3d8(0xdb)+_0xbac4ec[_0xcdb3d8(0xc5)]),_0x4cabba[_0xcdb3d8(0xdd)]&&(_0xbac4ec[_0xcdb3d8(0xcc)]&&console[_0xcdb3d8(0xaf)](_0xcdb3d8(0xd2)+_0xbac4ec['cause']),_0xbac4ec[_0xcdb3d8(0xc4)]&&(console['error'](_0xcdb3d8(0xca)),console['error'](_0xbac4ec[_0xcdb3d8(0xc4)])));else throw _0xbac4ec;}export class ChatCommand extends BaseCommand{[a15_0x2dbbf0(0xe3)]='chat';['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a15_0x2dbbf0(0xb1)](_0x29e589){const _0x1b3547=a15_0x2dbbf0,_0x4b631a=_0x29e589[_0x1b3547(0xc8)]['join']('\x20');if(!_0x4b631a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a15_0x2dbbf0(0xdf)](_0x4a4cc6,_0x59c550,_0xe9a1cf,_0x52ad41,_0x36253e){const _0x4040a0=a15_0x2dbbf0;for await(const _0x47ab29 of _0x4a4cc6[_0x4040a0(0xda)][_0x4040a0(0xb5)](_0x59c550,{'agentId':_0xe9a1cf,'chatId':_0x52ad41})){if(_0x47ab29[_0x4040a0(0xc1)]===_0x4040a0(0xe4)){const _0x219a4c=_0x47ab29['data'][_0x4040a0(0xc7)];saveLastChatId(_0x219a4c),_0x36253e&&console[_0x4040a0(0xaf)](_0x4040a0(0xbf)+_0x219a4c);}else _0x47ab29[_0x4040a0(0xc1)]===_0x4040a0(0xce)&&this[_0x4040a0(0xd7)](_0x47ab29[_0x4040a0(0xc3)]);}}async[a15_0x2dbbf0(0xbe)](_0x30d879,_0x188d5f,_0x48d55b,_0x132251,_0x543806){const _0x22b321=a15_0x2dbbf0,_0x271021=_0x188d5f||_0x48d55b;if(_0x271021){const {projectName:_0x202689,agentName:_0x76cf31}=parseAgentRef(_0x271021),_0x344c6d=_0x76cf31||_0x271021,_0x2e89f6=_0x76cf31?_0x202689:_0x132251;if(!_0x2e89f6)throw new Error(_0x22b321(0xcf));if(_0x543806){const _0x16df00=_0x188d5f?_0x22b321(0xc9):'session\x20context';console['error'](_0x22b321(0xb6)+_0x16df00+':\x20'+_0x2e89f6+'/'+_0x344c6d);}const _0x4ad9f0=await withSpinner('Resolving\x20project\x20\x27'+_0x2e89f6+_0x22b321(0xe5),()=>_0x30d879[_0x22b321(0xda)][_0x22b321(0xd9)](_0x2e89f6),{'verbose':_0x543806}),_0x5cdc82=await withSpinner(_0x22b321(0xc0)+_0x344c6d+_0x22b321(0xe5),()=>_0x30d879[_0x22b321(0xda)][_0x22b321(0xd8)](_0x344c6d,_0x4ad9f0[_0x22b321(0xc3)]),{'verbose':_0x543806});return _0x5cdc82[_0x22b321(0xc3)];}else{const _0x165509=_0x30d879['llm'][_0x22b321(0xb8)]();if(_0x165509)return _0x543806&&console[_0x22b321(0xaf)]('Using\x20cached\x20default\x20agent:\x20'+_0x165509[_0x22b321(0xe3)]),_0x165509['id'];const _0x2c4c32=await withSpinner(_0x22b321(0xde),()=>_0x30d879[_0x22b321(0xda)][_0x22b321(0xcd)](_0x22b321(0xe2),0x0),{'verbose':_0x543806});return _0x2c4c32['data']['id'];}}async[a15_0x2dbbf0(0xdc)](_0x2ac6e5){const _0x59b6f8=a15_0x2dbbf0,{options:_0x55fb9e,args:_0x252bbc,tdx:_0x59f904}=_0x2ac6e5,_0x3c9e38=_0x252bbc[_0x59b6f8(0xba)]('\x20'),_0x5a4f72=_0x55fb9e,_0x2fbe84=_0x5a4f72[_0x59b6f8(0xbd)],_0x41f861=_0x5a4f72[_0x59b6f8(0xd4)],_0x43ef01=_0x5a4f72[_0x59b6f8(0xd1)],_0x14f0a9=_0x5a4f72[_0x59b6f8(0xc6)];try{let _0x1fd3dc,_0x46e89f;!_0x14f0a9&&(_0x46e89f=loadLastChatId(),_0x46e89f&&_0x55fb9e[_0x59b6f8(0xdd)]&&console[_0x59b6f8(0xaf)]('Continuing\x20chat:\x20'+_0x46e89f));(_0x14f0a9||!_0x46e89f)&&(_0x1fd3dc=await this['getAgentId'](_0x59f904,_0x2fbe84,_0x41f861,_0x43ef01,_0x55fb9e[_0x59b6f8(0xdd)]));try{await this['streamChat'](_0x59f904,_0x3c9e38,_0x1fd3dc,_0x46e89f,_0x55fb9e[_0x59b6f8(0xdd)]);}catch(_0x3e8389){const _0x8d1078=_0x3e8389 instanceof SDKError&&_0x3e8389['code']===ErrorCode[_0x59b6f8(0xb7)]||_0x3e8389 instanceof Error&&_0x3e8389['message'][_0x59b6f8(0xbb)]('404');if(_0x8d1078)_0x55fb9e[_0x59b6f8(0xdd)]&&console[_0x59b6f8(0xaf)](_0x59b6f8(0xd5)),!_0x1fd3dc&&(_0x1fd3dc=await this[_0x59b6f8(0xbe)](_0x59f904,_0x2fbe84,_0x41f861,_0x43ef01,_0x55fb9e[_0x59b6f8(0xdd)])),await this['streamChat'](_0x59f904,_0x3c9e38,_0x1fd3dc,undefined,_0x55fb9e['verbose']);else throw _0x3e8389;}return console['log'](),0x0;}catch(_0x4432b1){return console[_0x59b6f8(0xaf)](),handleSDKError(_0x4432b1,_0x55fb9e),0x1;}}[a15_0x2dbbf0(0xd7)](_0x3876c5){const _0x259320=a15_0x2dbbf0;if('content'in _0x3876c5)process[_0x259320(0xc2)][_0x259320(0xe1)](_0x3876c5['content']);else _0x259320(0xaf)in _0x3876c5&&console[_0x259320(0xaf)](_0x259320(0xb0)+_0x3876c5[_0x259320(0xaf)]);}}
@@ -1 +1 @@
1
- const a16_0x11c910=a16_0x51ef;(function(_0x3591ef,_0x2973f7){const _0x35a272=a16_0x51ef,_0x3621e8=_0x3591ef();while(!![]){try{const _0x5c9e58=parseInt(_0x35a272(0x192))/0x1*(-parseInt(_0x35a272(0x1ea))/0x2)+-parseInt(_0x35a272(0x1a1))/0x3*(parseInt(_0x35a272(0x201))/0x4)+-parseInt(_0x35a272(0x1df))/0x5*(parseInt(_0x35a272(0x1aa))/0x6)+-parseInt(_0x35a272(0x1ed))/0x7+parseInt(_0x35a272(0x1c5))/0x8*(parseInt(_0x35a272(0x1f0))/0x9)+parseInt(_0x35a272(0x1d1))/0xa+parseInt(_0x35a272(0x1cf))/0xb;if(_0x5c9e58===_0x2973f7)break;else _0x3621e8['push'](_0x3621e8['shift']());}catch(_0x313eef){_0x3621e8['push'](_0x3621e8['shift']());}}}(a16_0x12cb,0x4c803));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a16_0x780086 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';function a16_0x12cb(){const _0x27fced=['✓\x20Logs\x20saved\x20to\x20','✓\x20Using\x20project:\x20','stop','statusLine','unshift','✓\x20Port\x20','Claude\x20Code\x20CLI\x20not\x20found','install','Updating\x20marketplace\x20\x27','Invalid\x20minimum\x20version\x20format:\x20','which','getCurrent','--version','Failed\x20to\x20update\x20marketplace\x20\x27','parse','command','Failed\x20to\x20install\x20plugin\x20\x27','td-docs','settings.local.json','string','ANTHROPIC_BASE_URL','CLAUDE_CODE_NOT_FOUND','2083344plkAaa','Checking\x20Claude\x20Code\x20version...','Executing:\x20claude\x20','Command\x20spawn\x20error:\x20','llm','Warning:\x20Failed\x20to\x20configure\x20','cause','Failed\x20to\x20configure\x20marketplace\x20\x27','✓\x20Claude\x20Code\x20version\x20OK','sql-skills','8828974eEfKYX','http://127.0.0.1:','3390550sVsDFr','add','init','fail','\x27...','http','debug','utf-8','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','red','ANTHROPIC_AUTH_TOKEN','start','td-skills','server','305qkVyxq','claude','Failed\x20to\x20launch\x20Claude\x20Code:\x20','minor','tdx-managed-proxy','error','Creating\x20.claude/settings.local.json...','name','pipe','tdx-skills','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','76506ZRpFHH','major','plugin','3888234WoLqcS','✓\x20MCP\x20server\x20\x27','user','18MkVvQA','includes','Finding\x20available\x20port...','Command\x20failed\x20(exit\x20','findClaudePath','2.0.20','stdout','cwd','description','td-skills\x20Plugins','Claude\x20Code\x20version\x20','originalSettings','https://docs.treasuredata.com/mcp','type','account_id','\x27\x20updated','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','4AfvYTX','statusline','already\x20configured','logLevel','\x20meets\x20minimum\x20requirement','✓\x20Marketplace\x20\x27','inherit','already\x20installed','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','workflow-skills','marketplace','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','already\x20exists','getLogPath','env','warn','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','close','getOrCreateDefaultProject','\x20is\x20too\x20old\x20(minimum:\x20','trim','model','patch','Setting\x20up\x20project...','toString','proxy','127.0.0.1','data','stderr','info','Claude\x20Code\x20version\x20check\x20failed','sonnet','join','Command\x20output:\x20','14HtObuG','\x20or\x20later.','attributes','localhost','Configuring\x20marketplace\x20\x27','site','--transport','exit','✓\x20Plugin\x20\x27','object','.claude','port','continue','✓\x20Settings\x20restored:\x20.claude/settings.local.json','logger','176295SJYOEh','text','https://github.com/treasure-data/td-skills','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','green','code','message','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','ANTHROPIC_MODEL','19614JpFMRX','log','CLAUDE_CODE_UNSUPPORTED_VERSION','stringify','):\x20claude\x20'];a16_0x12cb=function(){return _0x27fced;};return a16_0x12cb();}import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a16_0x11c910(0x1f5);function a16_0x51ef(_0x3e1649,_0x1e070d){_0x3e1649=_0x3e1649-0x190;const _0x12cbbe=a16_0x12cb();let _0x51ef79=_0x12cbbe[_0x3e1649];return _0x51ef79;}function handleInstallationError(_0x44e803,_0x2b5871,_0x457134,_0x5ad877){const _0x505ebc=a16_0x11c910;errorContains(_0x44e803,_0x505ebc(0x20d),_0x505ebc(0x208),_0x505ebc(0x203))?(_0x457134['text']='✓\x20'+_0x2b5871+'\x20already\x20configured',_0x5ad877?.[_0x505ebc(0x21e)](_0x2b5871+'\x20already\x20configured'),_0x44e803 instanceof SDKError&&_0x44e803[_0x505ebc(0x1cb)]&&_0x5ad877?.[_0x505ebc(0x1d7)](_0x505ebc(0x191)+_0x44e803[_0x505ebc(0x1cb)][_0x505ebc(0x1a7)])):(_0x457134[_0x505ebc(0x210)](_0x505ebc(0x1ca)+_0x2b5871),_0x5ad877?.[_0x505ebc(0x1e4)](_0x2b5871+'\x20configuration\x20failed',_0x44e803));}export function parseVersion(_0xc587ed){const _0x4b3a1e=a16_0x11c910,_0x186a1c=_0xc587ed[_0x4b3a1e(0x215)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x186a1c)return null;return{'major':parseInt(_0x186a1c[0x1],0xa),'minor':parseInt(_0x186a1c[0x2],0xa),'patch':parseInt(_0x186a1c[0x3],0xa)};}export function compareVersions(_0xc6e1dc,_0x1e5ad9){const _0x5b612e=a16_0x11c910;if(_0xc6e1dc[_0x5b612e(0x1eb)]!==_0x1e5ad9[_0x5b612e(0x1eb)])return _0xc6e1dc['major']-_0x1e5ad9[_0x5b612e(0x1eb)];if(_0xc6e1dc[_0x5b612e(0x1e2)]!==_0x1e5ad9[_0x5b612e(0x1e2)])return _0xc6e1dc['minor']-_0x1e5ad9[_0x5b612e(0x1e2)];return _0xc6e1dc[_0x5b612e(0x217)]-_0x1e5ad9[_0x5b612e(0x217)];}async function checkClaudeVersion(_0x1ac0b7,_0x1f8ec1){const _0x1d29c7=a16_0x11c910;_0x1f8ec1?.[_0x1d29c7(0x1d7)](_0x1d29c7(0x1d9)+_0x1ac0b7+')');const _0x1df819=await executeClaudeCommand([_0x1d29c7(0x1bb)],undefined,_0x1f8ec1),_0x33f5a1=parseVersion(_0x1df819);if(!_0x33f5a1){_0x1f8ec1?.[_0x1d29c7(0x210)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x1df819);return;}const _0x1bb422=_0x33f5a1[_0x1d29c7(0x1eb)]+'.'+_0x33f5a1[_0x1d29c7(0x1e2)]+'.'+_0x33f5a1['patch'],_0x2a7e06=parseVersion(_0x1ac0b7);if(!_0x2a7e06){_0x1f8ec1?.[_0x1d29c7(0x210)](_0x1d29c7(0x1b8)+_0x1ac0b7);return;}if(compareVersions(_0x33f5a1,_0x2a7e06)<0x0){_0x1f8ec1?.['error']('Claude\x20Code\x20version\x20'+_0x1bb422+_0x1d29c7(0x214)+_0x1ac0b7+')');throw new SDKError(ErrorCode[_0x1d29c7(0x1ac)],_0x1d29c7(0x1fa)+_0x1bb422+_0x1d29c7(0x211)+_0x1ac0b7+_0x1d29c7(0x193),undefined,{'helpText':_0x1d29c7(0x1e9)});}_0x1f8ec1?.[_0x1d29c7(0x1d7)](_0x1d29c7(0x1fa)+_0x1bb422+_0x1d29c7(0x205));}async function executeClaudeCommand(_0x499b07,_0xd1db6e,_0x13f535){const _0x1d1e4d=a16_0x11c910;return _0x13f535?.['info'](_0x1d1e4d(0x1c7)+_0x499b07[_0x1d1e4d(0x190)]('\x20')),new Promise((_0x3bd052,_0x2c442c)=>{const _0x352c73=_0x1d1e4d,_0x4afa2d=spawn(_0x352c73(0x1e0),_0x499b07,{'stdio':_0x352c73(0x1e7)});let _0x5b1b4a='',_0x5524a5='';_0x4afa2d[_0x352c73(0x1f6)]['on'](_0x352c73(0x21c),_0x3f7f7d=>{const _0x32acb8=_0x352c73;_0x5b1b4a+=_0x3f7f7d[_0x32acb8(0x219)]();}),_0x4afa2d[_0x352c73(0x21d)]['on']('data',_0x19758f=>{const _0x58e06f=_0x352c73;_0x5524a5+=_0x19758f[_0x58e06f(0x219)]();}),_0x4afa2d['on'](_0x352c73(0x1e4),_0x1414f2=>{const _0x393dd2=_0x352c73;_0x1414f2[_0x393dd2(0x1a6)]==='ENOENT'?(_0x13f535?.['error']('Claude\x20Code\x20CLI\x20not\x20found'),_0x2c442c(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',_0x1414f2,{'helpText':_0x393dd2(0x1a4)}))):(_0x13f535?.[_0x393dd2(0x1e4)](_0x393dd2(0x1c8)+_0x1414f2['message']),_0x2c442c(new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x1414f2[_0x393dd2(0x1a7)],_0x1414f2)));}),_0x4afa2d['on'](_0x352c73(0x199),_0x7307ea=>{const _0xdda9ed=_0x352c73;if(_0x7307ea===0x0)_0x3bd052(_0x5b1b4a);else _0xd1db6e?(_0x13f535?.[_0xdda9ed(0x1e4)](_0xdda9ed(0x1f3)+_0x7307ea+_0xdda9ed(0x1ae)+_0x499b07[_0xdda9ed(0x190)]('\x20')),_0x2c442c(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0xd1db6e,new Error(_0x5524a5)))):_0x3bd052('');});});}async function ensureMcpServer(_0x543b9e,_0x596a1c,_0x22d65f,_0x1b3a01,_0xf687fa){const _0x537882=a16_0x11c910;_0x1b3a01[_0x537882(0x1a2)]='Configuring\x20MCP\x20server\x20\x27'+_0x543b9e+_0x537882(0x1d5),await executeClaudeCommand(['mcp',_0x537882(0x1d2),_0x543b9e,_0x596a1c,_0x537882(0x198),_0x22d65f],_0x537882(0x1a8)+_0x543b9e+'\x27',_0xf687fa),_0x1b3a01[_0x537882(0x1a2)]=_0x537882(0x1ee)+_0x543b9e+'\x27\x20configured';}async function ensureMarketplace(_0x5cf5eb,_0x3cc0d1,_0x41a233,_0xd46144){const _0xfa365f=a16_0x11c910;_0x41a233[_0xfa365f(0x1a2)]=_0xfa365f(0x196)+_0x5cf5eb+_0xfa365f(0x1d5),await executeClaudeCommand([_0xfa365f(0x1ec),'marketplace',_0xfa365f(0x1d2),_0x3cc0d1],_0xfa365f(0x1cc)+_0x5cf5eb+'\x27',_0xd46144),_0x41a233[_0xfa365f(0x1a2)]=_0xfa365f(0x206)+_0x5cf5eb+'\x27\x20configured';}async function updateMarketplace(_0x1a0481,_0x595ee2,_0xf74133){const _0x3342e1=a16_0x11c910;_0x595ee2['text']=_0x3342e1(0x1b7)+_0x1a0481+_0x3342e1(0x1d5),await executeClaudeCommand([_0x3342e1(0x1ec),_0x3342e1(0x20b),'update'],_0x3342e1(0x1bc)+_0x1a0481+'\x27',_0xf74133),_0x595ee2['text']=_0x3342e1(0x206)+_0x1a0481+_0x3342e1(0x1ff);}async function ensurePlugin(_0x375239,_0x31d977,_0x4dc357,_0x1b886d){const _0x3855e5=a16_0x11c910;_0x4dc357[_0x3855e5(0x1a2)]='Installing\x20plugin\x20\x27'+_0x375239+_0x3855e5(0x1d5),await executeClaudeCommand([_0x3855e5(0x1ec),_0x3855e5(0x1b6),_0x375239+'@'+_0x31d977],_0x3855e5(0x1bf)+_0x375239+'\x27',_0x1b886d),_0x4dc357['text']=_0x3855e5(0x19a)+_0x375239+'\x27\x20installed';}async function createClaudeSettings(_0xfac5d3,_0x3e7010=a16_0x11c910(0x220),_0x2b1f9f){const _0x247512=a16_0x11c910,_0x394401=join(process['cwd'](),_0x247512(0x19c)),_0x3a4112=join(_0x394401,_0x247512(0x1c1));await mkdir(_0x394401,{'recursive':!![]});let _0x197be6={};if(existsSync(_0x3a4112))try{const _0xcc98d7=await readFile(_0x3a4112,'utf-8');_0x197be6=JSON[_0x247512(0x1bd)](_0xcc98d7);}catch{_0x197be6={};}const _0x351a61=_0x197be6[_0x247512(0x20f)]||{},_0x21c34f={'ANTHROPIC_BASE_URL':_0x351a61[_0x247512(0x1c3)],'ANTHROPIC_MODEL':_0x351a61['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x351a61[_0x247512(0x1db)],'statusLine':_0x197be6['statusLine']},_0x4a9041={..._0x197be6,'env':{..._0x351a61,'ANTHROPIC_BASE_URL':_0x247512(0x1d0)+_0xfac5d3,'ANTHROPIC_MODEL':_0x3e7010,'ANTHROPIC_AUTH_TOKEN':_0x247512(0x1e3)},'statusLine':{'type':_0x247512(0x1be),'command':_0x2b1f9f?'tdx\x20--profile\x20'+_0x2b1f9f+'\x20claude\x20statusline':'tdx\x20claude\x20statusline'}};return await writeFile(_0x3a4112,JSON[_0x247512(0x1ad)](_0x4a9041,null,0x2)+'\x0a'),_0x21c34f;}async function restoreClaudeSettings(_0x2494e6){const _0x5830f9=a16_0x11c910,_0x9375a0=join(process[_0x5830f9(0x1f7)](),_0x5830f9(0x19c)),_0x50f00d=join(_0x9375a0,_0x5830f9(0x1c1));if(!existsSync(_0x50f00d))return;try{const _0x302e83=await readFile(_0x50f00d,_0x5830f9(0x1d8)),_0x3a761a=JSON['parse'](_0x302e83),_0x14911c=_0x3a761a[_0x5830f9(0x20f)]||{},_0x2fb01c=_0x14911c[_0x5830f9(0x1c3)],_0x32356b=((()=>{const _0x31e8ea=_0x5830f9;if(typeof _0x2fb01c!==_0x31e8ea(0x1c2))return![];try{const _0x40f46c=new URL(_0x2fb01c);return _0x40f46c['hostname']===_0x31e8ea(0x195)||_0x40f46c['hostname']===_0x31e8ea(0x21b);}catch{return![];}})());_0x32356b?(delete _0x14911c[_0x5830f9(0x1c3)],delete _0x14911c[_0x5830f9(0x1a9)],delete _0x14911c[_0x5830f9(0x1db)]):(_0x2494e6[_0x5830f9(0x1c3)]!==undefined?_0x14911c[_0x5830f9(0x1c3)]=_0x2494e6[_0x5830f9(0x1c3)]:delete _0x14911c[_0x5830f9(0x1c3)],_0x2494e6[_0x5830f9(0x1a9)]!==undefined?_0x14911c['ANTHROPIC_MODEL']=_0x2494e6[_0x5830f9(0x1a9)]:delete _0x14911c[_0x5830f9(0x1a9)],_0x2494e6[_0x5830f9(0x1db)]!==undefined?_0x14911c[_0x5830f9(0x1db)]=_0x2494e6[_0x5830f9(0x1db)]:delete _0x14911c['ANTHROPIC_AUTH_TOKEN']);const _0x22f416=_0x3a761a[_0x5830f9(0x1b2)],_0x4353f6=((()=>{const _0x1a745b=_0x5830f9;if(!_0x22f416||typeof _0x22f416!==_0x1a745b(0x19b))return![];if(_0x22f416[_0x1a745b(0x1fd)]!=='command')return![];if(typeof _0x22f416[_0x1a745b(0x1be)]!==_0x1a745b(0x1c2))return![];return _0x22f416[_0x1a745b(0x1be)][_0x1a745b(0x1f1)]('tdx')&&_0x22f416[_0x1a745b(0x1be)][_0x1a745b(0x1f1)](_0x1a745b(0x202));})());if(_0x4353f6)delete _0x3a761a[_0x5830f9(0x1b2)];else _0x2494e6[_0x5830f9(0x1b2)]!==undefined?_0x3a761a[_0x5830f9(0x1b2)]=_0x2494e6[_0x5830f9(0x1b2)]:delete _0x3a761a[_0x5830f9(0x1b2)];_0x3a761a[_0x5830f9(0x20f)]=_0x14911c,await writeFile(_0x50f00d,JSON[_0x5830f9(0x1ad)](_0x3a761a,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a16_0x11c910(0x1e6)]=a16_0x11c910(0x1e0);[a16_0x11c910(0x1f8)]=a16_0x11c910(0x209);['server'];[a16_0x11c910(0x1fb)];[a16_0x11c910(0x1a0)];[a16_0x11c910(0x19d)];async['execute'](_0x134a11){const _0x510bbb=a16_0x11c910,{tdx:_0x14b773,options:_0x6c1d2,args:_0xc01b0b}=_0x134a11;try{const _0x5a9800=_0x6c1d2,_0xfab5e2=_0x5a9800[_0x510bbb(0x216)]||_0x510bbb(0x220),_0x56c9ef=_0x5a9800[_0x510bbb(0x21a)]===![],_0x21c27f=_0x5a9800[_0x510bbb(0x19e)]===!![],_0x5cbc18=_0x5a9800['resume']===!![],_0x5bfcd2=[..._0xc01b0b];if(_0x21c27f)_0x5bfcd2[_0x510bbb(0x1b3)]('-c');else _0x5cbc18&&_0x5bfcd2[_0x510bbb(0x1b3)]('-r');const _0x2436f0=createCommandSpinner('Initializing...',{'verbose':_0x6c1d2['verbose']});_0x2436f0[_0x510bbb(0x1dc)]();try{if(!_0x56c9ef){_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x1f2),this[_0x510bbb(0x19d)]=await findAvailablePort(0xfa0),_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x1b4)+this['port'],_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x218);const _0x5b0d9e=await _0x14b773[_0x510bbb(0x1c9)][_0x510bbb(0x213)](),_0x5db74f=_0x5b0d9e['id'];_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x1b0)+_0x5b0d9e[_0x510bbb(0x194)][_0x510bbb(0x1e6)];const _0x3e40e6=_0x6c1d2['profile'];try{const _0x4fe339=await _0x14b773[_0x510bbb(0x1ef)][_0x510bbb(0x1ba)]();_0x4fe339[_0x510bbb(0x1fe)]&&writeCachedAccountInfo(_0x6c1d2[_0x510bbb(0x197)],_0x4fe339[_0x510bbb(0x1fe)],_0x3e40e6);}catch{}_0x2436f0[_0x510bbb(0x1a2)]='Initializing\x20proxy\x20logger...',this[_0x510bbb(0x1a0)]=new TDXLogger(_0x6c1d2[_0x510bbb(0x204)],!![]),await this[_0x510bbb(0x1a0)][_0x510bbb(0x1d3)]();const _0x495bde=this['logger'][_0x510bbb(0x20e)]();_0x2436f0[_0x510bbb(0x1a2)]='✓\x20Logging\x20to\x20'+_0x495bde,_0x2436f0['text']='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x510bbb(0x1de)]=new ProxyServer({'port':this['port'],'projectId':_0x5db74f,'tdx':_0x14b773,'logger':this[_0x510bbb(0x1a0)],'site':_0x6c1d2['site']}),await this[_0x510bbb(0x1de)][_0x510bbb(0x1dc)](),_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x20c)+this[_0x510bbb(0x19d)],_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x1e5),this[_0x510bbb(0x1fb)]=await createClaudeSettings(this[_0x510bbb(0x19d)],_0xfab5e2,_0x3e40e6),_0x2436f0['text']='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x200);try{_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x1c6),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x510bbb(0x1a0)]),_0x2436f0[_0x510bbb(0x1a2)]=_0x510bbb(0x1cd);}catch(_0x5bf7b2){_0x2436f0[_0x510bbb(0x1d4)](_0x510bbb(0x21f));throw _0x5bf7b2;}try{await ensureMcpServer(_0x510bbb(0x1c0),_0x510bbb(0x1fc),_0x510bbb(0x1d6),_0x2436f0,this[_0x510bbb(0x1a0)]);}catch(_0x4dde08){handleInstallationError(_0x4dde08,'TD\x20Docs\x20MCP\x20Server',_0x2436f0,this[_0x510bbb(0x1a0)]);}try{await ensureMarketplace('td-skills',_0x510bbb(0x1a3),_0x2436f0,this[_0x510bbb(0x1a0)]),await updateMarketplace(_0x510bbb(0x1dd),_0x2436f0,this[_0x510bbb(0x1a0)]),await ensurePlugin(_0x510bbb(0x1ce),'td-skills',_0x2436f0,this[_0x510bbb(0x1a0)]),await ensurePlugin(_0x510bbb(0x20a),_0x510bbb(0x1dd),_0x2436f0,this[_0x510bbb(0x1a0)]),await ensurePlugin(_0x510bbb(0x1e8),_0x510bbb(0x1dd),_0x2436f0,this['logger']);}catch(_0x1ab2dd){handleInstallationError(_0x1ab2dd,_0x510bbb(0x1f9),_0x2436f0,this[_0x510bbb(0x1a0)]);}_0x2436f0[_0x510bbb(0x1b1)]();}catch(_0x4dadcc){_0x2436f0[_0x510bbb(0x1d4)]('Setup\x20failed');throw _0x4dadcc;}const _0x49609d=await this[_0x510bbb(0x1f4)]();if(!_0x49609d)throw new SDKError(ErrorCode[_0x510bbb(0x1c4)],_0x510bbb(0x1b5),undefined,{'helpText':_0x510bbb(0x1a4)});const _0x3a6d92={...process[_0x510bbb(0x20f)]};!_0x56c9ef&&(_0x3a6d92[_0x510bbb(0x1c3)]=_0x510bbb(0x1d0)+this[_0x510bbb(0x19d)],_0x3a6d92[_0x510bbb(0x1a9)]=_0xfab5e2,_0x3a6d92[_0x510bbb(0x1db)]=_0x510bbb(0x1e3));const _0x11e7e0=spawn(_0x49609d,_0x5bfcd2,{'stdio':_0x510bbb(0x207),'env':_0x3a6d92}),_0x1c260d=await new Promise(_0x1425a9=>{const _0x326a6f=_0x510bbb;_0x11e7e0['on'](_0x326a6f(0x199),_0x105308=>{_0x1425a9(_0x105308||0x0);}),_0x11e7e0['on'](_0x326a6f(0x1e4),_0x38593c=>{const _0x312d7e=_0x326a6f;console[_0x312d7e(0x1e4)](a16_0x780086[_0x312d7e(0x1da)](_0x312d7e(0x1e1)+_0x38593c['message'])),_0x1425a9(0x1);});});this[_0x510bbb(0x1de)]&&(await this[_0x510bbb(0x1de)][_0x510bbb(0x1b1)](),console['log'](a16_0x780086[_0x510bbb(0x1a5)]('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));if(this['logger']){await this[_0x510bbb(0x1a0)]['close']();const _0x57f33b=this[_0x510bbb(0x1a0)][_0x510bbb(0x20e)]();console['log'](a16_0x780086[_0x510bbb(0x1a5)](_0x510bbb(0x1af)+_0x57f33b));}return this[_0x510bbb(0x1fb)]&&(await restoreClaudeSettings(this[_0x510bbb(0x1fb)]),console[_0x510bbb(0x1ab)](a16_0x780086['green'](_0x510bbb(0x19f)))),_0x1c260d;}catch(_0x46ee67){this['server']&&await this['server'][_0x510bbb(0x1b1)]();this[_0x510bbb(0x1a0)]&&await this[_0x510bbb(0x1a0)][_0x510bbb(0x212)]();this[_0x510bbb(0x1fb)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x46ee67;}}async[a16_0x11c910(0x1f4)](){return new Promise(_0x12b2fc=>{const _0x46e987=a16_0x51ef,_0x119775=spawn(_0x46e987(0x1b9),[_0x46e987(0x1e0)]);let _0x24c593='';_0x119775[_0x46e987(0x1f6)]['on'](_0x46e987(0x21c),_0x10860d=>{const _0x5908cc=_0x46e987;_0x24c593+=_0x10860d[_0x5908cc(0x219)]();}),_0x119775['on'](_0x46e987(0x199),_0x460a9c=>{const _0xa23c7c=_0x46e987;_0x460a9c===0x0&&_0x24c593[_0xa23c7c(0x215)]()?_0x12b2fc(_0x24c593[_0xa23c7c(0x215)]()):_0x12b2fc(null);});});}}
1
+ const a16_0x5dd802=a16_0x3fad;(function(_0x51c05a,_0x310a61){const _0x5ad3dd=a16_0x3fad,_0x45494b=_0x51c05a();while(!![]){try{const _0x92ec4c=parseInt(_0x5ad3dd(0xb7))/0x1*(-parseInt(_0x5ad3dd(0xf4))/0x2)+parseInt(_0x5ad3dd(0x101))/0x3+-parseInt(_0x5ad3dd(0xf2))/0x4+parseInt(_0x5ad3dd(0x139))/0x5+-parseInt(_0x5ad3dd(0xb8))/0x6*(parseInt(_0x5ad3dd(0xff))/0x7)+parseInt(_0x5ad3dd(0x13b))/0x8+parseInt(_0x5ad3dd(0x145))/0x9;if(_0x92ec4c===_0x310a61)break;else _0x45494b['push'](_0x45494b['shift']());}catch(_0x53830f){_0x45494b['push'](_0x45494b['shift']());}}}(a16_0x4d8a,0x43b02));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a16_0x338c2b from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';function a16_0x3fad(_0x2f3a96,_0x2acbb8){_0x2f3a96=_0x2f3a96-0xb2;const _0x4d8aca=a16_0x4d8a();let _0x3fad23=_0x4d8aca[_0x2f3a96];return _0x3fad23;}import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a16_0x5dd802(0x114);function handleInstallationError(_0x70ec59,_0x40db0c,_0x436008,_0x5551f6){const _0x4cbf68=a16_0x5dd802;errorContains(_0x70ec59,_0x4cbf68(0xca),'already\x20installed',_0x4cbf68(0x124))?(_0x436008[_0x4cbf68(0xef)]='✓\x20'+_0x40db0c+_0x4cbf68(0x13d),_0x5551f6?.['info'](_0x40db0c+_0x4cbf68(0x13d)),_0x70ec59 instanceof SDKError&&_0x70ec59[_0x4cbf68(0xc0)]&&_0x5551f6?.[_0x4cbf68(0x113)]('Command\x20output:\x20'+_0x70ec59[_0x4cbf68(0xc0)][_0x4cbf68(0x122)])):(_0x436008['warn']('Warning:\x20Failed\x20to\x20configure\x20'+_0x40db0c),_0x5551f6?.[_0x4cbf68(0x12b)](_0x40db0c+_0x4cbf68(0xfe),_0x70ec59));}export function parseVersion(_0x11d9fa){const _0x97b325=a16_0x5dd802,_0x6afb6e=_0x11d9fa['trim']()[_0x97b325(0x10d)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x6afb6e)return null;return{'major':parseInt(_0x6afb6e[0x1],0xa),'minor':parseInt(_0x6afb6e[0x2],0xa),'patch':parseInt(_0x6afb6e[0x3],0xa)};}export function compareVersions(_0x1b0333,_0x9a1164){const _0x4d303d=a16_0x5dd802;if(_0x1b0333[_0x4d303d(0x120)]!==_0x9a1164[_0x4d303d(0x120)])return _0x1b0333[_0x4d303d(0x120)]-_0x9a1164[_0x4d303d(0x120)];if(_0x1b0333[_0x4d303d(0xce)]!==_0x9a1164[_0x4d303d(0xce)])return _0x1b0333['minor']-_0x9a1164[_0x4d303d(0xce)];return _0x1b0333['patch']-_0x9a1164[_0x4d303d(0xf9)];}async function checkClaudeVersion(_0x54ff87,_0x7a8fa3){const _0x11e26a=a16_0x5dd802;_0x7a8fa3?.[_0x11e26a(0x113)](_0x11e26a(0xb2)+_0x54ff87+')');const _0x12adf2=await executeClaudeCommand([_0x11e26a(0xc4)],undefined,_0x7a8fa3),_0x37dd2=parseVersion(_0x12adf2);if(!_0x37dd2){_0x7a8fa3?.[_0x11e26a(0xb9)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x12adf2);return;}const _0x1be321=_0x37dd2[_0x11e26a(0x120)]+'.'+_0x37dd2[_0x11e26a(0xce)]+'.'+_0x37dd2[_0x11e26a(0xf9)],_0x3b214a=parseVersion(_0x54ff87);if(!_0x3b214a){_0x7a8fa3?.['warn']('Invalid\x20minimum\x20version\x20format:\x20'+_0x54ff87);return;}if(compareVersions(_0x37dd2,_0x3b214a)<0x0){_0x7a8fa3?.['error']('Claude\x20Code\x20version\x20'+_0x1be321+_0x11e26a(0x13f)+_0x54ff87+')');throw new SDKError(ErrorCode[_0x11e26a(0xd6)],'Claude\x20Code\x20version\x20'+_0x1be321+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x54ff87+_0x11e26a(0x136),undefined,{'helpText':_0x11e26a(0x115)});}_0x7a8fa3?.['debug'](_0x11e26a(0xbf)+_0x1be321+_0x11e26a(0x13c));}async function executeClaudeCommand(_0x34c28f,_0x25c089,_0x20fb93){const _0x26f989=a16_0x5dd802;return _0x20fb93?.['info'](_0x26f989(0x12c)+_0x34c28f[_0x26f989(0x12f)]('\x20')),new Promise((_0x22cdc0,_0x9ad702)=>{const _0x369cea=_0x26f989,_0x314cdd=spawn(_0x369cea(0x116),_0x34c28f,{'stdio':_0x369cea(0x138)});let _0x3aa391='',_0x20c37c='';_0x314cdd[_0x369cea(0xbb)]['on'](_0x369cea(0x13a),_0xba4494=>{const _0x50d3be=_0x369cea;_0x3aa391+=_0xba4494[_0x50d3be(0x103)]();}),_0x314cdd[_0x369cea(0xc7)]['on'](_0x369cea(0x13a),_0x3295f5=>{const _0x266622=_0x369cea;_0x20c37c+=_0x3295f5[_0x266622(0x103)]();}),_0x314cdd['on'](_0x369cea(0x12b),_0x33e8be=>{const _0xbfa10b=_0x369cea;_0x33e8be['code']===_0xbfa10b(0x102)?(_0x20fb93?.[_0xbfa10b(0x12b)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x9ad702(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',_0x33e8be,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x20fb93?.['error']('Command\x20spawn\x20error:\x20'+_0x33e8be[_0xbfa10b(0x122)]),_0x9ad702(new SDKError(ErrorCode[_0xbfa10b(0x12d)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x33e8be[_0xbfa10b(0x122)],_0x33e8be)));}),_0x314cdd['on']('exit',_0x4559d8=>{const _0x599a4e=_0x369cea;if(_0x4559d8===0x0)_0x22cdc0(_0x3aa391);else _0x25c089?(_0x20fb93?.[_0x599a4e(0x12b)]('Command\x20failed\x20(exit\x20'+_0x4559d8+_0x599a4e(0x10e)+_0x34c28f[_0x599a4e(0x12f)]('\x20')),_0x9ad702(new SDKError(ErrorCode[_0x599a4e(0x13e)],_0x25c089,new Error(_0x20c37c)))):_0x22cdc0('');});});}async function ensureMcpServer(_0x4bc8cd,_0x3ceeef,_0x394a7e,_0x30d4c1,_0x1dfd8c){const _0xa8b026=a16_0x5dd802;_0x30d4c1[_0xa8b026(0xef)]=_0xa8b026(0x109)+_0x4bc8cd+_0xa8b026(0xcc),await executeClaudeCommand([_0xa8b026(0xd3),'add',_0x4bc8cd,_0x3ceeef,'--transport',_0x394a7e],_0xa8b026(0xbe)+_0x4bc8cd+'\x27',_0x1dfd8c),_0x30d4c1[_0xa8b026(0xef)]=_0xa8b026(0x131)+_0x4bc8cd+_0xa8b026(0x127);}async function ensureMarketplace(_0x223eb8,_0x33391f,_0x4838a5,_0x45fb4a){const _0xd25d4e=a16_0x5dd802;_0x4838a5[_0xd25d4e(0xef)]='Configuring\x20marketplace\x20\x27'+_0x223eb8+'\x27...',await executeClaudeCommand([_0xd25d4e(0xba),_0xd25d4e(0x11c),_0xd25d4e(0x12a),_0x33391f],_0xd25d4e(0x10f)+_0x223eb8+'\x27',_0x45fb4a),_0x4838a5[_0xd25d4e(0xef)]=_0xd25d4e(0xc1)+_0x223eb8+_0xd25d4e(0x127);}async function updateMarketplace(_0x2ed07e,_0xceebb9,_0x4e73f5){const _0x524e07=a16_0x5dd802;_0xceebb9[_0x524e07(0xef)]=_0x524e07(0x118)+_0x2ed07e+_0x524e07(0xcc),await executeClaudeCommand([_0x524e07(0xba),'marketplace',_0x524e07(0x107)],_0x524e07(0xdd)+_0x2ed07e+'\x27',_0x4e73f5),_0xceebb9[_0x524e07(0xef)]=_0x524e07(0xc1)+_0x2ed07e+_0x524e07(0xf0);}async function ensurePlugin(_0x4a1138,_0x36e756,_0xbffed3,_0x1867e4){const _0x2c7b04=a16_0x5dd802;_0xbffed3['text']=_0x2c7b04(0x143)+_0x4a1138+_0x2c7b04(0xcc),await executeClaudeCommand([_0x2c7b04(0xba),_0x2c7b04(0x133),_0x4a1138+'@'+_0x36e756],_0x2c7b04(0xbc)+_0x4a1138+'\x27',_0x1867e4),_0xbffed3[_0x2c7b04(0xef)]=_0x2c7b04(0xf7)+_0x4a1138+_0x2c7b04(0x11b);}async function createClaudeSettings(_0x1c592a,_0x15620b=a16_0x5dd802(0x10b),_0x298adb){const _0x27ad66=a16_0x5dd802,_0x327a5b=join(process['cwd'](),_0x27ad66(0xf6)),_0x316f05=join(_0x327a5b,_0x27ad66(0x11e));await mkdir(_0x327a5b,{'recursive':!![]});let _0xcce11a={};if(existsSync(_0x316f05))try{const _0x2a15b6=await readFile(_0x316f05,_0x27ad66(0xfd));_0xcce11a=JSON['parse'](_0x2a15b6);}catch{_0xcce11a={};}const _0x2277a2=_0xcce11a[_0x27ad66(0x111)]||{},_0x5a624b={'ANTHROPIC_BASE_URL':_0x2277a2[_0x27ad66(0xbd)],'ANTHROPIC_MODEL':_0x2277a2[_0x27ad66(0xdb)],'ANTHROPIC_AUTH_TOKEN':_0x2277a2['ANTHROPIC_AUTH_TOKEN'],'statusLine':_0xcce11a[_0x27ad66(0x125)]},_0x36b5e2={..._0xcce11a,'env':{..._0x2277a2,'ANTHROPIC_BASE_URL':_0x27ad66(0xb4)+_0x1c592a,'ANTHROPIC_MODEL':_0x15620b,'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy'},'statusLine':{'type':_0x27ad66(0x123),'command':_0x298adb?_0x27ad66(0xea)+_0x298adb+_0x27ad66(0xf8):_0x27ad66(0x104)}};return await writeFile(_0x316f05,JSON[_0x27ad66(0x11f)](_0x36b5e2,null,0x2)+'\x0a'),_0x5a624b;}async function restoreClaudeSettings(_0x206639){const _0x464d64=a16_0x5dd802,_0x183f58=join(process[_0x464d64(0xf3)](),_0x464d64(0xf6)),_0x39c050=join(_0x183f58,_0x464d64(0x11e));if(!existsSync(_0x39c050))return;try{const _0x3de765=await readFile(_0x39c050,'utf-8'),_0x45501d=JSON[_0x464d64(0x10c)](_0x3de765),_0x527ec8=_0x45501d[_0x464d64(0x111)]||{},_0x390b90=_0x527ec8[_0x464d64(0xbd)],_0x1929b2=((()=>{const _0x53da9e=_0x464d64;if(typeof _0x390b90!==_0x53da9e(0xfb))return![];try{const _0x5cbd48=new URL(_0x390b90);return _0x5cbd48[_0x53da9e(0xee)]===_0x53da9e(0xdc)||_0x5cbd48[_0x53da9e(0xee)]===_0x53da9e(0xd0);}catch{return![];}})());_0x1929b2?(delete _0x527ec8[_0x464d64(0xbd)],delete _0x527ec8['ANTHROPIC_MODEL'],delete _0x527ec8[_0x464d64(0x100)]):(_0x206639[_0x464d64(0xbd)]!==undefined?_0x527ec8[_0x464d64(0xbd)]=_0x206639['ANTHROPIC_BASE_URL']:delete _0x527ec8[_0x464d64(0xbd)],_0x206639[_0x464d64(0xdb)]!==undefined?_0x527ec8[_0x464d64(0xdb)]=_0x206639[_0x464d64(0xdb)]:delete _0x527ec8[_0x464d64(0xdb)],_0x206639['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x527ec8[_0x464d64(0x100)]=_0x206639[_0x464d64(0x100)]:delete _0x527ec8[_0x464d64(0x100)]);const _0x4d7ac3=_0x45501d[_0x464d64(0x125)],_0x545a14=((()=>{const _0x269beb=_0x464d64;if(!_0x4d7ac3||typeof _0x4d7ac3!==_0x269beb(0xd5))return![];if(_0x4d7ac3[_0x269beb(0x141)]!==_0x269beb(0x123))return![];if(typeof _0x4d7ac3[_0x269beb(0x123)]!=='string')return![];return _0x4d7ac3[_0x269beb(0x123)][_0x269beb(0x110)](_0x269beb(0xe4))&&_0x4d7ac3['command'][_0x269beb(0x110)]('statusline');})());if(_0x545a14)delete _0x45501d[_0x464d64(0x125)];else _0x206639['statusLine']!==undefined?_0x45501d['statusLine']=_0x206639['statusLine']:delete _0x45501d[_0x464d64(0x125)];_0x45501d[_0x464d64(0x111)]=_0x527ec8,await writeFile(_0x39c050,JSON[_0x464d64(0x11f)](_0x45501d,null,0x2)+'\x0a');}catch{}}function a16_0x4d8a(){const _0x26c4a0=['607659jAdSif','ENOENT','toString','tdx\x20claude\x20statusline','server','user','update','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','Configuring\x20MCP\x20server\x20\x27','Initializing\x20proxy\x20logger...','sonnet','parse','match','):\x20claude\x20','Failed\x20to\x20configure\x20marketplace\x20\x27','includes','env','getLogPath','debug','2.0.20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','claude','Claude\x20Code\x20CLI\x20not\x20found','Updating\x20marketplace\x20\x27','CLAUDE_CODE_NOT_FOUND','site','\x27\x20installed','marketplace','log','settings.local.json','stringify','major','name','message','command','already\x20configured','statusLine','stop','\x27\x20configured','start','fail','add','error','Executing:\x20claude\x20','INTERNAL','Creating\x20.claude/settings.local.json...','join','account_id','✓\x20MCP\x20server\x20\x27','proxy','install','✓\x20Logs\x20saved\x20to\x20','llm','\x20or\x20later.','port','pipe','185345MvEnTx','data','754720NoJGcm','\x20meets\x20minimum\x20requirement','\x20already\x20configured','INSTALLATION_FAILED','\x20is\x20too\x20old\x20(minimum:\x20','trim','type','td-skills','Installing\x20plugin\x20\x27','Initializing...','6858576YJglEn','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','Failed\x20to\x20launch\x20Claude\x20Code:\x20','http://127.0.0.1:','Starting\x20TD\x20LLM\x20proxy\x20server...','getOrCreateDefaultProject','17857yPhkOe','76530kHDzUg','warn','plugin','stdout','Failed\x20to\x20install\x20plugin\x20\x27','ANTHROPIC_BASE_URL','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Claude\x20Code\x20version\x20','cause','✓\x20Marketplace\x20\x27','workflow-skills','Checking\x20Claude\x20Code\x20version...','--version','✓\x20Using\x20project:\x20','TD\x20Docs\x20MCP\x20Server','stderr','sql-skills','exit','already\x20exists','which','\x27...','logger','minor','td-skills\x20Plugins','127.0.0.1','✓\x20Settings\x20configured:\x20.claude/settings.local.json','resume','mcp','green','object','CLAUDE_CODE_UNSUPPORTED_VERSION','close','logLevel','getCurrent','https://docs.treasuredata.com/mcp','ANTHROPIC_MODEL','localhost','Failed\x20to\x20update\x20marketplace\x20\x27','model','findClaudePath','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Setup\x20failed','originalSettings','tdx','tdx-managed-proxy','Claude\x20Code\x20version\x20check\x20failed','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Finding\x20available\x20port...','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','tdx\x20--profile\x20','continue','Setting\x20up\x20project...','✓\x20Port\x20','hostname','text','\x27\x20updated','attributes','469004cLrfsx','cwd','30wsnNhj','verbose','.claude','✓\x20Plugin\x20\x27','\x20claude\x20statusline','patch','✓\x20Settings\x20restored:\x20.claude/settings.local.json','string','unshift','utf-8','\x20configuration\x20failed','238ctTpqU','ANTHROPIC_AUTH_TOKEN'];a16_0x4d8a=function(){return _0x26c4a0;};return a16_0x4d8a();}export class ClaudeCommand extends BaseCommand{['name']='claude';['description']=a16_0x5dd802(0x108);[a16_0x5dd802(0x105)];[a16_0x5dd802(0xe3)];[a16_0x5dd802(0xcd)];[a16_0x5dd802(0x137)];async['execute'](_0x153c0b){const _0x5b69d6=a16_0x5dd802,{tdx:_0xae7f06,options:_0x101bc5,args:_0x79720a}=_0x153c0b;try{const _0x512afe=_0x101bc5,_0x1417cf=_0x512afe[_0x5b69d6(0xde)]||_0x5b69d6(0x10b),_0x2d5ada=_0x512afe[_0x5b69d6(0x132)]===![],_0x192c12=_0x512afe[_0x5b69d6(0xeb)]===!![],_0x13605e=_0x512afe[_0x5b69d6(0xd2)]===!![],_0x3d5788=[..._0x79720a];if(_0x192c12)_0x3d5788[_0x5b69d6(0xfc)]('-c');else _0x13605e&&_0x3d5788['unshift']('-r');const _0x38bb76=createCommandSpinner(_0x5b69d6(0x144),{'verbose':_0x101bc5[_0x5b69d6(0xf5)]});_0x38bb76['start']();try{if(!_0x2d5ada){_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xe8),this[_0x5b69d6(0x137)]=await findAvailablePort(0xfa0),_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xed)+this[_0x5b69d6(0x137)],_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xec);const _0xa06411=await _0xae7f06[_0x5b69d6(0x135)][_0x5b69d6(0xb6)](),_0x3457f5=_0xa06411['id'];_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xc5)+_0xa06411[_0x5b69d6(0xf1)][_0x5b69d6(0x121)];const _0x694cfc=_0x101bc5['profile'];try{const _0x271c84=await _0xae7f06[_0x5b69d6(0x106)][_0x5b69d6(0xd9)]();_0x271c84['account_id']&&writeCachedAccountInfo(_0x101bc5['site'],_0x271c84[_0x5b69d6(0x130)],_0x694cfc);}catch{}_0x38bb76['text']=_0x5b69d6(0x10a),this[_0x5b69d6(0xcd)]=new TDXLogger(_0x101bc5[_0x5b69d6(0xd8)],!![]),await this[_0x5b69d6(0xcd)]['init']();const _0xdb9012=this[_0x5b69d6(0xcd)][_0x5b69d6(0x112)]();_0x38bb76[_0x5b69d6(0xef)]='✓\x20Logging\x20to\x20'+_0xdb9012,_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xb5),this['server']=new ProxyServer({'port':this[_0x5b69d6(0x137)],'projectId':_0x3457f5,'tdx':_0xae7f06,'logger':this['logger'],'site':_0x101bc5[_0x5b69d6(0x11a)]}),await this[_0x5b69d6(0x105)][_0x5b69d6(0x128)](),_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xe0)+this[_0x5b69d6(0x137)],_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0x12e),this[_0x5b69d6(0xe3)]=await createClaudeSettings(this[_0x5b69d6(0x137)],_0x1417cf,_0x694cfc),_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xd1);}else _0x38bb76['text']=_0x5b69d6(0xe1);try{_0x38bb76[_0x5b69d6(0xef)]=_0x5b69d6(0xc3),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x5b69d6(0xcd)]),_0x38bb76[_0x5b69d6(0xef)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x4b9b74){_0x38bb76[_0x5b69d6(0x129)](_0x5b69d6(0xe6));throw _0x4b9b74;}try{await ensureMcpServer('td-docs',_0x5b69d6(0xda),'http',_0x38bb76,this[_0x5b69d6(0xcd)]);}catch(_0x51bdf5){handleInstallationError(_0x51bdf5,_0x5b69d6(0xc6),_0x38bb76,this[_0x5b69d6(0xcd)]);}try{await ensureMarketplace(_0x5b69d6(0x142),'https://github.com/treasure-data/td-skills',_0x38bb76,this[_0x5b69d6(0xcd)]),await updateMarketplace(_0x5b69d6(0x142),_0x38bb76,this[_0x5b69d6(0xcd)]),await ensurePlugin(_0x5b69d6(0xc8),_0x5b69d6(0x142),_0x38bb76,this[_0x5b69d6(0xcd)]),await ensurePlugin(_0x5b69d6(0xc2),'td-skills',_0x38bb76,this['logger']),await ensurePlugin('tdx-skills',_0x5b69d6(0x142),_0x38bb76,this[_0x5b69d6(0xcd)]);}catch(_0x3dea69){handleInstallationError(_0x3dea69,_0x5b69d6(0xcf),_0x38bb76,this[_0x5b69d6(0xcd)]);}_0x38bb76['stop']();}catch(_0x845a50){_0x38bb76[_0x5b69d6(0x129)](_0x5b69d6(0xe2));throw _0x845a50;}const _0x5cb81f=await this[_0x5b69d6(0xdf)]();if(!_0x5cb81f)throw new SDKError(ErrorCode[_0x5b69d6(0x119)],_0x5b69d6(0x117),undefined,{'helpText':_0x5b69d6(0xe7)});const _0x155bd2={...process[_0x5b69d6(0x111)]};!_0x2d5ada&&(_0x155bd2['ANTHROPIC_BASE_URL']=_0x5b69d6(0xb4)+this[_0x5b69d6(0x137)],_0x155bd2['ANTHROPIC_MODEL']=_0x1417cf,_0x155bd2['ANTHROPIC_AUTH_TOKEN']=_0x5b69d6(0xe5));const _0x212c76=spawn(_0x5cb81f,_0x3d5788,{'stdio':'inherit','env':_0x155bd2}),_0x5718c8=await new Promise(_0x81cc9a=>{const _0x16b4ca=_0x5b69d6;_0x212c76['on'](_0x16b4ca(0xc9),_0x316727=>{_0x81cc9a(_0x316727||0x0);}),_0x212c76['on'](_0x16b4ca(0x12b),_0x7a2e87=>{const _0x41fa09=_0x16b4ca;console[_0x41fa09(0x12b)](a16_0x338c2b['red'](_0x41fa09(0xb3)+_0x7a2e87['message'])),_0x81cc9a(0x1);});});this[_0x5b69d6(0x105)]&&(await this[_0x5b69d6(0x105)][_0x5b69d6(0x126)](),console['log'](a16_0x338c2b[_0x5b69d6(0xd4)](_0x5b69d6(0xe9))));if(this['logger']){await this[_0x5b69d6(0xcd)][_0x5b69d6(0xd7)]();const _0x2259c5=this[_0x5b69d6(0xcd)][_0x5b69d6(0x112)]();console[_0x5b69d6(0x11d)](a16_0x338c2b[_0x5b69d6(0xd4)](_0x5b69d6(0x134)+_0x2259c5));}return this[_0x5b69d6(0xe3)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x5b69d6(0x11d)](a16_0x338c2b[_0x5b69d6(0xd4)](_0x5b69d6(0xfa)))),_0x5718c8;}catch(_0x5a3d18){this[_0x5b69d6(0x105)]&&await this[_0x5b69d6(0x105)][_0x5b69d6(0x126)]();this['logger']&&await this[_0x5b69d6(0xcd)][_0x5b69d6(0xd7)]();this[_0x5b69d6(0xe3)]&&await restoreClaudeSettings(this[_0x5b69d6(0xe3)]);throw _0x5a3d18;}}async['findClaudePath'](){return new Promise(_0x12547d=>{const _0x1559cb=a16_0x3fad,_0xf88615=spawn(_0x1559cb(0xcb),[_0x1559cb(0x116)]);let _0x56a7c0='';_0xf88615['stdout']['on'](_0x1559cb(0x13a),_0x3f261f=>{_0x56a7c0+=_0x3f261f['toString']();}),_0xf88615['on'](_0x1559cb(0xc9),_0x2a5efd=>{const _0x53a3ee=_0x1559cb;_0x2a5efd===0x0&&_0x56a7c0[_0x53a3ee(0x140)]()?_0x12547d(_0x56a7c0['trim']()):_0x12547d(null);});});}}