@treasuredata/tdx 0.7.4 → 0.8.1

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 (205) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.d.ts +2 -2
  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/client/cdp-api-client.d.ts +40 -1
  10. package/dist/client/cdp-api-client.d.ts.map +1 -1
  11. package/dist/client/cdp-api-client.js +1 -1
  12. package/dist/client/cdp-api-client.js.map +1 -1
  13. package/dist/client/engage-api-client.js +1 -1
  14. package/dist/client/http-client.js +1 -1
  15. package/dist/client/llm-api-client.js +1 -1
  16. package/dist/client/rate-limiter.js +1 -1
  17. package/dist/client/td-api-client.d.ts +21 -1
  18. package/dist/client/td-api-client.d.ts.map +1 -1
  19. package/dist/client/td-api-client.js +1 -1
  20. package/dist/client/td-api-client.js.map +1 -1
  21. package/dist/client/trino-api-client.js +1 -1
  22. package/dist/client/workflow-client.js +1 -1
  23. package/dist/commands/activations.js +1 -1
  24. package/dist/commands/api-command.js +1 -1
  25. package/dist/commands/auth-command.js +1 -1
  26. package/dist/commands/chat-command.js +1 -1
  27. package/dist/commands/claude-command.d.ts.map +1 -1
  28. package/dist/commands/claude-command.js +1 -1
  29. package/dist/commands/claude-command.js.map +1 -1
  30. package/dist/commands/claude-statusline-command.d.ts +1 -1
  31. package/dist/commands/claude-statusline-command.d.ts.map +1 -1
  32. package/dist/commands/claude-statusline-command.js +1 -1
  33. package/dist/commands/claude-statusline-command.js.map +1 -1
  34. package/dist/commands/claude-usage-command.js +1 -1
  35. package/dist/commands/command.js +1 -1
  36. package/dist/commands/connection-command.d.ts +28 -0
  37. package/dist/commands/connection-command.d.ts.map +1 -0
  38. package/dist/commands/connection-command.js +1 -0
  39. package/dist/commands/connection-command.js.map +1 -0
  40. package/dist/commands/context-command.js +1 -1
  41. package/dist/commands/databases.js +1 -1
  42. package/dist/commands/describe.js +1 -1
  43. package/dist/commands/engage-command.js +1 -1
  44. package/dist/commands/job-command.js +1 -1
  45. package/dist/commands/llm-command.js +1 -1
  46. package/dist/commands/llm-proxy.js +1 -1
  47. package/dist/commands/parent-segment-command.d.ts +16 -5
  48. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  49. package/dist/commands/parent-segment-command.js +1 -1
  50. package/dist/commands/parent-segment-command.js.map +1 -1
  51. package/dist/commands/profiles-command.js +1 -1
  52. package/dist/commands/query-command.js +1 -1
  53. package/dist/commands/segment-command.d.ts +35 -22
  54. package/dist/commands/segment-command.d.ts.map +1 -1
  55. package/dist/commands/segment-command.js +1 -1
  56. package/dist/commands/segment-command.js.map +1 -1
  57. package/dist/commands/segment-create-command.d.ts +2 -0
  58. package/dist/commands/segment-create-command.d.ts.map +1 -1
  59. package/dist/commands/segment-create-command.js +1 -1
  60. package/dist/commands/segment-create-command.js.map +1 -1
  61. package/dist/commands/segment-fields-command.js +1 -1
  62. package/dist/commands/segment-pull-command.d.ts +21 -0
  63. package/dist/commands/segment-pull-command.d.ts.map +1 -0
  64. package/dist/commands/segment-pull-command.js +1 -0
  65. package/dist/commands/segment-pull-command.js.map +1 -0
  66. package/dist/commands/segment-push-command.d.ts +21 -0
  67. package/dist/commands/segment-push-command.d.ts.map +1 -0
  68. package/dist/commands/segment-push-command.js +1 -0
  69. package/dist/commands/segment-push-command.js.map +1 -0
  70. package/dist/commands/segment-update-command.d.ts +2 -0
  71. package/dist/commands/segment-update-command.d.ts.map +1 -1
  72. package/dist/commands/segment-update-command.js +1 -1
  73. package/dist/commands/segment-update-command.js.map +1 -1
  74. package/dist/commands/segment-use-command.d.ts.map +1 -1
  75. package/dist/commands/segment-use-command.js +1 -1
  76. package/dist/commands/segment-use-command.js.map +1 -1
  77. package/dist/commands/segments.d.ts +11 -19
  78. package/dist/commands/segments.d.ts.map +1 -1
  79. package/dist/commands/segments.js +1 -1
  80. package/dist/commands/segments.js.map +1 -1
  81. package/dist/commands/show.js +1 -1
  82. package/dist/commands/tables.js +1 -1
  83. package/dist/commands/use-command.js +1 -1
  84. package/dist/commands/user-command.d.ts +23 -0
  85. package/dist/commands/user-command.d.ts.map +1 -0
  86. package/dist/commands/user-command.js +1 -0
  87. package/dist/commands/user-command.js.map +1 -0
  88. package/dist/commands/workflow-command.js +1 -1
  89. package/dist/core/auth.js +1 -1
  90. package/dist/core/config.d.ts +26 -0
  91. package/dist/core/config.d.ts.map +1 -1
  92. package/dist/core/config.js +1 -1
  93. package/dist/core/config.js.map +1 -1
  94. package/dist/core/connection-cache.d.ts +29 -0
  95. package/dist/core/connection-cache.d.ts.map +1 -0
  96. package/dist/core/connection-cache.js +1 -0
  97. package/dist/core/connection-cache.js.map +1 -0
  98. package/dist/core/credential-cache.js +1 -1
  99. package/dist/core/global-context.js +1 -1
  100. package/dist/core/keychain.js +1 -1
  101. package/dist/core/profile.js +1 -1
  102. package/dist/core/project-config.js +1 -1
  103. package/dist/core/session.js +1 -1
  104. package/dist/core/user-cache.d.ts +29 -0
  105. package/dist/core/user-cache.d.ts.map +1 -0
  106. package/dist/core/user-cache.js +1 -0
  107. package/dist/core/user-cache.js.map +1 -0
  108. package/dist/index.js +1 -1
  109. package/dist/proxy/anthropic-adapter.js +1 -1
  110. package/dist/proxy/claude-usage-tracker.js +1 -1
  111. package/dist/proxy/context-signature.js +1 -1
  112. package/dist/proxy/conversation-utils.js +1 -1
  113. package/dist/proxy/server.js +1 -1
  114. package/dist/proxy/session-cache.js +1 -1
  115. package/dist/sdk/api.js +1 -1
  116. package/dist/sdk/connection.d.ts +116 -0
  117. package/dist/sdk/connection.d.ts.map +1 -0
  118. package/dist/sdk/connection.js +1 -0
  119. package/dist/sdk/connection.js.map +1 -0
  120. package/dist/sdk/engage.js +1 -1
  121. package/dist/sdk/errors.d.ts +6 -0
  122. package/dist/sdk/errors.d.ts.map +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/errors.js.map +1 -1
  125. package/dist/sdk/index.d.ts +13 -0
  126. package/dist/sdk/index.d.ts.map +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/index.js.map +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/llm.js +1 -1
  131. package/dist/sdk/query.js +1 -1
  132. package/dist/sdk/segment/child-segment-yaml.d.ts +288 -0
  133. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -0
  134. package/dist/sdk/segment/child-segment-yaml.js +1 -0
  135. package/dist/sdk/segment/child-segment-yaml.js.map +1 -0
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment.d.ts +87 -1
  139. package/dist/sdk/segment.d.ts.map +1 -1
  140. package/dist/sdk/segment.js +1 -1
  141. package/dist/sdk/segment.js.map +1 -1
  142. package/dist/sdk/user.d.ts +75 -0
  143. package/dist/sdk/user.d.ts.map +1 -0
  144. package/dist/sdk/user.js +1 -0
  145. package/dist/sdk/user.js.map +1 -0
  146. package/dist/sdk/workflow.js +1 -1
  147. package/dist/types/cdp.d.ts +90 -15
  148. package/dist/types/cdp.d.ts.map +1 -1
  149. package/dist/types/connection.d.ts +37 -0
  150. package/dist/types/connection.d.ts.map +1 -0
  151. package/dist/types/connection.js +1 -0
  152. package/dist/types/connection.js.map +1 -0
  153. package/dist/types/endpoints.js +1 -1
  154. package/dist/types/index.d.ts +23 -2
  155. package/dist/types/index.d.ts.map +1 -1
  156. package/dist/types/index.js +1 -1
  157. package/dist/types/index.js.map +1 -1
  158. package/dist/utils/agent-ref-parser.js +1 -1
  159. package/dist/utils/async.d.ts +13 -0
  160. package/dist/utils/async.d.ts.map +1 -0
  161. package/dist/utils/async.js +1 -0
  162. package/dist/utils/async.js.map +1 -0
  163. package/dist/utils/chat-cache.js +1 -1
  164. package/dist/utils/colors.js +1 -1
  165. package/dist/utils/command-output.d.ts +24 -3
  166. package/dist/utils/command-output.d.ts.map +1 -1
  167. package/dist/utils/command-output.js +1 -1
  168. package/dist/utils/command-output.js.map +1 -1
  169. package/dist/utils/constants.js +1 -1
  170. package/dist/utils/diff.js +1 -1
  171. package/dist/utils/fields-display.js +1 -1
  172. package/dist/utils/file-permissions.js +1 -1
  173. package/dist/utils/format-detector.js +1 -1
  174. package/dist/utils/formatters.js +1 -1
  175. package/dist/utils/json-loader.js +1 -1
  176. package/dist/utils/llm-backup-utils.js +1 -1
  177. package/dist/utils/model-aliases.js +1 -1
  178. package/dist/utils/model-factors.js +1 -1
  179. package/dist/utils/option-validation.js +1 -1
  180. package/dist/utils/port.js +1 -1
  181. package/dist/utils/process.js +1 -1
  182. package/dist/utils/prompt.js +1 -1
  183. package/dist/utils/segment-path-parser.d.ts +52 -0
  184. package/dist/utils/segment-path-parser.d.ts.map +1 -1
  185. package/dist/utils/segment-path-parser.js +1 -1
  186. package/dist/utils/segment-path-parser.js.map +1 -1
  187. package/dist/utils/segment-ref-parser.js +1 -1
  188. package/dist/utils/spinner.js +1 -1
  189. package/dist/utils/sql-parser.js +1 -1
  190. package/dist/utils/sse-parser.js +1 -1
  191. package/dist/utils/string-utils.js +1 -1
  192. package/dist/utils/table-ref-parser.js +1 -1
  193. package/dist/utils/tdx-config.d.ts +103 -0
  194. package/dist/utils/tdx-config.d.ts.map +1 -0
  195. package/dist/utils/tdx-config.js +1 -0
  196. package/dist/utils/tdx-config.js.map +1 -0
  197. package/dist/utils/tdx-logger.js +1 -1
  198. package/dist/utils/tree-formatter.js +1 -1
  199. package/dist/utils/version-check.js +1 -1
  200. package/dist/utils/workflow-utils.js +1 -1
  201. package/package.json +2 -2
  202. package/dist/commands/segment-pwd-command.d.ts +0 -21
  203. package/dist/commands/segment-pwd-command.d.ts.map +0 -1
  204. package/dist/commands/segment-pwd-command.js +0 -1
  205. package/dist/commands/segment-pwd-command.js.map +0 -1
