@treasuredata/tdx 0.14.8 → 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 (144) 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/utils/async.js +1 -1
  127. package/dist/utils/colors.d.ts +2 -1
  128. package/dist/utils/colors.d.ts.map +1 -1
  129. package/dist/utils/colors.js +1 -1
  130. package/dist/utils/colors.js.map +1 -1
  131. package/dist/utils/diff.js +1 -1
  132. package/dist/utils/file-permissions.js +1 -1
  133. package/dist/utils/json-loader.js +1 -1
  134. package/dist/utils/option-validation.js +1 -1
  135. package/dist/utils/port.js +1 -1
  136. package/dist/utils/process.js +1 -1
  137. package/dist/utils/prompt.js +1 -1
  138. package/dist/utils/spinner.js +1 -1
  139. package/dist/utils/sse-parser.js +1 -1
  140. package/dist/utils/string-utils.js +1 -1
  141. package/dist/utils/table-ref-parser.js +1 -1
  142. package/dist/utils/tdx-logger.js +1 -1
  143. package/dist/utils/version-check.js +1 -1
  144. package/package.json +1 -1
@@ -1 +1 @@
1
- function a3_0x3707(_0x570c04,_0x304b1e){_0x570c04=_0x570c04-0xd9;const _0xf1121=a3_0xf112();let _0x370737=_0xf1121[_0x570c04];return _0x370737;}const a3_0x272067=a3_0x3707;(function(_0x178715,_0x2d57da){const _0x2ab524=a3_0x3707,_0xe5411d=_0x178715();while(!![]){try{const _0x102a69=parseInt(_0x2ab524(0xda))/0x1*(-parseInt(_0x2ab524(0xd9))/0x2)+parseInt(_0x2ab524(0xf2))/0x3+-parseInt(_0x2ab524(0xe5))/0x4*(parseInt(_0x2ab524(0xef))/0x5)+parseInt(_0x2ab524(0xf3))/0x6*(parseInt(_0x2ab524(0xe3))/0x7)+parseInt(_0x2ab524(0xdb))/0x8+parseInt(_0x2ab524(0xfb))/0x9+-parseInt(_0x2ab524(0xe7))/0xa;if(_0x102a69===_0x2d57da)break;else _0xe5411d['push'](_0xe5411d['shift']());}catch(_0xfcb123){_0xe5411d['push'](_0xe5411d['shift']());}}}(a3_0xf112,0x8807a));import{BaseCommand}from'./command.js';function a3_0xf112(){const _0x42a6e6=['Resolving\x20parent\x20segment\x20\x27','execute','\x20\x20Cause:\x20','Site:\x20','8421vbiXTU','Error:\x20','4352116uTiNxH','\x20activation','6397460YrQDer','Parent\x20name:\x20','length','site','data','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Resolved\x20child\x20ID:\x20','Resolved\x20parent\x20ID:\x20','5eStejg','listActivations','error','2505267sqfMvn','3636nKLfTI','Resolving\x20child\x20segment\x20\x27','Child\x20name:\x20','description','resolveSegmentId','cause','segment','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','8395488ELNlNw','List\x20activations\x20for\x20a\x20segment','✔\x20Found\x20','934HskuLb','967KerwBS','1916824rOgmeI','\x27...','message','verbose'];a3_0xf112=function(){return _0x42a6e6;};return a3_0xf112();}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{['name']='activations';[a3_0x272067(0xf6)]=a3_0x272067(0xfc);async[a3_0x272067(0xe0)](_0x4ad280){const _0x36bf37=a3_0x272067,{options:_0x4a7f1f,args:_0x1d864d,tdx:_0x26488c}=_0x4ad280;if(_0x1d864d[_0x36bf37(0xe9)]===0x0)return console[_0x36bf37(0xf1)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x36bf37(0xf1)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x22babe,childId:_0x1a8a9f}=parseSegmentRef(_0x1d864d[0x0]);if(!_0x1a8a9f)return console['error'](_0x36bf37(0xec)),console['error'](_0x36bf37(0xfa)),0x1;_0x4a7f1f[_0x36bf37(0xde)]&&(console[_0x36bf37(0xf1)](_0x36bf37(0xe2)+_0x4a7f1f[_0x36bf37(0xea)]),console[_0x36bf37(0xf1)](_0x36bf37(0xe8)+_0x22babe),console[_0x36bf37(0xf1)](_0x36bf37(0xf5)+_0x1a8a9f));const _0x16ce8a=await withSpinner(_0x36bf37(0xdf)+_0x22babe+_0x36bf37(0xdc),()=>_0x26488c[_0x36bf37(0xf9)]['resolveParentId'](_0x22babe),{'verbose':_0x4a7f1f[_0x36bf37(0xde)]}),_0x409b54=_0x16ce8a['data'];_0x4a7f1f['verbose']&&console[_0x36bf37(0xf1)](_0x36bf37(0xee)+_0x409b54);const _0x22a84e=await withSpinner(_0x36bf37(0xf4)+_0x1a8a9f+_0x36bf37(0xdc),()=>_0x26488c[_0x36bf37(0xf9)][_0x36bf37(0xf7)](_0x409b54,_0x1a8a9f),{'verbose':_0x4a7f1f[_0x36bf37(0xde)]}),_0x199e74=_0x22a84e[_0x36bf37(0xeb)];_0x4a7f1f[_0x36bf37(0xde)]&&console['error'](_0x36bf37(0xed)+_0x199e74);const _0x92abc7=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x1a8a9f+_0x36bf37(0xdc),()=>_0x26488c[_0x36bf37(0xf9)][_0x36bf37(0xf0)](_0x409b54,_0x199e74),{'verbose':_0x4a7f1f[_0x36bf37(0xde)]}),_0x31b3e6=_0x92abc7[_0x36bf37(0xeb)];return console[_0x36bf37(0xf1)](_0x36bf37(0xfd)+_0x31b3e6[_0x36bf37(0xe9)]+_0x36bf37(0xe6)+(_0x31b3e6[_0x36bf37(0xe9)]!==0x1?'s':'')),await handleSDKOutput(_0x31b3e6,_0x4a7f1f),0x0;}catch(_0x2d0f38){if(_0x2d0f38 instanceof SDKError)return console[_0x36bf37(0xf1)](_0x36bf37(0xe4)+_0x2d0f38[_0x36bf37(0xdd)]),_0x2d0f38['cause']&&console[_0x36bf37(0xf1)](_0x36bf37(0xe1)+_0x2d0f38[_0x36bf37(0xf8)]),0x1;throw _0x2d0f38;}}}
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_0x4bcd92=a4_0x4c5c;(function(_0x3eda0f,_0x338f7b){const _0x26f75f=a4_0x4c5c,_0xa9b3f8=_0x3eda0f();while(!![]){try{const _0x5d992c=-parseInt(_0x26f75f(0x1c7))/0x1*(-parseInt(_0x26f75f(0x228))/0x2)+parseInt(_0x26f75f(0x234))/0x3+-parseInt(_0x26f75f(0x240))/0x4*(parseInt(_0x26f75f(0x1e2))/0x5)+-parseInt(_0x26f75f(0x1d1))/0x6*(-parseInt(_0x26f75f(0x201))/0x7)+parseInt(_0x26f75f(0x218))/0x8*(parseInt(_0x26f75f(0x1f6))/0x9)+parseInt(_0x26f75f(0x1f4))/0xa*(-parseInt(_0x26f75f(0x231))/0xb)+parseInt(_0x26f75f(0x1c5))/0xc;if(_0x5d992c===_0x338f7b)break;else _0xa9b3f8['push'](_0xa9b3f8['shift']());}catch(_0x13fae3){_0xa9b3f8['push'](_0xa9b3f8['shift']());}}}(a4_0x2dae,0x1cb5a));import a4_0x576acc from'chalk';import a4_0x32803c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x2dae(){const _0x1241b9=['dim','\x20--profile\x20','force','session','action','log','join','updated','\x20\x20Prompts:\x20','138504sqGaDP','\x20changed','push','yellow','\x20--name\x20','\x20files?','New\x20project\x20ID:\x20','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','new','outputDir','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','No\x20tdx.json\x20found\x20in\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','utf-8','\x20\x20Source:\x20','2xWbhVh','\x22\x20to\x20a\x20different\x20profile','\x22:\x20','projectName','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','MISSING_ARGUMENT','Dry\x20run\x20-\x20no\x20files\x20written','errors','pullAgent','1254275vkGRsf','\x20\x20Agents:\x20','Pushing\x20agent\x20from\x20\x22','260700SyBKHG','green','\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','name','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20|\x20','red','outputPath','Output\x20path:\x20','isNew','\x20resources?','633912CjvglJ','textKnowledgeBases','\x20=\x20','Errors:','Using\x20context\x20project:\x20','Would\x20pull\x20agent:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Agent\x20pulled\x20successfully','prompts','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22...','\x20\x20Knowledge\x20Bases:\x20','Push\x20cancelled','agentName','counts','Writing\x20files...','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','pushProject','Cannot\x20clone\x20from\x20context\x20project\x20\x22','created','dirname','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','agent.yml','Using\x20project:\x20','total','hasChanges','llmProject','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','Agent:\x20','Analyzing\x20changes\x20to\x20push...','\x20\x20Prompt\x20\x22','sourceProjectName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Analyzing\x20project\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','cloneProject','Project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','161832MEoymX','New\x20project:\x20','159513IcvSXz','\x20total','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','INVALID_ARGUMENT','\x20\x20tdx\x20agent\x20pull\x20','agents','\x0aProject\x20pushed\x20with\x20errors','newProjectId','dryRun','parse','135462yBhQIa','newProjectName','\x20created','\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)','llm_project','\x0aWrite\x20','diff','\x0aPull\x20summary\x20for\x20\x27','Pull\x20cancelled','✔\x20Context\x20set:\x20','description','\x20unchanged','tdx.json','New\x20project\x20name\x20is\x20required','error','execute','\x20new','5HhXUWZ','Dry\x20run\x20-\x20no\x20changes\x20made','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)','Summary:','agentId','Source:\x20','Using\x20current\x20project:\x20','knowledgeBases','\x0a✔\x20Pushed\x20','\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','Chat:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','<new-name>','repeat','cwd','\x20\x20Target:\x20','yes','unchanged','10KSluUS','\x0a✔\x20Pulled\x20','9YGGgXS','Clone\x20\x22','\x22\x20to\x20\x22','profile','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Cloning\x20\x22','Would\x20clone:','Agent\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','agent:push','Using\x20local\x20project:\x20','35lPsbHo','Pushing\x20to\x20project...','Clone\x20cancelled','\x0aChanges\x20to\x20agent\x20\x27','llm','\x22\x20to\x20new\x20project\x20\x22','\x20files\x20to\x20','Status:\x20','pullProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20resources\x20to\x20\x27','\x20\x20Agent\x20\x22','projectId','\x20\x20Knowledge\x20Base\x20\x22'];a4_0x2dae=function(){return _0x1241b9;};return a4_0x2dae();}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';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';function a4_0x4c5c(_0x12722d,_0x15b3a9){_0x12722d=_0x12722d-0x1b6;const _0x2dae21=a4_0x2dae();let _0x4c5ca5=_0x2dae21[_0x12722d];return _0x4c5ca5;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5bd4ac){const _0x3bbb33=a4_0x4c5c,_0x341b74=[];if(_0x5bd4ac['total']!==undefined)_0x341b74[_0x3bbb33(0x21a)](_0x5bd4ac[_0x3bbb33(0x1b6)]+_0x3bbb33(0x1c8));if(_0x5bd4ac['new']!==undefined&&_0x5bd4ac['new']>0x0)_0x341b74[_0x3bbb33(0x21a)](a4_0x576acc[_0x3bbb33(0x235)](_0x5bd4ac[_0x3bbb33(0x221)]+_0x3bbb33(0x1e1)));if(_0x5bd4ac[_0x3bbb33(0x253)]!==undefined&&_0x5bd4ac[_0x3bbb33(0x253)]>0x0)_0x341b74[_0x3bbb33(0x21a)](a4_0x576acc[_0x3bbb33(0x235)](_0x5bd4ac[_0x3bbb33(0x253)]+_0x3bbb33(0x1d3)));if(_0x5bd4ac['updated']!==undefined&&_0x5bd4ac[_0x3bbb33(0x216)]>0x0)_0x341b74[_0x3bbb33(0x21a)](a4_0x576acc[_0x3bbb33(0x21b)](_0x5bd4ac[_0x3bbb33(0x216)]+'\x20updated'));if(_0x5bd4ac[_0x3bbb33(0x1f3)]!==undefined&&_0x5bd4ac[_0x3bbb33(0x1f3)]>0x0)_0x341b74[_0x3bbb33(0x21a)](a4_0x576acc['gray'](_0x5bd4ac[_0x3bbb33(0x1f3)]+_0x3bbb33(0x1dc)));if(_0x5bd4ac['errors']!==undefined&&_0x5bd4ac[_0x3bbb33(0x22f)]>0x0)_0x341b74['push'](a4_0x576acc['red'](_0x5bd4ac[_0x3bbb33(0x22f)]+'\x20errors'));return _0x341b74[_0x3bbb33(0x215)](',\x20');}function displayDiffs(_0x50f573,_0x20dc72,_0x5d1e21,_0x2a51f6){const _0x44e00f=a4_0x4c5c;for(const _0x5b48f8 of _0x50f573){if(_0x5b48f8[_0x44e00f(0x1d7)]){const _0x2957ed=_0x5b48f8[_0x44e00f(0x24d)]||_0x5b48f8['name'];console[_0x44e00f(0x214)](_0x44e00f(0x204)+_0x2957ed+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x44e00f(0x214)](_0x5b48f8[_0x44e00f(0x1d7)]),console['log']('─'[_0x44e00f(0x1ef)](0x3c));}}for(const _0x209e62 of _0x20dc72){_0x209e62[_0x44e00f(0x1d7)]&&(console[_0x44e00f(0x214)](_0x44e00f(0x223)+_0x209e62[_0x44e00f(0x238)]+'\x27:'),console[_0x44e00f(0x214)]('─'[_0x44e00f(0x1ef)](0x3c)),console[_0x44e00f(0x214)](_0x209e62[_0x44e00f(0x1d7)]),console[_0x44e00f(0x214)]('─'[_0x44e00f(0x1ef)](0x3c)));}for(const _0x2ce5b3 of _0x5d1e21){_0x2ce5b3[_0x44e00f(0x1d7)]&&(console['log'](_0x44e00f(0x1fa)+_0x2ce5b3[_0x44e00f(0x238)]+'\x27:'),console[_0x44e00f(0x214)]('─'['repeat'](0x3c)),console[_0x44e00f(0x214)](_0x2ce5b3[_0x44e00f(0x1d7)]),console['log']('─'[_0x44e00f(0x1ef)](0x3c)));}for(const _0x5160f6 of _0x2a51f6){_0x5160f6[_0x44e00f(0x1d7)]&&(console[_0x44e00f(0x214)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x5160f6[_0x44e00f(0x238)]+'\x27:'),console[_0x44e00f(0x214)]('─'['repeat'](0x3c)),console[_0x44e00f(0x214)](_0x5160f6[_0x44e00f(0x1d7)]),console[_0x44e00f(0x214)]('─'[_0x44e00f(0x1ef)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x4bcd92(0x1db)]=a4_0x4bcd92(0x1c9);async[a4_0x4bcd92(0x1e0)](_0x11afd1){const _0x584c28=a4_0x4bcd92,{options:_0x35d3a1,args:_0xcf970b,tdx:_0x15ce4f}=_0x11afd1,_0x42002d=_0xcf970b[0x0],_0x593677=_0xcf970b[0x1],_0x499270=_0x35d3a1['output'],_0x54e7a1=_0x35d3a1[_0x584c28(0x1cf)],_0x11e136=_0x35d3a1[_0x584c28(0x211)],_0xb967e0=_0x35d3a1[_0x584c28(0x1f2)],_0x101e5b=_0x35d3a1['llmProject'];let _0xa251ad,_0x517433;const _0x4fa81e=findAgentConfigPath(process['cwd']());if(_0x42002d){const _0x743aef=a4_0x32803c[_0x584c28(0x215)](_0x42002d,_0x584c28(0x1dd));if(existsSync(_0x743aef))try{const _0x441078=JSON[_0x584c28(0x1d0)](readFileSync(_0x743aef,_0x584c28(0x226)));_0xa251ad=_0x441078['llm_project'],_0x517433=_0x42002d,console['log'](a4_0x576acc['dim']('Using\x20project\x20from\x20'+_0x743aef+':\x20'+_0xa251ad));}catch{_0xa251ad=_0x42002d;}else _0xa251ad=_0x42002d;}else{if(_0x4fa81e)try{const _0x1a3e87=JSON[_0x584c28(0x1d0)](readFileSync(_0x4fa81e,_0x584c28(0x226)));_0xa251ad=_0x1a3e87['llm_project'],_0x517433=a4_0x32803c[_0x584c28(0x254)](_0x4fa81e),console[_0x584c28(0x214)](a4_0x576acc[_0x584c28(0x20f)]('Using\x20project:\x20'+_0xa251ad));}catch{_0xa251ad=_0x101e5b;}else _0xa251ad=_0x101e5b;}if(!_0xa251ad)return console[_0x584c28(0x214)](a4_0x576acc[_0x584c28(0x21b)](_0x584c28(0x1c1))),console[_0x584c28(0x214)](_0x584c28(0x1e4)),console[_0x584c28(0x214)](_0x584c28(0x1eb)),console['log'](_0x584c28(0x220)),console[_0x584c28(0x214)](_0x584c28(0x22c)),0x1;if(_0x593677){const {data:_0x272660}=await withSpinner(_0x584c28(0x1b9)+_0x593677+'\x22\x20from\x20project\x20\x22'+_0xa251ad+_0x584c28(0x24a),()=>_0x15ce4f['llm'][_0x584c28(0x230)](_0xa251ad,_0x593677,_0x499270,{'dryRun':_0x54e7a1,'force':_0x11e136}));if(_0x54e7a1)return console['log'](a4_0x576acc[_0x584c28(0x21b)](_0x584c28(0x22e))),console['log'](_0x584c28(0x245)+_0x272660['agentName']),console[_0x584c28(0x214)](_0x584c28(0x23d)+_0x272660[_0x584c28(0x23c)]),_0x272660[_0x584c28(0x1d7)]&&(console['log']('\x0aChanges:'),console[_0x584c28(0x214)]('─'[_0x584c28(0x1ef)](0x3c)),console[_0x584c28(0x214)](_0x272660['diff']),console[_0x584c28(0x214)]('─'['repeat'](0x3c))),0x0;return console[_0x584c28(0x214)](a4_0x576acc[_0x584c28(0x235)](_0x584c28(0x247))),console[_0x584c28(0x214)](_0x584c28(0x1bb)+_0x272660[_0x584c28(0x24d)]),console[_0x584c28(0x214)]('Output:\x20'+_0x272660[_0x584c28(0x23c)]),console[_0x584c28(0x214)](_0x584c28(0x208)+(_0x272660[_0x584c28(0x23e)]?a4_0x576acc[_0x584c28(0x235)](_0x584c28(0x221)):_0x272660[_0x584c28(0x1b7)]?a4_0x576acc[_0x584c28(0x21b)]('updated'):a4_0x576acc['gray'](_0x584c28(0x1f3)))),0x0;}const _0x305b90=_0x517433||_0x499270,{data:_0x19f894}=await withSpinner(_0x584c28(0x1c0)+_0xa251ad+'\x22...',()=>_0x15ce4f[_0x584c28(0x205)][_0x584c28(0x209)](_0xa251ad,_0x305b90,{'dryRun':!![]})),_0x4a92cc=_0x19f894[_0x584c28(0x24e)][_0x584c28(0x1cc)]['new']+_0x19f894['counts'][_0x584c28(0x1e9)]['new']+_0x19f894[_0x584c28(0x24e)][_0x584c28(0x241)][_0x584c28(0x221)]+_0x19f894[_0x584c28(0x24e)][_0x584c28(0x248)][_0x584c28(0x221)],_0x458e1d=_0x19f894[_0x584c28(0x24e)][_0x584c28(0x1cc)]['updated']+_0x19f894[_0x584c28(0x24e)][_0x584c28(0x1e9)]['updated']+_0x19f894[_0x584c28(0x24e)][_0x584c28(0x241)]['updated']+_0x19f894[_0x584c28(0x24e)][_0x584c28(0x248)]['updated'],_0x1b04d3=_0x19f894['counts'][_0x584c28(0x1cc)][_0x584c28(0x1f3)]+_0x19f894[_0x584c28(0x24e)]['knowledgeBases'][_0x584c28(0x1f3)]+_0x19f894[_0x584c28(0x24e)]['textKnowledgeBases'][_0x584c28(0x1f3)]+_0x19f894[_0x584c28(0x24e)][_0x584c28(0x248)][_0x584c28(0x1f3)];console[_0x584c28(0x214)](_0x584c28(0x1d8)+_0x19f894['projectName']+'\x27:'),console[_0x584c28(0x214)]('\x20\x20'+a4_0x576acc[_0x584c28(0x235)]('+\x20'+_0x4a92cc+_0x584c28(0x1e1))+_0x584c28(0x23a)+a4_0x576acc[_0x584c28(0x21b)]('~\x20'+_0x458e1d+_0x584c28(0x219))+'\x20|\x20'+a4_0x576acc[_0x584c28(0x20f)]('=\x20'+_0x1b04d3+_0x584c28(0x1dc))),console[_0x584c28(0x214)]('\x20\x20Agents:\x20'+formatCountSummary(_0x19f894[_0x584c28(0x24e)][_0x584c28(0x1cc)])),console[_0x584c28(0x214)](_0x584c28(0x24b)+formatCountSummary(_0x19f894[_0x584c28(0x24e)][_0x584c28(0x1e9)])),console[_0x584c28(0x214)](_0x584c28(0x237)+formatCountSummary(_0x19f894[_0x584c28(0x24e)][_0x584c28(0x241)])),console[_0x584c28(0x214)](_0x584c28(0x217)+formatCountSummary(_0x19f894[_0x584c28(0x24e)][_0x584c28(0x248)])),console[_0x584c28(0x214)](_0x584c28(0x1f1)+a4_0x576acc[_0x584c28(0x21f)](_0x19f894['outputDir'])),displayDiffs(_0x19f894[_0x584c28(0x1cc)],_0x19f894[_0x584c28(0x1e9)],_0x19f894[_0x584c28(0x241)],_0x19f894[_0x584c28(0x248)]);if(_0x54e7a1)return console[_0x584c28(0x214)](a4_0x576acc[_0x584c28(0x21b)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4a92cc===0x0&&_0x458e1d===0x0)return console[_0x584c28(0x214)](a4_0x576acc[_0x584c28(0x235)](_0x584c28(0x1c4))),saveSessionContext({'llm_project':_0x19f894[_0x584c28(0x22b)]},_0x35d3a1[_0x584c28(0x212)]),console[_0x584c28(0x214)](a4_0x576acc[_0x584c28(0x235)]('✔\x20Context\x20set:\x20'+a4_0x576acc['dim'](_0x584c28(0x1d5))+_0x584c28(0x242)+a4_0x576acc[_0x584c28(0x21f)](_0x19f894[_0x584c28(0x22b)]))),0x0;if(!_0xb967e0&&!_0x11e136){const _0x3bc6fb=await confirmKey(_0x584c28(0x1d6)+(_0x4a92cc+_0x458e1d)+_0x584c28(0x21d));if(!_0x3bc6fb)return console[_0x584c28(0x214)](_0x584c28(0x1d9)),0x0;}const {data:_0x4f22d2}=await withSpinner(_0x584c28(0x24f),()=>_0x15ce4f['llm']['pullProject'](_0xa251ad,_0x305b90,{'force':_0x11e136}));return console[_0x584c28(0x214)](a4_0x576acc['green'](_0x584c28(0x1f5)+(_0x4a92cc+_0x458e1d)+_0x584c28(0x207)+_0x4f22d2[_0x584c28(0x222)])),saveSessionContext({'llm_project':_0x4f22d2[_0x584c28(0x22b)]},_0x35d3a1[_0x584c28(0x212)]),console['log'](a4_0x576acc['green'](_0x584c28(0x1da)+a4_0x576acc[_0x584c28(0x20f)](_0x584c28(0x1d5))+_0x584c28(0x242)+a4_0x576acc[_0x584c28(0x21f)](_0x4f22d2[_0x584c28(0x22b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x4bcd92(0x1db)]=a4_0x4bcd92(0x20a);async['execute'](_0x35bcf8){const _0x21be29=a4_0x4bcd92,{options:_0x4588b0,args:_0x5a51c6,tdx:_0x220f4c}=_0x35bcf8,_0x244b86=_0x5a51c6[0x0],_0x11e263=_0x4588b0['name'],_0x3b4c9b=_0x4588b0[_0x21be29(0x1cf)],_0x30fc52=_0x4588b0[_0x21be29(0x1f2)],_0x51a845=_0x4588b0['site'],_0x121618=_0x4588b0[_0x21be29(0x1b8)];let _0x43fad9;const _0x5d24dc=findAgentConfigPath(process[_0x21be29(0x1f0)]());if(_0x244b86){const _0x4ba3bc=a4_0x32803c[_0x21be29(0x215)](_0x244b86,'tdx.json');existsSync(_0x4ba3bc)?(_0x43fad9=_0x244b86,console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x20f)](_0x21be29(0x200)+_0x244b86))):_0x43fad9=_0x244b86;}else{if(_0x5d24dc)_0x43fad9=a4_0x32803c['dirname'](_0x5d24dc),console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x20f)](_0x21be29(0x1e8)+_0x43fad9));else{if(_0x121618){const _0x469b69=normalizeName(_0x121618),_0x28369c=a4_0x32803c[_0x21be29(0x215)](process[_0x21be29(0x1f0)](),'agents',_0x469b69,_0x21be29(0x1dd));if(existsSync(_0x28369c))_0x43fad9=a4_0x32803c[_0x21be29(0x254)](_0x28369c),console['log'](a4_0x576acc[_0x21be29(0x20f)]('Using\x20local\x20project:\x20'+_0x43fad9));else{const _0x327a9b=_0x4588b0[_0x21be29(0x1f9)];if(_0x327a9b)throw new SDKError(ErrorCode[_0x21be29(0x1ca)],_0x21be29(0x252)+_0x121618+_0x21be29(0x229),undefined,{'helpText':_0x21be29(0x257)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x21be29(0x1cb)+_0x121618+'\x0a')+(_0x21be29(0x225)+_0x469b69+_0x21be29(0x21c)+(_0x11e263||_0x21be29(0x1ee))+_0x21be29(0x210)+_0x327a9b)});_0x43fad9=_0x121618,console['log'](a4_0x576acc[_0x21be29(0x20f)](_0x21be29(0x244)+_0x121618));}}}}if(!_0x43fad9)return console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x21b)](_0x21be29(0x239))),console[_0x21be29(0x214)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x21be29(0x214)](_0x21be29(0x1ed)),console[_0x21be29(0x214)](_0x21be29(0x1d4)),console[_0x21be29(0x214)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x11e263)throw new SDKError(ErrorCode[_0x21be29(0x22d)],_0x21be29(0x1de),undefined,{'helpText':_0x21be29(0x249)});if(!_0x30fc52&&!_0x3b4c9b){const _0x525036=await confirmKey(_0x21be29(0x1f7)+_0x43fad9+_0x21be29(0x206)+_0x11e263+'\x22?');if(!_0x525036)return console[_0x21be29(0x214)](_0x21be29(0x203)),0x0;}const {data:_0x32ed1e}=await withSpinner(_0x21be29(0x1fb)+_0x43fad9+_0x21be29(0x1f8)+_0x11e263+_0x21be29(0x24a),()=>_0x220f4c['llm'][_0x21be29(0x1c2)](_0x43fad9,_0x11e263,{'dryRun':_0x3b4c9b}));if(_0x3b4c9b)return console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x21b)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x21be29(0x214)](_0x21be29(0x1e7)+_0x32ed1e[_0x21be29(0x1be)]),console['log'](_0x21be29(0x1c6)+_0x11e263),console[_0x21be29(0x214)](_0x21be29(0x1fc)),console['log'](_0x21be29(0x232)+_0x32ed1e['counts'][_0x21be29(0x1cc)][_0x21be29(0x253)]),console[_0x21be29(0x214)](_0x21be29(0x24b)+_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x1e9)][_0x21be29(0x253)]),console['log'](_0x21be29(0x217)+_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x248)][_0x21be29(0x253)]),0x0;const _0x123aba=_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x1cc)]['errors']>0x0||_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x1e9)]['errors']>0x0||_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x248)][_0x21be29(0x22f)]>0x0;_0x123aba?console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x21b)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x576acc[_0x21be29(0x235)]('Project\x20cloned\x20successfully'));console['log']('Source:\x20'+_0x32ed1e['sourceProjectName']),console['log'](_0x21be29(0x1c6)+_0x32ed1e[_0x21be29(0x1d2)]),console[_0x21be29(0x214)](_0x21be29(0x21e)+_0x32ed1e[_0x21be29(0x1ce)]),console[_0x21be29(0x214)](),console[_0x21be29(0x214)](_0x21be29(0x1e5)),console['log'](_0x21be29(0x232)+formatCountSummary(_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x1cc)])),console[_0x21be29(0x214)](_0x21be29(0x24b)+formatCountSummary(_0x32ed1e['counts'][_0x21be29(0x1e9)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x32ed1e[_0x21be29(0x24e)][_0x21be29(0x248)]));if(_0x123aba){console['log'](),console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x23b)](_0x21be29(0x243)));for(const _0x48eeb2 of _0x32ed1e['agents']){_0x48eeb2[_0x21be29(0x213)]==='error'&&console['log'](a4_0x576acc[_0x21be29(0x23b)](_0x21be29(0x20c)+_0x48eeb2[_0x21be29(0x24d)]+_0x21be29(0x22a)+_0x48eeb2[_0x21be29(0x1df)]));}for(const _0x6840e4 of _0x32ed1e[_0x21be29(0x1e9)]){_0x6840e4[_0x21be29(0x213)]===_0x21be29(0x1df)&&console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x23b)](_0x21be29(0x20e)+_0x6840e4[_0x21be29(0x238)]+_0x21be29(0x22a)+_0x6840e4[_0x21be29(0x1df)]));}for(const _0x4cfd57 of _0x32ed1e[_0x21be29(0x248)]){_0x4cfd57[_0x21be29(0x213)]==='error'&&console[_0x21be29(0x214)](a4_0x576acc[_0x21be29(0x23b)](_0x21be29(0x1bd)+_0x4cfd57[_0x21be29(0x238)]+'\x22:\x20'+_0x4cfd57[_0x21be29(0x1df)]));}return 0x1;}console['log']();const _0x498f1c=getLLMProjectUrl(_0x51a845,_0x32ed1e[_0x21be29(0x1ce)]);return console[_0x21be29(0x214)](_0x21be29(0x1c3)+a4_0x576acc['cyan'](_0x498f1c)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4bcd92(0x238)]=a4_0x4bcd92(0x1ff);[a4_0x4bcd92(0x1db)]=a4_0x4bcd92(0x250);async[a4_0x4bcd92(0x1e0)](_0x3b4c43){const _0x4428c3=a4_0x4bcd92,{options:_0x32e6d9,args:_0x3c9e83,tdx:_0x10e0eb}=_0x3b4c43;let _0x572181=_0x3c9e83[0x0]||process['cwd']();const _0x32f931=_0x32e6d9['dryRun'],_0x5f0cbc=_0x32e6d9[_0x4428c3(0x211)],_0x3b47db=_0x32e6d9[_0x4428c3(0x1f2)],_0x46431b=_0x32e6d9['site'],_0x2d7051=a4_0x32803c[_0x4428c3(0x215)](_0x572181,_0x4428c3(0x258)),_0x503ae4=existsSync(_0x2d7051);if(_0x503ae4){const {data:_0x489d4a}=await withSpinner(_0x4428c3(0x233)+_0x572181+'\x22...',()=>_0x10e0eb[_0x4428c3(0x205)]['pushAgent'](_0x572181,{'dryRun':_0x32f931,'force':_0x5f0cbc}));if(_0x32f931)return console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x21b)](_0x4428c3(0x1e3))),console[_0x4428c3(0x214)](_0x4428c3(0x1ba)+_0x489d4a[_0x4428c3(0x24d)]),0x0;if(_0x489d4a[_0x4428c3(0x213)]===_0x4428c3(0x1df))return console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x23b)]('Failed\x20to\x20push\x20agent:\x20'+_0x489d4a['error'])),0x1;console['log'](a4_0x576acc[_0x4428c3(0x235)](_0x4428c3(0x1fd)+_0x489d4a[_0x4428c3(0x213)]+_0x4428c3(0x236))),console[_0x4428c3(0x214)]('Agent:\x20'+_0x489d4a[_0x4428c3(0x24d)]);if(_0x489d4a[_0x4428c3(0x1e6)]&&_0x489d4a[_0x4428c3(0x20d)]){const _0x48200f=getLLMAgentChatUrl(_0x46431b,_0x489d4a[_0x4428c3(0x20d)],_0x489d4a[_0x4428c3(0x1e6)]);console[_0x4428c3(0x214)](_0x4428c3(0x1ec)+a4_0x576acc[_0x4428c3(0x21f)](_0x48200f));}return 0x0;}let _0x40ecd6=a4_0x32803c[_0x4428c3(0x215)](_0x572181,_0x4428c3(0x1dd));if(!existsSync(_0x40ecd6)){const _0x38c276=findAgentConfigPath(_0x572181);if(_0x38c276)_0x572181=a4_0x32803c[_0x4428c3(0x254)](_0x38c276),_0x40ecd6=_0x38c276,console['log'](a4_0x576acc[_0x4428c3(0x20f)](_0x4428c3(0x259)+_0x572181));else{const _0x26cb19=_0x32e6d9[_0x4428c3(0x1b8)];if(_0x26cb19){const _0x3ae1a3=normalizeName(_0x26cb19),_0x107ce3=a4_0x32803c[_0x4428c3(0x215)](_0x572181,'agents'),_0x313c3a=a4_0x32803c[_0x4428c3(0x215)](_0x107ce3,_0x3ae1a3,_0x4428c3(0x1dd));existsSync(_0x313c3a)&&(_0x572181=a4_0x32803c[_0x4428c3(0x254)](_0x313c3a),_0x40ecd6=_0x313c3a,console['log'](a4_0x576acc[_0x4428c3(0x20f)](_0x4428c3(0x259)+_0x572181)));}if(!existsSync(_0x40ecd6)){let _0x4dcc92=_0x4428c3(0x246);_0x26cb19&&(_0x4dcc92='Current\x20context\x20has\x20llm_project=\x22'+_0x26cb19+'\x22\x20but\x20no\x20local\x20folder\x20found.\x0a'+('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x26cb19+_0x4428c3(0x255)));throw new SDKError(ErrorCode[_0x4428c3(0x1ca)],_0x4428c3(0x224)+_0x572181,undefined,{'helpText':_0x4dcc92});}}}const {data:_0x19a73f}=await withSpinner(_0x4428c3(0x1bc),()=>_0x10e0eb[_0x4428c3(0x205)][_0x4428c3(0x251)](_0x572181,{'dryRun':!![]})),_0x490286=_0x19a73f[_0x4428c3(0x24e)][_0x4428c3(0x1cc)][_0x4428c3(0x22f)]>0x0;if(_0x490286){console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x23b)]('\x0aErrors\x20found:'));for(const _0x46982c of _0x19a73f['agents']){_0x46982c['action']===_0x4428c3(0x1df)&&console['log'](a4_0x576acc[_0x4428c3(0x23b)](_0x4428c3(0x20c)+_0x46982c[_0x4428c3(0x24d)]+_0x4428c3(0x22a)+_0x46982c[_0x4428c3(0x1df)]));}return 0x1;}const _0x40ae88=_0x19a73f['counts'][_0x4428c3(0x1cc)][_0x4428c3(0x253)]+_0x19a73f[_0x4428c3(0x24e)][_0x4428c3(0x1e9)][_0x4428c3(0x253)]+_0x19a73f['counts']['textKnowledgeBases']['created']+_0x19a73f['counts'][_0x4428c3(0x248)][_0x4428c3(0x253)],_0x277ce1=_0x19a73f[_0x4428c3(0x24e)][_0x4428c3(0x1cc)][_0x4428c3(0x216)]+_0x19a73f[_0x4428c3(0x24e)]['knowledgeBases'][_0x4428c3(0x216)]+_0x19a73f[_0x4428c3(0x24e)]['textKnowledgeBases'][_0x4428c3(0x216)]+_0x19a73f[_0x4428c3(0x24e)][_0x4428c3(0x248)][_0x4428c3(0x216)],_0x3870f5=_0x19a73f['counts'][_0x4428c3(0x1cc)][_0x4428c3(0x1f3)]+_0x19a73f[_0x4428c3(0x24e)][_0x4428c3(0x1e9)][_0x4428c3(0x1f3)]+_0x19a73f['counts']['textKnowledgeBases'][_0x4428c3(0x1f3)]+_0x19a73f['counts'][_0x4428c3(0x248)][_0x4428c3(0x1f3)];console[_0x4428c3(0x214)]('\x0aPush\x20summary\x20for\x20\x27'+_0x19a73f[_0x4428c3(0x22b)]+'\x27:'),console[_0x4428c3(0x214)]('\x20\x20'+a4_0x576acc[_0x4428c3(0x235)]('+\x20'+_0x40ae88+'\x20new')+_0x4428c3(0x23a)+a4_0x576acc[_0x4428c3(0x21b)]('~\x20'+_0x277ce1+_0x4428c3(0x219))+_0x4428c3(0x23a)+a4_0x576acc[_0x4428c3(0x20f)]('=\x20'+_0x3870f5+_0x4428c3(0x1dc))),console[_0x4428c3(0x214)](_0x4428c3(0x232)+formatCountSummary(_0x19a73f[_0x4428c3(0x24e)]['agents'])),console['log'](_0x4428c3(0x24b)+formatCountSummary(_0x19a73f[_0x4428c3(0x24e)]['knowledgeBases'])),console[_0x4428c3(0x214)](_0x4428c3(0x237)+formatCountSummary(_0x19a73f[_0x4428c3(0x24e)][_0x4428c3(0x241)])),console['log'](_0x4428c3(0x217)+formatCountSummary(_0x19a73f['counts']['prompts'])),console['log'](_0x4428c3(0x227)+a4_0x576acc[_0x4428c3(0x21f)](_0x572181)),displayDiffs(_0x19a73f[_0x4428c3(0x1cc)],_0x19a73f[_0x4428c3(0x1e9)],_0x19a73f[_0x4428c3(0x241)],_0x19a73f['prompts']);if(_0x32f931)return console['log'](a4_0x576acc['yellow'](_0x4428c3(0x1bf))),0x0;if(_0x40ae88===0x0&&_0x277ce1===0x0){console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x235)](_0x4428c3(0x256)));const _0x57ea4f=getLLMProjectUrl(_0x46431b,_0x19a73f[_0x4428c3(0x20d)]);return console[_0x4428c3(0x214)]('Project:\x20'+a4_0x576acc['cyan'](_0x57ea4f)),0x0;}if(!_0x3b47db&&!_0x5f0cbc){const _0xe561c=await confirmKey('\x0aPush\x20'+(_0x40ae88+_0x277ce1)+_0x4428c3(0x23f));if(!_0xe561c)return console[_0x4428c3(0x214)](_0x4428c3(0x24c)),0x0;}const {data:_0x360cb5}=await withSpinner(_0x4428c3(0x202),()=>_0x10e0eb[_0x4428c3(0x205)][_0x4428c3(0x251)](_0x572181,{'force':_0x5f0cbc})),_0x1d84e1=_0x360cb5[_0x4428c3(0x24e)][_0x4428c3(0x1cc)][_0x4428c3(0x22f)]>0x0||_0x360cb5[_0x4428c3(0x24e)]['knowledgeBases'][_0x4428c3(0x22f)]>0x0||_0x360cb5[_0x4428c3(0x24e)][_0x4428c3(0x241)][_0x4428c3(0x22f)]>0x0||_0x360cb5[_0x4428c3(0x24e)][_0x4428c3(0x248)][_0x4428c3(0x22f)]>0x0;if(_0x1d84e1){console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x21b)](_0x4428c3(0x1cd))),console['log'](),console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x23b)](_0x4428c3(0x243)));for(const _0x5f1a38 of _0x360cb5[_0x4428c3(0x1cc)]){_0x5f1a38[_0x4428c3(0x213)]==='error'&&console['log'](a4_0x576acc[_0x4428c3(0x23b)](_0x4428c3(0x20c)+_0x5f1a38[_0x4428c3(0x24d)]+_0x4428c3(0x22a)+_0x5f1a38[_0x4428c3(0x1df)]));}for(const _0x5eed95 of _0x360cb5['knowledgeBases']){_0x5eed95[_0x4428c3(0x213)]===_0x4428c3(0x1df)&&console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x23b)](_0x4428c3(0x20e)+_0x5eed95['name']+_0x4428c3(0x22a)+_0x5eed95[_0x4428c3(0x1df)]));}for(const _0x1a022a of _0x360cb5[_0x4428c3(0x241)]){_0x1a022a[_0x4428c3(0x213)]===_0x4428c3(0x1df)&&console[_0x4428c3(0x214)](a4_0x576acc['red'](_0x4428c3(0x1fe)+_0x1a022a[_0x4428c3(0x238)]+_0x4428c3(0x22a)+_0x1a022a[_0x4428c3(0x1df)]));}for(const _0x565ad1 of _0x360cb5[_0x4428c3(0x248)]){_0x565ad1['action']===_0x4428c3(0x1df)&&console[_0x4428c3(0x214)](a4_0x576acc[_0x4428c3(0x23b)]('\x20\x20Prompt\x20\x22'+_0x565ad1[_0x4428c3(0x238)]+_0x4428c3(0x22a)+_0x565ad1[_0x4428c3(0x1df)]));}return 0x1;}console[_0x4428c3(0x214)](a4_0x576acc['green'](_0x4428c3(0x1ea)+(_0x40ae88+_0x277ce1)+_0x4428c3(0x20b)+_0x360cb5['projectName']+'\x27'));const _0x1a7dbf=getLLMProjectUrl(_0x46431b,_0x360cb5[_0x4428c3(0x20d)]);return console[_0x4428c3(0x214)](_0x4428c3(0x1c3)+a4_0x576acc['cyan'](_0x1a7dbf)),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_0x39ff30=a5_0x7555;function a5_0x219a(){const _0x17a0b7=['description','startsWith','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','headers','includes','8kwHbUI','4SAKdTm','color','output','DELETE','9QtnyBY','type','6UMjoOB','stack','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','5508omvoxn','113061VGyUbI','length','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','log','body','POST','proxy-authorization','28897xolGip','trim','header','Invalid\x20header\x20format:\x20\x22','.\x20Valid\x20types:\x20','readBodyFromFile','error','.\x20Valid\x20methods:\x20','PUT','entries','x-trino-user','execute','site','x-auth-token','api','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','join','set-cookie2','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Error:\x20','authorization','file','substring','3739080kcQjRb','cookie','verbose','name','\x0aStack\x20trace:\x0a','\x22.\x20','keys','4842270wepBBr','indexOf','GET','1828203rFXueU','noColor','llm-proxy','data','toUpperCase','cdp','1903120OInJBJ','method','3706192wzJzlW'];a5_0x219a=function(){return _0x17a0b7;};return a5_0x219a();}(function(_0x336635,_0x3453b1){const _0x5eeb9d=a5_0x7555,_0x7c05e4=_0x336635();while(!![]){try{const _0x34688a=parseInt(_0x5eeb9d(0x1b8))/0x1*(-parseInt(_0x5eeb9d(0x1b3))/0x2)+-parseInt(_0x5eeb9d(0x19e))/0x3+parseInt(_0x5eeb9d(0x1ad))/0x4*(-parseInt(_0x5eeb9d(0x1a4))/0x5)+parseInt(_0x5eeb9d(0x194))/0x6+parseInt(_0x5eeb9d(0x1a6))/0x7*(-parseInt(_0x5eeb9d(0x1ac))/0x8)+parseInt(_0x5eeb9d(0x1b1))/0x9*(parseInt(_0x5eeb9d(0x19b))/0xa)+-parseInt(_0x5eeb9d(0x1bf))/0xb*(-parseInt(_0x5eeb9d(0x1b7))/0xc);if(_0x34688a===_0x3453b1)break;else _0x7c05e4['push'](_0x7c05e4['shift']());}catch(_0x36f05a){_0x7c05e4['push'](_0x7c05e4['shift']());}}}(a5_0x219a,0x6ef88));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';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_0x39ff30(0x191),a5_0x39ff30(0x1be),a5_0x39ff30(0x195),'set-cookie',a5_0x39ff30(0x18e),'x-xsrf-token',a5_0x39ff30(0x18a),a5_0x39ff30(0x187)]);function a5_0x7555(_0x52e811,_0x38209a){_0x52e811=_0x52e811-0x186;const _0x219ab1=a5_0x219a();let _0x75555c=_0x219ab1[_0x52e811];return _0x75555c;}function isSensitiveHeader(_0x145977){return SENSITIVE_HEADERS['has'](_0x145977['toLowerCase']());}function parseHeader(_0x5efdcd){const _0x1a7d31=a5_0x39ff30,_0x5b1a8c=_0x5efdcd[_0x1a7d31(0x19c)](':');if(_0x5b1a8c===-0x1)throw new Error(_0x1a7d31(0x1c2)+_0x5efdcd+_0x1a7d31(0x199)+_0x1a7d31(0x1b6));const _0x8e521e=_0x5efdcd[_0x1a7d31(0x193)](0x0,_0x5b1a8c)[_0x1a7d31(0x1c0)](),_0x3eebd3=_0x5efdcd[_0x1a7d31(0x193)](_0x5b1a8c+0x1)[_0x1a7d31(0x1c0)]();if(!_0x8e521e)throw new Error(_0x1a7d31(0x18f)+_0x5efdcd+'\x22');return[_0x8e521e,_0x3eebd3];}export class ApiCommand extends BaseCommand{[a5_0x39ff30(0x197)]=a5_0x39ff30(0x18b);[a5_0x39ff30(0x1a7)]=a5_0x39ff30(0x18c);['validate'](_0x1d985d){const _0x2610a1=a5_0x39ff30,{args:_0x27d0f3,options:_0xd1a0eb}=_0x1d985d,_0x3c7cb0=_0xd1a0eb;if(_0x27d0f3[_0x2610a1(0x1b9)]===0x0)return _0x2610a1(0x1a9);const _0x480fac=_0x27d0f3[0x0];if(!_0x480fac[_0x2610a1(0x1a8)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x480fac;const _0x36fe19=_0x3c7cb0[_0x2610a1(0x1a1)],_0x549a62=_0x3c7cb0[_0x2610a1(0x192)];if(_0x36fe19&&_0x549a62)return _0x2610a1(0x1ba);const _0x711971=_0x3c7cb0[_0x2610a1(0x1a5)]||_0x2610a1(0x19d),_0x63b148=['GET',_0x2610a1(0x1bd),_0x2610a1(0x1c7),_0x2610a1(0x1b0),'PATCH'];if(!_0x63b148[_0x2610a1(0x1ab)](_0x711971[_0x2610a1(0x1a2)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x711971+_0x2610a1(0x1c6)+_0x63b148[_0x2610a1(0x18d)](',\x20');const _0x44018b=_0x3c7cb0[_0x2610a1(0x1b2)]||'td',_0x5017f3=['td',_0x2610a1(0x1a3),'workflow','trino','llm',_0x2610a1(0x1a0)];if(!_0x5017f3[_0x2610a1(0x1ab)](_0x44018b))return'Invalid\x20API\x20type:\x20'+_0x44018b+_0x2610a1(0x1c3)+_0x5017f3[_0x2610a1(0x18d)](',\x20');return undefined;}async[a5_0x39ff30(0x188)](_0x13557a){const _0x957652=a5_0x39ff30,{options:_0x1ab6f3,args:_0x27a460,tdx:_0x9fc498}=_0x13557a,_0xd0dab9=_0x1ab6f3,_0x4d0d67=_0x27a460[0x0],_0x244a46=(_0xd0dab9['method']||'GET')[_0x957652(0x1a2)](),_0x1e1078=_0xd0dab9[_0x957652(0x1a1)],_0x1034ea=_0xd0dab9[_0x957652(0x192)],_0x407067=_0xd0dab9[_0x957652(0x1c1)],_0xb2dbef=_0xd0dab9[_0x957652(0x1b2)]||'td';try{const _0x47286f={};if(_0x407067){const _0x22b571=Array['isArray'](_0x407067)?_0x407067:[_0x407067];for(const _0x134525 of _0x22b571){const [_0x1b5bf9,_0x52e947]=parseHeader(_0x134525);_0x47286f[_0x1b5bf9]=_0x52e947;}}let _0x1c4bc3;if(_0x1e1078)_0x1c4bc3=_0x1e1078;else{if(_0x1034ea)try{_0x1c4bc3=RawAPI[_0x957652(0x1c4)](_0x1034ea);}catch(_0x653157){return console[_0x957652(0x1c5)](_0x957652(0x190)+(_0x653157 instanceof Error?_0x653157['message']:String(_0x653157))),0x1;}}const _0x4784c0={'method':_0x244a46,'apiType':_0xb2dbef,'includeHeaders':_0x1ab6f3[_0x957652(0x196)]};_0x1c4bc3&&(_0x4784c0[_0x957652(0x1bc)]=_0x1c4bc3);Object[_0x957652(0x19a)](_0x47286f)[_0x957652(0x1b9)]>0x0&&(_0x4784c0['headers']=_0x47286f);if(_0x1ab6f3['verbose']){const _0x23f711=resolveSite(_0x1ab6f3[_0x957652(0x189)]),_0x793cc2=getEndpoint(_0x23f711,_0xb2dbef),_0x4af04c=''+_0x793cc2+_0x4d0d67;console[_0x957652(0x1c5)]('>\x20'+_0x244a46+'\x20'+_0x4af04c);const _0x773187=getAuthHeaders(_0x23f711),_0x123bc6={..._0x773187,..._0x47286f};for(const [_0x574400,_0x232307]of Object[_0x957652(0x186)](_0x123bc6)){!isSensitiveHeader(_0x574400)&&console['error']('>\x20'+_0x574400+':\x20'+_0x232307);}_0x1c4bc3&&console[_0x957652(0x1c5)]('>'),console['error']('');}const _0x23fec6=await _0x9fc498[_0x957652(0x18b)]['request'](_0x4d0d67,_0x4784c0);if(_0x1ab6f3[_0x957652(0x196)]&&_0x23fec6[_0x957652(0x1aa)]){console['error']('<\x20HTTP/1.1\x20'+_0x23fec6['status']);for(const [_0x5aa0f8,_0x9c0161]of Object[_0x957652(0x186)](_0x23fec6[_0x957652(0x1aa)])){!isSensitiveHeader(_0x5aa0f8)&&console[_0x957652(0x1c5)]('<\x20'+_0x5aa0f8+':\x20'+_0x9c0161);}console[_0x957652(0x1c5)]('');}const _0x5041aa=Boolean(_0x1ab6f3[_0x957652(0x1af)]),_0x413fd2={'color':_0x1ab6f3[_0x957652(0x1ae)],'noColor':_0x1ab6f3[_0x957652(0x19f)]||_0x5041aa&&!_0x1ab6f3[_0x957652(0x1ae)]},_0xcb8abe=colorizeJSON(_0x23fec6['data'],_0x413fd2);return _0x1ab6f3[_0x957652(0x1af)]?(writeFileSync(_0x1ab6f3['output'],_0xcb8abe),console[_0x957652(0x1c5)]('Results\x20saved\x20to\x20'+_0x1ab6f3[_0x957652(0x1af)])):console[_0x957652(0x1bb)](_0xcb8abe),0x0;}catch(_0x50492e){return _0x50492e instanceof Error?(console[_0x957652(0x1c5)](_0x957652(0x190)+_0x50492e[_0x957652(0x1b5)]),_0x1ab6f3[_0x957652(0x196)]&&_0x50492e[_0x957652(0x1b4)]&&console[_0x957652(0x1c5)](_0x957652(0x198)+_0x50492e[_0x957652(0x1b4)])):console[_0x957652(0x1c5)]('Error:\x20'+String(_0x50492e)),0x1;}}}
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_0x1dbed0=a6_0x45db;(function(_0x217614,_0x61444d){const _0x38ace1=a6_0x45db,_0x5a81ca=_0x217614();while(!![]){try{const _0x1231b9=-parseInt(_0x38ace1(0x14e))/0x1+-parseInt(_0x38ace1(0x130))/0x2+parseInt(_0x38ace1(0x10b))/0x3+parseInt(_0x38ace1(0x138))/0x4*(-parseInt(_0x38ace1(0x143))/0x5)+-parseInt(_0x38ace1(0x142))/0x6*(-parseInt(_0x38ace1(0x15d))/0x7)+-parseInt(_0x38ace1(0x124))/0x8*(parseInt(_0x38ace1(0x161))/0x9)+-parseInt(_0x38ace1(0x131))/0xa*(-parseInt(_0x38ace1(0x127))/0xb);if(_0x1231b9===_0x61444d)break;else _0x5a81ca['push'](_0x5a81ca['shift']());}catch(_0x30ab87){_0x5a81ca['push'](_0x5a81ca['shift']());}}}(a6_0x5727,0x40718));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';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a6_0x25618c from'prompts';function a6_0x5727(){const _0x18c510=['✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','first_name','auth:setup','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','API\x20key\x20cannot\x20be\x20empty','us\x20\x20\x20-\x20United\x20States','jobs','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','create','Site\x20name\x20cannot\x20be\x20empty','40lNedUb','site','message','83116SMDMZQ','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Select\x20your\x20Treasure\x20Data\x20site:','tdx:\x20auth\x20clear','No\x20credential\x20found','status','tdx:\x20auth\x20setup','description','profile','991118gCfgLg','1400snYzkT','System\x20keychain\x20is\x20not\x20available','execute','\x20(profile:\x20','password','text','\x20for\x20profile:\x20','40QDwJsg','\x20\x20tdx','\x0aSetup\x20cancelled','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','push','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','eu01','findIndex','\x20(site:\x20','yellow','18KtZoBN','223370ZxOyef','✗\x20Validation\x20failed:\x20','Enter\x20custom\x20site','Setup\x20API\x20key\x20authentication\x20interactively','ap02','User:\x20','red','\x27\x20registered','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','name','warn','38163gHnBgX','jp\x20\x20\x20-\x20Japan','✓\x20Default\x20site\x20set\x20to\x20','filter','select','apiKey','log','last_name','ERROR','Enter\x20your\x20TD\x20API\x20key:','getUserInfo','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Authentication\x20successful\x0a','/app/mp/ak','length','814492vqLmoc','eu\x20\x20\x20-\x20Europe','us01','Setting\x20up\x20authentication\x20for\x20site:\x20','554706fbQhnn','email','trim','437052oHxCQn','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','tdx\x20profile:\x20','bold','Validating\x20API\x20key...','No\x20API\x20key\x20found\x20in\x20keychain','✓\x20Profile\x20\x27','auth:clear','error','other','customSite','logLevel','join','N/A','jp01'];a6_0x5727=function(){return _0x18c510;};return a6_0x5727();}import{HTTPClientError}from'../sdk/client/http-client.js';function a6_0x45db(_0x81f2f0,_0x1c0db3){_0x81f2f0=_0x81f2f0-0x10b;const _0x57279f=a6_0x5727();let _0x45dbde=_0x57279f[_0x81f2f0];return _0x45dbde;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a6_0x3b4494 from'chalk';export class AuthSetupCommand extends BaseCommand{[a6_0x1dbed0(0x14c)]=a6_0x1dbed0(0x11c);[a6_0x1dbed0(0x12e)]=a6_0x1dbed0(0x146);async['execute'](_0x48c681){const _0x7dcac3=a6_0x1dbed0,{options:_0x50391b}=_0x48c681,_0x4c0f7=_0x50391b['profile'];console[_0x7dcac3(0x154)](a6_0x3b4494[_0x7dcac3(0x10e)](_0x7dcac3(0x12d)));const _0x465e4b=_0x50391b[_0x7dcac3(0x125)]||_0x7dcac3(0x15f),_0x3e6d5e=[{'title':_0x7dcac3(0x11f),'value':_0x7dcac3(0x15f)},{'title':_0x7dcac3(0x14f),'value':_0x7dcac3(0x119)},{'title':_0x7dcac3(0x15e),'value':_0x7dcac3(0x13e)},{'title':'ap02\x20-\x20Korea','value':_0x7dcac3(0x147)}];let _0x73d4fd=_0x3e6d5e[_0x7dcac3(0x13f)](_0x1dfa81=>_0x1dfa81['value']===_0x465e4b);_0x73d4fd===-0x1&&_0x465e4b!==_0x7dcac3(0x15f)&&(_0x3e6d5e[_0x7dcac3(0x13c)]({'title':_0x465e4b,'value':_0x465e4b}),_0x73d4fd=_0x3e6d5e[_0x7dcac3(0x15c)]-0x1);_0x3e6d5e[_0x7dcac3(0x13c)]({'title':_0x7dcac3(0x145),'value':_0x7dcac3(0x114)});const _0x4ff989=_0x4c0f7?_0x7dcac3(0x14b)+_0x4c0f7+'):':_0x7dcac3(0x129),_0xbfdbc6=await a6_0x25618c({'type':_0x7dcac3(0x152),'name':_0x7dcac3(0x125),'message':_0x4ff989,'choices':_0x3e6d5e,'initial':_0x73d4fd>=0x0?_0x73d4fd:0x0});if(!_0xbfdbc6['site'])return console[_0x7dcac3(0x154)](_0x7dcac3(0x13a)),0x1;let _0x4d3248;if(_0xbfdbc6[_0x7dcac3(0x125)]===_0x7dcac3(0x114)){const _0x152915=await a6_0x25618c({'type':_0x7dcac3(0x136),'name':_0x7dcac3(0x115),'message':'Enter\x20site\x20name:','initial':_0x7dcac3(0x15f),'validate':_0x391ee5=>{const _0x362871=_0x7dcac3;if(!_0x391ee5||!_0x391ee5['trim']())return _0x362871(0x123);if(!/^[a-z0-9-]+$/['test'](_0x391ee5[_0x362871(0x163)]()))return _0x362871(0x11d);return!![];}});if(!_0x152915[_0x7dcac3(0x115)])return console[_0x7dcac3(0x154)](_0x7dcac3(0x13a)),0x1;_0x4d3248=_0x152915[_0x7dcac3(0x115)];}else _0x4d3248=_0xbfdbc6['site'];const _0x51936a=resolveSite(_0x4d3248);console[_0x7dcac3(0x154)](_0x7dcac3(0x160)+_0x51936a),console[_0x7dcac3(0x154)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x7dcac3(0x154)]('\x20\x20'+getConsoleUrl(_0x51936a,_0x7dcac3(0x15b)));const _0x5cef0f=await a6_0x25618c({'type':_0x7dcac3(0x135),'name':_0x7dcac3(0x153),'message':_0x7dcac3(0x157),'validate':_0x1ba9d9=>{const _0x4b8369=_0x7dcac3;if(!_0x1ba9d9||!_0x1ba9d9['trim']())return _0x4b8369(0x11e);return!![];}});if(!_0x5cef0f[_0x7dcac3(0x153)])return console[_0x7dcac3(0x154)]('\x0aSetup\x20cancelled'),0x1;const _0x17a841=_0x5cef0f[_0x7dcac3(0x153)];console['log'](_0x7dcac3(0x10f));try{const _0x38f8e7=TDX[_0x7dcac3(0x122)]({'site':_0x51936a,'apiKey':_0x17a841[_0x7dcac3(0x163)](),'logLevel':_0x50391b[_0x7dcac3(0x116)]??LogLevel[_0x7dcac3(0x156)]}),_0x228ce0=await _0x38f8e7[_0x7dcac3(0x120)][_0x7dcac3(0x158)]();console['log'](_0x7dcac3(0x128)+_0x228ce0[_0x7dcac3(0x162)]+')');const _0x431e94=await isKeychainAvailable();_0x431e94?(await saveAPIKeyAsync(_0x17a841['trim'](),_0x51936a,_0x4c0f7),console[_0x7dcac3(0x154)](_0x7dcac3(0x11a)+(_0x4c0f7?_0x7dcac3(0x134)+_0x4c0f7+')':''))):(console['warn'](a6_0x3b4494[_0x7dcac3(0x141)](_0x7dcac3(0x10c))),console[_0x7dcac3(0x14d)](a6_0x3b4494[_0x7dcac3(0x141)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x4c0f7){const _0x27752d={'site':_0x51936a};saveProfileToUserConfig(_0x4c0f7,_0x27752d),console[_0x7dcac3(0x154)](_0x7dcac3(0x111)+_0x4c0f7+_0x7dcac3(0x14a));}else saveDefaultSiteToUserConfig(_0x51936a),console[_0x7dcac3(0x154)](_0x7dcac3(0x150)+_0x51936a);const _0x122326=_0x4c0f7?'\x20--profile\x20'+_0x4c0f7:'';return console[_0x7dcac3(0x154)](),console[_0x7dcac3(0x154)](_0x7dcac3(0x13d)),console[_0x7dcac3(0x154)](_0x7dcac3(0x139)+_0x122326+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x7dcac3(0x154)](_0x7dcac3(0x139)+_0x122326+_0x7dcac3(0x159)),0x0;}catch(_0x358918){if(_0x358918 instanceof HTTPClientError&&_0x358918[_0x7dcac3(0x12c)]===0x191)return printAuthError(_0x358918),0x1;return console[_0x7dcac3(0x113)](a6_0x3b4494[_0x7dcac3(0x149)](_0x7dcac3(0x144)+(_0x358918 instanceof Error?_0x358918[_0x7dcac3(0x126)]:String(_0x358918)))),console[_0x7dcac3(0x113)](_0x7dcac3(0x121)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a6_0x1dbed0(0x14c)]='auth';['description']=a6_0x1dbed0(0x13b);async[a6_0x1dbed0(0x133)](_0x5cf6fe){const _0x48cbc8=a6_0x1dbed0,{options:_0x4a286a,tdx:_0x319de8}=_0x5cf6fe,_0x2f3a9b=_0x4a286a[_0x48cbc8(0x125)],_0x523aa1=_0x4a286a[_0x48cbc8(0x12f)],_0x2d2f73=_0x523aa1?_0x523aa1:_0x48cbc8(0x118);console[_0x48cbc8(0x154)](_0x48cbc8(0x10d)+_0x2d2f73+_0x48cbc8(0x140)+_0x2f3a9b+')');const _0x207a4c=await resolveAPIKeyAsync(_0x2f3a9b,_0x523aa1);if(_0x207a4c){const {source:_0x33572e,isDeprecated:_0x365ae2}=_0x207a4c,_0x51b0b8='Read\x20credential\x20from\x20'+_0x33572e;console['log'](_0x365ae2?a6_0x3b4494[_0x48cbc8(0x141)](_0x51b0b8):_0x51b0b8);}else console['log'](a6_0x3b4494[_0x48cbc8(0x141)](_0x48cbc8(0x12b)));try{const _0x3ef3d0=await _0x319de8['jobs'][_0x48cbc8(0x158)]();return console['log'](a6_0x3b4494['green'](_0x48cbc8(0x15a))),console[_0x48cbc8(0x154)](_0x48cbc8(0x148)+_0x3ef3d0[_0x48cbc8(0x162)]),(_0x3ef3d0['first_name']||_0x3ef3d0[_0x48cbc8(0x155)])&&console[_0x48cbc8(0x154)]('Name:\x20'+[_0x3ef3d0[_0x48cbc8(0x11b)],_0x3ef3d0[_0x48cbc8(0x155)]][_0x48cbc8(0x151)](Boolean)[_0x48cbc8(0x117)]('\x20')),0x0;}catch(_0x469563){return _0x469563 instanceof HTTPClientError&&_0x469563[_0x48cbc8(0x12c)]===0x191?printAuthError(_0x469563,!![],_0x523aa1):console[_0x48cbc8(0x113)](a6_0x3b4494[_0x48cbc8(0x149)](_0x48cbc8(0x144)+(_0x469563 instanceof Error?_0x469563[_0x48cbc8(0x126)]:String(_0x469563)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a6_0x1dbed0(0x14c)]=a6_0x1dbed0(0x112);[a6_0x1dbed0(0x12e)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a6_0x1dbed0(0x133)](_0x4314fb){const _0x2b8295=a6_0x1dbed0,{options:_0x2fc29c}=_0x4314fb,_0x268167=_0x2fc29c[_0x2b8295(0x12f)];console[_0x2b8295(0x154)](a6_0x3b4494[_0x2b8295(0x10e)](_0x2b8295(0x12a)));const _0x43c13c=await isKeychainAvailable();if(!_0x43c13c)return console[_0x2b8295(0x113)](a6_0x3b4494['red'](_0x2b8295(0x132))),0x1;const _0x2f1598=await deleteKeychainAPIKey(_0x268167);return _0x2f1598?(clearCredentialCache(),console[_0x2b8295(0x154)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x268167?_0x2b8295(0x134)+_0x268167+')':'')),0x0):(console['log'](_0x2b8295(0x110)+(_0x268167?_0x2b8295(0x137)+_0x268167:'')),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_0xa54755=a7_0x4244;(function(_0x56ca56,_0x16ca74){const _0x186c1f=a7_0x4244,_0x1dfef3=_0x56ca56();while(!![]){try{const _0x1c39c9=-parseInt(_0x186c1f(0x18a))/0x1*(parseInt(_0x186c1f(0x180))/0x2)+parseInt(_0x186c1f(0x19e))/0x3*(-parseInt(_0x186c1f(0x19b))/0x4)+-parseInt(_0x186c1f(0x181))/0x5+parseInt(_0x186c1f(0x189))/0x6*(-parseInt(_0x186c1f(0x186))/0x7)+parseInt(_0x186c1f(0x18f))/0x8+parseInt(_0x186c1f(0x1ae))/0x9+parseInt(_0x186c1f(0x19c))/0xa*(parseInt(_0x186c1f(0x1b2))/0xb);if(_0x1c39c9===_0x16ca74)break;else _0x1dfef3['push'](_0x1dfef3['shift']());}catch(_0x3117ba){_0x1dfef3['push'](_0x1dfef3['shift']());}}}(a7_0x2eb7,0xe241f));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_0x2eb7(){const _0x26c9c9=['llmAgent','error','llm','code','Error:\x20','data','streamChat','message','handleChatEvent','session\x20context','metadata','92PJzTjo','24971010zsHMpl','Continuing\x20chat:\x20','92526YjzxDm','getAgentId','content','Chat\x20session:\x20','type','claude-4.5-haiku','args','\x20\x20Cause:\x20','getOrCreateDefaultAgent','validate','getDefaultAgent','new','execute','agent','Resolving\x20project\x20\x27','Using\x20cached\x20default\x20agent:\x20','4601871EicjxN','cause','write','CHAT_NOT_FOUND','11ZnBuEw','1110Aokjpg','4210675XjDLSO','stdout','\x0aError:\x20','event','chat','12593jksPEZ','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','404','2142wnJXuB','3019HoPDaK','llmProject','verbose','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','\x27...','14300960AyUmwX'];a7_0x2eb7=function(){return _0x26c9c9;};return a7_0x2eb7();}function a7_0x4244(_0x1652db,_0xee0600){_0x1652db=_0x1652db-0x180;const _0x2eb76d=a7_0x2eb7();let _0x4244d7=_0x2eb76d[_0x1652db];return _0x4244d7;}function handleSDKError(_0x16eefe,_0x5872f9){const _0x97738a=a7_0x4244;if(_0x16eefe instanceof SDKError)console['error'](_0x97738a(0x194)+_0x16eefe[_0x97738a(0x197)]),_0x5872f9[_0x97738a(0x18c)]&&(_0x16eefe[_0x97738a(0x1af)]&&console[_0x97738a(0x191)](_0x97738a(0x1a5)+_0x16eefe[_0x97738a(0x1af)]),_0x16eefe['stack']&&(console['error']('\x0aStack\x20trace:'),console[_0x97738a(0x191)](_0x16eefe['stack'])));else throw _0x16eefe;}export class ChatCommand extends BaseCommand{['name']=a7_0xa54755(0x185);['description']=a7_0xa54755(0x18d);[a7_0xa54755(0x1a7)](_0x540868){const _0x5d83a4=a7_0xa54755,_0x30fd24=_0x540868[_0x5d83a4(0x1a4)]['join']('\x20');if(!_0x30fd24)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a7_0xa54755(0x196)](_0xc80786,_0x2e52a8,_0xc2521c,_0x1132fc,_0x527fad){const _0xa9287e=a7_0xa54755;for await(const _0x1c1e8b of _0xc80786[_0xa9287e(0x192)][_0xa9287e(0x185)](_0x2e52a8,{'agentId':_0xc2521c,'chatId':_0x1132fc})){if(_0x1c1e8b[_0xa9287e(0x1a2)]===_0xa9287e(0x19a)){const _0x3c7c56=_0x1c1e8b[_0xa9287e(0x195)]['chatId'];saveLastChatId(_0x3c7c56),_0x527fad&&console['error'](_0xa9287e(0x1a1)+_0x3c7c56);}else _0x1c1e8b['type']===_0xa9287e(0x184)&&this['handleChatEvent'](_0x1c1e8b[_0xa9287e(0x195)]);}}async[a7_0xa54755(0x19f)](_0x3a4ced,_0x34eb63,_0x1695ca,_0x1cec47,_0x5c367f){const _0x3b23c5=a7_0xa54755,_0x53a4bd=_0x34eb63||_0x1695ca;if(_0x53a4bd){const {projectName:_0x13a9ae,agentName:_0x5387d4}=parseAgentRef(_0x53a4bd),_0x5275f2=_0x5387d4||_0x53a4bd,_0x5105ee=_0x5387d4?_0x13a9ae:_0x1cec47;if(!_0x5105ee)throw new Error(_0x3b23c5(0x187));if(_0x5c367f){const _0x3ba3b8=_0x34eb63?'--agent\x20flag':_0x3b23c5(0x199);console[_0x3b23c5(0x191)]('Using\x20agent\x20from\x20'+_0x3ba3b8+':\x20'+_0x5105ee+'/'+_0x5275f2);}const _0x414bbd=await withSpinner(_0x3b23c5(0x1ac)+_0x5105ee+_0x3b23c5(0x18e),()=>_0x3a4ced[_0x3b23c5(0x192)]['resolveProjectId'](_0x5105ee),{'verbose':_0x5c367f}),_0x131e3c=await withSpinner('Resolving\x20agent\x20\x27'+_0x5275f2+_0x3b23c5(0x18e),()=>_0x3a4ced[_0x3b23c5(0x192)]['resolveAgentId'](_0x5275f2,_0x414bbd[_0x3b23c5(0x195)]),{'verbose':_0x5c367f});return _0x131e3c[_0x3b23c5(0x195)];}else{const _0x262f25=_0x3a4ced[_0x3b23c5(0x192)][_0x3b23c5(0x1a8)]();if(_0x262f25)return _0x5c367f&&console[_0x3b23c5(0x191)](_0x3b23c5(0x1ad)+_0x262f25['name']),_0x262f25['id'];const _0x25ed43=await withSpinner('Getting\x20default\x20agent...',()=>_0x3a4ced[_0x3b23c5(0x192)][_0x3b23c5(0x1a6)](_0x3b23c5(0x1a3),0x0),{'verbose':_0x5c367f});return _0x25ed43[_0x3b23c5(0x195)]['id'];}}async[a7_0xa54755(0x1aa)](_0x466d8d){const _0x13055e=a7_0xa54755,{options:_0x28d51b,args:_0x5af666,tdx:_0x28fdde}=_0x466d8d,_0x2b3f52=_0x5af666['join']('\x20'),_0x3420d1=_0x28d51b,_0xe37a51=_0x3420d1[_0x13055e(0x1ab)],_0x302b6d=_0x3420d1[_0x13055e(0x190)],_0x16acca=_0x3420d1[_0x13055e(0x18b)],_0x12997=_0x3420d1[_0x13055e(0x1a9)];try{let _0x52deab,_0x3fdc85;!_0x12997&&(_0x3fdc85=loadLastChatId(),_0x3fdc85&&_0x28d51b[_0x13055e(0x18c)]&&console[_0x13055e(0x191)](_0x13055e(0x19d)+_0x3fdc85));(_0x12997||!_0x3fdc85)&&(_0x52deab=await this['getAgentId'](_0x28fdde,_0xe37a51,_0x302b6d,_0x16acca,_0x28d51b['verbose']));try{await this['streamChat'](_0x28fdde,_0x2b3f52,_0x52deab,_0x3fdc85,_0x28d51b[_0x13055e(0x18c)]);}catch(_0x59ea5e){const _0x3ea853=_0x59ea5e instanceof SDKError&&_0x59ea5e[_0x13055e(0x193)]===ErrorCode[_0x13055e(0x1b1)]||_0x59ea5e instanceof Error&&_0x59ea5e[_0x13055e(0x197)]['includes'](_0x13055e(0x188));if(_0x3ea853)_0x28d51b[_0x13055e(0x18c)]&&console[_0x13055e(0x191)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x52deab&&(_0x52deab=await this[_0x13055e(0x19f)](_0x28fdde,_0xe37a51,_0x302b6d,_0x16acca,_0x28d51b[_0x13055e(0x18c)])),await this[_0x13055e(0x196)](_0x28fdde,_0x2b3f52,_0x52deab,undefined,_0x28d51b[_0x13055e(0x18c)]);else throw _0x59ea5e;}return console['log'](),0x0;}catch(_0x352d40){return console[_0x13055e(0x191)](),handleSDKError(_0x352d40,_0x28d51b),0x1;}}[a7_0xa54755(0x198)](_0x54c052){const _0x175603=a7_0xa54755;if('content'in _0x54c052)process[_0x175603(0x182)][_0x175603(0x1b0)](_0x54c052[_0x175603(0x1a0)]);else _0x175603(0x191)in _0x54c052&&console[_0x175603(0x191)](_0x175603(0x183)+_0x54c052[_0x175603(0x191)]);}}
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_0xca8d51=a8_0x2c52;(function(_0x22f060,_0x1c26af){const _0x1910de=a8_0x2c52,_0x34eb85=_0x22f060();while(!![]){try{const _0x6c7e9a=-parseInt(_0x1910de(0xb0))/0x1*(parseInt(_0x1910de(0x8b))/0x2)+parseInt(_0x1910de(0x87))/0x3*(-parseInt(_0x1910de(0xc8))/0x4)+parseInt(_0x1910de(0x10c))/0x5*(parseInt(_0x1910de(0xab))/0x6)+parseInt(_0x1910de(0x98))/0x7+-parseInt(_0x1910de(0x73))/0x8+parseInt(_0x1910de(0x106))/0x9+parseInt(_0x1910de(0xd2))/0xa;if(_0x6c7e9a===_0x1c26af)break;else _0x34eb85['push'](_0x34eb85['shift']());}catch(_0x55fbe1){_0x34eb85['push'](_0x34eb85['shift']());}}}(a8_0x54e7,0xb1a0c));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';function a8_0x54e7(){const _0x58722f=['✓\x20Settings\x20configured:\x20.claude/settings.local.json','ANTHROPIC_MODEL','tdx','✓\x20Marketplace\x20\x27','https://github.com/treasure-data/td-skills','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','parse','stringify','✓\x20Using\x20project:\x20','Initializing\x20proxy\x20logger...','2280724bTSIxM','ANTHROPIC_BASE_URL','tdx\x20--profile\x20','td-skills','llm','model','\x20is\x20too\x20old\x20(minimum:\x20','green','Configuring\x20marketplace\x20\x27','):\x20claude\x20','14728390EkuNOX','Checking\x20Claude\x20Code\x20version...','td-docs','getCurrent','CLAUDE_CODE_NOT_FOUND','install','Failed\x20to\x20launch\x20Claude\x20Code:\x20','continue','data','logger','close','127.0.0.1','apiKey','marketplace','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','Failed\x20to\x20configure\x20marketplace\x20\x27','claude','logLevel','stop','llmProxy','workflow-skills','port','\x20claude\x20statusline','already\x20exists','CLAUDE_CODE_USE_BEDROCK','getLogPath','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','llm-proxy','✓\x20Found\x20available\x20port:\x20','settings.local.json','debug','plugin','ANTHROPIC_AUTH_TOKEN','name','fail','getOrCreateDefaultProject','CLAUDE_CODE_UNSUPPORTED_VERSION','false','\x20already\x20configured','text','✓\x20Plugin\x20\x27','toString','mcp','Invalid\x20LLM\x20proxy\x20URL:\x20','error','CLAUDE_CODE_USE_VERTEX','passThroughServer','Starting\x20TD\x20LLM\x20proxy\x20server...','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','tdx-skills','exit','code','5470983GVMRTd','inherit','✓\x20MCP\x20server\x20\x27','https://docs.treasuredata.com/mcp','update','profile','25IKuNiu','already\x20configured','INTERNAL','\x27\x20updated','Setting\x20up\x20project...','patch','tdx-managed-proxy','ENOENT','✓\x20Logging\x20to\x20','string','Updating\x20marketplace\x20\x27','✓\x20Logs\x20saved\x20to\x20','6889112sSXcZl','log','Command\x20output:\x20','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','cause','Claude\x20Code\x20version\x20','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','resume','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','start','\x27...','major','server','utf-8','execute','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','INVALID_ARGUMENT','Invalid\x20minimum\x20version\x20format:\x20','\x27\x20configured','6QhPXMY','localhost','Creating\x20.claude/settings.local.json...','--version','2qYrsUp','Failed\x20to\x20update\x20marketplace\x20\x27','Warning:\x20Failed\x20to\x20configure\x20','\x20or\x20later.','✓\x20Claude\x20Code\x20version\x20OK','td-skills\x20Plugins','command','canParse','info','Command\x20spawn\x20error:\x20','.claude','tdx\x20claude\x20statusline','Failed\x20to\x20install\x20plugin\x20\x27','2985045FJHUlU','Installing\x20plugin\x20\x27','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','minor','originalSettings','\x20configuration\x20failed','Claude\x20Code\x20version\x20check\x20failed','env','account_id','\x20meets\x20minimum\x20requirement','Claude\x20Code\x20CLI\x20not\x20found','cwd','stdout','add','attributes','includes','unshift','TD\x20Docs\x20MCP\x20Server','match','845502GbTkmi','hostname','statusLine','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','already\x20installed','482681wxrZJS','warn','trim','Setup\x20failed','description','type','message','\x20→\x20','http://127.0.0.1:','init','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','site','Failed\x20to\x20spawn\x20claude\x20command:\x20','INSTALLATION_FAILED'];a8_0x54e7=function(){return _0x58722f;};return a8_0x54e7();}import{join}from'node:path';import a8_0x447b62 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';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='2.0.20';function handleInstallationError(_0x44043b,_0x5af972,_0x575ad5,_0x5fd8a5){const _0x5f390f=a8_0x2c52;errorContains(_0x44043b,_0x5f390f(0xe9),_0x5f390f(0xaf),_0x5f390f(0x10d))?(_0x575ad5[_0x5f390f(0xf9)]='✓\x20'+_0x5af972+'\x20already\x20configured',_0x5fd8a5?.['info'](_0x5af972+_0x5f390f(0xf8)),_0x44043b instanceof SDKError&&_0x44043b[_0x5f390f(0x78)]&&_0x5fd8a5?.[_0x5f390f(0xf0)](_0x5f390f(0x75)+_0x44043b[_0x5f390f(0x78)][_0x5f390f(0xb6)])):(_0x575ad5['warn'](_0x5f390f(0x8d)+_0x5af972),_0x5fd8a5?.['error'](_0x5af972+_0x5f390f(0x9d),_0x44043b));}export function parseVersion(_0x461fff){const _0x55a518=a8_0x2c52,_0xf01d75=_0x461fff[_0x55a518(0xb2)]()[_0x55a518(0xaa)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0xf01d75)return null;return{'major':parseInt(_0xf01d75[0x1],0xa),'minor':parseInt(_0xf01d75[0x2],0xa),'patch':parseInt(_0xf01d75[0x3],0xa)};}export function compareVersions(_0x508d43,_0x2cc228){const _0x2b4760=a8_0x2c52;if(_0x508d43[_0x2b4760(0x7f)]!==_0x2cc228[_0x2b4760(0x7f)])return _0x508d43['major']-_0x2cc228['major'];if(_0x508d43[_0x2b4760(0x9b)]!==_0x2cc228[_0x2b4760(0x9b)])return _0x508d43[_0x2b4760(0x9b)]-_0x2cc228['minor'];return _0x508d43['patch']-_0x2cc228[_0x2b4760(0x6c)];}async function checkClaudeVersion(_0xc27e,_0x12e544){const _0x16c3cd=a8_0x2c52;_0x12e544?.[_0x16c3cd(0xf0)](_0x16c3cd(0x102)+_0xc27e+')');const _0xcd3cf=await executeClaudeCommand([_0x16c3cd(0x8a)],undefined,_0x12e544),_0x48be86=parseVersion(_0xcd3cf);if(!_0x48be86){_0x12e544?.[_0x16c3cd(0xb1)](_0x16c3cd(0xec)+_0xcd3cf);return;}const _0x39c0b7=_0x48be86[_0x16c3cd(0x7f)]+'.'+_0x48be86['minor']+'.'+_0x48be86[_0x16c3cd(0x6c)],_0x3c01d5=parseVersion(_0xc27e);if(!_0x3c01d5){_0x12e544?.['warn'](_0x16c3cd(0x85)+_0xc27e);return;}if(compareVersions(_0x48be86,_0x3c01d5)<0x0){_0x12e544?.[_0x16c3cd(0xfe)](_0x16c3cd(0x79)+_0x39c0b7+_0x16c3cd(0xce)+_0xc27e+')');throw new SDKError(ErrorCode[_0x16c3cd(0xf6)],_0x16c3cd(0x79)+_0x39c0b7+_0x16c3cd(0xe0)+_0xc27e+_0x16c3cd(0x8e),undefined,{'helpText':_0x16c3cd(0x7c)});}_0x12e544?.[_0x16c3cd(0xf0)](_0x16c3cd(0x79)+_0x39c0b7+_0x16c3cd(0xa1));}async function executeClaudeCommand(_0x52a3fa,_0x200c1b,_0x20c17a){const _0x1604f1=a8_0x2c52;return _0x20c17a?.[_0x1604f1(0x93)]('Executing:\x20claude\x20'+_0x52a3fa['join']('\x20')),new Promise((_0x1e98c5,_0x481193)=>{const _0xb68c0b=_0x1604f1,_0x56e5ab=crossSpawn(_0xb68c0b(0xe2),_0x52a3fa,{'stdio':'pipe'});let _0x5175aa='',_0x3427f8='';_0x56e5ab[_0xb68c0b(0xa4)]?.['on'](_0xb68c0b(0xda),_0x4f7a38=>{const _0x5bf073=_0xb68c0b;_0x5175aa+=_0x4f7a38[_0x5bf073(0xfb)]();}),_0x56e5ab['stderr']?.['on'](_0xb68c0b(0xda),_0x59ffc4=>{const _0x5e3c21=_0xb68c0b;_0x3427f8+=_0x59ffc4[_0x5e3c21(0xfb)]();}),_0x56e5ab['on'](_0xb68c0b(0xfe),_0x3521ae=>{const _0x38d5d8=_0xb68c0b;_0x3521ae[_0x38d5d8(0x105)]===_0x38d5d8(0x6e)?(_0x20c17a?.[_0x38d5d8(0xfe)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x481193(new SDKError(ErrorCode[_0x38d5d8(0xd6)],_0x38d5d8(0xa2),_0x3521ae,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x20c17a?.['error'](_0x38d5d8(0x94)+_0x3521ae[_0x38d5d8(0xb6)]),_0x481193(new SDKError(ErrorCode[_0x38d5d8(0x10e)],_0x38d5d8(0xbc)+_0x3521ae[_0x38d5d8(0xb6)],_0x3521ae)));}),_0x56e5ab['on'](_0xb68c0b(0x104),_0x1d0a4c=>{const _0xed68d8=_0xb68c0b;if(_0x1d0a4c===0x0)_0x1e98c5(_0x5175aa);else _0x200c1b?(_0x20c17a?.[_0xed68d8(0xfe)]('Command\x20failed\x20(exit\x20'+_0x1d0a4c+_0xed68d8(0xd1)+_0x52a3fa['join']('\x20')),_0x481193(new SDKError(ErrorCode[_0xed68d8(0xbd)],_0x200c1b,new Error(_0x3427f8)))):_0x1e98c5('');});});}async function ensureMcpServer(_0x3edeb7,_0x3ea8a2,_0x8e765a,_0x156508,_0x306720){const _0x592b18=a8_0x2c52;_0x156508[_0x592b18(0xf9)]='Configuring\x20MCP\x20server\x20\x27'+_0x3edeb7+'\x27...',await executeClaudeCommand([_0x592b18(0xfc),_0x592b18(0xa5),_0x3edeb7,_0x3ea8a2,'--transport',_0x8e765a],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x3edeb7+'\x27',_0x306720),_0x156508['text']=_0x592b18(0x108)+_0x3edeb7+'\x27\x20configured';}async function ensureMarketplace(_0x8b399,_0x28099d,_0x4b8fa9,_0x8020c0){const _0x392b36=a8_0x2c52;_0x4b8fa9[_0x392b36(0xf9)]=_0x392b36(0xd0)+_0x8b399+_0x392b36(0x7e),await executeClaudeCommand([_0x392b36(0xf1),_0x392b36(0xdf),'add',_0x28099d],_0x392b36(0xe1)+_0x8b399+'\x27',_0x8020c0),_0x4b8fa9['text']=_0x392b36(0xc1)+_0x8b399+_0x392b36(0x86);}async function updateMarketplace(_0x8e9a5e,_0x5ca100,_0x1a4b53){const _0x431898=a8_0x2c52;_0x5ca100[_0x431898(0xf9)]=_0x431898(0x71)+_0x8e9a5e+'\x27...',await executeClaudeCommand(['plugin',_0x431898(0xdf),_0x431898(0x10a)],_0x431898(0x8c)+_0x8e9a5e+'\x27',_0x1a4b53),_0x5ca100['text']=_0x431898(0xc1)+_0x8e9a5e+_0x431898(0x10f);}async function ensurePlugin(_0x239e5c,_0xa7bb4c,_0x1b4480,_0x58f1b0){const _0x2741f9=a8_0x2c52;_0x1b4480[_0x2741f9(0xf9)]=_0x2741f9(0x99)+_0x239e5c+_0x2741f9(0x7e),await executeClaudeCommand([_0x2741f9(0xf1),_0x2741f9(0xd7),_0x239e5c+'@'+_0xa7bb4c],_0x2741f9(0x97)+_0x239e5c+'\x27',_0x58f1b0),_0x1b4480[_0x2741f9(0xf9)]=_0x2741f9(0xfa)+_0x239e5c+'\x27\x20installed';}function a8_0x2c52(_0x8317fd,_0x5e9a6a){_0x8317fd=_0x8317fd-0x6b;const _0x54e714=a8_0x54e7();let _0x2c52a6=_0x54e714[_0x8317fd];return _0x2c52a6;}async function createClaudeSettings(_0x2b0c02,_0x14dc30,_0x8ab15d){const _0x50944e=a8_0x2c52,_0x58f9f2=join(process[_0x50944e(0xa3)](),_0x50944e(0x95)),_0x460f2b=join(_0x58f9f2,_0x50944e(0xef));await mkdir(_0x58f9f2,{'recursive':!![]});let _0x35cf5a={};if(existsSync(_0x460f2b))try{const _0x418a68=await readFile(_0x460f2b,_0x50944e(0x81));_0x35cf5a=JSON[_0x50944e(0xc4)](_0x418a68);}catch{_0x35cf5a={};}const _0x2cde9d=_0x35cf5a[_0x50944e(0x9f)]||{},_0x48a8d9={'ANTHROPIC_BASE_URL':_0x2cde9d[_0x50944e(0xc9)],'ANTHROPIC_MODEL':_0x2cde9d['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x2cde9d['ANTHROPIC_AUTH_TOKEN'],'CLAUDE_CODE_USE_BEDROCK':_0x2cde9d['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x2cde9d[_0x50944e(0xff)],'statusLine':_0x35cf5a[_0x50944e(0xad)]},_0x5c8236={..._0x35cf5a,'env':{..._0x2cde9d,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x2b0c02,..._0x14dc30&&{'ANTHROPIC_MODEL':_0x14dc30},'ANTHROPIC_AUTH_TOKEN':_0x50944e(0x6d),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x50944e(0xf7)},'statusLine':{'type':_0x50944e(0x91),'command':_0x8ab15d?_0x50944e(0xca)+_0x8ab15d+_0x50944e(0xe8):_0x50944e(0x96)}};return await writeFile(_0x460f2b,JSON[_0x50944e(0xc5)](_0x5c8236,null,0x2)+'\x0a'),_0x48a8d9;}async function restoreClaudeSettings(_0x1112b9){const _0x479af0=a8_0x2c52,_0x3777c8=join(process[_0x479af0(0xa3)](),_0x479af0(0x95)),_0xc2da00=join(_0x3777c8,'settings.local.json');if(!existsSync(_0xc2da00))return;try{const _0x3bd6d5=await readFile(_0xc2da00,'utf-8'),_0x41a554=JSON[_0x479af0(0xc4)](_0x3bd6d5),_0x29bb20=_0x41a554[_0x479af0(0x9f)]||{},_0x18273d=_0x29bb20[_0x479af0(0xc9)],_0x18c6fc=((()=>{const _0x345782=_0x479af0;if(typeof _0x18273d!==_0x345782(0x70))return![];try{const _0x5c2858=new URL(_0x18273d);return _0x5c2858['hostname']===_0x345782(0x88)||_0x5c2858[_0x345782(0xac)]===_0x345782(0xdd);}catch{return![];}})());_0x18c6fc?(delete _0x29bb20['ANTHROPIC_BASE_URL'],delete _0x29bb20[_0x479af0(0xbf)],delete _0x29bb20[_0x479af0(0xf2)],delete _0x29bb20['CLAUDE_CODE_USE_BEDROCK'],delete _0x29bb20[_0x479af0(0xff)]):(_0x1112b9[_0x479af0(0xc9)]!==undefined?_0x29bb20[_0x479af0(0xc9)]=_0x1112b9['ANTHROPIC_BASE_URL']:delete _0x29bb20['ANTHROPIC_BASE_URL'],_0x1112b9[_0x479af0(0xbf)]!==undefined?_0x29bb20['ANTHROPIC_MODEL']=_0x1112b9[_0x479af0(0xbf)]:delete _0x29bb20[_0x479af0(0xbf)],_0x1112b9['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x29bb20[_0x479af0(0xf2)]=_0x1112b9[_0x479af0(0xf2)]:delete _0x29bb20[_0x479af0(0xf2)],_0x1112b9[_0x479af0(0xea)]!==undefined?_0x29bb20[_0x479af0(0xea)]=_0x1112b9['CLAUDE_CODE_USE_BEDROCK']:delete _0x29bb20[_0x479af0(0xea)],_0x1112b9[_0x479af0(0xff)]!==undefined?_0x29bb20[_0x479af0(0xff)]=_0x1112b9[_0x479af0(0xff)]:delete _0x29bb20[_0x479af0(0xff)]);const _0x5909b7=_0x41a554[_0x479af0(0xad)],_0x4212bd=((()=>{const _0x46aef2=_0x479af0;if(!_0x5909b7||typeof _0x5909b7!=='object')return![];if(_0x5909b7[_0x46aef2(0xb5)]!==_0x46aef2(0x91))return![];if(typeof _0x5909b7['command']!==_0x46aef2(0x70))return![];return _0x5909b7[_0x46aef2(0x91)]['includes'](_0x46aef2(0xc0))&&_0x5909b7[_0x46aef2(0x91)][_0x46aef2(0xa7)]('statusline');})());if(_0x4212bd)delete _0x41a554[_0x479af0(0xad)];else _0x1112b9[_0x479af0(0xad)]!==undefined?_0x41a554['statusLine']=_0x1112b9['statusLine']:delete _0x41a554['statusLine'];_0x41a554[_0x479af0(0x9f)]=_0x29bb20,await writeFile(_0xc2da00,JSON[_0x479af0(0xc5)](_0x41a554,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a8_0xca8d51(0xf3)]=a8_0xca8d51(0xe2);[a8_0xca8d51(0xb4)]=a8_0xca8d51(0x76);[a8_0xca8d51(0x80)];[a8_0xca8d51(0x100)];[a8_0xca8d51(0x9c)];[a8_0xca8d51(0xdb)];[a8_0xca8d51(0xe7)];async[a8_0xca8d51(0x82)](_0x54b3bd){const _0x3ad2af=a8_0xca8d51,{tdx:_0x45674c,options:_0x3e12ed,args:_0x94e0e1}=_0x54b3bd;try{const _0x2b1508=_0x3e12ed,_0xf3ebd6=_0x2b1508['proxy']===![],_0x49f9ee=_0x2b1508[_0x3ad2af(0xd9)]===!![],_0x57083a=_0x2b1508[_0x3ad2af(0x7b)]===!![],_0x838948=_0x2b1508[_0x3ad2af(0xe5)],_0x212cd6=_0x838948!==undefined&&_0x838948!==![],_0x19eebe=typeof _0x838948===_0x3ad2af(0x70)?_0x838948:undefined,_0x4a859d=_0x212cd6?undefined:_0x2b1508[_0x3ad2af(0xcd)],_0x39c0e1=[..._0x94e0e1];if(_0x49f9ee)_0x39c0e1['unshift']('-c');else _0x57083a&&_0x39c0e1[_0x3ad2af(0xa8)]('-r');const _0x1dc5c4=createCommandSpinner('Initializing...',{'verbose':_0x3e12ed['verbose']});_0x1dc5c4[_0x3ad2af(0x7d)]();try{if(!_0xf3ebd6){_0x1dc5c4[_0x3ad2af(0xf9)]='Finding\x20available\x20port...',this['port']=await findAvailablePort(0xfa0),_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0xee)+this[_0x3ad2af(0xe7)];const _0x371d40=_0x3e12ed[_0x3ad2af(0x10b)];try{const _0x116a71=await _0x45674c['user'][_0x3ad2af(0xd5)]();_0x116a71[_0x3ad2af(0xa0)]&&writeCachedAccountInfo(_0x3e12ed[_0x3ad2af(0xbb)],_0x116a71[_0x3ad2af(0xa0)],_0x371d40);}catch{}_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0xc7),this[_0x3ad2af(0xdb)]=new TDXLogger(_0x3e12ed[_0x3ad2af(0xe3)],!![]),await this[_0x3ad2af(0xdb)][_0x3ad2af(0xb9)]();const _0x5750cf=this[_0x3ad2af(0xdb)][_0x3ad2af(0xeb)]();_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0x6f)+_0x5750cf;if(_0x212cd6){if(_0x19eebe&&!URL[_0x3ad2af(0x92)](_0x19eebe))throw new SDKError(ErrorCode[_0x3ad2af(0x84)],_0x3ad2af(0xfd)+_0x19eebe);const _0x4bc7d3=_0x19eebe||getEndpoint(_0x3e12ed[_0x3ad2af(0xbb)],_0x3ad2af(0xed));_0x1dc5c4['text']='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x45674c['context'][_0x3ad2af(0xde)])throw new SDKError(ErrorCode[_0x3ad2af(0x84)],_0x3ad2af(0xc3));this['passThroughServer']=new PassThroughProxyServer({'port':this[_0x3ad2af(0xe7)],'llmProxyUrl':_0x4bc7d3,'apiKey':_0x45674c['context'][_0x3ad2af(0xde)],'logger':this[_0x3ad2af(0xdb)],'site':_0x3e12ed[_0x3ad2af(0xbb)],'profile':_0x371d40}),await this[_0x3ad2af(0x100)][_0x3ad2af(0x7d)](),_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0xae)+this['port']+_0x3ad2af(0xb7)+_0x4bc7d3;}else{_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0x6b);const _0x1b26cf=await _0x45674c[_0x3ad2af(0xcc)][_0x3ad2af(0xf5)](),_0x353ecd=_0x1b26cf['id'];_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0xc6)+_0x1b26cf[_0x3ad2af(0xa6)][_0x3ad2af(0xf3)],_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0x101),this[_0x3ad2af(0x80)]=new ProxyServer({'port':this[_0x3ad2af(0xe7)],'projectId':_0x353ecd,'tdx':_0x45674c,'logger':this[_0x3ad2af(0xdb)],'site':_0x3e12ed['site']}),await this[_0x3ad2af(0x80)][_0x3ad2af(0x7d)](),_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0x7a)+this['port'];}_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0x89),this[_0x3ad2af(0x9c)]=await createClaudeSettings(this[_0x3ad2af(0xe7)],_0x4a859d,_0x371d40),_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0xbe);}else _0x1dc5c4['text']=_0x3ad2af(0x83);try{_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0xd3),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x3ad2af(0xdb)]),_0x1dc5c4[_0x3ad2af(0xf9)]=_0x3ad2af(0x8f);}catch(_0x4db1d0){_0x1dc5c4[_0x3ad2af(0xf4)](_0x3ad2af(0x9e));throw _0x4db1d0;}try{await ensureMcpServer(_0x3ad2af(0xd4),_0x3ad2af(0x109),'http',_0x1dc5c4,this[_0x3ad2af(0xdb)]);}catch(_0x2c7d78){handleInstallationError(_0x2c7d78,_0x3ad2af(0xa9),_0x1dc5c4,this['logger']);}try{await ensureMarketplace(_0x3ad2af(0xcb),_0x3ad2af(0xc2),_0x1dc5c4,this[_0x3ad2af(0xdb)]),await updateMarketplace(_0x3ad2af(0xcb),_0x1dc5c4,this[_0x3ad2af(0xdb)]),await ensurePlugin('sql-skills',_0x3ad2af(0xcb),_0x1dc5c4,this[_0x3ad2af(0xdb)]),await ensurePlugin(_0x3ad2af(0xe6),_0x3ad2af(0xcb),_0x1dc5c4,this['logger']),await ensurePlugin(_0x3ad2af(0x103),_0x3ad2af(0xcb),_0x1dc5c4,this[_0x3ad2af(0xdb)]);}catch(_0x178f41){handleInstallationError(_0x178f41,_0x3ad2af(0x90),_0x1dc5c4,this[_0x3ad2af(0xdb)]);}_0x1dc5c4['stop']();}catch(_0x53cd63){_0x1dc5c4[_0x3ad2af(0xf4)](_0x3ad2af(0xb3));throw _0x53cd63;}const _0xd9e144=await findExecutable(_0x3ad2af(0xe2));if(!_0xd9e144)throw new SDKError(ErrorCode[_0x3ad2af(0xd6)],_0x3ad2af(0xa2),undefined,{'helpText':_0x3ad2af(0x9a)});const _0x5eae96={...process['env']};!_0xf3ebd6&&(_0x5eae96[_0x3ad2af(0xc9)]=_0x3ad2af(0xb8)+this[_0x3ad2af(0xe7)],_0x4a859d&&(_0x5eae96['ANTHROPIC_MODEL']=_0x4a859d),_0x5eae96[_0x3ad2af(0xf2)]=_0x3ad2af(0x6d),_0x5eae96[_0x3ad2af(0xea)]=_0x3ad2af(0xf7),_0x5eae96[_0x3ad2af(0xff)]=_0x3ad2af(0xf7));const _0x650306=crossSpawn(_0xd9e144,_0x39c0e1,{'stdio':_0x3ad2af(0x107),'env':_0x5eae96}),_0x22a4dc=await new Promise(_0x32eb3a=>{const _0x200742=_0x3ad2af;_0x650306['on'](_0x200742(0x104),_0x5a8535=>{_0x32eb3a(_0x5a8535||0x0);}),_0x650306['on'](_0x200742(0xfe),_0x5f1f40=>{const _0x566773=_0x200742;console[_0x566773(0xfe)](a8_0x447b62['red'](_0x566773(0xd8)+_0x5f1f40[_0x566773(0xb6)])),_0x32eb3a(0x1);});});this['server']&&(await this[_0x3ad2af(0x80)][_0x3ad2af(0xe4)](),console['log'](a8_0x447b62[_0x3ad2af(0xcf)](_0x3ad2af(0x77))));this[_0x3ad2af(0x100)]&&(await this[_0x3ad2af(0x100)]['stop'](),console[_0x3ad2af(0x74)](a8_0x447b62[_0x3ad2af(0xcf)](_0x3ad2af(0xba))));if(this[_0x3ad2af(0xdb)]){await this[_0x3ad2af(0xdb)]['close']();const _0x358467=this['logger']['getLogPath']();console['log'](a8_0x447b62[_0x3ad2af(0xcf)](_0x3ad2af(0x72)+_0x358467));}return this[_0x3ad2af(0x9c)]&&(await restoreClaudeSettings(this[_0x3ad2af(0x9c)]),console[_0x3ad2af(0x74)](a8_0x447b62['green']('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x22a4dc;}catch(_0x356b5b){this[_0x3ad2af(0x80)]&&await this[_0x3ad2af(0x80)]['stop']();this[_0x3ad2af(0x100)]&&await this[_0x3ad2af(0x100)][_0x3ad2af(0xe4)]();this[_0x3ad2af(0xdb)]&&await this[_0x3ad2af(0xdb)][_0x3ad2af(0xdc)]();this[_0x3ad2af(0x9c)]&&await restoreClaudeSettings(this[_0x3ad2af(0x9c)]);throw _0x356b5b;}}}
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_0x12b74a=a9_0x812a;(function(_0x3e66d1,_0x49e2fb){const _0x4bc99c=a9_0x812a,_0x24097b=_0x3e66d1();while(!![]){try{const _0x150121=-parseInt(_0x4bc99c(0x15e))/0x1*(-parseInt(_0x4bc99c(0x16a))/0x2)+-parseInt(_0x4bc99c(0x161))/0x3+parseInt(_0x4bc99c(0x16e))/0x4*(-parseInt(_0x4bc99c(0x159))/0x5)+parseInt(_0x4bc99c(0x172))/0x6+-parseInt(_0x4bc99c(0x15a))/0x7*(-parseInt(_0x4bc99c(0x16c))/0x8)+parseInt(_0x4bc99c(0x15b))/0x9+parseInt(_0x4bc99c(0x153))/0xa;if(_0x150121===_0x49e2fb)break;else _0x24097b['push'](_0x24097b['shift']());}catch(_0xe6f603){_0x24097b['push'](_0x24097b['shift']());}}}(a9_0x4949,0xaf639));import{createInterface}from'node:readline';function a9_0x812a(_0x58b452,_0xb36f0d){_0x58b452=_0x58b452-0x152;const _0x494994=a9_0x4949();let _0x812a5=_0x494994[_0x58b452];return _0x812a5;}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(_0x43386a=0x64){return new Promise(_0x2bca43=>{const _0x25fed0=a9_0x812a;let _0x29f2ca='',_0x19561e=![];const _0x19ca1c=createInterface({'input':process[_0x25fed0(0x167)],'terminal':![]}),_0x57af3e=_0x2d8067=>{const _0x52970f=_0x25fed0;if(_0x19561e)return;_0x19561e=!![],clearTimeout(_0x129fb8),_0x19ca1c[_0x52970f(0x15f)](),_0x2bca43(_0x2d8067);},_0x129fb8=setTimeout(()=>{_0x57af3e(null);},_0x43386a);_0x19ca1c['on'](_0x25fed0(0x16b),_0x360a5d=>{_0x29f2ca+=_0x360a5d;}),_0x19ca1c['on'](_0x25fed0(0x15f),()=>{const _0x39a258=_0x25fed0;if(_0x19561e)return;try{const _0x133349=JSON[_0x39a258(0x169)](_0x29f2ca);_0x57af3e(_0x133349);}catch{_0x57af3e(null);}});});}function formatCredits(_0x3e76a0){return _0x3e76a0['toFixed'](0x2);}function a9_0x4949(){const _0x12a6f5=['1713100svehJp','Claude','description','\x20today\x20/\x20','log','\x20|\x20','481870MJdMca','3191293QlAiwh','1072980rsHHmO','accountId','🧠\x20','1604uWkWyj','close','\x20month','1866450cnzUMx','💎\x20tdx\x20-\x20Claude','🪙\x20credit:\x20','site','\x20session\x20/\x20','💎\x20','stdin','push','parse','694JdOhkZ','line','8TPsESc','latestInputTokens','48iznVey','session_id','\x20-\x20','profile','7164084TdDzyX','statusline','tdx','join'];a9_0x4949=function(){return _0x12a6f5;};return a9_0x4949();}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a9_0x12b74a(0x173);[a9_0x12b74a(0x155)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async['execute'](_0xf57565){const _0x2f9519=a9_0x12b74a;try{const _0x195164=await readStdinJson();if(!_0x195164?.[_0x2f9519(0x16f)])return console[_0x2f9519(0x157)](_0x2f9519(0x162)),0x0;const _0xa0f824=_0x195164[_0x2f9519(0x16f)],_0x3ea15d=_0x195164['model']?.['id']||'',_0x5b597f=_0x195164[_0x2f9519(0x171)]||_0xf57565['options'][_0x2f9519(0x171)],_0x1fbc9f=await getUsageStats(_0xa0f824,_0x5b597f),_0x3ab055=[],_0x65e52b=readCachedAccountInfo(_0x5b597f),_0x5eb22f=_0x65e52b?'tdx\x20'+_0x65e52b[_0x2f9519(0x164)]+':'+_0x65e52b[_0x2f9519(0x15c)]:_0x2f9519(0x174),_0x47c6c6=_0x3ea15d?getModelDisplayName(_0x3ea15d):_0x2f9519(0x154);_0x3ab055[_0x2f9519(0x168)](_0x2f9519(0x166)+_0x5eb22f+_0x2f9519(0x170)+_0x47c6c6);const _0x1b56cc=formatCredits(_0x1fbc9f['sessionCredits']),_0x5b2a03=formatCredits(_0x1fbc9f['todayCredits']),_0x319214=formatCredits(_0x1fbc9f['monthCredits']);_0x3ab055[_0x2f9519(0x168)](_0x2f9519(0x163)+_0x1b56cc+_0x2f9519(0x165)+_0x5b2a03+_0x2f9519(0x156)+_0x319214+_0x2f9519(0x160));if(_0x1fbc9f[_0x2f9519(0x16d)]>0x0&&_0x3ea15d){const _0x13de55=formatTokenCount(_0x1fbc9f['latestInputTokens']),_0x56391c=calculateContextPercentage(_0x1fbc9f[_0x2f9519(0x16d)],_0x3ea15d);_0x3ab055['push'](_0x2f9519(0x15d)+_0x13de55+'\x20('+_0x56391c+'%)');}return console['log'](_0x3ab055[_0x2f9519(0x152)](_0x2f9519(0x158))),0x0;}catch{return console['log']('💎\x20tdx\x20-\x20Claude'),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;}}}