@treasuredata/tdx 0.8.2 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/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/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/context-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.d.ts.map +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/query-command.js.map +1 -1
  36. package/dist/commands/segment-command.d.ts.map +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-command.js.map +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js.map +1 -1
  44. package/dist/commands/segment-push-command.d.ts.map +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-push-command.js.map +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segments.d.ts.map +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/segments.js.map +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/connection-cache.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/profile.js +1 -1
  64. package/dist/core/project-config.js +1 -1
  65. package/dist/core/session.js +1 -1
  66. package/dist/core/user-cache.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/proxy/anthropic-adapter.d.ts +21 -21
  69. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  70. package/dist/proxy/anthropic-adapter.js +1 -1
  71. package/dist/proxy/anthropic-adapter.js.map +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/context-signature.js +1 -1
  74. package/dist/proxy/conversation-utils.js +1 -1
  75. package/dist/proxy/conversation-utils.js.map +1 -1
  76. package/dist/proxy/server.d.ts.map +1 -1
  77. package/dist/proxy/server.js +1 -1
  78. package/dist/proxy/server.js.map +1 -1
  79. package/dist/proxy/session-cache.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.d.ts +18 -0
  84. package/dist/sdk/errors.d.ts.map +1 -1
  85. package/dist/sdk/errors.js +1 -1
  86. package/dist/sdk/errors.js.map +1 -1
  87. package/dist/sdk/index.js +1 -1
  88. package/dist/sdk/job.js +1 -1
  89. package/dist/sdk/llm.js +1 -1
  90. package/dist/sdk/query.js +1 -1
  91. package/dist/sdk/segment/child-segment-yaml.d.ts +24 -5
  92. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  93. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  94. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  95. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  96. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  97. package/dist/sdk/segment.js +1 -1
  98. package/dist/sdk/user.js +1 -1
  99. package/dist/sdk/workflow.js +1 -1
  100. package/dist/types/endpoints.js +1 -1
  101. package/dist/types/index.d.ts +1 -0
  102. package/dist/types/index.d.ts.map +1 -1
  103. package/dist/types/index.js +1 -1
  104. package/dist/utils/agent-ref-parser.js +1 -1
  105. package/dist/utils/async.js +1 -1
  106. package/dist/utils/chat-cache.js +1 -1
  107. package/dist/utils/colors.js +1 -1
  108. package/dist/utils/command-output.js +1 -1
  109. package/dist/utils/constants.js +1 -1
  110. package/dist/utils/diff.js +1 -1
  111. package/dist/utils/fields-display.js +1 -1
  112. package/dist/utils/file-permissions.js +1 -1
  113. package/dist/utils/format-detector.js +1 -1
  114. package/dist/utils/formatters.js +1 -1
  115. package/dist/utils/json-loader.js +1 -1
  116. package/dist/utils/llm-backup-utils.js +1 -1
  117. package/dist/utils/model-aliases.js +1 -1
  118. package/dist/utils/model-factors.js +1 -1
  119. package/dist/utils/option-validation.js +1 -1
  120. package/dist/utils/port.js +1 -1
  121. package/dist/utils/process.d.ts +6 -0
  122. package/dist/utils/process.d.ts.map +1 -1
  123. package/dist/utils/process.js +1 -1
  124. package/dist/utils/process.js.map +1 -1
  125. package/dist/utils/prompt.js +1 -1
  126. package/dist/utils/segment-path-parser.js +1 -1
  127. package/dist/utils/segment-ref-parser.js +1 -1
  128. package/dist/utils/spinner.js +1 -1
  129. package/dist/utils/sql-parser.d.ts +37 -1
  130. package/dist/utils/sql-parser.d.ts.map +1 -1
  131. package/dist/utils/sql-parser.js +1 -1
  132. package/dist/utils/sql-parser.js.map +1 -1
  133. package/dist/utils/sse-parser.js +1 -1
  134. package/dist/utils/string-utils.js +1 -1
  135. package/dist/utils/table-ref-parser.js +1 -1
  136. package/dist/utils/tdx-config.js +1 -1
  137. package/dist/utils/tdx-logger.js +1 -1
  138. package/dist/utils/tree-formatter.d.ts +4 -0
  139. package/dist/utils/tree-formatter.d.ts.map +1 -1
  140. package/dist/utils/tree-formatter.js +1 -1
  141. package/dist/utils/tree-formatter.js.map +1 -1
  142. package/dist/utils/version-check.js +1 -1
  143. package/dist/utils/workflow-utils.js +1 -1
  144. package/package.json +3 -3