@@ -1 +1 @@
1
- function a19_0x5363(){const _0x46a4fe=['26817DqfWiv','483185XjoVBy','Error:\x20','245223EPMWiB','242hiTrrT','390196FsUXJf','Session\x20context\x20cleared\x20(session:\x20','session','name','354JUiZqo','64jkOHzT','yellow','141730UnFgQV','displayWithSources','warn','debug','4NFqmAh','message','402856MNBLbH','toString','2305503XSnpCl','execute','display','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','error','Show\x20current\x20resolved\x20context','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a'];a19_0x5363=function(){return _0x46a4fe;};return a19_0x5363();}const a19_0x4bd0c4=a19_0x2456;(function(_0xcb7a7a,_0x87237f){const _0xcde468=a19_0x2456,_0x5cf9b5=_0xcb7a7a();while(!![]){try{const _0x1ca0c3=-parseInt(_0xcde468(0x113))/0x1+-parseInt(_0xcde468(0x121))/0x2+parseInt(_0xcde468(0x115))/0x3*(parseInt(_0xcde468(0x111))/0x4)+parseInt(_0xcde468(0x11d))/0x5+parseInt(_0xcde468(0x125))/0x6*(parseInt(_0xcde468(0x11c))/0x7)+-parseInt(_0xcde468(0x126))/0x8*(-parseInt(_0xcde468(0x11f))/0x9)+-parseInt(_0xcde468(0x128))/0xa*(parseInt(_0xcde468(0x120))/0xb);if(_0x1ca0c3===_0x87237f)break;else _0x5cf9b5['push'](_0x5cf9b5['shift']());}catch(_0x217994){_0x5cf9b5['push'](_0x5cf9b5['shift']());}}}(a19_0x5363,0x61817));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';function a19_0x2456(_0x40bfc0,_0x572b16){const _0x53634a=a19_0x5363();return a19_0x2456=function(_0x245672,_0x495d38){_0x245672=_0x245672-0x10e;let _0x22d059=_0x53634a[_0x245672];return _0x22d059;},a19_0x2456(_0x40bfc0,_0x572b16);}import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a19_0x474075 from'chalk';export class ContextCommand extends BaseCommand{[a19_0x4bd0c4(0x124)]='context';['description']=a19_0x4bd0c4(0x11a);async[a19_0x4bd0c4(0x116)](_0x1584d){const _0x44fd66=a19_0x4bd0c4,{options:_0x1fb0f0}=_0x1584d,_0x120b61=_0x1fb0f0[_0x44fd66(0x110)],_0x1f8086=_0x1fb0f0['clear'];console['warn'](a19_0x474075['yellow']('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x44fd66(0x10f)](a19_0x474075[_0x44fd66(0x127)](_0x44fd66(0x118))),console[_0x44fd66(0x10f)](a19_0x474075[_0x44fd66(0x127)](_0x44fd66(0x11b))),cleanExpiredSessions();try{if(_0x1f8086){clearSessionContext(_0x1fb0f0[_0x44fd66(0x123)]);const _0x5b030a=_0x1fb0f0[_0x44fd66(0x123)]||getCurrentSessionPID()[_0x44fd66(0x114)]();return console['log'](_0x44fd66(0x122)+_0x5b030a+')'),0x0;}const _0x4d8602=new GlobalContext(_0x1fb0f0);return _0x120b61?_0x4d8602[_0x44fd66(0x10e)]():_0x4d8602[_0x44fd66(0x117)](),0x0;}catch(_0x51dbb0){return _0x51dbb0 instanceof Error&&console[_0x44fd66(0x119)](_0x44fd66(0x11e)+_0x51dbb0[_0x44fd66(0x112)]),0x1;}}}
1
+ const a20_0x27786b=a20_0x59c6;function a20_0x2378(){const _0x9a0ff2=['Show\x20current\x20resolved\x20context','display','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','yellow','12666488FQdHbl','1660VjHxri','9DLqyYX','clear','136KTBITe','25757LQLfEa','3157188BzjzTz','message','warn','Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.','21683100Mtlbnc','7768242PHVTpH','displayWithSources','log','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a','description','Session\x20context\x20cleared\x20(session:\x20','6424537CsizWs','Error:\x20','session','context','error','19885PKhEUs','name'];a20_0x2378=function(){return _0x9a0ff2;};return a20_0x2378();}(function(_0x2cb0e3,_0x175ea4){const _0x1303f5=a20_0x59c6,_0xe00476=_0x2cb0e3();while(!![]){try{const _0x4bac74=parseInt(_0x1303f5(0x152))/0x1*(parseInt(_0x1303f5(0x151))/0x2)+parseInt(_0x1303f5(0x153))/0x3+parseInt(_0x1303f5(0x14e))/0x4*(-parseInt(_0x1303f5(0x147))/0x5)+parseInt(_0x1303f5(0x158))/0x6+-parseInt(_0x1303f5(0x142))/0x7+-parseInt(_0x1303f5(0x14d))/0x8*(-parseInt(_0x1303f5(0x14f))/0x9)+-parseInt(_0x1303f5(0x157))/0xa;if(_0x4bac74===_0x175ea4)break;else _0xe00476['push'](_0xe00476['shift']());}catch(_0x322db4){_0xe00476['push'](_0xe00476['shift']());}}}(a20_0x2378,0xe6cb6));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';function a20_0x59c6(_0x4eff8c,_0x5dc642){_0x4eff8c=_0x4eff8c-0x13d;const _0x237855=a20_0x2378();let _0x59c671=_0x237855[_0x4eff8c];return _0x59c671;}import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a20_0x1bb4ef from'chalk';export class ContextCommand extends BaseCommand{[a20_0x27786b(0x148)]=a20_0x27786b(0x145);[a20_0x27786b(0x140)]=a20_0x27786b(0x149);async['execute'](_0x2decda){const _0x1d6fc1=a20_0x27786b,{options:_0x26b8ff}=_0x2decda,_0x400592=_0x26b8ff['debug'],_0x5d65bb=_0x26b8ff[_0x1d6fc1(0x150)];console['warn'](a20_0x1bb4ef[_0x1d6fc1(0x14c)](_0x1d6fc1(0x156))),console[_0x1d6fc1(0x155)](a20_0x1bb4ef[_0x1d6fc1(0x14c)](_0x1d6fc1(0x14b))),console[_0x1d6fc1(0x155)](a20_0x1bb4ef[_0x1d6fc1(0x14c)](_0x1d6fc1(0x13f))),cleanExpiredSessions();try{if(_0x5d65bb){clearSessionContext(_0x26b8ff[_0x1d6fc1(0x144)]);const _0x509bc8=_0x26b8ff[_0x1d6fc1(0x144)]||getCurrentSessionPID()['toString']();return console[_0x1d6fc1(0x13e)](_0x1d6fc1(0x141)+_0x509bc8+')'),0x0;}const _0x28118b=new GlobalContext(_0x26b8ff);return _0x400592?_0x28118b[_0x1d6fc1(0x13d)]():_0x28118b[_0x1d6fc1(0x14a)](),0x0;}catch(_0x36a970){return _0x36a970 instanceof Error&&console[_0x1d6fc1(0x146)](_0x1d6fc1(0x143)+_0x36a970[_0x1d6fc1(0x154)]),0x1;}}}
@@ -1 +1 @@
1
- const a20_0x202962=a20_0x25b6;(function(_0xde56f3,_0x38ce3a){const _0xc1cd7c=a20_0x25b6,_0x3bf4e6=_0xde56f3();while(!![]){try{const _0x394662=parseInt(_0xc1cd7c(0x193))/0x1*(parseInt(_0xc1cd7c(0x188))/0x2)+-parseInt(_0xc1cd7c(0x19b))/0x3+parseInt(_0xc1cd7c(0x195))/0x4+parseInt(_0xc1cd7c(0x18f))/0x5*(-parseInt(_0xc1cd7c(0x194))/0x6)+parseInt(_0xc1cd7c(0x18b))/0x7*(parseInt(_0xc1cd7c(0x19e))/0x8)+-parseInt(_0xc1cd7c(0x199))/0x9+-parseInt(_0xc1cd7c(0x19a))/0xa*(-parseInt(_0xc1cd7c(0x18a))/0xb);if(_0x394662===_0x38ce3a)break;else _0x3bf4e6['push'](_0x3bf4e6['shift']());}catch(_0x35e333){_0x3bf4e6['push'](_0x3bf4e6['shift']());}}}(a20_0x3c6b,0xdab56));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a20_0x25b6(_0x3066ac,_0x42e7c2){const _0x3c6b6e=a20_0x3c6b();return a20_0x25b6=function(_0x25b6dd,_0xd937c4){_0x25b6dd=_0x25b6dd-0x186;let _0x5b7156=_0x3c6b6e[_0x25b6dd];return _0x5b7156;},a20_0x25b6(_0x3066ac,_0x42e7c2);}function a20_0x3c6b(){const _0xe7fa5c=['verbose','20792UfeeTk','limit','\x20database','✔\x20Found\x20','error','Listing\x20databases...','372614DpnOSj','execute','37299064xHRXrE','63ZBLTYF','length','Error:\x20','Site:\x20','222890KWOtTu','listDatabases','description','databases','3Pufptt','126poEiQX','798452ooIqEG','cause','message','query','14029101hCrZEI','10crifSe','2345976HgieZA','name'];a20_0x3c6b=function(){return _0xe7fa5c;};return a20_0x3c6b();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a20_0x202962(0x19c)]=a20_0x202962(0x192);[a20_0x202962(0x191)]='List\x20all\x20databases';async[a20_0x202962(0x189)](_0x4421c3){const _0x44c9e1=a20_0x202962,{options:_0x245f8e,args:_0x422ff6,tdx:_0x552872}=_0x4421c3,_0x16406a=_0x422ff6[0x0];try{_0x245f8e['verbose']&&(console['error'](_0x44c9e1(0x18e)+_0x245f8e['site']),_0x16406a&&console['error']('Pattern:\x20'+_0x16406a));const _0x4afe88=resolveLimit(_0x245f8e[_0x44c9e1(0x19f)],DEFAULT_LISTING_LIMIT),_0x5c23b6=await withSpinner(_0x44c9e1(0x187),()=>_0x552872[_0x44c9e1(0x198)][_0x44c9e1(0x190)](_0x16406a,_0x4afe88),{'verbose':_0x245f8e[_0x44c9e1(0x19d)]}),_0x28bcac=_0x5c23b6['data'];return console['error'](_0x44c9e1(0x1a1)+_0x28bcac[_0x44c9e1(0x18c)]+_0x44c9e1(0x1a0)+(_0x28bcac[_0x44c9e1(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x28bcac,{..._0x245f8e,'limit':_0x4afe88}),0x0;}catch(_0x157b2a){if(_0x157b2a instanceof SDKError)return console['error'](_0x44c9e1(0x18d)+_0x157b2a[_0x44c9e1(0x197)]),_0x157b2a[_0x44c9e1(0x196)]&&console[_0x44c9e1(0x186)]('\x20\x20Cause:\x20'+_0x157b2a[_0x44c9e1(0x196)]),0x1;throw _0x157b2a;}}}
1
+ const a21_0x3a90ca=a21_0x29a8;(function(_0x55b7c0,_0x8547e9){const _0x30b6ee=a21_0x29a8,_0x21ed59=_0x55b7c0();while(!![]){try{const _0xc33861=-parseInt(_0x30b6ee(0x1c5))/0x1+-parseInt(_0x30b6ee(0x1d2))/0x2*(parseInt(_0x30b6ee(0x1d5))/0x3)+-parseInt(_0x30b6ee(0x1c7))/0x4+-parseInt(_0x30b6ee(0x1d7))/0x5+parseInt(_0x30b6ee(0x1c4))/0x6+-parseInt(_0x30b6ee(0x1c8))/0x7*(-parseInt(_0x30b6ee(0x1cb))/0x8)+-parseInt(_0x30b6ee(0x1de))/0x9*(-parseInt(_0x30b6ee(0x1e0))/0xa);if(_0xc33861===_0x8547e9)break;else _0x21ed59['push'](_0x21ed59['shift']());}catch(_0x514454){_0x21ed59['push'](_0x21ed59['shift']());}}}(a21_0x5e8c,0xabdf1));import{BaseCommand}from'./command.js';function a21_0x5e8c(){const _0x3c4211=['Listing\x20databases...','192YVkOmY','databases','verbose','site','Site:\x20','error','query','26AOZPQg','\x20\x20Cause:\x20','data','41523Wbpsms','Pattern:\x20','412920KSQUYZ','listDatabases','Error:\x20','\x20database','name','cause','length','162018imKWZO','limit','370WNJPYX','execute','message','6410382idPtfB','774218dyverM','description','1133820nOptwP','84497fqHzET','List\x20all\x20databases'];a21_0x5e8c=function(){return _0x3c4211;};return a21_0x5e8c();}import{SDKError}from'../sdk/index.js';function a21_0x29a8(_0xdb85f,_0x3fedd1){_0xdb85f=_0xdb85f-0x1c3;const _0x5e8c04=a21_0x5e8c();let _0x29a861=_0x5e8c04[_0xdb85f];return _0x29a861;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a21_0x3a90ca(0x1db)]=a21_0x3a90ca(0x1cc);[a21_0x3a90ca(0x1c6)]=a21_0x3a90ca(0x1c9);async[a21_0x3a90ca(0x1e1)](_0x305f8b){const _0x341aca=a21_0x3a90ca,{options:_0x55e231,args:_0x19966d,tdx:_0x527be2}=_0x305f8b,_0x385b09=_0x19966d[0x0];try{_0x55e231[_0x341aca(0x1cd)]&&(console[_0x341aca(0x1d0)](_0x341aca(0x1cf)+_0x55e231[_0x341aca(0x1ce)]),_0x385b09&&console[_0x341aca(0x1d0)](_0x341aca(0x1d6)+_0x385b09));const _0x2fbeb2=resolveLimit(_0x55e231[_0x341aca(0x1df)],DEFAULT_LISTING_LIMIT),_0x3a07d3=await withSpinner(_0x341aca(0x1ca),()=>_0x527be2[_0x341aca(0x1d1)][_0x341aca(0x1d8)](_0x385b09,_0x2fbeb2),{'verbose':_0x55e231['verbose']}),_0x2bd479=_0x3a07d3[_0x341aca(0x1d4)];return console['error']('✔\x20Found\x20'+_0x2bd479[_0x341aca(0x1dd)]+_0x341aca(0x1da)+(_0x2bd479[_0x341aca(0x1dd)]!==0x1?'s':'')),await handleSDKOutput(_0x2bd479,{..._0x55e231,'limit':_0x2fbeb2}),0x0;}catch(_0x18cda3){if(_0x18cda3 instanceof SDKError)return console[_0x341aca(0x1d0)](_0x341aca(0x1d9)+_0x18cda3[_0x341aca(0x1c3)]),_0x18cda3[_0x341aca(0x1dc)]&&console[_0x341aca(0x1d0)](_0x341aca(0x1d3)+_0x18cda3['cause']),0x1;throw _0x18cda3;}}}
@@ -1 +1 @@
1
- const a21_0x43eafd=a21_0x3d4c;function a21_0x1953(){const _0x5d52af=['database','1181335CRjBJG','validate','Describe\x20table\x20schema','577533bShMIS','Table\x20\x27','...','description','name','error','\x20\x20Cause:\x20','Database:\x20','table','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','3604951yEoMMC','✔\x20Found\x20','✖\x20Table\x20not\x20found','\x20in\x20','Error:\x20','message','describe','8nNBTuJ','9106245bvquBj','cause','query','length','verbose','describeTable','args','1059625lJQxfH','6aNlwAJ','2219106hZKBns','790thZZCC','Table:\x20','4jdmUlw','site','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','2796126NRWGUX'];a21_0x1953=function(){return _0x5d52af;};return a21_0x1953();}function a21_0x3d4c(_0x4c583f,_0xcac896){const _0x195365=a21_0x1953();return a21_0x3d4c=function(_0x3d4c13,_0x2b6e16){_0x3d4c13=_0x3d4c13-0x10e;let _0x4c281a=_0x195365[_0x3d4c13];return _0x4c281a;},a21_0x3d4c(_0x4c583f,_0xcac896);}(function(_0x3bd2a6,_0x13a9a7){const _0x39ae36=a21_0x3d4c,_0xcf7c57=_0x3bd2a6();while(!![]){try{const _0x119e34=parseInt(_0x39ae36(0x11d))/0x1+parseInt(_0x39ae36(0x125))/0x2+parseInt(_0x39ae36(0x11f))/0x3*(parseInt(_0x39ae36(0x122))/0x4)+parseInt(_0x39ae36(0x127))/0x5+parseInt(_0x39ae36(0x11e))/0x6*(parseInt(_0x39ae36(0x10e))/0x7)+-parseInt(_0x39ae36(0x115))/0x8*(-parseInt(_0x39ae36(0x116))/0x9)+parseInt(_0x39ae36(0x120))/0xa*(-parseInt(_0x39ae36(0x12a))/0xb);if(_0x119e34===_0x13a9a7)break;else _0xcf7c57['push'](_0xcf7c57['shift']());}catch(_0xff575e){_0xcf7c57['push'](_0xcf7c57['shift']());}}}(a21_0x1953,0xc66ae));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a21_0x43eafd(0x12e)]=a21_0x43eafd(0x114);[a21_0x43eafd(0x12d)]=a21_0x43eafd(0x129);async['execute'](_0x2276ef){const _0x46633e=a21_0x43eafd;return this[_0x46633e(0x11b)](_0x2276ef);}async[a21_0x43eafd(0x11b)](_0xf39b2){const _0x5628e4=a21_0x43eafd,{options:_0x10d98a,args:_0x275458,tdx:_0x5c478d}=_0xf39b2;let _0x39129d;try{_0x39129d=parseTableReference(_0x275458[0x0]);const _0x4de138=_0x10d98a[_0x5628e4(0x126)];!_0x39129d[_0x5628e4(0x126)]&&_0x4de138&&(_0x39129d[_0x5628e4(0x126)]=_0x4de138);const _0x1cc81f=validateTableDescribeReference(_0x39129d);if(_0x1cc81f)return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0x1cc81f),0x1;}catch(_0xfdc9c){return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0xfdc9c[_0x5628e4(0x113)]),0x1;}const _0x539f01=_0x39129d['database'],_0x31ce20=_0x39129d[_0x5628e4(0x132)];try{_0x10d98a[_0x5628e4(0x11a)]&&(console[_0x5628e4(0x12f)]('Site:\x20'+_0x10d98a[_0x5628e4(0x123)]),console[_0x5628e4(0x12f)](_0x5628e4(0x131)+_0x539f01),console['error'](_0x5628e4(0x121)+_0x31ce20));const _0x2ef168=await withSpinner('Describing\x20table\x20'+_0x539f01+'.'+_0x31ce20+_0x5628e4(0x12c),()=>_0x5c478d[_0x5628e4(0x118)]['describeTable'](_0x539f01,_0x31ce20),{'verbose':_0x10d98a[_0x5628e4(0x11a)]}),_0x3914cf=_0x2ef168['data'];if(_0x3914cf['length']===0x0)return console['error'](_0x5628e4(0x110)),console['error'](_0x5628e4(0x12b)+_0x539f01+'.'+_0x31ce20+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x5628e4(0x12f)](_0x5628e4(0x10f)+_0x3914cf[_0x5628e4(0x119)]+'\x20column'+(_0x3914cf['length']!==0x1?'s':'')+_0x5628e4(0x111)+_0x539f01+'.'+_0x31ce20),await handleSDKOutput(_0x3914cf,_0x10d98a),0x0;}catch(_0x38e1e5){if(_0x38e1e5 instanceof SDKError)return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0x38e1e5['message']),_0x38e1e5[_0x5628e4(0x117)]&&console[_0x5628e4(0x12f)](_0x5628e4(0x130)+_0x38e1e5[_0x5628e4(0x117)]),0x1;throw _0x38e1e5;}}[a21_0x43eafd(0x128)](_0x1b3500){const _0x61914c=a21_0x43eafd;if(_0x1b3500[_0x61914c(0x11c)][_0x61914c(0x119)]===0x0)return _0x61914c(0x124);if(_0x1b3500[_0x61914c(0x11c)][_0x61914c(0x119)]>0x1)return _0x61914c(0x133);return undefined;}}
1
+ const a22_0x5edf5c=a22_0xe52c;(function(_0x3a00cd,_0x3e6795){const _0x1b0870=a22_0xe52c,_0x14f54a=_0x3a00cd();while(!![]){try{const _0x10ee8f=-parseInt(_0x1b0870(0xa7))/0x1*(-parseInt(_0x1b0870(0xb6))/0x2)+parseInt(_0x1b0870(0x9a))/0x3*(parseInt(_0x1b0870(0xa5))/0x4)+-parseInt(_0x1b0870(0x9e))/0x5*(-parseInt(_0x1b0870(0x9c))/0x6)+-parseInt(_0x1b0870(0xa3))/0x7+-parseInt(_0x1b0870(0xb5))/0x8*(parseInt(_0x1b0870(0xa9))/0x9)+parseInt(_0x1b0870(0xa4))/0xa+parseInt(_0x1b0870(0xa1))/0xb*(-parseInt(_0x1b0870(0xb3))/0xc);if(_0x10ee8f===_0x3e6795)break;else _0x14f54a['push'](_0x14f54a['shift']());}catch(_0x1681be){_0x14f54a['push'](_0x14f54a['shift']());}}}(a22_0x797c,0xf1295));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a22_0xe52c(_0x5794e7,_0x50a485){_0x5794e7=_0x5794e7-0x96;const _0x797cea=a22_0x797c();let _0xe52c2c=_0x797cea[_0x5794e7];return _0xe52c2c;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a22_0x797c(){const _0x4a81cf=['230608JxeAUv','6231610CLEqMK','25072GuayRV','describeTable','4818JuWZkN','description','738IUjUSY','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','length','\x20in\x20','Describe\x20table\x20schema','...','cause','\x27\x20does\x20not\x20exist','\x20column','Table:\x20','23844VBxcom','✖\x20Table\x20not\x20found','139288RRuoYp','488NMDKtu','error','verbose','Site:\x20','args','validate','message','execute','database','✔\x20Found\x20','Database:\x20','177yPkWOr','\x20\x20Cause:\x20','78eBzyZE','data','510395apDKoL','Describing\x20table\x20','Error:\x20','5797CRNAsA','site'];a22_0x797c=function(){return _0x4a81cf;};return a22_0x797c();}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']='describe';[a22_0x5edf5c(0xa8)]=a22_0x5edf5c(0xad);async[a22_0x5edf5c(0x96)](_0x16289f){const _0x421e42=a22_0x5edf5c;return this[_0x421e42(0xa6)](_0x16289f);}async['describeTable'](_0x237ddd){const _0x5aa582=a22_0x5edf5c,{options:_0x1f5583,args:_0x20728e,tdx:_0x32e9b3}=_0x237ddd;let _0x862c28;try{_0x862c28=parseTableReference(_0x20728e[0x0]);const _0xbac21a=_0x1f5583['database'];!_0x862c28[_0x5aa582(0x97)]&&_0xbac21a&&(_0x862c28[_0x5aa582(0x97)]=_0xbac21a);const _0x5ebfd2=validateTableDescribeReference(_0x862c28);if(_0x5ebfd2)return console[_0x5aa582(0xb7)](_0x5aa582(0xa0)+_0x5ebfd2),0x1;}catch(_0x4e269c){return console[_0x5aa582(0xb7)](_0x5aa582(0xa0)+_0x4e269c[_0x5aa582(0xbc)]),0x1;}const _0x4b7656=_0x862c28[_0x5aa582(0x97)],_0x48229f=_0x862c28['table'];try{_0x1f5583[_0x5aa582(0xb8)]&&(console['error'](_0x5aa582(0xb9)+_0x1f5583[_0x5aa582(0xa2)]),console[_0x5aa582(0xb7)](_0x5aa582(0x99)+_0x4b7656),console[_0x5aa582(0xb7)](_0x5aa582(0xb2)+_0x48229f));const _0x4b5481=await withSpinner(_0x5aa582(0x9f)+_0x4b7656+'.'+_0x48229f+_0x5aa582(0xae),()=>_0x32e9b3['query'][_0x5aa582(0xa6)](_0x4b7656,_0x48229f),{'verbose':_0x1f5583[_0x5aa582(0xb8)]}),_0x1bc059=_0x4b5481[_0x5aa582(0x9d)];if(_0x1bc059[_0x5aa582(0xab)]===0x0)return console[_0x5aa582(0xb7)](_0x5aa582(0xb4)),console[_0x5aa582(0xb7)]('Table\x20\x27'+_0x4b7656+'.'+_0x48229f+_0x5aa582(0xb0)),0x1;return console[_0x5aa582(0xb7)](_0x5aa582(0x98)+_0x1bc059[_0x5aa582(0xab)]+_0x5aa582(0xb1)+(_0x1bc059['length']!==0x1?'s':'')+_0x5aa582(0xac)+_0x4b7656+'.'+_0x48229f),await handleSDKOutput(_0x1bc059,_0x1f5583),0x0;}catch(_0x53bc8a){if(_0x53bc8a instanceof SDKError)return console[_0x5aa582(0xb7)]('Error:\x20'+_0x53bc8a[_0x5aa582(0xbc)]),_0x53bc8a['cause']&&console['error'](_0x5aa582(0x9b)+_0x53bc8a[_0x5aa582(0xaf)]),0x1;throw _0x53bc8a;}}[a22_0x5edf5c(0xbb)](_0x4e11c2){const _0x20461d=a22_0x5edf5c;if(_0x4e11c2[_0x20461d(0xba)][_0x20461d(0xab)]===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x4e11c2[_0x20461d(0xba)]['length']>0x1)return _0x20461d(0xaa);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x11894c=a22_0x2136;(function(_0x4d7611,_0x2f5503){const _0x412e8c=a22_0x2136,_0x4a73b4=_0x4d7611();while(!![]){try{const _0x2cf8eb=parseInt(_0x412e8c(0xb2))/0x1+-parseInt(_0x412e8c(0x12a))/0x2+parseInt(_0x412e8c(0xf5))/0x3+-parseInt(_0x412e8c(0xb1))/0x4*(-parseInt(_0x412e8c(0xdd))/0x5)+parseInt(_0x412e8c(0xb8))/0x6+-parseInt(_0x412e8c(0xeb))/0x7+parseInt(_0x412e8c(0x11b))/0x8*(-parseInt(_0x412e8c(0x103))/0x9);if(_0x2cf8eb===_0x2f5503)break;else _0x4a73b4['push'](_0x4a73b4['shift']());}catch(_0x23bd0c){_0x4a73b4['push'](_0x4a73b4['shift']());}}}(a22_0x3cfc,0xb44fa));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x56cf76,_0x449b09,_0x17faac=![]){const _0x3b0e97=a22_0x2136;if(_0x56cf76[_0x3b0e97(0xd5)])return await _0x449b09['engage'][_0x3b0e97(0x132)](_0x56cf76[_0x3b0e97(0xd5)]);const _0x53ce54=loadSessionContext(_0x56cf76[_0x3b0e97(0x12c)]);if(_0x53ce54?.['engage_workspace'])return await _0x449b09['engage'][_0x3b0e97(0x132)](_0x53ce54['engage_workspace']);if(_0x17faac)throw new SDKError(ErrorCode[_0x3b0e97(0x101)],_0x3b0e97(0xc9),undefined,{'helpText':_0x3b0e97(0xee)});return undefined;}async function resolveSegmentFromOptions(_0x34f90d,_0x33de0e){const _0x370a14=a22_0x2136;if(!_0x34f90d[_0x370a14(0x118)])return{};const _0x490286=_0x34f90d[_0x370a14(0x118)],_0x4775c1=await _0x33de0e[_0x370a14(0x118)][_0x370a14(0xf0)](_0x490286);return{'audienceId':_0x4775c1[_0x370a14(0xe6)],'audienceName':_0x4775c1['parentName'],..._0x4775c1[_0x370a14(0xb3)]&&{'segmentId':_0x4775c1[_0x370a14(0xb3)],'segmentName':_0x4775c1[_0x370a14(0xbc)]}};}function buildConnectorConfig(_0x3af68d){const _0x424d87=a22_0x2136,_0x5f2a8e=_0x3af68d['emailSenderId'],_0x135bc5=_0x3af68d[_0x424d87(0xfa)];if(!_0x5f2a8e&&!_0x135bc5)return undefined;return{..._0x5f2a8e&&{'emailSenderId':_0x5f2a8e},..._0x135bc5&&{'jsonColumns':_0x135bc5}};}export class EngageCampaignsCommand extends BaseCommand{[a22_0x11894c(0xc8)]='engage:campaigns';[a22_0x11894c(0xd9)]=a22_0x11894c(0xdc);async[a22_0x11894c(0xfc)](_0x4560b7){const _0x3b7168=a22_0x11894c,{options:_0x4276f3,args:_0x4751b1,tdx:_0x26361f}=_0x4560b7,_0x1ef5c5=_0x4751b1[0x0],_0x502828=resolveLimit(_0x4276f3[_0x3b7168(0xfb)],DEFAULT_LLM_LIMIT),_0x3c95ab=_0x4276f3,_0x2e08b6=_0x3c95ab['type'],_0x39d8cf=_0x3c95ab[_0x3b7168(0x11f)],_0x36008e=await resolveWorkspaceIdFromOptions(_0x3c95ab,_0x26361f),_0x4816b4=await withSpinner(_0x3b7168(0x111),()=>_0x26361f[_0x3b7168(0x127)][_0x3b7168(0x139)]({'type':_0x2e08b6,'status':_0x39d8cf,'workspaceId':_0x36008e,'limit':_0x502828}),{'verbose':_0x4276f3[_0x3b7168(0x138)]});let _0x4b498f=_0x4816b4['data'];return _0x1ef5c5&&(_0x4b498f=_0x4816b4[_0x3b7168(0x12f)][_0x3b7168(0xd6)](_0x1b6bc8=>matchGlobPattern(_0x1b6bc8[_0x3b7168(0xc8)],_0x1ef5c5))),await handleSDKOutput(_0x4b498f,_0x4276f3),0x0;}}function a22_0x3cfc(){const _0x37f051=['Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Creating\x20campaign\x20\x27','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','full','Error:\x20--subject\x20is\x20required','Show\x20email\x20template\x20details','listTemplates','engage:workspace:delete','length','name','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:campaign:resume','deleteTemplate','Error:\x20--name\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Create\x20a\x20new\x20campaign','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','keys','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Updating\x20template\x20\x27','Create\x20a\x20workspace','engage:templates','workspace','filter','engage:workspace:create','Template\x20\x27','description','engage:template:create','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','List\x20campaigns','850ELpMRX','getCampaignFull','Operation\x20cancelled','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Duplicating\x20campaign\x20\x27','entries','\x27\x20deleted\x20successfully','engage:campaign:delete','engage:template:delete','parentId','Verifying\x20workspace\x20\x27','createCampaign','Fetching\x20workspace\x20\x27','subject','5767293iLfXqY','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Delete\x20a\x20workspace','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','resumeCampaign','resolvePathToResource','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','startAt','plaintext','engage:campaign:update','1818858qHDBIY','timezone','engage:campaign:launch','Workspace\x20\x27','Fetching\x20workspaces...','jsonColumns','limit','execute','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','\x27\x20launched\x20successfully','engage:workspace:show','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','MISSING_ARGUMENT','Pause\x20a\x20campaign','1045467YBLyxL','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Fetching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','updateWorkspace','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','fromEntries','engage:campaign:create','Error:\x20--html\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Fetching\x20template\x20\x27','Fetching\x20campaigns...','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27?\x20This\x20cannot\x20be\x20undone.','engage:campaign:show','Update\x20a\x20workspace','Show\x20workspace\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','segment','type','html','88jPGrMm','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Launching\x20campaign\x20\x27','status','duplicateCampaign','engage:workspace:use','getTemplate','log','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','createTemplate','engage','Launch\x20a\x20campaign','List\x20workspaces','205876dltuSj','Update\x20an\x20email\x20template','session','Campaign\x20\x27','editorType','data','deleteWorkspace','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Updating\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','\x27\x20resumed\x20successfully','engage:template:update','verbose','listCampaigns','Update\x20a\x20campaign','8564hceTKh','1300133iCAzkY','segmentId','updateCampaign','error','Resume\x20a\x20paused\x20campaign','engage:workspaces','4036770nNGFBK','deleteCampaign','\x27...','Options:\x20--name,\x20--description','segmentName','Pausing\x20campaign\x20\x27','yes'];a22_0x3cfc=function(){return _0x37f051;};return a22_0x3cfc();}export class EngageCampaignShowCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0x114);[a22_0x11894c(0xd9)]='Show\x20campaign\x20details';async[a22_0x11894c(0xfc)](_0x5c754f){const _0x2fd7b0=a22_0x11894c,{options:_0x10af0c,args:_0x126421,tdx:_0x1f5bd9}=_0x5c754f;if(_0x126421[_0x2fd7b0(0xc7)]===0x0)return console['error'](_0x2fd7b0(0x125)),console[_0x2fd7b0(0xb5)](_0x2fd7b0(0x10d)),0x1;const _0x1fb562=_0x126421[0x0],_0x38f6f2=_0x10af0c,_0xb820de=await resolveWorkspaceIdFromOptions(_0x38f6f2,_0x1f5bd9),_0x376fa7=_0x38f6f2[_0x2fd7b0(0xc2)];if(_0x376fa7){const _0x526480=await withSpinner(_0x2fd7b0(0x105)+_0x1fb562+_0x2fd7b0(0xba),()=>_0x1f5bd9['engage'][_0x2fd7b0(0xde)](_0x1fb562,_0xb820de),{'verbose':_0x10af0c[_0x2fd7b0(0x138)]});await handleSDKOutput([_0x526480],_0x10af0c);}else{const _0x5af180=await withSpinner('Fetching\x20campaign\x20\x27'+_0x1fb562+'\x27...',()=>_0x1f5bd9[_0x2fd7b0(0x127)]['getCampaign'](_0x1fb562,_0xb820de),{'verbose':_0x10af0c[_0x2fd7b0(0x138)]});await handleSDKOutput([_0x5af180],_0x10af0c);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a22_0x11894c(0x10b);['description']=a22_0x11894c(0xce);async[a22_0x11894c(0xfc)](_0x2604b7){const _0x210aca=a22_0x11894c,{options:_0x15916f,tdx:_0x1a1504}=_0x2604b7,_0x4e1031=_0x15916f,_0x4e7ad2=_0x4e1031[_0x210aca(0xc8)],_0x5217c8=_0x4e1031[_0x210aca(0x119)];if(!_0x4e7ad2)return console[_0x210aca(0xb5)](_0x210aca(0xcc)),console[_0x210aca(0xb5)](_0x210aca(0x11d)),0x1;if(!_0x5217c8)return console[_0x210aca(0xb5)](_0x210aca(0x10e)),console[_0x210aca(0xb5)](_0x210aca(0x11d)),0x1;const _0x1e250e=await resolveWorkspaceIdFromOptions(_0x4e1031,_0x1a1504,!![]),_0x304fda=await resolveSegmentFromOptions(_0x4e1031,_0x1a1504),_0x5c2ca5=buildConnectorConfig(_0x4e1031),_0x8c0241={'name':_0x4e7ad2,'campaignType':_0x5217c8,'workspaceId':_0x1e250e,'description':_0x4e1031['description'],..._0x304fda,'connectorConfig':_0x5c2ca5,'startAt':_0x4e1031[_0x210aca(0xf2)],'timezone':_0x4e1031[_0x210aca(0xf6)]},_0x3185a3=await withSpinner(_0x210aca(0xc0)+_0x4e7ad2+'\x27...',()=>_0x1a1504[_0x210aca(0x127)][_0x210aca(0xe8)](_0x8c0241));return await handleSDKOutput([_0x3185a3[_0x210aca(0x12f)]],_0x15916f),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xf4);[a22_0x11894c(0xd9)]=a22_0x11894c(0x13a);async['execute'](_0x28a909){const _0x3dbe09=a22_0x11894c,{options:_0x4ca164,args:_0x44c81a,tdx:_0x254a8a}=_0x28a909;if(_0x44c81a[_0x3dbe09(0xc7)]===0x0)return console[_0x3dbe09(0xb5)](_0x3dbe09(0x125)),console[_0x3dbe09(0xb5)](_0x3dbe09(0x109)),0x1;const _0x1364e3=_0x44c81a[0x0],_0x321ef8=_0x4ca164,_0x46bf73=await resolveWorkspaceIdFromOptions(_0x321ef8,_0x254a8a),_0x3404e6=await resolveSegmentFromOptions(_0x321ef8,_0x254a8a),_0x7d124f=buildConnectorConfig(_0x321ef8),_0xd6ab43={'name':_0x321ef8[_0x3dbe09(0xc8)],'description':_0x321ef8[_0x3dbe09(0xd9)],..._0x3404e6,'connectorConfig':_0x7d124f,'startAt':_0x321ef8[_0x3dbe09(0xf2)],'timezone':_0x321ef8['timezone']},_0x2e242e=Object['fromEntries'](Object[_0x3dbe09(0xe2)](_0xd6ab43)[_0x3dbe09(0xd6)](([,_0x200a4c])=>_0x200a4c!==undefined));if(Object[_0x3dbe09(0xd0)](_0x2e242e)[_0x3dbe09(0xc7)]===0x0)return console['error'](_0x3dbe09(0xec)),console['error'](_0x3dbe09(0xc1)),0x1;const _0x3c23d6=await withSpinner(_0x3dbe09(0x134)+_0x1364e3+_0x3dbe09(0xba),()=>_0x254a8a['engage'][_0x3dbe09(0xb4)](_0x1364e3,_0x2e242e,_0x46bf73),{'verbose':_0x4ca164[_0x3dbe09(0x138)]});return await handleSDKOutput([_0x3c23d6['data']],_0x4ca164),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a22_0x11894c(0xe4);[a22_0x11894c(0xd9)]='Delete\x20a\x20campaign';async[a22_0x11894c(0xfc)](_0x1464e3){const _0x829ea7=a22_0x11894c,{options:_0x609cc8,args:_0x1eecbf,tdx:_0x3938b9}=_0x1464e3;if(_0x1eecbf['length']===0x0)return console[_0x829ea7(0xb5)](_0x829ea7(0x125)),console[_0x829ea7(0xb5)](_0x829ea7(0x135)),0x1;const _0x5522be=_0x1eecbf[0x0],_0x193bb5=_0x609cc8,_0xb02d64=await resolveWorkspaceIdFromOptions(_0x193bb5,_0x3938b9);if(!_0x609cc8[_0x829ea7(0xbe)]){const _0x295b91=await confirm(_0x829ea7(0xd1)+_0x5522be+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x295b91)return console[_0x829ea7(0x123)]('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x5522be+_0x829ea7(0xba),()=>_0x3938b9[_0x829ea7(0x127)][_0x829ea7(0xb9)](_0x5522be,_0xb02d64),{'verbose':_0x609cc8[_0x829ea7(0x138)]}),console[_0x829ea7(0x123)]('Campaign\x20\x27'+_0x5522be+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xf7);[a22_0x11894c(0xd9)]=a22_0x11894c(0x128);async[a22_0x11894c(0xfc)](_0x20fa00){const _0x44a937=a22_0x11894c,{options:_0x5d079e,args:_0x1d62af,tdx:_0x4ddaf1}=_0x20fa00;if(_0x1d62af[_0x44a937(0xc7)]===0x0)return console['error'](_0x44a937(0x125)),console[_0x44a937(0xb5)](_0x44a937(0xbf)),0x1;const _0x6ce799=_0x1d62af[0x0],_0x46e58a=_0x5d079e,_0x1c0090=await resolveWorkspaceIdFromOptions(_0x46e58a,_0x4ddaf1);return await withSpinner(_0x44a937(0x11e)+_0x6ce799+_0x44a937(0xba),()=>_0x4ddaf1[_0x44a937(0x127)]['launchCampaign'](_0x6ce799,_0x1c0090),{'verbose':_0x5d079e['verbose']}),console[_0x44a937(0x123)](_0x44a937(0x12d)+_0x6ce799+_0x44a937(0xfe)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a22_0x11894c(0xc8)]='engage:campaign:pause';[a22_0x11894c(0xd9)]=a22_0x11894c(0x102);async[a22_0x11894c(0xfc)](_0x57e5ee){const _0x314aea=a22_0x11894c,{options:_0x80d231,args:_0x89a425,tdx:_0x3dd963}=_0x57e5ee;if(_0x89a425[_0x314aea(0xc7)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x314aea(0x10f)),0x1;const _0xe8824b=_0x89a425[0x0],_0x3dbf66=_0x80d231,_0x51ae9d=await resolveWorkspaceIdFromOptions(_0x3dbf66,_0x3dd963);return await withSpinner(_0x314aea(0xbd)+_0xe8824b+_0x314aea(0xba),()=>_0x3dd963['engage']['pauseCampaign'](_0xe8824b,_0x51ae9d),{'verbose':_0x80d231[_0x314aea(0x138)]}),console[_0x314aea(0x123)]('Campaign\x20\x27'+_0xe8824b+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a22_0x11894c(0xca);[a22_0x11894c(0xd9)]=a22_0x11894c(0xb6);async[a22_0x11894c(0xfc)](_0x30260f){const _0x40a756=a22_0x11894c,{options:_0x5a5b91,args:_0xb56e31,tdx:_0x25d65e}=_0x30260f;if(_0xb56e31[_0x40a756(0xc7)]===0x0)return console[_0x40a756(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x40a756(0xfd)),0x1;const _0x5d390d=_0xb56e31[0x0],_0x5cf5bc=_0x5a5b91,_0x2dece4=await resolveWorkspaceIdFromOptions(_0x5cf5bc,_0x25d65e);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x5d390d+_0x40a756(0xba),()=>_0x25d65e[_0x40a756(0x127)][_0x40a756(0xef)](_0x5d390d,_0x2dece4),{'verbose':_0x5a5b91[_0x40a756(0x138)]}),console[_0x40a756(0x123)](_0x40a756(0x12d)+_0x5d390d+_0x40a756(0x136)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a22_0x11894c(0xc8)]='engage:campaign:duplicate';[a22_0x11894c(0xd9)]='Duplicate\x20a\x20campaign';async['execute'](_0x2c0630){const _0x1e289c=a22_0x11894c,{options:_0x35669c,args:_0x1bb0d3,tdx:_0x158652}=_0x2c0630;if(_0x1bb0d3[_0x1e289c(0xc7)]===0x0)return console[_0x1e289c(0xb5)](_0x1e289c(0x125)),console['error'](_0x1e289c(0x11c)),0x1;const _0x4f239c=_0x1bb0d3[0x0],_0x323463=_0x35669c,_0x211a52=await resolveWorkspaceIdFromOptions(_0x323463,_0x158652),_0x17dd85=await withSpinner(_0x1e289c(0xe1)+_0x4f239c+_0x1e289c(0xba),()=>_0x158652[_0x1e289c(0x127)][_0x1e289c(0x120)](_0x4f239c,_0x211a52),{'verbose':_0x35669c[_0x1e289c(0x138)]});return await handleSDKOutput([_0x17dd85['data']],_0x35669c),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xd4);['description']='List\x20email\x20templates';async['execute'](_0x50654b){const _0x50d0ab=a22_0x11894c,{options:_0x541979,args:_0x5f0bae,tdx:_0x58fb56}=_0x50654b,_0x1ecfb9=_0x5f0bae[0x0],_0x2fb3ef=resolveLimit(_0x541979[_0x50d0ab(0xfb)],DEFAULT_LLM_LIMIT),_0x12938d=_0x541979,_0x59ea27=await resolveWorkspaceIdFromOptions(_0x12938d,_0x58fb56),_0x1e419d=await withSpinner('Fetching\x20templates...',()=>_0x58fb56[_0x50d0ab(0x127)][_0x50d0ab(0xc5)]({'workspaceId':_0x59ea27,'limit':_0x2fb3ef}),{'verbose':_0x541979[_0x50d0ab(0x138)]});let _0x2f2443=_0x1e419d[_0x50d0ab(0x12f)];return _0x1ecfb9&&(_0x2f2443=_0x1e419d[_0x50d0ab(0x12f)]['filter'](_0x33a5e6=>matchGlobPattern(_0x33a5e6[_0x50d0ab(0xc8)],_0x1ecfb9))),await handleSDKOutput(_0x2f2443,_0x541979),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a22_0x11894c(0xc8)]='engage:template:show';[a22_0x11894c(0xd9)]=a22_0x11894c(0xc4);async[a22_0x11894c(0xfc)](_0x1dba24){const _0x138cf1=a22_0x11894c,{options:_0x12c01a,args:_0x30d8b6,tdx:_0xb6dc54}=_0x1dba24;if(_0x30d8b6[_0x138cf1(0xc7)]===0x0)return console[_0x138cf1(0xb5)](_0x138cf1(0xcf)),console[_0x138cf1(0xb5)](_0x138cf1(0x131)),0x1;const _0x470e50=_0x30d8b6[0x0],_0x5e3b89=_0x12c01a,_0x4d57d8=await resolveWorkspaceIdFromOptions(_0x5e3b89,_0xb6dc54),_0x1b7be7=_0x5e3b89['full'];if(_0x1b7be7){const _0x4b2503=await withSpinner(_0x138cf1(0x110)+_0x470e50+_0x138cf1(0xba),()=>_0xb6dc54[_0x138cf1(0x127)]['getTemplateFull'](_0x470e50,_0x4d57d8),{'verbose':_0x12c01a[_0x138cf1(0x138)]});await handleSDKOutput([_0x4b2503],_0x12c01a);}else{const _0x249bf3=await withSpinner(_0x138cf1(0x110)+_0x470e50+_0x138cf1(0xba),()=>_0xb6dc54[_0x138cf1(0x127)][_0x138cf1(0x122)](_0x470e50,_0x4d57d8),{'verbose':_0x12c01a['verbose']});await handleSDKOutput([_0x249bf3],_0x12c01a);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xda);[a22_0x11894c(0xd9)]='Create\x20an\x20email\x20template';async[a22_0x11894c(0xfc)](_0x22388c){const _0x2ab477=a22_0x11894c,{options:_0x1b151e,tdx:_0x1234d9}=_0x22388c,_0xbd721c=_0x1b151e,_0x1f8742=_0xbd721c[_0x2ab477(0xc8)],_0x2bf515=_0xbd721c[_0x2ab477(0xea)],_0x576530=_0xbd721c[_0x2ab477(0x11a)];if(!_0x1f8742)return console[_0x2ab477(0xb5)](_0x2ab477(0xcc)),console['error'](_0x2ab477(0x104)),0x1;if(!_0x2bf515)return console[_0x2ab477(0xb5)](_0x2ab477(0xc3)),0x1;if(!_0x576530)return console[_0x2ab477(0xb5)](_0x2ab477(0x10c)),0x1;const _0x4fd46b=await resolveWorkspaceIdFromOptions(_0xbd721c,_0x1234d9,!![]),_0x1b1294={'name':_0x1f8742,'subjectTemplate':_0x2bf515,'htmlTemplate':_0x576530,'workspaceId':_0x4fd46b,'plaintextTemplate':_0xbd721c[_0x2ab477(0xf3)],'editorType':_0xbd721c[_0x2ab477(0x12e)]},_0x1d5e36=await withSpinner(_0x2ab477(0x108)+_0x1f8742+_0x2ab477(0xba),()=>_0x1234d9[_0x2ab477(0x127)][_0x2ab477(0x126)](_0x1b1294));return await handleSDKOutput([_0x1d5e36['data']],_0x1b151e),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0x137);['description']=a22_0x11894c(0x12b);async[a22_0x11894c(0xfc)](_0x125a41){const _0x3ebe92=a22_0x11894c,{options:_0x126d4e,args:_0x2a1d2a,tdx:_0x5cbe74}=_0x125a41;if(_0x2a1d2a[_0x3ebe92(0xc7)]===0x0)return console[_0x3ebe92(0xb5)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x3ebe92(0xb5)](_0x3ebe92(0x112)),0x1;const _0x168945=_0x2a1d2a[0x0],_0x21a7ec=_0x126d4e,_0x5497b8=await resolveWorkspaceIdFromOptions(_0x21a7ec,_0x5cbe74),_0x4e7498={'name':_0x21a7ec['name'],'subjectTemplate':_0x21a7ec[_0x3ebe92(0xea)],'htmlTemplate':_0x21a7ec[_0x3ebe92(0x11a)],'plaintextTemplate':_0x21a7ec[_0x3ebe92(0xf3)]},_0x1f8acb=Object[_0x3ebe92(0x10a)](Object[_0x3ebe92(0xe2)](_0x4e7498)[_0x3ebe92(0xd6)](([,_0x1bb9b5])=>_0x1bb9b5!==undefined));if(Object[_0x3ebe92(0xd0)](_0x1f8acb)[_0x3ebe92(0xc7)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3ebe92(0xb5)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x3a6f93=await withSpinner(_0x3ebe92(0xd2)+_0x168945+_0x3ebe92(0xba),()=>_0x5cbe74['engage']['updateTemplate'](_0x168945,_0x1f8acb,_0x5497b8),{'verbose':_0x126d4e['verbose']});return await handleSDKOutput([_0x3a6f93[_0x3ebe92(0x12f)]],_0x126d4e),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xe5);[a22_0x11894c(0xd9)]='Delete\x20an\x20email\x20template';async[a22_0x11894c(0xfc)](_0xcdc79b){const _0x45ddc2=a22_0x11894c,{options:_0x3475c5,args:_0x481579,tdx:_0x5e6912}=_0xcdc79b;if(_0x481579['length']===0x0)return console[_0x45ddc2(0xb5)](_0x45ddc2(0xcf)),console['error'](_0x45ddc2(0xf1)),0x1;const _0x53f49a=_0x481579[0x0],_0x377807=_0x3475c5,_0x18e345=await resolveWorkspaceIdFromOptions(_0x377807,_0x5e6912);if(!_0x3475c5[_0x45ddc2(0xbe)]){const _0x4ba4f8=await confirm(_0x45ddc2(0x100)+_0x53f49a+_0x45ddc2(0x113));if(!_0x4ba4f8)return console[_0x45ddc2(0x123)](_0x45ddc2(0xdf)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x53f49a+'\x27...',()=>_0x5e6912[_0x45ddc2(0x127)][_0x45ddc2(0xcb)](_0x53f49a,_0x18e345),{'verbose':_0x3475c5[_0x45ddc2(0x138)]}),console[_0x45ddc2(0x123)](_0x45ddc2(0xd8)+_0x53f49a+_0x45ddc2(0xe3)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a22_0x11894c(0xb7);['description']=a22_0x11894c(0x129);async['execute'](_0x218823){const _0x4a8ede=a22_0x11894c,{options:_0x48487d,args:_0x4b88bd,tdx:_0x2c40ef}=_0x218823,_0x3521a5=_0x4b88bd[0x0],_0xde9c9=resolveLimit(_0x48487d['limit'],DEFAULT_LLM_LIMIT),_0x4fcfa6=await withSpinner(_0x4a8ede(0xf9),()=>_0x2c40ef[_0x4a8ede(0x127)]['listWorkspaces']({'limit':_0xde9c9}),{'verbose':_0x48487d['verbose']});let _0x3609da=_0x4fcfa6[_0x4a8ede(0x12f)];return _0x3521a5&&(_0x3609da=_0x4fcfa6['data']['filter'](_0x4543d1=>matchGlobPattern(_0x4543d1[_0x4a8ede(0xc8)],_0x3521a5))),await handleSDKOutput(_0x3609da,_0x48487d),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xff);[a22_0x11894c(0xd9)]=a22_0x11894c(0x116);async['execute'](_0x3394ac){const _0x2e2e70=a22_0x11894c,{options:_0x3fccca,args:_0x239565,tdx:_0x15344c}=_0x3394ac;if(_0x239565[_0x2e2e70(0xc7)]===0x0)return console['error'](_0x2e2e70(0xdb)),console[_0x2e2e70(0xb5)](_0x2e2e70(0xcd)),0x1;const _0x2c2f6c=_0x239565[0x0],_0x156e62=_0x3fccca,_0x1c9f52=_0x156e62[_0x2e2e70(0xc2)];if(_0x1c9f52){const _0x47383d=await withSpinner(_0x2e2e70(0xe9)+_0x2c2f6c+'\x27...',()=>_0x15344c['engage']['getWorkspaceFull'](_0x2c2f6c),{'verbose':_0x3fccca['verbose']});await handleSDKOutput([_0x47383d],_0x3fccca);}else{const _0x306530=await withSpinner(_0x2e2e70(0xe9)+_0x2c2f6c+_0x2e2e70(0xba),()=>_0x15344c['engage']['getWorkspace'](_0x2c2f6c),{'verbose':_0x3fccca[_0x2e2e70(0x138)]});await handleSDKOutput([_0x306530],_0x3fccca);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a22_0x11894c(0xd7);[a22_0x11894c(0xd9)]=a22_0x11894c(0xd3);async['execute'](_0x436a40){const _0x4ad863=a22_0x11894c,{options:_0x53f69a,tdx:_0x5cca33}=_0x436a40,_0x16a229=_0x53f69a,_0x398ddc=_0x16a229['name'];if(!_0x398ddc)return console['error'](_0x4ad863(0xcc)),console[_0x4ad863(0xb5)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x3b9a9d={'name':_0x398ddc,'description':_0x16a229['description']},_0x34b8f0=await withSpinner('Creating\x20workspace\x20\x27'+_0x398ddc+'\x27...',()=>_0x5cca33['engage']['createWorkspace'](_0x3b9a9d));return await handleSDKOutput([_0x34b8f0['data']],_0x53f69a),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a22_0x11894c(0xc8)]='engage:workspace:update';[a22_0x11894c(0xd9)]=a22_0x11894c(0x115);async[a22_0x11894c(0xfc)](_0x1e86e0){const _0x764c5c=a22_0x11894c,{options:_0x5c5e4e,args:_0x4753d9,tdx:_0x4403ed}=_0x1e86e0;if(_0x4753d9[_0x764c5c(0xc7)]===0x0)return console[_0x764c5c(0xb5)](_0x764c5c(0xdb)),console[_0x764c5c(0xb5)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x4170ad=_0x4753d9[0x0],_0x14f2cf=_0x5c5e4e,_0x18b3c0={'name':_0x14f2cf[_0x764c5c(0xc8)],'description':_0x14f2cf[_0x764c5c(0xd9)]},_0x398c9d=Object[_0x764c5c(0x10a)](Object['entries'](_0x18b3c0)['filter'](([,_0xa27999])=>_0xa27999!==undefined));if(Object[_0x764c5c(0xd0)](_0x398c9d)[_0x764c5c(0xc7)]===0x0)return console[_0x764c5c(0xb5)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x764c5c(0xb5)](_0x764c5c(0xbb)),0x1;const _0x1134ea=await withSpinner('Updating\x20workspace\x20\x27'+_0x4170ad+_0x764c5c(0xba),()=>_0x4403ed[_0x764c5c(0x127)][_0x764c5c(0x107)](_0x4170ad,_0x398c9d),{'verbose':_0x5c5e4e[_0x764c5c(0x138)]});return await handleSDKOutput([_0x1134ea['data']],_0x5c5e4e),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0xc6);['description']=a22_0x11894c(0xed);async[a22_0x11894c(0xfc)](_0xdeeb70){const _0x4c1836=a22_0x11894c,{options:_0x2cbcc0,args:_0x1229e8,tdx:_0x443c63}=_0xdeeb70;if(_0x1229e8[_0x4c1836(0xc7)]===0x0)return console['error'](_0x4c1836(0xdb)),console[_0x4c1836(0xb5)](_0x4c1836(0x133)),0x1;const _0x128ea5=_0x1229e8[0x0];if(!_0x2cbcc0['yes']){const _0x127105=await confirm(_0x4c1836(0x117)+_0x128ea5+_0x4c1836(0x113));if(!_0x127105)return console['log'](_0x4c1836(0xdf)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x128ea5+_0x4c1836(0xba),()=>_0x443c63[_0x4c1836(0x127)][_0x4c1836(0x130)](_0x128ea5),{'verbose':_0x2cbcc0[_0x4c1836(0x138)]}),console[_0x4c1836(0x123)](_0x4c1836(0xf8)+_0x128ea5+_0x4c1836(0xe3)),0x0;}}function a22_0x2136(_0x2a3aac,_0x56221a){const _0x3cfc0e=a22_0x3cfc();return a22_0x2136=function(_0x21369c,_0x3945cd){_0x21369c=_0x21369c-0xb1;let _0x4e1c6d=_0x3cfc0e[_0x21369c];return _0x4e1c6d;},a22_0x2136(_0x2a3aac,_0x56221a);}export class EngageWorkspaceUseCommand extends BaseCommand{[a22_0x11894c(0xc8)]=a22_0x11894c(0x121);['description']=a22_0x11894c(0xe0);async['execute'](_0x5e6cc0){const _0xaf459=a22_0x11894c,{options:_0x2a0f64,args:_0x41c5f9,tdx:_0x2af008}=_0x5e6cc0;if(_0x41c5f9[_0xaf459(0xc7)]===0x0)return console[_0xaf459(0xb5)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0xaf459(0xb5)](_0xaf459(0x106)),0x1;const _0xf32fc=_0x41c5f9[0x0];await withSpinner(_0xaf459(0xe7)+_0xf32fc+_0xaf459(0xba),()=>_0x2af008[_0xaf459(0x127)][_0xaf459(0x132)](_0xf32fc));const _0x257071=_0x2a0f64[_0xaf459(0x12c)]||undefined;return saveSessionContext({'engage_workspace':_0xf32fc},_0x257071),console[_0xaf459(0x123)]('Engage\x20workspace\x20set\x20to:\x20'+_0xf32fc),console[_0xaf459(0x123)](_0xaf459(0x124)),0x0;}}
1
+ const a23_0x4b5403=a23_0x4b5d;(function(_0x9a7285,_0x10550c){const _0x34de39=a23_0x4b5d,_0x1e517f=_0x9a7285();while(!![]){try{const _0x41ef9a=parseInt(_0x34de39(0x14e))/0x1+-parseInt(_0x34de39(0x13c))/0x2*(parseInt(_0x34de39(0x154))/0x3)+parseInt(_0x34de39(0xf5))/0x4*(-parseInt(_0x34de39(0x101))/0x5)+-parseInt(_0x34de39(0xe8))/0x6+parseInt(_0x34de39(0x11d))/0x7*(parseInt(_0x34de39(0x15d))/0x8)+-parseInt(_0x34de39(0x134))/0x9*(-parseInt(_0x34de39(0x130))/0xa)+-parseInt(_0x34de39(0x14a))/0xb*(parseInt(_0x34de39(0x138))/0xc);if(_0x41ef9a===_0x10550c)break;else _0x1e517f['push'](_0x1e517f['shift']());}catch(_0x2cefda){_0x1e517f['push'](_0x1e517f['shift']());}}}(a23_0x49d2,0xd846a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';function a23_0x49d2(){const _0x1ff0f2=['Fetching\x20campaigns...','listWorkspaces','engage:campaign:pause','createCampaign','Pausing\x20campaign\x20\x27','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','error','launchCampaign','engage_workspace','Updating\x20workspace\x20\x27','pauseCampaign','getTemplateFull','engage:campaign:show','deleteCampaign','\x27\x20deleted\x20successfully','Set\x20workspace\x20context\x20for\x20Engage\x20commands','getWorkspaceFull','deleteTemplate','subject','7236966ABDazq','engage:campaign:duplicate','engage:templates','Error:\x20Workspace\x20name\x20is\x20required','Delete\x20a\x20workspace','listCampaigns','engage:workspace:use','Resuming\x20campaign\x20\x27','execute','Pause\x20a\x20campaign','List\x20workspaces','Update\x20a\x20campaign','type','46772Ycftep','engage:template:update','Deleting\x20campaign\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Engage\x20workspace\x20set\x20to:\x20','editorType','getCampaign','updateCampaign','Show\x20email\x20template\x20details','Delete\x20a\x20campaign','MISSING_ARGUMENT','Options:\x20--name,\x20--description','40fwGbHZ','workspace','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','status','Creating\x20workspace\x20\x27','verbose','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Updating\x20template\x20\x27','Show\x20workspace\x20details','limit','engage:campaign:launch','html','\x27\x20paused\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','plaintext','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','engage:campaign:create','\x27...','createTemplate','Creating\x20campaign\x20\x27','segmentId','full','Delete\x20an\x20email\x20template','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:workspace:create','resolveWorkspaceId','Operation\x20cancelled','Deleting\x20workspace\x20\x27','7xdKbQl','Create\x20an\x20email\x20template','name','Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','getTemplate','engage:campaign:update','segmentName','Verifying\x20workspace\x20\x27','description','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Campaign\x20\x27','session','log','duplicateCampaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','emailSenderId','Update\x20a\x20workspace','10FTKeVA','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','data','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','10527309yqqufQ','Workspace\x20\x27','Duplicate\x20a\x20campaign','Duplicating\x20campaign\x20\x27','612ePyPZx','filter','createWorkspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','22048UFsBvx','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','engage','Fetching\x20template\x20\x27','getCampaignFull','Error:\x20--subject\x20is\x20required','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','length','engage:workspaces','List\x20campaigns','engage:campaign:delete','yes','fromEntries','79816CiXHPF','\x27?\x20This\x20cannot\x20be\x20undone.','Deleting\x20template\x20\x27','entries','1197496kaUjrb','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','keys','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','engage:campaigns','deleteWorkspace','183vfpMkd','Fetching\x20campaign\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','listTemplates','segment','engage:template:show','startAt','Show\x20campaign\x20details','Launching\x20campaign\x20\x27','6887152bVHxeq','Resume\x20a\x20paused\x20campaign','engage:workspace:delete','engage:template:delete','Error:\x20--name\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'];a23_0x49d2=function(){return _0x1ff0f2;};return a23_0x49d2();}import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x196760,_0x4138fb,_0x4963e0=![]){const _0x23bd75=a23_0x4b5d;if(_0x196760['workspace'])return await _0x4138fb[_0x23bd75(0x13f)][_0x23bd75(0x11a)](_0x196760[_0x23bd75(0x102)]);const _0x3b0122=loadSessionContext(_0x196760['session']);if(_0x3b0122?.['engage_workspace'])return await _0x4138fb[_0x23bd75(0x13f)][_0x23bd75(0x11a)](_0x3b0122[_0x23bd75(0x16c)]);if(_0x4963e0)throw new SDKError(ErrorCode[_0x23bd75(0xff)],_0x23bd75(0x118),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x3c0f81,_0x447c41){const _0x4a0b67=a23_0x4b5d;if(!_0x3c0f81['segment'])return{};const _0x17fe27=_0x3c0f81[_0x4a0b67(0x158)],_0x336a3b=await _0x447c41['segment']['resolvePathToResource'](_0x17fe27);return{'audienceId':_0x336a3b['parentId'],'audienceName':_0x336a3b['parentName'],..._0x336a3b[_0x4a0b67(0x115)]&&{'segmentId':_0x336a3b['segmentId'],'segmentName':_0x336a3b[_0x4a0b67(0x124)]}};}function buildConnectorConfig(_0x48e7e1){const _0x5e9fa5=a23_0x4b5d,_0x33f855=_0x48e7e1[_0x5e9fa5(0x12e)],_0x61759b=_0x48e7e1['jsonColumns'];if(!_0x33f855&&!_0x61759b)return undefined;return{..._0x33f855&&{'emailSenderId':_0x33f855},..._0x61759b&&{'jsonColumns':_0x61759b}};}export class EngageCampaignsCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x152);['description']=a23_0x4b5403(0x146);async[a23_0x4b5403(0xf0)](_0x4ab0ff){const _0x5f028f=a23_0x4b5403,{options:_0x40c68e,args:_0x5ca0be,tdx:_0x388a3d}=_0x4ab0ff,_0xaffc51=_0x5ca0be[0x0],_0x1fbfb9=resolveLimit(_0x40c68e[_0x5f028f(0x10a)],DEFAULT_LLM_LIMIT),_0x3218c3=_0x40c68e,_0x120384=_0x3218c3[_0x5f028f(0xf4)],_0x1083f4=_0x3218c3[_0x5f028f(0x104)],_0x5d9cfe=await resolveWorkspaceIdFromOptions(_0x3218c3,_0x388a3d),_0x4772dd=await withSpinner(_0x5f028f(0x164),()=>_0x388a3d[_0x5f028f(0x13f)][_0x5f028f(0xed)]({'type':_0x120384,'status':_0x1083f4,'workspaceId':_0x5d9cfe,'limit':_0x1fbfb9}),{'verbose':_0x40c68e[_0x5f028f(0x106)]});let _0x3785cd=_0x4772dd[_0x5f028f(0x132)];return _0xaffc51&&(_0x3785cd=_0x4772dd['data']['filter'](_0x1fcacb=>matchGlobPattern(_0x1fcacb[_0x5f028f(0x11f)],_0xaffc51))),await handleSDKOutput(_0x3785cd,_0x40c68e),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0xe1);[a23_0x4b5403(0x126)]=a23_0x4b5403(0x15b);async[a23_0x4b5403(0xf0)](_0x3de15a){const _0xd1f726=a23_0x4b5403,{options:_0x52b4bd,args:_0x321bbb,tdx:_0x226388}=_0x3de15a;if(_0x321bbb[_0xd1f726(0x144)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xd1f726(0x16a)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x365a92=_0x321bbb[0x0],_0xfaaaa5=_0x52b4bd,_0x517665=await resolveWorkspaceIdFromOptions(_0xfaaaa5,_0x226388),_0x147189=_0xfaaaa5[_0xd1f726(0x116)];if(_0x147189){const _0x45cd32=await withSpinner(_0xd1f726(0x155)+_0x365a92+_0xd1f726(0x112),()=>_0x226388[_0xd1f726(0x13f)][_0xd1f726(0x141)](_0x365a92,_0x517665),{'verbose':_0x52b4bd[_0xd1f726(0x106)]});await handleSDKOutput([_0x45cd32],_0x52b4bd);}else{const _0x347b1b=await withSpinner(_0xd1f726(0x155)+_0x365a92+_0xd1f726(0x112),()=>_0x226388['engage'][_0xd1f726(0xfb)](_0x365a92,_0x517665),{'verbose':_0x52b4bd[_0xd1f726(0x106)]});await handleSDKOutput([_0x347b1b],_0x52b4bd);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x111);[a23_0x4b5403(0x126)]='Create\x20a\x20new\x20campaign';async[a23_0x4b5403(0xf0)](_0x4f4835){const _0x394059=a23_0x4b5403,{options:_0x5bd3e8,tdx:_0x431947}=_0x4f4835,_0x2f207d=_0x5bd3e8,_0x456c41=_0x2f207d[_0x394059(0x11f)],_0xcf43bb=_0x2f207d[_0x394059(0xf4)];if(!_0x456c41)return console[_0x394059(0x16a)](_0x394059(0x161)),console[_0x394059(0x16a)](_0x394059(0x133)),0x1;if(!_0xcf43bb)return console[_0x394059(0x16a)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x394059(0x16a)](_0x394059(0x133)),0x1;const _0x31084e=await resolveWorkspaceIdFromOptions(_0x2f207d,_0x431947,!![]),_0xa4e645=await resolveSegmentFromOptions(_0x2f207d,_0x431947),_0x4093e0=buildConnectorConfig(_0x2f207d),_0xfcd9b4={'name':_0x456c41,'campaignType':_0xcf43bb,'workspaceId':_0x31084e,'description':_0x2f207d['description'],..._0xa4e645,'connectorConfig':_0x4093e0,'startAt':_0x2f207d[_0x394059(0x15a)],'timezone':_0x2f207d['timezone']},_0x2bddbc=await withSpinner(_0x394059(0x114)+_0x456c41+_0x394059(0x112),()=>_0x431947[_0x394059(0x13f)][_0x394059(0x167)](_0xfcd9b4));return await handleSDKOutput([_0x2bddbc['data']],_0x5bd3e8),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x123);[a23_0x4b5403(0x126)]=a23_0x4b5403(0xf3);async[a23_0x4b5403(0xf0)](_0x83ca1d){const _0x7c5a68=a23_0x4b5403,{options:_0x598d94,args:_0x2d93f1,tdx:_0x5273b6}=_0x83ca1d;if(_0x2d93f1[_0x7c5a68(0x144)]===0x0)return console[_0x7c5a68(0x16a)](_0x7c5a68(0xf8)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x3a2dd3=_0x2d93f1[0x0],_0x4b407e=_0x598d94,_0xac34bd=await resolveWorkspaceIdFromOptions(_0x4b407e,_0x5273b6),_0x11ea68=await resolveSegmentFromOptions(_0x4b407e,_0x5273b6),_0xa29b26=buildConnectorConfig(_0x4b407e),_0x28b493={'name':_0x4b407e[_0x7c5a68(0x11f)],'description':_0x4b407e[_0x7c5a68(0x126)],..._0x11ea68,'connectorConfig':_0xa29b26,'startAt':_0x4b407e[_0x7c5a68(0x15a)],'timezone':_0x4b407e['timezone']},_0x5013d=Object[_0x7c5a68(0x149)](Object[_0x7c5a68(0x14d)](_0x28b493)[_0x7c5a68(0x139)](([,_0x59f048])=>_0x59f048!==undefined));if(Object['keys'](_0x5013d)['length']===0x0)return console[_0x7c5a68(0x16a)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x7c5a68(0x143)),0x1;const _0xa2e8d4=await withSpinner('Updating\x20campaign\x20\x27'+_0x3a2dd3+_0x7c5a68(0x112),()=>_0x5273b6[_0x7c5a68(0x13f)][_0x7c5a68(0xfc)](_0x3a2dd3,_0x5013d,_0xac34bd),{'verbose':_0x598d94[_0x7c5a68(0x106)]});return await handleSDKOutput([_0xa2e8d4[_0x7c5a68(0x132)]],_0x598d94),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x147);['description']=a23_0x4b5403(0xfe);async[a23_0x4b5403(0xf0)](_0x1297c4){const _0x36b789=a23_0x4b5403,{options:_0x31758c,args:_0x5a0fd5,tdx:_0x674971}=_0x1297c4;if(_0x5a0fd5[_0x36b789(0x144)]===0x0)return console[_0x36b789(0x16a)](_0x36b789(0xf8)),console[_0x36b789(0x16a)](_0x36b789(0x121)),0x1;const _0xd4ef56=_0x5a0fd5[0x0],_0x129623=_0x31758c,_0x70803f=await resolveWorkspaceIdFromOptions(_0x129623,_0x674971);if(!_0x31758c[_0x36b789(0x148)]){const _0x2538a5=await confirm(_0x36b789(0x13d)+_0xd4ef56+_0x36b789(0x14b));if(!_0x2538a5)return console[_0x36b789(0x12a)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x36b789(0xf7)+_0xd4ef56+'\x27...',()=>_0x674971[_0x36b789(0x13f)][_0x36b789(0xe2)](_0xd4ef56,_0x70803f),{'verbose':_0x31758c[_0x36b789(0x106)]}),console[_0x36b789(0x12a)](_0x36b789(0x128)+_0xd4ef56+_0x36b789(0xe3)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x10b);[a23_0x4b5403(0x126)]='Launch\x20a\x20campaign';async[a23_0x4b5403(0xf0)](_0x405453){const _0x5ecc51=a23_0x4b5403,{options:_0x1f6594,args:_0x107c00,tdx:_0x45cd92}=_0x405453;if(_0x107c00['length']===0x0)return console[_0x5ecc51(0x16a)](_0x5ecc51(0xf8)),console['error'](_0x5ecc51(0x151)),0x1;const _0x3bc9ba=_0x107c00[0x0],_0x3ebebf=_0x1f6594,_0x4f8c9b=await resolveWorkspaceIdFromOptions(_0x3ebebf,_0x45cd92);return await withSpinner(_0x5ecc51(0x15c)+_0x3bc9ba+_0x5ecc51(0x112),()=>_0x45cd92['engage'][_0x5ecc51(0x16b)](_0x3bc9ba,_0x4f8c9b),{'verbose':_0x1f6594[_0x5ecc51(0x106)]}),console[_0x5ecc51(0x12a)]('Campaign\x20\x27'+_0x3bc9ba+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x166);['description']=a23_0x4b5403(0xf1);async['execute'](_0x2b38ca){const _0x51197a=a23_0x4b5403,{options:_0x2d78c9,args:_0x85bc45,tdx:_0x42945c}=_0x2b38ca;if(_0x85bc45['length']===0x0)return console[_0x51197a(0x16a)](_0x51197a(0xf8)),console[_0x51197a(0x16a)](_0x51197a(0x10e)),0x1;const _0x11943b=_0x85bc45[0x0],_0x138a4d=_0x2d78c9,_0x81a24a=await resolveWorkspaceIdFromOptions(_0x138a4d,_0x42945c);return await withSpinner(_0x51197a(0x168)+_0x11943b+_0x51197a(0x112),()=>_0x42945c['engage'][_0x51197a(0x16e)](_0x11943b,_0x81a24a),{'verbose':_0x2d78c9[_0x51197a(0x106)]}),console[_0x51197a(0x12a)](_0x51197a(0x128)+_0x11943b+_0x51197a(0x10d)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a23_0x4b5403(0x11f)]='engage:campaign:resume';[a23_0x4b5403(0x126)]=a23_0x4b5403(0x15e);async[a23_0x4b5403(0xf0)](_0x5e23bf){const _0x38d173=a23_0x4b5403,{options:_0x253067,args:_0xe6b7aa,tdx:_0x1a7c8c}=_0x5e23bf;if(_0xe6b7aa[_0x38d173(0x144)]===0x0)return console[_0x38d173(0x16a)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x38d173(0x16a)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x4ddabd=_0xe6b7aa[0x0],_0x4038a2=_0x253067,_0x5f4419=await resolveWorkspaceIdFromOptions(_0x4038a2,_0x1a7c8c);return await withSpinner(_0x38d173(0xef)+_0x4ddabd+_0x38d173(0x112),()=>_0x1a7c8c['engage']['resumeCampaign'](_0x4ddabd,_0x5f4419),{'verbose':_0x253067['verbose']}),console[_0x38d173(0x12a)]('Campaign\x20\x27'+_0x4ddabd+'\x27\x20resumed\x20successfully'),0x0;}}function a23_0x4b5d(_0x360ac9,_0x540801){_0x360ac9=_0x360ac9-0xe1;const _0x49d226=a23_0x49d2();let _0x4b5dca=_0x49d226[_0x360ac9];return _0x4b5dca;}export class EngageCampaignDuplicateCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0xe9);['description']=a23_0x4b5403(0x136);async['execute'](_0xcdc11d){const _0x4516b4=a23_0x4b5403,{options:_0x54e0f7,args:_0x196e83,tdx:_0x39369b}=_0xcdc11d;if(_0x196e83[_0x4516b4(0x144)]===0x0)return console[_0x4516b4(0x16a)](_0x4516b4(0xf8)),console[_0x4516b4(0x16a)](_0x4516b4(0x103)),0x1;const _0x4b077d=_0x196e83[0x0],_0xe85eca=_0x54e0f7,_0x5130bb=await resolveWorkspaceIdFromOptions(_0xe85eca,_0x39369b),_0x37bafe=await withSpinner(_0x4516b4(0x137)+_0x4b077d+_0x4516b4(0x112),()=>_0x39369b[_0x4516b4(0x13f)][_0x4516b4(0x12b)](_0x4b077d,_0x5130bb),{'verbose':_0x54e0f7[_0x4516b4(0x106)]});return await handleSDKOutput([_0x37bafe[_0x4516b4(0x132)]],_0x54e0f7),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0xea);[a23_0x4b5403(0x126)]='List\x20email\x20templates';async[a23_0x4b5403(0xf0)](_0x53e445){const _0x185878=a23_0x4b5403,{options:_0x20abad,args:_0x47c82c,tdx:_0x722da1}=_0x53e445,_0x383fbd=_0x47c82c[0x0],_0x389db3=resolveLimit(_0x20abad[_0x185878(0x10a)],DEFAULT_LLM_LIMIT),_0x317f8f=_0x20abad,_0x21d0e3=await resolveWorkspaceIdFromOptions(_0x317f8f,_0x722da1),_0x5577fc=await withSpinner('Fetching\x20templates...',()=>_0x722da1[_0x185878(0x13f)][_0x185878(0x157)]({'workspaceId':_0x21d0e3,'limit':_0x389db3}),{'verbose':_0x20abad['verbose']});let _0x3e1c15=_0x5577fc['data'];return _0x383fbd&&(_0x3e1c15=_0x5577fc[_0x185878(0x132)][_0x185878(0x139)](_0x536abc=>matchGlobPattern(_0x536abc['name'],_0x383fbd))),await handleSDKOutput(_0x3e1c15,_0x20abad),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x159);['description']=a23_0x4b5403(0xfd);async[a23_0x4b5403(0xf0)](_0x39f14e){const _0x629ef=a23_0x4b5403,{options:_0x87db07,args:_0x3d26ba,tdx:_0x17a6f1}=_0x39f14e;if(_0x3d26ba[_0x629ef(0x144)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x629ef(0x16a)](_0x629ef(0x131)),0x1;const _0x46ca8c=_0x3d26ba[0x0],_0x65fa88=_0x87db07,_0x41a4c9=await resolveWorkspaceIdFromOptions(_0x65fa88,_0x17a6f1),_0x48462e=_0x65fa88[_0x629ef(0x116)];if(_0x48462e){const _0x4fc5cf=await withSpinner(_0x629ef(0x140)+_0x46ca8c+_0x629ef(0x112),()=>_0x17a6f1[_0x629ef(0x13f)][_0x629ef(0x16f)](_0x46ca8c,_0x41a4c9),{'verbose':_0x87db07[_0x629ef(0x106)]});await handleSDKOutput([_0x4fc5cf],_0x87db07);}else{const _0x2e8b08=await withSpinner('Fetching\x20template\x20\x27'+_0x46ca8c+'\x27...',()=>_0x17a6f1[_0x629ef(0x13f)][_0x629ef(0x122)](_0x46ca8c,_0x41a4c9),{'verbose':_0x87db07['verbose']});await handleSDKOutput([_0x2e8b08],_0x87db07);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a23_0x4b5403(0x11f)]='engage:template:create';[a23_0x4b5403(0x126)]=a23_0x4b5403(0x11e);async['execute'](_0x59c8cb){const _0x11cc25=a23_0x4b5403,{options:_0x57408f,tdx:_0x3ffcb7}=_0x59c8cb,_0xc17f9f=_0x57408f,_0x57ddd0=_0xc17f9f[_0x11cc25(0x11f)],_0x3cf5f1=_0xc17f9f[_0x11cc25(0xe7)],_0x551207=_0xc17f9f[_0x11cc25(0x10c)];if(!_0x57ddd0)return console[_0x11cc25(0x16a)](_0x11cc25(0x161)),console[_0x11cc25(0x16a)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x3cf5f1)return console[_0x11cc25(0x16a)](_0x11cc25(0x142)),0x1;if(!_0x551207)return console[_0x11cc25(0x16a)]('Error:\x20--html\x20is\x20required'),0x1;const _0xf36a4=await resolveWorkspaceIdFromOptions(_0xc17f9f,_0x3ffcb7,!![]),_0x1bea93={'name':_0x57ddd0,'subjectTemplate':_0x3cf5f1,'htmlTemplate':_0x551207,'workspaceId':_0xf36a4,'plaintextTemplate':_0xc17f9f[_0x11cc25(0x10f)],'editorType':_0xc17f9f[_0x11cc25(0xfa)]},_0x283a8e=await withSpinner('Creating\x20template\x20\x27'+_0x57ddd0+'\x27...',()=>_0x3ffcb7[_0x11cc25(0x13f)][_0x11cc25(0x113)](_0x1bea93));return await handleSDKOutput([_0x283a8e[_0x11cc25(0x132)]],_0x57408f),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0xf6);['description']='Update\x20an\x20email\x20template';async[a23_0x4b5403(0xf0)](_0x4cbf46){const _0x4f1449=a23_0x4b5403,{options:_0x2a9d05,args:_0x46e025,tdx:_0x5e62ad}=_0x4cbf46;if(_0x46e025[_0x4f1449(0x144)]===0x0)return console['error'](_0x4f1449(0x169)),console[_0x4f1449(0x16a)](_0x4f1449(0x163)),0x1;const _0x30b789=_0x46e025[0x0],_0x261349=_0x2a9d05,_0x1e7679=await resolveWorkspaceIdFromOptions(_0x261349,_0x5e62ad),_0x59f9a0={'name':_0x261349['name'],'subjectTemplate':_0x261349['subject'],'htmlTemplate':_0x261349['html'],'plaintextTemplate':_0x261349[_0x4f1449(0x10f)]},_0x209b90=Object[_0x4f1449(0x149)](Object['entries'](_0x59f9a0)[_0x4f1449(0x139)](([,_0x1d2272])=>_0x1d2272!==undefined));if(Object[_0x4f1449(0x150)](_0x209b90)[_0x4f1449(0x144)]===0x0)return console[_0x4f1449(0x16a)](_0x4f1449(0x107)),console[_0x4f1449(0x16a)](_0x4f1449(0x156)),0x1;const _0x3fa04c=await withSpinner(_0x4f1449(0x108)+_0x30b789+_0x4f1449(0x112),()=>_0x5e62ad[_0x4f1449(0x13f)]['updateTemplate'](_0x30b789,_0x209b90,_0x1e7679),{'verbose':_0x2a9d05[_0x4f1449(0x106)]});return await handleSDKOutput([_0x3fa04c[_0x4f1449(0x132)]],_0x2a9d05),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a23_0x4b5403(0x160);[a23_0x4b5403(0x126)]=a23_0x4b5403(0x117);async[a23_0x4b5403(0xf0)](_0x4dfe9b){const _0x1af6ef=a23_0x4b5403,{options:_0x595176,args:_0x385f77,tdx:_0x4d44b9}=_0x4dfe9b;if(_0x385f77[_0x1af6ef(0x144)]===0x0)return console['error'](_0x1af6ef(0x169)),console['error'](_0x1af6ef(0x110)),0x1;const _0x1dd86b=_0x385f77[0x0],_0x319625=_0x595176,_0x4b4a16=await resolveWorkspaceIdFromOptions(_0x319625,_0x4d44b9);if(!_0x595176['yes']){const _0x5ec1a2=await confirm(_0x1af6ef(0x12c)+_0x1dd86b+_0x1af6ef(0x14b));if(!_0x5ec1a2)return console['log'](_0x1af6ef(0x11b)),0x0;}return await withSpinner(_0x1af6ef(0x14c)+_0x1dd86b+'\x27...',()=>_0x4d44b9['engage'][_0x1af6ef(0xe6)](_0x1dd86b,_0x4b4a16),{'verbose':_0x595176[_0x1af6ef(0x106)]}),console[_0x1af6ef(0x12a)]('Template\x20\x27'+_0x1dd86b+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x145);['description']=a23_0x4b5403(0xf2);async[a23_0x4b5403(0xf0)](_0xd5e54b){const _0x7ca8c0=a23_0x4b5403,{options:_0x5b7a48,args:_0x1b9a1f,tdx:_0x5f5995}=_0xd5e54b,_0x4501ec=_0x1b9a1f[0x0],_0x3c3251=resolveLimit(_0x5b7a48['limit'],DEFAULT_LLM_LIMIT),_0x147e42=await withSpinner('Fetching\x20workspaces...',()=>_0x5f5995[_0x7ca8c0(0x13f)][_0x7ca8c0(0x165)]({'limit':_0x3c3251}),{'verbose':_0x5b7a48[_0x7ca8c0(0x106)]});let _0x3c0391=_0x147e42[_0x7ca8c0(0x132)];return _0x4501ec&&(_0x3c0391=_0x147e42[_0x7ca8c0(0x132)][_0x7ca8c0(0x139)](_0x44d4d1=>matchGlobPattern(_0x44d4d1[_0x7ca8c0(0x11f)],_0x4501ec))),await handleSDKOutput(_0x3c0391,_0x5b7a48),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a23_0x4b5403(0x11f)]='engage:workspace:show';[a23_0x4b5403(0x126)]=a23_0x4b5403(0x109);async['execute'](_0x259859){const _0x1497af=a23_0x4b5403,{options:_0x1f66ba,args:_0x13a482,tdx:_0x5f562d}=_0x259859;if(_0x13a482[_0x1497af(0x144)]===0x0)return console[_0x1497af(0x16a)](_0x1497af(0x12d)),console[_0x1497af(0x16a)](_0x1497af(0x162)),0x1;const _0x13a220=_0x13a482[0x0],_0xd6e22b=_0x1f66ba,_0x1f8a7d=_0xd6e22b[_0x1497af(0x116)];if(_0x1f8a7d){const _0x264d35=await withSpinner('Fetching\x20workspace\x20\x27'+_0x13a220+_0x1497af(0x112),()=>_0x5f562d[_0x1497af(0x13f)][_0x1497af(0xe5)](_0x13a220),{'verbose':_0x1f66ba[_0x1497af(0x106)]});await handleSDKOutput([_0x264d35],_0x1f66ba);}else{const _0x2a2c56=await withSpinner(_0x1497af(0x120)+_0x13a220+_0x1497af(0x112),()=>_0x5f562d[_0x1497af(0x13f)]['getWorkspace'](_0x13a220),{'verbose':_0x1f66ba[_0x1497af(0x106)]});await handleSDKOutput([_0x2a2c56],_0x1f66ba);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x119);[a23_0x4b5403(0x126)]='Create\x20a\x20workspace';async['execute'](_0x1e87d3){const _0x13020c=a23_0x4b5403,{options:_0x22cbe3,tdx:_0x3bb41b}=_0x1e87d3,_0x4910a5=_0x22cbe3,_0x47e3cc=_0x4910a5['name'];if(!_0x47e3cc)return console[_0x13020c(0x16a)]('Error:\x20--name\x20is\x20required'),console['error'](_0x13020c(0x13e)),0x1;const _0x3ce411={'name':_0x47e3cc,'description':_0x4910a5[_0x13020c(0x126)]},_0x4dfa5c=await withSpinner(_0x13020c(0x105)+_0x47e3cc+_0x13020c(0x112),()=>_0x3bb41b[_0x13020c(0x13f)][_0x13020c(0x13a)](_0x3ce411));return await handleSDKOutput([_0x4dfa5c[_0x13020c(0x132)]],_0x22cbe3),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']='engage:workspace:update';['description']=a23_0x4b5403(0x12f);async[a23_0x4b5403(0xf0)](_0x46cb5f){const _0x4eead9=a23_0x4b5403,{options:_0x110dc2,args:_0x481429,tdx:_0x4de1a9}=_0x46cb5f;if(_0x481429[_0x4eead9(0x144)]===0x0)return console[_0x4eead9(0x16a)](_0x4eead9(0x12d)),console[_0x4eead9(0x16a)](_0x4eead9(0x14f)),0x1;const _0x47d9ff=_0x481429[0x0],_0x595430=_0x110dc2,_0x1bcd1b={'name':_0x595430[_0x4eead9(0x11f)],'description':_0x595430[_0x4eead9(0x126)]},_0x47311d=Object[_0x4eead9(0x149)](Object[_0x4eead9(0x14d)](_0x1bcd1b)[_0x4eead9(0x139)](([,_0x481bfc])=>_0x481bfc!==undefined));if(Object[_0x4eead9(0x150)](_0x47311d)[_0x4eead9(0x144)]===0x0)return console['error'](_0x4eead9(0x107)),console[_0x4eead9(0x16a)](_0x4eead9(0x100)),0x1;const _0x447d4f=await withSpinner(_0x4eead9(0x16d)+_0x47d9ff+_0x4eead9(0x112),()=>_0x4de1a9[_0x4eead9(0x13f)]['updateWorkspace'](_0x47d9ff,_0x47311d),{'verbose':_0x110dc2[_0x4eead9(0x106)]});return await handleSDKOutput([_0x447d4f[_0x4eead9(0x132)]],_0x110dc2),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0x15f);[a23_0x4b5403(0x126)]=a23_0x4b5403(0xec);async['execute'](_0x170d7e){const _0x149b69=a23_0x4b5403,{options:_0x2ab510,args:_0x2b78d5,tdx:_0x2818f6}=_0x170d7e;if(_0x2b78d5['length']===0x0)return console[_0x149b69(0x16a)](_0x149b69(0x12d)),console['error'](_0x149b69(0x127)),0x1;const _0x394e75=_0x2b78d5[0x0];if(!_0x2ab510[_0x149b69(0x148)]){const _0x1b1720=await confirm(_0x149b69(0x13b)+_0x394e75+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x1b1720)return console[_0x149b69(0x12a)](_0x149b69(0x11b)),0x0;}return await withSpinner(_0x149b69(0x11c)+_0x394e75+_0x149b69(0x112),()=>_0x2818f6[_0x149b69(0x13f)][_0x149b69(0x153)](_0x394e75),{'verbose':_0x2ab510[_0x149b69(0x106)]}),console[_0x149b69(0x12a)](_0x149b69(0x135)+_0x394e75+_0x149b69(0xe3)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a23_0x4b5403(0x11f)]=a23_0x4b5403(0xee);[a23_0x4b5403(0x126)]=a23_0x4b5403(0xe4);async['execute'](_0x473de5){const _0x5ca27d=a23_0x4b5403,{options:_0x340f22,args:_0x26b931,tdx:_0x3f4641}=_0x473de5;if(_0x26b931[_0x5ca27d(0x144)]===0x0)return console['error'](_0x5ca27d(0xeb)),console[_0x5ca27d(0x16a)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x51bb4c=_0x26b931[0x0];await withSpinner(_0x5ca27d(0x125)+_0x51bb4c+_0x5ca27d(0x112),()=>_0x3f4641[_0x5ca27d(0x13f)][_0x5ca27d(0x11a)](_0x51bb4c));const _0x317179=_0x340f22[_0x5ca27d(0x129)]||undefined;return saveSessionContext({'engage_workspace':_0x51bb4c},_0x317179),console[_0x5ca27d(0x12a)](_0x5ca27d(0xf9)+_0x51bb4c),console[_0x5ca27d(0x12a)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
@@ -1 +1 @@
1
- const a23_0x1b09ee=a23_0x54a3;(function(_0x31b1fe,_0x9ffb2a){const _0x211db4=a23_0x54a3,_0x120913=_0x31b1fe();while(!![]){try{const _0x257be9=-parseInt(_0x211db4(0x1ef))/0x1+parseInt(_0x211db4(0x1e2))/0x2+-parseInt(_0x211db4(0x1b7))/0x3+parseInt(_0x211db4(0x1cf))/0x4+-parseInt(_0x211db4(0x1a9))/0x5+parseInt(_0x211db4(0x1d7))/0x6+parseInt(_0x211db4(0x1ae))/0x7;if(_0x257be9===_0x9ffb2a)break;else _0x120913['push'](_0x120913['shift']());}catch(_0x2a5ec6){_0x120913['push'](_0x120913['shift']());}}}(a23_0x230d,0x95d3e));import{BaseCommand}from'./command.js';function a23_0x54a3(_0x52b8d3,_0x40ae4c){const _0x230dfb=a23_0x230d();return a23_0x54a3=function(_0x54a37b,_0x438ac6){_0x54a37b=_0x54a37b-0x1a7;let _0x14cb44=_0x230dfb[_0x54a37b];return _0x14cb44;},a23_0x54a3(_0x52b8d3,_0x40ae4c);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a23_0x230d(){const _0x3de7b5=['map','description','✔\x20Found\x20','error','status','Error:\x20','570050vhrmqZ','kill','verbose','Kill\x20a\x20job','cause','debug','Job\x20type:\x20','List\x20jobs','job:kill','show','result','query','length','821659QbxJtM','Get\x20job\x20results','type','Error:\x20Query\x20is\x20required','Submitting\x20kill\x20request...','4294625tUgZgd','job:show','start_at','hive','Show\x20job\x20details','8034264pMrahM','yes','message','end_at','Usage:\x20job\x20show\x20<job-id>','\x20row','data','\x20\x20Cause:\x20','url','1435251fyCzAO','execute','list','limit','created_at','jobs','Database:\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','name','getTime','\x20\x20Job\x20ID:\x20','Limit:\x20','Query:\x20','\x20jobs','priority','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','job_id','Cancelled','database','submit','substring','✔\x20Retrieved\x20','2104760RhTOtJ','Listing\x20jobs...','\x20job','✔\x20Job\x20submitted','Submit\x20a\x20job','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Error:\x20Job\x20ID\x20is\x20required','4882368nuTFwU','user_name','file','Usage:\x20job\x20result\x20<job-id>','Getting\x20job\x20details...'];a23_0x230d=function(){return _0x3de7b5;};return a23_0x230d();}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a23_0x1b09ee(0x1c1)]=a23_0x1b09ee(0x1bc);[a23_0x1b09ee(0x1dd)]=a23_0x1b09ee(0x1e9);async[a23_0x1b09ee(0x1b8)](_0x148ad6){const _0x534a84=a23_0x1b09ee,{options:_0x380473,tdx:_0x21c6cb}=_0x148ad6;try{const _0x58bfb7=resolveLimit(_0x380473[_0x534a84(0x1ba)],DEFAULT_DISPLAY_LIMIT),_0x7a7115=_0x380473['status'];_0x380473[_0x534a84(0x1e4)]&&(console[_0x534a84(0x1df)](_0x534a84(0x1c4)+_0x58bfb7+_0x534a84(0x1c6)),_0x7a7115&&console['error']('Status\x20filter:\x20'+_0x7a7115));const _0x5f0307=await withSpinner(_0x534a84(0x1d0),()=>_0x21c6cb[_0x534a84(0x1bc)][_0x534a84(0x1b9)]({'from':0x0,'to':_0x58bfb7-0x1,'status':_0x7a7115}),{'verbose':_0x380473[_0x534a84(0x1e4)]}),_0x8f4d2e=_0x5f0307['data'];console['error'](_0x534a84(0x1de)+_0x8f4d2e[_0x534a84(0x1ee)]+_0x534a84(0x1d1)+(_0x8f4d2e[_0x534a84(0x1ee)]!==0x1?'s':''));const _0x48971d=_0x8f4d2e[_0x534a84(0x1dc)](_0x57637d=>{const _0x22df91=_0x534a84;let _0x2ef212;if(_0x57637d[_0x22df91(0x1ab)]&&_0x57637d[_0x22df91(0x1b1)]){const _0x4c8d2f=new Date(_0x57637d[_0x22df91(0x1ab)])[_0x22df91(0x1c2)](),_0x405c6d=new Date(_0x57637d[_0x22df91(0x1b1)])[_0x22df91(0x1c2)]();_0x2ef212=Math['round']((_0x405c6d-_0x4c8d2f)/0x3e8);}return{'job_id':_0x57637d['job_id'],'type':_0x57637d[_0x22df91(0x1f1)],'status':_0x57637d[_0x22df91(0x1e0)],'user_name':_0x57637d[_0x22df91(0x1d8)],'duration_sec':_0x2ef212,'created_at':_0x57637d['created_at'],'started_at':_0x57637d[_0x22df91(0x1ab)],'end_at':_0x57637d['end_at']};});return await handleSDKOutput(_0x48971d,_0x380473),0x0;}catch(_0x3f80d8){if(_0x3f80d8 instanceof SDKError)return console[_0x534a84(0x1df)]('Error:\x20'+_0x3f80d8[_0x534a84(0x1b0)]),_0x3f80d8[_0x534a84(0x1e6)]&&console[_0x534a84(0x1df)](_0x534a84(0x1b5)+_0x3f80d8[_0x534a84(0x1e6)]),0x1;throw _0x3f80d8;}}}export class JobShowCommand extends BaseCommand{[a23_0x1b09ee(0x1c1)]=a23_0x1b09ee(0x1aa);[a23_0x1b09ee(0x1dd)]=a23_0x1b09ee(0x1ad);async[a23_0x1b09ee(0x1b8)](_0x574555){const _0x232144=a23_0x1b09ee,{options:_0x37f7fd,args:_0x2ef9bf,tdx:_0x230e65}=_0x574555,_0x44abe3=_0x2ef9bf[0x0];if(!_0x44abe3)return console[_0x232144(0x1df)](_0x232144(0x1d6)),console[_0x232144(0x1df)](_0x232144(0x1b2)),0x1;try{const _0x183a01=await withSpinner(_0x232144(0x1db),()=>_0x230e65[_0x232144(0x1bc)][_0x232144(0x1eb)](_0x44abe3),{'verbose':_0x37f7fd[_0x232144(0x1e4)]}),_0x45ed88=_0x183a01[_0x232144(0x1b4)];let _0x130d3f;if(_0x45ed88[_0x232144(0x1ab)]&&_0x45ed88['end_at']){const _0x1997b8=new Date(_0x45ed88['start_at'])[_0x232144(0x1c2)](),_0x59c225=new Date(_0x45ed88[_0x232144(0x1b1)])[_0x232144(0x1c2)]();_0x130d3f=Math['round']((_0x59c225-_0x1997b8)/0x3e8);}const _0x254e9a={'job_id':_0x45ed88['job_id'],'type':_0x45ed88[_0x232144(0x1f1)],'status':_0x45ed88[_0x232144(0x1e0)],..._0x45ed88['user_name']&&{'user_name':_0x45ed88[_0x232144(0x1d8)]},..._0x130d3f!==undefined&&{'duration_sec':_0x130d3f},..._0x45ed88[_0x232144(0x1bb)]&&{'created_at':_0x45ed88[_0x232144(0x1bb)]},..._0x45ed88[_0x232144(0x1ab)]&&{'started_at':_0x45ed88['start_at']},..._0x45ed88[_0x232144(0x1b1)]&&{'end_at':_0x45ed88[_0x232144(0x1b1)]},..._0x45ed88[_0x232144(0x1cb)]&&{'database':_0x45ed88[_0x232144(0x1cb)]},..._0x45ed88[_0x232144(0x1c7)]!==undefined&&{'priority':_0x45ed88[_0x232144(0x1c7)]},..._0x45ed88[_0x232144(0x1b6)]&&{'url':_0x45ed88[_0x232144(0x1b6)]},..._0x45ed88['query']&&{'query':_0x45ed88[_0x232144(0x1ed)]},..._0x45ed88['debug']&&{'debug':_0x45ed88[_0x232144(0x1e7)]}};return await handleSingleObjectOutput(_0x254e9a,_0x37f7fd),0x0;}catch(_0x50b88b){if(_0x50b88b instanceof SDKError)return console[_0x232144(0x1df)]('Error:\x20'+_0x50b88b['message']),_0x50b88b[_0x232144(0x1e6)]&&console['error'](_0x232144(0x1b5)+_0x50b88b[_0x232144(0x1e6)]),0x1;throw _0x50b88b;}}}export class JobKillCommand extends BaseCommand{[a23_0x1b09ee(0x1c1)]=a23_0x1b09ee(0x1ea);[a23_0x1b09ee(0x1dd)]=a23_0x1b09ee(0x1e5);async[a23_0x1b09ee(0x1b8)](_0x4f61d3){const _0xad0df2=a23_0x1b09ee,{options:_0x506882,args:_0x2df274,tdx:_0x25ee86}=_0x4f61d3,_0x43c780=_0x2df274[0x0];if(!_0x43c780)return console[_0xad0df2(0x1df)](_0xad0df2(0x1d6)),console[_0xad0df2(0x1df)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x506882[_0xad0df2(0x1af)]){const _0x414c83=await confirm(_0xad0df2(0x1c0)+_0x43c780+'?');if(!_0x414c83)return console[_0xad0df2(0x1df)](_0xad0df2(0x1ca)),0x0;}return await withSpinner(_0xad0df2(0x1a8),()=>_0x25ee86[_0xad0df2(0x1bc)][_0xad0df2(0x1e3)](_0x43c780),{'verbose':_0x506882['verbose']}),console['error'](_0xad0df2(0x1be)+_0x43c780),console[_0xad0df2(0x1df)](_0xad0df2(0x1d5)+_0x43c780+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}catch(_0x3b18f3){if(_0x3b18f3 instanceof SDKError)return console[_0xad0df2(0x1df)](_0xad0df2(0x1e1)+_0x3b18f3['message']),_0x3b18f3[_0xad0df2(0x1e6)]&&console[_0xad0df2(0x1df)]('\x20\x20Cause:\x20'+_0x3b18f3['cause']),0x1;throw _0x3b18f3;}}}export class JobSubmitCommand extends BaseCommand{[a23_0x1b09ee(0x1c1)]='job:submit';[a23_0x1b09ee(0x1dd)]=a23_0x1b09ee(0x1d3);async[a23_0x1b09ee(0x1b8)](_0x591cc8){const _0x212d91=a23_0x1b09ee,{options:_0x2a30de,args:_0x7de57e,tdx:_0x2788cf}=_0x591cc8;try{const _0x2addd8=_0x2a30de['jobType']||'trino',_0x83ac4d=_0x2a30de[_0x212d91(0x1d9)],_0x50d8a3=_0x2a30de[_0x212d91(0x1cb)]||'information_schema';if(_0x2addd8!=='trino'&&_0x2addd8!==_0x212d91(0x1ac))return console[_0x212d91(0x1df)](_0x212d91(0x1d4)),0x1;let _0x81a4bc;if(_0x83ac4d){if(_0x7de57e[0x0])return console[_0x212d91(0x1df)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x1935ff=readSqlStatementsFromFile(_0x83ac4d);if(_0x1935ff[_0x212d91(0x1ee)]===0x0)return console[_0x212d91(0x1df)](_0x212d91(0x1c8)),0x1;if(_0x1935ff[_0x212d91(0x1ee)]>0x1)return console[_0x212d91(0x1df)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0x81a4bc=_0x1935ff[0x0];}else{if(!_0x7de57e[0x0])return console[_0x212d91(0x1df)](_0x212d91(0x1a7)),console[_0x212d91(0x1df)]('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x81a4bc=_0x7de57e[0x0];}_0x2a30de[_0x212d91(0x1e4)]&&(console[_0x212d91(0x1df)](_0x212d91(0x1e8)+_0x2addd8),console['error'](_0x212d91(0x1bd)+_0x50d8a3),console[_0x212d91(0x1df)](_0x212d91(0x1c5)+_0x81a4bc[_0x212d91(0x1cd)](0x0,0x64)+(_0x81a4bc['length']>0x64?_0x212d91(0x1bf):'')));const _0x6b7c6=await withSpinner('Submitting\x20job...',()=>_0x2788cf[_0x212d91(0x1bc)][_0x212d91(0x1cc)](_0x50d8a3,_0x81a4bc,_0x2addd8),{'verbose':_0x2a30de[_0x212d91(0x1e4)]}),_0x20d542=_0x6b7c6[_0x212d91(0x1b4)];return console[_0x212d91(0x1df)](_0x212d91(0x1d2)),console[_0x212d91(0x1df)](_0x212d91(0x1c3)+_0x20d542[_0x212d91(0x1c9)]),await handleSDKOutput([_0x20d542],_0x2a30de),0x0;}catch(_0x1f8d5e){if(_0x1f8d5e instanceof SDKError)return console[_0x212d91(0x1df)](_0x212d91(0x1e1)+_0x1f8d5e[_0x212d91(0x1b0)]),_0x1f8d5e[_0x212d91(0x1e6)]&&console[_0x212d91(0x1df)](_0x212d91(0x1b5)+_0x1f8d5e[_0x212d91(0x1e6)]),0x1;throw _0x1f8d5e;}}}export class JobResultCommand extends BaseCommand{[a23_0x1b09ee(0x1c1)]='job:result';[a23_0x1b09ee(0x1dd)]=a23_0x1b09ee(0x1f0);async['execute'](_0x276fdf){const _0x46bcbc=a23_0x1b09ee,{options:_0xde5150,args:_0x38f33f,tdx:_0x16f711}=_0x276fdf,_0x30188d=_0x38f33f[0x0];if(!_0x30188d)return console['error'](_0x46bcbc(0x1d6)),console[_0x46bcbc(0x1df)](_0x46bcbc(0x1da)),0x1;try{const _0x226e8b=await withSpinner('Getting\x20job\x20results...',()=>_0x16f711[_0x46bcbc(0x1bc)][_0x46bcbc(0x1ec)](_0x30188d),{'verbose':_0xde5150[_0x46bcbc(0x1e4)]}),_0x3e611e=_0x226e8b['data'];return console[_0x46bcbc(0x1df)](_0x46bcbc(0x1ce)+_0x3e611e['length']+_0x46bcbc(0x1b3)+(_0x3e611e[_0x46bcbc(0x1ee)]!==0x1?'s':'')),await handleSDKOutput(_0x3e611e,_0xde5150),0x0;}catch(_0x177549){if(_0x177549 instanceof SDKError)return console['error']('Error:\x20'+_0x177549['message']),_0x177549[_0x46bcbc(0x1e6)]&&console[_0x46bcbc(0x1df)](_0x46bcbc(0x1b5)+_0x177549[_0x46bcbc(0x1e6)]),0x1;throw _0x177549;}}}
1
+ function a24_0x3ca6(_0x956f45,_0x193f41){_0x956f45=_0x956f45-0x14a;const _0x1f32cd=a24_0x1f32();let _0x3ca6a0=_0x1f32cd[_0x956f45];return _0x3ca6a0;}const a24_0x3afaf6=a24_0x3ca6;(function(_0x15cd73,_0x243e37){const _0x37a6ff=a24_0x3ca6,_0x4fe855=_0x15cd73();while(!![]){try{const _0xdd7b23=parseInt(_0x37a6ff(0x178))/0x1+parseInt(_0x37a6ff(0x170))/0x2*(parseInt(_0x37a6ff(0x166))/0x3)+parseInt(_0x37a6ff(0x162))/0x4*(parseInt(_0x37a6ff(0x168))/0x5)+-parseInt(_0x37a6ff(0x199))/0x6+-parseInt(_0x37a6ff(0x195))/0x7+-parseInt(_0x37a6ff(0x14f))/0x8+parseInt(_0x37a6ff(0x158))/0x9*(-parseInt(_0x37a6ff(0x154))/0xa);if(_0xdd7b23===_0x243e37)break;else _0x4fe855['push'](_0x4fe855['shift']());}catch(_0xd7f094){_0x4fe855['push'](_0x4fe855['shift']());}}}(a24_0x1f32,0xbb906));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]='jobs';['description']=a24_0x3afaf6(0x16c);async[a24_0x3afaf6(0x197)](_0x36a5b6){const _0x38140f=a24_0x3afaf6,{options:_0x31ecb1,tdx:_0x24d66b}=_0x36a5b6;try{const _0x2fa3e5=resolveLimit(_0x31ecb1['limit'],DEFAULT_DISPLAY_LIMIT),_0x44389e=_0x31ecb1[_0x38140f(0x165)];_0x31ecb1['verbose']&&(console[_0x38140f(0x19c)](_0x38140f(0x19b)+_0x2fa3e5+'\x20jobs'),_0x44389e&&console[_0x38140f(0x19c)](_0x38140f(0x169)+_0x44389e));const _0x2e09a6=await withSpinner(_0x38140f(0x16a),()=>_0x24d66b[_0x38140f(0x196)][_0x38140f(0x172)]({'from':0x0,'to':_0x2fa3e5-0x1,'status':_0x44389e}),{'verbose':_0x31ecb1[_0x38140f(0x177)]}),_0x78844f=_0x2e09a6['data'];console[_0x38140f(0x19c)](_0x38140f(0x16b)+_0x78844f[_0x38140f(0x19a)]+'\x20job'+(_0x78844f[_0x38140f(0x19a)]!==0x1?'s':''));const _0x50e42c=_0x78844f[_0x38140f(0x14a)](_0x229e12=>{const _0x2441be=_0x38140f;let _0x3a5d95;if(_0x229e12[_0x2441be(0x192)]&&_0x229e12[_0x2441be(0x159)]){const _0xb50011=new Date(_0x229e12[_0x2441be(0x192)])[_0x2441be(0x157)](),_0x10440f=new Date(_0x229e12['end_at'])['getTime']();_0x3a5d95=Math[_0x2441be(0x17b)]((_0x10440f-_0xb50011)/0x3e8);}return{'job_id':_0x229e12[_0x2441be(0x190)],'type':_0x229e12[_0x2441be(0x18c)],'status':_0x229e12[_0x2441be(0x165)],'user_name':_0x229e12[_0x2441be(0x16f)],'duration_sec':_0x3a5d95,'created_at':_0x229e12[_0x2441be(0x15a)],'started_at':_0x229e12[_0x2441be(0x192)],'end_at':_0x229e12[_0x2441be(0x159)]};});return await handleSDKOutput(_0x50e42c,_0x31ecb1),0x0;}catch(_0x568e3a){if(_0x568e3a instanceof SDKError)return console[_0x38140f(0x19c)]('Error:\x20'+_0x568e3a[_0x38140f(0x18e)]),_0x568e3a['cause']&&console['error'](_0x38140f(0x173)+_0x568e3a[_0x38140f(0x153)]),0x1;throw _0x568e3a;}}}function a24_0x1f32(){const _0x58fefc=['job:result','Show\x20job\x20details','status','122919uqKbwX','hive','159910eaDwZg','Status\x20filter:\x20','Listing\x20jobs...','✔\x20Found\x20','List\x20jobs','Get\x20job\x20results','✔\x20Retrieved\x20','user_name','46rZgNXF','Error:\x20','list','\x20\x20Cause:\x20','Usage:\x20job\x20result\x20<job-id>','data','file','verbose','271153CPBFhW','\x27\x20to\x20verify\x20the\x20job\x20status','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','round','\x20row','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','Submit\x20a\x20job','job:submit','description','Cancelled','submit','job:show','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Usage:\x20job\x20show\x20<job-id>','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','query','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','kill','Submitting\x20kill\x20request...','type','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','message','url','job_id','Submitting\x20job...','start_at','\x20\x20Job\x20ID:\x20','yes','3886064szHnvu','jobs','execute','Getting\x20job\x20details...','918066PlgrIs','length','Limit:\x20','error','map','job:kill','Query:\x20','name','Error:\x20Job\x20ID\x20is\x20required','1792824YvtQsN','priority','✔\x20Job\x20submitted','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','cause','8242660NPkFip','trino','information_schema','getTime','9CyBFmj','end_at','created_at','database','result','Error:\x20Query\x20is\x20required','Database:\x20','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Job\x20type:\x20','debug','164ipldvU'];a24_0x1f32=function(){return _0x58fefc;};return a24_0x1f32();}export class JobShowCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x183);[a24_0x3afaf6(0x180)]=a24_0x3afaf6(0x164);async[a24_0x3afaf6(0x197)](_0x567fa2){const _0x5bece7=a24_0x3afaf6,{options:_0x503468,args:_0x26d542,tdx:_0x237438}=_0x567fa2,_0x366f59=_0x26d542[0x0];if(!_0x366f59)return console[_0x5bece7(0x19c)](_0x5bece7(0x14e)),console[_0x5bece7(0x19c)](_0x5bece7(0x185)),0x1;try{const _0x23834e=await withSpinner(_0x5bece7(0x198),()=>_0x237438['jobs']['show'](_0x366f59),{'verbose':_0x503468[_0x5bece7(0x177)]}),_0x2ce433=_0x23834e['data'];let _0x43c36e;if(_0x2ce433[_0x5bece7(0x192)]&&_0x2ce433['end_at']){const _0x42af35=new Date(_0x2ce433['start_at'])[_0x5bece7(0x157)](),_0x1c744a=new Date(_0x2ce433[_0x5bece7(0x159)])[_0x5bece7(0x157)]();_0x43c36e=Math[_0x5bece7(0x17b)]((_0x1c744a-_0x42af35)/0x3e8);}const _0x1bd70a={'job_id':_0x2ce433[_0x5bece7(0x190)],'type':_0x2ce433['type'],'status':_0x2ce433[_0x5bece7(0x165)],..._0x2ce433[_0x5bece7(0x16f)]&&{'user_name':_0x2ce433[_0x5bece7(0x16f)]},..._0x43c36e!==undefined&&{'duration_sec':_0x43c36e},..._0x2ce433[_0x5bece7(0x15a)]&&{'created_at':_0x2ce433[_0x5bece7(0x15a)]},..._0x2ce433['start_at']&&{'started_at':_0x2ce433['start_at']},..._0x2ce433['end_at']&&{'end_at':_0x2ce433[_0x5bece7(0x159)]},..._0x2ce433[_0x5bece7(0x15b)]&&{'database':_0x2ce433[_0x5bece7(0x15b)]},..._0x2ce433[_0x5bece7(0x150)]!==undefined&&{'priority':_0x2ce433[_0x5bece7(0x150)]},..._0x2ce433[_0x5bece7(0x18f)]&&{'url':_0x2ce433[_0x5bece7(0x18f)]},..._0x2ce433[_0x5bece7(0x187)]&&{'query':_0x2ce433[_0x5bece7(0x187)]},..._0x2ce433[_0x5bece7(0x161)]&&{'debug':_0x2ce433[_0x5bece7(0x161)]}};return await handleSingleObjectOutput(_0x1bd70a,_0x503468),0x0;}catch(_0x5c68f4){if(_0x5c68f4 instanceof SDKError)return console['error']('Error:\x20'+_0x5c68f4['message']),_0x5c68f4[_0x5bece7(0x153)]&&console[_0x5bece7(0x19c)]('\x20\x20Cause:\x20'+_0x5c68f4[_0x5bece7(0x153)]),0x1;throw _0x5c68f4;}}}export class JobKillCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x14b);[a24_0x3afaf6(0x180)]='Kill\x20a\x20job';async[a24_0x3afaf6(0x197)](_0x3e7e2b){const _0x103b32=a24_0x3afaf6,{options:_0x159167,args:_0x1b06ed,tdx:_0x13378e}=_0x3e7e2b,_0xeef0=_0x1b06ed[0x0];if(!_0xeef0)return console['error'](_0x103b32(0x14e)),console[_0x103b32(0x19c)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x159167[_0x103b32(0x194)]){const _0x461028=await confirm(_0x103b32(0x152)+_0xeef0+'?');if(!_0x461028)return console['error'](_0x103b32(0x181)),0x0;}return await withSpinner(_0x103b32(0x18b),()=>_0x13378e['jobs'][_0x103b32(0x18a)](_0xeef0),{'verbose':_0x159167['verbose']}),console[_0x103b32(0x19c)](_0x103b32(0x188)+_0xeef0),console[_0x103b32(0x19c)](_0x103b32(0x186)+_0xeef0+_0x103b32(0x179)),0x0;}catch(_0x960686){if(_0x960686 instanceof SDKError)return console[_0x103b32(0x19c)](_0x103b32(0x171)+_0x960686[_0x103b32(0x18e)]),_0x960686[_0x103b32(0x153)]&&console[_0x103b32(0x19c)](_0x103b32(0x173)+_0x960686[_0x103b32(0x153)]),0x1;throw _0x960686;}}}export class JobSubmitCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x17f);[a24_0x3afaf6(0x180)]=a24_0x3afaf6(0x17e);async[a24_0x3afaf6(0x197)](_0x10e7c6){const _0x4cb90f=a24_0x3afaf6,{options:_0x34e955,args:_0x420681,tdx:_0x3526b0}=_0x10e7c6;try{const _0xff8fc5=_0x34e955['jobType']||_0x4cb90f(0x155),_0xdeffcd=_0x34e955[_0x4cb90f(0x176)],_0x285ffe=_0x34e955[_0x4cb90f(0x15b)]||_0x4cb90f(0x156);if(_0xff8fc5!==_0x4cb90f(0x155)&&_0xff8fc5!==_0x4cb90f(0x167))return console[_0x4cb90f(0x19c)](_0x4cb90f(0x18d)),0x1;let _0x534f72;if(_0xdeffcd){if(_0x420681[0x0])return console['error'](_0x4cb90f(0x15f)),0x1;const _0x2fb11e=readSqlStatementsFromFile(_0xdeffcd);if(_0x2fb11e[_0x4cb90f(0x19a)]===0x0)return console[_0x4cb90f(0x19c)](_0x4cb90f(0x17d)),0x1;if(_0x2fb11e[_0x4cb90f(0x19a)]>0x1)return console[_0x4cb90f(0x19c)](_0x4cb90f(0x184)),0x1;_0x534f72=_0x2fb11e[0x0];}else{if(!_0x420681[0x0])return console[_0x4cb90f(0x19c)](_0x4cb90f(0x15d)),console[_0x4cb90f(0x19c)](_0x4cb90f(0x17a)),0x1;_0x534f72=_0x420681[0x0];}_0x34e955[_0x4cb90f(0x177)]&&(console['error'](_0x4cb90f(0x160)+_0xff8fc5),console[_0x4cb90f(0x19c)](_0x4cb90f(0x15e)+_0x285ffe),console[_0x4cb90f(0x19c)](_0x4cb90f(0x14c)+_0x534f72['substring'](0x0,0x64)+(_0x534f72[_0x4cb90f(0x19a)]>0x64?'...':'')));const _0x55a041=await withSpinner(_0x4cb90f(0x191),()=>_0x3526b0[_0x4cb90f(0x196)][_0x4cb90f(0x182)](_0x285ffe,_0x534f72,_0xff8fc5),{'verbose':_0x34e955[_0x4cb90f(0x177)]}),_0x30e469=_0x55a041[_0x4cb90f(0x175)];return console['error'](_0x4cb90f(0x151)),console['error'](_0x4cb90f(0x193)+_0x30e469['job_id']),await handleSDKOutput([_0x30e469],_0x34e955),0x0;}catch(_0x542b1d){if(_0x542b1d instanceof SDKError)return console[_0x4cb90f(0x19c)](_0x4cb90f(0x171)+_0x542b1d[_0x4cb90f(0x18e)]),_0x542b1d[_0x4cb90f(0x153)]&&console[_0x4cb90f(0x19c)](_0x4cb90f(0x173)+_0x542b1d[_0x4cb90f(0x153)]),0x1;throw _0x542b1d;}}}export class JobResultCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x163);[a24_0x3afaf6(0x180)]=a24_0x3afaf6(0x16d);async[a24_0x3afaf6(0x197)](_0x3a6254){const _0x472009=a24_0x3afaf6,{options:_0x3931c4,args:_0x41673c,tdx:_0x4a3aba}=_0x3a6254,_0x14e6a6=_0x41673c[0x0];if(!_0x14e6a6)return console['error'](_0x472009(0x14e)),console[_0x472009(0x19c)](_0x472009(0x174)),0x1;try{const _0x438349=await withSpinner(_0x472009(0x189),()=>_0x4a3aba[_0x472009(0x196)][_0x472009(0x15c)](_0x14e6a6),{'verbose':_0x3931c4[_0x472009(0x177)]}),_0x397767=_0x438349[_0x472009(0x175)];return console[_0x472009(0x19c)](_0x472009(0x16e)+_0x397767[_0x472009(0x19a)]+_0x472009(0x17c)+(_0x397767['length']!==0x1?'s':'')),await handleSDKOutput(_0x397767,_0x3931c4),0x0;}catch(_0x2f6b9a){if(_0x2f6b9a instanceof SDKError)return console[_0x472009(0x19c)]('Error:\x20'+_0x2f6b9a[_0x472009(0x18e)]),_0x2f6b9a[_0x472009(0x153)]&&console[_0x472009(0x19c)](_0x472009(0x173)+_0x2f6b9a[_0x472009(0x153)]),0x1;throw _0x2f6b9a;}}}
@@ -1 +1 @@
1
- const a24_0x1b217f=a24_0x4fc4;(function(_0x542413,_0x400d32){const _0x239a4a=a24_0x4fc4,_0xb4f427=_0x542413();while(!![]){try{const _0x46b4ad=parseInt(_0x239a4a(0x178))/0x1+parseInt(_0x239a4a(0x1bf))/0x2*(-parseInt(_0x239a4a(0x14e))/0x3)+parseInt(_0x239a4a(0x13b))/0x4*(parseInt(_0x239a4a(0x162))/0x5)+-parseInt(_0x239a4a(0x136))/0x6*(-parseInt(_0x239a4a(0x147))/0x7)+parseInt(_0x239a4a(0x1b6))/0x8*(-parseInt(_0x239a4a(0x181))/0x9)+-parseInt(_0x239a4a(0x1d1))/0xa+parseInt(_0x239a4a(0x1ac))/0xb*(parseInt(_0x239a4a(0x16e))/0xc);if(_0x46b4ad===_0x400d32)break;else _0xb4f427['push'](_0xb4f427['shift']());}catch(_0x285d24){_0xb4f427['push'](_0xb4f427['shift']());}}}(a24_0x3761,0x9e113));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a24_0x3761(){const _0x1a5e1c=['stack','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','\x20bytes)','all','\x20\x20Agents:\x20','\x20\x20Knowledge\x20Bases:\x20','\x20-\x20','format','m\x20ago','llm:project:delete','targetAgent','Agent\x20created:\x20','agent','[output]\x20','cause','agentId','verbose','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','cyan','[tool_call]','.llm','chatId','knowledgeBases','find','deleteProject','Creating\x20agent\x20\x27','Fetching\x20most\x20recent\x20chat...','[image]\x20\x20','short','llm:agent:create','red','Create\x20a\x20new\x20agent\x20in\x20current\x20project','Output\x20directory\x20\x27','toLowerCase','jsonl','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','llm:agent:update','[input]\x20\x20','Backup\x20cancelled.','Project\x20not\x20found:\x20','tdx\x20llm\x20history','bold','outputDir','Update\x20an\x20existing\x20agent','Deleting\x20project\x20\x27','tool','Project\x20created:\x20','toLocaleDateString','Delete\x20an\x20agent','\x0aCancelled','1782606TVvmIm','Backing\x20up\x20project\x20\x27','stringify','description','join','4UXkaLu','split','blue','claude-4.5-haiku','magenta','Project\x20restored:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Load\x20more...','data','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','projects','7JfAgsr','tool_call','updateAgent','[unknown]','input','starterMessage','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','15ZhdKZQ','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','llm:agents','floor','Getting\x20default\x20project...','\x20\x20Prompts:\x20','length','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','targetKnowledgeBase','numeric','\x20\x20Integrations:\x20','Agent\x20deleted:\x20','INVALID_ARGUMENT','targetImageGenerator','slice','set','integrations','Error:\x20Agent\x20name\x20is\x20required','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','getTime','5006915oButXx','createdAt','dim','message','\x20→\x20chat:\x20','\x20->\x20KB:','Use\x20format:\x20project-name/agent-name','llm:models','Restoring\x20project\x20from\x20\x27','Restore\x20cancelled.','prompt','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','11078808HClcFd','List\x20all\x20LLM\x20projects','llm:projects','includes','get','tdx\x20chats','__load_more__','restoreProject','List\x20available\x20LLM\x20models','Fetching\x20agents...','598868tryEFK','Show\x20agent\x20details','Fetching\x20chat\x20sessions...','limit','systemPrompt','name','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','resolveAgentId','No\x20chat\x20sessions\x20found.','9gwiTgF','json','yellow','llm:project:restore','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','d\x20ago','projectName','just\x20now','Error:\x20','getOrCreateDefaultProject','[tool]\x20\x20\x20','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Error:\x20Project\x20name\x20is\x20required','image','attributes','resolveProjectId','Fetching\x20available\x20models...','content','history','Invalid\x20path\x20syntax:\x20','map','Fetching\x20projects...','createProject','deleteAgent','Resolving\x20agent\x20\x27','sourceSite','llm','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Select\x20a\x20chat\x20session:','\x20->\x20WebSearch:','\x20->\x20Agent:','Updating\x20agent...','error','List\x20agents\x20in\x20current\x20project','counts','Resolving\x20project\x20\x27','dryRun','Fetching\x20agent...','exportedFrom','existsSync','Project\x20context\x20set\x20to:\x20','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','11sEynQk','createAgent','projectId','yes','maxToolIterations','substring','filter','Usage:\x20','log','Validating\x20backup\x20from\x20\x27','7906504chbZBn','Create\x20a\x20new\x20LLM\x20project','...','prompts','updatedAt','targetWebSearchTool','\x20->\x20ImageGen:','Analyzing\x20project\x20\x27','llm:history','4444GjeFnN','[content]','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','temperature','Creating\x20project\x20\x27','rmSync','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','output','getBackupMetadata','chats','h\x20ago','(no\x20message)','getCurrentProject','[error]\x20\x20','\x27...','en-US','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','\x20--last','11737200abYUIq','Agent\x20updated:\x20','agents','execute'];a24_0x3761=function(){return _0x1a5e1c;};return a24_0x3761();}import{handleSDKOutput,writeOutput}from'../utils/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'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a24_0x1cf23b from'node:fs';function handleSDKError(_0x3c3f9c,_0x1e8b77){const _0x2e0950=a24_0x4fc4;if(_0x3c3f9c instanceof SDKError)console['error'](_0x2e0950(0x189)+_0x3c3f9c[_0x2e0950(0x165)]),_0x1e8b77[_0x2e0950(0x114)]&&(_0x3c3f9c[_0x2e0950(0x112)]&&console[_0x2e0950(0x1a2)]('\x20\x20Cause:\x20'+_0x3c3f9c[_0x2e0950(0x112)]),_0x3c3f9c[_0x2e0950(0x1d5)]&&(console[_0x2e0950(0x1a2)]('\x0aStack\x20trace:'),console[_0x2e0950(0x1a2)](_0x3c3f9c['stack'])));else throw _0x3c3f9c;}function formatChatHistoryEntry(_0x5f46a5,_0x3a4112){const _0x25415f=a24_0x4fc4,_0x55b61c=getChalk(_0x3a4112),_0x1778a8=_0x55b61c[_0x25415f(0x164)](_0x5f46a5['at']);if(_0x25415f(0x14b)in _0x5f46a5){const _0x2f48e0=_0x55b61c[_0x25415f(0x116)](_0x25415f(0x129));return _0x1778a8+'\x20'+_0x2f48e0+':\x20'+_0x5f46a5[_0x25415f(0x14b)];}if('content'in _0x5f46a5){const _0xe6e3bc=_0x55b61c['green'](_0x25415f(0x1c0));return _0x1778a8+'\x20'+_0xe6e3bc+':\x20'+_0x5f46a5['content'];}if(_0x25415f(0x148)in _0x5f46a5){const _0x4c0d28=_0x55b61c[_0x25415f(0x183)](_0x25415f(0x117)),{functionName:_0x48cbd5,functionArguments:_0x2cdac6,targetFunction:_0x5062ea}=_0x5f46a5[_0x25415f(0x148)];let _0x4c0218=_0x1778a8+'\x20'+_0x4c0d28+':\x20'+_0x55b61c[_0x25415f(0x12d)](_0x48cbd5);if(_0x2cdac6&&Object['keys'](_0x2cdac6)[_0x25415f(0x154)]>0x0){const _0x427110=Object['entries'](_0x2cdac6)[_0x25415f(0x196)](([_0x16f118,_0x11d8d9])=>_0x16f118+'='+JSON['stringify'](_0x11d8d9))[_0x25415f(0x13a)](',\x20');_0x4c0218+='('+_0x427110+')';}_0x5062ea&&(_0x4c0218+=_0x55b61c[_0x25415f(0x164)]('\x20['+_0x5062ea+']'));let _0x44ce1d='';if(_0x5f46a5[_0x25415f(0x148)][_0x25415f(0x156)])_0x44ce1d=_0x25415f(0x167)+_0x5f46a5['tool_call'][_0x25415f(0x156)]['name'];else{if(_0x5f46a5[_0x25415f(0x148)][_0x25415f(0x10e)])_0x44ce1d=_0x25415f(0x1a0)+_0x5f46a5[_0x25415f(0x148)]['targetAgent'][_0x25415f(0x17d)];else{if(_0x5f46a5[_0x25415f(0x148)][_0x25415f(0x1bb)])_0x44ce1d=_0x25415f(0x19f)+_0x5f46a5[_0x25415f(0x148)][_0x25415f(0x1bb)][_0x25415f(0x17d)];else _0x5f46a5[_0x25415f(0x148)][_0x25415f(0x15b)]&&(_0x44ce1d=_0x25415f(0x1bc)+_0x5f46a5[_0x25415f(0x148)][_0x25415f(0x15b)]['name']);}}return _0x4c0218+_0x44ce1d;}if(_0x25415f(0x131)in _0x5f46a5){const _0x505e52=_0x55b61c[_0x25415f(0x13f)](_0x25415f(0x18b)),{functionName:_0x545ec4,functionArguments:_0x1b54d4,content:_0x4218c8,newChat:_0x177ca0}=_0x5f46a5['tool'];let _0x36ee2=_0x1778a8+'\x20'+_0x505e52+':\x20'+_0x55b61c[_0x25415f(0x12d)](_0x545ec4);if(_0x1b54d4){const _0x27825a=typeof _0x1b54d4==='string'?_0x1b54d4:JSON[_0x25415f(0x138)](_0x1b54d4);_0x36ee2+='('+_0x27825a+')';}return _0x4218c8&&(_0x36ee2+='\x0a'+_0x55b61c['dim'](_0x4218c8)),_0x177ca0&&(_0x36ee2+=_0x55b61c[_0x25415f(0x164)](_0x25415f(0x166)+_0x177ca0['id'])),_0x36ee2;}if(_0x25415f(0x1c6)in _0x5f46a5){const _0x4bdb8d=_0x55b61c[_0x25415f(0x13d)](_0x25415f(0x111));return _0x1778a8+'\x20'+_0x4bdb8d+':\x20'+_0x5f46a5[_0x25415f(0x1c6)][_0x25415f(0x17d)]+'\x20('+_0x5f46a5[_0x25415f(0x1c6)][_0x25415f(0x193)][_0x25415f(0x154)]+_0x25415f(0x1d7);}if(_0x25415f(0x18f)in _0x5f46a5){const _0x58fecc=_0x55b61c[_0x25415f(0x13d)](_0x25415f(0x11f)),{width:_0x16d09d,height:_0x1be4ac,headerText:_0x10cd89}=_0x5f46a5['image'],_0x4c2c4f=_0x10cd89?_0x25415f(0x1db)+_0x10cd89:'';return _0x1778a8+'\x20'+_0x58fecc+':\x20'+_0x16d09d+'x'+_0x1be4ac+_0x4c2c4f;}if(_0x25415f(0x1a2)in _0x5f46a5){const _0x59208f=_0x55b61c[_0x25415f(0x122)](_0x25415f(0x1cc));return _0x1778a8+'\x20'+_0x59208f+':\x20'+_0x5f46a5[_0x25415f(0x1a2)];}return _0x1778a8+'\x20'+_0x55b61c[_0x25415f(0x164)](_0x25415f(0x14a))+':\x20'+JSON['stringify'](_0x5f46a5);}async function executeChatHistoryCommand(_0x57a11d,_0x5bb847){const _0x548e0b=a24_0x4fc4,{options:_0x2c95be,args:_0x442adc,tdx:_0x1b0ccb}=_0x57a11d,_0xd91b7a=_0x442adc[0x0],_0x1a896c=_0x2c95be,_0x6c425c=_0x1a896c['last'];try{if(_0x6c425c&&_0xd91b7a)return console[_0x548e0b(0x1a2)](_0x548e0b(0x1d6)),console[_0x548e0b(0x1a2)](_0x548e0b(0x1b3)+_0x5bb847+_0x548e0b(0x1d0)),0x1;if(!_0xd91b7a&&!_0x6c425c&&_0x2c95be[_0x548e0b(0x1dc)]!==undefined){const _0x598f0a=resolveLimit(_0x2c95be[_0x548e0b(0x17b)],DEFAULT_LLM_LIMIT),_0x1937b8=await withSpinner(_0x548e0b(0x17a),()=>_0x1b0ccb[_0x548e0b(0x19c)]['chats'](_0x598f0a),{'verbose':_0x2c95be[_0x548e0b(0x114)]});return await handleSDKOutput(_0x1937b8[_0x548e0b(0x143)],_0x2c95be),0x0;}const _0x200ecd=await getChatIdOrSelect(_0x1b0ccb,_0x2c95be,_0x6c425c,_0xd91b7a);if(!_0x200ecd)return 0x0;return await displayChatHistory(_0x200ecd,_0x1b0ccb,_0x2c95be),0x0;}catch(_0x22032f){return handleSDKError(_0x22032f,_0x2c95be),0x1;}}async function displayChatHistory(_0x1f8627,_0x3d9584,_0x513812){const _0x14298d=a24_0x4fc4,_0x2f7551=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x1f8627+_0x14298d(0x1cd),()=>_0x3d9584['llm'][_0x14298d(0x194)](_0x1f8627),{'verbose':_0x513812[_0x14298d(0x114)]}),_0x43d498=_0x2f7551[_0x14298d(0x143)]['data']??[];if(_0x43d498[_0x14298d(0x154)]===0x0){console[_0x14298d(0x1b4)]('No\x20messages\x20found\x20in\x20chat\x20history.');return;}if(_0x513812[_0x14298d(0x1dc)]!==undefined)await handleSDKOutput(_0x43d498,_0x513812);else{const _0x24a89e=_0x43d498[_0x14298d(0x196)](_0x2729d6=>formatChatHistoryEntry(_0x2729d6,_0x513812)),_0x423eb5=_0x24a89e[_0x14298d(0x13a)]('\x0a');await writeOutput(_0x423eb5,_0x513812[_0x14298d(0x1c6)],'table');}}async function getChatIdOrSelect(_0x4821f1,_0x3c3056,_0x31ba16,_0xc99b4a){const _0x1c3065=a24_0x4fc4;if(_0xc99b4a)return _0xc99b4a;if(_0x31ba16){const _0x3ae94b=await withSpinner(_0x1c3065(0x11e),()=>_0x4821f1[_0x1c3065(0x19c)][_0x1c3065(0x1c8)](0x1),{'verbose':_0x3c3056[_0x1c3065(0x114)]});if(_0x3ae94b[_0x1c3065(0x143)][_0x1c3065(0x154)]===0x0)return console[_0x1c3065(0x1b4)](_0x1c3065(0x180)),undefined;return _0x3ae94b[_0x1c3065(0x143)][0x0]['id'];}const _0x1a3a9d=await selectChatInteractively(_0x4821f1,_0x3c3056);if(!_0x1a3a9d)return console[_0x1c3065(0x1b4)](_0x1c3065(0x135)),undefined;return _0x1a3a9d;}async function getProjectIdOrDefault(_0x5c6661){const _0x32fe8a=a24_0x4fc4,{tdx:_0x16cee6,options:_0x5c07c5}=_0x5c6661,_0x788273=_0x5c07c5['llmProject'];if(_0x788273){const _0x38c81d=await withSpinner(_0x32fe8a(0x1a5)+_0x788273+_0x32fe8a(0x1cd),()=>_0x16cee6['llm'][_0x32fe8a(0x191)](_0x788273),{'verbose':_0x5c07c5['verbose']});return _0x38c81d[_0x32fe8a(0x143)];}let _0x431f0e=_0x16cee6['llm'][_0x32fe8a(0x1cb)]();if(_0x431f0e)return _0x431f0e;const _0x43a274=await withSpinner(_0x32fe8a(0x152),()=>_0x16cee6['llm'][_0x32fe8a(0x18a)](),{'verbose':_0x5c07c5[_0x32fe8a(0x114)]});return _0x43a274['data']['id'];}function toLLMProjectInfo(_0xbb63a1){const _0x290094=a24_0x4fc4;return{'name':_0xbb63a1[_0x290094(0x190)]['name'],'description':_0xbb63a1[_0x290094(0x190)][_0x290094(0x139)],'createdAt':_0xbb63a1[_0x290094(0x190)][_0x290094(0x163)],'updatedAt':_0xbb63a1['attributes'][_0x290094(0x1ba)]};}function toAgentInfo(_0x209a7a){const _0x4659ec=a24_0x4fc4;return{'name':_0x209a7a[_0x4659ec(0x190)]['name'],'description':_0x209a7a[_0x4659ec(0x190)][_0x4659ec(0x139)],'prompt':truncatePrompt(_0x209a7a[_0x4659ec(0x190)][_0x4659ec(0x16c)]),'createdAt':_0x209a7a[_0x4659ec(0x190)]['createdAt'],'updatedAt':_0x209a7a[_0x4659ec(0x190)][_0x4659ec(0x1ba)]};}function truncatePrompt(_0x507f18){const _0x3fe45e=a24_0x4fc4;if(!_0x507f18)return undefined;const _0x10164a=0x64;if(_0x507f18['length']<=_0x10164a)return _0x507f18;return _0x507f18[_0x3fe45e(0x15c)](0x0,_0x10164a)+_0x3fe45e(0x1b8);}export class LLMModelsCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x169);[a24_0x1b217f(0x139)]=a24_0x1b217f(0x176);async[a24_0x1b217f(0x1d4)](_0x17bbe0){const _0x298d25=a24_0x1b217f,{options:_0x1a0442,tdx:_0x79713}=_0x17bbe0;try{const _0x14dda7=await withSpinner(_0x298d25(0x192),()=>_0x79713[_0x298d25(0x19c)]['models'](),{'verbose':_0x1a0442[_0x298d25(0x114)]});return await handleSDKOutput(_0x14dda7[_0x298d25(0x143)],_0x1a0442),0x0;}catch(_0x1c1142){return handleSDKError(_0x1c1142,_0x1a0442),0x1;}}}function a24_0x4fc4(_0xe396d,_0x5a7335){const _0x3761e4=a24_0x3761();return a24_0x4fc4=function(_0x4fc424,_0x1abdcf){_0x4fc424=_0x4fc424-0x10d;let _0x4056bf=_0x3761e4[_0x4fc424];return _0x4056bf;},a24_0x4fc4(_0xe396d,_0x5a7335);}export class LLMProjectsCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x170);[a24_0x1b217f(0x139)]=a24_0x1b217f(0x16f);async['execute'](_0x17ebe1){const _0x51fd75=a24_0x1b217f,{options:_0x32b841,args:_0x23365d,tdx:_0xae3c1a}=_0x17ebe1;try{const _0x15f276=_0x23365d[0x0],_0x1bf0f3=resolveLimit(_0x32b841[_0x51fd75(0x17b)],DEFAULT_LLM_LIMIT),_0x140af4=await withSpinner(_0x51fd75(0x197),()=>_0xae3c1a[_0x51fd75(0x19c)][_0x51fd75(0x146)](_0x1bf0f3),{'verbose':_0x32b841[_0x51fd75(0x114)]});let _0x6cd745=_0x140af4[_0x51fd75(0x143)];_0x15f276&&(_0x6cd745=_0x140af4['data'][_0x51fd75(0x1b2)](_0x28aa73=>matchGlobPattern(_0x28aa73['attributes'][_0x51fd75(0x17d)],_0x15f276)));const _0x28e97e=_0x6cd745['map'](toLLMProjectInfo);return await handleSDKOutput(_0x28e97e,_0x32b841),0x0;}catch(_0x256ec9){return handleSDKError(_0x256ec9,_0x32b841),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a24_0x1b217f(0x150);['description']=a24_0x1b217f(0x1a3);async[a24_0x1b217f(0x1d4)](_0x46673d){const _0x37c370=a24_0x1b217f,{options:_0x3beae3,args:_0x50aaf0,tdx:_0x54f62e}=_0x46673d;try{const _0x2a9676=_0x50aaf0[0x0];let _0x5513f3,_0x388608=_0x2a9676;if(_0x2a9676&&_0x2a9676[_0x37c370(0x171)]('/')){const _0x29b298=_0x2a9676[_0x37c370(0x13c)]('/');if(_0x29b298[_0x37c370(0x154)]===0x2){const [_0x9ab593,_0x46e28e]=_0x29b298,_0xce5382=await _0x54f62e[_0x37c370(0x19c)][_0x37c370(0x146)](),_0x25eb0f=_0xce5382['find'](_0x276811=>_0x276811[_0x37c370(0x190)][_0x37c370(0x17d)][_0x37c370(0x125)]()===_0x9ab593[_0x37c370(0x125)]());if(!_0x25eb0f)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x37c370(0x12b)+_0x9ab593,undefined,{'helpText':_0x37c370(0x141)});_0x5513f3=_0x25eb0f['id'],_0x388608=_0x46e28e;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20path\x20syntax:\x20'+_0x2a9676,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x5513f3=await getProjectIdOrDefault(_0x46673d);const _0x2b13b0=await withSpinner(_0x37c370(0x177),()=>_0x54f62e[_0x37c370(0x19c)]['agents'](_0x5513f3),{'verbose':_0x3beae3['verbose']});let _0x1ede30=_0x2b13b0[_0x37c370(0x143)];_0x388608&&(_0x1ede30=_0x2b13b0[_0x37c370(0x143)][_0x37c370(0x1b2)](_0x4ba450=>matchGlobPattern(_0x4ba450[_0x37c370(0x190)][_0x37c370(0x17d)],_0x388608)));const _0xb0d878=_0x1ede30['map'](toAgentInfo);return await handleSDKOutput(_0xb0d878,_0x3beae3),0x0;}catch(_0x15474c){return handleSDKError(_0x15474c,_0x3beae3),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a24_0x1b217f(0x17d)]='llm:agent:show';['description']=a24_0x1b217f(0x179);async[a24_0x1b217f(0x1d4)](_0x492330){const _0x500b09=a24_0x1b217f,{options:_0x5c11d0,args:_0x1db428,tdx:_0x357c5c}=_0x492330;if(_0x1db428[_0x500b09(0x154)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x500b09(0x155)),0x1;const _0x6b5f=_0x1db428[0x0];try{const _0x1ac130=await getProjectIdOrDefault(_0x492330),_0x4adad7=await withSpinner(_0x500b09(0x19a)+_0x6b5f+_0x500b09(0x1cd),()=>_0x357c5c['llm'][_0x500b09(0x17f)](_0x6b5f,_0x1ac130),{'verbose':_0x5c11d0[_0x500b09(0x114)]}),_0x3e320f=await withSpinner(_0x500b09(0x1a7),()=>_0x357c5c[_0x500b09(0x19c)][_0x500b09(0x110)](_0x4adad7['data']),{'verbose':_0x5c11d0[_0x500b09(0x114)]});return await handleSDKOutput([_0x3e320f[_0x500b09(0x143)]],_0x5c11d0),0x0;}catch(_0x330964){return handleSDKError(_0x330964,_0x5c11d0),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x121);[a24_0x1b217f(0x139)]=a24_0x1b217f(0x123);async[a24_0x1b217f(0x1d4)](_0x2d2fe0){const _0x555217=a24_0x1b217f,{options:_0x4497d7,args:_0x7c888,tdx:_0x34181f}=_0x2d2fe0;if(_0x7c888[_0x555217(0x154)]===0x0)return console['error'](_0x555217(0x15f)),console[_0x555217(0x1a2)](_0x555217(0x1ab)),console['error'](_0x555217(0x18d)),0x1;const _0x657158=_0x7c888[0x0],_0x54e39e=_0x4497d7,_0x3debbb=_0x54e39e[_0x555217(0x17c)],_0x4ae12c=_0x54e39e['model']||_0x555217(0x13e),_0x246efa=_0x54e39e[_0x555217(0x14c)],_0x324fd4=_0x54e39e['maxToolIterations']?Number(_0x54e39e[_0x555217(0x1b0)]):undefined,_0x14abd3=_0x54e39e[_0x555217(0x1c2)]?Number(_0x54e39e[_0x555217(0x1c2)]):undefined;try{let _0x21d902,_0x5a2258;if(_0x657158[_0x555217(0x171)]('/')){const _0xabf671=_0x657158[_0x555217(0x13c)]('/');if(_0xabf671[_0x555217(0x154)]===0x2){const [_0x552b6d,_0x21e2de]=_0xabf671,_0x3253ac=await withSpinner(_0x555217(0x1a5)+_0x552b6d+_0x555217(0x1cd),()=>_0x34181f[_0x555217(0x19c)][_0x555217(0x191)](_0x552b6d),{'verbose':_0x4497d7['verbose']});_0x21d902=_0x3253ac[_0x555217(0x143)],_0x5a2258=_0x21e2de;}else throw new SDKError(ErrorCode[_0x555217(0x15a)],_0x555217(0x195)+_0x657158,undefined,{'helpText':_0x555217(0x168)});}else _0x21d902=await getProjectIdOrDefault(_0x2d2fe0),_0x5a2258=_0x657158;const _0x45f7f1=await withSpinner(_0x555217(0x11d)+_0x5a2258+'\x27...',()=>_0x34181f['llm'][_0x555217(0x1ad)]({'name':_0x5a2258,'projectId':_0x21d902,'modelType':_0x4ae12c,'systemPrompt':_0x3debbb,'starterMessage':_0x246efa,'maxToolIterations':_0x324fd4,'temperature':_0x14abd3}),{'verbose':_0x4497d7[_0x555217(0x114)]});return console[_0x555217(0x1b4)](_0x555217(0x10f)+_0x45f7f1[_0x555217(0x143)]['id']),await handleSDKOutput([_0x45f7f1[_0x555217(0x143)]],_0x4497d7),0x0;}catch(_0x573eef){return handleSDKError(_0x573eef,_0x4497d7),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x128);[a24_0x1b217f(0x139)]=a24_0x1b217f(0x12f);async[a24_0x1b217f(0x1d4)](_0x524bfe){const _0x14dcff=a24_0x1b217f,{options:_0x440bf0,args:_0x5f17a0,tdx:_0x393d9f}=_0x524bfe;if(_0x5f17a0[_0x14dcff(0x154)]===0x0)return console[_0x14dcff(0x1a2)](_0x14dcff(0x15f)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x388795=_0x5f17a0[0x0],_0x53ae99=_0x440bf0,_0x2d1c30=_0x53ae99[_0x14dcff(0x17d)],_0x26ad8b=_0x53ae99[_0x14dcff(0x16c)],_0x382822=_0x53ae99[_0x14dcff(0x139)],_0x324eaa=_0x53ae99[_0x14dcff(0x14c)];if(!_0x2d1c30&&!_0x26ad8b&&!_0x382822&&!_0x324eaa)return console[_0x14dcff(0x1a2)](_0x14dcff(0x1c1)),console[_0x14dcff(0x1a2)](_0x14dcff(0x16d)),0x1;try{const _0x5b9fa2=await getProjectIdOrDefault(_0x524bfe),_0x47a0e2=await withSpinner(_0x14dcff(0x19a)+_0x388795+'\x27...',()=>_0x393d9f[_0x14dcff(0x19c)]['resolveAgentId'](_0x388795,_0x5b9fa2),{'verbose':_0x440bf0[_0x14dcff(0x114)]}),_0x2295a2=_0x47a0e2[_0x14dcff(0x143)],_0x4998f3=await withSpinner(_0x14dcff(0x1a1),()=>_0x393d9f[_0x14dcff(0x19c)][_0x14dcff(0x149)](_0x2295a2,{'name':_0x2d1c30,'prompt':_0x26ad8b,'description':_0x382822,'starterMessage':_0x324eaa}),{'verbose':_0x440bf0[_0x14dcff(0x114)]});return console[_0x14dcff(0x1b4)](_0x14dcff(0x1d2)+_0x4998f3[_0x14dcff(0x143)]['id']),await handleSDKOutput([_0x4998f3[_0x14dcff(0x143)]],_0x440bf0),0x0;}catch(_0x408b47){return handleSDKError(_0x408b47,_0x440bf0),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a24_0x1b217f(0x17d)]='llm:agent:delete';[a24_0x1b217f(0x139)]=a24_0x1b217f(0x134);async[a24_0x1b217f(0x1d4)](_0x156b08){const _0x6b9ea3=a24_0x1b217f,{options:_0x189044,args:_0x6ce1e6,tdx:_0x36a168}=_0x156b08;if(_0x6ce1e6['length']===0x0)return console[_0x6b9ea3(0x1a2)](_0x6b9ea3(0x15f)),console[_0x6b9ea3(0x1a2)](_0x6b9ea3(0x14d)),0x1;const _0xf9aebd=_0x6ce1e6[0x0];try{const _0x49cb76=await getProjectIdOrDefault(_0x156b08),_0xcf52e=await withSpinner('Resolving\x20agent\x20\x27'+_0xf9aebd+_0x6b9ea3(0x1cd),()=>_0x36a168[_0x6b9ea3(0x19c)][_0x6b9ea3(0x17f)](_0xf9aebd,_0x49cb76),{'verbose':_0x189044[_0x6b9ea3(0x114)]}),_0x475159=_0xcf52e['data'];return await withSpinner('Deleting\x20agent...',()=>_0x36a168['llm'][_0x6b9ea3(0x199)](_0x475159),{'verbose':_0x189044[_0x6b9ea3(0x114)]}),console['log'](_0x6b9ea3(0x159)+_0x475159),0x0;}catch(_0x2796b9){return handleSDKError(_0x2796b9,_0x189044),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a24_0x1b217f(0x1be);[a24_0x1b217f(0x139)]=a24_0x1b217f(0x1c5);async[a24_0x1b217f(0x1d4)](_0x493a79){const _0x436965=a24_0x1b217f;return executeChatHistoryCommand(_0x493a79,_0x436965(0x12c));}}export class LLMUseCommand extends BaseCommand{[a24_0x1b217f(0x17d)]='llm:use';[a24_0x1b217f(0x139)]='Set\x20current\x20project\x20context';async[a24_0x1b217f(0x1d4)](_0x1b8a5c){const _0xc23493=a24_0x1b217f,{options:_0x5ba032,args:_0x1f0350,tdx:_0xea41cc}=_0x1b8a5c;if(_0x1f0350[_0xc23493(0x154)]===0x0)return console['error'](_0xc23493(0x18e)),console[_0xc23493(0x1a2)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x86877b=_0x1f0350[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x86877b+_0xc23493(0x1cd),()=>_0xea41cc[_0xc23493(0x19c)]['setCurrentProject'](_0x86877b),{'verbose':_0x5ba032['verbose']}),console['log'](_0xc23493(0x1aa)+_0x86877b),0x0;}catch(_0x345fde){return handleSDKError(_0x345fde,_0x5ba032),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a24_0x1b217f(0x17d)]='llm:project:create';[a24_0x1b217f(0x139)]=a24_0x1b217f(0x1b7);async[a24_0x1b217f(0x1d4)](_0x178df4){const _0x12cd3a=a24_0x1b217f,{options:_0x4c40fc,args:_0x3e31fc,tdx:_0x3c2757}=_0x178df4;if(_0x3e31fc[_0x12cd3a(0x154)]===0x0)return console[_0x12cd3a(0x1a2)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x12cd3a(0x1a2)](_0x12cd3a(0x144)),0x1;const _0x3e7365=_0x3e31fc[0x0],_0x1c526b=_0x4c40fc,_0x256a92=_0x1c526b[_0x12cd3a(0x139)];try{const _0x5221f0=await withSpinner(_0x12cd3a(0x1c3)+_0x3e7365+_0x12cd3a(0x1cd),()=>_0x3c2757[_0x12cd3a(0x19c)][_0x12cd3a(0x198)]({'name':_0x3e7365,'description':_0x256a92}),{'verbose':_0x4c40fc[_0x12cd3a(0x114)]});console[_0x12cd3a(0x1b4)](_0x12cd3a(0x132)+_0x5221f0[_0x12cd3a(0x143)]['id']);const _0x358428=toLLMProjectInfo(_0x5221f0[_0x12cd3a(0x143)]);return await handleSDKOutput([_0x358428],_0x4c40fc),0x0;}catch(_0x52d980){return handleSDKError(_0x52d980,_0x4c40fc),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x10d);[a24_0x1b217f(0x139)]='Delete\x20an\x20LLM\x20project';async[a24_0x1b217f(0x1d4)](_0x18c92d){const _0x383a0e=a24_0x1b217f,{options:_0x55ad12,args:_0x427c70,tdx:_0x15512b}=_0x18c92d;if(_0x427c70[_0x383a0e(0x154)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x383a0e(0x1a2)](_0x383a0e(0x1cf)),0x1;const _0x24fed7=_0x427c70[0x0];try{return await withSpinner(_0x383a0e(0x130)+_0x24fed7+'\x27...',()=>_0x15512b[_0x383a0e(0x19c)][_0x383a0e(0x11c)](_0x24fed7),{'verbose':_0x55ad12[_0x383a0e(0x114)]}),console[_0x383a0e(0x1b4)]('Project\x20deleted:\x20'+_0x24fed7),0x0;}catch(_0x2a3680){return handleSDKError(_0x2a3680,_0x55ad12),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a24_0x1b217f(0x17d)]='llm:project:backup';[a24_0x1b217f(0x139)]=a24_0x1b217f(0x160);async['execute'](_0x330bf9){const _0x2d690e=a24_0x1b217f,{options:_0x5b5496,args:_0x32f1ec,tdx:_0x2543a0}=_0x330bf9;if(_0x32f1ec[_0x2d690e(0x154)]===0x0)return console['error'](_0x2d690e(0x18e)),console['error'](_0x2d690e(0x14f)),0x1;const _0x34d69d=_0x32f1ec[0x0],_0x3806c9=_0x5b5496,_0x11b5e0=_0x3806c9[_0x2d690e(0x1c6)],_0x49b956=_0x3806c9['dryRun'];try{const _0x2b0691=_0x11b5e0||_0x34d69d+_0x2d690e(0x118);if(a24_0x1cf23b[_0x2d690e(0x1a9)](_0x2b0691)&&!_0x49b956){if(!_0x5b5496[_0x2d690e(0x1af)]){const _0x2d047a=await confirm(_0x2d690e(0x124)+_0x2b0691+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x2d047a)return console[_0x2d690e(0x1b4)](_0x2d690e(0x12a)),0x0;}a24_0x1cf23b[_0x2d690e(0x1c4)](_0x2b0691,{'recursive':!![]});}const _0x22446d=await withSpinner(_0x49b956?_0x2d690e(0x1bd)+_0x34d69d+_0x2d690e(0x1cd):_0x2d690e(0x137)+_0x34d69d+'\x27...',()=>_0x2543a0['llm']['backupProject'](_0x34d69d,_0x11b5e0,{'dryRun':_0x49b956}),{'verbose':_0x5b5496['verbose']}),_0x5e40ed=_0x22446d[_0x2d690e(0x143)];return _0x49b956?console['log'](_0x2d690e(0x145)+_0x5e40ed['outputDir']):console[_0x2d690e(0x1b4)]('Project\x20backed\x20up\x20to:\x20'+_0x5e40ed[_0x2d690e(0x12e)]),console[_0x2d690e(0x1b4)](_0x2d690e(0x1d9)+_0x5e40ed['counts'][_0x2d690e(0x1d3)]),console[_0x2d690e(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+_0x5e40ed[_0x2d690e(0x1a4)][_0x2d690e(0x11a)]),console[_0x2d690e(0x1b4)]('\x20\x20Prompts:\x20'+_0x5e40ed[_0x2d690e(0x1a4)][_0x2d690e(0x1b9)]),console['log'](_0x2d690e(0x158)+_0x5e40ed['counts'][_0x2d690e(0x15e)]),(_0x5b5496[_0x2d690e(0x1dc)]==='json'||_0x5b5496[_0x2d690e(0x1dc)]===_0x2d690e(0x126))&&await handleSDKOutput([_0x5e40ed],_0x5b5496),0x0;}catch(_0x421172){return handleSDKError(_0x421172,_0x5b5496),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x184);[a24_0x1b217f(0x139)]=a24_0x1b217f(0x127);async[a24_0x1b217f(0x1d4)](_0x23e057){const _0x1fbd4d=a24_0x1b217f,{options:_0x1d9cd5,args:_0x3831d4,tdx:_0x3cac6d}=_0x23e057;if(_0x3831d4[_0x1fbd4d(0x154)]===0x0)return console[_0x1fbd4d(0x1a2)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x1fbd4d(0x1a2)](_0x1fbd4d(0x185)),0x1;const _0x1aa623=_0x3831d4[0x0],_0x1df271=_0x1d9cd5,_0x1d1b28=_0x1df271[_0x1fbd4d(0x17d)],_0x344d7f=_0x1df271[_0x1fbd4d(0x1a6)];try{if(!_0x344d7f){const _0x54ae11=_0x3cac6d[_0x1fbd4d(0x19c)][_0x1fbd4d(0x1c7)](_0x1aa623),_0x441f1d=_0x1d1b28||_0x54ae11[_0x1fbd4d(0x1a8)][_0x1fbd4d(0x187)],_0x410649=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x3cac6d[_0x1fbd4d(0x19c)][_0x1fbd4d(0x146)](),{'verbose':_0x1d9cd5[_0x1fbd4d(0x114)]}),_0x2389ba=_0x410649[_0x1fbd4d(0x143)][_0x1fbd4d(0x11b)](_0x240d30=>_0x240d30['attributes'][_0x1fbd4d(0x17d)]===_0x441f1d);if(_0x2389ba&&!_0x1d9cd5[_0x1fbd4d(0x1af)]){const _0x10c53c=await confirm('A\x20project\x20named\x20\x27'+_0x441f1d+_0x1fbd4d(0x19d));if(!_0x10c53c)return console[_0x1fbd4d(0x1b4)](_0x1fbd4d(0x16b)),0x0;}}const _0x31c951=await withSpinner(_0x344d7f?_0x1fbd4d(0x1b5)+_0x1aa623+_0x1fbd4d(0x1cd):_0x1fbd4d(0x16a)+_0x1aa623+_0x1fbd4d(0x1cd),()=>_0x3cac6d[_0x1fbd4d(0x19c)][_0x1fbd4d(0x175)](_0x1aa623,{'name':_0x1d1b28,'dryRun':_0x344d7f}),{'verbose':_0x1d9cd5[_0x1fbd4d(0x114)]}),_0x457058=_0x31c951['data'];return _0x457058[_0x1fbd4d(0x19b)]&&console['log'](_0x1fbd4d(0x17e)+_0x457058[_0x1fbd4d(0x19b)]+'\x27'),_0x344d7f?console[_0x1fbd4d(0x1b4)](_0x1fbd4d(0x18c)+_0x457058['projectName']):console['log'](_0x1fbd4d(0x140)+_0x457058[_0x1fbd4d(0x187)]+'\x20('+_0x457058[_0x1fbd4d(0x1ae)]+')'),console[_0x1fbd4d(0x1b4)](_0x1fbd4d(0x1d9)+_0x457058[_0x1fbd4d(0x1a4)][_0x1fbd4d(0x1d3)]),console[_0x1fbd4d(0x1b4)](_0x1fbd4d(0x1da)+_0x457058[_0x1fbd4d(0x1a4)][_0x1fbd4d(0x11a)]),console[_0x1fbd4d(0x1b4)](_0x1fbd4d(0x153)+_0x457058[_0x1fbd4d(0x1a4)][_0x1fbd4d(0x1b9)]),console[_0x1fbd4d(0x1b4)](_0x1fbd4d(0x158)+_0x457058[_0x1fbd4d(0x1a4)]['integrations']),(_0x1d9cd5[_0x1fbd4d(0x1dc)]===_0x1fbd4d(0x182)||_0x1d9cd5[_0x1fbd4d(0x1dc)]==='jsonl')&&await handleSDKOutput([_0x457058],_0x1d9cd5),0x0;}catch(_0x54839e){return handleSDKError(_0x54839e,_0x1d9cd5),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x3bf3a9,_0xdfcb3){const _0x25d6f8=a24_0x1b217f,_0x385e2a=_0xdfcb3[_0x25d6f8(0x17b)]||CHAT_SELECTOR_PAGE_SIZE;let _0x1ce115=0x0,_0x2542e8=[];const _0x591125=(await import('prompts'))['default'],_0x438c9d=getChalk(_0xdfcb3);while(!![]){const _0x3e4682=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x3bf3a9[_0x25d6f8(0x19c)][_0x25d6f8(0x1c8)](_0x385e2a+_0x1ce115),{'verbose':_0xdfcb3['verbose']});_0x2542e8=_0x3e4682[_0x25d6f8(0x143)];const _0x35b408=_0x2542e8[_0x25d6f8(0x15c)](_0x1ce115,_0x1ce115+_0x385e2a),_0x5271c7=_0x2542e8[_0x25d6f8(0x154)]>_0x1ce115+_0x385e2a,_0x275b9d=[...new Set(_0x35b408['map'](_0x1dff23=>_0x1dff23['attributes'][_0x25d6f8(0x113)])[_0x25d6f8(0x1b2)](_0x361e95=>_0x361e95!==undefined))],_0xf81af4=new Map();await Promise[_0x25d6f8(0x1d8)](_0x275b9d['map'](async _0x27f129=>{const _0xe7bec0=_0x25d6f8;try{const _0x576ad7=await _0x3bf3a9[_0xe7bec0(0x19c)]['agent'](_0x27f129);_0xf81af4['set'](_0x27f129,_0x576ad7[_0xe7bec0(0x190)][_0xe7bec0(0x17d)]);}catch{_0xf81af4[_0xe7bec0(0x15d)](_0x27f129,_0x27f129);}}));const _0x37c8f2=_0x35b408['map'](_0xd413d6=>{const _0x5c5636=_0x25d6f8,_0x28716d=_0xd413d6['attributes']['firstInputContent']||_0x5c5636(0x1ca),_0x2519d9=_0x28716d[_0x5c5636(0x13c)]('\x0a')[0x0],_0x1a6fd7=_0x2519d9[_0x5c5636(0x154)]>0x50?_0x2519d9[_0x5c5636(0x1b1)](0x0,0x4d)+_0x5c5636(0x1b8):_0x2519d9,_0x12bc2b=_0xd413d6[_0x5c5636(0x190)][_0x5c5636(0x113)]?_0xf81af4[_0x5c5636(0x172)](_0xd413d6['attributes'][_0x5c5636(0x113)])||_0xd413d6[_0x5c5636(0x190)]['agentId']:'(no\x20agent)',_0x4abbdf=_0xd413d6[_0x5c5636(0x190)]['lastConversationAt']||_0xd413d6[_0x5c5636(0x190)][_0x5c5636(0x1ba)],_0x2e05ac=new Date(_0x4abbdf),_0x2cef03=new Date(),_0x2152d8=_0x2cef03[_0x5c5636(0x161)]()-_0x2e05ac[_0x5c5636(0x161)](),_0x20c114=Math[_0x5c5636(0x151)](_0x2152d8/0xea60),_0x13ba45=Math['floor'](_0x2152d8/0x36ee80),_0x506309=Math['floor'](_0x2152d8/0x5265c00);let _0x443674;if(_0x20c114<0x1)_0x443674=_0x5c5636(0x188);else{if(_0x20c114<0x3c)_0x443674=_0x20c114+_0x5c5636(0x1dd);else{if(_0x13ba45<0x18)_0x443674=_0x13ba45+_0x5c5636(0x1c9);else _0x506309<0x7?_0x443674=_0x506309+_0x5c5636(0x186):_0x443674=_0x2e05ac[_0x5c5636(0x133)](_0x5c5636(0x1ce),{'month':_0x5c5636(0x120),'day':_0x5c5636(0x157)});}}return{'title':_0x1a6fd7+'\x20'+_0x438c9d['dim']('['+_0x12bc2b+']\x20'+_0x443674),'value':_0xd413d6['id']};});_0x5271c7&&_0x37c8f2['push']({'title':_0x438c9d[_0x25d6f8(0x116)](_0x25d6f8(0x142)),'value':'__load_more__'});const _0x335593=await _0x591125({'type':'select','name':_0x25d6f8(0x119),'message':_0x25d6f8(0x19e),'choices':_0x37c8f2,'hint':_0x25d6f8(0x115)});if(!_0x335593['chatId'])return undefined;if(_0x335593[_0x25d6f8(0x119)]===_0x25d6f8(0x174)){_0x1ce115+=_0x385e2a;continue;}return _0x335593[_0x25d6f8(0x119)];}}export class ChatsCommand extends BaseCommand{[a24_0x1b217f(0x17d)]=a24_0x1b217f(0x1c8);[a24_0x1b217f(0x139)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a24_0x1b217f(0x1d4)](_0x2d669c){const _0x30abdd=a24_0x1b217f;return executeChatHistoryCommand(_0x2d669c,_0x30abdd(0x173));}}
1
+ const a25_0x203df8=a25_0x35f0;(function(_0x150692,_0x270b40){const _0x286b70=a25_0x35f0,_0x58f98a=_0x150692();while(!![]){try{const _0x51719b=-parseInt(_0x286b70(0xc7))/0x1+parseInt(_0x286b70(0xe0))/0x2+-parseInt(_0x286b70(0x17b))/0x3*(-parseInt(_0x286b70(0xda))/0x4)+-parseInt(_0x286b70(0xb3))/0x5+-parseInt(_0x286b70(0x149))/0x6+parseInt(_0x286b70(0xc8))/0x7*(-parseInt(_0x286b70(0x177))/0x8)+parseInt(_0x286b70(0x11c))/0x9;if(_0x51719b===_0x270b40)break;else _0x58f98a['push'](_0x58f98a['shift']());}catch(_0x2a3704){_0x58f98a['push'](_0x58f98a['shift']());}}}(a25_0x4902,0x2bb06));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a25_0x35f0(_0x4ea390,_0x3ac540){_0x4ea390=_0x4ea390-0xb3;const _0x4902f2=a25_0x4902();let _0x35f094=_0x4902f2[_0x4ea390];return _0x35f094;}import{handleSDKOutput,writeOutput}from'../utils/command-output.js';function a25_0x4902(){const _0xc89bab=['[unknown]','restoreProject','d\x20ago','targetKnowledgeBase','agents','getTime','red','8rShnOh','tdx\x20chats','string','llm:agent:delete','54vRtvpH','526040VllXHt','\x27\x20already\x20exists.\x20Overwrite?','data','agent','Agent\x20updated:\x20','Use\x20format:\x20project-name/agent-name','\x20-\x20','includes','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','cause','List\x20available\x20LLM\x20models','temperature','execute','yes','tool_call','llm:project:create','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x20bytes)','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Output\x20directory\x20\x27','225661XwCrFA','1674351UkRmLp','model','slice','Creating\x20agent\x20\x27','find','\x27...','error','.llm','Fetching\x20chat\x20history\x20for\x20\x27','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20llm\x20use\x20<project-name>','updatedAt','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','tdx\x20llm\x20history','length','[input]\x20\x20','prompt','75860PeNmkO','Fetching\x20most\x20recent\x20chat...','createProject','resolveAgentId','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','limit','473086ftoXaC','dim','m\x20ago','Getting\x20default\x20project...','\x20->\x20ImageGen:','chatId','table','log','Setting\x20project\x20context\x20to\x20\x27','projects','attributes','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','llm:agent:update','LLM_PROJECT_NOT_FOUND','jsonl','\x0aCancelled','models','knowledgeBases','systemPrompt','\x20\x20Prompts:\x20','prompts','llmProject','integrations','yellow','Creating\x20project\x20\x27','description','filter','name','substring','toLowerCase','projectName','agentId','[image]\x20\x20','\x20->\x20Agent:','push','llm:agent:show','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','outputDir','Fetching\x20chat\x20sessions...','bold','content','Error:\x20Project\x20name\x20is\x20required','blue','json','llm:agents','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','keys','Error:\x20','Resolving\x20agent\x20\x27','\x20->\x20WebSearch:','split','\x0aStack\x20trace:','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','default','Set\x20current\x20project\x20context','numeric','rmSync','en-US','set','verbose','2636649KKQNkX','\x20\x20Agents:\x20','Project\x20restored:\x20','No\x20chat\x20sessions\x20found.','Deleting\x20project\x20\x27','history','image','Resolving\x20project\x20\x27','INVALID_ARGUMENT','chats','stringify','[error]\x20\x20','\x20\x20Integrations:\x20','floor','...','exportedFrom','getBackupMetadata','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','__load_more__','\x20--last','Update\x20an\x20existing\x20agent','Restoring\x20project\x20from\x20\x27','just\x20now','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','Updating\x20agent...','toLocaleDateString','tool','get','entries','Backing\x20up\x20project\x20\x27','updateAgent','output','llm:project:delete','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Fetching\x20available\x20models...','format','select','green','[tool]\x20\x20\x20','llm:project:backup','magenta','Agent\x20created:\x20','Error:\x20Agent\x20name\x20is\x20required','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Checking\x20for\x20existing\x20projects...','731172BwtbPt','Create\x20a\x20new\x20LLM\x20project','llm:use','getCurrentProject','Fetching\x20agents...','Load\x20more...','Invalid\x20path\x20syntax:\x20','Project\x20not\x20found:\x20','createdAt','llm:projects','stack','getOrCreateDefaultProject','llm','Create\x20a\x20new\x20agent\x20in\x20current\x20project','counts','h\x20ago','input','setCurrentProject','(no\x20message)','sourceSite','Deleting\x20agent...','Project\x20backed\x20up\x20to:\x20','resolveProjectId','dryRun','Restore\x20cancelled.','targetAgent','\x20\x20Cause:\x20','Analyzing\x20project\x20\x27','Select\x20a\x20chat\x20session:','List\x20all\x20LLM\x20projects','Error:\x20Backup\x20folder\x20path\x20is\x20required','map','No\x20messages\x20found\x20in\x20chat\x20history.','createAgent','\x20\x20Knowledge\x20Bases:\x20','targetImageGenerator','[output]\x20','\x20→\x20chat:\x20','firstInputContent'];a25_0x4902=function(){return _0xc89bab;};return a25_0x4902();}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'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a25_0x20bc81 from'node:fs';function handleSDKError(_0xff684e,_0x4ec880){const _0x40edd9=a25_0x35f0;if(_0xff684e instanceof SDKError)console[_0x40edd9(0xce)](_0x40edd9(0x10f)+_0xff684e['message']),_0x4ec880['verbose']&&(_0xff684e[_0x40edd9(0xbc)]&&console[_0x40edd9(0xce)](_0x40edd9(0x163)+_0xff684e[_0x40edd9(0xbc)]),_0xff684e[_0x40edd9(0x153)]&&(console[_0x40edd9(0xce)](_0x40edd9(0x113)),console[_0x40edd9(0xce)](_0xff684e[_0x40edd9(0x153)])));else throw _0xff684e;}function formatChatHistoryEntry(_0x13d47e,_0x23bb64){const _0x3b5146=a25_0x35f0,_0x431b7c=getChalk(_0x23bb64),_0x489860=_0x431b7c[_0x3b5146(0xe1)](_0x13d47e['at']);if('input'in _0x13d47e){const _0x2d694a=_0x431b7c['cyan'](_0x3b5146(0xd8));return _0x489860+'\x20'+_0x2d694a+':\x20'+_0x13d47e[_0x3b5146(0x159)];}if('content'in _0x13d47e){const _0x5cd035=_0x431b7c[_0x3b5146(0x141)]('[content]');return _0x489860+'\x20'+_0x5cd035+':\x20'+_0x13d47e[_0x3b5146(0x108)];}if(_0x3b5146(0xc1)in _0x13d47e){const _0x2ca63a=_0x431b7c[_0x3b5146(0xf7)]('[tool_call]'),{functionName:_0x5b3191,functionArguments:_0x45916f,targetFunction:_0x13aacf}=_0x13d47e['tool_call'];let _0x120ced=_0x489860+'\x20'+_0x2ca63a+':\x20'+_0x431b7c[_0x3b5146(0x107)](_0x5b3191);if(_0x45916f&&Object[_0x3b5146(0x10e)](_0x45916f)[_0x3b5146(0xd7)]>0x0){const _0x25c30e=Object[_0x3b5146(0x138)](_0x45916f)[_0x3b5146(0x168)](([_0x576df3,_0xf38694])=>_0x576df3+'='+JSON[_0x3b5146(0x126)](_0xf38694))['join'](',\x20');_0x120ced+='('+_0x25c30e+')';}_0x13aacf&&(_0x120ced+=_0x431b7c[_0x3b5146(0xe1)]('\x20['+_0x13aacf+']'));let _0x1c7268='';if(_0x13d47e[_0x3b5146(0xc1)][_0x3b5146(0x173)])_0x1c7268='\x20->\x20KB:'+_0x13d47e['tool_call'][_0x3b5146(0x173)][_0x3b5146(0xfb)];else{if(_0x13d47e['tool_call'][_0x3b5146(0x162)])_0x1c7268=_0x3b5146(0x101)+_0x13d47e[_0x3b5146(0xc1)][_0x3b5146(0x162)][_0x3b5146(0xfb)];else{if(_0x13d47e[_0x3b5146(0xc1)]['targetWebSearchTool'])_0x1c7268=_0x3b5146(0x111)+_0x13d47e[_0x3b5146(0xc1)]['targetWebSearchTool'][_0x3b5146(0xfb)];else _0x13d47e[_0x3b5146(0xc1)][_0x3b5146(0x16c)]&&(_0x1c7268=_0x3b5146(0xe4)+_0x13d47e[_0x3b5146(0xc1)]['targetImageGenerator'][_0x3b5146(0xfb)]);}}return _0x120ced+_0x1c7268;}if('tool'in _0x13d47e){const _0x48e59a=_0x431b7c[_0x3b5146(0x144)](_0x3b5146(0x142)),{functionName:_0x1838dc,functionArguments:_0x278ed8,content:_0x38a6fe,newChat:_0x225acc}=_0x13d47e[_0x3b5146(0x136)];let _0x20cf38=_0x489860+'\x20'+_0x48e59a+':\x20'+_0x431b7c[_0x3b5146(0x107)](_0x1838dc);if(_0x278ed8){const _0x605146=typeof _0x278ed8===_0x3b5146(0x179)?_0x278ed8:JSON[_0x3b5146(0x126)](_0x278ed8);_0x20cf38+='('+_0x605146+')';}return _0x38a6fe&&(_0x20cf38+='\x0a'+_0x431b7c['dim'](_0x38a6fe)),_0x225acc&&(_0x20cf38+=_0x431b7c['dim'](_0x3b5146(0x16e)+_0x225acc['id'])),_0x20cf38;}if(_0x3b5146(0x13b)in _0x13d47e){const _0x19a98d=_0x431b7c['blue'](_0x3b5146(0x16d));return _0x489860+'\x20'+_0x19a98d+':\x20'+_0x13d47e['output']['name']+'\x20('+_0x13d47e[_0x3b5146(0x13b)][_0x3b5146(0x108)][_0x3b5146(0xd7)]+_0x3b5146(0xc4);}if(_0x3b5146(0x122)in _0x13d47e){const _0x4c9e89=_0x431b7c[_0x3b5146(0x10a)](_0x3b5146(0x100)),{width:_0x292b67,height:_0x4d6602,headerText:_0x7c3077}=_0x13d47e[_0x3b5146(0x122)],_0x210627=_0x7c3077?_0x3b5146(0xb9)+_0x7c3077:'';return _0x489860+'\x20'+_0x4c9e89+':\x20'+_0x292b67+'x'+_0x4d6602+_0x210627;}if('error'in _0x13d47e){const _0x4aab87=_0x431b7c[_0x3b5146(0x176)](_0x3b5146(0x127));return _0x489860+'\x20'+_0x4aab87+':\x20'+_0x13d47e[_0x3b5146(0xce)];}return _0x489860+'\x20'+_0x431b7c[_0x3b5146(0xe1)](_0x3b5146(0x170))+':\x20'+JSON['stringify'](_0x13d47e);}async function executeChatHistoryCommand(_0x1ba20,_0x408976){const _0x269a75=a25_0x35f0,{options:_0x319f83,args:_0x308d87,tdx:_0x5c6209}=_0x1ba20,_0x3b95a5=_0x308d87[0x0],_0x3f1d9d=_0x319f83,_0x1e0c49=_0x3f1d9d['last'];try{if(_0x1e0c49&&_0x3b95a5)return console[_0x269a75(0xce)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x269a75(0xce)]('Usage:\x20'+_0x408976+_0x269a75(0x12f)),0x1;if(!_0x3b95a5&&!_0x1e0c49&&_0x319f83[_0x269a75(0x13f)]!==undefined){const _0x4e6937=resolveLimit(_0x319f83[_0x269a75(0xdf)],DEFAULT_LLM_LIMIT),_0x690384=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x5c6209[_0x269a75(0x155)][_0x269a75(0x125)](_0x4e6937),{'verbose':_0x319f83['verbose']});return await handleSDKOutput(_0x690384[_0x269a75(0xb5)],_0x319f83),0x0;}const _0x578fc3=await getChatIdOrSelect(_0x5c6209,_0x319f83,_0x1e0c49,_0x3b95a5);if(!_0x578fc3)return 0x0;return await displayChatHistory(_0x578fc3,_0x5c6209,_0x319f83),0x0;}catch(_0x5a4de6){return handleSDKError(_0x5a4de6,_0x319f83),0x1;}}async function displayChatHistory(_0x21e146,_0x4cff57,_0x26a05f){const _0x5acd74=a25_0x35f0,_0x49265a=await withSpinner(_0x5acd74(0xd0)+_0x21e146+_0x5acd74(0xcd),()=>_0x4cff57[_0x5acd74(0x155)][_0x5acd74(0x121)](_0x21e146),{'verbose':_0x26a05f[_0x5acd74(0x11b)]}),_0x3935e5=_0x49265a[_0x5acd74(0xb5)][_0x5acd74(0xb5)]??[];if(_0x3935e5['length']===0x0){console[_0x5acd74(0xe7)](_0x5acd74(0x169));return;}if(_0x26a05f[_0x5acd74(0x13f)]!==undefined)await handleSDKOutput(_0x3935e5,_0x26a05f);else{const _0x3a4a4a=_0x3935e5[_0x5acd74(0x168)](_0x2781fb=>formatChatHistoryEntry(_0x2781fb,_0x26a05f)),_0x1edba8=_0x3a4a4a['join']('\x0a');await writeOutput(_0x1edba8,_0x26a05f['output'],_0x5acd74(0xe6));}}async function getChatIdOrSelect(_0x27236e,_0x21cd45,_0xae0bd3,_0x5e200b){const _0x7d24fb=a25_0x35f0;if(_0x5e200b)return _0x5e200b;if(_0xae0bd3){const _0x38f55d=await withSpinner(_0x7d24fb(0xdb),()=>_0x27236e[_0x7d24fb(0x155)][_0x7d24fb(0x125)](0x1),{'verbose':_0x21cd45[_0x7d24fb(0x11b)]});if(_0x38f55d[_0x7d24fb(0xb5)]['length']===0x0)return console[_0x7d24fb(0xe7)](_0x7d24fb(0x11f)),undefined;return _0x38f55d[_0x7d24fb(0xb5)][0x0]['id'];}const _0x5c12f7=await selectChatInteractively(_0x27236e,_0x21cd45);if(!_0x5c12f7)return console[_0x7d24fb(0xe7)](_0x7d24fb(0xef)),undefined;return _0x5c12f7;}async function getProjectIdOrDefault(_0x1cf611){const _0x3e5ee1=a25_0x35f0,{tdx:_0x32d114,options:_0x1d5964}=_0x1cf611,_0x618e01=_0x1d5964[_0x3e5ee1(0xf5)];if(_0x618e01){const _0x54ad63=await withSpinner('Resolving\x20project\x20\x27'+_0x618e01+_0x3e5ee1(0xcd),()=>_0x32d114[_0x3e5ee1(0x155)][_0x3e5ee1(0x15f)](_0x618e01),{'verbose':_0x1d5964[_0x3e5ee1(0x11b)]});return _0x54ad63[_0x3e5ee1(0xb5)];}let _0x4cf89e=_0x32d114[_0x3e5ee1(0x155)][_0x3e5ee1(0x14c)]();if(_0x4cf89e)return _0x4cf89e;const _0xbc112e=await withSpinner(_0x3e5ee1(0xe3),()=>_0x32d114[_0x3e5ee1(0x155)][_0x3e5ee1(0x154)](),{'verbose':_0x1d5964[_0x3e5ee1(0x11b)]});return _0xbc112e[_0x3e5ee1(0xb5)]['id'];}function toLLMProjectInfo(_0x35ab8a){const _0x5e8569=a25_0x35f0;return{'name':_0x35ab8a[_0x5e8569(0xea)][_0x5e8569(0xfb)],'description':_0x35ab8a['attributes'][_0x5e8569(0xf9)],'createdAt':_0x35ab8a[_0x5e8569(0xea)][_0x5e8569(0x151)],'updatedAt':_0x35ab8a[_0x5e8569(0xea)][_0x5e8569(0xd4)]};}function toAgentInfo(_0x5d35ab){const _0x30ac61=a25_0x35f0;return{'name':_0x5d35ab[_0x30ac61(0xea)][_0x30ac61(0xfb)],'description':_0x5d35ab['attributes'][_0x30ac61(0xf9)],'prompt':truncatePrompt(_0x5d35ab[_0x30ac61(0xea)][_0x30ac61(0xd9)]),'createdAt':_0x5d35ab[_0x30ac61(0xea)][_0x30ac61(0x151)],'updatedAt':_0x5d35ab['attributes'][_0x30ac61(0xd4)]};}function truncatePrompt(_0x5a8037){const _0x263cc3=a25_0x35f0;if(!_0x5a8037)return undefined;const _0x1852d5=0x64;if(_0x5a8037['length']<=_0x1852d5)return _0x5a8037;return _0x5a8037['slice'](0x0,_0x1852d5)+_0x263cc3(0x12a);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a25_0x203df8(0xf9)]=a25_0x203df8(0xbd);async['execute'](_0x8d06e8){const _0x228a12=a25_0x203df8,{options:_0x1c94ae,tdx:_0x179508}=_0x8d06e8;try{const _0x348106=await withSpinner(_0x228a12(0x13e),()=>_0x179508[_0x228a12(0x155)][_0x228a12(0xf0)](),{'verbose':_0x1c94ae[_0x228a12(0x11b)]});return await handleSDKOutput(_0x348106[_0x228a12(0xb5)],_0x1c94ae),0x0;}catch(_0x5ae033){return handleSDKError(_0x5ae033,_0x1c94ae),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0x152);['description']=a25_0x203df8(0x166);async[a25_0x203df8(0xbf)](_0x3a3029){const _0x14334b=a25_0x203df8,{options:_0xbeecc0,args:_0x427f27,tdx:_0x1f65f5}=_0x3a3029;try{const _0x241b72=_0x427f27[0x0],_0x2254f4=resolveLimit(_0xbeecc0['limit'],DEFAULT_LLM_LIMIT),_0x5d8483=await withSpinner('Fetching\x20projects...',()=>_0x1f65f5[_0x14334b(0x155)][_0x14334b(0xe9)](_0x2254f4),{'verbose':_0xbeecc0[_0x14334b(0x11b)]});let _0x236333=_0x5d8483['data'];_0x241b72&&(_0x236333=_0x5d8483[_0x14334b(0xb5)][_0x14334b(0xfa)](_0x323dd0=>matchGlobPattern(_0x323dd0[_0x14334b(0xea)][_0x14334b(0xfb)],_0x241b72)));const _0x5d01a6=_0x236333[_0x14334b(0x168)](toLLMProjectInfo);return await handleSDKOutput(_0x5d01a6,_0xbeecc0),0x0;}catch(_0x387f75){return handleSDKError(_0x387f75,_0xbeecc0),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a25_0x203df8(0x10c);[a25_0x203df8(0xf9)]='List\x20agents\x20in\x20current\x20project';async[a25_0x203df8(0xbf)](_0x5d261b){const _0x3b1c53=a25_0x203df8,{options:_0x5c32d2,args:_0x1ec95f,tdx:_0x568384}=_0x5d261b;try{const _0x48a5fa=_0x1ec95f[0x0];let _0x3f7483,_0x51ca55=_0x48a5fa;if(_0x48a5fa&&_0x48a5fa[_0x3b1c53(0xba)]('/')){const _0x345721=_0x48a5fa[_0x3b1c53(0x112)]('/');if(_0x345721['length']===0x2){const [_0xb299c1,_0x4d6769]=_0x345721,_0x33bca0=await _0x568384[_0x3b1c53(0x155)]['projects'](),_0x27cb7b=_0x33bca0[_0x3b1c53(0xcc)](_0x3c8bcb=>_0x3c8bcb[_0x3b1c53(0xea)]['name'][_0x3b1c53(0xfd)]()===_0xb299c1[_0x3b1c53(0xfd)]());if(!_0x27cb7b)throw new SDKError(ErrorCode[_0x3b1c53(0xed)],_0x3b1c53(0x150)+_0xb299c1,undefined,{'helpText':_0x3b1c53(0xc5)});_0x3f7483=_0x27cb7b['id'],_0x51ca55=_0x4d6769;}else throw new SDKError(ErrorCode[_0x3b1c53(0x124)],_0x3b1c53(0x14f)+_0x48a5fa,undefined,{'helpText':_0x3b1c53(0xb8)});}else _0x3f7483=await getProjectIdOrDefault(_0x5d261b);const _0x15aa88=await withSpinner(_0x3b1c53(0x14d),()=>_0x568384[_0x3b1c53(0x155)][_0x3b1c53(0x174)](_0x3f7483),{'verbose':_0x5c32d2[_0x3b1c53(0x11b)]});let _0x79db6c=_0x15aa88[_0x3b1c53(0xb5)];_0x51ca55&&(_0x79db6c=_0x15aa88[_0x3b1c53(0xb5)][_0x3b1c53(0xfa)](_0x191243=>matchGlobPattern(_0x191243[_0x3b1c53(0xea)][_0x3b1c53(0xfb)],_0x51ca55)));const _0x12bdb5=_0x79db6c[_0x3b1c53(0x168)](toAgentInfo);return await handleSDKOutput(_0x12bdb5,_0x5c32d2),0x0;}catch(_0x2f1d23){return handleSDKError(_0x2f1d23,_0x5c32d2),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a25_0x203df8(0x103);[a25_0x203df8(0xf9)]='Show\x20agent\x20details';async[a25_0x203df8(0xbf)](_0x2eb279){const _0x450751=a25_0x203df8,{options:_0x525613,args:_0x2e01d3,tdx:_0x2a62f5}=_0x2eb279;if(_0x2e01d3[_0x450751(0xd7)]===0x0)return console[_0x450751(0xce)](_0x450751(0x146)),console[_0x450751(0xce)](_0x450751(0xc3)),0x1;const _0xff8bb=_0x2e01d3[0x0];try{const _0x5e23e0=await getProjectIdOrDefault(_0x2eb279),_0x5976cd=await withSpinner(_0x450751(0x110)+_0xff8bb+'\x27...',()=>_0x2a62f5[_0x450751(0x155)][_0x450751(0xdd)](_0xff8bb,_0x5e23e0),{'verbose':_0x525613[_0x450751(0x11b)]}),_0x3aa993=await withSpinner('Fetching\x20agent...',()=>_0x2a62f5['llm']['agent'](_0x5976cd[_0x450751(0xb5)]),{'verbose':_0x525613[_0x450751(0x11b)]});return await handleSDKOutput([_0x3aa993[_0x450751(0xb5)]],_0x525613),0x0;}catch(_0x285db0){return handleSDKError(_0x285db0,_0x525613),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']='llm:agent:create';[a25_0x203df8(0xf9)]=a25_0x203df8(0x156);async[a25_0x203df8(0xbf)](_0x200bc6){const _0x12c140=a25_0x203df8,{options:_0xb3fbf4,args:_0x14ea97,tdx:_0xafac77}=_0x200bc6;if(_0x14ea97[_0x12c140(0xd7)]===0x0)return console[_0x12c140(0xce)](_0x12c140(0x146)),console[_0x12c140(0xce)]('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console[_0x12c140(0xce)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x2e465b=_0x14ea97[0x0],_0x5e2e5b=_0xb3fbf4,_0x4bd0f5=_0x5e2e5b[_0x12c140(0xf2)],_0x34027b=_0x5e2e5b[_0x12c140(0xc9)]||'claude-4.5-haiku',_0xa4dea9=_0x5e2e5b['starterMessage'],_0x2f616e=_0x5e2e5b['maxToolIterations']?Number(_0x5e2e5b['maxToolIterations']):undefined,_0x3f77cf=_0x5e2e5b[_0x12c140(0xbe)]?Number(_0x5e2e5b[_0x12c140(0xbe)]):undefined;try{let _0x9e1832,_0x25e8ff;if(_0x2e465b[_0x12c140(0xba)]('/')){const _0x5bb508=_0x2e465b[_0x12c140(0x112)]('/');if(_0x5bb508['length']===0x2){const [_0x479122,_0x5cca36]=_0x5bb508,_0x4814d8=await withSpinner(_0x12c140(0x123)+_0x479122+'\x27...',()=>_0xafac77[_0x12c140(0x155)][_0x12c140(0x15f)](_0x479122),{'verbose':_0xb3fbf4[_0x12c140(0x11b)]});_0x9e1832=_0x4814d8['data'],_0x25e8ff=_0x5cca36;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12c140(0x14f)+_0x2e465b,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x9e1832=await getProjectIdOrDefault(_0x200bc6),_0x25e8ff=_0x2e465b;const _0x4d67c1=await withSpinner(_0x12c140(0xcb)+_0x25e8ff+_0x12c140(0xcd),()=>_0xafac77[_0x12c140(0x155)][_0x12c140(0x16a)]({'name':_0x25e8ff,'projectId':_0x9e1832,'modelType':_0x34027b,'systemPrompt':_0x4bd0f5,'starterMessage':_0xa4dea9,'maxToolIterations':_0x2f616e,'temperature':_0x3f77cf}),{'verbose':_0xb3fbf4[_0x12c140(0x11b)]});return console[_0x12c140(0xe7)](_0x12c140(0x145)+_0x4d67c1[_0x12c140(0xb5)]['id']),await handleSDKOutput([_0x4d67c1['data']],_0xb3fbf4),0x0;}catch(_0x40c0e5){return handleSDKError(_0x40c0e5,_0xb3fbf4),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a25_0x203df8(0xec);[a25_0x203df8(0xf9)]=a25_0x203df8(0x130);async[a25_0x203df8(0xbf)](_0x38400f){const _0x26d1e3=a25_0x203df8,{options:_0x358682,args:_0x150184,tdx:_0x37ff02}=_0x38400f;if(_0x150184[_0x26d1e3(0xd7)]===0x0)return console[_0x26d1e3(0xce)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x26d1e3(0x13d)),0x1;const _0x503fa8=_0x150184[0x0],_0x17a662=_0x358682,_0x127b97=_0x17a662[_0x26d1e3(0xfb)],_0x3f5ad6=_0x17a662[_0x26d1e3(0xd9)],_0x34ea39=_0x17a662[_0x26d1e3(0xf9)],_0x119d46=_0x17a662['starterMessage'];if(!_0x127b97&&!_0x3f5ad6&&!_0x34ea39&&!_0x119d46)return console[_0x26d1e3(0xce)](_0x26d1e3(0xeb)),console['error'](_0x26d1e3(0x10d)),0x1;try{const _0x2f93b8=await getProjectIdOrDefault(_0x38400f),_0x53bcee=await withSpinner(_0x26d1e3(0x110)+_0x503fa8+_0x26d1e3(0xcd),()=>_0x37ff02[_0x26d1e3(0x155)][_0x26d1e3(0xdd)](_0x503fa8,_0x2f93b8),{'verbose':_0x358682[_0x26d1e3(0x11b)]}),_0xbc1e1d=_0x53bcee[_0x26d1e3(0xb5)],_0x57b25d=await withSpinner(_0x26d1e3(0x134),()=>_0x37ff02[_0x26d1e3(0x155)][_0x26d1e3(0x13a)](_0xbc1e1d,{'name':_0x127b97,'prompt':_0x3f5ad6,'description':_0x34ea39,'starterMessage':_0x119d46}),{'verbose':_0x358682['verbose']});return console[_0x26d1e3(0xe7)](_0x26d1e3(0xb7)+_0x57b25d[_0x26d1e3(0xb5)]['id']),await handleSDKOutput([_0x57b25d[_0x26d1e3(0xb5)]],_0x358682),0x0;}catch(_0x58edb4){return handleSDKError(_0x58edb4,_0x358682),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a25_0x203df8(0x17a);[a25_0x203df8(0xf9)]='Delete\x20an\x20agent';async[a25_0x203df8(0xbf)](_0x2ab8dc){const _0x4305e2=a25_0x203df8,{options:_0x3bceee,args:_0xf116e,tdx:_0x3a9597}=_0x2ab8dc;if(_0xf116e['length']===0x0)return console[_0x4305e2(0xce)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x4305e2(0xce)](_0x4305e2(0xd5)),0x1;const _0x583e32=_0xf116e[0x0];try{const _0x1fda7c=await getProjectIdOrDefault(_0x2ab8dc),_0x1a4ad1=await withSpinner(_0x4305e2(0x110)+_0x583e32+'\x27...',()=>_0x3a9597[_0x4305e2(0x155)][_0x4305e2(0xdd)](_0x583e32,_0x1fda7c),{'verbose':_0x3bceee[_0x4305e2(0x11b)]}),_0x531cac=_0x1a4ad1[_0x4305e2(0xb5)];return await withSpinner(_0x4305e2(0x15d),()=>_0x3a9597[_0x4305e2(0x155)]['deleteAgent'](_0x531cac),{'verbose':_0x3bceee[_0x4305e2(0x11b)]}),console[_0x4305e2(0xe7)]('Agent\x20deleted:\x20'+_0x531cac),0x0;}catch(_0x486449){return handleSDKError(_0x486449,_0x3bceee),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a25_0x203df8(0xfb)]='llm:history';[a25_0x203df8(0xf9)]=a25_0x203df8(0x147);async[a25_0x203df8(0xbf)](_0x5da60f){const _0x225996=a25_0x203df8;return executeChatHistoryCommand(_0x5da60f,_0x225996(0xd6));}}export class LLMUseCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0x14b);[a25_0x203df8(0xf9)]=a25_0x203df8(0x116);async[a25_0x203df8(0xbf)](_0x54ed96){const _0x2b0f16=a25_0x203df8,{options:_0x184951,args:_0x42b561,tdx:_0x6479f5}=_0x54ed96;if(_0x42b561['length']===0x0)return console[_0x2b0f16(0xce)](_0x2b0f16(0x109)),console[_0x2b0f16(0xce)](_0x2b0f16(0xd3)),0x1;const _0x1f9a64=_0x42b561[0x0];try{return await withSpinner(_0x2b0f16(0xe8)+_0x1f9a64+'\x27...',()=>_0x6479f5['llm'][_0x2b0f16(0x15a)](_0x1f9a64),{'verbose':_0x184951[_0x2b0f16(0x11b)]}),console[_0x2b0f16(0xe7)]('Project\x20context\x20set\x20to:\x20'+_0x1f9a64),0x0;}catch(_0x226b26){return handleSDKError(_0x226b26,_0x184951),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0xc2);[a25_0x203df8(0xf9)]=a25_0x203df8(0x14a);async[a25_0x203df8(0xbf)](_0x32fa48){const _0xc87100=a25_0x203df8,{options:_0x36a3a7,args:_0x13d1a4,tdx:_0x62b84d}=_0x32fa48;if(_0x13d1a4[_0xc87100(0xd7)]===0x0)return console[_0xc87100(0xce)](_0xc87100(0x109)),console['error'](_0xc87100(0xd2)),0x1;const _0x551438=_0x13d1a4[0x0],_0x17f0cb=_0x36a3a7,_0x35e8ef=_0x17f0cb['description'];try{const _0x4d7998=await withSpinner(_0xc87100(0xf8)+_0x551438+_0xc87100(0xcd),()=>_0x62b84d[_0xc87100(0x155)][_0xc87100(0xdc)]({'name':_0x551438,'description':_0x35e8ef}),{'verbose':_0x36a3a7[_0xc87100(0x11b)]});console[_0xc87100(0xe7)]('Project\x20created:\x20'+_0x4d7998[_0xc87100(0xb5)]['id']);const _0x15d7c0=toLLMProjectInfo(_0x4d7998['data']);return await handleSDKOutput([_0x15d7c0],_0x36a3a7),0x0;}catch(_0x36c461){return handleSDKError(_0x36c461,_0x36a3a7),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0x13c);[a25_0x203df8(0xf9)]='Delete\x20an\x20LLM\x20project';async['execute'](_0x300938){const _0x5ca846=a25_0x203df8,{options:_0xeebc05,args:_0x185ac0,tdx:_0xe9f98d}=_0x300938;if(_0x185ac0[_0x5ca846(0xd7)]===0x0)return console[_0x5ca846(0xce)](_0x5ca846(0x109)),console['error']('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x3a3016=_0x185ac0[0x0];try{return await withSpinner(_0x5ca846(0x120)+_0x3a3016+_0x5ca846(0xcd),()=>_0xe9f98d[_0x5ca846(0x155)]['deleteProject'](_0x3a3016),{'verbose':_0xeebc05[_0x5ca846(0x11b)]}),console[_0x5ca846(0xe7)]('Project\x20deleted:\x20'+_0x3a3016),0x0;}catch(_0x1075b0){return handleSDKError(_0x1075b0,_0xeebc05),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a25_0x203df8(0x143);[a25_0x203df8(0xf9)]=a25_0x203df8(0x133);async['execute'](_0xed5640){const _0x3563cb=a25_0x203df8,{options:_0x2a9e82,args:_0x1a2c51,tdx:_0x5c1272}=_0xed5640;if(_0x1a2c51['length']===0x0)return console[_0x3563cb(0xce)](_0x3563cb(0x109)),console[_0x3563cb(0xce)]('Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]'),0x1;const _0x43803b=_0x1a2c51[0x0],_0x13e19a=_0x2a9e82,_0x3318f9=_0x13e19a[_0x3563cb(0x13b)],_0x4f885b=_0x13e19a[_0x3563cb(0x160)];try{const _0x823ca4=_0x3318f9||_0x43803b+_0x3563cb(0xcf);if(a25_0x20bc81['existsSync'](_0x823ca4)&&!_0x4f885b){if(!_0x2a9e82[_0x3563cb(0xc0)]){const _0x3b8382=await confirm(_0x3563cb(0xc6)+_0x823ca4+_0x3563cb(0xb4));if(!_0x3b8382)return console['log']('Backup\x20cancelled.'),0x0;}a25_0x20bc81[_0x3563cb(0x118)](_0x823ca4,{'recursive':!![]});}const _0x57588d=await withSpinner(_0x4f885b?_0x3563cb(0x164)+_0x43803b+_0x3563cb(0xcd):_0x3563cb(0x139)+_0x43803b+_0x3563cb(0xcd),()=>_0x5c1272[_0x3563cb(0x155)]['backupProject'](_0x43803b,_0x3318f9,{'dryRun':_0x4f885b}),{'verbose':_0x2a9e82['verbose']}),_0x54fe7=_0x57588d['data'];return _0x4f885b?console['log']('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0x54fe7[_0x3563cb(0x105)]):console[_0x3563cb(0xe7)](_0x3563cb(0x15e)+_0x54fe7['outputDir']),console[_0x3563cb(0xe7)](_0x3563cb(0x11d)+_0x54fe7[_0x3563cb(0x157)]['agents']),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x54fe7[_0x3563cb(0x157)]['knowledgeBases']),console[_0x3563cb(0xe7)](_0x3563cb(0xf3)+_0x54fe7['counts'][_0x3563cb(0xf4)]),console[_0x3563cb(0xe7)](_0x3563cb(0x128)+_0x54fe7['counts']['integrations']),(_0x2a9e82['format']===_0x3563cb(0x10b)||_0x2a9e82[_0x3563cb(0x13f)]===_0x3563cb(0xee))&&await handleSDKOutput([_0x54fe7],_0x2a9e82),0x0;}catch(_0xaee5f7){return handleSDKError(_0xaee5f7,_0x2a9e82),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a25_0x203df8(0xfb)]='llm:project:restore';[a25_0x203df8(0xf9)]=a25_0x203df8(0xbb);async['execute'](_0x1ee019){const _0x147b96=a25_0x203df8,{options:_0x16c1f3,args:_0x45dced,tdx:_0x463279}=_0x1ee019;if(_0x45dced[_0x147b96(0xd7)]===0x0)return console[_0x147b96(0xce)](_0x147b96(0x167)),console[_0x147b96(0xce)](_0x147b96(0x114)),0x1;const _0x1a0419=_0x45dced[0x0],_0xf02290=_0x16c1f3,_0xca93f8=_0xf02290['name'],_0x55acfd=_0xf02290['dryRun'];try{if(!_0x55acfd){const _0x4796c7=_0x463279['llm'][_0x147b96(0x12c)](_0x1a0419),_0x47ed65=_0xca93f8||_0x4796c7[_0x147b96(0x12b)][_0x147b96(0xfe)],_0x10aaba=await withSpinner(_0x147b96(0x148),()=>_0x463279[_0x147b96(0x155)][_0x147b96(0xe9)](),{'verbose':_0x16c1f3[_0x147b96(0x11b)]}),_0xa9ff1=_0x10aaba[_0x147b96(0xb5)][_0x147b96(0xcc)](_0x4af3b3=>_0x4af3b3['attributes'][_0x147b96(0xfb)]===_0x47ed65);if(_0xa9ff1&&!_0x16c1f3[_0x147b96(0xc0)]){const _0x17e623=await confirm('A\x20project\x20named\x20\x27'+_0x47ed65+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x17e623)return console[_0x147b96(0xe7)](_0x147b96(0x161)),0x0;}}const _0x2d7d80=await withSpinner(_0x55acfd?'Validating\x20backup\x20from\x20\x27'+_0x1a0419+'\x27...':_0x147b96(0x131)+_0x1a0419+_0x147b96(0xcd),()=>_0x463279[_0x147b96(0x155)][_0x147b96(0x171)](_0x1a0419,{'name':_0xca93f8,'dryRun':_0x55acfd}),{'verbose':_0x16c1f3[_0x147b96(0x11b)]}),_0x10c23e=_0x2d7d80['data'];return _0x10c23e[_0x147b96(0x15c)]&&console[_0x147b96(0xe7)](_0x147b96(0x12d)+_0x10c23e[_0x147b96(0x15c)]+'\x27'),_0x55acfd?console[_0x147b96(0xe7)](_0x147b96(0xde)+_0x10c23e[_0x147b96(0xfe)]):console['log'](_0x147b96(0x11e)+_0x10c23e['projectName']+'\x20('+_0x10c23e['projectId']+')'),console[_0x147b96(0xe7)](_0x147b96(0x11d)+_0x10c23e[_0x147b96(0x157)][_0x147b96(0x174)]),console[_0x147b96(0xe7)](_0x147b96(0x16b)+_0x10c23e['counts'][_0x147b96(0xf1)]),console['log']('\x20\x20Prompts:\x20'+_0x10c23e[_0x147b96(0x157)]['prompts']),console[_0x147b96(0xe7)]('\x20\x20Integrations:\x20'+_0x10c23e['counts'][_0x147b96(0xf6)]),(_0x16c1f3['format']===_0x147b96(0x10b)||_0x16c1f3[_0x147b96(0x13f)]==='jsonl')&&await handleSDKOutput([_0x10c23e],_0x16c1f3),0x0;}catch(_0x21290e){return handleSDKError(_0x21290e,_0x16c1f3),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x114172,_0x2ebc62){const _0x18226c=a25_0x203df8,_0x15faae=_0x2ebc62['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0xc2e239=0x0,_0x24fb30=[];const _0x36ec11=(await import('prompts'))[_0x18226c(0x115)],_0x51fb65=getChalk(_0x2ebc62);while(!![]){const _0x2f1066=await withSpinner(_0x18226c(0x106),()=>_0x114172[_0x18226c(0x155)][_0x18226c(0x125)](_0x15faae+_0xc2e239),{'verbose':_0x2ebc62[_0x18226c(0x11b)]});_0x24fb30=_0x2f1066[_0x18226c(0xb5)];const _0x52ecfd=_0x24fb30[_0x18226c(0xca)](_0xc2e239,_0xc2e239+_0x15faae),_0x22f7d5=_0x24fb30[_0x18226c(0xd7)]>_0xc2e239+_0x15faae,_0xe43126=[...new Set(_0x52ecfd['map'](_0xfa7db4=>_0xfa7db4[_0x18226c(0xea)][_0x18226c(0xff)])[_0x18226c(0xfa)](_0x222fad=>_0x222fad!==undefined))],_0x3cbc6a=new Map();await Promise['all'](_0xe43126[_0x18226c(0x168)](async _0x2d427c=>{const _0x3ad529=_0x18226c;try{const _0x4cbbd5=await _0x114172['llm'][_0x3ad529(0xb6)](_0x2d427c);_0x3cbc6a[_0x3ad529(0x11a)](_0x2d427c,_0x4cbbd5['attributes'][_0x3ad529(0xfb)]);}catch{_0x3cbc6a[_0x3ad529(0x11a)](_0x2d427c,_0x2d427c);}}));const _0x6c0311=_0x52ecfd[_0x18226c(0x168)](_0x486dc2=>{const _0x1249fa=_0x18226c,_0x4b1fa5=_0x486dc2[_0x1249fa(0xea)][_0x1249fa(0x16f)]||_0x1249fa(0x15b),_0x9c01da=_0x4b1fa5['split']('\x0a')[0x0],_0x3563d4=_0x9c01da[_0x1249fa(0xd7)]>0x50?_0x9c01da[_0x1249fa(0xfc)](0x0,0x4d)+_0x1249fa(0x12a):_0x9c01da,_0x1ab69c=_0x486dc2[_0x1249fa(0xea)][_0x1249fa(0xff)]?_0x3cbc6a[_0x1249fa(0x137)](_0x486dc2[_0x1249fa(0xea)]['agentId'])||_0x486dc2['attributes'][_0x1249fa(0xff)]:'(no\x20agent)',_0x577d1b=_0x486dc2[_0x1249fa(0xea)]['lastConversationAt']||_0x486dc2[_0x1249fa(0xea)][_0x1249fa(0xd4)],_0x3a7d58=new Date(_0x577d1b),_0x10e7bd=new Date(),_0x12cd48=_0x10e7bd[_0x1249fa(0x175)]()-_0x3a7d58[_0x1249fa(0x175)](),_0x2fb69a=Math[_0x1249fa(0x129)](_0x12cd48/0xea60),_0x376071=Math[_0x1249fa(0x129)](_0x12cd48/0x36ee80),_0x5dcff2=Math['floor'](_0x12cd48/0x5265c00);let _0x1825c2;if(_0x2fb69a<0x1)_0x1825c2=_0x1249fa(0x132);else{if(_0x2fb69a<0x3c)_0x1825c2=_0x2fb69a+_0x1249fa(0xe2);else{if(_0x376071<0x18)_0x1825c2=_0x376071+_0x1249fa(0x158);else _0x5dcff2<0x7?_0x1825c2=_0x5dcff2+_0x1249fa(0x172):_0x1825c2=_0x3a7d58[_0x1249fa(0x135)](_0x1249fa(0x119),{'month':'short','day':_0x1249fa(0x117)});}}return{'title':_0x3563d4+'\x20'+_0x51fb65[_0x1249fa(0xe1)]('['+_0x1ab69c+']\x20'+_0x1825c2),'value':_0x486dc2['id']};});_0x22f7d5&&_0x6c0311[_0x18226c(0x102)]({'title':_0x51fb65['cyan'](_0x18226c(0x14e)),'value':'__load_more__'});const _0x2d6841=await _0x36ec11({'type':_0x18226c(0x140),'name':_0x18226c(0xe5),'message':_0x18226c(0x165),'choices':_0x6c0311,'hint':_0x18226c(0xd1)});if(!_0x2d6841[_0x18226c(0xe5)])return undefined;if(_0x2d6841['chatId']===_0x18226c(0x12e)){_0xc2e239+=_0x15faae;continue;}return _0x2d6841[_0x18226c(0xe5)];}}export class ChatsCommand extends BaseCommand{[a25_0x203df8(0xfb)]='chats';[a25_0x203df8(0xf9)]=a25_0x203df8(0x104);async[a25_0x203df8(0xbf)](_0x32b030){const _0x1a7659=a25_0x203df8;return executeChatHistoryCommand(_0x32b030,_0x1a7659(0x178));}}
@@ -1 +1 @@
1
- const a25_0x14ac7=a25_0x5e1a;function a25_0x5e1a(_0x3dde25,_0x4db083){const _0x345e3c=a25_0x345e();return a25_0x5e1a=function(_0x5e1a8e,_0x5b5e43){_0x5e1a8e=_0x5e1a8e-0xf9;let _0x41f22c=_0x345e3c[_0x5e1a8e];return _0x41f22c;},a25_0x5e1a(_0x3dde25,_0x4db083);}(function(_0x2d4aa8,_0x12569a){const _0x46bfb0=a25_0x5e1a,_0x39c431=_0x2d4aa8();while(!![]){try{const _0x56747b=-parseInt(_0x46bfb0(0x118))/0x1+parseInt(_0x46bfb0(0x12c))/0x2*(parseInt(_0x46bfb0(0x124))/0x3)+parseInt(_0x46bfb0(0xff))/0x4+parseInt(_0x46bfb0(0x12f))/0x5*(parseInt(_0x46bfb0(0x11b))/0x6)+parseInt(_0x46bfb0(0x12b))/0x7*(parseInt(_0x46bfb0(0x100))/0x8)+parseInt(_0x46bfb0(0x133))/0x9*(-parseInt(_0x46bfb0(0x109))/0xa)+-parseInt(_0x46bfb0(0x115))/0xb;if(_0x56747b===_0x12569a)break;else _0x39c431['push'](_0x39c431['shift']());}catch(_0x3c5c56){_0x39c431['push'](_0x39c431['shift']());}}}(a25_0x345e,0xd3673));import a25_0x2f3ad9 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';function a25_0x345e(){const _0x1d5c9a=['[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','attributes','logger','NOT_FOUND','init','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','server','14243427vqNBzj','\x0aTesting\x20with\x20Agent\x20SDK:','execute','161977zeoaSP','\x20\x20Project:','Starting\x20proxy\x20server...','7038114sRZGgm','bold','llm:proxy','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','name','getOrCreateDefaultProject','\x20\x20\x20\x20\x22env\x22:\x20{','yellow','756261zEObun','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','✓\x20Proxy\x20server\x20stopped','\x0a\x0aShutting\x20down\x20proxy\x20server...','llmProject','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','site','682717igFpCr','4QxWFOH','\x20\x20Agents:','dim','5nWYwpx','close','\x20\x20Address:','cyan','1953jqzxVU','\x20\x20{','Server\x20Configuration:','SIGINT','log','stop','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0aClaude\x20Code\x20Configuration:','\x27\x20not\x20found','green','llm','2969908hhPsfX','112igKKYD','white','logLevel','http://0.0.0.0:','port','\x20is\x20unavailable,\x20using\x20port\x20','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','\x20\x20}','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','67390oEHKzU','description','SIGTERM','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','find'];a25_0x345e=function(){return _0x1d5c9a;};return a25_0x345e();}async function getProjectIdOrDefault(_0x1426bb,_0x5ecb5f){const _0x2cac4c=a25_0x5e1a,{tdx:_0x3aeaba,options:_0xdd971}=_0x1426bb,_0x665db2=_0x5ecb5f||_0xdd971[_0x2cac4c(0x128)];if(_0x665db2){const _0x90014d=await _0x3aeaba[_0x2cac4c(0xfe)]['projects'](),_0xa8f860=_0x90014d[_0x2cac4c(0x10d)](_0x31031e=>_0x31031e[_0x2cac4c(0x10f)][_0x2cac4c(0x120)]===_0x665db2);if(!_0xa8f860)throw new SDKError(ErrorCode[_0x2cac4c(0x111)],'Project\x20\x27'+_0x665db2+_0x2cac4c(0xfc),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0xa8f860['id'];}const _0x58b9c3=await _0x3aeaba[_0x2cac4c(0xfe)][_0x2cac4c(0x121)]();return _0x58b9c3['id'];}export class LLMProxyCommand extends BaseCommand{[a25_0x14ac7(0x120)]=a25_0x14ac7(0x11d);[a25_0x14ac7(0x10a)]=a25_0x14ac7(0x10e);[a25_0x14ac7(0x114)];['logger'];async[a25_0x14ac7(0x117)](_0x57fe53){const _0x1fceba=a25_0x14ac7,{tdx:_0x2e5815,options:_0x3ebafd}=_0x57fe53;try{const _0x2b9e6e=_0x3ebafd,_0x34c598=_0x2b9e6e[_0x1fceba(0x104)]||0xfa0,_0x18ddd1=_0x2b9e6e['project'],_0x2b00cd=await findAvailablePort(_0x34c598);console['log'](a25_0x2f3ad9[_0x1fceba(0x12e)]('Resolving\x20project...'));const _0x5944a0=await getProjectIdOrDefault(_0x57fe53,_0x18ddd1),_0x84dec3=await _0x2e5815['llm']['projects'](),_0x22dd53=_0x84dec3[_0x1fceba(0x10d)](_0xd5fe72=>_0xd5fe72['id']===_0x5944a0);this[_0x1fceba(0x110)]=new TDXLogger(_0x3ebafd[_0x1fceba(0x102)]),await this[_0x1fceba(0x110)][_0x1fceba(0x112)](),console['log'](a25_0x2f3ad9['dim'](_0x1fceba(0x11a)));_0x2b00cd!==_0x34c598&&console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x123)]('Port\x20'+_0x34c598+_0x1fceba(0x105)+_0x2b00cd));this[_0x1fceba(0x114)]=new ProxyServer({'port':_0x2b00cd,'projectId':_0x5944a0,'tdx':_0x2e5815,'logger':this[_0x1fceba(0x110)],'site':_0x3ebafd[_0x1fceba(0x12a)]}),await this[_0x1fceba(0x114)]['start'](),console['log'](a25_0x2f3ad9[_0x1fceba(0x123)][_0x1fceba(0x11c)](_0x1fceba(0x106))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x123)](_0x1fceba(0x113))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x123)](_0x1fceba(0xfa))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0xfd)][_0x1fceba(0x11c)](_0x1fceba(0x129))),console['log'](a25_0x2f3ad9[_0x1fceba(0x132)](_0x1fceba(0x135))),console['log'](a25_0x2f3ad9['dim'](_0x1fceba(0x131)),a25_0x2f3ad9[_0x1fceba(0x101)](_0x1fceba(0x103)+_0x2b00cd)),console['log'](a25_0x2f3ad9['dim'](_0x1fceba(0x119)),a25_0x2f3ad9['white'](_0x22dd53?.[_0x1fceba(0x10f)][_0x1fceba(0x120)]||_0x5944a0)),console[_0x1fceba(0x137)](a25_0x2f3ad9['dim'](_0x1fceba(0x12d)),a25_0x2f3ad9[_0x1fceba(0x101)]('created\x20on-demand\x20per\x20model')),console['log'](a25_0x2f3ad9[_0x1fceba(0x12e)]('\x20\x20Site:'),a25_0x2f3ad9[_0x1fceba(0x101)](_0x3ebafd[_0x1fceba(0x12a)])),console['log'](a25_0x2f3ad9[_0x1fceba(0x132)](_0x1fceba(0xfb))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x12e)](_0x1fceba(0x108))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x101)](_0x1fceba(0x134))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x101)](_0x1fceba(0x122))),console[_0x1fceba(0x137)](a25_0x2f3ad9['white'](_0x1fceba(0x11f)+_0x2b00cd+'\x22,')),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x101)](_0x1fceba(0x125))),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x101)]('\x20\x20\x20\x20}')),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x101)](_0x1fceba(0x107))),console[_0x1fceba(0x137)](a25_0x2f3ad9['cyan'](_0x1fceba(0x116))),console[_0x1fceba(0x137)](a25_0x2f3ad9['dim'](_0x1fceba(0x10c))),console[_0x1fceba(0x137)](a25_0x2f3ad9['dim']('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console['log'](a25_0x2f3ad9[_0x1fceba(0x12e)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x1fceba(0x137)](a25_0x2f3ad9[_0x1fceba(0x123)](_0x1fceba(0x11e)));const _0x16ac63=async()=>{const _0x30dbba=_0x1fceba;console[_0x30dbba(0x137)](a25_0x2f3ad9[_0x30dbba(0x12e)](_0x30dbba(0x127))),this[_0x30dbba(0x114)]&&await this['server'][_0x30dbba(0xf9)](),this['logger']&&await this[_0x30dbba(0x110)][_0x30dbba(0x130)](),console[_0x30dbba(0x137)](a25_0x2f3ad9['green'](_0x30dbba(0x126))),process['exit'](0x0);};return process['on'](_0x1fceba(0x136),_0x16ac63),process['on'](_0x1fceba(0x10b),_0x16ac63),await new Promise(()=>{}),0x0;}catch(_0x153a36){this[_0x1fceba(0x114)]&&await this['server'][_0x1fceba(0xf9)]();this['logger']&&await this[_0x1fceba(0x110)][_0x1fceba(0x130)]();throw _0x153a36;}}}
1
+ const a26_0x3c7251=a26_0x5b58;(function(_0x1e0748,_0x30005e){const _0x5a2deb=a26_0x5b58,_0x2f30e4=_0x1e0748();while(!![]){try{const _0x303dc6=-parseInt(_0x5a2deb(0x19e))/0x1+-parseInt(_0x5a2deb(0x1b5))/0x2*(-parseInt(_0x5a2deb(0x17f))/0x3)+parseInt(_0x5a2deb(0x19d))/0x4*(parseInt(_0x5a2deb(0x17b))/0x5)+parseInt(_0x5a2deb(0x193))/0x6*(-parseInt(_0x5a2deb(0x1a2))/0x7)+parseInt(_0x5a2deb(0x180))/0x8+-parseInt(_0x5a2deb(0x179))/0x9*(-parseInt(_0x5a2deb(0x17e))/0xa)+-parseInt(_0x5a2deb(0x1af))/0xb;if(_0x303dc6===_0x30005e)break;else _0x2f30e4['push'](_0x2f30e4['shift']());}catch(_0x54d94e){_0x2f30e4['push'](_0x2f30e4['shift']());}}}(a26_0x1b44,0x9052f));import a26_0x49ac94 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a26_0x5b58(_0xdd951e,_0x27b89d){_0xdd951e=_0xdd951e-0x173;const _0x1b44b1=a26_0x1b44();let _0x5b5817=_0x1b44b1[_0xdd951e];return _0x5b5817;}function a26_0x1b44(){const _0x2d8348=['765685yisGkS','yellow','Starting\x20proxy\x20server...','1013730nQcOmS','33INocYk','4064048aVAMlm','created\x20on-demand\x20per\x20model','Project\x20\x27','http://0.0.0.0:','\x20\x20}','\x0aTesting\x20with\x20Agent\x20SDK:','description','SIGINT','find','start','exit','execute','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','Server\x20Configuration:','\x0a\x0aShutting\x20down\x20proxy\x20server...','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','init','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','attributes','1890HUdPBN','SIGTERM','site','name','\x0aClaude\x20Code\x20Configuration:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','white','bold','Resolving\x20project...','log','12rFTDvP','59247WbSoVO','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','llm:proxy','✓\x20Proxy\x20server\x20stopped','8953bwWAii','port','green','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20\x20\x20}','NOT_FOUND','Port\x20','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20Address:','\x20\x20\x20\x20\x22env\x22:\x20{','logLevel','dim','project','14531231GsDDZA','logger','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','close','cyan','server','108346gEbikD','stop','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20Site:','\x20\x20{','llm','72umTKOl','projects'];a26_0x1b44=function(){return _0x2d8348;};return a26_0x1b44();}import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x543537,_0x2b7bb0){const _0x31b3f4=a26_0x5b58,{tdx:_0x385509,options:_0x59adbc}=_0x543537,_0x14444b=_0x2b7bb0||_0x59adbc['llmProject'];if(_0x14444b){const _0x223604=await _0x385509[_0x31b3f4(0x178)][_0x31b3f4(0x17a)](),_0x530885=_0x223604[_0x31b3f4(0x188)](_0x4e803e=>_0x4e803e[_0x31b3f4(0x192)]['name']===_0x14444b);if(!_0x530885)throw new SDKError(ErrorCode[_0x31b3f4(0x1a7)],_0x31b3f4(0x182)+_0x14444b+'\x27\x20not\x20found',undefined,{'helpText':_0x31b3f4(0x1a5)});return _0x530885['id'];}const _0x294923=await _0x385509['llm']['getOrCreateDefaultProject']();return _0x294923['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a26_0x3c7251(0x1a0);[a26_0x3c7251(0x186)]=a26_0x3c7251(0x175);[a26_0x3c7251(0x1b4)];[a26_0x3c7251(0x1b0)];async[a26_0x3c7251(0x18b)](_0x4b1b48){const _0x11bdfb=a26_0x3c7251,{tdx:_0x1d7823,options:_0x475888}=_0x4b1b48;try{const _0x4f8480=_0x475888,_0x5e80e6=_0x4f8480[_0x11bdfb(0x1a3)]||0xfa0,_0xc6bf76=_0x4f8480[_0x11bdfb(0x1ae)],_0x4de51d=await findAvailablePort(_0x5e80e6);console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x19b)));const _0x2db1e7=await getProjectIdOrDefault(_0x4b1b48,_0xc6bf76),_0x1d8eac=await _0x1d7823[_0x11bdfb(0x178)][_0x11bdfb(0x17a)](),_0x143f3c=_0x1d8eac['find'](_0x4e051e=>_0x4e051e['id']===_0x2db1e7);this[_0x11bdfb(0x1b0)]=new TDXLogger(_0x475888[_0x11bdfb(0x1ac)]),await this[_0x11bdfb(0x1b0)][_0x11bdfb(0x190)](),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x17d)));_0x4de51d!==_0x5e80e6&&console['log'](a26_0x49ac94['yellow'](_0x11bdfb(0x1a8)+_0x5e80e6+'\x20is\x20unavailable,\x20using\x20port\x20'+_0x4de51d));this[_0x11bdfb(0x1b4)]=new ProxyServer({'port':_0x4de51d,'projectId':_0x2db1e7,'tdx':_0x1d7823,'logger':this[_0x11bdfb(0x1b0)],'site':_0x475888[_0x11bdfb(0x195)]}),await this[_0x11bdfb(0x1b4)][_0x11bdfb(0x189)](),console['log'](a26_0x49ac94[_0x11bdfb(0x17c)]['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x11bdfb(0x19c)](a26_0x49ac94['yellow'](_0x11bdfb(0x18f))),console[_0x11bdfb(0x19c)](a26_0x49ac94['yellow'](_0x11bdfb(0x174))),console[_0x11bdfb(0x19c)](a26_0x49ac94['green'][_0x11bdfb(0x19a)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1b3)](_0x11bdfb(0x18d))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x1aa)),a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x183)+_0x4de51d)),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)]('\x20\x20Project:'),a26_0x49ac94['white'](_0x143f3c?.['attributes'][_0x11bdfb(0x196)]||_0x2db1e7)),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)]('\x20\x20Agents:'),a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x181))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x176)),a26_0x49ac94[_0x11bdfb(0x199)](_0x475888[_0x11bdfb(0x195)])),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1b3)](_0x11bdfb(0x197))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x19f))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x177))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x1ab))),console['log'](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x191)+_0x4de51d+'\x22,')),console[_0x11bdfb(0x19c)](a26_0x49ac94['white'](_0x11bdfb(0x198))),console[_0x11bdfb(0x19c)](a26_0x49ac94['white'](_0x11bdfb(0x1a6))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x184))),console['log'](a26_0x49ac94['cyan'](_0x11bdfb(0x185))),console['log'](a26_0x49ac94[_0x11bdfb(0x1ad)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x18c))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x1a9))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x17c)](_0x11bdfb(0x1b1)));const _0x49c09f=async()=>{const _0x426f68=_0x11bdfb;console[_0x426f68(0x19c)](a26_0x49ac94[_0x426f68(0x1ad)](_0x426f68(0x18e))),this[_0x426f68(0x1b4)]&&await this[_0x426f68(0x1b4)][_0x426f68(0x173)](),this[_0x426f68(0x1b0)]&&await this[_0x426f68(0x1b0)][_0x426f68(0x1b2)](),console[_0x426f68(0x19c)](a26_0x49ac94[_0x426f68(0x1a4)](_0x426f68(0x1a1))),process[_0x426f68(0x18a)](0x0);};return process['on'](_0x11bdfb(0x187),_0x49c09f),process['on'](_0x11bdfb(0x194),_0x49c09f),await new Promise(()=>{}),0x0;}catch(_0x51dc52){this[_0x11bdfb(0x1b4)]&&await this[_0x11bdfb(0x1b4)][_0x11bdfb(0x173)]();this['logger']&&await this[_0x11bdfb(0x1b0)][_0x11bdfb(0x1b2)]();throw _0x51dc52;}}}
@@ -2,6 +2,16 @@
2
2
  * Parent segment (audience) management commands
