@treasuredata/tdx 2026.6.1 → 2026.6.2

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 (240) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/table-deleted.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.js +1 -1
  59. package/dist/commands/workflow-command.d.ts +2 -2
  60. package/dist/commands/workflow-command.d.ts.map +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/commands/workflow-command.js.map +1 -1
  63. package/dist/core/auth.js +1 -1
  64. package/dist/core/command-output.js +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/constants.js +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.js +1 -1
  71. package/dist/core/oauth-keychain.js +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/cas/cas-api-client.js +1 -1
  99. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/index.js +1 -1
  102. package/dist/sdk/cas/pull-workflow.js +1 -1
  103. package/dist/sdk/cas/push-workflow.js +1 -1
  104. package/dist/sdk/client/cdp-api-client.js +1 -1
  105. package/dist/sdk/client/delivery-api-client.js +1 -1
  106. package/dist/sdk/client/endpoints.js +1 -1
  107. package/dist/sdk/client/engage-api-client.js +1 -1
  108. package/dist/sdk/client/http-client.js +1 -1
  109. package/dist/sdk/client/llm-api-client.js +1 -1
  110. package/dist/sdk/client/oauth-refresh.js +1 -1
  111. package/dist/sdk/client/rate-limiter.js +1 -1
  112. package/dist/sdk/client/td-api-client.js +1 -1
  113. package/dist/sdk/client/trino-api-client.js +1 -1
  114. package/dist/sdk/client/workflow-client.d.ts +23 -1
  115. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  116. package/dist/sdk/client/workflow-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js.map +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.js +1 -1
  126. package/dist/sdk/engage/template-push.js +1 -1
  127. package/dist/sdk/engage/template-validator.js +1 -1
  128. package/dist/sdk/engage/template-yaml.js +1 -1
  129. package/dist/sdk/engage/types/campaign-def.js +1 -1
  130. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  131. package/dist/sdk/engage/types/template-schema.js +1 -1
  132. package/dist/sdk/engage.js +1 -1
  133. package/dist/sdk/errors.js +1 -1
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/io/index.js +1 -1
  136. package/dist/sdk/io/node-filesystem.js +1 -1
  137. package/dist/sdk/job.js +1 -1
  138. package/dist/sdk/journey.js +1 -1
  139. package/dist/sdk/llm/chat-cache.js +1 -1
  140. package/dist/sdk/llm/index.js +1 -1
  141. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  142. package/dist/sdk/llm/model-factors.js +1 -1
  143. package/dist/sdk/llm/user-settings.js +1 -1
  144. package/dist/sdk/personalization.js +1 -1
  145. package/dist/sdk/policy.js +1 -1
  146. package/dist/sdk/query/deleted-table-validation.js +1 -1
  147. package/dist/sdk/query/index.js +1 -1
  148. package/dist/sdk/query/sql-parser.js +1 -1
  149. package/dist/sdk/realtime.js +1 -1
  150. package/dist/sdk/schedule.js +1 -1
  151. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  152. package/dist/sdk/segment/fields-display.js +1 -1
  153. package/dist/sdk/segment/file-discovery.js +1 -1
  154. package/dist/sdk/segment/journey-utils.js +1 -1
  155. package/dist/sdk/segment/journey-validator.js +1 -1
  156. package/dist/sdk/segment/journey-yaml.js +1 -1
  157. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  158. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  159. package/dist/sdk/segment/pull-workflow.js +1 -1
  160. package/dist/sdk/segment/push-recovery.js +1 -1
  161. package/dist/sdk/segment/push-workflow.js +1 -1
  162. package/dist/sdk/segment/resolution-context.js +1 -1
  163. package/dist/sdk/segment/segment-path-parser.js +1 -1
  164. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  165. package/dist/sdk/segment/segment-validator.js +1 -1
  166. package/dist/sdk/segment/target-resolution.js +1 -1
  167. package/dist/sdk/segment/tdx-config.js +1 -1
  168. package/dist/sdk/segment/types/activation-schema.js +1 -1
  169. package/dist/sdk/segment/types/journey-def.js +1 -1
  170. package/dist/sdk/segment/types/journey-schema.js +1 -1
  171. package/dist/sdk/segment/types/segment-def.js +1 -1
  172. package/dist/sdk/segment/types/segment-schema.js +1 -1
  173. package/dist/sdk/segment/validate-files.js +1 -1
  174. package/dist/sdk/segment/yaml-validator.js +1 -1
  175. package/dist/sdk/segment.js +1 -1
  176. package/dist/sdk/types/index.js +1 -1
  177. package/dist/sdk/types/progress.js +1 -1
  178. package/dist/sdk/types/workflow.d.ts +1 -1
  179. package/dist/sdk/types/workflow.d.ts.map +1 -1
  180. package/dist/sdk/types/workspace.js +1 -1
  181. package/dist/sdk/user.js +1 -1
  182. package/dist/sdk/util/format-detector.js +1 -1
  183. package/dist/sdk/util/formatters.js +1 -1
  184. package/dist/sdk/util/index.js +1 -1
  185. package/dist/sdk/util/paginate.js +1 -1
  186. package/dist/sdk/util/tree-formatter.js +1 -1
  187. package/dist/sdk/workflow/archive-validation.js +1 -1
  188. package/dist/sdk/workflow/clone-workflow.js +1 -1
  189. package/dist/sdk/workflow/index.d.ts +23 -2
  190. package/dist/sdk/workflow/index.d.ts.map +1 -1
  191. package/dist/sdk/workflow/index.js +1 -1
  192. package/dist/sdk/workflow/index.js.map +1 -1
  193. package/dist/sdk/workflow/pull-workflow.js +1 -1
  194. package/dist/sdk/workflow/push-workflow.d.ts +4 -0
  195. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
  196. package/dist/sdk/workflow/push-workflow.js +1 -1
  197. package/dist/sdk/workflow/push-workflow.js.map +1 -1
  198. package/dist/sdk/workflow/task-graph.js +1 -1
  199. package/dist/sdk/workflow/tdx-config.js +1 -1
  200. package/dist/sdk/workflow/workflow-utils.js +1 -1
  201. package/dist/sdk/workspace/access-tracker.js +1 -1
  202. package/dist/sdk/workspace/frontmatter.js +1 -1
  203. package/dist/sdk/workspace/git.js +1 -1
  204. package/dist/sdk/workspace/index.js +1 -1
  205. package/dist/sdk/workspace/templates.js +1 -1
  206. package/dist/sdk/workspace/weekly.js +1 -1
  207. package/dist/sdk/workspace/wikilinks.js +1 -1
  208. package/dist/test-utils/command-runner.js +1 -1
  209. package/dist/test-utils/factories.js +1 -1
  210. package/dist/test-utils/fixtures.js +1 -1
  211. package/dist/test-utils/http-mock.js +1 -1
  212. package/dist/test-utils/index.js +1 -1
  213. package/dist/utils/async.js +1 -1
  214. package/dist/utils/colors.js +1 -1
  215. package/dist/utils/diff.js +1 -1
  216. package/dist/utils/file-permissions.js +1 -1
  217. package/dist/utils/file-reader.js +1 -1
  218. package/dist/utils/github-releases.js +1 -1
  219. package/dist/utils/global-cache.js +1 -1
  220. package/dist/utils/json-loader.js +1 -1
  221. package/dist/utils/local-cache.js +1 -1
  222. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  223. package/dist/utils/logger/formatters/index.js +1 -1
  224. package/dist/utils/logger/handlers/console-handler.js +1 -1
  225. package/dist/utils/logger/handlers/file-handler.js +1 -1
  226. package/dist/utils/logger/handlers/index.js +1 -1
  227. package/dist/utils/logger/handlers/null-handler.js +1 -1
  228. package/dist/utils/logger/index.js +1 -1
  229. package/dist/utils/logger/logger.js +1 -1
  230. package/dist/utils/logger/types.js +1 -1
  231. package/dist/utils/option-validation.js +1 -1
  232. package/dist/utils/process.js +1 -1
  233. package/dist/utils/prompt.js +1 -1
  234. package/dist/utils/spinner.js +1 -1
  235. package/dist/utils/sse-parser.js +1 -1
  236. package/dist/utils/string-utils.js +1 -1
  237. package/dist/utils/table-ref-parser.js +1 -1
  238. package/dist/utils/tdx-logger.js +1 -1
  239. package/dist/utils/version-check.js +1 -1
  240. package/package.json +1 -1