@@ -1 +1 @@
1
- const a25_0x3869c4=a25_0xf4db;(function(_0x9383bd,_0x420416){const _0x827e02=a25_0xf4db,_0x1a3938=_0x9383bd();while(!![]){try{const _0x2ea993=parseInt(_0x827e02(0x266))/0x1+parseInt(_0x827e02(0x276))/0x2*(-parseInt(_0x827e02(0x288))/0x3)+parseInt(_0x827e02(0x263))/0x4+-parseInt(_0x827e02(0x29d))/0x5*(-parseInt(_0x827e02(0x236))/0x6)+-parseInt(_0x827e02(0x24b))/0x7*(parseInt(_0x827e02(0x211))/0x8)+parseInt(_0x827e02(0x277))/0x9*(parseInt(_0x827e02(0x210))/0xa)+-parseInt(_0x827e02(0x1fa))/0xb*(-parseInt(_0x827e02(0x205))/0xc);if(_0x2ea993===_0x420416)break;else _0x1a3938['push'](_0x1a3938['shift']());}catch(_0x447811){_0x1a3938['push'](_0x1a3938['shift']());}}}(a25_0x40e2,0x4f619));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a25_0x5bb442 from'node:fs';function handleSDKError(_0x4862fe,_0x231ef6){const _0x41f9ff=a25_0xf4db;if(_0x4862fe instanceof SDKError)console[_0x41f9ff(0x27c)](_0x41f9ff(0x2a3)+_0x4862fe[_0x41f9ff(0x21c)]),_0x231ef6[_0x41f9ff(0x257)]&&(_0x4862fe['cause']&&console[_0x41f9ff(0x27c)](_0x41f9ff(0x281)+_0x4862fe['cause']),_0x4862fe[_0x41f9ff(0x282)]&&(console[_0x41f9ff(0x27c)](_0x41f9ff(0x1f8)),console['error'](_0x4862fe[_0x41f9ff(0x282)])));else throw _0x4862fe;}function formatChatHistoryEntry(_0x2348f7,_0x1bea06){const _0x32c7c0=a25_0xf4db,_0x5ed74f=getChalk(_0x1bea06),_0x567ea2=_0x5ed74f[_0x32c7c0(0x2be)](_0x2348f7['at']);if(_0x32c7c0(0x261)in _0x2348f7){const _0xd6dff6=_0x5ed74f[_0x32c7c0(0x23f)]('[input]\x20\x20');return _0x567ea2+'\x20'+_0xd6dff6+':\x20'+_0x2348f7['input'];}if(_0x32c7c0(0x212)in _0x2348f7){const _0x56f5d6=_0x5ed74f[_0x32c7c0(0x242)]('[content]');return _0x567ea2+'\x20'+_0x56f5d6+':\x20'+_0x2348f7[_0x32c7c0(0x212)];}if(_0x32c7c0(0x291)in _0x2348f7){const _0x594948=_0x5ed74f['yellow']('[tool_call]'),{functionName:_0x5b9535,functionArguments:_0x33cb43,targetFunction:_0xfde629}=_0x2348f7['tool_call'];let _0x1331bb=_0x567ea2+'\x20'+_0x594948+':\x20'+_0x5ed74f[_0x32c7c0(0x251)](_0x5b9535);if(_0x33cb43&&Object['keys'](_0x33cb43)[_0x32c7c0(0x1f5)]>0x0){const _0x14b39f=Object['entries'](_0x33cb43)[_0x32c7c0(0x287)](([_0x15d363,_0x30021d])=>_0x15d363+'='+JSON[_0x32c7c0(0x2a0)](_0x30021d))['join'](',\x20');_0x1331bb+='('+_0x14b39f+')';}_0xfde629&&(_0x1331bb+=_0x5ed74f[_0x32c7c0(0x2be)]('\x20['+_0xfde629+']'));let _0x191fc5='';if(_0x2348f7['tool_call']['targetKnowledgeBase'])_0x191fc5='\x20->\x20KB:'+_0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x238)][_0x32c7c0(0x2a1)];else{if(_0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x237)])_0x191fc5='\x20->\x20Agent:'+_0x2348f7['tool_call'][_0x32c7c0(0x237)]['name'];else{if(_0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x209)])_0x191fc5=_0x32c7c0(0x28b)+_0x2348f7['tool_call'][_0x32c7c0(0x209)]['name'];else _0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x1fe)]&&(_0x191fc5=_0x32c7c0(0x1fc)+_0x2348f7[_0x32c7c0(0x291)]['targetImageGenerator'][_0x32c7c0(0x2a1)]);}}return _0x1331bb+_0x191fc5;}if('tool'in _0x2348f7){const _0x29c660=_0x5ed74f['magenta'](_0x32c7c0(0x28d)),{functionName:_0x21c1f5,functionArguments:_0x50b461,content:_0x8f168a,newChat:_0x5a71ea}=_0x2348f7[_0x32c7c0(0x22e)];let _0x59033e=_0x567ea2+'\x20'+_0x29c660+':\x20'+_0x5ed74f['bold'](_0x21c1f5);if(_0x50b461){const _0x147a16=typeof _0x50b461===_0x32c7c0(0x253)?_0x50b461:JSON[_0x32c7c0(0x2a0)](_0x50b461);_0x59033e+='('+_0x147a16+')';}return _0x8f168a&&(_0x59033e+='\x0a'+_0x5ed74f[_0x32c7c0(0x2be)](_0x8f168a)),_0x5a71ea&&(_0x59033e+=_0x5ed74f[_0x32c7c0(0x2be)](_0x32c7c0(0x23c)+_0x5a71ea['id'])),_0x59033e;}if(_0x32c7c0(0x2ba)in _0x2348f7){const _0x14d426=_0x5ed74f[_0x32c7c0(0x24a)](_0x32c7c0(0x218));return _0x567ea2+'\x20'+_0x14d426+':\x20'+_0x2348f7[_0x32c7c0(0x2ba)][_0x32c7c0(0x2a1)]+'\x20('+_0x2348f7[_0x32c7c0(0x2ba)]['content'][_0x32c7c0(0x1f5)]+_0x32c7c0(0x24c);}if(_0x32c7c0(0x269)in _0x2348f7){const _0x5535cd=_0x5ed74f[_0x32c7c0(0x24a)]('[image]\x20\x20'),{width:_0x509dd6,height:_0x551214,headerText:_0x8b7c6d}=_0x2348f7['image'],_0x35507a=_0x8b7c6d?'\x20-\x20'+_0x8b7c6d:'';return _0x567ea2+'\x20'+_0x5535cd+':\x20'+_0x509dd6+'x'+_0x551214+_0x35507a;}if(_0x32c7c0(0x27c)in _0x2348f7){const _0x2451ec=_0x5ed74f[_0x32c7c0(0x2ac)](_0x32c7c0(0x290));return _0x567ea2+'\x20'+_0x2451ec+':\x20'+_0x2348f7['error'];}return _0x567ea2+'\x20'+_0x5ed74f[_0x32c7c0(0x2be)](_0x32c7c0(0x1fb))+':\x20'+JSON['stringify'](_0x2348f7);}async function executeChatHistoryCommand(_0x195f82,_0x1d5324){const _0x79b3a5=a25_0xf4db,{options:_0x23ea1b,args:_0x23fc56,tdx:_0x15cd70}=_0x195f82,_0x2b9bde=_0x23fc56[0x0],_0x152c35=_0x23ea1b,_0x354731=_0x152c35[_0x79b3a5(0x2ab)];try{if(_0x354731&&_0x2b9bde)return console['error'](_0x79b3a5(0x25d)),console[_0x79b3a5(0x27c)](_0x79b3a5(0x2c1)+_0x1d5324+'\x20--last'),0x1;if(!_0x2b9bde&&!_0x354731&&_0x23ea1b[_0x79b3a5(0x22c)]!==undefined){const _0x3261e2=resolveLimit(_0x23ea1b[_0x79b3a5(0x20a)],DEFAULT_LLM_LIMIT),_0x11ea31=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x15cd70[_0x79b3a5(0x2b7)][_0x79b3a5(0x23e)](_0x3261e2),{'verbose':_0x23ea1b[_0x79b3a5(0x257)]});return await handleSDKOutput(_0x11ea31['data'],_0x23ea1b),0x0;}const _0x553f6f=await getChatIdOrSelect(_0x15cd70,_0x23ea1b,_0x354731,_0x2b9bde);if(!_0x553f6f)return 0x0;return await displayChatHistory(_0x553f6f,_0x15cd70,_0x23ea1b),0x0;}catch(_0x455ef2){return handleSDKError(_0x455ef2,_0x23ea1b),0x1;}}async function displayChatHistory(_0x4dd9ef,_0x130092,_0x408bce){const _0x494072=a25_0xf4db,_0x42c04d=await withSpinner(_0x494072(0x2b4)+_0x4dd9ef+_0x494072(0x2b5),()=>_0x130092[_0x494072(0x2b7)][_0x494072(0x208)](_0x4dd9ef),{'verbose':_0x408bce[_0x494072(0x257)]}),_0x435449=_0x42c04d[_0x494072(0x289)][_0x494072(0x289)]??[];if(_0x435449['length']===0x0){console[_0x494072(0x200)](_0x494072(0x204));return;}if(_0x408bce[_0x494072(0x22c)]!==undefined)await handleSDKOutput(_0x435449,_0x408bce);else{const _0x1a9ec2=_0x435449[_0x494072(0x287)](_0x256af1=>formatChatHistoryEntry(_0x256af1,_0x408bce)),_0x13c7ac=_0x1a9ec2['join']('\x0a');await writeOutput(_0x13c7ac,_0x408bce[_0x494072(0x2ba)],_0x494072(0x278));}}function a25_0x40e2(){const _0x43a3ba=['\x20\x20Agents:\x20','just\x20now','stringify','name','getOrCreateDefaultProject','Error:\x20','floor','\x27\x20already\x20exists.\x20Overwrite?','Fetching\x20chat\x20sessions...','Resolving\x20project\x20\x27','json','resolveProjectId','starterMessage','last','red','get','Backing\x20up\x20project\x20\x27','llm:agents','Update\x20an\x20existing\x20agent','__load_more__','deleteAgent','llm:agent:update','Fetching\x20chat\x20history\x20for\x20\x27','\x27...','yes','llm','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','...','output','restoreProject','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','model','dim','Select\x20a\x20chat\x20session:','default','Usage:\x20','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','length','Create\x20a\x20new\x20agent\x20in\x20current\x20project','getBackupMetadata','\x0aStack\x20trace:','Deleting\x20project\x20\x27','927586JKNxeG','[unknown]','\x20->\x20ImageGen:','find','targetImageGenerator','Usage:\x20tdx\x20llm\x20use\x20<project-name>','log','llmProject','firstInputContent','llm:project:backup','No\x20messages\x20found\x20in\x20chat\x20history.','24gZwpSY','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Show\x20agent\x20details','history','targetWebSearchTool','limit','createProject','createdAt','backupProject','includes','Delete\x20an\x20LLM\x20project','490XoXNHV','184tiIfac','content','llm:agent:show','A\x20project\x20named\x20\x27','maxToolIterations','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','chatId','[output]\x20','push','prompts','updatedAt','message','systemPrompt','Analyzing\x20project\x20\x27','all','Error:\x20Backup\x20folder\x20path\x20is\x20required','Checking\x20for\x20existing\x20projects...','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','Deleting\x20agent...','Fetching\x20projects...','Fetching\x20agent...','llm:history','Delete\x20an\x20agent','Error:\x20Agent\x20name\x20is\x20required','projects','exportedFrom','format','filter','tool','Agent\x20updated:\x20','Project\x20context\x20set\x20to:\x20','Use\x20format:\x20project-name/agent-name','agents','llm:use','Backup\x20cancelled.','counts','3325254vGcFQt','targetAgent','targetKnowledgeBase','split','Getting\x20default\x20project...','execute','\x20→\x20chat:\x20','dryRun','chats','cyan','toLowerCase','.llm','green','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','getTime','integrations','projectName','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','llm:agent:create','Setting\x20project\x20context\x20to\x20\x27','blue','90174jyuunM','\x20bytes)','llm:project:restore','Create\x20a\x20new\x20LLM\x20project','short','Project\x20not\x20found:\x20','bold','lastConversationAt','string','projectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Error:\x20Project\x20name\x20is\x20required','verbose','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Set\x20current\x20project\x20context','Project\x20created:\x20','rmSync','Agent\x20deleted:\x20','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','m\x20ago','Restoring\x20project\x20from\x20\x27','tdx\x20llm\x20history','input','set','126360upTpHB','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','258346MQUoKa','\x20\x20Knowledge\x20Bases:\x20','List\x20agents\x20in\x20current\x20project','image','Resolving\x20agent\x20\x27','numeric','outputDir','No\x20chat\x20sessions\x20found.','getCurrentProject','LLM_PROJECT_NOT_FOUND','agent','Project\x20backed\x20up\x20to:\x20','prompt','createAgent','Restore\x20cancelled.','agentId','478gfEdAb','153gAhYqC','table','slice','\x20\x20Prompts:\x20','Load\x20more...','error','llm:agent:delete','(no\x20agent)','Output\x20directory\x20\x27','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','\x20\x20Cause:\x20','stack','description','attributes','temperature','Validating\x20backup\x20from\x20\x27','map','4923yYLzIB','data','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20->\x20WebSearch:','List\x20available\x20LLM\x20models','[tool]\x20\x20\x20','\x20\x20Integrations:\x20','resolveAgentId','[error]\x20\x20','tool_call','Agent\x20created:\x20','substring','Updating\x20agent...','jsonl','knowledgeBases','sourceSite','INVALID_ARGUMENT','Project\x20deleted:\x20','Fetching\x20agents...','Creating\x20project\x20\x27','llm:project:delete','5fnsXOJ'];a25_0x40e2=function(){return _0x43a3ba;};return a25_0x40e2();}async function getChatIdOrSelect(_0x11f176,_0x4806bc,_0x480d6e,_0x3148d2){const _0x2fa302=a25_0xf4db;if(_0x3148d2)return _0x3148d2;if(_0x480d6e){const _0x261201=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x11f176[_0x2fa302(0x2b7)][_0x2fa302(0x23e)](0x1),{'verbose':_0x4806bc[_0x2fa302(0x257)]});if(_0x261201[_0x2fa302(0x289)][_0x2fa302(0x1f5)]===0x0)return console[_0x2fa302(0x200)](_0x2fa302(0x26d)),undefined;return _0x261201[_0x2fa302(0x289)][0x0]['id'];}const _0x3e06a6=await selectChatInteractively(_0x11f176,_0x4806bc);if(!_0x3e06a6)return console[_0x2fa302(0x200)]('\x0aCancelled'),undefined;return _0x3e06a6;}async function getProjectIdOrDefault(_0x2d86b2){const _0x599b16=a25_0xf4db,{tdx:_0x3d93bc,options:_0xdefc3}=_0x2d86b2,_0x2916ef=_0xdefc3[_0x599b16(0x201)];if(_0x2916ef){const _0x2d3342=await withSpinner(_0x599b16(0x2a7)+_0x2916ef+_0x599b16(0x2b5),()=>_0x3d93bc[_0x599b16(0x2b7)][_0x599b16(0x2a9)](_0x2916ef),{'verbose':_0xdefc3[_0x599b16(0x257)]});return _0x2d3342[_0x599b16(0x289)];}let _0x15f6a5=_0x3d93bc[_0x599b16(0x2b7)][_0x599b16(0x26e)]();if(_0x15f6a5)return _0x15f6a5;const _0x545b04=await withSpinner(_0x599b16(0x23a),()=>_0x3d93bc[_0x599b16(0x2b7)][_0x599b16(0x2a2)](),{'verbose':_0xdefc3[_0x599b16(0x257)]});return _0x545b04[_0x599b16(0x289)]['id'];}function toLLMProjectInfo(_0x189266){const _0x191aad=a25_0xf4db;return{'name':_0x189266[_0x191aad(0x284)]['name'],'description':_0x189266[_0x191aad(0x284)][_0x191aad(0x283)],'createdAt':_0x189266[_0x191aad(0x284)]['createdAt'],'updatedAt':_0x189266[_0x191aad(0x284)][_0x191aad(0x21b)]};}function toAgentInfo(_0x33370f){const _0x5d9c30=a25_0xf4db;return{'name':_0x33370f[_0x5d9c30(0x284)]['name'],'description':_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x283)],'prompt':truncatePrompt(_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x272)]),'createdAt':_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x20c)],'updatedAt':_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x21b)]};}function truncatePrompt(_0x5f4322){const _0x4f6b6e=a25_0xf4db;if(!_0x5f4322)return undefined;const _0x185c11=0x64;if(_0x5f4322[_0x4f6b6e(0x1f5)]<=_0x185c11)return _0x5f4322;return _0x5f4322['slice'](0x0,_0x185c11)+_0x4f6b6e(0x2b9);}export class LLMModelsCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]='llm:models';[a25_0x3869c4(0x283)]=a25_0x3869c4(0x28c);async[a25_0x3869c4(0x23b)](_0x50d74f){const _0x5380c1=a25_0x3869c4,{options:_0x1718c1,tdx:_0x26143a}=_0x50d74f;try{const _0x2ca9d7=await withSpinner('Fetching\x20available\x20models...',()=>_0x26143a['llm']['models'](),{'verbose':_0x1718c1['verbose']});return await handleSDKOutput(_0x2ca9d7[_0x5380c1(0x289)],_0x1718c1),0x0;}catch(_0x1ae524){return handleSDKError(_0x1ae524,_0x1718c1),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']='llm:projects';[a25_0x3869c4(0x283)]='List\x20all\x20LLM\x20projects';async[a25_0x3869c4(0x23b)](_0x2f6ec1){const _0x58ab7b=a25_0x3869c4,{options:_0x413ffe,args:_0x10eb5b,tdx:_0xf21fa1}=_0x2f6ec1;try{const _0x44c4e9=_0x10eb5b[0x0],_0x2641b6=resolveLimit(_0x413ffe[_0x58ab7b(0x20a)],DEFAULT_LLM_LIMIT),_0x203f16=await withSpinner(_0x58ab7b(0x225),()=>_0xf21fa1['llm'][_0x58ab7b(0x22a)](_0x2641b6),{'verbose':_0x413ffe[_0x58ab7b(0x257)]});let _0x295b11=_0x203f16[_0x58ab7b(0x289)];_0x44c4e9&&(_0x295b11=_0x203f16['data']['filter'](_0x47cdde=>matchGlobPattern(_0x47cdde[_0x58ab7b(0x284)][_0x58ab7b(0x2a1)],_0x44c4e9)));const _0x4dc2c8=_0x295b11['map'](toLLMProjectInfo);return await handleSDKOutput(_0x4dc2c8,_0x413ffe),0x0;}catch(_0x222b6e){return handleSDKError(_0x222b6e,_0x413ffe),0x1;}}}function a25_0xf4db(_0x4bfe2c,_0x1db85a){_0x4bfe2c=_0x4bfe2c-0x1f4;const _0x40e2de=a25_0x40e2();let _0xf4db=_0x40e2de[_0x4bfe2c];return _0xf4db;}export class LLMAgentsCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x2af);['description']=a25_0x3869c4(0x268);async['execute'](_0x497d6d){const _0x59db36=a25_0x3869c4,{options:_0xe310aa,args:_0x42f610,tdx:_0x2058f7}=_0x497d6d;try{const _0x16a607=_0x42f610[0x0];let _0x140da0,_0x265a3c=_0x16a607;if(_0x16a607&&_0x16a607[_0x59db36(0x20e)]('/')){const _0x4ffa16=_0x16a607[_0x59db36(0x239)]('/');if(_0x4ffa16[_0x59db36(0x1f5)]===0x2){const [_0x5959ba,_0x195233]=_0x4ffa16,_0x4e70d3=await _0x2058f7[_0x59db36(0x2b7)][_0x59db36(0x22a)](),_0x4f5179=_0x4e70d3[_0x59db36(0x1fd)](_0x45336c=>_0x45336c[_0x59db36(0x284)][_0x59db36(0x2a1)][_0x59db36(0x240)]()===_0x5959ba[_0x59db36(0x240)]());if(!_0x4f5179)throw new SDKError(ErrorCode[_0x59db36(0x26f)],_0x59db36(0x250)+_0x5959ba,undefined,{'helpText':_0x59db36(0x258)});_0x140da0=_0x4f5179['id'],_0x265a3c=_0x195233;}else throw new SDKError(ErrorCode[_0x59db36(0x298)],'Invalid\x20path\x20syntax:\x20'+_0x16a607,undefined,{'helpText':_0x59db36(0x231)});}else _0x140da0=await getProjectIdOrDefault(_0x497d6d);const _0x224720=await withSpinner(_0x59db36(0x29a),()=>_0x2058f7[_0x59db36(0x2b7)][_0x59db36(0x232)](_0x140da0),{'verbose':_0xe310aa['verbose']});let _0x416411=_0x224720[_0x59db36(0x289)];_0x265a3c&&(_0x416411=_0x224720['data'][_0x59db36(0x22d)](_0x16faa2=>matchGlobPattern(_0x16faa2[_0x59db36(0x284)]['name'],_0x265a3c)));const _0x2a5a9c=_0x416411[_0x59db36(0x287)](toAgentInfo);return await handleSDKOutput(_0x2a5a9c,_0xe310aa),0x0;}catch(_0x13b21b){return handleSDKError(_0x13b21b,_0xe310aa),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x213);['description']=a25_0x3869c4(0x207);async[a25_0x3869c4(0x23b)](_0x1676ca){const _0x199e93=a25_0x3869c4,{options:_0x222dfb,args:_0x3ce08d,tdx:_0x2fe054}=_0x1676ca;if(_0x3ce08d['length']===0x0)return console['error'](_0x199e93(0x229)),console['error'](_0x199e93(0x216)),0x1;const _0x8f9313=_0x3ce08d[0x0];try{const _0x4f5faf=await getProjectIdOrDefault(_0x1676ca),_0x4afc53=await withSpinner(_0x199e93(0x26a)+_0x8f9313+'\x27...',()=>_0x2fe054[_0x199e93(0x2b7)]['resolveAgentId'](_0x8f9313,_0x4f5faf),{'verbose':_0x222dfb[_0x199e93(0x257)]}),_0x110a5f=await withSpinner(_0x199e93(0x226),()=>_0x2fe054[_0x199e93(0x2b7)][_0x199e93(0x270)](_0x4afc53[_0x199e93(0x289)]),{'verbose':_0x222dfb[_0x199e93(0x257)]});return await handleSDKOutput([_0x110a5f['data']],_0x222dfb),0x0;}catch(_0x380451){return handleSDKError(_0x380451,_0x222dfb),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x248);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x1f6);async[a25_0x3869c4(0x23b)](_0x245385){const _0x54e08c=a25_0x3869c4,{options:_0xa31c28,args:_0x36c7f3,tdx:_0x10ba25}=_0x245385;if(_0x36c7f3['length']===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x54e08c(0x27c)](_0x54e08c(0x1f4)),console[_0x54e08c(0x27c)](_0x54e08c(0x255)),0x1;const _0x22fff0=_0x36c7f3[0x0],_0x560b8f=_0xa31c28,_0x515131=_0x560b8f[_0x54e08c(0x21d)],_0x1d92e4=_0x560b8f[_0x54e08c(0x2bd)]||'claude-4.5-haiku',_0x586010=_0x560b8f[_0x54e08c(0x2aa)],_0x4f96e9=_0x560b8f[_0x54e08c(0x215)]?Number(_0x560b8f['maxToolIterations']):undefined,_0x10882e=_0x560b8f[_0x54e08c(0x285)]?Number(_0x560b8f['temperature']):undefined;try{let _0x25c65d,_0x1d8882;if(_0x22fff0['includes']('/')){const _0x424e86=_0x22fff0['split']('/');if(_0x424e86[_0x54e08c(0x1f5)]===0x2){const [_0xa6f7f5,_0x1bd057]=_0x424e86,_0x439fe5=await withSpinner(_0x54e08c(0x2a7)+_0xa6f7f5+_0x54e08c(0x2b5),()=>_0x10ba25['llm'][_0x54e08c(0x2a9)](_0xa6f7f5),{'verbose':_0xa31c28['verbose']});_0x25c65d=_0x439fe5['data'],_0x1d8882=_0x1bd057;}else throw new SDKError(ErrorCode[_0x54e08c(0x298)],'Invalid\x20path\x20syntax:\x20'+_0x22fff0,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x25c65d=await getProjectIdOrDefault(_0x245385),_0x1d8882=_0x22fff0;const _0x465988=await withSpinner('Creating\x20agent\x20\x27'+_0x1d8882+_0x54e08c(0x2b5),()=>_0x10ba25['llm'][_0x54e08c(0x273)]({'name':_0x1d8882,'projectId':_0x25c65d,'modelType':_0x1d92e4,'systemPrompt':_0x515131,'starterMessage':_0x586010,'maxToolIterations':_0x4f96e9,'temperature':_0x10882e}),{'verbose':_0xa31c28[_0x54e08c(0x257)]});return console[_0x54e08c(0x200)](_0x54e08c(0x292)+_0x465988[_0x54e08c(0x289)]['id']),await handleSDKOutput([_0x465988[_0x54e08c(0x289)]],_0xa31c28),0x0;}catch(_0x2b8935){return handleSDKError(_0x2b8935,_0xa31c28),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x2b3);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x2b0);async[a25_0x3869c4(0x23b)](_0x34296c){const _0x39d382=a25_0x3869c4,{options:_0x3d7f52,args:_0x31e470,tdx:_0x5df8cd}=_0x34296c;if(_0x31e470[_0x39d382(0x1f5)]===0x0)return console[_0x39d382(0x27c)](_0x39d382(0x229)),console[_0x39d382(0x27c)](_0x39d382(0x28a)),0x1;const _0x4048df=_0x31e470[0x0],_0x5729c8=_0x3d7f52,_0x1b4b3e=_0x5729c8[_0x39d382(0x2a1)],_0x50cb36=_0x5729c8[_0x39d382(0x272)],_0x24cdfd=_0x5729c8['description'],_0x5d30c1=_0x5729c8[_0x39d382(0x2aa)];if(!_0x1b4b3e&&!_0x50cb36&&!_0x24cdfd&&!_0x5d30c1)return console[_0x39d382(0x27c)](_0x39d382(0x247)),console[_0x39d382(0x27c)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x551145=await getProjectIdOrDefault(_0x34296c),_0x4a6144=await withSpinner(_0x39d382(0x26a)+_0x4048df+'\x27...',()=>_0x5df8cd['llm'][_0x39d382(0x28f)](_0x4048df,_0x551145),{'verbose':_0x3d7f52[_0x39d382(0x257)]}),_0x556432=_0x4a6144['data'],_0x20ee3b=await withSpinner(_0x39d382(0x294),()=>_0x5df8cd[_0x39d382(0x2b7)]['updateAgent'](_0x556432,{'name':_0x1b4b3e,'prompt':_0x50cb36,'description':_0x24cdfd,'starterMessage':_0x5d30c1}),{'verbose':_0x3d7f52[_0x39d382(0x257)]});return console['log'](_0x39d382(0x22f)+_0x20ee3b[_0x39d382(0x289)]['id']),await handleSDKOutput([_0x20ee3b[_0x39d382(0x289)]],_0x3d7f52),0x0;}catch(_0x1aa1a6){return handleSDKError(_0x1aa1a6,_0x3d7f52),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x27d);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x228);async[a25_0x3869c4(0x23b)](_0x12e446){const _0x268e9a=a25_0x3869c4,{options:_0x115c52,args:_0x411fc4,tdx:_0x3a8e8c}=_0x12e446;if(_0x411fc4[_0x268e9a(0x1f5)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x268e9a(0x27c)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x380d7b=_0x411fc4[0x0];try{const _0x59904f=await getProjectIdOrDefault(_0x12e446),_0x58640c=await withSpinner(_0x268e9a(0x26a)+_0x380d7b+_0x268e9a(0x2b5),()=>_0x3a8e8c['llm'][_0x268e9a(0x28f)](_0x380d7b,_0x59904f),{'verbose':_0x115c52['verbose']}),_0x42a180=_0x58640c[_0x268e9a(0x289)];return await withSpinner(_0x268e9a(0x224),()=>_0x3a8e8c[_0x268e9a(0x2b7)][_0x268e9a(0x2b2)](_0x42a180),{'verbose':_0x115c52[_0x268e9a(0x257)]}),console[_0x268e9a(0x200)](_0x268e9a(0x25c)+_0x42a180),0x0;}catch(_0x3879ce){return handleSDKError(_0x3879ce,_0x115c52),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x227);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x206);async[a25_0x3869c4(0x23b)](_0x1a21d2){const _0x23046c=a25_0x3869c4;return executeChatHistoryCommand(_0x1a21d2,_0x23046c(0x260));}}export class LLMUseCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x233);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x259);async[a25_0x3869c4(0x23b)](_0x289c7b){const _0x4630a6=a25_0x3869c4,{options:_0x6c1901,args:_0x2f0cd9,tdx:_0x3acd45}=_0x289c7b;if(_0x2f0cd9[_0x4630a6(0x1f5)]===0x0)return console[_0x4630a6(0x27c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4630a6(0x27c)](_0x4630a6(0x1ff)),0x1;const _0x24c894=_0x2f0cd9[0x0];try{return await withSpinner(_0x4630a6(0x249)+_0x24c894+_0x4630a6(0x2b5),()=>_0x3acd45['llm']['setCurrentProject'](_0x24c894),{'verbose':_0x6c1901[_0x4630a6(0x257)]}),console[_0x4630a6(0x200)](_0x4630a6(0x230)+_0x24c894),0x0;}catch(_0x190c9b){return handleSDKError(_0x190c9b,_0x6c1901),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']='llm:project:create';[a25_0x3869c4(0x283)]=a25_0x3869c4(0x24e);async[a25_0x3869c4(0x23b)](_0x17897b){const _0x12dfad=a25_0x3869c4,{options:_0x30e8e8,args:_0x5a7bed,tdx:_0x5e9a2d}=_0x17897b;if(_0x5a7bed[_0x12dfad(0x1f5)]===0x0)return console['error'](_0x12dfad(0x256)),console[_0x12dfad(0x27c)](_0x12dfad(0x2b8)),0x1;const _0x37f698=_0x5a7bed[0x0],_0x5e7bc6=_0x30e8e8,_0x585996=_0x5e7bc6[_0x12dfad(0x283)];try{const _0x33813b=await withSpinner(_0x12dfad(0x29b)+_0x37f698+'\x27...',()=>_0x5e9a2d[_0x12dfad(0x2b7)][_0x12dfad(0x20b)]({'name':_0x37f698,'description':_0x585996}),{'verbose':_0x30e8e8[_0x12dfad(0x257)]});console[_0x12dfad(0x200)](_0x12dfad(0x25a)+_0x33813b[_0x12dfad(0x289)]['id']);const _0x3521c7=toLLMProjectInfo(_0x33813b[_0x12dfad(0x289)]);return await handleSDKOutput([_0x3521c7],_0x30e8e8),0x0;}catch(_0x5305f1){return handleSDKError(_0x5305f1,_0x30e8e8),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x29c);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x20f);async[a25_0x3869c4(0x23b)](_0x16425a){const _0xff80f8=a25_0x3869c4,{options:_0x1605bc,args:_0x1c35d0,tdx:_0x2612de}=_0x16425a;if(_0x1c35d0[_0xff80f8(0x1f5)]===0x0)return console[_0xff80f8(0x27c)](_0xff80f8(0x256)),console[_0xff80f8(0x27c)](_0xff80f8(0x280)),0x1;const _0x52f14b=_0x1c35d0[0x0];try{return await withSpinner(_0xff80f8(0x1f9)+_0x52f14b+_0xff80f8(0x2b5),()=>_0x2612de[_0xff80f8(0x2b7)]['deleteProject'](_0x52f14b),{'verbose':_0x1605bc[_0xff80f8(0x257)]}),console['log'](_0xff80f8(0x299)+_0x52f14b),0x0;}catch(_0x4a53a8){return handleSDKError(_0x4a53a8,_0x1605bc),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x203);['description']=a25_0x3869c4(0x2bc);async[a25_0x3869c4(0x23b)](_0x6ac865){const _0x39f026=a25_0x3869c4,{options:_0x4cb90a,args:_0x3a6739,tdx:_0x1968bd}=_0x6ac865;if(_0x3a6739[_0x39f026(0x1f5)]===0x0)return console['error'](_0x39f026(0x256)),console[_0x39f026(0x27c)](_0x39f026(0x264)),0x1;const _0x378538=_0x3a6739[0x0],_0x4cc0fd=_0x4cb90a,_0x2666f2=_0x4cc0fd['output'],_0x450531=_0x4cc0fd[_0x39f026(0x23d)];try{const _0xa5b95b=_0x2666f2||_0x378538+_0x39f026(0x241);if(a25_0x5bb442['existsSync'](_0xa5b95b)&&!_0x450531){if(!_0x4cb90a[_0x39f026(0x2b6)]){const _0x1c7800=await confirm(_0x39f026(0x27f)+_0xa5b95b+_0x39f026(0x2a5));if(!_0x1c7800)return console[_0x39f026(0x200)](_0x39f026(0x234)),0x0;}a25_0x5bb442[_0x39f026(0x25b)](_0xa5b95b,{'recursive':!![]});}const _0x4528f0=await withSpinner(_0x450531?_0x39f026(0x21e)+_0x378538+'\x27...':_0x39f026(0x2ae)+_0x378538+_0x39f026(0x2b5),()=>_0x1968bd[_0x39f026(0x2b7)][_0x39f026(0x20d)](_0x378538,_0x2666f2,{'dryRun':_0x450531}),{'verbose':_0x4cb90a[_0x39f026(0x257)]}),_0x1a492a=_0x4528f0[_0x39f026(0x289)];return _0x450531?console[_0x39f026(0x200)](_0x39f026(0x223)+_0x1a492a[_0x39f026(0x26c)]):console[_0x39f026(0x200)](_0x39f026(0x271)+_0x1a492a[_0x39f026(0x26c)]),console[_0x39f026(0x200)](_0x39f026(0x29e)+_0x1a492a[_0x39f026(0x235)][_0x39f026(0x232)]),console[_0x39f026(0x200)](_0x39f026(0x267)+_0x1a492a['counts'][_0x39f026(0x296)]),console[_0x39f026(0x200)](_0x39f026(0x27a)+_0x1a492a[_0x39f026(0x235)]['prompts']),console[_0x39f026(0x200)](_0x39f026(0x28e)+_0x1a492a[_0x39f026(0x235)]['integrations']),(_0x4cb90a[_0x39f026(0x22c)]===_0x39f026(0x2a8)||_0x4cb90a['format']==='jsonl')&&await handleSDKOutput([_0x1a492a],_0x4cb90a),0x0;}catch(_0x34ed07){return handleSDKError(_0x34ed07,_0x4cb90a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x24d);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x243);async['execute'](_0x4380a2){const _0x22c455=a25_0x3869c4,{options:_0x24e6e7,args:_0x5d4cc5,tdx:_0x4afc0f}=_0x4380a2;if(_0x5d4cc5['length']===0x0)return console[_0x22c455(0x27c)](_0x22c455(0x220)),console[_0x22c455(0x27c)]('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x5a187e=_0x5d4cc5[0x0],_0x240ab5=_0x24e6e7,_0x336b56=_0x240ab5[_0x22c455(0x2a1)],_0x44115e=_0x240ab5[_0x22c455(0x23d)];try{if(!_0x44115e){const _0x3ccf52=_0x4afc0f[_0x22c455(0x2b7)][_0x22c455(0x1f7)](_0x5a187e),_0x94b49a=_0x336b56||_0x3ccf52[_0x22c455(0x22b)][_0x22c455(0x246)],_0x12cd52=await withSpinner(_0x22c455(0x221),()=>_0x4afc0f['llm'][_0x22c455(0x22a)](),{'verbose':_0x24e6e7[_0x22c455(0x257)]}),_0x157387=_0x12cd52[_0x22c455(0x289)]['find'](_0x33ad28=>_0x33ad28[_0x22c455(0x284)][_0x22c455(0x2a1)]===_0x94b49a);if(_0x157387&&!_0x24e6e7['yes']){const _0x3c9061=await confirm(_0x22c455(0x214)+_0x94b49a+_0x22c455(0x265));if(!_0x3c9061)return console[_0x22c455(0x200)](_0x22c455(0x274)),0x0;}}const _0x548363=await withSpinner(_0x44115e?_0x22c455(0x286)+_0x5a187e+_0x22c455(0x2b5):_0x22c455(0x25f)+_0x5a187e+'\x27...',()=>_0x4afc0f[_0x22c455(0x2b7)][_0x22c455(0x2bb)](_0x5a187e,{'name':_0x336b56,'dryRun':_0x44115e}),{'verbose':_0x24e6e7[_0x22c455(0x257)]}),_0x487b88=_0x548363[_0x22c455(0x289)];return _0x487b88[_0x22c455(0x297)]&&console[_0x22c455(0x200)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x487b88[_0x22c455(0x297)]+'\x27'),_0x44115e?console[_0x22c455(0x200)]('[DRY\x20RUN]\x20Would\x20restore\x20project:\x20'+_0x487b88[_0x22c455(0x246)]):console[_0x22c455(0x200)]('Project\x20restored:\x20'+_0x487b88[_0x22c455(0x246)]+'\x20('+_0x487b88[_0x22c455(0x254)]+')'),console[_0x22c455(0x200)](_0x22c455(0x29e)+_0x487b88[_0x22c455(0x235)][_0x22c455(0x232)]),console[_0x22c455(0x200)](_0x22c455(0x267)+_0x487b88[_0x22c455(0x235)][_0x22c455(0x296)]),console[_0x22c455(0x200)](_0x22c455(0x27a)+_0x487b88[_0x22c455(0x235)]['prompts']),console[_0x22c455(0x200)](_0x22c455(0x28e)+_0x487b88['counts'][_0x22c455(0x245)]),(_0x24e6e7[_0x22c455(0x22c)]===_0x22c455(0x2a8)||_0x24e6e7[_0x22c455(0x22c)]===_0x22c455(0x295))&&await handleSDKOutput([_0x487b88],_0x24e6e7),0x0;}catch(_0x24e600){return handleSDKError(_0x24e600,_0x24e6e7),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x226a4e,_0x125c64){const _0x111527=a25_0x3869c4,_0x506dbe=_0x125c64['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0x141939=0x0,_0x1e61d3=[];const _0x1d322d=(await import(_0x111527(0x21a)))[_0x111527(0x2c0)],_0x554f80=getChalk(_0x125c64);while(!![]){const _0x309120=await withSpinner(_0x111527(0x2a6),()=>_0x226a4e['llm'][_0x111527(0x23e)](_0x506dbe+_0x141939),{'verbose':_0x125c64[_0x111527(0x257)]});_0x1e61d3=_0x309120[_0x111527(0x289)];const _0x15feb8=_0x1e61d3[_0x111527(0x279)](_0x141939,_0x141939+_0x506dbe),_0x14576b=_0x1e61d3[_0x111527(0x1f5)]>_0x141939+_0x506dbe,_0x265884=[...new Set(_0x15feb8['map'](_0x5f2d6c=>_0x5f2d6c[_0x111527(0x284)]['agentId'])[_0x111527(0x22d)](_0x13cf06=>_0x13cf06!==undefined))],_0x5402ab=new Map();await Promise[_0x111527(0x21f)](_0x265884['map'](async _0x47b72d=>{const _0xa97eee=_0x111527;try{const _0x2ba2b0=await _0x226a4e[_0xa97eee(0x2b7)][_0xa97eee(0x270)](_0x47b72d);_0x5402ab[_0xa97eee(0x262)](_0x47b72d,_0x2ba2b0['attributes'][_0xa97eee(0x2a1)]);}catch{_0x5402ab['set'](_0x47b72d,_0x47b72d);}}));const _0x142db1=_0x15feb8[_0x111527(0x287)](_0x5c17a3=>{const _0x10f7fe=_0x111527,_0x979528=_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x202)]||'(no\x20message)',_0xd0b539=_0x979528['split']('\x0a')[0x0],_0x425d76=_0xd0b539[_0x10f7fe(0x1f5)]>0x50?_0xd0b539[_0x10f7fe(0x293)](0x0,0x4d)+_0x10f7fe(0x2b9):_0xd0b539,_0x12d597=_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x275)]?_0x5402ab[_0x10f7fe(0x2ad)](_0x5c17a3[_0x10f7fe(0x284)]['agentId'])||_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x275)]:_0x10f7fe(0x27e),_0x522a70=_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x252)]||_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x21b)],_0x545f59=new Date(_0x522a70),_0x69318e=new Date(),_0x51e7e9=_0x69318e[_0x10f7fe(0x244)]()-_0x545f59[_0x10f7fe(0x244)](),_0xf7c922=Math['floor'](_0x51e7e9/0xea60),_0x4f240d=Math[_0x10f7fe(0x2a4)](_0x51e7e9/0x36ee80),_0x464d5a=Math[_0x10f7fe(0x2a4)](_0x51e7e9/0x5265c00);let _0x2b34ce;if(_0xf7c922<0x1)_0x2b34ce=_0x10f7fe(0x29f);else{if(_0xf7c922<0x3c)_0x2b34ce=_0xf7c922+_0x10f7fe(0x25e);else{if(_0x4f240d<0x18)_0x2b34ce=_0x4f240d+'h\x20ago';else _0x464d5a<0x7?_0x2b34ce=_0x464d5a+'d\x20ago':_0x2b34ce=_0x545f59['toLocaleDateString']('en-US',{'month':_0x10f7fe(0x24f),'day':_0x10f7fe(0x26b)});}}return{'title':_0x425d76+'\x20'+_0x554f80[_0x10f7fe(0x2be)]('['+_0x12d597+']\x20'+_0x2b34ce),'value':_0x5c17a3['id']};});_0x14576b&&_0x142db1[_0x111527(0x219)]({'title':_0x554f80[_0x111527(0x23f)](_0x111527(0x27b)),'value':_0x111527(0x2b1)});const _0x1c48b8=await _0x1d322d({'type':'select','name':_0x111527(0x217),'message':_0x111527(0x2bf),'choices':_0x142db1,'hint':_0x111527(0x222)});if(!_0x1c48b8['chatId'])return undefined;if(_0x1c48b8[_0x111527(0x217)]===_0x111527(0x2b1)){_0x141939+=_0x506dbe;continue;}return _0x1c48b8[_0x111527(0x217)];}}export class ChatsCommand extends BaseCommand{['name']=a25_0x3869c4(0x23e);['description']='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a25_0x3869c4(0x23b)](_0x3abcbd){return executeChatHistoryCommand(_0x3abcbd,'tdx\x20chats');}}
1
+ const a25_0xde397=a25_0x380a;(function(_0x344097,_0x5d4195){const _0x30ef8a=a25_0x380a,_0x579554=_0x344097();while(!![]){try{const _0x488549=-parseInt(_0x30ef8a(0x12e))/0x1+parseInt(_0x30ef8a(0x1c0))/0x2*(parseInt(_0x30ef8a(0x1c2))/0x3)+-parseInt(_0x30ef8a(0x159))/0x4*(parseInt(_0x30ef8a(0x1c1))/0x5)+parseInt(_0x30ef8a(0x14e))/0x6*(-parseInt(_0x30ef8a(0x15e))/0x7)+parseInt(_0x30ef8a(0x1e8))/0x8+parseInt(_0x30ef8a(0x175))/0x9*(-parseInt(_0x30ef8a(0x144))/0xa)+parseInt(_0x30ef8a(0x1e5))/0xb;if(_0x488549===_0x5d4195)break;else _0x579554['push'](_0x579554['shift']());}catch(_0x2f40b4){_0x579554['push'](_0x579554['shift']());}}}(a25_0x3962,0xa18f7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a25_0x5f229e from'node:fs';function handleSDKError(_0x580c8e,_0x580ac8){const _0x248c4a=a25_0x380a;if(_0x580c8e instanceof SDKError)console[_0x248c4a(0x184)](_0x248c4a(0x1c7)+_0x580c8e['message']),_0x580ac8[_0x248c4a(0x152)]&&(_0x580c8e[_0x248c4a(0x1b1)]&&console['error'](_0x248c4a(0x138)+_0x580c8e[_0x248c4a(0x1b1)]),_0x580c8e[_0x248c4a(0x1ae)]&&(console['error'](_0x248c4a(0x162)),console[_0x248c4a(0x184)](_0x580c8e[_0x248c4a(0x1ae)])));else throw _0x580c8e;}function formatChatHistoryEntry(_0x1cbebf,_0x1699b1){const _0x31dec7=a25_0x380a,_0x5a20b1=getChalk(_0x1699b1),_0x32f801=_0x5a20b1[_0x31dec7(0x139)](_0x1cbebf['at']);if(_0x31dec7(0x191)in _0x1cbebf){const _0x2414ff=_0x5a20b1[_0x31dec7(0x1fb)](_0x31dec7(0x176));return _0x32f801+'\x20'+_0x2414ff+':\x20'+_0x1cbebf['input'];}if('content'in _0x1cbebf){const _0xcda632=_0x5a20b1['green'](_0x31dec7(0x1eb));return _0x32f801+'\x20'+_0xcda632+':\x20'+_0x1cbebf[_0x31dec7(0x170)];}if(_0x31dec7(0x183)in _0x1cbebf){const _0x20f36f=_0x5a20b1[_0x31dec7(0x173)](_0x31dec7(0x1ef)),{functionName:_0x595df0,functionArguments:_0xb52539,targetFunction:_0x51d61c}=_0x1cbebf[_0x31dec7(0x183)];let _0x510ee0=_0x32f801+'\x20'+_0x20f36f+':\x20'+_0x5a20b1[_0x31dec7(0x180)](_0x595df0);if(_0xb52539&&Object[_0x31dec7(0x165)](_0xb52539)['length']>0x0){const _0x40b702=Object[_0x31dec7(0x1f1)](_0xb52539)[_0x31dec7(0x1a9)](([_0x1f29e5,_0x5eb21e])=>_0x1f29e5+'='+JSON[_0x31dec7(0x181)](_0x5eb21e))[_0x31dec7(0x188)](',\x20');_0x510ee0+='('+_0x40b702+')';}_0x51d61c&&(_0x510ee0+=_0x5a20b1[_0x31dec7(0x139)]('\x20['+_0x51d61c+']'));let _0x19ded9='';if(_0x1cbebf[_0x31dec7(0x183)][_0x31dec7(0x1a0)])_0x19ded9='\x20->\x20KB:'+_0x1cbebf[_0x31dec7(0x183)][_0x31dec7(0x1a0)]['name'];else{if(_0x1cbebf[_0x31dec7(0x183)][_0x31dec7(0x1dc)])_0x19ded9=_0x31dec7(0x18b)+_0x1cbebf['tool_call'][_0x31dec7(0x1dc)][_0x31dec7(0x1af)];else{if(_0x1cbebf[_0x31dec7(0x183)][_0x31dec7(0x16c)])_0x19ded9=_0x31dec7(0x13f)+_0x1cbebf[_0x31dec7(0x183)][_0x31dec7(0x16c)][_0x31dec7(0x1af)];else _0x1cbebf[_0x31dec7(0x183)][_0x31dec7(0x1c4)]&&(_0x19ded9=_0x31dec7(0x1a3)+_0x1cbebf['tool_call'][_0x31dec7(0x1c4)][_0x31dec7(0x1af)]);}}return _0x510ee0+_0x19ded9;}if(_0x31dec7(0x15c)in _0x1cbebf){const _0x405dc3=_0x5a20b1['magenta'](_0x31dec7(0x174)),{functionName:_0x49a6a8,functionArguments:_0x3e6d66,content:_0x4bcfdd,newChat:_0x596888}=_0x1cbebf[_0x31dec7(0x15c)];let _0x2402f4=_0x32f801+'\x20'+_0x405dc3+':\x20'+_0x5a20b1[_0x31dec7(0x180)](_0x49a6a8);if(_0x3e6d66){const _0x277a47=typeof _0x3e6d66==='string'?_0x3e6d66:JSON[_0x31dec7(0x181)](_0x3e6d66);_0x2402f4+='('+_0x277a47+')';}return _0x4bcfdd&&(_0x2402f4+='\x0a'+_0x5a20b1['dim'](_0x4bcfdd)),_0x596888&&(_0x2402f4+=_0x5a20b1['dim'](_0x31dec7(0x1cb)+_0x596888['id'])),_0x2402f4;}if(_0x31dec7(0x17f)in _0x1cbebf){const _0x2fbda0=_0x5a20b1['blue'](_0x31dec7(0x150));return _0x32f801+'\x20'+_0x2fbda0+':\x20'+_0x1cbebf[_0x31dec7(0x17f)]['name']+'\x20('+_0x1cbebf[_0x31dec7(0x17f)][_0x31dec7(0x170)][_0x31dec7(0x129)]+_0x31dec7(0x16e);}if('image'in _0x1cbebf){const _0x27e5cd=_0x5a20b1['blue']('[image]\x20\x20'),{width:_0x50024b,height:_0x1f1b59,headerText:_0x527c9a}=_0x1cbebf['image'],_0x7b5248=_0x527c9a?_0x31dec7(0x193)+_0x527c9a:'';return _0x32f801+'\x20'+_0x27e5cd+':\x20'+_0x50024b+'x'+_0x1f1b59+_0x7b5248;}if(_0x31dec7(0x184)in _0x1cbebf){const _0x991f=_0x5a20b1[_0x31dec7(0x128)](_0x31dec7(0x1b2));return _0x32f801+'\x20'+_0x991f+':\x20'+_0x1cbebf['error'];}return _0x32f801+'\x20'+_0x5a20b1[_0x31dec7(0x139)]('[unknown]')+':\x20'+JSON[_0x31dec7(0x181)](_0x1cbebf);}function a25_0x3962(){const _0x478c58=['Load\x20more...','dryRun','getOrCreateDefaultProject','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Getting\x20default\x20project...','includes','\x20\x20Integrations:\x20','filter','cyan','en-US','llm:agent:delete','red','length','sourceSite','execute','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Deleting\x20agent...','453475lzQAyV','llm','llm:models','(no\x20agent)','deleteAgent','llm:project:backup','Project\x20deleted:\x20','format','attributes','Invalid\x20path\x20syntax:\x20','\x20\x20Cause:\x20','dim','Output\x20directory\x20\x27','Analyzing\x20project\x20\x27','Creating\x20agent\x20\x27','temperature','Validating\x20backup\x20from\x20\x27','\x20->\x20WebSearch:','llm:history','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','List\x20all\x20LLM\x20projects','last','90kDETxr','projectName','rmSync','model','createdAt','\x20--last','resolveAgentId','List\x20agents\x20in\x20current\x20project','Resolving\x20project\x20\x27','createAgent','768TlBKDM','updateAgent','[output]\x20','Delete\x20an\x20LLM\x20project','verbose','llm:project:restore','setCurrentProject','knowledgeBases','Restore\x20cancelled.','__load_more__','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','798752nNPZQq','select','toLowerCase','tool','history','7847lnEqSz','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','outputDir','No\x20messages\x20found\x20in\x20chat\x20history.','\x0aStack\x20trace:','projects','starterMessage','keys','h\x20ago','Select\x20a\x20chat\x20session:','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','updatedAt','Create\x20a\x20new\x20LLM\x20project','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','targetWebSearchTool','tdx\x20chats','\x20bytes)','description','content','\x27\x20already\x20exists.\x20Overwrite?','Agent\x20updated:\x20','yellow','[tool]\x20\x20\x20','553221Nkahlj','[input]\x20\x20','Restoring\x20project\x20from\x20\x27','chatId','split','Usage:\x20','llm:agents','List\x20available\x20LLM\x20models','table','Use\x20format:\x20project-name/agent-name','output','bold','stringify','chats','tool_call','error','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','numeric','getBackupMetadata','join','Project\x20backed\x20up\x20to:\x20','getTime','\x20->\x20Agent:','data','push','floor','Fetching\x20agent...','slice','input','m\x20ago','\x20-\x20','agent','lastConversationAt','integrations','\x20\x20Agents:\x20','Resolving\x20agent\x20\x27','Backup\x20cancelled.','llm:project:create','counts','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','A\x20project\x20named\x20\x27','json','targetKnowledgeBase','get','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','\x20->\x20ImageGen:','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','prompts','Checking\x20for\x20existing\x20projects...','substring','claude-4.5-haiku','map','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','\x20\x20Prompts:\x20','Agent\x20created:\x20','agentId','stack','name','default','cause','[error]\x20\x20','all','exportedFrom','just\x20now','systemPrompt','Updating\x20agent...','Project\x20created:\x20','Agent\x20deleted:\x20','llm:projects','Project\x20not\x20found:\x20','resolveProjectId','getCurrentProject','Fetching\x20chat\x20sessions...','...','1888058xrxIZu','20pYQVlo','3dInAuS','Show\x20agent\x20details','targetImageGenerator','Error:\x20Project\x20name\x20is\x20required','find','Error:\x20','Fetching\x20available\x20models...','Fetching\x20agents...','.llm','\x20→\x20chat:\x20','toLocaleDateString','createProject','existsSync','short','\x0aCancelled','d\x20ago','Fetching\x20projects...','Fetching\x20chat\x20history\x20for\x20\x27','Setting\x20project\x20context\x20to\x20\x27','limit','projectId','llm:project:delete','Create\x20a\x20new\x20agent\x20in\x20current\x20project','\x27...','backupProject','maxToolIterations','targetAgent','\x20\x20Knowledge\x20Bases:\x20','Fetching\x20most\x20recent\x20chat...','Error:\x20Agent\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Project\x20restored:\x20','(no\x20message)','set','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','6160374HrWWZr','INVALID_ARGUMENT','log','8852992QSPzoV','Project\x20context\x20set\x20to:\x20','Deleting\x20project\x20\x27','[content]','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','jsonl','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','[tool_call]','deleteProject','entries','agents'];a25_0x3962=function(){return _0x478c58;};return a25_0x3962();}async function executeChatHistoryCommand(_0xa7a71c,_0x316381){const _0x500544=a25_0x380a,{options:_0x29c2f4,args:_0x20175b,tdx:_0x53c159}=_0xa7a71c,_0x50a733=_0x20175b[0x0],_0x3faecc=_0x29c2f4,_0x58dc6d=_0x3faecc[_0x500544(0x143)];try{if(_0x58dc6d&&_0x50a733)return console['error'](_0x500544(0x168)),console[_0x500544(0x184)](_0x500544(0x17a)+_0x316381+_0x500544(0x149)),0x1;if(!_0x50a733&&!_0x58dc6d&&_0x29c2f4[_0x500544(0x135)]!==undefined){const _0x8750cb=resolveLimit(_0x29c2f4[_0x500544(0x1d5)],DEFAULT_LLM_LIMIT),_0x1a8c03=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x53c159[_0x500544(0x12f)][_0x500544(0x182)](_0x8750cb),{'verbose':_0x29c2f4[_0x500544(0x152)]});return await handleSDKOutput(_0x1a8c03[_0x500544(0x18c)],_0x29c2f4),0x0;}const _0x28d549=await getChatIdOrSelect(_0x53c159,_0x29c2f4,_0x58dc6d,_0x50a733);if(!_0x28d549)return 0x0;return await displayChatHistory(_0x28d549,_0x53c159,_0x29c2f4),0x0;}catch(_0x36505f){return handleSDKError(_0x36505f,_0x29c2f4),0x1;}}async function displayChatHistory(_0x1ac612,_0x4ccb3c,_0x1d718c){const _0x4f38c8=a25_0x380a,_0x16906e=await withSpinner(_0x4f38c8(0x1d3)+_0x1ac612+'\x27...',()=>_0x4ccb3c[_0x4f38c8(0x12f)][_0x4f38c8(0x15d)](_0x1ac612),{'verbose':_0x1d718c['verbose']}),_0x67648e=_0x16906e[_0x4f38c8(0x18c)][_0x4f38c8(0x18c)]??[];if(_0x67648e[_0x4f38c8(0x129)]===0x0){console['log'](_0x4f38c8(0x161));return;}if(_0x1d718c['format']!==undefined)await handleSDKOutput(_0x67648e,_0x1d718c);else{const _0x4c00f6=_0x67648e[_0x4f38c8(0x1a9)](_0x35d628=>formatChatHistoryEntry(_0x35d628,_0x1d718c)),_0x25d83a=_0x4c00f6[_0x4f38c8(0x188)]('\x0a');await writeOutput(_0x25d83a,_0x1d718c[_0x4f38c8(0x17f)],_0x4f38c8(0x17d));}}async function getChatIdOrSelect(_0x5838ce,_0x568627,_0x2f0578,_0x3d00e5){const _0x15136a=a25_0x380a;if(_0x3d00e5)return _0x3d00e5;if(_0x2f0578){const _0x50cc6f=await withSpinner(_0x15136a(0x1de),()=>_0x5838ce['llm'][_0x15136a(0x182)](0x1),{'verbose':_0x568627[_0x15136a(0x152)]});if(_0x50cc6f[_0x15136a(0x18c)][_0x15136a(0x129)]===0x0)return console[_0x15136a(0x1e7)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x50cc6f[_0x15136a(0x18c)][0x0]['id'];}const _0x34e90f=await selectChatInteractively(_0x5838ce,_0x568627);if(!_0x34e90f)return console[_0x15136a(0x1e7)](_0x15136a(0x1d0)),undefined;return _0x34e90f;}async function getProjectIdOrDefault(_0x18134b){const _0x154791=a25_0x380a,{tdx:_0x2d99b0,options:_0x4040ee}=_0x18134b,_0x478df2=_0x4040ee['llmProject'];if(_0x478df2){const _0xf74109=await withSpinner(_0x154791(0x14c)+_0x478df2+_0x154791(0x1d9),()=>_0x2d99b0['llm'][_0x154791(0x1bc)](_0x478df2),{'verbose':_0x4040ee[_0x154791(0x152)]});return _0xf74109[_0x154791(0x18c)];}let _0x5f539f=_0x2d99b0['llm'][_0x154791(0x1bd)]();if(_0x5f539f)return _0x5f539f;const _0x5b24bd=await withSpinner(_0x154791(0x1f7),()=>_0x2d99b0[_0x154791(0x12f)][_0x154791(0x1f5)](),{'verbose':_0x4040ee[_0x154791(0x152)]});return _0x5b24bd[_0x154791(0x18c)]['id'];}function toLLMProjectInfo(_0x3519bf){const _0x213ed3=a25_0x380a;return{'name':_0x3519bf[_0x213ed3(0x136)]['name'],'description':_0x3519bf[_0x213ed3(0x136)]['description'],'createdAt':_0x3519bf[_0x213ed3(0x136)]['createdAt'],'updatedAt':_0x3519bf[_0x213ed3(0x136)][_0x213ed3(0x169)]};}function toAgentInfo(_0x14b3cc){const _0x44d904=a25_0x380a;return{'name':_0x14b3cc['attributes'][_0x44d904(0x1af)],'description':_0x14b3cc[_0x44d904(0x136)][_0x44d904(0x16f)],'prompt':truncatePrompt(_0x14b3cc[_0x44d904(0x136)]['prompt']),'createdAt':_0x14b3cc['attributes'][_0x44d904(0x148)],'updatedAt':_0x14b3cc[_0x44d904(0x136)]['updatedAt']};}function truncatePrompt(_0x42aaf8){const _0x8ecb01=a25_0x380a;if(!_0x42aaf8)return undefined;const _0x768039=0x64;if(_0x42aaf8['length']<=_0x768039)return _0x42aaf8;return _0x42aaf8['slice'](0x0,_0x768039)+_0x8ecb01(0x1bf);}export class LLMModelsCommand extends BaseCommand{['name']=a25_0xde397(0x130);[a25_0xde397(0x16f)]=a25_0xde397(0x17c);async[a25_0xde397(0x12b)](_0x42f379){const _0x379f33=a25_0xde397,{options:_0xc2c48e,tdx:_0x23888b}=_0x42f379;try{const _0x27c5f3=await withSpinner(_0x379f33(0x1c8),()=>_0x23888b[_0x379f33(0x12f)]['models'](),{'verbose':_0xc2c48e[_0x379f33(0x152)]});return await handleSDKOutput(_0x27c5f3['data'],_0xc2c48e),0x0;}catch(_0x416081){return handleSDKError(_0x416081,_0xc2c48e),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a25_0xde397(0x1ba);[a25_0xde397(0x16f)]=a25_0xde397(0x142);async[a25_0xde397(0x12b)](_0xd0959f){const _0x1fb53c=a25_0xde397,{options:_0x1b1289,args:_0x368ced,tdx:_0x6d6309}=_0xd0959f;try{const _0xfbd7fc=_0x368ced[0x0],_0x1cc0e9=resolveLimit(_0x1b1289[_0x1fb53c(0x1d5)],DEFAULT_LLM_LIMIT),_0x106b45=await withSpinner(_0x1fb53c(0x1d2),()=>_0x6d6309[_0x1fb53c(0x12f)][_0x1fb53c(0x163)](_0x1cc0e9),{'verbose':_0x1b1289[_0x1fb53c(0x152)]});let _0x4b3ea1=_0x106b45[_0x1fb53c(0x18c)];_0xfbd7fc&&(_0x4b3ea1=_0x106b45[_0x1fb53c(0x18c)][_0x1fb53c(0x1fa)](_0x243aaf=>matchGlobPattern(_0x243aaf[_0x1fb53c(0x136)][_0x1fb53c(0x1af)],_0xfbd7fc)));const _0x298879=_0x4b3ea1[_0x1fb53c(0x1a9)](toLLMProjectInfo);return await handleSDKOutput(_0x298879,_0x1b1289),0x0;}catch(_0x1c7de1){return handleSDKError(_0x1c7de1,_0x1b1289),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a25_0xde397(0x1af)]=a25_0xde397(0x17b);[a25_0xde397(0x16f)]=a25_0xde397(0x14b);async[a25_0xde397(0x12b)](_0x50e009){const _0x18fb3e=a25_0xde397,{options:_0x3f0f9c,args:_0x5a5ce9,tdx:_0x543da4}=_0x50e009;try{const _0x3805f2=_0x5a5ce9[0x0];let _0x3bd768,_0xa4bc5d=_0x3805f2;if(_0x3805f2&&_0x3805f2['includes']('/')){const _0x3bc49c=_0x3805f2[_0x18fb3e(0x179)]('/');if(_0x3bc49c[_0x18fb3e(0x129)]===0x2){const [_0x356f01,_0x550e64]=_0x3bc49c,_0x245aa8=await _0x543da4[_0x18fb3e(0x12f)]['projects'](),_0x4ef279=_0x245aa8[_0x18fb3e(0x1c6)](_0x44690f=>_0x44690f['attributes'][_0x18fb3e(0x1af)][_0x18fb3e(0x15b)]()===_0x356f01[_0x18fb3e(0x15b)]());if(!_0x4ef279)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x18fb3e(0x1bb)+_0x356f01,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0x3bd768=_0x4ef279['id'],_0xa4bc5d=_0x550e64;}else throw new SDKError(ErrorCode[_0x18fb3e(0x1e6)],_0x18fb3e(0x137)+_0x3805f2,undefined,{'helpText':_0x18fb3e(0x17e)});}else _0x3bd768=await getProjectIdOrDefault(_0x50e009);const _0xe770c6=await withSpinner(_0x18fb3e(0x1c9),()=>_0x543da4[_0x18fb3e(0x12f)][_0x18fb3e(0x1f2)](_0x3bd768),{'verbose':_0x3f0f9c['verbose']});let _0x358577=_0xe770c6[_0x18fb3e(0x18c)];_0xa4bc5d&&(_0x358577=_0xe770c6['data']['filter'](_0x3be38b=>matchGlobPattern(_0x3be38b['attributes'][_0x18fb3e(0x1af)],_0xa4bc5d)));const _0x56a574=_0x358577[_0x18fb3e(0x1a9)](toAgentInfo);return await handleSDKOutput(_0x56a574,_0x3f0f9c),0x0;}catch(_0x9a588c){return handleSDKError(_0x9a588c,_0x3f0f9c),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']='llm:agent:show';[a25_0xde397(0x16f)]=a25_0xde397(0x1c3);async[a25_0xde397(0x12b)](_0x57373e){const _0x1441f6=a25_0xde397,{options:_0x18d26f,args:_0x41f70e,tdx:_0x309dae}=_0x57373e;if(_0x41f70e['length']===0x0)return console[_0x1441f6(0x184)](_0x1441f6(0x1df)),console['error'](_0x1441f6(0x12c)),0x1;const _0x46ea97=_0x41f70e[0x0];try{const _0x4e1038=await getProjectIdOrDefault(_0x57373e),_0x471d3e=await withSpinner(_0x1441f6(0x198)+_0x46ea97+_0x1441f6(0x1d9),()=>_0x309dae[_0x1441f6(0x12f)]['resolveAgentId'](_0x46ea97,_0x4e1038),{'verbose':_0x18d26f[_0x1441f6(0x152)]}),_0x51ec90=await withSpinner(_0x1441f6(0x18f),()=>_0x309dae[_0x1441f6(0x12f)][_0x1441f6(0x194)](_0x471d3e[_0x1441f6(0x18c)]),{'verbose':_0x18d26f['verbose']});return await handleSDKOutput([_0x51ec90[_0x1441f6(0x18c)]],_0x18d26f),0x0;}catch(_0xfc3d90){return handleSDKError(_0xfc3d90,_0x18d26f),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a25_0xde397(0x1af)]='llm:agent:create';['description']=a25_0xde397(0x1d8);async[a25_0xde397(0x12b)](_0x1b93c1){const _0x424a9a=a25_0xde397,{options:_0x45bc26,args:_0x495938,tdx:_0x542330}=_0x1b93c1;if(_0x495938[_0x424a9a(0x129)]===0x0)return console[_0x424a9a(0x184)](_0x424a9a(0x1df)),console['error'](_0x424a9a(0x19c)),console['error'](_0x424a9a(0x1e0)),0x1;const _0x2d1a1e=_0x495938[0x0],_0x45254d=_0x45bc26,_0x2d900d=_0x45254d[_0x424a9a(0x1b6)],_0xe4e162=_0x45254d[_0x424a9a(0x147)]||_0x424a9a(0x1a8),_0x4f0400=_0x45254d[_0x424a9a(0x164)],_0xc7f6a5=_0x45254d[_0x424a9a(0x1db)]?Number(_0x45254d[_0x424a9a(0x1db)]):undefined,_0x57a383=_0x45254d[_0x424a9a(0x13d)]?Number(_0x45254d[_0x424a9a(0x13d)]):undefined;try{let _0x12a445,_0x4511be;if(_0x2d1a1e[_0x424a9a(0x1f8)]('/')){const _0x20aa81=_0x2d1a1e[_0x424a9a(0x179)]('/');if(_0x20aa81[_0x424a9a(0x129)]===0x2){const [_0x5bd54c,_0x5c08e9]=_0x20aa81,_0x292bfa=await withSpinner(_0x424a9a(0x14c)+_0x5bd54c+_0x424a9a(0x1d9),()=>_0x542330[_0x424a9a(0x12f)]['resolveProjectId'](_0x5bd54c),{'verbose':_0x45bc26['verbose']});_0x12a445=_0x292bfa['data'],_0x4511be=_0x5c08e9;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20path\x20syntax:\x20'+_0x2d1a1e,undefined,{'helpText':_0x424a9a(0x17e)});}else _0x12a445=await getProjectIdOrDefault(_0x1b93c1),_0x4511be=_0x2d1a1e;const _0x45c642=await withSpinner(_0x424a9a(0x13c)+_0x4511be+'\x27...',()=>_0x542330[_0x424a9a(0x12f)][_0x424a9a(0x14d)]({'name':_0x4511be,'projectId':_0x12a445,'modelType':_0xe4e162,'systemPrompt':_0x2d900d,'starterMessage':_0x4f0400,'maxToolIterations':_0xc7f6a5,'temperature':_0x57a383}),{'verbose':_0x45bc26[_0x424a9a(0x152)]});return console[_0x424a9a(0x1e7)](_0x424a9a(0x1ac)+_0x45c642['data']['id']),await handleSDKOutput([_0x45c642[_0x424a9a(0x18c)]],_0x45bc26),0x0;}catch(_0x5a2aff){return handleSDKError(_0x5a2aff,_0x45bc26),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a25_0xde397(0x1af)]='llm:agent:update';['description']='Update\x20an\x20existing\x20agent';async[a25_0xde397(0x12b)](_0x237448){const _0x44805b=a25_0xde397,{options:_0x15c2f7,args:_0x32ee7a,tdx:_0x9909e4}=_0x237448;if(_0x32ee7a['length']===0x0)return console[_0x44805b(0x184)](_0x44805b(0x1df)),console[_0x44805b(0x184)](_0x44805b(0x16b)),0x1;const _0x1a87a0=_0x32ee7a[0x0],_0x401fce=_0x15c2f7,_0x4fcb2f=_0x401fce[_0x44805b(0x1af)],_0x1f78e7=_0x401fce['prompt'],_0x131faf=_0x401fce[_0x44805b(0x16f)],_0x3cf56c=_0x401fce[_0x44805b(0x164)];if(!_0x4fcb2f&&!_0x1f78e7&&!_0x131faf&&!_0x3cf56c)return console['error'](_0x44805b(0x1aa)),console[_0x44805b(0x184)](_0x44805b(0x141)),0x1;try{const _0x228b36=await getProjectIdOrDefault(_0x237448),_0x2dec66=await withSpinner('Resolving\x20agent\x20\x27'+_0x1a87a0+'\x27...',()=>_0x9909e4[_0x44805b(0x12f)][_0x44805b(0x14a)](_0x1a87a0,_0x228b36),{'verbose':_0x15c2f7[_0x44805b(0x152)]}),_0x23057c=_0x2dec66[_0x44805b(0x18c)],_0x4c9b72=await withSpinner(_0x44805b(0x1b7),()=>_0x9909e4[_0x44805b(0x12f)][_0x44805b(0x14f)](_0x23057c,{'name':_0x4fcb2f,'prompt':_0x1f78e7,'description':_0x131faf,'starterMessage':_0x3cf56c}),{'verbose':_0x15c2f7[_0x44805b(0x152)]});return console['log'](_0x44805b(0x172)+_0x4c9b72[_0x44805b(0x18c)]['id']),await handleSDKOutput([_0x4c9b72[_0x44805b(0x18c)]],_0x15c2f7),0x0;}catch(_0x26c66c){return handleSDKError(_0x26c66c,_0x15c2f7),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a25_0xde397(0x1af)]=a25_0xde397(0x127);[a25_0xde397(0x16f)]='Delete\x20an\x20agent';async['execute'](_0x2d1263){const _0x8832ae=a25_0xde397,{options:_0x3a4794,args:_0x24a2a3,tdx:_0x4167ed}=_0x2d1263;if(_0x24a2a3[_0x8832ae(0x129)]===0x0)return console[_0x8832ae(0x184)](_0x8832ae(0x1df)),console[_0x8832ae(0x184)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0xdef1e0=_0x24a2a3[0x0];try{const _0x1ecc5b=await getProjectIdOrDefault(_0x2d1263),_0x548d48=await withSpinner('Resolving\x20agent\x20\x27'+_0xdef1e0+_0x8832ae(0x1d9),()=>_0x4167ed[_0x8832ae(0x12f)][_0x8832ae(0x14a)](_0xdef1e0,_0x1ecc5b),{'verbose':_0x3a4794[_0x8832ae(0x152)]}),_0x4cdb33=_0x548d48[_0x8832ae(0x18c)];return await withSpinner(_0x8832ae(0x12d),()=>_0x4167ed[_0x8832ae(0x12f)][_0x8832ae(0x132)](_0x4cdb33),{'verbose':_0x3a4794[_0x8832ae(0x152)]}),console[_0x8832ae(0x1e7)](_0x8832ae(0x1b9)+_0x4cdb33),0x0;}catch(_0x359645){return handleSDKError(_0x359645,_0x3a4794),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a25_0xde397(0x140);['description']=a25_0xde397(0x15f);async[a25_0xde397(0x12b)](_0x4a8cb5){return executeChatHistoryCommand(_0x4a8cb5,'tdx\x20llm\x20history');}}export class LLMUseCommand extends BaseCommand{[a25_0xde397(0x1af)]='llm:use';['description']='Set\x20current\x20project\x20context';async['execute'](_0x11e03d){const _0x473caf=a25_0xde397,{options:_0x537eb8,args:_0x49351e,tdx:_0x1f7d1d}=_0x11e03d;if(_0x49351e['length']===0x0)return console[_0x473caf(0x184)](_0x473caf(0x1c5)),console[_0x473caf(0x184)](_0x473caf(0x1f6)),0x1;const _0x499178=_0x49351e[0x0];try{return await withSpinner(_0x473caf(0x1d4)+_0x499178+_0x473caf(0x1d9),()=>_0x1f7d1d[_0x473caf(0x12f)][_0x473caf(0x154)](_0x499178),{'verbose':_0x537eb8[_0x473caf(0x152)]}),console[_0x473caf(0x1e7)](_0x473caf(0x1e9)+_0x499178),0x0;}catch(_0x861ff){return handleSDKError(_0x861ff,_0x537eb8),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a25_0xde397(0x19a);[a25_0xde397(0x16f)]=a25_0xde397(0x16a);async['execute'](_0x47954a){const _0x139c53=a25_0xde397,{options:_0x1b68f4,args:_0x278317,tdx:_0x39dbaa}=_0x47954a;if(_0x278317['length']===0x0)return console[_0x139c53(0x184)](_0x139c53(0x1c5)),console[_0x139c53(0x184)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x56c47e=_0x278317[0x0],_0x58efc0=_0x1b68f4,_0x1f1bea=_0x58efc0[_0x139c53(0x16f)];try{const _0x4a46a8=await withSpinner('Creating\x20project\x20\x27'+_0x56c47e+_0x139c53(0x1d9),()=>_0x39dbaa['llm'][_0x139c53(0x1cd)]({'name':_0x56c47e,'description':_0x1f1bea}),{'verbose':_0x1b68f4[_0x139c53(0x152)]});console[_0x139c53(0x1e7)](_0x139c53(0x1b8)+_0x4a46a8['data']['id']);const _0x102f6a=toLLMProjectInfo(_0x4a46a8[_0x139c53(0x18c)]);return await handleSDKOutput([_0x102f6a],_0x1b68f4),0x0;}catch(_0x58e663){return handleSDKError(_0x58e663,_0x1b68f4),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a25_0xde397(0x1d7);[a25_0xde397(0x16f)]=a25_0xde397(0x151);async['execute'](_0x27570b){const _0xc5f774=a25_0xde397,{options:_0x511c26,args:_0x165a60,tdx:_0x52031c}=_0x27570b;if(_0x165a60[_0xc5f774(0x129)]===0x0)return console['error'](_0xc5f774(0x1c5)),console[_0xc5f774(0x184)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x4953f4=_0x165a60[0x0];try{return await withSpinner(_0xc5f774(0x1ea)+_0x4953f4+_0xc5f774(0x1d9),()=>_0x52031c['llm'][_0xc5f774(0x1f0)](_0x4953f4),{'verbose':_0x511c26[_0xc5f774(0x152)]}),console[_0xc5f774(0x1e7)](_0xc5f774(0x134)+_0x4953f4),0x0;}catch(_0x408dfd){return handleSDKError(_0x408dfd,_0x511c26),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a25_0xde397(0x1af)]=a25_0xde397(0x133);[a25_0xde397(0x16f)]='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder';async['execute'](_0x4d8085){const _0xebe405=a25_0xde397,{options:_0x492ba3,args:_0x17946b,tdx:_0x3fdc50}=_0x4d8085;if(_0x17946b[_0xebe405(0x129)]===0x0)return console['error'](_0xebe405(0x1c5)),console[_0xebe405(0x184)](_0xebe405(0x1a2)),0x1;const _0x3331e5=_0x17946b[0x0],_0x5df353=_0x492ba3,_0x5bf903=_0x5df353[_0xebe405(0x17f)],_0x3d8eef=_0x5df353[_0xebe405(0x1f4)];try{const _0x16623f=_0x5bf903||_0x3331e5+_0xebe405(0x1ca);if(a25_0x5f229e[_0xebe405(0x1ce)](_0x16623f)&&!_0x3d8eef){if(!_0x492ba3['yes']){const _0x4d0bdc=await confirm(_0xebe405(0x13a)+_0x16623f+_0xebe405(0x171));if(!_0x4d0bdc)return console['log'](_0xebe405(0x199)),0x0;}a25_0x5f229e[_0xebe405(0x146)](_0x16623f,{'recursive':!![]});}const _0x270064=await withSpinner(_0x3d8eef?_0xebe405(0x13b)+_0x3331e5+_0xebe405(0x1d9):'Backing\x20up\x20project\x20\x27'+_0x3331e5+_0xebe405(0x1d9),()=>_0x3fdc50['llm'][_0xebe405(0x1da)](_0x3331e5,_0x5bf903,{'dryRun':_0x3d8eef}),{'verbose':_0x492ba3[_0xebe405(0x152)]}),_0x317699=_0x270064[_0xebe405(0x18c)];return _0x3d8eef?console[_0xebe405(0x1e7)](_0xebe405(0x158)+_0x317699[_0xebe405(0x160)]):console[_0xebe405(0x1e7)](_0xebe405(0x189)+_0x317699[_0xebe405(0x160)]),console[_0xebe405(0x1e7)](_0xebe405(0x197)+_0x317699[_0xebe405(0x19b)][_0xebe405(0x1f2)]),console[_0xebe405(0x1e7)](_0xebe405(0x1dd)+_0x317699[_0xebe405(0x19b)][_0xebe405(0x155)]),console['log'](_0xebe405(0x1ab)+_0x317699[_0xebe405(0x19b)][_0xebe405(0x1a5)]),console[_0xebe405(0x1e7)](_0xebe405(0x1f9)+_0x317699[_0xebe405(0x19b)][_0xebe405(0x196)]),(_0x492ba3[_0xebe405(0x135)]===_0xebe405(0x19f)||_0x492ba3[_0xebe405(0x135)]===_0xebe405(0x1ed))&&await handleSDKOutput([_0x317699],_0x492ba3),0x0;}catch(_0x2dbcc){return handleSDKError(_0x2dbcc,_0x492ba3),0x1;}}}function a25_0x380a(_0x3ac31b,_0x520695){_0x3ac31b=_0x3ac31b-0x126;const _0x39621d=a25_0x3962();let _0x380a34=_0x39621d[_0x3ac31b];return _0x380a34;}export class LLMProjectRestoreCommand extends BaseCommand{[a25_0xde397(0x1af)]=a25_0xde397(0x153);[a25_0xde397(0x16f)]=a25_0xde397(0x1ee);async['execute'](_0x4773a0){const _0x5da4f0=a25_0xde397,{options:_0x30e943,args:_0x150507,tdx:_0x23eba4}=_0x4773a0;if(_0x150507[_0x5da4f0(0x129)]===0x0)return console[_0x5da4f0(0x184)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x5da4f0(0x184)](_0x5da4f0(0x1ec)),0x1;const _0x3e02a1=_0x150507[0x0],_0x12a703=_0x30e943,_0x163a26=_0x12a703[_0x5da4f0(0x1af)],_0x3fddd6=_0x12a703[_0x5da4f0(0x1f4)];try{if(!_0x3fddd6){const _0x2b2068=_0x23eba4[_0x5da4f0(0x12f)][_0x5da4f0(0x187)](_0x3e02a1),_0x34d945=_0x163a26||_0x2b2068[_0x5da4f0(0x1b4)][_0x5da4f0(0x145)],_0x28d5ff=await withSpinner(_0x5da4f0(0x1a6),()=>_0x23eba4['llm'][_0x5da4f0(0x163)](),{'verbose':_0x30e943['verbose']}),_0x36e10b=_0x28d5ff[_0x5da4f0(0x18c)][_0x5da4f0(0x1c6)](_0x4bffe0=>_0x4bffe0[_0x5da4f0(0x136)]['name']===_0x34d945);if(_0x36e10b&&!_0x30e943['yes']){const _0x1f7736=await confirm(_0x5da4f0(0x19e)+_0x34d945+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x1f7736)return console[_0x5da4f0(0x1e7)](_0x5da4f0(0x156)),0x0;}}const _0x9f9cdb=await withSpinner(_0x3fddd6?_0x5da4f0(0x13e)+_0x3e02a1+_0x5da4f0(0x1d9):_0x5da4f0(0x177)+_0x3e02a1+_0x5da4f0(0x1d9),()=>_0x23eba4[_0x5da4f0(0x12f)]['restoreProject'](_0x3e02a1,{'name':_0x163a26,'dryRun':_0x3fddd6}),{'verbose':_0x30e943[_0x5da4f0(0x152)]}),_0x5cdad3=_0x9f9cdb[_0x5da4f0(0x18c)];return _0x5cdad3[_0x5da4f0(0x12a)]&&console[_0x5da4f0(0x1e7)](_0x5da4f0(0x19d)+_0x5cdad3[_0x5da4f0(0x12a)]+'\x27'),_0x3fddd6?console['log'](_0x5da4f0(0x185)+_0x5cdad3[_0x5da4f0(0x145)]):console['log'](_0x5da4f0(0x1e1)+_0x5cdad3[_0x5da4f0(0x145)]+'\x20('+_0x5cdad3[_0x5da4f0(0x1d6)]+')'),console[_0x5da4f0(0x1e7)]('\x20\x20Agents:\x20'+_0x5cdad3['counts']['agents']),console[_0x5da4f0(0x1e7)](_0x5da4f0(0x1dd)+_0x5cdad3['counts'][_0x5da4f0(0x155)]),console[_0x5da4f0(0x1e7)](_0x5da4f0(0x1ab)+_0x5cdad3['counts']['prompts']),console[_0x5da4f0(0x1e7)](_0x5da4f0(0x1f9)+_0x5cdad3[_0x5da4f0(0x19b)][_0x5da4f0(0x196)]),(_0x30e943[_0x5da4f0(0x135)]===_0x5da4f0(0x19f)||_0x30e943[_0x5da4f0(0x135)]===_0x5da4f0(0x1ed))&&await handleSDKOutput([_0x5cdad3],_0x30e943),0x0;}catch(_0x2432c9){return handleSDKError(_0x2432c9,_0x30e943),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x2d22cf,_0x2ae823){const _0x5f28da=a25_0xde397,_0x469a66=_0x2ae823['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0x35beb2=0x0,_0x3e4ef4=[];const _0x4b22cf=(await import(_0x5f28da(0x1a5)))[_0x5f28da(0x1b0)],_0x2bef31=getChalk(_0x2ae823);while(!![]){const _0x134aa7=await withSpinner(_0x5f28da(0x1be),()=>_0x2d22cf[_0x5f28da(0x12f)][_0x5f28da(0x182)](_0x469a66+_0x35beb2),{'verbose':_0x2ae823['verbose']});_0x3e4ef4=_0x134aa7[_0x5f28da(0x18c)];const _0xfdecc0=_0x3e4ef4[_0x5f28da(0x190)](_0x35beb2,_0x35beb2+_0x469a66),_0x17c92e=_0x3e4ef4['length']>_0x35beb2+_0x469a66,_0xed927f=[...new Set(_0xfdecc0[_0x5f28da(0x1a9)](_0xef95bb=>_0xef95bb[_0x5f28da(0x136)][_0x5f28da(0x1ad)])[_0x5f28da(0x1fa)](_0x475b72=>_0x475b72!==undefined))],_0x51e7e5=new Map();await Promise[_0x5f28da(0x1b3)](_0xed927f['map'](async _0x49145e=>{const _0x5d75be=_0x5f28da;try{const _0x176dde=await _0x2d22cf[_0x5d75be(0x12f)][_0x5d75be(0x194)](_0x49145e);_0x51e7e5['set'](_0x49145e,_0x176dde['attributes'][_0x5d75be(0x1af)]);}catch{_0x51e7e5[_0x5d75be(0x1e3)](_0x49145e,_0x49145e);}}));const _0x2ed920=_0xfdecc0[_0x5f28da(0x1a9)](_0xc165f3=>{const _0x16d7b6=_0x5f28da,_0x5228ac=_0xc165f3['attributes']['firstInputContent']||_0x16d7b6(0x1e2),_0x177733=_0x5228ac[_0x16d7b6(0x179)]('\x0a')[0x0],_0x3bede8=_0x177733[_0x16d7b6(0x129)]>0x50?_0x177733[_0x16d7b6(0x1a7)](0x0,0x4d)+'...':_0x177733,_0x232f42=_0xc165f3['attributes']['agentId']?_0x51e7e5[_0x16d7b6(0x1a1)](_0xc165f3[_0x16d7b6(0x136)][_0x16d7b6(0x1ad)])||_0xc165f3[_0x16d7b6(0x136)][_0x16d7b6(0x1ad)]:_0x16d7b6(0x131),_0x441c8e=_0xc165f3['attributes'][_0x16d7b6(0x195)]||_0xc165f3['attributes'][_0x16d7b6(0x169)],_0x450672=new Date(_0x441c8e),_0x1e0edd=new Date(),_0x25598d=_0x1e0edd[_0x16d7b6(0x18a)]()-_0x450672[_0x16d7b6(0x18a)](),_0x5c8a18=Math[_0x16d7b6(0x18e)](_0x25598d/0xea60),_0x4c086d=Math[_0x16d7b6(0x18e)](_0x25598d/0x36ee80),_0x13dda8=Math['floor'](_0x25598d/0x5265c00);let _0x372f05;if(_0x5c8a18<0x1)_0x372f05=_0x16d7b6(0x1b5);else{if(_0x5c8a18<0x3c)_0x372f05=_0x5c8a18+_0x16d7b6(0x192);else{if(_0x4c086d<0x18)_0x372f05=_0x4c086d+_0x16d7b6(0x166);else _0x13dda8<0x7?_0x372f05=_0x13dda8+_0x16d7b6(0x1d1):_0x372f05=_0x450672[_0x16d7b6(0x1cc)](_0x16d7b6(0x126),{'month':_0x16d7b6(0x1cf),'day':_0x16d7b6(0x186)});}}return{'title':_0x3bede8+'\x20'+_0x2bef31[_0x16d7b6(0x139)]('['+_0x232f42+']\x20'+_0x372f05),'value':_0xc165f3['id']};});_0x17c92e&&_0x2ed920[_0x5f28da(0x18d)]({'title':_0x2bef31[_0x5f28da(0x1fb)](_0x5f28da(0x1f3)),'value':_0x5f28da(0x157)});const _0x16cfc6=await _0x4b22cf({'type':_0x5f28da(0x15a),'name':_0x5f28da(0x178),'message':_0x5f28da(0x167),'choices':_0x2ed920,'hint':_0x5f28da(0x1e4)});if(!_0x16cfc6[_0x5f28da(0x178)])return undefined;if(_0x16cfc6[_0x5f28da(0x178)]==='__load_more__'){_0x35beb2+=_0x469a66;continue;}return _0x16cfc6[_0x5f28da(0x178)];}}export class ChatsCommand extends BaseCommand{[a25_0xde397(0x1af)]=a25_0xde397(0x182);[a25_0xde397(0x16f)]=a25_0xde397(0x1a4);async[a25_0xde397(0x12b)](_0x27e19e){const _0x160f20=a25_0xde397;return executeChatHistoryCommand(_0x27e19e,_0x160f20(0x16d));}}
@@ -1 +1 @@
1
- const a26_0x2d88f3=a26_0x2cc4;(function(_0x513970,_0x56398f){const _0x5881c6=a26_0x2cc4,_0xa8f3f1=_0x513970();while(!![]){try{const _0x9a087a=parseInt(_0x5881c6(0xc9))/0x1*(parseInt(_0x5881c6(0xe0))/0x2)+parseInt(_0x5881c6(0xbb))/0x3+-parseInt(_0x5881c6(0xd7))/0x4*(-parseInt(_0x5881c6(0xcb))/0x5)+-parseInt(_0x5881c6(0xc0))/0x6+parseInt(_0x5881c6(0xee))/0x7+-parseInt(_0x5881c6(0xf1))/0x8*(parseInt(_0x5881c6(0xca))/0x9)+parseInt(_0x5881c6(0xce))/0xa*(-parseInt(_0x5881c6(0xf4))/0xb);if(_0x9a087a===_0x56398f)break;else _0xa8f3f1['push'](_0xa8f3f1['shift']());}catch(_0x4b43ca){_0xa8f3f1['push'](_0xa8f3f1['shift']());}}}(a26_0x43c3,0x43a11));import a26_0x5c1fa4 from'chalk';function a26_0x43c3(){const _0x29a764=['white','description','init','dim','green','92WAJGkY','close','llmProject','yellow','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','log','site','cyan','stop','714qNOUAM','Port\x20','✓\x20Proxy\x20server\x20stopped','created\x20on-demand\x20per\x20model','llm','getOrCreateDefaultProject','\x20is\x20unavailable,\x20using\x20port\x20','server','find','logLevel','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','http://0.0.0.0:','Server\x20Configuration:','projects','1357433hebXlZ','exit','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','8ZUXvnC','name','Project\x20\x27','712536LVhtSc','\x20\x20Agents:','Resolving\x20project...','286998Ziwtxl','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0aTesting\x20with\x20Agent\x20SDK:','logger','\x20\x20}','1842816bzqzhn','port','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20\x20\x20}','SIGTERM','attributes','execute','bold','Starting\x20proxy\x20server...','1263DWQaUt','1405044caGaeS','14035vOBLAn','\x27\x20not\x20found','\x0aClaude\x20Code\x20Configuration:','10KOLJzY','\x20\x20Site:','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','NOT_FOUND'];a26_0x43c3=function(){return _0x29a764;};return a26_0x43c3();}import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a26_0x2cc4(_0x33ad4b,_0x5e144a){_0x33ad4b=_0x33ad4b-0xba;const _0x43c316=a26_0x43c3();let _0x2cc4f0=_0x43c316[_0x33ad4b];return _0x2cc4f0;}import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x1b0994,_0x32cc9a){const _0x285898=a26_0x2cc4,{tdx:_0x1a1f5d,options:_0x2c5ed9}=_0x1b0994,_0x640d85=_0x32cc9a||_0x2c5ed9[_0x285898(0xd9)];if(_0x640d85){const _0x452f83=await _0x1a1f5d['llm']['projects'](),_0x37d1a2=_0x452f83[_0x285898(0xe8)](_0x4af2cf=>_0x4af2cf[_0x285898(0xc5)][_0x285898(0xf2)]===_0x640d85);if(!_0x37d1a2)throw new SDKError(ErrorCode[_0x285898(0xd1)],_0x285898(0xf3)+_0x640d85+_0x285898(0xcc),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x37d1a2['id'];}const _0x2c7048=await _0x1a1f5d[_0x285898(0xe4)][_0x285898(0xe5)]();return _0x2c7048['id'];}export class LLMProxyCommand extends BaseCommand{[a26_0x2d88f3(0xf2)]='llm:proxy';[a26_0x2d88f3(0xd3)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a26_0x2d88f3(0xe7)];['logger'];async[a26_0x2d88f3(0xc6)](_0x3c584e){const _0x3cd40a=a26_0x2d88f3,{tdx:_0x240f15,options:_0x573018}=_0x3c584e;try{const _0x13b478=_0x573018,_0x55be9b=_0x13b478[_0x3cd40a(0xc1)]||0xfa0,_0x313ab0=_0x13b478['project'],_0x589ada=await findAvailablePort(_0x55be9b);console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xba)));const _0x3e4231=await getProjectIdOrDefault(_0x3c584e,_0x313ab0),_0x4c19ef=await _0x240f15[_0x3cd40a(0xe4)][_0x3cd40a(0xed)](),_0x28f196=_0x4c19ef['find'](_0x4ebbdd=>_0x4ebbdd['id']===_0x3e4231);this[_0x3cd40a(0xbe)]=new TDXLogger(_0x573018[_0x3cd40a(0xe9)]),await this[_0x3cd40a(0xbe)][_0x3cd40a(0xd4)](),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xc8)));_0x589ada!==_0x55be9b&&console[_0x3cd40a(0xdc)](a26_0x5c1fa4['yellow'](_0x3cd40a(0xe1)+_0x55be9b+_0x3cd40a(0xe6)+_0x589ada));this['server']=new ProxyServer({'port':_0x589ada,'projectId':_0x3e4231,'tdx':_0x240f15,'logger':this[_0x3cd40a(0xbe)],'site':_0x573018[_0x3cd40a(0xdd)]}),await this[_0x3cd40a(0xe7)]['start'](),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['yellow'][_0x3cd40a(0xc7)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xda)]('This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xda)](_0x3cd40a(0xbc))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['green'][_0x3cd40a(0xc7)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xde)](_0x3cd40a(0xec))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)]('\x20\x20Address:'),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xeb)+_0x589ada)),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['dim']('\x20\x20Project:'),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x28f196?.[_0x3cd40a(0xc5)][_0x3cd40a(0xf2)]||_0x3e4231)),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xf5)),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xe3))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xcf)),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x573018['site'])),console['log'](a26_0x5c1fa4[_0x3cd40a(0xde)](_0x3cd40a(0xcd))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xdb))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd2)]('\x20\x20{')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['white']('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd2)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x589ada+'\x22,')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd2)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xc3))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xbf))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xde)](_0x3cd40a(0xbd))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xd0))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['dim'](_0x3cd40a(0xf0))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xea))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['yellow']('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0xe22039=async()=>{const _0x5ca4bb=_0x3cd40a;console['log'](a26_0x5c1fa4['dim'](_0x5ca4bb(0xc2))),this[_0x5ca4bb(0xe7)]&&await this[_0x5ca4bb(0xe7)][_0x5ca4bb(0xdf)](),this[_0x5ca4bb(0xbe)]&&await this['logger'][_0x5ca4bb(0xd8)](),console[_0x5ca4bb(0xdc)](a26_0x5c1fa4[_0x5ca4bb(0xd6)](_0x5ca4bb(0xe2))),process[_0x5ca4bb(0xef)](0x0);};return process['on']('SIGINT',_0xe22039),process['on'](_0x3cd40a(0xc4),_0xe22039),await new Promise(()=>{}),0x0;}catch(_0xdd147b){this[_0x3cd40a(0xe7)]&&await this[_0x3cd40a(0xe7)][_0x3cd40a(0xdf)]();this[_0x3cd40a(0xbe)]&&await this[_0x3cd40a(0xbe)]['close']();throw _0xdd147b;}}}
1
+ const a26_0x340c2d=a26_0x530c;(function(_0xc382f,_0x316bf4){const _0x54ccb3=a26_0x530c,_0x416246=_0xc382f();while(!![]){try{const _0x102855=parseInt(_0x54ccb3(0xb3))/0x1+-parseInt(_0x54ccb3(0xae))/0x2+parseInt(_0x54ccb3(0x82))/0x3*(parseInt(_0x54ccb3(0xa7))/0x4)+parseInt(_0x54ccb3(0x97))/0x5*(-parseInt(_0x54ccb3(0xa9))/0x6)+parseInt(_0x54ccb3(0xa8))/0x7+parseInt(_0x54ccb3(0x86))/0x8*(-parseInt(_0x54ccb3(0x94))/0x9)+-parseInt(_0x54ccb3(0xa2))/0xa*(-parseInt(_0x54ccb3(0xaf))/0xb);if(_0x102855===_0x316bf4)break;else _0x416246['push'](_0x416246['shift']());}catch(_0xcd987e){_0x416246['push'](_0x416246['shift']());}}}(a26_0x50eb,0x1a242));import a26_0x56b0aa from'chalk';function a26_0x50eb(){const _0x4ab9ba=['\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','\x0aClaude\x20Code\x20Configuration:','✓\x20Proxy\x20server\x20stopped','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','SIGTERM','9vOKWNK','SIGINT','Server\x20Configuration:','server','328088bClILG','site','close','Resolving\x20project...','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','execute','port','start','\x20\x20{','\x20\x20Site:','Port\x20','\x20\x20}','bold','log','9itqDUL','name','created\x20on-demand\x20per\x20model','5IWECTo','cyan','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x27\x20not\x20found','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','stop','white','\x20\x20Address:','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','10ZQQmYA','http://0.0.0.0:','\x20is\x20unavailable,\x20using\x20port\x20','llm','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','5348ZYubAX','437234jugDXL','1193124AWePXJ','yellow','logLevel','description','projects','78868puNkmz','2198086RJwKIC','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','NOT_FOUND','logger','120074HQuHPF','llmProject','\x20\x20\x20\x20}','\x20\x20Agents:','dim','llm:proxy','green','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','find'];a26_0x50eb=function(){return _0x4ab9ba;};return a26_0x50eb();}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';async function getProjectIdOrDefault(_0x49616d,_0x1763b1){const _0x25732f=a26_0x530c,{tdx:_0x4a78a7,options:_0x29c1bd}=_0x49616d,_0x39d090=_0x1763b1||_0x29c1bd[_0x25732f(0xb4)];if(_0x39d090){const _0xc632db=await _0x4a78a7[_0x25732f(0xa5)][_0x25732f(0xad)](),_0xde2096=_0xc632db[_0x25732f(0x7c)](_0x20e3fc=>_0x20e3fc['attributes'][_0x25732f(0x95)]===_0x39d090);if(!_0xde2096)throw new SDKError(ErrorCode[_0x25732f(0xb1)],'Project\x20\x27'+_0x39d090+_0x25732f(0x9a),undefined,{'helpText':_0x25732f(0x9b)});return _0xde2096['id'];}const _0x55bddb=await _0x4a78a7[_0x25732f(0xa5)]['getOrCreateDefaultProject']();return _0x55bddb['id'];}function a26_0x530c(_0x5d7ea9,_0x21ae62){_0x5d7ea9=_0x5d7ea9-0x77;const _0x50eb84=a26_0x50eb();let _0x530c58=_0x50eb84[_0x5d7ea9];return _0x530c58;}export class LLMProxyCommand extends BaseCommand{['name']=a26_0x340c2d(0x79);[a26_0x340c2d(0xac)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a26_0x340c2d(0x85)];[a26_0x340c2d(0xb2)];async[a26_0x340c2d(0x8b)](_0x25c60b){const _0xe8185c=a26_0x340c2d,{tdx:_0x18228f,options:_0x57aca0}=_0x25c60b;try{const _0x3c3cf0=_0x57aca0,_0x3a114f=_0x3c3cf0[_0xe8185c(0x8c)]||0xfa0,_0x5cdd7e=_0x3c3cf0['project'],_0x47d50b=await findAvailablePort(_0x3a114f);console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0x89)));const _0x5bd284=await getProjectIdOrDefault(_0x25c60b,_0x5cdd7e),_0x483f3c=await _0x18228f[_0xe8185c(0xa5)]['projects'](),_0x948624=_0x483f3c[_0xe8185c(0x7c)](_0x3500bf=>_0x3500bf['id']===_0x5bd284);this[_0xe8185c(0xb2)]=new TDXLogger(_0x57aca0[_0xe8185c(0xab)]),await this[_0xe8185c(0xb2)]['init'](),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)]('Starting\x20proxy\x20server...'));_0x47d50b!==_0x3a114f&&console[_0xe8185c(0x93)](a26_0x56b0aa['yellow'](_0xe8185c(0x90)+_0x3a114f+_0xe8185c(0xa4)+_0x47d50b));this[_0xe8185c(0x85)]=new ProxyServer({'port':_0x47d50b,'projectId':_0x5bd284,'tdx':_0x18228f,'logger':this['logger'],'site':_0x57aca0[_0xe8185c(0x87)]}),await this[_0xe8185c(0x85)][_0xe8185c(0x8d)](),console['log'](a26_0x56b0aa['yellow'][_0xe8185c(0x92)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0xaa)](_0xe8185c(0x7b))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0xaa)](_0xe8185c(0x9f))),console['log'](a26_0x56b0aa[_0xe8185c(0x7a)][_0xe8185c(0x92)](_0xe8185c(0xa0))),console['log'](a26_0x56b0aa[_0xe8185c(0x98)](_0xe8185c(0x84))),console['log'](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0x9e)),a26_0x56b0aa['white'](_0xe8185c(0xa3)+_0x47d50b)),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)]('\x20\x20Project:'),a26_0x56b0aa['white'](_0x948624?.['attributes'][_0xe8185c(0x95)]||_0x5bd284)),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0x77)),a26_0x56b0aa['white'](_0xe8185c(0x96))),console['log'](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0x8f)),a26_0x56b0aa[_0xe8185c(0x9d)](_0x57aca0[_0xe8185c(0x87)])),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x98)](_0xe8185c(0x7e))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0x99))),console['log'](a26_0x56b0aa[_0xe8185c(0x9d)](_0xe8185c(0x8e))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x9d)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x9d)](_0xe8185c(0x7d)+_0x47d50b+'\x22,')),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x9d)](_0xe8185c(0xb0))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x9d)](_0xe8185c(0xb5))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x9d)](_0xe8185c(0x91))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x98)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0xa6))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0x78)](_0xe8185c(0x8a))),console[_0xe8185c(0x93)](a26_0x56b0aa['dim'](_0xe8185c(0x80))),console[_0xe8185c(0x93)](a26_0x56b0aa[_0xe8185c(0xaa)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x23d6a0=async()=>{const _0x36190a=_0xe8185c;console[_0x36190a(0x93)](a26_0x56b0aa[_0x36190a(0x78)](_0x36190a(0xa1))),this[_0x36190a(0x85)]&&await this[_0x36190a(0x85)][_0x36190a(0x9c)](),this[_0x36190a(0xb2)]&&await this[_0x36190a(0xb2)]['close'](),console[_0x36190a(0x93)](a26_0x56b0aa[_0x36190a(0x7a)](_0x36190a(0x7f))),process['exit'](0x0);};return process['on'](_0xe8185c(0x83),_0x23d6a0),process['on'](_0xe8185c(0x81),_0x23d6a0),await new Promise(()=>{}),0x0;}catch(_0x18a506){this[_0xe8185c(0x85)]&&await this[_0xe8185c(0x85)][_0xe8185c(0x9c)]();this[_0xe8185c(0xb2)]&&await this[_0xe8185c(0xb2)][_0xe8185c(0x88)]();throw _0x18a506;}}}
@@ -1 +1 @@
1
- const a27_0xe4513=a27_0x545b;(function(_0x445de0,_0x59044d){const _0x6886b3=a27_0x545b,_0x6a0ae6=_0x445de0();while(!![]){try{const _0x34688c=parseInt(_0x6886b3(0x28e))/0x1+parseInt(_0x6886b3(0x1c7))/0x2+-parseInt(_0x6886b3(0x196))/0x3+parseInt(_0x6886b3(0x192))/0x4+parseInt(_0x6886b3(0x27f))/0x5*(parseInt(_0x6886b3(0x176))/0x6)+parseInt(_0x6886b3(0x1c6))/0x7*(parseInt(_0x6886b3(0x25b))/0x8)+-parseInt(_0x6886b3(0x25c))/0x9;if(_0x34688c===_0x59044d)break;else _0x6a0ae6['push'](_0x6a0ae6['shift']());}catch(_0x25acbd){_0x6a0ae6['push'](_0x6a0ae6['shift']());}}}(a27_0x32a9,0xbafbd));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0x2eadbd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x393c4e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0xe4513(0x270),LEGACY_PARENT_SEGMENT_DIR=a27_0xe4513(0x190);function openBrowser(_0x1bcf64){const _0xd1b997=a27_0xe4513,_0x17b786=process[_0xd1b997(0x182)],_0x5a1389=_0x17b786==='darwin'?_0xd1b997(0x181):_0x17b786===_0xd1b997(0x251)?_0xd1b997(0x246):_0xd1b997(0x21b);spawn(_0x5a1389,[_0x1bcf64],{'detached':!![],'stdio':_0xd1b997(0x211)})['unref']();}function sanitizeFileName(_0x1d7209){const _0x5dc4e3=a27_0xe4513;return _0x1d7209[_0x5dc4e3(0x1c4)]()[_0x5dc4e3(0x1bf)](/[/\\:*?"<>|]/g,'-')[_0x5dc4e3(0x1bf)](/\s+/g,'-')[_0x5dc4e3(0x1bf)](/-+/g,'-')[_0x5dc4e3(0x1bf)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0xed170b=a27_0xe4513;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x547270=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x547270['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xed170b(0x257)](a27_0x393c4e['yellow'](_0xed170b(0x19b)+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x256)+PARENT_SEGMENT_DIR+_0xed170b(0x1dd))),console[_0xed170b(0x257)](a27_0x393c4e['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x259))),![];console[_0xed170b(0x257)](a27_0x393c4e[_0xed170b(0x274)](_0xed170b(0x1f2)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a27_0x393c4e[_0xed170b(0x20c)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3f1f5d){const _0x45176f=_0x3f1f5d instanceof Error?_0x3f1f5d[_0xed170b(0x1d5)]:String(_0x3f1f5d);return console[_0xed170b(0x257)](a27_0x393c4e['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x45176f+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0xe4513(0x1d0)](_0x596470){const _0x1d1c9a=a27_0xe4513;return migrateLegacyDirectory(),super[_0x1d1c9a(0x1d0)](_0x596470);}}function resolveYamlFile(_0xbf1dc5){const _0xb2aae=a27_0xe4513;if(_0xbf1dc5['endsWith'](_0xb2aae(0x24b))||_0xbf1dc5[_0xb2aae(0x220)](_0xb2aae(0x1c3)))return _0xbf1dc5;return a27_0x2eadbd[_0xb2aae(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xbf1dc5)+'.yml');}function formatProgressMessage(_0x555582){const _0x5d31d0=a27_0xe4513,_0x7fc1cd=_0x555582[_0x5d31d0(0x1ff)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7fc1cd){const [,_0x3b973d,_0x2dc7f3,_0x36fe5e='']=_0x7fc1cd;return a27_0x393c4e[_0x5d31d0(0x21d)](_0x3b973d+':')+'\x20'+_0x2dc7f3+a27_0x393c4e[_0x5d31d0(0x21d)](_0x36fe5e);}return a27_0x393c4e[_0x5d31d0(0x21d)](_0x555582);}function showFileNotFoundError(_0x3d64cc,_0x62b8f8){const _0x120742=a27_0xe4513;console[_0x120742(0x257)](a27_0x393c4e[_0x120742(0x25f)](_0x120742(0x267)+_0x3d64cc+'\x0a')),console['error'](a27_0x393c4e[_0x120742(0x1cc)](_0x120742(0x177)+_0x62b8f8+_0x120742(0x1e5)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x20a);[a27_0xe4513(0x21f)]=a27_0xe4513(0x283);async[a27_0xe4513(0x1b0)](_0x5414e4){const _0x1c25e7=a27_0xe4513,{options:_0x2a4f94,args:_0x361bb6,tdx:_0x297cad}=_0x5414e4,_0x5d3294=_0x361bb6[0x0];_0x2a4f94[_0x1c25e7(0x28f)]&&(console[_0x1c25e7(0x257)](_0x1c25e7(0x175)+_0x2a4f94[_0x1c25e7(0x27c)]),_0x5d3294&&console[_0x1c25e7(0x257)]('Pattern:\x20'+_0x5d3294));const _0x1e5493=await withSpinner(_0x5d3294?_0x1c25e7(0x26a)+_0x5d3294+'\x27...':_0x1c25e7(0x277),()=>_0x297cad[_0x1c25e7(0x20f)]['listParents'](),{'verbose':_0x2a4f94[_0x1c25e7(0x28f)]});let _0x434746=_0x1e5493['data'];if(_0x5d3294){const _0x4e49b3=_0x5d3294[_0x1c25e7(0x1bf)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x1c25e7(0x1bf)](/\?/g,'.'),_0x273e84=new RegExp('^'+_0x4e49b3+'$','i');_0x434746=_0x434746[_0x1c25e7(0x247)](_0x1b9496=>_0x273e84[_0x1c25e7(0x236)](_0x1b9496[_0x1c25e7(0x189)][_0x1c25e7(0x262)]));}_0x434746[_0x1c25e7(0x210)]((_0x43175f,_0x78e1e0)=>_0x43175f[_0x1c25e7(0x189)][_0x1c25e7(0x262)][_0x1c25e7(0x215)](_0x78e1e0['attributes'][_0x1c25e7(0x262)])),console[_0x1c25e7(0x257)](_0x1c25e7(0x25d)+_0x434746[_0x1c25e7(0x239)]+_0x1c25e7(0x1f1)+(_0x434746[_0x1c25e7(0x239)]!==0x1?'s':''));if(_0x2a4f94[_0x1c25e7(0x1cf)]===_0x1c25e7(0x253)||_0x2a4f94[_0x1c25e7(0x1cf)]==='jsonl')await handleSDKOutput(_0x434746,_0x2a4f94);else{if(_0x434746['length']===0x0)_0x5d3294?console['log'](_0x1c25e7(0x22c)+_0x5d3294):console['log']('No\x20parent\x20segments\x20found');else for(const _0x4c0560 of _0x434746){const _0x34238d=_0x4c0560['attributes'][_0x1c25e7(0x282)]?a27_0x393c4e[_0x1c25e7(0x21d)]('\x20('+formatRows(_0x4c0560['attributes'][_0x1c25e7(0x282)])+')'):'';console['log'](_0x1c25e7(0x1f7)+_0x4c0560[_0x1c25e7(0x189)][_0x1c25e7(0x262)]+_0x34238d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x184);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x375306){const _0x467244=a27_0xe4513,{options:_0x1d2980,args:_0x28b50d,tdx:_0x523542}=_0x375306;console[_0x467244(0x257)](_0x467244(0x1ab)+_0x467244(0x18a)+_0x467244(0x233));const _0x34bf47=_0x1d2980;if(_0x28b50d[_0x467244(0x239)]===0x0)return console['error'](_0x467244(0x1f6)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;const _0x50ab66=_0x28b50d[0x0];if(!_0x34bf47[_0x467244(0x19a)]||!_0x34bf47['table'])return console[_0x467244(0x257)](_0x467244(0x1e0)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;_0x34bf47[_0x467244(0x28f)]&&(console['error'](_0x467244(0x175)+_0x34bf47[_0x467244(0x27c)]),console[_0x467244(0x257)](_0x467244(0x24e)+_0x50ab66),console['error'](_0x467244(0x248)+_0x34bf47['database']),console[_0x467244(0x257)](_0x467244(0x1f3)+_0x34bf47['table']));const _0x382391=await loadJSONFromOptions(_0x34bf47['attributes'],_0x34bf47[_0x467244(0x261)]),_0x142f3b=await loadJSONFromOptions(_0x34bf47[_0x467244(0x1a1)],_0x34bf47[_0x467244(0x1f5)]),_0x52e895=await loadJSONFromOptions(_0x34bf47[_0x467244(0x243)],_0x34bf47[_0x467244(0x183)]),_0x3eb728={'name':_0x50ab66,'description':_0x34bf47[_0x467244(0x21f)],'scheduleType':_0x34bf47[_0x467244(0x279)],'scheduleOption':_0x34bf47[_0x467244(0x1a0)],'timezone':_0x34bf47[_0x467244(0x255)],'master':{'parentDatabaseName':_0x34bf47['database'],'parentTableName':_0x34bf47[_0x467244(0x258)]},'attributes':_0x382391,'behaviors':_0x142f3b,'customerGroup':_0x52e895},_0x2cc7fc=await withSpinner(_0x467244(0x221)+_0x50ab66+'\x27...',()=>_0x523542[_0x467244(0x20f)]['createParent'](_0x3eb728),{'verbose':_0x1d2980[_0x467244(0x28f)]}),_0x9ab870=_0x2cc7fc[_0x467244(0x226)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x9ab870[_0x467244(0x262)]+_0x467244(0x1af)+_0x9ab870['id']),await handleSDKOutput([_0x9ab870],_0x1d2980),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x3d28c1){const _0x2db336=a27_0xe4513,{options:_0xf5407a,args:_0x29243d,tdx:_0xdd5c59}=_0x3d28c1;console[_0x2db336(0x257)](_0x2db336(0x1b5)+_0x2db336(0x18a)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3aabc9=_0xf5407a;if(_0x29243d[_0x2db336(0x239)]===0x0)return console[_0x2db336(0x257)](_0x2db336(0x1f6)),console[_0x2db336(0x257)](_0x2db336(0x288)),0x1;const _0x1a64ac=_0x29243d[0x0];_0x3aabc9[_0x2db336(0x28f)]&&(console[_0x2db336(0x257)](_0x2db336(0x175)+_0x3aabc9[_0x2db336(0x27c)]),console['error'](_0x2db336(0x198)+_0x1a64ac));const _0x13e8ea=await withSpinner(_0x2db336(0x241)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59['segment']['getParentFull'](_0x1a64ac),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x14f8b1=_0x13e8ea['data'],_0x505bc7=await loadJSONFromOptions(_0x3aabc9['addAttributes'],_0x3aabc9[_0x2db336(0x1bc)]),_0x813b1e=await loadJSONFromOptions(_0x3aabc9[_0x2db336(0x23b)],_0x3aabc9['addBehaviorsFile']),_0x5bb024={'name':_0x14f8b1['name'],'description':_0x3aabc9['description']!==undefined?_0x3aabc9['description']:_0x14f8b1[_0x2db336(0x21f)],'scheduleType':_0x3aabc9[_0x2db336(0x279)]!==undefined?_0x3aabc9[_0x2db336(0x279)]:_0x14f8b1['scheduleType'],'scheduleOption':_0x3aabc9['scheduleOption']!==undefined?_0x3aabc9[_0x2db336(0x1a0)]:_0x14f8b1[_0x2db336(0x1a0)],'timezone':_0x3aabc9[_0x2db336(0x255)]!==undefined?_0x3aabc9[_0x2db336(0x255)]:_0x14f8b1['timezone'],'master':_0x14f8b1[_0x2db336(0x1ec)],'attributes':_0x505bc7?[..._0x14f8b1['attributes']||[],..._0x505bc7]:_0x14f8b1[_0x2db336(0x189)],'behaviors':_0x813b1e?[..._0x14f8b1[_0x2db336(0x1a1)]||[],..._0x813b1e]:_0x14f8b1[_0x2db336(0x1a1)],'customerGroup':_0x14f8b1[_0x2db336(0x243)]},_0x1471d6=await withSpinner(_0x2db336(0x1d9)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59[_0x2db336(0x20f)][_0x2db336(0x23a)](_0x1a64ac,_0x5bb024),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x205037=_0x1471d6[_0x2db336(0x226)];return console['error'](_0x2db336(0x24d)+_0x205037['name']+'\x27'),await handleSDKOutput([_0x205037],_0x3aabc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x18b);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x39978e){const _0x706327=a27_0xe4513,{options:_0x360a04,args:_0x434c6,tdx:_0x204405}=_0x39978e,_0x2feb6a=_0x360a04,_0x4559e2=_0x434c6[0x0]||_0x360a04[_0x706327(0x17a)];if(!_0x4559e2)return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)](_0x706327(0x229))),console['error'](_0x706327(0x1bb)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)](_0x706327(0x1c2))),0x1;if(_0x2feb6a[_0x706327(0x214)]&&_0x2feb6a[_0x706327(0x292)])return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a27_0x393c4e['dim'](_0x706327(0x1a4))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x21d)](_0x706327(0x18f)+PARENT_SEGMENT_DIR+_0x706327(0x240))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x534a91=_0x2feb6a[_0x706327(0x292)]||a27_0x2eadbd[_0x706327(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4559e2)+_0x706327(0x24b));_0x2feb6a['verbose']&&(console[_0x706327(0x257)]('Site:\x20'+_0x2feb6a['site']),console[_0x706327(0x257)]('Parent\x20segment:\x20'+_0x4559e2),console['error'](_0x706327(0x271)+_0x534a91));const _0x4dd2ba=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4559e2+'\x27...',()=>_0x204405[_0x706327(0x20f)][_0x706327(0x26d)](_0x4559e2),{'verbose':_0x2feb6a[_0x706327(0x28f)]}),_0x553d9e=_0x4dd2ba['data'];if(existsSync(_0x534a91)){const _0x4bddb5=readFileSync(_0x534a91,_0x706327(0x1d1)),_0xff2e1c=generateDiff(_0x4bddb5,_0x553d9e);if(!hasChanges(_0xff2e1c))console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x266)+a27_0x393c4e['cyan'](_0x534a91)+_0x706327(0x289));else{console[_0x706327(0x257)]('\x0aChanges\x20to\x20\x27'+_0x534a91+'\x27:'),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c)),console['error'](formatDiffWithColors(_0xff2e1c)),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c));if(!_0x2feb6a[_0x706327(0x22e)]){const _0x54a040=await confirmKey('Overwrite\x20\x27'+_0x534a91+'\x27?');if(!_0x54a040)return console[_0x706327(0x257)](_0x706327(0x260)),0x1;}writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e[_0x706327(0x1cc)](_0x534a91));}}else{const _0x5e3cb4=a27_0x2eadbd[_0x706327(0x205)](_0x534a91);!existsSync(_0x5e3cb4)&&mkdirSync(_0x5e3cb4,{'recursive':!![]}),writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e['cyan'](_0x534a91));}return saveSessionContext({'parent_segment':_0x4559e2},_0x2feb6a['session']),console[_0x706327(0x257)](a27_0x393c4e['green']('✔')+'\x20Context\x20set:\x20'+a27_0x393c4e['dim'](_0x706327(0x190))+_0x706327(0x18c)+a27_0x393c4e[_0x706327(0x1cc)](_0x4559e2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x1a5);[a27_0xe4513(0x21f)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x3be310){const _0x51e7e3=a27_0xe4513,{options:_0xe40479,args:_0x4a4bc2,tdx:_0x2036d0}=_0x3be310,_0x1b6870=_0xe40479,_0x2fd141=_0x4a4bc2[0x0]||_0xe40479[_0x51e7e3(0x17a)];if(!_0x2fd141)return console[_0x51e7e3(0x257)](a27_0x393c4e['red'](_0x51e7e3(0x229))),console[_0x51e7e3(0x257)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x51e7e3(0x257)](a27_0x393c4e['cyan']('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first')),0x1;const _0xaebbc2=resolveYamlFile(_0x2fd141);if(!existsSync(_0xaebbc2))return showFileNotFoundError(_0xaebbc2,_0x2fd141),0x1;_0x1b6870['verbose']&&(console[_0x51e7e3(0x257)]('Site:\x20'+_0x1b6870[_0x51e7e3(0x27c)]),console[_0x51e7e3(0x257)]('YAML\x20file:\x20'+_0xaebbc2));let _0x314748;try{_0x314748=readFileSync(_0xaebbc2,_0x51e7e3(0x1d1));}catch(_0x33e732){const _0x2932d5=_0x33e732 instanceof Error?_0x33e732[_0x51e7e3(0x1d5)]:String(_0x33e732);return console[_0x51e7e3(0x257)](_0x51e7e3(0x278)+_0x2932d5),0x1;}const _0x3a7f8a=await withSpinner(_0x51e7e3(0x1fd),()=>_0x2036d0[_0x51e7e3(0x20f)]['pushParentYaml'](_0x314748),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x557f1a=_0x3a7f8a[_0x51e7e3(0x226)],{isNew:_0x24704c,name:_0x5a23c3,hasChanges:_0x936347,diffFormatted:_0x50f9e2}=_0x557f1a;if(!_0x936347)return console[_0x51e7e3(0x257)](_0x51e7e3(0x1a3)+_0x5a23c3+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x24704c?console[_0x51e7e3(0x257)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5a23c3+'\x27:'):console[_0x51e7e3(0x257)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x5a23c3+'\x27:');console[_0x51e7e3(0x257)]('─'[_0x51e7e3(0x18d)](0x3c)),console[_0x51e7e3(0x257)](_0x50f9e2),console['error']('─'[_0x51e7e3(0x18d)](0x3c));const _0x2f1ee5=_0x24704c?_0x51e7e3(0x197)+_0x5a23c3+'\x27?':_0x51e7e3(0x18e)+_0x5a23c3+'\x27?';if(!_0x1b6870['yes']){const _0x45a613=await confirmKey(_0x2f1ee5);if(!_0x45a613)return console[_0x51e7e3(0x257)]('Aborted.'),0x1;}const _0x4a095d=_0x24704c?_0x51e7e3(0x28a):_0x51e7e3(0x204),_0x1ad3ba=await withSpinner(_0x4a095d+_0x51e7e3(0x1b4)+_0x5a23c3+_0x51e7e3(0x275),()=>_0x557f1a[_0x51e7e3(0x27e)](),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x3991f0=_0x1ad3ba['data'],_0x390646=getConsoleNextUrl(_0x1b6870[_0x51e7e3(0x27c)],_0x51e7e3(0x26b)+_0x3991f0['id']),_0x9a7de6=_0x24704c?_0x51e7e3(0x20b):_0x51e7e3(0x1da);return console['error']('✔\x20'+_0x9a7de6+'\x20parent\x20segment\x20\x27'+_0x3991f0[_0x51e7e3(0x262)]+'\x27'),console[_0x51e7e3(0x257)]('\x20\x20'+_0x390646),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x21a);[a27_0xe4513(0x21f)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a27_0xe4513(0x1b0)](_0x537193){const _0x454202=a27_0xe4513,{options:_0x52384b,args:_0x15dd46,tdx:_0x4370e4}=_0x537193,_0x1e063a=_0x52384b,_0xddacae=_0x15dd46[0x0]||_0x52384b['parentSegment'];if(!_0xddacae)return console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x454202(0x257)](_0x454202(0x23d)),console[_0x454202(0x257)](_0x454202(0x1f0)),console[_0x454202(0x257)](_0x454202(0x1f9)),console['error']('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x454202(0x257)](_0x454202(0x193)),console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x1cc)](_0x454202(0x1ca))),0x1;const _0x521335=resolveYamlFile(_0xddacae);if(!existsSync(_0x521335))return showFileNotFoundError(_0x521335,_0xddacae),0x1;_0x1e063a[_0x454202(0x28f)]&&(console[_0x454202(0x257)](_0x454202(0x175)+_0x1e063a['site']),console['error'](_0x454202(0x1b2)+_0x521335));let _0x35f1bc;try{_0x35f1bc=readFileSync(_0x521335,_0x454202(0x1d1));}catch(_0x342500){const _0x374612=_0x342500 instanceof Error?_0x342500[_0x454202(0x1d5)]:String(_0x342500);return console[_0x454202(0x257)](_0x454202(0x278)+_0x374612),0x1;}const _0x2a99d8=createCommandSpinner(a27_0x393c4e[_0x454202(0x21d)]('Validating\x20configuration...'),{'verbose':_0x1e063a[_0x454202(0x28f)]});_0x2a99d8[_0x454202(0x246)]();const _0x39e43c={'onProgress':_0x1a83e9=>{const _0x28272e=_0x454202;_0x2a99d8[_0x28272e(0x1de)]=formatProgressMessage(_0x1a83e9);}};if(_0x1e063a[_0x454202(0x1ec)])_0x39e43c[_0x454202(0x1ec)]=!![];if(_0x1e063a[_0x454202(0x17f)])_0x39e43c[_0x454202(0x17f)]=!![];_0x1e063a[_0x454202(0x219)]&&(_0x39e43c[_0x454202(0x219)]=_0x1e063a[_0x454202(0x219)]);_0x1e063a[_0x454202(0x206)]&&(_0x39e43c['behavior']=_0x1e063a[_0x454202(0x206)]);if(_0x1e063a['interval'])_0x39e43c['interval']=_0x1e063a[_0x454202(0x1bd)];let _0x3f65ad;try{_0x3f65ad=await _0x4370e4[_0x454202(0x20f)][_0x454202(0x208)](_0x35f1bc,_0x39e43c),_0x2a99d8[_0x454202(0x1b3)]();}catch(_0xe196d1){_0x2a99d8[_0x454202(0x1b3)]();throw _0xe196d1;}const _0x48c68c=_0x1e063a[_0x454202(0x1bd)]||_0x454202(0x1dc);return this[_0x454202(0x272)](_0x3f65ad,_0x39e43c,_0x521335,_0x48c68c),_0x3f65ad['allValid']?0x0:0x1;}[a27_0xe4513(0x272)](_0x143da4,_0x10d31d,_0x139a06,_0x1f9cf1){const _0x42c44d=a27_0xe4513;console[_0x42c44d(0x257)]('\x0a'+a27_0x393c4e[_0x42c44d(0x1d6)](_0x42c44d(0x269))+'\x20'+_0x143da4['name']),console[_0x42c44d(0x257)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x143da4);if(typeof _0x10d31d[_0x42c44d(0x219)]===_0x42c44d(0x1a6)){this['displayAttributesStats'](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'attribute',_0x10d31d[_0x42c44d(0x219)]);return;}if(_0x10d31d[_0x42c44d(0x219)]===!![]){this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x189));return;}if(typeof _0x10d31d['behavior']==='string'){this['displayBehaviorsStats'](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x206),_0x10d31d[_0x42c44d(0x206)]);return;}if(_0x10d31d[_0x42c44d(0x206)]===!![]){this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this['displayPreviewHints'](_0x139a06,_0x1f9cf1,_0x42c44d(0x1a1));return;}this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'all');}['displayPreviewHints'](_0x248f3e,_0x2190a4,_0x224222,_0x43602f){const _0x1a148a=a27_0xe4513;console[_0x1a148a(0x257)]('\x0a'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x252)));const _0x437d63=_0x2190a4!==_0x1a148a(0x1dc)?_0x1a148a(0x232)+_0x2190a4:'';if(_0x224222==='attribute'&&_0x43602f)console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x22a)+_0x43602f+'\x22'+_0x437d63));else{if(_0x224222===_0x1a148a(0x206)&&_0x43602f)console['error']('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x24f)+_0x43602f+'\x22'+_0x437d63));else(_0x224222===_0x1a148a(0x189)||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x19d)+_0x437d63));}(_0x224222==='behaviors'||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)]('tdx\x20segment\x20parent\x20preview\x20'+_0x248f3e+_0x1a148a(0x1c9)+_0x437d63)),_0x224222===_0x1a148a(0x1fb)&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x1a7)+_0x437d63));}['displayMasterInfo'](_0x1f773d){const _0x15f35b=a27_0xe4513,{master:_0x590b65}=_0x1f773d,_0x118efa=_0x590b65[_0x15f35b(0x24a)]?a27_0x393c4e[_0x15f35b(0x20c)]('✔'):a27_0x393c4e['red']('✘');console[_0x15f35b(0x257)]('\x0a'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1eb))),console['error'](_0x118efa+'\x20'+a27_0x393c4e[_0x15f35b(0x1d6)](_0x590b65[_0x15f35b(0x19a)]+'.'+_0x590b65[_0x15f35b(0x258)])),_0x590b65[_0x15f35b(0x24a)]?_0x590b65[_0x15f35b(0x20e)]!==undefined&&console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1e2))+'\x20'+a27_0x393c4e[_0x15f35b(0x1cc)](formatRows(_0x590b65['rowCount']))):console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e['red'](_0x15f35b(0x1ba))+'\x20'+_0x590b65[_0x15f35b(0x213)]);}[a27_0xe4513(0x245)](_0x4fa0d2){const _0x1ffb6c=a27_0xe4513;if(_0x4fa0d2[_0x1ffb6c(0x189)]['length']===0x0)return;console[_0x1ffb6c(0x257)]('\x0a'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1fa)));for(const _0x14598f of _0x4fa0d2['attributes']){const _0x46e617=_0x14598f[_0x1ffb6c(0x24a)]?a27_0x393c4e[_0x1ffb6c(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x59ecce='';if(_0x14598f[_0x1ffb6c(0x24a)]&&_0x14598f[_0x1ffb6c(0x291)]!==undefined&&_0x14598f[_0x1ffb6c(0x17d)]!==undefined){const _0x53567a=_0x14598f[_0x1ffb6c(0x17d)][_0x1ffb6c(0x19f)](0x1),_0x450d75=_0x14598f[_0x1ffb6c(0x17d)]>=0x50?a27_0x393c4e[_0x1ffb6c(0x20c)]:_0x14598f[_0x1ffb6c(0x17d)]>=0x32?a27_0x393c4e[_0x1ffb6c(0x274)]:a27_0x393c4e['red'];_0x59ecce='\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Coverage:')+'\x20'+_0x450d75(_0x53567a+'%')+'\x20('+formatRows(_0x14598f[_0x1ffb6c(0x291)])+_0x1ffb6c(0x263);}console[_0x1ffb6c(0x257)](_0x46e617+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f[_0x1ffb6c(0x262)])+_0x59ecce),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1e8))+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f['database']+'.'+_0x14598f[_0x1ffb6c(0x258)]));const _0x6bea5c=_0x14598f['joinKey']===_0x14598f[_0x1ffb6c(0x27a)]?a27_0x393c4e[_0x1ffb6c(0x21d)]('Join\x20on:')+'\x20'+_0x14598f['joinKey']:a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x254))+'\x20'+_0x14598f[_0x1ffb6c(0x25a)]+_0x1ffb6c(0x18c)+_0x14598f[_0x1ffb6c(0x27a)];console[_0x1ffb6c(0x257)]('\x20\x20'+_0x6bea5c),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Columns:')),this[_0x1ffb6c(0x1cd)](_0x14598f[_0x1ffb6c(0x199)]),!_0x14598f[_0x1ffb6c(0x24a)]&&console[_0x1ffb6c(0x257)]('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x25f)](_0x1ffb6c(0x1ba))+'\x20'+_0x14598f['schemaError']);}}[a27_0xe4513(0x223)](_0x284d70,_0x5c0d0b){const _0x383aee=a27_0xe4513;if(_0x284d70['behaviors'][_0x383aee(0x239)]===0x0)return;console[_0x383aee(0x257)]('\x0a'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1c1))+'\x20'+a27_0x393c4e[_0x383aee(0x21d)]('('+_0x5c0d0b+')'));for(const _0x479c3a of _0x284d70['behaviors']){const _0x1f9b2e=_0x479c3a[_0x383aee(0x24a)]?a27_0x393c4e[_0x383aee(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x4efea2='';if(_0x479c3a['schemaValid']&&_0x479c3a['customersWithEvents']!==undefined&&_0x479c3a[_0x383aee(0x25e)]!==undefined){const _0x2d4e01=_0x479c3a[_0x383aee(0x280)]?.[_0x383aee(0x19f)](0x1)||'?',_0x42cfe1=(_0x479c3a['customerPercent']??0x0)>=0x32?a27_0x393c4e[_0x383aee(0x20c)]:(_0x479c3a[_0x383aee(0x280)]??0x0)>=0x14?a27_0x393c4e[_0x383aee(0x274)]:a27_0x393c4e[_0x383aee(0x25f)];_0x4efea2='\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1ed))+'\x20'+_0x42cfe1(formatRows(_0x479c3a[_0x383aee(0x231)]))+'\x20('+_0x2d4e01+'%)\x20'+a27_0x393c4e['dim'](_0x383aee(0x1c0))+'\x20'+a27_0x393c4e['cyan'](formatRows(_0x479c3a[_0x383aee(0x25e)]));}console[_0x383aee(0x257)](_0x1f9b2e+'\x20'+a27_0x393c4e['bold'](_0x479c3a['name'])+_0x4efea2),console[_0x383aee(0x257)]('\x20\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1e8))+'\x20'+a27_0x393c4e[_0x383aee(0x1d6)](_0x479c3a[_0x383aee(0x19a)]+'.'+_0x479c3a[_0x383aee(0x258)]));const _0x9a5840=_0x479c3a[_0x383aee(0x25a)]===_0x479c3a[_0x383aee(0x27a)]?a27_0x393c4e['dim'](_0x383aee(0x1db))+'\x20'+_0x479c3a[_0x383aee(0x25a)]:a27_0x393c4e['dim'](_0x383aee(0x254))+'\x20'+_0x479c3a['joinKey']+_0x383aee(0x18c)+_0x479c3a[_0x383aee(0x27a)];console[_0x383aee(0x257)]('\x20\x20'+_0x9a5840),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x383aee(0x1d7))),this[_0x383aee(0x1cd)](_0x479c3a[_0x383aee(0x199)]),!_0x479c3a[_0x383aee(0x24a)]&&console['error']('\x20\x20'+a27_0x393c4e[_0x383aee(0x25f)]('Error:')+'\x20'+_0x479c3a['schemaError']);}}[a27_0xe4513(0x1cd)](_0x2f3615){const _0x5557cb=a27_0xe4513;for(const _0xf8eeb7 of _0x2f3615){_0xf8eeb7['label']===_0xf8eeb7[_0x5557cb(0x187)]||_0xf8eeb7[_0x5557cb(0x187)]==='*'?console[_0x5557cb(0x257)](_0x5557cb(0x1f8)+_0xf8eeb7['label']):console['error'](_0x5557cb(0x1f8)+_0xf8eeb7[_0x5557cb(0x188)]+'\x20'+a27_0x393c4e['dim']('('+_0xf8eeb7[_0x5557cb(0x187)]+')'));}}[a27_0xe4513(0x1f4)](_0x308b3e){const _0x31f453=a27_0xe4513;console[_0x31f453(0x257)]('─'[_0x31f453(0x18d)](0x3c));if(_0x308b3e[_0x31f453(0x17c)][_0x31f453(0x239)]>0x0){console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x25f)](_0x31f453(0x1b9)));for(const _0x995649 of _0x308b3e['errors']){console[_0x31f453(0x257)]('\x20\x20'+a27_0x393c4e[_0x31f453(0x25f)]('•')+'\x20'+_0x995649);}}_0x308b3e[_0x31f453(0x222)]&&console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x20c)]('✔')+_0x31f453(0x28d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x264);[a27_0xe4513(0x21f)]=a27_0xe4513(0x1b6);async[a27_0xe4513(0x1b0)](_0x980ec9){const _0x573298=a27_0xe4513,{options:_0x4b4117,args:_0x164bf6,tdx:_0x19cd02}=_0x980ec9,_0x1238db=_0x4b4117,_0x43ec50=_0x164bf6[0x0]||_0x4b4117[_0x573298(0x17a)];if(!_0x43ec50)return console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x229))),console[_0x573298(0x257)](_0x573298(0x1ae)),console[_0x573298(0x257)](_0x573298(0x1e4)),console['error'](_0x573298(0x1e9)),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x573298(0x257)](_0x573298(0x193)),console[_0x573298(0x257)](a27_0x393c4e['cyan'](_0x573298(0x1ca))),0x1;if(!_0x1238db[_0x573298(0x1ec)]&&!_0x1238db[_0x573298(0x219)]&&!_0x1238db[_0x573298(0x206)]&&!_0x1238db[_0x573298(0x17f)])return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x194))),console[_0x573298(0x257)](_0x573298(0x1ae)),console['error'](_0x573298(0x1f0)),console[_0x573298(0x257)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)](_0x573298(0x227)),0x1;const _0x544844=resolveYamlFile(_0x43ec50);if(!existsSync(_0x544844))return showFileNotFoundError(_0x544844,_0x43ec50),0x1;_0x1238db[_0x573298(0x28f)]&&(console[_0x573298(0x257)](_0x573298(0x175)+_0x1238db[_0x573298(0x27c)]),console[_0x573298(0x257)](_0x573298(0x1b2)+_0x544844));let _0x1e6c6a;try{_0x1e6c6a=readFileSync(_0x544844,_0x573298(0x1d1));}catch(_0x11e38e){const _0xedcfb0=_0x11e38e instanceof Error?_0x11e38e['message']:String(_0x11e38e);return console[_0x573298(0x257)](_0x573298(0x278)+_0xedcfb0),0x1;}let _0x274b95;try{_0x274b95=parseYamlString(_0x1e6c6a);}catch(_0x380012){const _0x412180=_0x380012 instanceof Error?_0x380012[_0x573298(0x1d5)]:String(_0x380012);return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error\x20parsing\x20YAML:\x20'+_0x412180)),0x1;}if(_0x1238db[_0x573298(0x219)]===!![]||_0x1238db[_0x573298(0x219)]===''){const _0x4e64e4=_0x274b95[_0x573298(0x189)]?.['map'](_0x1c971a=>_0x1c971a[_0x573298(0x262)])||[];if(_0x4e64e4[_0x573298(0x239)]===0x0)console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x1a8)));else{console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x202))),console[_0x573298(0x257)](_0x573298(0x287));for(const _0x49b7dc of _0x4e64e4){console[_0x573298(0x257)]('\x20\x20'+a27_0x393c4e[_0x573298(0x1cc)](_0x49b7dc));}console['error'](_0x573298(0x265)+_0x43ec50+'\x20--attribute\x20\x22'+_0x4e64e4[0x0]+'\x22');}return 0x1;}if(_0x1238db[_0x573298(0x206)]===!![]||_0x1238db[_0x573298(0x206)]===''){const _0x11c77f=_0x274b95[_0x573298(0x1a1)]?.[_0x573298(0x200)](_0x2dea67=>_0x2dea67[_0x573298(0x262)])||[];if(_0x11c77f[_0x573298(0x239)]===0x0)console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x217))),console['error'](_0x573298(0x1d4));for(const _0x5e303a of _0x11c77f){console['error']('\x20\x20'+a27_0x393c4e['cyan'](_0x5e303a));}console[_0x573298(0x257)](_0x573298(0x265)+_0x43ec50+_0x573298(0x24f)+_0x11c77f[0x0]+'\x22');}return 0x1;}const _0x7ea2a8=createCommandSpinner(a27_0x393c4e[_0x573298(0x21d)](_0x573298(0x249)),{'verbose':_0x1238db[_0x573298(0x28f)]});_0x7ea2a8[_0x573298(0x246)]();const _0x2a3b15={'onProgress':_0x46be19=>{const _0x57e2cc=_0x573298;_0x7ea2a8[_0x57e2cc(0x1de)]=formatProgressMessage(_0x46be19);}};if(_0x1238db[_0x573298(0x1ec)])_0x2a3b15['master']=!![];if(_0x1238db[_0x573298(0x219)]&&typeof _0x1238db['attribute']===_0x573298(0x1a6))_0x2a3b15[_0x573298(0x219)]=_0x1238db[_0x573298(0x219)];if(_0x1238db[_0x573298(0x206)]&&typeof _0x1238db[_0x573298(0x206)]===_0x573298(0x1a6))_0x2a3b15['behavior']=_0x1238db[_0x573298(0x206)];if(_0x1238db[_0x573298(0x17f)])_0x2a3b15[_0x573298(0x17f)]=!![];if(_0x1238db[_0x573298(0x1bd)])_0x2a3b15[_0x573298(0x1bd)]=_0x1238db[_0x573298(0x1bd)];let _0x486efb;try{_0x486efb=await _0x19cd02['segment'][_0x573298(0x21e)](_0x1e6c6a,_0x2a3b15),_0x7ea2a8[_0x573298(0x1b3)]();}catch(_0x5a5ecc){_0x7ea2a8[_0x573298(0x1b3)]();throw _0x5a5ecc;}return await this[_0x573298(0x191)](_0x486efb,{'master':_0x1238db[_0x573298(0x1ec)],'attribute':typeof _0x1238db[_0x573298(0x219)]===_0x573298(0x1a6)?_0x1238db[_0x573298(0x219)]:undefined,'behavior':typeof _0x1238db[_0x573298(0x206)]==='string'?_0x1238db[_0x573298(0x206)]:undefined,'enriched':_0x1238db[_0x573298(0x17f)]}),_0x486efb['allValid']?0x0:0x1;}async[a27_0xe4513(0x191)](_0x5a4e2e,_0x2f9989){const _0x5d4e7b=a27_0xe4513;console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5d4e7b(0x1d2))+'\x20'+_0x5a4e2e[_0x5d4e7b(0x262)]),console[_0x5d4e7b(0x257)]('═'['repeat'](0x3c));if(_0x2f9989['master']&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x521585=a27_0x393c4e[_0x5d4e7b(0x21d)]('Master:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5a4e2e[_0x5d4e7b(0x1ec)][_0x5d4e7b(0x19a)]+'.'+_0x5a4e2e[_0x5d4e7b(0x1ec)]['table']);await this[_0x5d4e7b(0x24c)](_0x521585,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x219)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x579597=a27_0x393c4e[_0x5d4e7b(0x21d)](_0x5d4e7b(0x28b))+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989['attribute']);await this[_0x5d4e7b(0x24c)](_0x579597,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x206)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x131c3c=a27_0x393c4e['dim']('Behavior:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989[_0x5d4e7b(0x206)]);await this[_0x5d4e7b(0x24c)](_0x131c3c,_0x5a4e2e['sampleData']);}else{if(_0x2f9989[_0x5d4e7b(0x17f)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x41ecef=a27_0x393c4e[_0x5d4e7b(0x21d)]('Enriched:')+'\x20'+a27_0x393c4e['bold'](_0x5d4e7b(0x235));await this[_0x5d4e7b(0x24c)](_0x41ecef,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else!_0x5a4e2e['sampleData']&&console[_0x5d4e7b(0x257)](_0x5d4e7b(0x1df));}}}if(_0x5a4e2e['errors'][_0x5d4e7b(0x239)]>0x0){console[_0x5d4e7b(0x257)]('─'['repeat'](0x3c)),console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e['red']('Errors:'));for(const _0x37467c of _0x5a4e2e[_0x5d4e7b(0x17c)]){console['error']('\x20\x20'+a27_0x393c4e['red']('•')+'\x20'+_0x37467c);}}}async[a27_0xe4513(0x24c)](_0x2d37dd,_0x467583){const _0x426667=a27_0xe4513;if(_0x467583[_0x426667(0x239)]===0x0){console['error']('\x0a'+_0x2d37dd),console[_0x426667(0x257)](_0x426667(0x17b));return;}console[_0x426667(0x257)]('\x0a'+_0x2d37dd);const _0x398837=Object[_0x426667(0x284)](_0x467583[0x0])['map'](_0x223ba0=>({'name':_0x223ba0,'type':typeof _0x467583[0x0][_0x223ba0]===_0x426667(0x22f)?_0x426667(0x201):_0x426667(0x238)})),_0x3aee7f={'queryId':_0x426667(0x244),'columns':_0x398837,'data':_0x467583,'stats':{'state':_0x426667(0x1ad),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x467583[_0x426667(0x239)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x7f9d10=formatAsTable(_0x3aee7f,_0x467583[_0x426667(0x239)],!![]);await writeOutput(_0x7f9d10,undefined,_0x426667(0x258));}}function a27_0x545b(_0x47f12d,_0x521d1c){_0x47f12d=_0x47f12d-0x175;const _0x32a9bd=a27_0x32a9();let _0x545b49=_0x32a9bd[_0x47f12d];return _0x545b49;}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x23f);[a27_0xe4513(0x21f)]=a27_0xe4513(0x26e);async[a27_0xe4513(0x1b0)](_0x39bc7e){const _0x20524e=a27_0xe4513,{options:_0x4ec766,args:_0x3eb623,tdx:_0x1f538e}=_0x39bc7e,_0x479fbf=_0x4ec766,_0x10278f=_0x3eb623[0x0]||_0x4ec766[_0x20524e(0x17a)];if(!_0x10278f)return console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x20524e(0x257)](_0x20524e(0x1c5)),console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x1cc)](_0x20524e(0x1c2))),0x1;const _0x3880c6=resolveYamlFile(_0x10278f);if(existsSync(_0x3880c6)){_0x479fbf['verbose']&&console[_0x20524e(0x257)]('Found\x20YAML\x20file:\x20'+_0x3880c6);let _0x2daed;try{_0x2daed=readFileSync(_0x3880c6,_0x20524e(0x1d1));}catch(_0x58ddbb){const _0x53184b=_0x58ddbb instanceof Error?_0x58ddbb[_0x20524e(0x1d5)]:String(_0x58ddbb);return console[_0x20524e(0x257)](_0x20524e(0x278)+_0x53184b),0x1;}const _0x2b0bb4=await withSpinner(_0x20524e(0x1fd),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23c)](_0x2daed),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x72163c=_0x2b0bb4[_0x20524e(0x226)],{isNew:_0x6af045,name:_0x40a8b2,hasChanges:_0x26b37c,diffFormatted:_0x53003b}=_0x72163c;if(_0x26b37c){_0x6af045?console['error'](_0x20524e(0x1d3)+_0x40a8b2+'\x27:'):console[_0x20524e(0x257)](_0x20524e(0x26c)+_0x40a8b2+'\x27:');console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c)),console[_0x20524e(0x257)](_0x53003b),console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c));const _0x3f3250=_0x6af045?_0x20524e(0x197)+_0x40a8b2+_0x20524e(0x22b):'Apply\x20changes\x20to\x20\x27'+_0x40a8b2+_0x20524e(0x22b);if(!_0x479fbf[_0x20524e(0x22e)]){const _0x1cf0b0=await confirmKey(_0x3f3250);if(!_0x1cf0b0)return console[_0x20524e(0x257)]('Aborted.'),0x1;}const _0x5e6152=_0x6af045?_0x20524e(0x28a):_0x20524e(0x204);await withSpinner(_0x5e6152+_0x20524e(0x1b4)+_0x40a8b2+_0x20524e(0x275),()=>_0x72163c[_0x20524e(0x27e)](),{'verbose':_0x479fbf['verbose']});const _0x300cb2=_0x6af045?_0x20524e(0x20b):_0x20524e(0x1da);console[_0x20524e(0x257)]('✔\x20'+_0x300cb2+_0x20524e(0x1b4)+_0x40a8b2+'\x27');}else console[_0x20524e(0x257)](_0x20524e(0x1a3)+_0x40a8b2+_0x20524e(0x207));}const _0x6e7f36=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x10278f+_0x20524e(0x275),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23e)](_0x10278f),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x377259=_0x6e7f36[_0x20524e(0x226)],_0x301faf=getConsoleUrl(_0x479fbf[_0x20524e(0x27c)],_0x20524e(0x242)+_0x377259[_0x20524e(0x17e)]+_0x20524e(0x1e1)+_0x377259[_0x20524e(0x19e)]+_0x20524e(0x234)+_0x377259[_0x20524e(0x228)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x218))+'\x20'+_0x377259['audienceId']),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x21c))+'\x20'+_0x377259[_0x20524e(0x1b1)]),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x180))+'\x20'+_0x377259[_0x20524e(0x19e)]),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x20524e(0x225))+'\x20'+_0x377259[_0x20524e(0x228)]),console[_0x20524e(0x257)]('\x20\x20'+_0x301faf),console[_0x20524e(0x257)]('\x0a'+a27_0x393c4e['dim'](_0x20524e(0x27b))+_0x20524e(0x1ce)+_0x377259[_0x20524e(0x228)]+_0x20524e(0x1e7)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x1b7);[a27_0xe4513(0x21f)]=a27_0xe4513(0x185);async[a27_0xe4513(0x1b0)](_0x125af1){const _0x17779d=a27_0xe4513,{options:_0x26196,args:_0x33d7d5,tdx:_0x146ac6}=_0x125af1,_0x24c200=_0x33d7d5[0x0]||_0x26196[_0x17779d(0x17a)];if(!_0x24c200)return console['error'](a27_0x393c4e[_0x17779d(0x25f)](_0x17779d(0x229))),console[_0x17779d(0x257)](_0x17779d(0x28c)),console[_0x17779d(0x257)](a27_0x393c4e[_0x17779d(0x1cc)](_0x17779d(0x1c2))),0x1;_0x26196['verbose']&&(console['error'](_0x17779d(0x175)+_0x26196['site']),console[_0x17779d(0x257)](_0x17779d(0x198)+_0x24c200));const _0x1f5e89=await withSpinner(_0x17779d(0x290)+_0x24c200+'\x27...',()=>_0x146ac6[_0x17779d(0x20f)]['listFields'](_0x24c200),{'verbose':_0x26196['verbose']}),_0x362d1c=_0x1f5e89[_0x17779d(0x226)];console['error'](_0x17779d(0x25d)+_0x362d1c[_0x17779d(0x239)]+'\x20field'+(_0x362d1c['length']!==0x1?'s':''));if(_0x26196[_0x17779d(0x253)]||_0x26196['jsonl'])return await handleSDKOutput(_0x362d1c,_0x26196),0x0;return displayFieldsHumanReadable(_0x362d1c,_0x24c200),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async[a27_0xe4513(0x1b0)](_0x2647ac){const _0x4f4c3b=a27_0xe4513,{options:_0x624d66,args:_0xb886b7,tdx:_0x537ad5}=_0x2647ac,_0x19f858=_0x624d66,_0x40a441=_0xb886b7[0x0]||_0x624d66[_0x4f4c3b(0x17a)];if(!_0x40a441)return console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x25f)](_0x4f4c3b(0x229))),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1be)),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1f0)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x4f4c3b(0x1ca))),0x1;_0x624d66[_0x4f4c3b(0x28f)]&&(console[_0x4f4c3b(0x257)](_0x4f4c3b(0x175)+_0x624d66[_0x4f4c3b(0x27c)]),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x198)+_0x40a441));const _0x5fd958=await withSpinner(_0x4f4c3b(0x1e6)+_0x40a441+'\x27...',()=>_0x537ad5[_0x4f4c3b(0x20f)]['getParentFull'](_0x40a441),{'verbose':_0x624d66[_0x4f4c3b(0x28f)]}),_0x2bbfab=_0x5fd958['data'];if(_0x19f858[_0x4f4c3b(0x216)]){const _0x40a56f=getConsoleNextUrl(_0x19f858[_0x4f4c3b(0x27c)],_0x4f4c3b(0x26b)+_0x2bbfab['id']);return console['error'](a27_0x393c4e[_0x4f4c3b(0x20c)]('✔')+'\x20Opening\x20'+a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x40a56f)),openBrowser(_0x40a56f),0x0;}return await handleSingleObjectOutput(_0x2bbfab,_0x624d66),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x186);['description']=a27_0xe4513(0x250);async['execute'](_0x1bed8a){const _0xacb483=a27_0xe4513,{options:_0x30191e,args:_0x343cad,tdx:_0x5ab886}=_0x1bed8a,_0x3fa2b1=_0x343cad[0x0]||_0x30191e['parentSegment'];if(!_0x3fa2b1)return console[_0xacb483(0x257)](a27_0x393c4e[_0xacb483(0x25f)](_0xacb483(0x229))),console[_0xacb483(0x257)](_0xacb483(0x1cb)),console[_0xacb483(0x257)](a27_0x393c4e['cyan'](_0xacb483(0x1c2))),0x1;_0x30191e[_0xacb483(0x28f)]&&(console['error']('Site:\x20'+_0x30191e[_0xacb483(0x27c)]),console[_0xacb483(0x257)](_0xacb483(0x198)+_0x3fa2b1));const _0x5d4f3f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886['segment'][_0xacb483(0x212)](_0x3fa2b1),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x287d7d=_0x5d4f3f['data'],_0x336910=await withSpinner(_0xacb483(0x1a2)+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886[_0xacb483(0x20f)][_0xacb483(0x1e3)](_0x287d7d),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x2894cd=await executeSchemaQuery(_0x336910[_0xacb483(0x226)],_0x5ab886,_0x30191e);return await handleQueryOutput(_0x2894cd,_0x30191e),0x0;}}function a27_0x32a9(){const _0x23918a=['Fetching\x20SQL\x20for\x20\x27','✔\x20No\x20changes\x20-\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','segment:parent:push','string','\x20--enriched','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','jsonl','join','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','FINISHED','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x27\x20with\x20ID:\x20','execute','status','YAML\x20file:\x20','stop','\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:fields','stats','Errors:','Error:','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','addAttributesFile','interval','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','replace','Events:','Behaviors','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','.yaml','toLowerCase','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','77mEWmLv','245336CGWHvz','processedRows','\x20--behavior\x20\x22<name>\x22','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','cyan','displayColumns','\x20tdx\x20wf\x20attempt\x20','format','run','utf-8','Preview:','\x0aNew\x20parent\x20segment\x20\x27','Available\x20behaviors:','message','bold','Columns:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Updating\x20parent\x20segment\x20\x27','Updated','Join\x20on:','-1d','/\x20directories\x20exist.','text','\x0aNo\x20sample\x20data\x20available','Error:\x20--database\x20and\x20--table\x20are\x20required','/sessions/','Rows:','getParentSQL','Options\x20(one\x20required):','`\x20to\x20download\x20the\x20configuration\x20first','Fetching\x20parent\x20segment\x20\x27','\x20kill','Source:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','sampleData','Master\x20Table','master','Customers:','limit','✔\x20Query\x20completed:\x20Processed\x20','Options:','\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','Table:\x20','displaySummary','behaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','👥\x20','\x20\x20\x20\x20-\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','Attributes','all','setJobId','Analyzing\x20changes...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','match','map','double','Error:\x20--attribute\x20requires\x20a\x20name\x0a','information_schema','Updating','dirname','behavior','\x27\x20is\x20up\x20to\x20date','validateParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:parent:list','Created','green','in\x20','rowCount','segment','sort','ignore','resolveParentId','schemaError','use','localeCompare','web','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Audience\x20ID:','attribute','segment:parent:validate','xdg-open','Status:','dim','previewParentYaml','description','endsWith','Creating\x20parent\x20segment\x20\x27','allValid','displayBehaviorsStats','elapsedTimeMillis','Attempt:','data','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','workflowAttemptId','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','\x20--attribute\x20\x22','\x27\x20and\x20run\x20workflow?','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:sql','yes','number','displayPreviewHints','customersWithEvents','\x20--interval\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','/attempt/','Master\x20+\x20Attributes','test','Get\x20SQL\x20query\x20for\x20parent\x20segment','varchar','length','updateParent','addBehaviors','pushParentYaml','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','runParent','segment:parent:run','/{name}.yml\x0a','Fetching\x20current\x20configuration\x20for\x20\x27','/app/workflows/','customerGroup','preview','displayAttributesStats','start','filter','Database:\x20','Fetching\x20sample\x20data...','schemaValid','.yml','displaySampleData','✔\x20Updated\x20parent\x20segment\x20\x27','Name:\x20','\x20--behavior\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','win32','To\x20view\x20sample\x20data:','json','Join:','timezone','/\x20and\x20','error','table','/\x20directory.\x0a','joinKey','924656jxIioK','30213837qaXGxR','✔\x20Found\x20','totalEvents','red','Aborted.','attributesFile','name','\x20rows)','segment:parent:preview','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20No\x20changes\x20-\x20','Error:\x20File\x20not\x20found:\x20','tdx\x20segment\x20parent\x20preview\x20','Validate:','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','\x0aChanges\x20to\x20apply\x20to\x20\x27','pullParentYaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20rows\x20','parent_segments','Output\x20file:\x20','displayValidateResults','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','yellow','\x27...','jobId','Listing\x20parent\x20segments...','Error\x20reading\x20file:\x20','scheduleType','foreignKey','To\x20cancel:','site','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','apply','204415ZMoSPd','customerPercent','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','population','List\x20parent\x20segments','keys','trim','SQL\x20query:\x0a','Available\x20attributes:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20is\x20already\x20up\x20to\x20date','Creating','Attribute:','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','\x20Configuration\x20is\x20valid','850662iZTuCI','verbose','Listing\x20fields\x20for\x20\x27','matchedCount','output','Site:\x20','168pigaYj','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Resolving\x20parent\x20segment\x20\x27','toLocaleString','parentSegment','\x20\x20No\x20sample\x20data\x20available','errors','coveragePercent','workflowId','enriched','Session:','open','platform','customerGroupFile','segment:parent:create','List\x20available\x20fields\x20for\x20segmentation','segment:parent:desc','column','label','attributes','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','segment:parent:pull','\x20=\x20','repeat','Apply\x20changes\x20to\x20\x27','using\x20the\x20default\x20path:\x20','parent_segment','displayPreviewResults','5752088utOlAM','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SELECT\x20*\x20FROM\x20(\x0a','2113500cEXzzX','Create\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','columns','database','\x0a⚠️\x20\x20Both\x20','Executing\x20parent\x20segment\x20query...','\x20--attribute\x20\x22<name>\x22','workflowSessionId','toFixed','scheduleOption','behaviors'];a27_0x32a9=function(){return _0x23918a;};return a27_0x32a9();}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x22d);[a27_0xe4513(0x21f)]=a27_0xe4513(0x237);async[a27_0xe4513(0x1b0)](_0x5a57d0){const _0x40bf1b=a27_0xe4513,{options:_0x103209,args:_0x18f87b,tdx:_0x411b74}=_0x5a57d0,_0x49e4d7=_0x18f87b[0x0]||_0x103209['parentSegment'];if(!_0x49e4d7)return console[_0x40bf1b(0x257)](a27_0x393c4e[_0x40bf1b(0x25f)](_0x40bf1b(0x229))),console[_0x40bf1b(0x257)](_0x40bf1b(0x1ac)),console[_0x40bf1b(0x257)](a27_0x393c4e['cyan'](_0x40bf1b(0x1c2))),0x1;_0x103209[_0x40bf1b(0x28f)]&&(console[_0x40bf1b(0x257)]('Site:\x20'+_0x103209[_0x40bf1b(0x27c)]),console['error'](_0x40bf1b(0x198)+_0x49e4d7));const _0x116043=await withSpinner(_0x40bf1b(0x178)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x212)](_0x49e4d7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x2dd4f7=_0x116043[_0x40bf1b(0x226)],_0x319bf6=await withSpinner(_0x40bf1b(0x1a2)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x1e3)](_0x2dd4f7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x1c2b37=_0x319bf6[_0x40bf1b(0x226)];return _0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x253)||_0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x1a9)?await handleSDKOutput([{'sql':_0x1c2b37}],_0x103209):console['log'](_0x1c2b37),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:show';[a27_0xe4513(0x21f)]=a27_0xe4513(0x281);async[a27_0xe4513(0x1b0)](_0x516264){const _0x2718c1=a27_0xe4513,{options:_0x20f6e2,args:_0x1ea97f,tdx:_0x4a1f42}=_0x516264,_0x5c6626=_0x1ea97f[0x0]||_0x20f6e2['parentSegment'];if(!_0x5c6626)return console[_0x2718c1(0x257)](a27_0x393c4e[_0x2718c1(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x2718c1(0x257)]('Usage:\x20tdx\x20ps\x20show\x20[name]\x0a'),console['error'](a27_0x393c4e[_0x2718c1(0x1cc)](_0x2718c1(0x1c2))),0x1;_0x20f6e2[_0x2718c1(0x28f)]&&(console[_0x2718c1(0x257)]('Site:\x20'+_0x20f6e2[_0x2718c1(0x27c)]),console[_0x2718c1(0x257)]('Parent\x20segment:\x20'+_0x5c6626));const _0x406a8c=await withSpinner(_0x2718c1(0x178)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment'][_0x2718c1(0x212)](_0x5c6626),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x376079=_0x406a8c[_0x2718c1(0x226)],_0x568eb7=await withSpinner(_0x2718c1(0x1a2)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment']['getParentSQL'](_0x376079),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]});let _0x4b96ad=_0x568eb7[_0x2718c1(0x226)];const _0x4824df=resolveLimit(_0x20f6e2[_0x2718c1(0x1ee)],DEFAULT_DISPLAY_LIMIT),_0x1b9111=/\bLIMIT\s+\d+/i[_0x2718c1(0x236)](_0x4b96ad);!_0x1b9111&&(_0x4b96ad=_0x4b96ad[_0x2718c1(0x285)]()[_0x2718c1(0x1bf)](/;+$/,''),_0x4b96ad=_0x2718c1(0x195)+_0x4b96ad+_0x2718c1(0x209)+_0x4824df);_0x20f6e2[_0x2718c1(0x28f)]&&console[_0x2718c1(0x257)](_0x2718c1(0x286)+_0x4b96ad);const _0x1d2b5d=await withQuerySpinner(_0x2718c1(0x19c),async _0x59f800=>{const _0x41475a=_0x2718c1,_0xb696fb=await _0x4a1f42['query'][_0x41475a(0x1b0)](_0x4b96ad,{'catalog':'td','schema':_0x41475a(0x203),'onJobId':_0x3906c0=>{const _0x281684=_0x41475a;_0x59f800[_0x281684(0x1fc)](_0x3906c0);}});return _0xb696fb;},{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x532816=_0x1d2b5d[_0x2718c1(0x226)],_0x4f6fa0=_0x532816[_0x2718c1(0x276)]?'\x20[Job\x20ID:\x20'+_0x532816[_0x2718c1(0x276)]+']':'';return console[_0x2718c1(0x257)](_0x2718c1(0x1ef)+_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x1c8)][_0x2718c1(0x179)]()+_0x2718c1(0x26f)+(_0x2718c1(0x20d)+formatElapsed(_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x224)])+_0x4f6fa0)),await handleQueryOutput(_0x532816,_0x20f6e2),0x0;}}
1
+ const a27_0x3dec44=a27_0x3f10;(function(_0x33747a,_0x3c6390){const _0x4df0b8=a27_0x3f10,_0x54bace=_0x33747a();while(!![]){try{const _0x5c08b2=-parseInt(_0x4df0b8(0x159))/0x1*(-parseInt(_0x4df0b8(0x1cf))/0x2)+-parseInt(_0x4df0b8(0x122))/0x3+parseInt(_0x4df0b8(0x1ca))/0x4*(-parseInt(_0x4df0b8(0x16f))/0x5)+-parseInt(_0x4df0b8(0xbb))/0x6+-parseInt(_0x4df0b8(0xff))/0x7*(parseInt(_0x4df0b8(0x1c6))/0x8)+-parseInt(_0x4df0b8(0xda))/0x9*(parseInt(_0x4df0b8(0x183))/0xa)+-parseInt(_0x4df0b8(0xfb))/0xb*(-parseInt(_0x4df0b8(0xd2))/0xc);if(_0x5c08b2===_0x3c6390)break;else _0x54bace['push'](_0x54bace['shift']());}catch(_0x5bc816){_0x54bace['push'](_0x54bace['shift']());}}}(a27_0x1cb4,0x47954));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';function a27_0x1cb4(){const _0x560d4e=['output','\x0aChanges\x20to\x20\x27','getParentFull','segment:parent:push','tdx\x20segment\x20parent\x20preview\x20','in\x20','description','ignore','Preview:','segment:parent:view','database','\x20--attribute\x20\x22<name>\x22','resolveParentId','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','Executing\x20parent\x20segment\x20query...','8830iRvSYX','replace','Available\x20behaviors:','updateParent','dim','open','totalEvents','green','listFields','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Master:','Analyzing\x20changes...','population','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20[Job\x20ID:\x20','displayBehaviorsStats','yellow','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayColumns','text','elapsedTimeMillis','displayPreviewHints','xdg-open','.yml','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Updating\x20parent\x20segment\x20\x27','Coverage:','session','/\x20→\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','List\x20available\x20fields\x20for\x20segmentation','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Error:','SELECT\x20*\x20FROM\x20(\x0a','behaviorsFile','foreignKey','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Listing\x20fields\x20for\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','Pattern:\x20','Attribute:','Fetching\x20current\x20configuration\x20for\x20\x27','customerPercent','Site:\x20','segment:parent:pull','site','Columns:','Error:\x20--database\x20and\x20--table\x20are\x20required','/\x20and\x20','Available\x20attributes:','\x20parent\x20segment','workflowId','displayPreviewResults','columns','Error:\x20File\x20not\x20found:\x20','Listing\x20parent\x20segments...','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','localeCompare','status','segment:parent:list','Aborted.','number','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20Context\x20set:\x20','segment','5944TXCIuW','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','Source:','Enriched:','92656LywkZh','customerGroup','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','verbose','25394KAiHCH','unref','keys','attribute','Error\x20parsing\x20YAML:\x20','\x20No\x20changes\x20-\x20','addBehaviorsFile','Errors:','all','attributesFile','Fetching\x20SQL\x20for\x20\x27','Behaviors','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','-1d','double','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Name:\x20','To\x20cancel:','Updated','interval','parent_segments','\x0aChanges\x20to\x20apply\x20to\x20\x27','2915196rgxiVg','\x20tdx\x20wf\x20attempt\x20','Behavior:','displayValidateResults','workflowSessionId','✔\x20Renamed\x20directory\x20to\x20','error','allValid','validateParentYaml','\x20Configuration\x20is\x20valid','FINISHED','win32','trim','cyan','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','pushParentYaml','use','\x0a⚠️\x20\x20Migrating:\x20','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','pullParentYaml','Master\x20+\x20Attributes','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','/\x20directory.\x0a','12ndAdRY','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','Join\x20on:','Overwrite\x20\x27','setJobId','label','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Options\x20(one\x20required):','4842PzoNBq','name','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Creating\x20parent\x20segment\x20\x27','\x20--interval\x20','.yaml','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x0aNo\x20sample\x20data\x20available','errors','getParentSQL','start','segment:parent:desc','Show\x20parent\x20segment\x20schema\x20(column\x20types)','No\x20parent\x20segments\x20match\x20pattern:\x20','red','\x20rows\x20','\x20--attribute\x20\x22','\x20Opening\x20','displaySummary','attributes','log','👥\x20','\x20parent\x20segment\x20\x27','platform','addBehaviors','\x20--enriched','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','timezone','YAML\x20file:\x20','apply','Fetching\x20parent\x20segment\x20\x27','Attributes','16718801PkTYzj','dirname','column','\x20kill','21IlFZwJ','segment:parent:sql','✔\x20Found\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','parentSegment','/{name}.yml\x0a','darwin','segment:parent:create','test','\x27\x20is\x20already\x20up\x20to\x20date','addAttributesFile','/app/dw/parentSegments/','preview','message','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20No\x20sample\x20data\x20available','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Listing\x20parent\x20segments\x20matching\x20\x27','join','Creating','coveragePercent','displayAttributesStats','segment:parent:run','%)\x20','Show\x20parent\x20segment\x20details','bold','\x20=\x20','jsonl','Output\x20file:\x20','sampleData','createParent','utf-8','toFixed','toLocaleString','308268Zhrjyp','Parent\x20segment:\x20','map','runParent','Created','matchedCount','Updating','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','run','data','List\x20parent\x20segments','json','Master\x20Table','length','Join:','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','segment:parent:update','isDirectory','customersWithEvents','string','table','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20\x20\x20\x20-\x20','enriched','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Customers:','workflowAttemptId','SQL\x20query:\x0a','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','format','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','behaviors','\x27\x20with\x20ID:\x20','endsWith','Options:','\x20--behavior\x20\x22','✔\x20Created\x20parent\x20segment\x20\x27','✔\x20No\x20changes\x20-\x20\x27','sort','scheduleType','Error\x20reading\x20file:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','schemaValid','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','/app/workflows/','No\x20parent\x20segments\x20found','Database:\x20','yes','parent_segment','master','/\x20directories\x20exist.','To\x20view\x20sample\x20data:','Create\x20parent\x20segment\x20\x27','\x27...','behavior','22JeFONQ','stats','Attempt:','repeat','scheduleOption','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','execute','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Rows:','\x20field','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','joinKey','displayMasterInfo','segment:parent:fields','\x27\x20is\x20up\x20to\x20date','\x27\x20and\x20run\x20workflow?','displaySampleData','Found\x20YAML\x20file:\x20','customerGroupFile','\x20is\x20already\x20up\x20to\x20date','Events:','/attempt/','95osAXwo','stop','jobId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','match'];a27_0x1cb4=function(){return _0x560d4e;};return a27_0x1cb4();}import a27_0x8c2021 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a27_0x3f10(_0x5b4b09,_0x4d0752){_0x5b4b09=_0x5b4b09-0xac;const _0x1cb4ca=a27_0x1cb4();let _0x3f1069=_0x1cb4ca[_0x5b4b09];return _0x3f1069;}import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x479863 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0x3dec44(0xb9),LEGACY_PARENT_SEGMENT_DIR=a27_0x3dec44(0x152);function openBrowser(_0x4bcb75){const _0x1f1f94=a27_0x3dec44,_0x30b74d=process[_0x1f1f94(0xf2)],_0x255177=_0x30b74d===_0x1f1f94(0x105)?_0x1f1f94(0x188):_0x30b74d===_0x1f1f94(0xc6)?_0x1f1f94(0xe5):_0x1f1f94(0x199);spawn(_0x255177,[_0x4bcb75],{'detached':!![],'stdio':_0x1f1f94(0x17b)})[_0x1f1f94(0x1d0)]();}function sanitizeFileName(_0x33ec04){const _0x49138a=a27_0x3dec44;return _0x33ec04['toLowerCase']()[_0x49138a(0x184)](/[/\\:*?"<>|]/g,'-')[_0x49138a(0x184)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x49138a(0x184)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0x415d66=a27_0x3dec44;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2254a4=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2254a4[_0x415d66(0x133)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x415d66(0xc1)](a27_0x479863[_0x415d66(0x193)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x415d66(0x1b4)+PARENT_SEGMENT_DIR+_0x415d66(0x154))),console[_0x415d66(0xc1)](a27_0x479863[_0x415d66(0x187)](_0x415d66(0x13e)+LEGACY_PARENT_SEGMENT_DIR+_0x415d66(0xd1))),![];console[_0x415d66(0xc1)](a27_0x479863[_0x415d66(0x193)](_0x415d66(0xcc)+LEGACY_PARENT_SEGMENT_DIR+_0x415d66(0x1a0)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a27_0x479863['green'](_0x415d66(0xc0)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2c75a6){const _0x4142f3=_0x2c75a6 instanceof Error?_0x2c75a6[_0x415d66(0x10c)]:String(_0x2c75a6);return console[_0x415d66(0xc1)](a27_0x479863['red'](_0x415d66(0x1c3)+_0x4142f3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0x3dec44(0x12a)](_0x2b3438){const _0x571986=a27_0x3dec44;return migrateLegacyDirectory(),super[_0x571986(0x12a)](_0x2b3438);}}function resolveYamlFile(_0x31a928){const _0x24cecd=a27_0x3dec44;if(_0x31a928[_0x24cecd(0x143)]('.yml')||_0x31a928['endsWith'](_0x24cecd(0xdf)))return _0x31a928;return a27_0x8c2021[_0x24cecd(0x112)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x31a928)+_0x24cecd(0x19a));}function formatProgressMessage(_0x550b49){const _0x326f80=a27_0x3dec44,_0x343b99=_0x550b49[_0x326f80(0x173)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x343b99){const [,_0x1551b2,_0x3b2bca,_0x13c144='']=_0x343b99;return a27_0x479863[_0x326f80(0x187)](_0x1551b2+':')+'\x20'+_0x3b2bca+a27_0x479863[_0x326f80(0x187)](_0x13c144);}return a27_0x479863[_0x326f80(0x187)](_0x550b49);}function showFileNotFoundError(_0xfdb160,_0x40f6f8){const _0x4b4f4a=a27_0x3dec44;console[_0x4b4f4a(0xc1)](a27_0x479863['red'](_0x4b4f4a(0x1ba)+_0xfdb160+'\x0a')),console['error'](a27_0x479863[_0x4b4f4a(0xc8)](_0x4b4f4a(0xb4)+_0x40f6f8+'`\x20to\x20download\x20the\x20configuration\x20first'));}export class ParentSegmentListCommand extends BaseCommand{['name']=a27_0x3dec44(0x1bf);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x12c);async['execute'](_0x27e73e){const _0x1c5cb5=a27_0x3dec44,{options:_0x107256,args:_0x5c0eed,tdx:_0x1d1838}=_0x27e73e,_0x106e1c=_0x5c0eed[0x0];_0x107256[_0x1c5cb5(0x1ce)]&&(console['error'](_0x1c5cb5(0x1af)+_0x107256[_0x1c5cb5(0x1b1)]),_0x106e1c&&console[_0x1c5cb5(0xc1)](_0x1c5cb5(0x1ab)+_0x106e1c));const _0x55fb2d=await withSpinner(_0x106e1c?_0x1c5cb5(0x111)+_0x106e1c+'\x27...':_0x1c5cb5(0x1bb),()=>_0x1d1838[_0x1c5cb5(0x1c5)]['listParents'](),{'verbose':_0x107256['verbose']});let _0x303217=_0x55fb2d[_0x1c5cb5(0x12b)];if(_0x106e1c){const _0x351794=_0x106e1c[_0x1c5cb5(0x184)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1c5cb5(0x184)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2b0fd4=new RegExp('^'+_0x351794+'$','i');_0x303217=_0x303217['filter'](_0x2bd504=>_0x2b0fd4[_0x1c5cb5(0x107)](_0x2bd504[_0x1c5cb5(0xee)][_0x1c5cb5(0xdb)]));}_0x303217[_0x1c5cb5(0x148)]((_0x298ce9,_0x477225)=>_0x298ce9[_0x1c5cb5(0xee)][_0x1c5cb5(0xdb)][_0x1c5cb5(0x1bd)](_0x477225[_0x1c5cb5(0xee)][_0x1c5cb5(0xdb)])),console[_0x1c5cb5(0xc1)]('✔\x20Found\x20'+_0x303217['length']+_0x1c5cb5(0x1b6)+(_0x303217[_0x1c5cb5(0x12f)]!==0x1?'s':''));if(_0x107256[_0x1c5cb5(0x13f)]===_0x1c5cb5(0x12d)||_0x107256[_0x1c5cb5(0x13f)]===_0x1c5cb5(0x11b))await handleSDKOutput(_0x303217,_0x107256);else{if(_0x303217[_0x1c5cb5(0x12f)]===0x0)_0x106e1c?console['log'](_0x1c5cb5(0xe8)+_0x106e1c):console[_0x1c5cb5(0xef)](_0x1c5cb5(0x14f));else for(const _0xf78dca of _0x303217){const _0x35863e=_0xf78dca[_0x1c5cb5(0xee)][_0x1c5cb5(0x18f)]?a27_0x479863[_0x1c5cb5(0x187)]('\x20('+formatRows(_0xf78dca[_0x1c5cb5(0xee)][_0x1c5cb5(0x18f)])+')'):'';console[_0x1c5cb5(0xef)](_0x1c5cb5(0xf0)+_0xf78dca[_0x1c5cb5(0xee)][_0x1c5cb5(0xdb)]+_0x35863e);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a27_0x3dec44(0x106);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x129);async[a27_0x3dec44(0x15f)](_0x5e52a2){const _0x49787e=a27_0x3dec44,{options:_0x4844c2,args:_0x557130,tdx:_0xf6ae27}=_0x5e52a2;console[_0x49787e(0xc1)](_0x49787e(0x19b)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x49787e(0x140));const _0xcfd01d=_0x4844c2;if(_0x557130[_0x49787e(0x12f)]===0x0)return console[_0x49787e(0xc1)](_0x49787e(0x10e)),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x1d3f19=_0x557130[0x0];if(!_0xcfd01d[_0x49787e(0x17e)]||!_0xcfd01d[_0x49787e(0x136)])return console[_0x49787e(0xc1)](_0x49787e(0x1b3)),console[_0x49787e(0xc1)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0xcfd01d['verbose']&&(console[_0x49787e(0xc1)](_0x49787e(0x1af)+_0xcfd01d[_0x49787e(0x1b1)]),console['error'](_0x49787e(0xb5)+_0x1d3f19),console[_0x49787e(0xc1)](_0x49787e(0x150)+_0xcfd01d[_0x49787e(0x17e)]),console[_0x49787e(0xc1)]('Table:\x20'+_0xcfd01d['table']));const _0x488227=await loadJSONFromOptions(_0xcfd01d[_0x49787e(0xee)],_0xcfd01d[_0x49787e(0xae)]),_0x1044e8=await loadJSONFromOptions(_0xcfd01d[_0x49787e(0x141)],_0xcfd01d[_0x49787e(0x1a6)]),_0x432768=await loadJSONFromOptions(_0xcfd01d[_0x49787e(0x1cb)],_0xcfd01d[_0x49787e(0x16b)]),_0x3a3bfa={'name':_0x1d3f19,'description':_0xcfd01d['description'],'scheduleType':_0xcfd01d[_0x49787e(0x149)],'scheduleOption':_0xcfd01d[_0x49787e(0x15d)],'timezone':_0xcfd01d[_0x49787e(0xf6)],'master':{'parentDatabaseName':_0xcfd01d['database'],'parentTableName':_0xcfd01d[_0x49787e(0x136)]},'attributes':_0x488227,'behaviors':_0x1044e8,'customerGroup':_0x432768},_0xdfa8ae=await withSpinner(_0x49787e(0xdd)+_0x1d3f19+_0x49787e(0x157),()=>_0xf6ae27['segment'][_0x49787e(0x11e)](_0x3a3bfa),{'verbose':_0x4844c2['verbose']}),_0x1abec0=_0xdfa8ae[_0x49787e(0x12b)];return console[_0x49787e(0xc1)](_0x49787e(0x146)+_0x1abec0[_0x49787e(0xdb)]+_0x49787e(0x142)+_0x1abec0['id']),await handleSDKOutput([_0x1abec0],_0x4844c2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0x132);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x194);async['execute'](_0x3d586d){const _0x3756be=a27_0x3dec44,{options:_0x186d67,args:_0x439c66,tdx:_0x464090}=_0x3d586d;console[_0x3756be(0xc1)](_0x3756be(0xdc)+_0x3756be(0x137)+_0x3756be(0x140));const _0x39d776=_0x186d67;if(_0x439c66[_0x3756be(0x12f)]===0x0)return console[_0x3756be(0xc1)](_0x3756be(0x10e)),console[_0x3756be(0xc1)](_0x3756be(0x14d)),0x1;const _0x67556=_0x439c66[0x0];_0x39d776[_0x3756be(0x1ce)]&&(console[_0x3756be(0xc1)](_0x3756be(0x1af)+_0x39d776['site']),console[_0x3756be(0xc1)](_0x3756be(0x123)+_0x67556));const _0x51fb20=await withSpinner(_0x3756be(0x1ad)+_0x67556+_0x3756be(0x157),()=>_0x464090[_0x3756be(0x1c5)][_0x3756be(0x176)](_0x67556),{'verbose':_0x39d776[_0x3756be(0x1ce)]}),_0xde4104=_0x51fb20['data'],_0x5d2f2a=await loadJSONFromOptions(_0x39d776['addAttributes'],_0x39d776[_0x3756be(0x109)]),_0x312efb=await loadJSONFromOptions(_0x39d776[_0x3756be(0xf3)],_0x39d776[_0x3756be(0x1d5)]),_0x7ec622={'name':_0xde4104[_0x3756be(0xdb)],'description':_0x39d776[_0x3756be(0x17a)]!==undefined?_0x39d776[_0x3756be(0x17a)]:_0xde4104[_0x3756be(0x17a)],'scheduleType':_0x39d776[_0x3756be(0x149)]!==undefined?_0x39d776[_0x3756be(0x149)]:_0xde4104[_0x3756be(0x149)],'scheduleOption':_0x39d776[_0x3756be(0x15d)]!==undefined?_0x39d776['scheduleOption']:_0xde4104[_0x3756be(0x15d)],'timezone':_0x39d776[_0x3756be(0xf6)]!==undefined?_0x39d776[_0x3756be(0xf6)]:_0xde4104[_0x3756be(0xf6)],'master':_0xde4104[_0x3756be(0x153)],'attributes':_0x5d2f2a?[..._0xde4104[_0x3756be(0xee)]||[],..._0x5d2f2a]:_0xde4104[_0x3756be(0xee)],'behaviors':_0x312efb?[..._0xde4104[_0x3756be(0x141)]||[],..._0x312efb]:_0xde4104[_0x3756be(0x141)],'customerGroup':_0xde4104['customerGroup']},_0x5937ad=await withSpinner(_0x3756be(0x19d)+_0x67556+_0x3756be(0x157),()=>_0x464090[_0x3756be(0x1c5)][_0x3756be(0x186)](_0x67556,_0x7ec622),{'verbose':_0x39d776[_0x3756be(0x1ce)]}),_0x57d898=_0x5937ad[_0x3756be(0x12b)];return console[_0x3756be(0xc1)](_0x3756be(0x1cc)+_0x57d898[_0x3756be(0xdb)]+'\x27'),await handleSDKOutput([_0x57d898],_0x39d776),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0x1b0);[a27_0x3dec44(0x17a)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a27_0x3dec44(0x15f)](_0x31342c){const _0x519253=a27_0x3dec44,{options:_0x443f48,args:_0x2c39d2,tdx:_0x16a97a}=_0x31342c,_0xb6c4cf=_0x443f48,_0xb95bfc=_0x2c39d2[0x0]||_0x443f48[_0x519253(0x103)];if(!_0xb95bfc)return console[_0x519253(0xc1)](a27_0x479863[_0x519253(0xe9)](_0x519253(0x1aa))),console[_0x519253(0xc1)]('Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a'),console[_0x519253(0xc1)](a27_0x479863[_0x519253(0xc8)](_0x519253(0xe0))),0x1;if(_0xb6c4cf[_0x519253(0xcb)]&&_0xb6c4cf[_0x519253(0x174)])return console[_0x519253(0xc1)](a27_0x479863[_0x519253(0xe9)](_0x519253(0x102))),console[_0x519253(0xc1)](a27_0x479863['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x519253(0xc1)](a27_0x479863['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x519253(0x104))),console[_0x519253(0xc1)](a27_0x479863[_0x519253(0xc8)](_0x519253(0x10d))),0x1;const _0x1ca2e8=_0xb6c4cf[_0x519253(0x174)]||a27_0x8c2021[_0x519253(0x112)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xb95bfc)+_0x519253(0x19a));_0xb6c4cf[_0x519253(0x1ce)]&&(console[_0x519253(0xc1)](_0x519253(0x1af)+_0xb6c4cf[_0x519253(0x1b1)]),console[_0x519253(0xc1)](_0x519253(0x123)+_0xb95bfc),console[_0x519253(0xc1)](_0x519253(0x11c)+_0x1ca2e8));const _0x4229ec=await withSpinner(_0x519253(0xf9)+_0xb95bfc+_0x519253(0x157),()=>_0x16a97a[_0x519253(0x1c5)][_0x519253(0xce)](_0xb95bfc),{'verbose':_0xb6c4cf[_0x519253(0x1ce)]}),_0x34bd50=_0x4229ec[_0x519253(0x12b)];if(existsSync(_0x1ca2e8)){const _0x274a5b=readFileSync(_0x1ca2e8,_0x519253(0x11f)),_0xd612f3=generateDiff(_0x274a5b,_0x34bd50);if(!hasChanges(_0xd612f3))console['error'](a27_0x479863[_0x519253(0x18a)]('✔')+_0x519253(0x1d4)+a27_0x479863['cyan'](_0x1ca2e8)+_0x519253(0x16c));else{console[_0x519253(0xc1)](_0x519253(0x175)+_0x1ca2e8+'\x27:'),console[_0x519253(0xc1)]('─'[_0x519253(0x15c)](0x3c)),console[_0x519253(0xc1)](formatDiffWithColors(_0xd612f3)),console[_0x519253(0xc1)]('─'[_0x519253(0x15c)](0x3c));if(!_0xb6c4cf['yes']){const _0xf37026=await confirmKey(_0x519253(0xd5)+_0x1ca2e8+'\x27?');if(!_0xf37026)return console['error'](_0x519253(0x1c0)),0x1;}writeFileSync(_0x1ca2e8,_0x34bd50,_0x519253(0x11f)),console[_0x519253(0xc1)](a27_0x479863[_0x519253(0x18a)]('✔')+_0x519253(0xe1)+a27_0x479863[_0x519253(0xc8)](_0x1ca2e8));}}else{const _0x156e7b=a27_0x8c2021[_0x519253(0xfc)](_0x1ca2e8);!existsSync(_0x156e7b)&&mkdirSync(_0x156e7b,{'recursive':!![]}),writeFileSync(_0x1ca2e8,_0x34bd50,_0x519253(0x11f)),console[_0x519253(0xc1)](a27_0x479863[_0x519253(0x18a)]('✔')+_0x519253(0xe1)+a27_0x479863[_0x519253(0xc8)](_0x1ca2e8));}return saveSessionContext({'parent_segment':_0xb95bfc},_0xb6c4cf[_0x519253(0x19f)]),console[_0x519253(0xc1)](a27_0x479863[_0x519253(0x18a)]('✔')+_0x519253(0x1c4)+a27_0x479863[_0x519253(0x187)](_0x519253(0x152))+_0x519253(0x11a)+a27_0x479863[_0x519253(0xc8)](_0xb95bfc)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0x177);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x1a3);async['execute'](_0x1561a9){const _0x5d27c5=a27_0x3dec44,{options:_0x82ad8d,args:_0x2a56b9,tdx:_0x4f415e}=_0x1561a9,_0x5787a8=_0x82ad8d,_0x387817=_0x2a56b9[0x0]||_0x82ad8d[_0x5d27c5(0x103)];if(!_0x387817)return console[_0x5d27c5(0xc1)](a27_0x479863['red'](_0x5d27c5(0x1aa))),console[_0x5d27c5(0xc1)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x5d27c5(0xc1)](a27_0x479863[_0x5d27c5(0xc8)](_0x5d27c5(0x1c7))),0x1;const _0x29cfe5=resolveYamlFile(_0x387817);if(!existsSync(_0x29cfe5))return showFileNotFoundError(_0x29cfe5,_0x387817),0x1;_0x5787a8['verbose']&&(console[_0x5d27c5(0xc1)](_0x5d27c5(0x1af)+_0x5787a8['site']),console[_0x5d27c5(0xc1)](_0x5d27c5(0xf7)+_0x29cfe5));let _0x5e8677;try{_0x5e8677=readFileSync(_0x29cfe5,_0x5d27c5(0x11f));}catch(_0xbda52c){const _0x6e8c58=_0xbda52c instanceof Error?_0xbda52c['message']:String(_0xbda52c);return console['error'](_0x5d27c5(0x14a)+_0x6e8c58),0x1;}const _0x4422d0=await withSpinner(_0x5d27c5(0x18e),()=>_0x4f415e[_0x5d27c5(0x1c5)][_0x5d27c5(0xca)](_0x5e8677),{'verbose':_0x5787a8[_0x5d27c5(0x1ce)]}),_0x15fad9=_0x4422d0[_0x5d27c5(0x12b)],{isNew:_0x51ce5c,name:_0x68d44,hasChanges:_0x300c54,diffFormatted:_0x549844}=_0x15fad9;if(!_0x300c54)return console[_0x5d27c5(0xc1)](_0x5d27c5(0x147)+_0x68d44+_0x5d27c5(0x108)),0x0;_0x51ce5c?console[_0x5d27c5(0xc1)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x68d44+'\x27:'):console[_0x5d27c5(0xc1)](_0x5d27c5(0xba)+_0x68d44+'\x27:');console[_0x5d27c5(0xc1)]('─'[_0x5d27c5(0x15c)](0x3c)),console[_0x5d27c5(0xc1)](_0x549844),console[_0x5d27c5(0xc1)]('─'[_0x5d27c5(0x15c)](0x3c));const _0x20c6c8=_0x51ce5c?_0x5d27c5(0x156)+_0x68d44+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x68d44+'\x27?';if(!_0x5787a8[_0x5d27c5(0x151)]){const _0x4545fa=await confirmKey(_0x20c6c8);if(!_0x4545fa)return console[_0x5d27c5(0xc1)](_0x5d27c5(0x1c0)),0x1;}const _0x4b884a=_0x51ce5c?_0x5d27c5(0x113):_0x5d27c5(0x128),_0x3c8675=await withSpinner(_0x4b884a+_0x5d27c5(0xf1)+_0x68d44+_0x5d27c5(0x157),()=>_0x15fad9[_0x5d27c5(0xf8)](),{'verbose':_0x5787a8[_0x5d27c5(0x1ce)]}),_0x28c2ce=_0x3c8675['data'],_0x46cd2e=getConsoleNextUrl(_0x5787a8[_0x5d27c5(0x1b1)],'/app/dw/parentSegments/'+_0x28c2ce['id']),_0x41026c=_0x51ce5c?_0x5d27c5(0x126):'Updated';return console[_0x5d27c5(0xc1)]('✔\x20'+_0x41026c+_0x5d27c5(0xf1)+_0x28c2ce[_0x5d27c5(0xdb)]+'\x27'),console['error']('\x20\x20'+_0x46cd2e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a27_0x3dec44(0xdb)]='segment:parent:validate';[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x1a8);async['execute'](_0x4d6d50){const _0x524265=a27_0x3dec44,{options:_0x23ccc0,args:_0x10ed48,tdx:_0x24819d}=_0x4d6d50,_0x1beb8f=_0x23ccc0,_0x330dde=_0x10ed48[0x0]||_0x23ccc0[_0x524265(0x103)];if(!_0x330dde)return console['error'](a27_0x479863[_0x524265(0xe9)](_0x524265(0x1aa))),console[_0x524265(0xc1)](_0x524265(0xc9)),console[_0x524265(0xc1)](_0x524265(0x144)),console[_0x524265(0xc1)](_0x524265(0x1c2)),console[_0x524265(0xc1)](_0x524265(0x181)),console[_0x524265(0xc1)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console[_0x524265(0xc1)](a27_0x479863[_0x524265(0xc8)](_0x524265(0x110))),0x1;const _0x599e30=resolveYamlFile(_0x330dde);if(!existsSync(_0x599e30))return showFileNotFoundError(_0x599e30,_0x330dde),0x1;_0x1beb8f['verbose']&&(console[_0x524265(0xc1)](_0x524265(0x1af)+_0x1beb8f[_0x524265(0x1b1)]),console[_0x524265(0xc1)]('YAML\x20file:\x20'+_0x599e30));let _0x55ab29;try{_0x55ab29=readFileSync(_0x599e30,_0x524265(0x11f));}catch(_0x2da308){const _0x1d2ff1=_0x2da308 instanceof Error?_0x2da308[_0x524265(0x10c)]:String(_0x2da308);return console['error']('Error\x20reading\x20file:\x20'+_0x1d2ff1),0x1;}const _0x335e5c=createCommandSpinner(a27_0x479863[_0x524265(0x187)]('Validating\x20configuration...'),{'verbose':_0x1beb8f[_0x524265(0x1ce)]});_0x335e5c[_0x524265(0xe5)]();const _0x1c3d80={'onProgress':_0x1629cb=>{_0x335e5c['text']=formatProgressMessage(_0x1629cb);}};if(_0x1beb8f[_0x524265(0x153)])_0x1c3d80[_0x524265(0x153)]=!![];if(_0x1beb8f[_0x524265(0x139)])_0x1c3d80['enriched']=!![];_0x1beb8f[_0x524265(0x1d2)]&&(_0x1c3d80[_0x524265(0x1d2)]=_0x1beb8f[_0x524265(0x1d2)]);_0x1beb8f[_0x524265(0x158)]&&(_0x1c3d80['behavior']=_0x1beb8f[_0x524265(0x158)]);if(_0x1beb8f[_0x524265(0xb8)])_0x1c3d80[_0x524265(0xb8)]=_0x1beb8f[_0x524265(0xb8)];let _0x5995ab;try{_0x5995ab=await _0x24819d[_0x524265(0x1c5)][_0x524265(0xc3)](_0x55ab29,_0x1c3d80),_0x335e5c[_0x524265(0x170)]();}catch(_0x3ed43e){_0x335e5c[_0x524265(0x170)]();throw _0x3ed43e;}const _0x1c3d13=_0x1beb8f[_0x524265(0xb8)]||_0x524265(0xb2);return this[_0x524265(0xbe)](_0x5995ab,_0x1c3d80,_0x599e30,_0x1c3d13),_0x5995ab[_0x524265(0xc2)]?0x0:0x1;}[a27_0x3dec44(0xbe)](_0x53f606,_0x29b6d6,_0x5c996c,_0xb0a291){const _0x1886a9=a27_0x3dec44;console[_0x1886a9(0xc1)]('\x0a'+a27_0x479863[_0x1886a9(0x119)]('Validate:')+'\x20'+_0x53f606[_0x1886a9(0xdb)]),console[_0x1886a9(0xc1)]('═'[_0x1886a9(0x15c)](0x3c)),this[_0x1886a9(0x165)](_0x53f606);if(typeof _0x29b6d6[_0x1886a9(0x1d2)]===_0x1886a9(0x135)){this[_0x1886a9(0x115)](_0x53f606),this[_0x1886a9(0xed)](_0x53f606),this[_0x1886a9(0x198)](_0x5c996c,_0xb0a291,_0x1886a9(0x1d2),_0x29b6d6[_0x1886a9(0x1d2)]);return;}if(_0x29b6d6['attribute']===!![]){this[_0x1886a9(0x115)](_0x53f606),this['displaySummary'](_0x53f606),this[_0x1886a9(0x198)](_0x5c996c,_0xb0a291,_0x1886a9(0xee));return;}if(typeof _0x29b6d6[_0x1886a9(0x158)]===_0x1886a9(0x135)){this['displayBehaviorsStats'](_0x53f606,_0xb0a291),this[_0x1886a9(0xed)](_0x53f606),this[_0x1886a9(0x198)](_0x5c996c,_0xb0a291,_0x1886a9(0x158),_0x29b6d6[_0x1886a9(0x158)]);return;}if(_0x29b6d6[_0x1886a9(0x158)]===!![]){this[_0x1886a9(0x192)](_0x53f606,_0xb0a291),this[_0x1886a9(0xed)](_0x53f606),this[_0x1886a9(0x198)](_0x5c996c,_0xb0a291,_0x1886a9(0x141));return;}this[_0x1886a9(0x115)](_0x53f606),this[_0x1886a9(0x192)](_0x53f606,_0xb0a291),this[_0x1886a9(0xed)](_0x53f606),this[_0x1886a9(0x198)](_0x5c996c,_0xb0a291,_0x1886a9(0xad));}[a27_0x3dec44(0x198)](_0xb64aaf,_0x350d06,_0x96c967,_0x1b4637){const _0x3b9285=a27_0x3dec44;console[_0x3b9285(0xc1)]('\x0a'+a27_0x479863['dim'](_0x3b9285(0x155)));const _0x43c762=_0x350d06!==_0x3b9285(0xb2)?_0x3b9285(0xde)+_0x350d06:'';if(_0x96c967===_0x3b9285(0x1d2)&&_0x1b4637)console[_0x3b9285(0xc1)]('\x20\x20'+a27_0x479863[_0x3b9285(0x187)](_0x3b9285(0x178)+_0xb64aaf+'\x20--attribute\x20\x22'+_0x1b4637+'\x22'+_0x43c762));else{if(_0x96c967===_0x3b9285(0x158)&&_0x1b4637)console[_0x3b9285(0xc1)]('\x20\x20'+a27_0x479863[_0x3b9285(0x187)](_0x3b9285(0x178)+_0xb64aaf+_0x3b9285(0x145)+_0x1b4637+'\x22'+_0x43c762));else(_0x96c967==='attributes'||_0x96c967===_0x3b9285(0xad))&&console[_0x3b9285(0xc1)]('\x20\x20'+a27_0x479863[_0x3b9285(0x187)](_0x3b9285(0x178)+_0xb64aaf+_0x3b9285(0x17f)+_0x43c762));}(_0x96c967==='behaviors'||_0x96c967===_0x3b9285(0xad))&&console['error']('\x20\x20'+a27_0x479863[_0x3b9285(0x187)](_0x3b9285(0x178)+_0xb64aaf+'\x20--behavior\x20\x22<name>\x22'+_0x43c762)),_0x96c967===_0x3b9285(0xad)&&console[_0x3b9285(0xc1)]('\x20\x20'+a27_0x479863[_0x3b9285(0x187)](_0x3b9285(0x178)+_0xb64aaf+_0x3b9285(0xf4)+_0x43c762));}['displayMasterInfo'](_0x159844){const _0x364b24=a27_0x3dec44,{master:_0x2717ec}=_0x159844,_0x3e0360=_0x2717ec['schemaValid']?a27_0x479863[_0x364b24(0x18a)]('✔'):a27_0x479863[_0x364b24(0xe9)]('✘');console[_0x364b24(0xc1)]('\x0a'+a27_0x479863[_0x364b24(0x187)](_0x364b24(0x12e))),console[_0x364b24(0xc1)](_0x3e0360+'\x20'+a27_0x479863[_0x364b24(0x119)](_0x2717ec[_0x364b24(0x17e)]+'.'+_0x2717ec[_0x364b24(0x136)])),_0x2717ec['schemaValid']?_0x2717ec['rowCount']!==undefined&&console[_0x364b24(0xc1)]('\x20\x20'+a27_0x479863[_0x364b24(0x187)](_0x364b24(0x161))+'\x20'+a27_0x479863['cyan'](formatRows(_0x2717ec['rowCount']))):console[_0x364b24(0xc1)]('\x20\x20'+a27_0x479863[_0x364b24(0xe9)](_0x364b24(0x1a4))+'\x20'+_0x2717ec['schemaError']);}[a27_0x3dec44(0x115)](_0x5c4be5){const _0x520743=a27_0x3dec44;if(_0x5c4be5[_0x520743(0xee)][_0x520743(0x12f)]===0x0)return;console[_0x520743(0xc1)]('\x0a'+a27_0x479863[_0x520743(0x187)](_0x520743(0xfa)));for(const _0x395b3d of _0x5c4be5[_0x520743(0xee)]){const _0x417dd3=_0x395b3d[_0x520743(0x14c)]?a27_0x479863[_0x520743(0x18a)]('✔'):a27_0x479863['red']('✘');let _0x2c5312='';if(_0x395b3d['schemaValid']&&_0x395b3d[_0x520743(0x127)]!==undefined&&_0x395b3d[_0x520743(0x114)]!==undefined){const _0x3e2cda=_0x395b3d[_0x520743(0x114)][_0x520743(0x120)](0x1),_0x5a577d=_0x395b3d[_0x520743(0x114)]>=0x50?a27_0x479863[_0x520743(0x18a)]:_0x395b3d[_0x520743(0x114)]>=0x32?a27_0x479863[_0x520743(0x193)]:a27_0x479863[_0x520743(0xe9)];_0x2c5312='\x20'+a27_0x479863['dim'](_0x520743(0x19e))+'\x20'+_0x5a577d(_0x3e2cda+'%')+'\x20('+formatRows(_0x395b3d[_0x520743(0x127)])+'\x20rows)';}console[_0x520743(0xc1)](_0x417dd3+'\x20'+a27_0x479863[_0x520743(0x119)](_0x395b3d[_0x520743(0xdb)])+_0x2c5312),console['error']('\x20\x20'+a27_0x479863[_0x520743(0x187)](_0x520743(0x1c8))+'\x20'+a27_0x479863['bold'](_0x395b3d[_0x520743(0x17e)]+'.'+_0x395b3d[_0x520743(0x136)]));const _0x33c318=_0x395b3d[_0x520743(0x164)]===_0x395b3d[_0x520743(0x1a7)]?a27_0x479863[_0x520743(0x187)](_0x520743(0xd4))+'\x20'+_0x395b3d[_0x520743(0x164)]:a27_0x479863['dim'](_0x520743(0x130))+'\x20'+_0x395b3d[_0x520743(0x164)]+_0x520743(0x11a)+_0x395b3d['foreignKey'];console[_0x520743(0xc1)]('\x20\x20'+_0x33c318),console[_0x520743(0xc1)]('\x20\x20'+a27_0x479863[_0x520743(0x187)]('Columns:')),this[_0x520743(0x195)](_0x395b3d[_0x520743(0x1b9)]),!_0x395b3d[_0x520743(0x14c)]&&console[_0x520743(0xc1)]('\x20\x20'+a27_0x479863[_0x520743(0xe9)](_0x520743(0x1a4))+'\x20'+_0x395b3d['schemaError']);}}['displayBehaviorsStats'](_0x3786aa,_0x5f2936){const _0x40f0b6=a27_0x3dec44;if(_0x3786aa[_0x40f0b6(0x141)][_0x40f0b6(0x12f)]===0x0)return;console['error']('\x0a'+a27_0x479863['dim'](_0x40f0b6(0xb0))+'\x20'+a27_0x479863['dim']('('+_0x5f2936+')'));for(const _0xf85a23 of _0x3786aa['behaviors']){const _0x395b7d=_0xf85a23[_0x40f0b6(0x14c)]?a27_0x479863['green']('✔'):a27_0x479863[_0x40f0b6(0xe9)]('✘');let _0x4178aa='';if(_0xf85a23[_0x40f0b6(0x14c)]&&_0xf85a23[_0x40f0b6(0x134)]!==undefined&&_0xf85a23['totalEvents']!==undefined){const _0x56e26a=_0xf85a23[_0x40f0b6(0x1ae)]?.[_0x40f0b6(0x120)](0x1)||'?',_0x5882e8=(_0xf85a23[_0x40f0b6(0x1ae)]??0x0)>=0x32?a27_0x479863[_0x40f0b6(0x18a)]:(_0xf85a23['customerPercent']??0x0)>=0x14?a27_0x479863['yellow']:a27_0x479863[_0x40f0b6(0xe9)];_0x4178aa='\x20'+a27_0x479863[_0x40f0b6(0x187)](_0x40f0b6(0x13b))+'\x20'+_0x5882e8(formatRows(_0xf85a23['customersWithEvents']))+'\x20('+_0x56e26a+_0x40f0b6(0x117)+a27_0x479863[_0x40f0b6(0x187)](_0x40f0b6(0x16d))+'\x20'+a27_0x479863[_0x40f0b6(0xc8)](formatRows(_0xf85a23[_0x40f0b6(0x189)]));}console[_0x40f0b6(0xc1)](_0x395b7d+'\x20'+a27_0x479863[_0x40f0b6(0x119)](_0xf85a23['name'])+_0x4178aa),console[_0x40f0b6(0xc1)]('\x20\x20'+a27_0x479863['dim'](_0x40f0b6(0x1c8))+'\x20'+a27_0x479863['bold'](_0xf85a23[_0x40f0b6(0x17e)]+'.'+_0xf85a23[_0x40f0b6(0x136)]));const _0x4c87cf=_0xf85a23[_0x40f0b6(0x164)]===_0xf85a23[_0x40f0b6(0x1a7)]?a27_0x479863['dim'](_0x40f0b6(0xd4))+'\x20'+_0xf85a23[_0x40f0b6(0x164)]:a27_0x479863['dim'](_0x40f0b6(0x130))+'\x20'+_0xf85a23[_0x40f0b6(0x164)]+_0x40f0b6(0x11a)+_0xf85a23['foreignKey'];console['error']('\x20\x20'+_0x4c87cf),console[_0x40f0b6(0xc1)]('\x20\x20'+a27_0x479863[_0x40f0b6(0x187)](_0x40f0b6(0x1b2))),this['displayColumns'](_0xf85a23[_0x40f0b6(0x1b9)]),!_0xf85a23[_0x40f0b6(0x14c)]&&console[_0x40f0b6(0xc1)]('\x20\x20'+a27_0x479863[_0x40f0b6(0xe9)](_0x40f0b6(0x1a4))+'\x20'+_0xf85a23['schemaError']);}}[a27_0x3dec44(0x195)](_0x152d7c){const _0x1aad68=a27_0x3dec44;for(const _0x3ee193 of _0x152d7c){_0x3ee193[_0x1aad68(0xd7)]===_0x3ee193[_0x1aad68(0xfd)]||_0x3ee193[_0x1aad68(0xfd)]==='*'?console[_0x1aad68(0xc1)](_0x1aad68(0x138)+_0x3ee193[_0x1aad68(0xd7)]):console['error'](_0x1aad68(0x138)+_0x3ee193[_0x1aad68(0xd7)]+'\x20'+a27_0x479863[_0x1aad68(0x187)]('('+_0x3ee193[_0x1aad68(0xfd)]+')'));}}[a27_0x3dec44(0xed)](_0x497b65){const _0x5827dd=a27_0x3dec44;console['error']('─'[_0x5827dd(0x15c)](0x3c));if(_0x497b65[_0x5827dd(0xe3)][_0x5827dd(0x12f)]>0x0){console['error']('\x0a'+a27_0x479863[_0x5827dd(0xe9)](_0x5827dd(0xac)));for(const _0x2974e0 of _0x497b65[_0x5827dd(0xe3)]){console[_0x5827dd(0xc1)]('\x20\x20'+a27_0x479863[_0x5827dd(0xe9)]('•')+'\x20'+_0x2974e0);}}_0x497b65[_0x5827dd(0xc2)]&&console['error']('\x0a'+a27_0x479863[_0x5827dd(0x18a)]('✔')+_0x5827dd(0xc4));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0x3dec44(0xdb)]='segment:parent:preview';[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x13a);async['execute'](_0x2d154c){const _0x145871=a27_0x3dec44,{options:_0x83ba24,args:_0x5d2b11,tdx:_0x138ab7}=_0x2d154c,_0x149133=_0x83ba24,_0x4f9d60=_0x5d2b11[0x0]||_0x83ba24[_0x145871(0x103)];if(!_0x4f9d60)return console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)](_0x145871(0x1aa))),console[_0x145871(0xc1)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x145871(0xc1)](_0x145871(0xd9)),console[_0x145871(0xc1)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x145871(0xc1)](_0x145871(0x1cd)),console['error'](_0x145871(0x172)),console[_0x145871(0xc1)](_0x145871(0x15e)),console[_0x145871(0xc1)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console[_0x145871(0xc1)](a27_0x479863['cyan'](_0x145871(0x110))),0x1;if(!_0x149133[_0x145871(0x153)]&&!_0x149133[_0x145871(0x1d2)]&&!_0x149133[_0x145871(0x158)]&&!_0x149133[_0x145871(0x139)])return console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)](_0x145871(0xcd))),console[_0x145871(0xc1)](_0x145871(0x190)),console[_0x145871(0xc1)](_0x145871(0x144)),console[_0x145871(0xc1)](_0x145871(0x1a1)),console['error'](_0x145871(0x1cd)),console[_0x145871(0xc1)](_0x145871(0x172)),console[_0x145871(0xc1)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x4dc9c4=resolveYamlFile(_0x4f9d60);if(!existsSync(_0x4dc9c4))return showFileNotFoundError(_0x4dc9c4,_0x4f9d60),0x1;_0x149133['verbose']&&(console[_0x145871(0xc1)](_0x145871(0x1af)+_0x149133[_0x145871(0x1b1)]),console[_0x145871(0xc1)](_0x145871(0xf7)+_0x4dc9c4));let _0x1de1a9;try{_0x1de1a9=readFileSync(_0x4dc9c4,_0x145871(0x11f));}catch(_0x4079c2){const _0x3be910=_0x4079c2 instanceof Error?_0x4079c2[_0x145871(0x10c)]:String(_0x4079c2);return console[_0x145871(0xc1)](_0x145871(0x14a)+_0x3be910),0x1;}let _0x463c9d;try{_0x463c9d=parseYamlString(_0x1de1a9);}catch(_0x511729){const _0x1b1a95=_0x511729 instanceof Error?_0x511729[_0x145871(0x10c)]:String(_0x511729);return console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)](_0x145871(0x1d3)+_0x1b1a95)),0x1;}if(_0x149133[_0x145871(0x1d2)]===!![]||_0x149133[_0x145871(0x1d2)]===''){const _0x52a49a=_0x463c9d[_0x145871(0xee)]?.[_0x145871(0x124)](_0x1a6831=>_0x1a6831[_0x145871(0xdb)])||[];if(_0x52a49a[_0x145871(0x12f)]===0x0)console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)](_0x145871(0xd8)));else{console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)](_0x145871(0x19c))),console[_0x145871(0xc1)](_0x145871(0x1b5));for(const _0x1d305a of _0x52a49a){console['error']('\x20\x20'+a27_0x479863[_0x145871(0xc8)](_0x1d305a));}console[_0x145871(0xc1)](_0x145871(0x160)+_0x4f9d60+_0x145871(0xeb)+_0x52a49a[0x0]+'\x22');}return 0x1;}if(_0x149133[_0x145871(0x158)]===!![]||_0x149133[_0x145871(0x158)]===''){const _0x41df0b=_0x463c9d[_0x145871(0x141)]?.['map'](_0x5f193b=>_0x5f193b[_0x145871(0xdb)])||[];if(_0x41df0b[_0x145871(0x12f)]===0x0)console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)](_0x145871(0xd0)));else{console[_0x145871(0xc1)](a27_0x479863[_0x145871(0xe9)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x145871(0xc1)](_0x145871(0x185));for(const _0x3541e5 of _0x41df0b){console[_0x145871(0xc1)]('\x20\x20'+a27_0x479863[_0x145871(0xc8)](_0x3541e5));}console[_0x145871(0xc1)](_0x145871(0x160)+_0x4f9d60+_0x145871(0x145)+_0x41df0b[0x0]+'\x22');}return 0x1;}const _0x1ea4f1=createCommandSpinner(a27_0x479863[_0x145871(0x187)]('Fetching\x20sample\x20data...'),{'verbose':_0x149133[_0x145871(0x1ce)]});_0x1ea4f1[_0x145871(0xe5)]();const _0x4a3a59={'onProgress':_0x226120=>{const _0x5742bd=_0x145871;_0x1ea4f1[_0x5742bd(0x196)]=formatProgressMessage(_0x226120);}};if(_0x149133['master'])_0x4a3a59['master']=!![];if(_0x149133[_0x145871(0x1d2)]&&typeof _0x149133['attribute']===_0x145871(0x135))_0x4a3a59['attribute']=_0x149133[_0x145871(0x1d2)];if(_0x149133[_0x145871(0x158)]&&typeof _0x149133[_0x145871(0x158)]===_0x145871(0x135))_0x4a3a59['behavior']=_0x149133[_0x145871(0x158)];if(_0x149133[_0x145871(0x139)])_0x4a3a59[_0x145871(0x139)]=!![];if(_0x149133[_0x145871(0xb8)])_0x4a3a59[_0x145871(0xb8)]=_0x149133[_0x145871(0xb8)];let _0x1c0bd1;try{_0x1c0bd1=await _0x138ab7[_0x145871(0x1c5)]['previewParentYaml'](_0x1de1a9,_0x4a3a59),_0x1ea4f1[_0x145871(0x170)]();}catch(_0x49a004){_0x1ea4f1[_0x145871(0x170)]();throw _0x49a004;}return await this[_0x145871(0x1b8)](_0x1c0bd1,{'master':_0x149133[_0x145871(0x153)],'attribute':typeof _0x149133[_0x145871(0x1d2)]===_0x145871(0x135)?_0x149133[_0x145871(0x1d2)]:undefined,'behavior':typeof _0x149133['behavior']===_0x145871(0x135)?_0x149133[_0x145871(0x158)]:undefined,'enriched':_0x149133['enriched']}),_0x1c0bd1['allValid']?0x0:0x1;}async[a27_0x3dec44(0x1b8)](_0x12e2b7,_0xd98d69){const _0x319f35=a27_0x3dec44;console[_0x319f35(0xc1)]('\x0a'+a27_0x479863['bold'](_0x319f35(0x17c))+'\x20'+_0x12e2b7[_0x319f35(0xdb)]),console[_0x319f35(0xc1)]('═'[_0x319f35(0x15c)](0x3c));if(_0xd98d69['master']&&_0x12e2b7[_0x319f35(0x11d)]){const _0x45a30a=a27_0x479863[_0x319f35(0x187)](_0x319f35(0x18d))+'\x20'+a27_0x479863[_0x319f35(0x119)](_0x12e2b7[_0x319f35(0x153)][_0x319f35(0x17e)]+'.'+_0x12e2b7[_0x319f35(0x153)][_0x319f35(0x136)]);await this[_0x319f35(0x169)](_0x45a30a,_0x12e2b7[_0x319f35(0x11d)]);}else{if(_0xd98d69[_0x319f35(0x1d2)]&&_0x12e2b7[_0x319f35(0x11d)]){const _0x574f78=a27_0x479863[_0x319f35(0x187)](_0x319f35(0x1ac))+'\x20'+a27_0x479863['bold'](_0xd98d69[_0x319f35(0x1d2)]);await this[_0x319f35(0x169)](_0x574f78,_0x12e2b7[_0x319f35(0x11d)]);}else{if(_0xd98d69[_0x319f35(0x158)]&&_0x12e2b7[_0x319f35(0x11d)]){const _0x2bbb1c=a27_0x479863[_0x319f35(0x187)](_0x319f35(0xbd))+'\x20'+a27_0x479863['bold'](_0xd98d69[_0x319f35(0x158)]);await this[_0x319f35(0x169)](_0x2bbb1c,_0x12e2b7[_0x319f35(0x11d)]);}else{if(_0xd98d69[_0x319f35(0x139)]&&_0x12e2b7[_0x319f35(0x11d)]){const _0x2f5a1e=a27_0x479863['dim'](_0x319f35(0x1c9))+'\x20'+a27_0x479863[_0x319f35(0x119)](_0x319f35(0xcf));await this[_0x319f35(0x169)](_0x2f5a1e,_0x12e2b7[_0x319f35(0x11d)]);}else!_0x12e2b7[_0x319f35(0x11d)]&&console[_0x319f35(0xc1)](_0x319f35(0xe2));}}}if(_0x12e2b7[_0x319f35(0xe3)]['length']>0x0){console[_0x319f35(0xc1)]('─'['repeat'](0x3c)),console['error']('\x0a'+a27_0x479863['red'](_0x319f35(0xac)));for(const _0x5e8dc8 of _0x12e2b7[_0x319f35(0xe3)]){console['error']('\x20\x20'+a27_0x479863['red']('•')+'\x20'+_0x5e8dc8);}}}async[a27_0x3dec44(0x169)](_0xf15cdf,_0x3c6c50){const _0x414664=a27_0x3dec44;if(_0x3c6c50[_0x414664(0x12f)]===0x0){console['error']('\x0a'+_0xf15cdf),console[_0x414664(0xc1)](_0x414664(0x10f));return;}console[_0x414664(0xc1)]('\x0a'+_0xf15cdf);const _0x11c5c3=Object[_0x414664(0x1d1)](_0x3c6c50[0x0])['map'](_0x156e44=>({'name':_0x156e44,'type':typeof _0x3c6c50[0x0][_0x156e44]===_0x414664(0x1c1)?_0x414664(0xb3):'varchar'})),_0x2d0a0c={'queryId':_0x414664(0x10b),'columns':_0x11c5c3,'data':_0x3c6c50,'stats':{'state':_0x414664(0xc5),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3c6c50[_0x414664(0x12f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3419d4=formatAsTable(_0x2d0a0c,_0x3c6c50['length'],!![]);await writeOutput(_0x3419d4,undefined,_0x414664(0x136));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a27_0x3dec44(0x116);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x131);async[a27_0x3dec44(0x15f)](_0x3dabd2){const _0x1694d4=a27_0x3dec44,{options:_0x278ab2,args:_0x2b0373,tdx:_0x2562d3}=_0x3dabd2,_0x5de209=_0x278ab2,_0x1f81dd=_0x2b0373[0x0]||_0x278ab2['parentSegment'];if(!_0x1f81dd)return console[_0x1694d4(0xc1)](a27_0x479863['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x1694d4(0xc1)]('Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a'),console['error'](a27_0x479863[_0x1694d4(0xc8)](_0x1694d4(0xe0))),0x1;const _0x192da0=resolveYamlFile(_0x1f81dd);if(existsSync(_0x192da0)){_0x5de209[_0x1694d4(0x1ce)]&&console[_0x1694d4(0xc1)](_0x1694d4(0x16a)+_0x192da0);let _0x55badb;try{_0x55badb=readFileSync(_0x192da0,_0x1694d4(0x11f));}catch(_0x292d1e){const _0x106e44=_0x292d1e instanceof Error?_0x292d1e[_0x1694d4(0x10c)]:String(_0x292d1e);return console[_0x1694d4(0xc1)](_0x1694d4(0x14a)+_0x106e44),0x1;}const _0x4863b1=await withSpinner(_0x1694d4(0x18e),()=>_0x2562d3[_0x1694d4(0x1c5)]['pushParentYaml'](_0x55badb),{'verbose':_0x5de209[_0x1694d4(0x1ce)]}),_0x897d4a=_0x4863b1[_0x1694d4(0x12b)],{isNew:_0x2e1b36,name:_0x297ba2,hasChanges:_0x4fee71,diffFormatted:_0x34ba7d}=_0x897d4a;if(_0x4fee71){_0x2e1b36?console[_0x1694d4(0xc1)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x297ba2+'\x27:'):console['error'](_0x1694d4(0xba)+_0x297ba2+'\x27:');console[_0x1694d4(0xc1)]('─'[_0x1694d4(0x15c)](0x3c)),console['error'](_0x34ba7d),console[_0x1694d4(0xc1)]('─'['repeat'](0x3c));const _0x2123cb=_0x2e1b36?'Create\x20parent\x20segment\x20\x27'+_0x297ba2+_0x1694d4(0x168):'Apply\x20changes\x20to\x20\x27'+_0x297ba2+_0x1694d4(0x168);if(!_0x5de209[_0x1694d4(0x151)]){const _0x2d6d21=await confirmKey(_0x2123cb);if(!_0x2d6d21)return console[_0x1694d4(0xc1)](_0x1694d4(0x1c0)),0x1;}const _0x275444=_0x2e1b36?'Creating':'Updating';await withSpinner(_0x275444+_0x1694d4(0xf1)+_0x297ba2+_0x1694d4(0x157),()=>_0x897d4a['apply'](),{'verbose':_0x5de209[_0x1694d4(0x1ce)]});const _0x46ab33=_0x2e1b36?_0x1694d4(0x126):_0x1694d4(0xb7);console[_0x1694d4(0xc1)]('✔\x20'+_0x46ab33+_0x1694d4(0xf1)+_0x297ba2+'\x27');}else console[_0x1694d4(0xc1)](_0x1694d4(0x147)+_0x297ba2+_0x1694d4(0x167));}const _0x5b2f9f=await withSpinner(_0x1694d4(0xf5)+_0x1f81dd+_0x1694d4(0x157),()=>_0x2562d3['segment'][_0x1694d4(0x125)](_0x1f81dd),{'verbose':_0x5de209[_0x1694d4(0x1ce)]}),_0x45e71d=_0x5b2f9f[_0x1694d4(0x12b)],_0x7d847e=getConsoleUrl(_0x5de209['site'],_0x1694d4(0x14e)+_0x45e71d[_0x1694d4(0x1b7)]+'/sessions/'+_0x45e71d[_0x1694d4(0xbf)]+_0x1694d4(0x16e)+_0x45e71d[_0x1694d4(0x13c)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x1694d4(0xc1)]('\x20\x20'+a27_0x479863['dim']('Audience\x20ID:')+'\x20'+_0x45e71d['audienceId']),console[_0x1694d4(0xc1)]('\x20\x20'+a27_0x479863['dim']('Status:')+'\x20'+_0x45e71d[_0x1694d4(0x1be)]),console[_0x1694d4(0xc1)]('\x20\x20'+a27_0x479863['dim']('Session:')+'\x20'+_0x45e71d[_0x1694d4(0xbf)]),console[_0x1694d4(0xc1)]('\x20\x20'+a27_0x479863[_0x1694d4(0x187)](_0x1694d4(0x15b))+'\x20'+_0x45e71d[_0x1694d4(0x13c)]),console[_0x1694d4(0xc1)]('\x20\x20'+_0x7d847e),console[_0x1694d4(0xc1)]('\x0a'+a27_0x479863[_0x1694d4(0x187)](_0x1694d4(0xb6))+_0x1694d4(0xbc)+_0x45e71d[_0x1694d4(0x13c)]+_0x1694d4(0xfe)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0x166);['description']=a27_0x3dec44(0x1a2);async[a27_0x3dec44(0x15f)](_0x5064bf){const _0xb179fc=a27_0x3dec44,{options:_0x54a686,args:_0x565ced,tdx:_0x5f49da}=_0x5064bf,_0x3332db=_0x565ced[0x0]||_0x54a686[_0xb179fc(0x103)];if(!_0x3332db)return console['error'](a27_0x479863[_0xb179fc(0xe9)](_0xb179fc(0x1aa))),console[_0xb179fc(0xc1)](_0xb179fc(0xd3)),console['error'](a27_0x479863[_0xb179fc(0xc8)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x54a686[_0xb179fc(0x1ce)]&&(console[_0xb179fc(0xc1)](_0xb179fc(0x1af)+_0x54a686[_0xb179fc(0x1b1)]),console[_0xb179fc(0xc1)](_0xb179fc(0x123)+_0x3332db));const _0x57f3f8=await withSpinner(_0xb179fc(0x1a9)+_0x3332db+_0xb179fc(0x157),()=>_0x5f49da[_0xb179fc(0x1c5)][_0xb179fc(0x18b)](_0x3332db),{'verbose':_0x54a686[_0xb179fc(0x1ce)]}),_0x37f653=_0x57f3f8[_0xb179fc(0x12b)];console[_0xb179fc(0xc1)](_0xb179fc(0x101)+_0x37f653[_0xb179fc(0x12f)]+_0xb179fc(0x162)+(_0x37f653[_0xb179fc(0x12f)]!==0x1?'s':''));if(_0x54a686[_0xb179fc(0x12d)]||_0x54a686['jsonl'])return await handleSDKOutput(_0x37f653,_0x54a686),0x0;return displayFieldsHumanReadable(_0x37f653,_0x3332db),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0x17d);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x118);async[a27_0x3dec44(0x15f)](_0x4cafa5){const _0x2972b6=a27_0x3dec44,{options:_0x4027d5,args:_0x18163d,tdx:_0x4b0c3b}=_0x4cafa5,_0x4e818a=_0x4027d5,_0x13843d=_0x18163d[0x0]||_0x4027d5[_0x2972b6(0x103)];if(!_0x13843d)return console['error'](a27_0x479863[_0x2972b6(0xe9)](_0x2972b6(0x1aa))),console[_0x2972b6(0xc1)]('Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a'),console[_0x2972b6(0xc1)](_0x2972b6(0x144)),console[_0x2972b6(0xc1)](_0x2972b6(0x18c)),console[_0x2972b6(0xc1)](a27_0x479863[_0x2972b6(0xc8)]('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x4027d5[_0x2972b6(0x1ce)]&&(console[_0x2972b6(0xc1)](_0x2972b6(0x1af)+_0x4027d5[_0x2972b6(0x1b1)]),console[_0x2972b6(0xc1)](_0x2972b6(0x123)+_0x13843d));const _0x1fa09e=await withSpinner(_0x2972b6(0xf9)+_0x13843d+_0x2972b6(0x157),()=>_0x4b0c3b[_0x2972b6(0x1c5)][_0x2972b6(0x176)](_0x13843d),{'verbose':_0x4027d5['verbose']}),_0x2fea98=_0x1fa09e[_0x2972b6(0x12b)];if(_0x4e818a['web']){const _0x6be715=getConsoleNextUrl(_0x4e818a[_0x2972b6(0x1b1)],_0x2972b6(0x10a)+_0x2fea98['id']);return console[_0x2972b6(0xc1)](a27_0x479863[_0x2972b6(0x18a)]('✔')+_0x2972b6(0xec)+a27_0x479863[_0x2972b6(0xc8)](_0x6be715)),openBrowser(_0x6be715),0x0;}return await handleSingleObjectOutput(_0x2fea98,_0x4027d5),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0xe6);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0xe7);async[a27_0x3dec44(0x15f)](_0x33e581){const _0x18c6b1=a27_0x3dec44,{options:_0x4f8e88,args:_0x53969a,tdx:_0x5f5b12}=_0x33e581,_0x1de4f8=_0x53969a[0x0]||_0x4f8e88['parentSegment'];if(!_0x1de4f8)return console['error'](a27_0x479863[_0x18c6b1(0xe9)](_0x18c6b1(0x1aa))),console[_0x18c6b1(0xc1)]('Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a'),console[_0x18c6b1(0xc1)](a27_0x479863[_0x18c6b1(0xc8)](_0x18c6b1(0xe0))),0x1;_0x4f8e88[_0x18c6b1(0x1ce)]&&(console[_0x18c6b1(0xc1)]('Site:\x20'+_0x4f8e88[_0x18c6b1(0x1b1)]),console[_0x18c6b1(0xc1)](_0x18c6b1(0x123)+_0x1de4f8));const _0x49e0fb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1de4f8+_0x18c6b1(0x157),()=>_0x5f5b12[_0x18c6b1(0x1c5)][_0x18c6b1(0x180)](_0x1de4f8),{'verbose':_0x4f8e88[_0x18c6b1(0x1ce)]}),_0x58ea61=_0x49e0fb[_0x18c6b1(0x12b)],_0x24cfca=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x1de4f8+_0x18c6b1(0x157),()=>_0x5f5b12[_0x18c6b1(0x1c5)]['getParentSQL'](_0x58ea61),{'verbose':_0x4f8e88['verbose']}),_0xc42667=await executeSchemaQuery(_0x24cfca[_0x18c6b1(0x12b)],_0x5f5b12,_0x4f8e88);return await handleQueryOutput(_0xc42667,_0x4f8e88),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0x3dec44(0xdb)]=a27_0x3dec44(0x100);[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x14b);async[a27_0x3dec44(0x15f)](_0x4b572e){const _0x3a0756=a27_0x3dec44,{options:_0x395c04,args:_0x572b3a,tdx:_0x12fd48}=_0x4b572e,_0x2bb3ae=_0x572b3a[0x0]||_0x395c04[_0x3a0756(0x103)];if(!_0x2bb3ae)return console[_0x3a0756(0xc1)](a27_0x479863['red'](_0x3a0756(0x1aa))),console[_0x3a0756(0xc1)](_0x3a0756(0x1bc)),console['error'](a27_0x479863[_0x3a0756(0xc8)](_0x3a0756(0xe0))),0x1;_0x395c04[_0x3a0756(0x1ce)]&&(console[_0x3a0756(0xc1)](_0x3a0756(0x1af)+_0x395c04[_0x3a0756(0x1b1)]),console['error']('Parent\x20segment:\x20'+_0x2bb3ae));const _0x29e0f9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2bb3ae+'\x27...',()=>_0x12fd48[_0x3a0756(0x1c5)][_0x3a0756(0x180)](_0x2bb3ae),{'verbose':_0x395c04[_0x3a0756(0x1ce)]}),_0x168daa=_0x29e0f9[_0x3a0756(0x12b)],_0x522d80=await withSpinner(_0x3a0756(0xaf)+_0x2bb3ae+_0x3a0756(0x157),()=>_0x12fd48['segment'][_0x3a0756(0xe4)](_0x168daa),{'verbose':_0x395c04[_0x3a0756(0x1ce)]}),_0x271025=_0x522d80[_0x3a0756(0x12b)];return _0x395c04[_0x3a0756(0x13f)]===_0x3a0756(0x12d)||_0x395c04['format']===_0x3a0756(0x11b)?await handleSDKOutput([{'sql':_0x271025}],_0x395c04):console[_0x3a0756(0xef)](_0x271025),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0x3dec44(0xdb)]='segment:parent:show';[a27_0x3dec44(0x17a)]=a27_0x3dec44(0x163);async[a27_0x3dec44(0x15f)](_0x5dc5c8){const _0x5bf8eb=a27_0x3dec44,{options:_0xf46418,args:_0x26688e,tdx:_0x2c1f58}=_0x5dc5c8,_0xf202a=_0x26688e[0x0]||_0xf46418[_0x5bf8eb(0x103)];if(!_0xf202a)return console[_0x5bf8eb(0xc1)](a27_0x479863[_0x5bf8eb(0xe9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x5bf8eb(0xc1)](_0x5bf8eb(0xb1)),console[_0x5bf8eb(0xc1)](a27_0x479863[_0x5bf8eb(0xc8)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0xf46418[_0x5bf8eb(0x1ce)]&&(console[_0x5bf8eb(0xc1)](_0x5bf8eb(0x1af)+_0xf46418[_0x5bf8eb(0x1b1)]),console[_0x5bf8eb(0xc1)]('Parent\x20segment:\x20'+_0xf202a));const _0x6cb025=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf202a+'\x27...',()=>_0x2c1f58[_0x5bf8eb(0x1c5)]['resolveParentId'](_0xf202a),{'verbose':_0xf46418['verbose']}),_0x3933e5=_0x6cb025[_0x5bf8eb(0x12b)],_0x2d615=await withSpinner(_0x5bf8eb(0xaf)+_0xf202a+'\x27...',()=>_0x2c1f58['segment'][_0x5bf8eb(0xe4)](_0x3933e5),{'verbose':_0xf46418['verbose']});let _0x1be909=_0x2d615[_0x5bf8eb(0x12b)];const _0x51f89c=resolveLimit(_0xf46418['limit'],DEFAULT_DISPLAY_LIMIT),_0x28ec19=/\bLIMIT\s+\d+/i[_0x5bf8eb(0x107)](_0x1be909);!_0x28ec19&&(_0x1be909=_0x1be909[_0x5bf8eb(0xc7)]()[_0x5bf8eb(0x184)](/;+$/,''),_0x1be909=_0x5bf8eb(0x1a5)+_0x1be909+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x51f89c);_0xf46418[_0x5bf8eb(0x1ce)]&&console[_0x5bf8eb(0xc1)](_0x5bf8eb(0x13d)+_0x1be909);const _0xc17376=await withQuerySpinner(_0x5bf8eb(0x182),async _0x4cdcf9=>{const _0x1dc0f9=_0x5bf8eb,_0x450092=await _0x2c1f58['query'][_0x1dc0f9(0x15f)](_0x1be909,{'catalog':'td','schema':'information_schema','onJobId':_0x12d8c4=>{const _0x3c2a2d=_0x1dc0f9;_0x4cdcf9[_0x3c2a2d(0xd6)](_0x12d8c4);}});return _0x450092;},{'verbose':_0xf46418[_0x5bf8eb(0x1ce)]}),_0x52a151=_0xc17376[_0x5bf8eb(0x12b)],_0x14cd89=_0x52a151[_0x5bf8eb(0x171)]?_0x5bf8eb(0x191)+_0x52a151[_0x5bf8eb(0x171)]+']':'';return console[_0x5bf8eb(0xc1)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x52a151['stats']['processedRows'][_0x5bf8eb(0x121)]()+_0x5bf8eb(0xea)+(_0x5bf8eb(0x179)+formatElapsed(_0x52a151[_0x5bf8eb(0x15a)][_0x5bf8eb(0x197)])+_0x14cd89)),await handleQueryOutput(_0x52a151,_0xf46418),0x0;}}
@@ -1 +1 @@
1
- const a28_0x4da8c0=a28_0x5d73;function a28_0x56fc(){const _0x2a53c4=['9zUYKWz','execute','2908975GzzvHb','2046KGROIR','map','scope','log','name','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','2121091kqPvPR','List\x20all\x20available\x20profiles','353085pDkylA','5406416SupNjP','profiles','Error:\x20','12CqLlyj','28880DotbOF','description','220300sbIEnY','message'];a28_0x56fc=function(){return _0x2a53c4;};return a28_0x56fc();}(function(_0x1112fd,_0x2b4cce){const _0x15c4e8=a28_0x5d73,_0x2a7386=_0x1112fd();while(!![]){try{const _0x254d65=parseInt(_0x15c4e8(0xdd))/0x1+-parseInt(_0x15c4e8(0xd6))/0x2+-parseInt(_0x15c4e8(0xd1))/0x3+-parseInt(_0x15c4e8(0xd8))/0x4+-parseInt(_0x15c4e8(0xdc))/0x5+parseInt(_0x15c4e8(0xd5))/0x6*(parseInt(_0x15c4e8(0xcf))/0x7)+parseInt(_0x15c4e8(0xd2))/0x8*(parseInt(_0x15c4e8(0xda))/0x9);if(_0x254d65===_0x2b4cce)break;else _0x2a7386['push'](_0x2a7386['shift']());}catch(_0x424adf){_0x2a7386['push'](_0x2a7386['shift']());}}}(a28_0x56fc,0x7db35));function a28_0x5d73(_0x1987af,_0x573d5b){_0x1987af=_0x1987af-0xce;const _0x56fc78=a28_0x56fc();let _0x5d7359=_0x56fc78[_0x1987af];return _0x5d7359;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a28_0x4da8c0(0xe1)]=a28_0x4da8c0(0xd3);[a28_0x4da8c0(0xd7)]=a28_0x4da8c0(0xd0);async[a28_0x4da8c0(0xdb)](_0x2833d6){const _0x3c3c2e=a28_0x4da8c0,{options:_0x4b9a28}=_0x2833d6;try{const _0x1fe54d=listProfiles(),_0x33c902=getActiveProfile();if(_0x1fe54d['length']===0x0)return console[_0x3c3c2e(0xe0)](_0x3c3c2e(0xce)),console[_0x3c3c2e(0xe0)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x3c3c2e(0xe0)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0xdea32=_0x1fe54d[_0x3c3c2e(0xde)](_0x4c617b=>{const _0x46d376=_0x3c3c2e,_0x2c3d68=_0x4c617b[_0x46d376(0xe1)]===_0x33c902,_0x289f29=getProfileParams(_0x4c617b['config']);return{'name':_0x4c617b['name'],'active':_0x2c3d68,'scope':_0x4c617b[_0x46d376(0xdf)],'description':_0x4c617b['config'][_0x46d376(0xd7)]||'','params':_0x289f29};});return await handleSDKOutput(_0xdea32,_0x4b9a28),0x0;}catch(_0x400a05){return _0x400a05 instanceof Error&&console['error'](_0x3c3c2e(0xd4)+_0x400a05[_0x3c3c2e(0xd9)]),0x1;}}}
1
+ const a28_0x2ef7d6=a28_0x452f;(function(_0x609380,_0x541f8e){const _0x9d5e3e=a28_0x452f,_0x4ebd07=_0x609380();while(!![]){try{const _0x5499ca=-parseInt(_0x9d5e3e(0x112))/0x1+parseInt(_0x9d5e3e(0x116))/0x2*(-parseInt(_0x9d5e3e(0x11f))/0x3)+parseInt(_0x9d5e3e(0x127))/0x4*(-parseInt(_0x9d5e3e(0x11c))/0x5)+parseInt(_0x9d5e3e(0x11e))/0x6+-parseInt(_0x9d5e3e(0x119))/0x7+-parseInt(_0x9d5e3e(0x117))/0x8+parseInt(_0x9d5e3e(0x113))/0x9;if(_0x5499ca===_0x541f8e)break;else _0x4ebd07['push'](_0x4ebd07['shift']());}catch(_0x178aca){_0x4ebd07['push'](_0x4ebd07['shift']());}}}(a28_0x38f6,0x3c0f2));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a28_0x452f(_0x2f97e4,_0x13f91e){_0x2f97e4=_0x2f97e4-0x112;const _0x38f692=a28_0x38f6();let _0x452fad=_0x38f692[_0x2f97e4];return _0x452fad;}export class ProfilesCommand extends BaseCommand{[a28_0x2ef7d6(0x11d)]=a28_0x2ef7d6(0x122);['description']=a28_0x2ef7d6(0x11a);async[a28_0x2ef7d6(0x115)](_0x19d494){const _0xd74e35=a28_0x2ef7d6,{options:_0x37b264}=_0x19d494;try{const _0x32758e=listProfiles(),_0x3d8c39=getActiveProfile();if(_0x32758e[_0xd74e35(0x126)]===0x0)return console['log'](_0xd74e35(0x11b)),console[_0xd74e35(0x125)](_0xd74e35(0x120)),console[_0xd74e35(0x125)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0xe74e0b=_0x32758e['map'](_0x577fa9=>{const _0x4888de=_0xd74e35,_0x266ed6=_0x577fa9[_0x4888de(0x11d)]===_0x3d8c39,_0x5a4181=getProfileParams(_0x577fa9['config']);return{'name':_0x577fa9[_0x4888de(0x11d)],'active':_0x266ed6,'scope':_0x577fa9[_0x4888de(0x114)],'description':_0x577fa9[_0x4888de(0x121)][_0x4888de(0x123)]||'','params':_0x5a4181};});return await handleSDKOutput(_0xe74e0b,_0x37b264),0x0;}catch(_0x580306){return _0x580306 instanceof Error&&console['error'](_0xd74e35(0x118)+_0x580306[_0xd74e35(0x124)]),0x1;}}}function a28_0x38f6(){const _0x16a6e3=['length','13380yGefDI','126748qwnREx','9920736YZyBbS','scope','execute','79186KnWaZq','1961984JgDeMS','Error:\x20','2368296IBudTz','List\x20all\x20available\x20profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','190qBsKnp','name','2499930Rxnvsw','33xESKON','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','config','profiles','description','message','log'];a28_0x38f6=function(){return _0x16a6e3;};return a28_0x38f6();}
@@ -1 +1 @@
1
- {"version":3,"file":"query-command.d.ts","sourceRoot":"","sources":["../../src/commands/query-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAQhE;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,WAAW,mCAAmC;IAEvD;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAoIvD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;CAgBhE"}
1
+ {"version":3,"file":"query-command.d.ts","sourceRoot":"","sources":["../../src/commands/query-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAQhE;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,WAAW,mCAAmC;IAEvD;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAwIvD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;CAgBhE"}