3
3
  */
4
4
  import { BaseCommand, type CommandContext } from './command.js';
5
+ /**
6
+ * Base class for parent segment commands that automatically handles
7
+ * legacy directory migration before command execution
8
+ */
9
+ declare abstract class BaseParentSegmentCommand extends BaseCommand {
10
+ /**
11
+ * Run the command with automatic migration of legacy directory
12
+ */
13
+ run(context: CommandContext): Promise<number>;
14
+ }
5
15
  /**
6
16
  * Parent segment list command
7
17
  * Usage:
@@ -44,7 +54,7 @@ export declare class ParentSegmentUpdateCommand extends BaseCommand {
44
54
  * Usage:
45
55
  * tdx segment parent pull <name> [-o output.yml] [-y]
46
56
  */
47
- export declare class ParentSegmentPullCommand extends BaseCommand {
57
+ export declare class ParentSegmentPullCommand extends BaseParentSegmentCommand {
48
58
  readonly name = "segment:parent:pull";
49
59
  readonly description = "Pull parent segment configuration to YAML file";
50
60
  execute(context: CommandContext): Promise<number>;
@@ -54,7 +64,7 @@ export declare class ParentSegmentPullCommand extends BaseCommand {
54
64
  * Usage:
55
65
  * tdx segment parent push <file.yml> [-y]
56
66
  */
57
- export declare class ParentSegmentPushCommand extends BaseCommand {
67
+ export declare class ParentSegmentPushCommand extends BaseParentSegmentCommand {
58
68
  readonly name = "segment:parent:push";
59
69
  readonly description = "Push parent segment configuration from YAML file";
60
70
  execute(context: CommandContext): Promise<number>;
@@ -67,7 +77,7 @@ export declare class ParentSegmentPushCommand extends BaseCommand {
67
77
  * tdx segment parent validate <file.yml> --behavior [name]
68
78
  * tdx segment parent validate <file.yml> --interval -7d
69
79
  */
70
- export declare class ParentSegmentValidateCommand extends BaseCommand {
80
+ export declare class ParentSegmentValidateCommand extends BaseParentSegmentCommand {
71
81
  readonly name = "segment:parent:validate";
72
82
  readonly description = "Validate parent segment YAML configuration and show statistics";
73
83
  execute(context: CommandContext): Promise<number>;
@@ -93,7 +103,7 @@ export declare class ParentSegmentValidateCommand extends BaseCommand {
93
103
  * tdx segment parent preview <file.yml> --behavior <name>
94
104
  * tdx segment parent preview <file.yml> --enriched
95
105
  */
96
- export declare class ParentSegmentPreviewCommand extends BaseCommand {
106
+ export declare class ParentSegmentPreviewCommand extends BaseParentSegmentCommand {
97
107
  readonly name = "segment:parent:preview";
98
108
  readonly description = "Preview sample data from parent segment YAML configuration";
99
109
  execute(context: CommandContext): Promise<number>;
@@ -112,7 +122,7 @@ export declare class ParentSegmentPreviewCommand extends BaseCommand {
112
122
  * Usage:
113
123
  * tdx parent-segment run <name> [-y]
114
124
  */
115
- export declare class ParentSegmentRunCommand extends BaseCommand {
125
+ export declare class ParentSegmentRunCommand extends BaseParentSegmentCommand {
116
126
  readonly name = "segment:parent:run";
117
127
  readonly description = "Run parent segment workflow (pushes YAML if exists)";
118
128
  execute(context: CommandContext): Promise<number>;
@@ -168,4 +178,5 @@ export declare class ParentSegmentShowCommand extends BaseCommand {
168
178
  readonly description = "Execute parent segment SQL query and show results";
169
179
  execute(context: CommandContext): Promise<number>;
170
180
  }
181
+ export {};
171
182
  //# sourceMappingURL=parent-segment-command.d.ts.map