@treasuredata/tdx 0.9.3 → 0.9.5

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 (161) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.d.ts +52 -1
  11. package/dist/client/llm-api-client.d.ts.map +1 -1
  12. package/dist/client/llm-api-client.js +1 -1
  13. package/dist/client/llm-api-client.js.map +1 -1
  14. package/dist/client/rate-limiter.js +1 -1
  15. package/dist/client/td-api-client.d.ts +45 -1
  16. package/dist/client/td-api-client.d.ts.map +1 -1
  17. package/dist/client/td-api-client.js +1 -1
  18. package/dist/client/td-api-client.js.map +1 -1
  19. package/dist/client/trino-api-client.js +1 -1
  20. package/dist/client/workflow-client.js +1 -1
  21. package/dist/commands/activations.js +1 -1
  22. package/dist/commands/agent-command.js +1 -1
  23. package/dist/commands/api-command.js +1 -1
  24. package/dist/commands/auth-command.js +1 -1
  25. package/dist/commands/chat-command.js +1 -1
  26. package/dist/commands/claude-command.js +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-usage-command.js +1 -1
  29. package/dist/commands/command.js +1 -1
  30. package/dist/commands/connection-command.d.ts +35 -0
  31. package/dist/commands/connection-command.d.ts.map +1 -1
  32. package/dist/commands/connection-command.js +1 -1
  33. package/dist/commands/connection-command.js.map +1 -1
  34. package/dist/commands/context-command.js +1 -1
  35. package/dist/commands/databases.js +1 -1
  36. package/dist/commands/describe.js +1 -1
  37. package/dist/commands/engage-command.js +1 -1
  38. package/dist/commands/job-command.js +1 -1
  39. package/dist/commands/journey-command.d.ts.map +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-command.js.map +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/llm-proxy.js +1 -1
  44. package/dist/commands/parent-segment-command.js +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-pull-command.js.map +1 -1
  53. package/dist/commands/segment-push-command.d.ts.map +1 -1
  54. package/dist/commands/segment-push-command.js +1 -1
  55. package/dist/commands/segment-push-command.js.map +1 -1
  56. package/dist/commands/segment-update-command.js +1 -1
  57. package/dist/commands/segment-use-command.js +1 -1
  58. package/dist/commands/segments.js +1 -1
  59. package/dist/commands/show.js +1 -1
  60. package/dist/commands/tables.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/workflow-command.js +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/profile.js +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/proxy/anthropic-adapter.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/context-signature.js +1 -1
  78. package/dist/proxy/conversation-utils.js +1 -1
  79. package/dist/proxy/server.js +1 -1
  80. package/dist/proxy/session-cache.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.d.ts +15 -2
  82. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  85. package/dist/sdk/api.js +1 -1
  86. package/dist/sdk/connection-validator.d.ts +119 -0
  87. package/dist/sdk/connection-validator.d.ts.map +1 -0
  88. package/dist/sdk/connection-validator.js +1 -0
  89. package/dist/sdk/connection-validator.js.map +1 -0
  90. package/dist/sdk/connection.d.ts +120 -1
  91. package/dist/sdk/connection.d.ts.map +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/connection.js.map +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.d.ts +4 -0
  96. package/dist/sdk/errors.d.ts.map +1 -1
  97. package/dist/sdk/errors.js +1 -1
  98. package/dist/sdk/errors.js.map +1 -1
  99. package/dist/sdk/index.js +1 -1
  100. package/dist/sdk/job.js +1 -1
  101. package/dist/sdk/journey.js +1 -1
  102. package/dist/sdk/llm.d.ts.map +1 -1
  103. package/dist/sdk/llm.js +1 -1
  104. package/dist/sdk/llm.js.map +1 -1
  105. package/dist/sdk/query.js +1 -1
  106. package/dist/sdk/segment/child-segment-yaml.d.ts +22 -6
  107. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment.js +1 -1
  114. package/dist/sdk/user.js +1 -1
  115. package/dist/sdk/workflow.js +1 -1
  116. package/dist/types/connector-schema.d.ts +182 -0
  117. package/dist/types/connector-schema.d.ts.map +1 -0
  118. package/dist/types/connector-schema.js +1 -0
  119. package/dist/types/connector-schema.js.map +1 -0
  120. package/dist/types/endpoints.js +1 -1
  121. package/dist/types/index.d.ts +3 -1
  122. package/dist/types/index.d.ts.map +1 -1
  123. package/dist/types/index.js +1 -1
  124. package/dist/types/llm.d.ts +107 -2
  125. package/dist/types/llm.d.ts.map +1 -1
  126. package/dist/utils/agent-config.js +1 -1
  127. package/dist/utils/agent-ref-parser.js +1 -1
  128. package/dist/utils/async.js +1 -1
  129. package/dist/utils/chat-cache.js +1 -1
  130. package/dist/utils/colors.js +1 -1
  131. package/dist/utils/command-output.js +1 -1
  132. package/dist/utils/constants.js +1 -1
  133. package/dist/utils/diff.js +1 -1
  134. package/dist/utils/fields-display.js +1 -1
  135. package/dist/utils/file-permissions.js +1 -1
  136. package/dist/utils/format-detector.js +1 -1
  137. package/dist/utils/formatters.js +1 -1
  138. package/dist/utils/journey-utils.d.ts.map +1 -1
  139. package/dist/utils/journey-utils.js +1 -1
  140. package/dist/utils/journey-utils.js.map +1 -1
  141. package/dist/utils/json-loader.js +1 -1
  142. package/dist/utils/llm-backup-utils.js +1 -1
  143. package/dist/utils/model-aliases.js +1 -1
  144. package/dist/utils/model-factors.js +1 -1
  145. package/dist/utils/option-validation.js +1 -1
  146. package/dist/utils/port.js +1 -1
  147. package/dist/utils/process.js +1 -1
  148. package/dist/utils/prompt.js +1 -1
  149. package/dist/utils/segment-path-parser.js +1 -1
  150. package/dist/utils/segment-ref-parser.js +1 -1
  151. package/dist/utils/spinner.js +1 -1
  152. package/dist/utils/sql-parser.js +1 -1
  153. package/dist/utils/sse-parser.js +1 -1
  154. package/dist/utils/string-utils.js +1 -1
  155. package/dist/utils/table-ref-parser.js +1 -1
  156. package/dist/utils/tdx-config.js +1 -1
  157. package/dist/utils/tdx-logger.js +1 -1
  158. package/dist/utils/tree-formatter.js +1 -1
  159. package/dist/utils/version-check.js +1 -1
  160. package/dist/utils/workflow-utils.js +1 -1
  161. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x8603d1=a9_0x1f9d;function a9_0x1f9d(_0x35fdba,_0x6b88ad){_0x35fdba=_0x35fdba-0x1c5;const _0x353bd2=a9_0x353b();let _0x1f9da1=_0x353bd2[_0x35fdba];return _0x1f9da1;}(function(_0x55ee71,_0x218edb){const _0x4d93c3=a9_0x1f9d,_0x13cd6f=_0x55ee71();while(!![]){try{const _0x36bfc8=parseInt(_0x4d93c3(0x1d1))/0x1*(-parseInt(_0x4d93c3(0x1d8))/0x2)+-parseInt(_0x4d93c3(0x209))/0x3+-parseInt(_0x4d93c3(0x1da))/0x4*(-parseInt(_0x4d93c3(0x1e2))/0x5)+parseInt(_0x4d93c3(0x1f2))/0x6+-parseInt(_0x4d93c3(0x1cd))/0x7*(-parseInt(_0x4d93c3(0x1c5))/0x8)+-parseInt(_0x4d93c3(0x1fe))/0x9*(parseInt(_0x4d93c3(0x1d9))/0xa)+parseInt(_0x4d93c3(0x1e4))/0xb*(parseInt(_0x4d93c3(0x208))/0xc);if(_0x36bfc8===_0x218edb)break;else _0x13cd6f['push'](_0x13cd6f['shift']());}catch(_0x153e58){_0x13cd6f['push'](_0x13cd6f['shift']());}}}(a9_0x353b,0x81e33));import{HTTPClient}from'./http-client.js';function a9_0x353b(){const _0x2cf156=['errorLocation','errorName','padStart','Invalid\x20nextUri\x20format:\x20','215885zfTRBu','stats','883278ejyYNf','repeat','state','data','POST','TRINO_NOT_FOUND','Warning:\x20Large\x20result\x20set\x20(','isTTY','error','name','INTERNAL','toLocaleString','Failed\x20to\x20cancel\x20query:','errorCode','3460164WSbGTc','push','dim','totalSplits','length','cancelQuery','warn','completedSplits','columns','message','consider\x20adding\x20LIMIT\x20clause','nextUri','2738061XnIJgf','TRINO_INVALID_ARGUMENT','warnings','TRINO_USER_CANCELLED','red','x-td-jobid','ALREADY_EXISTS','processedRows','httpClient','X-Trino-Catalog','72nJqbPh','1104711VBvaQc','streamResults','request','13512vYRCvt','convertRowsToObjects','aborted','INSUFFICIENT_RESOURCES','max','pathname','[query]','min','1043HXwhKN','site','Query\x20cancelled\x20by\x20user','EXTERNAL','7prhmVY','TRINO_SYNTAX_ERROR','GET','/v1/statement','TRINO_INTERNAL_ERROR','stdout','join','116542Pwirpm','10CGVnlu','28vATbYG','X-Trino-Schema','INTERNAL_ERROR','jobId'];a9_0x353b=function(){return _0x2cf156;};return a9_0x353b();}import{getEndpoint}from'../types/index.js';import{getTrinoHeaders}from'../core/auth.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{Chalk}from'chalk';export class TrinoApiClient{['httpClient'];constructor(_0x4275b1,_0x1dcda8){const _0x341a91=a9_0x1f9d,_0x14fcbf=getEndpoint(_0x4275b1[_0x341a91(0x1ce)],'trino'),_0x5375df=getTrinoHeaders(_0x4275b1[_0x341a91(0x1ce)],_0x4275b1['apiKey']);this['httpClient']=new HTTPClient(_0x14fcbf,_0x5375df,_0x1dcda8);}async['executeQuery'](_0x13fc45,_0x2ff615={}){const _0x42c3a0=a9_0x1f9d,{catalog:_0x1e833c,schema:_0xa8303d,timeout:_0x41fac6,signal:_0x575930,onJobId:_0x4290e8,onProgress:_0x4e4074}=_0x2ff615,_0x41eaee={'Content-Type':'text/plain'};(_0x1e833c||_0xa8303d)&&(_0x41eaee[_0x42c3a0(0x207)]=_0x1e833c||'td');_0xa8303d&&(_0x41eaee[_0x42c3a0(0x1db)]=_0xa8303d);const _0x1fd247=await this['httpClient'][_0x42c3a0(0x20b)](_0x42c3a0(0x1e8),_0x42c3a0(0x1d4),{'headers':_0x41eaee,'body':_0x13fc45,'timeout':_0x41fac6,'signal':_0x575930,'includeHeaders':!![]}),_0x55b113=_0x1fd247['data'],_0x208874=_0x1fd247['headers'],_0xdd525b=_0x208874[_0x42c3a0(0x203)]||_0x208874['X-TD-JobId'];_0xdd525b&&_0x4290e8&&_0x4290e8(_0xdd525b);this['checkResponseError'](_0x55b113,_0x55b113['id'],_0x13fc45);const _0x289129=await this[_0x42c3a0(0x20a)](_0x55b113,_0x13fc45,_0x575930,_0x4e4074);return _0xdd525b&&(_0x289129[_0x42c3a0(0x1dd)]=_0xdd525b),_0x289129;}async[a9_0x8603d1(0x20a)](_0x3ebcdc,_0x3cca08,_0x5aae95,_0x391057){const _0x35f4d6=a9_0x8603d1,_0x4e2070=_0x3ebcdc['id'];let _0x1df9f6=[];const _0x25f73d=[],_0x5cb2d6=[];let _0x1d8ad7=_0x3ebcdc;const _0x187cde=0x186a0;_0x1d8ad7[_0x35f4d6(0x1fa)]&&(_0x1df9f6=_0x1d8ad7[_0x35f4d6(0x1fa)]);_0x1d8ad7[_0x35f4d6(0x1e7)]&&_0x25f73d[_0x35f4d6(0x1f3)](..._0x1d8ad7[_0x35f4d6(0x1e7)]);_0x1d8ad7[_0x35f4d6(0x200)]&&_0x5cb2d6['push'](..._0x1d8ad7['warnings']);_0x391057&&_0x1d8ad7[_0x35f4d6(0x1e3)]&&_0x391057({'state':_0x1d8ad7['stats'][_0x35f4d6(0x1e6)],'processedRows':_0x1d8ad7[_0x35f4d6(0x1e3)][_0x35f4d6(0x205)],'completedSplits':_0x1d8ad7[_0x35f4d6(0x1e3)][_0x35f4d6(0x1f9)],'totalSplits':_0x1d8ad7[_0x35f4d6(0x1e3)][_0x35f4d6(0x1f5)]});while(_0x1d8ad7[_0x35f4d6(0x1fd)]){if(_0x5aae95?.[_0x35f4d6(0x1c7)]){await this[_0x35f4d6(0x1f7)](_0x1d8ad7[_0x35f4d6(0x1fd)]);throw new Error(_0x35f4d6(0x1cf));}let _0x41447f;try{_0x41447f=new URL(_0x1d8ad7[_0x35f4d6(0x1fd)])[_0x35f4d6(0x1ca)];}catch{throw new Error(_0x35f4d6(0x1e1)+_0x1d8ad7[_0x35f4d6(0x1fd)]);}_0x1d8ad7=await this[_0x35f4d6(0x206)][_0x35f4d6(0x20b)](_0x35f4d6(0x1d3),_0x41447f,{'signal':_0x5aae95}),this['checkResponseError'](_0x1d8ad7,_0x4e2070,_0x3cca08),_0x1d8ad7[_0x35f4d6(0x1fa)]&&_0x1df9f6[_0x35f4d6(0x1f6)]===0x0&&(_0x1df9f6=_0x1d8ad7[_0x35f4d6(0x1fa)]),_0x1d8ad7[_0x35f4d6(0x1e7)]&&(_0x25f73d[_0x35f4d6(0x1f3)](..._0x1d8ad7['data']),_0x25f73d[_0x35f4d6(0x1f6)]>_0x187cde&&_0x25f73d[_0x35f4d6(0x1f6)]%0xc350===0x0&&console['warn'](_0x35f4d6(0x1ea)+_0x25f73d['length'][_0x35f4d6(0x1ef)]()+'\x20rows)\x20-\x20'+_0x35f4d6(0x1fc))),_0x1d8ad7[_0x35f4d6(0x200)]&&_0x5cb2d6[_0x35f4d6(0x1f3)](..._0x1d8ad7[_0x35f4d6(0x200)]),_0x391057&&_0x1d8ad7[_0x35f4d6(0x1e3)]&&_0x391057({'state':_0x1d8ad7[_0x35f4d6(0x1e3)][_0x35f4d6(0x1e6)],'processedRows':_0x1d8ad7[_0x35f4d6(0x1e3)]['processedRows'],'completedSplits':_0x1d8ad7['stats'][_0x35f4d6(0x1f9)],'totalSplits':_0x1d8ad7[_0x35f4d6(0x1e3)][_0x35f4d6(0x1f5)]});}const _0x30071f=this[_0x35f4d6(0x1c6)](_0x1df9f6,_0x25f73d);return{'queryId':_0x4e2070,'columns':_0x1df9f6,'data':_0x30071f,'stats':_0x1d8ad7[_0x35f4d6(0x1e3)],'warnings':_0x5cb2d6[_0x35f4d6(0x1f6)]>0x0?_0x5cb2d6:undefined};}['checkResponseError'](_0x2fe352,_0x3ceb0b,_0x3d12f9){const _0x4adbb8=a9_0x8603d1;if(!_0x2fe352['error'])return;const _0x853dec=_0x2fe352[_0x4adbb8(0x1ec)],_0x3f4dc3=mapTrinoErrorToErrorCode(_0x853dec),_0xf6e715=process[_0x4adbb8(0x1d6)]['isTTY']?new Chalk({'level':0x3}):new Chalk({'level':0x0}),_0x7cacc1='['+_0x853dec[_0x4adbb8(0x1df)]+']\x20Query\x20ID:\x20'+_0x3ceb0b;let _0x7ed435=_0xf6e715[_0x4adbb8(0x202)](_0x7cacc1+'\x0a'+_0x853dec[_0x4adbb8(0x1fb)]);if(_0x3d12f9&&_0x853dec['errorLocation']){const {lineNumber:_0x2a02e7,columnNumber:_0x3828d5}=_0x853dec[_0x4adbb8(0x1de)];_0x7ed435+='\x0a\x0a'+_0xf6e715[_0x4adbb8(0x1f4)](_0x4adbb8(0x1cb))+'\x0a'+formatSqlErrorContext(_0x3d12f9,_0x2a02e7,_0x3828d5);}throw new SDKError(_0x3f4dc3,_0x7ed435,_0x853dec);}[a9_0x8603d1(0x1c6)](_0x4d72da,_0x33dd73){const _0x3a02d4=a9_0x8603d1;if(_0x4d72da[_0x3a02d4(0x1f6)]===0x0)return _0x33dd73;return _0x33dd73['map'](_0x1a95b8=>{const _0x4cbf09={};return _0x4d72da['forEach']((_0xd7c19e,_0x396ade)=>{const _0x49a012=a9_0x1f9d;_0x4cbf09[_0xd7c19e[_0x49a012(0x1ed)]]=_0x1a95b8[_0x396ade];}),_0x4cbf09;});}async[a9_0x8603d1(0x1f7)](_0x2542af){const _0x2ca34c=a9_0x8603d1;try{const _0x9e0edf=new URL(_0x2542af)[_0x2ca34c(0x1ca)];await this[_0x2ca34c(0x206)][_0x2ca34c(0x20b)]('DELETE',_0x9e0edf);}catch(_0x5f03fa){console[_0x2ca34c(0x1f8)](_0x2ca34c(0x1f0),_0x5f03fa);}}}function formatSqlErrorContext(_0xaf8050,_0x2b30f8,_0x481839){const _0x4c7696=a9_0x8603d1,_0x1579f6=_0xaf8050['split']('\x0a');if(_0x2b30f8<0x1||_0x2b30f8>_0x1579f6[_0x4c7696(0x1f6)])return _0xaf8050;const _0x489019=_0x2b30f8-0x1,_0x40f57b=Math[_0x4c7696(0x1c9)](0x0,_0x489019-0x2),_0x4576b6=Math[_0x4c7696(0x1cc)](_0x1579f6[_0x4c7696(0x1f6)],_0x489019+0x3),_0xe26cc0=[],_0x11adb7=process['stdout'][_0x4c7696(0x1eb)]?new Chalk({'level':0x3}):new Chalk({'level':0x0});for(let _0x2f5dc9=_0x40f57b;_0x2f5dc9<_0x4576b6;_0x2f5dc9++){const _0x3268b4=_0x2f5dc9===_0x489019?'>\x20':'\x20\x20',_0xc71afd=String(_0x2f5dc9+0x1)[_0x4c7696(0x1e0)](0x3,'\x20'),_0x47d78b=_0x11adb7[_0x4c7696(0x1f4)](''+_0x3268b4+_0xc71afd+'\x20|');_0xe26cc0[_0x4c7696(0x1f3)](_0x47d78b+'\x20'+_0x1579f6[_0x2f5dc9]);if(_0x2f5dc9===_0x489019){const _0x15cd1b=0x8+(_0x481839-0x1);_0xe26cc0['push']('\x20'[_0x4c7696(0x1e5)](_0x15cd1b)+'^');}}return _0xe26cc0[_0x4c7696(0x1d7)]('\x0a');}function mapTrinoErrorToErrorCode(_0x5e1c46){const _0x4454ac=a9_0x8603d1,_0x4961d7=_0x5e1c46['errorType'],_0x86ceb7=_0x5e1c46[_0x4454ac(0x1f1)];if(_0x4961d7==='USER_ERROR')switch(_0x86ceb7){case 0x1:return ErrorCode[_0x4454ac(0x1d2)];case 0x3:return ErrorCode[_0x4454ac(0x201)];case 0x4:return ErrorCode['PERMISSION_DENIED'];case 0x5:case 0x2c:case 0x2d:case 0x2e:case 0x2f:return ErrorCode[_0x4454ac(0x1e9)];case 0xc:case 0x31:case 0x32:return ErrorCode[_0x4454ac(0x204)];default:return ErrorCode[_0x4454ac(0x1ff)];}else{if(_0x4961d7===_0x4454ac(0x1dc))return ErrorCode['TRINO_INTERNAL_ERROR'];else{if(_0x4961d7===_0x4454ac(0x1c8))return ErrorCode['TRINO_INSUFFICIENT_RESOURCES'];else{if(_0x4961d7===_0x4454ac(0x1d0))return ErrorCode[_0x4454ac(0x1d5)];}}}return ErrorCode[_0x4454ac(0x1ee)];}
