@treasuredata/tdx 0.11.0 → 0.12.0

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 (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.d.ts +39 -5
  43. package/dist/commands/workflow-command.d.ts.map +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/commands/workflow-command.js.map +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/proxy/anthropic-adapter.js +1 -1
  60. package/dist/proxy/claude-usage-tracker.js +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/sdk/agent/agent-config.js +1 -1
  66. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/client/cdp-api-client.js +1 -1
  70. package/dist/sdk/client/endpoints.d.ts +8 -0
  71. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  72. package/dist/sdk/client/endpoints.js +1 -1
  73. package/dist/sdk/client/endpoints.js.map +1 -1
  74. package/dist/sdk/client/engage-api-client.js +1 -1
  75. package/dist/sdk/client/http-client.js +1 -1
  76. package/dist/sdk/client/llm-api-client.js +1 -1
  77. package/dist/sdk/client/rate-limiter.js +1 -1
  78. package/dist/sdk/client/td-api-client.js +1 -1
  79. package/dist/sdk/client/trino-api-client.js +1 -1
  80. package/dist/sdk/client/workflow-client.js +1 -1
  81. package/dist/sdk/connection-validator.js +1 -1
  82. package/dist/sdk/connection.js +1 -1
  83. package/dist/sdk/engage.js +1 -1
  84. package/dist/sdk/errors.d.ts +2 -0
  85. package/dist/sdk/errors.d.ts.map +1 -1
  86. package/dist/sdk/errors.js +1 -1
  87. package/dist/sdk/errors.js.map +1 -1
  88. package/dist/sdk/index.js +1 -1
  89. package/dist/sdk/io/index.js +1 -1
  90. package/dist/sdk/io/node-filesystem.js +1 -1
  91. package/dist/sdk/job.js +1 -1
  92. package/dist/sdk/journey.js +1 -1
  93. package/dist/sdk/llm/chat-cache.js +1 -1
  94. package/dist/sdk/llm/index.js +1 -1
  95. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  96. package/dist/sdk/llm/model-aliases.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  101. package/dist/sdk/segment/fields-display.js +1 -1
  102. package/dist/sdk/segment/file-discovery.js +1 -1
  103. package/dist/sdk/segment/journey-utils.js +1 -1
  104. package/dist/sdk/segment/journey-yaml.js +1 -1
  105. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  106. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/pull-workflow.js +1 -1
  108. package/dist/sdk/segment/push-workflow.js +1 -1
  109. package/dist/sdk/segment/resolution-context.js +1 -1
  110. package/dist/sdk/segment/segment-path-parser.js +1 -1
  111. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  112. package/dist/sdk/segment/target-resolution.js +1 -1
  113. package/dist/sdk/segment/tdx-config.js +1 -1
  114. package/dist/sdk/segment/validate-files.js +1 -1
  115. package/dist/sdk/segment/yaml-validator.js +1 -1
  116. package/dist/sdk/segment.js +1 -1
  117. package/dist/sdk/types/index.js +1 -1
  118. package/dist/sdk/types/progress.js +1 -1
  119. package/dist/sdk/user.js +1 -1
  120. package/dist/sdk/util/format-detector.js +1 -1
  121. package/dist/sdk/util/formatters.js +1 -1
  122. package/dist/sdk/util/index.js +1 -1
  123. package/dist/sdk/util/tree-formatter.js +1 -1
  124. package/dist/sdk/workflow/clone-workflow.d.ts +80 -0
  125. package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
  126. package/dist/sdk/workflow/clone-workflow.js +1 -0
  127. package/dist/sdk/workflow/clone-workflow.js.map +1 -0
  128. package/dist/sdk/workflow/index.d.ts +94 -0
  129. package/dist/sdk/workflow/index.d.ts.map +1 -1
  130. package/dist/sdk/workflow/index.js +1 -1
  131. package/dist/sdk/workflow/index.js.map +1 -1
  132. package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
  133. package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
  134. package/dist/sdk/workflow/pull-workflow.js +1 -0
  135. package/dist/sdk/workflow/pull-workflow.js.map +1 -0
  136. package/dist/sdk/workflow/push-workflow.d.ts +66 -0
  137. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
  138. package/dist/sdk/workflow/push-workflow.js +1 -0
  139. package/dist/sdk/workflow/push-workflow.js.map +1 -0
  140. package/dist/sdk/workflow/tdx-config.d.ts +110 -0
  141. package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
  142. package/dist/sdk/workflow/tdx-config.js +1 -0
  143. package/dist/sdk/workflow/tdx-config.js.map +1 -0
  144. package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
  145. package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
  146. package/dist/sdk/workflow/workflow-utils.js +1 -1
  147. package/dist/sdk/workflow/workflow-utils.js.map +1 -1
  148. package/dist/utils/async.js +1 -1
  149. package/dist/utils/colors.js +1 -1
  150. package/dist/utils/diff.js +1 -1
  151. package/dist/utils/file-permissions.js +1 -1
  152. package/dist/utils/json-loader.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a20_0x38cdde=a20_0x2d6f;(function(_0x3c9100,_0x5f0b11){const _0xc6e6a3=a20_0x2d6f,_0x186551=_0x3c9100();while(!![]){try{const _0x4146a2=-parseInt(_0xc6e6a3(0x117))/0x1+-parseInt(_0xc6e6a3(0x1a1))/0x2+-parseInt(_0xc6e6a3(0x1e9))/0x3+-parseInt(_0xc6e6a3(0x12f))/0x4*(-parseInt(_0xc6e6a3(0x12d))/0x5)+-parseInt(_0xc6e6a3(0x1e2))/0x6*(-parseInt(_0xc6e6a3(0x11b))/0x7)+parseInt(_0xc6e6a3(0x184))/0x8+-parseInt(_0xc6e6a3(0x18c))/0x9*(parseInt(_0xc6e6a3(0x17a))/0xa);if(_0x4146a2===_0x5f0b11)break;else _0x186551['push'](_0x186551['shift']());}catch(_0x547a16){_0x186551['push'](_0x186551['shift']());}}}(a20_0x216c,0x1b0b9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import*as a20_0x170174 from'node:fs';function handleSDKError(_0x272312,_0xed63f5){const _0x760630=a20_0x2d6f;if(_0x272312 instanceof SDKError)console['error'](_0x760630(0x130)+_0x272312[_0x760630(0x157)]),_0xed63f5['verbose']&&(_0x272312[_0x760630(0x15f)]&&console[_0x760630(0x1cd)](_0x760630(0x113)+_0x272312[_0x760630(0x15f)]),_0x272312[_0x760630(0x15a)]&&(console['error'](_0x760630(0x13a)),console[_0x760630(0x1cd)](_0x272312[_0x760630(0x15a)])));else throw _0x272312;}function formatChatHistoryEntry(_0x1d6819,_0x5d487f){const _0x4332ce=a20_0x2d6f,_0x9f102e=getChalk(_0x5d487f),_0x4d90ab=_0x9f102e['dim'](_0x1d6819['at']);if(_0x4332ce(0x134)in _0x1d6819){const _0x6c2955=_0x9f102e[_0x4332ce(0x1cf)]('[input]\x20\x20');return _0x4d90ab+'\x20'+_0x6c2955+':\x20'+_0x1d6819[_0x4332ce(0x134)];}if(_0x4332ce(0x120)in _0x1d6819){const _0x1c0586=_0x9f102e[_0x4332ce(0x17d)](_0x4332ce(0x1c8));return _0x4d90ab+'\x20'+_0x1c0586+':\x20'+_0x1d6819['content'];}if('tool_call'in _0x1d6819){const _0x38e19c=_0x9f102e[_0x4332ce(0x1d0)](_0x4332ce(0x1c4)),{functionName:_0x23cae4,functionArguments:_0x5a1a83,targetFunction:_0x5b8edc}=_0x1d6819[_0x4332ce(0x166)];let _0x44e93e=_0x4d90ab+'\x20'+_0x38e19c+':\x20'+_0x9f102e[_0x4332ce(0x1db)](_0x23cae4);if(_0x5a1a83&&Object[_0x4332ce(0x1e1)](_0x5a1a83)[_0x4332ce(0x124)]>0x0){const _0x40b267=Object[_0x4332ce(0x152)](_0x5a1a83)[_0x4332ce(0x193)](([_0x334ac4,_0xf8c7f9])=>_0x334ac4+'='+JSON[_0x4332ce(0x170)](_0xf8c7f9))[_0x4332ce(0x1f1)](',\x20');_0x44e93e+='('+_0x40b267+')';}_0x5b8edc&&(_0x44e93e+=_0x9f102e[_0x4332ce(0x18d)]('\x20['+_0x5b8edc+']'));let _0x548f41='';if(_0x1d6819['tool_call'][_0x4332ce(0x178)])_0x548f41=_0x4332ce(0x10d)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x178)][_0x4332ce(0x121)];else{if(_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1c3)])_0x548f41=_0x4332ce(0x133)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1c3)]['name'];else{if(_0x1d6819['tool_call'][_0x4332ce(0x15e)])_0x548f41=_0x4332ce(0x1c1)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x15e)][_0x4332ce(0x121)];else _0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1ca)]&&(_0x548f41='\x20->\x20ImageGen:'+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1ca)][_0x4332ce(0x121)]);}}return _0x44e93e+_0x548f41;}if('tool'in _0x1d6819){const _0x2ef799=_0x9f102e[_0x4332ce(0x1ec)]('[tool]\x20\x20\x20'),{functionName:_0x40bcdd,functionArguments:_0x3bef2a,content:_0x40b89e,newChat:_0x13ed04}=_0x1d6819[_0x4332ce(0x1ac)];let _0xb954bc=_0x4d90ab+'\x20'+_0x2ef799+':\x20'+_0x9f102e['bold'](_0x40bcdd);if(_0x3bef2a){const _0x442809=typeof _0x3bef2a===_0x4332ce(0x1a7)?_0x3bef2a:JSON[_0x4332ce(0x170)](_0x3bef2a);_0xb954bc+='('+_0x442809+')';}return _0x40b89e&&(_0xb954bc+='\x0a'+_0x9f102e[_0x4332ce(0x18d)](_0x40b89e)),_0x13ed04&&(_0xb954bc+=_0x9f102e[_0x4332ce(0x18d)](_0x4332ce(0x146)+_0x13ed04['id'])),_0xb954bc;}if('output'in _0x1d6819){const _0x45c982=_0x9f102e['blue'](_0x4332ce(0x1e7));return _0x4d90ab+'\x20'+_0x45c982+':\x20'+_0x1d6819[_0x4332ce(0x185)][_0x4332ce(0x121)]+'\x20('+_0x1d6819['output']['content'][_0x4332ce(0x124)]+_0x4332ce(0x1e5);}if(_0x4332ce(0x128)in _0x1d6819){const _0x516506=_0x9f102e['blue'](_0x4332ce(0x141)),{width:_0x212f33,height:_0x5b2b63,headerText:_0xa50c14}=_0x1d6819[_0x4332ce(0x128)],_0x2b1aa9=_0xa50c14?_0x4332ce(0x1d4)+_0xa50c14:'';return _0x4d90ab+'\x20'+_0x516506+':\x20'+_0x212f33+'x'+_0x5b2b63+_0x2b1aa9;}if(_0x4332ce(0x1cd)in _0x1d6819){const _0x5cfc9f=_0x9f102e['red'](_0x4332ce(0x111));return _0x4d90ab+'\x20'+_0x5cfc9f+':\x20'+_0x1d6819[_0x4332ce(0x1cd)];}return _0x4d90ab+'\x20'+_0x9f102e['dim'](_0x4332ce(0x1d1))+':\x20'+JSON['stringify'](_0x1d6819);}async function executeChatHistoryCommand(_0x21baf5,_0x2112bd){const _0x5c45ec=a20_0x2d6f,{options:_0x365111,args:_0x2bfce1,tdx:_0x81a6e1}=_0x21baf5,_0x35e807=_0x2bfce1[0x0],_0x375428=_0x365111,_0x16b545=_0x375428[_0x5c45ec(0x140)];try{if(_0x16b545&&_0x35e807)return console[_0x5c45ec(0x1cd)](_0x5c45ec(0x17e)),console['error'](_0x5c45ec(0x136)+_0x2112bd+'\x20--last'),0x1;if(!_0x35e807&&!_0x16b545&&_0x365111[_0x5c45ec(0x144)]!==undefined){const _0xd359bd=resolveLimit(_0x365111[_0x5c45ec(0x187)],DEFAULT_LLM_LIMIT),_0x555d38=await withSpinner(_0x5c45ec(0x1e6),()=>_0x81a6e1[_0x5c45ec(0x131)][_0x5c45ec(0x165)](_0xd359bd),{'verbose':_0x365111[_0x5c45ec(0x1be)]});return await handleSDKOutput(_0x555d38[_0x5c45ec(0x112)],_0x365111),0x0;}const _0x5c5da4=await getChatIdOrSelect(_0x81a6e1,_0x365111,_0x16b545,_0x35e807);if(!_0x5c5da4)return 0x0;return await displayChatHistory(_0x5c5da4,_0x81a6e1,_0x365111),0x0;}catch(_0x57a9b4){return handleSDKError(_0x57a9b4,_0x365111),0x1;}}async function displayChatHistory(_0x3fa4a9,_0x1c202d,_0x517152){const _0x1eef14=a20_0x2d6f,_0x1f8056=await withSpinner(_0x1eef14(0x11f)+_0x3fa4a9+_0x1eef14(0x143),()=>_0x1c202d[_0x1eef14(0x131)][_0x1eef14(0x151)](_0x3fa4a9),{'verbose':_0x517152[_0x1eef14(0x1be)]}),_0x31be4c=_0x1f8056[_0x1eef14(0x112)][_0x1eef14(0x112)]??[];if(_0x31be4c[_0x1eef14(0x124)]===0x0){console['log'](_0x1eef14(0x1d3));return;}if(_0x517152['format']!==undefined)await handleSDKOutput(_0x31be4c,_0x517152);else{const _0x36a61b=_0x31be4c[_0x1eef14(0x193)](_0x5f20a1=>formatChatHistoryEntry(_0x5f20a1,_0x517152)),_0x5aa39b=_0x36a61b[_0x1eef14(0x1f1)]('\x0a');await writeOutput(_0x5aa39b,_0x517152['output'],_0x1eef14(0x1ed));}}async function getChatIdOrSelect(_0x2a501e,_0x457f69,_0x1d4bec,_0x42b7f7){const _0x50094b=a20_0x2d6f;if(_0x42b7f7)return _0x42b7f7;if(_0x1d4bec){const _0x449910=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x2a501e['llm'][_0x50094b(0x165)](0x1),{'verbose':_0x457f69[_0x50094b(0x1be)]});if(_0x449910['data'][_0x50094b(0x124)]===0x0)return console[_0x50094b(0x1cb)](_0x50094b(0x186)),undefined;return _0x449910[_0x50094b(0x112)][0x0]['id'];}const _0x438ee5=await selectChatInteractively(_0x2a501e,_0x457f69);if(!_0x438ee5)return console['log'](_0x50094b(0x1c5)),undefined;return _0x438ee5;}async function getProjectIdOrDefault(_0x312f69){const _0xc51223=await getProjectWithName(_0x312f69);return _0xc51223['id'];}async function getProjectWithName(_0x11263c){const _0x2d85ea=a20_0x2d6f,{tdx:_0x4cebe1,options:_0x4f266b}=_0x11263c,_0x1c761d=_0x4f266b['llmProject'];if(_0x1c761d){const _0x50543d=await withSpinner(_0x2d85ea(0x1a5)+_0x1c761d+'\x27...',()=>_0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x1a9)](_0x1c761d),{'verbose':_0x4f266b[_0x2d85ea(0x1be)]});return{'id':_0x50543d['data'],'name':_0x1c761d};}const _0x1c1b21=_0x4cebe1[_0x2d85ea(0x131)]['getCurrentProject']();if(_0x1c1b21){const _0x762bdc=await _0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x1f0)](),_0x87878e=_0x762bdc['find'](_0x429abe=>_0x429abe['id']===_0x1c1b21);return{'id':_0x1c1b21,'name':_0x87878e?.[_0x2d85ea(0x159)][_0x2d85ea(0x121)]||_0x2d85ea(0x119)};}const _0x46bf49=await withSpinner(_0x2d85ea(0x12c),()=>_0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x16d)](),{'verbose':_0x4f266b[_0x2d85ea(0x1be)]});return{'id':_0x46bf49[_0x2d85ea(0x112)]['id'],'name':_0x46bf49[_0x2d85ea(0x112)][_0x2d85ea(0x159)][_0x2d85ea(0x121)]};}function toLLMProjectInfo(_0x433cd2){const _0x15e353=a20_0x2d6f;return{'name':_0x433cd2[_0x15e353(0x159)][_0x15e353(0x121)],'description':_0x433cd2['attributes'][_0x15e353(0x14b)],'createdAt':_0x433cd2[_0x15e353(0x159)][_0x15e353(0x190)],'updatedAt':_0x433cd2[_0x15e353(0x159)]['updatedAt']};}function toAgentInfo(_0x46dedf){const _0x49e301=a20_0x2d6f;return{'name':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x121)],'description':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x14b)],'prompt':truncatePrompt(_0x46dedf[_0x49e301(0x159)][_0x49e301(0x17b)]),'createdAt':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x190)],'updatedAt':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x18f)]};}function truncatePrompt(_0x32fc26){const _0x456069=a20_0x2d6f;if(!_0x32fc26)return undefined;const _0x5ca43e=0x64;if(_0x32fc26[_0x456069(0x124)]<=_0x5ca43e)return _0x32fc26;return _0x32fc26[_0x456069(0x153)](0x0,_0x5ca43e)+_0x456069(0x1ce);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a20_0x38cdde(0x14b)]='List\x20available\x20LLM\x20models';async[a20_0x38cdde(0x13c)](_0x3c8658){const _0x22cb0e=a20_0x38cdde,{options:_0xe35f46,tdx:_0x2a593e}=_0x3c8658;try{const _0x5942db=await withSpinner(_0x22cb0e(0x177),()=>_0x2a593e[_0x22cb0e(0x131)][_0x22cb0e(0x149)](),{'verbose':_0xe35f46[_0x22cb0e(0x1be)]});return await handleSDKOutput(_0x5942db[_0x22cb0e(0x112)],_0xe35f46),0x0;}catch(_0x1d7cde){return handleSDKError(_0x1d7cde,_0xe35f46),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x171);[a20_0x38cdde(0x14b)]='List\x20all\x20LLM\x20projects';async[a20_0x38cdde(0x13c)](_0x4a6380){const _0x31e496=a20_0x38cdde,{options:_0x5c0b04,args:_0x13716b,tdx:_0x23fbe0}=_0x4a6380,_0x146209=getChalk(_0x5c0b04),_0x3bf5eb=_0x5c0b04['web'],_0x4e0cf9=_0x5c0b04[_0x31e496(0x16f)];try{const _0x225c70=_0x13716b[0x0],_0x571f7e=resolveLimit(_0x5c0b04[_0x31e496(0x187)],DEFAULT_LLM_LIMIT),_0x1bf0b1=await withSpinner(_0x31e496(0x160),()=>_0x23fbe0['llm'][_0x31e496(0x1f0)](_0x571f7e),{'verbose':_0x5c0b04[_0x31e496(0x1be)]});let _0xe1ad5b=_0x1bf0b1[_0x31e496(0x112)];_0x225c70&&(_0xe1ad5b=_0x1bf0b1[_0x31e496(0x112)][_0x31e496(0x1a2)](_0x44e98b=>matchGlobPattern(_0x44e98b[_0x31e496(0x159)][_0x31e496(0x121)],_0x225c70)));const _0x6b7f37=_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x1d9)||_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x14d)||_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x1ed)||_0x5c0b04['format']===_0x31e496(0x126);if(_0x6b7f37){const _0x4f3ead=_0xe1ad5b[_0x31e496(0x193)](_0x31bf3c=>({...toLLMProjectInfo(_0x31bf3c),..._0x3bf5eb?{'url':getLLMProjectUrl(_0x4e0cf9,_0x31bf3c['id'])}:{}}));await handleSDKOutput(_0x4f3ead,_0x5c0b04);}else{const _0x1e18d1=[];if(_0xe1ad5b['length']===0x0)_0x1e18d1[_0x31e496(0x168)](_0x146209[_0x31e496(0x18d)](_0x31e496(0x19f)));else{const _0x3911cf=[..._0xe1ad5b]['sort']((_0x379338,_0x3d96f2)=>_0x379338['attributes'][_0x31e496(0x121)]['localeCompare'](_0x3d96f2[_0x31e496(0x159)]['name']));for(const _0x37cda7 of _0x3911cf){if(_0x3bf5eb){const _0x33f354=getLLMProjectUrl(_0x4e0cf9,_0x37cda7['id']);_0x1e18d1[_0x31e496(0x168)](_0x31e496(0x189)+_0x37cda7[_0x31e496(0x159)]['name']+'\x20\x20'+_0x146209[_0x31e496(0x18d)](_0x33f354));}else _0x1e18d1['push']('⚒️\x20'+_0x37cda7[_0x31e496(0x159)]['name']);}_0x1e18d1[_0x31e496(0x168)](_0x146209['dim'](_0xe1ad5b[_0x31e496(0x124)]+'\x20project(s)'));}await writeOutput(_0x1e18d1['join']('\x0a'),_0x5c0b04['output'],'table');}return 0x0;}catch(_0x311a89){return handleSDKError(_0x311a89,_0x5c0b04),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1df);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x14c);async[a20_0x38cdde(0x13c)](_0x458ccd){const _0x2ed7a7=a20_0x38cdde,{options:_0x2bf9df,args:_0x5ecad4,tdx:_0x31444c}=_0x458ccd,_0x26b377=getChalk(_0x2bf9df),_0xd12e2a=_0x2bf9df[_0x2ed7a7(0x1b0)],_0x533466=_0x2bf9df[_0x2ed7a7(0x16f)];try{const _0x523358=_0x5ecad4[0x0];let _0x5f0f91=_0x523358,_0x38e353,_0x156738;if(_0x523358&&_0x523358[_0x2ed7a7(0x12e)]('/')){const _0x363b23=_0x523358['split']('/');if(_0x363b23[_0x2ed7a7(0x124)]===0x2){const [_0x380ef9,_0x5e272b]=_0x363b23,_0x293ef9=await _0x31444c[_0x2ed7a7(0x131)]['projects'](),_0xa1f05a=_0x293ef9['find'](_0x49f47=>_0x49f47[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)]['toLowerCase']()===_0x380ef9[_0x2ed7a7(0x1c0)]());if(!_0xa1f05a)throw new SDKError(ErrorCode[_0x2ed7a7(0x10a)],'Project\x20not\x20found:\x20'+_0x380ef9,undefined,{'helpText':_0x2ed7a7(0x1a6)});_0x38e353=_0xa1f05a['id'],_0x156738=_0xa1f05a[_0x2ed7a7(0x159)]['name'],_0x5f0f91=_0x5e272b;}else throw new SDKError(ErrorCode[_0x2ed7a7(0x1ef)],'Invalid\x20path\x20syntax:\x20'+_0x523358,undefined,{'helpText':_0x2ed7a7(0x1aa)});}else{const _0x34d650=await getProjectWithName(_0x458ccd);_0x38e353=_0x34d650['id'],_0x156738=_0x34d650[_0x2ed7a7(0x121)];}const _0x1e5ec2=await withSpinner(_0x2ed7a7(0x116),()=>_0x31444c[_0x2ed7a7(0x131)]['agents'](_0x38e353),{'verbose':_0x2bf9df[_0x2ed7a7(0x1be)]});let _0xe95fa0=_0x1e5ec2[_0x2ed7a7(0x112)];_0x5f0f91&&(_0xe95fa0=_0x1e5ec2[_0x2ed7a7(0x112)]['filter'](_0x35853a=>matchGlobPattern(_0x35853a[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)],_0x5f0f91)));const _0x224b9a=_0x2bf9df['format']===_0x2ed7a7(0x1d9)||_0x2bf9df[_0x2ed7a7(0x144)]===_0x2ed7a7(0x14d)||_0x2bf9df[_0x2ed7a7(0x144)]===_0x2ed7a7(0x1ed)||_0x2bf9df[_0x2ed7a7(0x144)]==='tsv';if(_0x224b9a){const _0x1f5de5=_0xe95fa0[_0x2ed7a7(0x193)](_0x5ddddc=>({...toAgentInfo(_0x5ddddc),..._0xd12e2a?{'chatUrl':getLLMAgentChatUrl(_0x533466,_0x38e353,_0x5ddddc['id'])}:{}}));await handleSDKOutput(_0x1f5de5,_0x2bf9df);}else{const _0x48fc37=[];_0x48fc37[_0x2ed7a7(0x168)](_0x26b377[_0x2ed7a7(0x18d)]('['+_0x156738+']'));if(_0xe95fa0[_0x2ed7a7(0x124)]===0x0)_0x48fc37['push'](_0x26b377[_0x2ed7a7(0x18d)](_0x2ed7a7(0x1bc)));else{const _0x4c4ae5=[..._0xe95fa0]['sort']((_0x251e04,_0x2e542c)=>_0x251e04[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)][_0x2ed7a7(0x1bb)](_0x2e542c[_0x2ed7a7(0x159)]['name']));for(const _0x54deba of _0x4c4ae5){if(_0xd12e2a){const _0x5a95cc=getLLMAgentChatUrl(_0x533466,_0x38e353,_0x54deba['id']);_0x48fc37[_0x2ed7a7(0x168)]('🤖\x20'+_0x54deba[_0x2ed7a7(0x159)]['name']+'\x20\x20'+_0x26b377[_0x2ed7a7(0x18d)](_0x5a95cc));}else _0x48fc37['push'](_0x2ed7a7(0x11a)+_0x54deba[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)]);}_0x48fc37['push'](_0x26b377[_0x2ed7a7(0x18d)](_0xe95fa0[_0x2ed7a7(0x124)]+_0x2ed7a7(0x1b5)));}await writeOutput(_0x48fc37[_0x2ed7a7(0x1f1)]('\x0a'),_0x2bf9df['output'],_0x2ed7a7(0x1ed));}return 0x0;}catch(_0x1feabd){return handleSDKError(_0x1feabd,_0x2bf9df),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1ab);['description']=a20_0x38cdde(0x1ee);async['execute'](_0x15fdb9){const _0x216d94=a20_0x38cdde,{options:_0x3af7f6,args:_0x2ab02c,tdx:_0x38b7ac}=_0x15fdb9;if(_0x2ab02c['length']===0x0)return console[_0x216d94(0x1cd)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x216d94(0x1cd)](_0x216d94(0x142)),0x1;const _0xb93afb=_0x2ab02c[0x0];try{const _0x4f9e70=await getProjectIdOrDefault(_0x15fdb9),_0x33652b=await withSpinner('Resolving\x20agent\x20\x27'+_0xb93afb+_0x216d94(0x143),()=>_0x38b7ac[_0x216d94(0x131)][_0x216d94(0x13b)](_0xb93afb,_0x4f9e70),{'verbose':_0x3af7f6['verbose']}),_0x1f9f14=await withSpinner('Fetching\x20agent...',()=>_0x38b7ac[_0x216d94(0x131)][_0x216d94(0x1da)](_0x33652b[_0x216d94(0x112)]),{'verbose':_0x3af7f6[_0x216d94(0x1be)]});return await handleSDKOutput([_0x1f9f14['data']],_0x3af7f6),0x0;}catch(_0x2a1ef1){return handleSDKError(_0x2a1ef1,_0x3af7f6),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x174);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x14a);async['execute'](_0x4917f6){const _0x1a130c=a20_0x38cdde,{options:_0x32f2cb,args:_0x23d39a,tdx:_0x2d9636}=_0x4917f6;if(_0x23d39a[_0x1a130c(0x124)]===0x0)return console[_0x1a130c(0x1cd)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x1a130c(0x1cd)](_0x1a130c(0x139)),console[_0x1a130c(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x58aafd=_0x23d39a[0x0],_0x5bcd4d=_0x32f2cb,_0x328043=_0x5bcd4d[_0x1a130c(0x10c)],_0x24c86b=_0x5bcd4d[_0x1a130c(0x13d)]||_0x1a130c(0x19e),_0x18a224=_0x5bcd4d[_0x1a130c(0x132)],_0x208065=_0x5bcd4d[_0x1a130c(0x16b)]?Number(_0x5bcd4d[_0x1a130c(0x16b)]):undefined,_0x2695d9=_0x5bcd4d[_0x1a130c(0x19c)]?Number(_0x5bcd4d[_0x1a130c(0x19c)]):undefined;try{let _0x49768e,_0x375691;if(_0x58aafd[_0x1a130c(0x12e)]('/')){const _0x3295c2=_0x58aafd['split']('/');if(_0x3295c2[_0x1a130c(0x124)]===0x2){const [_0x44ccf9,_0x1af514]=_0x3295c2,_0x38519e=await withSpinner(_0x1a130c(0x1a5)+_0x44ccf9+_0x1a130c(0x143),()=>_0x2d9636['llm'][_0x1a130c(0x1a9)](_0x44ccf9),{'verbose':_0x32f2cb['verbose']});_0x49768e=_0x38519e[_0x1a130c(0x112)],_0x375691=_0x1af514;}else throw new SDKError(ErrorCode[_0x1a130c(0x1ef)],_0x1a130c(0x16c)+_0x58aafd,undefined,{'helpText':_0x1a130c(0x1aa)});}else _0x49768e=await getProjectIdOrDefault(_0x4917f6),_0x375691=_0x58aafd;const _0x1bbf5d=await withSpinner(_0x1a130c(0x1b4)+_0x375691+_0x1a130c(0x143),()=>_0x2d9636[_0x1a130c(0x131)][_0x1a130c(0x158)]({'name':_0x375691,'projectId':_0x49768e,'modelType':_0x24c86b,'systemPrompt':_0x328043,'starterMessage':_0x18a224,'maxToolIterations':_0x208065,'temperature':_0x2695d9}),{'verbose':_0x32f2cb[_0x1a130c(0x1be)]});return console[_0x1a130c(0x1cb)](_0x1a130c(0x1d7)+_0x1bbf5d[_0x1a130c(0x112)]['id']),await handleSDKOutput([_0x1bbf5d[_0x1a130c(0x112)]],_0x32f2cb),0x0;}catch(_0x4b9cb3){return handleSDKError(_0x4b9cb3,_0x32f2cb),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a20_0x38cdde(0x19d);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x13f);async[a20_0x38cdde(0x13c)](_0x213fec){const _0x28e599=a20_0x38cdde,{options:_0x554224,args:_0x17ae56,tdx:_0x7ab540}=_0x213fec;if(_0x17ae56[_0x28e599(0x124)]===0x0)return console[_0x28e599(0x1cd)](_0x28e599(0x1b7)),console[_0x28e599(0x1cd)](_0x28e599(0x14e)),0x1;const _0x497ef6=_0x17ae56[0x0],_0x5ed436=_0x554224,_0x23f294=_0x5ed436[_0x28e599(0x121)],_0xc064c5=_0x5ed436[_0x28e599(0x17b)],_0x5e7c72=_0x5ed436['description'],_0x5ae8d6=_0x5ed436['starterMessage'];if(!_0x23f294&&!_0xc064c5&&!_0x5e7c72&&!_0x5ae8d6)return console[_0x28e599(0x1cd)](_0x28e599(0x1e8)),console[_0x28e599(0x1cd)](_0x28e599(0x1a0)),0x1;try{const _0x4763bc=await getProjectIdOrDefault(_0x213fec),_0x4d6b18=await withSpinner(_0x28e599(0x17c)+_0x497ef6+_0x28e599(0x143),()=>_0x7ab540[_0x28e599(0x131)]['resolveAgentId'](_0x497ef6,_0x4763bc),{'verbose':_0x554224[_0x28e599(0x1be)]}),_0x458947=_0x4d6b18[_0x28e599(0x112)],_0x32b109=await withSpinner(_0x28e599(0x129),()=>_0x7ab540[_0x28e599(0x131)]['updateAgent'](_0x458947,{'name':_0x23f294,'prompt':_0xc064c5,'description':_0x5e7c72,'starterMessage':_0x5ae8d6}),{'verbose':_0x554224[_0x28e599(0x1be)]});return console[_0x28e599(0x1cb)](_0x28e599(0x1cc)+_0x32b109[_0x28e599(0x112)]['id']),await handleSDKOutput([_0x32b109[_0x28e599(0x112)]],_0x554224),0x0;}catch(_0x2130b1){return handleSDKError(_0x2130b1,_0x554224),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']='llm:agent:delete';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x150);async[a20_0x38cdde(0x13c)](_0x28c005){const _0x2681f3=a20_0x38cdde,{options:_0x413542,args:_0xea832a,tdx:_0x3a1229}=_0x28c005;if(_0xea832a['length']===0x0)return console[_0x2681f3(0x1cd)](_0x2681f3(0x1b7)),console[_0x2681f3(0x1cd)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x1dfa80=_0xea832a[0x0];try{const _0x4b2c3a=await getProjectIdOrDefault(_0x28c005),_0x5b501e=await withSpinner(_0x2681f3(0x17c)+_0x1dfa80+_0x2681f3(0x143),()=>_0x3a1229['llm'][_0x2681f3(0x13b)](_0x1dfa80,_0x4b2c3a),{'verbose':_0x413542[_0x2681f3(0x1be)]}),_0xa26428=_0x5b501e[_0x2681f3(0x112)];return await withSpinner('Deleting\x20agent...',()=>_0x3a1229['llm'][_0x2681f3(0x10e)](_0xa26428),{'verbose':_0x413542[_0x2681f3(0x1be)]}),console[_0x2681f3(0x1cb)](_0x2681f3(0x118)+_0xa26428),0x0;}catch(_0x134423){return handleSDKError(_0x134423,_0x413542),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a20_0x38cdde(0x110);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x109);async[a20_0x38cdde(0x13c)](_0x3821e7){const _0x50b5d6=a20_0x38cdde;return executeChatHistoryCommand(_0x3821e7,_0x50b5d6(0x13e));}}export class LLMUseCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x15b);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1b6);async[a20_0x38cdde(0x13c)](_0x4b0df5){const _0x291bf7=a20_0x38cdde,{options:_0x2c264d,args:_0x4196a7,tdx:_0x4bd244}=_0x4b0df5;if(_0x4196a7[_0x291bf7(0x124)]===0x0)return console[_0x291bf7(0x1cd)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x291bf7(0x12a)),0x1;const _0x4e5caf=_0x4196a7[0x0];try{return await withSpinner(_0x291bf7(0x122)+_0x4e5caf+_0x291bf7(0x143),()=>_0x4bd244[_0x291bf7(0x131)][_0x291bf7(0x169)](_0x4e5caf),{'verbose':_0x2c264d['verbose']}),console[_0x291bf7(0x1cb)](_0x291bf7(0x1e0)+_0x4e5caf),0x0;}catch(_0x34548f){return handleSDKError(_0x34548f,_0x2c264d),0x1;}}}function a20_0x216c(){const _0x533810=['createdAt','A\x20project\x20named\x20\x27','.llm','map','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','__load_more__','Restore\x20cancelled.','tdx\x20chats','Delete\x20an\x20LLM\x20project','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','\x27\x20already\x20exists.\x20Overwrite?','temperature','llm:agent:update','claude-4.5-haiku','No\x20projects\x20found','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','48288CYupSm','filter','find','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','Resolving\x20project\x20\x27','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','string','set','resolveProjectId','Use\x20format:\x20project-name/agent-name','llm:agent:show','tool','Validating\x20backup\x20from\x20\x27','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','web','createProject','split','chatId','Creating\x20agent\x20\x27','\x20agent(s)','Set\x20current\x20project\x20context','Error:\x20Agent\x20name\x20is\x20required','prompts','integrations','Project\x20restored:\x20','localeCompare','No\x20agents\x20found','toLocaleDateString','verbose','llm:project:create','toLowerCase','\x20->\x20WebSearch:','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','targetAgent','[tool_call]','\x0aCancelled','Project\x20deleted:\x20','get','[content]','Restoring\x20project\x20from\x20\x27','targetImageGenerator','log','Agent\x20updated:\x20','error','...','cyan','yellow','[unknown]','agents','No\x20messages\x20found\x20in\x20chat\x20history.','\x20-\x20','Backing\x20up\x20project\x20\x27','rmSync','Agent\x20created:\x20','\x20\x20Integrations:\x20','json','agent','bold','getTime','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','counts','llm:agents','Project\x20context\x20set\x20to:\x20','keys','18BBAyjJ','outputDir','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','\x20bytes)','Fetching\x20chat\x20sessions...','[output]\x20','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','115887luOXZb','en-US','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','magenta','table','Show\x20agent\x20details','INVALID_ARGUMENT','projects','join','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','LLM_PROJECT_NOT_FOUND','\x20\x20Knowledge\x20Bases:\x20','systemPrompt','\x20->\x20KB:','deleteAgent','Analyzing\x20project\x20\x27','llm:history','[error]\x20\x20','data','\x20\x20Cause:\x20','Creating\x20project\x20\x27','d\x20ago','Fetching\x20agents...','193450OzRBrP','Agent\x20deleted:\x20','Unknown','🤖\x20','21245orOfig','Deleting\x20project\x20\x27','lastConversationAt','knowledgeBases','Fetching\x20chat\x20history\x20for\x20\x27','content','name','Setting\x20project\x20context\x20to\x20\x27','Checking\x20for\x20existing\x20projects...','length','all','tsv','\x20\x20Agents:\x20','image','Updating\x20agent...','Usage:\x20tdx\x20llm\x20use\x20<project-name>','deleteProject','Getting\x20default\x20project...','5zBtGTX','includes','633164EnfhHB','Error:\x20','llm','starterMessage','\x20->\x20Agent:','input','exportedFrom','Usage:\x20','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','sourceSite','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x0aStack\x20trace:','resolveAgentId','execute','model','tdx\x20llm\x20history','Update\x20an\x20existing\x20agent','last','[image]\x20\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x27...','format','default','\x20→\x20chat:\x20','Create\x20a\x20new\x20LLM\x20project','m\x20ago','models','Create\x20a\x20new\x20agent\x20in\x20current\x20project','description','List\x20agents\x20in\x20current\x20project','jsonl','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Delete\x20an\x20agent','history','entries','slice','h\x20ago','llm:project:restore','Project\x20created:\x20','message','createAgent','attributes','stack','llm:use','just\x20now','select','targetWebSearchTool','cause','Fetching\x20projects...','\x20\x20Prompts:\x20','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','(no\x20agent)','chats','tool_call','backupProject','push','setCurrentProject','Project\x20backed\x20up\x20to:\x20','maxToolIterations','Invalid\x20path\x20syntax:\x20','getOrCreateDefaultProject','substring','site','stringify','llm:projects','dryRun','(no\x20message)','llm:agent:create','restoreProject','floor','Fetching\x20available\x20models...','targetKnowledgeBase','Select\x20a\x20chat\x20session:','9910OjyoAg','prompt','Resolving\x20agent\x20\x27','green','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','projectName','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','getBackupMetadata','projectId','existsSync','1771248FWiywM','output','No\x20chat\x20sessions\x20found.','limit','Load\x20more...','⚒️\x20','Error:\x20Backup\x20folder\x20path\x20is\x20required','agentId','198sAbbkB','dim','\x20\x20\x20Examples:','updatedAt'];a20_0x216c=function(){return _0x533810;};return a20_0x216c();}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1bf);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x147);async[a20_0x38cdde(0x13c)](_0x54528e){const _0x3787c3=a20_0x38cdde,{options:_0x5c5d2d,args:_0xe9207b,tdx:_0x49b336}=_0x54528e;if(_0xe9207b[_0x3787c3(0x124)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x3787c3(0x1cd)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x555351=_0xe9207b[0x0],_0xbcc1f0=_0x5c5d2d,_0x50e4ba=_0xbcc1f0[_0x3787c3(0x14b)];try{const _0x506537=await withSpinner(_0x3787c3(0x114)+_0x555351+_0x3787c3(0x143),()=>_0x49b336[_0x3787c3(0x131)][_0x3787c3(0x1b1)]({'name':_0x555351,'description':_0x50e4ba}),{'verbose':_0x5c5d2d[_0x3787c3(0x1be)]});console[_0x3787c3(0x1cb)](_0x3787c3(0x156)+_0x506537[_0x3787c3(0x112)]['id']);const _0x4c3c40=toLLMProjectInfo(_0x506537[_0x3787c3(0x112)]);return await handleSDKOutput([_0x4c3c40],_0x5c5d2d),0x0;}catch(_0x3bd8a5){return handleSDKError(_0x3bd8a5,_0x5c5d2d),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x38cdde(0x121)]='llm:project:delete';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x198);async['execute'](_0xfe2a56){const _0x230e4e=a20_0x38cdde,{options:_0x50bb12,args:_0x227006,tdx:_0x51ebec}=_0xfe2a56;if(_0x227006[_0x230e4e(0x124)]===0x0)return console[_0x230e4e(0x1cd)](_0x230e4e(0x1ae)),console[_0x230e4e(0x1cd)](_0x230e4e(0x163)),0x1;const _0x2c013c=_0x227006[0x0];try{return await withSpinner(_0x230e4e(0x11c)+_0x2c013c+_0x230e4e(0x143),()=>_0x51ebec[_0x230e4e(0x131)][_0x230e4e(0x12b)](_0x2c013c),{'verbose':_0x50bb12[_0x230e4e(0x1be)]}),console[_0x230e4e(0x1cb)](_0x230e4e(0x1c6)+_0x2c013c),0x0;}catch(_0x32bb98){return handleSDKError(_0x32bb98,_0x50bb12),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x38cdde(0x121)]='llm:project:backup';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1a4);async[a20_0x38cdde(0x13c)](_0x29f9d7){const _0x4a869e=a20_0x38cdde,{options:_0x31a55a,args:_0x20a2c9,tdx:_0x2335cf}=_0x29f9d7,_0x46adf7=getChalk(_0x31a55a);console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x1d0)](_0x4a869e(0x180))),console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x1d0)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x18d)]('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console[_0x4a869e(0x1cb)]();if(_0x20a2c9[_0x4a869e(0x124)]===0x0)return console[_0x4a869e(0x1cd)](_0x4a869e(0x1ae)),console['error'](_0x4a869e(0x1af)),0x1;const _0x135326=_0x20a2c9[0x0],_0x4cf6a9=_0x31a55a,_0x1bf435=_0x4cf6a9[_0x4a869e(0x185)],_0x4af889=_0x4cf6a9['dryRun'];try{const _0x5596b0=_0x1bf435||_0x135326+_0x4a869e(0x192);if(a20_0x170174[_0x4a869e(0x183)](_0x5596b0)&&!_0x4af889){if(!_0x31a55a['yes']){const _0x51e760=await confirm('Output\x20directory\x20\x27'+_0x5596b0+_0x4a869e(0x19b));if(!_0x51e760)return console[_0x4a869e(0x1cb)]('Backup\x20cancelled.'),0x0;}a20_0x170174[_0x4a869e(0x1d6)](_0x5596b0,{'recursive':!![]});}const _0x3040b6=await withSpinner(_0x4af889?_0x4a869e(0x10f)+_0x135326+'\x27...':_0x4a869e(0x1d5)+_0x135326+_0x4a869e(0x143),()=>_0x2335cf[_0x4a869e(0x131)][_0x4a869e(0x167)](_0x135326,_0x1bf435,{'dryRun':_0x4af889}),{'verbose':_0x31a55a[_0x4a869e(0x1be)]}),_0x44fcd9=_0x3040b6[_0x4a869e(0x112)];return _0x4af889?console[_0x4a869e(0x1cb)](_0x4a869e(0x194)+_0x44fcd9['outputDir']):console[_0x4a869e(0x1cb)](_0x4a869e(0x16a)+_0x44fcd9[_0x4a869e(0x1e3)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x127)+_0x44fcd9['counts'][_0x4a869e(0x1d2)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x10b)+_0x44fcd9[_0x4a869e(0x1de)]['knowledgeBases']),console['log'](_0x4a869e(0x161)+_0x44fcd9['counts'][_0x4a869e(0x1b8)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x1d8)+_0x44fcd9[_0x4a869e(0x1de)][_0x4a869e(0x1b9)]),(_0x31a55a[_0x4a869e(0x144)]==='json'||_0x31a55a['format']===_0x4a869e(0x14d))&&await handleSDKOutput([_0x44fcd9],_0x31a55a),0x0;}catch(_0x1e4f02){return handleSDKError(_0x1e4f02,_0x31a55a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x155);['description']=a20_0x38cdde(0x137);async[a20_0x38cdde(0x13c)](_0x4ec218){const _0x217696=a20_0x38cdde,{options:_0x43bbc8,args:_0x580962,tdx:_0x4145bd}=_0x4ec218,_0x1ce71a=getChalk(_0x43bbc8);console[_0x217696(0x1cb)](_0x1ce71a['yellow'](_0x217696(0x19a))),console[_0x217696(0x1cb)](_0x1ce71a[_0x217696(0x1d0)](_0x217696(0x1dd))),console[_0x217696(0x1cb)](_0x1ce71a['dim'](_0x217696(0x18e))),console['log'](_0x1ce71a[_0x217696(0x18d)]('\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/')),console[_0x217696(0x1cb)](_0x1ce71a['dim'](_0x217696(0x1e4))),console[_0x217696(0x1cb)]();if(_0x580962['length']===0x0)return console['error'](_0x217696(0x18a)),console['error'](_0x217696(0x199)),0x1;const _0x1ec762=_0x580962[0x0],_0x23e317=_0x43bbc8,_0x59068c=_0x23e317[_0x217696(0x121)],_0x540631=_0x23e317[_0x217696(0x172)];try{if(!_0x540631){const _0x3d210f=_0x4145bd['llm'][_0x217696(0x181)](_0x1ec762),_0x38e2cc=_0x59068c||_0x3d210f[_0x217696(0x135)][_0x217696(0x17f)],_0x25c35e=await withSpinner(_0x217696(0x123),()=>_0x4145bd[_0x217696(0x131)][_0x217696(0x1f0)](),{'verbose':_0x43bbc8['verbose']}),_0xa4262a=_0x25c35e['data'][_0x217696(0x1a3)](_0x3e9112=>_0x3e9112['attributes'][_0x217696(0x121)]===_0x38e2cc);if(_0xa4262a&&!_0x43bbc8['yes']){const _0x24f141=await confirm(_0x217696(0x191)+_0x38e2cc+_0x217696(0x162));if(!_0x24f141)return console[_0x217696(0x1cb)](_0x217696(0x196)),0x0;}}const _0x3aed49=await withSpinner(_0x540631?_0x217696(0x1ad)+_0x1ec762+_0x217696(0x143):_0x217696(0x1c9)+_0x1ec762+'\x27...',()=>_0x4145bd[_0x217696(0x131)][_0x217696(0x175)](_0x1ec762,{'name':_0x59068c,'dryRun':_0x540631}),{'verbose':_0x43bbc8[_0x217696(0x1be)]}),_0x1e1600=_0x3aed49[_0x217696(0x112)];return _0x1e1600[_0x217696(0x138)]&&console[_0x217696(0x1cb)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x1e1600[_0x217696(0x138)]+'\x27'),_0x540631?console[_0x217696(0x1cb)](_0x217696(0x14f)+_0x1e1600[_0x217696(0x17f)]):console[_0x217696(0x1cb)](_0x217696(0x1ba)+_0x1e1600[_0x217696(0x17f)]+'\x20('+_0x1e1600[_0x217696(0x182)]+')'),console[_0x217696(0x1cb)](_0x217696(0x127)+_0x1e1600['counts'][_0x217696(0x1d2)]),console[_0x217696(0x1cb)](_0x217696(0x10b)+_0x1e1600[_0x217696(0x1de)][_0x217696(0x11e)]),console[_0x217696(0x1cb)](_0x217696(0x161)+_0x1e1600['counts']['prompts']),console[_0x217696(0x1cb)](_0x217696(0x1d8)+_0x1e1600[_0x217696(0x1de)]['integrations']),(_0x43bbc8['format']===_0x217696(0x1d9)||_0x43bbc8[_0x217696(0x144)]===_0x217696(0x14d))&&await handleSDKOutput([_0x1e1600],_0x43bbc8),0x0;}catch(_0x55b662){return handleSDKError(_0x55b662,_0x43bbc8),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x234115,_0x5bd5ea){const _0x647071=a20_0x38cdde,_0x3f1ce9=_0x5bd5ea[_0x647071(0x187)]||CHAT_SELECTOR_PAGE_SIZE;let _0x5a14f2=0x0,_0x25a2be=[];const _0x94be93=(await import(_0x647071(0x1b8)))[_0x647071(0x145)],_0x1b0a03=getChalk(_0x5bd5ea);while(!![]){const _0x4bade3=await withSpinner(_0x647071(0x1e6),()=>_0x234115[_0x647071(0x131)][_0x647071(0x165)](_0x3f1ce9+_0x5a14f2),{'verbose':_0x5bd5ea[_0x647071(0x1be)]});_0x25a2be=_0x4bade3['data'];const _0x30a81f=_0x25a2be[_0x647071(0x153)](_0x5a14f2,_0x5a14f2+_0x3f1ce9),_0x5980be=_0x25a2be[_0x647071(0x124)]>_0x5a14f2+_0x3f1ce9,_0xe5ea1f=[...new Set(_0x30a81f[_0x647071(0x193)](_0x4e765f=>_0x4e765f[_0x647071(0x159)][_0x647071(0x18b)])['filter'](_0x40b443=>_0x40b443!==undefined))],_0x107347=new Map();await Promise[_0x647071(0x125)](_0xe5ea1f['map'](async _0x4705ea=>{const _0x3bb1ac=_0x647071;try{const _0x28f9c4=await _0x234115[_0x3bb1ac(0x131)][_0x3bb1ac(0x1da)](_0x4705ea);_0x107347[_0x3bb1ac(0x1a8)](_0x4705ea,_0x28f9c4[_0x3bb1ac(0x159)][_0x3bb1ac(0x121)]);}catch{_0x107347['set'](_0x4705ea,_0x4705ea);}}));const _0x3bdf4a=_0x30a81f[_0x647071(0x193)](_0x1f6d06=>{const _0x1ebde0=_0x647071,_0x14053f=_0x1f6d06[_0x1ebde0(0x159)]['firstInputContent']||_0x1ebde0(0x173),_0x32b7b8=_0x14053f[_0x1ebde0(0x1b2)]('\x0a')[0x0],_0x372ef5=_0x32b7b8['length']>0x50?_0x32b7b8[_0x1ebde0(0x16e)](0x0,0x4d)+_0x1ebde0(0x1ce):_0x32b7b8,_0x2d8c79=_0x1f6d06['attributes'][_0x1ebde0(0x18b)]?_0x107347[_0x1ebde0(0x1c7)](_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18b)])||_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18b)]:_0x1ebde0(0x164),_0x415ac=_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x11d)]||_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18f)],_0xd6bee7=new Date(_0x415ac),_0x3fe778=new Date(),_0x36ae05=_0x3fe778[_0x1ebde0(0x1dc)]()-_0xd6bee7[_0x1ebde0(0x1dc)](),_0x8fae6d=Math[_0x1ebde0(0x176)](_0x36ae05/0xea60),_0x3a3d2f=Math[_0x1ebde0(0x176)](_0x36ae05/0x36ee80),_0x3ed301=Math[_0x1ebde0(0x176)](_0x36ae05/0x5265c00);let _0x2b60f1;if(_0x8fae6d<0x1)_0x2b60f1=_0x1ebde0(0x15c);else{if(_0x8fae6d<0x3c)_0x2b60f1=_0x8fae6d+_0x1ebde0(0x148);else{if(_0x3a3d2f<0x18)_0x2b60f1=_0x3a3d2f+_0x1ebde0(0x154);else _0x3ed301<0x7?_0x2b60f1=_0x3ed301+_0x1ebde0(0x115):_0x2b60f1=_0xd6bee7[_0x1ebde0(0x1bd)](_0x1ebde0(0x1ea),{'month':'short','day':'numeric'});}}return{'title':_0x372ef5+'\x20'+_0x1b0a03['dim']('['+_0x2d8c79+']\x20'+_0x2b60f1),'value':_0x1f6d06['id']};});_0x5980be&&_0x3bdf4a[_0x647071(0x168)]({'title':_0x1b0a03[_0x647071(0x1cf)](_0x647071(0x188)),'value':_0x647071(0x195)});const _0x5ec6c3=await _0x94be93({'type':_0x647071(0x15d),'name':_0x647071(0x1b3),'message':_0x647071(0x179),'choices':_0x3bdf4a,'hint':_0x647071(0x1c2)});if(!_0x5ec6c3[_0x647071(0x1b3)])return undefined;if(_0x5ec6c3[_0x647071(0x1b3)]===_0x647071(0x195)){_0x5a14f2+=_0x3f1ce9;continue;}return _0x5ec6c3[_0x647071(0x1b3)];}}function a20_0x2d6f(_0x162537,_0x32f3e5){_0x162537=_0x162537-0x109;const _0x216c5f=a20_0x216c();let _0x2d6f87=_0x216c5f[_0x162537];return _0x2d6f87;}export class ChatsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x165);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1eb);async[a20_0x38cdde(0x13c)](_0x21ac8a){const _0x5389e5=a20_0x38cdde;return executeChatHistoryCommand(_0x21ac8a,_0x5389e5(0x197));}}
