@treasuredata/tdx 2026.3.31 → 2026.3.32

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 (256) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.d.ts +36 -0
  61. package/dist/commands/work-command.d.ts.map +1 -0
  62. package/dist/commands/work-command.js +1 -0
  63. package/dist/commands/work-command.js.map +1 -0
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.js +1 -1
  75. package/dist/core/profile.js +1 -1
  76. package/dist/core/project-config.d.ts +2 -0
  77. package/dist/core/project-config.d.ts.map +1 -1
  78. package/dist/core/project-config.js +1 -1
  79. package/dist/core/project-config.js.map +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/utils.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js +1 -1
  90. package/dist/proxy/passthrough-server.js +1 -1
  91. package/dist/proxy/sse-usage-parser.js +1 -1
  92. package/dist/sdk/agent/agent-config.js +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.js +1 -1
  95. package/dist/sdk/agent/test/evaluator.js +1 -1
  96. package/dist/sdk/agent/test/executor.js +1 -1
  97. package/dist/sdk/agent/test/index.js +1 -1
  98. package/dist/sdk/agent/test/output.js +1 -1
  99. package/dist/sdk/agent/test/parser.js +1 -1
  100. package/dist/sdk/agent/tool-target-registry.js +1 -1
  101. package/dist/sdk/api.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js +1 -1
  103. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  104. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  105. package/dist/sdk/cas/index.js +1 -1
  106. package/dist/sdk/cas/pull-workflow.js +1 -1
  107. package/dist/sdk/cas/push-workflow.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/oauth-refresh.js +1 -1
  115. package/dist/sdk/client/rate-limiter.js +1 -1
  116. package/dist/sdk/client/td-api-client.js +1 -1
  117. package/dist/sdk/client/trino-api-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.d.ts +1 -0
  136. package/dist/sdk/index.d.ts.map +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/index.js.map +1 -1
  139. package/dist/sdk/io/index.js +1 -1
  140. package/dist/sdk/io/node-filesystem.js +1 -1
  141. package/dist/sdk/job.js +1 -1
  142. package/dist/sdk/journey.js +1 -1
  143. package/dist/sdk/llm/chat-cache.js +1 -1
  144. package/dist/sdk/llm/index.js +1 -1
  145. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  146. package/dist/sdk/llm/model-factors.js +1 -1
  147. package/dist/sdk/personalization.js +1 -1
  148. package/dist/sdk/policy.js +1 -1
  149. package/dist/sdk/query/index.js +1 -1
  150. package/dist/sdk/query/sql-parser.js +1 -1
  151. package/dist/sdk/realtime.js +1 -1
  152. package/dist/sdk/schedule.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.js +1 -1
  164. package/dist/sdk/segment/resolution-context.js +1 -1
  165. package/dist/sdk/segment/segment-path-parser.js +1 -1
  166. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  167. package/dist/sdk/segment/segment-validator.js +1 -1
  168. package/dist/sdk/segment/target-resolution.js +1 -1
  169. package/dist/sdk/segment/tdx-config.js +1 -1
  170. package/dist/sdk/segment/types/activation-schema.js +1 -1
  171. package/dist/sdk/segment/types/journey-def.js +1 -1
  172. package/dist/sdk/segment/types/journey-schema.js +1 -1
  173. package/dist/sdk/segment/types/segment-def.js +1 -1
  174. package/dist/sdk/segment/types/segment-schema.js +1 -1
  175. package/dist/sdk/segment/validate-files.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/index.d.ts +2 -0
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/types/workspace.d.ts +146 -0
  184. package/dist/sdk/types/workspace.d.ts.map +1 -0
  185. package/dist/sdk/types/workspace.js +1 -0
  186. package/dist/sdk/types/workspace.js.map +1 -0
  187. package/dist/sdk/user.js +1 -1
  188. package/dist/sdk/util/format-detector.js +1 -1
  189. package/dist/sdk/util/formatters.js +1 -1
  190. package/dist/sdk/util/index.js +1 -1
  191. package/dist/sdk/util/paginate.js +1 -1
  192. package/dist/sdk/util/tree-formatter.js +1 -1
  193. package/dist/sdk/workflow/archive-validation.js +1 -1
  194. package/dist/sdk/workflow/clone-workflow.js +1 -1
  195. package/dist/sdk/workflow/index.js +1 -1
  196. package/dist/sdk/workflow/pull-workflow.js +1 -1
  197. package/dist/sdk/workflow/push-workflow.js +1 -1
  198. package/dist/sdk/workflow/tdx-config.js +1 -1
  199. package/dist/sdk/workflow/workflow-utils.js +1 -1
  200. package/dist/sdk/workspace/frontmatter.d.ts +28 -0
  201. package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
  202. package/dist/sdk/workspace/frontmatter.js +1 -0
  203. package/dist/sdk/workspace/frontmatter.js.map +1 -0
  204. package/dist/sdk/workspace/git.d.ts +55 -0
  205. package/dist/sdk/workspace/git.d.ts.map +1 -0
  206. package/dist/sdk/workspace/git.js +1 -0
  207. package/dist/sdk/workspace/git.js.map +1 -0
  208. package/dist/sdk/workspace/index.d.ts +149 -0
  209. package/dist/sdk/workspace/index.d.ts.map +1 -0
  210. package/dist/sdk/workspace/index.js +1 -0
  211. package/dist/sdk/workspace/index.js.map +1 -0
  212. package/dist/sdk/workspace/skills.d.ts +34 -0
  213. package/dist/sdk/workspace/skills.d.ts.map +1 -0
  214. package/dist/sdk/workspace/skills.js +1 -0
  215. package/dist/sdk/workspace/skills.js.map +1 -0
  216. package/dist/sdk/workspace/templates.d.ts +17 -0
  217. package/dist/sdk/workspace/templates.d.ts.map +1 -0
  218. package/dist/sdk/workspace/templates.js +1 -0
  219. package/dist/sdk/workspace/templates.js.map +1 -0
  220. package/dist/sdk/workspace/wikilinks.d.ts +44 -0
  221. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
  222. package/dist/sdk/workspace/wikilinks.js +1 -0
  223. package/dist/sdk/workspace/wikilinks.js.map +1 -0
  224. package/dist/test-utils/command-runner.js +1 -1
  225. package/dist/test-utils/factories.js +1 -1
  226. package/dist/test-utils/fixtures.js +1 -1
  227. package/dist/test-utils/http-mock.js +1 -1
  228. package/dist/test-utils/index.js +1 -1
  229. package/dist/utils/async.js +1 -1
  230. package/dist/utils/colors.js +1 -1
  231. package/dist/utils/diff.js +1 -1
  232. package/dist/utils/file-permissions.js +1 -1
  233. package/dist/utils/file-reader.js +1 -1
  234. package/dist/utils/github-releases.js +1 -1
  235. package/dist/utils/global-cache.js +1 -1
  236. package/dist/utils/json-loader.js +1 -1
  237. package/dist/utils/local-cache.js +1 -1
  238. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  239. package/dist/utils/logger/formatters/index.js +1 -1
  240. package/dist/utils/logger/handlers/console-handler.js +1 -1
  241. package/dist/utils/logger/handlers/file-handler.js +1 -1
  242. package/dist/utils/logger/handlers/index.js +1 -1
  243. package/dist/utils/logger/handlers/null-handler.js +1 -1
  244. package/dist/utils/logger/index.js +1 -1
  245. package/dist/utils/logger/logger.js +1 -1
  246. package/dist/utils/logger/types.js +1 -1
  247. package/dist/utils/option-validation.js +1 -1
  248. package/dist/utils/process.js +1 -1
  249. package/dist/utils/prompt.js +1 -1
  250. package/dist/utils/spinner.js +1 -1
  251. package/dist/utils/sse-parser.js +1 -1
  252. package/dist/utils/string-utils.js +1 -1
  253. package/dist/utils/table-ref-parser.js +1 -1
  254. package/dist/utils/tdx-logger.js +1 -1
  255. package/dist/utils/version-check.js +1 -1
  256. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x31a965=a30_0x36e7;(function(_0x3633b0,_0x3e91e1){const _0x4b9e78=a30_0x36e7,_0x252c95=_0x3633b0();while(!![]){try{const _0x3e9621=parseInt(_0x4b9e78(0x1d3))/0x1*(-parseInt(_0x4b9e78(0x12f))/0x2)+parseInt(_0x4b9e78(0x1bc))/0x3*(parseInt(_0x4b9e78(0x171))/0x4)+-parseInt(_0x4b9e78(0x125))/0x5+parseInt(_0x4b9e78(0x166))/0x6*(-parseInt(_0x4b9e78(0x144))/0x7)+parseInt(_0x4b9e78(0x173))/0x8+-parseInt(_0x4b9e78(0x1c9))/0x9*(parseInt(_0x4b9e78(0x165))/0xa)+parseInt(_0x4b9e78(0x123))/0xb;if(_0x3e9621===_0x3e91e1)break;else _0x252c95['push'](_0x252c95['shift']());}catch(_0x168181){_0x252c95['push'](_0x252c95['shift']());}}}(a30_0x5d0f,0x1c1d1));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';function a30_0x5d0f(){const _0x5149ab=['description','Deleting\x20project\x20\x27','projectName','m\x20ago','log','deleteAgent','409200DDzApP','6846RVgfHi','llm:models','No\x20messages\x20found\x20in\x20chat\x20history.','Fetching\x20agents...','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','getChatLog','No\x20agents\x20found','getBackupMetadata','updatedAt','agentId','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','172hiGWDg','\x27...','420024FcxdKQ','toLocaleDateString','llm:agent:update','Create\x20a\x20new\x20LLM\x20project','history','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20\x20Knowledge\x20Bases:\x20','targetAgent','string','Error:\x20','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','List\x20available\x20LLM\x20models','site','json','numeric','getTime','Fetching\x20most\x20recent\x20chat...','\x20\x20Prompts:\x20','blue','outputDir','(no\x20agent)','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Unknown','Resolving\x20project\x20\x27','.llm','...','deleteProject','model','sourceSite','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','table','Creating\x20project\x20\x27','llm:agent:delete','error','split','resolveProjectId','Project\x20deleted:\x20','chatId','\x20\x20Integrations:\x20','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','\x20->\x20Agent:','Checking\x20for\x20existing\x20projects...','Agent\x20created:\x20','llmProject','Validating\x20backup\x20from\x20\x27','tsv','tool','No\x20chat\x20sessions\x20found.','image','Deleting\x20agent...','projectId','createProject','Restore\x20cancelled.','llm:projects','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','INVALID_ARGUMENT','Delete\x20an\x20agent','getOrCreateDefaultProject','\x27\x20already\x20exists.\x20Overwrite?','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Error:\x20Agent\x20name\x20is\x20required','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','short','LLM_PROJECT_NOT_FOUND','verbose','\x20bytes)','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','backupProject','Fetching\x20projects...','llm','\x20\x20Agents:\x20','Setting\x20project\x20context\x20to\x20\x27','12426oUrIyc','\x20->\x20ImageGen:','substring','Select\x20a\x20chat\x20session:','Session\x20llm_project\x20set\x20to:\x20','[unknown]','data','Backup\x20cancelled.','maxToolIterations','yellow','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','\x20--last','prompt','45dJcnbZ','slice','updateAgent','[tool]\x20\x20\x20','find','limit','llm:project:backup','(no\x20message)','Fetching\x20chat\x20history\x20for\x20\x27','__load_more__','1bemUdl','push','[input]\x20\x20','toLowerCase','get','jsonl','content','Analyzing\x20project\x20\x27','llm:agents','llm:project:create','Show\x20agent\x20details','cyan','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Error:\x20Project\x20name\x20is\x20required','chats','knowledgeBases','counts','models','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','dryRun','Set\x20current\x20project\x20context','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Updating\x20agent...','Fetching\x20chat\x20sessions...','join','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','floor','\x0aCancelled','Project\x20created:\x20','targetKnowledgeBase','firstInputContent','filter','name','resolveAgentId','format','exportedFrom','Fetching\x20chat\x20log\x20for\x20\x27','cause','sort','default','h\x20ago','prompts','agents','execute','tdx\x20llm\x20history','existsSync','localeCompare','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','6643241amydHw','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','854135QfuVLK','input','Getting\x20default\x20project...','getCurrentProject','entries','\x0aStack\x20trace:','Resolving\x20agent\x20\x27','[image]\x20\x20','stack','output','430054hwpmYz','restoreProject','Project\x20not\x20found:\x20','\x20→\x20chat:\x20','bold','[error]\x20\x20','message','agent','includes','Load\x20more...','[output]\x20','projects','Backing\x20up\x20project\x20\x27','[tool_call]','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','createdAt','magenta','targetImageGenerator','red','stringify','\x20-\x20','791ByXmkF','llm:log','⚒️\x20','length','all','Agent\x20deleted:\x20','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','dim','targetWebSearchTool','integrations','\x20agent(s)','yes','session','Output\x20directory\x20\x27','tool_call','Error:\x20chat-id\x20is\x20required','map','en-US','llm:history','Invalid\x20path\x20syntax:\x20','attributes','temperature','List\x20agents\x20in\x20current\x20project','starterMessage','Use\x20format:\x20project-name/agent-name','green','A\x20project\x20named\x20\x27'];a30_0x5d0f=function(){return _0x5149ab;};return a30_0x5d0f();}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 a30_0x5f2345 from'node:fs';function handleSDKError(_0x325f1f,_0x30ee63){const _0x338678=a30_0x36e7;if(_0x325f1f instanceof SDKError)console[_0x338678(0x194)](_0x338678(0x17c)+_0x325f1f[_0x338678(0x135)]),_0x30ee63['verbose']&&(_0x325f1f[_0x338678(0x118)]&&console[_0x338678(0x194)]('\x20\x20Cause:\x20'+_0x325f1f[_0x338678(0x118)]),_0x325f1f[_0x338678(0x12d)]&&(console['error'](_0x338678(0x12a)),console[_0x338678(0x194)](_0x325f1f['stack'])));else throw _0x325f1f;}function formatChatHistoryEntry(_0x55c825,_0x5ad387){const _0x5d4524=a30_0x36e7,_0x362fd5=getChalk(_0x5ad387),_0x4ef47e=_0x362fd5[_0x5d4524(0x14b)](_0x55c825['at']);if('input'in _0x55c825){const _0x384880=_0x362fd5[_0x5d4524(0xfd)](_0x5d4524(0x1d5));return _0x4ef47e+'\x20'+_0x384880+':\x20'+_0x55c825[_0x5d4524(0x126)];}if(_0x5d4524(0xf8)in _0x55c825){const _0x2bf4c1=_0x362fd5[_0x5d4524(0x15d)]('[content]');return _0x4ef47e+'\x20'+_0x2bf4c1+':\x20'+_0x55c825['content'];}if(_0x5d4524(0x152)in _0x55c825){const _0x9f96f3=_0x362fd5[_0x5d4524(0x1c5)](_0x5d4524(0x13c)),{functionName:_0x110df7,functionArguments:_0x192c18,targetFunction:_0x435b64}=_0x55c825[_0x5d4524(0x152)];let _0x32aa45=_0x4ef47e+'\x20'+_0x9f96f3+':\x20'+_0x362fd5[_0x5d4524(0x133)](_0x110df7);if(_0x192c18&&Object['keys'](_0x192c18)[_0x5d4524(0x147)]>0x0){const _0x34e9f7=Object[_0x5d4524(0x129)](_0x192c18)[_0x5d4524(0x154)](([_0x16d320,_0x53ebbf])=>_0x16d320+'='+JSON[_0x5d4524(0x142)](_0x53ebbf))[_0x5d4524(0x10b)](',\x20');_0x32aa45+='('+_0x34e9f7+')';}_0x435b64&&(_0x32aa45+=_0x362fd5[_0x5d4524(0x14b)]('\x20['+_0x435b64+']'));let _0x4824e6='';if(_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x110)])_0x4824e6='\x20->\x20KB:'+_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x110)][_0x5d4524(0x113)];else{if(_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x17a)])_0x4824e6=_0x5d4524(0x19b)+_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x17a)]['name'];else{if(_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x14c)])_0x4824e6='\x20->\x20WebSearch:'+_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x14c)]['name'];else _0x55c825[_0x5d4524(0x152)][_0x5d4524(0x140)]&&(_0x4824e6=_0x5d4524(0x1bd)+_0x55c825[_0x5d4524(0x152)][_0x5d4524(0x140)][_0x5d4524(0x113)]);}}return _0x32aa45+_0x4824e6;}if(_0x5d4524(0x1a1)in _0x55c825){const _0x3eba3c=_0x362fd5[_0x5d4524(0x13f)](_0x5d4524(0x1cc)),{functionName:_0x522106,functionArguments:_0x3a9c7b,content:_0x2097ac,newChat:_0x124dc9}=_0x55c825[_0x5d4524(0x1a1)];let _0x1a1ec6=_0x4ef47e+'\x20'+_0x3eba3c+':\x20'+_0x362fd5[_0x5d4524(0x133)](_0x522106);if(_0x3a9c7b){const _0x1a514b=typeof _0x3a9c7b===_0x5d4524(0x17b)?_0x3a9c7b:JSON[_0x5d4524(0x142)](_0x3a9c7b);_0x1a1ec6+='('+_0x1a514b+')';}return _0x2097ac&&(_0x1a1ec6+='\x0a'+_0x362fd5[_0x5d4524(0x14b)](_0x2097ac)),_0x124dc9&&(_0x1a1ec6+=_0x362fd5[_0x5d4524(0x14b)](_0x5d4524(0x132)+_0x124dc9['id'])),_0x1a1ec6;}if(_0x5d4524(0x12e)in _0x55c825){const _0x44dd7b=_0x362fd5[_0x5d4524(0x185)](_0x5d4524(0x139));return _0x4ef47e+'\x20'+_0x44dd7b+':\x20'+_0x55c825[_0x5d4524(0x12e)][_0x5d4524(0x113)]+'\x20('+_0x55c825[_0x5d4524(0x12e)]['content'][_0x5d4524(0x147)]+_0x5d4524(0x1b5);}if('image'in _0x55c825){const _0x1bae1a=_0x362fd5[_0x5d4524(0x185)](_0x5d4524(0x12c)),{width:_0x774105,height:_0xcb63b4,headerText:_0x589229}=_0x55c825[_0x5d4524(0x1a3)],_0x391912=_0x589229?_0x5d4524(0x143)+_0x589229:'';return _0x4ef47e+'\x20'+_0x1bae1a+':\x20'+_0x774105+'x'+_0xcb63b4+_0x391912;}if(_0x5d4524(0x194)in _0x55c825){const _0x10e9af=_0x362fd5[_0x5d4524(0x141)](_0x5d4524(0x134));return _0x4ef47e+'\x20'+_0x10e9af+':\x20'+_0x55c825[_0x5d4524(0x194)];}return _0x4ef47e+'\x20'+_0x362fd5[_0x5d4524(0x14b)](_0x5d4524(0x1c1))+':\x20'+JSON[_0x5d4524(0x142)](_0x55c825);}async function executeChatHistoryCommand(_0x1ce25e,_0x1a7ab7){const _0xc9c779=a30_0x36e7,{options:_0x16a124,args:_0xa79742,tdx:_0x10a779}=_0x1ce25e,_0x30fc15=_0xa79742[0x0],_0x590ec2=_0x16a124,_0x9d0b79=_0x590ec2['last'];try{if(_0x9d0b79&&_0x30fc15)return console[_0xc9c779(0x194)](_0xc9c779(0x1c6)),console[_0xc9c779(0x194)]('Usage:\x20'+_0x1a7ab7+_0xc9c779(0x1c7)),0x1;if(!_0x30fc15&&!_0x9d0b79&&_0x16a124[_0xc9c779(0x115)]!==undefined){const _0x2cc35f=resolveLimit(_0x16a124[_0xc9c779(0x1ce)],DEFAULT_LLM_LIMIT),_0x3095f0=await withSpinner(_0xc9c779(0x10a),()=>_0x10a779['llm'][_0xc9c779(0x100)](_0x2cc35f),{'verbose':_0x16a124[_0xc9c779(0x1b4)]});return await handleSDKOutput(_0x3095f0['data'],_0x16a124),0x0;}const _0x4f8d65=await getChatIdOrSelect(_0x10a779,_0x16a124,_0x9d0b79,_0x30fc15);if(!_0x4f8d65)return 0x0;return await displayChatHistory(_0x4f8d65,_0x10a779,_0x16a124),0x0;}catch(_0x54f6b7){return handleSDKError(_0x54f6b7,_0x16a124),0x1;}}async function displayChatHistory(_0x59c0d9,_0x1e2b6a,_0x548bf0){const _0x54545e=a30_0x36e7,_0x13bcf8=await withSpinner(_0x54545e(0x1d1)+_0x59c0d9+_0x54545e(0x172),()=>_0x1e2b6a[_0x54545e(0x1b9)][_0x54545e(0x177)](_0x59c0d9),{'verbose':_0x548bf0[_0x54545e(0x1b4)]}),_0x256ab4=_0x13bcf8[_0x54545e(0x1c2)][_0x54545e(0x1c2)]??[];if(_0x256ab4[_0x54545e(0x147)]===0x0){console['log'](_0x54545e(0x168));return;}if(_0x548bf0['format']!==undefined)await handleSDKOutput(_0x256ab4,_0x548bf0);else{const _0x56fd72=_0x256ab4['map'](_0x49cae7=>formatChatHistoryEntry(_0x49cae7,_0x548bf0)),_0x6ddda=_0x56fd72['join']('\x0a');await writeOutput(_0x6ddda,_0x548bf0['output'],_0x54545e(0x191));}}async function getChatIdOrSelect(_0x548b25,_0x318bc2,_0x2e8515,_0x2805a7){const _0x3f9609=a30_0x36e7;if(_0x2805a7)return _0x2805a7;if(_0x2e8515){const _0x190db8=await withSpinner(_0x3f9609(0x183),()=>_0x548b25[_0x3f9609(0x1b9)]['chats'](0x1),{'verbose':_0x318bc2['verbose']});if(_0x190db8['data'][_0x3f9609(0x147)]===0x0)return console[_0x3f9609(0x163)](_0x3f9609(0x1a2)),undefined;return _0x190db8['data'][0x0]['id'];}const _0x4209aa=await selectChatInteractively(_0x548b25,_0x318bc2);if(!_0x4209aa)return console[_0x3f9609(0x163)](_0x3f9609(0x10e)),undefined;return _0x4209aa;}async function getProjectIdOrDefault(_0x26c3c3){const _0x3f8a66=await getProjectWithName(_0x26c3c3);return _0x3f8a66['id'];}async function getProjectWithName(_0xbe5df4){const _0x538fa1=a30_0x36e7,{tdx:_0x58f144,options:_0x134bfa}=_0xbe5df4,_0x425df8=_0x134bfa[_0x538fa1(0x19e)];if(_0x425df8){const _0x360d8f=await withSpinner(_0x538fa1(0x18a)+_0x425df8+'\x27...',()=>_0x58f144['llm']['resolveProjectId'](_0x425df8),{'verbose':_0x134bfa[_0x538fa1(0x1b4)]});return{'id':_0x360d8f[_0x538fa1(0x1c2)],'name':_0x425df8};}const _0x1cad58=_0x58f144[_0x538fa1(0x1b9)][_0x538fa1(0x128)]();if(_0x1cad58){const _0x3c7e70=await _0x58f144['llm'][_0x538fa1(0x13a)](),_0x921665=_0x3c7e70[_0x538fa1(0x1cd)](_0x5f2022=>_0x5f2022['id']===_0x1cad58);return{'id':_0x1cad58,'name':_0x921665?.[_0x538fa1(0x158)][_0x538fa1(0x113)]||_0x538fa1(0x189)};}const _0x374fbc=await withSpinner(_0x538fa1(0x127),()=>_0x58f144[_0x538fa1(0x1b9)][_0x538fa1(0x1ad)](),{'verbose':_0x134bfa[_0x538fa1(0x1b4)]});return{'id':_0x374fbc[_0x538fa1(0x1c2)]['id'],'name':_0x374fbc[_0x538fa1(0x1c2)][_0x538fa1(0x158)][_0x538fa1(0x113)]};}function toLLMProjectInfo(_0x380918){const _0x366322=a30_0x36e7;return{'name':_0x380918[_0x366322(0x158)][_0x366322(0x113)],'description':_0x380918['attributes']['description'],'createdAt':_0x380918[_0x366322(0x158)][_0x366322(0x13e)],'updatedAt':_0x380918[_0x366322(0x158)][_0x366322(0x16e)]};}function toAgentInfo(_0x4462b0){const _0x5d0f35=a30_0x36e7;return{'name':_0x4462b0[_0x5d0f35(0x158)][_0x5d0f35(0x113)],'description':_0x4462b0[_0x5d0f35(0x158)]['description'],'prompt':truncatePrompt(_0x4462b0[_0x5d0f35(0x158)][_0x5d0f35(0x1c8)]),'createdAt':_0x4462b0[_0x5d0f35(0x158)][_0x5d0f35(0x13e)],'updatedAt':_0x4462b0[_0x5d0f35(0x158)][_0x5d0f35(0x16e)]};}function truncatePrompt(_0x1db028){const _0x8bad8b=a30_0x36e7;if(!_0x1db028)return undefined;const _0x4a86b8=0x64;if(_0x1db028[_0x8bad8b(0x147)]<=_0x4a86b8)return _0x1db028;return _0x1db028[_0x8bad8b(0x1ca)](0x0,_0x4a86b8)+_0x8bad8b(0x18c);}export class LLMModelsCommand extends BaseCommand{['name']=a30_0x31a965(0x167);[a30_0x31a965(0x15f)]=a30_0x31a965(0x17e);async[a30_0x31a965(0x11e)](_0x232f44){const _0x34237d=a30_0x31a965,{options:_0x483b55,tdx:_0x4e187f}=_0x232f44;try{const _0x3c53b3=await withSpinner('Fetching\x20available\x20models...',()=>_0x4e187f[_0x34237d(0x1b9)][_0x34237d(0x103)](),{'verbose':_0x483b55['verbose']});return await handleSDKOutput(_0x3c53b3[_0x34237d(0x1c2)],_0x483b55),0x0;}catch(_0x25a097){return handleSDKError(_0x25a097,_0x483b55),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a30_0x31a965(0x113)]=a30_0x31a965(0x1a8);[a30_0x31a965(0x15f)]='List\x20all\x20LLM\x20projects';async[a30_0x31a965(0x11e)](_0x58b3c5){const _0xd2a676=a30_0x31a965,{options:_0x153338,args:_0x445af5,tdx:_0x4da051}=_0x58b3c5,_0x491b7e=getChalk(_0x153338),_0x106dc2=_0x153338[_0xd2a676(0x17f)];try{const _0x3766f=_0x445af5[0x0],_0x3506e0=resolveLimit(_0x153338['limit'],DEFAULT_LLM_LIMIT),_0x49cbb7=await withSpinner(_0xd2a676(0x1b8),()=>_0x4da051[_0xd2a676(0x1b9)][_0xd2a676(0x13a)](_0x3506e0),{'verbose':_0x153338[_0xd2a676(0x1b4)]});let _0x19e4dc=_0x49cbb7['data'];_0x3766f&&(_0x19e4dc=_0x49cbb7[_0xd2a676(0x1c2)][_0xd2a676(0x112)](_0x2fdebc=>matchGlobPattern(_0x2fdebc[_0xd2a676(0x158)][_0xd2a676(0x113)],_0x3766f)));const _0x104896=_0x153338[_0xd2a676(0x115)]==='json'||_0x153338[_0xd2a676(0x115)]===_0xd2a676(0x1d8)||_0x153338[_0xd2a676(0x115)]==='table'||_0x153338[_0xd2a676(0x115)]==='tsv';if(_0x104896){const _0xd19bf3=_0x19e4dc['map'](_0x130e48=>({...toLLMProjectInfo(_0x130e48),'url':getLLMProjectUrl(_0x106dc2,_0x130e48['id'])}));await handleSDKOutput(_0xd19bf3,_0x153338);}else{const _0x5e6299=[];if(_0x19e4dc['length']===0x0)_0x5e6299[_0xd2a676(0x1d4)](_0x491b7e[_0xd2a676(0x14b)]('No\x20projects\x20found'));else{const _0xa95525=[..._0x19e4dc][_0xd2a676(0x119)]((_0x1a0fd7,_0x5dd2c4)=>_0x1a0fd7['attributes']['name'][_0xd2a676(0x121)](_0x5dd2c4['attributes'][_0xd2a676(0x113)]));for(const _0x592b71 of _0xa95525){const _0x6dfd80=getLLMProjectUrl(_0x106dc2,_0x592b71['id']),_0xc1870c=hyperlink(_0x592b71[_0xd2a676(0x158)]['name'],_0x6dfd80);_0x5e6299[_0xd2a676(0x1d4)](_0xd2a676(0x146)+_0xc1870c);}_0x5e6299[_0xd2a676(0x1d4)](_0x491b7e[_0xd2a676(0x14b)](_0x19e4dc[_0xd2a676(0x147)]+'\x20project(s)'));}await writeOutput(_0x5e6299[_0xd2a676(0x10b)]('\x0a'),_0x153338['output'],_0xd2a676(0x191));}return 0x0;}catch(_0x1557f5){return handleSDKError(_0x1557f5,_0x153338),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a30_0x31a965(0xfa);[a30_0x31a965(0x15f)]=a30_0x31a965(0x15a);async['execute'](_0x9c11d3){const _0x2db1cb=a30_0x31a965,{options:_0x3c4c8f,args:_0x2e31a7,tdx:_0x3497b5}=_0x9c11d3,_0x27d4ff=getChalk(_0x3c4c8f),_0x2f7e55=_0x3c4c8f[_0x2db1cb(0x17f)];try{const _0x28f353=_0x2e31a7[0x0];let _0x26fb86=_0x28f353,_0x2b19fd,_0x1e0a91;if(_0x28f353&&_0x28f353['includes']('/')){const _0x513482=_0x28f353[_0x2db1cb(0x195)]('/');if(_0x513482['length']===0x2){const [_0x1b1596,_0x52fd48]=_0x513482,_0x1122a7=await _0x3497b5['llm']['projects'](),_0x523b7f=_0x1122a7[_0x2db1cb(0x1cd)](_0x1c9478=>_0x1c9478[_0x2db1cb(0x158)]['name']['toLowerCase']()===_0x1b1596[_0x2db1cb(0x1d6)]());if(!_0x523b7f)throw new SDKError(ErrorCode[_0x2db1cb(0x1b3)],_0x2db1cb(0x131)+_0x1b1596,undefined,{'helpText':_0x2db1cb(0x16a)});_0x2b19fd=_0x523b7f['id'],_0x1e0a91=_0x523b7f[_0x2db1cb(0x158)][_0x2db1cb(0x113)],_0x26fb86=_0x52fd48;}else throw new SDKError(ErrorCode[_0x2db1cb(0x1ab)],'Invalid\x20path\x20syntax:\x20'+_0x28f353,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x4e924c=await getProjectWithName(_0x9c11d3);_0x2b19fd=_0x4e924c['id'],_0x1e0a91=_0x4e924c['name'];}const _0x4a326a=await withSpinner(_0x2db1cb(0x169),()=>_0x3497b5['llm'][_0x2db1cb(0x11d)](_0x2b19fd),{'verbose':_0x3c4c8f[_0x2db1cb(0x1b4)]});let _0x188aa3=_0x4a326a[_0x2db1cb(0x1c2)];_0x26fb86&&(_0x188aa3=_0x4a326a[_0x2db1cb(0x1c2)][_0x2db1cb(0x112)](_0x461e5a=>matchGlobPattern(_0x461e5a[_0x2db1cb(0x158)][_0x2db1cb(0x113)],_0x26fb86)));const _0xe53126=_0x3c4c8f['format']===_0x2db1cb(0x180)||_0x3c4c8f[_0x2db1cb(0x115)]===_0x2db1cb(0x1d8)||_0x3c4c8f[_0x2db1cb(0x115)]===_0x2db1cb(0x191)||_0x3c4c8f['format']===_0x2db1cb(0x1a0);if(_0xe53126){const _0x550e9e=_0x188aa3['map'](_0x4bd40a=>({...toAgentInfo(_0x4bd40a),'chatUrl':getLLMAgentChatUrl(_0x2f7e55,_0x2b19fd,_0x4bd40a['id'])}));await handleSDKOutput(_0x550e9e,_0x3c4c8f);}else{const _0x692bde=[];_0x692bde['push'](_0x27d4ff[_0x2db1cb(0x14b)]('['+_0x1e0a91+']'));if(_0x188aa3[_0x2db1cb(0x147)]===0x0)_0x692bde['push'](_0x27d4ff[_0x2db1cb(0x14b)](_0x2db1cb(0x16c)));else{const _0x27b9c9=[..._0x188aa3][_0x2db1cb(0x119)]((_0x5f3dd3,_0x3bcdf5)=>_0x5f3dd3[_0x2db1cb(0x158)][_0x2db1cb(0x113)][_0x2db1cb(0x121)](_0x3bcdf5[_0x2db1cb(0x158)][_0x2db1cb(0x113)]));for(const _0x168c82 of _0x27b9c9){const _0x491bcb=getLLMAgentChatUrl(_0x2f7e55,_0x2b19fd,_0x168c82['id']),_0x391718=hyperlink(_0x168c82[_0x2db1cb(0x158)][_0x2db1cb(0x113)],_0x491bcb);_0x692bde[_0x2db1cb(0x1d4)]('🤖\x20'+_0x391718);}_0x692bde[_0x2db1cb(0x1d4)](_0x27d4ff[_0x2db1cb(0x14b)](_0x188aa3['length']+_0x2db1cb(0x14e)));}await writeOutput(_0x692bde[_0x2db1cb(0x10b)]('\x0a'),_0x3c4c8f[_0x2db1cb(0x12e)],_0x2db1cb(0x191));}return 0x0;}catch(_0x499187){return handleSDKError(_0x499187,_0x3c4c8f),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a30_0x31a965(0x113)]='llm:agent:show';[a30_0x31a965(0x15f)]=a30_0x31a965(0xfc);async[a30_0x31a965(0x11e)](_0x4ba5ea){const _0x244452=a30_0x31a965,{options:_0x2b5d6e,args:_0x11f77b,tdx:_0x18f096}=_0x4ba5ea;if(_0x11f77b['length']===0x0)return console['error'](_0x244452(0x1b0)),console[_0x244452(0x194)](_0x244452(0x13d)),0x1;const _0x152eaa=_0x11f77b[0x0];try{const _0x3c2f1a=await getProjectIdOrDefault(_0x4ba5ea),_0x42f590=await withSpinner(_0x244452(0x12b)+_0x152eaa+_0x244452(0x172),()=>_0x18f096[_0x244452(0x1b9)][_0x244452(0x114)](_0x152eaa,_0x3c2f1a),{'verbose':_0x2b5d6e[_0x244452(0x1b4)]}),_0x1f8346=await withSpinner('Fetching\x20agent...',()=>_0x18f096[_0x244452(0x1b9)][_0x244452(0x136)](_0x42f590['data']),{'verbose':_0x2b5d6e[_0x244452(0x1b4)]});return await handleSDKOutput([_0x1f8346[_0x244452(0x1c2)]],_0x2b5d6e),0x0;}catch(_0x3dc195){return handleSDKError(_0x3dc195,_0x2b5d6e),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a30_0x31a965(0x113)]='llm:agent:create';['description']='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a30_0x31a965(0x11e)](_0x12cfba){const _0x3b63fd=a30_0x31a965,{options:_0xd178d6,args:_0x58dcfd,tdx:_0xabaf1d}=_0x12cfba;if(_0x58dcfd[_0x3b63fd(0x147)]===0x0)return console['error'](_0x3b63fd(0x1b0)),console[_0x3b63fd(0x194)](_0x3b63fd(0x10c)),console[_0x3b63fd(0x194)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x4e434b=_0x58dcfd[0x0],_0x4c0567=_0xd178d6,_0x3f5fe4=_0x4c0567['systemPrompt'],_0x51fc00=_0x4c0567[_0x3b63fd(0x18e)]||'claude-4.5-haiku',_0x2f89b9=_0x4c0567['starterMessage'],_0x2ae2f3=_0x4c0567['maxToolIterations']?Number(_0x4c0567[_0x3b63fd(0x1c4)]):undefined,_0x4c7572=_0x4c0567[_0x3b63fd(0x159)]?Number(_0x4c0567[_0x3b63fd(0x159)]):undefined;try{let _0x32426f,_0x32b550;if(_0x4e434b[_0x3b63fd(0x137)]('/')){const _0x2cdb55=_0x4e434b[_0x3b63fd(0x195)]('/');if(_0x2cdb55[_0x3b63fd(0x147)]===0x2){const [_0x441723,_0x1fb938]=_0x2cdb55,_0x5519ec=await withSpinner('Resolving\x20project\x20\x27'+_0x441723+_0x3b63fd(0x172),()=>_0xabaf1d[_0x3b63fd(0x1b9)][_0x3b63fd(0x196)](_0x441723),{'verbose':_0xd178d6[_0x3b63fd(0x1b4)]});_0x32426f=_0x5519ec['data'],_0x32b550=_0x1fb938;}else throw new SDKError(ErrorCode[_0x3b63fd(0x1ab)],_0x3b63fd(0x157)+_0x4e434b,undefined,{'helpText':_0x3b63fd(0x15c)});}else _0x32426f=await getProjectIdOrDefault(_0x12cfba),_0x32b550=_0x4e434b;const _0x279d3f=await withSpinner('Creating\x20agent\x20\x27'+_0x32b550+_0x3b63fd(0x172),()=>_0xabaf1d[_0x3b63fd(0x1b9)]['createAgent']({'name':_0x32b550,'projectId':_0x32426f,'modelType':_0x51fc00,'systemPrompt':_0x3f5fe4,'starterMessage':_0x2f89b9,'maxToolIterations':_0x2ae2f3,'temperature':_0x4c7572}),{'verbose':_0xd178d6[_0x3b63fd(0x1b4)]});return console[_0x3b63fd(0x163)](_0x3b63fd(0x19d)+_0x279d3f[_0x3b63fd(0x1c2)]['id']),await handleSDKOutput([_0x279d3f[_0x3b63fd(0x1c2)]],_0xd178d6),0x0;}catch(_0x579ae8){return handleSDKError(_0x579ae8,_0xd178d6),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a30_0x31a965(0x113)]=a30_0x31a965(0x175);[a30_0x31a965(0x15f)]='Update\x20an\x20existing\x20agent';async[a30_0x31a965(0x11e)](_0xd91c9c){const _0x77100a=a30_0x31a965,{options:_0x41dc39,args:_0x4a4a3f,tdx:_0x26ff7f}=_0xd91c9c;if(_0x4a4a3f[_0x77100a(0x147)]===0x0)return console[_0x77100a(0x194)](_0x77100a(0x1b0)),console['error'](_0x77100a(0x178)),0x1;const _0xecf17=_0x4a4a3f[0x0],_0x3aa225=_0x41dc39,_0x1552b4=_0x3aa225[_0x77100a(0x113)],_0x469dfa=_0x3aa225[_0x77100a(0x1c8)],_0x35f1ac=_0x3aa225[_0x77100a(0x15f)],_0x5a1746=_0x3aa225[_0x77100a(0x15b)];if(!_0x1552b4&&!_0x469dfa&&!_0x35f1ac&&!_0x5a1746)return console[_0x77100a(0x194)]('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console[_0x77100a(0x194)](_0x77100a(0x122)),0x1;try{const _0xaa134a=await getProjectIdOrDefault(_0xd91c9c),_0x4a5ba6=await withSpinner(_0x77100a(0x12b)+_0xecf17+'\x27...',()=>_0x26ff7f['llm'][_0x77100a(0x114)](_0xecf17,_0xaa134a),{'verbose':_0x41dc39[_0x77100a(0x1b4)]}),_0x285198=_0x4a5ba6[_0x77100a(0x1c2)],_0x13ee41=await withSpinner(_0x77100a(0x109),()=>_0x26ff7f[_0x77100a(0x1b9)][_0x77100a(0x1cb)](_0x285198,{'name':_0x1552b4,'prompt':_0x469dfa,'description':_0x35f1ac,'starterMessage':_0x5a1746}),{'verbose':_0x41dc39[_0x77100a(0x1b4)]});return console[_0x77100a(0x163)]('Agent\x20updated:\x20'+_0x13ee41[_0x77100a(0x1c2)]['id']),await handleSDKOutput([_0x13ee41[_0x77100a(0x1c2)]],_0x41dc39),0x0;}catch(_0x197927){return handleSDKError(_0x197927,_0x41dc39),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a30_0x31a965(0x113)]=a30_0x31a965(0x193);[a30_0x31a965(0x15f)]=a30_0x31a965(0x1ac);async['execute'](_0x498785){const _0x585ea7=a30_0x31a965,{options:_0x261b55,args:_0x7314fe,tdx:_0x2b2f9d}=_0x498785;if(_0x7314fe[_0x585ea7(0x147)]===0x0)return console[_0x585ea7(0x194)](_0x585ea7(0x1b0)),console[_0x585ea7(0x194)](_0x585ea7(0x14a)),0x1;const _0x34ac54=_0x7314fe[0x0];try{const _0x47f715=await getProjectIdOrDefault(_0x498785),_0xc79ee4=await withSpinner(_0x585ea7(0x12b)+_0x34ac54+_0x585ea7(0x172),()=>_0x2b2f9d[_0x585ea7(0x1b9)]['resolveAgentId'](_0x34ac54,_0x47f715),{'verbose':_0x261b55[_0x585ea7(0x1b4)]}),_0x5b85ce=_0xc79ee4[_0x585ea7(0x1c2)];return await withSpinner(_0x585ea7(0x1a4),()=>_0x2b2f9d['llm'][_0x585ea7(0x164)](_0x5b85ce),{'verbose':_0x261b55[_0x585ea7(0x1b4)]}),console[_0x585ea7(0x163)](_0x585ea7(0x149)+_0x5b85ce),0x0;}catch(_0x7be61e){return handleSDKError(_0x7be61e,_0x261b55),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a30_0x31a965(0x156);[a30_0x31a965(0x15f)]=a30_0x31a965(0x108);async[a30_0x31a965(0x11e)](_0x51dab){const _0x47411a=a30_0x31a965;return executeChatHistoryCommand(_0x51dab,_0x47411a(0x11f));}}export class LLMUseCommand extends BaseCommand{[a30_0x31a965(0x113)]='llm:use';['description']=a30_0x31a965(0x106);async['execute'](_0x4b7967){const _0x14708d=a30_0x31a965,{options:_0x3551a8,args:_0x139936,tdx:_0x5896ca}=_0x4b7967;if(_0x139936['length']===0x0)return console[_0x14708d(0x194)](_0x14708d(0xff)),console[_0x14708d(0x194)](_0x14708d(0x188)),0x1;const _0x5ef9dc=_0x139936[0x0];try{await withSpinner(_0x14708d(0x1bb)+_0x5ef9dc+_0x14708d(0x172),()=>_0x5896ca[_0x14708d(0x1b9)]['setCurrentProject'](_0x5ef9dc),{'verbose':_0x3551a8['verbose']}),saveSessionContext({'llm_project':_0x5ef9dc},_0x3551a8[_0x14708d(0x150)]);const _0x1549e3=getChalk(_0x3551a8);return console[_0x14708d(0x163)](_0x14708d(0x1c0)+_0x1549e3[_0x14708d(0x15d)](_0x5ef9dc)),0x0;}catch(_0x195c08){return handleSDKError(_0x195c08,_0x3551a8),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a30_0x31a965(0xfb);[a30_0x31a965(0x15f)]=a30_0x31a965(0x176);async[a30_0x31a965(0x11e)](_0xfe730a){const _0x10be9f=a30_0x31a965,{options:_0xd34cd9,args:_0x29123a,tdx:_0x5cc328}=_0xfe730a;if(_0x29123a[_0x10be9f(0x147)]===0x0)return console[_0x10be9f(0x194)](_0x10be9f(0xff)),console[_0x10be9f(0x194)](_0x10be9f(0x19a)),0x1;const _0x2d971a=_0x29123a[0x0],_0x4e43bf=_0xd34cd9,_0x85a406=_0x4e43bf[_0x10be9f(0x15f)];try{const _0x36c600=await withSpinner(_0x10be9f(0x192)+_0x2d971a+_0x10be9f(0x172),()=>_0x5cc328[_0x10be9f(0x1b9)][_0x10be9f(0x1a6)]({'name':_0x2d971a,'description':_0x85a406}),{'verbose':_0xd34cd9[_0x10be9f(0x1b4)]});console[_0x10be9f(0x163)](_0x10be9f(0x10f)+_0x36c600['data']['id']);const _0x15d296=toLLMProjectInfo(_0x36c600[_0x10be9f(0x1c2)]);return await handleSDKOutput([_0x15d296],_0xd34cd9),0x0;}catch(_0xa776ee){return handleSDKError(_0xa776ee,_0xd34cd9),0x1;}}}function a30_0x36e7(_0x3389e5,_0x23a094){_0x3389e5=_0x3389e5-0xf8;const _0x5d0fdf=a30_0x5d0f();let _0x36e7ea=_0x5d0fdf[_0x3389e5];return _0x36e7ea;}export class LLMProjectDeleteCommand extends BaseCommand{[a30_0x31a965(0x113)]='llm:project:delete';[a30_0x31a965(0x15f)]='Delete\x20an\x20LLM\x20project';async['execute'](_0xa6a9b0){const _0x5c59c8=a30_0x31a965,{options:_0x1e8e00,args:_0x5c990f,tdx:_0x5d1c42}=_0xa6a9b0;if(_0x5c990f[_0x5c59c8(0x147)]===0x0)return console[_0x5c59c8(0x194)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5c59c8(0x194)](_0x5c59c8(0x1b6)),0x1;const _0x57e96a=_0x5c990f[0x0];try{return await withSpinner(_0x5c59c8(0x160)+_0x57e96a+'\x27...',()=>_0x5d1c42[_0x5c59c8(0x1b9)][_0x5c59c8(0x18d)](_0x57e96a),{'verbose':_0x1e8e00[_0x5c59c8(0x1b4)]}),console[_0x5c59c8(0x163)](_0x5c59c8(0x197)+_0x57e96a),0x0;}catch(_0x10186a){return handleSDKError(_0x10186a,_0x1e8e00),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a30_0x31a965(0x1cf);['description']='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)';async['execute'](_0x35b383){const _0x88dc70=a30_0x31a965,{options:_0x38732a,args:_0x4c7f77,tdx:_0x35eeca}=_0x35b383,_0x146763=getChalk(_0x38732a);console['log'](_0x146763['yellow'](_0x88dc70(0x1aa))),console[_0x88dc70(0x163)](_0x146763['yellow']('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console['log'](_0x146763[_0x88dc70(0x14b)](_0x88dc70(0x17d))),console[_0x88dc70(0x163)]();if(_0x4c7f77['length']===0x0)return console['error'](_0x88dc70(0xff)),console[_0x88dc70(0x194)](_0x88dc70(0x170)),0x1;const _0x11a3bb=_0x4c7f77[0x0],_0x1552e8=_0x38732a,_0x3d5898=_0x1552e8[_0x88dc70(0x12e)],_0x52f718=_0x1552e8[_0x88dc70(0x105)];try{const _0x13fd3e=_0x3d5898||_0x11a3bb+_0x88dc70(0x18b);if(a30_0x5f2345[_0x88dc70(0x120)](_0x13fd3e)&&!_0x52f718){if(!_0x38732a[_0x88dc70(0x14f)]){const _0xddec86=await confirm(_0x88dc70(0x151)+_0x13fd3e+_0x88dc70(0x1ae));if(!_0xddec86)return console[_0x88dc70(0x163)](_0x88dc70(0x1c3)),0x0;}a30_0x5f2345['rmSync'](_0x13fd3e,{'recursive':!![]});}const _0x274c3d=await withSpinner(_0x52f718?_0x88dc70(0xf9)+_0x11a3bb+'\x27...':_0x88dc70(0x13b)+_0x11a3bb+_0x88dc70(0x172),()=>_0x35eeca[_0x88dc70(0x1b9)][_0x88dc70(0x1b7)](_0x11a3bb,_0x3d5898,{'dryRun':_0x52f718}),{'verbose':_0x38732a[_0x88dc70(0x1b4)]}),_0x531311=_0x274c3d[_0x88dc70(0x1c2)];return _0x52f718?console[_0x88dc70(0x163)](_0x88dc70(0x1a9)+_0x531311[_0x88dc70(0x186)]):console['log']('Project\x20backed\x20up\x20to:\x20'+_0x531311['outputDir']),console[_0x88dc70(0x163)](_0x88dc70(0x1ba)+_0x531311[_0x88dc70(0x102)][_0x88dc70(0x11d)]),console[_0x88dc70(0x163)]('\x20\x20Knowledge\x20Bases:\x20'+_0x531311['counts'][_0x88dc70(0x101)]),console[_0x88dc70(0x163)](_0x88dc70(0x184)+_0x531311['counts'][_0x88dc70(0x11c)]),console[_0x88dc70(0x163)]('\x20\x20Integrations:\x20'+_0x531311[_0x88dc70(0x102)][_0x88dc70(0x14d)]),(_0x38732a[_0x88dc70(0x115)]==='json'||_0x38732a[_0x88dc70(0x115)]===_0x88dc70(0x1d8))&&await handleSDKOutput([_0x531311],_0x38732a),0x0;}catch(_0x36256a){return handleSDKError(_0x36256a,_0x38732a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a30_0x31a965(0x113)]='llm:project:restore';[a30_0x31a965(0x15f)]='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)';async[a30_0x31a965(0x11e)](_0x31eb8c){const _0x342ea6=a30_0x31a965,{options:_0xdb516d,args:_0x24fb62,tdx:_0x45ac24}=_0x31eb8c,_0x3bf49d=getChalk(_0xdb516d);console[_0x342ea6(0x163)](_0x3bf49d[_0x342ea6(0x1c5)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.')),console[_0x342ea6(0x163)](_0x3bf49d['yellow'](_0x342ea6(0x124))),console['log'](_0x3bf49d['dim']('\x20\x20\x20Examples:')),console[_0x342ea6(0x163)](_0x3bf49d[_0x342ea6(0x14b)](_0x342ea6(0x1b1))),console[_0x342ea6(0x163)](_0x3bf49d['dim']('\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22')),console[_0x342ea6(0x163)]();if(_0x24fb62['length']===0x0)return console[_0x342ea6(0x194)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x342ea6(0x194)](_0x342ea6(0xfe)),0x1;const _0x93bcd1=_0x24fb62[0x0],_0x478ff4=_0xdb516d,_0x1e1b0a=_0x478ff4[_0x342ea6(0x113)],_0x520eb4=_0x478ff4[_0x342ea6(0x105)];try{if(!_0x520eb4){const _0x1554e0=_0x45ac24[_0x342ea6(0x1b9)][_0x342ea6(0x16d)](_0x93bcd1),_0x2f3625=_0x1e1b0a||_0x1554e0[_0x342ea6(0x116)][_0x342ea6(0x161)],_0x4e3f32=await withSpinner(_0x342ea6(0x19c),()=>_0x45ac24[_0x342ea6(0x1b9)][_0x342ea6(0x13a)](),{'verbose':_0xdb516d[_0x342ea6(0x1b4)]}),_0x4e3104=_0x4e3f32[_0x342ea6(0x1c2)]['find'](_0x33afac=>_0x33afac['attributes'][_0x342ea6(0x113)]===_0x2f3625);if(_0x4e3104&&!_0xdb516d['yes']){const _0x569c50=await confirm(_0x342ea6(0x15e)+_0x2f3625+_0x342ea6(0x190));if(!_0x569c50)return console[_0x342ea6(0x163)](_0x342ea6(0x1a7)),0x0;}}const _0x57dbe8=await withSpinner(_0x520eb4?_0x342ea6(0x19f)+_0x93bcd1+_0x342ea6(0x172):'Restoring\x20project\x20from\x20\x27'+_0x93bcd1+_0x342ea6(0x172),()=>_0x45ac24['llm'][_0x342ea6(0x130)](_0x93bcd1,{'name':_0x1e1b0a,'dryRun':_0x520eb4}),{'verbose':_0xdb516d[_0x342ea6(0x1b4)]}),_0x5c7782=_0x57dbe8[_0x342ea6(0x1c2)];return _0x5c7782[_0x342ea6(0x18f)]&&console[_0x342ea6(0x163)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x5c7782['sourceSite']+'\x27'),_0x520eb4?console[_0x342ea6(0x163)](_0x342ea6(0x1af)+_0x5c7782[_0x342ea6(0x161)]):console[_0x342ea6(0x163)]('Project\x20restored:\x20'+_0x5c7782[_0x342ea6(0x161)]+'\x20('+_0x5c7782[_0x342ea6(0x1a5)]+')'),console[_0x342ea6(0x163)](_0x342ea6(0x1ba)+_0x5c7782['counts'][_0x342ea6(0x11d)]),console['log'](_0x342ea6(0x179)+_0x5c7782[_0x342ea6(0x102)]['knowledgeBases']),console['log'](_0x342ea6(0x184)+_0x5c7782[_0x342ea6(0x102)][_0x342ea6(0x11c)]),console['log'](_0x342ea6(0x199)+_0x5c7782[_0x342ea6(0x102)][_0x342ea6(0x14d)]),(_0xdb516d[_0x342ea6(0x115)]===_0x342ea6(0x180)||_0xdb516d[_0x342ea6(0x115)]===_0x342ea6(0x1d8))&&await handleSDKOutput([_0x5c7782],_0xdb516d),0x0;}catch(_0x391ecc){return handleSDKError(_0x391ecc,_0xdb516d),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x3d3f28,_0x499eb3){const _0x17d7b4=a30_0x31a965,_0x3044d5=_0x499eb3['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0x3c69c6=0x0,_0x1de79b=[];const _0x1f3a2c=(await import(_0x17d7b4(0x11c)))[_0x17d7b4(0x11a)],_0x42c97e=getChalk(_0x499eb3);while(!![]){const _0x5d939a=await withSpinner(_0x17d7b4(0x10a),()=>_0x3d3f28[_0x17d7b4(0x1b9)][_0x17d7b4(0x100)](_0x3044d5+_0x3c69c6),{'verbose':_0x499eb3[_0x17d7b4(0x1b4)]});_0x1de79b=_0x5d939a['data'];const _0x5d7089=_0x1de79b[_0x17d7b4(0x1ca)](_0x3c69c6,_0x3c69c6+_0x3044d5),_0x1effa5=_0x1de79b[_0x17d7b4(0x147)]>_0x3c69c6+_0x3044d5,_0x2b8a40=[...new Set(_0x5d7089[_0x17d7b4(0x154)](_0x3f5eff=>_0x3f5eff['attributes']['agentId'])[_0x17d7b4(0x112)](_0x80fcdc=>_0x80fcdc!==undefined))],_0x260a54=new Map();await Promise[_0x17d7b4(0x148)](_0x2b8a40[_0x17d7b4(0x154)](async _0x571e5c=>{const _0x1b995e=_0x17d7b4;try{const _0x521a9e=await _0x3d3f28[_0x1b995e(0x1b9)][_0x1b995e(0x136)](_0x571e5c);_0x260a54['set'](_0x571e5c,_0x521a9e[_0x1b995e(0x158)][_0x1b995e(0x113)]);}catch{_0x260a54['set'](_0x571e5c,_0x571e5c);}}));const _0xcfae58=_0x5d7089[_0x17d7b4(0x154)](_0x550fec=>{const _0x18f959=_0x17d7b4,_0x48499d=_0x550fec[_0x18f959(0x158)][_0x18f959(0x111)]||_0x18f959(0x1d0),_0x240111=_0x48499d[_0x18f959(0x195)]('\x0a')[0x0],_0x29f49b=_0x240111['length']>0x50?_0x240111[_0x18f959(0x1be)](0x0,0x4d)+_0x18f959(0x18c):_0x240111,_0x363da0=_0x550fec[_0x18f959(0x158)][_0x18f959(0x16f)]?_0x260a54[_0x18f959(0x1d7)](_0x550fec[_0x18f959(0x158)][_0x18f959(0x16f)])||_0x550fec[_0x18f959(0x158)][_0x18f959(0x16f)]:_0x18f959(0x187),_0x31a27d=_0x550fec['attributes']['lastConversationAt']||_0x550fec[_0x18f959(0x158)][_0x18f959(0x16e)],_0x3d60c8=new Date(_0x31a27d),_0x12da7a=new Date(),_0x5e20d2=_0x12da7a[_0x18f959(0x182)]()-_0x3d60c8[_0x18f959(0x182)](),_0x26b0c2=Math[_0x18f959(0x10d)](_0x5e20d2/0xea60),_0x13cfcf=Math[_0x18f959(0x10d)](_0x5e20d2/0x36ee80),_0x1933fd=Math[_0x18f959(0x10d)](_0x5e20d2/0x5265c00);let _0x48b374;if(_0x26b0c2<0x1)_0x48b374='just\x20now';else{if(_0x26b0c2<0x3c)_0x48b374=_0x26b0c2+_0x18f959(0x162);else{if(_0x13cfcf<0x18)_0x48b374=_0x13cfcf+_0x18f959(0x11b);else _0x1933fd<0x7?_0x48b374=_0x1933fd+'d\x20ago':_0x48b374=_0x3d60c8[_0x18f959(0x174)](_0x18f959(0x155),{'month':_0x18f959(0x1b2),'day':_0x18f959(0x181)});}}return{'title':_0x29f49b+'\x20'+_0x42c97e[_0x18f959(0x14b)]('['+_0x363da0+']\x20'+_0x48b374),'value':_0x550fec['id']};});_0x1effa5&&_0xcfae58[_0x17d7b4(0x1d4)]({'title':_0x42c97e[_0x17d7b4(0xfd)](_0x17d7b4(0x138)),'value':_0x17d7b4(0x1d2)});const _0x562be2=await _0x1f3a2c({'type':'select','name':_0x17d7b4(0x198),'message':_0x17d7b4(0x1bf),'choices':_0xcfae58,'hint':_0x17d7b4(0x107)});if(!_0x562be2[_0x17d7b4(0x198)])return undefined;if(_0x562be2[_0x17d7b4(0x198)]===_0x17d7b4(0x1d2)){_0x3c69c6+=_0x3044d5;continue;}return _0x562be2[_0x17d7b4(0x198)];}}export class ChatsCommand extends BaseCommand{['name']=a30_0x31a965(0x100);['description']=a30_0x31a965(0x104);async[a30_0x31a965(0x11e)](_0x5c26e2){return executeChatHistoryCommand(_0x5c26e2,'tdx\x20chats');}}export class LLMLogCommand extends BaseCommand{[a30_0x31a965(0x113)]=a30_0x31a965(0x145);[a30_0x31a965(0x15f)]='Show\x20chat\x20log';async[a30_0x31a965(0x11e)](_0x1bae1c){const _0x24e709=a30_0x31a965,{options:_0x1f3974,args:_0x58846f,tdx:_0x522a79}=_0x1bae1c,_0x1e9bbc=_0x58846f[0x0];if(!_0x1e9bbc)return console[_0x24e709(0x194)](_0x24e709(0x153)),console[_0x24e709(0x194)]('Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>'),0x1;const _0x25bb23=await withSpinner(_0x24e709(0x117)+_0x1e9bbc+'\x27...',()=>_0x522a79['llm'][_0x24e709(0x16b)](_0x1e9bbc),{'verbose':_0x1f3974[_0x24e709(0x1b4)]});return await handleSDKOutput(_0x25bb23[_0x24e709(0x1c2)][_0x24e709(0x1c2)],_0x1f3974),0x0;}}
1
+ const a30_0x3f5e91=a30_0x583b;(function(_0x251f00,_0x241ab2){const _0x216ff8=a30_0x583b,_0x57405c=_0x251f00();while(!![]){try{const _0x542802=-parseInt(_0x216ff8(0x172))/0x1+parseInt(_0x216ff8(0x185))/0x2*(-parseInt(_0x216ff8(0x143))/0x3)+parseInt(_0x216ff8(0x1b5))/0x4+parseInt(_0x216ff8(0x1ca))/0x5+parseInt(_0x216ff8(0x10e))/0x6+-parseInt(_0x216ff8(0x122))/0x7+-parseInt(_0x216ff8(0x1b8))/0x8*(-parseInt(_0x216ff8(0x1de))/0x9);if(_0x542802===_0x241ab2)break;else _0x57405c['push'](_0x57405c['shift']());}catch(_0x445df7){_0x57405c['push'](_0x57405c['shift']());}}}(a30_0x19b6,0x2f948));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 a30_0x119a70 from'node:fs';function a30_0x583b(_0x1d66b4,_0x1a151b){_0x1d66b4=_0x1d66b4-0x101;const _0x19b6c8=a30_0x19b6();let _0x583b10=_0x19b6c8[_0x1d66b4];return _0x583b10;}function handleSDKError(_0x2c6019,_0x57c47f){const _0x8550e2=a30_0x583b;if(_0x2c6019 instanceof SDKError)console[_0x8550e2(0x1bf)](_0x8550e2(0x16b)+_0x2c6019[_0x8550e2(0x1bb)]),_0x57c47f[_0x8550e2(0x141)]&&(_0x2c6019[_0x8550e2(0x12a)]&&console[_0x8550e2(0x1bf)](_0x8550e2(0x15c)+_0x2c6019[_0x8550e2(0x12a)]),_0x2c6019[_0x8550e2(0x132)]&&(console[_0x8550e2(0x1bf)](_0x8550e2(0x13c)),console[_0x8550e2(0x1bf)](_0x2c6019[_0x8550e2(0x132)])));else throw _0x2c6019;}function formatChatHistoryEntry(_0x288275,_0x1b6dba){const _0x301f39=a30_0x583b,_0x5b879e=getChalk(_0x1b6dba),_0x33d9e2=_0x5b879e[_0x301f39(0x11e)](_0x288275['at']);if(_0x301f39(0x1e0)in _0x288275){const _0xc8ce=_0x5b879e[_0x301f39(0x1a7)](_0x301f39(0x162));return _0x33d9e2+'\x20'+_0xc8ce+':\x20'+_0x288275[_0x301f39(0x1e0)];}if(_0x301f39(0x17d)in _0x288275){const _0x4b6cfc=_0x5b879e['green'](_0x301f39(0x110));return _0x33d9e2+'\x20'+_0x4b6cfc+':\x20'+_0x288275[_0x301f39(0x17d)];}if('tool_call'in _0x288275){const _0x569af0=_0x5b879e[_0x301f39(0x186)](_0x301f39(0x1cf)),{functionName:_0x4aeb03,functionArguments:_0x36bfb2,targetFunction:_0x841150}=_0x288275[_0x301f39(0x113)];let _0x769a5b=_0x33d9e2+'\x20'+_0x569af0+':\x20'+_0x5b879e[_0x301f39(0x19e)](_0x4aeb03);if(_0x36bfb2&&Object[_0x301f39(0x17a)](_0x36bfb2)[_0x301f39(0x12e)]>0x0){const _0x1a31ae=Object[_0x301f39(0x1ab)](_0x36bfb2)[_0x301f39(0x148)](([_0x4d958a,_0x578b94])=>_0x4d958a+'='+JSON[_0x301f39(0x19d)](_0x578b94))['join'](',\x20');_0x769a5b+='('+_0x1a31ae+')';}_0x841150&&(_0x769a5b+=_0x5b879e[_0x301f39(0x11e)]('\x20['+_0x841150+']'));let _0x1ae512='';if(_0x288275[_0x301f39(0x113)][_0x301f39(0x111)])_0x1ae512=_0x301f39(0x157)+_0x288275['tool_call'][_0x301f39(0x111)][_0x301f39(0x1ce)];else{if(_0x288275[_0x301f39(0x113)][_0x301f39(0x14e)])_0x1ae512=_0x301f39(0x1c9)+_0x288275[_0x301f39(0x113)][_0x301f39(0x14e)][_0x301f39(0x1ce)];else{if(_0x288275[_0x301f39(0x113)][_0x301f39(0x194)])_0x1ae512=_0x301f39(0x136)+_0x288275[_0x301f39(0x113)]['targetWebSearchTool'][_0x301f39(0x1ce)];else _0x288275[_0x301f39(0x113)][_0x301f39(0x149)]&&(_0x1ae512=_0x301f39(0x198)+_0x288275['tool_call']['targetImageGenerator'][_0x301f39(0x1ce)]);}}return _0x769a5b+_0x1ae512;}if(_0x301f39(0x1d9)in _0x288275){const _0x37041e=_0x5b879e[_0x301f39(0x18b)]('[tool]\x20\x20\x20'),{functionName:_0x3fb059,functionArguments:_0x4abbdf,content:_0x34ae95,newChat:_0x3451ad}=_0x288275[_0x301f39(0x1d9)];let _0x3a5b31=_0x33d9e2+'\x20'+_0x37041e+':\x20'+_0x5b879e[_0x301f39(0x19e)](_0x3fb059);if(_0x4abbdf){const _0x579838=typeof _0x4abbdf===_0x301f39(0x10c)?_0x4abbdf:JSON[_0x301f39(0x19d)](_0x4abbdf);_0x3a5b31+='('+_0x579838+')';}return _0x34ae95&&(_0x3a5b31+='\x0a'+_0x5b879e[_0x301f39(0x11e)](_0x34ae95)),_0x3451ad&&(_0x3a5b31+=_0x5b879e['dim'](_0x301f39(0x1c6)+_0x3451ad['id'])),_0x3a5b31;}if(_0x301f39(0x11f)in _0x288275){const _0x3e0eb7=_0x5b879e[_0x301f39(0x1dc)](_0x301f39(0x1d6));return _0x33d9e2+'\x20'+_0x3e0eb7+':\x20'+_0x288275['output'][_0x301f39(0x1ce)]+'\x20('+_0x288275[_0x301f39(0x11f)][_0x301f39(0x17d)][_0x301f39(0x12e)]+'\x20bytes)';}if(_0x301f39(0x164)in _0x288275){const _0x25a2b0=_0x5b879e[_0x301f39(0x1dc)](_0x301f39(0x15e)),{width:_0x5c110b,height:_0x190a69,headerText:_0x1778c4}=_0x288275[_0x301f39(0x164)],_0x30c5d3=_0x1778c4?_0x301f39(0x17f)+_0x1778c4:'';return _0x33d9e2+'\x20'+_0x25a2b0+':\x20'+_0x5c110b+'x'+_0x190a69+_0x30c5d3;}if(_0x301f39(0x1bf)in _0x288275){const _0x561a5e=_0x5b879e[_0x301f39(0x1ba)]('[error]\x20\x20');return _0x33d9e2+'\x20'+_0x561a5e+':\x20'+_0x288275['error'];}return _0x33d9e2+'\x20'+_0x5b879e['dim'](_0x301f39(0x175))+':\x20'+JSON[_0x301f39(0x19d)](_0x288275);}async function executeChatHistoryCommand(_0x2c8117,_0x4ed016){const _0x55cebf=a30_0x583b,{options:_0x2f6157,args:_0x51a81a,tdx:_0x540f1f}=_0x2c8117,_0x1e96a9=_0x51a81a[0x0],_0x46ab4b=_0x2f6157,_0x589c66=_0x46ab4b[_0x55cebf(0x187)];try{if(_0x589c66&&_0x1e96a9)return console[_0x55cebf(0x1bf)](_0x55cebf(0x173)),console[_0x55cebf(0x1bf)]('Usage:\x20'+_0x4ed016+'\x20--last'),0x1;if(!_0x1e96a9&&!_0x589c66&&_0x2f6157[_0x55cebf(0x112)]!==undefined){const _0x26dea9=resolveLimit(_0x2f6157[_0x55cebf(0x189)],DEFAULT_LLM_LIMIT),_0x4557bb=await withSpinner(_0x55cebf(0x123),()=>_0x540f1f[_0x55cebf(0x1aa)][_0x55cebf(0x196)](_0x26dea9),{'verbose':_0x2f6157[_0x55cebf(0x141)]});return await handleSDKOutput(_0x4557bb[_0x55cebf(0x159)],_0x2f6157),0x0;}const _0xfc175=await getChatIdOrSelect(_0x540f1f,_0x2f6157,_0x589c66,_0x1e96a9);if(!_0xfc175)return 0x0;return await displayChatHistory(_0xfc175,_0x540f1f,_0x2f6157),0x0;}catch(_0x4cd1f4){return handleSDKError(_0x4cd1f4,_0x2f6157),0x1;}}async function displayChatHistory(_0x217411,_0x3827d8,_0xdd1fd){const _0x39f4d6=a30_0x583b,_0x39a358=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x217411+_0x39f4d6(0x150),()=>_0x3827d8[_0x39f4d6(0x1aa)][_0x39f4d6(0x178)](_0x217411),{'verbose':_0xdd1fd[_0x39f4d6(0x141)]}),_0x389d7e=_0x39a358[_0x39f4d6(0x159)][_0x39f4d6(0x159)]??[];if(_0x389d7e[_0x39f4d6(0x12e)]===0x0){console[_0x39f4d6(0x138)](_0x39f4d6(0x16d));return;}if(_0xdd1fd[_0x39f4d6(0x112)]!==undefined)await handleSDKOutput(_0x389d7e,_0xdd1fd);else{const _0x4c297f=_0x389d7e[_0x39f4d6(0x148)](_0x23d121=>formatChatHistoryEntry(_0x23d121,_0xdd1fd)),_0x22fb4e=_0x4c297f[_0x39f4d6(0x1c2)]('\x0a');await writeOutput(_0x22fb4e,_0xdd1fd[_0x39f4d6(0x11f)],_0x39f4d6(0x1c5));}}async function getChatIdOrSelect(_0x1f6278,_0x542782,_0x40f3c0,_0x406c1c){const _0x5829d6=a30_0x583b;if(_0x406c1c)return _0x406c1c;if(_0x40f3c0){const _0x404ad2=await withSpinner(_0x5829d6(0x1ae),()=>_0x1f6278[_0x5829d6(0x1aa)][_0x5829d6(0x196)](0x1),{'verbose':_0x542782[_0x5829d6(0x141)]});if(_0x404ad2['data'][_0x5829d6(0x12e)]===0x0)return console[_0x5829d6(0x138)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x404ad2[_0x5829d6(0x159)][0x0]['id'];}const _0x1389ec=await selectChatInteractively(_0x1f6278,_0x542782);if(!_0x1389ec)return console[_0x5829d6(0x138)]('\x0aCancelled'),undefined;return _0x1389ec;}async function getProjectIdOrDefault(_0x33b48f){const _0x8c9458=await getProjectWithName(_0x33b48f);return _0x8c9458['id'];}async function getProjectWithName(_0x1de405){const _0x33f378=a30_0x583b,{tdx:_0x5629c6,options:_0x5076ef}=_0x1de405,_0x4771c6=_0x5076ef[_0x33f378(0x1ac)];if(_0x4771c6){const _0x1eb6ea=await withSpinner(_0x33f378(0x13a)+_0x4771c6+_0x33f378(0x150),()=>_0x5629c6[_0x33f378(0x1aa)]['resolveProjectId'](_0x4771c6),{'verbose':_0x5076ef[_0x33f378(0x141)]});return{'id':_0x1eb6ea[_0x33f378(0x159)],'name':_0x4771c6};}const _0x2ac0eb=_0x5629c6[_0x33f378(0x1aa)][_0x33f378(0x14f)]();if(_0x2ac0eb){const _0x42b6bb=await _0x5629c6[_0x33f378(0x1aa)][_0x33f378(0x1b2)](),_0x5df12f=_0x42b6bb[_0x33f378(0x197)](_0xf69d2c=>_0xf69d2c['id']===_0x2ac0eb);return{'id':_0x2ac0eb,'name':_0x5df12f?.[_0x33f378(0x13e)][_0x33f378(0x1ce)]||_0x33f378(0x154)};}const _0x2e3735=await withSpinner(_0x33f378(0x11d),()=>_0x5629c6[_0x33f378(0x1aa)]['getOrCreateDefaultProject'](),{'verbose':_0x5076ef[_0x33f378(0x141)]});return{'id':_0x2e3735['data']['id'],'name':_0x2e3735['data'][_0x33f378(0x13e)]['name']};}function toLLMProjectInfo(_0x298fd4){const _0x583154=a30_0x583b;return{'name':_0x298fd4[_0x583154(0x13e)][_0x583154(0x1ce)],'description':_0x298fd4[_0x583154(0x13e)][_0x583154(0x146)],'createdAt':_0x298fd4[_0x583154(0x13e)][_0x583154(0x16a)],'updatedAt':_0x298fd4[_0x583154(0x13e)][_0x583154(0x1b7)]};}function toAgentInfo(_0x39f0a1){const _0x5c1d2c=a30_0x583b;return{'name':_0x39f0a1[_0x5c1d2c(0x13e)]['name'],'description':_0x39f0a1[_0x5c1d2c(0x13e)][_0x5c1d2c(0x146)],'prompt':truncatePrompt(_0x39f0a1['attributes']['prompt']),'createdAt':_0x39f0a1[_0x5c1d2c(0x13e)]['createdAt'],'updatedAt':_0x39f0a1[_0x5c1d2c(0x13e)][_0x5c1d2c(0x1b7)]};}function truncatePrompt(_0x30baee){const _0x1e4e7c=a30_0x583b;if(!_0x30baee)return undefined;const _0x1d9aa5=0x64;if(_0x30baee[_0x1e4e7c(0x12e)]<=_0x1d9aa5)return _0x30baee;return _0x30baee[_0x1e4e7c(0x169)](0x0,_0x1d9aa5)+'...';}export class LLMModelsCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:models';[a30_0x3f5e91(0x146)]='List\x20available\x20LLM\x20models';async[a30_0x3f5e91(0x1b6)](_0x29c121){const _0x339c06=a30_0x3f5e91,{options:_0x233885,tdx:_0x1e9188}=_0x29c121;try{const _0x57e76e=await withSpinner('Fetching\x20available\x20models...',()=>_0x1e9188[_0x339c06(0x1aa)][_0x339c06(0x107)](),{'verbose':_0x233885[_0x339c06(0x141)]});return await handleSDKOutput(_0x57e76e[_0x339c06(0x159)],_0x233885),0x0;}catch(_0x977e9e){return handleSDKError(_0x977e9e,_0x233885),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']='llm:projects';['description']=a30_0x3f5e91(0x165);async['execute'](_0x64442b){const _0x439226=a30_0x3f5e91,{options:_0x455361,args:_0x37352d,tdx:_0x5d652b}=_0x64442b,_0x22bea1=getChalk(_0x455361),_0x4b85a3=_0x455361[_0x439226(0x1c4)];try{const _0x15f422=_0x37352d[0x0],_0x3d2df5=resolveLimit(_0x455361[_0x439226(0x189)],DEFAULT_LLM_LIMIT),_0xe1c941=await withSpinner(_0x439226(0x10a),()=>_0x5d652b[_0x439226(0x1aa)][_0x439226(0x1b2)](_0x3d2df5),{'verbose':_0x455361[_0x439226(0x141)]});let _0x717c6c=_0xe1c941[_0x439226(0x159)];_0x15f422&&(_0x717c6c=_0xe1c941[_0x439226(0x159)][_0x439226(0x140)](_0x222adf=>matchGlobPattern(_0x222adf[_0x439226(0x13e)]['name'],_0x15f422)));const _0x3f4a2c=_0x455361[_0x439226(0x112)]==='json'||_0x455361[_0x439226(0x112)]==='jsonl'||_0x455361[_0x439226(0x112)]===_0x439226(0x1c5)||_0x455361[_0x439226(0x112)]===_0x439226(0x106);if(_0x3f4a2c){const _0x24181e=_0x717c6c[_0x439226(0x148)](_0x53d81a=>({...toLLMProjectInfo(_0x53d81a),'url':getLLMProjectUrl(_0x4b85a3,_0x53d81a['id'])}));await handleSDKOutput(_0x24181e,_0x455361);}else{const _0x3f7f66=[];if(_0x717c6c[_0x439226(0x12e)]===0x0)_0x3f7f66['push'](_0x22bea1[_0x439226(0x11e)]('No\x20projects\x20found'));else{const _0xa6f5a8=[..._0x717c6c][_0x439226(0x1a1)]((_0x4680ff,_0x109f89)=>_0x4680ff[_0x439226(0x13e)][_0x439226(0x1ce)][_0x439226(0x1cb)](_0x109f89[_0x439226(0x13e)][_0x439226(0x1ce)]));for(const _0x424763 of _0xa6f5a8){const _0x43346a=getLLMProjectUrl(_0x4b85a3,_0x424763['id']),_0x1c8b3e=hyperlink(_0x424763[_0x439226(0x13e)][_0x439226(0x1ce)],_0x43346a);_0x3f7f66['push'](_0x439226(0x118)+_0x1c8b3e);}_0x3f7f66[_0x439226(0x190)](_0x22bea1[_0x439226(0x11e)](_0x717c6c[_0x439226(0x12e)]+'\x20project(s)'));}await writeOutput(_0x3f7f66['join']('\x0a'),_0x455361[_0x439226(0x11f)],_0x439226(0x1c5));}return 0x0;}catch(_0x4e6d49){return handleSDKError(_0x4e6d49,_0x455361),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']='llm:agents';['description']=a30_0x3f5e91(0x1c0);async[a30_0x3f5e91(0x1b6)](_0x192d52){const _0x3b5e7b=a30_0x3f5e91,{options:_0x160ec3,args:_0x275d5c,tdx:_0x47f53f}=_0x192d52,_0x2dcd01=getChalk(_0x160ec3),_0x45f1a2=_0x160ec3[_0x3b5e7b(0x1c4)];try{const _0x5d6261=_0x275d5c[0x0];let _0x431fdc=_0x5d6261,_0x46fe56,_0x5b2070;if(_0x5d6261&&_0x5d6261[_0x3b5e7b(0x14a)]('/')){const _0x32ebe0=_0x5d6261[_0x3b5e7b(0x18d)]('/');if(_0x32ebe0['length']===0x2){const [_0x577e15,_0x2c1454]=_0x32ebe0,_0x460426=await _0x47f53f[_0x3b5e7b(0x1aa)][_0x3b5e7b(0x1b2)](),_0x17b5c5=_0x460426[_0x3b5e7b(0x197)](_0x21934e=>_0x21934e[_0x3b5e7b(0x13e)]['name'][_0x3b5e7b(0x15f)]()===_0x577e15[_0x3b5e7b(0x15f)]());if(!_0x17b5c5)throw new SDKError(ErrorCode[_0x3b5e7b(0x152)],'Project\x20not\x20found:\x20'+_0x577e15,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0x46fe56=_0x17b5c5['id'],_0x5b2070=_0x17b5c5[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)],_0x431fdc=_0x2c1454;}else throw new SDKError(ErrorCode[_0x3b5e7b(0x167)],_0x3b5e7b(0x117)+_0x5d6261,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x11dce9=await getProjectWithName(_0x192d52);_0x46fe56=_0x11dce9['id'],_0x5b2070=_0x11dce9[_0x3b5e7b(0x1ce)];}const _0x8ce25d=await withSpinner(_0x3b5e7b(0x137),()=>_0x47f53f[_0x3b5e7b(0x1aa)]['agents'](_0x46fe56),{'verbose':_0x160ec3[_0x3b5e7b(0x141)]});let _0x5b9bc3=_0x8ce25d['data'];_0x431fdc&&(_0x5b9bc3=_0x8ce25d[_0x3b5e7b(0x159)][_0x3b5e7b(0x140)](_0x129997=>matchGlobPattern(_0x129997[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)],_0x431fdc)));const _0x149b81=_0x160ec3[_0x3b5e7b(0x112)]==='json'||_0x160ec3[_0x3b5e7b(0x112)]==='jsonl'||_0x160ec3[_0x3b5e7b(0x112)]===_0x3b5e7b(0x1c5)||_0x160ec3['format']===_0x3b5e7b(0x106);if(_0x149b81){const _0x1cbe2b=_0x5b9bc3[_0x3b5e7b(0x148)](_0x5082a7=>({...toAgentInfo(_0x5082a7),'chatUrl':getLLMAgentChatUrl(_0x45f1a2,_0x46fe56,_0x5082a7['id'])}));await handleSDKOutput(_0x1cbe2b,_0x160ec3);}else{const _0x10a579=[];_0x10a579[_0x3b5e7b(0x190)](_0x2dcd01['dim']('['+_0x5b2070+']'));if(_0x5b9bc3[_0x3b5e7b(0x12e)]===0x0)_0x10a579['push'](_0x2dcd01[_0x3b5e7b(0x11e)](_0x3b5e7b(0x156)));else{const _0x12d6e6=[..._0x5b9bc3][_0x3b5e7b(0x1a1)]((_0x3417c0,_0x23c9c8)=>_0x3417c0[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)][_0x3b5e7b(0x1cb)](_0x23c9c8[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)]));for(const _0xae2692 of _0x12d6e6){const _0x5c6d79=getLLMAgentChatUrl(_0x45f1a2,_0x46fe56,_0xae2692['id']),_0x1f8a12=hyperlink(_0xae2692[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)],_0x5c6d79);_0x10a579[_0x3b5e7b(0x190)](_0x3b5e7b(0x124)+_0x1f8a12);}_0x10a579[_0x3b5e7b(0x190)](_0x2dcd01[_0x3b5e7b(0x11e)](_0x5b9bc3['length']+_0x3b5e7b(0x1c7)));}await writeOutput(_0x10a579[_0x3b5e7b(0x1c2)]('\x0a'),_0x160ec3[_0x3b5e7b(0x11f)],_0x3b5e7b(0x1c5));}return 0x0;}catch(_0x5d4432){return handleSDKError(_0x5d4432,_0x160ec3),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:agent:show';[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1a4);async[a30_0x3f5e91(0x1b6)](_0x132e26){const _0x2f8165=a30_0x3f5e91,{options:_0xfeb42b,args:_0x2b5fe3,tdx:_0x532b23}=_0x132e26;if(_0x2b5fe3[_0x2f8165(0x12e)]===0x0)return console[_0x2f8165(0x1bf)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x2f8165(0x1bf)](_0x2f8165(0x181)),0x1;const _0x5d79c6=_0x2b5fe3[0x0];try{const _0xefe06d=await getProjectIdOrDefault(_0x132e26),_0x352747=await withSpinner(_0x2f8165(0x18a)+_0x5d79c6+_0x2f8165(0x150),()=>_0x532b23['llm']['resolveAgentId'](_0x5d79c6,_0xefe06d),{'verbose':_0xfeb42b[_0x2f8165(0x141)]}),_0x5e767c=await withSpinner(_0x2f8165(0x191),()=>_0x532b23[_0x2f8165(0x1aa)][_0x2f8165(0x1c1)](_0x352747['data']),{'verbose':_0xfeb42b[_0x2f8165(0x141)]});return await handleSDKOutput([_0x5e767c[_0x2f8165(0x159)]],_0xfeb42b),0x0;}catch(_0x1c2f8c){return handleSDKError(_0x1c2f8c,_0xfeb42b),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a30_0x3f5e91(0x133);[a30_0x3f5e91(0x146)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a30_0x3f5e91(0x1b6)](_0x189287){const _0x47cec2=a30_0x3f5e91,{options:_0x493ef2,args:_0x3fade0,tdx:_0x1034d8}=_0x189287;if(_0x3fade0[_0x47cec2(0x12e)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x47cec2(0x1bf)]('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x446efc=_0x3fade0[0x0],_0x337e03=_0x493ef2,_0x1364a1=_0x337e03['systemPrompt'],_0x439e90=_0x337e03['model']||_0x47cec2(0x176),_0x22c9ed=_0x337e03[_0x47cec2(0x114)],_0x57ae31=_0x337e03['maxToolIterations']?Number(_0x337e03[_0x47cec2(0x160)]):undefined,_0x3eb7e1=_0x337e03[_0x47cec2(0x1d0)]?Number(_0x337e03[_0x47cec2(0x1d0)]):undefined;try{let _0x5e994b,_0x400c08;if(_0x446efc[_0x47cec2(0x14a)]('/')){const _0x1a71f0=_0x446efc[_0x47cec2(0x18d)]('/');if(_0x1a71f0[_0x47cec2(0x12e)]===0x2){const [_0x1a1b2f,_0x2679e4]=_0x1a71f0,_0x17467b=await withSpinner(_0x47cec2(0x13a)+_0x1a1b2f+'\x27...',()=>_0x1034d8[_0x47cec2(0x1aa)][_0x47cec2(0x1c8)](_0x1a1b2f),{'verbose':_0x493ef2[_0x47cec2(0x141)]});_0x5e994b=_0x17467b[_0x47cec2(0x159)],_0x400c08=_0x2679e4;}else throw new SDKError(ErrorCode[_0x47cec2(0x167)],_0x47cec2(0x117)+_0x446efc,undefined,{'helpText':_0x47cec2(0x109)});}else _0x5e994b=await getProjectIdOrDefault(_0x189287),_0x400c08=_0x446efc;const _0x525f93=await withSpinner(_0x47cec2(0x1a3)+_0x400c08+_0x47cec2(0x150),()=>_0x1034d8[_0x47cec2(0x1aa)][_0x47cec2(0x1d7)]({'name':_0x400c08,'projectId':_0x5e994b,'modelType':_0x439e90,'systemPrompt':_0x1364a1,'starterMessage':_0x22c9ed,'maxToolIterations':_0x57ae31,'temperature':_0x3eb7e1}),{'verbose':_0x493ef2[_0x47cec2(0x141)]});return console[_0x47cec2(0x138)](_0x47cec2(0x19a)+_0x525f93['data']['id']),await handleSDKOutput([_0x525f93[_0x47cec2(0x159)]],_0x493ef2),0x0;}catch(_0x1c4cfd){return handleSDKError(_0x1c4cfd,_0x493ef2),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x125);[a30_0x3f5e91(0x146)]='Update\x20an\x20existing\x20agent';async['execute'](_0x2b97e0){const _0x36494a=a30_0x3f5e91,{options:_0x1ffbcc,args:_0x48b581,tdx:_0x2d9346}=_0x2b97e0;if(_0x48b581['length']===0x0)return console['error'](_0x36494a(0x15a)),console[_0x36494a(0x1bf)](_0x36494a(0x18e)),0x1;const _0x18390b=_0x48b581[0x0],_0x4b0230=_0x1ffbcc,_0x9b8df9=_0x4b0230['name'],_0x459ef1=_0x4b0230[_0x36494a(0x101)],_0x379487=_0x4b0230[_0x36494a(0x146)],_0xee6707=_0x4b0230[_0x36494a(0x114)];if(!_0x9b8df9&&!_0x459ef1&&!_0x379487&&!_0xee6707)return console[_0x36494a(0x1bf)](_0x36494a(0x128)),console[_0x36494a(0x1bf)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0xb023f5=await getProjectIdOrDefault(_0x2b97e0),_0xa60144=await withSpinner(_0x36494a(0x18a)+_0x18390b+'\x27...',()=>_0x2d9346['llm']['resolveAgentId'](_0x18390b,_0xb023f5),{'verbose':_0x1ffbcc[_0x36494a(0x141)]}),_0x605416=_0xa60144[_0x36494a(0x159)],_0x3386ad=await withSpinner(_0x36494a(0x18c),()=>_0x2d9346[_0x36494a(0x1aa)][_0x36494a(0x182)](_0x605416,{'name':_0x9b8df9,'prompt':_0x459ef1,'description':_0x379487,'starterMessage':_0xee6707}),{'verbose':_0x1ffbcc['verbose']});return console[_0x36494a(0x138)]('Agent\x20updated:\x20'+_0x3386ad[_0x36494a(0x159)]['id']),await handleSDKOutput([_0x3386ad[_0x36494a(0x159)]],_0x1ffbcc),0x0;}catch(_0x43adca){return handleSDKError(_0x43adca,_0x1ffbcc),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x1cc);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x12c);async[a30_0x3f5e91(0x1b6)](_0x540e57){const _0x4d385a=a30_0x3f5e91,{options:_0x4bbe45,args:_0xe76617,tdx:_0x20ba7d}=_0x540e57;if(_0xe76617[_0x4d385a(0x12e)]===0x0)return console[_0x4d385a(0x1bf)](_0x4d385a(0x15a)),console[_0x4d385a(0x1bf)](_0x4d385a(0x1b9)),0x1;const _0x59808d=_0xe76617[0x0];try{const _0x1fbe22=await getProjectIdOrDefault(_0x540e57),_0xf88732=await withSpinner(_0x4d385a(0x18a)+_0x59808d+_0x4d385a(0x150),()=>_0x20ba7d[_0x4d385a(0x1aa)]['resolveAgentId'](_0x59808d,_0x1fbe22),{'verbose':_0x4bbe45[_0x4d385a(0x141)]}),_0x5f5ddb=_0xf88732[_0x4d385a(0x159)];return await withSpinner('Deleting\x20agent...',()=>_0x20ba7d[_0x4d385a(0x1aa)][_0x4d385a(0x126)](_0x5f5ddb),{'verbose':_0x4bbe45[_0x4d385a(0x141)]}),console[_0x4d385a(0x138)](_0x4d385a(0x153)+_0x5f5ddb),0x0;}catch(_0x22f5b3){return handleSDKError(_0x22f5b3,_0x4bbe45),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x1a5);['description']=a30_0x3f5e91(0x1a8);async['execute'](_0x42d886){const _0x16b25b=a30_0x3f5e91;return executeChatHistoryCommand(_0x42d886,_0x16b25b(0x188));}}export class LLMUseCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x1df);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1a0);async['execute'](_0x5199f6){const _0x512950=a30_0x3f5e91,{options:_0x4d050e,args:_0x5d57fb,tdx:_0xe99024}=_0x5199f6;if(_0x5d57fb['length']===0x0)return console[_0x512950(0x1bf)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x512950(0x1bf)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x38dc83=_0x5d57fb[0x0];try{await withSpinner(_0x512950(0x1db)+_0x38dc83+_0x512950(0x150),()=>_0xe99024[_0x512950(0x1aa)][_0x512950(0x1af)](_0x38dc83),{'verbose':_0x4d050e['verbose']}),saveSessionContext({'llm_project':_0x38dc83},_0x4d050e['session']);const _0x1593a8=getChalk(_0x4d050e);return console[_0x512950(0x138)](_0x512950(0x130)+_0x1593a8[_0x512950(0x192)](_0x38dc83)),0x0;}catch(_0x29c0ea){return handleSDKError(_0x29c0ea,_0x4d050e),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x134);['description']=a30_0x3f5e91(0x120);async['execute'](_0x5496ad){const _0x4ea100=a30_0x3f5e91,{options:_0x4ddc47,args:_0x578247,tdx:_0x28ed95}=_0x5496ad;if(_0x578247['length']===0x0)return console['error'](_0x4ea100(0x1a2)),console['error']('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x203f37=_0x578247[0x0],_0x301182=_0x4ddc47,_0x137439=_0x301182[_0x4ea100(0x146)];try{const _0x5873ef=await withSpinner('Creating\x20project\x20\x27'+_0x203f37+_0x4ea100(0x150),()=>_0x28ed95[_0x4ea100(0x1aa)]['createProject']({'name':_0x203f37,'description':_0x137439}),{'verbose':_0x4ddc47[_0x4ea100(0x141)]});console[_0x4ea100(0x138)](_0x4ea100(0x15d)+_0x5873ef[_0x4ea100(0x159)]['id']);const _0xe60fab=toLLMProjectInfo(_0x5873ef[_0x4ea100(0x159)]);return await handleSDKOutput([_0xe60fab],_0x4ddc47),0x0;}catch(_0x289fc7){return handleSDKError(_0x289fc7,_0x4ddc47),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:project:delete';['description']='Delete\x20an\x20LLM\x20project';async[a30_0x3f5e91(0x1b6)](_0x391c40){const _0x45ec4f=a30_0x3f5e91,{options:_0x5c584d,args:_0x12c8f6,tdx:_0x54e69c}=_0x391c40;if(_0x12c8f6[_0x45ec4f(0x12e)]===0x0)return console[_0x45ec4f(0x1bf)](_0x45ec4f(0x1a2)),console['error'](_0x45ec4f(0x144)),0x1;const _0xdc142e=_0x12c8f6[0x0];try{return await withSpinner(_0x45ec4f(0x135)+_0xdc142e+_0x45ec4f(0x150),()=>_0x54e69c[_0x45ec4f(0x1aa)][_0x45ec4f(0x105)](_0xdc142e),{'verbose':_0x5c584d[_0x45ec4f(0x141)]}),console[_0x45ec4f(0x138)](_0x45ec4f(0x119)+_0xdc142e),0x0;}catch(_0x183010){return handleSDKError(_0x183010,_0x5c584d),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x10d);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1e1);async['execute'](_0x3fdcfc){const _0xcc55f2=a30_0x3f5e91,{options:_0x2c3230,args:_0x322266,tdx:_0x3e731f}=_0x3fdcfc,_0x3e4747=getChalk(_0x2c3230);console['log'](_0x3e4747[_0xcc55f2(0x186)](_0xcc55f2(0x19b))),console[_0xcc55f2(0x138)](_0x3e4747[_0xcc55f2(0x186)](_0xcc55f2(0x1b4))),console[_0xcc55f2(0x138)](_0x3e4747['dim']('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console['log']();if(_0x322266[_0xcc55f2(0x12e)]===0x0)return console[_0xcc55f2(0x1bf)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xcc55f2(0x1bf)](_0xcc55f2(0x104)),0x1;const _0x1a14ac=_0x322266[0x0],_0x26599e=_0x2c3230,_0x2a76b3=_0x26599e['output'],_0x4a2c7b=_0x26599e['dryRun'];try{const _0xe3402b=_0x2a76b3||_0x1a14ac+'.llm';if(a30_0x119a70[_0xcc55f2(0x16e)](_0xe3402b)&&!_0x4a2c7b){if(!_0x2c3230[_0xcc55f2(0x14d)]){const _0x3ae96e=await confirm(_0xcc55f2(0x1d8)+_0xe3402b+_0xcc55f2(0x14c));if(!_0x3ae96e)return console[_0xcc55f2(0x138)](_0xcc55f2(0x1b1)),0x0;}a30_0x119a70['rmSync'](_0xe3402b,{'recursive':!![]});}const _0xf7b439=await withSpinner(_0x4a2c7b?_0xcc55f2(0x1bd)+_0x1a14ac+_0xcc55f2(0x150):_0xcc55f2(0x1d3)+_0x1a14ac+_0xcc55f2(0x150),()=>_0x3e731f[_0xcc55f2(0x1aa)][_0xcc55f2(0x168)](_0x1a14ac,_0x2a76b3,{'dryRun':_0x4a2c7b}),{'verbose':_0x2c3230[_0xcc55f2(0x141)]}),_0x5a0ace=_0xf7b439[_0xcc55f2(0x159)];return _0x4a2c7b?console['log'](_0xcc55f2(0x11a)+_0x5a0ace[_0xcc55f2(0x1c3)]):console[_0xcc55f2(0x138)](_0xcc55f2(0x108)+_0x5a0ace[_0xcc55f2(0x1c3)]),console[_0xcc55f2(0x138)](_0xcc55f2(0x16f)+_0x5a0ace[_0xcc55f2(0x19c)]['agents']),console[_0xcc55f2(0x138)](_0xcc55f2(0x10f)+_0x5a0ace[_0xcc55f2(0x19c)]['knowledgeBases']),console[_0xcc55f2(0x138)](_0xcc55f2(0x1b3)+_0x5a0ace['counts'][_0xcc55f2(0x1b0)]),console[_0xcc55f2(0x138)](_0xcc55f2(0x13d)+_0x5a0ace[_0xcc55f2(0x19c)][_0xcc55f2(0x17c)]),(_0x2c3230['format']===_0xcc55f2(0x11b)||_0x2c3230[_0xcc55f2(0x112)]===_0xcc55f2(0x180))&&await handleSDKOutput([_0x5a0ace],_0x2c3230),0x0;}catch(_0x3786e3){return handleSDKError(_0x3786e3,_0x2c3230),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:project:restore';[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x129);async[a30_0x3f5e91(0x1b6)](_0x378bb2){const _0x1f62d1=a30_0x3f5e91,{options:_0x875098,args:_0x144b9a,tdx:_0x414d59}=_0x378bb2,_0x135d7f=getChalk(_0x875098);console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x186)](_0x1f62d1(0x1a6))),console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x186)](_0x1f62d1(0x199))),console[_0x1f62d1(0x138)](_0x135d7f['dim'](_0x1f62d1(0x127))),console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x11e)](_0x1f62d1(0x163))),console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x11e)](_0x1f62d1(0x174))),console[_0x1f62d1(0x138)]();if(_0x144b9a[_0x1f62d1(0x12e)]===0x0)return console['error'](_0x1f62d1(0x1a9)),console[_0x1f62d1(0x1bf)](_0x1f62d1(0x131)),0x1;const _0x29e7e2=_0x144b9a[0x0],_0x41974c=_0x875098,_0x1d9ba5=_0x41974c['name'],_0x40127c=_0x41974c[_0x1f62d1(0x170)];try{if(!_0x40127c){const _0x41ec9f=_0x414d59[_0x1f62d1(0x1aa)][_0x1f62d1(0x142)](_0x29e7e2),_0x4f0d0c=_0x1d9ba5||_0x41ec9f['exportedFrom'][_0x1f62d1(0x1d4)],_0xa216cf=await withSpinner(_0x1f62d1(0x183),()=>_0x414d59[_0x1f62d1(0x1aa)][_0x1f62d1(0x1b2)](),{'verbose':_0x875098['verbose']}),_0x5ac6f9=_0xa216cf['data'][_0x1f62d1(0x197)](_0x57a24b=>_0x57a24b['attributes'][_0x1f62d1(0x1ce)]===_0x4f0d0c);if(_0x5ac6f9&&!_0x875098['yes']){const _0x3e0113=await confirm(_0x1f62d1(0x10b)+_0x4f0d0c+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x3e0113)return console[_0x1f62d1(0x138)](_0x1f62d1(0x13f)),0x0;}}const _0xca5c4a=await withSpinner(_0x40127c?_0x1f62d1(0x17e)+_0x29e7e2+_0x1f62d1(0x150):_0x1f62d1(0x1cd)+_0x29e7e2+_0x1f62d1(0x150),()=>_0x414d59[_0x1f62d1(0x1aa)][_0x1f62d1(0x179)](_0x29e7e2,{'name':_0x1d9ba5,'dryRun':_0x40127c}),{'verbose':_0x875098[_0x1f62d1(0x141)]}),_0x3237e4=_0xca5c4a[_0x1f62d1(0x159)];return _0x3237e4[_0x1f62d1(0x184)]&&console[_0x1f62d1(0x138)](_0x1f62d1(0x158)+_0x3237e4[_0x1f62d1(0x184)]+'\x27'),_0x40127c?console[_0x1f62d1(0x138)](_0x1f62d1(0x12f)+_0x3237e4[_0x1f62d1(0x1d4)]):console[_0x1f62d1(0x138)]('Project\x20restored:\x20'+_0x3237e4[_0x1f62d1(0x1d4)]+'\x20('+_0x3237e4['projectId']+')'),console[_0x1f62d1(0x138)](_0x1f62d1(0x16f)+_0x3237e4['counts'][_0x1f62d1(0x1d2)]),console[_0x1f62d1(0x138)](_0x1f62d1(0x10f)+_0x3237e4['counts'][_0x1f62d1(0x15b)]),console[_0x1f62d1(0x138)](_0x1f62d1(0x1b3)+_0x3237e4[_0x1f62d1(0x19c)][_0x1f62d1(0x1b0)]),console[_0x1f62d1(0x138)](_0x1f62d1(0x13d)+_0x3237e4[_0x1f62d1(0x19c)][_0x1f62d1(0x17c)]),(_0x875098['format']===_0x1f62d1(0x11b)||_0x875098[_0x1f62d1(0x112)]===_0x1f62d1(0x180))&&await handleSDKOutput([_0x3237e4],_0x875098),0x0;}catch(_0x3aee26){return handleSDKError(_0x3aee26,_0x875098),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x383dd0,_0x44046a){const _0x3735bd=a30_0x3f5e91,_0x2f05f8=_0x44046a[_0x3735bd(0x189)]||CHAT_SELECTOR_PAGE_SIZE;let _0xe93561=0x0,_0x29df33=[];const _0x531248=(await import(_0x3735bd(0x1b0)))[_0x3735bd(0x19f)],_0x134cf2=getChalk(_0x44046a);while(!![]){const _0x261379=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x383dd0['llm'][_0x3735bd(0x196)](_0x2f05f8+_0xe93561),{'verbose':_0x44046a[_0x3735bd(0x141)]});_0x29df33=_0x261379['data'];const _0x86f8d0=_0x29df33[_0x3735bd(0x169)](_0xe93561,_0xe93561+_0x2f05f8),_0x64303b=_0x29df33[_0x3735bd(0x12e)]>_0xe93561+_0x2f05f8,_0x52cfbc=[...new Set(_0x86f8d0['map'](_0x5ac211=>_0x5ac211[_0x3735bd(0x13e)][_0x3735bd(0x145)])[_0x3735bd(0x140)](_0x12c79a=>_0x12c79a!==undefined))],_0x4bd9c7=new Map();await Promise[_0x3735bd(0x16c)](_0x52cfbc[_0x3735bd(0x148)](async _0x35a9f1=>{const _0x229e77=_0x3735bd;try{const _0x214844=await _0x383dd0['llm'][_0x229e77(0x1c1)](_0x35a9f1);_0x4bd9c7['set'](_0x35a9f1,_0x214844[_0x229e77(0x13e)][_0x229e77(0x1ce)]);}catch{_0x4bd9c7[_0x229e77(0x139)](_0x35a9f1,_0x35a9f1);}}));const _0x3c09a4=_0x86f8d0[_0x3735bd(0x148)](_0x6aafed=>{const _0x3b231f=_0x3735bd,_0x13804e=_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x155)]||_0x3b231f(0x14b),_0x30820b=_0x13804e[_0x3b231f(0x18d)]('\x0a')[0x0],_0x39f38b=_0x30820b[_0x3b231f(0x12e)]>0x50?_0x30820b[_0x3b231f(0x195)](0x0,0x4d)+_0x3b231f(0x147):_0x30820b,_0x4ac811=_0x6aafed[_0x3b231f(0x13e)]['agentId']?_0x4bd9c7[_0x3b231f(0x193)](_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x145)])||_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x145)]:'(no\x20agent)',_0xf5cb9a=_0x6aafed['attributes']['lastConversationAt']||_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x1b7)],_0x542d39=new Date(_0xf5cb9a),_0x47916a=new Date(),_0x41ebb3=_0x47916a[_0x3b231f(0x1ad)]()-_0x542d39['getTime'](),_0x1bdeb0=Math[_0x3b231f(0x12b)](_0x41ebb3/0xea60),_0x4572a2=Math[_0x3b231f(0x12b)](_0x41ebb3/0x36ee80),_0x11228a=Math['floor'](_0x41ebb3/0x5265c00);let _0x2d6dd0;if(_0x1bdeb0<0x1)_0x2d6dd0=_0x3b231f(0x161);else{if(_0x1bdeb0<0x3c)_0x2d6dd0=_0x1bdeb0+_0x3b231f(0x18f);else{if(_0x4572a2<0x18)_0x2d6dd0=_0x4572a2+_0x3b231f(0x1be);else _0x11228a<0x7?_0x2d6dd0=_0x11228a+_0x3b231f(0x1d1):_0x2d6dd0=_0x542d39[_0x3b231f(0x121)](_0x3b231f(0x102),{'month':_0x3b231f(0x1dd),'day':_0x3b231f(0x103)});}}return{'title':_0x39f38b+'\x20'+_0x134cf2[_0x3b231f(0x11e)]('['+_0x4ac811+']\x20'+_0x2d6dd0),'value':_0x6aafed['id']};});_0x64303b&&_0x3c09a4[_0x3735bd(0x190)]({'title':_0x134cf2[_0x3735bd(0x1a7)](_0x3735bd(0x171)),'value':_0x3735bd(0x115)});const _0x161492=await _0x531248({'type':_0x3735bd(0x13b),'name':_0x3735bd(0x177),'message':_0x3735bd(0x17b),'choices':_0x3c09a4,'hint':_0x3735bd(0x12d)});if(!_0x161492[_0x3735bd(0x177)])return undefined;if(_0x161492[_0x3735bd(0x177)]==='__load_more__'){_0xe93561+=_0x2f05f8;continue;}return _0x161492[_0x3735bd(0x177)];}}function a30_0x19b6(){const _0x5ca86b=['[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','data','Error:\x20Agent\x20name\x20is\x20required','knowledgeBases','\x20\x20Cause:\x20','Project\x20created:\x20','[image]\x20\x20','toLowerCase','maxToolIterations','just\x20now','[input]\x20\x20','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','image','List\x20all\x20LLM\x20projects','llm:log','INVALID_ARGUMENT','backupProject','slice','createdAt','Error:\x20','all','No\x20messages\x20found\x20in\x20chat\x20history.','existsSync','\x20\x20Agents:\x20','dryRun','Load\x20more...','71431CGiASL','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','[unknown]','claude-4.5-haiku','chatId','history','restoreProject','keys','Select\x20a\x20chat\x20session:','integrations','content','Validating\x20backup\x20from\x20\x27','\x20-\x20','jsonl','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','updateAgent','Checking\x20for\x20existing\x20projects...','sourceSite','153848HNqcgI','yellow','last','tdx\x20llm\x20history','limit','Resolving\x20agent\x20\x27','magenta','Updating\x20agent...','split','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','m\x20ago','push','Fetching\x20agent...','green','get','targetWebSearchTool','substring','chats','find','\x20->\x20ImageGen:','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','Agent\x20created:\x20','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','counts','stringify','bold','default','Set\x20current\x20project\x20context','sort','Error:\x20Project\x20name\x20is\x20required','Creating\x20agent\x20\x27','Show\x20agent\x20details','llm:history','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','cyan','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Error:\x20Backup\x20folder\x20path\x20is\x20required','llm','entries','llmProject','getTime','Fetching\x20most\x20recent\x20chat...','setCurrentProject','prompts','Backup\x20cancelled.','projects','\x20\x20Prompts:\x20','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','1119328VXApdE','execute','updatedAt','1645272dkRmvG','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','red','message','Fetching\x20chat\x20log\x20for\x20\x27','Analyzing\x20project\x20\x27','h\x20ago','error','List\x20agents\x20in\x20current\x20project','agent','join','outputDir','site','table','\x20→\x20chat:\x20','\x20agent(s)','resolveProjectId','\x20->\x20Agent:','1561150VyPlZv','localeCompare','llm:agent:delete','Restoring\x20project\x20from\x20\x27','name','[tool_call]','temperature','d\x20ago','agents','Backing\x20up\x20project\x20\x27','projectName','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','[output]\x20','createAgent','Output\x20directory\x20\x27','tool','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','Setting\x20project\x20context\x20to\x20\x27','blue','short','9zUgRxw','llm:use','input','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','prompt','en-US','numeric','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','deleteProject','tsv','models','Project\x20backed\x20up\x20to:\x20','Use\x20format:\x20project-name/agent-name','Fetching\x20projects...','A\x20project\x20named\x20\x27','string','llm:project:backup','933240zabpAU','\x20\x20Knowledge\x20Bases:\x20','[content]','targetKnowledgeBase','format','tool_call','starterMessage','__load_more__','tdx\x20chats','Invalid\x20path\x20syntax:\x20','⚒️\x20','Project\x20deleted:\x20','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','json','Error:\x20chat-id\x20is\x20required','Getting\x20default\x20project...','dim','output','Create\x20a\x20new\x20LLM\x20project','toLocaleDateString','2116254puqmsz','Fetching\x20chat\x20sessions...','🤖\x20','llm:agent:update','deleteAgent','\x20\x20\x20Examples:','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','cause','floor','Delete\x20an\x20agent','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','length','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Session\x20llm_project\x20set\x20to:\x20','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','stack','llm:agent:create','llm:project:create','Deleting\x20project\x20\x27','\x20->\x20WebSearch:','Fetching\x20agents...','log','set','Resolving\x20project\x20\x27','select','\x0aStack\x20trace:','\x20\x20Integrations:\x20','attributes','Restore\x20cancelled.','filter','verbose','getBackupMetadata','15SxqusQ','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','agentId','description','...','map','targetImageGenerator','includes','(no\x20message)','\x27\x20already\x20exists.\x20Overwrite?','yes','targetAgent','getCurrentProject','\x27...','Show\x20chat\x20log','LLM_PROJECT_NOT_FOUND','Agent\x20deleted:\x20','Unknown','firstInputContent','No\x20agents\x20found','\x20->\x20KB:'];a30_0x19b6=function(){return _0x5ca86b;};return a30_0x19b6();}export class ChatsCommand extends BaseCommand{['name']=a30_0x3f5e91(0x196);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1d5);async[a30_0x3f5e91(0x1b6)](_0x45155a){const _0x14e193=a30_0x3f5e91;return executeChatHistoryCommand(_0x45155a,_0x14e193(0x116));}}export class LLMLogCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x166);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x151);async[a30_0x3f5e91(0x1b6)](_0x3ba5d3){const _0x4f1388=a30_0x3f5e91,{options:_0x1576d8,args:_0xfea022,tdx:_0x150e99}=_0x3ba5d3,_0x477f2b=_0xfea022[0x0];if(!_0x477f2b)return console[_0x4f1388(0x1bf)](_0x4f1388(0x11c)),console['error'](_0x4f1388(0x1da)),0x1;const _0x242d2e=await withSpinner(_0x4f1388(0x1bc)+_0x477f2b+_0x4f1388(0x150),()=>_0x150e99[_0x4f1388(0x1aa)]['getChatLog'](_0x477f2b),{'verbose':_0x1576d8[_0x4f1388(0x141)]});return await handleSDKOutput(_0x242d2e[_0x4f1388(0x159)]['data'],_0x1576d8),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3a85e6=a31_0x4e2a;(function(_0x1e5b7f,_0xac17fa){const _0x82c13f=a31_0x4e2a,_0x5b2c89=_0x1e5b7f();while(!![]){try{const _0x16ac3b=parseInt(_0x82c13f(0x1bc))/0x1*(-parseInt(_0x82c13f(0x1c9))/0x2)+-parseInt(_0x82c13f(0x1b9))/0x3*(-parseInt(_0x82c13f(0x1c2))/0x4)+parseInt(_0x82c13f(0x1c3))/0x5*(parseInt(_0x82c13f(0x1ce))/0x6)+-parseInt(_0x82c13f(0x1c5))/0x7*(parseInt(_0x82c13f(0x1be))/0x8)+-parseInt(_0x82c13f(0x1bf))/0x9+parseInt(_0x82c13f(0x1c1))/0xa*(-parseInt(_0x82c13f(0x1b6))/0xb)+parseInt(_0x82c13f(0x1ca))/0xc*(parseInt(_0x82c13f(0x1c0))/0xd);if(_0x16ac3b===_0xac17fa)break;else _0x5b2c89['push'](_0x5b2c89['shift']());}catch(_0x235371){_0x5b2c89['push'](_0x5b2c89['shift']());}}}(a31_0x38d7,0x41982));import{BaseCommand}from'./command.js';function a31_0x38d7(){const _0x19ef93=['52DcOvFE','130gwBeaj','28gkmztE','696530NSBSWe','mcp','14egUYoZ','error','TDX_PROFILE','../mcp/server.js','12lNfaUL','3215832NefPiW','site','MCP\x20server\x20error:\x20','name','18hGKLzM','apiKey','TDX_API_KEY','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','TDX_SITE','194997WLAtvU','message','context','16194bjDnnn','description','profile','72724wuLVES','accessToken','2144000JjjxlJ','505611QxpczZ'];a31_0x38d7=function(){return _0x19ef93;};return a31_0x38d7();}function a31_0x4e2a(_0x32e927,_0x1859b0){_0x32e927=_0x32e927-0x1b4;const _0x38d76c=a31_0x38d7();let _0x4e2a9c=_0x38d76c[_0x32e927];return _0x4e2a9c;}export class MCPCommand extends BaseCommand{[a31_0x3a85e6(0x1cd)]=a31_0x3a85e6(0x1c4);[a31_0x3a85e6(0x1ba)]=a31_0x3a85e6(0x1b4);async['execute'](_0x3d965d){const _0x409aa3=a31_0x3a85e6,{tdx:_0x8f9b5b}=_0x3d965d,_0x4dbc23={};if(process.env.TDX_PROFILE)_0x4dbc23[_0x409aa3(0x1c7)]=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x4dbc23[_0x409aa3(0x1d0)]=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x4dbc23[_0x409aa3(0x1b5)]=process.env.TDX_SITE);else{if(_0x8f9b5b[_0x409aa3(0x1b8)][_0x409aa3(0x1bd)])_0x4dbc23['TDX_ACCESS_TOKEN']=_0x8f9b5b[_0x409aa3(0x1b8)][_0x409aa3(0x1bd)],_0x4dbc23[_0x409aa3(0x1b5)]=_0x8f9b5b[_0x409aa3(0x1b8)][_0x409aa3(0x1cb)];else _0x8f9b5b[_0x409aa3(0x1b8)][_0x409aa3(0x1cf)]&&(_0x4dbc23[_0x409aa3(0x1d0)]=_0x8f9b5b[_0x409aa3(0x1b8)][_0x409aa3(0x1cf)],_0x4dbc23['TDX_SITE']=_0x8f9b5b[_0x409aa3(0x1b8)]['site']);}}_0x8f9b5b['context']['profile']&&(_0x4dbc23[_0x409aa3(0x1c7)]=_0x8f9b5b[_0x409aa3(0x1b8)][_0x409aa3(0x1bb)]);try{const {startMCPServer:_0x2a855c}=await import(_0x409aa3(0x1c8));return await _0x2a855c({'env':_0x4dbc23}),0x0;}catch(_0x3df9eb){const _0x71df5f=_0x3df9eb instanceof Error?_0x3df9eb[_0x409aa3(0x1b7)]:String(_0x3df9eb);return console[_0x409aa3(0x1c6)](_0x409aa3(0x1cc)+_0x71df5f),0x1;}}}
1
+ const a31_0x1cc834=a31_0x49ad;(function(_0x41b9d7,_0x5676b8){const _0x5b99b7=a31_0x49ad,_0x6ee7be=_0x41b9d7();while(!![]){try{const _0x4621e9=parseInt(_0x5b99b7(0xf9))/0x1*(parseInt(_0x5b99b7(0x10e))/0x2)+-parseInt(_0x5b99b7(0xfa))/0x3+parseInt(_0x5b99b7(0x101))/0x4*(parseInt(_0x5b99b7(0xff))/0x5)+parseInt(_0x5b99b7(0x106))/0x6+-parseInt(_0x5b99b7(0x104))/0x7*(parseInt(_0x5b99b7(0x109))/0x8)+parseInt(_0x5b99b7(0xf5))/0x9+-parseInt(_0x5b99b7(0x10f))/0xa*(-parseInt(_0x5b99b7(0x108))/0xb);if(_0x4621e9===_0x5676b8)break;else _0x6ee7be['push'](_0x6ee7be['shift']());}catch(_0x378bf9){_0x6ee7be['push'](_0x6ee7be['shift']());}}}(a31_0x5c23,0x3e139));import{BaseCommand}from'./command.js';function a31_0x5c23(){const _0x168e2d=['TDX_ACCESS_TOKEN','message','MCP\x20server\x20error:\x20','982NQqvDH','247730wZBhrJ','485811awVoMr','TDX_API_KEY','site','error','292lPTwlJ','367191bNQRoF','accessToken','mcp','TDX_SITE','profile','5TWkTmL','apiKey','567964DbzrSa','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','TDX_PROFILE','2946265LuxqPX','context','73806eSEyhd','description','198CAqbVb','8nRuSmV','name'];a31_0x5c23=function(){return _0x168e2d;};return a31_0x5c23();}function a31_0x49ad(_0x4e76ab,_0x10260c){_0x4e76ab=_0x4e76ab-0xf5;const _0x5c23fa=a31_0x5c23();let _0x49adca=_0x5c23fa[_0x4e76ab];return _0x49adca;}export class MCPCommand extends BaseCommand{[a31_0x1cc834(0x10a)]=a31_0x1cc834(0xfc);[a31_0x1cc834(0x107)]=a31_0x1cc834(0x102);async['execute'](_0x493ed6){const _0x25965e=a31_0x1cc834,{tdx:_0x1480ea}=_0x493ed6,_0x2e4352={};if(process.env.TDX_PROFILE)_0x2e4352[_0x25965e(0x103)]=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x2e4352[_0x25965e(0xf6)]=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x2e4352[_0x25965e(0xfd)]=process.env.TDX_SITE);else{if(_0x1480ea[_0x25965e(0x105)][_0x25965e(0xfb)])_0x2e4352[_0x25965e(0x10b)]=_0x1480ea['context'][_0x25965e(0xfb)],_0x2e4352[_0x25965e(0xfd)]=_0x1480ea[_0x25965e(0x105)]['site'];else _0x1480ea[_0x25965e(0x105)][_0x25965e(0x100)]&&(_0x2e4352[_0x25965e(0xf6)]=_0x1480ea[_0x25965e(0x105)]['apiKey'],_0x2e4352[_0x25965e(0xfd)]=_0x1480ea[_0x25965e(0x105)][_0x25965e(0xf7)]);}}_0x1480ea['context'][_0x25965e(0xfe)]&&(_0x2e4352['TDX_PROFILE']=_0x1480ea[_0x25965e(0x105)][_0x25965e(0xfe)]);try{const {startMCPServer:_0x3113fd}=await import('../mcp/server.js');return await _0x3113fd({'env':_0x2e4352}),0x0;}catch(_0x40e873){const _0x25a768=_0x40e873 instanceof Error?_0x40e873[_0x25965e(0x10c)]:String(_0x40e873);return console[_0x25965e(0xf8)](_0x25965e(0x10d)+_0x25a768),0x1;}}}