1
+ const a9_0x16c64e=a9_0x344c;(function(_0x1984c7,_0x24b10a){const _0x5c6fd4=a9_0x344c,_0x2a15fa=_0x1984c7();while(!![]){try{const _0x27fff6=parseInt(_0x5c6fd4(0x1be))/0x1+parseInt(_0x5c6fd4(0x1bc))/0x2+-parseInt(_0x5c6fd4(0x18f))/0x3+-parseInt(_0x5c6fd4(0x1a6))/0x4*(parseInt(_0x5c6fd4(0x191))/0x5)+parseInt(_0x5c6fd4(0x1ac))/0x6+parseInt(_0x5c6fd4(0x18d))/0x7+parseInt(_0x5c6fd4(0x189))/0x8*(parseInt(_0x5c6fd4(0x19f))/0x9);if(_0x27fff6===_0x24b10a)break;else _0x2a15fa['push'](_0x2a15fa['shift']());}catch(_0xb3033c){_0x2a15fa['push'](_0x2a15fa['shift']());}}}(a9_0x81fa,0x5a520));import{HTTPClient}from'./http-client.js';function a9_0x344c(_0x2f54c0,_0x2e9b6a){_0x2f54c0=_0x2f54c0-0x178;const _0x81fa9d=a9_0x81fa();let _0x344cc3=_0x81fa9d[_0x2f54c0];return _0x344cc3;}import{getEndpoint}from'../types/index.js';import{getTrinoHeaders}from'../core/auth.js';function a9_0x81fa(){const _0x53d85f=['PERMISSION_DENIED','TRINO_SYNTAX_ERROR','981PAulQJ','[query]','name',']\x20Query\x20ID:\x20','ALREADY_EXISTS','totalSplits','length','2434372DZoKGC','message','aborted','errorName','streamResults','headers','2158194RYZbOO','TRINO_INVALID_ARGUMENT','trino','warnings','state','consider\x20adding\x20LIMIT\x20clause','isTTY','httpClient','INTERNAL_ERROR','errorLocation','X-Trino-Schema','processedRows','min','convertRowsToObjects','stats','INTERNAL','399946gAnhCC','apiKey','405848wVffcq','dim','GET','forEach','POST','red','nextUri','executeQuery','errorType','\x20rows)\x20-\x20','columns','split','push','EXTERNAL','TRINO_INTERNAL_ERROR','max','data','request','9816QjPrmb','padStart','error','cancelQuery','458416JJFzEW','X-Trino-Catalog','558618IySaiP','x-td-jobid','5ZkfXJn','checkResponseError','Query\x20cancelled\x20by\x20user','join','toLocaleString','completedSplits','stdout','repeat','Invalid\x20nextUri\x20format:\x20','site','pathname','warn'];a9_0x81fa=function(){return _0x53d85f;};return a9_0x81fa();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{Chalk}from'chalk';export class TrinoApiClient{['httpClient'];constructor(_0x1d2e60,_0x28cf13){const _0x282e8e=a9_0x344c,_0x1e4273=getEndpoint(_0x1d2e60['site'],_0x282e8e(0x1ae)),_0x533a12=getTrinoHeaders(_0x1d2e60[_0x282e8e(0x19a)],_0x1d2e60[_0x282e8e(0x1bd)]);this[_0x282e8e(0x1b3)]=new HTTPClient(_0x1e4273,_0x533a12,_0x28cf13);}async[a9_0x16c64e(0x17e)](_0x44ec7c,_0x394765={}){const _0x11ce3c=a9_0x16c64e,{catalog:_0x1e8d89,schema:_0x14da5e,timeout:_0x29554a,signal:_0xc71dc,onJobId:_0x18cb48,onProgress:_0x595340}=_0x394765,_0x167cd3={'Content-Type':'text/plain'};(_0x1e8d89||_0x14da5e)&&(_0x167cd3[_0x11ce3c(0x18e)]=_0x1e8d89||'td');_0x14da5e&&(_0x167cd3[_0x11ce3c(0x1b6)]=_0x14da5e);const _0x5099f7=await this[_0x11ce3c(0x1b3)][_0x11ce3c(0x188)](_0x11ce3c(0x17b),'/v1/statement',{'headers':_0x167cd3,'body':_0x44ec7c,'timeout':_0x29554a,'signal':_0xc71dc,'includeHeaders':!![]}),_0xf8b693=_0x5099f7['data'],_0x108226=_0x5099f7[_0x11ce3c(0x1ab)],_0x24e7ec=_0x108226[_0x11ce3c(0x190)]||_0x108226['X-TD-JobId'];_0x24e7ec&&_0x18cb48&&_0x18cb48(_0x24e7ec);this[_0x11ce3c(0x192)](_0xf8b693,_0xf8b693['id'],_0x44ec7c);const _0x43e4f1=await this['streamResults'](_0xf8b693,_0x44ec7c,_0xc71dc,_0x595340);return _0x24e7ec&&(_0x43e4f1['jobId']=_0x24e7ec),_0x43e4f1;}async[a9_0x16c64e(0x1aa)](_0x1ff391,_0x3c1004,_0x39e36c,_0x4936be){const _0x300220=a9_0x16c64e,_0x2a213a=_0x1ff391['id'];let _0x5269fc=[];const _0x57ae5c=[],_0x35e15c=[];let _0x103abf=_0x1ff391;const _0x565dd5=0x186a0;_0x103abf['columns']&&(_0x5269fc=_0x103abf[_0x300220(0x181)]);_0x103abf[_0x300220(0x187)]&&_0x57ae5c[_0x300220(0x183)](..._0x103abf[_0x300220(0x187)]);_0x103abf[_0x300220(0x1af)]&&_0x35e15c[_0x300220(0x183)](..._0x103abf[_0x300220(0x1af)]);_0x4936be&&_0x103abf[_0x300220(0x1ba)]&&_0x4936be({'state':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1b0)],'processedRows':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1b7)],'completedSplits':_0x103abf[_0x300220(0x1ba)][_0x300220(0x196)],'totalSplits':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1a4)]});while(_0x103abf[_0x300220(0x17d)]){if(_0x39e36c?.[_0x300220(0x1a8)]){await this[_0x300220(0x18c)](_0x103abf['nextUri']);throw new Error(_0x300220(0x193));}let _0x25c175;try{_0x25c175=new URL(_0x103abf['nextUri'])[_0x300220(0x19b)];}catch{throw new Error(_0x300220(0x199)+_0x103abf[_0x300220(0x17d)]);}_0x103abf=await this[_0x300220(0x1b3)][_0x300220(0x188)](_0x300220(0x179),_0x25c175,{'signal':_0x39e36c}),this[_0x300220(0x192)](_0x103abf,_0x2a213a,_0x3c1004),_0x103abf[_0x300220(0x181)]&&_0x5269fc[_0x300220(0x1a5)]===0x0&&(_0x5269fc=_0x103abf[_0x300220(0x181)]),_0x103abf[_0x300220(0x187)]&&(_0x57ae5c[_0x300220(0x183)](..._0x103abf[_0x300220(0x187)]),_0x57ae5c[_0x300220(0x1a5)]>_0x565dd5&&_0x57ae5c[_0x300220(0x1a5)]%0xc350===0x0&&console[_0x300220(0x19c)]('Warning:\x20Large\x20result\x20set\x20('+_0x57ae5c[_0x300220(0x1a5)][_0x300220(0x195)]()+_0x300220(0x180)+_0x300220(0x1b1))),_0x103abf[_0x300220(0x1af)]&&_0x35e15c[_0x300220(0x183)](..._0x103abf[_0x300220(0x1af)]),_0x4936be&&_0x103abf[_0x300220(0x1ba)]&&_0x4936be({'state':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1b0)],'processedRows':_0x103abf['stats'][_0x300220(0x1b7)],'completedSplits':_0x103abf[_0x300220(0x1ba)]['completedSplits'],'totalSplits':_0x103abf[_0x300220(0x1ba)]['totalSplits']});}const _0x287cf0=this[_0x300220(0x1b9)](_0x5269fc,_0x57ae5c);return{'queryId':_0x2a213a,'columns':_0x5269fc,'data':_0x287cf0,'stats':_0x103abf[_0x300220(0x1ba)],'warnings':_0x35e15c[_0x300220(0x1a5)]>0x0?_0x35e15c:undefined};}[a9_0x16c64e(0x192)](_0x4e3aeb,_0x5c71a8,_0x3e88e8){const _0x145a7b=a9_0x16c64e;if(!_0x4e3aeb[_0x145a7b(0x18b)])return;const _0x2dc0d2=_0x4e3aeb['error'],_0x40bcda=mapTrinoErrorToErrorCode(_0x2dc0d2),_0x26ae1d=process[_0x145a7b(0x197)]['isTTY']?new Chalk({'level':0x3}):new Chalk({'level':0x0}),_0x457e2b='['+_0x2dc0d2[_0x145a7b(0x1a9)]+_0x145a7b(0x1a2)+_0x5c71a8;let _0x51fabd=_0x26ae1d[_0x145a7b(0x17c)](_0x457e2b+'\x0a'+_0x2dc0d2[_0x145a7b(0x1a7)]);if(_0x3e88e8&&_0x2dc0d2[_0x145a7b(0x1b5)]){const {lineNumber:_0xfebd42,columnNumber:_0x5369b5}=_0x2dc0d2[_0x145a7b(0x1b5)];_0x51fabd+='\x0a\x0a'+_0x26ae1d['dim'](_0x145a7b(0x1a0))+'\x0a'+formatSqlErrorContext(_0x3e88e8,_0xfebd42,_0x5369b5);}throw new SDKError(_0x40bcda,_0x51fabd,_0x2dc0d2);}[a9_0x16c64e(0x1b9)](_0x3f80dc,_0x31ec11){const _0x575126=a9_0x16c64e;if(_0x3f80dc[_0x575126(0x1a5)]===0x0)return _0x31ec11;return _0x31ec11['map'](_0x50a3db=>{const _0x4a2cf9=_0x575126,_0x3d3606={};return _0x3f80dc[_0x4a2cf9(0x17a)]((_0x2136cd,_0x5afb9a)=>{const _0x13a8f9=_0x4a2cf9;_0x3d3606[_0x2136cd[_0x13a8f9(0x1a1)]]=_0x50a3db[_0x5afb9a];}),_0x3d3606;});}async[a9_0x16c64e(0x18c)](_0xbbd509){const _0x5bd478=a9_0x16c64e;try{const _0x4ba87c=new URL(_0xbbd509)[_0x5bd478(0x19b)];await this[_0x5bd478(0x1b3)][_0x5bd478(0x188)]('DELETE',_0x4ba87c);}catch(_0x194a95){console['warn']('Failed\x20to\x20cancel\x20query:',_0x194a95);}}}function formatSqlErrorContext(_0x247d62,_0x5cbef9,_0x523b33){const _0x41b4be=a9_0x16c64e,_0x22d755=_0x247d62[_0x41b4be(0x182)]('\x0a');if(_0x5cbef9<0x1||_0x5cbef9>_0x22d755[_0x41b4be(0x1a5)])return _0x247d62;const _0x4d3826=_0x5cbef9-0x1,_0x21d5d1=Math[_0x41b4be(0x186)](0x0,_0x4d3826-0x2),_0x47114b=Math[_0x41b4be(0x1b8)](_0x22d755[_0x41b4be(0x1a5)],_0x4d3826+0x3),_0x3b403a=[],_0x511e7c=process[_0x41b4be(0x197)][_0x41b4be(0x1b2)]?new Chalk({'level':0x3}):new Chalk({'level':0x0});for(let _0x5e514f=_0x21d5d1;_0x5e514f<_0x47114b;_0x5e514f++){const _0x2d4ca2=_0x5e514f===_0x4d3826?'>\x20':'\x20\x20',_0x56157c=String(_0x5e514f+0x1)[_0x41b4be(0x18a)](0x3,'\x20'),_0x476e1f=_0x511e7c[_0x41b4be(0x178)](''+_0x2d4ca2+_0x56157c+'\x20|');_0x3b403a[_0x41b4be(0x183)](_0x476e1f+'\x20'+_0x22d755[_0x5e514f]);if(_0x5e514f===_0x4d3826){const _0xa37ea1=0x8+(_0x523b33-0x1);_0x3b403a[_0x41b4be(0x183)]('\x20'[_0x41b4be(0x198)](_0xa37ea1)+'^');}}return _0x3b403a[_0x41b4be(0x194)]('\x0a');}function mapTrinoErrorToErrorCode(_0x14837c){const _0xcb16cc=a9_0x16c64e,_0x309560=_0x14837c[_0xcb16cc(0x17f)],_0x3e8234=_0x14837c['errorCode'];if(_0x309560==='USER_ERROR')switch(_0x3e8234){case 0x1:return ErrorCode[_0xcb16cc(0x19e)];case 0x3:return ErrorCode['TRINO_USER_CANCELLED'];case 0x4:return ErrorCode[_0xcb16cc(0x19d)];case 0x5:case 0x2c:case 0x2d:case 0x2e:case 0x2f:return ErrorCode['TRINO_NOT_FOUND'];case 0xc:case 0x31:case 0x32:return ErrorCode[_0xcb16cc(0x1a3)];default:return ErrorCode[_0xcb16cc(0x1ad)];}else{if(_0x309560===_0xcb16cc(0x1b4))return ErrorCode[_0xcb16cc(0x185)];else{if(_0x309560==='INSUFFICIENT_RESOURCES')return ErrorCode['TRINO_INSUFFICIENT_RESOURCES'];else{if(_0x309560===_0xcb16cc(0x184))return ErrorCode['TRINO_INTERNAL_ERROR'];}}}return ErrorCode[_0xcb16cc(0x1bb)];}
@@ -1 +1 @@
1
- const a10_0x48f0e1=a10_0x2617;function a10_0x2617(_0x1426d3,_0x162cd2){_0x1426d3=_0x1426d3-0xe7;const _0x2e858d=a10_0x2e85();let _0x2617ab=_0x2e858d[_0x1426d3];return _0x2617ab;}(function(_0x10e756,_0x2adea0){const _0x73f8bd=a10_0x2617,_0x28c3af=_0x10e756();while(!![]){try{const _0x35edb9=parseInt(_0x73f8bd(0x10d))/0x1*(-parseInt(_0x73f8bd(0x125))/0x2)+-parseInt(_0x73f8bd(0xf8))/0x3+parseInt(_0x73f8bd(0x12e))/0x4+-parseInt(_0x73f8bd(0x114))/0x5+parseInt(_0x73f8bd(0x13e))/0x6*(-parseInt(_0x73f8bd(0xf5))/0x7)+parseInt(_0x73f8bd(0x11b))/0x8*(-parseInt(_0x73f8bd(0x12f))/0x9)+parseInt(_0x73f8bd(0x10f))/0xa;if(_0x35edb9===_0x2adea0)break;else _0x28c3af['push'](_0x28c3af['shift']());}catch(_0x5f4caf){_0x28c3af['push'](_0x28c3af['shift']());}}}(a10_0x2e85,0xe5eb2));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{matchGlobPattern}from'../utils/string-utils.js';function a10_0x2e85(){const _0x321e31=['task','/api/attempts/','/archive','name_pattern','/files?','DELETE','GET','retryAttemptName','to_time','name','/kill','POST','retrySession','project_name','getTaskLogs','startAttempt','721JBlhrm','/logs?','search_project_name','1079121TKGxVa','killAttempt','httpClient','workflow_name','getAttemptTasks','apiKey','/sessions','filter','workflowId','clear_schedule','replace','request','getAttempt','from_time','/api/sessions/','retry_params','project_id','projectName','include_subtasks','resume_from','project','70315ysyHKp','/files','37431640ssqhCR','sessions','allowQueueing','params','/api/attempts?','8750030QVCljj','attempts','clear_schedule_all','tasks','scheduleFrom','schedule_from','status','737864AknxFm','/api/projects?','workflow','PUT','lastId','readFile','projects','offset','/api/attempts','listWorkflows','2xioFWf','listAttempts','/archive?','/retry','/tasks','writeFile','/api/sessions','listLogFiles','workflowName','3971496DHqGyl','9qTYGOP','reason','last_id','/tasks/','revision','clearScheduleAll','deleteProject','site','retryAttempt','/tasks?','true','/api/projects/','limit','uploadProjectArchive','from_task','88662ZPmiWR','authHeaders','toString','append','force','include_retried','downloadProjectArchive'];a10_0x2e85=function(){return _0x321e31;};return a10_0x2e85();}export class WorkflowApiClient{[a10_0x48f0e1(0xfa)];[a10_0x48f0e1(0x13f)];constructor(_0x13d9bb,_0x1e416c){const _0x5741c5=a10_0x48f0e1,_0x1609b6=getEndpoint(_0x13d9bb[_0x5741c5(0x136)],_0x5741c5(0x11d));this[_0x5741c5(0x13f)]=toHeaderRecord(getAuthHeaders(_0x13d9bb['site'],_0x13d9bb[_0x5741c5(0xfd)])),this[_0x5741c5(0xfa)]=new HTTPClient(_0x1609b6,this[_0x5741c5(0x13f)],_0x1e416c);}async['listProjects'](_0x135562){const _0x5b2bb8=a10_0x48f0e1,_0x120c7f=new URLSearchParams();if(_0x135562?.[_0x5b2bb8(0x13b)])_0x120c7f[_0x5b2bb8(0x141)](_0x5b2bb8(0x13b),String(_0x135562[_0x5b2bb8(0x13b)]));if(_0x135562?.[_0x5b2bb8(0x131)])_0x120c7f[_0x5b2bb8(0x141)](_0x5b2bb8(0x131),_0x135562[_0x5b2bb8(0x131)]);if(_0x135562?.[_0x5b2bb8(0xe8)]){const _0x27a2e1=_0x135562[_0x5b2bb8(0xe8)][_0x5b2bb8(0x102)](/[*?]/g,'');_0x27a2e1&&_0x120c7f[_0x5b2bb8(0x141)]('name_pattern',_0x27a2e1);}const _0x17a05e=_0x120c7f['toString'](),_0x41b175=_0x17a05e?'/api/projects?'+_0x17a05e:'/api/projects',_0x17cd75=await this[_0x5b2bb8(0xfa)][_0x5b2bb8(0x103)](_0x5b2bb8(0xeb),_0x41b175);let _0x2bf3ec=_0x17cd75[_0x5b2bb8(0x121)]||[];return _0x135562?.[_0x5b2bb8(0xe8)]&&(_0x2bf3ec=_0x2bf3ec[_0x5b2bb8(0xff)](_0x4a5c07=>{const _0x4a5523=_0x5b2bb8;return matchGlobPattern(_0x4a5c07[_0x4a5523(0xee)],_0x135562[_0x4a5523(0xe8)]);})),{'data':_0x2bf3ec,'lastId':_0x17cd75[_0x5b2bb8(0x11f)]};}async[a10_0x48f0e1(0x124)](_0x4bfb82){const _0x4fdf00=a10_0x48f0e1,_0x382235=new URLSearchParams();if(_0x4bfb82?.[_0x4fdf00(0x13b)])_0x382235[_0x4fdf00(0x141)]('limit',String(_0x4bfb82[_0x4fdf00(0x13b)]));if(_0x4bfb82?.['last_id'])_0x382235[_0x4fdf00(0x141)](_0x4fdf00(0x131),_0x4bfb82['last_id']);if(_0x4bfb82?.[_0x4fdf00(0xf2)]){const _0x324e7c=_0x4bfb82[_0x4fdf00(0xf2)][_0x4fdf00(0x102)](/[*?]/g,'');_0x324e7c&&(_0x382235[_0x4fdf00(0x141)]('name_pattern',_0x324e7c),_0x382235[_0x4fdf00(0x141)](_0x4fdf00(0xf7),'true'));}const _0x5669b3=_0x382235['toString'](),_0x36fb28=_0x5669b3?'/api/workflows?'+_0x5669b3:'/api/workflows',_0x20da32=await this[_0x4fdf00(0xfa)]['request'](_0x4fdf00(0xeb),_0x36fb28);let _0xe43dee=_0x20da32['workflows']||[];return _0x4bfb82?.[_0x4fdf00(0xf2)]&&(_0xe43dee=_0xe43dee[_0x4fdf00(0xff)](_0x3e9959=>{const _0x4d1a62=_0x4fdf00,_0x9c2df1=_0x3e9959[_0x4d1a62(0x10c)]?.[_0x4d1a62(0xee)];if(!_0x9c2df1)return![];return matchGlobPattern(_0x9c2df1,_0x4bfb82[_0x4d1a62(0xf2)]);})),{'data':_0xe43dee,'lastId':_0x20da32[_0x4fdf00(0x11f)]};}async['listSessions'](_0x496653){const _0x21e629=a10_0x48f0e1;let _0x239bb0=_0x21e629(0x12b);_0x496653?.[_0x21e629(0x108)]&&(_0x239bb0=_0x21e629(0x13a)+encodeURIComponent(_0x496653[_0x21e629(0x108)])+_0x21e629(0xfe));const _0x3bdc83=new URLSearchParams();if(_0x496653?.[_0x21e629(0xfb)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x11d),_0x496653['workflow_name']);if(_0x496653?.[_0x21e629(0x11a)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x11a),_0x496653[_0x21e629(0x11a)]);if(_0x496653?.[_0x21e629(0x105)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x105),_0x496653[_0x21e629(0x105)]);if(_0x496653?.[_0x21e629(0xed)])_0x3bdc83[_0x21e629(0x141)]('to_time',_0x496653[_0x21e629(0xed)]);if(_0x496653?.[_0x21e629(0x13b)])_0x3bdc83[_0x21e629(0x141)]('limit',String(_0x496653[_0x21e629(0x13b)]));if(_0x496653?.[_0x21e629(0x131)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x131),_0x496653[_0x21e629(0x131)]);const _0x214f60=_0x3bdc83[_0x21e629(0x140)]();_0x214f60&&(_0x239bb0=_0x239bb0+'?'+_0x214f60);const _0x401b53=await this[_0x21e629(0xfa)][_0x21e629(0x103)](_0x21e629(0xeb),_0x239bb0);return{'data':_0x401b53[_0x21e629(0x110)]||[],'lastId':_0x401b53[_0x21e629(0x11f)]};}async[a10_0x48f0e1(0x126)](_0x1b1ab5){const _0x48fb16=a10_0x48f0e1,_0x5873c4=new URLSearchParams();if(_0x1b1ab5?.[_0x48fb16(0xf2)])_0x5873c4[_0x48fb16(0x141)]('project',_0x1b1ab5[_0x48fb16(0xf2)]);if(_0x1b1ab5?.['workflow_name'])_0x5873c4[_0x48fb16(0x141)](_0x48fb16(0x11d),_0x1b1ab5[_0x48fb16(0xfb)]);if(_0x1b1ab5?.[_0x48fb16(0x143)])_0x5873c4[_0x48fb16(0x141)](_0x48fb16(0x143),'1');if(_0x1b1ab5?.['limit'])_0x5873c4[_0x48fb16(0x141)]('limit',String(_0x1b1ab5[_0x48fb16(0x13b)]));if(_0x1b1ab5?.[_0x48fb16(0x131)])_0x5873c4['append'](_0x48fb16(0x131),_0x1b1ab5[_0x48fb16(0x131)]);const _0x55c959=_0x5873c4[_0x48fb16(0x140)](),_0x199c94=_0x55c959?_0x48fb16(0x113)+_0x55c959:'/api/attempts',_0x38a422=await this[_0x48fb16(0xfa)]['request'](_0x48fb16(0xeb),_0x199c94);return{'data':_0x38a422[_0x48fb16(0x115)]||[],'lastId':_0x38a422[_0x48fb16(0x11f)]};}async[a10_0x48f0e1(0x104)](_0x2dbf7c){const _0x4b1bf1=a10_0x48f0e1;return await this[_0x4b1bf1(0xfa)][_0x4b1bf1(0x103)](_0x4b1bf1(0xeb),_0x4b1bf1(0x146)+encodeURIComponent(_0x2dbf7c));}async[a10_0x48f0e1(0xfc)](_0x18705e,_0x42efc2=![]){const _0x58d9ef=a10_0x48f0e1,_0x1ddece=new URLSearchParams();_0x42efc2&&_0x1ddece[_0x58d9ef(0x141)](_0x58d9ef(0x10a),'true');const _0x187a7f=_0x1ddece[_0x58d9ef(0x140)](),_0x3be134=_0x187a7f?_0x58d9ef(0x146)+encodeURIComponent(_0x18705e)+_0x58d9ef(0x138)+_0x187a7f:_0x58d9ef(0x146)+encodeURIComponent(_0x18705e)+_0x58d9ef(0x129),_0x1bdf70=await this[_0x58d9ef(0xfa)][_0x58d9ef(0x103)](_0x58d9ef(0xeb),_0x3be134);return _0x1bdf70[_0x58d9ef(0x117)]||[];}async[a10_0x48f0e1(0xf3)](_0x591ce3,_0x1d62be,_0x224f77){const _0x52c118=a10_0x48f0e1,_0x4d906c=new URLSearchParams();_0x224f77?.['offset']!==undefined&&_0x4d906c['append'](_0x52c118(0x122),String(_0x224f77[_0x52c118(0x122)]));_0x224f77?.[_0x52c118(0x13b)]!==undefined&&_0x4d906c[_0x52c118(0x141)]('limit',String(_0x224f77[_0x52c118(0x13b)]));const _0x15e3df=_0x4d906c['toString'](),_0x22b39c=_0x15e3df?'/api/attempts/'+encodeURIComponent(_0x591ce3)+_0x52c118(0x132)+encodeURIComponent(_0x1d62be)+_0x52c118(0xf6)+_0x15e3df:_0x52c118(0x146)+encodeURIComponent(_0x591ce3)+_0x52c118(0x132)+encodeURIComponent(_0x1d62be)+'/logs',_0x460bd1=await this[_0x52c118(0xfa)][_0x52c118(0x103)](_0x52c118(0xeb),_0x22b39c);return _0x460bd1['logs']||[];}async[a10_0x48f0e1(0x12c)](_0x1346c,_0x4dbdf6){const _0x5d7057=a10_0x48f0e1,_0x496bfa=new URLSearchParams();_0x4dbdf6&&_0x496bfa['append'](_0x5d7057(0x145),_0x4dbdf6);const _0x3e4311=_0x496bfa[_0x5d7057(0x140)](),_0x46f5a5=_0x3e4311?'/api/logs/'+encodeURIComponent(_0x1346c)+_0x5d7057(0xe9)+_0x3e4311:'/api/logs/'+encodeURIComponent(_0x1346c)+_0x5d7057(0x10e),_0x5a7824=await this['httpClient'][_0x5d7057(0x103)](_0x5d7057(0xeb),_0x46f5a5);return _0x5a7824['files']||[];}async[a10_0x48f0e1(0xf9)](_0x2d44d4,_0x54285d){const _0x2a6dae=a10_0x48f0e1,_0x119047={};return _0x54285d&&(_0x119047[_0x2a6dae(0x130)]=_0x54285d),await this['httpClient'][_0x2a6dae(0x103)]('POST',_0x2a6dae(0x146)+encodeURIComponent(_0x2d44d4)+_0x2a6dae(0xef),{'body':_0x119047});}async[a10_0x48f0e1(0xf1)](_0x4bb9ba,_0x538773){const _0x36122c=a10_0x48f0e1,_0x346f35={};return _0x538773?.[_0x36122c(0x13d)]&&(_0x346f35[_0x36122c(0x13d)]=_0x538773[_0x36122c(0x13d)]),_0x538773?.[_0x36122c(0x107)]&&(_0x346f35[_0x36122c(0x107)]=_0x538773['retry_params']),await this['httpClient'][_0x36122c(0x103)](_0x36122c(0xf0),_0x36122c(0x106)+encodeURIComponent(_0x4bb9ba)+_0x36122c(0x128),{'body':_0x346f35});}async[a10_0x48f0e1(0x137)](_0x2c2ce5,_0x21f04c){const _0x429606=a10_0x48f0e1,_0x2723c3={};return _0x21f04c?.[_0x429606(0x10b)]&&(_0x2723c3[_0x429606(0x10b)]=_0x21f04c[_0x429606(0x10b)]),_0x21f04c?.['retry_params']&&(_0x2723c3[_0x429606(0x107)]=_0x21f04c['retry_params']),_0x21f04c?.['force']&&(_0x2723c3[_0x429606(0x142)]=_0x21f04c[_0x429606(0x142)]),await this[_0x429606(0xfa)][_0x429606(0x103)](_0x429606(0xf0),_0x429606(0x146)+encodeURIComponent(_0x2c2ce5)+_0x429606(0x128),{'body':_0x2723c3});}async[a10_0x48f0e1(0xf4)](_0x4dbe06){const _0x47d1fd=a10_0x48f0e1,_0x24afad={'sessionTime':_0x4dbe06['sessionTime'],'params':_0x4dbe06[_0x47d1fd(0x112)]};return _0x4dbe06[_0x47d1fd(0x100)]&&(_0x24afad[_0x47d1fd(0x100)]=_0x4dbe06[_0x47d1fd(0x100)]),_0x4dbe06[_0x47d1fd(0x109)]&&(_0x24afad[_0x47d1fd(0x109)]=_0x4dbe06['projectName']),_0x4dbe06[_0x47d1fd(0x12d)]&&(_0x24afad['workflowName']=_0x4dbe06[_0x47d1fd(0x12d)]),_0x4dbe06[_0x47d1fd(0xec)]&&(_0x24afad['retryAttemptName']=_0x4dbe06[_0x47d1fd(0xec)]),_0x4dbe06[_0x47d1fd(0x111)]!==undefined&&(_0x24afad[_0x47d1fd(0x111)]=_0x4dbe06[_0x47d1fd(0x111)]),await this[_0x47d1fd(0xfa)][_0x47d1fd(0x103)](_0x47d1fd(0x11e),_0x47d1fd(0x123),{'body':_0x24afad});}async[a10_0x48f0e1(0x144)](_0xbae43d,_0x363959,_0xb4a781){const _0x180a2b=a10_0x48f0e1,{promises:_0x4c188a}=await import('fs'),_0x1be490=new URLSearchParams();_0xb4a781&&_0x1be490[_0x180a2b(0x141)](_0x180a2b(0x133),_0xb4a781);const _0x50c95e=_0x1be490[_0x180a2b(0x140)](),_0x8e1416=_0x50c95e?_0x180a2b(0x13a)+encodeURIComponent(_0xbae43d)+_0x180a2b(0x127)+_0x50c95e:'/api/projects/'+encodeURIComponent(_0xbae43d)+_0x180a2b(0xe7),_0x319ca5=await this[_0x180a2b(0xfa)]['request'](_0x180a2b(0xeb),_0x8e1416,{'headers':{'Accept':'application/gzip'},'responseType':'arraybuffer'});return await _0x4c188a[_0x180a2b(0x12a)](_0x363959,_0x319ca5),_0x363959;}async[a10_0x48f0e1(0x13c)](_0x56f1bc,_0x5e4f89,_0x2f1630,_0x177505){const _0x452609=a10_0x48f0e1,{promises:_0x4eb20f}=await import('fs'),_0x235d81=new URLSearchParams();_0x235d81[_0x452609(0x141)](_0x452609(0x10c),_0x56f1bc),_0x235d81[_0x452609(0x141)](_0x452609(0x133),_0x5e4f89);_0x177505?.['scheduleFrom']&&_0x235d81[_0x452609(0x141)](_0x452609(0x119),_0x177505[_0x452609(0x118)]);_0x177505?.['clearSchedule']&&_0x177505['clearSchedule']['forEach'](_0x1c045e=>{const _0x5b7b97=_0x452609;_0x235d81[_0x5b7b97(0x141)](_0x5b7b97(0x101),_0x1c045e);});_0x177505?.[_0x452609(0x134)]&&_0x235d81[_0x452609(0x141)](_0x452609(0x116),_0x452609(0x139));const _0x27fd2e=_0x235d81[_0x452609(0x140)](),_0xe265e8=_0x452609(0x11c)+_0x27fd2e,_0x42216b=await _0x4eb20f[_0x452609(0x120)](_0x2f1630);return await this[_0x452609(0xfa)][_0x452609(0x103)](_0x452609(0x11e),_0xe265e8,{'body':_0x42216b,'headers':{'Content-Type':'application/gzip'}});}async[a10_0x48f0e1(0x135)](_0x8ffaac){const _0x53fc2b=a10_0x48f0e1;return await this[_0x53fc2b(0xfa)]['request'](_0x53fc2b(0xea),_0x53fc2b(0x13a)+encodeURIComponent(_0x8ffaac));}}
1
+ const a10_0x27cb81=a10_0x2736;(function(_0x124519,_0xeb34fe){const _0xce6971=a10_0x2736,_0x5525f4=_0x124519();while(!![]){try{const _0x4591f8=-parseInt(_0xce6971(0xaa))/0x1*(-parseInt(_0xce6971(0xb7))/0x2)+-parseInt(_0xce6971(0xb1))/0x3+-parseInt(_0xce6971(0xd3))/0x4*(parseInt(_0xce6971(0xdc))/0x5)+parseInt(_0xce6971(0xfa))/0x6*(parseInt(_0xce6971(0xb4))/0x7)+-parseInt(_0xce6971(0xf5))/0x8+parseInt(_0xce6971(0xb6))/0x9+-parseInt(_0xce6971(0xa6))/0xa*(-parseInt(_0xce6971(0xb3))/0xb);if(_0x4591f8===_0xeb34fe)break;else _0x5525f4['push'](_0x5525f4['shift']());}catch(_0x1ff867){_0x5525f4['push'](_0x5525f4['shift']());}}}(a10_0x4df6,0xaaaf3));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a10_0x2736(_0x13e189,_0x432fd0){_0x13e189=_0x13e189-0x9e;const _0x4df6ea=a10_0x4df6();let _0x2736eb=_0x4df6ea[_0x13e189];return _0x2736eb;}import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{matchGlobPattern}from'../utils/string-utils.js';function a10_0x4df6(){const _0x122c11=['to_time','schedule_from','/api/attempts?','from_time','readFile','listProjects','/retry','workflow','filter','1099816TkieFa','downloadProjectArchive','append','project','sessionTime','548742lLYMfO','resume_from','params','lastId','/api/workflows?','request','retrySession','/tasks/','GET','/archive','/kill','projectName','httpClient','13235370dXXxBq','listSessions','getAttempt','/tasks','135526RwsURN','authHeaders','deleteProject','application/gzip','name_pattern','status','include_subtasks','2890014MHzndD','/api/attempts/','11ZgBOSy','14ABsHgD','/files?','3879783TEUeyd','2myDDQM','/logs','tasks','site','uploadProjectArchive','include_retried','last_id','/archive?','from_task','logs','/api/logs/','name','listAttempts','clearSchedule','retryAttemptName','POST','/api/projects','limit','/api/attempts','/logs?','true','reason','PUT','getAttemptTasks','replace','workflowId','/tasks?','revision','4xOwJZk','files','toString','startAttempt','clearScheduleAll','scheduleFrom','workflowName','clear_schedule','force','1365630dlukxy','offset','DELETE','workflows','retry_params','allowQueueing','writeFile','/api/projects/','search_project_name','listWorkflows','attempts','workflow_name','project_id','task','projects','project_name'];a10_0x4df6=function(){return _0x122c11;};return a10_0x4df6();}export class WorkflowApiClient{[a10_0x27cb81(0xa5)];[a10_0x27cb81(0xab)];constructor(_0x149d96,_0x587cc9){const _0x58654f=a10_0x27cb81,_0x255b9b=getEndpoint(_0x149d96[_0x58654f(0xba)],'workflow');this[_0x58654f(0xab)]=toHeaderRecord(getAuthHeaders(_0x149d96[_0x58654f(0xba)],_0x149d96['apiKey'])),this['httpClient']=new HTTPClient(_0x255b9b,this['authHeaders'],_0x587cc9);}async[a10_0x27cb81(0xf1)](_0x7fdc9e){const _0x173c73=a10_0x27cb81,_0x3f102d=new URLSearchParams();if(_0x7fdc9e?.[_0x173c73(0xc8)])_0x3f102d[_0x173c73(0xf7)](_0x173c73(0xc8),String(_0x7fdc9e['limit']));if(_0x7fdc9e?.[_0x173c73(0xbd)])_0x3f102d[_0x173c73(0xf7)](_0x173c73(0xbd),_0x7fdc9e[_0x173c73(0xbd)]);if(_0x7fdc9e?.[_0x173c73(0xae)]){const _0x379bdc=_0x7fdc9e[_0x173c73(0xae)][_0x173c73(0xcf)](/[*?]/g,'');_0x379bdc&&_0x3f102d['append']('name_pattern',_0x379bdc);}const _0x3ff63b=_0x3f102d['toString'](),_0x1fb80e=_0x3ff63b?'/api/projects?'+_0x3ff63b:_0x173c73(0xc7),_0x140310=await this[_0x173c73(0xa5)]['request']('GET',_0x1fb80e);let _0x4ca606=_0x140310[_0x173c73(0xea)]||[];return _0x7fdc9e?.['name_pattern']&&(_0x4ca606=_0x4ca606['filter'](_0x675781=>{const _0x59dee0=_0x173c73;return matchGlobPattern(_0x675781[_0x59dee0(0xc2)],_0x7fdc9e['name_pattern']);})),{'data':_0x4ca606,'lastId':_0x140310[_0x173c73(0xfd)]};}async[a10_0x27cb81(0xe5)](_0x313c18){const _0x324d71=a10_0x27cb81,_0x505485=new URLSearchParams();if(_0x313c18?.[_0x324d71(0xc8)])_0x505485[_0x324d71(0xf7)](_0x324d71(0xc8),String(_0x313c18[_0x324d71(0xc8)]));if(_0x313c18?.[_0x324d71(0xbd)])_0x505485['append']('last_id',_0x313c18[_0x324d71(0xbd)]);if(_0x313c18?.['project_name']){const _0x23ae40=_0x313c18[_0x324d71(0xeb)]['replace'](/[*?]/g,'');_0x23ae40&&(_0x505485[_0x324d71(0xf7)](_0x324d71(0xae),_0x23ae40),_0x505485[_0x324d71(0xf7)](_0x324d71(0xe4),_0x324d71(0xcb)));}const _0x4e1559=_0x505485['toString'](),_0x53fe50=_0x4e1559?_0x324d71(0xfe)+_0x4e1559:'/api/workflows',_0x3cfcc5=await this[_0x324d71(0xa5)][_0x324d71(0x9e)](_0x324d71(0xa1),_0x53fe50);let _0x2b78ba=_0x3cfcc5[_0x324d71(0xdf)]||[];return _0x313c18?.[_0x324d71(0xeb)]&&(_0x2b78ba=_0x2b78ba[_0x324d71(0xf4)](_0x406fbb=>{const _0x51607b=_0x324d71,_0x50f334=_0x406fbb[_0x51607b(0xf8)]?.[_0x51607b(0xc2)];if(!_0x50f334)return![];return matchGlobPattern(_0x50f334,_0x313c18['project_name']);})),{'data':_0x2b78ba,'lastId':_0x3cfcc5[_0x324d71(0xfd)]};}async[a10_0x27cb81(0xa7)](_0x3a2a47){const _0x12eebf=a10_0x27cb81;let _0xf17739='/api/sessions';_0x3a2a47?.[_0x12eebf(0xe8)]&&(_0xf17739=_0x12eebf(0xe3)+encodeURIComponent(_0x3a2a47['project_id'])+'/sessions');const _0x431adf=new URLSearchParams();if(_0x3a2a47?.[_0x12eebf(0xe7)])_0x431adf['append'](_0x12eebf(0xf3),_0x3a2a47[_0x12eebf(0xe7)]);if(_0x3a2a47?.['status'])_0x431adf[_0x12eebf(0xf7)](_0x12eebf(0xaf),_0x3a2a47[_0x12eebf(0xaf)]);if(_0x3a2a47?.[_0x12eebf(0xef)])_0x431adf['append'](_0x12eebf(0xef),_0x3a2a47[_0x12eebf(0xef)]);if(_0x3a2a47?.[_0x12eebf(0xec)])_0x431adf[_0x12eebf(0xf7)](_0x12eebf(0xec),_0x3a2a47[_0x12eebf(0xec)]);if(_0x3a2a47?.[_0x12eebf(0xc8)])_0x431adf[_0x12eebf(0xf7)]('limit',String(_0x3a2a47[_0x12eebf(0xc8)]));if(_0x3a2a47?.['last_id'])_0x431adf[_0x12eebf(0xf7)]('last_id',_0x3a2a47[_0x12eebf(0xbd)]);const _0x3ba43d=_0x431adf[_0x12eebf(0xd5)]();_0x3ba43d&&(_0xf17739=_0xf17739+'?'+_0x3ba43d);const _0x24ad62=await this['httpClient'][_0x12eebf(0x9e)](_0x12eebf(0xa1),_0xf17739);return{'data':_0x24ad62['sessions']||[],'lastId':_0x24ad62[_0x12eebf(0xfd)]};}async[a10_0x27cb81(0xc3)](_0x17921a){const _0x1b2bf8=a10_0x27cb81,_0x5d85b5=new URLSearchParams();if(_0x17921a?.[_0x1b2bf8(0xeb)])_0x5d85b5['append']('project',_0x17921a[_0x1b2bf8(0xeb)]);if(_0x17921a?.[_0x1b2bf8(0xe7)])_0x5d85b5[_0x1b2bf8(0xf7)](_0x1b2bf8(0xf3),_0x17921a[_0x1b2bf8(0xe7)]);if(_0x17921a?.[_0x1b2bf8(0xbc)])_0x5d85b5[_0x1b2bf8(0xf7)](_0x1b2bf8(0xbc),'1');if(_0x17921a?.['limit'])_0x5d85b5[_0x1b2bf8(0xf7)]('limit',String(_0x17921a[_0x1b2bf8(0xc8)]));if(_0x17921a?.[_0x1b2bf8(0xbd)])_0x5d85b5[_0x1b2bf8(0xf7)](_0x1b2bf8(0xbd),_0x17921a[_0x1b2bf8(0xbd)]);const _0x1ed07e=_0x5d85b5[_0x1b2bf8(0xd5)](),_0x1f7093=_0x1ed07e?_0x1b2bf8(0xee)+_0x1ed07e:_0x1b2bf8(0xc9),_0x526a90=await this[_0x1b2bf8(0xa5)]['request'](_0x1b2bf8(0xa1),_0x1f7093);return{'data':_0x526a90[_0x1b2bf8(0xe6)]||[],'lastId':_0x526a90['lastId']};}async[a10_0x27cb81(0xa8)](_0x4ec004){const _0x367eae=a10_0x27cb81;return await this[_0x367eae(0xa5)][_0x367eae(0x9e)](_0x367eae(0xa1),_0x367eae(0xb2)+encodeURIComponent(_0x4ec004));}async[a10_0x27cb81(0xce)](_0x4a052f,_0x268387=![]){const _0x5e96d1=a10_0x27cb81,_0x53393a=new URLSearchParams();_0x268387&&_0x53393a[_0x5e96d1(0xf7)](_0x5e96d1(0xb0),_0x5e96d1(0xcb));const _0xd10039=_0x53393a[_0x5e96d1(0xd5)](),_0x1294e8=_0xd10039?_0x5e96d1(0xb2)+encodeURIComponent(_0x4a052f)+_0x5e96d1(0xd1)+_0xd10039:'/api/attempts/'+encodeURIComponent(_0x4a052f)+_0x5e96d1(0xa9),_0x42e598=await this[_0x5e96d1(0xa5)]['request'](_0x5e96d1(0xa1),_0x1294e8);return _0x42e598[_0x5e96d1(0xb9)]||[];}async['getTaskLogs'](_0x2144a6,_0x34dc18,_0x595e5f){const _0x56746e=a10_0x27cb81,_0x3e2093=new URLSearchParams();_0x595e5f?.[_0x56746e(0xdd)]!==undefined&&_0x3e2093[_0x56746e(0xf7)](_0x56746e(0xdd),String(_0x595e5f[_0x56746e(0xdd)]));_0x595e5f?.[_0x56746e(0xc8)]!==undefined&&_0x3e2093[_0x56746e(0xf7)](_0x56746e(0xc8),String(_0x595e5f[_0x56746e(0xc8)]));const _0x52a292=_0x3e2093['toString'](),_0x4cc07c=_0x52a292?_0x56746e(0xb2)+encodeURIComponent(_0x2144a6)+_0x56746e(0xa0)+encodeURIComponent(_0x34dc18)+_0x56746e(0xca)+_0x52a292:_0x56746e(0xb2)+encodeURIComponent(_0x2144a6)+_0x56746e(0xa0)+encodeURIComponent(_0x34dc18)+_0x56746e(0xb8),_0x259d5e=await this[_0x56746e(0xa5)][_0x56746e(0x9e)](_0x56746e(0xa1),_0x4cc07c);return _0x259d5e[_0x56746e(0xc0)]||[];}async['listLogFiles'](_0x19baa9,_0x4b6c70){const _0x36983e=a10_0x27cb81,_0x5517a3=new URLSearchParams();_0x4b6c70&&_0x5517a3[_0x36983e(0xf7)](_0x36983e(0xe9),_0x4b6c70);const _0x9f2b97=_0x5517a3[_0x36983e(0xd5)](),_0xe66f6c=_0x9f2b97?'/api/logs/'+encodeURIComponent(_0x19baa9)+_0x36983e(0xb5)+_0x9f2b97:_0x36983e(0xc1)+encodeURIComponent(_0x19baa9)+'/files',_0x10c557=await this[_0x36983e(0xa5)][_0x36983e(0x9e)]('GET',_0xe66f6c);return _0x10c557[_0x36983e(0xd4)]||[];}async['killAttempt'](_0x18cd0a,_0x4f53cf){const _0x563a29=a10_0x27cb81,_0x246b82={};return _0x4f53cf&&(_0x246b82[_0x563a29(0xcc)]=_0x4f53cf),await this[_0x563a29(0xa5)][_0x563a29(0x9e)](_0x563a29(0xc6),_0x563a29(0xb2)+encodeURIComponent(_0x18cd0a)+_0x563a29(0xa3),{'body':_0x246b82});}async[a10_0x27cb81(0x9f)](_0x274c56,_0x5576fb){const _0x4d1528=a10_0x27cb81,_0x2d53c4={};return _0x5576fb?.[_0x4d1528(0xbf)]&&(_0x2d53c4[_0x4d1528(0xbf)]=_0x5576fb[_0x4d1528(0xbf)]),_0x5576fb?.['retry_params']&&(_0x2d53c4[_0x4d1528(0xe0)]=_0x5576fb[_0x4d1528(0xe0)]),await this['httpClient']['request'](_0x4d1528(0xc6),'/api/sessions/'+encodeURIComponent(_0x274c56)+_0x4d1528(0xf2),{'body':_0x2d53c4});}async['retryAttempt'](_0x58af1e,_0x285ab1){const _0x271251=a10_0x27cb81,_0x261b01={};return _0x285ab1?.[_0x271251(0xfb)]&&(_0x261b01[_0x271251(0xfb)]=_0x285ab1[_0x271251(0xfb)]),_0x285ab1?.[_0x271251(0xe0)]&&(_0x261b01[_0x271251(0xe0)]=_0x285ab1['retry_params']),_0x285ab1?.[_0x271251(0xdb)]&&(_0x261b01[_0x271251(0xdb)]=_0x285ab1[_0x271251(0xdb)]),await this[_0x271251(0xa5)][_0x271251(0x9e)]('POST','/api/attempts/'+encodeURIComponent(_0x58af1e)+_0x271251(0xf2),{'body':_0x261b01});}async[a10_0x27cb81(0xd6)](_0x4e85eb){const _0x225b02=a10_0x27cb81,_0x169217={'sessionTime':_0x4e85eb[_0x225b02(0xf9)],'params':_0x4e85eb[_0x225b02(0xfc)]};return _0x4e85eb[_0x225b02(0xd0)]&&(_0x169217['workflowId']=_0x4e85eb[_0x225b02(0xd0)]),_0x4e85eb[_0x225b02(0xa4)]&&(_0x169217['projectName']=_0x4e85eb[_0x225b02(0xa4)]),_0x4e85eb['workflowName']&&(_0x169217[_0x225b02(0xd9)]=_0x4e85eb[_0x225b02(0xd9)]),_0x4e85eb[_0x225b02(0xc5)]&&(_0x169217[_0x225b02(0xc5)]=_0x4e85eb[_0x225b02(0xc5)]),_0x4e85eb[_0x225b02(0xe1)]!==undefined&&(_0x169217['allowQueueing']=_0x4e85eb[_0x225b02(0xe1)]),await this[_0x225b02(0xa5)]['request'](_0x225b02(0xcd),_0x225b02(0xc9),{'body':_0x169217});}async[a10_0x27cb81(0xf6)](_0x3857fe,_0x46511a,_0x25f1e7){const _0x48a627=a10_0x27cb81,{promises:_0x81eee3}=await import('fs'),_0x420a89=new URLSearchParams();_0x25f1e7&&_0x420a89[_0x48a627(0xf7)](_0x48a627(0xd2),_0x25f1e7);const _0x2c6667=_0x420a89[_0x48a627(0xd5)](),_0x1f0fdb=_0x2c6667?_0x48a627(0xe3)+encodeURIComponent(_0x3857fe)+_0x48a627(0xbe)+_0x2c6667:_0x48a627(0xe3)+encodeURIComponent(_0x3857fe)+_0x48a627(0xa2),_0x36614b=await this[_0x48a627(0xa5)][_0x48a627(0x9e)](_0x48a627(0xa1),_0x1f0fdb,{'headers':{'Accept':_0x48a627(0xad)},'responseType':'arraybuffer'});return await _0x81eee3[_0x48a627(0xe2)](_0x46511a,_0x36614b),_0x46511a;}async[a10_0x27cb81(0xbb)](_0x440f96,_0x1f483d,_0x5f2275,_0x8e4592){const _0x53a5fa=a10_0x27cb81,{promises:_0x44238c}=await import('fs'),_0x3afaf9=new URLSearchParams();_0x3afaf9[_0x53a5fa(0xf7)](_0x53a5fa(0xf8),_0x440f96),_0x3afaf9[_0x53a5fa(0xf7)]('revision',_0x1f483d);_0x8e4592?.['scheduleFrom']&&_0x3afaf9[_0x53a5fa(0xf7)](_0x53a5fa(0xed),_0x8e4592[_0x53a5fa(0xd8)]);_0x8e4592?.[_0x53a5fa(0xc4)]&&_0x8e4592['clearSchedule']['forEach'](_0x421ecc=>{const _0x4bc7dc=_0x53a5fa;_0x3afaf9[_0x4bc7dc(0xf7)](_0x4bc7dc(0xda),_0x421ecc);});_0x8e4592?.[_0x53a5fa(0xd7)]&&_0x3afaf9[_0x53a5fa(0xf7)]('clear_schedule_all',_0x53a5fa(0xcb));const _0x2e37a2=_0x3afaf9[_0x53a5fa(0xd5)](),_0x3520f6='/api/projects?'+_0x2e37a2,_0x49f50c=await _0x44238c[_0x53a5fa(0xf0)](_0x5f2275);return await this['httpClient'][_0x53a5fa(0x9e)](_0x53a5fa(0xcd),_0x3520f6,{'body':_0x49f50c,'headers':{'Content-Type':_0x53a5fa(0xad)}});}async[a10_0x27cb81(0xac)](_0x40f24b){const _0x3d4779=a10_0x27cb81;return await this[_0x3d4779(0xa5)][_0x3d4779(0x9e)](_0x3d4779(0xde),_0x3d4779(0xe3)+encodeURIComponent(_0x40f24b));}}
@@ -1 +1 @@
1
- const a11_0x4f5e4a=a11_0x380a;(function(_0x4fe92c,_0x394e22){const _0x5ae6f4=a11_0x380a,_0x4217b=_0x4fe92c();while(!![]){try{const _0x53395e=parseInt(_0x5ae6f4(0x13a))/0x1+parseInt(_0x5ae6f4(0x126))/0x2*(-parseInt(_0x5ae6f4(0x12a))/0x3)+-parseInt(_0x5ae6f4(0x121))/0x4+-parseInt(_0x5ae6f4(0x11e))/0x5*(-parseInt(_0x5ae6f4(0x12e))/0x6)+-parseInt(_0x5ae6f4(0x12f))/0x7+parseInt(_0x5ae6f4(0x134))/0x8*(parseInt(_0x5ae6f4(0x123))/0x9)+parseInt(_0x5ae6f4(0x133))/0xa*(parseInt(_0x5ae6f4(0x124))/0xb);if(_0x53395e===_0x394e22)break;else _0x4217b['push'](_0x4217b['shift']());}catch(_0x25527e){_0x4217b['push'](_0x4217b['shift']());}}}(a11_0x450a,0x629a5));function a11_0x380a(_0x42dfd0,_0x210a8e){_0x42dfd0=_0x42dfd0-0x119;const _0x450a12=a11_0x450a();let _0x380afc=_0x450a12[_0x42dfd0];return _0x380afc;}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_0x450a(){const _0x3774ad=['Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','538511Thjolf','Parent\x20name:\x20','Site:\x20','Listing\x20activations\x20for\x20segment\x20\x27','verbose','Error:\x20Segment\x20name\x20is\x20required','141845yeinLd','segment','Resolving\x20parent\x20segment\x20\x27','2590156nxlvoC','cause','5119362zAbbIy','195404kCeUDo','resolveSegmentId','741908etYgiW','\x27...','execute','site','6cjVmmd','Resolved\x20child\x20ID:\x20','error','activations','102DFtUMx','5040042pUhtaJ','resolveParentId','List\x20activations\x20for\x20a\x20segment','data','520bBMouN','8THvvyf','listActivations','description','length','Usage:\x20tdx\x20activations\x20<parent_name/child_name>'];a11_0x450a=function(){return _0x3774ad;};return a11_0x450a();}export class ActivationsCommand extends BaseCommand{['name']=a11_0x4f5e4a(0x12d);[a11_0x4f5e4a(0x136)]=a11_0x4f5e4a(0x131);async[a11_0x4f5e4a(0x128)](_0x4f2519){const _0x519524=a11_0x4f5e4a,{options:_0x50a422,args:_0x4549be,tdx:_0xe3b851}=_0x4f2519;if(_0x4549be['length']===0x0)return console[_0x519524(0x12c)](_0x519524(0x11d)),console[_0x519524(0x12c)](_0x519524(0x138)),0x1;try{const {parentId:_0x195b74,childId:_0x7d41f5}=parseSegmentRef(_0x4549be[0x0]);if(!_0x7d41f5)return console[_0x519524(0x12c)](_0x519524(0x139)),console['error'](_0x519524(0x138)),0x1;_0x50a422['verbose']&&(console[_0x519524(0x12c)](_0x519524(0x11a)+_0x50a422[_0x519524(0x129)]),console[_0x519524(0x12c)](_0x519524(0x119)+_0x195b74),console[_0x519524(0x12c)]('Child\x20name:\x20'+_0x7d41f5));const _0x49235f=await withSpinner(_0x519524(0x120)+_0x195b74+_0x519524(0x127),()=>_0xe3b851[_0x519524(0x11f)][_0x519524(0x130)](_0x195b74),{'verbose':_0x50a422[_0x519524(0x11c)]}),_0x111808=_0x49235f[_0x519524(0x132)];_0x50a422[_0x519524(0x11c)]&&console[_0x519524(0x12c)]('Resolved\x20parent\x20ID:\x20'+_0x111808);const _0x4858aa=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x7d41f5+_0x519524(0x127),()=>_0xe3b851[_0x519524(0x11f)][_0x519524(0x125)](_0x111808,_0x7d41f5),{'verbose':_0x50a422['verbose']}),_0xf19f5c=_0x4858aa[_0x519524(0x132)];_0x50a422[_0x519524(0x11c)]&&console['error'](_0x519524(0x12b)+_0xf19f5c);const _0x100020=await withSpinner(_0x519524(0x11b)+_0x7d41f5+_0x519524(0x127),()=>_0xe3b851['segment'][_0x519524(0x135)](_0x111808,_0xf19f5c),{'verbose':_0x50a422[_0x519524(0x11c)]}),_0x3a6849=_0x100020['data'];return console[_0x519524(0x12c)]('✔\x20Found\x20'+_0x3a6849[_0x519524(0x137)]+'\x20activation'+(_0x3a6849[_0x519524(0x137)]!==0x1?'s':'')),await handleSDKOutput(_0x3a6849,_0x50a422),0x0;}catch(_0x59359a){if(_0x59359a instanceof SDKError)return console[_0x519524(0x12c)]('Error:\x20'+_0x59359a['message']),_0x59359a[_0x519524(0x122)]&&console[_0x519524(0x12c)]('\x20\x20Cause:\x20'+_0x59359a['cause']),0x1;throw _0x59359a;}}}
1
+ function a11_0x56dd(_0x188c4b,_0x47401b){_0x188c4b=_0x188c4b-0x1e4;const _0x2e5f92=a11_0x2e5f();let _0x56dd0d=_0x2e5f92[_0x188c4b];return _0x56dd0d;}const a11_0x3e58ce=a11_0x56dd;(function(_0x1320c7,_0x2f66ec){const _0x3dd572=a11_0x56dd,_0x5730b4=_0x1320c7();while(!![]){try{const _0x371eb5=parseInt(_0x3dd572(0x1eb))/0x1*(parseInt(_0x3dd572(0x20a))/0x2)+parseInt(_0x3dd572(0x1ed))/0x3+parseInt(_0x3dd572(0x1e8))/0x4*(-parseInt(_0x3dd572(0x1ef))/0x5)+-parseInt(_0x3dd572(0x1e7))/0x6*(parseInt(_0x3dd572(0x206))/0x7)+parseInt(_0x3dd572(0x1f2))/0x8*(-parseInt(_0x3dd572(0x1fd))/0x9)+-parseInt(_0x3dd572(0x1f3))/0xa*(-parseInt(_0x3dd572(0x1fe))/0xb)+parseInt(_0x3dd572(0x1ff))/0xc*(parseInt(_0x3dd572(0x201))/0xd);if(_0x371eb5===_0x2f66ec)break;else _0x5730b4['push'](_0x5730b4['shift']());}catch(_0x53b68d){_0x5730b4['push'](_0x5730b4['shift']());}}}(a11_0x2e5f,0x5cd00));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_0x2e5f(){const _0x16d153=['36oPgnEg','length','532259aNTvQm','\x27...','List\x20activations\x20for\x20a\x20segment','data','\x20activation','21JZWIIE','✔\x20Found\x20','Parent\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','2Ohnlzd','\x20\x20Cause:\x20','cause','description','Child\x20name:\x20','1070166kzrcHz','2056ciZoTJ','resolveParentId','Resolving\x20child\x20segment\x20\x27','189963igZCVP','execute','1203402vaMhwi','Error:\x20','1955CFoFst','resolveSegmentId','site','2088536gmocnS','20DwjBxP','segment','Resolved\x20parent\x20ID:\x20','verbose','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','error','Resolved\x20child\x20ID:\x20','Site:\x20','Error:\x20Segment\x20name\x20is\x20required','name','9LTqIQO','3648469dVIhXR'];a11_0x2e5f=function(){return _0x16d153;};return a11_0x2e5f();}export class ActivationsCommand extends BaseCommand{[a11_0x3e58ce(0x1fc)]='activations';[a11_0x3e58ce(0x1e5)]=a11_0x3e58ce(0x203);async[a11_0x3e58ce(0x1ec)](_0x128e72){const _0x2f2df7=a11_0x3e58ce,{options:_0x5ab92f,args:_0x2bde76,tdx:_0x3aa3b3}=_0x128e72;if(_0x2bde76[_0x2f2df7(0x200)]===0x0)return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1fb)),console[_0x2f2df7(0x1f8)](_0x2f2df7(0x209)),0x1;try{const {parentId:_0x29f9be,childId:_0x5da5f6}=parseSegmentRef(_0x2bde76[0x0]);if(!_0x5da5f6)return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1f7)),console[_0x2f2df7(0x1f8)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x5ab92f[_0x2f2df7(0x1f6)]&&(console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1fa)+_0x5ab92f[_0x2f2df7(0x1f1)]),console[_0x2f2df7(0x1f8)](_0x2f2df7(0x208)+_0x29f9be),console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1e6)+_0x5da5f6));const _0x3d7201=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29f9be+_0x2f2df7(0x202),()=>_0x3aa3b3['segment'][_0x2f2df7(0x1e9)](_0x29f9be),{'verbose':_0x5ab92f['verbose']}),_0x35254b=_0x3d7201[_0x2f2df7(0x204)];_0x5ab92f[_0x2f2df7(0x1f6)]&&console['error'](_0x2f2df7(0x1f5)+_0x35254b);const _0x1417fa=await withSpinner(_0x2f2df7(0x1ea)+_0x5da5f6+_0x2f2df7(0x202),()=>_0x3aa3b3[_0x2f2df7(0x1f4)][_0x2f2df7(0x1f0)](_0x35254b,_0x5da5f6),{'verbose':_0x5ab92f[_0x2f2df7(0x1f6)]}),_0x1ced84=_0x1417fa[_0x2f2df7(0x204)];_0x5ab92f[_0x2f2df7(0x1f6)]&&console['error'](_0x2f2df7(0x1f9)+_0x1ced84);const _0x4719d2=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x5da5f6+_0x2f2df7(0x202),()=>_0x3aa3b3[_0x2f2df7(0x1f4)]['listActivations'](_0x35254b,_0x1ced84),{'verbose':_0x5ab92f[_0x2f2df7(0x1f6)]}),_0x7a43f5=_0x4719d2[_0x2f2df7(0x204)];return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x207)+_0x7a43f5['length']+_0x2f2df7(0x205)+(_0x7a43f5['length']!==0x1?'s':'')),await handleSDKOutput(_0x7a43f5,_0x5ab92f),0x0;}catch(_0x5217e5){if(_0x5217e5 instanceof SDKError)return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1ee)+_0x5217e5['message']),_0x5217e5['cause']&&console[_0x2f2df7(0x1f8)](_0x2f2df7(0x20b)+_0x5217e5[_0x2f2df7(0x1e4)]),0x1;throw _0x5217e5;}}}
@@ -1 +1 @@
1
- const a12_0x2bae4c=a12_0x3cd2;(function(_0x518dc7,_0x42150f){const _0x28ad11=a12_0x3cd2,_0x452324=_0x518dc7();while(!![]){try{const _0x52518d=parseInt(_0x28ad11(0x164))/0x1+-parseInt(_0x28ad11(0x116))/0x2+parseInt(_0x28ad11(0x113))/0x3+-parseInt(_0x28ad11(0x14f))/0x4*(parseInt(_0x28ad11(0x114))/0x5)+-parseInt(_0x28ad11(0x198))/0x6+parseInt(_0x28ad11(0x191))/0x7*(-parseInt(_0x28ad11(0x12f))/0x8)+parseInt(_0x28ad11(0x11e))/0x9;if(_0x52518d===_0x42150f)break;else _0x452324['push'](_0x452324['shift']());}catch(_0x2f6bda){_0x452324['push'](_0x452324['shift']());}}}(a12_0x413a,0xdfd7b));import a12_0x22025a from'chalk';import a12_0x3503c0 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_0x3cd2(_0x48d97f,_0x44d50d){_0x48d97f=_0x48d97f-0x101;const _0x413a97=a12_0x413a();let _0x3cd2c4=_0x413a97[_0x48d97f];return _0x3cd2c4;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';function formatCountSummary(_0x340a39){const _0x4ba832=a12_0x3cd2,_0x3de0e4=[];if(_0x340a39[_0x4ba832(0x197)]!==undefined)_0x3de0e4[_0x4ba832(0x193)](_0x340a39['total']+_0x4ba832(0x165));if(_0x340a39[_0x4ba832(0x15e)]!==undefined&&_0x340a39['new']>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x169)](_0x340a39['new']+_0x4ba832(0x195)));if(_0x340a39[_0x4ba832(0x16d)]!==undefined&&_0x340a39['created']>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x169)](_0x340a39[_0x4ba832(0x16d)]+'\x20created'));if(_0x340a39[_0x4ba832(0x16a)]!==undefined&&_0x340a39[_0x4ba832(0x16a)]>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x152)](_0x340a39['updated']+'\x20updated'));if(_0x340a39[_0x4ba832(0x130)]!==undefined&&_0x340a39[_0x4ba832(0x130)]>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x14d)](_0x340a39[_0x4ba832(0x130)]+_0x4ba832(0x14a)));if(_0x340a39[_0x4ba832(0x18b)]!==undefined&&_0x340a39[_0x4ba832(0x18b)]>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x17a)](_0x340a39[_0x4ba832(0x18b)]+'\x20errors'));return _0x3de0e4['join'](',\x20');}function displayDiffs(_0x483585,_0x4cfc5f,_0x4bfdbf,_0x279466){const _0x24ecfc=a12_0x3cd2;for(const _0x330a1b of _0x483585){if(_0x330a1b[_0x24ecfc(0x112)]){const _0x14f3fe=_0x330a1b[_0x24ecfc(0x14c)]||_0x330a1b[_0x24ecfc(0x101)];console['log'](_0x24ecfc(0x10d)+_0x14f3fe+'\x27:'),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c)),console[_0x24ecfc(0x140)](_0x330a1b['diff']),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c));}}for(const _0x440b5a of _0x4cfc5f){_0x440b5a[_0x24ecfc(0x112)]&&(console['log'](_0x24ecfc(0x180)+_0x440b5a['name']+'\x27:'),console['log']('─'[_0x24ecfc(0x186)](0x3c)),console['log'](_0x440b5a['diff']),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c)));}for(const _0x1c4ae2 of _0x4bfdbf){_0x1c4ae2[_0x24ecfc(0x112)]&&(console[_0x24ecfc(0x140)](_0x24ecfc(0x12e)+_0x1c4ae2[_0x24ecfc(0x101)]+'\x27:'),console['log']('─'[_0x24ecfc(0x186)](0x3c)),console['log'](_0x1c4ae2[_0x24ecfc(0x112)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3ec62c of _0x279466){_0x3ec62c[_0x24ecfc(0x112)]&&(console[_0x24ecfc(0x140)](_0x24ecfc(0x184)+_0x3ec62c[_0x24ecfc(0x101)]+'\x27:'),console['log']('─'[_0x24ecfc(0x186)](0x3c)),console[_0x24ecfc(0x140)](_0x3ec62c[_0x24ecfc(0x112)]),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c)));}}function a12_0x413a(){const _0x104bca=['join','No\x20tdx.json\x20found\x20in\x20','errors','\x0a✔\x20Pulled\x20','prompts','dirname','\x0aProject\x20pushed\x20with\x20errors','Dry\x20run\x20-\x20no\x20changes\x20made','3845394kucSim','parse','push','\x20files\x20to\x20','\x20new','\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','total','10946118RRghDC','action','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Analyzing\x20changes\x20to\x20push...','pushProject','name','outputDir','dim','Using\x20local\x20project:\x20','\x20files?','agent.yml','\x20changed','\x20\x20Agent\x20\x22','\x0aErrors\x20found:','site','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a','cyan','\x0aChanges\x20to\x20agent\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20successfully','llmProject','Analyzing\x20project\x20\x22','diff','736056MOPEKN','780005lSabcM','Pushing\x20agent\x20from\x20\x22','2221132WumFIv','Pushing\x20to\x20project...','Chat:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20context\x20project:\x20','New\x20project\x20name\x20is\x20required','Status:\x20','counts','26664300KMiUyy','llm','\x22\x20to\x20a\x20different\x20profile','textKnowledgeBases','Clone\x20cancelled','llm_project','agents','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20successfully','execute','force','MISSING_ARGUMENT','Agent:\x20','\x0aPush\x20summary\x20for\x20\x27','agent:clone','pushAgent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','8RROHOd','unchanged','Writing\x20files...','Summary:','sourceProjectName','Dry\x20run\x20-\x20no\x20files\x20written','outputPath','newProjectName','\x20\x20Prompts:\x20','tdx.json','Cloning\x20\x22','knowledgeBases','\x22...','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','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)','Using\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','log','dryRun','\x22:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','hasChanges','INVALID_ARGUMENT','output','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20pull\x20agent:\x20','description','\x20unchanged','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agentName','gray','\x20resources?','8PDKFwx','\x22\x20from\x20project\x20\x22','Agent\x20','yellow','projectName','agentId','\x20|\x20','Errors:','\x20=\x20','✔\x20Context\x20set:\x20','projectId','agent:push','Would\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','new','\x20\x20Knowledge\x20Bases:\x20','Output:\x20','utf-8','\x20resources\x20to\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','1505070TgqCZd','\x20total','\x20\x20Prompt\x20\x22','\x0aPush\x20','Would\x20clone:','green','updated','session','\x20\x20Knowledge\x20Base\x20\x22','created','\x22\x20to\x20\x22','Project\x20cloned\x20with\x20errors','Project:\x20','\x20\x20tdx\x20agent\x20pull\x20','Pull\x20cancelled','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','newProjectId','pullProject','error','\x20\x20Source:\x20','New\x20project:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','red','Source:\x20','\x20--profile\x20','Using\x20project\x20from\x20','\x20\x20Target:\x20','\x20\x20Agents:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','<new-name>','Pulling\x20agent\x20\x22','yes','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22\x20to\x20new\x20project\x20\x22'];a12_0x413a=function(){return _0x104bca;};return a12_0x413a();}export class AgentPullCommand extends BaseCommand{[a12_0x2bae4c(0x101)]='agent:pull';[a12_0x2bae4c(0x149)]=a12_0x2bae4c(0x173);async[a12_0x2bae4c(0x127)](_0x4127e8){const _0x45732e=a12_0x2bae4c,{options:_0x310154,args:_0x251afc,tdx:_0x463263}=_0x4127e8,_0x2e3c69=_0x251afc[0x0],_0x5b89c9=_0x251afc[0x1],_0x2e8e25=_0x310154[_0x45732e(0x146)],_0x3aac05=_0x310154[_0x45732e(0x141)],_0x5d033d=_0x310154['force'],_0x4f722f=_0x310154[_0x45732e(0x183)],_0x30923a=_0x310154[_0x45732e(0x110)];let _0x39281a,_0x212f51;const _0x31f37f=findAgentConfigPath(process[_0x45732e(0x15d)]());if(_0x2e3c69){const _0x22237c=a12_0x3503c0[_0x45732e(0x189)](_0x2e3c69,_0x45732e(0x138));if(existsSync(_0x22237c))try{const _0xc60ff=JSON[_0x45732e(0x192)](readFileSync(_0x22237c,'utf-8'));_0x39281a=_0xc60ff[_0x45732e(0x123)],_0x212f51=_0x2e3c69,console[_0x45732e(0x140)](a12_0x22025a['dim'](_0x45732e(0x17d)+_0x22237c+':\x20'+_0x39281a));}catch{_0x39281a=_0x2e3c69;}else _0x39281a=_0x2e3c69;}else{if(_0x31f37f)try{const _0x2eb025=JSON[_0x45732e(0x192)](readFileSync(_0x31f37f,_0x45732e(0x161)));_0x39281a=_0x2eb025['llm_project'],_0x212f51=a12_0x3503c0[_0x45732e(0x18e)](_0x31f37f),console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x103)](_0x45732e(0x13e)+_0x39281a));}catch{_0x39281a=_0x30923a;}else _0x39281a=_0x30923a;}if(!_0x39281a)return console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x152)](_0x45732e(0x187))),console[_0x45732e(0x140)](_0x45732e(0x13d)),console[_0x45732e(0x140)](_0x45732e(0x196)),console[_0x45732e(0x140)]('\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['log'](_0x45732e(0x19a)),0x1;if(_0x5b89c9){const {data:_0x274ab2}=await withSpinner(_0x45732e(0x182)+_0x5b89c9+_0x45732e(0x150)+_0x39281a+'\x22...',()=>_0x463263[_0x45732e(0x11f)]['pullAgent'](_0x39281a,_0x5b89c9,_0x2e8e25,{'dryRun':_0x3aac05,'force':_0x5d033d}));if(_0x3aac05)return console[_0x45732e(0x140)](a12_0x22025a['yellow'](_0x45732e(0x134))),console[_0x45732e(0x140)](_0x45732e(0x148)+_0x274ab2[_0x45732e(0x14c)]),console[_0x45732e(0x140)]('Output\x20path:\x20'+_0x274ab2[_0x45732e(0x135)]),_0x274ab2[_0x45732e(0x112)]&&(console[_0x45732e(0x140)]('\x0aChanges:'),console[_0x45732e(0x140)]('─'[_0x45732e(0x186)](0x3c)),console[_0x45732e(0x140)](_0x274ab2[_0x45732e(0x112)]),console[_0x45732e(0x140)]('─'[_0x45732e(0x186)](0x3c))),0x0;return console[_0x45732e(0x140)](a12_0x22025a['green']('Agent\x20pulled\x20successfully')),console[_0x45732e(0x140)]('Agent:\x20'+_0x274ab2[_0x45732e(0x14c)]),console[_0x45732e(0x140)](_0x45732e(0x160)+_0x274ab2['outputPath']),console['log'](_0x45732e(0x11c)+(_0x274ab2['isNew']?a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x15e)):_0x274ab2[_0x45732e(0x144)]?a12_0x22025a[_0x45732e(0x152)](_0x45732e(0x16a)):a12_0x22025a['gray'](_0x45732e(0x130)))),0x0;}const _0x241674=_0x212f51||_0x2e8e25,{data:_0x243c80}=await withSpinner(_0x45732e(0x111)+_0x39281a+_0x45732e(0x13b),()=>_0x463263[_0x45732e(0x11f)]['pullProject'](_0x39281a,_0x241674,{'dryRun':!![]})),_0x4dc1cb=_0x243c80[_0x45732e(0x11d)][_0x45732e(0x124)][_0x45732e(0x15e)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x13a)][_0x45732e(0x15e)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x121)][_0x45732e(0x15e)]+_0x243c80[_0x45732e(0x11d)]['prompts'][_0x45732e(0x15e)],_0x33f110=_0x243c80['counts'][_0x45732e(0x124)]['updated']+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x13a)][_0x45732e(0x16a)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x121)][_0x45732e(0x16a)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x18d)][_0x45732e(0x16a)],_0x435b5d=_0x243c80['counts'][_0x45732e(0x124)][_0x45732e(0x130)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x13a)][_0x45732e(0x130)]+_0x243c80[_0x45732e(0x11d)]['textKnowledgeBases'][_0x45732e(0x130)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x18d)]['unchanged'];console[_0x45732e(0x140)]('\x0aPull\x20summary\x20for\x20\x27'+_0x243c80['projectName']+'\x27:'),console[_0x45732e(0x140)]('\x20\x20'+a12_0x22025a[_0x45732e(0x169)]('+\x20'+_0x4dc1cb+_0x45732e(0x195))+_0x45732e(0x155)+a12_0x22025a[_0x45732e(0x152)]('~\x20'+_0x33f110+'\x20changed')+_0x45732e(0x155)+a12_0x22025a[_0x45732e(0x103)]('=\x20'+_0x435b5d+_0x45732e(0x14a))),console[_0x45732e(0x140)]('\x20\x20Agents:\x20'+formatCountSummary(_0x243c80['counts'][_0x45732e(0x124)])),console[_0x45732e(0x140)](_0x45732e(0x15f)+formatCountSummary(_0x243c80['counts'][_0x45732e(0x13a)])),console[_0x45732e(0x140)](_0x45732e(0x143)+formatCountSummary(_0x243c80['counts'][_0x45732e(0x121)])),console['log'](_0x45732e(0x137)+formatCountSummary(_0x243c80[_0x45732e(0x11d)][_0x45732e(0x18d)])),console[_0x45732e(0x140)](_0x45732e(0x17e)+a12_0x22025a['cyan'](_0x243c80[_0x45732e(0x102)])),displayDiffs(_0x243c80[_0x45732e(0x124)],_0x243c80[_0x45732e(0x13a)],_0x243c80[_0x45732e(0x121)],_0x243c80[_0x45732e(0x18d)]);if(_0x3aac05)return console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x152)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4dc1cb===0x0&&_0x33f110===0x0)return console[_0x45732e(0x140)](a12_0x22025a['green'](_0x45732e(0x163))),saveSessionContext({'llm_project':_0x243c80[_0x45732e(0x153)]},_0x310154[_0x45732e(0x16b)]),console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x158)+a12_0x22025a[_0x45732e(0x103)](_0x45732e(0x123))+_0x45732e(0x157)+a12_0x22025a[_0x45732e(0x10c)](_0x243c80['projectName']))),0x0;if(!_0x4f722f&&!_0x5d033d){const _0x594e4f=await confirmKey('\x0aWrite\x20'+(_0x4dc1cb+_0x33f110)+_0x45732e(0x105));if(!_0x594e4f)return console[_0x45732e(0x140)](_0x45732e(0x172)),0x0;}const {data:_0x580a36}=await withSpinner(_0x45732e(0x131),()=>_0x463263[_0x45732e(0x11f)][_0x45732e(0x175)](_0x39281a,_0x241674,{'force':_0x5d033d}));return console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x18c)+(_0x4dc1cb+_0x33f110)+_0x45732e(0x194)+_0x580a36[_0x45732e(0x102)])),saveSessionContext({'llm_project':_0x580a36[_0x45732e(0x153)]},_0x310154['session']),console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x158)+a12_0x22025a['dim'](_0x45732e(0x123))+'\x20=\x20'+a12_0x22025a['cyan'](_0x580a36[_0x45732e(0x153)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a12_0x2bae4c(0x101)]=a12_0x2bae4c(0x12c);[a12_0x2bae4c(0x149)]=a12_0x2bae4c(0x147);async[a12_0x2bae4c(0x127)](_0x550d8f){const _0xaf4b7c=a12_0x2bae4c,{options:_0x206cea,args:_0x3b3f1a,tdx:_0x4cc942}=_0x550d8f,_0x3410ed=_0x3b3f1a[0x0],_0x138c01=_0x206cea[_0xaf4b7c(0x101)],_0x28551f=_0x206cea[_0xaf4b7c(0x141)],_0x3ba680=_0x206cea[_0xaf4b7c(0x183)],_0x536d36=_0x206cea[_0xaf4b7c(0x10a)],_0x2ea15b=_0x206cea['llmProject'];let _0x5c7dd8;const _0x6d26b8=findAgentConfigPath(process[_0xaf4b7c(0x15d)]());if(_0x3410ed){const _0x188096=a12_0x3503c0['join'](_0x3410ed,_0xaf4b7c(0x138));existsSync(_0x188096)?(_0x5c7dd8=_0x3410ed,console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x103)]('Using\x20local\x20project:\x20'+_0x3410ed))):_0x5c7dd8=_0x3410ed;}else{if(_0x6d26b8)_0x5c7dd8=a12_0x3503c0[_0xaf4b7c(0x18e)](_0x6d26b8),console[_0xaf4b7c(0x140)](a12_0x22025a['dim']('Using\x20current\x20project:\x20'+_0x5c7dd8));else{if(_0x2ea15b){const _0x2784f7=normalizeName(_0x2ea15b),_0x295157=a12_0x3503c0['join'](process[_0xaf4b7c(0x15d)](),_0xaf4b7c(0x124),_0x2784f7,_0xaf4b7c(0x138));if(existsSync(_0x295157))_0x5c7dd8=a12_0x3503c0[_0xaf4b7c(0x18e)](_0x295157),console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x103)](_0xaf4b7c(0x104)+_0x5c7dd8));else{const _0xb61035=_0x206cea['profile'];if(_0xb61035)throw new SDKError(ErrorCode[_0xaf4b7c(0x145)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2ea15b+_0xaf4b7c(0x120),undefined,{'helpText':_0xaf4b7c(0x10e)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0xaf4b7c(0x171)+_0x2ea15b+'\x0a')+(_0xaf4b7c(0x15c)+_0x2784f7+'\x20--name\x20'+(_0x138c01||_0xaf4b7c(0x181))+_0xaf4b7c(0x17c)+_0xb61035)});_0x5c7dd8=_0x2ea15b,console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x103)](_0xaf4b7c(0x11a)+_0x2ea15b));}}}}if(!_0x5c7dd8)return console[_0xaf4b7c(0x140)](a12_0x22025a['yellow'](_0xaf4b7c(0x179))),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x185)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0xaf4b7c(0x140)]('\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)'),console[_0xaf4b7c(0x140)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x138c01)throw new SDKError(ErrorCode[_0xaf4b7c(0x129)],_0xaf4b7c(0x11b),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3ba680&&!_0x28551f){const _0x61333d=await confirmKey('Clone\x20\x22'+_0x5c7dd8+_0xaf4b7c(0x188)+_0x138c01+'\x22?');if(!_0x61333d)return console[_0xaf4b7c(0x140)](_0xaf4b7c(0x122)),0x0;}const {data:_0x149031}=await withSpinner(_0xaf4b7c(0x139)+_0x5c7dd8+_0xaf4b7c(0x16e)+_0x138c01+'\x22...',()=>_0x4cc942[_0xaf4b7c(0x11f)]['cloneProject'](_0x5c7dd8,_0x138c01,{'dryRun':_0x28551f}));if(_0x28551f)return console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x152)](_0xaf4b7c(0x190))),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x17b)+_0x149031[_0xaf4b7c(0x133)]),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x178)+_0x138c01),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x168)),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x17f)+_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x124)][_0xaf4b7c(0x16d)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x13a)][_0xaf4b7c(0x16d)]),console['log']('\x20\x20Prompts:\x20'+_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x18d)]['created']),0x0;const _0x118c78=_0x149031['counts'][_0xaf4b7c(0x124)][_0xaf4b7c(0x18b)]>0x0||_0x149031['counts'][_0xaf4b7c(0x13a)][_0xaf4b7c(0x18b)]>0x0||_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x18d)]['errors']>0x0;_0x118c78?console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x152)](_0xaf4b7c(0x16f))):console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x169)](_0xaf4b7c(0x126)));console[_0xaf4b7c(0x140)](_0xaf4b7c(0x17b)+_0x149031[_0xaf4b7c(0x133)]),console['log'](_0xaf4b7c(0x178)+_0x149031[_0xaf4b7c(0x136)]),console['log']('New\x20project\x20ID:\x20'+_0x149031['newProjectId']),console[_0xaf4b7c(0x140)](),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x132)),console[_0xaf4b7c(0x140)]('\x20\x20Agents:\x20'+formatCountSummary(_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x124)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x149031['counts'][_0xaf4b7c(0x13a)])),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x137)+formatCountSummary(_0x149031['counts'][_0xaf4b7c(0x18d)]));if(_0x118c78){console['log'](),console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x17a)]('Errors:'));for(const _0x3d9d20 of _0x149031['agents']){_0x3d9d20[_0xaf4b7c(0x199)]===_0xaf4b7c(0x176)&&console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x17a)](_0xaf4b7c(0x108)+_0x3d9d20[_0xaf4b7c(0x14c)]+_0xaf4b7c(0x142)+_0x3d9d20['error']));}for(const _0x2f3d72 of _0x149031[_0xaf4b7c(0x13a)]){_0x2f3d72[_0xaf4b7c(0x199)]===_0xaf4b7c(0x176)&&console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x17a)](_0xaf4b7c(0x16c)+_0x2f3d72[_0xaf4b7c(0x101)]+_0xaf4b7c(0x142)+_0x2f3d72[_0xaf4b7c(0x176)]));}for(const _0x4d1a70 of _0x149031[_0xaf4b7c(0x18d)]){_0x4d1a70[_0xaf4b7c(0x199)]===_0xaf4b7c(0x176)&&console[_0xaf4b7c(0x140)](a12_0x22025a['red'](_0xaf4b7c(0x166)+_0x4d1a70['name']+_0xaf4b7c(0x142)+_0x4d1a70[_0xaf4b7c(0x176)]));}return 0x1;}saveSessionContext({'llm_project':_0x149031[_0xaf4b7c(0x136)]},_0x206cea[_0xaf4b7c(0x16b)]),console[_0xaf4b7c(0x140)](),console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x169)]('Context\x20set:\x20'+a12_0x22025a[_0xaf4b7c(0x103)]('llm_project')+_0xaf4b7c(0x157)+a12_0x22025a[_0xaf4b7c(0x10c)](_0x149031[_0xaf4b7c(0x136)])));const _0x55cdd2=getLLMProjectUrl(_0x536d36,_0x149031[_0xaf4b7c(0x174)]);return console[_0xaf4b7c(0x140)](_0xaf4b7c(0x170)+a12_0x22025a['cyan'](_0x55cdd2)),0x0;}}export class AgentPushCommand extends BaseCommand{[a12_0x2bae4c(0x101)]=a12_0x2bae4c(0x15a);['description']=a12_0x2bae4c(0x13c);async[a12_0x2bae4c(0x127)](_0x45f8e6){const _0x399e4b=a12_0x2bae4c,{options:_0x2b4984,args:_0x27e950,tdx:_0x59075c}=_0x45f8e6;let _0x2ba9c2=_0x27e950[0x0]||process[_0x399e4b(0x15d)]();const _0x53d561=_0x2b4984[_0x399e4b(0x141)],_0x276de7=_0x2b4984[_0x399e4b(0x128)],_0x40a4a5=_0x2b4984[_0x399e4b(0x183)],_0x255775=_0x2b4984['site'],_0x114f24=a12_0x3503c0[_0x399e4b(0x189)](_0x2ba9c2,_0x399e4b(0x106)),_0x1011e6=existsSync(_0x114f24);if(_0x1011e6){const {data:_0x3edb0}=await withSpinner(_0x399e4b(0x115)+_0x2ba9c2+_0x399e4b(0x13b),()=>_0x59075c[_0x399e4b(0x11f)][_0x399e4b(0x12d)](_0x2ba9c2,{'dryRun':_0x53d561,'force':_0x276de7}));if(_0x53d561)return console['log'](a12_0x22025a[_0x399e4b(0x152)](_0x399e4b(0x190))),console[_0x399e4b(0x140)](_0x399e4b(0x15b)+_0x3edb0[_0x399e4b(0x14c)]),0x0;if(_0x3edb0['action']===_0x399e4b(0x176))return console[_0x399e4b(0x140)](a12_0x22025a['red']('Failed\x20to\x20push\x20agent:\x20'+_0x3edb0['error'])),0x1;console['log'](a12_0x22025a[_0x399e4b(0x169)](_0x399e4b(0x151)+_0x3edb0[_0x399e4b(0x199)]+_0x399e4b(0x10f))),console[_0x399e4b(0x140)](_0x399e4b(0x12a)+_0x3edb0[_0x399e4b(0x14c)]);if(_0x3edb0['agentId']&&_0x3edb0[_0x399e4b(0x159)]){const _0x233011=getLLMAgentChatUrl(_0x255775,_0x3edb0[_0x399e4b(0x159)],_0x3edb0[_0x399e4b(0x154)]);console[_0x399e4b(0x140)](_0x399e4b(0x118)+a12_0x22025a[_0x399e4b(0x10c)](_0x233011));}return 0x0;}let _0x27dc35=a12_0x3503c0[_0x399e4b(0x189)](_0x2ba9c2,_0x399e4b(0x138));if(!existsSync(_0x27dc35)){const _0xfcb1e5=findAgentConfigPath(_0x2ba9c2);if(_0xfcb1e5)_0x2ba9c2=a12_0x3503c0['dirname'](_0xfcb1e5),_0x27dc35=_0xfcb1e5,console[_0x399e4b(0x140)](a12_0x22025a['dim'](_0x399e4b(0x13e)+_0x2ba9c2));else{const _0x22b517=_0x2b4984[_0x399e4b(0x110)];if(_0x22b517){const _0x3bec2d=normalizeName(_0x22b517),_0x58cb46=a12_0x3503c0['join'](_0x2ba9c2,_0x399e4b(0x124)),_0x3c1f7d=a12_0x3503c0[_0x399e4b(0x189)](_0x58cb46,_0x3bec2d,'tdx.json');existsSync(_0x3c1f7d)&&(_0x2ba9c2=a12_0x3503c0[_0x399e4b(0x18e)](_0x3c1f7d),_0x27dc35=_0x3c1f7d,console[_0x399e4b(0x140)](a12_0x22025a['dim'](_0x399e4b(0x13e)+_0x2ba9c2)));}if(!existsSync(_0x27dc35)){let _0x451b52=_0x399e4b(0x14b);_0x22b517&&(_0x451b52='Current\x20context\x20has\x20llm_project=\x22'+_0x22b517+_0x399e4b(0x10b)+(_0x399e4b(0x13f)+_0x22b517+'\x27\x20to\x20create\x20the\x20folder\x20structure.'));throw new SDKError(ErrorCode[_0x399e4b(0x145)],_0x399e4b(0x18a)+_0x2ba9c2,undefined,{'helpText':_0x451b52});}}}const {data:_0x3c1efd}=await withSpinner(_0x399e4b(0x19b),()=>_0x59075c[_0x399e4b(0x11f)][_0x399e4b(0x19c)](_0x2ba9c2,{'dryRun':!![]})),_0x58c757=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x18b)]>0x0;if(_0x58c757){console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x109)));for(const _0x13390d of _0x3c1efd['agents']){_0x13390d[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x108)+_0x13390d[_0x399e4b(0x14c)]+'\x22:\x20'+_0x13390d['error']));}return 0x1;}const _0x3ae685=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x16d)]+_0x3c1efd['counts'][_0x399e4b(0x13a)][_0x399e4b(0x16d)]+_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x121)][_0x399e4b(0x16d)]+_0x3c1efd[_0x399e4b(0x11d)]['prompts'][_0x399e4b(0x16d)],_0x3df9ce=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x16a)]+_0x3c1efd['counts'][_0x399e4b(0x13a)]['updated']+_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x121)]['updated']+_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x18d)][_0x399e4b(0x16a)],_0x45d176=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x130)]+_0x3c1efd['counts'][_0x399e4b(0x13a)][_0x399e4b(0x130)]+_0x3c1efd[_0x399e4b(0x11d)]['textKnowledgeBases'][_0x399e4b(0x130)]+_0x3c1efd[_0x399e4b(0x11d)]['prompts']['unchanged'];console[_0x399e4b(0x140)](_0x399e4b(0x12b)+_0x3c1efd[_0x399e4b(0x153)]+'\x27:'),console[_0x399e4b(0x140)]('\x20\x20'+a12_0x22025a[_0x399e4b(0x169)]('+\x20'+_0x3ae685+'\x20new')+'\x20|\x20'+a12_0x22025a['yellow']('~\x20'+_0x3df9ce+_0x399e4b(0x107))+'\x20|\x20'+a12_0x22025a[_0x399e4b(0x103)]('=\x20'+_0x45d176+'\x20unchanged')),console[_0x399e4b(0x140)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3c1efd['counts'][_0x399e4b(0x124)])),console[_0x399e4b(0x140)](_0x399e4b(0x15f)+formatCountSummary(_0x3c1efd['counts']['knowledgeBases'])),console[_0x399e4b(0x140)](_0x399e4b(0x143)+formatCountSummary(_0x3c1efd[_0x399e4b(0x11d)]['textKnowledgeBases'])),console[_0x399e4b(0x140)](_0x399e4b(0x137)+formatCountSummary(_0x3c1efd['counts'][_0x399e4b(0x18d)])),console[_0x399e4b(0x140)](_0x399e4b(0x177)+a12_0x22025a[_0x399e4b(0x10c)](_0x2ba9c2)),displayDiffs(_0x3c1efd[_0x399e4b(0x124)],_0x3c1efd[_0x399e4b(0x13a)],_0x3c1efd[_0x399e4b(0x121)],_0x3c1efd[_0x399e4b(0x18d)]);if(_0x53d561)return console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x152)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x3ae685===0x0&&_0x3df9ce===0x0){console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x169)](_0x399e4b(0x119)));const _0x38b202=getLLMProjectUrl(_0x255775,_0x3c1efd[_0x399e4b(0x159)]);return console[_0x399e4b(0x140)](_0x399e4b(0x170)+a12_0x22025a['cyan'](_0x38b202)),0x0;}if(!_0x40a4a5&&!_0x276de7){const _0x30ed5c=await confirmKey(_0x399e4b(0x167)+(_0x3ae685+_0x3df9ce)+_0x399e4b(0x14e));if(!_0x30ed5c)return console['log']('Push\x20cancelled'),0x0;}const {data:_0x1ade2d}=await withSpinner(_0x399e4b(0x117),()=>_0x59075c['llm'][_0x399e4b(0x19c)](_0x2ba9c2,{'force':_0x276de7})),_0x20bb3c=_0x1ade2d[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x18b)]>0x0||_0x1ade2d[_0x399e4b(0x11d)][_0x399e4b(0x13a)][_0x399e4b(0x18b)]>0x0||_0x1ade2d[_0x399e4b(0x11d)]['textKnowledgeBases']['errors']>0x0||_0x1ade2d[_0x399e4b(0x11d)][_0x399e4b(0x18d)][_0x399e4b(0x18b)]>0x0;if(_0x20bb3c){console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x152)](_0x399e4b(0x18f))),console[_0x399e4b(0x140)](),console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x156)));for(const _0x1471c9 of _0x1ade2d[_0x399e4b(0x124)]){_0x1471c9['action']===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)]('\x20\x20Agent\x20\x22'+_0x1471c9[_0x399e4b(0x14c)]+'\x22:\x20'+_0x1471c9[_0x399e4b(0x176)]));}for(const _0x675bac of _0x1ade2d[_0x399e4b(0x13a)]){_0x675bac[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x16c)+_0x675bac[_0x399e4b(0x101)]+'\x22:\x20'+_0x675bac[_0x399e4b(0x176)]));}for(const _0x3a6ee7 of _0x1ade2d[_0x399e4b(0x121)]){_0x3a6ee7[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x125)+_0x3a6ee7['name']+_0x399e4b(0x142)+_0x3a6ee7[_0x399e4b(0x176)]));}for(const _0xa9e0af of _0x1ade2d[_0x399e4b(0x18d)]){_0xa9e0af[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x166)+_0xa9e0af[_0x399e4b(0x101)]+'\x22:\x20'+_0xa9e0af[_0x399e4b(0x176)]));}return 0x1;}console[_0x399e4b(0x140)](a12_0x22025a['green']('\x0a✔\x20Pushed\x20'+(_0x3ae685+_0x3df9ce)+_0x399e4b(0x162)+_0x1ade2d[_0x399e4b(0x153)]+'\x27'));const _0x5a5e79=getLLMProjectUrl(_0x255775,_0x1ade2d[_0x399e4b(0x159)]);return console[_0x399e4b(0x140)]('Project:\x20'+a12_0x22025a[_0x399e4b(0x10c)](_0x5a5e79)),0x0;}}
1
+ const a12_0x3d7ff1=a12_0xe260;(function(_0x4766c9,_0x20eff0){const _0x4489e3=a12_0xe260,_0x20f0a=_0x4766c9();while(!![]){try{const _0x2e35e6=-parseInt(_0x4489e3(0x147))/0x1+-parseInt(_0x4489e3(0x1b9))/0x2*(-parseInt(_0x4489e3(0x18c))/0x3)+-parseInt(_0x4489e3(0x174))/0x4+parseInt(_0x4489e3(0x13a))/0x5*(parseInt(_0x4489e3(0x185))/0x6)+-parseInt(_0x4489e3(0x159))/0x7*(parseInt(_0x4489e3(0x193))/0x8)+parseInt(_0x4489e3(0x151))/0x9*(-parseInt(_0x4489e3(0x1af))/0xa)+parseInt(_0x4489e3(0x179))/0xb*(parseInt(_0x4489e3(0x1ab))/0xc);if(_0x2e35e6===_0x20eff0)break;else _0x20f0a['push'](_0x20f0a['shift']());}catch(_0x190866){_0x20f0a['push'](_0x20f0a['shift']());}}}(a12_0x4e94,0x29a84));import a12_0x20c898 from'chalk';import a12_0x362ccb 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';function a12_0x4e94(){const _0xf3cb44=['Pulling\x20agent\x20\x22','utf-8','Analyzing\x20changes\x20to\x20push...','\x20\x20Prompt\x20\x22','791724tNUfmk','\x0aChanges\x20to\x20agent\x20\x27','No\x20tdx.json\x20found\x20in\x20','Failed\x20to\x20push\x20agent:\x20','tdx.json','11jpsPbJ','name','Current\x20context\x20has\x20llm_project=\x22','Dry\x20run\x20-\x20no\x20changes\x20made','Pushing\x20to\x20project...','knowledgeBases','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','diff','log','\x20\x20Knowledge\x20Base\x20\x22','\x20files\x20to\x20','\x0aWrite\x20','6QUNdbD','\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)','yellow','cloneProject','Agent\x20','\x20--profile\x20','Push\x20cancelled','3zhTpVE','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','pushProject','Chat:\x20','total','\x20\x20Text\x20Knowledge\x20Bases:\x20','Source:\x20','1270184JyKRmJ','dryRun','force','repeat','red','\x20total','textKnowledgeBases','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project\x20cloned\x20with\x20errors','Analyzing\x20project\x20\x22','cyan','gray','\x20\x20Agents:\x20','Errors:','yes','\x20unchanged','agent:pull','pushAgent','\x22:\x20','llm_project','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Source:\x20','6000180IkDHAa','Agent:\x20','prompts','new','30wPcUOP','projectName','created','\x22...','\x0aErrors\x20found:','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','action','dim','push','projectId','196322qIXUQi','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Using\x20local\x20project:\x20','INVALID_ARGUMENT','\x0aPull\x20summary\x20for\x20\x27','Pull\x20cancelled','agent.yml','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Target:\x20','\x0a✔\x20Pulled\x20','llmProject','agentName','\x20new','\x0aPush\x20','cwd','Clone\x20\x22','outputDir','Agent\x20pulled\x20successfully','\x20\x20tdx\x20agent\x20clone\x20agents/','✔\x20Context\x20set:\x20','New\x20project:\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)','Writing\x20files...','New\x20project\x20ID:\x20','counts','Would\x20clone:','description','Using\x20current\x20project:\x20','newProjectName','Dry\x20run\x20-\x20no\x20files\x20written','428755xRRomr','profile','\x20successfully','\x20|\x20','\x22\x20to\x20new\x20project\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Project\x20cloned\x20successfully','unchanged','error','parse','site','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Would\x20push\x20agent:\x20','142804nwjnQj','Run\x20\x27tdx\x20agent\x20pull\x20','\x20changed','output','execute','Summary:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','join','session','41373bxszUS','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Project:\x20','newProjectId','agents','dirname','Would\x20pull\x20agent:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','7yiTCMA','Using\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Pushing\x20agent\x20from\x20\x22','\x20errors','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Output\x20path:\x20','outputPath','updated','\x20\x20Prompts:\x20','\x20=\x20','llm','\x20\x20Agent\x20\x22','\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','New\x20project\x20name\x20is\x20required','\x20\x20tdx\x20agent\x20pull\x20','errors','agentId','<new-name>','green','pullProject','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a'];a12_0x4e94=function(){return _0xf3cb44;};return a12_0x4e94();}import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';function formatCountSummary(_0x5b14bc){const _0xc9928b=a12_0xe260,_0xc08f2c=[];if(_0x5b14bc[_0xc9928b(0x190)]!==undefined)_0xc08f2c[_0xc9928b(0x1b7)](_0x5b14bc[_0xc9928b(0x190)]+_0xc9928b(0x198));if(_0x5b14bc[_0xc9928b(0x1ae)]!==undefined&&_0x5b14bc['new']>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x16d)](_0x5b14bc[_0xc9928b(0x1ae)]+_0xc9928b(0x1c5)));if(_0x5b14bc[_0xc9928b(0x1b1)]!==undefined&&_0x5b14bc[_0xc9928b(0x1b1)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898['green'](_0x5b14bc['created']+'\x20created'));if(_0x5b14bc[_0xc9928b(0x162)]!==undefined&&_0x5b14bc[_0xc9928b(0x162)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x187)](_0x5b14bc[_0xc9928b(0x162)]+'\x20updated'));if(_0x5b14bc[_0xc9928b(0x141)]!==undefined&&_0x5b14bc[_0xc9928b(0x141)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x19f)](_0x5b14bc['unchanged']+_0xc9928b(0x1a3)));if(_0x5b14bc[_0xc9928b(0x16a)]!==undefined&&_0x5b14bc[_0xc9928b(0x16a)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x197)](_0x5b14bc[_0xc9928b(0x16a)]+_0xc9928b(0x15d)));return _0xc08f2c['join'](',\x20');}function a12_0xe260(_0x33f17c,_0x25484f){_0x33f17c=_0x33f17c-0x135;const _0x4e94f3=a12_0x4e94();let _0xe260f5=_0x4e94f3[_0x33f17c];return _0xe260f5;}function displayDiffs(_0x14d1d4,_0xfdb5b7,_0x5e4677,_0x14ce02){const _0x8f87cd=a12_0xe260;for(const _0xbbacd2 of _0x14d1d4){if(_0xbbacd2[_0x8f87cd(0x180)]){const _0x46a8d7=_0xbbacd2[_0x8f87cd(0x1c4)]||_0xbbacd2['name'];console[_0x8f87cd(0x181)](_0x8f87cd(0x175)+_0x46a8d7+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x8f87cd(0x181)](_0xbbacd2['diff']),console[_0x8f87cd(0x181)]('─'[_0x8f87cd(0x196)](0x3c));}}for(const _0x46d065 of _0xfdb5b7){_0x46d065[_0x8f87cd(0x180)]&&(console[_0x8f87cd(0x181)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x46d065[_0x8f87cd(0x17a)]+'\x27:'),console[_0x8f87cd(0x181)]('─'['repeat'](0x3c)),console['log'](_0x46d065['diff']),console[_0x8f87cd(0x181)]('─'[_0x8f87cd(0x196)](0x3c)));}for(const _0x188fa9 of _0x5e4677){_0x188fa9[_0x8f87cd(0x180)]&&(console['log'](_0x8f87cd(0x17f)+_0x188fa9[_0x8f87cd(0x17a)]+'\x27:'),console['log']('─'[_0x8f87cd(0x196)](0x3c)),console[_0x8f87cd(0x181)](_0x188fa9[_0x8f87cd(0x180)]),console['log']('─'[_0x8f87cd(0x196)](0x3c)));}for(const _0x4385fd of _0x14ce02){_0x4385fd[_0x8f87cd(0x180)]&&(console['log'](_0x8f87cd(0x1a8)+_0x4385fd[_0x8f87cd(0x17a)]+'\x27:'),console[_0x8f87cd(0x181)]('─'['repeat'](0x3c)),console[_0x8f87cd(0x181)](_0x4385fd['diff']),console['log']('─'[_0x8f87cd(0x196)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a12_0x3d7ff1(0x17a)]=a12_0x3d7ff1(0x1a4);[a12_0x3d7ff1(0x136)]=a12_0x3d7ff1(0x15e);async[a12_0x3d7ff1(0x14b)](_0x465a9f){const _0x20f1cb=a12_0x3d7ff1,{options:_0x50b464,args:_0x2533ed,tdx:_0x2f8a04}=_0x465a9f,_0x122962=_0x2533ed[0x0],_0x1c0610=_0x2533ed[0x1],_0x20ec60=_0x50b464[_0x20f1cb(0x14a)],_0x2cb99d=_0x50b464['dryRun'],_0xf1f934=_0x50b464[_0x20f1cb(0x195)],_0x58d8c9=_0x50b464[_0x20f1cb(0x1a2)],_0x1ba2de=_0x50b464[_0x20f1cb(0x1c3)];let _0x3ff32c,_0x5f4896;const _0x381f7d=findAgentConfigPath(process[_0x20f1cb(0x1c7)]());if(_0x122962){const _0x367110=a12_0x362ccb[_0x20f1cb(0x14f)](_0x122962,_0x20f1cb(0x178));if(existsSync(_0x367110))try{const _0x357d78=JSON[_0x20f1cb(0x143)](readFileSync(_0x367110,_0x20f1cb(0x171)));_0x3ff32c=_0x357d78['llm_project'],_0x5f4896=_0x122962,console[_0x20f1cb(0x181)](a12_0x20c898[_0x20f1cb(0x1b6)]('Using\x20project\x20from\x20'+_0x367110+':\x20'+_0x3ff32c));}catch{_0x3ff32c=_0x122962;}else _0x3ff32c=_0x122962;}else{if(_0x381f7d)try{const _0x28f9b7=JSON[_0x20f1cb(0x143)](readFileSync(_0x381f7d,_0x20f1cb(0x171)));_0x3ff32c=_0x28f9b7['llm_project'],_0x5f4896=a12_0x362ccb['dirname'](_0x381f7d),console['log'](a12_0x20c898[_0x20f1cb(0x1b6)](_0x20f1cb(0x15a)+_0x3ff32c));}catch{_0x3ff32c=_0x1ba2de;}else _0x3ff32c=_0x1ba2de;}if(!_0x3ff32c)return console['log'](a12_0x20c898[_0x20f1cb(0x187)](_0x20f1cb(0x1b4))),console[_0x20f1cb(0x181)](_0x20f1cb(0x1ce)),console[_0x20f1cb(0x181)]('\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[_0x20f1cb(0x181)](_0x20f1cb(0x167)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x1c0610){const {data:_0x5df16c}=await withSpinner(_0x20f1cb(0x170)+_0x1c0610+'\x22\x20from\x20project\x20\x22'+_0x3ff32c+_0x20f1cb(0x1b2),()=>_0x2f8a04['llm']['pullAgent'](_0x3ff32c,_0x1c0610,_0x20ec60,{'dryRun':_0x2cb99d,'force':_0xf1f934}));if(_0x2cb99d)return console['log'](a12_0x20c898[_0x20f1cb(0x187)](_0x20f1cb(0x139))),console['log'](_0x20f1cb(0x157)+_0x5df16c['agentName']),console[_0x20f1cb(0x181)](_0x20f1cb(0x160)+_0x5df16c['outputPath']),_0x5df16c[_0x20f1cb(0x180)]&&(console[_0x20f1cb(0x181)]('\x0aChanges:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x5df16c[_0x20f1cb(0x180)]),console[_0x20f1cb(0x181)]('─'[_0x20f1cb(0x196)](0x3c))),0x0;return console['log'](a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x1ca))),console[_0x20f1cb(0x181)]('Agent:\x20'+_0x5df16c[_0x20f1cb(0x1c4)]),console[_0x20f1cb(0x181)]('Output:\x20'+_0x5df16c[_0x20f1cb(0x161)]),console[_0x20f1cb(0x181)]('Status:\x20'+(_0x5df16c['isNew']?a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x1ae)):_0x5df16c['hasChanges']?a12_0x20c898[_0x20f1cb(0x187)](_0x20f1cb(0x162)):a12_0x20c898['gray'](_0x20f1cb(0x141)))),0x0;}const _0x2600a8=_0x5f4896||_0x20ec60,{data:_0x3090da}=await withSpinner(_0x20f1cb(0x19d)+_0x3ff32c+'\x22...',()=>_0x2f8a04[_0x20f1cb(0x165)]['pullProject'](_0x3ff32c,_0x2600a8,{'dryRun':!![]})),_0x32a9df=_0x3090da[_0x20f1cb(0x1d1)]['agents'][_0x20f1cb(0x1ae)]+_0x3090da['counts'][_0x20f1cb(0x17e)][_0x20f1cb(0x1ae)]+_0x3090da['counts']['textKnowledgeBases']['new']+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x1ad)][_0x20f1cb(0x1ae)],_0x14b2b2=_0x3090da['counts'][_0x20f1cb(0x155)][_0x20f1cb(0x162)]+_0x3090da[_0x20f1cb(0x1d1)]['knowledgeBases'][_0x20f1cb(0x162)]+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x199)][_0x20f1cb(0x162)]+_0x3090da['counts'][_0x20f1cb(0x1ad)][_0x20f1cb(0x162)],_0x14159b=_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x155)][_0x20f1cb(0x141)]+_0x3090da['counts'][_0x20f1cb(0x17e)][_0x20f1cb(0x141)]+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x199)][_0x20f1cb(0x141)]+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x1ad)][_0x20f1cb(0x141)];console[_0x20f1cb(0x181)](_0x20f1cb(0x1bd)+_0x3090da[_0x20f1cb(0x1b0)]+'\x27:'),console[_0x20f1cb(0x181)]('\x20\x20'+a12_0x20c898[_0x20f1cb(0x16d)]('+\x20'+_0x32a9df+_0x20f1cb(0x1c5))+_0x20f1cb(0x13d)+a12_0x20c898['yellow']('~\x20'+_0x14b2b2+_0x20f1cb(0x149))+'\x20|\x20'+a12_0x20c898[_0x20f1cb(0x1b6)]('=\x20'+_0x14159b+_0x20f1cb(0x1a3))),console[_0x20f1cb(0x181)](_0x20f1cb(0x1a0)+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x155)])),console[_0x20f1cb(0x181)](_0x20f1cb(0x1a9)+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)]['knowledgeBases'])),console[_0x20f1cb(0x181)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x199)])),console[_0x20f1cb(0x181)](_0x20f1cb(0x163)+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)]['prompts'])),console['log'](_0x20f1cb(0x1c1)+a12_0x20c898[_0x20f1cb(0x19e)](_0x3090da[_0x20f1cb(0x1c9)])),displayDiffs(_0x3090da[_0x20f1cb(0x155)],_0x3090da[_0x20f1cb(0x17e)],_0x3090da[_0x20f1cb(0x199)],_0x3090da[_0x20f1cb(0x1ad)]);if(_0x2cb99d)return console[_0x20f1cb(0x181)](a12_0x20c898[_0x20f1cb(0x187)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x32a9df===0x0&&_0x14b2b2===0x0)return console['log'](a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x145))),saveSessionContext({'llm_project':_0x3090da[_0x20f1cb(0x1b0)]},_0x50b464[_0x20f1cb(0x150)]),console[_0x20f1cb(0x181)](a12_0x20c898['green'](_0x20f1cb(0x1cc)+a12_0x20c898[_0x20f1cb(0x1b6)](_0x20f1cb(0x1a7))+_0x20f1cb(0x164)+a12_0x20c898[_0x20f1cb(0x19e)](_0x3090da[_0x20f1cb(0x1b0)]))),0x0;if(!_0x58d8c9&&!_0xf1f934){const _0x2bcf13=await confirmKey(_0x20f1cb(0x184)+(_0x32a9df+_0x14b2b2)+'\x20files?');if(!_0x2bcf13)return console['log'](_0x20f1cb(0x1be)),0x0;}const {data:_0x8b3fb9}=await withSpinner(_0x20f1cb(0x1cf),()=>_0x2f8a04[_0x20f1cb(0x165)][_0x20f1cb(0x16e)](_0x3ff32c,_0x2600a8,{'force':_0xf1f934}));return console[_0x20f1cb(0x181)](a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x1c2)+(_0x32a9df+_0x14b2b2)+_0x20f1cb(0x183)+_0x8b3fb9[_0x20f1cb(0x1c9)])),saveSessionContext({'llm_project':_0x8b3fb9[_0x20f1cb(0x1b0)]},_0x50b464['session']),console[_0x20f1cb(0x181)](a12_0x20c898['green'](_0x20f1cb(0x1cc)+a12_0x20c898['dim'](_0x20f1cb(0x1a7))+_0x20f1cb(0x164)+a12_0x20c898['cyan'](_0x8b3fb9[_0x20f1cb(0x1b0)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a12_0x3d7ff1(0x17a)]='agent:clone';[a12_0x3d7ff1(0x136)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a12_0x3d7ff1(0x14b)](_0x9729eb){const _0x54c32a=a12_0x3d7ff1,{options:_0xa20688,args:_0x53125c,tdx:_0x460731}=_0x9729eb,_0x410d0e=_0x53125c[0x0],_0x5d2933=_0xa20688['name'],_0x55dceb=_0xa20688[_0x54c32a(0x194)],_0x428427=_0xa20688[_0x54c32a(0x1a2)],_0x518dfd=_0xa20688[_0x54c32a(0x144)],_0x4bbb9=_0xa20688[_0x54c32a(0x1c3)];let _0x33f0c8;const _0x4d8232=findAgentConfigPath(process['cwd']());if(_0x410d0e){const _0x1a3d18=a12_0x362ccb['join'](_0x410d0e,_0x54c32a(0x178));existsSync(_0x1a3d18)?(_0x33f0c8=_0x410d0e,console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)](_0x54c32a(0x1bb)+_0x410d0e))):_0x33f0c8=_0x410d0e;}else{if(_0x4d8232)_0x33f0c8=a12_0x362ccb[_0x54c32a(0x156)](_0x4d8232),console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)](_0x54c32a(0x137)+_0x33f0c8));else{if(_0x4bbb9){const _0x502b74=normalizeName(_0x4bbb9),_0x293645=a12_0x362ccb['join'](process[_0x54c32a(0x1c7)](),'agents',_0x502b74,_0x54c32a(0x178));if(existsSync(_0x293645))_0x33f0c8=a12_0x362ccb[_0x54c32a(0x156)](_0x293645),console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)]('Using\x20local\x20project:\x20'+_0x33f0c8));else{const _0x1798d2=_0xa20688[_0x54c32a(0x13b)];if(_0x1798d2)throw new SDKError(ErrorCode[_0x54c32a(0x1bc)],_0x54c32a(0x1ba)+_0x4bbb9+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x54c32a(0x18d)+_0x54c32a(0x14d)+(_0x54c32a(0x169)+_0x4bbb9+'\x0a')+(_0x54c32a(0x1cb)+_0x502b74+'\x20--name\x20'+(_0x5d2933||_0x54c32a(0x16c))+_0x54c32a(0x18a)+_0x1798d2)});_0x33f0c8=_0x4bbb9,console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)](_0x54c32a(0x14e)+_0x4bbb9));}}}}if(!_0x33f0c8)return console[_0x54c32a(0x181)](a12_0x20c898['yellow'](_0x54c32a(0x152))),console[_0x54c32a(0x181)](_0x54c32a(0x1c0)),console[_0x54c32a(0x181)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x54c32a(0x181)](_0x54c32a(0x186)),console[_0x54c32a(0x181)](_0x54c32a(0x19a)),0x1;if(!_0x5d2933)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x54c32a(0x168),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x428427&&!_0x55dceb){const _0x353bd2=await confirmKey(_0x54c32a(0x1c8)+_0x33f0c8+_0x54c32a(0x13e)+_0x5d2933+'\x22?');if(!_0x353bd2)return console[_0x54c32a(0x181)]('Clone\x20cancelled'),0x0;}const {data:_0x3139ff}=await withSpinner('Cloning\x20\x22'+_0x33f0c8+'\x22\x20to\x20\x22'+_0x5d2933+_0x54c32a(0x1b2),()=>_0x460731[_0x54c32a(0x165)][_0x54c32a(0x188)](_0x33f0c8,_0x5d2933,{'dryRun':_0x55dceb}));if(_0x55dceb)return console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x187)](_0x54c32a(0x17c))),console[_0x54c32a(0x181)]('Source:\x20'+_0x3139ff['sourceProjectName']),console['log'](_0x54c32a(0x1cd)+_0x5d2933),console[_0x54c32a(0x181)](_0x54c32a(0x135)),console[_0x54c32a(0x181)](_0x54c32a(0x1a0)+_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x155)][_0x54c32a(0x1b1)]),console[_0x54c32a(0x181)]('\x20\x20Knowledge\x20Bases:\x20'+_0x3139ff['counts'][_0x54c32a(0x17e)][_0x54c32a(0x1b1)]),console[_0x54c32a(0x181)](_0x54c32a(0x163)+_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x1ad)][_0x54c32a(0x1b1)]),0x0;const _0x2c26f8=_0x3139ff[_0x54c32a(0x1d1)]['agents'][_0x54c32a(0x16a)]>0x0||_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x17e)][_0x54c32a(0x16a)]>0x0||_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x1ad)][_0x54c32a(0x16a)]>0x0;_0x2c26f8?console[_0x54c32a(0x181)](a12_0x20c898['yellow'](_0x54c32a(0x19c))):console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x16d)](_0x54c32a(0x140)));console['log'](_0x54c32a(0x192)+_0x3139ff['sourceProjectName']),console['log']('New\x20project:\x20'+_0x3139ff[_0x54c32a(0x138)]),console[_0x54c32a(0x181)](_0x54c32a(0x1d0)+_0x3139ff[_0x54c32a(0x154)]),console['log'](),console[_0x54c32a(0x181)](_0x54c32a(0x14c)),console['log'](_0x54c32a(0x1a0)+formatCountSummary(_0x3139ff['counts']['agents'])),console[_0x54c32a(0x181)](_0x54c32a(0x1a9)+formatCountSummary(_0x3139ff[_0x54c32a(0x1d1)]['knowledgeBases'])),console['log'](_0x54c32a(0x163)+formatCountSummary(_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x1ad)]));if(_0x2c26f8){console[_0x54c32a(0x181)](),console['log'](a12_0x20c898[_0x54c32a(0x197)](_0x54c32a(0x1a1)));for(const _0x1c56bc of _0x3139ff[_0x54c32a(0x155)]){_0x1c56bc[_0x54c32a(0x1b5)]===_0x54c32a(0x142)&&console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x197)](_0x54c32a(0x166)+_0x1c56bc[_0x54c32a(0x1c4)]+_0x54c32a(0x1a6)+_0x1c56bc[_0x54c32a(0x142)]));}for(const _0x1a16ef of _0x3139ff[_0x54c32a(0x17e)]){_0x1a16ef['action']===_0x54c32a(0x142)&&console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x197)](_0x54c32a(0x182)+_0x1a16ef[_0x54c32a(0x17a)]+'\x22:\x20'+_0x1a16ef[_0x54c32a(0x142)]));}for(const _0x4d7653 of _0x3139ff[_0x54c32a(0x1ad)]){_0x4d7653[_0x54c32a(0x1b5)]===_0x54c32a(0x142)&&console[_0x54c32a(0x181)](a12_0x20c898['red']('\x20\x20Prompt\x20\x22'+_0x4d7653['name']+_0x54c32a(0x1a6)+_0x4d7653['error']));}return 0x1;}saveSessionContext({'llm_project':_0x3139ff[_0x54c32a(0x138)]},_0xa20688[_0x54c32a(0x150)]),console[_0x54c32a(0x181)](),console[_0x54c32a(0x181)](a12_0x20c898['green']('Context\x20set:\x20'+a12_0x20c898['dim']('llm_project')+_0x54c32a(0x164)+a12_0x20c898[_0x54c32a(0x19e)](_0x3139ff[_0x54c32a(0x138)])));const _0x44e87f=getLLMProjectUrl(_0x518dfd,_0x3139ff[_0x54c32a(0x154)]);return console['log'](_0x54c32a(0x153)+a12_0x20c898[_0x54c32a(0x19e)](_0x44e87f)),0x0;}}export class AgentPushCommand extends BaseCommand{[a12_0x3d7ff1(0x17a)]='agent:push';[a12_0x3d7ff1(0x136)]=a12_0x3d7ff1(0x19b);async[a12_0x3d7ff1(0x14b)](_0x5e64c3){const _0x99b0c1=a12_0x3d7ff1,{options:_0x4845a5,args:_0x4c0b8f,tdx:_0xb7be7c}=_0x5e64c3;let _0x3fee15=_0x4c0b8f[0x0]||process[_0x99b0c1(0x1c7)]();const _0x5a2e49=_0x4845a5[_0x99b0c1(0x194)],_0x401cc7=_0x4845a5[_0x99b0c1(0x195)],_0x50bccc=_0x4845a5[_0x99b0c1(0x1a2)],_0xc43ea5=_0x4845a5['site'],_0x55bba6=a12_0x362ccb[_0x99b0c1(0x14f)](_0x3fee15,_0x99b0c1(0x1bf)),_0x515aee=existsSync(_0x55bba6);if(_0x515aee){const {data:_0x33f668}=await withSpinner(_0x99b0c1(0x15c)+_0x3fee15+_0x99b0c1(0x1b2),()=>_0xb7be7c[_0x99b0c1(0x165)][_0x99b0c1(0x1a5)](_0x3fee15,{'dryRun':_0x5a2e49,'force':_0x401cc7}));if(_0x5a2e49)return console['log'](a12_0x20c898[_0x99b0c1(0x187)](_0x99b0c1(0x17c))),console[_0x99b0c1(0x181)](_0x99b0c1(0x146)+_0x33f668[_0x99b0c1(0x1c4)]),0x0;if(_0x33f668[_0x99b0c1(0x1b5)]==='error')return console[_0x99b0c1(0x181)](a12_0x20c898['red'](_0x99b0c1(0x177)+_0x33f668[_0x99b0c1(0x142)])),0x1;console[_0x99b0c1(0x181)](a12_0x20c898['green'](_0x99b0c1(0x189)+_0x33f668['action']+_0x99b0c1(0x13c))),console[_0x99b0c1(0x181)](_0x99b0c1(0x1ac)+_0x33f668[_0x99b0c1(0x1c4)]);if(_0x33f668[_0x99b0c1(0x16b)]&&_0x33f668[_0x99b0c1(0x1b8)]){const _0x22b09c=getLLMAgentChatUrl(_0xc43ea5,_0x33f668[_0x99b0c1(0x1b8)],_0x33f668[_0x99b0c1(0x16b)]);console[_0x99b0c1(0x181)](_0x99b0c1(0x18f)+a12_0x20c898[_0x99b0c1(0x19e)](_0x22b09c));}return 0x0;}let _0x536e25=a12_0x362ccb[_0x99b0c1(0x14f)](_0x3fee15,_0x99b0c1(0x178));if(!existsSync(_0x536e25)){const _0xca1659=findAgentConfigPath(_0x3fee15);if(_0xca1659)_0x3fee15=a12_0x362ccb[_0x99b0c1(0x156)](_0xca1659),_0x536e25=_0xca1659,console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x1b6)]('Using\x20project:\x20'+_0x3fee15));else{const _0x5132c4=_0x4845a5['llmProject'];if(_0x5132c4){const _0x5b3f6d=normalizeName(_0x5132c4),_0x1cf0b1=a12_0x362ccb[_0x99b0c1(0x14f)](_0x3fee15,_0x99b0c1(0x155)),_0x4deb50=a12_0x362ccb[_0x99b0c1(0x14f)](_0x1cf0b1,_0x5b3f6d,_0x99b0c1(0x178));existsSync(_0x4deb50)&&(_0x3fee15=a12_0x362ccb[_0x99b0c1(0x156)](_0x4deb50),_0x536e25=_0x4deb50,console['log'](a12_0x20c898[_0x99b0c1(0x1b6)](_0x99b0c1(0x15a)+_0x3fee15)));}if(!existsSync(_0x536e25)){let _0x7ced2d=_0x99b0c1(0x13f);_0x5132c4&&(_0x7ced2d=_0x99b0c1(0x17b)+_0x5132c4+_0x99b0c1(0x16f)+(_0x99b0c1(0x148)+_0x5132c4+_0x99b0c1(0x15b)));throw new SDKError(ErrorCode[_0x99b0c1(0x1bc)],_0x99b0c1(0x176)+_0x3fee15,undefined,{'helpText':_0x7ced2d});}}}const {data:_0x8a4255}=await withSpinner(_0x99b0c1(0x172),()=>_0xb7be7c[_0x99b0c1(0x165)][_0x99b0c1(0x18e)](_0x3fee15,{'dryRun':!![]})),_0x108f16=_0x8a4255['counts'][_0x99b0c1(0x155)]['errors']>0x0;if(_0x108f16){console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x1b3)));for(const _0x2a97cc of _0x8a4255[_0x99b0c1(0x155)]){_0x2a97cc[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x166)+_0x2a97cc[_0x99b0c1(0x1c4)]+'\x22:\x20'+_0x2a97cc[_0x99b0c1(0x142)]));}return 0x1;}const _0x1b20cf=_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x155)]['created']+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x17e)][_0x99b0c1(0x1b1)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x199)][_0x99b0c1(0x1b1)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x1ad)][_0x99b0c1(0x1b1)],_0x296b65=_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x155)][_0x99b0c1(0x162)]+_0x8a4255[_0x99b0c1(0x1d1)]['knowledgeBases'][_0x99b0c1(0x162)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x199)][_0x99b0c1(0x162)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x1ad)][_0x99b0c1(0x162)],_0x47ef83=_0x8a4255['counts'][_0x99b0c1(0x155)]['unchanged']+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x17e)][_0x99b0c1(0x141)]+_0x8a4255['counts']['textKnowledgeBases']['unchanged']+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x1ad)][_0x99b0c1(0x141)];console[_0x99b0c1(0x181)]('\x0aPush\x20summary\x20for\x20\x27'+_0x8a4255[_0x99b0c1(0x1b0)]+'\x27:'),console['log']('\x20\x20'+a12_0x20c898['green']('+\x20'+_0x1b20cf+_0x99b0c1(0x1c5))+_0x99b0c1(0x13d)+a12_0x20c898[_0x99b0c1(0x187)]('~\x20'+_0x296b65+_0x99b0c1(0x149))+_0x99b0c1(0x13d)+a12_0x20c898[_0x99b0c1(0x1b6)]('=\x20'+_0x47ef83+_0x99b0c1(0x1a3))),console[_0x99b0c1(0x181)](_0x99b0c1(0x1a0)+formatCountSummary(_0x8a4255[_0x99b0c1(0x1d1)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x17e)])),console[_0x99b0c1(0x181)](_0x99b0c1(0x191)+formatCountSummary(_0x8a4255[_0x99b0c1(0x1d1)]['textKnowledgeBases'])),console['log'](_0x99b0c1(0x163)+formatCountSummary(_0x8a4255['counts']['prompts'])),console['log'](_0x99b0c1(0x1aa)+a12_0x20c898['cyan'](_0x3fee15)),displayDiffs(_0x8a4255[_0x99b0c1(0x155)],_0x8a4255['knowledgeBases'],_0x8a4255['textKnowledgeBases'],_0x8a4255[_0x99b0c1(0x1ad)]);if(_0x5a2e49)return console['log'](a12_0x20c898[_0x99b0c1(0x187)](_0x99b0c1(0x15f))),0x0;if(_0x1b20cf===0x0&&_0x296b65===0x0){console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x16d)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x5e2f2a=getLLMProjectUrl(_0xc43ea5,_0x8a4255['projectId']);return console['log'](_0x99b0c1(0x153)+a12_0x20c898[_0x99b0c1(0x19e)](_0x5e2f2a)),0x0;}if(!_0x50bccc&&!_0x401cc7){const _0x3c7374=await confirmKey(_0x99b0c1(0x1c6)+(_0x1b20cf+_0x296b65)+'\x20resources?');if(!_0x3c7374)return console[_0x99b0c1(0x181)](_0x99b0c1(0x18b)),0x0;}const {data:_0x1f35ca}=await withSpinner(_0x99b0c1(0x17d),()=>_0xb7be7c['llm'][_0x99b0c1(0x18e)](_0x3fee15,{'force':_0x401cc7})),_0xc6e943=_0x1f35ca[_0x99b0c1(0x1d1)][_0x99b0c1(0x155)][_0x99b0c1(0x16a)]>0x0||_0x1f35ca[_0x99b0c1(0x1d1)]['knowledgeBases'][_0x99b0c1(0x16a)]>0x0||_0x1f35ca['counts']['textKnowledgeBases'][_0x99b0c1(0x16a)]>0x0||_0x1f35ca['counts'][_0x99b0c1(0x1ad)][_0x99b0c1(0x16a)]>0x0;if(_0xc6e943){console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x187)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x1a1)));for(const _0x3f050c of _0x1f35ca[_0x99b0c1(0x155)]){_0x3f050c[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)]('\x20\x20Agent\x20\x22'+_0x3f050c[_0x99b0c1(0x1c4)]+_0x99b0c1(0x1a6)+_0x3f050c['error']));}for(const _0x411d34 of _0x1f35ca[_0x99b0c1(0x17e)]){_0x411d34[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x182)+_0x411d34[_0x99b0c1(0x17a)]+_0x99b0c1(0x1a6)+_0x411d34['error']));}for(const _0x35cd1c of _0x1f35ca[_0x99b0c1(0x199)]){_0x35cd1c[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x158)+_0x35cd1c[_0x99b0c1(0x17a)]+_0x99b0c1(0x1a6)+_0x35cd1c[_0x99b0c1(0x142)]));}for(const _0x3aec37 of _0x1f35ca['prompts']){_0x3aec37[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x173)+_0x3aec37[_0x99b0c1(0x17a)]+'\x22:\x20'+_0x3aec37[_0x99b0c1(0x142)]));}return 0x1;}console[_0x99b0c1(0x181)](a12_0x20c898['green']('\x0a✔\x20Pushed\x20'+(_0x1b20cf+_0x296b65)+'\x20resources\x20to\x20\x27'+_0x1f35ca[_0x99b0c1(0x1b0)]+'\x27'));const _0xa566d2=getLLMProjectUrl(_0xc43ea5,_0x1f35ca[_0x99b0c1(0x1b8)]);return console[_0x99b0c1(0x181)](_0x99b0c1(0x153)+a12_0x20c898[_0x99b0c1(0x19e)](_0xa566d2)),0x0;}}
@@ -1 +1 @@
1
- const a13_0x705e96=a13_0x216a;(function(_0x363c3f,_0x1985a7){const _0x56321e=a13_0x216a,_0x46ec8f=_0x363c3f();while(!![]){try{const _0x2f9178=-parseInt(_0x56321e(0x214))/0x1*(-parseInt(_0x56321e(0x222))/0x2)+-parseInt(_0x56321e(0x20e))/0x3+-parseInt(_0x56321e(0x224))/0x4+parseInt(_0x56321e(0x1ff))/0x5+parseInt(_0x56321e(0x1f0))/0x6+parseInt(_0x56321e(0x1fe))/0x7+parseInt(_0x56321e(0x217))/0x8*(-parseInt(_0x56321e(0x1fd))/0x9);if(_0x2f9178===_0x1985a7)break;else _0x46ec8f['push'](_0x46ec8f['shift']());}catch(_0x383128){_0x46ec8f['push'](_0x46ec8f['shift']());}}}(a13_0x4118,0xd6372));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';function a13_0x216a(_0x2c46b3,_0x2bc4d8){_0x2c46b3=_0x2c46b3-0x1e7;const _0x411817=a13_0x4118();let _0x216a86=_0x411817[_0x2c46b3];return _0x216a86;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a13_0x705e96(0x1ed),a13_0x705e96(0x1ec),a13_0x705e96(0x1f8),'set-cookie','set-cookie2','x-xsrf-token',a13_0x705e96(0x210),a13_0x705e96(0x201)]);function a13_0x4118(){const _0x113817=['8013500yZDlEq','\x0aStack\x20trace:\x0a','x-trino-user','startsWith','error','has','Invalid\x20header\x20format:\x20\x22','length','PUT','indexOf','.\x20Valid\x20types:\x20','api','status','stack','POST','2747994TbuARg','toUpperCase','x-auth-token','type','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Error:\x20','797pPiJFd','entries','output','29956968rujZhc','execute','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','GET','Endpoint\x20must\x20start\x20with\x20/:\x20','toLowerCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','readBodyFromFile','name','noColor','headers','3716UCevyi','substring','2433108NzvAue','join','Results\x20saved\x20to\x20','color','workflow','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','method','proxy-authorization','authorization','includes','description','8826156CdFjTY','verbose','trim','Invalid\x20HTTP\x20method:\x20','log','DELETE','site','data','cookie','.\x20Valid\x20methods:\x20','\x22.\x20','file','request','9eUXKJZ','11142390pKioYo'];a13_0x4118=function(){return _0x113817;};return a13_0x4118();}function isSensitiveHeader(_0x29c207){const _0x350892=a13_0x705e96;return SENSITIVE_HEADERS[_0x350892(0x204)](_0x29c207[_0x350892(0x21c)]());}function parseHeader(_0x143c07){const _0x281b83=a13_0x705e96,_0x13a94d=_0x143c07[_0x281b83(0x208)](':');if(_0x13a94d===-0x1)throw new Error(_0x281b83(0x205)+_0x143c07+_0x281b83(0x1fa)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x3e39a0=_0x143c07[_0x281b83(0x223)](0x0,_0x13a94d)[_0x281b83(0x1f2)](),_0x179ce2=_0x143c07[_0x281b83(0x223)](_0x13a94d+0x1)[_0x281b83(0x1f2)]();if(!_0x3e39a0)throw new Error(_0x281b83(0x219)+_0x143c07+'\x22');return[_0x3e39a0,_0x179ce2];}export class ApiCommand extends BaseCommand{[a13_0x705e96(0x21f)]='api';[a13_0x705e96(0x1ef)]=a13_0x705e96(0x212);['validate'](_0x352251){const _0x3379bf=a13_0x705e96,{args:_0x204cac,options:_0x12aef7}=_0x352251,_0x39f16b=_0x12aef7;if(_0x204cac[_0x3379bf(0x206)]===0x0)return _0x3379bf(0x21d);const _0x58f7c3=_0x204cac[0x0];if(!_0x58f7c3[_0x3379bf(0x202)]('/'))return _0x3379bf(0x21b)+_0x58f7c3;const _0x483713=_0x39f16b[_0x3379bf(0x1f7)],_0xad5fbf=_0x39f16b[_0x3379bf(0x1fb)];if(_0x483713&&_0xad5fbf)return _0x3379bf(0x1ea);const _0x5982e6=_0x39f16b[_0x3379bf(0x1eb)]||_0x3379bf(0x21a),_0x3885ff=[_0x3379bf(0x21a),_0x3379bf(0x20d),_0x3379bf(0x207),_0x3379bf(0x1f5),'PATCH'];if(!_0x3885ff[_0x3379bf(0x1ee)](_0x5982e6['toUpperCase']()))return _0x3379bf(0x1f3)+_0x5982e6+_0x3379bf(0x1f9)+_0x3885ff[_0x3379bf(0x225)](',\x20');const _0x272a04=_0x39f16b[_0x3379bf(0x211)]||'td',_0x546bba=['td','cdp',_0x3379bf(0x1e9),'trino','llm'];if(!_0x546bba['includes'](_0x272a04))return'Invalid\x20API\x20type:\x20'+_0x272a04+_0x3379bf(0x209)+_0x546bba[_0x3379bf(0x225)](',\x20');return undefined;}async[a13_0x705e96(0x218)](_0x3941dd){const _0x5b90e6=a13_0x705e96,{options:_0x40b521,args:_0x18c33e,tdx:_0x4cfca0}=_0x3941dd,_0x920060=_0x40b521,_0x2c275f=_0x18c33e[0x0],_0x2df3ce=(_0x920060[_0x5b90e6(0x1eb)]||'GET')[_0x5b90e6(0x20f)](),_0x1b977b=_0x920060['data'],_0x5528a=_0x920060[_0x5b90e6(0x1fb)],_0x256e96=_0x920060['header'],_0x4451a6=_0x920060[_0x5b90e6(0x211)]||'td';try{const _0x3b3bdf={};if(_0x256e96){const _0x27b3c0=Array['isArray'](_0x256e96)?_0x256e96:[_0x256e96];for(const _0x5a6b82 of _0x27b3c0){const [_0x33a9fb,_0x18101d]=parseHeader(_0x5a6b82);_0x3b3bdf[_0x33a9fb]=_0x18101d;}}let _0x1c319c;if(_0x1b977b)_0x1c319c=_0x1b977b;else{if(_0x5528a)try{_0x1c319c=RawAPI[_0x5b90e6(0x21e)](_0x5528a);}catch(_0x201626){return console['error']('Error:\x20'+(_0x201626 instanceof Error?_0x201626['message']:String(_0x201626))),0x1;}}const _0x5c727b={'method':_0x2df3ce,'apiType':_0x4451a6,'includeHeaders':_0x40b521['verbose']};_0x1c319c&&(_0x5c727b['body']=_0x1c319c);Object['keys'](_0x3b3bdf)[_0x5b90e6(0x206)]>0x0&&(_0x5c727b[_0x5b90e6(0x221)]=_0x3b3bdf);if(_0x40b521[_0x5b90e6(0x1f1)]){const _0x54b928=resolveSite(_0x40b521[_0x5b90e6(0x1f6)]),_0x2e1d33=getEndpoint(_0x54b928,_0x4451a6),_0x5e6a3a=''+_0x2e1d33+_0x2c275f;console[_0x5b90e6(0x203)]('>\x20'+_0x2df3ce+'\x20'+_0x5e6a3a);const _0x13e359=getAuthHeaders(_0x54b928),_0x198033={..._0x13e359,..._0x3b3bdf};for(const [_0x25520a,_0x3fe662]of Object[_0x5b90e6(0x215)](_0x198033)){!isSensitiveHeader(_0x25520a)&&console['error']('>\x20'+_0x25520a+':\x20'+_0x3fe662);}_0x1c319c&&console['error']('>'),console[_0x5b90e6(0x203)]('');}const _0x596df9=await _0x4cfca0[_0x5b90e6(0x20a)][_0x5b90e6(0x1fc)](_0x2c275f,_0x5c727b);if(_0x40b521[_0x5b90e6(0x1f1)]&&_0x596df9[_0x5b90e6(0x221)]){console['error']('<\x20HTTP/1.1\x20'+_0x596df9[_0x5b90e6(0x20b)]);for(const [_0x4670f6,_0x2daf4b]of Object[_0x5b90e6(0x215)](_0x596df9['headers'])){!isSensitiveHeader(_0x4670f6)&&console[_0x5b90e6(0x203)]('<\x20'+_0x4670f6+':\x20'+_0x2daf4b);}console['error']('');}const _0x58062b=Boolean(_0x40b521['output']),_0x2a48cf={'color':_0x40b521['color'],'noColor':_0x40b521[_0x5b90e6(0x220)]||_0x58062b&&!_0x40b521[_0x5b90e6(0x1e8)]},_0x231c6c=colorizeJSON(_0x596df9[_0x5b90e6(0x1f7)],_0x2a48cf);return _0x40b521[_0x5b90e6(0x216)]?(writeFileSync(_0x40b521[_0x5b90e6(0x216)],_0x231c6c),console[_0x5b90e6(0x203)](_0x5b90e6(0x1e7)+_0x40b521['output'])):console[_0x5b90e6(0x1f4)](_0x231c6c),0x0;}catch(_0x3dc25d){return _0x3dc25d instanceof Error?(console[_0x5b90e6(0x203)](_0x5b90e6(0x213)+_0x3dc25d['message']),_0x40b521[_0x5b90e6(0x1f1)]&&_0x3dc25d[_0x5b90e6(0x20c)]&&console['error'](_0x5b90e6(0x200)+_0x3dc25d[_0x5b90e6(0x20c)])):console['error']('Error:\x20'+String(_0x3dc25d)),0x1;}}}
1
+ const a13_0x198657=a13_0x5d13;(function(_0x2e6c3b,_0x11ffff){const _0x13bd50=a13_0x5d13,_0x1612dc=_0x2e6c3b();while(!![]){try{const _0x52c57f=-parseInt(_0x13bd50(0x196))/0x1*(-parseInt(_0x13bd50(0x192))/0x2)+-parseInt(_0x13bd50(0x190))/0x3+-parseInt(_0x13bd50(0x182))/0x4+parseInt(_0x13bd50(0x16c))/0x5+parseInt(_0x13bd50(0x183))/0x6*(parseInt(_0x13bd50(0x17c))/0x7)+parseInt(_0x13bd50(0x165))/0x8+-parseInt(_0x13bd50(0x186))/0x9*(parseInt(_0x13bd50(0x184))/0xa);if(_0x52c57f===_0x11ffff)break;else _0x1612dc['push'](_0x1612dc['shift']());}catch(_0x2db3c8){_0x1612dc['push'](_0x1612dc['shift']());}}}(a13_0x39f2,0x6b5fa));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a13_0x39f2(){const _0x376f8c=['readBodyFromFile','error','14TwBLxw','execute','log','Invalid\x20HTTP\x20method:\x20','api','trim','2389100VQlJSF','2563374ncjIiO','30QvPIiA','data','4007169Istmel','site','x-xsrf-token','POST','x-trino-user','message','output','workflow','method','cookie','158121SksbXo','trino','2OXulCq','authorization','has','name','827557IcryVM','color','set-cookie','file','type','join','\x22.\x20','request','x-auth-token','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Invalid\x20header\x20format:\x20\x22','body','isArray','entries','<\x20HTTP/1.1\x20','verbose','substring','443520fiWeCZ','noColor','startsWith','Error:\x20','.\x20Valid\x20methods:\x20','length','Invalid\x20API\x20type:\x20','3440260vOKDlH','toUpperCase','PUT','description','stack','includes','validate','header','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','keys','proxy-authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','headers','GET'];a13_0x39f2=function(){return _0x376f8c;};return a13_0x39f2();}import{writeFileSync}from'fs';function a13_0x5d13(_0x3989eb,_0x1a2b40){_0x3989eb=_0x3989eb-0x15a;const _0x39f27a=a13_0x39f2();let _0x5d13a1=_0x39f27a[_0x3989eb];return _0x5d13a1;}import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a13_0x198657(0x193),a13_0x198657(0x176),a13_0x198657(0x18f),a13_0x198657(0x198),'set-cookie2',a13_0x198657(0x188),a13_0x198657(0x15c),a13_0x198657(0x18a)]);function isSensitiveHeader(_0x3c5c59){const _0x4f0d59=a13_0x198657;return SENSITIVE_HEADERS[_0x4f0d59(0x194)](_0x3c5c59['toLowerCase']());}function parseHeader(_0x1f98cf){const _0x427300=a13_0x198657,_0x3f9412=_0x1f98cf['indexOf'](':');if(_0x3f9412===-0x1)throw new Error(_0x427300(0x15e)+_0x1f98cf+_0x427300(0x15a)+_0x427300(0x174));const _0x3c3957=_0x1f98cf[_0x427300(0x164)](0x0,_0x3f9412)[_0x427300(0x181)](),_0x5e6110=_0x1f98cf[_0x427300(0x164)](_0x3f9412+0x1)['trim']();if(!_0x3c3957)throw new Error(_0x427300(0x177)+_0x1f98cf+'\x22');return[_0x3c3957,_0x5e6110];}export class ApiCommand extends BaseCommand{[a13_0x198657(0x195)]=a13_0x198657(0x180);[a13_0x198657(0x16f)]=a13_0x198657(0x15d);[a13_0x198657(0x172)](_0x513f69){const _0x329322=a13_0x198657,{args:_0x5addcf,options:_0x28130d}=_0x513f69,_0x14d2cc=_0x28130d;if(_0x5addcf[_0x329322(0x16a)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x5ead13=_0x5addcf[0x0];if(!_0x5ead13[_0x329322(0x167)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x5ead13;const _0x49c826=_0x14d2cc['data'],_0x2986a2=_0x14d2cc[_0x329322(0x199)];if(_0x49c826&&_0x2986a2)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x599e2e=_0x14d2cc[_0x329322(0x18e)]||_0x329322(0x179),_0x162351=['GET',_0x329322(0x189),_0x329322(0x16e),'DELETE','PATCH'];if(!_0x162351[_0x329322(0x171)](_0x599e2e[_0x329322(0x16d)]()))return _0x329322(0x17f)+_0x599e2e+_0x329322(0x169)+_0x162351['join'](',\x20');const _0x3be3bb=_0x14d2cc[_0x329322(0x19a)]||'td',_0x578018=['td','cdp',_0x329322(0x18d),_0x329322(0x191),'llm'];if(!_0x578018[_0x329322(0x171)](_0x3be3bb))return _0x329322(0x16b)+_0x3be3bb+'.\x20Valid\x20types:\x20'+_0x578018[_0x329322(0x19b)](',\x20');return undefined;}async[a13_0x198657(0x17d)](_0x1baeec){const _0xcdf906=a13_0x198657,{options:_0x492db7,args:_0x2b3bb3,tdx:_0x496196}=_0x1baeec,_0x160aee=_0x492db7,_0x34e122=_0x2b3bb3[0x0],_0x2cbb69=(_0x160aee[_0xcdf906(0x18e)]||_0xcdf906(0x179))[_0xcdf906(0x16d)](),_0x1c05f4=_0x160aee[_0xcdf906(0x185)],_0x15e3e0=_0x160aee[_0xcdf906(0x199)],_0x52a03c=_0x160aee[_0xcdf906(0x173)],_0x5670d1=_0x160aee[_0xcdf906(0x19a)]||'td';try{const _0x54ae4c={};if(_0x52a03c){const _0x3fc60d=Array[_0xcdf906(0x160)](_0x52a03c)?_0x52a03c:[_0x52a03c];for(const _0x427474 of _0x3fc60d){const [_0x5e70c7,_0x47297e]=parseHeader(_0x427474);_0x54ae4c[_0x5e70c7]=_0x47297e;}}let _0x3c5e68;if(_0x1c05f4)_0x3c5e68=_0x1c05f4;else{if(_0x15e3e0)try{_0x3c5e68=RawAPI[_0xcdf906(0x17a)](_0x15e3e0);}catch(_0x4cf1a6){return console[_0xcdf906(0x17b)](_0xcdf906(0x168)+(_0x4cf1a6 instanceof Error?_0x4cf1a6[_0xcdf906(0x18b)]:String(_0x4cf1a6))),0x1;}}const _0x43aec5={'method':_0x2cbb69,'apiType':_0x5670d1,'includeHeaders':_0x492db7[_0xcdf906(0x163)]};_0x3c5e68&&(_0x43aec5[_0xcdf906(0x15f)]=_0x3c5e68);Object[_0xcdf906(0x175)](_0x54ae4c)[_0xcdf906(0x16a)]>0x0&&(_0x43aec5[_0xcdf906(0x178)]=_0x54ae4c);if(_0x492db7[_0xcdf906(0x163)]){const _0x434a55=resolveSite(_0x492db7[_0xcdf906(0x187)]),_0x517131=getEndpoint(_0x434a55,_0x5670d1),_0x5da1b2=''+_0x517131+_0x34e122;console[_0xcdf906(0x17b)]('>\x20'+_0x2cbb69+'\x20'+_0x5da1b2);const _0x280d83=getAuthHeaders(_0x434a55),_0x287c90={..._0x280d83,..._0x54ae4c};for(const [_0x63c6d1,_0x23be95]of Object[_0xcdf906(0x161)](_0x287c90)){!isSensitiveHeader(_0x63c6d1)&&console[_0xcdf906(0x17b)]('>\x20'+_0x63c6d1+':\x20'+_0x23be95);}_0x3c5e68&&console[_0xcdf906(0x17b)]('>'),console[_0xcdf906(0x17b)]('');}const _0x37c42d=await _0x496196[_0xcdf906(0x180)][_0xcdf906(0x15b)](_0x34e122,_0x43aec5);if(_0x492db7[_0xcdf906(0x163)]&&_0x37c42d[_0xcdf906(0x178)]){console[_0xcdf906(0x17b)](_0xcdf906(0x162)+_0x37c42d['status']);for(const [_0x5b326f,_0x1cc53a]of Object[_0xcdf906(0x161)](_0x37c42d[_0xcdf906(0x178)])){!isSensitiveHeader(_0x5b326f)&&console[_0xcdf906(0x17b)]('<\x20'+_0x5b326f+':\x20'+_0x1cc53a);}console[_0xcdf906(0x17b)]('');}const _0x418b76=Boolean(_0x492db7[_0xcdf906(0x18c)]),_0x3540f9={'color':_0x492db7[_0xcdf906(0x197)],'noColor':_0x492db7[_0xcdf906(0x166)]||_0x418b76&&!_0x492db7[_0xcdf906(0x197)]},_0x1aa758=colorizeJSON(_0x37c42d[_0xcdf906(0x185)],_0x3540f9);return _0x492db7[_0xcdf906(0x18c)]?(writeFileSync(_0x492db7[_0xcdf906(0x18c)],_0x1aa758),console[_0xcdf906(0x17b)]('Results\x20saved\x20to\x20'+_0x492db7[_0xcdf906(0x18c)])):console[_0xcdf906(0x17e)](_0x1aa758),0x0;}catch(_0x53c7fa){return _0x53c7fa instanceof Error?(console[_0xcdf906(0x17b)](_0xcdf906(0x168)+_0x53c7fa[_0xcdf906(0x18b)]),_0x492db7[_0xcdf906(0x163)]&&_0x53c7fa['stack']&&console[_0xcdf906(0x17b)]('\x0aStack\x20trace:\x0a'+_0x53c7fa[_0xcdf906(0x170)])):console[_0xcdf906(0x17b)]('Error:\x20'+String(_0x53c7fa)),0x1;}}}
@@ -1 +1 @@
1
- function a14_0x2c56(_0x2c0243,_0x30bdd7){_0x2c0243=_0x2c0243-0x73;const _0x4d287f=a14_0x4d28();let _0x2c56c6=_0x4d287f[_0x2c0243];return _0x2c56c6;}const a14_0x330ed2=a14_0x2c56;function a14_0x4d28(){const _0x562c7c=['select','Site\x20name\x20cannot\x20be\x20empty','Enter\x20your\x20TD\x20API\x20key:','50690ijnddB','last_name','tdx:\x20auth\x20setup','test','10fPeATD','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','getUserInfo','117CUdIiy','tdx\x20profile:\x20','System\x20keychain\x20is\x20not\x20available','log','error','Enter\x20custom\x20site','✓\x20Profile\x20\x27','992178ixrhwW','8lefTDE','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20removed\x20from\x20keychain','red','2852508ZmOOeh','User:\x20','Enter\x20site\x20name:','\x20--profile\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','join','warn','auth:clear','\x27\x20registered','\x20(site:\x20','jobs','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','ERROR','\x20for\x20profile:\x20','50pHOssL','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','profile','site','text','68pCXgbt','other','jp\x20\x20\x20-\x20Japan','No\x20API\x20key\x20found\x20in\x20keychain','name','ap02','bold','email','length','3443022nvmPfg','findIndex','Select\x20your\x20Treasure\x20Data\x20site:','7iPINDC','eu01','filter','/app/mp/ak','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','911204uQLaGF','4173462KuYREg','status','N/A','Name:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth:setup','\x20(profile:\x20','trim','✓\x20Authentication\x20successful\x0a','first_name','us01','Setting\x20up\x20authentication\x20for\x20site:\x20','✗\x20Validation\x20failed:\x20','apiKey','description','API\x20key\x20cannot\x20be\x20empty','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','auth','message','8141625HydYTT','\x20\x20tdx','execute','create','customSite','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x0aSetup\x20cancelled','yellow','push','password'];a14_0x4d28=function(){return _0x562c7c;};return a14_0x4d28();}(function(_0x3dd15d,_0x3b81a4){const _0x3af28c=a14_0x2c56,_0xe082c=_0x3dd15d();while(!![]){try{const _0x3b9d8d=parseInt(_0x3af28c(0x74))/0x1*(parseInt(_0x3af28c(0xa6))/0x2)+parseInt(_0x3af28c(0x7d))/0x3+parseInt(_0x3af28c(0x85))/0x4*(-parseInt(_0x3af28c(0xaa))/0x5)+-parseInt(_0x3af28c(0x86))/0x6*(parseInt(_0x3af28c(0x80))/0x7)+-parseInt(_0x3af28c(0xb5))/0x8*(-parseInt(_0x3af28c(0x99))/0x9)+parseInt(_0x3af28c(0xc7))/0xa*(parseInt(_0x3af28c(0xb4))/0xb)+parseInt(_0x3af28c(0xb9))/0xc*(-parseInt(_0x3af28c(0xad))/0xd);if(_0x3b9d8d===_0x3b81a4)break;else _0xe082c['push'](_0xe082c['shift']());}catch(_0x377ff1){_0xe082c['push'](_0xe082c['shift']());}}}(a14_0x4d28,0xe48fd));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_0x485f82 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a14_0x2bc7b4 from'chalk';export class AuthSetupCommand extends BaseCommand{[a14_0x330ed2(0x78)]=a14_0x330ed2(0x8b);[a14_0x330ed2(0x94)]=a14_0x330ed2(0xb6);async[a14_0x330ed2(0x9b)](_0x4e282b){const _0x2f033c=a14_0x330ed2,{options:_0x3fe4b6}=_0x4e282b,_0x41b4a1=_0x3fe4b6[_0x2f033c(0xca)];console['log'](a14_0x2bc7b4['bold'](_0x2f033c(0xa8)));const _0x4d1089=_0x3fe4b6[_0x2f033c(0xcb)]||_0x2f033c(0x90),_0x5be5e2=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x2f033c(0x90)},{'title':_0x2f033c(0x76),'value':'jp01'},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x2f033c(0x81)},{'title':'ap02\x20-\x20Korea','value':_0x2f033c(0x79)}];let _0x3c2181=_0x5be5e2[_0x2f033c(0x7e)](_0x16774d=>_0x16774d['value']===_0x4d1089);_0x3c2181===-0x1&&_0x4d1089!==_0x2f033c(0x90)&&(_0x5be5e2['push']({'title':_0x4d1089,'value':_0x4d1089}),_0x3c2181=_0x5be5e2[_0x2f033c(0x7c)]-0x1);_0x5be5e2[_0x2f033c(0xa1)]({'title':_0x2f033c(0xb2),'value':_0x2f033c(0x75)});const _0xe37569=_0x41b4a1?_0x2f033c(0xc9)+_0x41b4a1+'):':_0x2f033c(0x7f),_0x5435d3=await a14_0x485f82({'type':_0x2f033c(0xa3),'name':_0x2f033c(0xcb),'message':_0xe37569,'choices':_0x5be5e2,'initial':_0x3c2181>=0x0?_0x3c2181:0x0});if(!_0x5435d3[_0x2f033c(0xcb)])return console[_0x2f033c(0xb0)](_0x2f033c(0x9f)),0x1;let _0x4c6a81;if(_0x5435d3['site']==='other'){const _0x23b5a1=await a14_0x485f82({'type':_0x2f033c(0x73),'name':_0x2f033c(0x9d),'message':_0x2f033c(0xbb),'initial':_0x2f033c(0x90),'validate':_0x266b6e=>{const _0x1ca52b=_0x2f033c;if(!_0x266b6e||!_0x266b6e[_0x1ca52b(0x8d)]())return _0x1ca52b(0xa4);if(!/^[a-z0-9-]+$/[_0x1ca52b(0xa9)](_0x266b6e['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x23b5a1[_0x2f033c(0x9d)])return console[_0x2f033c(0xb0)](_0x2f033c(0x9f)),0x1;_0x4c6a81=_0x23b5a1['customSite'];}else _0x4c6a81=_0x5435d3[_0x2f033c(0xcb)];const _0x202b35=resolveSite(_0x4c6a81);console[_0x2f033c(0xb0)](_0x2f033c(0x91)+_0x202b35),console[_0x2f033c(0xb0)](_0x2f033c(0x8a)),console[_0x2f033c(0xb0)]('\x20\x20'+getConsoleUrl(_0x202b35,_0x2f033c(0x83)));const _0x51dbcc=await a14_0x485f82({'type':_0x2f033c(0xa2),'name':_0x2f033c(0x93),'message':_0x2f033c(0xa5),'validate':_0x73d45f=>{const _0x2fde97=_0x2f033c;if(!_0x73d45f||!_0x73d45f[_0x2fde97(0x8d)]())return _0x2fde97(0x95);return!![];}});if(!_0x51dbcc['apiKey'])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x5c9871=_0x51dbcc[_0x2f033c(0x93)];console[_0x2f033c(0xb0)]('Validating\x20API\x20key...');try{const _0x3890b2=TDX[_0x2f033c(0x9c)]({'site':_0x202b35,'apiKey':_0x5c9871[_0x2f033c(0x8d)](),'logLevel':_0x3fe4b6['logLevel']??LogLevel[_0x2f033c(0xc5)]}),_0x2f603b=await _0x3890b2[_0x2f033c(0xc3)][_0x2f033c(0xac)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2f603b[_0x2f033c(0x7b)]+')');const _0x2b06e9=await isKeychainAvailable();_0x2b06e9?(await saveAPIKeyAsync(_0x5c9871[_0x2f033c(0x8d)](),_0x202b35,_0x41b4a1),console[_0x2f033c(0xb0)](_0x2f033c(0xbd)+(_0x41b4a1?_0x2f033c(0x8c)+_0x41b4a1+')':''))):(console[_0x2f033c(0xbf)](a14_0x2bc7b4[_0x2f033c(0xa0)](_0x2f033c(0x84))),console['warn'](a14_0x2bc7b4[_0x2f033c(0xa0)](_0x2f033c(0xc8))));if(_0x41b4a1){const _0xa00f4d={'site':_0x202b35};saveProfileToUserConfig(_0x41b4a1,_0xa00f4d),console[_0x2f033c(0xb0)](_0x2f033c(0xb3)+_0x41b4a1+_0x2f033c(0xc1));}const _0x590c6a=_0x41b4a1?_0x2f033c(0xbc)+_0x41b4a1:'';return console['log'](),console[_0x2f033c(0xb0)](_0x2f033c(0xab)),console[_0x2f033c(0xb0)](_0x2f033c(0x9a)+_0x590c6a+_0x2f033c(0x9e)),console[_0x2f033c(0xb0)](_0x2f033c(0x9a)+_0x590c6a+_0x2f033c(0xc4)),0x0;}catch(_0x4555b6){if(_0x4555b6 instanceof HTTPClientError&&_0x4555b6[_0x2f033c(0x87)]===0x191)return printAuthError(_0x4555b6),0x1;return console[_0x2f033c(0xb1)](a14_0x2bc7b4[_0x2f033c(0xb8)](_0x2f033c(0x92)+(_0x4555b6 instanceof Error?_0x4555b6[_0x2f033c(0x98)]:String(_0x4555b6)))),console[_0x2f033c(0xb1)](_0x2f033c(0x96)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a14_0x330ed2(0x78)]=a14_0x330ed2(0x97);[a14_0x330ed2(0x94)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a14_0x330ed2(0x9b)](_0x1bea06){const _0x3ef4f3=a14_0x330ed2,{options:_0x2b8af1,tdx:_0x9c4f1a}=_0x1bea06,_0x479835=_0x2b8af1[_0x3ef4f3(0xcb)],_0x54a17b=_0x2b8af1[_0x3ef4f3(0xca)],_0x4257e5=_0x54a17b?_0x54a17b:_0x3ef4f3(0x88);console[_0x3ef4f3(0xb0)](_0x3ef4f3(0xae)+_0x4257e5+_0x3ef4f3(0xc2)+_0x479835+')');const _0x44950f=await resolveAPIKeyAsync(_0x479835,_0x54a17b);if(_0x44950f){const {source:_0x11db74,isDeprecated:_0x1c9568}=_0x44950f,_0x2574ee='Read\x20credential\x20from\x20'+_0x11db74;console[_0x3ef4f3(0xb0)](_0x1c9568?a14_0x2bc7b4['yellow'](_0x2574ee):_0x2574ee);}else console['log'](a14_0x2bc7b4['yellow']('No\x20credential\x20found'));try{const _0x1aff3d=await _0x9c4f1a['jobs']['getUserInfo']();return console[_0x3ef4f3(0xb0)](a14_0x2bc7b4['green'](_0x3ef4f3(0x8e))),console['log'](_0x3ef4f3(0xba)+_0x1aff3d[_0x3ef4f3(0x7b)]),(_0x1aff3d[_0x3ef4f3(0x8f)]||_0x1aff3d[_0x3ef4f3(0xa7)])&&console[_0x3ef4f3(0xb0)](_0x3ef4f3(0x89)+[_0x1aff3d[_0x3ef4f3(0x8f)],_0x1aff3d['last_name']][_0x3ef4f3(0x82)](Boolean)[_0x3ef4f3(0xbe)]('\x20')),0x0;}catch(_0x5e90e4){return _0x5e90e4 instanceof HTTPClientError&&_0x5e90e4[_0x3ef4f3(0x87)]===0x191?printAuthError(_0x5e90e4,!![],_0x54a17b):console[_0x3ef4f3(0xb1)](a14_0x2bc7b4[_0x3ef4f3(0xb8)](_0x3ef4f3(0x92)+(_0x5e90e4 instanceof Error?_0x5e90e4[_0x3ef4f3(0x98)]:String(_0x5e90e4)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a14_0x330ed2(0x78)]=a14_0x330ed2(0xc0);[a14_0x330ed2(0x94)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a14_0x330ed2(0x9b)](_0x35fbb2){const _0x4ce2ee=a14_0x330ed2,{options:_0x2ed9a6}=_0x35fbb2,_0x465868=_0x2ed9a6[_0x4ce2ee(0xca)];console['log'](a14_0x2bc7b4[_0x4ce2ee(0x7a)]('tdx:\x20auth\x20clear'));const _0x30e3f9=await isKeychainAvailable();if(!_0x30e3f9)return console[_0x4ce2ee(0xb1)](a14_0x2bc7b4[_0x4ce2ee(0xb8)](_0x4ce2ee(0xaf))),0x1;const _0x33e877=await deleteKeychainAPIKey(_0x465868);return _0x33e877?(clearCredentialCache(),console['log'](_0x4ce2ee(0xb7)+(_0x465868?_0x4ce2ee(0x8c)+_0x465868+')':'')),0x0):(console[_0x4ce2ee(0xb0)](_0x4ce2ee(0x77)+(_0x465868?_0x4ce2ee(0xc6)+_0x465868:'')),0x1);}}
1
+ const a14_0x4551de=a14_0x126c;(function(_0x59f2e8,_0x1f9bf6){const _0x4aa622=a14_0x126c,_0x143da1=_0x59f2e8();while(!![]){try{const _0x310a43=parseInt(_0x4aa622(0x111))/0x1*(-parseInt(_0x4aa622(0xed))/0x2)+-parseInt(_0x4aa622(0xcc))/0x3*(-parseInt(_0x4aa622(0x107))/0x4)+parseInt(_0x4aa622(0xfc))/0x5+-parseInt(_0x4aa622(0xe9))/0x6+parseInt(_0x4aa622(0x101))/0x7*(-parseInt(_0x4aa622(0x10b))/0x8)+-parseInt(_0x4aa622(0xc4))/0x9*(parseInt(_0x4aa622(0xd1))/0xa)+parseInt(_0x4aa622(0xe7))/0xb*(parseInt(_0x4aa622(0xff))/0xc);if(_0x310a43===_0x1f9bf6)break;else _0x143da1['push'](_0x143da1['shift']());}catch(_0x2c24cb){_0x143da1['push'](_0x143da1['shift']());}}}(a14_0x55e5,0x5c8d8));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_0x44d144 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a14_0x318fe2 from'chalk';export class AuthSetupCommand extends BaseCommand{[a14_0x4551de(0xdb)]='auth:setup';[a14_0x4551de(0x114)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a14_0x4551de(0xf7)](_0x226e1f){const _0x3d7837=a14_0x4551de,{options:_0x5abc9c}=_0x226e1f,_0x171f66=_0x5abc9c[_0x3d7837(0xec)];console[_0x3d7837(0xf1)](a14_0x318fe2[_0x3d7837(0xe2)]('tdx:\x20auth\x20setup'));const _0x11c1bb=_0x5abc9c[_0x3d7837(0xfd)]||_0x3d7837(0xc9),_0x3ed863=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x3d7837(0xc9)},{'title':_0x3d7837(0x10a),'value':_0x3d7837(0xf9)},{'title':_0x3d7837(0xcb),'value':_0x3d7837(0xf8)},{'title':_0x3d7837(0xda),'value':_0x3d7837(0x106)}];let _0x7dd0b6=_0x3ed863[_0x3d7837(0xd6)](_0x5ce2f3=>_0x5ce2f3[_0x3d7837(0x113)]===_0x11c1bb);_0x7dd0b6===-0x1&&_0x11c1bb!==_0x3d7837(0xc9)&&(_0x3ed863[_0x3d7837(0xd2)]({'title':_0x11c1bb,'value':_0x11c1bb}),_0x7dd0b6=_0x3ed863[_0x3d7837(0xd3)]-0x1);_0x3ed863[_0x3d7837(0xd2)]({'title':'Enter\x20custom\x20site','value':_0x3d7837(0xc7)});const _0x273b42=_0x171f66?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x171f66+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x2e315f=await a14_0x44d144({'type':_0x3d7837(0xf6),'name':'site','message':_0x273b42,'choices':_0x3ed863,'initial':_0x7dd0b6>=0x0?_0x7dd0b6:0x0});if(!_0x2e315f['site'])return console[_0x3d7837(0xf1)]('\x0aSetup\x20cancelled'),0x1;let _0x320061;if(_0x2e315f[_0x3d7837(0xfd)]===_0x3d7837(0xc7)){const _0x19f12e=await a14_0x44d144({'type':_0x3d7837(0xe4),'name':_0x3d7837(0x10d),'message':_0x3d7837(0xc3),'initial':'us01','validate':_0x50b140=>{const _0x400362=_0x3d7837;if(!_0x50b140||!_0x50b140[_0x400362(0xfb)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x400362(0xe3)](_0x50b140['trim']()))return _0x400362(0xd5);return!![];}});if(!_0x19f12e[_0x3d7837(0x10d)])return console['log'](_0x3d7837(0xd0)),0x1;_0x320061=_0x19f12e['customSite'];}else _0x320061=_0x2e315f[_0x3d7837(0xfd)];const _0x5c911d=resolveSite(_0x320061);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5c911d),console['log'](_0x3d7837(0xdf)),console[_0x3d7837(0xf1)]('\x20\x20'+getConsoleUrl(_0x5c911d,_0x3d7837(0xd9)));const _0x4f2354=await a14_0x44d144({'type':_0x3d7837(0xd7),'name':'apiKey','message':_0x3d7837(0xee),'validate':_0x22018a=>{const _0x33c141=_0x3d7837;if(!_0x22018a||!_0x22018a['trim']())return _0x33c141(0xf4);return!![];}});if(!_0x4f2354['apiKey'])return console[_0x3d7837(0xf1)](_0x3d7837(0xd0)),0x1;const _0x198db3=_0x4f2354[_0x3d7837(0xeb)];console[_0x3d7837(0xf1)]('Validating\x20API\x20key...');try{const _0x5a3ced=TDX['create']({'site':_0x5c911d,'apiKey':_0x198db3[_0x3d7837(0xfb)](),'logLevel':_0x5abc9c[_0x3d7837(0xc8)]??LogLevel[_0x3d7837(0x103)]}),_0x258841=await _0x5a3ced[_0x3d7837(0xce)][_0x3d7837(0xe6)]();console['log'](_0x3d7837(0xdd)+_0x258841[_0x3d7837(0x112)]+')');const _0x287b55=await isKeychainAvailable();_0x287b55?(await saveAPIKeyAsync(_0x198db3[_0x3d7837(0xfb)](),_0x5c911d,_0x171f66),console[_0x3d7837(0xf1)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x171f66?_0x3d7837(0xc5)+_0x171f66+')':''))):(console['warn'](a14_0x318fe2[_0x3d7837(0xf3)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x3d7837(0x105)](a14_0x318fe2[_0x3d7837(0xf3)](_0x3d7837(0x10c))));if(_0x171f66){const _0x455edb={'site':_0x5c911d};saveProfileToUserConfig(_0x171f66,_0x455edb),console[_0x3d7837(0xf1)](_0x3d7837(0xe8)+_0x171f66+_0x3d7837(0xc6));}const _0x5336bb=_0x171f66?_0x3d7837(0xfe)+_0x171f66:'';return console[_0x3d7837(0xf1)](),console['log'](_0x3d7837(0x102)),console[_0x3d7837(0xf1)]('\x20\x20tdx'+_0x5336bb+_0x3d7837(0xcd)),console[_0x3d7837(0xf1)](_0x3d7837(0xca)+_0x5336bb+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x48953c){if(_0x48953c instanceof HTTPClientError&&_0x48953c[_0x3d7837(0xfa)]===0x191)return printAuthError(_0x48953c),0x1;return console['error'](a14_0x318fe2[_0x3d7837(0x10e)](_0x3d7837(0xe1)+(_0x48953c instanceof Error?_0x48953c[_0x3d7837(0x100)]:String(_0x48953c)))),console[_0x3d7837(0xc0)](_0x3d7837(0xe5)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a14_0x4551de(0xdb)]=a14_0x4551de(0xe0);['description']=a14_0x4551de(0xc1);async[a14_0x4551de(0xf7)](_0x1eeb0c){const _0x5ad1d7=a14_0x4551de,{options:_0x18481a,tdx:_0x43df7c}=_0x1eeb0c,_0x554e91=_0x18481a['site'],_0x5dbaa0=_0x18481a[_0x5ad1d7(0xec)],_0x245c57=_0x5dbaa0?_0x5dbaa0:_0x5ad1d7(0xf5);console['log'](_0x5ad1d7(0xef)+_0x245c57+_0x5ad1d7(0xde)+_0x554e91+')');const _0x3a4161=await resolveAPIKeyAsync(_0x554e91,_0x5dbaa0);if(_0x3a4161){const {source:_0x20f506,isDeprecated:_0x2f7ebc}=_0x3a4161,_0x4d8d71=_0x5ad1d7(0xd8)+_0x20f506;console['log'](_0x2f7ebc?a14_0x318fe2['yellow'](_0x4d8d71):_0x4d8d71);}else console[_0x5ad1d7(0xf1)](a14_0x318fe2[_0x5ad1d7(0xf3)](_0x5ad1d7(0xdc)));try{const _0x1be1b6=await _0x43df7c[_0x5ad1d7(0xce)][_0x5ad1d7(0xe6)]();return console[_0x5ad1d7(0xf1)](a14_0x318fe2['green'](_0x5ad1d7(0xc2))),console[_0x5ad1d7(0xf1)](_0x5ad1d7(0x109)+_0x1be1b6[_0x5ad1d7(0x112)]),(_0x1be1b6[_0x5ad1d7(0x108)]||_0x1be1b6[_0x5ad1d7(0xf2)])&&console['log'](_0x5ad1d7(0xcf)+[_0x1be1b6[_0x5ad1d7(0x108)],_0x1be1b6[_0x5ad1d7(0xf2)]][_0x5ad1d7(0x110)](Boolean)['join']('\x20')),0x0;}catch(_0x105765){return _0x105765 instanceof HTTPClientError&&_0x105765['status']===0x191?printAuthError(_0x105765,!![],_0x5dbaa0):console[_0x5ad1d7(0xc0)](a14_0x318fe2[_0x5ad1d7(0x10e)](_0x5ad1d7(0xe1)+(_0x105765 instanceof Error?_0x105765[_0x5ad1d7(0x100)]:String(_0x105765)))),0x1;}}}function a14_0x55e5(){const _0x383f92=['jp\x20\x20\x20-\x20Japan','2424jDpGhM','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','customSite','red','tdx:\x20auth\x20clear','filter','69653MgUGKj','email','value','description','✓\x20API\x20key\x20removed\x20from\x20keychain','error','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Authentication\x20successful\x0a','Enter\x20site\x20name:','90kggJzq','\x20(profile:\x20','\x27\x20registered','other','logLevel','us01','\x20\x20tdx','eu\x20\x20\x20-\x20Europe','972meMWXK','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','Name:\x20','\x0aSetup\x20cancelled','226910QmSDdJ','push','length','No\x20API\x20key\x20found\x20in\x20keychain','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','findIndex','password','Read\x20credential\x20from\x20','/app/mp/ak','ap02\x20-\x20Korea','name','No\x20credential\x20found','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20(site:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','✗\x20Validation\x20failed:\x20','bold','test','text','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','getUserInfo','19095571WTwYNH','✓\x20Profile\x20\x27','857814rKYvaX','auth:clear','apiKey','profile','20eOJGTR','Enter\x20your\x20TD\x20API\x20key:','tdx\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','log','last_name','yellow','API\x20key\x20cannot\x20be\x20empty','N/A','select','execute','eu01','jp01','status','trim','837455bAcNEd','site','\x20--profile\x20','12iTxcOw','message','15939gyvIOA','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR','\x20for\x20profile:\x20','warn','ap02','2864aMcknE','first_name','User:\x20'];a14_0x55e5=function(){return _0x383f92;};return a14_0x55e5();}function a14_0x126c(_0x175580,_0x5b942f){_0x175580=_0x175580-0xc0;const _0x55e502=a14_0x55e5();let _0x126ca8=_0x55e502[_0x175580];return _0x126ca8;}export class AuthClearCommand extends BaseCommand{[a14_0x4551de(0xdb)]=a14_0x4551de(0xea);['description']=a14_0x4551de(0xf0);async['execute'](_0x75c616){const _0x3a9d36=a14_0x4551de,{options:_0x317332}=_0x75c616,_0x404108=_0x317332[_0x3a9d36(0xec)];console['log'](a14_0x318fe2[_0x3a9d36(0xe2)](_0x3a9d36(0x10f)));const _0x24c9bb=await isKeychainAvailable();if(!_0x24c9bb)return console[_0x3a9d36(0xc0)](a14_0x318fe2[_0x3a9d36(0x10e)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x4c9815=await deleteKeychainAPIKey(_0x404108);return _0x4c9815?(clearCredentialCache(),console[_0x3a9d36(0xf1)](_0x3a9d36(0x115)+(_0x404108?_0x3a9d36(0xc5)+_0x404108+')':'')),0x0):(console['log'](_0x3a9d36(0xd4)+(_0x404108?_0x3a9d36(0x104)+_0x404108:'')),0x1);}}
@@ -1 +1 @@
1
- const a15_0x2666e7=a15_0x3373;(function(_0x5224b7,_0x5406bf){const _0x3eb447=a15_0x3373,_0x57980e=_0x5224b7();while(!![]){try{const _0x3d104f=parseInt(_0x3eb447(0x122))/0x1+parseInt(_0x3eb447(0x126))/0x2+-parseInt(_0x3eb447(0x10c))/0x3+parseInt(_0x3eb447(0x12b))/0x4*(parseInt(_0x3eb447(0x10a))/0x5)+parseInt(_0x3eb447(0x106))/0x6+-parseInt(_0x3eb447(0x100))/0x7*(parseInt(_0x3eb447(0xfd))/0x8)+-parseInt(_0x3eb447(0xfa))/0x9;if(_0x3d104f===_0x5406bf)break;else _0x57980e['push'](_0x57980e['shift']());}catch(_0xa21143){_0x57980e['push'](_0x57980e['shift']());}}}(a15_0x2c6b,0x6f989));import{BaseCommand}from'./command.js';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 a15_0x3373(_0x1ff766,_0x1b42ed){_0x1ff766=_0x1ff766-0xf5;const _0x2c6b1f=a15_0x2c6b();let _0x3373f7=_0x2c6b1f[_0x1ff766];return _0x3373f7;}function a15_0x2c6b(){const _0x39b6c1=['session\x20context','llmAgent','404','new','includes','chatId','metadata','Chat\x20session:\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','897043fxLrUP','execute','verbose','stack','156442NhkuQJ','getDefaultAgent','Error:\x20','name','llm','1426948gpUrjh','Getting\x20default\x20agent...','Resolving\x20agent\x20\x27','Using\x20agent\x20from\x20','type','\x0aStack\x20trace:','data','\x20\x20Cause:\x20','10438578bhilvw','streamChat','\x27...','40NwhRAZ','code','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','769713GxenAP','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','resolveProjectId','cause','Continuing\x20chat:\x20','write','2931654QFkCzd','claude-4.5-haiku','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','message','10CUQRnD','Resolving\x20project\x20\x27','31839UnXORN','error','stdout','join','content','description','validate','llmProject','CHAT_NOT_FOUND','getAgentId','resolveAgentId','handleChatEvent','\x0aError:\x20'];a15_0x2c6b=function(){return _0x39b6c1;};return a15_0x2c6b();}function handleSDKError(_0x1f5e4f,_0x51b3eb){const _0x1bc7e0=a15_0x3373;if(_0x1f5e4f instanceof SDKError)console['error'](_0x1bc7e0(0x128)+_0x1f5e4f[_0x1bc7e0(0x109)]),_0x51b3eb['verbose']&&(_0x1f5e4f[_0x1bc7e0(0x103)]&&console[_0x1bc7e0(0x10d)](_0x1bc7e0(0xf9)+_0x1f5e4f[_0x1bc7e0(0x103)]),_0x1f5e4f[_0x1bc7e0(0x125)]&&(console['error'](_0x1bc7e0(0xf7)),console['error'](_0x1f5e4f[_0x1bc7e0(0x125)])));else throw _0x1f5e4f;}export class ChatCommand extends BaseCommand{[a15_0x2666e7(0x129)]='chat';[a15_0x2666e7(0x111)]=a15_0x2666e7(0x101);[a15_0x2666e7(0x112)](_0x1dc3b6){const _0x202254=a15_0x2666e7,_0x84a615=_0x1dc3b6['args'][_0x202254(0x10f)]('\x20');if(!_0x84a615)return _0x202254(0xff);return undefined;}async[a15_0x2666e7(0xfb)](_0x1ce472,_0x5b1fec,_0x902a84,_0x5dc8e2,_0x564d51){const _0x5db9a9=a15_0x2666e7;for await(const _0x19bfad of _0x1ce472[_0x5db9a9(0x12a)]['chat'](_0x5b1fec,{'agentId':_0x902a84,'chatId':_0x5dc8e2})){if(_0x19bfad[_0x5db9a9(0xf6)]===_0x5db9a9(0x11f)){const _0x2da771=_0x19bfad['data'][_0x5db9a9(0x11e)];saveLastChatId(_0x2da771),_0x564d51&&console[_0x5db9a9(0x10d)](_0x5db9a9(0x120)+_0x2da771);}else _0x19bfad[_0x5db9a9(0xf6)]==='event'&&this[_0x5db9a9(0x117)](_0x19bfad[_0x5db9a9(0xf8)]);}}async[a15_0x2666e7(0x115)](_0x3cd27a,_0x5e07ab,_0x4828b3,_0x28ac33,_0x596aee){const _0x489dd3=a15_0x2666e7,_0x2df3cc=_0x5e07ab||_0x4828b3;if(_0x2df3cc){const {projectName:_0x198def,agentName:_0x1cc559}=parseAgentRef(_0x2df3cc),_0x404a37=_0x1cc559||_0x2df3cc,_0x3f111d=_0x1cc559?_0x198def:_0x28ac33;if(!_0x3f111d)throw new Error(_0x489dd3(0x108));if(_0x596aee){const _0x38bc3f=_0x5e07ab?'--agent\x20flag':_0x489dd3(0x119);console[_0x489dd3(0x10d)](_0x489dd3(0xf5)+_0x38bc3f+':\x20'+_0x3f111d+'/'+_0x404a37);}const _0x5e3678=await withSpinner(_0x489dd3(0x10b)+_0x3f111d+_0x489dd3(0xfc),()=>_0x3cd27a['llm'][_0x489dd3(0x102)](_0x3f111d),{'verbose':_0x596aee}),_0x1db503=await withSpinner(_0x489dd3(0x12d)+_0x404a37+_0x489dd3(0xfc),()=>_0x3cd27a[_0x489dd3(0x12a)][_0x489dd3(0x116)](_0x404a37,_0x5e3678[_0x489dd3(0xf8)]),{'verbose':_0x596aee});return _0x1db503[_0x489dd3(0xf8)];}else{const _0xe90451=_0x3cd27a['llm'][_0x489dd3(0x127)]();if(_0xe90451)return _0x596aee&&console[_0x489dd3(0x10d)]('Using\x20cached\x20default\x20agent:\x20'+_0xe90451[_0x489dd3(0x129)]),_0xe90451['id'];const _0x543450=await withSpinner(_0x489dd3(0x12c),()=>_0x3cd27a[_0x489dd3(0x12a)]['getOrCreateDefaultAgent'](_0x489dd3(0x107),0x0),{'verbose':_0x596aee});return _0x543450['data']['id'];}}async[a15_0x2666e7(0x123)](_0x4759f6){const _0x51d004=a15_0x2666e7,{options:_0x3a063f,args:_0x41ea5d,tdx:_0x3575e4}=_0x4759f6,_0x281bf1=_0x41ea5d['join']('\x20'),_0x6c2834=_0x3a063f,_0x13a079=_0x6c2834['agent'],_0x2a6d5d=_0x6c2834[_0x51d004(0x11a)],_0x4a761e=_0x6c2834[_0x51d004(0x113)],_0x152a07=_0x6c2834[_0x51d004(0x11c)];try{let _0x426cf5,_0x10f245;!_0x152a07&&(_0x10f245=loadLastChatId(),_0x10f245&&_0x3a063f['verbose']&&console['error'](_0x51d004(0x104)+_0x10f245));(_0x152a07||!_0x10f245)&&(_0x426cf5=await this[_0x51d004(0x115)](_0x3575e4,_0x13a079,_0x2a6d5d,_0x4a761e,_0x3a063f[_0x51d004(0x124)]));try{await this[_0x51d004(0xfb)](_0x3575e4,_0x281bf1,_0x426cf5,_0x10f245,_0x3a063f[_0x51d004(0x124)]);}catch(_0x4dbb8d){const _0xf61062=_0x4dbb8d instanceof SDKError&&_0x4dbb8d[_0x51d004(0xfe)]===ErrorCode[_0x51d004(0x114)]||_0x4dbb8d instanceof Error&&_0x4dbb8d[_0x51d004(0x109)][_0x51d004(0x11d)](_0x51d004(0x11b));if(_0xf61062)_0x3a063f['verbose']&&console['error'](_0x51d004(0x121)),!_0x426cf5&&(_0x426cf5=await this[_0x51d004(0x115)](_0x3575e4,_0x13a079,_0x2a6d5d,_0x4a761e,_0x3a063f['verbose'])),await this['streamChat'](_0x3575e4,_0x281bf1,_0x426cf5,undefined,_0x3a063f['verbose']);else throw _0x4dbb8d;}return console['log'](),0x0;}catch(_0x1d3147){return console[_0x51d004(0x10d)](),handleSDKError(_0x1d3147,_0x3a063f),0x1;}}['handleChatEvent'](_0x222c54){const _0x4fd3ad=a15_0x2666e7;if(_0x4fd3ad(0x110)in _0x222c54)process[_0x4fd3ad(0x10e)][_0x4fd3ad(0x105)](_0x222c54[_0x4fd3ad(0x110)]);else'error'in _0x222c54&&console['error'](_0x4fd3ad(0x118)+_0x222c54[_0x4fd3ad(0x10d)]);}}
1
+ const a15_0x221c1a=a15_0x2e16;(function(_0x4d3974,_0x18d758){const _0x54aaea=a15_0x2e16,_0x4dc3e2=_0x4d3974();while(!![]){try{const _0x2aff39=-parseInt(_0x54aaea(0x194))/0x1+-parseInt(_0x54aaea(0x189))/0x2+parseInt(_0x54aaea(0x1b3))/0x3*(parseInt(_0x54aaea(0x19b))/0x4)+parseInt(_0x54aaea(0x1a3))/0x5+parseInt(_0x54aaea(0x19e))/0x6*(-parseInt(_0x54aaea(0x1b1))/0x7)+-parseInt(_0x54aaea(0x1a9))/0x8*(-parseInt(_0x54aaea(0x190))/0x9)+-parseInt(_0x54aaea(0x1b2))/0xa*(parseInt(_0x54aaea(0x185))/0xb);if(_0x2aff39===_0x18d758)break;else _0x4dc3e2['push'](_0x4dc3e2['shift']());}catch(_0x3c7419){_0x4dc3e2['push'](_0x4dc3e2['shift']());}}}(a15_0x52c0,0xa2568));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a15_0x52c0(){const _0x1439e3=['stdout','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','verbose','\x20\x20Cause:\x20','data','9uYADjr','getDefaultAgent','chat','join','931872CuCdrB','claude-4.5-haiku','validate','chatId','name','resolveAgentId','Resolving\x20agent\x20\x27','76UUXfgW','log','write','24AuUZTW','agent','CHAT_NOT_FOUND','metadata','content','5681560KFhKYe','code','handleChatEvent','streamChat','Getting\x20default\x20agent...','resolveProjectId','9148648zUdUqB','llmProject','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','404','Resolving\x20project\x20\x27','type','Using\x20agent\x20from\x20','444969qIeUUM','140ByQCYB','44283NFWzcp','description','Error:\x20','llm','new','Chat\x20session:\x20','cause','getAgentId','338294phxrDy','message','error','session\x20context','557440XoLXbc'];a15_0x52c0=function(){return _0x1439e3;};return a15_0x52c0();}import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';function a15_0x2e16(_0x5be0ee,_0x56b5ac){_0x5be0ee=_0x5be0ee-0x183;const _0x52c042=a15_0x52c0();let _0x2e165b=_0x52c042[_0x5be0ee];return _0x2e165b;}function handleSDKError(_0x2856ad,_0x4c7401){const _0x3f04a7=a15_0x2e16;if(_0x2856ad instanceof SDKError)console[_0x3f04a7(0x187)](_0x3f04a7(0x1b5)+_0x2856ad[_0x3f04a7(0x186)]),_0x4c7401['verbose']&&(_0x2856ad['cause']&&console['error'](_0x3f04a7(0x18e)+_0x2856ad[_0x3f04a7(0x183)]),_0x2856ad['stack']&&(console[_0x3f04a7(0x187)]('\x0aStack\x20trace:'),console['error'](_0x2856ad['stack'])));else throw _0x2856ad;}export class ChatCommand extends BaseCommand{['name']='chat';[a15_0x221c1a(0x1b4)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a15_0x221c1a(0x196)](_0x89f042){const _0x2f4d70=a15_0x221c1a,_0x3c9a83=_0x89f042['args'][_0x2f4d70(0x193)]('\x20');if(!_0x3c9a83)return _0x2f4d70(0x18c);return undefined;}async['streamChat'](_0x70105e,_0x26e77c,_0x2aea95,_0xeb1a79,_0x64e405){const _0x50e641=a15_0x221c1a;for await(const _0xcec20a of _0x70105e[_0x50e641(0x1b6)][_0x50e641(0x192)](_0x26e77c,{'agentId':_0x2aea95,'chatId':_0xeb1a79})){if(_0xcec20a['type']===_0x50e641(0x1a1)){const _0x1a1bd5=_0xcec20a[_0x50e641(0x18f)][_0x50e641(0x197)];saveLastChatId(_0x1a1bd5),_0x64e405&&console[_0x50e641(0x187)](_0x50e641(0x1b8)+_0x1a1bd5);}else _0xcec20a[_0x50e641(0x1af)]==='event'&&this[_0x50e641(0x1a5)](_0xcec20a[_0x50e641(0x18f)]);}}async[a15_0x221c1a(0x184)](_0x53f42c,_0x2c67f4,_0x129e10,_0x425473,_0x5b7b5e){const _0x2a727a=a15_0x221c1a,_0x4239f0=_0x2c67f4||_0x129e10;if(_0x4239f0){const {projectName:_0x58adea,agentName:_0x444e08}=parseAgentRef(_0x4239f0),_0x297de7=_0x444e08||_0x4239f0,_0x1c38d8=_0x444e08?_0x58adea:_0x425473;if(!_0x1c38d8)throw new Error(_0x2a727a(0x18b));if(_0x5b7b5e){const _0x577018=_0x2c67f4?'--agent\x20flag':_0x2a727a(0x188);console['error'](_0x2a727a(0x1b0)+_0x577018+':\x20'+_0x1c38d8+'/'+_0x297de7);}const _0x4c440a=await withSpinner(_0x2a727a(0x1ae)+_0x1c38d8+'\x27...',()=>_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x1a8)](_0x1c38d8),{'verbose':_0x5b7b5e}),_0x16a4a2=await withSpinner(_0x2a727a(0x19a)+_0x297de7+'\x27...',()=>_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x199)](_0x297de7,_0x4c440a['data']),{'verbose':_0x5b7b5e});return _0x16a4a2['data'];}else{const _0x5c7dc1=_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x191)]();if(_0x5c7dc1)return _0x5b7b5e&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x5c7dc1[_0x2a727a(0x198)]),_0x5c7dc1['id'];const _0x5e5c78=await withSpinner(_0x2a727a(0x1a7),()=>_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x1ab)](_0x2a727a(0x195),0x0),{'verbose':_0x5b7b5e});return _0x5e5c78[_0x2a727a(0x18f)]['id'];}}async['execute'](_0x26947e){const _0xd99783=a15_0x221c1a,{options:_0x3a8a37,args:_0x172b68,tdx:_0x25945d}=_0x26947e,_0x149d04=_0x172b68['join']('\x20'),_0x1e1b73=_0x3a8a37,_0x45b58e=_0x1e1b73[_0xd99783(0x19f)],_0x1abe93=_0x1e1b73['llmAgent'],_0x4e9dc8=_0x1e1b73[_0xd99783(0x1aa)],_0x550c10=_0x1e1b73[_0xd99783(0x1b7)];try{let _0x2f3972,_0x3e1ba0;!_0x550c10&&(_0x3e1ba0=loadLastChatId(),_0x3e1ba0&&_0x3a8a37[_0xd99783(0x18d)]&&console[_0xd99783(0x187)]('Continuing\x20chat:\x20'+_0x3e1ba0));(_0x550c10||!_0x3e1ba0)&&(_0x2f3972=await this[_0xd99783(0x184)](_0x25945d,_0x45b58e,_0x1abe93,_0x4e9dc8,_0x3a8a37[_0xd99783(0x18d)]));try{await this[_0xd99783(0x1a6)](_0x25945d,_0x149d04,_0x2f3972,_0x3e1ba0,_0x3a8a37[_0xd99783(0x18d)]);}catch(_0x5beb74){const _0x2e588c=_0x5beb74 instanceof SDKError&&_0x5beb74[_0xd99783(0x1a4)]===ErrorCode[_0xd99783(0x1a0)]||_0x5beb74 instanceof Error&&_0x5beb74[_0xd99783(0x186)]['includes'](_0xd99783(0x1ad));if(_0x2e588c)_0x3a8a37[_0xd99783(0x18d)]&&console[_0xd99783(0x187)](_0xd99783(0x1ac)),!_0x2f3972&&(_0x2f3972=await this[_0xd99783(0x184)](_0x25945d,_0x45b58e,_0x1abe93,_0x4e9dc8,_0x3a8a37['verbose'])),await this[_0xd99783(0x1a6)](_0x25945d,_0x149d04,_0x2f3972,undefined,_0x3a8a37[_0xd99783(0x18d)]);else throw _0x5beb74;}return console[_0xd99783(0x19c)](),0x0;}catch(_0x25b57f){return console['error'](),handleSDKError(_0x25b57f,_0x3a8a37),0x1;}}[a15_0x221c1a(0x1a5)](_0x25fef9){const _0x8233cc=a15_0x221c1a;if(_0x8233cc(0x1a2)in _0x25fef9)process[_0x8233cc(0x18a)][_0x8233cc(0x19d)](_0x25fef9[_0x8233cc(0x1a2)]);else _0x8233cc(0x187)in _0x25fef9&&console[_0x8233cc(0x187)]('\x0aError:\x20'+_0x25fef9[_0x8233cc(0x187)]);}}