@treasuredata/tdx 0.14.7 → 0.14.9

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 (145) hide show
  1. package/README.md +21 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/segment-command.js +1 -1
  29. package/dist/commands/segment-create-command.js +1 -1
  30. package/dist/commands/segment-fields-command.js +1 -1
  31. package/dist/commands/segment-pull-command.js +1 -1
  32. package/dist/commands/segment-push-command.js +1 -1
  33. package/dist/commands/segment-update-command.js +1 -1
  34. package/dist/commands/segment-use-command.js +1 -1
  35. package/dist/commands/segment-validate-command.js +1 -1
  36. package/dist/commands/segments.js +1 -1
  37. package/dist/commands/show.js +1 -1
  38. package/dist/commands/tables.js +1 -1
  39. package/dist/commands/unset-command.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/core/version.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.js +1 -1
  59. package/dist/proxy/context-signature.js +1 -1
  60. package/dist/proxy/conversation-utils.js +1 -1
  61. package/dist/proxy/passthrough-server.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/proxy/sse-usage-parser.js +1 -1
  65. package/dist/sdk/agent/agent-config.js +1 -1
  66. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/client/cdp-api-client.js +1 -1
  70. package/dist/sdk/client/endpoints.js +1 -1
  71. package/dist/sdk/client/engage-api-client.js +1 -1
  72. package/dist/sdk/client/http-client.js +1 -1
  73. package/dist/sdk/client/llm-api-client.js +1 -1
  74. package/dist/sdk/client/rate-limiter.js +1 -1
  75. package/dist/sdk/client/td-api-client.js +1 -1
  76. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  77. package/dist/sdk/client/trino-api-client.js +1 -1
  78. package/dist/sdk/client/trino-api-client.js.map +1 -1
  79. package/dist/sdk/client/workflow-client.js +1 -1
  80. package/dist/sdk/connection-validator.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.js +1 -1
  84. package/dist/sdk/index.js +1 -1
  85. package/dist/sdk/io/index.js +1 -1
  86. package/dist/sdk/io/node-filesystem.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.js +1 -1
  89. package/dist/sdk/llm/chat-cache.js +1 -1
  90. package/dist/sdk/llm/index.js +1 -1
  91. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  92. package/dist/sdk/llm/model-aliases.js +1 -1
  93. package/dist/sdk/llm/model-factors.js +1 -1
  94. package/dist/sdk/query/index.js +1 -1
  95. package/dist/sdk/query/sql-parser.js +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/fields-display.js +1 -1
  98. package/dist/sdk/segment/file-discovery.js +1 -1
  99. package/dist/sdk/segment/journey-utils.js +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  102. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  103. package/dist/sdk/segment/pull-workflow.js +1 -1
  104. package/dist/sdk/segment/push-workflow.js +1 -1
  105. package/dist/sdk/segment/resolution-context.js +1 -1
  106. package/dist/sdk/segment/segment-path-parser.js +1 -1
  107. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  108. package/dist/sdk/segment/target-resolution.js +1 -1
  109. package/dist/sdk/segment/tdx-config.js +1 -1
  110. package/dist/sdk/segment/validate-files.js +1 -1
  111. package/dist/sdk/segment/yaml-validator.js +1 -1
  112. package/dist/sdk/segment.js +1 -1
  113. package/dist/sdk/types/index.js +1 -1
  114. package/dist/sdk/types/progress.js +1 -1
  115. package/dist/sdk/user.js +1 -1
  116. package/dist/sdk/util/format-detector.js +1 -1
  117. package/dist/sdk/util/formatters.js +1 -1
  118. package/dist/sdk/util/index.js +1 -1
  119. package/dist/sdk/util/tree-formatter.js +1 -1
  120. package/dist/sdk/workflow/clone-workflow.js +1 -1
  121. package/dist/sdk/workflow/index.js +1 -1
  122. package/dist/sdk/workflow/pull-workflow.js +1 -1
  123. package/dist/sdk/workflow/push-workflow.js +1 -1
  124. package/dist/sdk/workflow/tdx-config.js +1 -1
  125. package/dist/sdk/workflow/workflow-utils.js +1 -1
  126. package/dist/tdx +10 -0
  127. package/dist/utils/async.js +1 -1
  128. package/dist/utils/colors.d.ts +2 -1
  129. package/dist/utils/colors.d.ts.map +1 -1
  130. package/dist/utils/colors.js +1 -1
  131. package/dist/utils/colors.js.map +1 -1
  132. package/dist/utils/diff.js +1 -1
  133. package/dist/utils/file-permissions.js +1 -1
  134. package/dist/utils/json-loader.js +1 -1
  135. package/dist/utils/option-validation.js +1 -1
  136. package/dist/utils/port.js +1 -1
  137. package/dist/utils/process.js +1 -1
  138. package/dist/utils/prompt.js +1 -1
  139. package/dist/utils/spinner.js +1 -1
  140. package/dist/utils/sse-parser.js +1 -1
  141. package/dist/utils/string-utils.js +1 -1
  142. package/dist/utils/table-ref-parser.js +1 -1
  143. package/dist/utils/tdx-logger.js +1 -1
  144. package/dist/utils/version-check.js +1 -1
  145. package/package.json +2 -2