@@ -1 +1 @@
1
- const a29_0xc3c091=a29_0x1283;(function(_0x1a676e,_0x2b7b4a){const _0xc47b28=a29_0x1283,_0x18368c=_0x1a676e();while(!![]){try{const _0x5c912c=parseInt(_0xc47b28(0x21c))/0x1*(parseInt(_0xc47b28(0x237))/0x2)+-parseInt(_0xc47b28(0x287))/0x3+parseInt(_0xc47b28(0x29b))/0x4*(parseInt(_0xc47b28(0x1ee))/0x5)+parseInt(_0xc47b28(0x24f))/0x6+-parseInt(_0xc47b28(0x212))/0x7+parseInt(_0xc47b28(0x1f6))/0x8+-parseInt(_0xc47b28(0x1e3))/0x9;if(_0x5c912c===_0x2b7b4a)break;else _0x18368c['push'](_0x18368c['shift']());}catch(_0x46124c){_0x18368c['push'](_0x18368c['shift']());}}}(a29_0x3202,0x647fc));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import*as a29_0x4bb10c from'node:fs';function handleSDKError(_0x223d54,_0x5083a1){const _0x10653e=a29_0x1283;if(_0x223d54 instanceof SDKError)console[_0x10653e(0x23d)](_0x10653e(0x285)+_0x223d54[_0x10653e(0x1f0)]),_0x5083a1[_0x10653e(0x289)]&&(_0x223d54[_0x10653e(0x25c)]&&console[_0x10653e(0x23d)](_0x10653e(0x1e5)+_0x223d54['cause']),_0x223d54['stack']&&(console[_0x10653e(0x23d)](_0x10653e(0x291)),console['error'](_0x223d54['stack'])));else throw _0x223d54;}function a29_0x1283(_0xed23d8,_0x1cb4f3){_0xed23d8=_0xed23d8-0x1d7;const _0x3202ca=a29_0x3202();let _0x12831d=_0x3202ca[_0xed23d8];return _0x12831d;}function formatChatHistoryEntry(_0x1fd113,_0x271acd){const _0x1a764e=a29_0x1283,_0x1e5e03=getChalk(_0x271acd),_0x3b47bb=_0x1e5e03[_0x1a764e(0x20f)](_0x1fd113['at']);if('input'in _0x1fd113){const _0x250e2f=_0x1e5e03['cyan'](_0x1a764e(0x257));return _0x3b47bb+'\x20'+_0x250e2f+':\x20'+_0x1fd113[_0x1a764e(0x252)];}if(_0x1a764e(0x1f5)in _0x1fd113){const _0x5585ff=_0x1e5e03[_0x1a764e(0x1d9)](_0x1a764e(0x25d));return _0x3b47bb+'\x20'+_0x5585ff+':\x20'+_0x1fd113['content'];}if(_0x1a764e(0x21d)in _0x1fd113){const _0x138835=_0x1e5e03[_0x1a764e(0x201)](_0x1a764e(0x26e)),{functionName:_0x1afb04,functionArguments:_0x4ba8e2,targetFunction:_0x34dd29}=_0x1fd113[_0x1a764e(0x21d)];let _0x1df78c=_0x3b47bb+'\x20'+_0x138835+':\x20'+_0x1e5e03['bold'](_0x1afb04);if(_0x4ba8e2&&Object[_0x1a764e(0x274)](_0x4ba8e2)[_0x1a764e(0x203)]>0x0){const _0x1fb0aa=Object[_0x1a764e(0x280)](_0x4ba8e2)[_0x1a764e(0x2af)](([_0x1d1497,_0x4d9e91])=>_0x1d1497+'='+JSON[_0x1a764e(0x29a)](_0x4d9e91))[_0x1a764e(0x2a9)](',\x20');_0x1df78c+='('+_0x1fb0aa+')';}_0x34dd29&&(_0x1df78c+=_0x1e5e03[_0x1a764e(0x20f)]('\x20['+_0x34dd29+']'));let _0x1031df='';if(_0x1fd113[_0x1a764e(0x21d)]['targetKnowledgeBase'])_0x1031df=_0x1a764e(0x273)+_0x1fd113[_0x1a764e(0x21d)][_0x1a764e(0x2b5)]['name'];else{if(_0x1fd113['tool_call'][_0x1a764e(0x298)])_0x1031df=_0x1a764e(0x209)+_0x1fd113[_0x1a764e(0x21d)][_0x1a764e(0x298)][_0x1a764e(0x202)];else{if(_0x1fd113['tool_call'][_0x1a764e(0x220)])_0x1031df=_0x1a764e(0x2b0)+_0x1fd113['tool_call'][_0x1a764e(0x220)]['name'];else _0x1fd113[_0x1a764e(0x21d)][_0x1a764e(0x218)]&&(_0x1031df=_0x1a764e(0x238)+_0x1fd113['tool_call'][_0x1a764e(0x218)][_0x1a764e(0x202)]);}}return _0x1df78c+_0x1031df;}if('tool'in _0x1fd113){const _0x1ec968=_0x1e5e03[_0x1a764e(0x1ff)]('[tool]\x20\x20\x20'),{functionName:_0x114524,functionArguments:_0x5a9a62,content:_0x3b06c0,newChat:_0x3d272c}=_0x1fd113[_0x1a764e(0x2a7)];let _0x23ebda=_0x3b47bb+'\x20'+_0x1ec968+':\x20'+_0x1e5e03[_0x1a764e(0x2a3)](_0x114524);if(_0x5a9a62){const _0x2f519f=typeof _0x5a9a62===_0x1a764e(0x235)?_0x5a9a62:JSON['stringify'](_0x5a9a62);_0x23ebda+='('+_0x2f519f+')';}return _0x3b06c0&&(_0x23ebda+='\x0a'+_0x1e5e03['dim'](_0x3b06c0)),_0x3d272c&&(_0x23ebda+=_0x1e5e03[_0x1a764e(0x20f)]('\x20→\x20chat:\x20'+_0x3d272c['id'])),_0x23ebda;}if('output'in _0x1fd113){const _0x4e0df5=_0x1e5e03[_0x1a764e(0x243)](_0x1a764e(0x286));return _0x3b47bb+'\x20'+_0x4e0df5+':\x20'+_0x1fd113[_0x1a764e(0x296)][_0x1a764e(0x202)]+'\x20('+_0x1fd113[_0x1a764e(0x296)]['content'][_0x1a764e(0x203)]+_0x1a764e(0x27f);}if(_0x1a764e(0x217)in _0x1fd113){const _0x14866d=_0x1e5e03['blue'](_0x1a764e(0x1e9)),{width:_0x5c17fd,height:_0x2f6d78,headerText:_0x4e936f}=_0x1fd113[_0x1a764e(0x217)],_0xe4d3a=_0x4e936f?'\x20-\x20'+_0x4e936f:'';return _0x3b47bb+'\x20'+_0x14866d+':\x20'+_0x5c17fd+'x'+_0x2f6d78+_0xe4d3a;}if(_0x1a764e(0x23d)in _0x1fd113){const _0xe2928a=_0x1e5e03[_0x1a764e(0x277)]('[error]\x20\x20');return _0x3b47bb+'\x20'+_0xe2928a+':\x20'+_0x1fd113[_0x1a764e(0x23d)];}return _0x3b47bb+'\x20'+_0x1e5e03['dim'](_0x1a764e(0x253))+':\x20'+JSON[_0x1a764e(0x29a)](_0x1fd113);}async function executeChatHistoryCommand(_0x24d00f,_0x3c257a){const _0x36af74=a29_0x1283,{options:_0x15cd82,args:_0x2b68e2,tdx:_0x42ac24}=_0x24d00f,_0xa326fa=_0x2b68e2[0x0],_0x3e7eab=_0x15cd82,_0x1ae2a6=_0x3e7eab[_0x36af74(0x234)];try{if(_0x1ae2a6&&_0xa326fa)return console[_0x36af74(0x23d)](_0x36af74(0x230)),console[_0x36af74(0x23d)]('Usage:\x20'+_0x3c257a+_0x36af74(0x295)),0x1;if(!_0xa326fa&&!_0x1ae2a6&&_0x15cd82[_0x36af74(0x275)]!==undefined){const _0xafbb47=resolveLimit(_0x15cd82[_0x36af74(0x20b)],DEFAULT_LLM_LIMIT),_0x2c4f4a=await withSpinner(_0x36af74(0x2a4),()=>_0x42ac24[_0x36af74(0x1fd)][_0x36af74(0x246)](_0xafbb47),{'verbose':_0x15cd82['verbose']});return await handleSDKOutput(_0x2c4f4a[_0x36af74(0x2b1)],_0x15cd82),0x0;}const _0x56a49d=await getChatIdOrSelect(_0x42ac24,_0x15cd82,_0x1ae2a6,_0xa326fa);if(!_0x56a49d)return 0x0;return await displayChatHistory(_0x56a49d,_0x42ac24,_0x15cd82),0x0;}catch(_0x1229c2){return handleSDKError(_0x1229c2,_0x15cd82),0x1;}}async function displayChatHistory(_0x400dbe,_0x5b4e9e,_0x158501){const _0x25649b=a29_0x1283,_0x1e691c=await withSpinner(_0x25649b(0x25a)+_0x400dbe+'\x27...',()=>_0x5b4e9e['llm'][_0x25649b(0x213)](_0x400dbe),{'verbose':_0x158501[_0x25649b(0x289)]}),_0x460e88=_0x1e691c[_0x25649b(0x2b1)]['data']??[];if(_0x460e88[_0x25649b(0x203)]===0x0){console[_0x25649b(0x248)]('No\x20messages\x20found\x20in\x20chat\x20history.');return;}if(_0x158501['format']!==undefined)await handleSDKOutput(_0x460e88,_0x158501);else{const _0xc76a2=_0x460e88[_0x25649b(0x2af)](_0x14ca57=>formatChatHistoryEntry(_0x14ca57,_0x158501)),_0x3aec92=_0xc76a2[_0x25649b(0x2a9)]('\x0a');await writeOutput(_0x3aec92,_0x158501[_0x25649b(0x296)],'table');}}async function getChatIdOrSelect(_0x4e293f,_0x16a99b,_0x26cf71,_0x550167){const _0x394596=a29_0x1283;if(_0x550167)return _0x550167;if(_0x26cf71){const _0xd51f88=await withSpinner(_0x394596(0x28a),()=>_0x4e293f[_0x394596(0x1fd)][_0x394596(0x246)](0x1),{'verbose':_0x16a99b[_0x394596(0x289)]});if(_0xd51f88[_0x394596(0x2b1)][_0x394596(0x203)]===0x0)return console['log']('No\x20chat\x20sessions\x20found.'),undefined;return _0xd51f88[_0x394596(0x2b1)][0x0]['id'];}const _0x42136e=await selectChatInteractively(_0x4e293f,_0x16a99b);if(!_0x42136e)return console['log'](_0x394596(0x1e2)),undefined;return _0x42136e;}async function getProjectIdOrDefault(_0x442895){const _0x5d8ccd=await getProjectWithName(_0x442895);return _0x5d8ccd['id'];}async function getProjectWithName(_0x56e814){const _0x20880b=a29_0x1283,{tdx:_0x1bc639,options:_0x567dcd}=_0x56e814,_0x61a4dc=_0x567dcd[_0x20880b(0x224)];if(_0x61a4dc){const _0x4e1fc1=await withSpinner(_0x20880b(0x262)+_0x61a4dc+_0x20880b(0x25e),()=>_0x1bc639['llm']['resolveProjectId'](_0x61a4dc),{'verbose':_0x567dcd[_0x20880b(0x289)]});return{'id':_0x4e1fc1['data'],'name':_0x61a4dc};}const _0x8582bf=_0x1bc639['llm']['getCurrentProject']();if(_0x8582bf){const _0xc38bbc=await _0x1bc639[_0x20880b(0x1fd)][_0x20880b(0x2b2)](),_0x482ec6=_0xc38bbc[_0x20880b(0x1e7)](_0x1ad9a5=>_0x1ad9a5['id']===_0x8582bf);return{'id':_0x8582bf,'name':_0x482ec6?.[_0x20880b(0x22c)][_0x20880b(0x202)]||_0x20880b(0x28d)};}const _0x637495=await withSpinner('Getting\x20default\x20project...',()=>_0x1bc639['llm'][_0x20880b(0x24c)](),{'verbose':_0x567dcd[_0x20880b(0x289)]});return{'id':_0x637495[_0x20880b(0x2b1)]['id'],'name':_0x637495['data'][_0x20880b(0x22c)]['name']};}function toLLMProjectInfo(_0x297d4f){const _0x2aa9ca=a29_0x1283;return{'name':_0x297d4f['attributes']['name'],'description':_0x297d4f[_0x2aa9ca(0x22c)][_0x2aa9ca(0x29d)],'createdAt':_0x297d4f[_0x2aa9ca(0x22c)]['createdAt'],'updatedAt':_0x297d4f[_0x2aa9ca(0x22c)]['updatedAt']};}function toAgentInfo(_0x19f8ad){const _0x13b6c=a29_0x1283;return{'name':_0x19f8ad['attributes'][_0x13b6c(0x202)],'description':_0x19f8ad[_0x13b6c(0x22c)][_0x13b6c(0x29d)],'prompt':truncatePrompt(_0x19f8ad['attributes']['prompt']),'createdAt':_0x19f8ad[_0x13b6c(0x22c)][_0x13b6c(0x2a8)],'updatedAt':_0x19f8ad[_0x13b6c(0x22c)]['updatedAt']};}function truncatePrompt(_0x18099e){const _0x24c810=a29_0x1283;if(!_0x18099e)return undefined;const _0x2492f1=0x64;if(_0x18099e[_0x24c810(0x203)]<=_0x2492f1)return _0x18099e;return _0x18099e['slice'](0x0,_0x2492f1)+_0x24c810(0x236);}export class LLMModelsCommand extends BaseCommand{['name']=a29_0xc3c091(0x245);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x29e);async[a29_0xc3c091(0x261)](_0x596910){const _0x54330c=a29_0xc3c091,{options:_0x3a189f,tdx:_0x527cf7}=_0x596910;try{const _0xe79007=await withSpinner(_0x54330c(0x229),()=>_0x527cf7[_0x54330c(0x1fd)]['models'](),{'verbose':_0x3a189f[_0x54330c(0x289)]});return await handleSDKOutput(_0xe79007[_0x54330c(0x2b1)],_0x3a189f),0x0;}catch(_0xa095a4){return handleSDKError(_0xa095a4,_0x3a189f),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a29_0xc3c091(0x250);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x283);async[a29_0xc3c091(0x261)](_0x474bc1){const _0xa626be=a29_0xc3c091,{options:_0x443eea,args:_0x11c724,tdx:_0x1907b2}=_0x474bc1,_0x539c9c=getChalk(_0x443eea),_0x51189d=_0x443eea[_0xa626be(0x22b)];try{const _0x286f2c=_0x11c724[0x0],_0x3f858a=resolveLimit(_0x443eea[_0xa626be(0x20b)],DEFAULT_LLM_LIMIT),_0x859fc8=await withSpinner(_0xa626be(0x23f),()=>_0x1907b2['llm']['projects'](_0x3f858a),{'verbose':_0x443eea[_0xa626be(0x289)]});let _0x48a7f3=_0x859fc8[_0xa626be(0x2b1)];_0x286f2c&&(_0x48a7f3=_0x859fc8[_0xa626be(0x2b1)][_0xa626be(0x2b4)](_0x5b153e=>matchGlobPattern(_0x5b153e['attributes'][_0xa626be(0x202)],_0x286f2c)));const _0x4c5d42=_0x443eea[_0xa626be(0x275)]===_0xa626be(0x21e)||_0x443eea[_0xa626be(0x275)]===_0xa626be(0x26b)||_0x443eea[_0xa626be(0x275)]===_0xa626be(0x22d)||_0x443eea[_0xa626be(0x275)]===_0xa626be(0x1ea);if(_0x4c5d42){const _0x5037f6=_0x48a7f3[_0xa626be(0x2af)](_0x5bded1=>({...toLLMProjectInfo(_0x5bded1),'url':getLLMProjectUrl(_0x51189d,_0x5bded1['id'])}));await handleSDKOutput(_0x5037f6,_0x443eea);}else{const _0x407f1c=[];if(_0x48a7f3[_0xa626be(0x203)]===0x0)_0x407f1c[_0xa626be(0x28f)](_0x539c9c[_0xa626be(0x20f)](_0xa626be(0x2a6)));else{const _0x2a09c1=[..._0x48a7f3]['sort']((_0x1cf2b3,_0x27bb23)=>_0x1cf2b3[_0xa626be(0x22c)]['name'][_0xa626be(0x266)](_0x27bb23[_0xa626be(0x22c)]['name']));for(const _0x431f54 of _0x2a09c1){const _0x5428a2=getLLMProjectUrl(_0x51189d,_0x431f54['id']),_0x5d4141=hyperlink(_0x431f54['attributes'][_0xa626be(0x202)],_0x5428a2);_0x407f1c['push']('⚒️\x20'+_0x5d4141);}_0x407f1c[_0xa626be(0x28f)](_0x539c9c[_0xa626be(0x20f)](_0x48a7f3[_0xa626be(0x203)]+_0xa626be(0x2b3)));}await writeOutput(_0x407f1c[_0xa626be(0x2a9)]('\x0a'),_0x443eea['output'],_0xa626be(0x22d));}return 0x0;}catch(_0x2364d0){return handleSDKError(_0x2364d0,_0x443eea),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x20e);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x205);async[a29_0xc3c091(0x261)](_0x3da115){const _0x2e2803=a29_0xc3c091,{options:_0x3b9702,args:_0x26589a,tdx:_0x53f6a8}=_0x3da115,_0x1f7608=getChalk(_0x3b9702),_0x11a360=_0x3b9702[_0x2e2803(0x22b)];try{const _0x2be236=_0x26589a[0x0];let _0x1e7edb=_0x2be236,_0x49532b,_0x1ff3a4;if(_0x2be236&&_0x2be236['includes']('/')){const _0x2189d5=_0x2be236['split']('/');if(_0x2189d5['length']===0x2){const [_0x3d9fa0,_0x31fe21]=_0x2189d5,_0x87de14=await _0x53f6a8[_0x2e2803(0x1fd)][_0x2e2803(0x2b2)](),_0x5c042b=_0x87de14[_0x2e2803(0x1e7)](_0xad7b0d=>_0xad7b0d[_0x2e2803(0x22c)][_0x2e2803(0x202)][_0x2e2803(0x1fa)]()===_0x3d9fa0[_0x2e2803(0x1fa)]());if(!_0x5c042b)throw new SDKError(ErrorCode[_0x2e2803(0x1fe)],_0x2e2803(0x28b)+_0x3d9fa0,undefined,{'helpText':_0x2e2803(0x215)});_0x49532b=_0x5c042b['id'],_0x1ff3a4=_0x5c042b[_0x2e2803(0x22c)]['name'],_0x1e7edb=_0x31fe21;}else throw new SDKError(ErrorCode[_0x2e2803(0x210)],_0x2e2803(0x223)+_0x2be236,undefined,{'helpText':_0x2e2803(0x24d)});}else{const _0x80abf3=await getProjectWithName(_0x3da115);_0x49532b=_0x80abf3['id'],_0x1ff3a4=_0x80abf3[_0x2e2803(0x202)];}const _0xffc269=await withSpinner(_0x2e2803(0x2ab),()=>_0x53f6a8[_0x2e2803(0x1fd)][_0x2e2803(0x259)](_0x49532b),{'verbose':_0x3b9702[_0x2e2803(0x289)]});let _0x57a6f4=_0xffc269[_0x2e2803(0x2b1)];_0x1e7edb&&(_0x57a6f4=_0xffc269['data'][_0x2e2803(0x2b4)](_0x217a2d=>matchGlobPattern(_0x217a2d[_0x2e2803(0x22c)][_0x2e2803(0x202)],_0x1e7edb)));const _0x4e33d1=_0x3b9702[_0x2e2803(0x275)]===_0x2e2803(0x21e)||_0x3b9702['format']===_0x2e2803(0x26b)||_0x3b9702[_0x2e2803(0x275)]===_0x2e2803(0x22d)||_0x3b9702['format']==='tsv';if(_0x4e33d1){const _0x2cb068=_0x57a6f4[_0x2e2803(0x2af)](_0x26fbd2=>({...toAgentInfo(_0x26fbd2),'chatUrl':getLLMAgentChatUrl(_0x11a360,_0x49532b,_0x26fbd2['id'])}));await handleSDKOutput(_0x2cb068,_0x3b9702);}else{const _0x22a289=[];_0x22a289[_0x2e2803(0x28f)](_0x1f7608[_0x2e2803(0x20f)]('['+_0x1ff3a4+']'));if(_0x57a6f4[_0x2e2803(0x203)]===0x0)_0x22a289[_0x2e2803(0x28f)](_0x1f7608[_0x2e2803(0x20f)](_0x2e2803(0x1d8)));else{const _0x165f38=[..._0x57a6f4][_0x2e2803(0x279)]((_0x2a742c,_0x3fbe94)=>_0x2a742c[_0x2e2803(0x22c)][_0x2e2803(0x202)][_0x2e2803(0x266)](_0x3fbe94[_0x2e2803(0x22c)][_0x2e2803(0x202)]));for(const _0x5e2637 of _0x165f38){const _0x57af98=getLLMAgentChatUrl(_0x11a360,_0x49532b,_0x5e2637['id']),_0x5b971b=hyperlink(_0x5e2637[_0x2e2803(0x22c)]['name'],_0x57af98);_0x22a289[_0x2e2803(0x28f)](_0x2e2803(0x1e0)+_0x5b971b);}_0x22a289[_0x2e2803(0x28f)](_0x1f7608['dim'](_0x57a6f4[_0x2e2803(0x203)]+'\x20agent(s)'));}await writeOutput(_0x22a289[_0x2e2803(0x2a9)]('\x0a'),_0x3b9702[_0x2e2803(0x296)],_0x2e2803(0x22d));}return 0x0;}catch(_0x115ac6){return handleSDKError(_0x115ac6,_0x3b9702),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x28c);['description']=a29_0xc3c091(0x225);async[a29_0xc3c091(0x261)](_0x5b2fde){const _0x11d797=a29_0xc3c091,{options:_0x5fb961,args:_0xe82442,tdx:_0x5a4e92}=_0x5b2fde;if(_0xe82442[_0x11d797(0x203)]===0x0)return console[_0x11d797(0x23d)](_0x11d797(0x24b)),console['error'](_0x11d797(0x293)),0x1;const _0x575cbb=_0xe82442[0x0];try{const _0x446501=await getProjectIdOrDefault(_0x5b2fde),_0x3bd507=await withSpinner(_0x11d797(0x2b7)+_0x575cbb+'\x27...',()=>_0x5a4e92['llm'][_0x11d797(0x276)](_0x575cbb,_0x446501),{'verbose':_0x5fb961[_0x11d797(0x289)]}),_0xae4f6a=await withSpinner(_0x11d797(0x258),()=>_0x5a4e92[_0x11d797(0x1fd)][_0x11d797(0x20d)](_0x3bd507[_0x11d797(0x2b1)]),{'verbose':_0x5fb961[_0x11d797(0x289)]});return await handleSDKOutput([_0xae4f6a[_0x11d797(0x2b1)]],_0x5fb961),0x0;}catch(_0x2ff147){return handleSDKError(_0x2ff147,_0x5fb961),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a29_0xc3c091(0x202)]='llm:agent:create';[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x1e6);async[a29_0xc3c091(0x261)](_0x51ffae){const _0x4fe83a=a29_0xc3c091,{options:_0x25ae75,args:_0x26fadc,tdx:_0x5bf0d5}=_0x51ffae;if(_0x26fadc[_0x4fe83a(0x203)]===0x0)return console['error'](_0x4fe83a(0x24b)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console[_0x4fe83a(0x23d)](_0x4fe83a(0x1ed)),0x1;const _0x2faec8=_0x26fadc[0x0],_0x42290e=_0x25ae75,_0x24f194=_0x42290e[_0x4fe83a(0x2ae)],_0x4e2ea6=_0x42290e['model']||_0x4fe83a(0x1f9),_0xb87e48=_0x42290e['starterMessage'],_0x26ca66=_0x42290e['maxToolIterations']?Number(_0x42290e[_0x4fe83a(0x21a)]):undefined,_0x2b9da6=_0x42290e[_0x4fe83a(0x1ec)]?Number(_0x42290e[_0x4fe83a(0x1ec)]):undefined;try{let _0x5c16f2,_0x51cada;if(_0x2faec8[_0x4fe83a(0x1eb)]('/')){const _0x4d8b44=_0x2faec8[_0x4fe83a(0x247)]('/');if(_0x4d8b44[_0x4fe83a(0x203)]===0x2){const [_0x23721d,_0x411bb3]=_0x4d8b44,_0x4e0959=await withSpinner('Resolving\x20project\x20\x27'+_0x23721d+_0x4fe83a(0x25e),()=>_0x5bf0d5[_0x4fe83a(0x1fd)]['resolveProjectId'](_0x23721d),{'verbose':_0x25ae75[_0x4fe83a(0x289)]});_0x5c16f2=_0x4e0959[_0x4fe83a(0x2b1)],_0x51cada=_0x411bb3;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4fe83a(0x223)+_0x2faec8,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x5c16f2=await getProjectIdOrDefault(_0x51ffae),_0x51cada=_0x2faec8;const _0x362038=await withSpinner(_0x4fe83a(0x1dd)+_0x51cada+'\x27...',()=>_0x5bf0d5[_0x4fe83a(0x1fd)]['createAgent']({'name':_0x51cada,'projectId':_0x5c16f2,'modelType':_0x4e2ea6,'systemPrompt':_0x24f194,'starterMessage':_0xb87e48,'maxToolIterations':_0x26ca66,'temperature':_0x2b9da6}),{'verbose':_0x25ae75[_0x4fe83a(0x289)]});return console['log']('Agent\x20created:\x20'+_0x362038[_0x4fe83a(0x2b1)]['id']),await handleSDKOutput([_0x362038[_0x4fe83a(0x2b1)]],_0x25ae75),0x0;}catch(_0xc3d607){return handleSDKError(_0xc3d607,_0x25ae75),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a29_0xc3c091(0x202)]='llm:agent:update';[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x25f);async['execute'](_0x5872a1){const _0x46ec65=a29_0xc3c091,{options:_0x40108a,args:_0x1ce9ec,tdx:_0x2f3584}=_0x5872a1;if(_0x1ce9ec[_0x46ec65(0x203)]===0x0)return console[_0x46ec65(0x23d)](_0x46ec65(0x24b)),console[_0x46ec65(0x23d)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x33ba75=_0x1ce9ec[0x0],_0x31d971=_0x40108a,_0x552bea=_0x31d971[_0x46ec65(0x202)],_0x4382e6=_0x31d971[_0x46ec65(0x25b)],_0x438655=_0x31d971[_0x46ec65(0x29d)],_0x4b6bda=_0x31d971[_0x46ec65(0x1f8)];if(!_0x552bea&&!_0x4382e6&&!_0x438655&&!_0x4b6bda)return console['error'](_0x46ec65(0x214)),console[_0x46ec65(0x23d)](_0x46ec65(0x23e)),0x1;try{const _0x4782ad=await getProjectIdOrDefault(_0x5872a1),_0x5bf30a=await withSpinner(_0x46ec65(0x2b7)+_0x33ba75+_0x46ec65(0x25e),()=>_0x2f3584[_0x46ec65(0x1fd)][_0x46ec65(0x276)](_0x33ba75,_0x4782ad),{'verbose':_0x40108a[_0x46ec65(0x289)]}),_0x31d138=_0x5bf30a[_0x46ec65(0x2b1)],_0x12a5b6=await withSpinner(_0x46ec65(0x294),()=>_0x2f3584['llm'][_0x46ec65(0x27b)](_0x31d138,{'name':_0x552bea,'prompt':_0x4382e6,'description':_0x438655,'starterMessage':_0x4b6bda}),{'verbose':_0x40108a['verbose']});return console[_0x46ec65(0x248)]('Agent\x20updated:\x20'+_0x12a5b6['data']['id']),await handleSDKOutput([_0x12a5b6[_0x46ec65(0x2b1)]],_0x40108a),0x0;}catch(_0x4a82a5){return handleSDKError(_0x4a82a5,_0x40108a),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x255);[a29_0xc3c091(0x29d)]='Delete\x20an\x20agent';async['execute'](_0x2c1b47){const _0x5c2e05=a29_0xc3c091,{options:_0xa80268,args:_0xa7d96c,tdx:_0x1e82ff}=_0x2c1b47;if(_0xa7d96c['length']===0x0)return console['error'](_0x5c2e05(0x24b)),console[_0x5c2e05(0x23d)](_0x5c2e05(0x1f3)),0x1;const _0x42a01=_0xa7d96c[0x0];try{const _0x5a211c=await getProjectIdOrDefault(_0x2c1b47),_0x22a5c4=await withSpinner(_0x5c2e05(0x2b7)+_0x42a01+'\x27...',()=>_0x1e82ff[_0x5c2e05(0x1fd)][_0x5c2e05(0x276)](_0x42a01,_0x5a211c),{'verbose':_0xa80268[_0x5c2e05(0x289)]}),_0x5e469c=_0x22a5c4['data'];return await withSpinner('Deleting\x20agent...',()=>_0x1e82ff[_0x5c2e05(0x1fd)][_0x5c2e05(0x200)](_0x5e469c),{'verbose':_0xa80268[_0x5c2e05(0x289)]}),console[_0x5c2e05(0x248)](_0x5c2e05(0x282)+_0x5e469c),0x0;}catch(_0x11798d){return handleSDKError(_0x11798d,_0xa80268),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x2a1);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x254);async[a29_0xc3c091(0x261)](_0x2cfaf4){const _0x1841d0=a29_0xc3c091;return executeChatHistoryCommand(_0x2cfaf4,_0x1841d0(0x1df));}}export class LLMUseCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x24e);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x288);async[a29_0xc3c091(0x261)](_0x509084){const _0x5f31bb=a29_0xc3c091,{options:_0x4b2940,args:_0x46445e,tdx:_0x441c7b}=_0x509084;if(_0x46445e[_0x5f31bb(0x203)]===0x0)return console[_0x5f31bb(0x23d)](_0x5f31bb(0x226)),console[_0x5f31bb(0x23d)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x4a744e=_0x46445e[0x0];try{await withSpinner(_0x5f31bb(0x27a)+_0x4a744e+_0x5f31bb(0x25e),()=>_0x441c7b['llm'][_0x5f31bb(0x239)](_0x4a744e),{'verbose':_0x4b2940[_0x5f31bb(0x289)]}),saveSessionContext({'llm_project':_0x4a744e},_0x4b2940['session']);const _0x24c873=getChalk(_0x4b2940);return console['log'](_0x5f31bb(0x267)+_0x24c873[_0x5f31bb(0x1d9)](_0x4a744e)),0x0;}catch(_0x39117e){return handleSDKError(_0x39117e,_0x4b2940),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a29_0xc3c091(0x232);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x1f2);async['execute'](_0x216635){const _0x25ff78=a29_0xc3c091,{options:_0x9433c5,args:_0x15a8cf,tdx:_0x10e055}=_0x216635;if(_0x15a8cf[_0x25ff78(0x203)]===0x0)return console[_0x25ff78(0x23d)](_0x25ff78(0x226)),console[_0x25ff78(0x23d)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x36fd54=_0x15a8cf[0x0],_0x176690=_0x9433c5,_0xf5fc4a=_0x176690[_0x25ff78(0x29d)];try{const _0x38e8c2=await withSpinner(_0x25ff78(0x263)+_0x36fd54+_0x25ff78(0x25e),()=>_0x10e055['llm'][_0x25ff78(0x1f4)]({'name':_0x36fd54,'description':_0xf5fc4a}),{'verbose':_0x9433c5[_0x25ff78(0x289)]});console[_0x25ff78(0x248)]('Project\x20created:\x20'+_0x38e8c2[_0x25ff78(0x2b1)]['id']);const _0x3479f7=toLLMProjectInfo(_0x38e8c2[_0x25ff78(0x2b1)]);return await handleSDKOutput([_0x3479f7],_0x9433c5),0x0;}catch(_0x4188a2){return handleSDKError(_0x4188a2,_0x9433c5),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x297);[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x264);async[a29_0xc3c091(0x261)](_0x33fed9){const _0x386656=a29_0xc3c091,{options:_0x5ada2a,args:_0x466f29,tdx:_0x2bcb36}=_0x33fed9;if(_0x466f29[_0x386656(0x203)]===0x0)return console[_0x386656(0x23d)](_0x386656(0x226)),console[_0x386656(0x23d)](_0x386656(0x1d7)),0x1;const _0x39a4ab=_0x466f29[0x0];try{return await withSpinner(_0x386656(0x28e)+_0x39a4ab+'\x27...',()=>_0x2bcb36['llm'][_0x386656(0x2aa)](_0x39a4ab),{'verbose':_0x5ada2a['verbose']}),console[_0x386656(0x248)](_0x386656(0x2a0)+_0x39a4ab),0x0;}catch(_0x54a771){return handleSDKError(_0x54a771,_0x5ada2a),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x1e8);['description']='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)';async[a29_0xc3c091(0x261)](_0x56675c){const _0x1f069e=a29_0xc3c091,{options:_0x14ae9b,args:_0xe9bfe3,tdx:_0x2030de}=_0x56675c,_0x2d1204=getChalk(_0x14ae9b);console[_0x1f069e(0x248)](_0x2d1204[_0x1f069e(0x201)](_0x1f069e(0x204))),console['log'](_0x2d1204[_0x1f069e(0x201)](_0x1f069e(0x292))),console['log'](_0x2d1204['dim'](_0x1f069e(0x2a2))),console['log']();if(_0xe9bfe3[_0x1f069e(0x203)]===0x0)return console[_0x1f069e(0x23d)](_0x1f069e(0x226)),console['error'](_0x1f069e(0x26c)),0x1;const _0x1ed63a=_0xe9bfe3[0x0],_0x59bb30=_0x14ae9b,_0x87868d=_0x59bb30[_0x1f069e(0x296)],_0x35cbc5=_0x59bb30[_0x1f069e(0x2ac)];try{const _0x3c056a=_0x87868d||_0x1ed63a+_0x1f069e(0x278);if(a29_0x4bb10c[_0x1f069e(0x26a)](_0x3c056a)&&!_0x35cbc5){if(!_0x14ae9b['yes']){const _0x18490a=await confirm(_0x1f069e(0x251)+_0x3c056a+_0x1f069e(0x29c));if(!_0x18490a)return console[_0x1f069e(0x248)](_0x1f069e(0x26f)),0x0;}a29_0x4bb10c[_0x1f069e(0x268)](_0x3c056a,{'recursive':!![]});}const _0x1708c1=await withSpinner(_0x35cbc5?'Analyzing\x20project\x20\x27'+_0x1ed63a+_0x1f069e(0x25e):_0x1f069e(0x1de)+_0x1ed63a+_0x1f069e(0x25e),()=>_0x2030de[_0x1f069e(0x1fd)][_0x1f069e(0x270)](_0x1ed63a,_0x87868d,{'dryRun':_0x35cbc5}),{'verbose':_0x14ae9b[_0x1f069e(0x289)]}),_0x312090=_0x1708c1[_0x1f069e(0x2b1)];return _0x35cbc5?console[_0x1f069e(0x248)](_0x1f069e(0x23c)+_0x312090[_0x1f069e(0x265)]):console[_0x1f069e(0x248)]('Project\x20backed\x20up\x20to:\x20'+_0x312090[_0x1f069e(0x265)]),console[_0x1f069e(0x248)](_0x1f069e(0x211)+_0x312090[_0x1f069e(0x256)][_0x1f069e(0x259)]),console[_0x1f069e(0x248)](_0x1f069e(0x207)+_0x312090['counts'][_0x1f069e(0x208)]),console[_0x1f069e(0x248)](_0x1f069e(0x284)+_0x312090[_0x1f069e(0x256)][_0x1f069e(0x221)]),console[_0x1f069e(0x248)](_0x1f069e(0x227)+_0x312090['counts'][_0x1f069e(0x21f)]),(_0x14ae9b[_0x1f069e(0x275)]===_0x1f069e(0x21e)||_0x14ae9b['format']==='jsonl')&&await handleSDKOutput([_0x312090],_0x14ae9b),0x0;}catch(_0x58edb8){return handleSDKError(_0x58edb8,_0x14ae9b),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x26d);[a29_0xc3c091(0x29d)]='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)';async[a29_0xc3c091(0x261)](_0x4eb16a){const _0x5120d6=a29_0xc3c091,{options:_0x2ccae6,args:_0x282f3a,tdx:_0x5222ac}=_0x4eb16a,_0x36f3d7=getChalk(_0x2ccae6);console[_0x5120d6(0x248)](_0x36f3d7[_0x5120d6(0x201)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.')),console[_0x5120d6(0x248)](_0x36f3d7['yellow'](_0x5120d6(0x228))),console[_0x5120d6(0x248)](_0x36f3d7[_0x5120d6(0x20f)](_0x5120d6(0x27d))),console[_0x5120d6(0x248)](_0x36f3d7[_0x5120d6(0x20f)](_0x5120d6(0x1fb))),console[_0x5120d6(0x248)](_0x36f3d7[_0x5120d6(0x20f)](_0x5120d6(0x260))),console[_0x5120d6(0x248)]();if(_0x282f3a[_0x5120d6(0x203)]===0x0)return console[_0x5120d6(0x23d)](_0x5120d6(0x1fc)),console['error'](_0x5120d6(0x219)),0x1;const _0x5ebcb2=_0x282f3a[0x0],_0x27b0a7=_0x2ccae6,_0x56d789=_0x27b0a7['name'],_0x4b1644=_0x27b0a7['dryRun'];try{if(!_0x4b1644){const _0x4ffa47=_0x5222ac[_0x5120d6(0x1fd)]['getBackupMetadata'](_0x5ebcb2),_0x1601fc=_0x56d789||_0x4ffa47['exportedFrom'][_0x5120d6(0x24a)],_0x3418ef=await withSpinner(_0x5120d6(0x2a5),()=>_0x5222ac['llm'][_0x5120d6(0x2b2)](),{'verbose':_0x2ccae6[_0x5120d6(0x289)]}),_0x2e6fd6=_0x3418ef[_0x5120d6(0x2b1)][_0x5120d6(0x1e7)](_0xa8f5c4=>_0xa8f5c4[_0x5120d6(0x22c)][_0x5120d6(0x202)]===_0x1601fc);if(_0x2e6fd6&&!_0x2ccae6[_0x5120d6(0x249)]){const _0x103cb1=await confirm(_0x5120d6(0x233)+_0x1601fc+_0x5120d6(0x1db));if(!_0x103cb1)return console['log'](_0x5120d6(0x240)),0x0;}}const _0xf3682c=await withSpinner(_0x4b1644?_0x5120d6(0x1e4)+_0x5ebcb2+_0x5120d6(0x25e):_0x5120d6(0x20c)+_0x5ebcb2+_0x5120d6(0x25e),()=>_0x5222ac[_0x5120d6(0x1fd)][_0x5120d6(0x272)](_0x5ebcb2,{'name':_0x56d789,'dryRun':_0x4b1644}),{'verbose':_0x2ccae6[_0x5120d6(0x289)]}),_0x351762=_0xf3682c['data'];return _0x351762[_0x5120d6(0x231)]&&console[_0x5120d6(0x248)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x351762[_0x5120d6(0x231)]+'\x27'),_0x4b1644?console['log']('[DRY\x20RUN]\x20Would\x20restore\x20project:\x20'+_0x351762['projectName']):console['log'](_0x5120d6(0x242)+_0x351762[_0x5120d6(0x24a)]+'\x20('+_0x351762[_0x5120d6(0x244)]+')'),console[_0x5120d6(0x248)]('\x20\x20Agents:\x20'+_0x351762[_0x5120d6(0x256)][_0x5120d6(0x259)]),console['log'](_0x5120d6(0x207)+_0x351762['counts'][_0x5120d6(0x208)]),console[_0x5120d6(0x248)](_0x5120d6(0x284)+_0x351762[_0x5120d6(0x256)][_0x5120d6(0x221)]),console[_0x5120d6(0x248)](_0x5120d6(0x227)+_0x351762[_0x5120d6(0x256)][_0x5120d6(0x21f)]),(_0x2ccae6[_0x5120d6(0x275)]==='json'||_0x2ccae6[_0x5120d6(0x275)]===_0x5120d6(0x26b))&&await handleSDKOutput([_0x351762],_0x2ccae6),0x0;}catch(_0x1d61db){return handleSDKError(_0x1d61db,_0x2ccae6),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x40c063,_0x3777bf){const _0x5bc3ad=a29_0xc3c091,_0x16b3fb=_0x3777bf[_0x5bc3ad(0x20b)]||CHAT_SELECTOR_PAGE_SIZE;let _0x38619d=0x0,_0x2b5b03=[];const _0x3ef01f=(await import(_0x5bc3ad(0x221)))[_0x5bc3ad(0x23a)],_0x5a9e9a=getChalk(_0x3777bf);while(!![]){const _0x17b2a1=await withSpinner(_0x5bc3ad(0x2a4),()=>_0x40c063[_0x5bc3ad(0x1fd)][_0x5bc3ad(0x246)](_0x16b3fb+_0x38619d),{'verbose':_0x3777bf[_0x5bc3ad(0x289)]});_0x2b5b03=_0x17b2a1[_0x5bc3ad(0x2b1)];const _0x45f9be=_0x2b5b03[_0x5bc3ad(0x1ef)](_0x38619d,_0x38619d+_0x16b3fb),_0x119399=_0x2b5b03[_0x5bc3ad(0x203)]>_0x38619d+_0x16b3fb,_0x2b041e=[...new Set(_0x45f9be[_0x5bc3ad(0x2af)](_0x2b11da=>_0x2b11da['attributes'][_0x5bc3ad(0x216)])[_0x5bc3ad(0x2b4)](_0x1621fe=>_0x1621fe!==undefined))],_0x5f20b9=new Map();await Promise[_0x5bc3ad(0x269)](_0x2b041e[_0x5bc3ad(0x2af)](async _0x4a452b=>{const _0x179792=_0x5bc3ad;try{const _0x7549f=await _0x40c063[_0x179792(0x1fd)]['agent'](_0x4a452b);_0x5f20b9[_0x179792(0x290)](_0x4a452b,_0x7549f[_0x179792(0x22c)][_0x179792(0x202)]);}catch{_0x5f20b9['set'](_0x4a452b,_0x4a452b);}}));const _0x86850b=_0x45f9be[_0x5bc3ad(0x2af)](_0x32e461=>{const _0x3a020d=_0x5bc3ad,_0x5d774e=_0x32e461[_0x3a020d(0x22c)][_0x3a020d(0x241)]||'(no\x20message)',_0x1f42a9=_0x5d774e['split']('\x0a')[0x0],_0x7912d4=_0x1f42a9['length']>0x50?_0x1f42a9['substring'](0x0,0x4d)+'...':_0x1f42a9,_0x89908d=_0x32e461[_0x3a020d(0x22c)][_0x3a020d(0x216)]?_0x5f20b9[_0x3a020d(0x22f)](_0x32e461[_0x3a020d(0x22c)][_0x3a020d(0x216)])||_0x32e461[_0x3a020d(0x22c)][_0x3a020d(0x216)]:_0x3a020d(0x22a),_0x39afee=_0x32e461[_0x3a020d(0x22c)][_0x3a020d(0x29f)]||_0x32e461[_0x3a020d(0x22c)][_0x3a020d(0x299)],_0x550988=new Date(_0x39afee),_0x5b7b4f=new Date(),_0x547d78=_0x5b7b4f['getTime']()-_0x550988[_0x3a020d(0x2b6)](),_0x3a45bc=Math[_0x3a020d(0x23b)](_0x547d78/0xea60),_0x22b66c=Math[_0x3a020d(0x23b)](_0x547d78/0x36ee80),_0x9ae570=Math[_0x3a020d(0x23b)](_0x547d78/0x5265c00);let _0x5e6666;if(_0x3a45bc<0x1)_0x5e6666='just\x20now';else{if(_0x3a45bc<0x3c)_0x5e6666=_0x3a45bc+_0x3a020d(0x22e);else{if(_0x22b66c<0x18)_0x5e6666=_0x22b66c+_0x3a020d(0x281);else _0x9ae570<0x7?_0x5e6666=_0x9ae570+'d\x20ago':_0x5e6666=_0x550988['toLocaleDateString'](_0x3a020d(0x1dc),{'month':_0x3a020d(0x2ad),'day':'numeric'});}}return{'title':_0x7912d4+'\x20'+_0x5a9e9a[_0x3a020d(0x20f)]('['+_0x89908d+']\x20'+_0x5e6666),'value':_0x32e461['id']};});_0x119399&&_0x86850b[_0x5bc3ad(0x28f)]({'title':_0x5a9e9a[_0x5bc3ad(0x1e1)]('Load\x20more...'),'value':_0x5bc3ad(0x271)});const _0x95a838=await _0x3ef01f({'type':_0x5bc3ad(0x27e),'name':'chatId','message':'Select\x20a\x20chat\x20session:','choices':_0x86850b,'hint':_0x5bc3ad(0x27c)});if(!_0x95a838[_0x5bc3ad(0x21b)])return undefined;if(_0x95a838[_0x5bc3ad(0x21b)]===_0x5bc3ad(0x271)){_0x38619d+=_0x16b3fb;continue;}return _0x95a838['chatId'];}}export class ChatsCommand extends BaseCommand{[a29_0xc3c091(0x202)]=a29_0xc3c091(0x246);['description']=a29_0xc3c091(0x1f1);async[a29_0xc3c091(0x261)](_0x50af19){const _0x2e5fc1=a29_0xc3c091;return executeChatHistoryCommand(_0x50af19,_0x2e5fc1(0x1da));}}export class LLMLogCommand extends BaseCommand{[a29_0xc3c091(0x202)]='llm:log';[a29_0xc3c091(0x29d)]=a29_0xc3c091(0x222);async[a29_0xc3c091(0x261)](_0x3df77c){const _0x28ae9a=a29_0xc3c091,{options:_0x155084,args:_0x367ddd,tdx:_0x440f9b}=_0x3df77c,_0x13beca=_0x367ddd[0x0];if(!_0x13beca)return console[_0x28ae9a(0x23d)]('Error:\x20chat-id\x20is\x20required'),console[_0x28ae9a(0x23d)](_0x28ae9a(0x20a)),0x1;const _0x288ace=await withSpinner(_0x28ae9a(0x1f7)+_0x13beca+'\x27...',()=>_0x440f9b['llm'][_0x28ae9a(0x206)](_0x13beca),{'verbose':_0x155084['verbose']});return await handleSDKOutput(_0x288ace[_0x28ae9a(0x2b1)][_0x28ae9a(0x2b1)],_0x155084),0x0;}}function a29_0x3202(){const _0x592f0e=['targetWebSearchTool','prompts','Show\x20chat\x20log','Invalid\x20path\x20syntax:\x20','llmProject','Show\x20agent\x20details','Error:\x20Project\x20name\x20is\x20required','\x20\x20Integrations:\x20','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','Fetching\x20available\x20models...','(no\x20agent)','site','attributes','table','m\x20ago','get','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','sourceSite','llm:project:create','A\x20project\x20named\x20\x27','last','string','...','2NxPLDT','\x20->\x20ImageGen:','setCurrentProject','default','floor','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','error','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Fetching\x20projects...','Restore\x20cancelled.','firstInputContent','Project\x20restored:\x20','blue','projectId','llm:models','chats','split','log','yes','projectName','Error:\x20Agent\x20name\x20is\x20required','getOrCreateDefaultProject','Use\x20format:\x20project-name/agent-name','llm:use','4447998Rfazke','llm:projects','Output\x20directory\x20\x27','input','[unknown]','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','llm:agent:delete','counts','[input]\x20\x20','Fetching\x20agent...','agents','Fetching\x20chat\x20history\x20for\x20\x27','prompt','cause','[content]','\x27...','Update\x20an\x20existing\x20agent','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','execute','Resolving\x20project\x20\x27','Creating\x20project\x20\x27','Delete\x20an\x20LLM\x20project','outputDir','localeCompare','Session\x20llm_project\x20set\x20to:\x20','rmSync','all','existsSync','jsonl','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','llm:project:restore','[tool_call]','Backup\x20cancelled.','backupProject','__load_more__','restoreProject','\x20->\x20KB:','keys','format','resolveAgentId','red','.llm','sort','Setting\x20project\x20context\x20to\x20\x27','updateAgent','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','\x20\x20\x20Examples:','select','\x20bytes)','entries','h\x20ago','Agent\x20deleted:\x20','List\x20all\x20LLM\x20projects','\x20\x20Prompts:\x20','Error:\x20','[output]\x20','251085DmfRPl','Set\x20current\x20project\x20context','verbose','Fetching\x20most\x20recent\x20chat...','Project\x20not\x20found:\x20','llm:agent:show','Unknown','Deleting\x20project\x20\x27','push','set','\x0aStack\x20trace:','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Updating\x20agent...','\x20--last','output','llm:project:delete','targetAgent','updatedAt','stringify','828796wRTXqN','\x27\x20already\x20exists.\x20Overwrite?','description','List\x20available\x20LLM\x20models','lastConversationAt','Project\x20deleted:\x20','llm:history','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','bold','Fetching\x20chat\x20sessions...','Checking\x20for\x20existing\x20projects...','No\x20projects\x20found','tool','createdAt','join','deleteProject','Fetching\x20agents...','dryRun','short','systemPrompt','map','\x20->\x20WebSearch:','data','projects','\x20project(s)','filter','targetKnowledgeBase','getTime','Resolving\x20agent\x20\x27','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','No\x20agents\x20found','green','tdx\x20chats','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','en-US','Creating\x20agent\x20\x27','Backing\x20up\x20project\x20\x27','tdx\x20llm\x20history','🤖\x20','cyan','\x0aCancelled','11459439LEbiGf','Validating\x20backup\x20from\x20\x27','\x20\x20Cause:\x20','Create\x20a\x20new\x20agent\x20in\x20current\x20project','find','llm:project:backup','[image]\x20\x20','tsv','includes','temperature','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','10YsuZrw','slice','message','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','Create\x20a\x20new\x20LLM\x20project','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','createProject','content','3917152qrGXqF','Fetching\x20chat\x20log\x20for\x20\x27','starterMessage','claude-4.5-haiku','toLowerCase','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Error:\x20Backup\x20folder\x20path\x20is\x20required','llm','LLM_PROJECT_NOT_FOUND','magenta','deleteAgent','yellow','name','length','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','List\x20agents\x20in\x20current\x20project','getChatLog','\x20\x20Knowledge\x20Bases:\x20','knowledgeBases','\x20->\x20Agent:','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','limit','Restoring\x20project\x20from\x20\x27','agent','llm:agents','dim','INVALID_ARGUMENT','\x20\x20Agents:\x20','3641960ZPQckm','history','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','agentId','image','targetImageGenerator','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','maxToolIterations','chatId','643515xVWUpX','tool_call','json','integrations'];a29_0x3202=function(){return _0x592f0e;};return a29_0x3202();}
1
+ const a29_0x2efbd4=a29_0x5d09;(function(_0xb1d24d,_0x5b2501){const _0xcb013e=a29_0x5d09,_0x2c96d3=_0xb1d24d();while(!![]){try{const _0x433059=parseInt(_0xcb013e(0x287))/0x1*(-parseInt(_0xcb013e(0x20e))/0x2)+-parseInt(_0xcb013e(0x209))/0x3*(parseInt(_0xcb013e(0x299))/0x4)+parseInt(_0xcb013e(0x225))/0x5*(-parseInt(_0xcb013e(0x250))/0x6)+-parseInt(_0xcb013e(0x27a))/0x7+parseInt(_0xcb013e(0x2b1))/0x8+parseInt(_0xcb013e(0x207))/0x9*(parseInt(_0xcb013e(0x29d))/0xa)+parseInt(_0xcb013e(0x1e8))/0xb;if(_0x433059===_0x5b2501)break;else _0x2c96d3['push'](_0x2c96d3['shift']());}catch(_0x139544){_0x2c96d3['push'](_0x2c96d3['shift']());}}}(a29_0x1229,0xcac71));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import*as a29_0x385cb6 from'node:fs';function handleSDKError(_0x4dc4ec,_0x3467df){const _0x3a9852=a29_0x5d09;if(_0x4dc4ec instanceof SDKError)console['error'](_0x3a9852(0x247)+_0x4dc4ec['message']),_0x3467df['verbose']&&(_0x4dc4ec['cause']&&console[_0x3a9852(0x1e7)](_0x3a9852(0x29a)+_0x4dc4ec[_0x3a9852(0x212)]),_0x4dc4ec[_0x3a9852(0x261)]&&(console['error'](_0x3a9852(0x230)),console[_0x3a9852(0x1e7)](_0x4dc4ec['stack'])));else throw _0x4dc4ec;}function formatChatHistoryEntry(_0xec381,_0x22dbbb){const _0x21d743=a29_0x5d09,_0x3f3d9e=getChalk(_0x22dbbb),_0x134d29=_0x3f3d9e[_0x21d743(0x27e)](_0xec381['at']);if(_0x21d743(0x216)in _0xec381){const _0xc97888=_0x3f3d9e[_0x21d743(0x1f1)](_0x21d743(0x1d8));return _0x134d29+'\x20'+_0xc97888+':\x20'+_0xec381[_0x21d743(0x216)];}if(_0x21d743(0x22a)in _0xec381){const _0x4f4904=_0x3f3d9e[_0x21d743(0x256)]('[content]');return _0x134d29+'\x20'+_0x4f4904+':\x20'+_0xec381[_0x21d743(0x22a)];}if(_0x21d743(0x234)in _0xec381){const _0x4cc66f=_0x3f3d9e[_0x21d743(0x235)]('[tool_call]'),{functionName:_0x399a7c,functionArguments:_0x1551c8,targetFunction:_0x4d0a3d}=_0xec381[_0x21d743(0x234)];let _0x59c30f=_0x134d29+'\x20'+_0x4cc66f+':\x20'+_0x3f3d9e['bold'](_0x399a7c);if(_0x1551c8&&Object['keys'](_0x1551c8)[_0x21d743(0x239)]>0x0){const _0x38099a=Object[_0x21d743(0x2b7)](_0x1551c8)[_0x21d743(0x236)](([_0x5d6382,_0x42342c])=>_0x5d6382+'='+JSON['stringify'](_0x42342c))[_0x21d743(0x264)](',\x20');_0x59c30f+='('+_0x38099a+')';}_0x4d0a3d&&(_0x59c30f+=_0x3f3d9e[_0x21d743(0x27e)]('\x20['+_0x4d0a3d+']'));let _0x194b47='';if(_0xec381[_0x21d743(0x234)][_0x21d743(0x1dd)])_0x194b47=_0x21d743(0x25f)+_0xec381['tool_call'][_0x21d743(0x1dd)][_0x21d743(0x1f2)];else{if(_0xec381[_0x21d743(0x234)]['targetAgent'])_0x194b47=_0x21d743(0x1d9)+_0xec381['tool_call']['targetAgent'][_0x21d743(0x1f2)];else{if(_0xec381[_0x21d743(0x234)][_0x21d743(0x265)])_0x194b47=_0x21d743(0x219)+_0xec381[_0x21d743(0x234)][_0x21d743(0x265)][_0x21d743(0x1f2)];else _0xec381['tool_call'][_0x21d743(0x2ae)]&&(_0x194b47=_0x21d743(0x229)+_0xec381[_0x21d743(0x234)][_0x21d743(0x2ae)][_0x21d743(0x1f2)]);}}return _0x59c30f+_0x194b47;}if(_0x21d743(0x1d6)in _0xec381){const _0x3a1f53=_0x3f3d9e['magenta'](_0x21d743(0x201)),{functionName:_0x495738,functionArguments:_0x2c7414,content:_0x17255b,newChat:_0x19e646}=_0xec381['tool'];let _0x22d5b8=_0x134d29+'\x20'+_0x3a1f53+':\x20'+_0x3f3d9e[_0x21d743(0x24e)](_0x495738);if(_0x2c7414){const _0xfbb64d=typeof _0x2c7414===_0x21d743(0x214)?_0x2c7414:JSON[_0x21d743(0x217)](_0x2c7414);_0x22d5b8+='('+_0xfbb64d+')';}return _0x17255b&&(_0x22d5b8+='\x0a'+_0x3f3d9e['dim'](_0x17255b)),_0x19e646&&(_0x22d5b8+=_0x3f3d9e['dim'](_0x21d743(0x248)+_0x19e646['id'])),_0x22d5b8;}if(_0x21d743(0x249)in _0xec381){const _0x490927=_0x3f3d9e[_0x21d743(0x2a8)](_0x21d743(0x2a6));return _0x134d29+'\x20'+_0x490927+':\x20'+_0xec381['output'][_0x21d743(0x1f2)]+'\x20('+_0xec381[_0x21d743(0x249)][_0x21d743(0x22a)][_0x21d743(0x239)]+_0x21d743(0x29b);}if('image'in _0xec381){const _0x32daab=_0x3f3d9e[_0x21d743(0x2a8)](_0x21d743(0x27f)),{width:_0x4277eb,height:_0x4f1cf9,headerText:_0x2bf088}=_0xec381[_0x21d743(0x1fc)],_0x3371b4=_0x2bf088?_0x21d743(0x24a)+_0x2bf088:'';return _0x134d29+'\x20'+_0x32daab+':\x20'+_0x4277eb+'x'+_0x4f1cf9+_0x3371b4;}if(_0x21d743(0x1e7)in _0xec381){const _0x418bd0=_0x3f3d9e[_0x21d743(0x25d)](_0x21d743(0x22f));return _0x134d29+'\x20'+_0x418bd0+':\x20'+_0xec381[_0x21d743(0x1e7)];}return _0x134d29+'\x20'+_0x3f3d9e[_0x21d743(0x27e)](_0x21d743(0x1e4))+':\x20'+JSON[_0x21d743(0x217)](_0xec381);}async function executeChatHistoryCommand(_0x1f0b26,_0x400432){const _0x2745d9=a29_0x5d09,{options:_0x3e45ae,args:_0xb9838e,tdx:_0x11be7a}=_0x1f0b26,_0x3443fb=_0xb9838e[0x0],_0x21cf1b=_0x3e45ae,_0x22b9a1=_0x21cf1b[_0x2745d9(0x26b)];try{if(_0x22b9a1&&_0x3443fb)return console[_0x2745d9(0x1e7)](_0x2745d9(0x1ec)),console[_0x2745d9(0x1e7)](_0x2745d9(0x222)+_0x400432+_0x2745d9(0x28f)),0x1;if(!_0x3443fb&&!_0x22b9a1&&_0x3e45ae['format']!==undefined){const _0x22d181=resolveLimit(_0x3e45ae[_0x2745d9(0x237)],DEFAULT_LLM_LIMIT),_0x5e7a8a=await withSpinner(_0x2745d9(0x28d),()=>_0x11be7a[_0x2745d9(0x1da)][_0x2745d9(0x21a)](_0x22d181),{'verbose':_0x3e45ae[_0x2745d9(0x22e)]});return await handleSDKOutput(_0x5e7a8a['data'],_0x3e45ae),0x0;}const _0xe18fd5=await getChatIdOrSelect(_0x11be7a,_0x3e45ae,_0x22b9a1,_0x3443fb);if(!_0xe18fd5)return 0x0;return await displayChatHistory(_0xe18fd5,_0x11be7a,_0x3e45ae),0x0;}catch(_0x3e1d23){return handleSDKError(_0x3e1d23,_0x3e45ae),0x1;}}function a29_0x1229(){const _0x3f8acf=['\x20->\x20ImageGen:','content','Unknown','Project\x20restored:\x20','short','verbose','[error]\x20\x20','\x0aStack\x20trace:','Create\x20a\x20new\x20LLM\x20project','Fetching\x20available\x20models...','dryRun','tool_call','yellow','map','limit','getCurrentProject','length','Getting\x20default\x20project...','LLM_PROJECT_NOT_FOUND','default','agents','Resolving\x20agent\x20\x27','Fetching\x20projects...','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','outputDir','Invalid\x20path\x20syntax:\x20','Fetching\x20most\x20recent\x20chat...','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','llm:agent:create','attributes','Error:\x20','\x20→\x20chat:\x20','output','\x20-\x20','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','set','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','bold','Restore\x20cancelled.','193554XzXMDz','Update\x20an\x20existing\x20agent','Error:\x20Project\x20name\x20is\x20required','model','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','green','Setting\x20project\x20context\x20to\x20\x27','toLowerCase','(no\x20agent)','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','select','Show\x20chat\x20log','red','Error:\x20chat-id\x20is\x20required','\x20->\x20KB:','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','stack','data','...','join','targetWebSearchTool','Use\x20format:\x20project-name/agent-name','Deleting\x20agent...','numeric','List\x20agents\x20in\x20current\x20project','includes','last','projectName','deleteAgent','Error:\x20Agent\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','deleteProject','Backing\x20up\x20project\x20\x27','counts','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','yes','Delete\x20an\x20LLM\x20project','h\x20ago','\x20project(s)','table','List\x20all\x20LLM\x20projects','5358850VaJjNR','setCurrentProject','createAgent','\x20\x20Agents:\x20','dim','[image]\x20\x20','llm:project:backup','Creating\x20agent\x20\x27','Agent\x20updated:\x20','List\x20available\x20LLM\x20models','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','tsv','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','1KvFHyi','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','No\x20messages\x20found\x20in\x20chat\x20history.','filter','resolveAgentId','agent','Fetching\x20chat\x20sessions...','llm:log','\x20--last','log','find','__load_more__','claude-4.5-haiku','\x0aCancelled','session','INVALID_ARGUMENT','existsSync','getTime','472VBqjwF','\x20\x20Cause:\x20','\x20bytes)','llm:history','30JkDNyh','A\x20project\x20named\x20\x27','updatedAt','push','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','prompts','tdx\x20llm\x20history','site','Create\x20a\x20new\x20agent\x20in\x20current\x20project','[output]\x20','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','blue','No\x20agents\x20found','chatId','\x20\x20Prompts:\x20','llm:agents','backupProject','targetImageGenerator','Show\x20agent\x20details','Project\x20deleted:\x20','4626608drBaMY','en-US','\x27...','substring','d\x20ago','resolveProjectId','entries','tool','projects','[input]\x20\x20','\x20->\x20Agent:','llm','Agent\x20deleted:\x20','Validating\x20backup\x20from\x20\x27','targetKnowledgeBase','.llm','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','⚒️\x20','Project\x20created:\x20','all','[unknown]','prompt','\x27\x20already\x20exists.\x20Overwrite?','error','12343320BfCtdZ','llm:project:delete','localeCompare','sourceSite','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','getBackupMetadata','Updating\x20agent...','history','Fetching\x20chat\x20log\x20for\x20\x27','cyan','name','Error:\x20Backup\x20folder\x20path\x20is\x20required','models','split','slice','floor','jsonl','\x20\x20Knowledge\x20Bases:\x20','llmProject','Resolving\x20project\x20\x27','image','Restoring\x20project\x20from\x20\x27','llm:project:restore','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','Output\x20directory\x20\x27','[tool]\x20\x20\x20','Fetching\x20agent...','\x20\x20Integrations:\x20','getChatLog','🤖\x20','createdAt','3337380MnnFPq','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','9033SWgqht','maxToolIterations','systemPrompt','llm:projects','description','303566zkaJYa','knowledgeBases','json','integrations','cause','temperature','string','sort','input','stringify','llm:use','\x20->\x20WebSearch:','chats','(no\x20message)','m\x20ago','llm:agent:update','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','get','starterMessage','execute','Usage:\x20','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','lastConversationAt','110tAoeLD','format','\x20agent(s)','agentId'];a29_0x1229=function(){return _0x3f8acf;};return a29_0x1229();}async function displayChatHistory(_0x55997b,_0x246c09,_0x4cc44a){const _0x28ef3e=a29_0x5d09,_0x4ef44d=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x55997b+_0x28ef3e(0x2b3),()=>_0x246c09[_0x28ef3e(0x1da)][_0x28ef3e(0x1ef)](_0x55997b),{'verbose':_0x4cc44a[_0x28ef3e(0x22e)]}),_0xef5e31=_0x4ef44d['data'][_0x28ef3e(0x262)]??[];if(_0xef5e31[_0x28ef3e(0x239)]===0x0){console['log'](_0x28ef3e(0x289));return;}if(_0x4cc44a[_0x28ef3e(0x226)]!==undefined)await handleSDKOutput(_0xef5e31,_0x4cc44a);else{const _0x329c88=_0xef5e31[_0x28ef3e(0x236)](_0x540b2e=>formatChatHistoryEntry(_0x540b2e,_0x4cc44a)),_0x18b114=_0x329c88[_0x28ef3e(0x264)]('\x0a');await writeOutput(_0x18b114,_0x4cc44a[_0x28ef3e(0x249)],'table');}}async function getChatIdOrSelect(_0x237618,_0x32a72f,_0x7fb374,_0x27518d){const _0xb8b3c7=a29_0x5d09;if(_0x27518d)return _0x27518d;if(_0x7fb374){const _0x26d76f=await withSpinner(_0xb8b3c7(0x243),()=>_0x237618['llm'][_0xb8b3c7(0x21a)](0x1),{'verbose':_0x32a72f[_0xb8b3c7(0x22e)]});if(_0x26d76f[_0xb8b3c7(0x262)][_0xb8b3c7(0x239)]===0x0)return console[_0xb8b3c7(0x290)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x26d76f[_0xb8b3c7(0x262)][0x0]['id'];}const _0x323104=await selectChatInteractively(_0x237618,_0x32a72f);if(!_0x323104)return console[_0xb8b3c7(0x290)](_0xb8b3c7(0x294)),undefined;return _0x323104;}async function getProjectIdOrDefault(_0x4f4347){const _0x5cf680=await getProjectWithName(_0x4f4347);return _0x5cf680['id'];}async function getProjectWithName(_0x19e1e4){const _0x53d286=a29_0x5d09,{tdx:_0x55141b,options:_0x2eadf4}=_0x19e1e4,_0x22a905=_0x2eadf4[_0x53d286(0x1fa)];if(_0x22a905){const _0x41fa17=await withSpinner('Resolving\x20project\x20\x27'+_0x22a905+'\x27...',()=>_0x55141b[_0x53d286(0x1da)][_0x53d286(0x2b6)](_0x22a905),{'verbose':_0x2eadf4['verbose']});return{'id':_0x41fa17['data'],'name':_0x22a905};}const _0x2f7015=_0x55141b[_0x53d286(0x1da)][_0x53d286(0x238)]();if(_0x2f7015){const _0xf1c3f5=await _0x55141b[_0x53d286(0x1da)][_0x53d286(0x1d7)](),_0x38b86d=_0xf1c3f5[_0x53d286(0x291)](_0xca39ee=>_0xca39ee['id']===_0x2f7015);return{'id':_0x2f7015,'name':_0x38b86d?.[_0x53d286(0x246)][_0x53d286(0x1f2)]||_0x53d286(0x22b)};}const _0x397cd1=await withSpinner(_0x53d286(0x23a),()=>_0x55141b['llm']['getOrCreateDefaultProject'](),{'verbose':_0x2eadf4[_0x53d286(0x22e)]});return{'id':_0x397cd1[_0x53d286(0x262)]['id'],'name':_0x397cd1[_0x53d286(0x262)]['attributes']['name']};}function toLLMProjectInfo(_0x775045){const _0x7a3343=a29_0x5d09;return{'name':_0x775045['attributes'][_0x7a3343(0x1f2)],'description':_0x775045[_0x7a3343(0x246)][_0x7a3343(0x20d)],'createdAt':_0x775045[_0x7a3343(0x246)][_0x7a3343(0x206)],'updatedAt':_0x775045[_0x7a3343(0x246)][_0x7a3343(0x29f)]};}function toAgentInfo(_0x482f29){const _0x3369b3=a29_0x5d09;return{'name':_0x482f29[_0x3369b3(0x246)][_0x3369b3(0x1f2)],'description':_0x482f29[_0x3369b3(0x246)][_0x3369b3(0x20d)],'prompt':truncatePrompt(_0x482f29[_0x3369b3(0x246)]['prompt']),'createdAt':_0x482f29[_0x3369b3(0x246)][_0x3369b3(0x206)],'updatedAt':_0x482f29[_0x3369b3(0x246)][_0x3369b3(0x29f)]};}function truncatePrompt(_0x314a90){const _0x11dd9f=a29_0x5d09;if(!_0x314a90)return undefined;const _0x1924cc=0x64;if(_0x314a90[_0x11dd9f(0x239)]<=_0x1924cc)return _0x314a90;return _0x314a90[_0x11dd9f(0x1f6)](0x0,_0x1924cc)+_0x11dd9f(0x263);}export class LLMModelsCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]='llm:models';['description']=a29_0x2efbd4(0x283);async[a29_0x2efbd4(0x221)](_0x2b743c){const _0x337fb7=a29_0x2efbd4,{options:_0xe1a736,tdx:_0x400dee}=_0x2b743c;try{const _0x5d2f1b=await withSpinner(_0x337fb7(0x232),()=>_0x400dee['llm'][_0x337fb7(0x1f4)](),{'verbose':_0xe1a736['verbose']});return await handleSDKOutput(_0x5d2f1b[_0x337fb7(0x262)],_0xe1a736),0x0;}catch(_0x4a908c){return handleSDKError(_0x4a908c,_0xe1a736),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a29_0x2efbd4(0x20c);['description']=a29_0x2efbd4(0x279);async[a29_0x2efbd4(0x221)](_0x4366ba){const _0x5e55d2=a29_0x2efbd4,{options:_0x284e97,args:_0x2d45e6,tdx:_0x53faee}=_0x4366ba,_0x1e79c0=getChalk(_0x284e97),_0x3e8a62=_0x284e97[_0x5e55d2(0x2a4)];try{const _0x2e60be=_0x2d45e6[0x0],_0x4f1d92=resolveLimit(_0x284e97['limit'],DEFAULT_LLM_LIMIT),_0x5f1ebe=await withSpinner(_0x5e55d2(0x23f),()=>_0x53faee['llm'][_0x5e55d2(0x1d7)](_0x4f1d92),{'verbose':_0x284e97[_0x5e55d2(0x22e)]});let _0x3f37fe=_0x5f1ebe[_0x5e55d2(0x262)];_0x2e60be&&(_0x3f37fe=_0x5f1ebe['data']['filter'](_0x2a69f8=>matchGlobPattern(_0x2a69f8[_0x5e55d2(0x246)]['name'],_0x2e60be)));const _0x512897=_0x284e97[_0x5e55d2(0x226)]===_0x5e55d2(0x210)||_0x284e97[_0x5e55d2(0x226)]===_0x5e55d2(0x1f8)||_0x284e97[_0x5e55d2(0x226)]===_0x5e55d2(0x278)||_0x284e97[_0x5e55d2(0x226)]===_0x5e55d2(0x285);if(_0x512897){const _0x7648ae=_0x3f37fe[_0x5e55d2(0x236)](_0x5190ed=>({...toLLMProjectInfo(_0x5190ed),'url':getLLMProjectUrl(_0x3e8a62,_0x5190ed['id'])}));await handleSDKOutput(_0x7648ae,_0x284e97);}else{const _0x5c7d31=[];if(_0x3f37fe['length']===0x0)_0x5c7d31[_0x5e55d2(0x2a0)](_0x1e79c0[_0x5e55d2(0x27e)]('No\x20projects\x20found'));else{const _0xf490a0=[..._0x3f37fe]['sort']((_0x397041,_0x2e5324)=>_0x397041['attributes']['name'][_0x5e55d2(0x1ea)](_0x2e5324['attributes'][_0x5e55d2(0x1f2)]));for(const _0x294e85 of _0xf490a0){const _0x3ba872=getLLMProjectUrl(_0x3e8a62,_0x294e85['id']),_0x5ac71d=hyperlink(_0x294e85['attributes']['name'],_0x3ba872);_0x5c7d31['push'](_0x5e55d2(0x1e1)+_0x5ac71d);}_0x5c7d31[_0x5e55d2(0x2a0)](_0x1e79c0['dim'](_0x3f37fe['length']+_0x5e55d2(0x277)));}await writeOutput(_0x5c7d31[_0x5e55d2(0x264)]('\x0a'),_0x284e97[_0x5e55d2(0x249)],_0x5e55d2(0x278));}return 0x0;}catch(_0x49f084){return handleSDKError(_0x49f084,_0x284e97),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x2ac);['description']=a29_0x2efbd4(0x269);async['execute'](_0x3a5d31){const _0x2748d0=a29_0x2efbd4,{options:_0x5eeee2,args:_0x44e386,tdx:_0x14fc3a}=_0x3a5d31,_0x9ebe3e=getChalk(_0x5eeee2),_0xc99e8b=_0x5eeee2[_0x2748d0(0x2a4)];try{const _0x3d895e=_0x44e386[0x0];let _0x13802d=_0x3d895e,_0x4dced0,_0x55188e;if(_0x3d895e&&_0x3d895e[_0x2748d0(0x26a)]('/')){const _0x24d895=_0x3d895e[_0x2748d0(0x1f5)]('/');if(_0x24d895['length']===0x2){const [_0xeb9d1c,_0x3d9bef]=_0x24d895,_0xf43c10=await _0x14fc3a[_0x2748d0(0x1da)][_0x2748d0(0x1d7)](),_0x29ff13=_0xf43c10['find'](_0x316d95=>_0x316d95[_0x2748d0(0x246)][_0x2748d0(0x1f2)][_0x2748d0(0x258)]()===_0xeb9d1c[_0x2748d0(0x258)]());if(!_0x29ff13)throw new SDKError(ErrorCode[_0x2748d0(0x23b)],'Project\x20not\x20found:\x20'+_0xeb9d1c,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0x4dced0=_0x29ff13['id'],_0x55188e=_0x29ff13[_0x2748d0(0x246)][_0x2748d0(0x1f2)],_0x13802d=_0x3d9bef;}else throw new SDKError(ErrorCode[_0x2748d0(0x296)],_0x2748d0(0x242)+_0x3d895e,undefined,{'helpText':_0x2748d0(0x266)});}else{const _0x31ddd4=await getProjectWithName(_0x3a5d31);_0x4dced0=_0x31ddd4['id'],_0x55188e=_0x31ddd4[_0x2748d0(0x1f2)];}const _0x2c5c9d=await withSpinner('Fetching\x20agents...',()=>_0x14fc3a[_0x2748d0(0x1da)]['agents'](_0x4dced0),{'verbose':_0x5eeee2[_0x2748d0(0x22e)]});let _0x13a88b=_0x2c5c9d[_0x2748d0(0x262)];_0x13802d&&(_0x13a88b=_0x2c5c9d[_0x2748d0(0x262)][_0x2748d0(0x28a)](_0x24a8c1=>matchGlobPattern(_0x24a8c1[_0x2748d0(0x246)]['name'],_0x13802d)));const _0x5210b3=_0x5eeee2[_0x2748d0(0x226)]===_0x2748d0(0x210)||_0x5eeee2[_0x2748d0(0x226)]==='jsonl'||_0x5eeee2['format']===_0x2748d0(0x278)||_0x5eeee2[_0x2748d0(0x226)]===_0x2748d0(0x285);if(_0x5210b3){const _0x6fff2a=_0x13a88b['map'](_0x2de6c1=>({...toAgentInfo(_0x2de6c1),'chatUrl':getLLMAgentChatUrl(_0xc99e8b,_0x4dced0,_0x2de6c1['id'])}));await handleSDKOutput(_0x6fff2a,_0x5eeee2);}else{const _0x293558=[];_0x293558[_0x2748d0(0x2a0)](_0x9ebe3e['dim']('['+_0x55188e+']'));if(_0x13a88b[_0x2748d0(0x239)]===0x0)_0x293558[_0x2748d0(0x2a0)](_0x9ebe3e[_0x2748d0(0x27e)](_0x2748d0(0x2a9)));else{const _0x5c36ae=[..._0x13a88b][_0x2748d0(0x215)]((_0x516068,_0x1dd47f)=>_0x516068[_0x2748d0(0x246)]['name']['localeCompare'](_0x1dd47f[_0x2748d0(0x246)]['name']));for(const _0x5d5b2c of _0x5c36ae){const _0xcb9b45=getLLMAgentChatUrl(_0xc99e8b,_0x4dced0,_0x5d5b2c['id']),_0x19ab04=hyperlink(_0x5d5b2c['attributes'][_0x2748d0(0x1f2)],_0xcb9b45);_0x293558[_0x2748d0(0x2a0)](_0x2748d0(0x205)+_0x19ab04);}_0x293558[_0x2748d0(0x2a0)](_0x9ebe3e[_0x2748d0(0x27e)](_0x13a88b[_0x2748d0(0x239)]+_0x2748d0(0x227)));}await writeOutput(_0x293558[_0x2748d0(0x264)]('\x0a'),_0x5eeee2[_0x2748d0(0x249)],_0x2748d0(0x278));}return 0x0;}catch(_0x346d52){return handleSDKError(_0x346d52,_0x5eeee2),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']='llm:agent:show';[a29_0x2efbd4(0x20d)]=a29_0x2efbd4(0x2af);async[a29_0x2efbd4(0x221)](_0x1ddc9c){const _0x4a35a3=a29_0x2efbd4,{options:_0x534be3,args:_0x4fd697,tdx:_0x1c644e}=_0x1ddc9c;if(_0x4fd697[_0x4a35a3(0x239)]===0x0)return console['error'](_0x4a35a3(0x26e)),console[_0x4a35a3(0x1e7)](_0x4a35a3(0x21e)),0x1;const _0xf76a2b=_0x4fd697[0x0];try{const _0x52e7bf=await getProjectIdOrDefault(_0x1ddc9c),_0x98bb2f=await withSpinner(_0x4a35a3(0x23e)+_0xf76a2b+_0x4a35a3(0x2b3),()=>_0x1c644e['llm'][_0x4a35a3(0x28b)](_0xf76a2b,_0x52e7bf),{'verbose':_0x534be3[_0x4a35a3(0x22e)]}),_0x58c7af=await withSpinner(_0x4a35a3(0x202),()=>_0x1c644e[_0x4a35a3(0x1da)][_0x4a35a3(0x28c)](_0x98bb2f[_0x4a35a3(0x262)]),{'verbose':_0x534be3[_0x4a35a3(0x22e)]});return await handleSDKOutput([_0x58c7af[_0x4a35a3(0x262)]],_0x534be3),0x0;}catch(_0x5c1d27){return handleSDKError(_0x5c1d27,_0x534be3),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a29_0x2efbd4(0x245);[a29_0x2efbd4(0x20d)]=a29_0x2efbd4(0x2a5);async[a29_0x2efbd4(0x221)](_0x83afca){const _0x42813d=a29_0x2efbd4,{options:_0x3d8473,args:_0x25191f,tdx:_0x4e3950}=_0x83afca;if(_0x25191f['length']===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x42813d(0x1df)),console[_0x42813d(0x1e7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x572eb4=_0x25191f[0x0],_0xd6f003=_0x3d8473,_0x176018=_0xd6f003[_0x42813d(0x20b)],_0x34d2b7=_0xd6f003[_0x42813d(0x253)]||_0x42813d(0x293),_0x537dbe=_0xd6f003[_0x42813d(0x220)],_0x3271de=_0xd6f003[_0x42813d(0x20a)]?Number(_0xd6f003['maxToolIterations']):undefined,_0x1a7af4=_0xd6f003[_0x42813d(0x213)]?Number(_0xd6f003['temperature']):undefined;try{let _0x575f94,_0x435e58;if(_0x572eb4['includes']('/')){const _0x4887f3=_0x572eb4[_0x42813d(0x1f5)]('/');if(_0x4887f3[_0x42813d(0x239)]===0x2){const [_0xda3e63,_0x3b90b5]=_0x4887f3,_0x1523b7=await withSpinner(_0x42813d(0x1fb)+_0xda3e63+_0x42813d(0x2b3),()=>_0x4e3950[_0x42813d(0x1da)][_0x42813d(0x2b6)](_0xda3e63),{'verbose':_0x3d8473[_0x42813d(0x22e)]});_0x575f94=_0x1523b7[_0x42813d(0x262)],_0x435e58=_0x3b90b5;}else throw new SDKError(ErrorCode[_0x42813d(0x296)],_0x42813d(0x242)+_0x572eb4,undefined,{'helpText':_0x42813d(0x266)});}else _0x575f94=await getProjectIdOrDefault(_0x83afca),_0x435e58=_0x572eb4;const _0x732c79=await withSpinner(_0x42813d(0x281)+_0x435e58+_0x42813d(0x2b3),()=>_0x4e3950[_0x42813d(0x1da)][_0x42813d(0x27c)]({'name':_0x435e58,'projectId':_0x575f94,'modelType':_0x34d2b7,'systemPrompt':_0x176018,'starterMessage':_0x537dbe,'maxToolIterations':_0x3271de,'temperature':_0x1a7af4}),{'verbose':_0x3d8473[_0x42813d(0x22e)]});return console[_0x42813d(0x290)]('Agent\x20created:\x20'+_0x732c79[_0x42813d(0x262)]['id']),await handleSDKOutput([_0x732c79['data']],_0x3d8473),0x0;}catch(_0x52a3f4){return handleSDKError(_0x52a3f4,_0x3d8473),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a29_0x2efbd4(0x21d);[a29_0x2efbd4(0x20d)]=a29_0x2efbd4(0x251);async[a29_0x2efbd4(0x221)](_0x32faab){const _0x5ebb40=a29_0x2efbd4,{options:_0x359b96,args:_0x45cde7,tdx:_0x281299}=_0x32faab;if(_0x45cde7[_0x5ebb40(0x239)]===0x0)return console[_0x5ebb40(0x1e7)](_0x5ebb40(0x26e)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0xe5a35c=_0x45cde7[0x0],_0x19973f=_0x359b96,_0x493ead=_0x19973f[_0x5ebb40(0x1f2)],_0x26f8b5=_0x19973f[_0x5ebb40(0x1e5)],_0x44acb6=_0x19973f[_0x5ebb40(0x20d)],_0x5e7f9e=_0x19973f[_0x5ebb40(0x220)];if(!_0x493ead&&!_0x26f8b5&&!_0x44acb6&&!_0x5e7f9e)return console[_0x5ebb40(0x1e7)](_0x5ebb40(0x208)),console[_0x5ebb40(0x1e7)](_0x5ebb40(0x273)),0x1;try{const _0x23d372=await getProjectIdOrDefault(_0x32faab),_0x185c76=await withSpinner('Resolving\x20agent\x20\x27'+_0xe5a35c+_0x5ebb40(0x2b3),()=>_0x281299[_0x5ebb40(0x1da)]['resolveAgentId'](_0xe5a35c,_0x23d372),{'verbose':_0x359b96['verbose']}),_0x28b63e=_0x185c76[_0x5ebb40(0x262)],_0x117567=await withSpinner(_0x5ebb40(0x1ee),()=>_0x281299[_0x5ebb40(0x1da)]['updateAgent'](_0x28b63e,{'name':_0x493ead,'prompt':_0x26f8b5,'description':_0x44acb6,'starterMessage':_0x5e7f9e}),{'verbose':_0x359b96[_0x5ebb40(0x22e)]});return console[_0x5ebb40(0x290)](_0x5ebb40(0x282)+_0x117567[_0x5ebb40(0x262)]['id']),await handleSDKOutput([_0x117567[_0x5ebb40(0x262)]],_0x359b96),0x0;}catch(_0xf5d542){return handleSDKError(_0xf5d542,_0x359b96),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]='llm:agent:delete';[a29_0x2efbd4(0x20d)]='Delete\x20an\x20agent';async[a29_0x2efbd4(0x221)](_0x2dde85){const _0x4ae755=a29_0x2efbd4,{options:_0xdb3b74,args:_0x10e0e5,tdx:_0x3cf141}=_0x2dde85;if(_0x10e0e5['length']===0x0)return console[_0x4ae755(0x1e7)](_0x4ae755(0x26e)),console[_0x4ae755(0x1e7)](_0x4ae755(0x26f)),0x1;const _0x334844=_0x10e0e5[0x0];try{const _0x23cdcf=await getProjectIdOrDefault(_0x2dde85),_0x165b87=await withSpinner(_0x4ae755(0x23e)+_0x334844+'\x27...',()=>_0x3cf141['llm']['resolveAgentId'](_0x334844,_0x23cdcf),{'verbose':_0xdb3b74['verbose']}),_0x51a5c0=_0x165b87[_0x4ae755(0x262)];return await withSpinner(_0x4ae755(0x267),()=>_0x3cf141['llm'][_0x4ae755(0x26d)](_0x51a5c0),{'verbose':_0xdb3b74[_0x4ae755(0x22e)]}),console[_0x4ae755(0x290)](_0x4ae755(0x1db)+_0x51a5c0),0x0;}catch(_0x592a5b){return handleSDKError(_0x592a5b,_0xdb3b74),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x29c);[a29_0x2efbd4(0x20d)]=a29_0x2efbd4(0x254);async['execute'](_0x1bce73){const _0x2f38f9=a29_0x2efbd4;return executeChatHistoryCommand(_0x1bce73,_0x2f38f9(0x2a3));}}export class LLMUseCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x218);['description']='Set\x20current\x20project\x20context';async['execute'](_0xcc29d0){const _0x3fb10e=a29_0x2efbd4,{options:_0x3d3853,args:_0x5f3729,tdx:_0x5b6b9d}=_0xcc29d0;if(_0x5f3729[_0x3fb10e(0x239)]===0x0)return console['error'](_0x3fb10e(0x252)),console['error']('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x37ab0a=_0x5f3729[0x0];try{await withSpinner(_0x3fb10e(0x257)+_0x37ab0a+'\x27...',()=>_0x5b6b9d['llm'][_0x3fb10e(0x27b)](_0x37ab0a),{'verbose':_0x3d3853['verbose']}),saveSessionContext({'llm_project':_0x37ab0a},_0x3d3853[_0x3fb10e(0x295)]);const _0x13917f=getChalk(_0x3d3853);return console[_0x3fb10e(0x290)]('Session\x20llm_project\x20set\x20to:\x20'+_0x13917f['green'](_0x37ab0a)),0x0;}catch(_0xcb96f0){return handleSDKError(_0xcb96f0,_0x3d3853),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]='llm:project:create';['description']=a29_0x2efbd4(0x231);async[a29_0x2efbd4(0x221)](_0xbe03d4){const _0x3fc8fb=a29_0x2efbd4,{options:_0x4e674f,args:_0x494228,tdx:_0x22ab42}=_0xbe03d4;if(_0x494228['length']===0x0)return console[_0x3fc8fb(0x1e7)](_0x3fc8fb(0x252)),console[_0x3fc8fb(0x1e7)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x27b234=_0x494228[0x0],_0x9fc38=_0x4e674f,_0x4ebd53=_0x9fc38[_0x3fc8fb(0x20d)];try{const _0x2f7d70=await withSpinner('Creating\x20project\x20\x27'+_0x27b234+_0x3fc8fb(0x2b3),()=>_0x22ab42[_0x3fc8fb(0x1da)]['createProject']({'name':_0x27b234,'description':_0x4ebd53}),{'verbose':_0x4e674f[_0x3fc8fb(0x22e)]});console[_0x3fc8fb(0x290)](_0x3fc8fb(0x1e2)+_0x2f7d70[_0x3fc8fb(0x262)]['id']);const _0x133c7d=toLLMProjectInfo(_0x2f7d70['data']);return await handleSDKOutput([_0x133c7d],_0x4e674f),0x0;}catch(_0x8eedc7){return handleSDKError(_0x8eedc7,_0x4e674f),0x1;}}}function a29_0x5d09(_0x2d652d,_0x42ee1a){_0x2d652d=_0x2d652d-0x1d6;const _0x1229ae=a29_0x1229();let _0x5d09a1=_0x1229ae[_0x2d652d];return _0x5d09a1;}export class LLMProjectDeleteCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x1e9);[a29_0x2efbd4(0x20d)]=a29_0x2efbd4(0x275);async[a29_0x2efbd4(0x221)](_0x3dcc83){const _0x45af3b=a29_0x2efbd4,{options:_0x44d3a6,args:_0x324547,tdx:_0x11ef4a}=_0x3dcc83;if(_0x324547['length']===0x0)return console[_0x45af3b(0x1e7)](_0x45af3b(0x252)),console['error'](_0x45af3b(0x223)),0x1;const _0x52ab5c=_0x324547[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x52ab5c+_0x45af3b(0x2b3),()=>_0x11ef4a[_0x45af3b(0x1da)][_0x45af3b(0x270)](_0x52ab5c),{'verbose':_0x44d3a6[_0x45af3b(0x22e)]}),console[_0x45af3b(0x290)](_0x45af3b(0x2b0)+_0x52ab5c),0x0;}catch(_0x5d0627){return handleSDKError(_0x5d0627,_0x44d3a6),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x280);[a29_0x2efbd4(0x20d)]=a29_0x2efbd4(0x1ff);async['execute'](_0x36ca0a){const _0x1b011e=a29_0x2efbd4,{options:_0x4be234,args:_0x5eb817,tdx:_0x453a4f}=_0x36ca0a,_0xff8abe=getChalk(_0x4be234);console['log'](_0xff8abe[_0x1b011e(0x235)](_0x1b011e(0x2a7))),console['log'](_0xff8abe[_0x1b011e(0x235)](_0x1b011e(0x2a1))),console[_0x1b011e(0x290)](_0xff8abe['dim'](_0x1b011e(0x286))),console['log']();if(_0x5eb817['length']===0x0)return console['error'](_0x1b011e(0x252)),console['error'](_0x1b011e(0x1e0)),0x1;const _0x51de2e=_0x5eb817[0x0],_0x154acb=_0x4be234,_0x6541c=_0x154acb[_0x1b011e(0x249)],_0x23c3ae=_0x154acb[_0x1b011e(0x233)];try{const _0x1658ed=_0x6541c||_0x51de2e+_0x1b011e(0x1de);if(a29_0x385cb6[_0x1b011e(0x297)](_0x1658ed)&&!_0x23c3ae){if(!_0x4be234[_0x1b011e(0x274)]){const _0x97ffe0=await confirm(_0x1b011e(0x200)+_0x1658ed+_0x1b011e(0x1e6));if(!_0x97ffe0)return console[_0x1b011e(0x290)]('Backup\x20cancelled.'),0x0;}a29_0x385cb6['rmSync'](_0x1658ed,{'recursive':!![]});}const _0x11cee0=await withSpinner(_0x23c3ae?'Analyzing\x20project\x20\x27'+_0x51de2e+_0x1b011e(0x2b3):_0x1b011e(0x271)+_0x51de2e+'\x27...',()=>_0x453a4f[_0x1b011e(0x1da)][_0x1b011e(0x2ad)](_0x51de2e,_0x6541c,{'dryRun':_0x23c3ae}),{'verbose':_0x4be234[_0x1b011e(0x22e)]}),_0x18db11=_0x11cee0[_0x1b011e(0x262)];return _0x23c3ae?console[_0x1b011e(0x290)](_0x1b011e(0x255)+_0x18db11[_0x1b011e(0x241)]):console['log']('Project\x20backed\x20up\x20to:\x20'+_0x18db11[_0x1b011e(0x241)]),console['log'](_0x1b011e(0x27d)+_0x18db11['counts'][_0x1b011e(0x23d)]),console[_0x1b011e(0x290)]('\x20\x20Knowledge\x20Bases:\x20'+_0x18db11[_0x1b011e(0x272)][_0x1b011e(0x20f)]),console['log'](_0x1b011e(0x2ab)+_0x18db11[_0x1b011e(0x272)]['prompts']),console[_0x1b011e(0x290)](_0x1b011e(0x203)+_0x18db11[_0x1b011e(0x272)][_0x1b011e(0x211)]),(_0x4be234[_0x1b011e(0x226)]===_0x1b011e(0x210)||_0x4be234[_0x1b011e(0x226)]===_0x1b011e(0x1f8))&&await handleSDKOutput([_0x18db11],_0x4be234),0x0;}catch(_0x1ed94d){return handleSDKError(_0x1ed94d,_0x4be234),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x1fe);['description']=a29_0x2efbd4(0x24b);async['execute'](_0x369a8c){const _0x5c59d9=a29_0x2efbd4,{options:_0x3521d6,args:_0x47de0e,tdx:_0xac5152}=_0x369a8c,_0x599f8c=getChalk(_0x3521d6);console['log'](_0x599f8c[_0x5c59d9(0x235)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.')),console[_0x5c59d9(0x290)](_0x599f8c[_0x5c59d9(0x235)](_0x5c59d9(0x288))),console['log'](_0x599f8c[_0x5c59d9(0x27e)]('\x20\x20\x20Examples:')),console['log'](_0x599f8c['dim'](_0x5c59d9(0x240))),console[_0x5c59d9(0x290)](_0x599f8c['dim']('\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22')),console[_0x5c59d9(0x290)]();if(_0x47de0e[_0x5c59d9(0x239)]===0x0)return console[_0x5c59d9(0x1e7)](_0x5c59d9(0x1f3)),console[_0x5c59d9(0x1e7)](_0x5c59d9(0x244)),0x1;const _0x3c503b=_0x47de0e[0x0],_0x21b871=_0x3521d6,_0x1be2fe=_0x21b871[_0x5c59d9(0x1f2)],_0x488976=_0x21b871[_0x5c59d9(0x233)];try{if(!_0x488976){const _0x3637b9=_0xac5152['llm'][_0x5c59d9(0x1ed)](_0x3c503b),_0x577bb9=_0x1be2fe||_0x3637b9['exportedFrom']['projectName'],_0x44061b=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0xac5152[_0x5c59d9(0x1da)]['projects'](),{'verbose':_0x3521d6[_0x5c59d9(0x22e)]}),_0x4f03eb=_0x44061b[_0x5c59d9(0x262)]['find'](_0x3a36a2=>_0x3a36a2['attributes']['name']===_0x577bb9);if(_0x4f03eb&&!_0x3521d6[_0x5c59d9(0x274)]){const _0x23318e=await confirm(_0x5c59d9(0x29e)+_0x577bb9+_0x5c59d9(0x25a));if(!_0x23318e)return console[_0x5c59d9(0x290)](_0x5c59d9(0x24f)),0x0;}}const _0x38f28b=await withSpinner(_0x488976?_0x5c59d9(0x1dc)+_0x3c503b+'\x27...':_0x5c59d9(0x1fd)+_0x3c503b+_0x5c59d9(0x2b3),()=>_0xac5152[_0x5c59d9(0x1da)]['restoreProject'](_0x3c503b,{'name':_0x1be2fe,'dryRun':_0x488976}),{'verbose':_0x3521d6[_0x5c59d9(0x22e)]}),_0x3f0d11=_0x38f28b[_0x5c59d9(0x262)];return _0x3f0d11[_0x5c59d9(0x1eb)]&&console['log'](_0x5c59d9(0x24d)+_0x3f0d11[_0x5c59d9(0x1eb)]+'\x27'),_0x488976?console[_0x5c59d9(0x290)](_0x5c59d9(0x260)+_0x3f0d11[_0x5c59d9(0x26c)]):console['log'](_0x5c59d9(0x22c)+_0x3f0d11[_0x5c59d9(0x26c)]+'\x20('+_0x3f0d11['projectId']+')'),console['log'](_0x5c59d9(0x27d)+_0x3f0d11[_0x5c59d9(0x272)][_0x5c59d9(0x23d)]),console['log'](_0x5c59d9(0x1f9)+_0x3f0d11[_0x5c59d9(0x272)]['knowledgeBases']),console[_0x5c59d9(0x290)]('\x20\x20Prompts:\x20'+_0x3f0d11['counts'][_0x5c59d9(0x2a2)]),console['log'](_0x5c59d9(0x203)+_0x3f0d11[_0x5c59d9(0x272)]['integrations']),(_0x3521d6[_0x5c59d9(0x226)]===_0x5c59d9(0x210)||_0x3521d6['format']===_0x5c59d9(0x1f8))&&await handleSDKOutput([_0x3f0d11],_0x3521d6),0x0;}catch(_0x3ae8ac){return handleSDKError(_0x3ae8ac,_0x3521d6),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x496ea2,_0x193226){const _0x1b6bf6=a29_0x2efbd4,_0x5cd221=_0x193226[_0x1b6bf6(0x237)]||CHAT_SELECTOR_PAGE_SIZE;let _0x58adb9=0x0,_0x2d4a2c=[];const _0x423a66=(await import(_0x1b6bf6(0x2a2)))[_0x1b6bf6(0x23c)],_0x57a320=getChalk(_0x193226);while(!![]){const _0x400284=await withSpinner(_0x1b6bf6(0x28d),()=>_0x496ea2[_0x1b6bf6(0x1da)][_0x1b6bf6(0x21a)](_0x5cd221+_0x58adb9),{'verbose':_0x193226[_0x1b6bf6(0x22e)]});_0x2d4a2c=_0x400284['data'];const _0x5d3c4f=_0x2d4a2c['slice'](_0x58adb9,_0x58adb9+_0x5cd221),_0x250039=_0x2d4a2c[_0x1b6bf6(0x239)]>_0x58adb9+_0x5cd221,_0x419a3b=[...new Set(_0x5d3c4f[_0x1b6bf6(0x236)](_0x8c354f=>_0x8c354f[_0x1b6bf6(0x246)]['agentId'])[_0x1b6bf6(0x28a)](_0x52cae4=>_0x52cae4!==undefined))],_0x5ef17d=new Map();await Promise[_0x1b6bf6(0x1e3)](_0x419a3b[_0x1b6bf6(0x236)](async _0x50b99c=>{const _0x4c501b=_0x1b6bf6;try{const _0x204613=await _0x496ea2[_0x4c501b(0x1da)][_0x4c501b(0x28c)](_0x50b99c);_0x5ef17d[_0x4c501b(0x24c)](_0x50b99c,_0x204613['attributes']['name']);}catch{_0x5ef17d['set'](_0x50b99c,_0x50b99c);}}));const _0x1e9141=_0x5d3c4f[_0x1b6bf6(0x236)](_0x3566c8=>{const _0x27a275=_0x1b6bf6,_0x5810cf=_0x3566c8[_0x27a275(0x246)]['firstInputContent']||_0x27a275(0x21b),_0x2281b1=_0x5810cf[_0x27a275(0x1f5)]('\x0a')[0x0],_0x548d77=_0x2281b1['length']>0x50?_0x2281b1[_0x27a275(0x2b4)](0x0,0x4d)+_0x27a275(0x263):_0x2281b1,_0x1d0cec=_0x3566c8['attributes']['agentId']?_0x5ef17d[_0x27a275(0x21f)](_0x3566c8['attributes'][_0x27a275(0x228)])||_0x3566c8[_0x27a275(0x246)][_0x27a275(0x228)]:_0x27a275(0x259),_0x44510e=_0x3566c8[_0x27a275(0x246)][_0x27a275(0x224)]||_0x3566c8[_0x27a275(0x246)][_0x27a275(0x29f)],_0x774928=new Date(_0x44510e),_0xe8fef6=new Date(),_0x19eb22=_0xe8fef6[_0x27a275(0x298)]()-_0x774928['getTime'](),_0x541b94=Math[_0x27a275(0x1f7)](_0x19eb22/0xea60),_0x58e575=Math[_0x27a275(0x1f7)](_0x19eb22/0x36ee80),_0x3b884a=Math[_0x27a275(0x1f7)](_0x19eb22/0x5265c00);let _0x126169;if(_0x541b94<0x1)_0x126169='just\x20now';else{if(_0x541b94<0x3c)_0x126169=_0x541b94+_0x27a275(0x21c);else{if(_0x58e575<0x18)_0x126169=_0x58e575+_0x27a275(0x276);else _0x3b884a<0x7?_0x126169=_0x3b884a+_0x27a275(0x2b5):_0x126169=_0x774928['toLocaleDateString'](_0x27a275(0x2b2),{'month':_0x27a275(0x22d),'day':_0x27a275(0x268)});}}return{'title':_0x548d77+'\x20'+_0x57a320['dim']('['+_0x1d0cec+']\x20'+_0x126169),'value':_0x3566c8['id']};});_0x250039&&_0x1e9141[_0x1b6bf6(0x2a0)]({'title':_0x57a320[_0x1b6bf6(0x1f1)]('Load\x20more...'),'value':'__load_more__'});const _0x5eeaa5=await _0x423a66({'type':_0x1b6bf6(0x25b),'name':_0x1b6bf6(0x2aa),'message':'Select\x20a\x20chat\x20session:','choices':_0x1e9141,'hint':_0x1b6bf6(0x284)});if(!_0x5eeaa5[_0x1b6bf6(0x2aa)])return undefined;if(_0x5eeaa5[_0x1b6bf6(0x2aa)]===_0x1b6bf6(0x292)){_0x58adb9+=_0x5cd221;continue;}return _0x5eeaa5[_0x1b6bf6(0x2aa)];}}export class ChatsCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]='chats';[a29_0x2efbd4(0x20d)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a29_0x2efbd4(0x221)](_0x213af0){return executeChatHistoryCommand(_0x213af0,'tdx\x20chats');}}export class LLMLogCommand extends BaseCommand{[a29_0x2efbd4(0x1f2)]=a29_0x2efbd4(0x28e);['description']=a29_0x2efbd4(0x25c);async['execute'](_0x14f6c5){const _0x1e0f7e=a29_0x2efbd4,{options:_0xb7f09,args:_0x4bbfb5,tdx:_0x5bc458}=_0x14f6c5,_0x5a5419=_0x4bbfb5[0x0];if(!_0x5a5419)return console[_0x1e0f7e(0x1e7)](_0x1e0f7e(0x25e)),console[_0x1e0f7e(0x1e7)]('Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>'),0x1;const _0x71e45=await withSpinner(_0x1e0f7e(0x1f0)+_0x5a5419+_0x1e0f7e(0x2b3),()=>_0x5bc458['llm'][_0x1e0f7e(0x204)](_0x5a5419),{'verbose':_0xb7f09[_0x1e0f7e(0x22e)]});return await handleSDKOutput(_0x71e45[_0x1e0f7e(0x262)][_0x1e0f7e(0x262)],_0xb7f09),0x0;}}
@@ -1 +1 @@
1
- const a30_0x20b66e=a30_0x2fb5;function a30_0x5d15(){const _0x2c61ad=['context','492530JtQOsu','44277030bQwbWc','TDX_PROFILE','55305ffbBYd','MCP\x20server\x20error:\x20','711662qWosTm','TDX_ACCESS_TOKEN','accessToken','529935XmnbbH','4023080jsJTwR','error','name','1472QaDNyf','execute','description','apiKey','TDX_API_KEY','mcp','11KnhIcr','profile','site','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','3KWkemC','18tTfDCl','TDX_SITE','966457nVZMYS'];a30_0x5d15=function(){return _0x2c61ad;};return a30_0x5d15();}(function(_0x26cc14,_0x3db0eb){const _0x3a0c37=a30_0x2fb5,_0x4428a6=_0x26cc14();while(!![]){try{const _0x5044e1=-parseInt(_0x3a0c37(0xaf))/0x1+parseInt(_0x3a0c37(0xb1))/0x2*(-parseInt(_0x3a0c37(0xc7))/0x3)+-parseInt(_0x3a0c37(0xba))/0x4+-parseInt(_0x3a0c37(0xb9))/0x5+parseInt(_0x3a0c37(0xc8))/0x6*(-parseInt(_0x3a0c37(0xb6))/0x7)+-parseInt(_0x3a0c37(0xbd))/0x8*(parseInt(_0x3a0c37(0xb4))/0x9)+parseInt(_0x3a0c37(0xb2))/0xa*(parseInt(_0x3a0c37(0xc3))/0xb);if(_0x5044e1===_0x3db0eb)break;else _0x4428a6['push'](_0x4428a6['shift']());}catch(_0x3e45d6){_0x4428a6['push'](_0x4428a6['shift']());}}}(a30_0x5d15,0xa2f9a));import{BaseCommand}from'./command.js';function a30_0x2fb5(_0x3b242f,_0x12b8a6){_0x3b242f=_0x3b242f-0xaf;const _0x5d15de=a30_0x5d15();let _0x2fb53a=_0x5d15de[_0x3b242f];return _0x2fb53a;}export class MCPCommand extends BaseCommand{[a30_0x20b66e(0xbc)]=a30_0x20b66e(0xc2);[a30_0x20b66e(0xbf)]=a30_0x20b66e(0xc6);async[a30_0x20b66e(0xbe)](_0x2a63b){const _0x33b2e9=a30_0x20b66e,{tdx:_0x48ce97}=_0x2a63b,_0x368b52={};if(process.env.TDX_PROFILE)_0x368b52[_0x33b2e9(0xb3)]=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x368b52['TDX_API_KEY']=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x368b52[_0x33b2e9(0xc9)]=process.env.TDX_SITE);else{if(_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xb8)])_0x368b52[_0x33b2e9(0xb7)]=_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xb8)],_0x368b52[_0x33b2e9(0xc9)]=_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xc5)];else _0x48ce97[_0x33b2e9(0xb0)]['apiKey']&&(_0x368b52[_0x33b2e9(0xc1)]=_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xc0)],_0x368b52[_0x33b2e9(0xc9)]=_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xc5)]);}}_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xc4)]&&(_0x368b52[_0x33b2e9(0xb3)]=_0x48ce97[_0x33b2e9(0xb0)][_0x33b2e9(0xc4)]);try{const {startMCPServer:_0x1e1a31}=await import('../mcp/server.js');return await _0x1e1a31({'env':_0x368b52}),0x0;}catch(_0x2277eb){const _0x4b87c5=_0x2277eb instanceof Error?_0x2277eb['message']:String(_0x2277eb);return console[_0x33b2e9(0xbb)](_0x33b2e9(0xb5)+_0x4b87c5),0x1;}}}
1
+ const a30_0x12fd67=a30_0x445d;(function(_0x3ecf94,_0x106bee){const _0x47731c=a30_0x445d,_0x1e5413=_0x3ecf94();while(!![]){try{const _0x2b5b19=parseInt(_0x47731c(0x1da))/0x1*(parseInt(_0x47731c(0x1d2))/0x2)+parseInt(_0x47731c(0x1e6))/0x3*(parseInt(_0x47731c(0x1d3))/0x4)+-parseInt(_0x47731c(0x1eb))/0x5+parseInt(_0x47731c(0x1d1))/0x6*(parseInt(_0x47731c(0x1e2))/0x7)+-parseInt(_0x47731c(0x1dd))/0x8*(-parseInt(_0x47731c(0x1e5))/0x9)+parseInt(_0x47731c(0x1e1))/0xa*(-parseInt(_0x47731c(0x1db))/0xb)+-parseInt(_0x47731c(0x1ec))/0xc;if(_0x2b5b19===_0x106bee)break;else _0x1e5413['push'](_0x1e5413['shift']());}catch(_0x260d10){_0x1e5413['push'](_0x1e5413['shift']());}}}(a30_0x1041,0xa0990));import{BaseCommand}from'./command.js';function a30_0x445d(_0x1484fa,_0x41c484){_0x1484fa=_0x1484fa-0x1d1;const _0x1041bb=a30_0x1041();let _0x445d2a=_0x1041bb[_0x1484fa];return _0x445d2a;}export class MCPCommand extends BaseCommand{[a30_0x12fd67(0x1d8)]=a30_0x12fd67(0x1e3);[a30_0x12fd67(0x1e0)]=a30_0x12fd67(0x1d4);async[a30_0x12fd67(0x1d5)](_0x3f0eda){const _0x13f47b=a30_0x12fd67,{tdx:_0x3d8382}=_0x3f0eda,_0x21ce4b={};if(process.env.TDX_PROFILE)_0x21ce4b['TDX_PROFILE']=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x21ce4b[_0x13f47b(0x1d7)]=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x21ce4b['TDX_SITE']=process.env.TDX_SITE);else{if(_0x3d8382['context'][_0x13f47b(0x1e4)])_0x21ce4b[_0x13f47b(0x1e7)]=_0x3d8382[_0x13f47b(0x1d6)]['accessToken'],_0x21ce4b['TDX_SITE']=_0x3d8382[_0x13f47b(0x1d6)][_0x13f47b(0x1e9)];else _0x3d8382[_0x13f47b(0x1d6)][_0x13f47b(0x1dc)]&&(_0x21ce4b[_0x13f47b(0x1d7)]=_0x3d8382[_0x13f47b(0x1d6)][_0x13f47b(0x1dc)],_0x21ce4b['TDX_SITE']=_0x3d8382['context'][_0x13f47b(0x1e9)]);}}_0x3d8382['context'][_0x13f47b(0x1ea)]&&(_0x21ce4b[_0x13f47b(0x1d9)]=_0x3d8382[_0x13f47b(0x1d6)][_0x13f47b(0x1ea)]);try{const {startMCPServer:_0x1090b}=await import('../mcp/server.js');return await _0x1090b({'env':_0x21ce4b}),0x0;}catch(_0x308d6d){const _0x1252a5=_0x308d6d instanceof Error?_0x308d6d[_0x13f47b(0x1e8)]:String(_0x308d6d);return console[_0x13f47b(0x1de)](_0x13f47b(0x1df)+_0x1252a5),0x1;}}}function a30_0x1041(){const _0x3c0dd8=['description','20PQTEdg','4802TJzpQv','mcp','accessToken','8303157ZVabmJ','3PpOXZM','TDX_ACCESS_TOKEN','message','site','profile','4152045MKDTol','18046992xggstq','8034NpheJb','6rRmYoN','1479596nrkYVX','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','execute','context','TDX_API_KEY','name','TDX_PROFILE','339207wmiuId','1300827kxjpoa','apiKey','8YsEHim','error','MCP\x20server\x20error:\x20'];a30_0x1041=function(){return _0x3c0dd8;};return a30_0x1041();}