1
+ const a20_0x56bc32=a20_0x340b;(function(_0xcd8e48,_0x2a8e93){const _0xcbb42f=a20_0x340b,_0x3a1ef4=_0xcd8e48();while(!![]){try{const _0x19266a=parseInt(_0xcbb42f(0x1d7))/0x1*(parseInt(_0xcbb42f(0x167))/0x2)+parseInt(_0xcbb42f(0x1d8))/0x3*(parseInt(_0xcbb42f(0x17b))/0x4)+parseInt(_0xcbb42f(0x1ee))/0x5+-parseInt(_0xcbb42f(0x1b0))/0x6*(-parseInt(_0xcbb42f(0x15d))/0x7)+parseInt(_0xcbb42f(0x1d4))/0x8*(parseInt(_0xcbb42f(0x221))/0x9)+-parseInt(_0xcbb42f(0x1eb))/0xa+-parseInt(_0xcbb42f(0x19b))/0xb*(parseInt(_0xcbb42f(0x18c))/0xc);if(_0x19266a===_0x2a8e93)break;else _0x3a1ef4['push'](_0x3a1ef4['shift']());}catch(_0xab9364){_0x3a1ef4['push'](_0x3a1ef4['shift']());}}}(a20_0x5dae,0xc65d2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import*as a20_0x4b500b from'node:fs';function handleSDKError(_0x440e79,_0x4afc2b){const _0x5c376e=a20_0x340b;if(_0x440e79 instanceof SDKError)console[_0x5c376e(0x1c3)]('Error:\x20'+_0x440e79['message']),_0x4afc2b[_0x5c376e(0x1aa)]&&(_0x440e79[_0x5c376e(0x1af)]&&console[_0x5c376e(0x1c3)](_0x5c376e(0x210)+_0x440e79['cause']),_0x440e79[_0x5c376e(0x15b)]&&(console['error'](_0x5c376e(0x17a)),console['error'](_0x440e79[_0x5c376e(0x15b)])));else throw _0x440e79;}function formatChatHistoryEntry(_0x588c79,_0x2c5c44){const _0x3cf682=a20_0x340b,_0x3cd5c0=getChalk(_0x2c5c44),_0x71a6a2=_0x3cd5c0[_0x3cf682(0x20a)](_0x588c79['at']);if(_0x3cf682(0x1ce)in _0x588c79){const _0x47b78b=_0x3cd5c0[_0x3cf682(0x223)](_0x3cf682(0x180));return _0x71a6a2+'\x20'+_0x47b78b+':\x20'+_0x588c79['input'];}if('content'in _0x588c79){const _0xb2ff8a=_0x3cd5c0[_0x3cf682(0x1b5)]('[content]');return _0x71a6a2+'\x20'+_0xb2ff8a+':\x20'+_0x588c79[_0x3cf682(0x18f)];}if('tool_call'in _0x588c79){const _0x2bef91=_0x3cd5c0[_0x3cf682(0x207)](_0x3cf682(0x1e7)),{functionName:_0x1105ee,functionArguments:_0x32edaf,targetFunction:_0x4a636e}=_0x588c79[_0x3cf682(0x228)];let _0x8a6c25=_0x71a6a2+'\x20'+_0x2bef91+':\x20'+_0x3cd5c0[_0x3cf682(0x172)](_0x1105ee);if(_0x32edaf&&Object[_0x3cf682(0x184)](_0x32edaf)[_0x3cf682(0x212)]>0x0){const _0x4dfdc6=Object[_0x3cf682(0x1df)](_0x32edaf)[_0x3cf682(0x19f)](([_0x1b48f1,_0x15067a])=>_0x1b48f1+'='+JSON['stringify'](_0x15067a))[_0x3cf682(0x220)](',\x20');_0x8a6c25+='('+_0x4dfdc6+')';}_0x4a636e&&(_0x8a6c25+=_0x3cd5c0[_0x3cf682(0x20a)]('\x20['+_0x4a636e+']'));let _0x52b6ec='';if(_0x588c79[_0x3cf682(0x228)][_0x3cf682(0x194)])_0x52b6ec='\x20->\x20KB:'+_0x588c79[_0x3cf682(0x228)][_0x3cf682(0x194)][_0x3cf682(0x168)];else{if(_0x588c79[_0x3cf682(0x228)][_0x3cf682(0x1dd)])_0x52b6ec=_0x3cf682(0x159)+_0x588c79[_0x3cf682(0x228)]['targetAgent'][_0x3cf682(0x168)];else{if(_0x588c79['tool_call'][_0x3cf682(0x1a7)])_0x52b6ec=_0x3cf682(0x16b)+_0x588c79[_0x3cf682(0x228)][_0x3cf682(0x1a7)][_0x3cf682(0x168)];else _0x588c79[_0x3cf682(0x228)][_0x3cf682(0x1bd)]&&(_0x52b6ec=_0x3cf682(0x1ca)+_0x588c79[_0x3cf682(0x228)]['targetImageGenerator'][_0x3cf682(0x168)]);}}return _0x8a6c25+_0x52b6ec;}if(_0x3cf682(0x22a)in _0x588c79){const _0x146dd9=_0x3cd5c0[_0x3cf682(0x1e2)](_0x3cf682(0x1a8)),{functionName:_0x5607a4,functionArguments:_0x284800,content:_0x476a64,newChat:_0x1c0358}=_0x588c79[_0x3cf682(0x22a)];let _0x35bcfa=_0x71a6a2+'\x20'+_0x146dd9+':\x20'+_0x3cd5c0[_0x3cf682(0x172)](_0x5607a4);if(_0x284800){const _0x3cc507=typeof _0x284800===_0x3cf682(0x19e)?_0x284800:JSON[_0x3cf682(0x1e8)](_0x284800);_0x35bcfa+='('+_0x3cc507+')';}return _0x476a64&&(_0x35bcfa+='\x0a'+_0x3cd5c0[_0x3cf682(0x20a)](_0x476a64)),_0x1c0358&&(_0x35bcfa+=_0x3cd5c0[_0x3cf682(0x20a)](_0x3cf682(0x154)+_0x1c0358['id'])),_0x35bcfa;}if(_0x3cf682(0x1f7)in _0x588c79){const _0x1d187b=_0x3cd5c0['blue'](_0x3cf682(0x203));return _0x71a6a2+'\x20'+_0x1d187b+':\x20'+_0x588c79['output'][_0x3cf682(0x168)]+'\x20('+_0x588c79['output'][_0x3cf682(0x18f)][_0x3cf682(0x212)]+_0x3cf682(0x219);}if('image'in _0x588c79){const _0x4b8a4d=_0x3cd5c0['blue']('[image]\x20\x20'),{width:_0x3072b9,height:_0x554e64,headerText:_0x2ae553}=_0x588c79[_0x3cf682(0x18b)],_0x16a381=_0x2ae553?'\x20-\x20'+_0x2ae553:'';return _0x71a6a2+'\x20'+_0x4b8a4d+':\x20'+_0x3072b9+'x'+_0x554e64+_0x16a381;}if(_0x3cf682(0x1c3)in _0x588c79){const _0x2d1fc4=_0x3cd5c0[_0x3cf682(0x1fb)]('[error]\x20\x20');return _0x71a6a2+'\x20'+_0x2d1fc4+':\x20'+_0x588c79[_0x3cf682(0x1c3)];}return _0x71a6a2+'\x20'+_0x3cd5c0['dim'](_0x3cf682(0x21d))+':\x20'+JSON[_0x3cf682(0x1e8)](_0x588c79);}async function executeChatHistoryCommand(_0x1e998a,_0x555c94){const _0x4e1408=a20_0x340b,{options:_0xcdb44d,args:_0x327a7b,tdx:_0x3134af}=_0x1e998a,_0x2f76df=_0x327a7b[0x0],_0x3bb4a4=_0xcdb44d,_0x1173e7=_0x3bb4a4[_0x4e1408(0x1bf)];try{if(_0x1173e7&&_0x2f76df)return console['error'](_0x4e1408(0x21b)),console[_0x4e1408(0x1c3)]('Usage:\x20'+_0x555c94+_0x4e1408(0x1b9)),0x1;if(!_0x2f76df&&!_0x1173e7&&_0xcdb44d[_0x4e1408(0x1cd)]!==undefined){const _0x3a9148=resolveLimit(_0xcdb44d[_0x4e1408(0x1ed)],DEFAULT_LLM_LIMIT),_0x3ad4d5=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x3134af[_0x4e1408(0x15e)][_0x4e1408(0x1c5)](_0x3a9148),{'verbose':_0xcdb44d[_0x4e1408(0x1aa)]});return await handleSDKOutput(_0x3ad4d5[_0x4e1408(0x1bb)],_0xcdb44d),0x0;}const _0x5c286f=await getChatIdOrSelect(_0x3134af,_0xcdb44d,_0x1173e7,_0x2f76df);if(!_0x5c286f)return 0x0;return await displayChatHistory(_0x5c286f,_0x3134af,_0xcdb44d),0x0;}catch(_0x14ba1d){return handleSDKError(_0x14ba1d,_0xcdb44d),0x1;}}async function displayChatHistory(_0x58733e,_0xb57929,_0xf24d32){const _0x2f4700=a20_0x340b,_0x388676=await withSpinner(_0x2f4700(0x1f5)+_0x58733e+'\x27...',()=>_0xb57929[_0x2f4700(0x15e)]['history'](_0x58733e),{'verbose':_0xf24d32['verbose']}),_0x578414=_0x388676[_0x2f4700(0x1bb)][_0x2f4700(0x1bb)]??[];if(_0x578414[_0x2f4700(0x212)]===0x0){console['log'](_0x2f4700(0x1a2));return;}if(_0xf24d32[_0x2f4700(0x1cd)]!==undefined)await handleSDKOutput(_0x578414,_0xf24d32);else{const _0x31a43a=_0x578414[_0x2f4700(0x19f)](_0xe2a101=>formatChatHistoryEntry(_0xe2a101,_0xf24d32)),_0x581ffa=_0x31a43a[_0x2f4700(0x220)]('\x0a');await writeOutput(_0x581ffa,_0xf24d32['output'],_0x2f4700(0x1f3));}}async function getChatIdOrSelect(_0x13d8e0,_0x4f4692,_0x2cb263,_0x5bb8a8){const _0x3d59d6=a20_0x340b;if(_0x5bb8a8)return _0x5bb8a8;if(_0x2cb263){const _0x1b94e1=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x13d8e0[_0x3d59d6(0x15e)][_0x3d59d6(0x1c5)](0x1),{'verbose':_0x4f4692['verbose']});if(_0x1b94e1[_0x3d59d6(0x1bb)]['length']===0x0)return console[_0x3d59d6(0x1fd)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x1b94e1[_0x3d59d6(0x1bb)][0x0]['id'];}const _0x115715=await selectChatInteractively(_0x13d8e0,_0x4f4692);if(!_0x115715)return console[_0x3d59d6(0x1fd)](_0x3d59d6(0x16c)),undefined;return _0x115715;}async function getProjectIdOrDefault(_0x1b212c){const _0x5a2185=await getProjectWithName(_0x1b212c);return _0x5a2185['id'];}async function getProjectWithName(_0x18aaf1){const _0x47f809=a20_0x340b,{tdx:_0x699a8d,options:_0x29eaff}=_0x18aaf1,_0x27c2ee=_0x29eaff[_0x47f809(0x218)];if(_0x27c2ee){const _0x4b3cdd=await withSpinner('Resolving\x20project\x20\x27'+_0x27c2ee+_0x47f809(0x163),()=>_0x699a8d['llm'][_0x47f809(0x1ab)](_0x27c2ee),{'verbose':_0x29eaff[_0x47f809(0x1aa)]});return{'id':_0x4b3cdd[_0x47f809(0x1bb)],'name':_0x27c2ee};}const _0x42bb46=_0x699a8d[_0x47f809(0x15e)][_0x47f809(0x183)]();if(_0x42bb46){const _0x10aed9=await _0x699a8d['llm']['projects'](),_0xebd6d4=_0x10aed9[_0x47f809(0x189)](_0x2df989=>_0x2df989['id']===_0x42bb46);return{'id':_0x42bb46,'name':_0xebd6d4?.['attributes'][_0x47f809(0x168)]||_0x47f809(0x205)};}const _0x2b867b=await withSpinner('Getting\x20default\x20project...',()=>_0x699a8d[_0x47f809(0x15e)][_0x47f809(0x21e)](),{'verbose':_0x29eaff[_0x47f809(0x1aa)]});return{'id':_0x2b867b['data']['id'],'name':_0x2b867b['data'][_0x47f809(0x22b)][_0x47f809(0x168)]};}function toLLMProjectInfo(_0x475192){const _0x5a0e43=a20_0x340b;return{'name':_0x475192['attributes'][_0x5a0e43(0x168)],'description':_0x475192[_0x5a0e43(0x22b)][_0x5a0e43(0x20b)],'createdAt':_0x475192[_0x5a0e43(0x22b)]['createdAt'],'updatedAt':_0x475192[_0x5a0e43(0x22b)][_0x5a0e43(0x202)]};}function toAgentInfo(_0x242282){const _0x11bbc4=a20_0x340b;return{'name':_0x242282[_0x11bbc4(0x22b)]['name'],'description':_0x242282[_0x11bbc4(0x22b)]['description'],'prompt':truncatePrompt(_0x242282[_0x11bbc4(0x22b)][_0x11bbc4(0x214)]),'createdAt':_0x242282[_0x11bbc4(0x22b)]['createdAt'],'updatedAt':_0x242282[_0x11bbc4(0x22b)][_0x11bbc4(0x202)]};}function truncatePrompt(_0x3e7ea1){const _0x58d719=a20_0x340b;if(!_0x3e7ea1)return undefined;const _0x46d79e=0x64;if(_0x3e7ea1[_0x58d719(0x212)]<=_0x46d79e)return _0x3e7ea1;return _0x3e7ea1[_0x58d719(0x19c)](0x0,_0x46d79e)+_0x58d719(0x227);}export class LLMModelsCommand extends BaseCommand{[a20_0x56bc32(0x168)]='llm:models';[a20_0x56bc32(0x20b)]='List\x20available\x20LLM\x20models';async[a20_0x56bc32(0x1d6)](_0x546681){const _0x7998af=a20_0x56bc32,{options:_0x29f489,tdx:_0x379bb1}=_0x546681;try{const _0x4a5b7b=await withSpinner(_0x7998af(0x1ae),()=>_0x379bb1[_0x7998af(0x15e)][_0x7998af(0x1e9)](),{'verbose':_0x29f489[_0x7998af(0x1aa)]});return await handleSDKOutput(_0x4a5b7b[_0x7998af(0x1bb)],_0x29f489),0x0;}catch(_0x2dea5d){return handleSDKError(_0x2dea5d,_0x29f489),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x56bc32(0x168)]='llm:projects';['description']=a20_0x56bc32(0x190);async['execute'](_0x241bb5){const _0x456993=a20_0x56bc32,{options:_0x3ff339,args:_0x1cb5b6,tdx:_0x11fb8d}=_0x241bb5,_0x2cbfd9=getChalk(_0x3ff339),_0x26cbbc=_0x3ff339[_0x456993(0x1cb)],_0x90563=_0x3ff339[_0x456993(0x192)];try{const _0x4e8a2b=_0x1cb5b6[0x0],_0x3b28ef=resolveLimit(_0x3ff339['limit'],DEFAULT_LLM_LIMIT),_0x145eac=await withSpinner('Fetching\x20projects...',()=>_0x11fb8d[_0x456993(0x15e)]['projects'](_0x3b28ef),{'verbose':_0x3ff339[_0x456993(0x1aa)]});let _0x1e906c=_0x145eac['data'];_0x4e8a2b&&(_0x1e906c=_0x145eac[_0x456993(0x1bb)]['filter'](_0x2af814=>matchGlobPattern(_0x2af814['attributes'][_0x456993(0x168)],_0x4e8a2b)));const _0x2db3b2=_0x3ff339[_0x456993(0x1cd)]===_0x456993(0x1c9)||_0x3ff339[_0x456993(0x1cd)]===_0x456993(0x196)||_0x3ff339[_0x456993(0x1cd)]==='table'||_0x3ff339[_0x456993(0x1cd)]===_0x456993(0x20c);if(_0x2db3b2){const _0x527bd8=_0x1e906c[_0x456993(0x19f)](_0x393895=>({...toLLMProjectInfo(_0x393895),..._0x26cbbc?{'url':getLLMProjectUrl(_0x90563,_0x393895['id'])}:{}}));await handleSDKOutput(_0x527bd8,_0x3ff339);}else{const _0x20e042=[];if(_0x1e906c[_0x456993(0x212)]===0x0)_0x20e042[_0x456993(0x208)](_0x2cbfd9[_0x456993(0x20a)]('No\x20projects\x20found'));else{const _0x1d82be=[..._0x1e906c]['sort']((_0x318868,_0x13c839)=>_0x318868['attributes'][_0x456993(0x168)]['localeCompare'](_0x13c839[_0x456993(0x22b)][_0x456993(0x168)]));for(const _0x2bd3a8 of _0x1d82be){if(_0x26cbbc){const _0x588f03=getLLMProjectUrl(_0x90563,_0x2bd3a8['id']);_0x20e042[_0x456993(0x208)]('⚒️\x20'+_0x2bd3a8[_0x456993(0x22b)][_0x456993(0x168)]+'\x20\x20'+_0x2cbfd9['dim'](_0x588f03));}else _0x20e042[_0x456993(0x208)]('⚒️\x20'+_0x2bd3a8[_0x456993(0x22b)][_0x456993(0x168)]);}_0x20e042[_0x456993(0x208)](_0x2cbfd9['dim'](_0x1e906c[_0x456993(0x212)]+_0x456993(0x1cf)));}await writeOutput(_0x20e042[_0x456993(0x220)]('\x0a'),_0x3ff339[_0x456993(0x1f7)],_0x456993(0x1f3));}return 0x0;}catch(_0xa0cfc2){return handleSDKError(_0xa0cfc2,_0x3ff339),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x56bc32(0x168)]='llm:agents';[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x21a);async[a20_0x56bc32(0x1d6)](_0x4b570b){const _0x2c9957=a20_0x56bc32,{options:_0x270391,args:_0x43261d,tdx:_0x4fafe1}=_0x4b570b,_0x21ff09=getChalk(_0x270391),_0x55cdd9=_0x270391['web'],_0x44322c=_0x270391[_0x2c9957(0x192)];try{const _0x437785=_0x43261d[0x0];let _0x5b7bc8=_0x437785,_0x1b8bdc,_0x145723;if(_0x437785&&_0x437785[_0x2c9957(0x1b4)]('/')){const _0x14cd59=_0x437785[_0x2c9957(0x19a)]('/');if(_0x14cd59[_0x2c9957(0x212)]===0x2){const [_0x1f9a80,_0xf949c6]=_0x14cd59,_0x927f15=await _0x4fafe1[_0x2c9957(0x15e)][_0x2c9957(0x1d2)](),_0x2a8d42=_0x927f15[_0x2c9957(0x189)](_0x1fb2ad=>_0x1fb2ad[_0x2c9957(0x22b)][_0x2c9957(0x168)][_0x2c9957(0x1cc)]()===_0x1f9a80[_0x2c9957(0x1cc)]());if(!_0x2a8d42)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x2c9957(0x1e3)+_0x1f9a80,undefined,{'helpText':_0x2c9957(0x20e)});_0x1b8bdc=_0x2a8d42['id'],_0x145723=_0x2a8d42[_0x2c9957(0x22b)][_0x2c9957(0x168)],_0x5b7bc8=_0xf949c6;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2c9957(0x1f0)+_0x437785,undefined,{'helpText':_0x2c9957(0x20d)});}else{const _0x68c4a0=await getProjectWithName(_0x4b570b);_0x1b8bdc=_0x68c4a0['id'],_0x145723=_0x68c4a0['name'];}const _0x58a6a7=await withSpinner(_0x2c9957(0x187),()=>_0x4fafe1[_0x2c9957(0x15e)][_0x2c9957(0x209)](_0x1b8bdc),{'verbose':_0x270391[_0x2c9957(0x1aa)]});let _0x48baef=_0x58a6a7[_0x2c9957(0x1bb)];_0x5b7bc8&&(_0x48baef=_0x58a6a7[_0x2c9957(0x1bb)][_0x2c9957(0x1f4)](_0x210725=>matchGlobPattern(_0x210725[_0x2c9957(0x22b)][_0x2c9957(0x168)],_0x5b7bc8)));const _0x43e6b4=_0x270391[_0x2c9957(0x1cd)]===_0x2c9957(0x1c9)||_0x270391[_0x2c9957(0x1cd)]==='jsonl'||_0x270391[_0x2c9957(0x1cd)]===_0x2c9957(0x1f3)||_0x270391[_0x2c9957(0x1cd)]==='tsv';if(_0x43e6b4){const _0x1131a8=_0x48baef['map'](_0x274706=>({...toAgentInfo(_0x274706),..._0x55cdd9?{'chatUrl':getLLMAgentChatUrl(_0x44322c,_0x1b8bdc,_0x274706['id'])}:{}}));await handleSDKOutput(_0x1131a8,_0x270391);}else{const _0x529c41=[];_0x529c41[_0x2c9957(0x208)](_0x21ff09['dim']('['+_0x145723+']'));if(_0x48baef['length']===0x0)_0x529c41[_0x2c9957(0x208)](_0x21ff09[_0x2c9957(0x20a)](_0x2c9957(0x217)));else{const _0xb1d763=[..._0x48baef][_0x2c9957(0x1fe)]((_0x207124,_0x4b9647)=>_0x207124[_0x2c9957(0x22b)][_0x2c9957(0x168)][_0x2c9957(0x156)](_0x4b9647['attributes'][_0x2c9957(0x168)]));for(const _0x1c281b of _0xb1d763){if(_0x55cdd9){const _0x2fc162=getLLMAgentChatUrl(_0x44322c,_0x1b8bdc,_0x1c281b['id']);_0x529c41[_0x2c9957(0x208)]('🤖\x20'+_0x1c281b[_0x2c9957(0x22b)]['name']+'\x20\x20'+_0x21ff09[_0x2c9957(0x20a)](_0x2fc162));}else _0x529c41[_0x2c9957(0x208)](_0x2c9957(0x1ea)+_0x1c281b[_0x2c9957(0x22b)][_0x2c9957(0x168)]);}_0x529c41[_0x2c9957(0x208)](_0x21ff09[_0x2c9957(0x20a)](_0x48baef[_0x2c9957(0x212)]+'\x20agent(s)'));}await writeOutput(_0x529c41[_0x2c9957(0x220)]('\x0a'),_0x270391['output'],_0x2c9957(0x1f3));}return 0x0;}catch(_0x42a846){return handleSDKError(_0x42a846,_0x270391),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a20_0x56bc32(0x177);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x1c4);async[a20_0x56bc32(0x1d6)](_0x567275){const _0x10a434=a20_0x56bc32,{options:_0x1d1bf1,args:_0x486e6a,tdx:_0x5d1d93}=_0x567275;if(_0x486e6a[_0x10a434(0x212)]===0x0)return console[_0x10a434(0x1c3)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x10a434(0x1c3)](_0x10a434(0x1f1)),0x1;const _0x4e0196=_0x486e6a[0x0];try{const _0x9a361d=await getProjectIdOrDefault(_0x567275),_0x5e1fbd=await withSpinner('Resolving\x20agent\x20\x27'+_0x4e0196+_0x10a434(0x163),()=>_0x5d1d93['llm']['resolveAgentId'](_0x4e0196,_0x9a361d),{'verbose':_0x1d1bf1[_0x10a434(0x1aa)]}),_0x20a31b=await withSpinner(_0x10a434(0x1ad),()=>_0x5d1d93[_0x10a434(0x15e)][_0x10a434(0x1f2)](_0x5e1fbd[_0x10a434(0x1bb)]),{'verbose':_0x1d1bf1[_0x10a434(0x1aa)]});return await handleSDKOutput([_0x20a31b[_0x10a434(0x1bb)]],_0x1d1bf1),0x0;}catch(_0x46f1ad){return handleSDKError(_0x46f1ad,_0x1d1bf1),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1e4);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x1d1);async[a20_0x56bc32(0x1d6)](_0x360121){const _0x6ef57b=a20_0x56bc32,{options:_0x1bf9c0,args:_0x494d18,tdx:_0x2839d8}=_0x360121;if(_0x494d18[_0x6ef57b(0x212)]===0x0)return console[_0x6ef57b(0x1c3)](_0x6ef57b(0x18a)),console[_0x6ef57b(0x1c3)](_0x6ef57b(0x222)),console[_0x6ef57b(0x1c3)](_0x6ef57b(0x1a0)),0x1;const _0x4d109f=_0x494d18[0x0],_0x38bd79=_0x1bf9c0,_0x2f3449=_0x38bd79[_0x6ef57b(0x201)],_0x52d0ea=_0x38bd79[_0x6ef57b(0x1e1)]||_0x6ef57b(0x204),_0x168175=_0x38bd79[_0x6ef57b(0x153)],_0x35303c=_0x38bd79[_0x6ef57b(0x15f)]?Number(_0x38bd79['maxToolIterations']):undefined,_0x192df5=_0x38bd79['temperature']?Number(_0x38bd79['temperature']):undefined;try{let _0x23415f,_0x4de5df;if(_0x4d109f[_0x6ef57b(0x1b4)]('/')){const _0x4e44b4=_0x4d109f['split']('/');if(_0x4e44b4[_0x6ef57b(0x212)]===0x2){const [_0x5719df,_0x301888]=_0x4e44b4,_0x407e62=await withSpinner(_0x6ef57b(0x16f)+_0x5719df+_0x6ef57b(0x163),()=>_0x2839d8['llm'][_0x6ef57b(0x1ab)](_0x5719df),{'verbose':_0x1bf9c0[_0x6ef57b(0x1aa)]});_0x23415f=_0x407e62[_0x6ef57b(0x1bb)],_0x4de5df=_0x301888;}else throw new SDKError(ErrorCode[_0x6ef57b(0x161)],_0x6ef57b(0x1f0)+_0x4d109f,undefined,{'helpText':_0x6ef57b(0x20d)});}else _0x23415f=await getProjectIdOrDefault(_0x360121),_0x4de5df=_0x4d109f;const _0x381f5d=await withSpinner(_0x6ef57b(0x165)+_0x4de5df+_0x6ef57b(0x163),()=>_0x2839d8[_0x6ef57b(0x15e)][_0x6ef57b(0x1f9)]({'name':_0x4de5df,'projectId':_0x23415f,'modelType':_0x52d0ea,'systemPrompt':_0x2f3449,'starterMessage':_0x168175,'maxToolIterations':_0x35303c,'temperature':_0x192df5}),{'verbose':_0x1bf9c0[_0x6ef57b(0x1aa)]});return console[_0x6ef57b(0x1fd)](_0x6ef57b(0x178)+_0x381f5d[_0x6ef57b(0x1bb)]['id']),await handleSDKOutput([_0x381f5d[_0x6ef57b(0x1bb)]],_0x1bf9c0),0x0;}catch(_0x3eb712){return handleSDKError(_0x3eb712,_0x1bf9c0),0x1;}}}function a20_0x340b(_0x463d56,_0x148924){_0x463d56=_0x463d56-0x14e;const _0x5daeb3=a20_0x5dae();let _0x340b0d=_0x5daeb3[_0x463d56];return _0x340b0d;}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1a5);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x16e);async[a20_0x56bc32(0x1d6)](_0x1e3a80){const _0x57c030=a20_0x56bc32,{options:_0x29218c,args:_0x149d7e,tdx:_0x3af0d1}=_0x1e3a80;if(_0x149d7e[_0x57c030(0x212)]===0x0)return console[_0x57c030(0x1c3)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x57c030(0x176)),0x1;const _0x571bd9=_0x149d7e[0x0],_0x11740a=_0x29218c,_0x340042=_0x11740a[_0x57c030(0x168)],_0x2abbeb=_0x11740a['prompt'],_0x1c0e00=_0x11740a[_0x57c030(0x20b)],_0x548cd0=_0x11740a[_0x57c030(0x153)];if(!_0x340042&&!_0x2abbeb&&!_0x1c0e00&&!_0x548cd0)return console[_0x57c030(0x1c3)](_0x57c030(0x198)),console['error'](_0x57c030(0x166)),0x1;try{const _0x3033a6=await getProjectIdOrDefault(_0x1e3a80),_0x2b4146=await withSpinner('Resolving\x20agent\x20\x27'+_0x571bd9+_0x57c030(0x163),()=>_0x3af0d1[_0x57c030(0x15e)]['resolveAgentId'](_0x571bd9,_0x3033a6),{'verbose':_0x29218c[_0x57c030(0x1aa)]}),_0x280205=_0x2b4146[_0x57c030(0x1bb)],_0x2276f2=await withSpinner(_0x57c030(0x1dc),()=>_0x3af0d1['llm']['updateAgent'](_0x280205,{'name':_0x340042,'prompt':_0x2abbeb,'description':_0x1c0e00,'starterMessage':_0x548cd0}),{'verbose':_0x29218c['verbose']});return console[_0x57c030(0x1fd)](_0x57c030(0x226)+_0x2276f2[_0x57c030(0x1bb)]['id']),await handleSDKOutput([_0x2276f2[_0x57c030(0x1bb)]],_0x29218c),0x0;}catch(_0x41c690){return handleSDKError(_0x41c690,_0x29218c),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a20_0x56bc32(0x193);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x1db);async['execute'](_0x37ac28){const _0x497f2c=a20_0x56bc32,{options:_0xea25b0,args:_0x130789,tdx:_0x43b02a}=_0x37ac28;if(_0x130789[_0x497f2c(0x212)]===0x0)return console[_0x497f2c(0x1c3)](_0x497f2c(0x18a)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x301707=_0x130789[0x0];try{const _0x597d51=await getProjectIdOrDefault(_0x37ac28),_0x42aed1=await withSpinner(_0x497f2c(0x179)+_0x301707+'\x27...',()=>_0x43b02a[_0x497f2c(0x15e)][_0x497f2c(0x21f)](_0x301707,_0x597d51),{'verbose':_0xea25b0[_0x497f2c(0x1aa)]}),_0x5c0047=_0x42aed1[_0x497f2c(0x1bb)];return await withSpinner('Deleting\x20agent...',()=>_0x43b02a[_0x497f2c(0x15e)][_0x497f2c(0x1ba)](_0x5c0047),{'verbose':_0xea25b0[_0x497f2c(0x1aa)]}),console['log']('Agent\x20deleted:\x20'+_0x5c0047),0x0;}catch(_0x51e806){return handleSDKError(_0x51e806,_0xea25b0),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x16a);['description']=a20_0x56bc32(0x197);async[a20_0x56bc32(0x1d6)](_0x5f586f){const _0x4c9df0=a20_0x56bc32;return executeChatHistoryCommand(_0x5f586f,_0x4c9df0(0x1b3));}}export class LLMUseCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1c0);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x151);async[a20_0x56bc32(0x1d6)](_0x733745){const _0x1a5cea=a20_0x56bc32,{options:_0x2b0dd2,args:_0x433718,tdx:_0x4b8ef2}=_0x733745;if(_0x433718[_0x1a5cea(0x212)]===0x0)return console[_0x1a5cea(0x1c3)](_0x1a5cea(0x162)),console[_0x1a5cea(0x1c3)](_0x1a5cea(0x199)),0x1;const _0x5ad488=_0x433718[0x0];try{return await withSpinner(_0x1a5cea(0x22e)+_0x5ad488+'\x27...',()=>_0x4b8ef2[_0x1a5cea(0x15e)]['setCurrentProject'](_0x5ad488),{'verbose':_0x2b0dd2[_0x1a5cea(0x1aa)]}),console[_0x1a5cea(0x1fd)](_0x1a5cea(0x18d)+_0x5ad488),0x0;}catch(_0x2229fc){return handleSDKError(_0x2229fc,_0x2b0dd2),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1e0);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x15c);async[a20_0x56bc32(0x1d6)](_0xb28691){const _0x1d4dc3=a20_0x56bc32,{options:_0x495589,args:_0x365ca6,tdx:_0x694215}=_0xb28691;if(_0x365ca6[_0x1d4dc3(0x212)]===0x0)return console['error'](_0x1d4dc3(0x162)),console[_0x1d4dc3(0x1c3)](_0x1d4dc3(0x17e)),0x1;const _0x226e5c=_0x365ca6[0x0],_0xdf0e8c=_0x495589,_0x197863=_0xdf0e8c[_0x1d4dc3(0x20b)];try{const _0x1d53a5=await withSpinner(_0x1d4dc3(0x1d0)+_0x226e5c+'\x27...',()=>_0x694215[_0x1d4dc3(0x15e)]['createProject']({'name':_0x226e5c,'description':_0x197863}),{'verbose':_0x495589[_0x1d4dc3(0x1aa)]});console[_0x1d4dc3(0x1fd)](_0x1d4dc3(0x1c8)+_0x1d53a5['data']['id']);const _0x5672c1=toLLMProjectInfo(_0x1d53a5[_0x1d4dc3(0x1bb)]);return await handleSDKOutput([_0x5672c1],_0x495589),0x0;}catch(_0x2a3002){return handleSDKError(_0x2a3002,_0x495589),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a20_0x56bc32(0x1b7);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x1ac);async['execute'](_0x91e186){const _0x486780=a20_0x56bc32,{options:_0x349a50,args:_0xdf08dd,tdx:_0x50aa7e}=_0x91e186;if(_0xdf08dd[_0x486780(0x212)]===0x0)return console['error'](_0x486780(0x162)),console['error'](_0x486780(0x191)),0x1;const _0x35c758=_0xdf08dd[0x0];try{return await withSpinner(_0x486780(0x1ec)+_0x35c758+'\x27...',()=>_0x50aa7e['llm'][_0x486780(0x1f8)](_0x35c758),{'verbose':_0x349a50['verbose']}),console[_0x486780(0x1fd)]('Project\x20deleted:\x20'+_0x35c758),0x0;}catch(_0x52a25c){return handleSDKError(_0x52a25c,_0x349a50),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1a4);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x1d3);async['execute'](_0xf47517){const _0x409960=a20_0x56bc32,{options:_0x53432f,args:_0x203ae7,tdx:_0x1857f7}=_0xf47517,_0x4f05f9=getChalk(_0x53432f);console['log'](_0x4f05f9['yellow'](_0x409960(0x22d))),console[_0x409960(0x1fd)](_0x4f05f9[_0x409960(0x207)](_0x409960(0x229))),console[_0x409960(0x1fd)](_0x4f05f9['dim'](_0x409960(0x18e))),console['log']();if(_0x203ae7[_0x409960(0x212)]===0x0)return console[_0x409960(0x1c3)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x409960(0x21c)),0x1;const _0x44bb7a=_0x203ae7[0x0],_0x27ab52=_0x53432f,_0x4aa41a=_0x27ab52['output'],_0x3e6e85=_0x27ab52[_0x409960(0x17c)];try{const _0x4d9d65=_0x4aa41a||_0x44bb7a+_0x409960(0x17f);if(a20_0x4b500b[_0x409960(0x225)](_0x4d9d65)&&!_0x3e6e85){if(!_0x53432f[_0x409960(0x1e6)]){const _0x143862=await confirm(_0x409960(0x1a6)+_0x4d9d65+_0x409960(0x185));if(!_0x143862)return console[_0x409960(0x1fd)](_0x409960(0x1de)),0x0;}a20_0x4b500b[_0x409960(0x1ef)](_0x4d9d65,{'recursive':!![]});}const _0x39e3c6=await withSpinner(_0x3e6e85?_0x409960(0x1a3)+_0x44bb7a+_0x409960(0x163):_0x409960(0x1bc)+_0x44bb7a+_0x409960(0x163),()=>_0x1857f7['llm']['backupProject'](_0x44bb7a,_0x4aa41a,{'dryRun':_0x3e6e85}),{'verbose':_0x53432f['verbose']}),_0x4891e7=_0x39e3c6[_0x409960(0x1bb)];return _0x3e6e85?console[_0x409960(0x1fd)]('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0x4891e7[_0x409960(0x1f6)]):console[_0x409960(0x1fd)]('Project\x20backed\x20up\x20to:\x20'+_0x4891e7[_0x409960(0x1f6)]),console[_0x409960(0x1fd)]('\x20\x20Agents:\x20'+_0x4891e7[_0x409960(0x22c)][_0x409960(0x209)]),console[_0x409960(0x1fd)]('\x20\x20Knowledge\x20Bases:\x20'+_0x4891e7[_0x409960(0x22c)]['knowledgeBases']),console[_0x409960(0x1fd)](_0x409960(0x17d)+_0x4891e7[_0x409960(0x22c)][_0x409960(0x174)]),console[_0x409960(0x1fd)](_0x409960(0x1e5)+_0x4891e7['counts']['integrations']),(_0x53432f[_0x409960(0x1cd)]===_0x409960(0x1c9)||_0x53432f[_0x409960(0x1cd)]===_0x409960(0x196))&&await handleSDKOutput([_0x4891e7],_0x53432f),0x0;}catch(_0x3f8941){return handleSDKError(_0x3f8941,_0x53432f),0x1;}}}function a20_0x5dae(){const _0x3e0d8d=['Show\x20agent\x20details','chats','m\x20ago','agentId','Project\x20created:\x20','json','\x20->\x20ImageGen:','web','toLowerCase','format','input','\x20project(s)','Creating\x20project\x20\x27','Create\x20a\x20new\x20agent\x20in\x20current\x20project','projects','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','552BEHaOd','\x20\x20Agents:\x20','execute','15mUASAO','769902AgRrvn','llm:project:restore','set','Delete\x20an\x20agent','Updating\x20agent...','targetAgent','Backup\x20cancelled.','entries','llm:project:create','model','magenta','Project\x20not\x20found:\x20','llm:agent:create','\x20\x20Integrations:\x20','yes','[tool_call]','stringify','models','🤖\x20','9729970AhGKdo','Deleting\x20project\x20\x27','limit','4043165UFYuJd','rmSync','Invalid\x20path\x20syntax:\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','agent','table','filter','Fetching\x20chat\x20history\x20for\x20\x27','outputDir','output','deleteProject','createAgent','projectId','red','Checking\x20for\x20existing\x20projects...','log','sort','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','A\x20project\x20named\x20\x27','systemPrompt','updatedAt','[output]\x20','claude-4.5-haiku','Unknown','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','yellow','push','agents','dim','description','tsv','Use\x20format:\x20project-name/agent-name','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Fetching\x20chat\x20sessions...','\x20\x20Cause:\x20','lastConversationAt','length','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','prompt','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','getTime','No\x20agents\x20found','llmProject','\x20bytes)','List\x20agents\x20in\x20current\x20project','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','[unknown]','getOrCreateDefaultProject','resolveAgentId','join','83115NeRGOM','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','cyan','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','existsSync','Agent\x20updated:\x20','...','tool_call','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','tool','attributes','counts','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','Setting\x20project\x20context\x20to\x20\x27','\x20\x20Knowledge\x20Bases:\x20','projectName','\x20\x20\x20Examples:','(no\x20message)','Set\x20current\x20project\x20context','just\x20now','starterMessage','\x20→\x20chat:\x20','firstInputContent','localeCompare','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','en-US','\x20->\x20Agent:','toLocaleDateString','stack','Create\x20a\x20new\x20LLM\x20project','1245629sSuMqJ','llm','maxToolIterations','Restore\x20cancelled.','INVALID_ARGUMENT','Error:\x20Project\x20name\x20is\x20required','\x27...','chatId','Creating\x20agent\x20\x27','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','40158KVQAPp','name','h\x20ago','llm:history','\x20->\x20WebSearch:','\x0aCancelled','exportedFrom','Update\x20an\x20existing\x20agent','Resolving\x20project\x20\x27','sourceSite','restoreProject','bold','Select\x20a\x20chat\x20session:','prompts','get','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','llm:agent:show','Agent\x20created:\x20','Resolving\x20agent\x20\x27','\x0aStack\x20trace:','20SIfLjy','dryRun','\x20\x20Prompts:\x20','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','.llm','[input]\x20\x20','d\x20ago','integrations','getCurrentProject','keys','\x27\x20already\x20exists.\x20Overwrite?','substring','Fetching\x20agents...','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','find','Error:\x20Agent\x20name\x20is\x20required','image','2124oDrftV','Project\x20context\x20set\x20to:\x20','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','content','List\x20all\x20LLM\x20projects','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','site','llm:agent:delete','targetKnowledgeBase','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','jsonl','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Usage:\x20tdx\x20llm\x20use\x20<project-name>','split','132649ZHufiE','slice','numeric','string','map','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','__load_more__','No\x20messages\x20found\x20in\x20chat\x20history.','Analyzing\x20project\x20\x27','llm:project:backup','llm:agent:update','Output\x20directory\x20\x27','targetWebSearchTool','[tool]\x20\x20\x20','all','verbose','resolveProjectId','Delete\x20an\x20LLM\x20project','Fetching\x20agent...','Fetching\x20available\x20models...','cause','30EvuVfb','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','tdx\x20llm\x20history','includes','green','select','llm:project:delete','Project\x20restored:\x20','\x20--last','deleteAgent','data','Backing\x20up\x20project\x20\x27','targetImageGenerator','tdx\x20chats','last','llm:use','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','floor','error'];a20_0x5dae=function(){return _0x3e0d8d;};return a20_0x5dae();}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1d9);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x157);async[a20_0x56bc32(0x1d6)](_0x5bcb00){const _0x58bd3f=a20_0x56bc32,{options:_0xce772,args:_0x157eb,tdx:_0x54af7a}=_0x5bcb00,_0x42bdb6=getChalk(_0xce772);console[_0x58bd3f(0x1fd)](_0x42bdb6[_0x58bd3f(0x207)](_0x58bd3f(0x1b2))),console[_0x58bd3f(0x1fd)](_0x42bdb6[_0x58bd3f(0x207)](_0x58bd3f(0x213))),console['log'](_0x42bdb6[_0x58bd3f(0x20a)](_0x58bd3f(0x14f))),console[_0x58bd3f(0x1fd)](_0x42bdb6['dim'](_0x58bd3f(0x1ff))),console[_0x58bd3f(0x1fd)](_0x42bdb6[_0x58bd3f(0x20a)](_0x58bd3f(0x1b1))),console['log']();if(_0x157eb[_0x58bd3f(0x212)]===0x0)return console[_0x58bd3f(0x1c3)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x58bd3f(0x1c3)](_0x58bd3f(0x188)),0x1;const _0x35b764=_0x157eb[0x0],_0x741666=_0xce772,_0x158002=_0x741666[_0x58bd3f(0x168)],_0x2a5df6=_0x741666[_0x58bd3f(0x17c)];try{if(!_0x2a5df6){const _0x91920e=_0x54af7a[_0x58bd3f(0x15e)]['getBackupMetadata'](_0x35b764),_0x412292=_0x158002||_0x91920e[_0x58bd3f(0x16d)][_0x58bd3f(0x14e)],_0x31c412=await withSpinner(_0x58bd3f(0x1fc),()=>_0x54af7a[_0x58bd3f(0x15e)][_0x58bd3f(0x1d2)](),{'verbose':_0xce772['verbose']}),_0x3964b9=_0x31c412[_0x58bd3f(0x1bb)]['find'](_0x562ecd=>_0x562ecd[_0x58bd3f(0x22b)][_0x58bd3f(0x168)]===_0x412292);if(_0x3964b9&&!_0xce772[_0x58bd3f(0x1e6)]){const _0x501416=await confirm(_0x58bd3f(0x200)+_0x412292+_0x58bd3f(0x224));if(!_0x501416)return console[_0x58bd3f(0x1fd)](_0x58bd3f(0x160)),0x0;}}const _0x320be5=await withSpinner(_0x2a5df6?'Validating\x20backup\x20from\x20\x27'+_0x35b764+'\x27...':'Restoring\x20project\x20from\x20\x27'+_0x35b764+_0x58bd3f(0x163),()=>_0x54af7a[_0x58bd3f(0x15e)][_0x58bd3f(0x171)](_0x35b764,{'name':_0x158002,'dryRun':_0x2a5df6}),{'verbose':_0xce772[_0x58bd3f(0x1aa)]}),_0x16addf=_0x320be5[_0x58bd3f(0x1bb)];return _0x16addf[_0x58bd3f(0x170)]&&console[_0x58bd3f(0x1fd)](_0x58bd3f(0x1c1)+_0x16addf[_0x58bd3f(0x170)]+'\x27'),_0x2a5df6?console['log'](_0x58bd3f(0x206)+_0x16addf[_0x58bd3f(0x14e)]):console[_0x58bd3f(0x1fd)](_0x58bd3f(0x1b8)+_0x16addf[_0x58bd3f(0x14e)]+'\x20('+_0x16addf[_0x58bd3f(0x1fa)]+')'),console[_0x58bd3f(0x1fd)](_0x58bd3f(0x1d5)+_0x16addf['counts'][_0x58bd3f(0x209)]),console[_0x58bd3f(0x1fd)](_0x58bd3f(0x22f)+_0x16addf[_0x58bd3f(0x22c)]['knowledgeBases']),console['log'](_0x58bd3f(0x17d)+_0x16addf[_0x58bd3f(0x22c)]['prompts']),console[_0x58bd3f(0x1fd)]('\x20\x20Integrations:\x20'+_0x16addf['counts'][_0x58bd3f(0x182)]),(_0xce772[_0x58bd3f(0x1cd)]===_0x58bd3f(0x1c9)||_0xce772['format']===_0x58bd3f(0x196))&&await handleSDKOutput([_0x16addf],_0xce772),0x0;}catch(_0x278089){return handleSDKError(_0x278089,_0xce772),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x531f78,_0x6099b5){const _0x3ff08d=a20_0x56bc32,_0x4422bf=_0x6099b5[_0x3ff08d(0x1ed)]||CHAT_SELECTOR_PAGE_SIZE;let _0x559067=0x0,_0x23d41b=[];const _0x5766ab=(await import(_0x3ff08d(0x174)))['default'],_0xd8509a=getChalk(_0x6099b5);while(!![]){const _0x4e7db0=await withSpinner(_0x3ff08d(0x20f),()=>_0x531f78[_0x3ff08d(0x15e)]['chats'](_0x4422bf+_0x559067),{'verbose':_0x6099b5[_0x3ff08d(0x1aa)]});_0x23d41b=_0x4e7db0[_0x3ff08d(0x1bb)];const _0x44a895=_0x23d41b[_0x3ff08d(0x19c)](_0x559067,_0x559067+_0x4422bf),_0x5ac49a=_0x23d41b[_0x3ff08d(0x212)]>_0x559067+_0x4422bf,_0x4deb7a=[...new Set(_0x44a895['map'](_0x1bf391=>_0x1bf391[_0x3ff08d(0x22b)]['agentId'])['filter'](_0x902aa9=>_0x902aa9!==undefined))],_0x4e9d99=new Map();await Promise[_0x3ff08d(0x1a9)](_0x4deb7a['map'](async _0x158937=>{const _0x5b5174=_0x3ff08d;try{const _0x534a3f=await _0x531f78['llm'][_0x5b5174(0x1f2)](_0x158937);_0x4e9d99['set'](_0x158937,_0x534a3f['attributes'][_0x5b5174(0x168)]);}catch{_0x4e9d99[_0x5b5174(0x1da)](_0x158937,_0x158937);}}));const _0x59e50f=_0x44a895[_0x3ff08d(0x19f)](_0x115460=>{const _0x34af68=_0x3ff08d,_0x56ca1a=_0x115460[_0x34af68(0x22b)][_0x34af68(0x155)]||_0x34af68(0x150),_0x5b3002=_0x56ca1a['split']('\x0a')[0x0],_0x184aba=_0x5b3002[_0x34af68(0x212)]>0x50?_0x5b3002[_0x34af68(0x186)](0x0,0x4d)+_0x34af68(0x227):_0x5b3002,_0x71410c=_0x115460[_0x34af68(0x22b)][_0x34af68(0x1c7)]?_0x4e9d99[_0x34af68(0x175)](_0x115460[_0x34af68(0x22b)]['agentId'])||_0x115460['attributes'][_0x34af68(0x1c7)]:'(no\x20agent)',_0x2d0d5d=_0x115460['attributes'][_0x34af68(0x211)]||_0x115460[_0x34af68(0x22b)][_0x34af68(0x202)],_0x5e6d0c=new Date(_0x2d0d5d),_0x3db5b5=new Date(),_0x2d5fc4=_0x3db5b5['getTime']()-_0x5e6d0c[_0x34af68(0x216)](),_0x56f8af=Math[_0x34af68(0x1c2)](_0x2d5fc4/0xea60),_0x4456ca=Math['floor'](_0x2d5fc4/0x36ee80),_0x10cf69=Math[_0x34af68(0x1c2)](_0x2d5fc4/0x5265c00);let _0xcc6afb;if(_0x56f8af<0x1)_0xcc6afb=_0x34af68(0x152);else{if(_0x56f8af<0x3c)_0xcc6afb=_0x56f8af+_0x34af68(0x1c6);else{if(_0x4456ca<0x18)_0xcc6afb=_0x4456ca+_0x34af68(0x169);else _0x10cf69<0x7?_0xcc6afb=_0x10cf69+_0x34af68(0x181):_0xcc6afb=_0x5e6d0c[_0x34af68(0x15a)](_0x34af68(0x158),{'month':'short','day':_0x34af68(0x19d)});}}return{'title':_0x184aba+'\x20'+_0xd8509a['dim']('['+_0x71410c+']\x20'+_0xcc6afb),'value':_0x115460['id']};});_0x5ac49a&&_0x59e50f[_0x3ff08d(0x208)]({'title':_0xd8509a[_0x3ff08d(0x223)]('Load\x20more...'),'value':_0x3ff08d(0x1a1)});const _0x2ffc02=await _0x5766ab({'type':_0x3ff08d(0x1b6),'name':_0x3ff08d(0x164),'message':_0x3ff08d(0x173),'choices':_0x59e50f,'hint':_0x3ff08d(0x215)});if(!_0x2ffc02[_0x3ff08d(0x164)])return undefined;if(_0x2ffc02[_0x3ff08d(0x164)]===_0x3ff08d(0x1a1)){_0x559067+=_0x4422bf;continue;}return _0x2ffc02[_0x3ff08d(0x164)];}}export class ChatsCommand extends BaseCommand{[a20_0x56bc32(0x168)]=a20_0x56bc32(0x1c5);[a20_0x56bc32(0x20b)]=a20_0x56bc32(0x195);async['execute'](_0x48f08e){const _0x3d6294=a20_0x56bc32;return executeChatHistoryCommand(_0x48f08e,_0x3d6294(0x1be));}}
@@ -1 +1 @@
1
- const a21_0x1df827=a21_0x276b;(function(_0x4d0383,_0x2014b9){const _0x4c662f=a21_0x276b,_0x1a647c=_0x4d0383();while(!![]){try{const _0x30b146=parseInt(_0x4c662f(0x1b2))/0x1*(-parseInt(_0x4c662f(0x1ae))/0x2)+-parseInt(_0x4c662f(0x199))/0x3+parseInt(_0x4c662f(0x195))/0x4+parseInt(_0x4c662f(0x1be))/0x5*(-parseInt(_0x4c662f(0x196))/0x6)+-parseInt(_0x4c662f(0x1b5))/0x7+-parseInt(_0x4c662f(0x189))/0x8*(-parseInt(_0x4c662f(0x1a1))/0x9)+parseInt(_0x4c662f(0x1c2))/0xa;if(_0x30b146===_0x2014b9)break;else _0x1a647c['push'](_0x1a647c['shift']());}catch(_0x2427f9){_0x1a647c['push'](_0x1a647c['shift']());}}}(a21_0x34b7,0x509b6));function a21_0x34b7(){const _0x51ec2d=['Port\x20','\x27\x20not\x20found','site','project','675qYjHer','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','Project\x20\x27','NOT_FOUND','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','bold','llm','http://0.0.0.0:','port','Server\x20Configuration:','Resolving\x20project...','\x20\x20\x20\x20}','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','430nRZCNB','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','\x20\x20}','\x20\x20Address:','958lebXyG','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','4161290XhefhU','\x0aTesting\x20with\x20Agent\x20SDK:','init','description','exit','SIGINT','Starting\x20proxy\x20server...','\x20\x20Site:','SIGTERM','1760YaliEd','cyan','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','16900900YhtQaZ','✓\x20Proxy\x20server\x20stopped','\x20\x20\x20\x20\x22env\x22:\x20{','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','server','attributes','\x20\x20{','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','39272RfamDE','yellow','llmProject','green','white','\x0aClaude\x20Code\x20Configuration:','\x20\x20Agents:','find','logger','close','name','start','10220WnBOOv','11244FAriWY','projects','dim','811698DcvRqO','stop','execute','log'];a21_0x34b7=function(){return _0x51ec2d;};return a21_0x34b7();}import a21_0x5a29a2 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 a21_0x276b(_0x4bf820,_0x2ea38b){_0x4bf820=_0x4bf820-0x188;const _0x34b73e=a21_0x34b7();let _0x276b47=_0x34b73e[_0x4bf820];return _0x276b47;}async function getProjectIdOrDefault(_0x3a8e5f,_0x107a94){const _0x230564=a21_0x276b,{tdx:_0x2fcfd3,options:_0xc0d45b}=_0x3a8e5f,_0x472766=_0x107a94||_0xc0d45b[_0x230564(0x18b)];if(_0x472766){const _0x35bb9b=await _0x2fcfd3[_0x230564(0x1a7)][_0x230564(0x197)](),_0x585544=_0x35bb9b[_0x230564(0x190)](_0x80db4e=>_0x80db4e[_0x230564(0x1c7)][_0x230564(0x193)]===_0x472766);if(!_0x585544)throw new SDKError(ErrorCode[_0x230564(0x1a4)],_0x230564(0x1a3)+_0x472766+_0x230564(0x19e),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x585544['id'];}const _0x35d39f=await _0x2fcfd3['llm']['getOrCreateDefaultProject']();return _0x35d39f['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x1df827(0x193)]='llm:proxy';[a21_0x1df827(0x1b8)]=a21_0x1df827(0x1a2);['server'];[a21_0x1df827(0x191)];async[a21_0x1df827(0x19b)](_0x5e8cc6){const _0x430078=a21_0x1df827,{tdx:_0x3fcc78,options:_0x31d28a}=_0x5e8cc6;try{const _0x15b9e8=_0x31d28a,_0x324e95=_0x15b9e8[_0x430078(0x1a9)]||0xfa0,_0x238cb3=_0x15b9e8[_0x430078(0x1a0)],_0x32d3f5=await findAvailablePort(_0x324e95);console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1ab)));const _0x7d1bd2=await getProjectIdOrDefault(_0x5e8cc6,_0x238cb3),_0x3789b6=await _0x3fcc78[_0x430078(0x1a7)]['projects'](),_0x568655=_0x3789b6['find'](_0x33f548=>_0x33f548['id']===_0x7d1bd2);this[_0x430078(0x191)]=new TDXLogger(_0x31d28a['logLevel']),await this[_0x430078(0x191)][_0x430078(0x1b7)](),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1bb)));_0x32d3f5!==_0x324e95&&console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)](_0x430078(0x19d)+_0x324e95+'\x20is\x20unavailable,\x20using\x20port\x20'+_0x32d3f5));this['server']=new ProxyServer({'port':_0x32d3f5,'projectId':_0x7d1bd2,'tdx':_0x3fcc78,'logger':this['logger'],'site':_0x31d28a['site']}),await this[_0x430078(0x1c6)][_0x430078(0x194)](),console['log'](a21_0x5a29a2[_0x430078(0x18a)][_0x430078(0x1a6)](_0x430078(0x188))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)](_0x430078(0x1c5))),console[_0x430078(0x19c)](a21_0x5a29a2['yellow'](_0x430078(0x1c0))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18c)][_0x430078(0x1a6)](_0x430078(0x1b4))),console['log'](a21_0x5a29a2[_0x430078(0x1bf)](_0x430078(0x1aa))),console['log'](a21_0x5a29a2['dim'](_0x430078(0x1b1)),a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1a8)+_0x32d3f5)),console[_0x430078(0x19c)](a21_0x5a29a2['dim']('\x20\x20Project:'),a21_0x5a29a2[_0x430078(0x18d)](_0x568655?.['attributes']['name']||_0x7d1bd2)),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x18f)),a21_0x5a29a2['white']('created\x20on-demand\x20per\x20model')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1bc)),a21_0x5a29a2[_0x430078(0x18d)](_0x31d28a[_0x430078(0x19f)])),console['log'](a21_0x5a29a2[_0x430078(0x1bf)](_0x430078(0x18e))),console[_0x430078(0x19c)](a21_0x5a29a2['dim'](_0x430078(0x1ad))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1c8))),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1c4))),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1a5)+_0x32d3f5+'\x22,')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22')),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1ac))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1b0))),console[_0x430078(0x19c)](a21_0x5a29a2['cyan'](_0x430078(0x1b6))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1b3))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1af))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x174dca=async()=>{const _0x1e6bae=_0x430078;console[_0x1e6bae(0x19c)](a21_0x5a29a2['dim'](_0x1e6bae(0x1c1))),this[_0x1e6bae(0x1c6)]&&await this[_0x1e6bae(0x1c6)]['stop'](),this[_0x1e6bae(0x191)]&&await this[_0x1e6bae(0x191)][_0x1e6bae(0x192)](),console['log'](a21_0x5a29a2[_0x1e6bae(0x18c)](_0x1e6bae(0x1c3))),process[_0x1e6bae(0x1b9)](0x0);};return process['on'](_0x430078(0x1ba),_0x174dca),process['on'](_0x430078(0x1bd),_0x174dca),await new Promise(()=>{}),0x0;}catch(_0x4f6a64){this[_0x430078(0x1c6)]&&await this['server'][_0x430078(0x19a)]();this[_0x430078(0x191)]&&await this['logger'][_0x430078(0x192)]();throw _0x4f6a64;}}}
1
+ const a21_0x393efe=a21_0x4fd2;(function(_0x43f428,_0x286fe2){const _0x108b61=a21_0x4fd2,_0x228363=_0x43f428();while(!![]){try{const _0x2be88e=parseInt(_0x108b61(0x223))/0x1*(parseInt(_0x108b61(0x222))/0x2)+-parseInt(_0x108b61(0x1f3))/0x3+parseInt(_0x108b61(0x1eb))/0x4*(-parseInt(_0x108b61(0x226))/0x5)+parseInt(_0x108b61(0x217))/0x6*(-parseInt(_0x108b61(0x204))/0x7)+-parseInt(_0x108b61(0x20f))/0x8*(parseInt(_0x108b61(0x202))/0x9)+-parseInt(_0x108b61(0x1ff))/0xa*(-parseInt(_0x108b61(0x1f8))/0xb)+parseInt(_0x108b61(0x221))/0xc*(parseInt(_0x108b61(0x216))/0xd);if(_0x2be88e===_0x286fe2)break;else _0x228363['push'](_0x228363['shift']());}catch(_0xa8d82b){_0x228363['push'](_0x228363['shift']());}}}(a21_0x9058,0x9b858));function a21_0x9058(){const _0x93374e=['Server\x20Configuration:','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','green','1247784Cduhpp','3290VtEDzI','123xnGnsq','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x0aClaude\x20Code\x20Configuration:','29570ByJxCB','Resolving\x20project...','llm','dim','site','✓\x20Proxy\x20server\x20stopped','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20Project:','close','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','Starting\x20proxy\x20server...','log','init','608YvXsJu','Port\x20','logger','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,','SIGTERM','http://0.0.0.0:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','logLevel','1247433XrWCEY','yellow','\x20\x20}','SIGINT','exit','33kyTjqG','cyan','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','name','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','projects','\x27\x20not\x20found','3611430PqYVAL','execute','server','99iQIwqU','\x0aTesting\x20with\x20Agent\x20SDK:','25907wlDOfB','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','description','\x20is\x20unavailable,\x20using\x20port\x20','Project\x20\x27','\x20\x20\x20\x20\x22env\x22:\x20{','getOrCreateDefaultProject','attributes','\x20\x20Address:','NOT_FOUND','\x20\x20Site:','220992JLNODG','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','\x20\x20Agents:','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','port','\x20\x20{','\x20\x20\x20\x20}','143QpvTFV','282acdsyM','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','project','white','llm:proxy','created\x20on-demand\x20per\x20model','find'];a21_0x9058=function(){return _0x93374e;};return a21_0x9058();}import a21_0x432180 from'chalk';import{BaseCommand}from'./command.js';function a21_0x4fd2(_0x5c5c10,_0x5229a1){_0x5c5c10=_0x5c5c10-0x1eb;const _0x90586f=a21_0x9058();let _0x4fd27d=_0x90586f[_0x5c5c10];return _0x4fd27d;}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';async function getProjectIdOrDefault(_0x540638,_0x31a1c3){const _0x52219b=a21_0x4fd2,{tdx:_0x254284,options:_0x387419}=_0x540638,_0x1bb4b3=_0x31a1c3||_0x387419['llmProject'];if(_0x1bb4b3){const _0x42dfbb=await _0x254284[_0x52219b(0x228)][_0x52219b(0x1fd)](),_0xeeb0a6=_0x42dfbb[_0x52219b(0x21d)](_0x58350e=>_0x58350e[_0x52219b(0x20b)][_0x52219b(0x1fb)]===_0x1bb4b3);if(!_0xeeb0a6)throw new SDKError(ErrorCode[_0x52219b(0x20d)],_0x52219b(0x208)+_0x1bb4b3+_0x52219b(0x1fe),undefined,{'helpText':_0x52219b(0x205)});return _0xeeb0a6['id'];}const _0x4eb610=await _0x254284[_0x52219b(0x228)][_0x52219b(0x20a)]();return _0x4eb610['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x393efe(0x1fb)]=a21_0x393efe(0x21b);[a21_0x393efe(0x206)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a21_0x393efe(0x201)];[a21_0x393efe(0x1ed)];async[a21_0x393efe(0x200)](_0x38d6a8){const _0x9e98de=a21_0x393efe,{tdx:_0xde0438,options:_0x403c16}=_0x38d6a8;try{const _0x13f973=_0x403c16,_0x4d4592=_0x13f973[_0x9e98de(0x213)]||0xfa0,_0x5324fd=_0x13f973[_0x9e98de(0x219)],_0x218fdd=await findAvailablePort(_0x4d4592);console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x227)));const _0x1d7b66=await getProjectIdOrDefault(_0x38d6a8,_0x5324fd),_0x352092=await _0xde0438[_0x9e98de(0x228)][_0x9e98de(0x1fd)](),_0x3eb420=_0x352092['find'](_0x3b7627=>_0x3b7627['id']===_0x1d7b66);this[_0x9e98de(0x1ed)]=new TDXLogger(_0x403c16[_0x9e98de(0x1f2)]),await this[_0x9e98de(0x1ed)][_0x9e98de(0x232)](),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x230)));_0x218fdd!==_0x4d4592&&console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x1f4)](_0x9e98de(0x1ec)+_0x4d4592+_0x9e98de(0x207)+_0x218fdd));this['server']=new ProxyServer({'port':_0x218fdd,'projectId':_0x1d7b66,'tdx':_0xde0438,'logger':this[_0x9e98de(0x1ed)],'site':_0x403c16[_0x9e98de(0x22a)]}),await this['server']['start'](),console['log'](a21_0x432180['yellow']['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console['log'](a21_0x432180[_0x9e98de(0x1f4)](_0x9e98de(0x1fa))),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x1f4)]('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x220)]['bold'](_0x9e98de(0x224))),console[_0x9e98de(0x231)](a21_0x432180['cyan'](_0x9e98de(0x21e))),console[_0x9e98de(0x231)](a21_0x432180['dim'](_0x9e98de(0x20c)),a21_0x432180[_0x9e98de(0x21a)](_0x9e98de(0x1f0)+_0x218fdd)),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x22d)),a21_0x432180['white'](_0x3eb420?.[_0x9e98de(0x20b)][_0x9e98de(0x1fb)]||_0x1d7b66)),console['log'](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x211)),a21_0x432180[_0x9e98de(0x21a)](_0x9e98de(0x21c))),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x20e)),a21_0x432180[_0x9e98de(0x21a)](_0x403c16[_0x9e98de(0x22a)])),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x1f9)](_0x9e98de(0x225))),console[_0x9e98de(0x231)](a21_0x432180['dim'](_0x9e98de(0x1fc))),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x21a)](_0x9e98de(0x214))),console['log'](a21_0x432180[_0x9e98de(0x21a)](_0x9e98de(0x209))),console['log'](a21_0x432180[_0x9e98de(0x21a)](_0x9e98de(0x218)+_0x218fdd+'\x22,')),console[_0x9e98de(0x231)](a21_0x432180['white'](_0x9e98de(0x1ee))),console['log'](a21_0x432180[_0x9e98de(0x21a)](_0x9e98de(0x1f1))),console[_0x9e98de(0x231)](a21_0x432180['white'](_0x9e98de(0x215))),console[_0x9e98de(0x231)](a21_0x432180['white'](_0x9e98de(0x1f5))),console['log'](a21_0x432180[_0x9e98de(0x1f9)](_0x9e98de(0x203))),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x210))),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x21f))),console['log'](a21_0x432180[_0x9e98de(0x229)](_0x9e98de(0x212))),console[_0x9e98de(0x231)](a21_0x432180[_0x9e98de(0x1f4)](_0x9e98de(0x22f)));const _0x102a77=async()=>{const _0x1305be=_0x9e98de;console[_0x1305be(0x231)](a21_0x432180[_0x1305be(0x229)](_0x1305be(0x22c))),this[_0x1305be(0x201)]&&await this['server']['stop'](),this[_0x1305be(0x1ed)]&&await this['logger'][_0x1305be(0x22e)](),console[_0x1305be(0x231)](a21_0x432180['green'](_0x1305be(0x22b))),process[_0x1305be(0x1f7)](0x0);};return process['on'](_0x9e98de(0x1f6),_0x102a77),process['on'](_0x9e98de(0x1ef),_0x102a77),await new Promise(()=>{}),0x0;}catch(_0x41e738){this[_0x9e98de(0x201)]&&await this[_0x9e98de(0x201)]['stop']();this[_0x9e98de(0x1ed)]&&await this[_0x9e98de(0x1ed)][_0x9e98de(0x22e)]();throw _0x41e738;}}}
@@ -1 +1 @@
1
- const a22_0x22549a=a22_0x4ac6;(function(_0x1ccf30,_0x2fb6ad){const _0x31df45=a22_0x4ac6,_0x5a1209=_0x1ccf30();while(!![]){try{const _0x4c91e2=parseInt(_0x31df45(0x260))/0x1*(-parseInt(_0x31df45(0x216))/0x2)+parseInt(_0x31df45(0x286))/0x3+parseInt(_0x31df45(0x177))/0x4+parseInt(_0x31df45(0x28d))/0x5*(parseInt(_0x31df45(0x17f))/0x6)+parseInt(_0x31df45(0x19c))/0x7*(-parseInt(_0x31df45(0x22a))/0x8)+-parseInt(_0x31df45(0x244))/0x9+-parseInt(_0x31df45(0x1d5))/0xa*(-parseInt(_0x31df45(0x1b9))/0xb);if(_0x4c91e2===_0x2fb6ad)break;else _0x5a1209['push'](_0x5a1209['shift']());}catch(_0x66fc84){_0x5a1209['push'](_0x5a1209['shift']());}}}(a22_0x1a89,0x49c7b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x39ae17 from'path';function a22_0x4ac6(_0x2d6db6,_0x5c412c){_0x2d6db6=_0x2d6db6-0x16d;const _0x1a89f1=a22_0x1a89();let _0x4ac6a0=_0x1a89f1[_0x2d6db6];return _0x4ac6a0;}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a22_0x1a89(){const _0x1452f=['Fetching\x20parent\x20segment\x20\x27','coveragePercent','Options\x20(one\x20required):\x0a','\x5c$&','\x20\x20No\x20sample\x20data\x20available','allValid','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','label','Updating','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20parent\x20segment\x20\x27','Master\x20+\x20Attributes','rowCount','cyan','\x20Opening\x20','Events:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','apply','Validating\x20configuration...','schemaError','segment:parent:run','red','.yml','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','13332tjEVgn','unref','customerPercent','information_schema','table','\x20parent\x20segment','\x0a⚠️\x20\x20Both\x20','name','Created','\x20--enriched','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Output\x20file:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','parent_segment','Fetching\x20current\x20configuration\x20for\x20\x27','filter','\x20Configuration\x20is\x20valid','start','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Available\x20attributes:','interval','length','Apply\x20changes\x20to\x20\x27','\x20--behavior\x20\x22<name>\x22','780njoUet','customerGroup','SELECT\x20*\x20FROM\x20(\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Fetching\x20SQL\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','log','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','message','Create\x20parent\x20segment\x20\x27','ignore','preview','Join:','attributesFile','output','enriched','segment:parent:push','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','timezone','description','Error\x20reading\x20file:\x20','/\x20and\x20','Preview:','Enriched:','workflowId','green','Master\x20Table','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','test','verbose','string','bold','behaviorsFile','scheduleType','match','errors','\x20rows\x20','attribute','getParentFull','stop','/\x20directories\x20exist.','\x20--behavior\x20\x22','totalEvents','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Renamed\x20directory\x20to\x20','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','✔\x20Updated\x20parent\x20segment\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','database','Listing\x20parent\x20segments...','Analyzing\x20changes...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerGroupFile','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','addBehaviors','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:validate','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SQL\x20query:\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','keys','parentSegment','displaySampleData','236AGouDd','status','trim','Creating','Rows:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','segment:parent:view','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:','No\x20parent\x20segments\x20match\x20pattern:\x20','Resolving\x20parent\x20segment\x20\x27','scheduleOption','json','Found\x20YAML\x20file:\x20','Show\x20parent\x20segment\x20details','Attributes','\x0a⚠️\x20\x20Migrating:\x20','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','format','customersWithEvents','32QDUbfl','error','\x20is\x20already\x20up\x20to\x20date','schemaValid','master','win32','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','createParent','\x0a✔\x20Workflow\x20started','site','localeCompare','displayPreviewHints','query','To\x20cancel:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','👥\x20','Executing\x20parent\x20segment\x20query...','/sessions/','Updated','getParentSQL','replace','toFixed','\x0aNo\x20sample\x20data\x20available','run','setJobId','YAML\x20file:\x20','4781853Vglxaq','pushParentYaml','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','.yaml','runParent','platform','join','Source:','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Columns:','Master:','using\x20the\x20default\x20path:\x20','Parent\x20segment:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Options:\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','workflowAttemptId','\x20=\x20','Fetching\x20sample\x20data...','Table:\x20','\x27...','Site:\x20','matchedCount','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','1986QUJPnk','utf-8','joinKey','endsWith','\x20--attribute\x20\x22<name>\x22','workflowSessionId','Error:\x20File\x20not\x20found:\x20','Creating\x20parent\x20segment\x20\x27','pullParentYaml','segment','Options:','tdx\x20segment\x20parent\x20preview\x20','yes','List\x20parent\x20segments','execute','-1d','columns','elapsedTimeMillis','displayBehaviorsStats','✘\x20Failed\x20to\x20rename\x20directory:\x20','displayPreviewResults','Errors:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','use','Error:\x20--database\x20and\x20--table\x20are\x20required','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','text','\x20[Job\x20ID:\x20','repeat','addAttributesFile','segment:parent:pull','\x20\x20\x20\x20-\x20','✔\x20Created\x20parent\x20segment\x20\x27','Audience\x20ID:','number','open','No\x20parent\x20segments\x20found','640557nfSNdk','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Overwrite\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','population','validateParentYaml','stats','5KJKegc','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','segment:parent:preview','segment:parent:fields','displayColumns','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','displayValidateResults','displaySummary','all','\x20--attribute\x20\x22','segment:parent:sql','jobId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Join\x20on:','foreignKey','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','2026116tvZkbu','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','updateParent','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','behaviors','attributes','addBehaviorsFile','3098688Tifydk','map','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','jsonl','parent_segments','Aborted.','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:show','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','column','\x0aNew\x20parent\x20segment\x20\x27','in\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','data','Attempt:','resolveParentId','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Attribute:','yellow','FINISHED','behavior','displayAttributesStats','Error\x20parsing\x20YAML:\x20','isDirectory','addAttributes','✔\x20Found\x20','Updating\x20parent\x20segment\x20\x27','460537CbVVHh','/app/dw/parentSegments/','processedRows'];a22_0x1a89=function(){return _0x1452f;};return a22_0x1a89();}import a22_0x36549d from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x22549a(0x183),LEGACY_PARENT_SEGMENT_DIR=a22_0x22549a(0x1c9);function openBrowser(_0x5e351e){const _0x2284d7=a22_0x22549a,_0x57b985=process[_0x2284d7(0x249)],_0x33d1b9=_0x57b985==='darwin'?_0x2284d7(0x284):_0x57b985===_0x2284d7(0x22f)?_0x2284d7(0x1cd):'xdg-open';spawn(_0x33d1b9,[_0x5e351e],{'detached':!![],'stdio':_0x2284d7(0x1df)})[_0x2284d7(0x1ba)]();}function migrateLegacyDirectory(){const _0x5b7820=a22_0x22549a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2f0b07=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2f0b07[_0x5b7820(0x198)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5b7820(0x22b)](a22_0x36549d['yellow'](_0x5b7820(0x1bf)+LEGACY_PARENT_SEGMENT_DIR+_0x5b7820(0x1ea)+PARENT_SEGMENT_DIR+_0x5b7820(0x1fe))),console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x1a8)](_0x5b7820(0x1b8)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x193)](_0x5b7820(0x226)+LEGACY_PARENT_SEGMENT_DIR+_0x5b7820(0x204)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5b7820(0x22b)](a22_0x36549d['green'](_0x5b7820(0x202)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1ad60e){const _0x152ff0=_0x1ad60e instanceof Error?_0x1ad60e['message']:String(_0x1ad60e);return console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x1b5)](_0x5b7820(0x273)+_0x152ff0+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x22549a(0x241)](_0xf77b9b){const _0x1f71be=a22_0x22549a;return migrateLegacyDirectory(),super[_0x1f71be(0x241)](_0xf77b9b);}}function resolveYamlFile(_0x12d1a7){const _0x51f48a=a22_0x22549a;if(_0x12d1a7[_0x51f48a(0x263)]('.yml')||_0x12d1a7['endsWith'](_0x51f48a(0x247)))return _0x12d1a7;return a22_0x39ae17['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x12d1a7)+'.yml');}function formatProgressMessage(_0x2e73b2){const _0x1fafb=a22_0x22549a,_0x3a9f37=_0x2e73b2[_0x1fafb(0x1f8)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3a9f37){const [,_0x541a48,_0x5efb52,_0x2caeb2='']=_0x3a9f37;return a22_0x36549d[_0x1fafb(0x1a8)](_0x541a48+':')+'\x20'+_0x5efb52+a22_0x36549d[_0x1fafb(0x1a8)](_0x2caeb2);}return a22_0x36549d['dim'](_0x2e73b2);}function showFileNotFoundError(_0x10ae29,_0x408bcf){const _0x5574f7=a22_0x22549a;console[_0x5574f7(0x22b)](a22_0x36549d[_0x5574f7(0x1b5)](_0x5574f7(0x266)+_0x10ae29+'\x0a')),console[_0x5574f7(0x22b)](a22_0x36549d[_0x5574f7(0x1ad)](_0x5574f7(0x191)+_0x408bcf+_0x5574f7(0x206)));}function showParentSegmentNotSetError(_0x32ef1a){const _0x4008b2=a22_0x22549a;console[_0x4008b2(0x22b)](a22_0x36549d[_0x4008b2(0x193)](_0x4008b2(0x212))),console[_0x4008b2(0x22b)](_0x32ef1a);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:list';[a22_0x22549a(0x1e8)]=a22_0x22549a(0x26d);async[a22_0x22549a(0x26e)](_0x42dbc6){const _0x3cefaf=a22_0x22549a,{options:_0x509e27,args:_0x17e5db,tdx:_0x5525e9}=_0x42dbc6,_0x484d2e=_0x17e5db[0x0];_0x509e27[_0x3cefaf(0x1f3)]&&(console[_0x3cefaf(0x22b)](_0x3cefaf(0x25d)+_0x509e27['site']),_0x484d2e&&console[_0x3cefaf(0x22b)]('Pattern:\x20'+_0x484d2e));const _0x38481e=await withSpinner(_0x484d2e?_0x3cefaf(0x1c6)+_0x484d2e+_0x3cefaf(0x25c):_0x3cefaf(0x208),()=>_0x5525e9['segment']['listParents'](),{'verbose':_0x509e27[_0x3cefaf(0x1f3)]});let _0x57213e=_0x38481e[_0x3cefaf(0x18e)];if(_0x484d2e){const _0x4cb69f=_0x484d2e[_0x3cefaf(0x23e)](/[.+^${}()|[\]\\]/g,_0x3cefaf(0x1a2))[_0x3cefaf(0x23e)](/\*/g,'.*')[_0x3cefaf(0x23e)](/\?/g,'.'),_0x16e08a=new RegExp('^'+_0x4cb69f+'$','i');_0x57213e=_0x57213e[_0x3cefaf(0x1cb)](_0x9afcb5=>_0x16e08a[_0x3cefaf(0x1f2)](_0x9afcb5[_0x3cefaf(0x17d)]['name']));}_0x57213e['sort']((_0x5be93e,_0x1870f7)=>_0x5be93e[_0x3cefaf(0x17d)]['name'][_0x3cefaf(0x234)](_0x1870f7[_0x3cefaf(0x17d)][_0x3cefaf(0x1c0)])),console[_0x3cefaf(0x22b)]('✔\x20Found\x20'+_0x57213e['length']+_0x3cefaf(0x1be)+(_0x57213e['length']!==0x1?'s':''));if(_0x509e27[_0x3cefaf(0x228)]===_0x3cefaf(0x222)||_0x509e27['format']===_0x3cefaf(0x182))await handleSDKOutput(_0x57213e,_0x509e27);else{if(_0x57213e[_0x3cefaf(0x1d2)]===0x0)_0x484d2e?console[_0x3cefaf(0x1db)](_0x3cefaf(0x21f)+_0x484d2e):console[_0x3cefaf(0x1db)](_0x3cefaf(0x285));else for(const _0x4a5af8 of _0x57213e){const _0x441eb2=_0x4a5af8['attributes'][_0x3cefaf(0x28a)]?a22_0x36549d[_0x3cefaf(0x1a8)]('\x20('+formatRows(_0x4a5af8[_0x3cefaf(0x17d)]['population'])+')'):'';console[_0x3cefaf(0x1db)](_0x3cefaf(0x239)+_0x4a5af8[_0x3cefaf(0x17d)][_0x3cefaf(0x1c0)]+_0x441eb2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:create';[a22_0x22549a(0x1e8)]=a22_0x22549a(0x246);async[a22_0x22549a(0x26e)](_0xa51246){const _0x1eaaf1=a22_0x22549a,{options:_0x1aa350,args:_0x3d3e8b,tdx:_0x2a7d17}=_0xa51246;console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x1c3)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x1eaaf1(0x188));const _0xbb1c15=_0x1aa350;if(_0x3d3e8b[_0x1eaaf1(0x1d2)]===0x0)return console[_0x1eaaf1(0x22b)](a22_0x36549d[_0x1eaaf1(0x1b5)](_0x1eaaf1(0x21d))),console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x289)),0x1;const _0x317063=_0x3d3e8b[0x0];if(!_0xbb1c15['database']||!_0xbb1c15['table'])return console['error'](_0x1eaaf1(0x278)),console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x289)),0x1;_0xbb1c15[_0x1eaaf1(0x1f3)]&&(console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x25d)+_0xbb1c15['site']),console[_0x1eaaf1(0x22b)]('Name:\x20'+_0x317063),console[_0x1eaaf1(0x22b)]('Database:\x20'+_0xbb1c15[_0x1eaaf1(0x207)]),console['error'](_0x1eaaf1(0x25b)+_0xbb1c15['table']));const _0x7d1a2=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x17d)],_0xbb1c15[_0x1eaaf1(0x1e2)]),_0x2c5447=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x17c)],_0xbb1c15[_0x1eaaf1(0x1f6)]),_0x2ad375=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x1d6)],_0xbb1c15[_0x1eaaf1(0x20b)]),_0x33b0e4={'name':_0x317063,'description':_0xbb1c15['description'],'scheduleType':_0xbb1c15[_0x1eaaf1(0x1f7)],'scheduleOption':_0xbb1c15[_0x1eaaf1(0x221)],'timezone':_0xbb1c15[_0x1eaaf1(0x1e7)],'master':{'parentDatabaseName':_0xbb1c15[_0x1eaaf1(0x207)],'parentTableName':_0xbb1c15[_0x1eaaf1(0x1bd)]},'attributes':_0x7d1a2,'behaviors':_0x2c5447,'customerGroup':_0x2ad375},_0x325a8b=await withSpinner(_0x1eaaf1(0x267)+_0x317063+_0x1eaaf1(0x25c),()=>_0x2a7d17[_0x1eaaf1(0x269)][_0x1eaaf1(0x231)](_0x33b0e4),{'verbose':_0x1aa350[_0x1eaaf1(0x1f3)]}),_0x5003eb=_0x325a8b[_0x1eaaf1(0x18e)];return console['error'](_0x1eaaf1(0x281)+_0x5003eb[_0x1eaaf1(0x1c0)]+'\x27\x20with\x20ID:\x20'+_0x5003eb['id']),await handleSDKOutput([_0x5003eb],_0x1aa350),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x22549a(0x26e)](_0x19bc40){const _0x56620e=a22_0x22549a,{options:_0x157914,args:_0xd8eaa2,tdx:_0x1ebfeb}=_0x19bc40;console['error'](_0x56620e(0x173)+_0x56620e(0x18d)+_0x56620e(0x188));const _0x3d141c=_0x157914;if(_0xd8eaa2[_0x56620e(0x1d2)]===0x0)return console[_0x56620e(0x22b)](a22_0x36549d[_0x56620e(0x1b5)](_0x56620e(0x21d))),console[_0x56620e(0x22b)](_0x56620e(0x20e)),0x1;const _0x185e26=_0xd8eaa2[0x0];_0x3d141c[_0x56620e(0x1f3)]&&(console['error'](_0x56620e(0x25d)+_0x3d141c[_0x56620e(0x233)]),console[_0x56620e(0x22b)]('Parent\x20segment:\x20'+_0x185e26));const _0x27e14b=await withSpinner(_0x56620e(0x1ca)+_0x185e26+_0x56620e(0x25c),()=>_0x1ebfeb[_0x56620e(0x269)][_0x56620e(0x1fc)](_0x185e26),{'verbose':_0x3d141c[_0x56620e(0x1f3)]}),_0x35302=_0x27e14b['data'],_0xf2eda6=await loadJSONFromOptions(_0x3d141c[_0x56620e(0x199)],_0x3d141c[_0x56620e(0x27e)]),_0x3a5981=await loadJSONFromOptions(_0x3d141c[_0x56620e(0x20d)],_0x3d141c[_0x56620e(0x17e)]),_0xc42f2c={'name':_0x35302[_0x56620e(0x1c0)],'description':_0x3d141c[_0x56620e(0x1e8)]!==undefined?_0x3d141c['description']:_0x35302[_0x56620e(0x1e8)],'scheduleType':_0x3d141c[_0x56620e(0x1f7)]!==undefined?_0x3d141c['scheduleType']:_0x35302['scheduleType'],'scheduleOption':_0x3d141c[_0x56620e(0x221)]!==undefined?_0x3d141c[_0x56620e(0x221)]:_0x35302['scheduleOption'],'timezone':_0x3d141c['timezone']!==undefined?_0x3d141c[_0x56620e(0x1e7)]:_0x35302[_0x56620e(0x1e7)],'master':_0x35302[_0x56620e(0x22e)],'attributes':_0xf2eda6?[..._0x35302[_0x56620e(0x17d)]||[],..._0xf2eda6]:_0x35302['attributes'],'behaviors':_0x3a5981?[..._0x35302['behaviors']||[],..._0x3a5981]:_0x35302[_0x56620e(0x17c)],'customerGroup':_0x35302[_0x56620e(0x1d6)]},_0xcf0157=await withSpinner(_0x56620e(0x19b)+_0x185e26+_0x56620e(0x25c),()=>_0x1ebfeb[_0x56620e(0x269)][_0x56620e(0x179)](_0x185e26,_0xc42f2c),{'verbose':_0x3d141c[_0x56620e(0x1f3)]}),_0x559faf=_0xcf0157[_0x56620e(0x18e)];return console[_0x56620e(0x22b)](_0x56620e(0x205)+_0x559faf[_0x56620e(0x1c0)]+'\x27'),await handleSDKOutput([_0x559faf],_0x3d141c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x27f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x20c);async[a22_0x22549a(0x26e)](_0x2a99ce){const _0x1dbc1d=a22_0x22549a,{options:_0x427a04,args:_0x216d88,tdx:_0xea5192}=_0x2a99ce,_0x370fbf=_0x427a04,_0x8100d5=_0x216d88[0x0]||_0x427a04[_0x1dbc1d(0x214)];if(!_0x8100d5)return showParentSegmentNotSetError(_0x1dbc1d(0x17b)+_0x1dbc1d(0x257)),0x1;if(_0x370fbf[_0x1dbc1d(0x277)]&&_0x370fbf[_0x1dbc1d(0x1e3)])return console['error'](a22_0x36549d[_0x1dbc1d(0x1b5)](_0x1dbc1d(0x185))),console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x1b0))),console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x24f)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x1dbc1d(0x22b)](a22_0x36549d['cyan'](_0x1dbc1d(0x18c))),0x1;const _0x27a676=_0x370fbf[_0x1dbc1d(0x1e3)]||a22_0x39ae17[_0x1dbc1d(0x24a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x8100d5)+_0x1dbc1d(0x1b6));_0x370fbf[_0x1dbc1d(0x1f3)]&&(console[_0x1dbc1d(0x22b)](_0x1dbc1d(0x25d)+_0x370fbf[_0x1dbc1d(0x233)]),console[_0x1dbc1d(0x22b)]('Parent\x20segment:\x20'+_0x8100d5),console['error'](_0x1dbc1d(0x1c4)+_0x27a676));const _0x5e7e28=await withSpinner(_0x1dbc1d(0x19f)+_0x8100d5+_0x1dbc1d(0x25c),()=>_0xea5192[_0x1dbc1d(0x269)][_0x1dbc1d(0x268)](_0x8100d5),{'verbose':_0x370fbf['verbose']}),_0x10743e=_0x5e7e28[_0x1dbc1d(0x18e)];if(existsSync(_0x27a676)){const _0x172a2a=readFileSync(_0x27a676,_0x1dbc1d(0x261)),_0x4e4a74=generateDiff(_0x172a2a,_0x10743e);if(!hasChanges(_0x4e4a74))console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1ee)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676)+_0x1dbc1d(0x22c));else{console[_0x1dbc1d(0x22b)]('\x0aChanges\x20to\x20\x27'+_0x27a676+'\x27:'),console[_0x1dbc1d(0x22b)]('─'[_0x1dbc1d(0x27d)](0x3c)),console['error'](formatDiffWithColors(_0x4e4a74)),console[_0x1dbc1d(0x22b)]('─'[_0x1dbc1d(0x27d)](0x3c));if(!_0x370fbf[_0x1dbc1d(0x26c)]){const _0x410cfb=await confirmKey(_0x1dbc1d(0x288)+_0x27a676+'\x27?');if(!_0x410cfb)return console[_0x1dbc1d(0x22b)]('Aborted.'),0x1;}writeFileSync(_0x27a676,_0x10743e,_0x1dbc1d(0x261)),console[_0x1dbc1d(0x22b)](a22_0x36549d['green']('✔')+_0x1dbc1d(0x276)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676));}}else{const _0x568d70=a22_0x39ae17['dirname'](_0x27a676);!existsSync(_0x568d70)&&mkdirSync(_0x568d70,{'recursive':!![]}),writeFileSync(_0x27a676,_0x10743e,_0x1dbc1d(0x261)),console['error'](a22_0x36549d[_0x1dbc1d(0x1ee)]('✔')+_0x1dbc1d(0x276)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676));}return saveSessionContext({'parent_segment':_0x8100d5},_0x370fbf['session']),console[_0x1dbc1d(0x22b)](a22_0x36549d['green']('✔')+'\x20Context\x20set:\x20'+a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x1c9))+_0x1dbc1d(0x259)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x8100d5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x1e5);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x21b);async[a22_0x22549a(0x26e)](_0x21d620){const _0x4b0244=a22_0x22549a,{options:_0xc32da2,args:_0x19505f,tdx:_0x5c220b}=_0x21d620,_0x304754=_0xc32da2,_0x323c6f=_0x19505f[0x0]||_0xc32da2[_0x4b0244(0x214)];if(!_0x323c6f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0xaff11b=resolveYamlFile(_0x323c6f);if(!existsSync(_0xaff11b))return showFileNotFoundError(_0xaff11b,_0x323c6f),0x1;_0x304754[_0x4b0244(0x1f3)]&&(console[_0x4b0244(0x22b)](_0x4b0244(0x25d)+_0x304754[_0x4b0244(0x233)]),console[_0x4b0244(0x22b)](_0x4b0244(0x243)+_0xaff11b));let _0x125a97;try{_0x125a97=readFileSync(_0xaff11b,_0x4b0244(0x261));}catch(_0x51b0ff){const _0x5b5da7=_0x51b0ff instanceof Error?_0x51b0ff['message']:String(_0x51b0ff);return console[_0x4b0244(0x22b)](_0x4b0244(0x1e9)+_0x5b5da7),0x1;}const _0xae7ab1=await withSpinner(_0x4b0244(0x209),()=>_0x5c220b['segment']['pushParentYaml'](_0x125a97),{'verbose':_0x304754['verbose']}),_0x5bd03d=_0xae7ab1[_0x4b0244(0x18e)],{isNew:_0x121833,name:_0x362f8e,hasChanges:_0x5bf0d0,diffFormatted:_0x2673a1}=_0x5bd03d;if(!_0x5bf0d0)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x362f8e+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x121833?console[_0x4b0244(0x22b)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x362f8e+'\x27:'):console['error'](_0x4b0244(0x1f1)+_0x362f8e+'\x27:');console[_0x4b0244(0x22b)]('─'[_0x4b0244(0x27d)](0x3c)),console['error'](_0x2673a1),console[_0x4b0244(0x22b)]('─'['repeat'](0x3c));const _0x37a2cf=_0x121833?_0x4b0244(0x1de)+_0x362f8e+'\x27?':_0x4b0244(0x1d3)+_0x362f8e+'\x27?';if(!_0x304754[_0x4b0244(0x26c)]){const _0x1ae600=await confirmKey(_0x37a2cf);if(!_0x1ae600)return console['error'](_0x4b0244(0x184)),0x1;}const _0x1c6056=_0x121833?_0x4b0244(0x219):_0x4b0244(0x1a7),_0x3880b2=await withSpinner(_0x1c6056+_0x4b0244(0x1aa)+_0x362f8e+_0x4b0244(0x25c),()=>_0x5bd03d[_0x4b0244(0x1b1)](),{'verbose':_0x304754[_0x4b0244(0x1f3)]}),_0x3f3721=_0x3880b2[_0x4b0244(0x18e)],_0x3f0840=getConsoleNextUrl(_0x304754[_0x4b0244(0x233)],_0x4b0244(0x19d)+_0x3f3721['id']),_0x5e6717=_0x121833?_0x4b0244(0x1c1):_0x4b0244(0x23c);return console[_0x4b0244(0x22b)]('✔\x20'+_0x5e6717+_0x4b0244(0x1aa)+_0x3f3721[_0x4b0244(0x1c0)]+'\x27'),console['error']('\x20\x20'+_0x3f0840),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x20f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x178);async['execute'](_0x38a5ec){const _0x33079a=a22_0x22549a,{options:_0xff182f,args:_0x13c778,tdx:_0x336610}=_0x38a5ec,_0x3bde6c=_0xff182f,_0x37d794=_0x13c778[0x0]||_0xff182f[_0x33079a(0x214)];if(!_0x37d794)return showParentSegmentNotSetError(_0x33079a(0x255)+_0x33079a(0x1a9)+'Options:\x0a'+_0x33079a(0x287)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x33079a(0x17a)),0x1;const _0x1bedc1=resolveYamlFile(_0x37d794);if(!existsSync(_0x1bedc1))return showFileNotFoundError(_0x1bedc1,_0x37d794),0x1;_0x3bde6c['verbose']&&(console[_0x33079a(0x22b)](_0x33079a(0x25d)+_0x3bde6c[_0x33079a(0x233)]),console[_0x33079a(0x22b)](_0x33079a(0x243)+_0x1bedc1));let _0x5f56cc;try{_0x5f56cc=readFileSync(_0x1bedc1,_0x33079a(0x261));}catch(_0x228200){const _0x54d769=_0x228200 instanceof Error?_0x228200[_0x33079a(0x1dd)]:String(_0x228200);return console[_0x33079a(0x22b)](_0x33079a(0x1e9)+_0x54d769),0x1;}const _0x4a3eaa=createCommandSpinner(a22_0x36549d[_0x33079a(0x1a8)](_0x33079a(0x1b2)),{'verbose':_0x3bde6c[_0x33079a(0x1f3)]});_0x4a3eaa[_0x33079a(0x1cd)]();const _0x40cbe0={'onProgress':_0x35e6d1=>{const _0x359ed8=_0x33079a;_0x4a3eaa[_0x359ed8(0x27b)]=formatProgressMessage(_0x35e6d1);}};if(_0x3bde6c[_0x33079a(0x22e)])_0x40cbe0[_0x33079a(0x22e)]=!![];if(_0x3bde6c[_0x33079a(0x1e4)])_0x40cbe0[_0x33079a(0x1e4)]=!![];_0x3bde6c[_0x33079a(0x1fb)]&&(_0x40cbe0[_0x33079a(0x1fb)]=_0x3bde6c[_0x33079a(0x1fb)]);_0x3bde6c[_0x33079a(0x195)]&&(_0x40cbe0['behavior']=_0x3bde6c[_0x33079a(0x195)]);if(_0x3bde6c[_0x33079a(0x1d1)])_0x40cbe0[_0x33079a(0x1d1)]=_0x3bde6c['interval'];let _0x86e829;try{_0x86e829=await _0x336610[_0x33079a(0x269)][_0x33079a(0x28b)](_0x5f56cc,_0x40cbe0),_0x4a3eaa[_0x33079a(0x1fd)]();}catch(_0x46d833){_0x4a3eaa[_0x33079a(0x1fd)]();throw _0x46d833;}const _0x2eba83=_0x3bde6c[_0x33079a(0x1d1)]||_0x33079a(0x26f);return this['displayValidateResults'](_0x86e829,_0x40cbe0,_0x1bedc1,_0x2eba83),_0x86e829[_0x33079a(0x1a4)]?0x0:0x1;}[a22_0x22549a(0x16d)](_0x1ab728,_0x2abda4,_0xae0bae,_0x2a04cf){const _0x44853c=a22_0x22549a;console['error']('\x0a'+a22_0x36549d[_0x44853c(0x1f5)]('Validate:')+'\x20'+_0x1ab728['name']),console[_0x44853c(0x22b)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x1ab728);if(typeof _0x2abda4[_0x44853c(0x1fb)]===_0x44853c(0x1f4)){this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x1fb),_0x2abda4[_0x44853c(0x1fb)]);return;}if(_0x2abda4['attribute']===!![]){this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,'attributes');return;}if(typeof _0x2abda4['behavior']===_0x44853c(0x1f4)){this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this['displaySummary'](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,'behavior',_0x2abda4[_0x44853c(0x195)]);return;}if(_0x2abda4['behavior']===!![]){this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x17c));return;}this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x16f));}[a22_0x22549a(0x235)](_0x329a78,_0x43a725,_0x512bba,_0x5037a2){const _0x43fcbd=a22_0x22549a;console[_0x43fcbd(0x22b)]('\x0a'+a22_0x36549d[_0x43fcbd(0x1a8)]('To\x20view\x20sample\x20data:'));const _0x1d1b6a=_0x43a725!=='-1d'?'\x20--interval\x20'+_0x43a725:'';if(_0x512bba==='attribute'&&_0x5037a2)console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d['dim'](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x170)+_0x5037a2+'\x22'+_0x1d1b6a));else{if(_0x512bba==='behavior'&&_0x5037a2)console['error']('\x20\x20'+a22_0x36549d['dim'](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x1ff)+_0x5037a2+'\x22'+_0x1d1b6a));else(_0x512bba===_0x43fcbd(0x17d)||_0x512bba===_0x43fcbd(0x16f))&&console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x264)+_0x1d1b6a));}(_0x512bba===_0x43fcbd(0x17c)||_0x512bba===_0x43fcbd(0x16f))&&console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)]('tdx\x20segment\x20parent\x20preview\x20'+_0x329a78+_0x43fcbd(0x1d4)+_0x1d1b6a)),_0x512bba===_0x43fcbd(0x16f)&&console['error']('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)]('tdx\x20segment\x20parent\x20preview\x20'+_0x329a78+_0x43fcbd(0x1c2)+_0x1d1b6a));}['displayMasterInfo'](_0x755bb2){const _0xda9fe6=a22_0x22549a,{master:_0x51c4ce}=_0x755bb2,_0x199bfe=_0x51c4ce[_0xda9fe6(0x22d)]?a22_0x36549d[_0xda9fe6(0x1ee)]('✔'):a22_0x36549d[_0xda9fe6(0x1b5)]('✘');console['error']('\x0a'+a22_0x36549d[_0xda9fe6(0x1a8)](_0xda9fe6(0x1ef))),console[_0xda9fe6(0x22b)](_0x199bfe+'\x20'+a22_0x36549d[_0xda9fe6(0x1f5)](_0x51c4ce[_0xda9fe6(0x207)]+'.'+_0x51c4ce['table'])),_0x51c4ce['schemaValid']?_0x51c4ce[_0xda9fe6(0x1ac)]!==undefined&&console[_0xda9fe6(0x22b)]('\x20\x20'+a22_0x36549d[_0xda9fe6(0x1a8)](_0xda9fe6(0x21a))+'\x20'+a22_0x36549d[_0xda9fe6(0x1ad)](formatRows(_0x51c4ce[_0xda9fe6(0x1ac)]))):console[_0xda9fe6(0x22b)]('\x20\x20'+a22_0x36549d[_0xda9fe6(0x1b5)](_0xda9fe6(0x21e))+'\x20'+_0x51c4ce[_0xda9fe6(0x1b3)]);}[a22_0x22549a(0x196)](_0x152dcc){const _0x5372e1=a22_0x22549a;if(_0x152dcc['attributes'][_0x5372e1(0x1d2)]===0x0)return;console['error']('\x0a'+a22_0x36549d['dim'](_0x5372e1(0x225)));for(const _0x29586f of _0x152dcc[_0x5372e1(0x17d)]){const _0x5e3892=_0x29586f['schemaValid']?a22_0x36549d['green']('✔'):a22_0x36549d['red']('✘');let _0x5853ef='';if(_0x29586f['schemaValid']&&_0x29586f['matchedCount']!==undefined&&_0x29586f[_0x5372e1(0x1a0)]!==undefined){const _0x19eaf3=_0x29586f[_0x5372e1(0x1a0)][_0x5372e1(0x23f)](0x1),_0x23fe4c=_0x29586f[_0x5372e1(0x1a0)]>=0x50?a22_0x36549d['green']:_0x29586f[_0x5372e1(0x1a0)]>=0x32?a22_0x36549d[_0x5372e1(0x193)]:a22_0x36549d['red'];_0x5853ef='\x20'+a22_0x36549d[_0x5372e1(0x1a8)]('Coverage:')+'\x20'+_0x23fe4c(_0x19eaf3+'%')+'\x20('+formatRows(_0x29586f[_0x5372e1(0x25e)])+'\x20rows)';}console['error'](_0x5e3892+'\x20'+a22_0x36549d[_0x5372e1(0x1f5)](_0x29586f[_0x5372e1(0x1c0)])+_0x5853ef),console[_0x5372e1(0x22b)]('\x20\x20'+a22_0x36549d[_0x5372e1(0x1a8)]('Source:')+'\x20'+a22_0x36549d[_0x5372e1(0x1f5)](_0x29586f[_0x5372e1(0x207)]+'.'+_0x29586f['table']));const _0x45f4f6=_0x29586f['joinKey']===_0x29586f[_0x5372e1(0x175)]?a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x174))+'\x20'+_0x29586f[_0x5372e1(0x262)]:a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x1e1))+'\x20'+_0x29586f['joinKey']+_0x5372e1(0x259)+_0x29586f[_0x5372e1(0x175)];console['error']('\x20\x20'+_0x45f4f6),console[_0x5372e1(0x22b)]('\x20\x20'+a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x24d))),this['displayColumns'](_0x29586f[_0x5372e1(0x270)]),!_0x29586f[_0x5372e1(0x22d)]&&console['error']('\x20\x20'+a22_0x36549d[_0x5372e1(0x1b5)](_0x5372e1(0x21e))+'\x20'+_0x29586f['schemaError']);}}[a22_0x22549a(0x272)](_0x4b9ebc,_0x2a3f21){const _0x5cd7f0=a22_0x22549a;if(_0x4b9ebc['behaviors'][_0x5cd7f0(0x1d2)]===0x0)return;console[_0x5cd7f0(0x22b)]('\x0a'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x256))+'\x20'+a22_0x36549d['dim']('('+_0x2a3f21+')'));for(const _0x3c0938 of _0x4b9ebc[_0x5cd7f0(0x17c)]){const _0x4ef817=_0x3c0938[_0x5cd7f0(0x22d)]?a22_0x36549d['green']('✔'):a22_0x36549d[_0x5cd7f0(0x1b5)]('✘');let _0x27ee7b='';if(_0x3c0938['schemaValid']&&_0x3c0938[_0x5cd7f0(0x229)]!==undefined&&_0x3c0938[_0x5cd7f0(0x200)]!==undefined){const _0x42ceaa=_0x3c0938[_0x5cd7f0(0x1bb)]?.[_0x5cd7f0(0x23f)](0x1)||'?',_0x593fe3=(_0x3c0938[_0x5cd7f0(0x1bb)]??0x0)>=0x32?a22_0x36549d['green']:(_0x3c0938['customerPercent']??0x0)>=0x14?a22_0x36549d[_0x5cd7f0(0x193)]:a22_0x36549d['red'];_0x27ee7b='\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)]('Customers:')+'\x20'+_0x593fe3(formatRows(_0x3c0938[_0x5cd7f0(0x229)]))+'\x20('+_0x42ceaa+'%)\x20'+a22_0x36549d['dim'](_0x5cd7f0(0x1af))+'\x20'+a22_0x36549d['cyan'](formatRows(_0x3c0938[_0x5cd7f0(0x200)]));}console[_0x5cd7f0(0x22b)](_0x4ef817+'\x20'+a22_0x36549d[_0x5cd7f0(0x1f5)](_0x3c0938[_0x5cd7f0(0x1c0)])+_0x27ee7b),console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x24b))+'\x20'+a22_0x36549d[_0x5cd7f0(0x1f5)](_0x3c0938['database']+'.'+_0x3c0938[_0x5cd7f0(0x1bd)]));const _0x5765d7=_0x3c0938[_0x5cd7f0(0x262)]===_0x3c0938[_0x5cd7f0(0x175)]?a22_0x36549d['dim']('Join\x20on:')+'\x20'+_0x3c0938[_0x5cd7f0(0x262)]:a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x1e1))+'\x20'+_0x3c0938['joinKey']+_0x5cd7f0(0x259)+_0x3c0938['foreignKey'];console[_0x5cd7f0(0x22b)]('\x20\x20'+_0x5765d7),console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x24d))),this[_0x5cd7f0(0x291)](_0x3c0938[_0x5cd7f0(0x270)]),!_0x3c0938[_0x5cd7f0(0x22d)]&&console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d['red'](_0x5cd7f0(0x21e))+'\x20'+_0x3c0938[_0x5cd7f0(0x1b3)]);}}['displayColumns'](_0x3270f4){const _0x7e99d0=a22_0x22549a;for(const _0x4f24eb of _0x3270f4){_0x4f24eb[_0x7e99d0(0x1a6)]===_0x4f24eb[_0x7e99d0(0x189)]||_0x4f24eb[_0x7e99d0(0x189)]==='*'?console[_0x7e99d0(0x22b)](_0x7e99d0(0x280)+_0x4f24eb['label']):console['error'](_0x7e99d0(0x280)+_0x4f24eb[_0x7e99d0(0x1a6)]+'\x20'+a22_0x36549d['dim']('('+_0x4f24eb['column']+')'));}}[a22_0x22549a(0x16e)](_0x5e71bc){const _0x437301=a22_0x22549a;console['error']('─'[_0x437301(0x27d)](0x3c));if(_0x5e71bc[_0x437301(0x1f9)][_0x437301(0x1d2)]>0x0){console['error']('\x0a'+a22_0x36549d[_0x437301(0x1b5)](_0x437301(0x275)));for(const _0x369bcf of _0x5e71bc[_0x437301(0x1f9)]){console[_0x437301(0x22b)]('\x20\x20'+a22_0x36549d[_0x437301(0x1b5)]('•')+'\x20'+_0x369bcf);}}_0x5e71bc[_0x437301(0x1a4)]&&console[_0x437301(0x22b)]('\x0a'+a22_0x36549d[_0x437301(0x1ee)]('✔')+_0x437301(0x1cc));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x28f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x201);async['execute'](_0x418709){const _0x2beb3f=a22_0x22549a,{options:_0x24ee03,args:_0x3196cc,tdx:_0x275b71}=_0x418709,_0x303e12=_0x24ee03,_0xed1d=_0x3196cc[0x0]||_0x24ee03['parentSegment'];if(!_0xed1d)return showParentSegmentNotSetError(_0x2beb3f(0x254)+_0x2beb3f(0x1cf)+_0x2beb3f(0x1a1)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x2beb3f(0x252)+_0x2beb3f(0x1da)+_0x2beb3f(0x251)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x303e12['master']&&!_0x303e12[_0x2beb3f(0x1fb)]&&!_0x303e12[_0x2beb3f(0x195)]&&!_0x303e12[_0x2beb3f(0x1e4)])return console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x210))),console[_0x2beb3f(0x22b)](_0x2beb3f(0x24c)),console['error'](_0x2beb3f(0x26a)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x1a5)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x176)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x20a)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x181)),0x1;const _0x5345db=resolveYamlFile(_0xed1d);if(!existsSync(_0x5345db))return showFileNotFoundError(_0x5345db,_0xed1d),0x1;_0x303e12['verbose']&&(console[_0x2beb3f(0x22b)](_0x2beb3f(0x25d)+_0x303e12[_0x2beb3f(0x233)]),console[_0x2beb3f(0x22b)](_0x2beb3f(0x243)+_0x5345db));let _0x53c47c;try{_0x53c47c=readFileSync(_0x5345db,_0x2beb3f(0x261));}catch(_0x4e6824){const _0x4956fc=_0x4e6824 instanceof Error?_0x4e6824[_0x2beb3f(0x1dd)]:String(_0x4e6824);return console[_0x2beb3f(0x22b)](_0x2beb3f(0x1e9)+_0x4956fc),0x1;}let _0x34b01f;try{_0x34b01f=parseDef(_0x53c47c);}catch(_0x2ca39d){const _0x3ccbc7=_0x2ca39d instanceof Error?_0x2ca39d[_0x2beb3f(0x1dd)]:String(_0x2ca39d);return console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x197)+_0x3ccbc7)),0x1;}if(_0x303e12[_0x2beb3f(0x1fb)]===!![]||_0x303e12[_0x2beb3f(0x1fb)]===''){const _0x358418=_0x34b01f['attributes']?.[_0x2beb3f(0x180)](_0x573b79=>_0x573b79[_0x2beb3f(0x1c0)])||[];if(_0x358418[_0x2beb3f(0x1d2)]===0x0)console[_0x2beb3f(0x22b)](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x1c8)));else{console[_0x2beb3f(0x22b)](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x238))),console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d0));for(const _0x10055e of _0x358418){console['error']('\x20\x20'+a22_0x36549d[_0x2beb3f(0x1ad)](_0x10055e));}console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d8)+_0xed1d+_0x2beb3f(0x170)+_0x358418[0x0]+'\x22');}return 0x1;}if(_0x303e12[_0x2beb3f(0x195)]===!![]||_0x303e12[_0x2beb3f(0x195)]===''){const _0x238726=_0x34b01f[_0x2beb3f(0x17c)]?.[_0x2beb3f(0x180)](_0x2fa245=>_0x2fa245[_0x2beb3f(0x1c0)])||[];if(_0x238726[_0x2beb3f(0x1d2)]===0x0)console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x186)));else{console[_0x2beb3f(0x22b)](a22_0x36549d['red']('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x2beb3f(0x22b)]('Available\x20behaviors:');for(const _0x41b6fe of _0x238726){console[_0x2beb3f(0x22b)]('\x20\x20'+a22_0x36549d[_0x2beb3f(0x1ad)](_0x41b6fe));}console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d8)+_0xed1d+_0x2beb3f(0x1ff)+_0x238726[0x0]+'\x22');}return 0x1;}const _0x265664=createCommandSpinner(a22_0x36549d[_0x2beb3f(0x1a8)](_0x2beb3f(0x25a)),{'verbose':_0x303e12[_0x2beb3f(0x1f3)]});_0x265664[_0x2beb3f(0x1cd)]();const _0x459c80={'onProgress':_0x44f70b=>{const _0x4e93d2=_0x2beb3f;_0x265664[_0x4e93d2(0x27b)]=formatProgressMessage(_0x44f70b);}};if(_0x303e12[_0x2beb3f(0x22e)])_0x459c80[_0x2beb3f(0x22e)]=!![];if(_0x303e12['attribute']&&typeof _0x303e12[_0x2beb3f(0x1fb)]===_0x2beb3f(0x1f4))_0x459c80[_0x2beb3f(0x1fb)]=_0x303e12['attribute'];if(_0x303e12[_0x2beb3f(0x195)]&&typeof _0x303e12[_0x2beb3f(0x195)]===_0x2beb3f(0x1f4))_0x459c80[_0x2beb3f(0x195)]=_0x303e12[_0x2beb3f(0x195)];if(_0x303e12['enriched'])_0x459c80[_0x2beb3f(0x1e4)]=!![];if(_0x303e12['interval'])_0x459c80[_0x2beb3f(0x1d1)]=_0x303e12[_0x2beb3f(0x1d1)];let _0x1129f8;try{_0x1129f8=await _0x275b71[_0x2beb3f(0x269)]['previewParentYaml'](_0x53c47c,_0x459c80),_0x265664['stop']();}catch(_0x117b2a){_0x265664[_0x2beb3f(0x1fd)]();throw _0x117b2a;}return await this[_0x2beb3f(0x274)](_0x1129f8,{'master':_0x303e12[_0x2beb3f(0x22e)],'attribute':typeof _0x303e12['attribute']===_0x2beb3f(0x1f4)?_0x303e12[_0x2beb3f(0x1fb)]:undefined,'behavior':typeof _0x303e12[_0x2beb3f(0x195)]===_0x2beb3f(0x1f4)?_0x303e12['behavior']:undefined,'enriched':_0x303e12[_0x2beb3f(0x1e4)]}),_0x1129f8[_0x2beb3f(0x1a4)]?0x0:0x1;}async[a22_0x22549a(0x274)](_0x20ecab,_0x25c951){const _0x33d778=a22_0x22549a;console[_0x33d778(0x22b)]('\x0a'+a22_0x36549d[_0x33d778(0x1f5)](_0x33d778(0x1eb))+'\x20'+_0x20ecab[_0x33d778(0x1c0)]),console['error']('═'['repeat'](0x3c));if(_0x25c951[_0x33d778(0x22e)]&&_0x20ecab['sampleData']){const _0xbb4265=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x24e))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x20ecab['master'][_0x33d778(0x207)]+'.'+_0x20ecab[_0x33d778(0x22e)]['table']);await this[_0x33d778(0x215)](_0xbb4265,_0x20ecab[_0x33d778(0x1ce)]);}else{if(_0x25c951['attribute']&&_0x20ecab[_0x33d778(0x1ce)]){const _0x592f13=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x192))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x25c951['attribute']);await this['displaySampleData'](_0x592f13,_0x20ecab[_0x33d778(0x1ce)]);}else{if(_0x25c951['behavior']&&_0x20ecab[_0x33d778(0x1ce)]){const _0x4eff90=a22_0x36549d[_0x33d778(0x1a8)]('Behavior:')+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x25c951[_0x33d778(0x195)]);await this['displaySampleData'](_0x4eff90,_0x20ecab['sampleData']);}else{if(_0x25c951[_0x33d778(0x1e4)]&&_0x20ecab[_0x33d778(0x1ce)]){const _0x230572=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x1ec))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x33d778(0x1ab));await this[_0x33d778(0x215)](_0x230572,_0x20ecab['sampleData']);}else!_0x20ecab[_0x33d778(0x1ce)]&&console[_0x33d778(0x22b)](_0x33d778(0x240));}}}if(_0x20ecab[_0x33d778(0x1f9)][_0x33d778(0x1d2)]>0x0){console['error']('─'[_0x33d778(0x27d)](0x3c)),console[_0x33d778(0x22b)]('\x0a'+a22_0x36549d[_0x33d778(0x1b5)](_0x33d778(0x275)));for(const _0x3c52ef of _0x20ecab[_0x33d778(0x1f9)]){console[_0x33d778(0x22b)]('\x20\x20'+a22_0x36549d['red']('•')+'\x20'+_0x3c52ef);}}}async[a22_0x22549a(0x215)](_0x48ed8e,_0x326604){const _0x243639=a22_0x22549a;if(_0x326604[_0x243639(0x1d2)]===0x0){console['error']('\x0a'+_0x48ed8e),console[_0x243639(0x22b)](_0x243639(0x1a3));return;}console[_0x243639(0x22b)]('\x0a'+_0x48ed8e);const _0x397fb4=Object[_0x243639(0x213)](_0x326604[0x0])[_0x243639(0x180)](_0x1f0134=>({'name':_0x1f0134,'type':typeof _0x326604[0x0][_0x1f0134]===_0x243639(0x283)?'double':'varchar'})),_0xf385ea={'queryId':_0x243639(0x1e0),'columns':_0x397fb4,'data':_0x326604,'stats':{'state':_0x243639(0x194),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x326604[_0x243639(0x1d2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xffaa09=formatAsTable(_0xf385ea,_0x326604[_0x243639(0x1d2)],!![]);await writeOutput(_0xffaa09,undefined,_0x243639(0x1bd));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x1b4);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x230);async[a22_0x22549a(0x26e)](_0x2afa5f){const _0x187b7d=a22_0x22549a,{options:_0x5d77c0,args:_0x198a1e,tdx:_0x679a8b}=_0x2afa5f,_0x3b65f2=_0x5d77c0,_0x2014e6=_0x198a1e[0x0]||_0x5d77c0['parentSegment'];if(!_0x2014e6)return showParentSegmentNotSetError(_0x187b7d(0x28e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1f0f86=resolveYamlFile(_0x2014e6);if(existsSync(_0x1f0f86)){_0x3b65f2['verbose']&&console[_0x187b7d(0x22b)](_0x187b7d(0x223)+_0x1f0f86);let _0x26c2df;try{_0x26c2df=readFileSync(_0x1f0f86,_0x187b7d(0x261));}catch(_0x207217){const _0x11ec70=_0x207217 instanceof Error?_0x207217[_0x187b7d(0x1dd)]:String(_0x207217);return console[_0x187b7d(0x22b)](_0x187b7d(0x1e9)+_0x11ec70),0x1;}const _0x5f3271=await withSpinner(_0x187b7d(0x209),()=>_0x679a8b[_0x187b7d(0x269)][_0x187b7d(0x245)](_0x26c2df),{'verbose':_0x3b65f2[_0x187b7d(0x1f3)]}),_0x5cd73d=_0x5f3271[_0x187b7d(0x18e)],{isNew:_0x400115,name:_0x1cf6bf,hasChanges:_0x35158b,diffFormatted:_0x835fe9}=_0x5cd73d;if(_0x35158b){_0x400115?console[_0x187b7d(0x22b)](_0x187b7d(0x18a)+_0x1cf6bf+'\x27:'):console[_0x187b7d(0x22b)](_0x187b7d(0x1f1)+_0x1cf6bf+'\x27:');console[_0x187b7d(0x22b)]('─'[_0x187b7d(0x27d)](0x3c)),console[_0x187b7d(0x22b)](_0x835fe9),console[_0x187b7d(0x22b)]('─'[_0x187b7d(0x27d)](0x3c));const _0x572b5c=_0x400115?_0x187b7d(0x1de)+_0x1cf6bf+_0x187b7d(0x279):_0x187b7d(0x1d3)+_0x1cf6bf+'\x27\x20and\x20run\x20workflow?';if(!_0x3b65f2['yes']){const _0xb3efb4=await confirmKey(_0x572b5c);if(!_0xb3efb4)return console[_0x187b7d(0x22b)](_0x187b7d(0x184)),0x1;}const _0x22161b=_0x400115?_0x187b7d(0x219):_0x187b7d(0x1a7);await withSpinner(_0x22161b+'\x20parent\x20segment\x20\x27'+_0x1cf6bf+_0x187b7d(0x25c),()=>_0x5cd73d[_0x187b7d(0x1b1)](),{'verbose':_0x3b65f2['verbose']});const _0x2c2c28=_0x400115?_0x187b7d(0x1c1):'Updated';console[_0x187b7d(0x22b)]('✔\x20'+_0x2c2c28+_0x187b7d(0x1aa)+_0x1cf6bf+'\x27');}else console[_0x187b7d(0x22b)]('✔\x20No\x20changes\x20-\x20\x27'+_0x1cf6bf+_0x187b7d(0x203));}const _0x3388dd=await withSpinner(_0x187b7d(0x1e6)+_0x2014e6+_0x187b7d(0x25c),()=>_0x679a8b[_0x187b7d(0x269)][_0x187b7d(0x248)](_0x2014e6),{'verbose':_0x3b65f2[_0x187b7d(0x1f3)]}),_0x5bf543=_0x3388dd[_0x187b7d(0x18e)],_0x3142a8=getConsoleUrl(_0x3b65f2['site'],'/app/workflows/'+_0x5bf543[_0x187b7d(0x1ed)]+_0x187b7d(0x23b)+_0x5bf543[_0x187b7d(0x265)]+'/attempt/'+_0x5bf543[_0x187b7d(0x258)]);return console[_0x187b7d(0x22b)](_0x187b7d(0x232)),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x282))+'\x20'+_0x5bf543['audienceId']),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)]('Status:')+'\x20'+_0x5bf543[_0x187b7d(0x217)]),console['error']('\x20\x20'+a22_0x36549d['dim']('Session:')+'\x20'+_0x5bf543['workflowSessionId']),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x18f))+'\x20'+_0x5bf543[_0x187b7d(0x258)]),console[_0x187b7d(0x22b)]('\x20\x20'+_0x3142a8),console['error']('\x0a'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x237))+'\x20tdx\x20wf\x20attempt\x20'+_0x5bf543[_0x187b7d(0x258)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a22_0x22549a(0x290);[a22_0x22549a(0x1e8)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3153b1){const _0x1aa66c=a22_0x22549a,{options:_0x595b71,args:_0x21bc30,tdx:_0x54a2c7}=_0x3153b1,_0x238696=_0x21bc30[0x0]||_0x595b71[_0x1aa66c(0x214)];if(!_0x238696)return showParentSegmentNotSetError(_0x1aa66c(0x1dc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x595b71[_0x1aa66c(0x1f3)]&&(console[_0x1aa66c(0x22b)](_0x1aa66c(0x25d)+_0x595b71[_0x1aa66c(0x233)]),console[_0x1aa66c(0x22b)](_0x1aa66c(0x250)+_0x238696));const _0x5ad826=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x238696+_0x1aa66c(0x25c),()=>_0x54a2c7['segment']['listFields'](_0x238696),{'verbose':_0x595b71[_0x1aa66c(0x1f3)]}),_0x44329d=_0x5ad826[_0x1aa66c(0x18e)];console['error'](_0x1aa66c(0x19a)+_0x44329d['length']+'\x20field'+(_0x44329d[_0x1aa66c(0x1d2)]!==0x1?'s':''));if(_0x595b71['json']||_0x595b71[_0x1aa66c(0x182)])return await handleSDKOutput(_0x44329d,_0x595b71),0x0;return displayFieldsHumanReadable(_0x44329d,_0x238696),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x21c);['description']=a22_0x22549a(0x224);async['execute'](_0xb88716){const _0x54b143=a22_0x22549a,{options:_0x55ca45,args:_0x7c16c2,tdx:_0x319255}=_0xb88716,_0x2badc6=_0x55ca45,_0x2833ab=_0x7c16c2[0x0]||_0x55ca45['parentSegment'];if(!_0x2833ab)return showParentSegmentNotSetError(_0x54b143(0x1b7)+_0x54b143(0x292)+_0x54b143(0x253)+_0x54b143(0x1c7)),0x1;_0x55ca45['verbose']&&(console[_0x54b143(0x22b)](_0x54b143(0x25d)+_0x55ca45[_0x54b143(0x233)]),console[_0x54b143(0x22b)]('Parent\x20segment:\x20'+_0x2833ab));const _0x5063df=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2833ab+'\x27...',()=>_0x319255[_0x54b143(0x269)][_0x54b143(0x1fc)](_0x2833ab),{'verbose':_0x55ca45[_0x54b143(0x1f3)]}),_0x4135d0=_0x5063df['data'];if(_0x2badc6['web']){const _0xb167d8=getConsoleNextUrl(_0x2badc6[_0x54b143(0x233)],_0x54b143(0x19d)+_0x4135d0['id']);return console[_0x54b143(0x22b)](a22_0x36549d[_0x54b143(0x1ee)]('✔')+_0x54b143(0x1ae)+a22_0x36549d[_0x54b143(0x1ad)](_0xb167d8)),openBrowser(_0xb167d8),0x0;}return await handleSingleObjectOutput(_0x4135d0,_0x55ca45),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:desc';['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a22_0x22549a(0x26e)](_0x13a383){const _0x24f498=a22_0x22549a,{options:_0x2eee80,args:_0x1aeef9,tdx:_0x4d63f4}=_0x13a383,_0x918e7f=_0x1aeef9[0x0]||_0x2eee80[_0x24f498(0x214)];if(!_0x918e7f)return showParentSegmentNotSetError(_0x24f498(0x227)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x2eee80[_0x24f498(0x1f3)]&&(console[_0x24f498(0x22b)]('Site:\x20'+_0x2eee80[_0x24f498(0x233)]),console[_0x24f498(0x22b)]('Parent\x20segment:\x20'+_0x918e7f));const _0x3062ba=await withSpinner(_0x24f498(0x220)+_0x918e7f+_0x24f498(0x25c),()=>_0x4d63f4[_0x24f498(0x269)][_0x24f498(0x190)](_0x918e7f),{'verbose':_0x2eee80[_0x24f498(0x1f3)]}),_0x39df5e=_0x3062ba[_0x24f498(0x18e)],_0x536983=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x918e7f+'\x27...',()=>_0x4d63f4[_0x24f498(0x269)][_0x24f498(0x23d)](_0x39df5e),{'verbose':_0x2eee80[_0x24f498(0x1f3)]}),_0x43793b=await executeSchemaQuery(_0x536983[_0x24f498(0x18e)],_0x4d63f4,_0x2eee80);return await handleQueryOutput(_0x43793b,_0x2eee80),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a22_0x22549a(0x171);[a22_0x22549a(0x1e8)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a22_0x22549a(0x26e)](_0x3e45a3){const _0xe40650=a22_0x22549a,{options:_0x5056ab,args:_0x26f8d4,tdx:_0x9f3e2d}=_0x3e45a3,_0x6a5fa1=_0x26f8d4[0x0]||_0x5056ab['parentSegment'];if(!_0x6a5fa1)return showParentSegmentNotSetError(_0xe40650(0x1f0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x5056ab[_0xe40650(0x1f3)]&&(console[_0xe40650(0x22b)](_0xe40650(0x25d)+_0x5056ab[_0xe40650(0x233)]),console[_0xe40650(0x22b)](_0xe40650(0x250)+_0x6a5fa1));const _0x35f904=await withSpinner(_0xe40650(0x220)+_0x6a5fa1+'\x27...',()=>_0x9f3e2d[_0xe40650(0x269)][_0xe40650(0x190)](_0x6a5fa1),{'verbose':_0x5056ab[_0xe40650(0x1f3)]}),_0x4c8b8d=_0x35f904[_0xe40650(0x18e)],_0x1b4042=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x6a5fa1+_0xe40650(0x25c),()=>_0x9f3e2d[_0xe40650(0x269)][_0xe40650(0x23d)](_0x4c8b8d),{'verbose':_0x5056ab[_0xe40650(0x1f3)]}),_0x458808=_0x1b4042[_0xe40650(0x18e)];return _0x5056ab[_0xe40650(0x228)]===_0xe40650(0x222)||_0x5056ab['format']==='jsonl'?await handleSDKOutput([{'sql':_0x458808}],_0x5056ab):console[_0xe40650(0x1db)](_0x458808),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x187);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x25f);async[a22_0x22549a(0x26e)](_0x5a6b8c){const _0x418de3=a22_0x22549a,{options:_0x3459d1,args:_0x1eab48,tdx:_0x1dfa97}=_0x5a6b8c,_0x51da89=_0x1eab48[0x0]||_0x3459d1[_0x418de3(0x214)];if(!_0x51da89)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x418de3(0x27a)),0x1;_0x3459d1['verbose']&&(console[_0x418de3(0x22b)](_0x418de3(0x25d)+_0x3459d1[_0x418de3(0x233)]),console[_0x418de3(0x22b)](_0x418de3(0x250)+_0x51da89));const _0x83b2c7=await withSpinner(_0x418de3(0x220)+_0x51da89+_0x418de3(0x25c),()=>_0x1dfa97['segment'][_0x418de3(0x190)](_0x51da89),{'verbose':_0x3459d1[_0x418de3(0x1f3)]}),_0x54e999=_0x83b2c7[_0x418de3(0x18e)],_0x32a167=await withSpinner(_0x418de3(0x1d9)+_0x51da89+'\x27...',()=>_0x1dfa97[_0x418de3(0x269)][_0x418de3(0x23d)](_0x54e999),{'verbose':_0x3459d1[_0x418de3(0x1f3)]});let _0x3e4b57=_0x32a167[_0x418de3(0x18e)];const _0x37ef81=resolveLimit(_0x3459d1['limit'],DEFAULT_DISPLAY_LIMIT),_0x246b80=/\bLIMIT\s+\d+/i[_0x418de3(0x1f2)](_0x3e4b57);!_0x246b80&&(_0x3e4b57=_0x3e4b57[_0x418de3(0x218)]()[_0x418de3(0x23e)](/;+$/,''),_0x3e4b57=_0x418de3(0x1d7)+_0x3e4b57+_0x418de3(0x1c5)+_0x37ef81);_0x3459d1[_0x418de3(0x1f3)]&&console[_0x418de3(0x22b)](_0x418de3(0x211)+_0x3e4b57);const _0x5a4225=await withProgressSpinner(_0x418de3(0x23a),async _0x10e377=>{const _0x4c3ac4=_0x418de3,_0x4f9d5c=await _0x1dfa97[_0x4c3ac4(0x236)]['execute'](_0x3e4b57,{'catalog':'td','schema':_0x4c3ac4(0x1bc),'onJobId':_0xff6b33=>{const _0x3f5e48=_0x4c3ac4;_0x10e377[_0x3f5e48(0x242)](_0xff6b33);}});return _0x4f9d5c;},{'verbose':_0x3459d1[_0x418de3(0x1f3)]}),_0x3c3f9d=_0x5a4225[_0x418de3(0x18e)],_0x875054=_0x3c3f9d[_0x418de3(0x172)]?_0x418de3(0x27c)+_0x3c3f9d[_0x418de3(0x172)]+']':'';return console[_0x418de3(0x22b)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x3c3f9d[_0x418de3(0x28c)][_0x418de3(0x19e)]['toLocaleString']()+_0x418de3(0x1fa)+(_0x418de3(0x18b)+formatElapsed(_0x3c3f9d[_0x418de3(0x28c)][_0x418de3(0x271)])+_0x875054)),await handleQueryOutput(_0x3c3f9d,_0x3459d1),0x0;}}
1
+ function a22_0x5edf(){const _0x52c6a0=['dim','all','2544751ZWdJdT','enriched','limit','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20No\x20changes\x20-\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','.yaml','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','16icZQeY','\x20--behavior\x20\x22','verbose','6DZOoKZ','List\x20available\x20fields\x20for\x20segmentation','300hClnoz','\x20parent\x20segment','255598iESzoD','behaviorsFile','Listing\x20fields\x20for\x20\x27','updateParent','customerGroup','Preview:','Show\x20parent\x20segment\x20details','localeCompare','label','attributes','18288VrzvJW','repeat','Master\x20Table','length','Site:\x20','match','start','use','segment:parent:pull','displayColumns','sampleData','\x20--enriched','2422987jOdqKi','jsonl','error','✔\x20Created\x20parent\x20segment\x20\x27','coveragePercent','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Master:','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','status','\x20kill','run','listParents','elapsedTimeMillis','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Session:','Customers:','description','\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','pushParentYaml','schemaValid','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','getParentSQL','red','database','foreignKey','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Executing\x20parent\x20segment\x20query...','/{name}.yml\x0a','toFixed','40Nyidot','xdg-open','runParent','Rows:','No\x20parent\x20segments\x20found','information_schema','rowCount','Listing\x20parent\x20segments\x20matching\x20\x27','Coverage:','/sessions/','List\x20parent\x20segments','stop','\x20=\x20','Join:','parentSegment','behaviors','Errors:','green','parent_segments','schemaError','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','scheduleType','FINISHED','✔\x20Found\x20','json','segment:parent:create','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','jobId','workflowId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','win32','displayAttributesStats','filter','Resolving\x20parent\x20segment\x20\x27','Columns:','resolveParentId','Apply\x20changes\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Source:','Creating','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x27\x20and\x20run\x20workflow?','cyan','5739545QBCsVE','displayPreviewResults','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Updating\x20parent\x20segment\x20\x27','toLocaleString','4gagBsQ','\x20[Job\x20ID:\x20','\x20parent\x20segment\x20\x27','attribute','output','getParentFull','Fetching\x20sample\x20data...','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','web','query','segment','trim','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20--behavior\x20\x22<name>\x22','text','Error:\x20Parent\x20segment\x20name\x20is\x20required','interval','using\x20the\x20default\x20path:\x20','displaySummary','customerGroupFile','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','endsWith','segment:parent:push','joinKey','SQL\x20query:\x0a','Options:\x0a','join','timezone','execute','segment:parent:sql','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20Context\x20set:\x20','apply','Events:','log','scheduleOption','Get\x20SQL\x20query\x20for\x20parent\x20segment','errors','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Join\x20on:','test','column','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','columns','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','map','utf-8','Updating','parent_segment','To\x20cancel:','No\x20parent\x20segments\x20match\x20pattern:\x20','allValid','/\x20directories\x20exist.','displayPreviewHints','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displayMasterInfo','YAML\x20file:\x20','Analyzing\x20changes...','Pattern:\x20','displayBehaviorsStats','session','table','isDirectory','behavior','segment:parent:update','/app/dw/parentSegments/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','platform','customerPercent','in\x20','workflowAttemptId','segment:parent:run','Validating\x20configuration...','\x0a⚠️\x20\x20Migrating:\x20','customersWithEvents','workflowSessionId','segment:parent:fields','Behaviors','Updated','Error:','Output\x20file:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Available\x20behaviors:','data','displayValidateResults','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','\x27\x20is\x20up\x20to\x20date','processedRows','segment:parent:show','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Audience\x20ID:','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','format','\x20--attribute\x20\x22','To\x20view\x20sample\x20data:','/attempt/','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','`\x20to\x20download\x20the\x20configuration\x20first','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','string','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','yellow','\x0aChanges\x20to\x20apply\x20to\x20\x27','Options\x20(one\x20required):\x0a','/\x20→\x20','sort','Name:\x20','Attributes','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Created','pullParentYaml','Aborted.','\x0a✔\x20Workflow\x20started','Found\x20YAML\x20file:\x20','preview','\x27\x20is\x20already\x20up\x20to\x20date','site','-1d','\x0aChanges\x20to\x20\x27','Parent\x20segment:\x20','\x0aNo\x20sample\x20data\x20available','Fetching\x20SQL\x20for\x20\x27','addBehaviorsFile','Database:\x20','\x27\x20with\x20ID:\x20','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','replace','Show\x20parent\x20segment\x20schema\x20(column\x20types)','population','addBehaviors','createParent','Error\x20reading\x20file:\x20','Status:','addAttributes','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','30148hAaSVj','tdx\x20segment\x20parent\x20preview\x20','master','Error:\x20File\x20not\x20found:\x20','Available\x20attributes:','yes','/app/workflows/','bold','Attempt:','\x20Configuration\x20is\x20valid','\x20rows\x20','\x20tdx\x20wf\x20attempt\x20','ignore','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','dirname','matchedCount','Master\x20+\x20Attributes','Options:','segment:parent:view','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x27...','\x20field','✔\x20Renamed\x20directory\x20to\x20','stats','message','Fetching\x20parent\x20segment\x20\x27','18382KrlPyP','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','3483423XTMmZI','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','audienceId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','.yml','name','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','displaySampleData','Error:\x20--attribute\x20requires\x20a\x20name\x0a'];a22_0x5edf=function(){return _0x52c6a0;};return a22_0x5edf();}const a22_0x428e50=a22_0x22fd;(function(_0x1950e4,_0x2681d8){const _0x2ace95=a22_0x22fd,_0x4b6b3a=_0x1950e4();while(!![]){try{const _0x3f1961=-parseInt(_0x2ace95(0x284))/0x1*(parseInt(_0x2ace95(0x21b))/0x2)+-parseInt(_0x2ace95(0x219))/0x3*(parseInt(_0x2ace95(0x1e2))/0x4)+-parseInt(_0x2ace95(0x27e))/0x5*(-parseInt(_0x2ace95(0x217))/0x6)+-parseInt(_0x2ace95(0x231))/0x7*(parseInt(_0x2ace95(0x214))/0x8)+parseInt(_0x2ace95(0x1fe))/0x9+-parseInt(_0x2ace95(0x250))/0xa*(parseInt(_0x2ace95(0x20a))/0xb)+-parseInt(_0x2ace95(0x225))/0xc*(-parseInt(_0x2ace95(0x1fc))/0xd);if(_0x3f1961===_0x2681d8)break;else _0x4b6b3a['push'](_0x4b6b3a['shift']());}catch(_0x1a1013){_0x4b6b3a['push'](_0x4b6b3a['shift']());}}}(a22_0x5edf,0xc51b6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x9419a8 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable}from'../sdk/util/formatters.js';function a22_0x22fd(_0x4a3521,_0x265269){_0x4a3521=_0x4a3521-0x190;const _0x5edf1a=a22_0x5edf();let _0x22fd7a=_0x5edf1a[_0x4a3521];return _0x22fd7a;}import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x5c26e2 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x428e50(0x262),LEGACY_PARENT_SEGMENT_DIR=a22_0x428e50(0x2b6);function openBrowser(_0x15d133){const _0x14d307=a22_0x428e50,_0xa583b3=process[_0x14d307(0x19a)],_0x836370=_0xa583b3==='darwin'?'open':_0xa583b3===_0x14d307(0x271)?_0x14d307(0x22b):_0x14d307(0x251);spawn(_0x836370,[_0x15d133],{'detached':!![],'stdio':_0x14d307(0x1ee)})['unref']();}function migrateLegacyDirectory(){const _0x213655=a22_0x428e50;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3cb46f=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3cb46f[_0x213655(0x195)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x213655(0x233)](a22_0x5c26e2[_0x213655(0x1bf)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x213655(0x2ba))),console['error'](a22_0x5c26e2[_0x213655(0x208)](_0x213655(0x20d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console['error'](a22_0x5c26e2['yellow'](_0x213655(0x1a0)+LEGACY_PARENT_SEGMENT_DIR+_0x213655(0x1c2)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a22_0x5c26e2[_0x213655(0x261)](_0x213655(0x1f8)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3c1942){const _0x299a2e=_0x3c1942 instanceof Error?_0x3c1942[_0x213655(0x1fa)]:String(_0x3c1942);return console[_0x213655(0x233)](a22_0x5c26e2[_0x213655(0x249)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x299a2e+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x428e50(0x23b)](_0x591ab8){return migrateLegacyDirectory(),super['run'](_0x591ab8);}}function resolveYamlFile(_0x3a02b8){const _0x18f451=a22_0x428e50;if(_0x3a02b8[_0x18f451(0x29a)](_0x18f451(0x203))||_0x3a02b8[_0x18f451(0x29a)](_0x18f451(0x212)))return _0x3a02b8;return a22_0x9419a8['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3a02b8)+_0x18f451(0x203));}function formatProgressMessage(_0xbb9b64){const _0x37faec=a22_0x428e50,_0x3299d2=_0xbb9b64[_0x37faec(0x22a)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3299d2){const [,_0x271295,_0x4fb0bf,_0x2b1c3a='']=_0x3299d2;return a22_0x5c26e2[_0x37faec(0x208)](_0x271295+':')+'\x20'+_0x4fb0bf+a22_0x5c26e2[_0x37faec(0x208)](_0x2b1c3a);}return a22_0x5c26e2[_0x37faec(0x208)](_0xbb9b64);}function showFileNotFoundError(_0x172822,_0x59e186){const _0x4bef27=a22_0x428e50;console['error'](a22_0x5c26e2['red'](_0x4bef27(0x1e5)+_0x172822+'\x0a')),console[_0x4bef27(0x233)](a22_0x5c26e2[_0x4bef27(0x27d)](_0x4bef27(0x213)+_0x59e186+_0x4bef27(0x1bb)));}function showParentSegmentNotSetError(_0x254011){const _0x4a1e14=a22_0x428e50;console[_0x4a1e14(0x233)](a22_0x5c26e2['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x4a1e14(0x233)](_0x254011);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x428e50(0x204)]='segment:parent:list';[a22_0x428e50(0x241)]=a22_0x428e50(0x25a);async[a22_0x428e50(0x2a1)](_0x318bc7){const _0x6bf6c9=a22_0x428e50,{options:_0x22c2d7,args:_0x14557a,tdx:_0x2f97e1}=_0x318bc7,_0x25231c=_0x14557a[0x0];_0x22c2d7[_0x6bf6c9(0x216)]&&(console[_0x6bf6c9(0x233)](_0x6bf6c9(0x229)+_0x22c2d7[_0x6bf6c9(0x1ce)]),_0x25231c&&console[_0x6bf6c9(0x233)](_0x6bf6c9(0x191)+_0x25231c));const _0x17e9e9=await withSpinner(_0x25231c?_0x6bf6c9(0x257)+_0x25231c+'\x27...':'Listing\x20parent\x20segments...',()=>_0x2f97e1['segment'][_0x6bf6c9(0x23c)](),{'verbose':_0x22c2d7[_0x6bf6c9(0x216)]});let _0x5caa33=_0x17e9e9[_0x6bf6c9(0x1aa)];if(_0x25231c){const _0x47976d=_0x25231c['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x6bf6c9(0x1d9)](/\?/g,'.'),_0x5c58bd=new RegExp('^'+_0x47976d+'$','i');_0x5caa33=_0x5caa33[_0x6bf6c9(0x273)](_0x401417=>_0x5c58bd[_0x6bf6c9(0x2ad)](_0x401417['attributes'][_0x6bf6c9(0x204)]));}_0x5caa33[_0x6bf6c9(0x1c3)]((_0x43d0d9,_0x52b807)=>_0x43d0d9[_0x6bf6c9(0x224)][_0x6bf6c9(0x204)][_0x6bf6c9(0x222)](_0x52b807[_0x6bf6c9(0x224)][_0x6bf6c9(0x204)])),console[_0x6bf6c9(0x233)](_0x6bf6c9(0x267)+_0x5caa33[_0x6bf6c9(0x228)]+_0x6bf6c9(0x21a)+(_0x5caa33[_0x6bf6c9(0x228)]!==0x1?'s':''));if(_0x22c2d7[_0x6bf6c9(0x1b6)]===_0x6bf6c9(0x268)||_0x22c2d7['format']===_0x6bf6c9(0x232))await handleSDKOutput(_0x5caa33,_0x22c2d7);else{if(_0x5caa33[_0x6bf6c9(0x228)]===0x0)_0x25231c?console['log'](_0x6bf6c9(0x2b8)+_0x25231c):console['log'](_0x6bf6c9(0x254));else for(const _0x46aea0 of _0x5caa33){const _0x24bcf0=_0x46aea0['attributes'][_0x6bf6c9(0x1db)]?a22_0x5c26e2['dim']('\x20('+formatRows(_0x46aea0[_0x6bf6c9(0x224)][_0x6bf6c9(0x1db)])+')'):'';console[_0x6bf6c9(0x2a7)]('👥\x20'+_0x46aea0['attributes']['name']+_0x24bcf0);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x269);[a22_0x428e50(0x241)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x428e50(0x2a1)](_0x40d637){const _0x2cf3bd=a22_0x428e50,{options:_0xdeacf,args:_0x241cef,tdx:_0x557222}=_0x40d637;console[_0x2cf3bd(0x233)](_0x2cf3bd(0x202)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x17e6d6=_0xdeacf;if(_0x241cef[_0x2cf3bd(0x228)]===0x0)return console[_0x2cf3bd(0x233)](a22_0x5c26e2[_0x2cf3bd(0x249)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x2cf3bd(0x233)](_0x2cf3bd(0x26c)),0x1;const _0x10a672=_0x241cef[0x0];if(!_0x17e6d6[_0x2cf3bd(0x24a)]||!_0x17e6d6['table'])return console[_0x2cf3bd(0x233)](_0x2cf3bd(0x291)),console[_0x2cf3bd(0x233)](_0x2cf3bd(0x26c)),0x1;_0x17e6d6['verbose']&&(console[_0x2cf3bd(0x233)](_0x2cf3bd(0x229)+_0x17e6d6['site']),console[_0x2cf3bd(0x233)](_0x2cf3bd(0x1c4)+_0x10a672),console[_0x2cf3bd(0x233)](_0x2cf3bd(0x1d5)+_0x17e6d6[_0x2cf3bd(0x24a)]),console[_0x2cf3bd(0x233)]('Table:\x20'+_0x17e6d6[_0x2cf3bd(0x194)]));const _0x443b31=await loadJSONFromOptions(_0x17e6d6[_0x2cf3bd(0x224)],_0x17e6d6['attributesFile']),_0xab0063=await loadJSONFromOptions(_0x17e6d6[_0x2cf3bd(0x25f)],_0x17e6d6[_0x2cf3bd(0x21c)]),_0x48bbe4=await loadJSONFromOptions(_0x17e6d6[_0x2cf3bd(0x21f)],_0x17e6d6[_0x2cf3bd(0x298)]),_0x4b4f09={'name':_0x10a672,'description':_0x17e6d6[_0x2cf3bd(0x241)],'scheduleType':_0x17e6d6[_0x2cf3bd(0x265)],'scheduleOption':_0x17e6d6[_0x2cf3bd(0x2a8)],'timezone':_0x17e6d6[_0x2cf3bd(0x2a0)],'master':{'parentDatabaseName':_0x17e6d6[_0x2cf3bd(0x24a)],'parentTableName':_0x17e6d6[_0x2cf3bd(0x194)]},'attributes':_0x443b31,'behaviors':_0xab0063,'customerGroup':_0x48bbe4},_0x1d2a45=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x10a672+'\x27...',()=>_0x557222['segment'][_0x2cf3bd(0x1dd)](_0x4b4f09),{'verbose':_0xdeacf['verbose']}),_0x560887=_0x1d2a45[_0x2cf3bd(0x1aa)];return console[_0x2cf3bd(0x233)](_0x2cf3bd(0x234)+_0x560887[_0x2cf3bd(0x204)]+_0x2cf3bd(0x1d6)+_0x560887['id']),await handleSDKOutput([_0x560887],_0xdeacf),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x197);[a22_0x428e50(0x241)]=a22_0x428e50(0x1ba);async[a22_0x428e50(0x2a1)](_0x2031b1){const _0x538c1e=a22_0x428e50,{options:_0x1e041a,args:_0x359fb7,tdx:_0x4b4487}=_0x2031b1;console[_0x538c1e(0x233)](_0x538c1e(0x28b)+_0x538c1e(0x1b5)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x6b0c9e=_0x1e041a;if(_0x359fb7['length']===0x0)return console[_0x538c1e(0x233)](a22_0x5c26e2[_0x538c1e(0x249)](_0x538c1e(0x294))),console['error'](_0x538c1e(0x2a3)),0x1;const _0x586d3c=_0x359fb7[0x0];_0x6b0c9e[_0x538c1e(0x216)]&&(console['error']('Site:\x20'+_0x6b0c9e[_0x538c1e(0x1ce)]),console[_0x538c1e(0x233)](_0x538c1e(0x1d1)+_0x586d3c));const _0x26b394=await withSpinner(_0x538c1e(0x1b3)+_0x586d3c+_0x538c1e(0x1f6),()=>_0x4b4487['segment']['getParentFull'](_0x586d3c),{'verbose':_0x6b0c9e[_0x538c1e(0x216)]}),_0x1bdbc9=_0x26b394[_0x538c1e(0x1aa)],_0x3c351e=await loadJSONFromOptions(_0x6b0c9e[_0x538c1e(0x1e0)],_0x6b0c9e['addAttributesFile']),_0x13b67e=await loadJSONFromOptions(_0x6b0c9e[_0x538c1e(0x1dc)],_0x6b0c9e[_0x538c1e(0x1d4)]),_0x226311={'name':_0x1bdbc9[_0x538c1e(0x204)],'description':_0x6b0c9e['description']!==undefined?_0x6b0c9e[_0x538c1e(0x241)]:_0x1bdbc9[_0x538c1e(0x241)],'scheduleType':_0x6b0c9e[_0x538c1e(0x265)]!==undefined?_0x6b0c9e['scheduleType']:_0x1bdbc9[_0x538c1e(0x265)],'scheduleOption':_0x6b0c9e[_0x538c1e(0x2a8)]!==undefined?_0x6b0c9e[_0x538c1e(0x2a8)]:_0x1bdbc9['scheduleOption'],'timezone':_0x6b0c9e[_0x538c1e(0x2a0)]!==undefined?_0x6b0c9e[_0x538c1e(0x2a0)]:_0x1bdbc9[_0x538c1e(0x2a0)],'master':_0x1bdbc9['master'],'attributes':_0x3c351e?[..._0x1bdbc9[_0x538c1e(0x224)]||[],..._0x3c351e]:_0x1bdbc9['attributes'],'behaviors':_0x13b67e?[..._0x1bdbc9[_0x538c1e(0x25f)]||[],..._0x13b67e]:_0x1bdbc9[_0x538c1e(0x25f)],'customerGroup':_0x1bdbc9[_0x538c1e(0x21f)]},_0x129838=await withSpinner(_0x538c1e(0x282)+_0x586d3c+'\x27...',()=>_0x4b4487['segment'][_0x538c1e(0x21e)](_0x586d3c,_0x226311),{'verbose':_0x6b0c9e[_0x538c1e(0x216)]}),_0x186374=_0x129838[_0x538c1e(0x1aa)];return console[_0x538c1e(0x233)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x186374['name']+'\x27'),await handleSDKOutput([_0x186374],_0x6b0c9e),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a22_0x428e50(0x22d);[a22_0x428e50(0x241)]=a22_0x428e50(0x205);async[a22_0x428e50(0x2a1)](_0x41924d){const _0x135479=a22_0x428e50,{options:_0x559bbd,args:_0xea3182,tdx:_0x504acf}=_0x41924d,_0x2f24af=_0x559bbd,_0xf2e539=_0xea3182[0x0]||_0x559bbd[_0x135479(0x25e)];if(!_0xf2e539)return showParentSegmentNotSetError(_0x135479(0x2b2)+_0x135479(0x278)),0x1;if(_0x2f24af[_0x135479(0x22c)]&&_0x2f24af[_0x135479(0x288)])return console[_0x135479(0x233)](a22_0x5c26e2['red'](_0x135479(0x24c))),console[_0x135479(0x233)](a22_0x5c26e2[_0x135479(0x208)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x135479(0x233)](a22_0x5c26e2['dim'](_0x135479(0x296)+PARENT_SEGMENT_DIR+_0x135479(0x24e))),console['error'](a22_0x5c26e2['cyan'](_0x135479(0x200))),0x1;const _0x41c2f0=_0x2f24af[_0x135479(0x288)]||a22_0x9419a8[_0x135479(0x29f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xf2e539)+_0x135479(0x203));_0x2f24af['verbose']&&(console[_0x135479(0x233)]('Site:\x20'+_0x2f24af[_0x135479(0x1ce)]),console['error'](_0x135479(0x1d1)+_0xf2e539),console[_0x135479(0x233)](_0x135479(0x1a7)+_0x41c2f0));const _0x7447aa=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0xf2e539+'\x27...',()=>_0x504acf['segment'][_0x135479(0x1c8)](_0xf2e539),{'verbose':_0x2f24af[_0x135479(0x216)]}),_0x1ff003=_0x7447aa['data'];if(existsSync(_0x41c2f0)){const _0x140a20=readFileSync(_0x41c2f0,_0x135479(0x2b4)),_0x3aa0ad=generateDiff(_0x140a20,_0x1ff003);if(!hasChanges(_0x3aa0ad))console[_0x135479(0x233)](a22_0x5c26e2[_0x135479(0x261)]('✔')+_0x135479(0x20e)+a22_0x5c26e2['cyan'](_0x41c2f0)+_0x135479(0x242));else{console[_0x135479(0x233)](_0x135479(0x1d0)+_0x41c2f0+'\x27:'),console[_0x135479(0x233)]('─'[_0x135479(0x226)](0x3c)),console[_0x135479(0x233)](formatDiffWithColors(_0x3aa0ad)),console[_0x135479(0x233)]('─'[_0x135479(0x226)](0x3c));if(!_0x2f24af['yes']){const _0x465384=await confirmKey('Overwrite\x20\x27'+_0x41c2f0+'\x27?');if(!_0x465384)return console['error'](_0x135479(0x1c9)),0x1;}writeFileSync(_0x41c2f0,_0x1ff003,'utf-8'),console['error'](a22_0x5c26e2[_0x135479(0x261)]('✔')+_0x135479(0x1a8)+a22_0x5c26e2['cyan'](_0x41c2f0));}}else{const _0x423809=a22_0x9419a8[_0x135479(0x1f0)](_0x41c2f0);!existsSync(_0x423809)&&mkdirSync(_0x423809,{'recursive':!![]}),writeFileSync(_0x41c2f0,_0x1ff003,_0x135479(0x2b4)),console['error'](a22_0x5c26e2['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x5c26e2[_0x135479(0x27d)](_0x41c2f0));}return saveSessionContext({'parent_segment':_0xf2e539},_0x2f24af[_0x135479(0x193)]),console[_0x135479(0x233)](a22_0x5c26e2[_0x135479(0x261)]('✔')+_0x135479(0x2a4)+a22_0x5c26e2[_0x135479(0x208)](_0x135479(0x2b6))+_0x135479(0x25c)+a22_0x5c26e2['cyan'](_0xf2e539)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x29b);['description']=a22_0x428e50(0x1b1);async[a22_0x428e50(0x2a1)](_0x258449){const _0x5f027c=a22_0x428e50,{options:_0x2c12ec,args:_0x225beb,tdx:_0x5787c6}=_0x258449,_0x5c15f0=_0x2c12ec,_0x529aec=_0x225beb[0x0]||_0x2c12ec[_0x5f027c(0x25e)];if(!_0x529aec)return showParentSegmentNotSetError(_0x5f027c(0x1b0)+_0x5f027c(0x26d)),0x1;const _0x1554a9=resolveYamlFile(_0x529aec);if(!existsSync(_0x1554a9))return showFileNotFoundError(_0x1554a9,_0x529aec),0x1;_0x5c15f0[_0x5f027c(0x216)]&&(console['error']('Site:\x20'+_0x5c15f0[_0x5f027c(0x1ce)]),console[_0x5f027c(0x233)]('YAML\x20file:\x20'+_0x1554a9));let _0x111cfc;try{_0x111cfc=readFileSync(_0x1554a9,'utf-8');}catch(_0x4a3e95){const _0xd17c98=_0x4a3e95 instanceof Error?_0x4a3e95['message']:String(_0x4a3e95);return console[_0x5f027c(0x233)]('Error\x20reading\x20file:\x20'+_0xd17c98),0x1;}const _0x339300=await withSpinner(_0x5f027c(0x190),()=>_0x5787c6[_0x5f027c(0x28e)][_0x5f027c(0x244)](_0x111cfc),{'verbose':_0x5c15f0[_0x5f027c(0x216)]}),_0x1871c9=_0x339300[_0x5f027c(0x1aa)],{isNew:_0x41c711,name:_0xc84a98,hasChanges:_0x9fa79f,diffFormatted:_0x2c6a33}=_0x1871c9;if(!_0x9fa79f)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0xc84a98+_0x5f027c(0x1cd)),0x0;_0x41c711?console['error']('\x0aNew\x20parent\x20segment\x20\x27'+_0xc84a98+'\x27:'):console[_0x5f027c(0x233)](_0x5f027c(0x1c0)+_0xc84a98+'\x27:');console['error']('─'['repeat'](0x3c)),console['error'](_0x2c6a33),console[_0x5f027c(0x233)]('─'[_0x5f027c(0x226)](0x3c));const _0x1053e1=_0x41c711?'Create\x20parent\x20segment\x20\x27'+_0xc84a98+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0xc84a98+'\x27?';if(!_0x5c15f0[_0x5f027c(0x1e7)]){const _0x319753=await confirmKey(_0x1053e1);if(!_0x319753)return console['error'](_0x5f027c(0x1c9)),0x1;}const _0xcb8d12=_0x41c711?_0x5f027c(0x27a):_0x5f027c(0x2b5),_0x1110a0=await withSpinner(_0xcb8d12+_0x5f027c(0x286)+_0xc84a98+_0x5f027c(0x1f6),()=>_0x1871c9[_0x5f027c(0x2a5)](),{'verbose':_0x5c15f0[_0x5f027c(0x216)]}),_0x4351f5=_0x1110a0['data'],_0xb31078=getConsoleNextUrl(_0x5c15f0[_0x5f027c(0x1ce)],'/app/dw/parentSegments/'+_0x4351f5['id']),_0x1641f8=_0x41c711?_0x5f027c(0x1c7):'Updated';return console['error']('✔\x20'+_0x1641f8+_0x5f027c(0x286)+_0x4351f5[_0x5f027c(0x204)]+'\x27'),console[_0x5f027c(0x233)]('\x20\x20'+_0xb31078),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x428e50(0x204)]='segment:parent:validate';[a22_0x428e50(0x241)]=a22_0x428e50(0x2af);async[a22_0x428e50(0x2a1)](_0x3cec95){const _0x2ec1c7=a22_0x428e50,{options:_0x2dad8b,args:_0x19f2f6,tdx:_0x21a856}=_0x3cec95,_0x2cb476=_0x2dad8b,_0x3d6821=_0x19f2f6[0x0]||_0x2dad8b[_0x2ec1c7(0x25e)];if(!_0x3d6821)return showParentSegmentNotSetError(_0x2ec1c7(0x264)+_0x2ec1c7(0x199)+_0x2ec1c7(0x29e)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x2ec1c7(0x1ef)+_0x2ec1c7(0x211)),0x1;const _0x2964ce=resolveYamlFile(_0x3d6821);if(!existsSync(_0x2964ce))return showFileNotFoundError(_0x2964ce,_0x3d6821),0x1;_0x2cb476[_0x2ec1c7(0x216)]&&(console[_0x2ec1c7(0x233)](_0x2ec1c7(0x229)+_0x2cb476[_0x2ec1c7(0x1ce)]),console['error'](_0x2ec1c7(0x2be)+_0x2964ce));let _0x5b88a4;try{_0x5b88a4=readFileSync(_0x2964ce,_0x2ec1c7(0x2b4));}catch(_0x2dfc6f){const _0x4a18df=_0x2dfc6f instanceof Error?_0x2dfc6f[_0x2ec1c7(0x1fa)]:String(_0x2dfc6f);return console[_0x2ec1c7(0x233)](_0x2ec1c7(0x1de)+_0x4a18df),0x1;}const _0x382e24=createCommandSpinner(a22_0x5c26e2['dim'](_0x2ec1c7(0x19f)),{'verbose':_0x2cb476['verbose']});_0x382e24[_0x2ec1c7(0x22b)]();const _0x37cbc8={'onProgress':_0x591406=>{_0x382e24['text']=formatProgressMessage(_0x591406);}};if(_0x2cb476[_0x2ec1c7(0x1e4)])_0x37cbc8[_0x2ec1c7(0x1e4)]=!![];if(_0x2cb476[_0x2ec1c7(0x20b)])_0x37cbc8[_0x2ec1c7(0x20b)]=!![];_0x2cb476['attribute']&&(_0x37cbc8[_0x2ec1c7(0x287)]=_0x2cb476[_0x2ec1c7(0x287)]);_0x2cb476[_0x2ec1c7(0x196)]&&(_0x37cbc8['behavior']=_0x2cb476[_0x2ec1c7(0x196)]);if(_0x2cb476['interval'])_0x37cbc8[_0x2ec1c7(0x295)]=_0x2cb476[_0x2ec1c7(0x295)];let _0x59af83;try{_0x59af83=await _0x21a856[_0x2ec1c7(0x28e)]['validateParentYaml'](_0x5b88a4,_0x37cbc8),_0x382e24['stop']();}catch(_0x1358f4){_0x382e24[_0x2ec1c7(0x25b)]();throw _0x1358f4;}const _0x423fb3=_0x2cb476[_0x2ec1c7(0x295)]||_0x2ec1c7(0x1cf);return this[_0x2ec1c7(0x1ab)](_0x59af83,_0x37cbc8,_0x2964ce,_0x423fb3),_0x59af83[_0x2ec1c7(0x2b9)]?0x0:0x1;}[a22_0x428e50(0x1ab)](_0x30e347,_0x410f53,_0x50d3fc,_0x24ff9b){const _0x288a74=a22_0x428e50;console['error']('\x0a'+a22_0x5c26e2[_0x288a74(0x1e9)]('Validate:')+'\x20'+_0x30e347[_0x288a74(0x204)]),console[_0x288a74(0x233)]('═'[_0x288a74(0x226)](0x3c)),this['displayMasterInfo'](_0x30e347);if(typeof _0x410f53[_0x288a74(0x287)]==='string'){this[_0x288a74(0x272)](_0x30e347),this['displaySummary'](_0x30e347),this[_0x288a74(0x2bb)](_0x50d3fc,_0x24ff9b,'attribute',_0x410f53['attribute']);return;}if(_0x410f53[_0x288a74(0x287)]===!![]){this[_0x288a74(0x272)](_0x30e347),this['displaySummary'](_0x30e347),this['displayPreviewHints'](_0x50d3fc,_0x24ff9b,_0x288a74(0x224));return;}if(typeof _0x410f53['behavior']===_0x288a74(0x1bd)){this[_0x288a74(0x192)](_0x30e347,_0x24ff9b),this[_0x288a74(0x297)](_0x30e347),this[_0x288a74(0x2bb)](_0x50d3fc,_0x24ff9b,_0x288a74(0x196),_0x410f53[_0x288a74(0x196)]);return;}if(_0x410f53[_0x288a74(0x196)]===!![]){this[_0x288a74(0x192)](_0x30e347,_0x24ff9b),this[_0x288a74(0x297)](_0x30e347),this[_0x288a74(0x2bb)](_0x50d3fc,_0x24ff9b,_0x288a74(0x25f));return;}this[_0x288a74(0x272)](_0x30e347),this['displayBehaviorsStats'](_0x30e347,_0x24ff9b),this[_0x288a74(0x297)](_0x30e347),this['displayPreviewHints'](_0x50d3fc,_0x24ff9b,'all');}[a22_0x428e50(0x2bb)](_0x4831b1,_0x3d11b4,_0x5d7820,_0x564f80){const _0x3293e9=a22_0x428e50;console['error']('\x0a'+a22_0x5c26e2[_0x3293e9(0x208)](_0x3293e9(0x1b8)));const _0x1d9361=_0x3d11b4!==_0x3293e9(0x1cf)?'\x20--interval\x20'+_0x3d11b4:'';if(_0x5d7820===_0x3293e9(0x287)&&_0x564f80)console['error']('\x20\x20'+a22_0x5c26e2[_0x3293e9(0x208)]('tdx\x20segment\x20parent\x20preview\x20'+_0x4831b1+_0x3293e9(0x1b7)+_0x564f80+'\x22'+_0x1d9361));else{if(_0x5d7820===_0x3293e9(0x196)&&_0x564f80)console['error']('\x20\x20'+a22_0x5c26e2[_0x3293e9(0x208)](_0x3293e9(0x1e3)+_0x4831b1+_0x3293e9(0x215)+_0x564f80+'\x22'+_0x1d9361));else(_0x5d7820===_0x3293e9(0x224)||_0x5d7820===_0x3293e9(0x209))&&console[_0x3293e9(0x233)]('\x20\x20'+a22_0x5c26e2[_0x3293e9(0x208)]('tdx\x20segment\x20parent\x20preview\x20'+_0x4831b1+'\x20--attribute\x20\x22<name>\x22'+_0x1d9361));}(_0x5d7820===_0x3293e9(0x25f)||_0x5d7820===_0x3293e9(0x209))&&console['error']('\x20\x20'+a22_0x5c26e2[_0x3293e9(0x208)](_0x3293e9(0x1e3)+_0x4831b1+_0x3293e9(0x292)+_0x1d9361)),_0x5d7820==='all'&&console['error']('\x20\x20'+a22_0x5c26e2[_0x3293e9(0x208)](_0x3293e9(0x1e3)+_0x4831b1+_0x3293e9(0x230)+_0x1d9361));}[a22_0x428e50(0x2bd)](_0x3f1c87){const _0x3ac147=a22_0x428e50,{master:_0x57361f}=_0x3f1c87,_0x18d04a=_0x57361f[_0x3ac147(0x245)]?a22_0x5c26e2[_0x3ac147(0x261)]('✔'):a22_0x5c26e2['red']('✘');console[_0x3ac147(0x233)]('\x0a'+a22_0x5c26e2[_0x3ac147(0x208)](_0x3ac147(0x227))),console[_0x3ac147(0x233)](_0x18d04a+'\x20'+a22_0x5c26e2['bold'](_0x57361f['database']+'.'+_0x57361f[_0x3ac147(0x194)])),_0x57361f[_0x3ac147(0x245)]?_0x57361f[_0x3ac147(0x256)]!==undefined&&console[_0x3ac147(0x233)]('\x20\x20'+a22_0x5c26e2[_0x3ac147(0x208)](_0x3ac147(0x253))+'\x20'+a22_0x5c26e2[_0x3ac147(0x27d)](formatRows(_0x57361f[_0x3ac147(0x256)]))):console[_0x3ac147(0x233)]('\x20\x20'+a22_0x5c26e2[_0x3ac147(0x249)](_0x3ac147(0x1a6))+'\x20'+_0x57361f['schemaError']);}['displayAttributesStats'](_0x162722){const _0x30ea4e=a22_0x428e50;if(_0x162722['attributes'][_0x30ea4e(0x228)]===0x0)return;console[_0x30ea4e(0x233)]('\x0a'+a22_0x5c26e2[_0x30ea4e(0x208)](_0x30ea4e(0x1c5)));for(const _0x5cf845 of _0x162722[_0x30ea4e(0x224)]){const _0x2501f4=_0x5cf845[_0x30ea4e(0x245)]?a22_0x5c26e2['green']('✔'):a22_0x5c26e2[_0x30ea4e(0x249)]('✘');let _0x1309e4='';if(_0x5cf845[_0x30ea4e(0x245)]&&_0x5cf845[_0x30ea4e(0x1f1)]!==undefined&&_0x5cf845[_0x30ea4e(0x235)]!==undefined){const _0x5341b5=_0x5cf845[_0x30ea4e(0x235)]['toFixed'](0x1),_0x44c9c2=_0x5cf845[_0x30ea4e(0x235)]>=0x50?a22_0x5c26e2[_0x30ea4e(0x261)]:_0x5cf845[_0x30ea4e(0x235)]>=0x32?a22_0x5c26e2['yellow']:a22_0x5c26e2['red'];_0x1309e4='\x20'+a22_0x5c26e2[_0x30ea4e(0x208)](_0x30ea4e(0x258))+'\x20'+_0x44c9c2(_0x5341b5+'%')+'\x20('+formatRows(_0x5cf845[_0x30ea4e(0x1f1)])+'\x20rows)';}console[_0x30ea4e(0x233)](_0x2501f4+'\x20'+a22_0x5c26e2[_0x30ea4e(0x1e9)](_0x5cf845[_0x30ea4e(0x204)])+_0x1309e4),console[_0x30ea4e(0x233)]('\x20\x20'+a22_0x5c26e2[_0x30ea4e(0x208)](_0x30ea4e(0x279))+'\x20'+a22_0x5c26e2[_0x30ea4e(0x1e9)](_0x5cf845[_0x30ea4e(0x24a)]+'.'+_0x5cf845[_0x30ea4e(0x194)]));const _0x37f0c8=_0x5cf845['joinKey']===_0x5cf845[_0x30ea4e(0x24b)]?a22_0x5c26e2[_0x30ea4e(0x208)](_0x30ea4e(0x2ac))+'\x20'+_0x5cf845[_0x30ea4e(0x29c)]:a22_0x5c26e2[_0x30ea4e(0x208)](_0x30ea4e(0x25d))+'\x20'+_0x5cf845[_0x30ea4e(0x29c)]+_0x30ea4e(0x25c)+_0x5cf845[_0x30ea4e(0x24b)];console[_0x30ea4e(0x233)]('\x20\x20'+_0x37f0c8),console['error']('\x20\x20'+a22_0x5c26e2[_0x30ea4e(0x208)](_0x30ea4e(0x275))),this[_0x30ea4e(0x22e)](_0x5cf845[_0x30ea4e(0x2b1)]),!_0x5cf845['schemaValid']&&console['error']('\x20\x20'+a22_0x5c26e2[_0x30ea4e(0x249)](_0x30ea4e(0x1a6))+'\x20'+_0x5cf845[_0x30ea4e(0x263)]);}}[a22_0x428e50(0x192)](_0x41eb64,_0x3e37a3){const _0x9a9d89=a22_0x428e50;if(_0x41eb64['behaviors'][_0x9a9d89(0x228)]===0x0)return;console['error']('\x0a'+a22_0x5c26e2[_0x9a9d89(0x208)](_0x9a9d89(0x1a4))+'\x20'+a22_0x5c26e2[_0x9a9d89(0x208)]('('+_0x3e37a3+')'));for(const _0x439743 of _0x41eb64[_0x9a9d89(0x25f)]){const _0x524859=_0x439743[_0x9a9d89(0x245)]?a22_0x5c26e2['green']('✔'):a22_0x5c26e2[_0x9a9d89(0x249)]('✘');let _0x47b9c0='';if(_0x439743[_0x9a9d89(0x245)]&&_0x439743[_0x9a9d89(0x1a1)]!==undefined&&_0x439743['totalEvents']!==undefined){const _0x5b7eb5=_0x439743['customerPercent']?.[_0x9a9d89(0x24f)](0x1)||'?',_0x5ebbc5=(_0x439743[_0x9a9d89(0x19b)]??0x0)>=0x32?a22_0x5c26e2[_0x9a9d89(0x261)]:(_0x439743['customerPercent']??0x0)>=0x14?a22_0x5c26e2[_0x9a9d89(0x1bf)]:a22_0x5c26e2[_0x9a9d89(0x249)];_0x47b9c0='\x20'+a22_0x5c26e2[_0x9a9d89(0x208)](_0x9a9d89(0x240))+'\x20'+_0x5ebbc5(formatRows(_0x439743[_0x9a9d89(0x1a1)]))+'\x20('+_0x5b7eb5+'%)\x20'+a22_0x5c26e2['dim'](_0x9a9d89(0x2a6))+'\x20'+a22_0x5c26e2[_0x9a9d89(0x27d)](formatRows(_0x439743['totalEvents']));}console[_0x9a9d89(0x233)](_0x524859+'\x20'+a22_0x5c26e2[_0x9a9d89(0x1e9)](_0x439743['name'])+_0x47b9c0),console['error']('\x20\x20'+a22_0x5c26e2[_0x9a9d89(0x208)](_0x9a9d89(0x279))+'\x20'+a22_0x5c26e2[_0x9a9d89(0x1e9)](_0x439743['database']+'.'+_0x439743[_0x9a9d89(0x194)]));const _0x3281d5=_0x439743[_0x9a9d89(0x29c)]===_0x439743[_0x9a9d89(0x24b)]?a22_0x5c26e2[_0x9a9d89(0x208)](_0x9a9d89(0x2ac))+'\x20'+_0x439743[_0x9a9d89(0x29c)]:a22_0x5c26e2['dim'](_0x9a9d89(0x25d))+'\x20'+_0x439743['joinKey']+_0x9a9d89(0x25c)+_0x439743[_0x9a9d89(0x24b)];console['error']('\x20\x20'+_0x3281d5),console[_0x9a9d89(0x233)]('\x20\x20'+a22_0x5c26e2['dim']('Columns:')),this[_0x9a9d89(0x22e)](_0x439743[_0x9a9d89(0x2b1)]),!_0x439743['schemaValid']&&console['error']('\x20\x20'+a22_0x5c26e2[_0x9a9d89(0x249)](_0x9a9d89(0x1a6))+'\x20'+_0x439743[_0x9a9d89(0x263)]);}}[a22_0x428e50(0x22e)](_0x25a27f){const _0x3c3a5b=a22_0x428e50;for(const _0x555309 of _0x25a27f){_0x555309[_0x3c3a5b(0x223)]===_0x555309[_0x3c3a5b(0x2ae)]||_0x555309[_0x3c3a5b(0x2ae)]==='*'?console['error'](_0x3c3a5b(0x1d7)+_0x555309['label']):console['error'](_0x3c3a5b(0x1d7)+_0x555309[_0x3c3a5b(0x223)]+'\x20'+a22_0x5c26e2['dim']('('+_0x555309[_0x3c3a5b(0x2ae)]+')'));}}[a22_0x428e50(0x297)](_0x15b5df){const _0x390f66=a22_0x428e50;console[_0x390f66(0x233)]('─'['repeat'](0x3c));if(_0x15b5df[_0x390f66(0x2aa)]['length']>0x0){console['error']('\x0a'+a22_0x5c26e2[_0x390f66(0x249)](_0x390f66(0x260)));for(const _0x11eabe of _0x15b5df[_0x390f66(0x2aa)]){console[_0x390f66(0x233)]('\x20\x20'+a22_0x5c26e2[_0x390f66(0x249)]('•')+'\x20'+_0x11eabe);}}_0x15b5df[_0x390f66(0x2b9)]&&console[_0x390f66(0x233)]('\x0a'+a22_0x5c26e2[_0x390f66(0x261)]('✔')+_0x390f66(0x1eb));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a22_0x428e50(0x204)]='segment:parent:preview';[a22_0x428e50(0x241)]=a22_0x428e50(0x238);async[a22_0x428e50(0x2a1)](_0xa3e7a1){const _0xd2fdeb=a22_0x428e50,{options:_0x153b76,args:_0x53e909,tdx:_0x58555b}=_0xa3e7a1,_0x161e93=_0x153b76,_0xd9e8b1=_0x53e909[0x0]||_0x153b76[_0xd2fdeb(0x25e)];if(!_0xd9e8b1)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0xd2fdeb(0x2bc)+_0xd2fdeb(0x1c1)+_0xd2fdeb(0x1f5)+_0xd2fdeb(0x26a)+_0xd2fdeb(0x1b4)+_0xd2fdeb(0x210)+_0xd2fdeb(0x211)),0x1;if(!_0x161e93[_0xd2fdeb(0x1e4)]&&!_0x161e93['attribute']&&!_0x161e93[_0xd2fdeb(0x196)]&&!_0x161e93[_0xd2fdeb(0x20b)])return console['error'](a22_0x5c26e2[_0xd2fdeb(0x249)](_0xd2fdeb(0x299))),console[_0xd2fdeb(0x233)](_0xd2fdeb(0x1d8)),console[_0xd2fdeb(0x233)](_0xd2fdeb(0x1f3)),console[_0xd2fdeb(0x233)](_0xd2fdeb(0x246)),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0xd2fdeb(0x233)](_0xd2fdeb(0x1ff)),console['error'](_0xd2fdeb(0x2ab)),0x1;const _0x289794=resolveYamlFile(_0xd9e8b1);if(!existsSync(_0x289794))return showFileNotFoundError(_0x289794,_0xd9e8b1),0x1;_0x161e93[_0xd2fdeb(0x216)]&&(console[_0xd2fdeb(0x233)]('Site:\x20'+_0x161e93[_0xd2fdeb(0x1ce)]),console[_0xd2fdeb(0x233)](_0xd2fdeb(0x2be)+_0x289794));let _0x2e1bbf;try{_0x2e1bbf=readFileSync(_0x289794,'utf-8');}catch(_0xbefac6){const _0xc2202d=_0xbefac6 instanceof Error?_0xbefac6['message']:String(_0xbefac6);return console['error'](_0xd2fdeb(0x1de)+_0xc2202d),0x1;}let _0x11cdd9;try{_0x11cdd9=parseDef(_0x2e1bbf);}catch(_0x3946ba){const _0x5e3a96=_0x3946ba instanceof Error?_0x3946ba['message']:String(_0x3946ba);return console[_0xd2fdeb(0x233)](a22_0x5c26e2['red']('Error\x20parsing\x20YAML:\x20'+_0x5e3a96)),0x1;}if(_0x161e93[_0xd2fdeb(0x287)]===!![]||_0x161e93[_0xd2fdeb(0x287)]===''){const _0x3c7fa9=_0x11cdd9['attributes']?.[_0xd2fdeb(0x2b3)](_0x32ada6=>_0x32ada6[_0xd2fdeb(0x204)])||[];if(_0x3c7fa9[_0xd2fdeb(0x228)]===0x0)console[_0xd2fdeb(0x233)](a22_0x5c26e2['red'](_0xd2fdeb(0x27b)));else{console[_0xd2fdeb(0x233)](a22_0x5c26e2[_0xd2fdeb(0x249)](_0xd2fdeb(0x207))),console[_0xd2fdeb(0x233)](_0xd2fdeb(0x1e6));for(const _0x47d1aa of _0x3c7fa9){console[_0xd2fdeb(0x233)]('\x20\x20'+a22_0x5c26e2['cyan'](_0x47d1aa));}console[_0xd2fdeb(0x233)](_0xd2fdeb(0x1c6)+_0xd9e8b1+_0xd2fdeb(0x1b7)+_0x3c7fa9[0x0]+'\x22');}return 0x1;}if(_0x161e93[_0xd2fdeb(0x196)]===!![]||_0x161e93[_0xd2fdeb(0x196)]===''){const _0x2aff60=_0x11cdd9[_0xd2fdeb(0x25f)]?.['map'](_0xbe982c=>_0xbe982c[_0xd2fdeb(0x204)])||[];if(_0x2aff60[_0xd2fdeb(0x228)]===0x0)console[_0xd2fdeb(0x233)](a22_0x5c26e2[_0xd2fdeb(0x249)](_0xd2fdeb(0x236)));else{console[_0xd2fdeb(0x233)](a22_0x5c26e2[_0xd2fdeb(0x249)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0xd2fdeb(0x1a9));for(const _0x4e7cb5 of _0x2aff60){console[_0xd2fdeb(0x233)]('\x20\x20'+a22_0x5c26e2['cyan'](_0x4e7cb5));}console['error'](_0xd2fdeb(0x1c6)+_0xd9e8b1+'\x20--behavior\x20\x22'+_0x2aff60[0x0]+'\x22');}return 0x1;}const _0x3e9723=createCommandSpinner(a22_0x5c26e2[_0xd2fdeb(0x208)](_0xd2fdeb(0x28a)),{'verbose':_0x161e93[_0xd2fdeb(0x216)]});_0x3e9723[_0xd2fdeb(0x22b)]();const _0x58e69c={'onProgress':_0x40dbaf=>{const _0x22a569=_0xd2fdeb;_0x3e9723[_0x22a569(0x293)]=formatProgressMessage(_0x40dbaf);}};if(_0x161e93[_0xd2fdeb(0x1e4)])_0x58e69c[_0xd2fdeb(0x1e4)]=!![];if(_0x161e93[_0xd2fdeb(0x287)]&&typeof _0x161e93[_0xd2fdeb(0x287)]===_0xd2fdeb(0x1bd))_0x58e69c[_0xd2fdeb(0x287)]=_0x161e93[_0xd2fdeb(0x287)];if(_0x161e93['behavior']&&typeof _0x161e93[_0xd2fdeb(0x196)]===_0xd2fdeb(0x1bd))_0x58e69c[_0xd2fdeb(0x196)]=_0x161e93[_0xd2fdeb(0x196)];if(_0x161e93[_0xd2fdeb(0x20b)])_0x58e69c[_0xd2fdeb(0x20b)]=!![];if(_0x161e93['interval'])_0x58e69c[_0xd2fdeb(0x295)]=_0x161e93['interval'];let _0xa71b83;try{_0xa71b83=await _0x58555b['segment']['previewParentYaml'](_0x2e1bbf,_0x58e69c),_0x3e9723[_0xd2fdeb(0x25b)]();}catch(_0x497d30){_0x3e9723[_0xd2fdeb(0x25b)]();throw _0x497d30;}return await this[_0xd2fdeb(0x27f)](_0xa71b83,{'master':_0x161e93[_0xd2fdeb(0x1e4)],'attribute':typeof _0x161e93[_0xd2fdeb(0x287)]===_0xd2fdeb(0x1bd)?_0x161e93[_0xd2fdeb(0x287)]:undefined,'behavior':typeof _0x161e93[_0xd2fdeb(0x196)]===_0xd2fdeb(0x1bd)?_0x161e93['behavior']:undefined,'enriched':_0x161e93[_0xd2fdeb(0x20b)]}),_0xa71b83[_0xd2fdeb(0x2b9)]?0x0:0x1;}async['displayPreviewResults'](_0x3dd9f2,_0x10cf2f){const _0x59f9fb=a22_0x428e50;console['error']('\x0a'+a22_0x5c26e2[_0x59f9fb(0x1e9)](_0x59f9fb(0x220))+'\x20'+_0x3dd9f2[_0x59f9fb(0x204)]),console[_0x59f9fb(0x233)]('═'[_0x59f9fb(0x226)](0x3c));if(_0x10cf2f[_0x59f9fb(0x1e4)]&&_0x3dd9f2['sampleData']){const _0x7bb4ac=a22_0x5c26e2[_0x59f9fb(0x208)](_0x59f9fb(0x237))+'\x20'+a22_0x5c26e2[_0x59f9fb(0x1e9)](_0x3dd9f2[_0x59f9fb(0x1e4)]['database']+'.'+_0x3dd9f2['master'][_0x59f9fb(0x194)]);await this[_0x59f9fb(0x206)](_0x7bb4ac,_0x3dd9f2['sampleData']);}else{if(_0x10cf2f[_0x59f9fb(0x287)]&&_0x3dd9f2['sampleData']){const _0x2f64a8=a22_0x5c26e2[_0x59f9fb(0x208)]('Attribute:')+'\x20'+a22_0x5c26e2[_0x59f9fb(0x1e9)](_0x10cf2f[_0x59f9fb(0x287)]);await this[_0x59f9fb(0x206)](_0x2f64a8,_0x3dd9f2[_0x59f9fb(0x22f)]);}else{if(_0x10cf2f['behavior']&&_0x3dd9f2[_0x59f9fb(0x22f)]){const _0x23cd4b=a22_0x5c26e2[_0x59f9fb(0x208)]('Behavior:')+'\x20'+a22_0x5c26e2[_0x59f9fb(0x1e9)](_0x10cf2f[_0x59f9fb(0x196)]);await this[_0x59f9fb(0x206)](_0x23cd4b,_0x3dd9f2[_0x59f9fb(0x22f)]);}else{if(_0x10cf2f[_0x59f9fb(0x20b)]&&_0x3dd9f2[_0x59f9fb(0x22f)]){const _0x3dda61=a22_0x5c26e2['dim']('Enriched:')+'\x20'+a22_0x5c26e2[_0x59f9fb(0x1e9)](_0x59f9fb(0x1f2));await this[_0x59f9fb(0x206)](_0x3dda61,_0x3dd9f2['sampleData']);}else!_0x3dd9f2[_0x59f9fb(0x22f)]&&console[_0x59f9fb(0x233)](_0x59f9fb(0x1d2));}}}if(_0x3dd9f2[_0x59f9fb(0x2aa)][_0x59f9fb(0x228)]>0x0){console[_0x59f9fb(0x233)]('─'[_0x59f9fb(0x226)](0x3c)),console[_0x59f9fb(0x233)]('\x0a'+a22_0x5c26e2[_0x59f9fb(0x249)](_0x59f9fb(0x260)));for(const _0x7b7588 of _0x3dd9f2[_0x59f9fb(0x2aa)]){console[_0x59f9fb(0x233)]('\x20\x20'+a22_0x5c26e2[_0x59f9fb(0x249)]('•')+'\x20'+_0x7b7588);}}}async[a22_0x428e50(0x206)](_0x2146e5,_0x25f53a){const _0x2364a1=a22_0x428e50;if(_0x25f53a[_0x2364a1(0x228)]===0x0){console[_0x2364a1(0x233)]('\x0a'+_0x2146e5),console[_0x2364a1(0x233)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x2364a1(0x233)]('\x0a'+_0x2146e5);const _0x488e50=Object['keys'](_0x25f53a[0x0])[_0x2364a1(0x2b3)](_0x520a95=>({'name':_0x520a95,'type':typeof _0x25f53a[0x0][_0x520a95]==='number'?'double':'varchar'})),_0x4a10af={'queryId':_0x2364a1(0x1cc),'columns':_0x488e50,'data':_0x25f53a,'stats':{'state':_0x2364a1(0x266),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x25f53a[_0x2364a1(0x228)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x27e3e4=formatAsTable(_0x4a10af,_0x25f53a['length'],!![]);await writeOutput(_0x27e3e4,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x19e);[a22_0x428e50(0x241)]=a22_0x428e50(0x20f);async[a22_0x428e50(0x2a1)](_0x519bfc){const _0x58bc70=a22_0x428e50,{options:_0x1c9048,args:_0x3c6453,tdx:_0x1dd26e}=_0x519bfc,_0x49f9ba=_0x1c9048,_0x1aeb94=_0x3c6453[0x0]||_0x1c9048['parentSegment'];if(!_0x1aeb94)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x58bc70(0x2b0)),0x1;const _0x285333=resolveYamlFile(_0x1aeb94);if(existsSync(_0x285333)){_0x49f9ba[_0x58bc70(0x216)]&&console[_0x58bc70(0x233)](_0x58bc70(0x1cb)+_0x285333);let _0x34d942;try{_0x34d942=readFileSync(_0x285333,'utf-8');}catch(_0x3d1cf5){const _0x7bcc94=_0x3d1cf5 instanceof Error?_0x3d1cf5[_0x58bc70(0x1fa)]:String(_0x3d1cf5);return console[_0x58bc70(0x233)]('Error\x20reading\x20file:\x20'+_0x7bcc94),0x1;}const _0x123954=await withSpinner(_0x58bc70(0x190),()=>_0x1dd26e[_0x58bc70(0x28e)]['pushParentYaml'](_0x34d942),{'verbose':_0x49f9ba[_0x58bc70(0x216)]}),_0x35cbf4=_0x123954[_0x58bc70(0x1aa)],{isNew:_0x4a647b,name:_0x431c0f,hasChanges:_0x12a3bf,diffFormatted:_0x30e7e4}=_0x35cbf4;if(_0x12a3bf){_0x4a647b?console[_0x58bc70(0x233)](_0x58bc70(0x26b)+_0x431c0f+'\x27:'):console[_0x58bc70(0x233)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x431c0f+'\x27:');console['error']('─'[_0x58bc70(0x226)](0x3c)),console[_0x58bc70(0x233)](_0x30e7e4),console[_0x58bc70(0x233)]('─'[_0x58bc70(0x226)](0x3c));const _0x2371ab=_0x4a647b?'Create\x20parent\x20segment\x20\x27'+_0x431c0f+_0x58bc70(0x27c):_0x58bc70(0x277)+_0x431c0f+_0x58bc70(0x27c);if(!_0x49f9ba[_0x58bc70(0x1e7)]){const _0xa67c76=await confirmKey(_0x2371ab);if(!_0xa67c76)return console[_0x58bc70(0x233)](_0x58bc70(0x1c9)),0x1;}const _0x30c1ad=_0x4a647b?_0x58bc70(0x27a):'Updating';await withSpinner(_0x30c1ad+'\x20parent\x20segment\x20\x27'+_0x431c0f+_0x58bc70(0x1f6),()=>_0x35cbf4[_0x58bc70(0x2a5)](),{'verbose':_0x49f9ba[_0x58bc70(0x216)]});const _0x5870ea=_0x4a647b?_0x58bc70(0x1c7):_0x58bc70(0x1a5);console[_0x58bc70(0x233)]('✔\x20'+_0x5870ea+_0x58bc70(0x286)+_0x431c0f+'\x27');}else console[_0x58bc70(0x233)]('✔\x20No\x20changes\x20-\x20\x27'+_0x431c0f+_0x58bc70(0x1ad));}const _0x220bd1=await withSpinner(_0x58bc70(0x1bc)+_0x1aeb94+_0x58bc70(0x1f6),()=>_0x1dd26e[_0x58bc70(0x28e)][_0x58bc70(0x252)](_0x1aeb94),{'verbose':_0x49f9ba[_0x58bc70(0x216)]}),_0x560fa4=_0x220bd1[_0x58bc70(0x1aa)],_0x4883f7=getConsoleUrl(_0x49f9ba['site'],_0x58bc70(0x1e8)+_0x560fa4[_0x58bc70(0x26f)]+_0x58bc70(0x259)+_0x560fa4[_0x58bc70(0x1a2)]+_0x58bc70(0x1b9)+_0x560fa4[_0x58bc70(0x19d)]);return console['error'](_0x58bc70(0x1ca)),console[_0x58bc70(0x233)]('\x20\x20'+a22_0x5c26e2[_0x58bc70(0x208)](_0x58bc70(0x1b2))+'\x20'+_0x560fa4[_0x58bc70(0x201)]),console[_0x58bc70(0x233)]('\x20\x20'+a22_0x5c26e2[_0x58bc70(0x208)](_0x58bc70(0x1df))+'\x20'+_0x560fa4[_0x58bc70(0x239)]),console['error']('\x20\x20'+a22_0x5c26e2[_0x58bc70(0x208)](_0x58bc70(0x23f))+'\x20'+_0x560fa4[_0x58bc70(0x1a2)]),console[_0x58bc70(0x233)]('\x20\x20'+a22_0x5c26e2[_0x58bc70(0x208)](_0x58bc70(0x1ea))+'\x20'+_0x560fa4[_0x58bc70(0x19d)]),console['error']('\x20\x20'+_0x4883f7),console[_0x58bc70(0x233)]('\x0a'+a22_0x5c26e2[_0x58bc70(0x208)](_0x58bc70(0x2b7))+_0x58bc70(0x1ed)+_0x560fa4[_0x58bc70(0x19d)]+_0x58bc70(0x23a)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x1a3);['description']=a22_0x428e50(0x218);async[a22_0x428e50(0x2a1)](_0x50bc90){const _0x26113e=a22_0x428e50,{options:_0x45bcc1,args:_0x2aeb60,tdx:_0x14098b}=_0x50bc90,_0x4a12a6=_0x2aeb60[0x0]||_0x45bcc1[_0x26113e(0x25e)];if(!_0x4a12a6)return showParentSegmentNotSetError(_0x26113e(0x290)+_0x26113e(0x270)),0x1;_0x45bcc1[_0x26113e(0x216)]&&(console[_0x26113e(0x233)]('Site:\x20'+_0x45bcc1['site']),console['error'](_0x26113e(0x1d1)+_0x4a12a6));const _0x2cdca2=await withSpinner(_0x26113e(0x21d)+_0x4a12a6+_0x26113e(0x1f6),()=>_0x14098b[_0x26113e(0x28e)]['listFields'](_0x4a12a6),{'verbose':_0x45bcc1[_0x26113e(0x216)]}),_0x15804b=_0x2cdca2[_0x26113e(0x1aa)];console[_0x26113e(0x233)](_0x26113e(0x267)+_0x15804b['length']+_0x26113e(0x1f7)+(_0x15804b['length']!==0x1?'s':''));if(_0x45bcc1[_0x26113e(0x268)]||_0x45bcc1['jsonl'])return await handleSDKOutput(_0x15804b,_0x45bcc1),0x0;return displayFieldsHumanReadable(_0x15804b,_0x4a12a6),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x1f4);['description']=a22_0x428e50(0x221);async[a22_0x428e50(0x2a1)](_0x1a335b){const _0xb10f3f=a22_0x428e50,{options:_0x5c0a20,args:_0xf5d5c4,tdx:_0x14838a}=_0x1a335b,_0x2e2ccc=_0x5c0a20,_0x2aa8dd=_0xf5d5c4[0x0]||_0x5c0a20[_0xb10f3f(0x25e)];if(!_0x2aa8dd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0xb10f3f(0x247)+_0xb10f3f(0x29e)+_0xb10f3f(0x23e)),0x1;_0x5c0a20['verbose']&&(console[_0xb10f3f(0x233)](_0xb10f3f(0x229)+_0x5c0a20[_0xb10f3f(0x1ce)]),console[_0xb10f3f(0x233)](_0xb10f3f(0x1d1)+_0x2aa8dd));const _0x34d778=await withSpinner(_0xb10f3f(0x1fb)+_0x2aa8dd+_0xb10f3f(0x1f6),()=>_0x14838a[_0xb10f3f(0x28e)][_0xb10f3f(0x289)](_0x2aa8dd),{'verbose':_0x5c0a20[_0xb10f3f(0x216)]}),_0x2b14d9=_0x34d778[_0xb10f3f(0x1aa)];if(_0x2e2ccc[_0xb10f3f(0x28c)]){const _0x314a65=getConsoleNextUrl(_0x2e2ccc[_0xb10f3f(0x1ce)],_0xb10f3f(0x198)+_0x2b14d9['id']);return console[_0xb10f3f(0x233)](a22_0x5c26e2[_0xb10f3f(0x261)]('✔')+'\x20Opening\x20'+a22_0x5c26e2[_0xb10f3f(0x27d)](_0x314a65)),openBrowser(_0x314a65),0x0;}return await handleSingleObjectOutput(_0x2b14d9,_0x5c0a20),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a22_0x428e50(0x241)]=a22_0x428e50(0x1da);async['execute'](_0x41e637){const _0x1f1b88=a22_0x428e50,{options:_0x353800,args:_0x40e51d,tdx:_0x1b3446}=_0x41e637,_0x2ce4b1=_0x40e51d[0x0]||_0x353800['parentSegment'];if(!_0x2ce4b1)return showParentSegmentNotSetError(_0x1f1b88(0x1ac)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x353800[_0x1f1b88(0x216)]&&(console[_0x1f1b88(0x233)](_0x1f1b88(0x229)+_0x353800[_0x1f1b88(0x1ce)]),console['error'](_0x1f1b88(0x1d1)+_0x2ce4b1));const _0x4cc35a=await withSpinner(_0x1f1b88(0x274)+_0x2ce4b1+'\x27...',()=>_0x1b3446['segment'][_0x1f1b88(0x276)](_0x2ce4b1),{'verbose':_0x353800['verbose']}),_0xa66def=_0x4cc35a[_0x1f1b88(0x1aa)],_0x121366=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x2ce4b1+'\x27...',()=>_0x1b3446[_0x1f1b88(0x28e)]['getParentSQL'](_0xa66def),{'verbose':_0x353800[_0x1f1b88(0x216)]}),_0x4f9f06=await executeSchemaQuery(_0x121366[_0x1f1b88(0x1aa)],_0x1b3446,_0x353800);return await handleQueryOutput(_0x4f9f06,_0x353800),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a22_0x428e50(0x2a2);['description']=a22_0x428e50(0x2a9);async[a22_0x428e50(0x2a1)](_0x21c5ce){const _0x40b307=a22_0x428e50,{options:_0x25210c,args:_0x4d9f79,tdx:_0x551a21}=_0x21c5ce,_0x2b81da=_0x4d9f79[0x0]||_0x25210c[_0x40b307(0x25e)];if(!_0x2b81da)return showParentSegmentNotSetError(_0x40b307(0x1fd)+_0x40b307(0x281)),0x1;_0x25210c[_0x40b307(0x216)]&&(console[_0x40b307(0x233)](_0x40b307(0x229)+_0x25210c[_0x40b307(0x1ce)]),console[_0x40b307(0x233)](_0x40b307(0x1d1)+_0x2b81da));const _0x5426b7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2b81da+_0x40b307(0x1f6),()=>_0x551a21[_0x40b307(0x28e)][_0x40b307(0x276)](_0x2b81da),{'verbose':_0x25210c[_0x40b307(0x216)]}),_0x5b65c8=_0x5426b7[_0x40b307(0x1aa)],_0x273746=await withSpinner(_0x40b307(0x1d3)+_0x2b81da+'\x27...',()=>_0x551a21['segment']['getParentSQL'](_0x5b65c8),{'verbose':_0x25210c[_0x40b307(0x216)]}),_0x3a4e6e=_0x273746[_0x40b307(0x1aa)];return _0x25210c['format']===_0x40b307(0x268)||_0x25210c['format']===_0x40b307(0x232)?await handleSDKOutput([{'sql':_0x3a4e6e}],_0x25210c):console[_0x40b307(0x2a7)](_0x3a4e6e),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x428e50(0x204)]=a22_0x428e50(0x1af);[a22_0x428e50(0x241)]=a22_0x428e50(0x1e1);async['execute'](_0x36e10f){const _0x89fd38=a22_0x428e50,{options:_0x34b3b0,args:_0x14955e,tdx:_0x8d916d}=_0x36e10f,_0x17bb6f=_0x14955e[0x0]||_0x34b3b0[_0x89fd38(0x25e)];if(!_0x17bb6f)return showParentSegmentNotSetError(_0x89fd38(0x243)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x34b3b0['verbose']&&(console[_0x89fd38(0x233)](_0x89fd38(0x229)+_0x34b3b0[_0x89fd38(0x1ce)]),console[_0x89fd38(0x233)](_0x89fd38(0x1d1)+_0x17bb6f));const _0x47e281=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x17bb6f+'\x27...',()=>_0x8d916d['segment'][_0x89fd38(0x276)](_0x17bb6f),{'verbose':_0x34b3b0['verbose']}),_0x2507c7=_0x47e281[_0x89fd38(0x1aa)],_0x13ba5e=await withSpinner(_0x89fd38(0x1d3)+_0x17bb6f+_0x89fd38(0x1f6),()=>_0x8d916d[_0x89fd38(0x28e)][_0x89fd38(0x248)](_0x2507c7),{'verbose':_0x34b3b0[_0x89fd38(0x216)]});let _0x210bd0=_0x13ba5e[_0x89fd38(0x1aa)];const _0x2678e0=resolveLimit(_0x34b3b0[_0x89fd38(0x20c)],DEFAULT_DISPLAY_LIMIT),_0x400d2d=/\bLIMIT\s+\d+/i[_0x89fd38(0x2ad)](_0x210bd0);!_0x400d2d&&(_0x210bd0=_0x210bd0[_0x89fd38(0x28f)]()['replace'](/;+$/,''),_0x210bd0='SELECT\x20*\x20FROM\x20(\x0a'+_0x210bd0+_0x89fd38(0x1be)+_0x2678e0);_0x34b3b0[_0x89fd38(0x216)]&&console[_0x89fd38(0x233)](_0x89fd38(0x29d)+_0x210bd0);const _0x6edb35=await withProgressSpinner(_0x89fd38(0x24d),async _0x5958cc=>{const _0x462bf5=_0x89fd38,_0x151fae=await _0x8d916d[_0x462bf5(0x28d)][_0x462bf5(0x2a1)](_0x210bd0,{'catalog':'td','schema':_0x462bf5(0x255),'onJobId':_0xaa4c4c=>{_0x5958cc['setJobId'](_0xaa4c4c);}});return _0x151fae;},{'verbose':_0x34b3b0[_0x89fd38(0x216)]}),_0x4d89cc=_0x6edb35[_0x89fd38(0x1aa)],_0x52f087=_0x4d89cc[_0x89fd38(0x26e)]?_0x89fd38(0x285)+_0x4d89cc[_0x89fd38(0x26e)]+']':'';return console[_0x89fd38(0x233)](_0x89fd38(0x280)+_0x4d89cc[_0x89fd38(0x1f9)][_0x89fd38(0x1ae)][_0x89fd38(0x283)]()+_0x89fd38(0x1ec)+(_0x89fd38(0x19c)+formatElapsed(_0x4d89cc[_0x89fd38(0x1f9)][_0x89fd38(0x23d)])+_0x52f087)),await handleQueryOutput(_0x4d89cc,_0x34b3b0),0x0;}}
@@ -1 +1 @@
1
- const a23_0x507c66=a23_0x2616;function a23_0x2616(_0x53332f,_0x4b565e){_0x53332f=_0x53332f-0x1ac;const _0x2f450a=a23_0x2f45();let _0x261624=_0x2f450a[_0x53332f];return _0x261624;}(function(_0x432276,_0x67227){const _0x43a9df=a23_0x2616,_0x5a0cb4=_0x432276();while(!![]){try{const _0xcdf947=parseInt(_0x43a9df(0x1b0))/0x1+-parseInt(_0x43a9df(0x1bb))/0x2*(parseInt(_0x43a9df(0x1b3))/0x3)+-parseInt(_0x43a9df(0x1b5))/0x4+-parseInt(_0x43a9df(0x1b4))/0x5*(-parseInt(_0x43a9df(0x1ba))/0x6)+-parseInt(_0x43a9df(0x1af))/0x7+parseInt(_0x43a9df(0x1c0))/0x8+parseInt(_0x43a9df(0x1c1))/0x9*(parseInt(_0x43a9df(0x1bc))/0xa);if(_0xcdf947===_0x67227)break;else _0x5a0cb4['push'](_0x5a0cb4['shift']());}catch(_0x3a7c5d){_0x5a0cb4['push'](_0x5a0cb4['shift']());}}}(a23_0x2f45,0xcad87));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a23_0x2f45(){const _0xeac447=['334770eeSMkG','description','length','log','2659488UOLBOp','279KoRTgW','Error:\x20','config','profiles','map','scope','184156LTdUdo','638890OpLGCV','name','execute','1668XSlYbe','5MaqFYi','2281948ueHnzn','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message','\x20\x20Global:\x20~/.config/tdx/tdx.json','List\x20all\x20available\x20profiles','681222tublYD','2500MXsKDX'];a23_0x2f45=function(){return _0xeac447;};return a23_0x2f45();}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x507c66(0x1b1)]=a23_0x507c66(0x1ac);[a23_0x507c66(0x1bd)]=a23_0x507c66(0x1b9);async[a23_0x507c66(0x1b2)](_0x5271ed){const _0x5c1bd5=a23_0x507c66,{options:_0x3d156a}=_0x5271ed;try{const _0x100c5e=listProfiles(),_0x2a3ad5=getActiveProfile();if(_0x100c5e[_0x5c1bd5(0x1be)]===0x0)return console[_0x5c1bd5(0x1bf)](_0x5c1bd5(0x1b6)),console[_0x5c1bd5(0x1bf)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5c1bd5(0x1bf)](_0x5c1bd5(0x1b8)),0x0;const _0x4ba941=_0x100c5e[_0x5c1bd5(0x1ad)](_0x3e2220=>{const _0x3b708c=_0x5c1bd5,_0x270c5c=_0x3e2220[_0x3b708c(0x1b1)]===_0x2a3ad5,_0x129a18=getProfileParams(_0x3e2220[_0x3b708c(0x1c3)]);return{'name':_0x3e2220['name'],'active':_0x270c5c,'scope':_0x3e2220[_0x3b708c(0x1ae)],'description':_0x3e2220['config'][_0x3b708c(0x1bd)]||'','params':_0x129a18};});return await handleSDKOutput(_0x4ba941,_0x3d156a),0x0;}catch(_0x3906c9){return _0x3906c9 instanceof Error&&console['error'](_0x5c1bd5(0x1c2)+_0x3906c9[_0x5c1bd5(0x1b7)]),0x1;}}}
1
+ function a23_0x3e25(){const _0x49981f=['8926542Rzmgip','log','8AyBkxV','scope','length','10HpZZsO','error','4872RorUMF','description','433082RHdbQo','33064CcULiE','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','1243695jEEUBf','config','213EKAlaZ','name','910bSoMXo','1012451LvABkx','message','map','16usmiGa','profiles','23707320wEfFBA'];a23_0x3e25=function(){return _0x49981f;};return a23_0x3e25();}const a23_0x62d5ad=a23_0x5d9f;(function(_0x2ff3f0,_0x23235d){const _0x239937=a23_0x5d9f,_0x4bf5da=_0x2ff3f0();while(!![]){try{const _0x418b04=-parseInt(_0x239937(0xd7))/0x1+-parseInt(_0x239937(0xd8))/0x2*(-parseInt(_0x239937(0xc5))/0x3)+parseInt(_0x239937(0xcb))/0x4*(parseInt(_0x239937(0xc3))/0x5)+-parseInt(_0x239937(0xd5))/0x6*(-parseInt(_0x239937(0xc7))/0x7)+-parseInt(_0x239937(0xd0))/0x8*(-parseInt(_0x239937(0xce))/0x9)+parseInt(_0x239937(0xd3))/0xa*(-parseInt(_0x239937(0xc8))/0xb)+-parseInt(_0x239937(0xcd))/0xc;if(_0x418b04===_0x23235d)break;else _0x4bf5da['push'](_0x4bf5da['shift']());}catch(_0x4810c9){_0x4bf5da['push'](_0x4bf5da['shift']());}}}(a23_0x3e25,0xbadd1));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';function a23_0x5d9f(_0xae9fe9,_0x58272c){_0xae9fe9=_0xae9fe9-0xc2;const _0x3e25f4=a23_0x3e25();let _0x5d9f16=_0x3e25f4[_0xae9fe9];return _0x5d9f16;}export class ProfilesCommand extends BaseCommand{[a23_0x62d5ad(0xc6)]=a23_0x62d5ad(0xcc);[a23_0x62d5ad(0xd6)]='List\x20all\x20available\x20profiles';async['execute'](_0x1dc425){const _0x567b04=a23_0x62d5ad,{options:_0x12c963}=_0x1dc425;try{const _0x1b238c=listProfiles(),_0x460f5e=getActiveProfile();if(_0x1b238c[_0x567b04(0xd2)]===0x0)return console[_0x567b04(0xcf)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x567b04(0xcf)](_0x567b04(0xc2)),console[_0x567b04(0xcf)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x16f86f=_0x1b238c[_0x567b04(0xca)](_0x471d74=>{const _0x6b7b28=_0x567b04,_0x1910ac=_0x471d74[_0x6b7b28(0xc6)]===_0x460f5e,_0x473b29=getProfileParams(_0x471d74[_0x6b7b28(0xc4)]);return{'name':_0x471d74[_0x6b7b28(0xc6)],'active':_0x1910ac,'scope':_0x471d74[_0x6b7b28(0xd1)],'description':_0x471d74[_0x6b7b28(0xc4)][_0x6b7b28(0xd6)]||'','params':_0x473b29};});return await handleSDKOutput(_0x16f86f,_0x12c963),0x0;}catch(_0x410c7d){return _0x410c7d instanceof Error&&console[_0x567b04(0xd4)]('Error:\x20'+_0x410c7d[_0x567b04(0xc9)]),0x1;}}}