@@ -1 +1 @@
1
- const a3_0x26ff81=a3_0x5855;function a3_0x5855(_0x45148c,_0x4d9b4a){_0x45148c=_0x45148c-0x1aa;const _0x5376e4=a3_0x5376();let _0x5855db=_0x5376e4[_0x45148c];return _0x5855db;}(function(_0x59d165,_0x19cf12){const _0x506725=a3_0x5855,_0x989b15=_0x59d165();while(!![]){try{const _0x197a9b=parseInt(_0x506725(0x1bc))/0x1*(-parseInt(_0x506725(0x1cf))/0x2)+parseInt(_0x506725(0x1b6))/0x3+parseInt(_0x506725(0x1c8))/0x4*(parseInt(_0x506725(0x1d0))/0x5)+parseInt(_0x506725(0x1cb))/0x6+parseInt(_0x506725(0x1b4))/0x7+parseInt(_0x506725(0x1cc))/0x8*(-parseInt(_0x506725(0x1ad))/0x9)+-parseInt(_0x506725(0x1b5))/0xa*(parseInt(_0x506725(0x1ab))/0xb);if(_0x197a9b===_0x19cf12)break;else _0x989b15['push'](_0x989b15['shift']());}catch(_0x25fe5a){_0x989b15['push'](_0x989b15['shift']());}}}(a3_0x5376,0xcd5ec));function a3_0x5376(){const _0x71eecd=['Resolving\x20child\x20segment\x20\x27','\x20\x20Cause:\x20','verbose','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','cause','execute','Error:\x20','\x20activation','name','344fndhQY','data','site','5110014iHPRpU','8613176dkYdLo','activations','Error:\x20Segment\x20name\x20is\x20required','3164HEjend','78050OgIyjc','Resolving\x20parent\x20segment\x20\x27','length','49313AOnxUH','Site:\x20','9zOTwYJ','\x27...','segment','✔\x20Found\x20','listActivations','List\x20activations\x20for\x20a\x20segment','Parent\x20name:\x20','10541447PkeRyl','2760ywWcYJ','2214309xhJUAx','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveSegmentId','Child\x20name:\x20','error','resolveParentId','811btHSNF','message'];a3_0x5376=function(){return _0x71eecd;};return a3_0x5376();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x26ff81(0x1c7)]=a3_0x26ff81(0x1cd);['description']=a3_0x26ff81(0x1b2);async[a3_0x26ff81(0x1c4)](_0x18c1d3){const _0x150a44=a3_0x26ff81,{options:_0x4c8924,args:_0x20c71d,tdx:_0x24ba00}=_0x18c1d3;if(_0x20c71d['length']===0x0)return console[_0x150a44(0x1ba)](_0x150a44(0x1ce)),console[_0x150a44(0x1ba)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x533cdb,childId:_0x1b8786}=parseSegmentRef(_0x20c71d[0x0]);if(!_0x1b8786)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x150a44(0x1ba)](_0x150a44(0x1b7)),0x1;_0x4c8924[_0x150a44(0x1c0)]&&(console[_0x150a44(0x1ba)](_0x150a44(0x1ac)+_0x4c8924[_0x150a44(0x1ca)]),console[_0x150a44(0x1ba)](_0x150a44(0x1b3)+_0x533cdb),console[_0x150a44(0x1ba)](_0x150a44(0x1b9)+_0x1b8786));const _0xdb0ff=await withSpinner(_0x150a44(0x1d1)+_0x533cdb+'\x27...',()=>_0x24ba00[_0x150a44(0x1af)][_0x150a44(0x1bb)](_0x533cdb),{'verbose':_0x4c8924[_0x150a44(0x1c0)]}),_0x2f02ac=_0xdb0ff[_0x150a44(0x1c9)];_0x4c8924[_0x150a44(0x1c0)]&&console[_0x150a44(0x1ba)](_0x150a44(0x1c1)+_0x2f02ac);const _0x26912a=await withSpinner(_0x150a44(0x1be)+_0x1b8786+_0x150a44(0x1ae),()=>_0x24ba00[_0x150a44(0x1af)][_0x150a44(0x1b8)](_0x2f02ac,_0x1b8786),{'verbose':_0x4c8924[_0x150a44(0x1c0)]}),_0x14b660=_0x26912a['data'];_0x4c8924[_0x150a44(0x1c0)]&&console[_0x150a44(0x1ba)]('Resolved\x20child\x20ID:\x20'+_0x14b660);const _0x3a4712=await withSpinner(_0x150a44(0x1c2)+_0x1b8786+_0x150a44(0x1ae),()=>_0x24ba00[_0x150a44(0x1af)][_0x150a44(0x1b1)](_0x2f02ac,_0x14b660),{'verbose':_0x4c8924['verbose']}),_0x3b17fb=_0x3a4712[_0x150a44(0x1c9)];return console[_0x150a44(0x1ba)](_0x150a44(0x1b0)+_0x3b17fb[_0x150a44(0x1aa)]+_0x150a44(0x1c6)+(_0x3b17fb[_0x150a44(0x1aa)]!==0x1?'s':'')),await handleSDKOutput(_0x3b17fb,_0x4c8924),0x0;}catch(_0x44ba96){if(_0x44ba96 instanceof SDKError)return console['error'](_0x150a44(0x1c5)+_0x44ba96[_0x150a44(0x1bd)]),_0x44ba96[_0x150a44(0x1c3)]&&console['error'](_0x150a44(0x1bf)+_0x44ba96[_0x150a44(0x1c3)]),0x1;throw _0x44ba96;}}}
1
+ const a3_0x32884f=a3_0x2d4b;function a3_0x2d4b(_0x510a34,_0x3e354b){_0x510a34=_0x510a34-0x18c;const _0x2763c6=a3_0x2763();let _0x2d4b6c=_0x2763c6[_0x510a34];return _0x2d4b6c;}(function(_0xb1d064,_0x5ce231){const _0x43c892=a3_0x2d4b,_0x5a588a=_0xb1d064();while(!![]){try{const _0x367c1b=parseInt(_0x43c892(0x192))/0x1+-parseInt(_0x43c892(0x197))/0x2*(-parseInt(_0x43c892(0x195))/0x3)+parseInt(_0x43c892(0x194))/0x4+-parseInt(_0x43c892(0x19c))/0x5+-parseInt(_0x43c892(0x18f))/0x6*(parseInt(_0x43c892(0x1af))/0x7)+-parseInt(_0x43c892(0x19a))/0x8+parseInt(_0x43c892(0x19f))/0x9*(parseInt(_0x43c892(0x19e))/0xa);if(_0x367c1b===_0x5ce231)break;else _0x5a588a['push'](_0x5a588a['shift']());}catch(_0x9a153c){_0x5a588a['push'](_0x5a588a['shift']());}}}(a3_0x2763,0xbb631));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x2763(){const _0x228778=['error','data','activations','Resolved\x20parent\x20ID:\x20','18xHlFxZ','listActivations','verbose','224687XqEwAj','Error:\x20Segment\x20name\x20is\x20required','2651480pDsQCA','3FZzuPn','Resolving\x20child\x20segment\x20\x27','2803674voAXsz','Child\x20name:\x20','segment','975528RUVUPB','message','354715oNoNUn','Site:\x20','810bZLwsx','8802iWjBBr','name','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','cause','\x20\x20Cause:\x20','Error:\x20','description','Resolving\x20parent\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','execute','length','Parent\x20name:\x20','Listing\x20activations\x20for\x20segment\x20\x27','\x27...','site','3285779FneiFw','resolveSegmentId'];a3_0x2763=function(){return _0x228778;};return a3_0x2763();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x32884f(0x1a0)]=a3_0x32884f(0x18d);[a3_0x32884f(0x1a6)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x32884f(0x1a9)](_0x53b771){const _0x6955e9=a3_0x32884f,{options:_0x2490e0,args:_0x2152a2,tdx:_0x33b229}=_0x53b771;if(_0x2152a2[_0x6955e9(0x1aa)]===0x0)return console[_0x6955e9(0x1b1)](_0x6955e9(0x193)),console[_0x6955e9(0x1b1)](_0x6955e9(0x1a2)),0x1;try{const {parentId:_0x5f5bfd,childId:_0x31fc75}=parseSegmentRef(_0x2152a2[0x0]);if(!_0x31fc75)return console['error'](_0x6955e9(0x1a8)),console[_0x6955e9(0x1b1)](_0x6955e9(0x1a2)),0x1;_0x2490e0['verbose']&&(console['error'](_0x6955e9(0x19d)+_0x2490e0[_0x6955e9(0x1ae)]),console[_0x6955e9(0x1b1)](_0x6955e9(0x1ab)+_0x5f5bfd),console[_0x6955e9(0x1b1)](_0x6955e9(0x198)+_0x31fc75));const _0x27f70e=await withSpinner(_0x6955e9(0x1a7)+_0x5f5bfd+'\x27...',()=>_0x33b229[_0x6955e9(0x199)]['resolveParentId'](_0x5f5bfd),{'verbose':_0x2490e0[_0x6955e9(0x191)]}),_0x468625=_0x27f70e[_0x6955e9(0x18c)];_0x2490e0['verbose']&&console[_0x6955e9(0x1b1)](_0x6955e9(0x18e)+_0x468625);const _0x42c6b0=await withSpinner(_0x6955e9(0x196)+_0x31fc75+_0x6955e9(0x1ad),()=>_0x33b229['segment'][_0x6955e9(0x1b0)](_0x468625,_0x31fc75),{'verbose':_0x2490e0['verbose']}),_0x59a2b9=_0x42c6b0[_0x6955e9(0x18c)];_0x2490e0[_0x6955e9(0x191)]&&console[_0x6955e9(0x1b1)](_0x6955e9(0x1a1)+_0x59a2b9);const _0x25f618=await withSpinner(_0x6955e9(0x1ac)+_0x31fc75+_0x6955e9(0x1ad),()=>_0x33b229[_0x6955e9(0x199)][_0x6955e9(0x190)](_0x468625,_0x59a2b9),{'verbose':_0x2490e0['verbose']}),_0x4c63af=_0x25f618[_0x6955e9(0x18c)];return console[_0x6955e9(0x1b1)]('✔\x20Found\x20'+_0x4c63af['length']+'\x20activation'+(_0x4c63af[_0x6955e9(0x1aa)]!==0x1?'s':'')),await handleSDKOutput(_0x4c63af,_0x2490e0),0x0;}catch(_0x5bd91b){if(_0x5bd91b instanceof SDKError)return console[_0x6955e9(0x1b1)](_0x6955e9(0x1a5)+_0x5bd91b[_0x6955e9(0x19b)]),_0x5bd91b[_0x6955e9(0x1a3)]&&console[_0x6955e9(0x1b1)](_0x6955e9(0x1a4)+_0x5bd91b[_0x6955e9(0x1a3)]),0x1;throw _0x5bd91b;}}}
@@ -1 +1 @@
1
- const a4_0x2065ff=a4_0x2276;(function(_0x122c3d,_0x1dfb61){const _0x4439ae=a4_0x2276,_0x41133e=_0x122c3d();while(!![]){try{const _0x55c070=-parseInt(_0x4439ae(0x1cc))/0x1+parseInt(_0x4439ae(0x1c2))/0x2*(parseInt(_0x4439ae(0x156))/0x3)+-parseInt(_0x4439ae(0x15b))/0x4*(-parseInt(_0x4439ae(0x1be))/0x5)+-parseInt(_0x4439ae(0x15e))/0x6*(-parseInt(_0x4439ae(0x1cb))/0x7)+-parseInt(_0x4439ae(0x1c1))/0x8*(parseInt(_0x4439ae(0x191))/0x9)+parseInt(_0x4439ae(0x14c))/0xa+parseInt(_0x4439ae(0x1cd))/0xb;if(_0x55c070===_0x1dfb61)break;else _0x41133e['push'](_0x41133e['shift']());}catch(_0x3c3591){_0x41133e['push'](_0x41133e['shift']());}}}(a4_0x363d,0x45a09));import a4_0x57aa08 from'chalk';import a4_0x3c9f70 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';function a4_0x2276(_0x337ba8,_0x38cd15){_0x337ba8=_0x337ba8-0x134;const _0x363df3=a4_0x363d();let _0x2276d5=_0x363df3[_0x337ba8];return _0x2276d5;}import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x476a82){const _0x478342=a4_0x2276,_0x316365=[];if(_0x476a82['total']!==undefined)_0x316365[_0x478342(0x178)](_0x476a82['total']+'\x20total');if(_0x476a82[_0x478342(0x1a8)]!==undefined&&_0x476a82[_0x478342(0x1a8)]>0x0)_0x316365[_0x478342(0x178)](a4_0x57aa08[_0x478342(0x144)](_0x476a82[_0x478342(0x1a8)]+'\x20new'));if(_0x476a82['created']!==undefined&&_0x476a82['created']>0x0)_0x316365[_0x478342(0x178)](a4_0x57aa08[_0x478342(0x144)](_0x476a82[_0x478342(0x177)]+_0x478342(0x18d)));if(_0x476a82[_0x478342(0x135)]!==undefined&&_0x476a82[_0x478342(0x135)]>0x0)_0x316365[_0x478342(0x178)](a4_0x57aa08[_0x478342(0x145)](_0x476a82[_0x478342(0x135)]+_0x478342(0x196)));if(_0x476a82[_0x478342(0x1d1)]!==undefined&&_0x476a82[_0x478342(0x1d1)]>0x0)_0x316365[_0x478342(0x178)](a4_0x57aa08[_0x478342(0x1bc)](_0x476a82['unchanged']+_0x478342(0x140)));if(_0x476a82['errors']!==undefined&&_0x476a82[_0x478342(0x148)]>0x0)_0x316365[_0x478342(0x178)](a4_0x57aa08[_0x478342(0x134)](_0x476a82[_0x478342(0x148)]+_0x478342(0x18f)));return _0x316365['join'](',\x20');}function displayDiffs(_0x30938a,_0x390da3,_0x4342ff,_0x546074){const _0x3e3946=a4_0x2276;for(const _0x2f5514 of _0x30938a){if(_0x2f5514[_0x3e3946(0x179)]){const _0x32d797=_0x2f5514[_0x3e3946(0x138)]||_0x2f5514[_0x3e3946(0x1a2)];console['log'](_0x3e3946(0x1a5)+_0x32d797+'\x27:'),console[_0x3e3946(0x17d)]('─'[_0x3e3946(0x1b1)](0x3c)),console[_0x3e3946(0x17d)](_0x2f5514['diff']),console[_0x3e3946(0x17d)]('─'[_0x3e3946(0x1b1)](0x3c));}}for(const _0x4e44a1 of _0x390da3){_0x4e44a1[_0x3e3946(0x179)]&&(console[_0x3e3946(0x17d)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x4e44a1[_0x3e3946(0x1a2)]+'\x27:'),console[_0x3e3946(0x17d)]('─'['repeat'](0x3c)),console[_0x3e3946(0x17d)](_0x4e44a1['diff']),console['log']('─'[_0x3e3946(0x1b1)](0x3c)));}for(const _0x501e4b of _0x4342ff){_0x501e4b[_0x3e3946(0x179)]&&(console[_0x3e3946(0x17d)](_0x3e3946(0x1ab)+_0x501e4b[_0x3e3946(0x1a2)]+'\x27:'),console[_0x3e3946(0x17d)]('─'[_0x3e3946(0x1b1)](0x3c)),console['log'](_0x501e4b[_0x3e3946(0x179)]),console[_0x3e3946(0x17d)]('─'[_0x3e3946(0x1b1)](0x3c)));}for(const _0x918892 of _0x546074){_0x918892['diff']&&(console[_0x3e3946(0x17d)](_0x3e3946(0x159)+_0x918892[_0x3e3946(0x1a2)]+'\x27:'),console[_0x3e3946(0x17d)]('─'['repeat'](0x3c)),console['log'](_0x918892[_0x3e3946(0x179)]),console[_0x3e3946(0x17d)]('─'[_0x3e3946(0x1b1)](0x3c)));}}function a4_0x363d(){const _0x382d33=['Pulling\x20agent\x20\x22','knowledgeBases','\x20updated','Cloning\x20\x22','agent:pull','\x20\x20Prompts:\x20','pushAgent','\x20\x20Knowledge\x20Base\x20\x22','tdx.json','\x20=\x20','Errors:','\x22\x20to\x20new\x20project\x20\x22','\x20changed','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','name','Failed\x20to\x20push\x20agent:\x20','execute','\x0aChanges\x20to\x20agent\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','site','new','Source:\x20','projectName','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agents','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','repeat','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a','Chat:\x20','projectId','dim','output','New\x20project\x20name\x20is\x20required','\x20\x20Text\x20Knowledge\x20Bases:\x20','Using\x20context\x20project:\x20','\x0a✔\x20Pulled\x20','textKnowledgeBases','gray','join','5sLxtjW','outputDir','\x0aProject\x20pushed\x20with\x20errors','68336tHqCHW','2586LPVzcn','\x0aChanges:','Clone\x20cancelled','Using\x20project:\x20','Current\x20context\x20has\x20llm_project=\x22','\x22...','cyan','\x20\x20Source:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','371EjCwky','386367YxlleJ','79420bELPrq','outputPath','cwd','Agent:\x20','unchanged','session','\x20|\x20','red','updated','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','llm_project','agentName','\x20\x20Prompt\x20\x22','Using\x20current\x20project:\x20','pullProject','Dry\x20run\x20-\x20no\x20files\x20written','Would\x20clone:','description','newProjectName','\x20unchanged','\x20\x20Agents:\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)','isNew','green','yellow','sourceProjectName','\x20\x20Knowledge\x20Bases:\x20','errors','dirname','yes','\x0a✔\x20Pushed\x20','1491020pVUALF','pushProject','Agent\x20','\x0aErrors\x20found:','llmProject','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Push\x20cancelled','dryRun','agent.yml','207CTnQBU','Project:\x20','\x20\x20Target:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20\x22','983724uHLixV','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Using\x20project\x20from\x20','43596ytfMXD','Using\x20local\x20project:\x20','Pushing\x20to\x20project...','New\x20project\x20ID:\x20','\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','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20pull\x20','agent:push','\x22\x20from\x20project\x20\x22','\x22:\x20','utf-8','\x20files\x20to\x20','INVALID_ARGUMENT','\x22\x20to\x20a\x20different\x20profile','\x27\x20to\x20create\x20the\x20folder\x20structure.','counts','Would\x20push\x20agent:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Project\x20cloned\x20with\x20errors','Dry\x20run\x20-\x20no\x20changes\x20made','No\x20tdx.json\x20found\x20in\x20','\x20new','\x20--name\x20','llm','\x20\x20Agent\x20\x22','created','push','diff','Writing\x20files...','force','\x0aPull\x20summary\x20for\x20\x27','log','Summary:','cloneProject','agentId','Analyzing\x20project\x20\x22','prompts','Would\x20pull\x20agent:\x20','Project\x20cloned\x20successfully','error','\x0aPush\x20summary\x20for\x20\x27','parse','\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','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agent:clone','Status:\x20','Pull\x20cancelled','\x20created','Output\x20path:\x20','\x20errors','action','216mhbaza','✔\x20Context\x20set:\x20','Output:\x20'];a4_0x363d=function(){return _0x382d33;};return a4_0x363d();}export class AgentPullCommand extends BaseCommand{[a4_0x2065ff(0x1a2)]=a4_0x2065ff(0x198);['description']=a4_0x2065ff(0x189);async[a4_0x2065ff(0x1a4)](_0x4ff5fe){const _0x15773f=a4_0x2065ff,{options:_0x466912,args:_0x5ee7ee,tdx:_0x2f8eea}=_0x4ff5fe,_0x55f08e=_0x5ee7ee[0x0],_0x44b793=_0x5ee7ee[0x1],_0x158c3c=_0x466912[_0x15773f(0x1b6)],_0x5ecad1=_0x466912[_0x15773f(0x154)],_0x2fedb9=_0x466912[_0x15773f(0x17b)],_0x2e84f7=_0x466912[_0x15773f(0x14a)],_0x4f4b4c=_0x466912[_0x15773f(0x150)];let _0xa1fb23,_0x28dd32;const _0x1c3442=findAgentConfigPath(process[_0x15773f(0x1cf)]());if(_0x55f08e){const _0x4a79ed=a4_0x3c9f70['join'](_0x55f08e,'tdx.json');if(existsSync(_0x4a79ed))try{const _0x2b85d3=JSON[_0x15773f(0x187)](readFileSync(_0x4a79ed,_0x15773f(0x168)));_0xa1fb23=_0x2b85d3[_0x15773f(0x137)],_0x28dd32=_0x55f08e,console[_0x15773f(0x17d)](a4_0x57aa08[_0x15773f(0x1b5)](_0x15773f(0x15d)+_0x4a79ed+':\x20'+_0xa1fb23));}catch{_0xa1fb23=_0x55f08e;}else _0xa1fb23=_0x55f08e;}else{if(_0x1c3442)try{const _0x81c75c=JSON[_0x15773f(0x187)](readFileSync(_0x1c3442,'utf-8'));_0xa1fb23=_0x81c75c[_0x15773f(0x137)],_0x28dd32=a4_0x3c9f70[_0x15773f(0x149)](_0x1c3442),console[_0x15773f(0x17d)](a4_0x57aa08['dim'](_0x15773f(0x1c5)+_0xa1fb23));}catch{_0xa1fb23=_0x4f4b4c;}else _0xa1fb23=_0x4f4b4c;}if(!_0xa1fb23)return console['log'](a4_0x57aa08[_0x15773f(0x145)](_0x15773f(0x16f))),console[_0x15773f(0x17d)](_0x15773f(0x142)),console[_0x15773f(0x17d)](_0x15773f(0x188)),console[_0x15773f(0x17d)](_0x15773f(0x162)),console[_0x15773f(0x17d)](_0x15773f(0x1af)),0x1;if(_0x44b793){const {data:_0xd1afe3}=await withSpinner(_0x15773f(0x194)+_0x44b793+_0x15773f(0x166)+_0xa1fb23+'\x22...',()=>_0x2f8eea[_0x15773f(0x175)]['pullAgent'](_0xa1fb23,_0x44b793,_0x158c3c,{'dryRun':_0x5ecad1,'force':_0x2fedb9}));if(_0x5ecad1)return console[_0x15773f(0x17d)](a4_0x57aa08[_0x15773f(0x145)](_0x15773f(0x13c))),console['log'](_0x15773f(0x183)+_0xd1afe3[_0x15773f(0x138)]),console[_0x15773f(0x17d)](_0x15773f(0x18e)+_0xd1afe3['outputPath']),_0xd1afe3[_0x15773f(0x179)]&&(console[_0x15773f(0x17d)](_0x15773f(0x1c3)),console[_0x15773f(0x17d)]('─'[_0x15773f(0x1b1)](0x3c)),console[_0x15773f(0x17d)](_0xd1afe3[_0x15773f(0x179)]),console[_0x15773f(0x17d)]('─'[_0x15773f(0x1b1)](0x3c))),0x0;return console[_0x15773f(0x17d)](a4_0x57aa08[_0x15773f(0x144)]('Agent\x20pulled\x20successfully')),console[_0x15773f(0x17d)](_0x15773f(0x1d0)+_0xd1afe3[_0x15773f(0x138)]),console['log'](_0x15773f(0x193)+_0xd1afe3[_0x15773f(0x1ce)]),console[_0x15773f(0x17d)](_0x15773f(0x18b)+(_0xd1afe3[_0x15773f(0x143)]?a4_0x57aa08[_0x15773f(0x144)](_0x15773f(0x1a8)):_0xd1afe3['hasChanges']?a4_0x57aa08[_0x15773f(0x145)](_0x15773f(0x135)):a4_0x57aa08[_0x15773f(0x1bc)](_0x15773f(0x1d1)))),0x0;}const _0x1b98d8=_0x28dd32||_0x158c3c,{data:_0x986138}=await withSpinner(_0x15773f(0x181)+_0xa1fb23+'\x22...',()=>_0x2f8eea[_0x15773f(0x175)][_0x15773f(0x13b)](_0xa1fb23,_0x1b98d8,{'dryRun':!![]})),_0x1d792f=_0x986138['counts']['agents'][_0x15773f(0x1a8)]+_0x986138[_0x15773f(0x16d)][_0x15773f(0x195)][_0x15773f(0x1a8)]+_0x986138[_0x15773f(0x16d)][_0x15773f(0x1bb)]['new']+_0x986138[_0x15773f(0x16d)]['prompts'][_0x15773f(0x1a8)],_0x25807e=_0x986138['counts'][_0x15773f(0x1ac)][_0x15773f(0x135)]+_0x986138[_0x15773f(0x16d)][_0x15773f(0x195)][_0x15773f(0x135)]+_0x986138[_0x15773f(0x16d)][_0x15773f(0x1bb)][_0x15773f(0x135)]+_0x986138[_0x15773f(0x16d)]['prompts']['updated'],_0x900b21=_0x986138[_0x15773f(0x16d)][_0x15773f(0x1ac)][_0x15773f(0x1d1)]+_0x986138[_0x15773f(0x16d)][_0x15773f(0x195)]['unchanged']+_0x986138[_0x15773f(0x16d)][_0x15773f(0x1bb)]['unchanged']+_0x986138['counts'][_0x15773f(0x182)][_0x15773f(0x1d1)];console['log'](_0x15773f(0x17c)+_0x986138['projectName']+'\x27:'),console[_0x15773f(0x17d)]('\x20\x20'+a4_0x57aa08[_0x15773f(0x144)]('+\x20'+_0x1d792f+_0x15773f(0x173))+_0x15773f(0x1d3)+a4_0x57aa08[_0x15773f(0x145)]('~\x20'+_0x25807e+_0x15773f(0x1a0))+_0x15773f(0x1d3)+a4_0x57aa08['dim']('=\x20'+_0x900b21+'\x20unchanged')),console[_0x15773f(0x17d)]('\x20\x20Agents:\x20'+formatCountSummary(_0x986138[_0x15773f(0x16d)][_0x15773f(0x1ac)])),console['log'](_0x15773f(0x147)+formatCountSummary(_0x986138[_0x15773f(0x16d)][_0x15773f(0x195)])),console['log'](_0x15773f(0x1b8)+formatCountSummary(_0x986138['counts']['textKnowledgeBases'])),console[_0x15773f(0x17d)](_0x15773f(0x199)+formatCountSummary(_0x986138['counts'][_0x15773f(0x182)])),console['log'](_0x15773f(0x158)+a4_0x57aa08[_0x15773f(0x1c8)](_0x986138[_0x15773f(0x1bf)])),displayDiffs(_0x986138[_0x15773f(0x1ac)],_0x986138[_0x15773f(0x195)],_0x986138[_0x15773f(0x1bb)],_0x986138[_0x15773f(0x182)]);if(_0x5ecad1)return console[_0x15773f(0x17d)](a4_0x57aa08['yellow'](_0x15773f(0x1ca))),0x0;if(_0x1d792f===0x0&&_0x25807e===0x0)return console['log'](a4_0x57aa08['green'](_0x15773f(0x1a1))),saveSessionContext({'llm_project':_0x986138[_0x15773f(0x1aa)]},_0x466912[_0x15773f(0x1d2)]),console[_0x15773f(0x17d)](a4_0x57aa08['green'](_0x15773f(0x192)+a4_0x57aa08[_0x15773f(0x1b5)](_0x15773f(0x137))+_0x15773f(0x19d)+a4_0x57aa08[_0x15773f(0x1c8)](_0x986138['projectName']))),0x0;if(!_0x2e84f7&&!_0x2fedb9){const _0x33020d=await confirmKey('\x0aWrite\x20'+(_0x1d792f+_0x25807e)+'\x20files?');if(!_0x33020d)return console['log'](_0x15773f(0x18c)),0x0;}const {data:_0x30ef07}=await withSpinner(_0x15773f(0x17a),()=>_0x2f8eea[_0x15773f(0x175)][_0x15773f(0x13b)](_0xa1fb23,_0x1b98d8,{'force':_0x2fedb9}));return console[_0x15773f(0x17d)](a4_0x57aa08[_0x15773f(0x144)](_0x15773f(0x1ba)+(_0x1d792f+_0x25807e)+_0x15773f(0x169)+_0x30ef07['outputDir'])),saveSessionContext({'llm_project':_0x30ef07[_0x15773f(0x1aa)]},_0x466912[_0x15773f(0x1d2)]),console[_0x15773f(0x17d)](a4_0x57aa08[_0x15773f(0x144)](_0x15773f(0x192)+a4_0x57aa08[_0x15773f(0x1b5)](_0x15773f(0x137))+_0x15773f(0x19d)+a4_0x57aa08[_0x15773f(0x1c8)](_0x30ef07[_0x15773f(0x1aa)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2065ff(0x1a2)]=a4_0x2065ff(0x18a);[a4_0x2065ff(0x13e)]=a4_0x2065ff(0x1ad);async[a4_0x2065ff(0x1a4)](_0x5e0b9c){const _0x476381=a4_0x2065ff,{options:_0x32b4db,args:_0x19ebe5,tdx:_0x290cee}=_0x5e0b9c,_0xf62779=_0x19ebe5[0x0],_0x15ef87=_0x32b4db[_0x476381(0x1a2)],_0x218d54=_0x32b4db[_0x476381(0x154)],_0xbd6b9c=_0x32b4db[_0x476381(0x14a)],_0x2c21e6=_0x32b4db[_0x476381(0x1a7)],_0x363900=_0x32b4db[_0x476381(0x150)];let _0xa10b82;const _0x5503e1=findAgentConfigPath(process['cwd']());if(_0xf62779){const _0x1c4511=a4_0x3c9f70[_0x476381(0x1bd)](_0xf62779,_0x476381(0x19c));existsSync(_0x1c4511)?(_0xa10b82=_0xf62779,console[_0x476381(0x17d)](a4_0x57aa08[_0x476381(0x1b5)](_0x476381(0x15f)+_0xf62779))):_0xa10b82=_0xf62779;}else{if(_0x5503e1)_0xa10b82=a4_0x3c9f70['dirname'](_0x5503e1),console[_0x476381(0x17d)](a4_0x57aa08[_0x476381(0x1b5)](_0x476381(0x13a)+_0xa10b82));else{if(_0x363900){const _0x5ce324=normalizeName(_0x363900),_0x301b6c=a4_0x3c9f70[_0x476381(0x1bd)](process[_0x476381(0x1cf)](),_0x476381(0x1ac),_0x5ce324,'tdx.json');if(existsSync(_0x301b6c))_0xa10b82=a4_0x3c9f70['dirname'](_0x301b6c),console[_0x476381(0x17d)](a4_0x57aa08[_0x476381(0x1b5)](_0x476381(0x15f)+_0xa10b82));else{const _0x419d4e=_0x32b4db['profile'];if(_0x419d4e)throw new SDKError(ErrorCode[_0x476381(0x16a)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x363900+_0x476381(0x16b),undefined,{'helpText':_0x476381(0x1b0)+_0x476381(0x136)+(_0x476381(0x164)+_0x363900+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x5ce324+_0x476381(0x174)+(_0x15ef87||'<new-name>')+'\x20--profile\x20'+_0x419d4e)});_0xa10b82=_0x363900,console[_0x476381(0x17d)](a4_0x57aa08['dim'](_0x476381(0x1b9)+_0x363900));}}}}if(!_0xa10b82)return console['log'](a4_0x57aa08['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x476381(0x17d)](_0x476381(0x1ae)),console[_0x476381(0x17d)]('\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[_0x476381(0x17d)](_0x476381(0x163)),0x1;if(!_0x15ef87)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x476381(0x1b7),undefined,{'helpText':_0x476381(0x152)});if(!_0xbd6b9c&&!_0x218d54){const _0x36d8d2=await confirmKey(_0x476381(0x15a)+_0xa10b82+_0x476381(0x19f)+_0x15ef87+'\x22?');if(!_0x36d8d2)return console[_0x476381(0x17d)](_0x476381(0x1c4)),0x0;}const {data:_0x22cb79}=await withSpinner(_0x476381(0x197)+_0xa10b82+'\x22\x20to\x20\x22'+_0x15ef87+_0x476381(0x1c7),()=>_0x290cee[_0x476381(0x175)][_0x476381(0x17f)](_0xa10b82,_0x15ef87,{'dryRun':_0x218d54}));if(_0x218d54)return console['log'](a4_0x57aa08[_0x476381(0x145)](_0x476381(0x171))),console[_0x476381(0x17d)]('Source:\x20'+_0x22cb79[_0x476381(0x146)]),console[_0x476381(0x17d)]('New\x20project:\x20'+_0x15ef87),console[_0x476381(0x17d)](_0x476381(0x13d)),console[_0x476381(0x17d)](_0x476381(0x141)+_0x22cb79[_0x476381(0x16d)][_0x476381(0x1ac)][_0x476381(0x177)]),console[_0x476381(0x17d)](_0x476381(0x147)+_0x22cb79[_0x476381(0x16d)][_0x476381(0x195)]['created']),console['log'](_0x476381(0x199)+_0x22cb79[_0x476381(0x16d)][_0x476381(0x182)][_0x476381(0x177)]),0x0;const _0x1e8c31=_0x22cb79['counts'][_0x476381(0x1ac)][_0x476381(0x148)]>0x0||_0x22cb79[_0x476381(0x16d)][_0x476381(0x195)][_0x476381(0x148)]>0x0||_0x22cb79[_0x476381(0x16d)][_0x476381(0x182)][_0x476381(0x148)]>0x0;_0x1e8c31?console[_0x476381(0x17d)](a4_0x57aa08[_0x476381(0x145)](_0x476381(0x170))):console[_0x476381(0x17d)](a4_0x57aa08[_0x476381(0x144)](_0x476381(0x184)));console[_0x476381(0x17d)](_0x476381(0x1a9)+_0x22cb79[_0x476381(0x146)]),console[_0x476381(0x17d)]('New\x20project:\x20'+_0x22cb79[_0x476381(0x13f)]),console['log'](_0x476381(0x161)+_0x22cb79['newProjectId']),console[_0x476381(0x17d)](),console['log'](_0x476381(0x17e)),console[_0x476381(0x17d)]('\x20\x20Agents:\x20'+formatCountSummary(_0x22cb79[_0x476381(0x16d)][_0x476381(0x1ac)])),console['log'](_0x476381(0x147)+formatCountSummary(_0x22cb79[_0x476381(0x16d)][_0x476381(0x195)])),console[_0x476381(0x17d)](_0x476381(0x199)+formatCountSummary(_0x22cb79[_0x476381(0x16d)][_0x476381(0x182)]));if(_0x1e8c31){console[_0x476381(0x17d)](),console['log'](a4_0x57aa08['red'](_0x476381(0x19e)));for(const _0x5b7b52 of _0x22cb79[_0x476381(0x1ac)]){_0x5b7b52[_0x476381(0x190)]===_0x476381(0x185)&&console[_0x476381(0x17d)](a4_0x57aa08[_0x476381(0x134)]('\x20\x20Agent\x20\x22'+_0x5b7b52[_0x476381(0x138)]+_0x476381(0x167)+_0x5b7b52[_0x476381(0x185)]));}for(const _0x496aff of _0x22cb79[_0x476381(0x195)]){_0x496aff['action']===_0x476381(0x185)&&console['log'](a4_0x57aa08['red'](_0x476381(0x19b)+_0x496aff['name']+_0x476381(0x167)+_0x496aff[_0x476381(0x185)]));}for(const _0x2503b9 of _0x22cb79['prompts']){_0x2503b9[_0x476381(0x190)]==='error'&&console['log'](a4_0x57aa08[_0x476381(0x134)]('\x20\x20Prompt\x20\x22'+_0x2503b9[_0x476381(0x1a2)]+_0x476381(0x167)+_0x2503b9[_0x476381(0x185)]));}return 0x1;}console[_0x476381(0x17d)]();const _0x134c70=getLLMProjectUrl(_0x2c21e6,_0x22cb79['newProjectId']);return console[_0x476381(0x17d)](_0x476381(0x157)+a4_0x57aa08[_0x476381(0x1c8)](_0x134c70)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2065ff(0x1a2)]=a4_0x2065ff(0x165);[a4_0x2065ff(0x13e)]=a4_0x2065ff(0x1a6);async[a4_0x2065ff(0x1a4)](_0x349504){const _0xe8a482=a4_0x2065ff,{options:_0x23a45a,args:_0x56538f,tdx:_0x15056e}=_0x349504;let _0x421039=_0x56538f[0x0]||process[_0xe8a482(0x1cf)]();const _0x132964=_0x23a45a[_0xe8a482(0x154)],_0x3bad38=_0x23a45a[_0xe8a482(0x17b)],_0xed0a8b=_0x23a45a[_0xe8a482(0x14a)],_0x269311=_0x23a45a[_0xe8a482(0x1a7)],_0x4a8680=a4_0x3c9f70['join'](_0x421039,_0xe8a482(0x155)),_0x56cedb=existsSync(_0x4a8680);if(_0x56cedb){const {data:_0x49d93a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x421039+_0xe8a482(0x1c7),()=>_0x15056e[_0xe8a482(0x175)][_0xe8a482(0x19a)](_0x421039,{'dryRun':_0x132964,'force':_0x3bad38}));if(_0x132964)return console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x145)](_0xe8a482(0x171))),console[_0xe8a482(0x17d)](_0xe8a482(0x16e)+_0x49d93a['agentName']),0x0;if(_0x49d93a[_0xe8a482(0x190)]===_0xe8a482(0x185))return console['log'](a4_0x57aa08[_0xe8a482(0x134)](_0xe8a482(0x1a3)+_0x49d93a[_0xe8a482(0x185)])),0x1;console['log'](a4_0x57aa08['green'](_0xe8a482(0x14e)+_0x49d93a['action']+'\x20successfully')),console['log'](_0xe8a482(0x1d0)+_0x49d93a['agentName']);if(_0x49d93a['agentId']&&_0x49d93a[_0xe8a482(0x1b4)]){const _0x2cc9df=getLLMAgentChatUrl(_0x269311,_0x49d93a[_0xe8a482(0x1b4)],_0x49d93a[_0xe8a482(0x180)]);console[_0xe8a482(0x17d)](_0xe8a482(0x1b3)+a4_0x57aa08[_0xe8a482(0x1c8)](_0x2cc9df));}return 0x0;}let _0x4be31b=a4_0x3c9f70[_0xe8a482(0x1bd)](_0x421039,'tdx.json');if(!existsSync(_0x4be31b)){const _0x2c517c=findAgentConfigPath(_0x421039);if(_0x2c517c)_0x421039=a4_0x3c9f70[_0xe8a482(0x149)](_0x2c517c),_0x4be31b=_0x2c517c,console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x1b5)](_0xe8a482(0x1c5)+_0x421039));else{const _0x387661=_0x23a45a[_0xe8a482(0x150)];if(_0x387661){const _0x501983=normalizeName(_0x387661),_0x474bd8=a4_0x3c9f70[_0xe8a482(0x1bd)](_0x421039,_0xe8a482(0x1ac)),_0x54306a=a4_0x3c9f70[_0xe8a482(0x1bd)](_0x474bd8,_0x501983,_0xe8a482(0x19c));existsSync(_0x54306a)&&(_0x421039=a4_0x3c9f70['dirname'](_0x54306a),_0x4be31b=_0x54306a,console[_0xe8a482(0x17d)](a4_0x57aa08['dim']('Using\x20project:\x20'+_0x421039)));}if(!existsSync(_0x4be31b)){let _0x2b82f5=_0xe8a482(0x151);_0x387661&&(_0x2b82f5=_0xe8a482(0x1c6)+_0x387661+_0xe8a482(0x1b2)+('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x387661+_0xe8a482(0x16c)));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe8a482(0x172)+_0x421039,undefined,{'helpText':_0x2b82f5});}}}const {data:_0x237421}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x15056e['llm'][_0xe8a482(0x14d)](_0x421039,{'dryRun':!![]})),_0x1a46b5=_0x237421[_0xe8a482(0x16d)]['agents'][_0xe8a482(0x148)]>0x0;if(_0x1a46b5){console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)](_0xe8a482(0x14f)));for(const _0x36cd26 of _0x237421[_0xe8a482(0x1ac)]){_0x36cd26[_0xe8a482(0x190)]===_0xe8a482(0x185)&&console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)]('\x20\x20Agent\x20\x22'+_0x36cd26[_0xe8a482(0x138)]+_0xe8a482(0x167)+_0x36cd26[_0xe8a482(0x185)]));}return 0x1;}const _0x19a110=_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x1ac)]['created']+_0x237421['counts'][_0xe8a482(0x195)]['created']+_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x1bb)][_0xe8a482(0x177)]+_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x182)]['created'],_0x2c66fd=_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x1ac)][_0xe8a482(0x135)]+_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x195)][_0xe8a482(0x135)]+_0x237421['counts'][_0xe8a482(0x1bb)][_0xe8a482(0x135)]+_0x237421['counts'][_0xe8a482(0x182)]['updated'],_0x2f3dfb=_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x1ac)][_0xe8a482(0x1d1)]+_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x195)][_0xe8a482(0x1d1)]+_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x1bb)][_0xe8a482(0x1d1)]+_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x182)]['unchanged'];console[_0xe8a482(0x17d)](_0xe8a482(0x186)+_0x237421[_0xe8a482(0x1aa)]+'\x27:'),console[_0xe8a482(0x17d)]('\x20\x20'+a4_0x57aa08[_0xe8a482(0x144)]('+\x20'+_0x19a110+_0xe8a482(0x173))+_0xe8a482(0x1d3)+a4_0x57aa08[_0xe8a482(0x145)]('~\x20'+_0x2c66fd+_0xe8a482(0x1a0))+_0xe8a482(0x1d3)+a4_0x57aa08[_0xe8a482(0x1b5)]('=\x20'+_0x2f3dfb+'\x20unchanged')),console['log'](_0xe8a482(0x141)+formatCountSummary(_0x237421['counts'][_0xe8a482(0x1ac)])),console[_0xe8a482(0x17d)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x195)])),console[_0xe8a482(0x17d)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x1bb)])),console[_0xe8a482(0x17d)](_0xe8a482(0x199)+formatCountSummary(_0x237421[_0xe8a482(0x16d)][_0xe8a482(0x182)])),console[_0xe8a482(0x17d)](_0xe8a482(0x1c9)+a4_0x57aa08[_0xe8a482(0x1c8)](_0x421039)),displayDiffs(_0x237421[_0xe8a482(0x1ac)],_0x237421[_0xe8a482(0x195)],_0x237421[_0xe8a482(0x1bb)],_0x237421[_0xe8a482(0x182)]);if(_0x132964)return console['log'](a4_0x57aa08[_0xe8a482(0x145)](_0xe8a482(0x15c))),0x0;if(_0x19a110===0x0&&_0x2c66fd===0x0){console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x144)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x55282d=getLLMProjectUrl(_0x269311,_0x237421['projectId']);return console[_0xe8a482(0x17d)]('Project:\x20'+a4_0x57aa08[_0xe8a482(0x1c8)](_0x55282d)),0x0;}if(!_0xed0a8b&&!_0x3bad38){const _0x206780=await confirmKey('\x0aPush\x20'+(_0x19a110+_0x2c66fd)+'\x20resources?');if(!_0x206780)return console[_0xe8a482(0x17d)](_0xe8a482(0x153)),0x0;}const {data:_0x5d03d0}=await withSpinner(_0xe8a482(0x160),()=>_0x15056e[_0xe8a482(0x175)][_0xe8a482(0x14d)](_0x421039,{'force':_0x3bad38})),_0x5705e3=_0x5d03d0['counts'][_0xe8a482(0x1ac)][_0xe8a482(0x148)]>0x0||_0x5d03d0['counts']['knowledgeBases'][_0xe8a482(0x148)]>0x0||_0x5d03d0[_0xe8a482(0x16d)][_0xe8a482(0x1bb)]['errors']>0x0||_0x5d03d0['counts']['prompts']['errors']>0x0;if(_0x5705e3){console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x145)](_0xe8a482(0x1c0))),console[_0xe8a482(0x17d)](),console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)](_0xe8a482(0x19e)));for(const _0x18bbc1 of _0x5d03d0[_0xe8a482(0x1ac)]){_0x18bbc1[_0xe8a482(0x190)]==='error'&&console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)](_0xe8a482(0x176)+_0x18bbc1[_0xe8a482(0x138)]+_0xe8a482(0x167)+_0x18bbc1['error']));}for(const _0x1164d6 of _0x5d03d0[_0xe8a482(0x195)]){_0x1164d6['action']===_0xe8a482(0x185)&&console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)](_0xe8a482(0x19b)+_0x1164d6[_0xe8a482(0x1a2)]+_0xe8a482(0x167)+_0x1164d6['error']));}for(const _0xbfea3f of _0x5d03d0[_0xe8a482(0x1bb)]){_0xbfea3f['action']==='error'&&console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0xbfea3f[_0xe8a482(0x1a2)]+'\x22:\x20'+_0xbfea3f[_0xe8a482(0x185)]));}for(const _0x1e696e of _0x5d03d0['prompts']){_0x1e696e[_0xe8a482(0x190)]===_0xe8a482(0x185)&&console[_0xe8a482(0x17d)](a4_0x57aa08[_0xe8a482(0x134)](_0xe8a482(0x139)+_0x1e696e[_0xe8a482(0x1a2)]+_0xe8a482(0x167)+_0x1e696e[_0xe8a482(0x185)]));}return 0x1;}console['log'](a4_0x57aa08['green'](_0xe8a482(0x14b)+(_0x19a110+_0x2c66fd)+'\x20resources\x20to\x20\x27'+_0x5d03d0[_0xe8a482(0x1aa)]+'\x27'));const _0x4ebde8=getLLMProjectUrl(_0x269311,_0x5d03d0[_0xe8a482(0x1b4)]);return console['log']('Project:\x20'+a4_0x57aa08[_0xe8a482(0x1c8)](_0x4ebde8)),0x0;}}
1
+ const a4_0x6da52a=a4_0x552b;(function(_0x118b49,_0x309ad5){const _0x448de1=a4_0x552b,_0x222f49=_0x118b49();while(!![]){try{const _0x2f31f7=parseInt(_0x448de1(0x100))/0x1+-parseInt(_0x448de1(0xfc))/0x2+-parseInt(_0x448de1(0x139))/0x3*(-parseInt(_0x448de1(0xb5))/0x4)+parseInt(_0x448de1(0xc1))/0x5+-parseInt(_0x448de1(0xa3))/0x6*(-parseInt(_0x448de1(0xc7))/0x7)+parseInt(_0x448de1(0x112))/0x8*(-parseInt(_0x448de1(0xf8))/0x9)+-parseInt(_0x448de1(0xea))/0xa;if(_0x2f31f7===_0x309ad5)break;else _0x222f49['push'](_0x222f49['shift']());}catch(_0x419a3e){_0x222f49['push'](_0x222f49['shift']());}}}(a4_0x32be,0xa77dc));import a4_0x582f7a from'chalk';import a4_0x323037 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';function a4_0x32be(){const _0x3a1e59=['llm','\x20\x20Knowledge\x20Bases:\x20','total','\x20unchanged','yes','\x22\x20to\x20a\x20different\x20profile','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','cloneProject','diff','\x0a✔\x20Pulled\x20','description','Output\x20path:\x20','\x0aPush\x20','6124288CuKFyp','Would\x20push\x20agent:\x20','new','outputPath','Writing\x20files...','\x22\x20to\x20\x22','pullProject','dryRun','✔\x20Context\x20set:\x20','\x0aErrors\x20found:','Project\x20cloned\x20successfully','\x20\x20Source:\x20','\x20\x20Prompts:\x20','execute','\x20resources?','New\x20project\x20name\x20is\x20required','\x27\x20to\x20create\x20the\x20folder\x20structure.','parse','Summary:','\x0aChanges:','\x22:\x20','\x20|\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20local\x20project:\x20','Errors:','\x22...','New\x20project\x20ID:\x20','MISSING_ARGUMENT','Pushing\x20to\x20project...','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Base\x20\x22','\x20total','counts','projectName','Status:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','red','agentId','550317SMdDTL','dirname','Run\x20\x27tdx\x20agent\x20pull\x20','isNew','tdx.json','unchanged','Cannot\x20clone\x20from\x20context\x20project\x20\x22','created','395856zLFpnL','output','\x20\x20tdx\x20agent\x20clone\x20agents/','projectId','Using\x20project\x20from\x20','\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','Dry\x20run\x20-\x20no\x20changes\x20made','Cloning\x20\x22','Agent\x20','action','\x0aPush\x20summary\x20for\x20\x27','\x0aWrite\x20','pushAgent','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20prompt\x20\x27','agent.yml','Project:\x20','gray','4IxkKaa','agents','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a','\x0aProject\x20pushed\x20with\x20errors','force','\x20\x20Target:\x20','newProjectId','\x20files\x20to\x20','green','prompts','\x20errors','outputDir','5562360wzWrZE','Agent:\x20','dim','agent:push','\x20created','Using\x20current\x20project:\x20','7iGlnKM','Pushing\x20agent\x20from\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','session','updated','pushProject','\x22\x20from\x20project\x20\x22','cyan','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20project:\x20','hasChanges','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','name','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','knowledgeBases','\x20updated','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','New\x20project:\x20','\x20\x20Agents:\x20','llm_project','errors','Analyzing\x20changes\x20to\x20push...','Pull\x20cancelled','\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)','\x20files?','repeat','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','push','\x20successfully','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','newProjectName','Clone\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','201830zHzoOk','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','join','yellow','log','\x20=\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cwd','\x20changed','textKnowledgeBases','Would\x20pull\x20agent:\x20','utf-8','\x20\x20Agent\x20\x22','\x20new','9fwMCKT','Using\x20context\x20project:\x20','error','INVALID_ARGUMENT','1644224BHCOMC','Source:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','llmProject','931988NdqCgl','\x20\x20tdx\x20agent\x20pull\x20','Would\x20clone:','agent:pull','agentName'];a4_0x32be=function(){return _0x3a1e59;};return a4_0x32be();}import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../sdk/agent/agent-config.js';function a4_0x552b(_0x45b572,_0x536f80){_0x45b572=_0x45b572-0xa0;const _0x32be15=a4_0x32be();let _0x552b32=_0x32be15[_0x45b572];return _0x552b32;}import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1380c1){const _0x2e090b=a4_0x552b,_0x2aaf26=[];if(_0x1380c1[_0x2e090b(0x107)]!==undefined)_0x2aaf26['push'](_0x1380c1[_0x2e090b(0x107)]+_0x2e090b(0x132));if(_0x1380c1[_0x2e090b(0x114)]!==undefined&&_0x1380c1[_0x2e090b(0x114)]>0x0)_0x2aaf26[_0x2e090b(0xe4)](a4_0x582f7a[_0x2e090b(0xbd)](_0x1380c1[_0x2e090b(0x114)]+_0x2e090b(0xf7)));if(_0x1380c1['created']!==undefined&&_0x1380c1[_0x2e090b(0xa2)]>0x0)_0x2aaf26[_0x2e090b(0xe4)](a4_0x582f7a[_0x2e090b(0xbd)](_0x1380c1['created']+_0x2e090b(0xc5)));if(_0x1380c1[_0x2e090b(0xcb)]!==undefined&&_0x1380c1[_0x2e090b(0xcb)]>0x0)_0x2aaf26[_0x2e090b(0xe4)](a4_0x582f7a[_0x2e090b(0xed)](_0x1380c1[_0x2e090b(0xcb)]+_0x2e090b(0xd8)));if(_0x1380c1[_0x2e090b(0xa0)]!==undefined&&_0x1380c1['unchanged']>0x0)_0x2aaf26[_0x2e090b(0xe4)](a4_0x582f7a[_0x2e090b(0xb4)](_0x1380c1[_0x2e090b(0xa0)]+_0x2e090b(0x108)));if(_0x1380c1['errors']!==undefined&&_0x1380c1[_0x2e090b(0xdd)]>0x0)_0x2aaf26[_0x2e090b(0xe4)](a4_0x582f7a[_0x2e090b(0x137)](_0x1380c1[_0x2e090b(0xdd)]+_0x2e090b(0xbf)));return _0x2aaf26[_0x2e090b(0xec)](',\x20');}function displayDiffs(_0xb01f49,_0x17d9b1,_0x6097f0,_0x47483c){const _0x35e8ef=a4_0x552b;for(const _0x1c7000 of _0xb01f49){if(_0x1c7000['diff']){const _0x1ca7d=_0x1c7000['agentName']||_0x1c7000[_0x35e8ef(0xd4)];console[_0x35e8ef(0xee)](_0x35e8ef(0xd6)+_0x1ca7d+'\x27:'),console['log']('─'[_0x35e8ef(0xe2)](0x3c)),console[_0x35e8ef(0xee)](_0x1c7000[_0x35e8ef(0x10d)]),console[_0x35e8ef(0xee)]('─'['repeat'](0x3c));}}for(const _0xa61144 of _0x17d9b1){_0xa61144['diff']&&(console[_0x35e8ef(0xee)](_0x35e8ef(0xe6)+_0xa61144[_0x35e8ef(0xd4)]+'\x27:'),console[_0x35e8ef(0xee)]('─'['repeat'](0x3c)),console[_0x35e8ef(0xee)](_0xa61144[_0x35e8ef(0x10d)]),console[_0x35e8ef(0xee)]('─'[_0x35e8ef(0xe2)](0x3c)));}for(const _0x26a996 of _0x6097f0){_0x26a996[_0x35e8ef(0x10d)]&&(console[_0x35e8ef(0xee)](_0x35e8ef(0x136)+_0x26a996['name']+'\x27:'),console[_0x35e8ef(0xee)]('─'[_0x35e8ef(0xe2)](0x3c)),console[_0x35e8ef(0xee)](_0x26a996[_0x35e8ef(0x10d)]),console['log']('─'[_0x35e8ef(0xe2)](0x3c)));}for(const _0x2887a9 of _0x47483c){_0x2887a9[_0x35e8ef(0x10d)]&&(console[_0x35e8ef(0xee)](_0x35e8ef(0xb1)+_0x2887a9[_0x35e8ef(0xd4)]+'\x27:'),console['log']('─'[_0x35e8ef(0xe2)](0x3c)),console[_0x35e8ef(0xee)](_0x2887a9[_0x35e8ef(0x10d)]),console[_0x35e8ef(0xee)]('─'[_0x35e8ef(0xe2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x6da52a(0xd4)]=a4_0x6da52a(0x103);[a4_0x6da52a(0x10f)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x2857c7){const _0x456f02=a4_0x6da52a,{options:_0x309c38,args:_0x40655b,tdx:_0x305fd2}=_0x2857c7,_0x4f5360=_0x40655b[0x0],_0x39219d=_0x40655b[0x1],_0x188421=_0x309c38[_0x456f02(0xa4)],_0x3cf6fd=_0x309c38[_0x456f02(0x119)],_0x3b00f8=_0x309c38[_0x456f02(0xb9)],_0x544717=_0x309c38[_0x456f02(0x109)],_0x152409=_0x309c38[_0x456f02(0xff)];let _0x424a37,_0x3a9341;const _0x4cf09e=findAgentConfigPath(process[_0x456f02(0xf1)]());if(_0x4f5360){const _0x30a546=a4_0x323037[_0x456f02(0xec)](_0x4f5360,_0x456f02(0x13d));if(existsSync(_0x30a546))try{const _0x4783ab=JSON[_0x456f02(0x123)](readFileSync(_0x30a546,_0x456f02(0xf5)));_0x424a37=_0x4783ab['llm_project'],_0x3a9341=_0x4f5360,console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xc3)](_0x456f02(0xa7)+_0x30a546+':\x20'+_0x424a37));}catch{_0x424a37=_0x4f5360;}else _0x424a37=_0x4f5360;}else{if(_0x4cf09e)try{const _0x248243=JSON[_0x456f02(0x123)](readFileSync(_0x4cf09e,_0x456f02(0xf5)));_0x424a37=_0x248243[_0x456f02(0xdc)],_0x3a9341=a4_0x323037[_0x456f02(0x13a)](_0x4cf09e),console['log'](a4_0x582f7a[_0x456f02(0xc3)]('Using\x20project:\x20'+_0x424a37));}catch{_0x424a37=_0x152409;}else _0x424a37=_0x152409;}if(!_0x424a37)return console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xed)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x456f02(0xee)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x456f02(0xee)]('\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[_0x456f02(0xee)](_0x456f02(0xa8)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x39219d){const {data:_0x388e28}=await withSpinner(_0x456f02(0xd5)+_0x39219d+_0x456f02(0xcd)+_0x424a37+_0x456f02(0x12b),()=>_0x305fd2[_0x456f02(0x105)]['pullAgent'](_0x424a37,_0x39219d,_0x188421,{'dryRun':_0x3cf6fd,'force':_0x3b00f8}));if(_0x3cf6fd)return console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xed)](_0x456f02(0xd0))),console['log'](_0x456f02(0xf4)+_0x388e28[_0x456f02(0x104)]),console['log'](_0x456f02(0x110)+_0x388e28[_0x456f02(0x115)]),_0x388e28[_0x456f02(0x10d)]&&(console[_0x456f02(0xee)](_0x456f02(0x125)),console['log']('─'['repeat'](0x3c)),console['log'](_0x388e28['diff']),console['log']('─'[_0x456f02(0xe2)](0x3c))),0x0;return console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xbd)]('Agent\x20pulled\x20successfully')),console[_0x456f02(0xee)](_0x456f02(0xc2)+_0x388e28[_0x456f02(0x104)]),console['log']('Output:\x20'+_0x388e28[_0x456f02(0x115)]),console[_0x456f02(0xee)](_0x456f02(0x135)+(_0x388e28[_0x456f02(0x13c)]?a4_0x582f7a[_0x456f02(0xbd)]('new'):_0x388e28[_0x456f02(0xd2)]?a4_0x582f7a[_0x456f02(0xed)](_0x456f02(0xcb)):a4_0x582f7a[_0x456f02(0xb4)](_0x456f02(0xa0)))),0x0;}const _0x18a326=_0x3a9341||_0x188421,{data:_0xb5471b}=await withSpinner('Analyzing\x20project\x20\x22'+_0x424a37+_0x456f02(0x12b),()=>_0x305fd2['llm'][_0x456f02(0x118)](_0x424a37,_0x18a326,{'dryRun':!![]})),_0x2abaa6=_0xb5471b['counts'][_0x456f02(0xb6)][_0x456f02(0x114)]+_0xb5471b['counts'][_0x456f02(0xd7)][_0x456f02(0x114)]+_0xb5471b[_0x456f02(0x133)]['textKnowledgeBases']['new']+_0xb5471b['counts']['prompts'][_0x456f02(0x114)],_0x23cee7=_0xb5471b['counts']['agents'][_0x456f02(0xcb)]+_0xb5471b[_0x456f02(0x133)][_0x456f02(0xd7)]['updated']+_0xb5471b[_0x456f02(0x133)][_0x456f02(0xf3)][_0x456f02(0xcb)]+_0xb5471b[_0x456f02(0x133)][_0x456f02(0xbe)][_0x456f02(0xcb)],_0x165cb6=_0xb5471b[_0x456f02(0x133)]['agents'][_0x456f02(0xa0)]+_0xb5471b[_0x456f02(0x133)][_0x456f02(0xd7)][_0x456f02(0xa0)]+_0xb5471b[_0x456f02(0x133)]['textKnowledgeBases'][_0x456f02(0xa0)]+_0xb5471b['counts'][_0x456f02(0xbe)]['unchanged'];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0xb5471b['projectName']+'\x27:'),console[_0x456f02(0xee)]('\x20\x20'+a4_0x582f7a[_0x456f02(0xbd)]('+\x20'+_0x2abaa6+_0x456f02(0xf7))+_0x456f02(0x127)+a4_0x582f7a['yellow']('~\x20'+_0x23cee7+_0x456f02(0xf2))+_0x456f02(0x127)+a4_0x582f7a[_0x456f02(0xc3)]('=\x20'+_0x165cb6+_0x456f02(0x108))),console[_0x456f02(0xee)](_0x456f02(0xdb)+formatCountSummary(_0xb5471b[_0x456f02(0x133)][_0x456f02(0xb6)])),console[_0x456f02(0xee)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xb5471b[_0x456f02(0x133)][_0x456f02(0xd7)])),console[_0x456f02(0xee)](_0x456f02(0xe9)+formatCountSummary(_0xb5471b[_0x456f02(0x133)][_0x456f02(0xf3)])),console[_0x456f02(0xee)](_0x456f02(0x11e)+formatCountSummary(_0xb5471b[_0x456f02(0x133)][_0x456f02(0xbe)])),console['log'](_0x456f02(0xba)+a4_0x582f7a[_0x456f02(0xce)](_0xb5471b[_0x456f02(0xc0)])),displayDiffs(_0xb5471b[_0x456f02(0xb6)],_0xb5471b[_0x456f02(0xd7)],_0xb5471b[_0x456f02(0xf3)],_0xb5471b['prompts']);if(_0x3cf6fd)return console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xed)](_0x456f02(0xd3))),0x0;if(_0x2abaa6===0x0&&_0x23cee7===0x0)return console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xbd)](_0x456f02(0xd9))),saveSessionContext({'llm_project':_0xb5471b[_0x456f02(0x134)]},_0x309c38['session']),console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xbd)](_0x456f02(0x11a)+a4_0x582f7a[_0x456f02(0xc3)]('llm_project')+_0x456f02(0xef)+a4_0x582f7a[_0x456f02(0xce)](_0xb5471b[_0x456f02(0x134)]))),0x0;if(!_0x544717&&!_0x3b00f8){const _0x36429b=await confirmKey(_0x456f02(0xae)+(_0x2abaa6+_0x23cee7)+_0x456f02(0xe1));if(!_0x36429b)return console['log'](_0x456f02(0xdf)),0x0;}const {data:_0x4dfaa6}=await withSpinner(_0x456f02(0x116),()=>_0x305fd2[_0x456f02(0x105)][_0x456f02(0x118)](_0x424a37,_0x18a326,{'force':_0x3b00f8}));return console['log'](a4_0x582f7a[_0x456f02(0xbd)](_0x456f02(0x10e)+(_0x2abaa6+_0x23cee7)+_0x456f02(0xbc)+_0x4dfaa6[_0x456f02(0xc0)])),saveSessionContext({'llm_project':_0x4dfaa6['projectName']},_0x309c38[_0x456f02(0xca)]),console[_0x456f02(0xee)](a4_0x582f7a[_0x456f02(0xbd)](_0x456f02(0x11a)+a4_0x582f7a[_0x456f02(0xc3)](_0x456f02(0xdc))+_0x456f02(0xef)+a4_0x582f7a[_0x456f02(0xce)](_0x4dfaa6[_0x456f02(0x134)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x6da52a(0x10f)]=a4_0x6da52a(0x128);async[a4_0x6da52a(0x11f)](_0x4eb6e0){const _0x17b941=a4_0x6da52a,{options:_0x3fef46,args:_0x224317,tdx:_0x64ab5e}=_0x4eb6e0,_0x12b994=_0x224317[0x0],_0x4b215b=_0x3fef46[_0x17b941(0xd4)],_0x368a6b=_0x3fef46[_0x17b941(0x119)],_0x2e6bcf=_0x3fef46['yes'],_0xf38ffe=_0x3fef46['site'],_0x2ec23b=_0x3fef46[_0x17b941(0xff)];let _0x59e7d1;const _0x9b0f60=findAgentConfigPath(process[_0x17b941(0xf1)]());if(_0x12b994){const _0x5a779d=a4_0x323037[_0x17b941(0xec)](_0x12b994,_0x17b941(0x13d));existsSync(_0x5a779d)?(_0x59e7d1=_0x12b994,console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0xc3)](_0x17b941(0x129)+_0x12b994))):_0x59e7d1=_0x12b994;}else{if(_0x9b0f60)_0x59e7d1=a4_0x323037[_0x17b941(0x13a)](_0x9b0f60),console['log'](a4_0x582f7a[_0x17b941(0xc3)](_0x17b941(0xc6)+_0x59e7d1));else{if(_0x2ec23b){const _0xd0973d=normalizeName(_0x2ec23b),_0x25d139=a4_0x323037[_0x17b941(0xec)](process[_0x17b941(0xf1)](),_0x17b941(0xb6),_0xd0973d,_0x17b941(0x13d));if(existsSync(_0x25d139))_0x59e7d1=a4_0x323037[_0x17b941(0x13a)](_0x25d139),console[_0x17b941(0xee)](a4_0x582f7a['dim']('Using\x20local\x20project:\x20'+_0x59e7d1));else{const _0xf7323c=_0x3fef46['profile'];if(_0xf7323c)throw new SDKError(ErrorCode[_0x17b941(0xfb)],_0x17b941(0xa1)+_0x2ec23b+_0x17b941(0x10a),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x17b941(0xeb)+(_0x17b941(0x101)+_0x2ec23b+'\x0a')+(_0x17b941(0xa5)+_0xd0973d+'\x20--name\x20'+(_0x4b215b||'<new-name>')+'\x20--profile\x20'+_0xf7323c)});_0x59e7d1=_0x2ec23b,console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0xc3)](_0x17b941(0xf9)+_0x2ec23b));}}}}if(!_0x59e7d1)return console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0xed)](_0x17b941(0xf0))),console[_0x17b941(0xee)](_0x17b941(0xcf)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x17b941(0xee)](_0x17b941(0xe0)),console['log'](_0x17b941(0x12f)),0x1;if(!_0x4b215b)throw new SDKError(ErrorCode[_0x17b941(0x12d)],_0x17b941(0x121),undefined,{'helpText':_0x17b941(0xe3)});if(!_0x2e6bcf&&!_0x368a6b){const _0x4aa0b6=await confirmKey(_0x17b941(0xe8)+_0x59e7d1+'\x22\x20to\x20new\x20project\x20\x22'+_0x4b215b+'\x22?');if(!_0x4aa0b6)return console[_0x17b941(0xee)]('Clone\x20cancelled'),0x0;}const {data:_0x571307}=await withSpinner(_0x17b941(0xaa)+_0x59e7d1+_0x17b941(0x117)+_0x4b215b+_0x17b941(0x12b),()=>_0x64ab5e[_0x17b941(0x105)][_0x17b941(0x10c)](_0x59e7d1,_0x4b215b,{'dryRun':_0x368a6b}));if(_0x368a6b)return console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0xed)](_0x17b941(0xa9))),console['log'](_0x17b941(0xfd)+_0x571307['sourceProjectName']),console[_0x17b941(0xee)](_0x17b941(0xda)+_0x4b215b),console[_0x17b941(0xee)](_0x17b941(0x102)),console[_0x17b941(0xee)](_0x17b941(0xdb)+_0x571307[_0x17b941(0x133)][_0x17b941(0xb6)][_0x17b941(0xa2)]),console['log'](_0x17b941(0x106)+_0x571307[_0x17b941(0x133)][_0x17b941(0xd7)]['created']),console[_0x17b941(0xee)](_0x17b941(0x11e)+_0x571307[_0x17b941(0x133)]['prompts']['created']),0x0;const _0x335a09=_0x571307[_0x17b941(0x133)][_0x17b941(0xb6)]['errors']>0x0||_0x571307['counts'][_0x17b941(0xd7)]['errors']>0x0||_0x571307[_0x17b941(0x133)][_0x17b941(0xbe)][_0x17b941(0xdd)]>0x0;_0x335a09?console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0xed)](_0x17b941(0x130))):console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0xbd)](_0x17b941(0x11c)));console[_0x17b941(0xee)](_0x17b941(0xfd)+_0x571307['sourceProjectName']),console['log'](_0x17b941(0xda)+_0x571307[_0x17b941(0xe7)]),console[_0x17b941(0xee)](_0x17b941(0x12c)+_0x571307[_0x17b941(0xbb)]),console[_0x17b941(0xee)](),console[_0x17b941(0xee)](_0x17b941(0x124)),console['log'](_0x17b941(0xdb)+formatCountSummary(_0x571307[_0x17b941(0x133)][_0x17b941(0xb6)])),console[_0x17b941(0xee)](_0x17b941(0x106)+formatCountSummary(_0x571307[_0x17b941(0x133)][_0x17b941(0xd7)])),console[_0x17b941(0xee)](_0x17b941(0x11e)+formatCountSummary(_0x571307[_0x17b941(0x133)]['prompts']));if(_0x335a09){console['log'](),console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0x137)](_0x17b941(0x12a)));for(const _0x24cc87 of _0x571307[_0x17b941(0xb6)]){_0x24cc87['action']==='error'&&console[_0x17b941(0xee)](a4_0x582f7a[_0x17b941(0x137)](_0x17b941(0xf6)+_0x24cc87[_0x17b941(0x104)]+_0x17b941(0x126)+_0x24cc87[_0x17b941(0xfa)]));}for(const _0xc70453 of _0x571307[_0x17b941(0xd7)]){_0xc70453[_0x17b941(0xac)]===_0x17b941(0xfa)&&console[_0x17b941(0xee)](a4_0x582f7a['red'](_0x17b941(0x131)+_0xc70453[_0x17b941(0xd4)]+_0x17b941(0x126)+_0xc70453['error']));}for(const _0x5d48fa of _0x571307['prompts']){_0x5d48fa[_0x17b941(0xac)]===_0x17b941(0xfa)&&console[_0x17b941(0xee)](a4_0x582f7a['red']('\x20\x20Prompt\x20\x22'+_0x5d48fa['name']+'\x22:\x20'+_0x5d48fa[_0x17b941(0xfa)]));}return 0x1;}console[_0x17b941(0xee)]();const _0x2f1e76=getLLMProjectUrl(_0xf38ffe,_0x571307[_0x17b941(0xbb)]);return console['log'](_0x17b941(0xb3)+a4_0x582f7a[_0x17b941(0xce)](_0x2f1e76)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x6da52a(0xd4)]=a4_0x6da52a(0xc4);[a4_0x6da52a(0x10f)]=a4_0x6da52a(0x10b);async[a4_0x6da52a(0x11f)](_0x2481ea){const _0x40bcd5=a4_0x6da52a,{options:_0x35137e,args:_0x17659e,tdx:_0x1c1a46}=_0x2481ea;let _0x425e5c=_0x17659e[0x0]||process[_0x40bcd5(0xf1)]();const _0x459d3e=_0x35137e[_0x40bcd5(0x119)],_0x219a05=_0x35137e[_0x40bcd5(0xb9)],_0x46551d=_0x35137e[_0x40bcd5(0x109)],_0x2b3b43=_0x35137e['site'],_0x2a45c3=a4_0x323037['join'](_0x425e5c,_0x40bcd5(0xb2)),_0x3fb036=existsSync(_0x2a45c3);if(_0x3fb036){const {data:_0x40c868}=await withSpinner(_0x40bcd5(0xc8)+_0x425e5c+_0x40bcd5(0x12b),()=>_0x1c1a46[_0x40bcd5(0x105)][_0x40bcd5(0xaf)](_0x425e5c,{'dryRun':_0x459d3e,'force':_0x219a05}));if(_0x459d3e)return console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0xed)](_0x40bcd5(0xa9))),console['log'](_0x40bcd5(0x113)+_0x40c868[_0x40bcd5(0x104)]),0x0;if(_0x40c868[_0x40bcd5(0xac)]===_0x40bcd5(0xfa))return console[_0x40bcd5(0xee)](a4_0x582f7a['red']('Failed\x20to\x20push\x20agent:\x20'+_0x40c868[_0x40bcd5(0xfa)])),0x1;console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0xbd)](_0x40bcd5(0xab)+_0x40c868[_0x40bcd5(0xac)]+_0x40bcd5(0xe5))),console[_0x40bcd5(0xee)](_0x40bcd5(0xc2)+_0x40c868['agentName']);if(_0x40c868[_0x40bcd5(0x138)]&&_0x40c868[_0x40bcd5(0xa6)]){const _0x41dc1d=getLLMAgentChatUrl(_0x2b3b43,_0x40c868['projectId'],_0x40c868[_0x40bcd5(0x138)]);console['log']('Chat:\x20'+a4_0x582f7a[_0x40bcd5(0xce)](_0x41dc1d));}return 0x0;}let _0x940f94=a4_0x323037[_0x40bcd5(0xec)](_0x425e5c,'tdx.json');if(!existsSync(_0x940f94)){const _0x431bdf=findAgentConfigPath(_0x425e5c);if(_0x431bdf)_0x425e5c=a4_0x323037[_0x40bcd5(0x13a)](_0x431bdf),_0x940f94=_0x431bdf,console['log'](a4_0x582f7a[_0x40bcd5(0xc3)](_0x40bcd5(0xd1)+_0x425e5c));else{const _0x114047=_0x35137e[_0x40bcd5(0xff)];if(_0x114047){const _0x5410ea=normalizeName(_0x114047),_0x363fd8=a4_0x323037[_0x40bcd5(0xec)](_0x425e5c,_0x40bcd5(0xb6)),_0x206e28=a4_0x323037['join'](_0x363fd8,_0x5410ea,_0x40bcd5(0x13d));existsSync(_0x206e28)&&(_0x425e5c=a4_0x323037[_0x40bcd5(0x13a)](_0x206e28),_0x940f94=_0x206e28,console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0xc3)](_0x40bcd5(0xd1)+_0x425e5c)));}if(!existsSync(_0x940f94)){let _0x44846d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x114047&&(_0x44846d='Current\x20context\x20has\x20llm_project=\x22'+_0x114047+_0x40bcd5(0xb7)+(_0x40bcd5(0x13b)+_0x114047+_0x40bcd5(0x122)));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20tdx.json\x20found\x20in\x20'+_0x425e5c,undefined,{'helpText':_0x44846d});}}}const {data:_0xe79581}=await withSpinner(_0x40bcd5(0xde),()=>_0x1c1a46[_0x40bcd5(0x105)][_0x40bcd5(0xcc)](_0x425e5c,{'dryRun':!![]})),_0x1d99cc=_0xe79581[_0x40bcd5(0x133)][_0x40bcd5(0xb6)]['errors']>0x0;if(_0x1d99cc){console['log'](a4_0x582f7a[_0x40bcd5(0x137)](_0x40bcd5(0x11b)));for(const _0x23a545 of _0xe79581['agents']){_0x23a545['action']===_0x40bcd5(0xfa)&&console['log'](a4_0x582f7a[_0x40bcd5(0x137)]('\x20\x20Agent\x20\x22'+_0x23a545[_0x40bcd5(0x104)]+'\x22:\x20'+_0x23a545[_0x40bcd5(0xfa)]));}return 0x1;}const _0x17300b=_0xe79581['counts'][_0x40bcd5(0xb6)]['created']+_0xe79581[_0x40bcd5(0x133)]['knowledgeBases'][_0x40bcd5(0xa2)]+_0xe79581['counts'][_0x40bcd5(0xf3)][_0x40bcd5(0xa2)]+_0xe79581[_0x40bcd5(0x133)][_0x40bcd5(0xbe)][_0x40bcd5(0xa2)],_0x88ce6b=_0xe79581[_0x40bcd5(0x133)][_0x40bcd5(0xb6)][_0x40bcd5(0xcb)]+_0xe79581[_0x40bcd5(0x133)][_0x40bcd5(0xd7)]['updated']+_0xe79581[_0x40bcd5(0x133)][_0x40bcd5(0xf3)][_0x40bcd5(0xcb)]+_0xe79581[_0x40bcd5(0x133)]['prompts']['updated'],_0x49f97a=_0xe79581['counts']['agents'][_0x40bcd5(0xa0)]+_0xe79581['counts'][_0x40bcd5(0xd7)][_0x40bcd5(0xa0)]+_0xe79581[_0x40bcd5(0x133)]['textKnowledgeBases'][_0x40bcd5(0xa0)]+_0xe79581['counts']['prompts'][_0x40bcd5(0xa0)];console[_0x40bcd5(0xee)](_0x40bcd5(0xad)+_0xe79581[_0x40bcd5(0x134)]+'\x27:'),console[_0x40bcd5(0xee)]('\x20\x20'+a4_0x582f7a['green']('+\x20'+_0x17300b+'\x20new')+_0x40bcd5(0x127)+a4_0x582f7a[_0x40bcd5(0xed)]('~\x20'+_0x88ce6b+_0x40bcd5(0xf2))+_0x40bcd5(0x127)+a4_0x582f7a[_0x40bcd5(0xc3)]('=\x20'+_0x49f97a+_0x40bcd5(0x108))),console[_0x40bcd5(0xee)](_0x40bcd5(0xdb)+formatCountSummary(_0xe79581['counts'][_0x40bcd5(0xb6)])),console['log'](_0x40bcd5(0x106)+formatCountSummary(_0xe79581['counts'][_0x40bcd5(0xd7)])),console[_0x40bcd5(0xee)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xe79581[_0x40bcd5(0x133)]['textKnowledgeBases'])),console[_0x40bcd5(0xee)](_0x40bcd5(0x11e)+formatCountSummary(_0xe79581[_0x40bcd5(0x133)][_0x40bcd5(0xbe)])),console['log'](_0x40bcd5(0x11d)+a4_0x582f7a[_0x40bcd5(0xce)](_0x425e5c)),displayDiffs(_0xe79581[_0x40bcd5(0xb6)],_0xe79581[_0x40bcd5(0xd7)],_0xe79581[_0x40bcd5(0xf3)],_0xe79581['prompts']);if(_0x459d3e)return console[_0x40bcd5(0xee)](a4_0x582f7a['yellow'](_0x40bcd5(0xfe))),0x0;if(_0x17300b===0x0&&_0x88ce6b===0x0){console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0xbd)](_0x40bcd5(0xc9)));const _0x25e92f=getLLMProjectUrl(_0x2b3b43,_0xe79581[_0x40bcd5(0xa6)]);return console[_0x40bcd5(0xee)]('Project:\x20'+a4_0x582f7a[_0x40bcd5(0xce)](_0x25e92f)),0x0;}if(!_0x46551d&&!_0x219a05){const _0x33bebe=await confirmKey(_0x40bcd5(0x111)+(_0x17300b+_0x88ce6b)+_0x40bcd5(0x120));if(!_0x33bebe)return console[_0x40bcd5(0xee)]('Push\x20cancelled'),0x0;}const {data:_0x264bd7}=await withSpinner(_0x40bcd5(0x12e),()=>_0x1c1a46[_0x40bcd5(0x105)][_0x40bcd5(0xcc)](_0x425e5c,{'force':_0x219a05})),_0x32c435=_0x264bd7['counts'][_0x40bcd5(0xb6)]['errors']>0x0||_0x264bd7[_0x40bcd5(0x133)][_0x40bcd5(0xd7)][_0x40bcd5(0xdd)]>0x0||_0x264bd7[_0x40bcd5(0x133)][_0x40bcd5(0xf3)][_0x40bcd5(0xdd)]>0x0||_0x264bd7[_0x40bcd5(0x133)]['prompts'][_0x40bcd5(0xdd)]>0x0;if(_0x32c435){console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0xed)](_0x40bcd5(0xb8))),console['log'](),console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0x137)](_0x40bcd5(0x12a)));for(const _0x4b43e5 of _0x264bd7['agents']){_0x4b43e5[_0x40bcd5(0xac)]==='error'&&console['log'](a4_0x582f7a[_0x40bcd5(0x137)](_0x40bcd5(0xf6)+_0x4b43e5[_0x40bcd5(0x104)]+'\x22:\x20'+_0x4b43e5['error']));}for(const _0xfd6f3c of _0x264bd7[_0x40bcd5(0xd7)]){_0xfd6f3c[_0x40bcd5(0xac)]===_0x40bcd5(0xfa)&&console['log'](a4_0x582f7a[_0x40bcd5(0x137)](_0x40bcd5(0x131)+_0xfd6f3c[_0x40bcd5(0xd4)]+_0x40bcd5(0x126)+_0xfd6f3c[_0x40bcd5(0xfa)]));}for(const _0x58e1a5 of _0x264bd7[_0x40bcd5(0xf3)]){_0x58e1a5[_0x40bcd5(0xac)]===_0x40bcd5(0xfa)&&console[_0x40bcd5(0xee)](a4_0x582f7a[_0x40bcd5(0x137)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x58e1a5['name']+_0x40bcd5(0x126)+_0x58e1a5['error']));}for(const _0x587d1f of _0x264bd7[_0x40bcd5(0xbe)]){_0x587d1f[_0x40bcd5(0xac)]===_0x40bcd5(0xfa)&&console['log'](a4_0x582f7a[_0x40bcd5(0x137)]('\x20\x20Prompt\x20\x22'+_0x587d1f[_0x40bcd5(0xd4)]+_0x40bcd5(0x126)+_0x587d1f[_0x40bcd5(0xfa)]));}return 0x1;}console[_0x40bcd5(0xee)](a4_0x582f7a['green']('\x0a✔\x20Pushed\x20'+(_0x17300b+_0x88ce6b)+_0x40bcd5(0xb0)+_0x264bd7[_0x40bcd5(0x134)]+'\x27'));const _0x2362a8=getLLMProjectUrl(_0x2b3b43,_0x264bd7[_0x40bcd5(0xa6)]);return console[_0x40bcd5(0xee)](_0x40bcd5(0xb3)+a4_0x582f7a[_0x40bcd5(0xce)](_0x2362a8)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x2d19ee=a5_0x5623;(function(_0x381bde,_0x36c511){const _0x21eba4=a5_0x5623,_0x4f9a50=_0x381bde();while(!![]){try{const _0x395b79=-parseInt(_0x21eba4(0x1fd))/0x1+-parseInt(_0x21eba4(0x217))/0x2+parseInt(_0x21eba4(0x1f1))/0x3*(parseInt(_0x21eba4(0x228))/0x4)+parseInt(_0x21eba4(0x220))/0x5+-parseInt(_0x21eba4(0x1ee))/0x6*(-parseInt(_0x21eba4(0x20e))/0x7)+parseInt(_0x21eba4(0x215))/0x8*(parseInt(_0x21eba4(0x1f9))/0x9)+parseInt(_0x21eba4(0x20f))/0xa;if(_0x395b79===_0x36c511)break;else _0x4f9a50['push'](_0x4f9a50['shift']());}catch(_0x4099cb){_0x4f9a50['push'](_0x4f9a50['shift']());}}}(a5_0x78e4,0xc2cd8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a5_0x5623(_0x335587,_0x40ceea){_0x335587=_0x335587-0x1eb;const _0x78e42a=a5_0x78e4();let _0x5623f=_0x78e42a[_0x335587];return _0x5623f;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a5_0x2d19ee(0x200),a5_0x2d19ee(0x1f7),a5_0x2d19ee(0x222),'set-cookie','set-cookie2',a5_0x2d19ee(0x22c),a5_0x2d19ee(0x227),'x-trino-user']);function isSensitiveHeader(_0xaa36fc){const _0x265436=a5_0x2d19ee;return SENSITIVE_HEADERS['has'](_0xaa36fc[_0x265436(0x204)]());}function parseHeader(_0x5ec485){const _0x3de4c1=a5_0x2d19ee,_0x18d344=_0x5ec485['indexOf'](':');if(_0x18d344===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5ec485+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0xfd32af=_0x5ec485[_0x3de4c1(0x208)](0x0,_0x18d344)[_0x3de4c1(0x21c)](),_0x3f825e=_0x5ec485[_0x3de4c1(0x208)](_0x18d344+0x1)[_0x3de4c1(0x21c)]();if(!_0xfd32af)throw new Error(_0x3de4c1(0x219)+_0x5ec485+'\x22');return[_0xfd32af,_0x3f825e];}export class ApiCommand extends BaseCommand{[a5_0x2d19ee(0x21e)]=a5_0x2d19ee(0x1ff);[a5_0x2d19ee(0x225)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a5_0x2d19ee(0x216)](_0x58651e){const _0x5e0c42=a5_0x2d19ee,{args:_0x1c56e9,options:_0x407373}=_0x58651e,_0x45a088=_0x407373;if(_0x1c56e9[_0x5e0c42(0x1fb)]===0x0)return _0x5e0c42(0x20c);const _0x565e7e=_0x1c56e9[0x0];if(!_0x565e7e[_0x5e0c42(0x22a)]('/'))return _0x5e0c42(0x21a)+_0x565e7e;const _0x4cf1a0=_0x45a088[_0x5e0c42(0x1f8)],_0x7e9c0e=_0x45a088[_0x5e0c42(0x1fa)];if(_0x4cf1a0&&_0x7e9c0e)return _0x5e0c42(0x21f);const _0x43b6cd=_0x45a088[_0x5e0c42(0x1eb)]||_0x5e0c42(0x22b),_0x3f933f=[_0x5e0c42(0x22b),_0x5e0c42(0x221),_0x5e0c42(0x201),'DELETE',_0x5e0c42(0x1ed)];if(!_0x3f933f[_0x5e0c42(0x22d)](_0x43b6cd[_0x5e0c42(0x202)]()))return _0x5e0c42(0x207)+_0x43b6cd+_0x5e0c42(0x226)+_0x3f933f[_0x5e0c42(0x224)](',\x20');const _0x11cb1c=_0x45a088['type']||'td',_0x9872b3=['td',_0x5e0c42(0x1ec),'workflow',_0x5e0c42(0x20b),_0x5e0c42(0x212),_0x5e0c42(0x218)];if(!_0x9872b3['includes'](_0x11cb1c))return _0x5e0c42(0x1f5)+_0x11cb1c+_0x5e0c42(0x20d)+_0x9872b3['join'](',\x20');return undefined;}async['execute'](_0x4c4983){const _0xa64386=a5_0x2d19ee,{options:_0x12a4e0,args:_0x8d1804,tdx:_0x426f18}=_0x4c4983,_0x4f158b=_0x12a4e0,_0x4684c8=_0x8d1804[0x0],_0x29a5db=(_0x4f158b[_0xa64386(0x1eb)]||_0xa64386(0x22b))[_0xa64386(0x202)](),_0x1ffa13=_0x4f158b[_0xa64386(0x1f8)],_0xfa94=_0x4f158b[_0xa64386(0x1fa)],_0x1d3e56=_0x4f158b[_0xa64386(0x1f3)],_0x13e426=_0x4f158b[_0xa64386(0x210)]||'td';try{const _0x1abb42={};if(_0x1d3e56){const _0x2d4be8=Array[_0xa64386(0x1fe)](_0x1d3e56)?_0x1d3e56:[_0x1d3e56];for(const _0x5c9aaf of _0x2d4be8){const [_0x494925,_0x3d4680]=parseHeader(_0x5c9aaf);_0x1abb42[_0x494925]=_0x3d4680;}}let _0x403ca9;if(_0x1ffa13)_0x403ca9=_0x1ffa13;else{if(_0xfa94)try{_0x403ca9=RawAPI[_0xa64386(0x20a)](_0xfa94);}catch(_0x10c1d3){return console[_0xa64386(0x21b)]('Error:\x20'+(_0x10c1d3 instanceof Error?_0x10c1d3['message']:String(_0x10c1d3))),0x1;}}const _0x43bbcb={'method':_0x29a5db,'apiType':_0x13e426,'includeHeaders':_0x12a4e0[_0xa64386(0x1f4)]};_0x403ca9&&(_0x43bbcb[_0xa64386(0x223)]=_0x403ca9);Object[_0xa64386(0x209)](_0x1abb42)[_0xa64386(0x1fb)]>0x0&&(_0x43bbcb[_0xa64386(0x1f0)]=_0x1abb42);if(_0x12a4e0[_0xa64386(0x1f4)]){const _0x5aeed0=resolveSite(_0x12a4e0[_0xa64386(0x1f6)]),_0x3beeaf=getEndpoint(_0x5aeed0,_0x13e426),_0x5ec095=''+_0x3beeaf+_0x4684c8;console[_0xa64386(0x21b)]('>\x20'+_0x29a5db+'\x20'+_0x5ec095);const _0x4b0299=getAuthHeaders(_0x5aeed0),_0x395e30={..._0x4b0299,..._0x1abb42};for(const [_0x350a56,_0x400da4]of Object[_0xa64386(0x22e)](_0x395e30)){!isSensitiveHeader(_0x350a56)&&console[_0xa64386(0x21b)]('>\x20'+_0x350a56+':\x20'+_0x400da4);}_0x403ca9&&console['error']('>'),console['error']('');}const _0x2fba39=await _0x426f18[_0xa64386(0x1ff)][_0xa64386(0x1fc)](_0x4684c8,_0x43bbcb);if(_0x12a4e0[_0xa64386(0x1f4)]&&_0x2fba39[_0xa64386(0x1f0)]){console[_0xa64386(0x21b)](_0xa64386(0x1ef)+_0x2fba39[_0xa64386(0x213)]);for(const [_0x25f606,_0x2eaf3d]of Object[_0xa64386(0x22e)](_0x2fba39[_0xa64386(0x1f0)])){!isSensitiveHeader(_0x25f606)&&console[_0xa64386(0x21b)]('<\x20'+_0x25f606+':\x20'+_0x2eaf3d);}console['error']('');}const _0x4eb067=Boolean(_0x12a4e0['output']),_0x197923={'color':_0x12a4e0[_0xa64386(0x211)],'noColor':_0x12a4e0[_0xa64386(0x1f2)]||_0x4eb067&&!_0x12a4e0[_0xa64386(0x211)]},_0x29ca0c=colorizeJSON(_0x2fba39['data'],_0x197923);return _0x12a4e0['output']?(writeFileSync(_0x12a4e0[_0xa64386(0x229)],_0x29ca0c),console['error'](_0xa64386(0x214)+_0x12a4e0[_0xa64386(0x229)])):console['log'](_0x29ca0c),0x0;}catch(_0x412be1){return _0x412be1 instanceof Error?(console[_0xa64386(0x21b)](_0xa64386(0x203)+_0x412be1[_0xa64386(0x21d)]),_0x12a4e0[_0xa64386(0x1f4)]&&_0x412be1[_0xa64386(0x206)]&&console[_0xa64386(0x21b)](_0xa64386(0x205)+_0x412be1[_0xa64386(0x206)])):console[_0xa64386(0x21b)](_0xa64386(0x203)+String(_0x412be1)),0x1;}}}function a5_0x78e4(){const _0x463003=['3082948ByAOdt','llm-proxy','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Endpoint\x20must\x20start\x20with\x20/:\x20','error','trim','message','name','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','3627940ggRcYd','POST','cookie','body','join','description','.\x20Valid\x20methods:\x20','x-auth-token','28vyNBqa','output','startsWith','GET','x-xsrf-token','includes','entries','method','cdp','PATCH','14394osDivS','<\x20HTTP/1.1\x20','headers','227994hmtObr','noColor','header','verbose','Invalid\x20API\x20type:\x20','site','proxy-authorization','data','45cNBUMe','file','length','request','262472HXawfi','isArray','api','authorization','PUT','toUpperCase','Error:\x20','toLowerCase','\x0aStack\x20trace:\x0a','stack','Invalid\x20HTTP\x20method:\x20','substring','keys','readBodyFromFile','trino','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','.\x20Valid\x20types:\x20','658YZktaB','6157130uZvEbn','type','color','llm','status','Results\x20saved\x20to\x20','804904TIaMlR','validate'];a5_0x78e4=function(){return _0x463003;};return a5_0x78e4();}
1
+ const a5_0x2fc6bd=a5_0x36df;(function(_0xa2d416,_0x4a5a31){const _0x5a4ad3=a5_0x36df,_0x4331f2=_0xa2d416();while(!![]){try{const _0x99b915=-parseInt(_0x5a4ad3(0x17f))/0x1*(parseInt(_0x5a4ad3(0x164))/0x2)+parseInt(_0x5a4ad3(0x16a))/0x3+-parseInt(_0x5a4ad3(0x18e))/0x4*(-parseInt(_0x5a4ad3(0x176))/0x5)+parseInt(_0x5a4ad3(0x18c))/0x6+parseInt(_0x5a4ad3(0x193))/0x7*(parseInt(_0x5a4ad3(0x174))/0x8)+parseInt(_0x5a4ad3(0x188))/0x9+-parseInt(_0x5a4ad3(0x182))/0xa;if(_0x99b915===_0x4a5a31)break;else _0x4331f2['push'](_0x4331f2['shift']());}catch(_0x177b9f){_0x4331f2['push'](_0x4331f2['shift']());}}}(a5_0x5124,0x40427));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a5_0x36df(_0x203572,_0x445ae9){_0x203572=_0x203572-0x158;const _0x512429=a5_0x5124();let _0x36df31=_0x512429[_0x203572];return _0x36df31;}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a5_0x2fc6bd(0x189),a5_0x2fc6bd(0x163),a5_0x2fc6bd(0x18b),'set-cookie2','x-xsrf-token',a5_0x2fc6bd(0x169),a5_0x2fc6bd(0x195)]);function isSensitiveHeader(_0x47854d){return SENSITIVE_HEADERS['has'](_0x47854d['toLowerCase']());}function parseHeader(_0x202e1a){const _0x5c0709=a5_0x2fc6bd,_0x4e21c6=_0x202e1a[_0x5c0709(0x184)](':');if(_0x4e21c6===-0x1)throw new Error(_0x5c0709(0x15d)+_0x202e1a+_0x5c0709(0x15e)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x2de9fa=_0x202e1a[_0x5c0709(0x177)](0x0,_0x4e21c6)[_0x5c0709(0x181)](),_0x4c8927=_0x202e1a['substring'](_0x4e21c6+0x1)[_0x5c0709(0x181)]();if(!_0x2de9fa)throw new Error(_0x5c0709(0x186)+_0x202e1a+'\x22');return[_0x2de9fa,_0x4c8927];}function a5_0x5124(){const _0x1a5ab1=['3681765DUaxjn','proxy-authorization','isArray','set-cookie','1600458TLwdnA','name','20RwKtub','output','body','Invalid\x20HTTP\x20method:\x20','Error:\x20','4529ZEUgqZ','site','x-trino-user','workflow','<\x20HTTP/1.1\x20','toUpperCase','POST','\x0aStack\x20trace:\x0a','.\x20Valid\x20types:\x20','Invalid\x20header\x20format:\x20\x22','\x22.\x20','api','llm','request','file','cookie','14272KlNMOj','status','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','DELETE','includes','x-auth-token','1104375YYWArM','data','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','error','description','verbose','GET','trino','.\x20Valid\x20methods:\x20','type','6320uQWGXF','method','517935OmuSPz','substring','length','readBodyFromFile','startsWith','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','join','validate','execute','46gjDlGr','header','trim','14815550KQTwGf','Endpoint\x20must\x20start\x20with\x20/:\x20','indexOf','stack','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','color'];a5_0x5124=function(){return _0x1a5ab1;};return a5_0x5124();}export class ApiCommand extends BaseCommand{[a5_0x2fc6bd(0x18d)]=a5_0x2fc6bd(0x15f);[a5_0x2fc6bd(0x16e)]=a5_0x2fc6bd(0x16c);[a5_0x2fc6bd(0x17d)](_0x1a2544){const _0x16e417=a5_0x2fc6bd,{args:_0x3e01d8,options:_0x5bd6b0}=_0x1a2544,_0xfd2716=_0x5bd6b0;if(_0x3e01d8[_0x16e417(0x178)]===0x0)return _0x16e417(0x17b);const _0x18db2f=_0x3e01d8[0x0];if(!_0x18db2f[_0x16e417(0x17a)]('/'))return _0x16e417(0x183)+_0x18db2f;const _0x1d8206=_0xfd2716['data'],_0xd4788b=_0xfd2716[_0x16e417(0x162)];if(_0x1d8206&&_0xd4788b)return _0x16e417(0x166);const _0x18c276=_0xfd2716['method']||_0x16e417(0x170),_0x4962fb=[_0x16e417(0x170),_0x16e417(0x15a),'PUT',_0x16e417(0x167),'PATCH'];if(!_0x4962fb[_0x16e417(0x168)](_0x18c276[_0x16e417(0x159)]()))return _0x16e417(0x191)+_0x18c276+_0x16e417(0x172)+_0x4962fb[_0x16e417(0x17c)](',\x20');const _0x10aea1=_0xfd2716['type']||'td',_0x4d2748=['td','cdp',_0x16e417(0x196),_0x16e417(0x171),_0x16e417(0x160),'llm-proxy'];if(!_0x4d2748['includes'](_0x10aea1))return'Invalid\x20API\x20type:\x20'+_0x10aea1+_0x16e417(0x15c)+_0x4d2748[_0x16e417(0x17c)](',\x20');return undefined;}async[a5_0x2fc6bd(0x17e)](_0x3eab96){const _0x47171a=a5_0x2fc6bd,{options:_0x1737e8,args:_0x508400,tdx:_0x49d847}=_0x3eab96,_0x23f4da=_0x1737e8,_0x46116f=_0x508400[0x0],_0x41507e=(_0x23f4da[_0x47171a(0x175)]||_0x47171a(0x170))[_0x47171a(0x159)](),_0x212c2c=_0x23f4da[_0x47171a(0x16b)],_0x53927a=_0x23f4da[_0x47171a(0x162)],_0x17ccbd=_0x23f4da[_0x47171a(0x180)],_0x18f05c=_0x23f4da[_0x47171a(0x173)]||'td';try{const _0x3913f8={};if(_0x17ccbd){const _0x581891=Array[_0x47171a(0x18a)](_0x17ccbd)?_0x17ccbd:[_0x17ccbd];for(const _0x247110 of _0x581891){const [_0x161822,_0x242e5d]=parseHeader(_0x247110);_0x3913f8[_0x161822]=_0x242e5d;}}let _0x4ac411;if(_0x212c2c)_0x4ac411=_0x212c2c;else{if(_0x53927a)try{_0x4ac411=RawAPI[_0x47171a(0x179)](_0x53927a);}catch(_0x173b75){return console['error'](_0x47171a(0x192)+(_0x173b75 instanceof Error?_0x173b75['message']:String(_0x173b75))),0x1;}}const _0x53aa37={'method':_0x41507e,'apiType':_0x18f05c,'includeHeaders':_0x1737e8[_0x47171a(0x16f)]};_0x4ac411&&(_0x53aa37[_0x47171a(0x190)]=_0x4ac411);Object['keys'](_0x3913f8)[_0x47171a(0x178)]>0x0&&(_0x53aa37['headers']=_0x3913f8);if(_0x1737e8[_0x47171a(0x16f)]){const _0x23ef0c=resolveSite(_0x1737e8[_0x47171a(0x194)]),_0x5015ce=getEndpoint(_0x23ef0c,_0x18f05c),_0x2a834e=''+_0x5015ce+_0x46116f;console[_0x47171a(0x16d)]('>\x20'+_0x41507e+'\x20'+_0x2a834e);const _0x3d9812=getAuthHeaders(_0x23ef0c),_0xad6a62={..._0x3d9812,..._0x3913f8};for(const [_0x4d51f4,_0x24eca1]of Object['entries'](_0xad6a62)){!isSensitiveHeader(_0x4d51f4)&&console[_0x47171a(0x16d)]('>\x20'+_0x4d51f4+':\x20'+_0x24eca1);}_0x4ac411&&console[_0x47171a(0x16d)]('>'),console[_0x47171a(0x16d)]('');}const _0x3f7989=await _0x49d847[_0x47171a(0x15f)][_0x47171a(0x161)](_0x46116f,_0x53aa37);if(_0x1737e8[_0x47171a(0x16f)]&&_0x3f7989['headers']){console[_0x47171a(0x16d)](_0x47171a(0x158)+_0x3f7989[_0x47171a(0x165)]);for(const [_0x6c25e1,_0x48e2a9]of Object['entries'](_0x3f7989['headers'])){!isSensitiveHeader(_0x6c25e1)&&console['error']('<\x20'+_0x6c25e1+':\x20'+_0x48e2a9);}console[_0x47171a(0x16d)]('');}const _0x11d342=Boolean(_0x1737e8[_0x47171a(0x18f)]),_0x247381={'color':_0x1737e8['color'],'noColor':_0x1737e8['noColor']||_0x11d342&&!_0x1737e8[_0x47171a(0x187)]},_0x4178fd=colorizeJSON(_0x3f7989['data'],_0x247381);return _0x1737e8[_0x47171a(0x18f)]?(writeFileSync(_0x1737e8[_0x47171a(0x18f)],_0x4178fd),console[_0x47171a(0x16d)]('Results\x20saved\x20to\x20'+_0x1737e8[_0x47171a(0x18f)])):console['log'](_0x4178fd),0x0;}catch(_0xc9a163){return _0xc9a163 instanceof Error?(console[_0x47171a(0x16d)](_0x47171a(0x192)+_0xc9a163['message']),_0x1737e8['verbose']&&_0xc9a163[_0x47171a(0x185)]&&console[_0x47171a(0x16d)](_0x47171a(0x15b)+_0xc9a163[_0x47171a(0x185)])):console[_0x47171a(0x16d)]('Error:\x20'+String(_0xc9a163)),0x1;}}}
@@ -1 +1 @@
1
- const a6_0x123842=a6_0x5029;(function(_0x2893f4,_0x513e92){const _0x397acc=a6_0x5029,_0x14c9c3=_0x2893f4();while(!![]){try{const _0x5a773c=parseInt(_0x397acc(0x138))/0x1+-parseInt(_0x397acc(0x132))/0x2*(parseInt(_0x397acc(0x148))/0x3)+-parseInt(_0x397acc(0x16f))/0x4*(parseInt(_0x397acc(0x142))/0x5)+-parseInt(_0x397acc(0x136))/0x6*(-parseInt(_0x397acc(0x139))/0x7)+-parseInt(_0x397acc(0x16a))/0x8*(parseInt(_0x397acc(0x14a))/0x9)+-parseInt(_0x397acc(0x15e))/0xa*(-parseInt(_0x397acc(0x131))/0xb)+parseInt(_0x397acc(0x13d))/0xc*(parseInt(_0x397acc(0x16c))/0xd);if(_0x5a773c===_0x513e92)break;else _0x14c9c3['push'](_0x14c9c3['shift']());}catch(_0x292a15){_0x14c9c3['push'](_0x14c9c3['shift']());}}}(a6_0x45b7,0x32ed2));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a6_0x5029(_0x41727a,_0x135942){_0x41727a=_0x41727a-0x126;const _0x45b74b=a6_0x45b7();let _0x5029bf=_0x45b74b[_0x41727a];return _0x5029bf;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a6_0x13fd8f from'prompts';function a6_0x45b7(){const _0x45f1f1=['754212hcDddT','API\x20key\x20cannot\x20be\x20empty','Enter\x20site\x20name:','User:\x20','181824qjHuut','red','278707yaFjuW','28SeoeNO','push','✓\x20Profile\x20\x27','Setup\x20API\x20key\x20authentication\x20interactively','1263036Jeyyqy','Name:\x20','\x0aSetup\x20cancelled','\x20\x20tdx','create','40QvEoVk','ap02','trim','No\x20credential\x20found','eu\x20\x20\x20-\x20Europe','jp\x20\x20\x20-\x20Japan','3UQDppE','bold','260460fEeOfC','green','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Enter\x20custom\x20site','email','text','customSite','Read\x20credential\x20from\x20','value','apiKey','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','name','ERROR','other','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','jobs','us\x20\x20\x20-\x20United\x20States','✓\x20API\x20key\x20removed\x20from\x20keychain','Site\x20name\x20cannot\x20be\x20empty','10SHJiHS','\x27\x20registered','test','status','\x20--profile\x20','auth','profile','site','Remove\x20API\x20key\x20from\x20system\x20keychain','tdx:\x20auth\x20setup','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','yellow','112UfdFCU','last_name','39FizYCj','error','auth:setup','30836YkewjV','tdx:\x20auth\x20clear','warn','log','description','Enter\x20your\x20TD\x20API\x20key:','N/A','us01','ap02\x20-\x20Korea','\x20(profile:\x20','first_name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','filter','✗\x20Validation\x20failed:\x20','password','jp01','/app/mp/ak','\x20(site:\x20','findIndex','getUserInfo','tdx\x20profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','No\x20API\x20key\x20found\x20in\x20keychain','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Select\x20your\x20Treasure\x20Data\x20site:','message','execute','auth:clear','3705350CQpUrd'];a6_0x45b7=function(){return _0x45f1f1;};return a6_0x45b7();}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a6_0x4137f1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a6_0x123842(0x156)]=a6_0x123842(0x16e);[a6_0x123842(0x173)]=a6_0x123842(0x13c);async[a6_0x123842(0x12f)](_0x34c81d){const _0x19d2d4=a6_0x123842,{options:_0x26e9e7}=_0x34c81d,_0xadb9e1=_0x26e9e7[_0x19d2d4(0x164)];console['log'](a6_0x4137f1[_0x19d2d4(0x149)](_0x19d2d4(0x167)));const _0x3737b5=_0x26e9e7[_0x19d2d4(0x165)]||'us01',_0x3995b6=[{'title':_0x19d2d4(0x15b),'value':'us01'},{'title':_0x19d2d4(0x147),'value':_0x19d2d4(0x17e)},{'title':_0x19d2d4(0x146),'value':'eu01'},{'title':_0x19d2d4(0x177),'value':_0x19d2d4(0x143)}];let _0x4ddcb4=_0x3995b6[_0x19d2d4(0x127)](_0x358450=>_0x358450[_0x19d2d4(0x153)]===_0x3737b5);_0x4ddcb4===-0x1&&_0x3737b5!==_0x19d2d4(0x176)&&(_0x3995b6[_0x19d2d4(0x13a)]({'title':_0x3737b5,'value':_0x3737b5}),_0x4ddcb4=_0x3995b6['length']-0x1);_0x3995b6[_0x19d2d4(0x13a)]({'title':_0x19d2d4(0x14e),'value':_0x19d2d4(0x158)});const _0x1242fa=_0xadb9e1?_0x19d2d4(0x14c)+_0xadb9e1+'):':_0x19d2d4(0x12d),_0x4c9b7f=await a6_0x13fd8f({'type':'select','name':_0x19d2d4(0x165),'message':_0x1242fa,'choices':_0x3995b6,'initial':_0x4ddcb4>=0x0?_0x4ddcb4:0x0});if(!_0x4c9b7f[_0x19d2d4(0x165)])return console[_0x19d2d4(0x172)]('\x0aSetup\x20cancelled'),0x1;let _0x468d97;if(_0x4c9b7f[_0x19d2d4(0x165)]==='other'){const _0x37ca56=await a6_0x13fd8f({'type':_0x19d2d4(0x150),'name':'customSite','message':_0x19d2d4(0x134),'initial':'us01','validate':_0x26c2c4=>{const _0x17c5c8=_0x19d2d4;if(!_0x26c2c4||!_0x26c2c4[_0x17c5c8(0x144)]())return _0x17c5c8(0x15d);if(!/^[a-z0-9-]+$/[_0x17c5c8(0x160)](_0x26c2c4[_0x17c5c8(0x144)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x37ca56[_0x19d2d4(0x151)])return console[_0x19d2d4(0x172)]('\x0aSetup\x20cancelled'),0x1;_0x468d97=_0x37ca56[_0x19d2d4(0x151)];}else _0x468d97=_0x4c9b7f['site'];const _0x5efc8a=resolveSite(_0x468d97);console[_0x19d2d4(0x172)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5efc8a),console[_0x19d2d4(0x172)](_0x19d2d4(0x12a)),console[_0x19d2d4(0x172)]('\x20\x20'+getConsoleUrl(_0x5efc8a,_0x19d2d4(0x17f)));const _0x25decd=await a6_0x13fd8f({'type':_0x19d2d4(0x17d),'name':'apiKey','message':_0x19d2d4(0x174),'validate':_0x1e4fb5=>{const _0x235316=_0x19d2d4;if(!_0x1e4fb5||!_0x1e4fb5[_0x235316(0x144)]())return _0x235316(0x133);return!![];}});if(!_0x25decd[_0x19d2d4(0x154)])return console[_0x19d2d4(0x172)](_0x19d2d4(0x13f)),0x1;const _0x46ecc8=_0x25decd['apiKey'];console[_0x19d2d4(0x172)]('Validating\x20API\x20key...');try{const _0x24d165=TDX[_0x19d2d4(0x141)]({'site':_0x5efc8a,'apiKey':_0x46ecc8[_0x19d2d4(0x144)](),'logLevel':_0x26e9e7['logLevel']??LogLevel[_0x19d2d4(0x157)]}),_0x5b775c=await _0x24d165[_0x19d2d4(0x15a)][_0x19d2d4(0x128)]();console[_0x19d2d4(0x172)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5b775c[_0x19d2d4(0x14f)]+')');const _0x186209=await isKeychainAvailable();_0x186209?(await saveAPIKeyAsync(_0x46ecc8[_0x19d2d4(0x144)](),_0x5efc8a,_0xadb9e1),console[_0x19d2d4(0x172)](_0x19d2d4(0x155)+(_0xadb9e1?_0x19d2d4(0x178)+_0xadb9e1+')':''))):(console[_0x19d2d4(0x171)](a6_0x4137f1[_0x19d2d4(0x169)](_0x19d2d4(0x17a))),console[_0x19d2d4(0x171)](a6_0x4137f1[_0x19d2d4(0x169)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0xadb9e1){const _0x5dfb4c={'site':_0x5efc8a};saveProfileToUserConfig(_0xadb9e1,_0x5dfb4c),console['log'](_0x19d2d4(0x13b)+_0xadb9e1+_0x19d2d4(0x15f));}else saveDefaultSiteToUserConfig(_0x5efc8a),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x5efc8a);const _0x5500d5=_0xadb9e1?_0x19d2d4(0x162)+_0xadb9e1:'';return console[_0x19d2d4(0x172)](),console['log'](_0x19d2d4(0x14d)),console[_0x19d2d4(0x172)](_0x19d2d4(0x140)+_0x5500d5+_0x19d2d4(0x168)),console[_0x19d2d4(0x172)]('\x20\x20tdx'+_0x5500d5+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1e398d){if(_0x1e398d instanceof HTTPClientError&&_0x1e398d[_0x19d2d4(0x161)]===0x191)return printAuthError(_0x1e398d),0x1;return console[_0x19d2d4(0x16d)](a6_0x4137f1['red'](_0x19d2d4(0x17c)+(_0x1e398d instanceof Error?_0x1e398d[_0x19d2d4(0x12e)]:String(_0x1e398d)))),console[_0x19d2d4(0x16d)](_0x19d2d4(0x159)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a6_0x123842(0x156)]=a6_0x123842(0x163);[a6_0x123842(0x173)]=a6_0x123842(0x12c);async[a6_0x123842(0x12f)](_0x148a5d){const _0x3e0aac=a6_0x123842,{options:_0x28ab94,tdx:_0x41e984}=_0x148a5d,_0x14f49a=_0x28ab94[_0x3e0aac(0x165)],_0x5dca93=_0x28ab94[_0x3e0aac(0x164)],_0x9c0ee1=_0x5dca93?_0x5dca93:_0x3e0aac(0x175);console[_0x3e0aac(0x172)](_0x3e0aac(0x129)+_0x9c0ee1+_0x3e0aac(0x126)+_0x14f49a+')');const _0x347aff=await resolveAPIKeyAsync(_0x14f49a,_0x5dca93);if(_0x347aff){const {source:_0x1b9255,isDeprecated:_0x473906}=_0x347aff,_0x739941=_0x3e0aac(0x152)+_0x1b9255;console[_0x3e0aac(0x172)](_0x473906?a6_0x4137f1['yellow'](_0x739941):_0x739941);}else console[_0x3e0aac(0x172)](a6_0x4137f1['yellow'](_0x3e0aac(0x145)));try{const _0x53479f=await _0x41e984[_0x3e0aac(0x15a)][_0x3e0aac(0x128)]();return console['log'](a6_0x4137f1[_0x3e0aac(0x14b)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x3e0aac(0x135)+_0x53479f[_0x3e0aac(0x14f)]),(_0x53479f['first_name']||_0x53479f[_0x3e0aac(0x16b)])&&console[_0x3e0aac(0x172)](_0x3e0aac(0x13e)+[_0x53479f[_0x3e0aac(0x179)],_0x53479f[_0x3e0aac(0x16b)]][_0x3e0aac(0x17b)](Boolean)['join']('\x20')),0x0;}catch(_0x1c0626){return _0x1c0626 instanceof HTTPClientError&&_0x1c0626[_0x3e0aac(0x161)]===0x191?printAuthError(_0x1c0626,!![],_0x5dca93):console[_0x3e0aac(0x16d)](a6_0x4137f1[_0x3e0aac(0x137)](_0x3e0aac(0x17c)+(_0x1c0626 instanceof Error?_0x1c0626[_0x3e0aac(0x12e)]:String(_0x1c0626)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a6_0x123842(0x156)]=a6_0x123842(0x130);[a6_0x123842(0x173)]=a6_0x123842(0x166);async[a6_0x123842(0x12f)](_0x5812d1){const _0x3b1cdd=a6_0x123842,{options:_0x5f50e8}=_0x5812d1,_0x164ff0=_0x5f50e8[_0x3b1cdd(0x164)];console[_0x3b1cdd(0x172)](a6_0x4137f1[_0x3b1cdd(0x149)](_0x3b1cdd(0x170)));const _0x5c994a=await isKeychainAvailable();if(!_0x5c994a)return console[_0x3b1cdd(0x16d)](a6_0x4137f1['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x39531a=await deleteKeychainAPIKey(_0x164ff0);return _0x39531a?(clearCredentialCache(),console[_0x3b1cdd(0x172)](_0x3b1cdd(0x15c)+(_0x164ff0?_0x3b1cdd(0x178)+_0x164ff0+')':'')),0x0):(console['log'](_0x3b1cdd(0x12b)+(_0x164ff0?'\x20for\x20profile:\x20'+_0x164ff0:'')),0x1);}}
1
+ const a6_0x55a03d=a6_0xb795;(function(_0x3e1e43,_0x40cb20){const _0x1af24f=a6_0xb795,_0x445133=_0x3e1e43();while(!![]){try{const _0x10f4a4=-parseInt(_0x1af24f(0x1b9))/0x1*(parseInt(_0x1af24f(0x1a2))/0x2)+-parseInt(_0x1af24f(0x1cc))/0x3+parseInt(_0x1af24f(0x185))/0x4*(-parseInt(_0x1af24f(0x19e))/0x5)+parseInt(_0x1af24f(0x1a7))/0x6*(-parseInt(_0x1af24f(0x183))/0x7)+-parseInt(_0x1af24f(0x1ac))/0x8*(parseInt(_0x1af24f(0x1ab))/0x9)+parseInt(_0x1af24f(0x1b0))/0xa*(-parseInt(_0x1af24f(0x1c2))/0xb)+-parseInt(_0x1af24f(0x188))/0xc*(-parseInt(_0x1af24f(0x1c9))/0xd);if(_0x10f4a4===_0x40cb20)break;else _0x445133['push'](_0x445133['shift']());}catch(_0x1a9e02){_0x445133['push'](_0x445133['shift']());}}}(a6_0x21c0,0x541de));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a6_0x21c0(){const _0x3dde72=['apiKey','create','warn','ERROR','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','customSite','auth','us\x20\x20\x20-\x20United\x20States','profile','Site\x20name\x20cannot\x20be\x20empty','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','test','jobs','tdx\x20profile:\x20','User:\x20','\x0aSetup\x20cancelled','ap02\x20-\x20Korea','status','32610EWuTFC','execute','yellow','No\x20API\x20key\x20found\x20in\x20keychain','391258cOwmEz','site','✓\x20Authentication\x20successful\x0a','You\x20can\x20find\x20your\x20API\x20key\x20at:','green','80310hpXkaP','ap02','\x20(site:\x20','\x20--profile\x20','9aZvMuP','4522864FLxVds','Setup\x20API\x20key\x20authentication\x20interactively','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Enter\x20your\x20TD\x20API\x20key:','2469790uohDqG','logLevel','tdx:\x20auth\x20clear','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20Profile\x20\x27','last_name','select','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20tdx','3vktSge','jp01','text','auth:clear','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','red','Read\x20credential\x20from\x20','join','jp\x20\x20\x20-\x20Japan','11ysOYeL','length','\x20(profile:\x20','getUserInfo','bold','Remove\x20API\x20key\x20from\x20system\x20keychain','Validating\x20API\x20key...','39hyvUyk','Setting\x20up\x20authentication\x20for\x20site:\x20','eu\x20\x20\x20-\x20Europe','1515906sXKyLG','us01','log','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','first_name','email','N/A','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','tdx:\x20auth\x20setup','password','description','error','7tkKIlw','✗\x20Validation\x20failed:\x20','136BRxOYV','trim','Enter\x20custom\x20site','9936804KTUfvD','other','System\x20keychain\x20is\x20not\x20available','push'];a6_0x21c0=function(){return _0x3dde72;};return a6_0x21c0();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a6_0x4401ca from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a6_0xb795(_0x85cc47,_0x304f3d){_0x85cc47=_0x85cc47-0x17b;const _0x21c09c=a6_0x21c0();let _0xb79554=_0x21c09c[_0x85cc47];return _0xb79554;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a6_0x28019c from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';['description']=a6_0x55a03d(0x1ad);async[a6_0x55a03d(0x19f)](_0x34e1fc){const _0x5c0278=a6_0x55a03d,{options:_0x135ade}=_0x34e1fc,_0x25e203=_0x135ade[_0x5c0278(0x194)];console[_0x5c0278(0x1ce)](a6_0x28019c['bold'](_0x5c0278(0x17f)));const _0x2b3cb1=_0x135ade['site']||'us01',_0x47b7a3=[{'title':_0x5c0278(0x193),'value':_0x5c0278(0x1cd)},{'title':_0x5c0278(0x1c1),'value':_0x5c0278(0x1ba)},{'title':_0x5c0278(0x1cb),'value':'eu01'},{'title':_0x5c0278(0x19c),'value':_0x5c0278(0x1a8)}];let _0x5e86d3=_0x47b7a3['findIndex'](_0x587410=>_0x587410['value']===_0x2b3cb1);_0x5e86d3===-0x1&&_0x2b3cb1!==_0x5c0278(0x1cd)&&(_0x47b7a3[_0x5c0278(0x18b)]({'title':_0x2b3cb1,'value':_0x2b3cb1}),_0x5e86d3=_0x47b7a3[_0x5c0278(0x1c3)]-0x1);_0x47b7a3[_0x5c0278(0x18b)]({'title':_0x5c0278(0x187),'value':_0x5c0278(0x189)});const _0x208582=_0x25e203?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x25e203+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x572f26=await a6_0x4401ca({'type':_0x5c0278(0x1b6),'name':_0x5c0278(0x1a3),'message':_0x208582,'choices':_0x47b7a3,'initial':_0x5e86d3>=0x0?_0x5e86d3:0x0});if(!_0x572f26[_0x5c0278(0x1a3)])return console[_0x5c0278(0x1ce)](_0x5c0278(0x19b)),0x1;let _0xd15ddb;if(_0x572f26[_0x5c0278(0x1a3)]===_0x5c0278(0x189)){const _0x37b219=await a6_0x4401ca({'type':_0x5c0278(0x1bb),'name':_0x5c0278(0x191),'message':'Enter\x20site\x20name:','initial':'us01','validate':_0x35f0a0=>{const _0x165403=_0x5c0278;if(!_0x35f0a0||!_0x35f0a0[_0x165403(0x186)]())return _0x165403(0x195);if(!/^[a-z0-9-]+$/[_0x165403(0x197)](_0x35f0a0[_0x165403(0x186)]()))return _0x165403(0x196);return!![];}});if(!_0x37b219['customSite'])return console[_0x5c0278(0x1ce)](_0x5c0278(0x19b)),0x1;_0xd15ddb=_0x37b219[_0x5c0278(0x191)];}else _0xd15ddb=_0x572f26['site'];const _0xb773b5=resolveSite(_0xd15ddb);console[_0x5c0278(0x1ce)](_0x5c0278(0x1ca)+_0xb773b5),console['log'](_0x5c0278(0x1a5)),console['log']('\x20\x20'+getConsoleUrl(_0xb773b5,'/app/mp/ak'));const _0x4d10c4=await a6_0x4401ca({'type':_0x5c0278(0x180),'name':_0x5c0278(0x18c),'message':_0x5c0278(0x1af),'validate':_0x7b0bf1=>{if(!_0x7b0bf1||!_0x7b0bf1['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x4d10c4[_0x5c0278(0x18c)])return console[_0x5c0278(0x1ce)]('\x0aSetup\x20cancelled'),0x1;const _0x33e5f6=_0x4d10c4[_0x5c0278(0x18c)];console[_0x5c0278(0x1ce)](_0x5c0278(0x1c8));try{const _0x1891bf=TDX[_0x5c0278(0x18d)]({'site':_0xb773b5,'apiKey':_0x33e5f6[_0x5c0278(0x186)](),'logLevel':_0x135ade[_0x5c0278(0x1b1)]??LogLevel[_0x5c0278(0x18f)]}),_0x2ee05a=await _0x1891bf[_0x5c0278(0x198)]['getUserInfo']();console['log'](_0x5c0278(0x17d)+_0x2ee05a[_0x5c0278(0x1d1)]+')');const _0x4c9b16=await isKeychainAvailable();_0x4c9b16?(await saveAPIKeyAsync(_0x33e5f6[_0x5c0278(0x186)](),_0xb773b5,_0x25e203),console[_0x5c0278(0x1ce)](_0x5c0278(0x1b3)+(_0x25e203?_0x5c0278(0x1c4)+_0x25e203+')':''))):(console['warn'](a6_0x28019c[_0x5c0278(0x1a0)](_0x5c0278(0x190))),console[_0x5c0278(0x18e)](a6_0x28019c['yellow'](_0x5c0278(0x1bd))));if(_0x25e203){const _0x5cb0d5={'site':_0xb773b5};saveProfileToUserConfig(_0x25e203,_0x5cb0d5),console[_0x5c0278(0x1ce)](_0x5c0278(0x1b4)+_0x25e203+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0xb773b5),console[_0x5c0278(0x1ce)](_0x5c0278(0x1b7)+_0xb773b5);const _0x1b833a=_0x25e203?_0x5c0278(0x1aa)+_0x25e203:'';return console[_0x5c0278(0x1ce)](),console[_0x5c0278(0x1ce)](_0x5c0278(0x1ae)),console['log'](_0x5c0278(0x1b8)+_0x1b833a+_0x5c0278(0x1cf)),console[_0x5c0278(0x1ce)](_0x5c0278(0x1b8)+_0x1b833a+_0x5c0278(0x17c)),0x0;}catch(_0x6b2311){if(_0x6b2311 instanceof HTTPClientError&&_0x6b2311[_0x5c0278(0x19d)]===0x191)return printAuthError(_0x6b2311),0x1;return console['error'](a6_0x28019c[_0x5c0278(0x1be)](_0x5c0278(0x184)+(_0x6b2311 instanceof Error?_0x6b2311['message']:String(_0x6b2311)))),console[_0x5c0278(0x182)](_0x5c0278(0x17e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a6_0x55a03d(0x192);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a6_0x55a03d(0x19f)](_0x1241a2){const _0x5ec786=a6_0x55a03d,{options:_0x144ba6,tdx:_0x29d367}=_0x1241a2,_0x422b75=_0x144ba6['site'],_0x12155b=_0x144ba6['profile'],_0x435282=_0x12155b?_0x12155b:_0x5ec786(0x17b);console[_0x5ec786(0x1ce)](_0x5ec786(0x199)+_0x435282+_0x5ec786(0x1a9)+_0x422b75+')');const _0x2bed34=await resolveAPIKeyAsync(_0x422b75,_0x12155b);if(_0x2bed34){const {source:_0x16539a,isDeprecated:_0x2f2def}=_0x2bed34,_0xe33b1a=_0x5ec786(0x1bf)+_0x16539a;console['log'](_0x2f2def?a6_0x28019c[_0x5ec786(0x1a0)](_0xe33b1a):_0xe33b1a);}else console[_0x5ec786(0x1ce)](a6_0x28019c[_0x5ec786(0x1a0)]('No\x20credential\x20found'));try{const _0x363f0c=await _0x29d367[_0x5ec786(0x198)][_0x5ec786(0x1c5)]();return console[_0x5ec786(0x1ce)](a6_0x28019c[_0x5ec786(0x1a6)](_0x5ec786(0x1a4))),console[_0x5ec786(0x1ce)](_0x5ec786(0x19a)+_0x363f0c[_0x5ec786(0x1d1)]),(_0x363f0c[_0x5ec786(0x1d0)]||_0x363f0c['last_name'])&&console[_0x5ec786(0x1ce)]('Name:\x20'+[_0x363f0c[_0x5ec786(0x1d0)],_0x363f0c[_0x5ec786(0x1b5)]]['filter'](Boolean)[_0x5ec786(0x1c0)]('\x20')),0x0;}catch(_0x7015bb){return _0x7015bb instanceof HTTPClientError&&_0x7015bb[_0x5ec786(0x19d)]===0x191?printAuthError(_0x7015bb,!![],_0x12155b):console[_0x5ec786(0x182)](a6_0x28019c[_0x5ec786(0x1be)](_0x5ec786(0x184)+(_0x7015bb instanceof Error?_0x7015bb['message']:String(_0x7015bb)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a6_0x55a03d(0x1bc);[a6_0x55a03d(0x181)]=a6_0x55a03d(0x1c7);async[a6_0x55a03d(0x19f)](_0x364ecd){const _0x567152=a6_0x55a03d,{options:_0xeea849}=_0x364ecd,_0x4c7697=_0xeea849[_0x567152(0x194)];console[_0x567152(0x1ce)](a6_0x28019c[_0x567152(0x1c6)](_0x567152(0x1b2)));const _0x4fde06=await isKeychainAvailable();if(!_0x4fde06)return console['error'](a6_0x28019c[_0x567152(0x1be)](_0x567152(0x18a))),0x1;const _0x4388c9=await deleteKeychainAPIKey(_0x4c7697);return _0x4388c9?(clearCredentialCache(),console['log']('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4c7697?_0x567152(0x1c4)+_0x4c7697+')':'')),0x0):(console[_0x567152(0x1ce)](_0x567152(0x1a1)+(_0x4c7697?'\x20for\x20profile:\x20'+_0x4c7697:'')),0x1);}}
@@ -1 +1 @@
1
- const a7_0x381ce7=a7_0x1356;function a7_0x1356(_0x973706,_0x262c81){_0x973706=_0x973706-0x151;const _0x467439=a7_0x4674();let _0x135601=_0x467439[_0x973706];return _0x135601;}(function(_0x5049c7,_0x357fbd){const _0x2fbe08=a7_0x1356,_0x776b1d=_0x5049c7();while(!![]){try{const _0x390aaa=-parseInt(_0x2fbe08(0x162))/0x1*(parseInt(_0x2fbe08(0x18b))/0x2)+-parseInt(_0x2fbe08(0x184))/0x3+parseInt(_0x2fbe08(0x186))/0x4*(-parseInt(_0x2fbe08(0x159))/0x5)+parseInt(_0x2fbe08(0x174))/0x6*(parseInt(_0x2fbe08(0x177))/0x7)+-parseInt(_0x2fbe08(0x166))/0x8*(parseInt(_0x2fbe08(0x176))/0x9)+-parseInt(_0x2fbe08(0x164))/0xa*(parseInt(_0x2fbe08(0x182))/0xb)+parseInt(_0x2fbe08(0x168))/0xc*(parseInt(_0x2fbe08(0x151))/0xd);if(_0x390aaa===_0x357fbd)break;else _0x776b1d['push'](_0x776b1d['shift']());}catch(_0x118dc5){_0x776b1d['push'](_0x776b1d['shift']());}}}(a7_0x4674,0xd5a33));import{BaseCommand}from'./command.js';function a7_0x4674(){const _0x513cf1=['agent','stack','llm','llmAgent','event','getOrCreateDefaultAgent','name','content','getAgentId','claude-4.5-haiku','295361xEFpyI','args','573921bHoNSo','\x27...','131420nzWmge','\x20\x20Cause:\x20','Continuing\x20chat:\x20','join','resolveAgentId','721702ETrLuZ','130QNGsgq','error','chatId','new','verbose','Getting\x20default\x20agent...','Resolving\x20project\x20\x27','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','85dnJTVc','llmProject','\x0aError:\x20','includes','CHAT_NOT_FOUND','\x0aStack\x20trace:','--agent\x20flag','cause','chat','3TUqLhM','Error:\x20','110SYDaym','Chat\x20session:\x20','361112sMJeCG','handleChatEvent','3287568GOUjbw','type','streamChat','validate','execute','description','data','resolveProjectId','metadata','code','getDefaultAgent','Using\x20agent\x20from\x20','6bPZceT','message','261CAUolR','11005442lBZjHE'];a7_0x4674=function(){return _0x513cf1;};return a7_0x4674();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x180088,_0x30f3fa){const _0x3c8584=a7_0x1356;if(_0x180088 instanceof SDKError)console[_0x3c8584(0x152)](_0x3c8584(0x163)+_0x180088[_0x3c8584(0x175)]),_0x30f3fa[_0x3c8584(0x155)]&&(_0x180088[_0x3c8584(0x160)]&&console[_0x3c8584(0x152)](_0x3c8584(0x187)+_0x180088[_0x3c8584(0x160)]),_0x180088[_0x3c8584(0x179)]&&(console[_0x3c8584(0x152)](_0x3c8584(0x15e)),console[_0x3c8584(0x152)](_0x180088['stack'])));else throw _0x180088;}export class ChatCommand extends BaseCommand{['name']=a7_0x381ce7(0x161);[a7_0x381ce7(0x16d)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a7_0x381ce7(0x16b)](_0x3cec9a){const _0x47b671=a7_0x381ce7,_0x2de679=_0x3cec9a[_0x47b671(0x183)]['join']('\x20');if(!_0x2de679)return _0x47b671(0x158);return undefined;}async[a7_0x381ce7(0x16a)](_0xabeefc,_0x2d6558,_0x2b4e4d,_0x4230f7,_0x12e9b1){const _0x541e43=a7_0x381ce7;for await(const _0x2ac2dc of _0xabeefc[_0x541e43(0x17a)]['chat'](_0x2d6558,{'agentId':_0x2b4e4d,'chatId':_0x4230f7})){if(_0x2ac2dc[_0x541e43(0x169)]===_0x541e43(0x170)){const _0x28193e=_0x2ac2dc[_0x541e43(0x16e)][_0x541e43(0x153)];saveLastChatId(_0x28193e),_0x12e9b1&&console[_0x541e43(0x152)](_0x541e43(0x165)+_0x28193e);}else _0x2ac2dc[_0x541e43(0x169)]===_0x541e43(0x17c)&&this['handleChatEvent'](_0x2ac2dc['data']);}}async['getAgentId'](_0x496835,_0x5dea64,_0x107760,_0x552313,_0x2ba605){const _0x524c3d=a7_0x381ce7,_0x3a98d2=_0x5dea64||_0x107760;if(_0x3a98d2){const {projectName:_0x25ba8d,agentName:_0x4b288c}=parseAgentRef(_0x3a98d2),_0x48308e=_0x4b288c||_0x3a98d2,_0x3812b4=_0x4b288c?_0x25ba8d:_0x552313;if(!_0x3812b4)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x2ba605){const _0x4ab7f6=_0x5dea64?_0x524c3d(0x15f):'session\x20context';console[_0x524c3d(0x152)](_0x524c3d(0x173)+_0x4ab7f6+':\x20'+_0x3812b4+'/'+_0x48308e);}const _0x4d427d=await withSpinner(_0x524c3d(0x157)+_0x3812b4+_0x524c3d(0x185),()=>_0x496835[_0x524c3d(0x17a)][_0x524c3d(0x16f)](_0x3812b4),{'verbose':_0x2ba605}),_0x3f4aa1=await withSpinner('Resolving\x20agent\x20\x27'+_0x48308e+_0x524c3d(0x185),()=>_0x496835[_0x524c3d(0x17a)][_0x524c3d(0x18a)](_0x48308e,_0x4d427d[_0x524c3d(0x16e)]),{'verbose':_0x2ba605});return _0x3f4aa1['data'];}else{const _0x5cab99=_0x496835['llm'][_0x524c3d(0x172)]();if(_0x5cab99)return _0x2ba605&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x5cab99[_0x524c3d(0x17e)]),_0x5cab99['id'];const _0x35a1e9=await withSpinner(_0x524c3d(0x156),()=>_0x496835['llm'][_0x524c3d(0x17d)](_0x524c3d(0x181),0x0),{'verbose':_0x2ba605});return _0x35a1e9[_0x524c3d(0x16e)]['id'];}}async[a7_0x381ce7(0x16c)](_0x506aae){const _0xcbcbb4=a7_0x381ce7,{options:_0x3214c7,args:_0x128c45,tdx:_0x5807b0}=_0x506aae,_0x31eb29=_0x128c45[_0xcbcbb4(0x189)]('\x20'),_0x55d005=_0x3214c7,_0x1b747a=_0x55d005[_0xcbcbb4(0x178)],_0x5be41e=_0x55d005[_0xcbcbb4(0x17b)],_0x3d7247=_0x55d005[_0xcbcbb4(0x15a)],_0x3a8d9d=_0x55d005[_0xcbcbb4(0x154)];try{let _0xa577e5,_0x57383f;!_0x3a8d9d&&(_0x57383f=loadLastChatId(),_0x57383f&&_0x3214c7[_0xcbcbb4(0x155)]&&console[_0xcbcbb4(0x152)](_0xcbcbb4(0x188)+_0x57383f));(_0x3a8d9d||!_0x57383f)&&(_0xa577e5=await this['getAgentId'](_0x5807b0,_0x1b747a,_0x5be41e,_0x3d7247,_0x3214c7[_0xcbcbb4(0x155)]));try{await this['streamChat'](_0x5807b0,_0x31eb29,_0xa577e5,_0x57383f,_0x3214c7['verbose']);}catch(_0x119d9b){const _0x13424e=_0x119d9b instanceof SDKError&&_0x119d9b[_0xcbcbb4(0x171)]===ErrorCode[_0xcbcbb4(0x15d)]||_0x119d9b instanceof Error&&_0x119d9b[_0xcbcbb4(0x175)][_0xcbcbb4(0x15c)]('404');if(_0x13424e)_0x3214c7[_0xcbcbb4(0x155)]&&console[_0xcbcbb4(0x152)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0xa577e5&&(_0xa577e5=await this[_0xcbcbb4(0x180)](_0x5807b0,_0x1b747a,_0x5be41e,_0x3d7247,_0x3214c7[_0xcbcbb4(0x155)])),await this['streamChat'](_0x5807b0,_0x31eb29,_0xa577e5,undefined,_0x3214c7[_0xcbcbb4(0x155)]);else throw _0x119d9b;}return console['log'](),0x0;}catch(_0x5db950){return console[_0xcbcbb4(0x152)](),handleSDKError(_0x5db950,_0x3214c7),0x1;}}[a7_0x381ce7(0x167)](_0x45af1d){const _0x26dded=a7_0x381ce7;if(_0x26dded(0x17f)in _0x45af1d)process['stdout']['write'](_0x45af1d[_0x26dded(0x17f)]);else _0x26dded(0x152)in _0x45af1d&&console['error'](_0x26dded(0x15b)+_0x45af1d[_0x26dded(0x152)]);}}
1
+ const a7_0x3824b1=a7_0xc20c;function a7_0x3569(){const _0x2ef074=['message','\x0aError:\x20','chatId','Using\x20agent\x20from\x20','1777320vzTmMq','1023255UYRgSj','log','claude-4.5-haiku','handleChatEvent','--agent\x20flag','name','resolveProjectId','31283gpjwSQ','metadata','cause','Getting\x20default\x20agent...','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','validate','llmAgent','agent','\x0aStack\x20trace:','args','721754BfJbYc','streamChat','chat','error','1337928hzcAEE','Resolving\x20agent\x20\x27','584dRNgsq','getAgentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','description','execute','resolveAgentId','Resolving\x20project\x20\x27','llm','data','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','\x27...','includes','type','Chat\x20session:\x20','Using\x20cached\x20default\x20agent:\x20','code','Error:\x20','stack','3102876fQWiIf','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','content','verbose','join','1595338rSvorA','CHAT_NOT_FOUND','Continuing\x20chat:\x20','new','404','write'];a7_0x3569=function(){return _0x2ef074;};return a7_0x3569();}(function(_0x2be309,_0x3dc2d4){const _0x130a8a=a7_0xc20c,_0x197be9=_0x2be309();while(!![]){try{const _0x3c422b=parseInt(_0x130a8a(0x168))/0x1+-parseInt(_0x130a8a(0x185))/0x2+-parseInt(_0x130a8a(0x190))/0x3+parseInt(_0x130a8a(0x16c))/0x4+parseInt(_0x130a8a(0x18f))/0x5+parseInt(_0x130a8a(0x180))/0x6+parseInt(_0x130a8a(0x197))/0x7*(-parseInt(_0x130a8a(0x16e))/0x8);if(_0x3c422b===_0x3dc2d4)break;else _0x197be9['push'](_0x197be9['shift']());}catch(_0x5bf0f3){_0x197be9['push'](_0x197be9['shift']());}}}(a7_0x3569,0x713ef));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a7_0xc20c(_0x280636,_0x35a05e){_0x280636=_0x280636-0x168;const _0x35690d=a7_0x3569();let _0xc20c6d=_0x35690d[_0x280636];return _0xc20c6d;}function handleSDKError(_0x2800d2,_0x4defe8){const _0x21aa0d=a7_0xc20c;if(_0x2800d2 instanceof SDKError)console[_0x21aa0d(0x16b)](_0x21aa0d(0x17e)+_0x2800d2[_0x21aa0d(0x18b)]),_0x4defe8[_0x21aa0d(0x183)]&&(_0x2800d2[_0x21aa0d(0x199)]&&console[_0x21aa0d(0x16b)]('\x20\x20Cause:\x20'+_0x2800d2['cause']),_0x2800d2['stack']&&(console[_0x21aa0d(0x16b)](_0x21aa0d(0x19f)),console[_0x21aa0d(0x16b)](_0x2800d2[_0x21aa0d(0x17f)])));else throw _0x2800d2;}export class ChatCommand extends BaseCommand{[a7_0x3824b1(0x195)]=a7_0x3824b1(0x16a);[a7_0x3824b1(0x171)]=a7_0x3824b1(0x170);[a7_0x3824b1(0x19c)](_0x21f37d){const _0x1976cc=a7_0x3824b1,_0x40fe1b=_0x21f37d[_0x1976cc(0x1a0)][_0x1976cc(0x184)]('\x20');if(!_0x40fe1b)return _0x1976cc(0x177);return undefined;}async[a7_0x3824b1(0x169)](_0x5ab2c7,_0x317da6,_0x1fa9ca,_0x3226f7,_0x11380c){const _0x57ebb9=a7_0x3824b1;for await(const _0x114f07 of _0x5ab2c7[_0x57ebb9(0x175)][_0x57ebb9(0x16a)](_0x317da6,{'agentId':_0x1fa9ca,'chatId':_0x3226f7})){if(_0x114f07[_0x57ebb9(0x17a)]===_0x57ebb9(0x198)){const _0x4c0af8=_0x114f07[_0x57ebb9(0x176)][_0x57ebb9(0x18d)];saveLastChatId(_0x4c0af8),_0x11380c&&console[_0x57ebb9(0x16b)](_0x57ebb9(0x17b)+_0x4c0af8);}else _0x114f07[_0x57ebb9(0x17a)]==='event'&&this[_0x57ebb9(0x193)](_0x114f07[_0x57ebb9(0x176)]);}}async[a7_0x3824b1(0x16f)](_0x40e486,_0x49e0d3,_0x2663dc,_0x7edde8,_0x2e4a96){const _0x507658=a7_0x3824b1,_0x2389d1=_0x49e0d3||_0x2663dc;if(_0x2389d1){const {projectName:_0x1f6513,agentName:_0x9496e8}=parseAgentRef(_0x2389d1),_0x2a39f6=_0x9496e8||_0x2389d1,_0x3a39d7=_0x9496e8?_0x1f6513:_0x7edde8;if(!_0x3a39d7)throw new Error(_0x507658(0x19b));if(_0x2e4a96){const _0x51bfdb=_0x49e0d3?_0x507658(0x194):'session\x20context';console[_0x507658(0x16b)](_0x507658(0x18e)+_0x51bfdb+':\x20'+_0x3a39d7+'/'+_0x2a39f6);}const _0xf1502b=await withSpinner(_0x507658(0x174)+_0x3a39d7+_0x507658(0x178),()=>_0x40e486[_0x507658(0x175)][_0x507658(0x196)](_0x3a39d7),{'verbose':_0x2e4a96}),_0x4d6800=await withSpinner(_0x507658(0x16d)+_0x2a39f6+'\x27...',()=>_0x40e486[_0x507658(0x175)][_0x507658(0x173)](_0x2a39f6,_0xf1502b['data']),{'verbose':_0x2e4a96});return _0x4d6800['data'];}else{const _0xd910de=_0x40e486[_0x507658(0x175)]['getDefaultAgent']();if(_0xd910de)return _0x2e4a96&&console[_0x507658(0x16b)](_0x507658(0x17c)+_0xd910de[_0x507658(0x195)]),_0xd910de['id'];const _0x21ea84=await withSpinner(_0x507658(0x19a),()=>_0x40e486[_0x507658(0x175)]['getOrCreateDefaultAgent'](_0x507658(0x192),0x0),{'verbose':_0x2e4a96});return _0x21ea84[_0x507658(0x176)]['id'];}}async[a7_0x3824b1(0x172)](_0x434cab){const _0x2b5bf1=a7_0x3824b1,{options:_0x175256,args:_0x268521,tdx:_0x45ed96}=_0x434cab,_0x10e844=_0x268521[_0x2b5bf1(0x184)]('\x20'),_0x4ae294=_0x175256,_0x487e27=_0x4ae294[_0x2b5bf1(0x19e)],_0x2b3afd=_0x4ae294[_0x2b5bf1(0x19d)],_0x420374=_0x4ae294['llmProject'],_0x51f2bd=_0x4ae294[_0x2b5bf1(0x188)];try{let _0xee972f,_0x2001c0;!_0x51f2bd&&(_0x2001c0=loadLastChatId(),_0x2001c0&&_0x175256[_0x2b5bf1(0x183)]&&console[_0x2b5bf1(0x16b)](_0x2b5bf1(0x187)+_0x2001c0));(_0x51f2bd||!_0x2001c0)&&(_0xee972f=await this[_0x2b5bf1(0x16f)](_0x45ed96,_0x487e27,_0x2b3afd,_0x420374,_0x175256['verbose']));try{await this[_0x2b5bf1(0x169)](_0x45ed96,_0x10e844,_0xee972f,_0x2001c0,_0x175256[_0x2b5bf1(0x183)]);}catch(_0x37dc5d){const _0x12e519=_0x37dc5d instanceof SDKError&&_0x37dc5d[_0x2b5bf1(0x17d)]===ErrorCode[_0x2b5bf1(0x186)]||_0x37dc5d instanceof Error&&_0x37dc5d[_0x2b5bf1(0x18b)][_0x2b5bf1(0x179)](_0x2b5bf1(0x189));if(_0x12e519)_0x175256[_0x2b5bf1(0x183)]&&console['error'](_0x2b5bf1(0x181)),!_0xee972f&&(_0xee972f=await this[_0x2b5bf1(0x16f)](_0x45ed96,_0x487e27,_0x2b3afd,_0x420374,_0x175256[_0x2b5bf1(0x183)])),await this['streamChat'](_0x45ed96,_0x10e844,_0xee972f,undefined,_0x175256[_0x2b5bf1(0x183)]);else throw _0x37dc5d;}return console[_0x2b5bf1(0x191)](),0x0;}catch(_0x17db2e){return console[_0x2b5bf1(0x16b)](),handleSDKError(_0x17db2e,_0x175256),0x1;}}[a7_0x3824b1(0x193)](_0x23375b){const _0x1ea9c0=a7_0x3824b1;if('content'in _0x23375b)process['stdout'][_0x1ea9c0(0x18a)](_0x23375b[_0x1ea9c0(0x182)]);else _0x1ea9c0(0x16b)in _0x23375b&&console[_0x1ea9c0(0x16b)](_0x1ea9c0(0x18c)+_0x23375b[_0x1ea9c0(0x16b)]);}}
@@ -1 +1 @@
1
- const a8_0x532737=a8_0x5f2d;(function(_0x1dd852,_0x12f5df){const _0x1b3070=a8_0x5f2d,_0x4261d7=_0x1dd852();while(!![]){try{const _0x1f48cb=parseInt(_0x1b3070(0x10b))/0x1*(parseInt(_0x1b3070(0xf8))/0x2)+parseInt(_0x1b3070(0x83))/0x3*(-parseInt(_0x1b3070(0x10a))/0x4)+-parseInt(_0x1b3070(0xe0))/0x5*(-parseInt(_0x1b3070(0xe3))/0x6)+parseInt(_0x1b3070(0x11f))/0x7+parseInt(_0x1b3070(0x10c))/0x8*(parseInt(_0x1b3070(0xd0))/0x9)+-parseInt(_0x1b3070(0x101))/0xa*(-parseInt(_0x1b3070(0xc7))/0xb)+-parseInt(_0x1b3070(0xfd))/0xc;if(_0x1f48cb===_0x12f5df)break;else _0x4261d7['push'](_0x4261d7['shift']());}catch(_0x10db72){_0x4261d7['push'](_0x4261d7['shift']());}}}(a8_0x38b9,0x8b790));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a8_0xde6757 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';function a8_0x5f2d(_0xd8c63b,_0x22c123){_0xd8c63b=_0xd8c63b-0x83;const _0x38b936=a8_0x38b9();let _0x5f2d1e=_0x38b936[_0xd8c63b];return _0x5f2d1e;}import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';function a8_0x38b9(){const _0x28e455=['Starting\x20TD\x20LLM\x20proxy\x20server...','tdx\x20--profile\x20','init','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','ANTHROPIC_AUTH_TOKEN','Executing:\x20claude\x20','Initializing\x20proxy\x20logger...','update','\x20claude\x20statusline','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','td-docs','110EVKoip','major','✓\x20Found\x20available\x20port:\x20','mcp','env','data','td-skills','stderr','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','9pBEBGZ','Failed\x20to\x20update\x20marketplace\x20\x27','port','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','tdx','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','inherit','stop','✓\x20Logs\x20saved\x20to\x20','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','\x27\x20updated','Updating\x20marketplace\x20\x27','Invalid\x20LLM\x20proxy\x20URL:\x20','already\x20installed','hostname','info','147885GBGqPT','Configuring\x20marketplace\x20\x27','--version','6hMeCBq','Invalid\x20minimum\x20version\x20format:\x20','✓\x20Marketplace\x20\x27','https://docs.treasuredata.com/mcp','ANTHROPIC_MODEL','debug','CLAUDE_CODE_USE_VERTEX','localhost','getOrCreateDefaultProject','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','patch','\x20→\x20','\x20meets\x20minimum\x20requirement','Failed\x20to\x20launch\x20Claude\x20Code:\x20','model','fail','settings.local.json','Command\x20output:\x20','cause','already\x20configured','workflow-skills','2744OZoixh','marketplace','INSTALLATION_FAILED','false','\x27\x20installed','7384812NUXhzP','https://github.com/treasure-data/td-skills','Failed\x20to\x20configure\x20marketplace\x20\x27','user','599750GZIurv','✓\x20MCP\x20server\x20\x27','Command\x20failed\x20(exit\x20','already\x20exists','\x27...','message','llmProxy','stringify','logLevel','328goknQO','434fJADkE','457176APaTDf','statusLine','llm-proxy','Failed\x20to\x20install\x20plugin\x20\x27','tdx\x20claude\x20statusline','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Claude\x20Code\x20version\x20check\x20failed','apiKey','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','logger','Finding\x20available\x20port...','sql-skills','\x20or\x20later.','.claude','match','error','object','Claude\x20Code\x20CLI\x20not\x20found','Claude\x20Code\x20version\x20','1427265fDgxSk','CLAUDE_CODE_USE_BEDROCK','getCurrent','join','add','tdx-managed-proxy','http://127.0.0.1:','originalSettings','10944uTTNVz','plugin','\x20configuration\x20failed','Initializing...','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','install','2.0.20','command','\x27\x20configured','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','CLAUDE_CODE_NOT_FOUND','parse','code','Warning:\x20Failed\x20to\x20configure\x20','ENOENT','profile','\x20is\x20too\x20old\x20(minimum:\x20','canParse','toString','server','account_id','✓\x20Settings\x20configured:\x20.claude/settings.local.json','text','http','ANTHROPIC_BASE_URL','site','warn','passThroughServer','unshift','INVALID_ARGUMENT','continue','close','Setup\x20failed','log','name','string','red','context','claude','green','includes','exit','pipe','minor','\x20already\x20configured','attributes','Configuring\x20MCP\x20server\x20\x27','INTERNAL','td-skills\x20Plugins','✓\x20Logging\x20to\x20','description','start','Setting\x20up\x20project...','cwd','resume','Creating\x20.claude/settings.local.json...','):\x20claude\x20'];a8_0x38b9=function(){return _0x28e455;};return a8_0x38b9();}import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a8_0x532737(0x89);function handleInstallationError(_0x2924d4,_0x1d2080,_0x4e8961,_0x28ab3a){const _0x1cc2c3=a8_0x532737;errorContains(_0x2924d4,_0x1cc2c3(0x104),_0x1cc2c3(0xdd),_0x1cc2c3(0xf6))?(_0x4e8961[_0x1cc2c3(0x99)]='✓\x20'+_0x1d2080+_0x1cc2c3(0xaf),_0x28ab3a?.[_0x1cc2c3(0xdf)](_0x1d2080+_0x1cc2c3(0xaf)),_0x2924d4 instanceof SDKError&&_0x2924d4['cause']&&_0x28ab3a?.[_0x1cc2c3(0xe8)](_0x1cc2c3(0xf4)+_0x2924d4[_0x1cc2c3(0xf5)]['message'])):(_0x4e8961[_0x1cc2c3(0x9d)](_0x1cc2c3(0x90)+_0x1d2080),_0x28ab3a?.[_0x1cc2c3(0x11b)](_0x1d2080+_0x1cc2c3(0x85),_0x2924d4));}export function parseVersion(_0x23d13a){const _0x34d7fe=a8_0x532737,_0x5f0728=_0x23d13a['trim']()[_0x34d7fe(0x11a)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x5f0728)return null;return{'major':parseInt(_0x5f0728[0x1],0xa),'minor':parseInt(_0x5f0728[0x2],0xa),'patch':parseInt(_0x5f0728[0x3],0xa)};}export function compareVersions(_0xde1ed7,_0x24e753){const _0xf53a74=a8_0x532737;if(_0xde1ed7[_0xf53a74(0xc8)]!==_0x24e753[_0xf53a74(0xc8)])return _0xde1ed7['major']-_0x24e753[_0xf53a74(0xc8)];if(_0xde1ed7[_0xf53a74(0xae)]!==_0x24e753[_0xf53a74(0xae)])return _0xde1ed7['minor']-_0x24e753[_0xf53a74(0xae)];return _0xde1ed7[_0xf53a74(0xed)]-_0x24e753[_0xf53a74(0xed)];}async function checkClaudeVersion(_0x26f606,_0x1694c2){const _0x1a1fe0=a8_0x532737;_0x1694c2?.[_0x1a1fe0(0xe8)](_0x1a1fe0(0xd9)+_0x26f606+')');const _0x4793ab=await executeClaudeCommand([_0x1a1fe0(0xe2)],undefined,_0x1694c2),_0x12cd91=parseVersion(_0x4793ab);if(!_0x12cd91){_0x1694c2?.[_0x1a1fe0(0x9d)](_0x1a1fe0(0xd5)+_0x4793ab);return;}const _0x34a6ea=_0x12cd91['major']+'.'+_0x12cd91[_0x1a1fe0(0xae)]+'.'+_0x12cd91[_0x1a1fe0(0xed)],_0x365e03=parseVersion(_0x26f606);if(!_0x365e03){_0x1694c2?.[_0x1a1fe0(0x9d)](_0x1a1fe0(0xe4)+_0x26f606);return;}if(compareVersions(_0x12cd91,_0x365e03)<0x0){_0x1694c2?.[_0x1a1fe0(0x11b)](_0x1a1fe0(0x11e)+_0x34a6ea+_0x1a1fe0(0x93)+_0x26f606+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],_0x1a1fe0(0x11e)+_0x34a6ea+_0x1a1fe0(0x8c)+_0x26f606+_0x1a1fe0(0x118),undefined,{'helpText':_0x1a1fe0(0x87)});}_0x1694c2?.[_0x1a1fe0(0xe8)]('Claude\x20Code\x20version\x20'+_0x34a6ea+_0x1a1fe0(0xef));}async function executeClaudeCommand(_0x118e45,_0x2925cf,_0x460260){const _0x47da03=a8_0x532737;return _0x460260?.[_0x47da03(0xdf)](_0x47da03(0xc1)+_0x118e45[_0x47da03(0x122)]('\x20')),new Promise((_0x361c70,_0x4fdc24)=>{const _0x3e1e04=_0x47da03,_0x46ff32=crossSpawn('claude',_0x118e45,{'stdio':_0x3e1e04(0xad)});let _0x4e82ab='',_0x48b5e8='';_0x46ff32['stdout']?.['on'](_0x3e1e04(0xcc),_0x4e6870=>{const _0x5e6213=_0x3e1e04;_0x4e82ab+=_0x4e6870[_0x5e6213(0x95)]();}),_0x46ff32[_0x3e1e04(0xce)]?.['on'](_0x3e1e04(0xcc),_0x2e6d4c=>{const _0x1e81d6=_0x3e1e04;_0x48b5e8+=_0x2e6d4c[_0x1e81d6(0x95)]();}),_0x46ff32['on'](_0x3e1e04(0x11b),_0x5237db=>{const _0x4c58cb=_0x3e1e04;_0x5237db[_0x4c58cb(0x8f)]===_0x4c58cb(0x91)?(_0x460260?.[_0x4c58cb(0x11b)](_0x4c58cb(0x11d)),_0x4fdc24(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',_0x5237db,{'helpText':_0x4c58cb(0xcf)}))):(_0x460260?.[_0x4c58cb(0x11b)]('Command\x20spawn\x20error:\x20'+_0x5237db[_0x4c58cb(0x106)]),_0x4fdc24(new SDKError(ErrorCode[_0x4c58cb(0xb2)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x5237db[_0x4c58cb(0x106)],_0x5237db)));}),_0x46ff32['on'](_0x3e1e04(0xac),_0x265196=>{const _0x2e3e08=_0x3e1e04;if(_0x265196===0x0)_0x361c70(_0x4e82ab);else _0x2925cf?(_0x460260?.['error'](_0x2e3e08(0x103)+_0x265196+_0x2e3e08(0xbb)+_0x118e45[_0x2e3e08(0x122)]('\x20')),_0x4fdc24(new SDKError(ErrorCode[_0x2e3e08(0xfa)],_0x2925cf,new Error(_0x48b5e8)))):_0x361c70('');});});}async function ensureMcpServer(_0xafae55,_0x1fe1dc,_0xd640c,_0x215aad,_0x3bb4af){const _0x2a940f=a8_0x532737;_0x215aad[_0x2a940f(0x99)]=_0x2a940f(0xb1)+_0xafae55+'\x27...',await executeClaudeCommand([_0x2a940f(0xca),_0x2a940f(0x123),_0xafae55,_0x1fe1dc,'--transport',_0xd640c],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0xafae55+'\x27',_0x3bb4af),_0x215aad[_0x2a940f(0x99)]=_0x2a940f(0x102)+_0xafae55+_0x2a940f(0x8b);}async function ensureMarketplace(_0x4a3be9,_0x59e070,_0x264df2,_0x4bd10a){const _0x12dc7e=a8_0x532737;_0x264df2['text']=_0x12dc7e(0xe1)+_0x4a3be9+_0x12dc7e(0x105),await executeClaudeCommand([_0x12dc7e(0x84),_0x12dc7e(0xf9),'add',_0x59e070],_0x12dc7e(0xff)+_0x4a3be9+'\x27',_0x4bd10a),_0x264df2['text']=_0x12dc7e(0xe5)+_0x4a3be9+_0x12dc7e(0x8b);}async function updateMarketplace(_0x2c6ea9,_0x5f1ace,_0xe7fe25){const _0x576a8b=a8_0x532737;_0x5f1ace[_0x576a8b(0x99)]=_0x576a8b(0xdb)+_0x2c6ea9+'\x27...',await executeClaudeCommand([_0x576a8b(0x84),'marketplace',_0x576a8b(0xc3)],_0x576a8b(0xd1)+_0x2c6ea9+'\x27',_0xe7fe25),_0x5f1ace[_0x576a8b(0x99)]='✓\x20Marketplace\x20\x27'+_0x2c6ea9+_0x576a8b(0xda);}async function ensurePlugin(_0x20fa7e,_0xa1b577,_0x2c325d,_0x4813e5){const _0xa71212=a8_0x532737;_0x2c325d[_0xa71212(0x99)]='Installing\x20plugin\x20\x27'+_0x20fa7e+'\x27...',await executeClaudeCommand([_0xa71212(0x84),_0xa71212(0x88),_0x20fa7e+'@'+_0xa1b577],_0xa71212(0x10f)+_0x20fa7e+'\x27',_0x4813e5),_0x2c325d[_0xa71212(0x99)]='✓\x20Plugin\x20\x27'+_0x20fa7e+_0xa71212(0xfc);}async function createClaudeSettings(_0x574181,_0x266a02,_0x532b52){const _0x4b9307=a8_0x532737,_0x563de7=join(process[_0x4b9307(0xb8)](),_0x4b9307(0x119)),_0x3818f2=join(_0x563de7,'settings.local.json');await mkdir(_0x563de7,{'recursive':!![]});let _0x5142d6={};if(existsSync(_0x3818f2))try{const _0x2c627d=await readFile(_0x3818f2,'utf-8');_0x5142d6=JSON[_0x4b9307(0x8e)](_0x2c627d);}catch{_0x5142d6={};}const _0x5097c5=_0x5142d6[_0x4b9307(0xcb)]||{},_0xa548c2={'ANTHROPIC_BASE_URL':_0x5097c5[_0x4b9307(0x9b)],'ANTHROPIC_MODEL':_0x5097c5[_0x4b9307(0xe7)],'ANTHROPIC_AUTH_TOKEN':_0x5097c5[_0x4b9307(0xc0)],'CLAUDE_CODE_USE_BEDROCK':_0x5097c5[_0x4b9307(0x120)],'CLAUDE_CODE_USE_VERTEX':_0x5097c5['CLAUDE_CODE_USE_VERTEX'],'statusLine':_0x5142d6[_0x4b9307(0x10d)]},_0x4f9b94={..._0x5142d6,'env':{..._0x5097c5,'ANTHROPIC_BASE_URL':_0x4b9307(0x125)+_0x574181,..._0x266a02&&{'ANTHROPIC_MODEL':_0x266a02},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':_0x4b9307(0xfb),'CLAUDE_CODE_USE_VERTEX':_0x4b9307(0xfb)},'statusLine':{'type':'command','command':_0x532b52?_0x4b9307(0xbd)+_0x532b52+_0x4b9307(0xc4):_0x4b9307(0x110)}};return await writeFile(_0x3818f2,JSON[_0x4b9307(0x108)](_0x4f9b94,null,0x2)+'\x0a'),_0xa548c2;}async function restoreClaudeSettings(_0x202428){const _0x5e6e9d=a8_0x532737,_0x4cb9aa=join(process[_0x5e6e9d(0xb8)](),'.claude'),_0x5b2a69=join(_0x4cb9aa,_0x5e6e9d(0xf3));if(!existsSync(_0x5b2a69))return;try{const _0x42f0f5=await readFile(_0x5b2a69,'utf-8'),_0x5c9f60=JSON[_0x5e6e9d(0x8e)](_0x42f0f5),_0x4d8a89=_0x5c9f60['env']||{},_0x28c40d=_0x4d8a89[_0x5e6e9d(0x9b)],_0x4264f1=((()=>{const _0x1e4940=_0x5e6e9d;if(typeof _0x28c40d!==_0x1e4940(0xa6))return![];try{const _0x578313=new URL(_0x28c40d);return _0x578313['hostname']===_0x1e4940(0xea)||_0x578313[_0x1e4940(0xde)]==='127.0.0.1';}catch{return![];}})());_0x4264f1?(delete _0x4d8a89[_0x5e6e9d(0x9b)],delete _0x4d8a89['ANTHROPIC_MODEL'],delete _0x4d8a89[_0x5e6e9d(0xc0)],delete _0x4d8a89[_0x5e6e9d(0x120)],delete _0x4d8a89['CLAUDE_CODE_USE_VERTEX']):(_0x202428[_0x5e6e9d(0x9b)]!==undefined?_0x4d8a89[_0x5e6e9d(0x9b)]=_0x202428[_0x5e6e9d(0x9b)]:delete _0x4d8a89[_0x5e6e9d(0x9b)],_0x202428[_0x5e6e9d(0xe7)]!==undefined?_0x4d8a89[_0x5e6e9d(0xe7)]=_0x202428[_0x5e6e9d(0xe7)]:delete _0x4d8a89[_0x5e6e9d(0xe7)],_0x202428[_0x5e6e9d(0xc0)]!==undefined?_0x4d8a89[_0x5e6e9d(0xc0)]=_0x202428[_0x5e6e9d(0xc0)]:delete _0x4d8a89[_0x5e6e9d(0xc0)],_0x202428[_0x5e6e9d(0x120)]!==undefined?_0x4d8a89['CLAUDE_CODE_USE_BEDROCK']=_0x202428['CLAUDE_CODE_USE_BEDROCK']:delete _0x4d8a89['CLAUDE_CODE_USE_BEDROCK'],_0x202428[_0x5e6e9d(0xe9)]!==undefined?_0x4d8a89[_0x5e6e9d(0xe9)]=_0x202428[_0x5e6e9d(0xe9)]:delete _0x4d8a89['CLAUDE_CODE_USE_VERTEX']);const _0x5b1ce3=_0x5c9f60[_0x5e6e9d(0x10d)],_0x5c4ad9=((()=>{const _0x1e19f3=_0x5e6e9d;if(!_0x5b1ce3||typeof _0x5b1ce3!==_0x1e19f3(0x11c))return![];if(_0x5b1ce3['type']!==_0x1e19f3(0x8a))return![];if(typeof _0x5b1ce3[_0x1e19f3(0x8a)]!==_0x1e19f3(0xa6))return![];return _0x5b1ce3[_0x1e19f3(0x8a)]['includes'](_0x1e19f3(0xd4))&&_0x5b1ce3[_0x1e19f3(0x8a)][_0x1e19f3(0xab)]('statusline');})());if(_0x5c4ad9)delete _0x5c9f60[_0x5e6e9d(0x10d)];else _0x202428['statusLine']!==undefined?_0x5c9f60[_0x5e6e9d(0x10d)]=_0x202428['statusLine']:delete _0x5c9f60[_0x5e6e9d(0x10d)];_0x5c9f60[_0x5e6e9d(0xcb)]=_0x4d8a89,await writeFile(_0x5b2a69,JSON[_0x5e6e9d(0x108)](_0x5c9f60,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a8_0x532737(0xa5)]='claude';[a8_0x532737(0xb5)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a8_0x532737(0x96)];['passThroughServer'];['originalSettings'];[a8_0x532737(0x115)];['port'];async['execute'](_0x38e496){const _0x1b3e6e=a8_0x532737,{tdx:_0x377590,options:_0x76ad0c,args:_0x341e47}=_0x38e496;try{const _0x2bbc9a=_0x76ad0c,_0x49c802=_0x2bbc9a['proxy']===![],_0x518cd0=_0x2bbc9a[_0x1b3e6e(0xa1)]===!![],_0x42e439=_0x2bbc9a[_0x1b3e6e(0xb9)]===!![],_0x4314e7=_0x2bbc9a[_0x1b3e6e(0x107)],_0x4157c4=_0x4314e7!==undefined&&_0x4314e7!==![],_0x6c30d3=typeof _0x4314e7===_0x1b3e6e(0xa6)?_0x4314e7:undefined,_0x37db03=_0x4157c4?undefined:_0x2bbc9a[_0x1b3e6e(0xf1)],_0xe29d33=[..._0x341e47];if(_0x518cd0)_0xe29d33['unshift']('-c');else _0x42e439&&_0xe29d33[_0x1b3e6e(0x9f)]('-r');const _0x1734f1=createCommandSpinner(_0x1b3e6e(0x86),{'verbose':_0x76ad0c['verbose']});_0x1734f1[_0x1b3e6e(0xb6)]();try{if(!_0x49c802){_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0x116),this['port']=await findAvailablePort(0xfa0),_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xc9)+this['port'];const _0x49d38c=_0x76ad0c[_0x1b3e6e(0x92)];try{const _0x36e1c8=await _0x377590[_0x1b3e6e(0x100)][_0x1b3e6e(0x121)]();_0x36e1c8[_0x1b3e6e(0x97)]&&writeCachedAccountInfo(_0x76ad0c[_0x1b3e6e(0x9c)],_0x36e1c8['account_id'],_0x49d38c);}catch{}_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xc2),this['logger']=new TDXLogger(_0x76ad0c[_0x1b3e6e(0x109)],!![]),await this['logger'][_0x1b3e6e(0xbe)]();const _0x34b2fd=this['logger']['getLogPath']();_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xb4)+_0x34b2fd;if(_0x4157c4){if(_0x6c30d3&&!URL[_0x1b3e6e(0x94)](_0x6c30d3))throw new SDKError(ErrorCode[_0x1b3e6e(0xa0)],_0x1b3e6e(0xdc)+_0x6c30d3);const _0x5690a0=_0x6c30d3||getEndpoint(_0x76ad0c[_0x1b3e6e(0x9c)],_0x1b3e6e(0x10e));_0x1734f1['text']=_0x1b3e6e(0x111);if(!_0x377590[_0x1b3e6e(0xa8)][_0x1b3e6e(0x113)])throw new SDKError(ErrorCode[_0x1b3e6e(0xa0)],_0x1b3e6e(0xc5));this[_0x1b3e6e(0x9e)]=new PassThroughProxyServer({'port':this[_0x1b3e6e(0xd2)],'llmProxyUrl':_0x5690a0,'apiKey':_0x377590[_0x1b3e6e(0xa8)]['apiKey'],'logger':this['logger'],'site':_0x76ad0c[_0x1b3e6e(0x9c)],'profile':_0x49d38c}),await this['passThroughServer'][_0x1b3e6e(0xb6)](),_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xbf)+this['port']+_0x1b3e6e(0xee)+_0x5690a0;}else{_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xb7);const _0x3eaa14=await _0x377590['llm'][_0x1b3e6e(0xeb)](),_0x43474a=_0x3eaa14['id'];_0x1734f1[_0x1b3e6e(0x99)]='✓\x20Using\x20project:\x20'+_0x3eaa14[_0x1b3e6e(0xb0)]['name'],_0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xbc),this[_0x1b3e6e(0x96)]=new ProxyServer({'port':this[_0x1b3e6e(0xd2)],'projectId':_0x43474a,'tdx':_0x377590,'logger':this[_0x1b3e6e(0x115)],'site':_0x76ad0c[_0x1b3e6e(0x9c)]}),await this[_0x1b3e6e(0x96)][_0x1b3e6e(0xb6)](),_0x1734f1[_0x1b3e6e(0x99)]='✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20'+this[_0x1b3e6e(0xd2)];}_0x1734f1['text']=_0x1b3e6e(0xba),this[_0x1b3e6e(0x126)]=await createClaudeSettings(this[_0x1b3e6e(0xd2)],_0x37db03,_0x49d38c),_0x1734f1['text']=_0x1b3e6e(0x98);}else _0x1734f1[_0x1b3e6e(0x99)]=_0x1b3e6e(0xd3);try{_0x1734f1['text']='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x1b3e6e(0x115)]),_0x1734f1[_0x1b3e6e(0x99)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x24d5d9){_0x1734f1[_0x1b3e6e(0xf2)](_0x1b3e6e(0x112));throw _0x24d5d9;}try{await ensureMcpServer(_0x1b3e6e(0xc6),_0x1b3e6e(0xe6),_0x1b3e6e(0x9a),_0x1734f1,this['logger']);}catch(_0x27243a){handleInstallationError(_0x27243a,'TD\x20Docs\x20MCP\x20Server',_0x1734f1,this[_0x1b3e6e(0x115)]);}try{await ensureMarketplace(_0x1b3e6e(0xcd),_0x1b3e6e(0xfe),_0x1734f1,this[_0x1b3e6e(0x115)]),await updateMarketplace('td-skills',_0x1734f1,this[_0x1b3e6e(0x115)]),await ensurePlugin(_0x1b3e6e(0x117),_0x1b3e6e(0xcd),_0x1734f1,this[_0x1b3e6e(0x115)]),await ensurePlugin(_0x1b3e6e(0xf7),_0x1b3e6e(0xcd),_0x1734f1,this[_0x1b3e6e(0x115)]),await ensurePlugin('tdx-skills',_0x1b3e6e(0xcd),_0x1734f1,this[_0x1b3e6e(0x115)]);}catch(_0x32d0c5){handleInstallationError(_0x32d0c5,_0x1b3e6e(0xb3),_0x1734f1,this[_0x1b3e6e(0x115)]);}_0x1734f1[_0x1b3e6e(0xd7)]();}catch(_0x99bcb3){_0x1734f1[_0x1b3e6e(0xf2)](_0x1b3e6e(0xa3));throw _0x99bcb3;}const _0xada9bb=await findExecutable(_0x1b3e6e(0xa9));if(!_0xada9bb)throw new SDKError(ErrorCode[_0x1b3e6e(0x8d)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x1b3e6e(0xcf)});const _0x35b07a={...process[_0x1b3e6e(0xcb)]};!_0x49c802&&(_0x35b07a[_0x1b3e6e(0x9b)]=_0x1b3e6e(0x125)+this['port'],_0x37db03&&(_0x35b07a[_0x1b3e6e(0xe7)]=_0x37db03),_0x35b07a[_0x1b3e6e(0xc0)]=_0x1b3e6e(0x124),_0x35b07a[_0x1b3e6e(0x120)]='false',_0x35b07a[_0x1b3e6e(0xe9)]=_0x1b3e6e(0xfb));const _0x4debf9=crossSpawn(_0xada9bb,_0xe29d33,{'stdio':_0x1b3e6e(0xd6),'env':_0x35b07a}),_0xf53d87=await new Promise(_0x1c623d=>{const _0x5d335c=_0x1b3e6e;_0x4debf9['on'](_0x5d335c(0xac),_0x14057e=>{_0x1c623d(_0x14057e||0x0);}),_0x4debf9['on'](_0x5d335c(0x11b),_0x2896d5=>{const _0x153a05=_0x5d335c;console[_0x153a05(0x11b)](a8_0xde6757[_0x153a05(0xa7)](_0x153a05(0xf0)+_0x2896d5[_0x153a05(0x106)])),_0x1c623d(0x1);});});this['server']&&(await this[_0x1b3e6e(0x96)]['stop'](),console['log'](a8_0xde6757[_0x1b3e6e(0xaa)](_0x1b3e6e(0x114))));this[_0x1b3e6e(0x9e)]&&(await this[_0x1b3e6e(0x9e)][_0x1b3e6e(0xd7)](),console[_0x1b3e6e(0xa4)](a8_0xde6757[_0x1b3e6e(0xaa)](_0x1b3e6e(0xec))));if(this['logger']){await this[_0x1b3e6e(0x115)][_0x1b3e6e(0xa2)]();const _0x1ed5d3=this['logger']['getLogPath']();console[_0x1b3e6e(0xa4)](a8_0xde6757[_0x1b3e6e(0xaa)](_0x1b3e6e(0xd8)+_0x1ed5d3));}return this[_0x1b3e6e(0x126)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x1b3e6e(0xa4)](a8_0xde6757[_0x1b3e6e(0xaa)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0xf53d87;}catch(_0x6b466d){this[_0x1b3e6e(0x96)]&&await this[_0x1b3e6e(0x96)][_0x1b3e6e(0xd7)]();this[_0x1b3e6e(0x9e)]&&await this[_0x1b3e6e(0x9e)][_0x1b3e6e(0xd7)]();this[_0x1b3e6e(0x115)]&&await this[_0x1b3e6e(0x115)][_0x1b3e6e(0xa2)]();this['originalSettings']&&await restoreClaudeSettings(this[_0x1b3e6e(0x126)]);throw _0x6b466d;}}}
1
+ const a8_0xd93c37=a8_0x5de1;(function(_0x25196d,_0x1e9dd7){const _0x2d46b7=a8_0x5de1,_0x226cdf=_0x25196d();while(!![]){try{const _0x41aa7c=parseInt(_0x2d46b7(0x1f3))/0x1*(-parseInt(_0x2d46b7(0x1c4))/0x2)+parseInt(_0x2d46b7(0x1f9))/0x3*(parseInt(_0x2d46b7(0x1c9))/0x4)+parseInt(_0x2d46b7(0x1f2))/0x5+-parseInt(_0x2d46b7(0x1c2))/0x6+-parseInt(_0x2d46b7(0x1fb))/0x7+parseInt(_0x2d46b7(0x207))/0x8+parseInt(_0x2d46b7(0x1e2))/0x9;if(_0x41aa7c===_0x1e9dd7)break;else _0x226cdf['push'](_0x226cdf['shift']());}catch(_0x51110d){_0x226cdf['push'](_0x226cdf['shift']());}}}(a8_0x49dd,0x7fbdd));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a8_0x288e9b from'chalk';import{BaseCommand}from'./command.js';function a8_0x5de1(_0x2d90b4,_0x163fe1){_0x2d90b4=_0x2d90b4-0x187;const _0x49dd9f=a8_0x49dd();let _0x5de1a8=_0x49dd9f[_0x2d90b4];return _0x5de1a8;}import{ProxyServer}from'../proxy/server.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a8_0xd93c37(0x189);function handleInstallationError(_0x1bb55e,_0x35d6f1,_0x11e0ea,_0x5ba437){const _0x55c44c=a8_0xd93c37;errorContains(_0x1bb55e,'already\x20exists',_0x55c44c(0x1b2),_0x55c44c(0x188))?(_0x11e0ea['text']='✓\x20'+_0x35d6f1+_0x55c44c(0x1f0),_0x5ba437?.['info'](_0x35d6f1+'\x20already\x20configured'),_0x1bb55e instanceof SDKError&&_0x1bb55e[_0x55c44c(0x1ee)]&&_0x5ba437?.[_0x55c44c(0x1fc)](_0x55c44c(0x1ea)+_0x1bb55e[_0x55c44c(0x1ee)]['message'])):(_0x11e0ea['warn']('Warning:\x20Failed\x20to\x20configure\x20'+_0x35d6f1),_0x5ba437?.[_0x55c44c(0x1f8)](_0x35d6f1+_0x55c44c(0x1b0),_0x1bb55e));}export function parseVersion(_0x2306cc){const _0x400ff0=a8_0xd93c37,_0x39c7f4=_0x2306cc[_0x400ff0(0x195)]()[_0x400ff0(0x1a6)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x39c7f4)return null;return{'major':parseInt(_0x39c7f4[0x1],0xa),'minor':parseInt(_0x39c7f4[0x2],0xa),'patch':parseInt(_0x39c7f4[0x3],0xa)};}export function compareVersions(_0x1a81e3,_0x5eff52){const _0x511ef7=a8_0xd93c37;if(_0x1a81e3[_0x511ef7(0x192)]!==_0x5eff52['major'])return _0x1a81e3[_0x511ef7(0x192)]-_0x5eff52[_0x511ef7(0x192)];if(_0x1a81e3[_0x511ef7(0x21c)]!==_0x5eff52[_0x511ef7(0x21c)])return _0x1a81e3[_0x511ef7(0x21c)]-_0x5eff52['minor'];return _0x1a81e3[_0x511ef7(0x20c)]-_0x5eff52[_0x511ef7(0x20c)];}async function checkClaudeVersion(_0x402e35,_0x144e3c){const _0x12a431=a8_0xd93c37;_0x144e3c?.['debug']('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x402e35+')');const _0x116673=await executeClaudeCommand(['--version'],undefined,_0x144e3c),_0x3273bd=parseVersion(_0x116673);if(!_0x3273bd){_0x144e3c?.['warn'](_0x12a431(0x200)+_0x116673);return;}const _0x3f9c1c=_0x3273bd[_0x12a431(0x192)]+'.'+_0x3273bd[_0x12a431(0x21c)]+'.'+_0x3273bd[_0x12a431(0x20c)],_0xc1b036=parseVersion(_0x402e35);if(!_0xc1b036){_0x144e3c?.[_0x12a431(0x203)]('Invalid\x20minimum\x20version\x20format:\x20'+_0x402e35);return;}if(compareVersions(_0x3273bd,_0xc1b036)<0x0){_0x144e3c?.[_0x12a431(0x1f8)](_0x12a431(0x193)+_0x3f9c1c+_0x12a431(0x1d4)+_0x402e35+')');throw new SDKError(ErrorCode[_0x12a431(0x201)],_0x12a431(0x193)+_0x3f9c1c+_0x12a431(0x214)+_0x402e35+_0x12a431(0x1b7),undefined,{'helpText':_0x12a431(0x18d)});}_0x144e3c?.['debug'](_0x12a431(0x193)+_0x3f9c1c+_0x12a431(0x209));}function a8_0x49dd(){const _0xb9aad0=['Installing\x20plugin\x20\x27','log','model','CLAUDE_CODE_NOT_FOUND','account_id','env','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','CLAUDE_CODE_USE_VERTEX','originalSettings','):\x20claude\x20','type','stringify','Starting\x20TD\x20LLM\x20proxy\x20server...','stop','minor','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','ENOENT','already\x20configured','2.0.20','CLAUDE_CODE_USE_BEDROCK','workflow-skills','user','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','✓\x20Marketplace\x20\x27','llm','includes','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','major','Claude\x20Code\x20version\x20','name','trim','unshift','stdout','td-skills\x20Plugins','Creating\x20.claude/settings.local.json...','\x27\x20configured','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Command\x20spawn\x20error:\x20','Finding\x20available\x20port...','sql-skills','Initializing\x20proxy\x20logger...','mcp','tdx\x20claude\x20statusline','getOrCreateDefaultProject','Claude\x20Code\x20CLI\x20not\x20found','proxy','INSTALLATION_FAILED','match','add','hostname','info','✓\x20Logging\x20to\x20','statusline','ANTHROPIC_MODEL','logLevel','stderr','settings.local.json','\x20configuration\x20failed','llm-proxy','already\x20installed','false','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','marketplace','✓\x20Settings\x20configured:\x20.claude/settings.local.json','\x20or\x20later.','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','✓\x20Using\x20project:\x20','Claude\x20Code\x20version\x20check\x20failed','\x20claude\x20statusline','INTERNAL','http','cwd','parse','Updating\x20marketplace\x20\x27','plugin','6003216dujsto','start','2620QUVxdq','Initializing...','\x27...','✓\x20Claude\x20Code\x20version\x20OK','✓\x20Plugin\x20\x27','127192VgNvsQ','fail','tdx-managed-proxy','exit','close','https://github.com/treasure-data/td-skills','Failed\x20to\x20configure\x20marketplace\x20\x27','message','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','127.0.0.1','Setup\x20failed','\x20is\x20too\x20old\x20(minimum:\x20','command','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','claude','ANTHROPIC_BASE_URL','verbose','Failed\x20to\x20update\x20marketplace\x20\x27','\x27\x20installed','getLogPath','join','Configuring\x20marketplace\x20\x27','tdx','ANTHROPIC_AUTH_TOKEN','statusLine','16157754cHYict','Command\x20failed\x20(exit\x20','TD\x20Docs\x20MCP\x20Server','INVALID_ARGUMENT','string','port','utf-8','passThroughServer','Command\x20output:\x20','✓\x20Found\x20available\x20port:\x20','description','apiKey','cause','server','\x20already\x20configured','localhost','463570lALpCS','566eWxUzQ','.claude','data','site','install','error','87zvxUmk','logger','4362540ZPJcmT','debug','context','continue','execute','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','CLAUDE_CODE_UNSUPPORTED_VERSION','http://127.0.0.1:','warn','toString','Checking\x20Claude\x20Code\x20version...','text','626264dhMqFE','green','\x20meets\x20minimum\x20requirement','code','Setting\x20up\x20project...','patch','td-skills'];a8_0x49dd=function(){return _0xb9aad0;};return a8_0x49dd();}async function executeClaudeCommand(_0x32cf9a,_0x1464fd,_0x25edb1){const _0x4004dd=a8_0xd93c37;return _0x25edb1?.[_0x4004dd(0x1a9)]('Executing:\x20claude\x20'+_0x32cf9a[_0x4004dd(0x1dd)]('\x20')),new Promise((_0x5b5365,_0x2c5064)=>{const _0x3d3dbb=_0x4004dd,_0xf3a6c6=crossSpawn(_0x3d3dbb(0x1d7),_0x32cf9a,{'stdio':'pipe'});let _0x241155='',_0x3ebc24='';_0xf3a6c6[_0x3d3dbb(0x197)]?.['on'](_0x3d3dbb(0x1f5),_0x361caa=>{const _0x114b73=_0x3d3dbb;_0x241155+=_0x361caa[_0x114b73(0x204)]();}),_0xf3a6c6[_0x3d3dbb(0x1ae)]?.['on'](_0x3d3dbb(0x1f5),_0x538d67=>{const _0x2063cb=_0x3d3dbb;_0x3ebc24+=_0x538d67[_0x2063cb(0x204)]();}),_0xf3a6c6['on'](_0x3d3dbb(0x1f8),_0x3b825e=>{const _0x414ce8=_0x3d3dbb;_0x3b825e[_0x414ce8(0x20a)]===_0x414ce8(0x187)?(_0x25edb1?.[_0x414ce8(0x1f8)](_0x414ce8(0x1a3)),_0x2c5064(new SDKError(ErrorCode[_0x414ce8(0x211)],_0x414ce8(0x1a3),_0x3b825e,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x25edb1?.[_0x414ce8(0x1f8)](_0x414ce8(0x19c)+_0x3b825e[_0x414ce8(0x1d0)]),_0x2c5064(new SDKError(ErrorCode[_0x414ce8(0x1bc)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x3b825e[_0x414ce8(0x1d0)],_0x3b825e)));}),_0xf3a6c6['on'](_0x3d3dbb(0x1cc),_0x44d4b3=>{const _0x1dbe31=_0x3d3dbb;if(_0x44d4b3===0x0)_0x5b5365(_0x241155);else _0x1464fd?(_0x25edb1?.[_0x1dbe31(0x1f8)](_0x1dbe31(0x1e3)+_0x44d4b3+_0x1dbe31(0x217)+_0x32cf9a[_0x1dbe31(0x1dd)]('\x20')),_0x2c5064(new SDKError(ErrorCode[_0x1dbe31(0x1a5)],_0x1464fd,new Error(_0x3ebc24)))):_0x5b5365('');});});}async function ensureMcpServer(_0x3d5308,_0x3c0b6f,_0x191c7e,_0x3e3097,_0x1fe4b8){const _0x297e87=a8_0xd93c37;_0x3e3097['text']='Configuring\x20MCP\x20server\x20\x27'+_0x3d5308+_0x297e87(0x1c6),await executeClaudeCommand([_0x297e87(0x1a0),'add',_0x3d5308,_0x3c0b6f,'--transport',_0x191c7e],_0x297e87(0x19b)+_0x3d5308+'\x27',_0x1fe4b8),_0x3e3097[_0x297e87(0x206)]='✓\x20MCP\x20server\x20\x27'+_0x3d5308+_0x297e87(0x19a);}async function ensureMarketplace(_0x3cde8b,_0x36e0af,_0x23aac8,_0x54cb01){const _0x3f40a1=a8_0xd93c37;_0x23aac8[_0x3f40a1(0x206)]=_0x3f40a1(0x1de)+_0x3cde8b+_0x3f40a1(0x1c6),await executeClaudeCommand([_0x3f40a1(0x1c1),'marketplace',_0x3f40a1(0x1a7),_0x36e0af],_0x3f40a1(0x1cf)+_0x3cde8b+'\x27',_0x54cb01),_0x23aac8[_0x3f40a1(0x206)]='✓\x20Marketplace\x20\x27'+_0x3cde8b+'\x27\x20configured';}async function updateMarketplace(_0x11708d,_0x3b5789,_0x29af46){const _0x1fa3d0=a8_0xd93c37;_0x3b5789['text']=_0x1fa3d0(0x1c0)+_0x11708d+'\x27...',await executeClaudeCommand(['plugin',_0x1fa3d0(0x1b5),'update'],_0x1fa3d0(0x1da)+_0x11708d+'\x27',_0x29af46),_0x3b5789[_0x1fa3d0(0x206)]=_0x1fa3d0(0x18e)+_0x11708d+'\x27\x20updated';}async function ensurePlugin(_0xaf185b,_0x47d201,_0x4b4d26,_0xca1b59){const _0x3213e0=a8_0xd93c37;_0x4b4d26[_0x3213e0(0x206)]=_0x3213e0(0x20e)+_0xaf185b+_0x3213e0(0x1c6),await executeClaudeCommand([_0x3213e0(0x1c1),_0x3213e0(0x1f7),_0xaf185b+'@'+_0x47d201],'Failed\x20to\x20install\x20plugin\x20\x27'+_0xaf185b+'\x27',_0xca1b59),_0x4b4d26[_0x3213e0(0x206)]=_0x3213e0(0x1c8)+_0xaf185b+_0x3213e0(0x1db);}async function createClaudeSettings(_0x22a7b2,_0x582a03,_0x62d28b){const _0x481377=a8_0xd93c37,_0x4918f5=join(process[_0x481377(0x1be)](),'.claude'),_0x510319=join(_0x4918f5,_0x481377(0x1af));await mkdir(_0x4918f5,{'recursive':!![]});let _0xf0101a={};if(existsSync(_0x510319))try{const _0x30a7f1=await readFile(_0x510319,_0x481377(0x1e8));_0xf0101a=JSON['parse'](_0x30a7f1);}catch{_0xf0101a={};}const _0x54c1fd=_0xf0101a[_0x481377(0x213)]||{},_0x382631={'ANTHROPIC_BASE_URL':_0x54c1fd['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x54c1fd[_0x481377(0x1ac)],'ANTHROPIC_AUTH_TOKEN':_0x54c1fd[_0x481377(0x1e0)],'CLAUDE_CODE_USE_BEDROCK':_0x54c1fd[_0x481377(0x18a)],'CLAUDE_CODE_USE_VERTEX':_0x54c1fd[_0x481377(0x215)],'statusLine':_0xf0101a[_0x481377(0x1e1)]},_0x595993={..._0xf0101a,'env':{..._0x54c1fd,'ANTHROPIC_BASE_URL':_0x481377(0x202)+_0x22a7b2,..._0x582a03&&{'ANTHROPIC_MODEL':_0x582a03},'ANTHROPIC_AUTH_TOKEN':_0x481377(0x1cb),'CLAUDE_CODE_USE_BEDROCK':_0x481377(0x1b3),'CLAUDE_CODE_USE_VERTEX':_0x481377(0x1b3)},'statusLine':{'type':_0x481377(0x1d5),'command':_0x62d28b?'tdx\x20--profile\x20'+_0x62d28b+_0x481377(0x1bb):_0x481377(0x1a1)}};return await writeFile(_0x510319,JSON[_0x481377(0x219)](_0x595993,null,0x2)+'\x0a'),_0x382631;}async function restoreClaudeSettings(_0x15977d){const _0x4008b5=a8_0xd93c37,_0x3bd2c1=join(process[_0x4008b5(0x1be)](),_0x4008b5(0x1f4)),_0x1b8110=join(_0x3bd2c1,_0x4008b5(0x1af));if(!existsSync(_0x1b8110))return;try{const _0x566546=await readFile(_0x1b8110,_0x4008b5(0x1e8)),_0x350024=JSON[_0x4008b5(0x1bf)](_0x566546),_0x74ac55=_0x350024[_0x4008b5(0x213)]||{},_0x12c930=_0x74ac55['ANTHROPIC_BASE_URL'],_0x4a1dd0=((()=>{const _0x5988a2=_0x4008b5;if(typeof _0x12c930!==_0x5988a2(0x1e6))return![];try{const _0x3531fd=new URL(_0x12c930);return _0x3531fd[_0x5988a2(0x1a8)]===_0x5988a2(0x1f1)||_0x3531fd[_0x5988a2(0x1a8)]===_0x5988a2(0x1d2);}catch{return![];}})());_0x4a1dd0?(delete _0x74ac55['ANTHROPIC_BASE_URL'],delete _0x74ac55['ANTHROPIC_MODEL'],delete _0x74ac55[_0x4008b5(0x1e0)],delete _0x74ac55[_0x4008b5(0x18a)],delete _0x74ac55[_0x4008b5(0x215)]):(_0x15977d[_0x4008b5(0x1d8)]!==undefined?_0x74ac55['ANTHROPIC_BASE_URL']=_0x15977d['ANTHROPIC_BASE_URL']:delete _0x74ac55[_0x4008b5(0x1d8)],_0x15977d[_0x4008b5(0x1ac)]!==undefined?_0x74ac55[_0x4008b5(0x1ac)]=_0x15977d[_0x4008b5(0x1ac)]:delete _0x74ac55['ANTHROPIC_MODEL'],_0x15977d[_0x4008b5(0x1e0)]!==undefined?_0x74ac55[_0x4008b5(0x1e0)]=_0x15977d['ANTHROPIC_AUTH_TOKEN']:delete _0x74ac55['ANTHROPIC_AUTH_TOKEN'],_0x15977d[_0x4008b5(0x18a)]!==undefined?_0x74ac55[_0x4008b5(0x18a)]=_0x15977d['CLAUDE_CODE_USE_BEDROCK']:delete _0x74ac55[_0x4008b5(0x18a)],_0x15977d[_0x4008b5(0x215)]!==undefined?_0x74ac55[_0x4008b5(0x215)]=_0x15977d[_0x4008b5(0x215)]:delete _0x74ac55[_0x4008b5(0x215)]);const _0x467a6a=_0x350024['statusLine'],_0x29a1b0=((()=>{const _0x1a338a=_0x4008b5;if(!_0x467a6a||typeof _0x467a6a!=='object')return![];if(_0x467a6a[_0x1a338a(0x218)]!==_0x1a338a(0x1d5))return![];if(typeof _0x467a6a[_0x1a338a(0x1d5)]!=='string')return![];return _0x467a6a['command']['includes'](_0x1a338a(0x1df))&&_0x467a6a[_0x1a338a(0x1d5)][_0x1a338a(0x190)](_0x1a338a(0x1ab));})());if(_0x29a1b0)delete _0x350024[_0x4008b5(0x1e1)];else _0x15977d[_0x4008b5(0x1e1)]!==undefined?_0x350024[_0x4008b5(0x1e1)]=_0x15977d['statusLine']:delete _0x350024['statusLine'];_0x350024[_0x4008b5(0x213)]=_0x74ac55,await writeFile(_0x1b8110,JSON[_0x4008b5(0x219)](_0x350024,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a8_0xd93c37(0x194)]=a8_0xd93c37(0x1d7);[a8_0xd93c37(0x1ec)]=a8_0xd93c37(0x1b8);[a8_0xd93c37(0x1ef)];[a8_0xd93c37(0x1e9)];[a8_0xd93c37(0x216)];[a8_0xd93c37(0x1fa)];[a8_0xd93c37(0x1e7)];async[a8_0xd93c37(0x1ff)](_0x52b2e1){const _0x282699=a8_0xd93c37,{tdx:_0x118eac,options:_0x375a42,args:_0x5dd6d2}=_0x52b2e1;try{const _0x5ecda7=_0x375a42,_0x113f0d=_0x5ecda7[_0x282699(0x1a4)]===![],_0x1daf05=_0x5ecda7[_0x282699(0x1fe)]===!![],_0x17a077=_0x5ecda7['resume']===!![],_0x2165a0=_0x5ecda7['llmProxy'],_0x3aa004=_0x2165a0!==undefined&&_0x2165a0!==![],_0x7a9eca=typeof _0x2165a0===_0x282699(0x1e6)?_0x2165a0:undefined,_0x2e28c2=_0x3aa004?undefined:_0x5ecda7[_0x282699(0x210)],_0x3412cf=[..._0x5dd6d2];if(_0x1daf05)_0x3412cf[_0x282699(0x196)]('-c');else _0x17a077&&_0x3412cf[_0x282699(0x196)]('-r');const _0x36a28d=createCommandSpinner(_0x282699(0x1c5),{'verbose':_0x375a42[_0x282699(0x1d9)]});_0x36a28d[_0x282699(0x1c3)]();try{if(!_0x113f0d){_0x36a28d[_0x282699(0x206)]=_0x282699(0x19d),this[_0x282699(0x1e7)]=await findAvailablePort(0xfa0),_0x36a28d[_0x282699(0x206)]=_0x282699(0x1eb)+this[_0x282699(0x1e7)];const _0x5b1a19=_0x375a42['profile'];try{const _0x4db66b=await _0x118eac[_0x282699(0x18c)]['getCurrent']();_0x4db66b[_0x282699(0x212)]&&writeCachedAccountInfo(_0x375a42[_0x282699(0x1f6)],_0x4db66b[_0x282699(0x212)],_0x5b1a19);}catch{}_0x36a28d[_0x282699(0x206)]=_0x282699(0x19f),this['logger']=new TDXLogger(_0x375a42[_0x282699(0x1ad)],!![]),await this[_0x282699(0x1fa)]['init']();const _0x1b25ab=this[_0x282699(0x1fa)][_0x282699(0x1dc)]();_0x36a28d[_0x282699(0x206)]=_0x282699(0x1aa)+_0x1b25ab;if(_0x3aa004){if(_0x7a9eca&&!URL['canParse'](_0x7a9eca))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20LLM\x20proxy\x20URL:\x20'+_0x7a9eca);const _0x23eae8=_0x7a9eca||getEndpoint(_0x375a42['site'],_0x282699(0x1b1));_0x36a28d[_0x282699(0x206)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x118eac[_0x282699(0x1fd)][_0x282699(0x1ed)])throw new SDKError(ErrorCode[_0x282699(0x1e5)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x282699(0x1e9)]=new PassThroughProxyServer({'port':this[_0x282699(0x1e7)],'llmProxyUrl':_0x23eae8,'apiKey':_0x118eac[_0x282699(0x1fd)][_0x282699(0x1ed)],'logger':this[_0x282699(0x1fa)],'site':_0x375a42['site'],'profile':_0x5b1a19}),await this[_0x282699(0x1e9)][_0x282699(0x1c3)](),_0x36a28d['text']=_0x282699(0x191)+this['port']+'\x20→\x20'+_0x23eae8;}else{_0x36a28d['text']=_0x282699(0x20b);const _0x4567aa=await _0x118eac[_0x282699(0x18f)][_0x282699(0x1a2)](),_0x5e7557=_0x4567aa['id'];_0x36a28d[_0x282699(0x206)]=_0x282699(0x1b9)+_0x4567aa['attributes']['name'],_0x36a28d[_0x282699(0x206)]=_0x282699(0x21a),this[_0x282699(0x1ef)]=new ProxyServer({'port':this['port'],'projectId':_0x5e7557,'tdx':_0x118eac,'logger':this[_0x282699(0x1fa)],'site':_0x375a42[_0x282699(0x1f6)]}),await this['server'][_0x282699(0x1c3)](),_0x36a28d[_0x282699(0x206)]=_0x282699(0x1b4)+this[_0x282699(0x1e7)];}_0x36a28d['text']=_0x282699(0x199),this[_0x282699(0x216)]=await createClaudeSettings(this[_0x282699(0x1e7)],_0x2e28c2,_0x5b1a19),_0x36a28d[_0x282699(0x206)]=_0x282699(0x1b6);}else _0x36a28d[_0x282699(0x206)]='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{_0x36a28d[_0x282699(0x206)]=_0x282699(0x205),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x282699(0x1fa)]),_0x36a28d[_0x282699(0x206)]=_0x282699(0x1c7);}catch(_0x753e6f){_0x36a28d['fail'](_0x282699(0x1ba));throw _0x753e6f;}try{await ensureMcpServer('td-docs','https://docs.treasuredata.com/mcp',_0x282699(0x1bd),_0x36a28d,this[_0x282699(0x1fa)]);}catch(_0x3ce61c){handleInstallationError(_0x3ce61c,_0x282699(0x1e4),_0x36a28d,this[_0x282699(0x1fa)]);}try{await ensureMarketplace('td-skills',_0x282699(0x1ce),_0x36a28d,this[_0x282699(0x1fa)]),await updateMarketplace(_0x282699(0x20d),_0x36a28d,this['logger']),await ensurePlugin(_0x282699(0x19e),_0x282699(0x20d),_0x36a28d,this['logger']),await ensurePlugin(_0x282699(0x18b),_0x282699(0x20d),_0x36a28d,this[_0x282699(0x1fa)]),await ensurePlugin('tdx-skills','td-skills',_0x36a28d,this['logger']);}catch(_0x453aef){handleInstallationError(_0x453aef,_0x282699(0x198),_0x36a28d,this[_0x282699(0x1fa)]);}_0x36a28d[_0x282699(0x21b)]();}catch(_0x4eb759){_0x36a28d[_0x282699(0x1ca)](_0x282699(0x1d3));throw _0x4eb759;}const _0x883517=await findExecutable('claude');if(!_0x883517)throw new SDKError(ErrorCode[_0x282699(0x211)],_0x282699(0x1a3),undefined,{'helpText':_0x282699(0x1d1)});const _0x13f28c={...process['env']};!_0x113f0d&&(_0x13f28c[_0x282699(0x1d8)]=_0x282699(0x202)+this[_0x282699(0x1e7)],_0x2e28c2&&(_0x13f28c[_0x282699(0x1ac)]=_0x2e28c2),_0x13f28c['ANTHROPIC_AUTH_TOKEN']=_0x282699(0x1cb),_0x13f28c[_0x282699(0x18a)]='false',_0x13f28c['CLAUDE_CODE_USE_VERTEX']=_0x282699(0x1b3));const _0x491a68=crossSpawn(_0x883517,_0x3412cf,{'stdio':'inherit','env':_0x13f28c}),_0x3b1837=await new Promise(_0x1ab166=>{const _0x408555=_0x282699;_0x491a68['on'](_0x408555(0x1cc),_0x5114c3=>{_0x1ab166(_0x5114c3||0x0);}),_0x491a68['on'](_0x408555(0x1f8),_0x31cbcc=>{const _0xe0d258=_0x408555;console[_0xe0d258(0x1f8)](a8_0x288e9b['red']('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x31cbcc[_0xe0d258(0x1d0)])),_0x1ab166(0x1);});});this[_0x282699(0x1ef)]&&(await this['server']['stop'](),console['log'](a8_0x288e9b[_0x282699(0x208)](_0x282699(0x21d))));this['passThroughServer']&&(await this[_0x282699(0x1e9)][_0x282699(0x21b)](),console[_0x282699(0x20f)](a8_0x288e9b[_0x282699(0x208)](_0x282699(0x1d6))));if(this[_0x282699(0x1fa)]){await this['logger'][_0x282699(0x1cd)]();const _0x41d78f=this['logger'][_0x282699(0x1dc)]();console[_0x282699(0x20f)](a8_0x288e9b[_0x282699(0x208)]('✓\x20Logs\x20saved\x20to\x20'+_0x41d78f));}return this[_0x282699(0x216)]&&(await restoreClaudeSettings(this[_0x282699(0x216)]),console['log'](a8_0x288e9b[_0x282699(0x208)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x3b1837;}catch(_0x58bfa4){this[_0x282699(0x1ef)]&&await this[_0x282699(0x1ef)][_0x282699(0x21b)]();this['passThroughServer']&&await this[_0x282699(0x1e9)]['stop']();this[_0x282699(0x1fa)]&&await this[_0x282699(0x1fa)][_0x282699(0x1cd)]();this[_0x282699(0x216)]&&await restoreClaudeSettings(this[_0x282699(0x216)]);throw _0x58bfa4;}}}
@@ -1 +1 @@
1
- const a9_0xbce417=a9_0x591d;(function(_0x9573ac,_0x48b12b){const _0x265f67=a9_0x591d,_0x3bccaa=_0x9573ac();while(!![]){try{const _0x193090=-parseInt(_0x265f67(0x1ea))/0x1+parseInt(_0x265f67(0x1ec))/0x2*(parseInt(_0x265f67(0x1f3))/0x3)+parseInt(_0x265f67(0x1fe))/0x4*(parseInt(_0x265f67(0x1fd))/0x5)+-parseInt(_0x265f67(0x1da))/0x6+parseInt(_0x265f67(0x1ee))/0x7+-parseInt(_0x265f67(0x1fa))/0x8*(parseInt(_0x265f67(0x1e0))/0x9)+parseInt(_0x265f67(0x1e7))/0xa;if(_0x193090===_0x48b12b)break;else _0x3bccaa['push'](_0x3bccaa['shift']());}catch(_0x2b5ca4){_0x3bccaa['push'](_0x3bccaa['shift']());}}}(a9_0x2c94,0x1eb5b));function a9_0x2c94(){const _0x346c35=['parse','421337EgLSfr','💎\x20','execute','monthCredits','\x20-\x20','1374owCgvO','toFixed','latestInputTokens','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','profile','push','💎\x20tdx\x20-\x20Claude','2096ikErlH','\x20|\x20','tdx\x20','41810UxIFRQ','8xYfFzQ','stdin','\x20today\x20/\x20','tdx','close','910716tLdKep','description','site','join','🧠\x20','session_id','3573ocqKWh','name','sessionCredits','log','options','\x20session\x20/\x20','\x20month','2370160WuiBGL','Claude','accountId','92186WjZwAm','statusline','698umklse'];a9_0x2c94=function(){return _0x346c35;};return a9_0x2c94();}import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x26067c=0x64){return new Promise(_0x3b5d97=>{const _0x25ddc9=a9_0x591d;let _0x72209a='',_0x48dc6c=![];const _0x11e6be=createInterface({'input':process[_0x25ddc9(0x1ff)],'terminal':![]}),_0xd60bc2=_0x441d70=>{const _0x4f7065=_0x25ddc9;if(_0x48dc6c)return;_0x48dc6c=!![],clearTimeout(_0x5a6ce7),_0x11e6be[_0x4f7065(0x1d9)](),_0x3b5d97(_0x441d70);},_0x5a6ce7=setTimeout(()=>{_0xd60bc2(null);},_0x26067c);_0x11e6be['on']('line',_0x2d76f7=>{_0x72209a+=_0x2d76f7;}),_0x11e6be['on'](_0x25ddc9(0x1d9),()=>{const _0x318589=_0x25ddc9;if(_0x48dc6c)return;try{const _0x3e8ca4=JSON[_0x318589(0x1ed)](_0x72209a);_0xd60bc2(_0x3e8ca4);}catch{_0xd60bc2(null);}});});}function a9_0x591d(_0x254114,_0x263297){_0x254114=_0x254114-0x1d7;const _0x2c94dd=a9_0x2c94();let _0x591d46=_0x2c94dd[_0x254114];return _0x591d46;}function formatCredits(_0x4364c7){const _0x3490a1=a9_0x591d;return _0x4364c7[_0x3490a1(0x1f4)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a9_0xbce417(0x1e1)]=a9_0xbce417(0x1eb);[a9_0xbce417(0x1db)]=a9_0xbce417(0x1f6);async[a9_0xbce417(0x1f0)](_0x297db2){const _0x5ba74b=a9_0xbce417;try{const _0x403ce0=await readStdinJson();if(!_0x403ce0?.[_0x5ba74b(0x1df)])return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;const _0x2ec848=_0x403ce0[_0x5ba74b(0x1df)],_0x496e12=_0x403ce0['model']?.['id']||'',_0x3211d8=_0x403ce0[_0x5ba74b(0x1f7)]||_0x297db2[_0x5ba74b(0x1e4)][_0x5ba74b(0x1f7)],_0x2b027b=await getUsageStats(_0x2ec848,_0x3211d8),_0x4e8bf7=[],_0x94aaf6=readCachedAccountInfo(_0x3211d8),_0x187958=_0x94aaf6?_0x5ba74b(0x1fc)+_0x94aaf6[_0x5ba74b(0x1dc)]+':'+_0x94aaf6[_0x5ba74b(0x1e9)]:_0x5ba74b(0x1d8),_0x376468=_0x496e12?getModelDisplayName(_0x496e12):_0x5ba74b(0x1e8);_0x4e8bf7['push'](_0x5ba74b(0x1ef)+_0x187958+_0x5ba74b(0x1f2)+_0x376468);const _0x16a3c2=formatCredits(_0x2b027b[_0x5ba74b(0x1e2)]),_0x198e7f=formatCredits(_0x2b027b['todayCredits']),_0x17df4=formatCredits(_0x2b027b[_0x5ba74b(0x1f1)]);_0x4e8bf7[_0x5ba74b(0x1f8)]('🪙\x20credit:\x20'+_0x16a3c2+_0x5ba74b(0x1e5)+_0x198e7f+_0x5ba74b(0x1d7)+_0x17df4+_0x5ba74b(0x1e6));if(_0x2b027b['latestInputTokens']>0x0&&_0x496e12){const _0x3e4a53=formatTokenCount(_0x2b027b[_0x5ba74b(0x1f5)]),_0x56a7d5=calculateContextPercentage(_0x2b027b[_0x5ba74b(0x1f5)],_0x496e12);_0x4e8bf7[_0x5ba74b(0x1f8)](_0x5ba74b(0x1de)+_0x3e4a53+'\x20('+_0x56a7d5+'%)');}return console[_0x5ba74b(0x1e3)](_0x4e8bf7[_0x5ba74b(0x1dd)](_0x5ba74b(0x1fb))),0x0;}catch{return console[_0x5ba74b(0x1e3)](_0x5ba74b(0x1f9)),0x0;}}}
1
+ const a9_0x41ac12=a9_0x544b;(function(_0x4306dc,_0x403e92){const _0x24a757=a9_0x544b,_0x3bf76a=_0x4306dc();while(!![]){try{const _0xcbe940=parseInt(_0x24a757(0x1a6))/0x1*(parseInt(_0x24a757(0x197))/0x2)+parseInt(_0x24a757(0x1a8))/0x3+parseInt(_0x24a757(0x195))/0x4*(parseInt(_0x24a757(0x1b4))/0x5)+-parseInt(_0x24a757(0x1ad))/0x6+-parseInt(_0x24a757(0x196))/0x7*(parseInt(_0x24a757(0x1ac))/0x8)+parseInt(_0x24a757(0x19a))/0x9+-parseInt(_0x24a757(0x19b))/0xa*(parseInt(_0x24a757(0x1a0))/0xb);if(_0xcbe940===_0x403e92)break;else _0x3bf76a['push'](_0x3bf76a['shift']());}catch(_0x77ba3f){_0x3bf76a['push'](_0x3bf76a['shift']());}}}(a9_0x390c,0x55b82));import{createInterface}from'node:readline';function a9_0x544b(_0x27c079,_0x2c5372){_0x27c079=_0x27c079-0x194;const _0x390c3e=a9_0x390c();let _0x544baf=_0x390c3e[_0x27c079];return _0x544baf;}function a9_0x390c(){const _0xa26ea7=['\x20-\x20','sessionCredits','name','58536NMvlrk','52494yDpGJm','statusline','\x20session\x20/\x20','\x20month','join','parse','toFixed','2454475aomfAf','options','log','line','todayCredits','4UxkBrS','469BezrSp','2636Jcsiuo','push','monthCredits','5272587ODGqCA','11386780PErHIJ','site','tdx\x20','🧠\x20','latestInputTokens','11yyyJXq','💎\x20tdx\x20-\x20Claude','model','description','close','🪙\x20credit:\x20','206aIZDvf','profile','1921578neGqBb'];a9_0x390c=function(){return _0xa26ea7;};return a9_0x390c();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x26cb1a=0x64){return new Promise(_0x157c19=>{const _0x96a08b=a9_0x544b;let _0x28b118='',_0x4cd565=![];const _0x34c563=createInterface({'input':process['stdin'],'terminal':![]}),_0xdaf737=_0x4123b7=>{const _0x23d75c=a9_0x544b;if(_0x4cd565)return;_0x4cd565=!![],clearTimeout(_0x20da10),_0x34c563[_0x23d75c(0x1a4)](),_0x157c19(_0x4123b7);},_0x20da10=setTimeout(()=>{_0xdaf737(null);},_0x26cb1a);_0x34c563['on'](_0x96a08b(0x1b7),_0x44bbc2=>{_0x28b118+=_0x44bbc2;}),_0x34c563['on'](_0x96a08b(0x1a4),()=>{const _0x43b21a=_0x96a08b;if(_0x4cd565)return;try{const _0x4414a1=JSON[_0x43b21a(0x1b2)](_0x28b118);_0xdaf737(_0x4414a1);}catch{_0xdaf737(null);}});});}function formatCredits(_0x29ff17){const _0x22e7c4=a9_0x544b;return _0x29ff17[_0x22e7c4(0x1b3)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a9_0x41ac12(0x1ab)]=a9_0x41ac12(0x1ae);[a9_0x41ac12(0x1a3)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async['execute'](_0x471b7e){const _0x9026cf=a9_0x41ac12;try{const _0x4d95a9=await readStdinJson();if(!_0x4d95a9?.['session_id'])return console[_0x9026cf(0x1b6)](_0x9026cf(0x1a1)),0x0;const _0x4fa13c=_0x4d95a9['session_id'],_0x34e828=_0x4d95a9[_0x9026cf(0x1a2)]?.['id']||'',_0x370b2d=_0x4d95a9[_0x9026cf(0x1a7)]||_0x471b7e[_0x9026cf(0x1b5)][_0x9026cf(0x1a7)],_0x11d6bf=await getUsageStats(_0x4fa13c,_0x370b2d),_0x259be6=[],_0xbd8d62=readCachedAccountInfo(_0x370b2d),_0x1fb950=_0xbd8d62?_0x9026cf(0x19d)+_0xbd8d62[_0x9026cf(0x19c)]+':'+_0xbd8d62['accountId']:'tdx',_0x30f977=_0x34e828?getModelDisplayName(_0x34e828):'Claude';_0x259be6[_0x9026cf(0x198)]('💎\x20'+_0x1fb950+_0x9026cf(0x1a9)+_0x30f977);const _0x5a6a99=formatCredits(_0x11d6bf[_0x9026cf(0x1aa)]),_0x38df16=formatCredits(_0x11d6bf[_0x9026cf(0x194)]),_0x179918=formatCredits(_0x11d6bf[_0x9026cf(0x199)]);_0x259be6['push'](_0x9026cf(0x1a5)+_0x5a6a99+_0x9026cf(0x1af)+_0x38df16+'\x20today\x20/\x20'+_0x179918+_0x9026cf(0x1b0));if(_0x11d6bf['latestInputTokens']>0x0&&_0x34e828){const _0x2d714f=formatTokenCount(_0x11d6bf[_0x9026cf(0x19f)]),_0x4812bf=calculateContextPercentage(_0x11d6bf[_0x9026cf(0x19f)],_0x34e828);_0x259be6[_0x9026cf(0x198)](_0x9026cf(0x19e)+_0x2d714f+'\x20('+_0x4812bf+'%)');}return console[_0x9026cf(0x1b6)](_0x259be6[_0x9026cf(0x1b1)]('\x20|\x20')),0x0;}catch{return console[_0x9026cf(0x1b6)](_0x9026cf(0x1a1)),0x0;}}}