@treasuredata/tdx 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) 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.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-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.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/connection.js +1 -1
  67. package/dist/sdk/engage.js +1 -1
  68. package/dist/sdk/errors.js +1 -1
  69. package/dist/sdk/index.js +1 -1
  70. package/dist/sdk/job.js +1 -1
  71. package/dist/sdk/journey.js +1 -1
  72. package/dist/sdk/llm.d.ts +27 -20
  73. package/dist/sdk/llm.d.ts.map +1 -1
  74. package/dist/sdk/llm.js +1 -1
  75. package/dist/sdk/llm.js.map +1 -1
  76. package/dist/sdk/query.js +1 -1
  77. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  78. package/dist/sdk/segment/journey-yaml.js +1 -1
  79. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  80. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  81. package/dist/sdk/segment.js +1 -1
  82. package/dist/sdk/user.js +1 -1
  83. package/dist/sdk/workflow.js +1 -1
  84. package/dist/types/endpoints.js +1 -1
  85. package/dist/types/index.js +1 -1
  86. package/dist/utils/agent-config.js +1 -1
  87. package/dist/utils/agent-ref-parser.js +1 -1
  88. package/dist/utils/async.js +1 -1
  89. package/dist/utils/chat-cache.js +1 -1
  90. package/dist/utils/colors.js +1 -1
  91. package/dist/utils/command-output.js +1 -1
  92. package/dist/utils/constants.js +1 -1
  93. package/dist/utils/diff.js +1 -1
  94. package/dist/utils/fields-display.js +1 -1
  95. package/dist/utils/file-permissions.js +1 -1
  96. package/dist/utils/format-detector.js +1 -1
  97. package/dist/utils/formatters.js +1 -1
  98. package/dist/utils/journey-utils.js +1 -1
  99. package/dist/utils/json-loader.js +1 -1
  100. package/dist/utils/llm-backup-utils.js +1 -1
  101. package/dist/utils/model-aliases.js +1 -1
  102. package/dist/utils/model-factors.js +1 -1
  103. package/dist/utils/option-validation.js +1 -1
  104. package/dist/utils/port.js +1 -1
  105. package/dist/utils/process.js +1 -1
  106. package/dist/utils/prompt.js +1 -1
  107. package/dist/utils/segment-path-parser.js +1 -1
  108. package/dist/utils/segment-ref-parser.js +1 -1
  109. package/dist/utils/spinner.js +1 -1
  110. package/dist/utils/sql-parser.js +1 -1
  111. package/dist/utils/sse-parser.js +1 -1
  112. package/dist/utils/string-utils.js +1 -1
  113. package/dist/utils/table-ref-parser.js +1 -1
  114. package/dist/utils/tdx-config.js +1 -1
  115. package/dist/utils/tdx-logger.js +1 -1
  116. package/dist/utils/tree-formatter.js +1 -1
  117. package/dist/utils/version-check.js +1 -1
  118. package/dist/utils/workflow-utils.js +1 -1
  119. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x312b8c=a27_0x3d16;(function(_0x2af077,_0x53948c){const _0x29a899=a27_0x3d16,_0x44a631=_0x2af077();while(!![]){try{const _0x5b7a09=parseInt(_0x29a899(0x1f7))/0x1+-parseInt(_0x29a899(0x1f0))/0x2*(-parseInt(_0x29a899(0x1c9))/0x3)+-parseInt(_0x29a899(0x1f5))/0x4+parseInt(_0x29a899(0x25f))/0x5*(-parseInt(_0x29a899(0x1ca))/0x6)+-parseInt(_0x29a899(0x1bd))/0x7*(parseInt(_0x29a899(0x240))/0x8)+parseInt(_0x29a899(0x1d0))/0x9+-parseInt(_0x29a899(0x1da))/0xa*(-parseInt(_0x29a899(0x1ee))/0xb);if(_0x5b7a09===_0x53948c)break;else _0x44a631['push'](_0x44a631['shift']());}catch(_0x3c401c){_0x44a631['push'](_0x44a631['shift']());}}}(a27_0x48b6,0xa659d));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';function a27_0x3d16(_0x299665,_0x34cc73){_0x299665=_0x299665-0x1b4;const _0x48b6c5=a27_0x48b6();let _0x3d1663=_0x48b6c5[_0x299665];return _0x3d1663;}import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';import*as a27_0x1ad4a7 from'node:fs';function handleSDKError(_0x376707,_0x2ff67d){const _0xcf1b51=a27_0x3d16;if(_0x376707 instanceof SDKError)console[_0xcf1b51(0x1b8)](_0xcf1b51(0x241)+_0x376707[_0xcf1b51(0x276)]),_0x2ff67d[_0xcf1b51(0x26c)]&&(_0x376707[_0xcf1b51(0x1bc)]&&console[_0xcf1b51(0x1b8)](_0xcf1b51(0x1e7)+_0x376707[_0xcf1b51(0x1bc)]),_0x376707[_0xcf1b51(0x238)]&&(console[_0xcf1b51(0x1b8)]('\x0aStack\x20trace:'),console[_0xcf1b51(0x1b8)](_0x376707[_0xcf1b51(0x238)])));else throw _0x376707;}function formatChatHistoryEntry(_0x5470cf,_0x55f830){const _0x5831e2=a27_0x3d16,_0xfde1f3=getChalk(_0x55f830),_0x3315d5=_0xfde1f3['dim'](_0x5470cf['at']);if('input'in _0x5470cf){const _0x638821=_0xfde1f3[_0x5831e2(0x253)]('[input]\x20\x20');return _0x3315d5+'\x20'+_0x638821+':\x20'+_0x5470cf[_0x5831e2(0x1ec)];}if(_0x5831e2(0x202)in _0x5470cf){const _0x580963=_0xfde1f3[_0x5831e2(0x1db)](_0x5831e2(0x1e1));return _0x3315d5+'\x20'+_0x580963+':\x20'+_0x5470cf[_0x5831e2(0x202)];}if(_0x5831e2(0x27c)in _0x5470cf){const _0x556cc5=_0xfde1f3[_0x5831e2(0x1fa)](_0x5831e2(0x260)),{functionName:_0x487d6b,functionArguments:_0x4fac2c,targetFunction:_0x306bbc}=_0x5470cf[_0x5831e2(0x27c)];let _0x1d0e27=_0x3315d5+'\x20'+_0x556cc5+':\x20'+_0xfde1f3[_0x5831e2(0x213)](_0x487d6b);if(_0x4fac2c&&Object['keys'](_0x4fac2c)[_0x5831e2(0x1cd)]>0x0){const _0x29a385=Object[_0x5831e2(0x1c0)](_0x4fac2c)[_0x5831e2(0x27e)](([_0x1388b6,_0x3b6ee1])=>_0x1388b6+'='+JSON[_0x5831e2(0x1de)](_0x3b6ee1))[_0x5831e2(0x1d5)](',\x20');_0x1d0e27+='('+_0x29a385+')';}_0x306bbc&&(_0x1d0e27+=_0xfde1f3[_0x5831e2(0x26b)]('\x20['+_0x306bbc+']'));let _0x1e3359='';if(_0x5470cf[_0x5831e2(0x27c)][_0x5831e2(0x258)])_0x1e3359=_0x5831e2(0x25d)+_0x5470cf[_0x5831e2(0x27c)]['targetKnowledgeBase'][_0x5831e2(0x219)];else{if(_0x5470cf[_0x5831e2(0x27c)][_0x5831e2(0x25b)])_0x1e3359=_0x5831e2(0x257)+_0x5470cf['tool_call'][_0x5831e2(0x25b)][_0x5831e2(0x219)];else{if(_0x5470cf[_0x5831e2(0x27c)][_0x5831e2(0x1c7)])_0x1e3359=_0x5831e2(0x275)+_0x5470cf[_0x5831e2(0x27c)][_0x5831e2(0x1c7)][_0x5831e2(0x219)];else _0x5470cf[_0x5831e2(0x27c)]['targetImageGenerator']&&(_0x1e3359=_0x5831e2(0x1f4)+_0x5470cf[_0x5831e2(0x27c)][_0x5831e2(0x1cb)][_0x5831e2(0x219)]);}}return _0x1d0e27+_0x1e3359;}if(_0x5831e2(0x27d)in _0x5470cf){const _0x822400=_0xfde1f3[_0x5831e2(0x279)](_0x5831e2(0x1f6)),{functionName:_0xbfc592,functionArguments:_0x3363ca,content:_0x31c43c,newChat:_0x5623d7}=_0x5470cf[_0x5831e2(0x27d)];let _0x4eeda1=_0x3315d5+'\x20'+_0x822400+':\x20'+_0xfde1f3[_0x5831e2(0x213)](_0xbfc592);if(_0x3363ca){const _0x55eadb=typeof _0x3363ca===_0x5831e2(0x21f)?_0x3363ca:JSON[_0x5831e2(0x1de)](_0x3363ca);_0x4eeda1+='('+_0x55eadb+')';}return _0x31c43c&&(_0x4eeda1+='\x0a'+_0xfde1f3['dim'](_0x31c43c)),_0x5623d7&&(_0x4eeda1+=_0xfde1f3[_0x5831e2(0x26b)](_0x5831e2(0x210)+_0x5623d7['id'])),_0x4eeda1;}if(_0x5831e2(0x239)in _0x5470cf){const _0x25f697=_0xfde1f3[_0x5831e2(0x26a)]('[output]\x20');return _0x3315d5+'\x20'+_0x25f697+':\x20'+_0x5470cf['output'][_0x5831e2(0x219)]+'\x20('+_0x5470cf[_0x5831e2(0x239)][_0x5831e2(0x202)][_0x5831e2(0x1cd)]+_0x5831e2(0x216);}if('image'in _0x5470cf){const _0x44cd9d=_0xfde1f3[_0x5831e2(0x26a)](_0x5831e2(0x226)),{width:_0x234a91,height:_0x29fc0c,headerText:_0x19aeca}=_0x5470cf[_0x5831e2(0x1c4)],_0xa81208=_0x19aeca?_0x5831e2(0x220)+_0x19aeca:'';return _0x3315d5+'\x20'+_0x44cd9d+':\x20'+_0x234a91+'x'+_0x29fc0c+_0xa81208;}if(_0x5831e2(0x1b8)in _0x5470cf){const _0x34e396=_0xfde1f3[_0x5831e2(0x1b5)]('[error]\x20\x20');return _0x3315d5+'\x20'+_0x34e396+':\x20'+_0x5470cf[_0x5831e2(0x1b8)];}return _0x3315d5+'\x20'+_0xfde1f3['dim'](_0x5831e2(0x23c))+':\x20'+JSON['stringify'](_0x5470cf);}async function executeChatHistoryCommand(_0x4c3b3b,_0x553ac2){const _0x413438=a27_0x3d16,{options:_0x5d4032,args:_0x3cc62a,tdx:_0x8ceb30}=_0x4c3b3b,_0x2af465=_0x3cc62a[0x0],_0x16d7d6=_0x5d4032,_0x45cfb8=_0x16d7d6['last'];try{if(_0x45cfb8&&_0x2af465)return console[_0x413438(0x1b8)](_0x413438(0x267)),console[_0x413438(0x1b8)]('Usage:\x20'+_0x553ac2+_0x413438(0x1d2)),0x1;if(!_0x2af465&&!_0x45cfb8&&_0x5d4032[_0x413438(0x26d)]!==undefined){const _0x46e23e=resolveLimit(_0x5d4032[_0x413438(0x1b6)],DEFAULT_LLM_LIMIT),_0x1d2b97=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x8ceb30[_0x413438(0x263)]['chats'](_0x46e23e),{'verbose':_0x5d4032[_0x413438(0x26c)]});return await handleSDKOutput(_0x1d2b97[_0x413438(0x1c1)],_0x5d4032),0x0;}const _0x5c6f65=await getChatIdOrSelect(_0x8ceb30,_0x5d4032,_0x45cfb8,_0x2af465);if(!_0x5c6f65)return 0x0;return await displayChatHistory(_0x5c6f65,_0x8ceb30,_0x5d4032),0x0;}catch(_0x1e7e2d){return handleSDKError(_0x1e7e2d,_0x5d4032),0x1;}}async function displayChatHistory(_0x79a38b,_0x5d4aa5,_0x160bda){const _0x2847a9=a27_0x3d16,_0x2220b9=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x79a38b+'\x27...',()=>_0x5d4aa5[_0x2847a9(0x263)]['history'](_0x79a38b),{'verbose':_0x160bda[_0x2847a9(0x26c)]}),_0x432cce=_0x2220b9[_0x2847a9(0x1c1)]['data']??[];if(_0x432cce['length']===0x0){console[_0x2847a9(0x245)](_0x2847a9(0x23b));return;}if(_0x160bda[_0x2847a9(0x26d)]!==undefined)await handleSDKOutput(_0x432cce,_0x160bda);else{const _0x3fb790=_0x432cce[_0x2847a9(0x27e)](_0x58ddb1=>formatChatHistoryEntry(_0x58ddb1,_0x160bda)),_0x15ff31=_0x3fb790[_0x2847a9(0x1d5)]('\x0a');await writeOutput(_0x15ff31,_0x160bda['output'],_0x2847a9(0x1e5));}}async function getChatIdOrSelect(_0x131696,_0x459f87,_0x32b16b,_0x12e903){const _0x29cd03=a27_0x3d16;if(_0x12e903)return _0x12e903;if(_0x32b16b){const _0x59bc9a=await withSpinner(_0x29cd03(0x1e3),()=>_0x131696[_0x29cd03(0x263)][_0x29cd03(0x24a)](0x1),{'verbose':_0x459f87[_0x29cd03(0x26c)]});if(_0x59bc9a[_0x29cd03(0x1c1)][_0x29cd03(0x1cd)]===0x0)return console[_0x29cd03(0x245)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x59bc9a[_0x29cd03(0x1c1)][0x0]['id'];}const _0x4c0ae0=await selectChatInteractively(_0x131696,_0x459f87);if(!_0x4c0ae0)return console[_0x29cd03(0x245)](_0x29cd03(0x22c)),undefined;return _0x4c0ae0;}async function getProjectIdOrDefault(_0x47ba59){const _0x2ee9d9=await getProjectWithName(_0x47ba59);return _0x2ee9d9['id'];}async function getProjectWithName(_0x5079f3){const _0x2ef609=a27_0x3d16,{tdx:_0x4e69c4,options:_0x54200e}=_0x5079f3,_0x41a86a=_0x54200e[_0x2ef609(0x20c)];if(_0x41a86a){const _0x40160f=await withSpinner(_0x2ef609(0x20f)+_0x41a86a+_0x2ef609(0x1d8),()=>_0x4e69c4[_0x2ef609(0x263)][_0x2ef609(0x201)](_0x41a86a),{'verbose':_0x54200e['verbose']});return{'id':_0x40160f[_0x2ef609(0x1c1)],'name':_0x41a86a};}const _0x148039=_0x4e69c4['llm'][_0x2ef609(0x261)]();if(_0x148039){const _0x2cb266=await _0x4e69c4[_0x2ef609(0x263)][_0x2ef609(0x274)](),_0x3eaa58=_0x2cb266[_0x2ef609(0x1d3)](_0x498382=>_0x498382['id']===_0x148039);return{'id':_0x148039,'name':_0x3eaa58?.[_0x2ef609(0x215)]['name']||'Unknown'};}const _0x17cffa=await withSpinner(_0x2ef609(0x25a),()=>_0x4e69c4[_0x2ef609(0x263)]['getOrCreateDefaultProject'](),{'verbose':_0x54200e[_0x2ef609(0x26c)]});return{'id':_0x17cffa[_0x2ef609(0x1c1)]['id'],'name':_0x17cffa[_0x2ef609(0x1c1)][_0x2ef609(0x215)][_0x2ef609(0x219)]};}function toLLMProjectInfo(_0x5d9110){const _0x24953c=a27_0x3d16;return{'name':_0x5d9110[_0x24953c(0x215)][_0x24953c(0x219)],'description':_0x5d9110[_0x24953c(0x215)][_0x24953c(0x236)],'createdAt':_0x5d9110[_0x24953c(0x215)][_0x24953c(0x22b)],'updatedAt':_0x5d9110['attributes'][_0x24953c(0x266)]};}function toAgentInfo(_0xe9a82f){const _0x2cb1c3=a27_0x3d16;return{'name':_0xe9a82f['attributes'][_0x2cb1c3(0x219)],'description':_0xe9a82f[_0x2cb1c3(0x215)]['description'],'prompt':truncatePrompt(_0xe9a82f[_0x2cb1c3(0x215)][_0x2cb1c3(0x218)]),'createdAt':_0xe9a82f['attributes'][_0x2cb1c3(0x22b)],'updatedAt':_0xe9a82f[_0x2cb1c3(0x215)]['updatedAt']};}function truncatePrompt(_0x27ab5c){const _0x1a5423=a27_0x3d16;if(!_0x27ab5c)return undefined;const _0x2fa9aa=0x64;if(_0x27ab5c[_0x1a5423(0x1cd)]<=_0x2fa9aa)return _0x27ab5c;return _0x27ab5c['slice'](0x0,_0x2fa9aa)+_0x1a5423(0x21c);}export class LLMModelsCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x27b);[a27_0x312b8c(0x236)]='List\x20available\x20LLM\x20models';async[a27_0x312b8c(0x204)](_0x4feec6){const _0x58f2f8=a27_0x312b8c,{options:_0x3022a5,tdx:_0x2c0bd1}=_0x4feec6;try{const _0x44584c=await withSpinner('Fetching\x20available\x20models...',()=>_0x2c0bd1[_0x58f2f8(0x263)][_0x58f2f8(0x1df)](),{'verbose':_0x3022a5['verbose']});return await handleSDKOutput(_0x44584c['data'],_0x3022a5),0x0;}catch(_0x2b6445){return handleSDKError(_0x2b6445,_0x3022a5),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a27_0x312b8c(0x21e);[a27_0x312b8c(0x236)]=a27_0x312b8c(0x284);async[a27_0x312b8c(0x204)](_0x525495){const _0x21794b=a27_0x312b8c,{options:_0x29ca55,args:_0x306482,tdx:_0x4c22a8}=_0x525495,_0x3798ce=getChalk(_0x29ca55),_0x175eb7=_0x29ca55[_0x21794b(0x1bf)],_0x49ada6=_0x29ca55[_0x21794b(0x255)];try{const _0x1cbca1=_0x306482[0x0],_0xefd056=resolveLimit(_0x29ca55[_0x21794b(0x1b6)],DEFAULT_LLM_LIMIT),_0x524d3f=await withSpinner('Fetching\x20projects...',()=>_0x4c22a8[_0x21794b(0x263)][_0x21794b(0x274)](_0xefd056),{'verbose':_0x29ca55[_0x21794b(0x26c)]});let _0x22f279=_0x524d3f[_0x21794b(0x1c1)];_0x1cbca1&&(_0x22f279=_0x524d3f[_0x21794b(0x1c1)][_0x21794b(0x1f3)](_0x51b438=>matchGlobPattern(_0x51b438[_0x21794b(0x215)][_0x21794b(0x219)],_0x1cbca1)));const _0x22541e=_0x29ca55[_0x21794b(0x26d)]===_0x21794b(0x1f2)||_0x29ca55[_0x21794b(0x26d)]===_0x21794b(0x21a)||_0x29ca55[_0x21794b(0x26d)]===_0x21794b(0x1e5)||_0x29ca55[_0x21794b(0x26d)]===_0x21794b(0x282);if(_0x22541e){const _0x55415f=_0x22f279[_0x21794b(0x27e)](_0x185521=>({...toLLMProjectInfo(_0x185521),..._0x175eb7?{'url':getLLMProjectUrl(_0x49ada6,_0x185521['id'])}:{}}));await handleSDKOutput(_0x55415f,_0x29ca55);}else{const _0x3fc82d=[];if(_0x22f279[_0x21794b(0x1cd)]===0x0)_0x3fc82d[_0x21794b(0x206)](_0x3798ce[_0x21794b(0x26b)]('No\x20projects\x20found'));else{const _0x3abf6f=[..._0x22f279][_0x21794b(0x1b7)]((_0x5bf408,_0x5a8acb)=>_0x5bf408['attributes'][_0x21794b(0x219)]['localeCompare'](_0x5a8acb[_0x21794b(0x215)][_0x21794b(0x219)]));for(const _0x56f3fa of _0x3abf6f){if(_0x175eb7){const _0x3368dd=getLLMProjectUrl(_0x49ada6,_0x56f3fa['id']);_0x3fc82d[_0x21794b(0x206)]('⚒️\x20'+_0x56f3fa[_0x21794b(0x215)]['name']+'\x20\x20'+_0x3798ce[_0x21794b(0x26b)](_0x3368dd));}else _0x3fc82d[_0x21794b(0x206)](_0x21794b(0x1fd)+_0x56f3fa[_0x21794b(0x215)][_0x21794b(0x219)]);}_0x3fc82d[_0x21794b(0x206)](_0x3798ce[_0x21794b(0x26b)](_0x22f279[_0x21794b(0x1cd)]+_0x21794b(0x273)));}await writeOutput(_0x3fc82d['join']('\x0a'),_0x29ca55[_0x21794b(0x239)],_0x21794b(0x1e5));}return 0x0;}catch(_0x2239c2){return handleSDKError(_0x2239c2,_0x29ca55),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x1eb);['description']=a27_0x312b8c(0x25e);async[a27_0x312b8c(0x204)](_0x1a8f5e){const _0x1ea1b2=a27_0x312b8c,{options:_0x2e27bd,args:_0x4c4bc0,tdx:_0x3a9ca0}=_0x1a8f5e,_0x108e43=getChalk(_0x2e27bd),_0x376a48=_0x2e27bd['web'],_0x510ced=_0x2e27bd['site'];try{const _0x191dd3=_0x4c4bc0[0x0];let _0x2409bb=_0x191dd3,_0x154b8f,_0x5111a6;if(_0x191dd3&&_0x191dd3[_0x1ea1b2(0x1d9)]('/')){const _0x2a0fc8=_0x191dd3['split']('/');if(_0x2a0fc8[_0x1ea1b2(0x1cd)]===0x2){const [_0x565d6e,_0x1b7e70]=_0x2a0fc8,_0x7f4c2f=await _0x3a9ca0[_0x1ea1b2(0x263)][_0x1ea1b2(0x274)](),_0x394f47=_0x7f4c2f[_0x1ea1b2(0x1d3)](_0x11e09c=>_0x11e09c[_0x1ea1b2(0x215)]['name']['toLowerCase']()===_0x565d6e[_0x1ea1b2(0x251)]());if(!_0x394f47)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0x565d6e,undefined,{'helpText':_0x1ea1b2(0x1c6)});_0x154b8f=_0x394f47['id'],_0x5111a6=_0x394f47[_0x1ea1b2(0x215)][_0x1ea1b2(0x219)],_0x2409bb=_0x1b7e70;}else throw new SDKError(ErrorCode[_0x1ea1b2(0x228)],_0x1ea1b2(0x24f)+_0x191dd3,undefined,{'helpText':_0x1ea1b2(0x256)});}else{const _0x4323dc=await getProjectWithName(_0x1a8f5e);_0x154b8f=_0x4323dc['id'],_0x5111a6=_0x4323dc[_0x1ea1b2(0x219)];}const _0x576070=await withSpinner('Fetching\x20agents...',()=>_0x3a9ca0['llm']['agents'](_0x154b8f),{'verbose':_0x2e27bd[_0x1ea1b2(0x26c)]});let _0x5e8c0c=_0x576070['data'];_0x2409bb&&(_0x5e8c0c=_0x576070[_0x1ea1b2(0x1c1)][_0x1ea1b2(0x1f3)](_0x8402d1=>matchGlobPattern(_0x8402d1[_0x1ea1b2(0x215)]['name'],_0x2409bb)));const _0x4a035a=_0x2e27bd[_0x1ea1b2(0x26d)]===_0x1ea1b2(0x1f2)||_0x2e27bd[_0x1ea1b2(0x26d)]==='jsonl'||_0x2e27bd[_0x1ea1b2(0x26d)]==='table'||_0x2e27bd[_0x1ea1b2(0x26d)]===_0x1ea1b2(0x282);if(_0x4a035a){const _0x576051=_0x5e8c0c[_0x1ea1b2(0x27e)](_0xdcc42c=>({...toAgentInfo(_0xdcc42c),..._0x376a48?{'chatUrl':getLLMAgentChatUrl(_0x510ced,_0x154b8f,_0xdcc42c['id'])}:{}}));await handleSDKOutput(_0x576051,_0x2e27bd);}else{const _0x1717de=[];_0x1717de[_0x1ea1b2(0x206)](_0x108e43['dim']('['+_0x5111a6+']'));if(_0x5e8c0c['length']===0x0)_0x1717de['push'](_0x108e43[_0x1ea1b2(0x26b)](_0x1ea1b2(0x1ff)));else{const _0x52414c=[..._0x5e8c0c][_0x1ea1b2(0x1b7)]((_0x560ae1,_0xd78e76)=>_0x560ae1['attributes'][_0x1ea1b2(0x219)][_0x1ea1b2(0x246)](_0xd78e76[_0x1ea1b2(0x215)][_0x1ea1b2(0x219)]));for(const _0x4de1f6 of _0x52414c){if(_0x376a48){const _0x5549c6=getLLMAgentChatUrl(_0x510ced,_0x154b8f,_0x4de1f6['id']);_0x1717de[_0x1ea1b2(0x206)](_0x1ea1b2(0x1d1)+_0x4de1f6[_0x1ea1b2(0x215)]['name']+'\x20\x20'+_0x108e43['dim'](_0x5549c6));}else _0x1717de[_0x1ea1b2(0x206)](_0x1ea1b2(0x1d1)+_0x4de1f6[_0x1ea1b2(0x215)][_0x1ea1b2(0x219)]);}_0x1717de[_0x1ea1b2(0x206)](_0x108e43[_0x1ea1b2(0x26b)](_0x5e8c0c[_0x1ea1b2(0x1cd)]+_0x1ea1b2(0x243)));}await writeOutput(_0x1717de['join']('\x0a'),_0x2e27bd[_0x1ea1b2(0x239)],_0x1ea1b2(0x1e5));}return 0x0;}catch(_0x5ed147){return handleSDKError(_0x5ed147,_0x2e27bd),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x24b);[a27_0x312b8c(0x236)]=a27_0x312b8c(0x259);async[a27_0x312b8c(0x204)](_0x1be5ac){const _0x4edc0f=a27_0x312b8c,{options:_0x56343e,args:_0x5d4c45,tdx:_0x2e8212}=_0x1be5ac;if(_0x5d4c45[_0x4edc0f(0x1cd)]===0x0)return console[_0x4edc0f(0x1b8)](_0x4edc0f(0x237)),console[_0x4edc0f(0x1b8)](_0x4edc0f(0x23d)),0x1;const _0x2c4bc9=_0x5d4c45[0x0];try{const _0x1df942=await getProjectIdOrDefault(_0x1be5ac),_0x1c1201=await withSpinner(_0x4edc0f(0x203)+_0x2c4bc9+_0x4edc0f(0x1d8),()=>_0x2e8212[_0x4edc0f(0x263)]['resolveAgentId'](_0x2c4bc9,_0x1df942),{'verbose':_0x56343e[_0x4edc0f(0x26c)]}),_0x35d561=await withSpinner(_0x4edc0f(0x23f),()=>_0x2e8212['llm']['agent'](_0x1c1201[_0x4edc0f(0x1c1)]),{'verbose':_0x56343e[_0x4edc0f(0x26c)]});return await handleSDKOutput([_0x35d561[_0x4edc0f(0x1c1)]],_0x56343e),0x0;}catch(_0xa8b788){return handleSDKError(_0xa8b788,_0x56343e),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a27_0x312b8c(0x219)]='llm:agent:create';['description']=a27_0x312b8c(0x1dc);async[a27_0x312b8c(0x204)](_0x52d951){const _0x5c16f4=a27_0x312b8c,{options:_0x48d197,args:_0x16c72d,tdx:_0x3f3ab2}=_0x52d951;if(_0x16c72d[_0x5c16f4(0x1cd)]===0x0)return console[_0x5c16f4(0x1b8)](_0x5c16f4(0x237)),console[_0x5c16f4(0x1b8)]('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console[_0x5c16f4(0x1b8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x2a9388=_0x16c72d[0x0],_0x3f66a0=_0x48d197,_0x527c64=_0x3f66a0[_0x5c16f4(0x227)],_0x6ba547=_0x3f66a0[_0x5c16f4(0x1e0)]||_0x5c16f4(0x23a),_0x30641f=_0x3f66a0[_0x5c16f4(0x22f)],_0x266ea6=_0x3f66a0[_0x5c16f4(0x249)]?Number(_0x3f66a0[_0x5c16f4(0x249)]):undefined,_0x44a787=_0x3f66a0[_0x5c16f4(0x27a)]?Number(_0x3f66a0['temperature']):undefined;try{let _0x1d0484,_0x153255;if(_0x2a9388[_0x5c16f4(0x1d9)]('/')){const _0x22647b=_0x2a9388[_0x5c16f4(0x288)]('/');if(_0x22647b['length']===0x2){const [_0x1652d5,_0x4ea765]=_0x22647b,_0x4d98b1=await withSpinner(_0x5c16f4(0x20f)+_0x1652d5+'\x27...',()=>_0x3f3ab2[_0x5c16f4(0x263)][_0x5c16f4(0x201)](_0x1652d5),{'verbose':_0x48d197[_0x5c16f4(0x26c)]});_0x1d0484=_0x4d98b1['data'],_0x153255=_0x4ea765;}else throw new SDKError(ErrorCode[_0x5c16f4(0x228)],'Invalid\x20path\x20syntax:\x20'+_0x2a9388,undefined,{'helpText':_0x5c16f4(0x256)});}else _0x1d0484=await getProjectIdOrDefault(_0x52d951),_0x153255=_0x2a9388;const _0x4deafb=await withSpinner(_0x5c16f4(0x1d6)+_0x153255+_0x5c16f4(0x1d8),()=>_0x3f3ab2[_0x5c16f4(0x263)][_0x5c16f4(0x1e4)]({'name':_0x153255,'projectId':_0x1d0484,'modelType':_0x6ba547,'systemPrompt':_0x527c64,'starterMessage':_0x30641f,'maxToolIterations':_0x266ea6,'temperature':_0x44a787}),{'verbose':_0x48d197['verbose']});return console[_0x5c16f4(0x245)]('Agent\x20created:\x20'+_0x4deafb[_0x5c16f4(0x1c1)]['id']),await handleSDKOutput([_0x4deafb[_0x5c16f4(0x1c1)]],_0x48d197),0x0;}catch(_0x359584){return handleSDKError(_0x359584,_0x48d197),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x289);['description']=a27_0x312b8c(0x234);async['execute'](_0xb6ede2){const _0x50b94f=a27_0x312b8c,{options:_0x3a2bf7,args:_0x23eb26,tdx:_0x3d307c}=_0xb6ede2;if(_0x23eb26[_0x50b94f(0x1cd)]===0x0)return console[_0x50b94f(0x1b8)](_0x50b94f(0x237)),console[_0x50b94f(0x1b8)](_0x50b94f(0x250)),0x1;const _0x3c2291=_0x23eb26[0x0],_0x58b6c0=_0x3a2bf7,_0x110f85=_0x58b6c0[_0x50b94f(0x219)],_0x2742d5=_0x58b6c0[_0x50b94f(0x218)],_0xb779f3=_0x58b6c0[_0x50b94f(0x236)],_0x2f624b=_0x58b6c0[_0x50b94f(0x22f)];if(!_0x110f85&&!_0x2742d5&&!_0xb779f3&&!_0x2f624b)return console[_0x50b94f(0x1b8)](_0x50b94f(0x247)),console[_0x50b94f(0x1b8)](_0x50b94f(0x1b4)),0x1;try{const _0x4c3891=await getProjectIdOrDefault(_0xb6ede2),_0xe2f4eb=await withSpinner(_0x50b94f(0x203)+_0x3c2291+'\x27...',()=>_0x3d307c[_0x50b94f(0x263)][_0x50b94f(0x283)](_0x3c2291,_0x4c3891),{'verbose':_0x3a2bf7[_0x50b94f(0x26c)]}),_0x57858d=_0xe2f4eb[_0x50b94f(0x1c1)],_0x4ef1cf=await withSpinner(_0x50b94f(0x221),()=>_0x3d307c[_0x50b94f(0x263)][_0x50b94f(0x285)](_0x57858d,{'name':_0x110f85,'prompt':_0x2742d5,'description':_0xb779f3,'starterMessage':_0x2f624b}),{'verbose':_0x3a2bf7[_0x50b94f(0x26c)]});return console[_0x50b94f(0x245)](_0x50b94f(0x278)+_0x4ef1cf['data']['id']),await handleSDKOutput([_0x4ef1cf[_0x50b94f(0x1c1)]],_0x3a2bf7),0x0;}catch(_0x4e39d7){return handleSDKError(_0x4e39d7,_0x3a2bf7),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x1c8);['description']=a27_0x312b8c(0x21b);async[a27_0x312b8c(0x204)](_0x42705a){const _0x48e02=a27_0x312b8c,{options:_0x3cc035,args:_0x596032,tdx:_0x4684b6}=_0x42705a;if(_0x596032[_0x48e02(0x1cd)]===0x0)return console[_0x48e02(0x1b8)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x48e02(0x1b8)](_0x48e02(0x233)),0x1;const _0x903bfb=_0x596032[0x0];try{const _0x4038f1=await getProjectIdOrDefault(_0x42705a),_0x23e43b=await withSpinner('Resolving\x20agent\x20\x27'+_0x903bfb+_0x48e02(0x1d8),()=>_0x4684b6['llm'][_0x48e02(0x283)](_0x903bfb,_0x4038f1),{'verbose':_0x3cc035[_0x48e02(0x26c)]}),_0x50a879=_0x23e43b[_0x48e02(0x1c1)];return await withSpinner(_0x48e02(0x1dd),()=>_0x4684b6[_0x48e02(0x263)][_0x48e02(0x217)](_0x50a879),{'verbose':_0x3cc035[_0x48e02(0x26c)]}),console['log'](_0x48e02(0x20b)+_0x50a879),0x0;}catch(_0x5c6164){return handleSDKError(_0x5c6164,_0x3cc035),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x232);['description']=a27_0x312b8c(0x265);async[a27_0x312b8c(0x204)](_0x258581){return executeChatHistoryCommand(_0x258581,'tdx\x20llm\x20history');}}export class LLMUseCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x1e2);[a27_0x312b8c(0x236)]=a27_0x312b8c(0x1fe);async[a27_0x312b8c(0x204)](_0x426171){const _0x3a13ae=a27_0x312b8c,{options:_0x3f5803,args:_0x42e7c0,tdx:_0x67db3c}=_0x426171;if(_0x42e7c0[_0x3a13ae(0x1cd)]===0x0)return console[_0x3a13ae(0x1b8)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3a13ae(0x1b8)](_0x3a13ae(0x1fb)),0x1;const _0x560d61=_0x42e7c0[0x0];try{return await withSpinner(_0x3a13ae(0x229)+_0x560d61+'\x27...',()=>_0x67db3c[_0x3a13ae(0x263)][_0x3a13ae(0x1e6)](_0x560d61),{'verbose':_0x3f5803[_0x3a13ae(0x26c)]}),console[_0x3a13ae(0x245)](_0x3a13ae(0x235)+_0x560d61),0x0;}catch(_0x234a50){return handleSDKError(_0x234a50,_0x3f5803),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x268);[a27_0x312b8c(0x236)]='Create\x20a\x20new\x20LLM\x20project';async[a27_0x312b8c(0x204)](_0x5829bf){const _0x3ddfae=a27_0x312b8c,{options:_0x27c3c3,args:_0x1ecbf2,tdx:_0x568ba7}=_0x5829bf;if(_0x1ecbf2[_0x3ddfae(0x1cd)]===0x0)return console[_0x3ddfae(0x1b8)](_0x3ddfae(0x248)),console['error'](_0x3ddfae(0x24d)),0x1;const _0x2cca97=_0x1ecbf2[0x0],_0x166f5c=_0x27c3c3,_0x25d2fa=_0x166f5c[_0x3ddfae(0x236)];try{const _0x509c3e=await withSpinner('Creating\x20project\x20\x27'+_0x2cca97+_0x3ddfae(0x1d8),()=>_0x568ba7['llm'][_0x3ddfae(0x1c5)]({'name':_0x2cca97,'description':_0x25d2fa}),{'verbose':_0x27c3c3[_0x3ddfae(0x26c)]});console[_0x3ddfae(0x245)]('Project\x20created:\x20'+_0x509c3e[_0x3ddfae(0x1c1)]['id']);const _0x106cdc=toLLMProjectInfo(_0x509c3e[_0x3ddfae(0x1c1)]);return await handleSDKOutput([_0x106cdc],_0x27c3c3),0x0;}catch(_0x10a023){return handleSDKError(_0x10a023,_0x27c3c3),0x1;}}}function a27_0x48b6(){const _0x12e5ad=['Setting\x20project\x20context\x20to\x20\x27','h\x20ago','createdAt','\x0aCancelled','prompts','(no\x20message)','starterMessage','toLocaleDateString','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','llm:history','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','Update\x20an\x20existing\x20agent','Project\x20context\x20set\x20to:\x20','description','Error:\x20Agent\x20name\x20is\x20required','stack','output','claude-4.5-haiku','No\x20messages\x20found\x20in\x20chat\x20history.','[unknown]','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Error:\x20Backup\x20folder\x20path\x20is\x20required','Fetching\x20agent...','47512OccWjn','Error:\x20','projectName','\x20agent(s)','knowledgeBases','log','localeCompare','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Error:\x20Project\x20name\x20is\x20required','maxToolIterations','chats','llm:agent:show','\x20\x20Integrations:\x20','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','select','Invalid\x20path\x20syntax:\x20','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','toLowerCase','Backing\x20up\x20project\x20\x27','cyan','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','site','Use\x20format:\x20project-name/agent-name','\x20->\x20Agent:','targetKnowledgeBase','Show\x20agent\x20details','Getting\x20default\x20project...','targetAgent','agentId','\x20->\x20KB:','List\x20agents\x20in\x20current\x20project','704940MqUvoI','[tool_call]','getCurrentProject','\x27\x20already\x20exists.\x20Overwrite?','llm','backupProject','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','updatedAt','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','llm:project:create','yes','blue','dim','verbose','format','existsSync','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','getTime','Backup\x20cancelled.','(no\x20agent)','\x20project(s)','projects','\x20->\x20WebSearch:','message','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Agent\x20updated:\x20','magenta','temperature','llm:models','tool_call','tool','map','\x20\x20\x20Examples:','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','getBackupMetadata','tsv','resolveAgentId','List\x20all\x20LLM\x20projects','updateAgent','agents','agent','split','llm:agent:update','.llm','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','Load\x20more...','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','red','limit','sort','error','set','Analyzing\x20project\x20\x27','short','cause','77rDMRWC','Output\x20directory\x20\x27','web','entries','data','get','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','image','createProject','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','targetWebSearchTool','llm:agent:delete','19428CpiNfd','24kUMggJ','targetImageGenerator','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','length','Project\x20deleted:\x20','Validating\x20backup\x20from\x20\x27','8656398qrvmtS','🤖\x20','\x20--last','find','\x20\x20Agents:\x20','join','Creating\x20agent\x20\x27','llm:project:delete','\x27...','includes','1568330lhMSHv','green','Create\x20a\x20new\x20agent\x20in\x20current\x20project','Deleting\x20agent...','stringify','models','model','[content]','llm:use','Fetching\x20most\x20recent\x20chat...','createAgent','table','setCurrentProject','\x20\x20Cause:\x20','sourceSite','chatId','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','llm:agents','input','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','11FSwulO','outputDir','186SMSLsi','counts','json','filter','\x20->\x20ImageGen:','4361236tfFoyl','[tool]\x20\x20\x20','680040GlXdRB','m\x20ago','llm:project:restore','yellow','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Fetching\x20chat\x20sessions...','⚒️\x20','Set\x20current\x20project\x20context','No\x20agents\x20found','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','resolveProjectId','content','Resolving\x20agent\x20\x27','execute','Deleting\x20project\x20\x27','push','en-US','Select\x20a\x20chat\x20session:','\x20\x20Knowledge\x20Bases:\x20','substring','Agent\x20deleted:\x20','llmProject','integrations','all','Resolving\x20project\x20\x27','\x20→\x20chat:\x20','exportedFrom','floor','bold','dryRun','attributes','\x20bytes)','deleteAgent','prompt','name','jsonl','Delete\x20an\x20agent','...','default','llm:projects','string','\x20-\x20','Updating\x20agent...','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','__load_more__','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','Project\x20backed\x20up\x20to:\x20','[image]\x20\x20','systemPrompt','INVALID_ARGUMENT'];a27_0x48b6=function(){return _0x12e5ad;};return a27_0x48b6();}export class LLMProjectDeleteCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x1d7);[a27_0x312b8c(0x236)]='Delete\x20an\x20LLM\x20project';async[a27_0x312b8c(0x204)](_0xc91785){const _0x5e4916=a27_0x312b8c,{options:_0x2c1065,args:_0x4071f7,tdx:_0x1f0637}=_0xc91785;if(_0x4071f7[_0x5e4916(0x1cd)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x5e4916(0x1b8)](_0x5e4916(0x1cc)),0x1;const _0x65380d=_0x4071f7[0x0];try{return await withSpinner(_0x5e4916(0x205)+_0x65380d+_0x5e4916(0x1d8),()=>_0x1f0637[_0x5e4916(0x263)]['deleteProject'](_0x65380d),{'verbose':_0x2c1065['verbose']}),console['log'](_0x5e4916(0x1ce)+_0x65380d),0x0;}catch(_0x48395c){return handleSDKError(_0x48395c,_0x2c1065),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a27_0x312b8c(0x219)]='llm:project:backup';[a27_0x312b8c(0x236)]=a27_0x312b8c(0x26f);async['execute'](_0x30df27){const _0x35f8b5=a27_0x312b8c,{options:_0x477c8e,args:_0x5caf93,tdx:_0x4f5e2c}=_0x30df27,_0x4d5226=getChalk(_0x477c8e);console[_0x35f8b5(0x245)](_0x4d5226[_0x35f8b5(0x1fa)](_0x35f8b5(0x1c3))),console['log'](_0x4d5226[_0x35f8b5(0x1fa)](_0x35f8b5(0x254))),console[_0x35f8b5(0x245)](_0x4d5226['dim'](_0x35f8b5(0x280))),console[_0x35f8b5(0x245)]();if(_0x5caf93[_0x35f8b5(0x1cd)]===0x0)return console[_0x35f8b5(0x1b8)](_0x35f8b5(0x248)),console['error'](_0x35f8b5(0x1ea)),0x1;const _0xc17519=_0x5caf93[0x0],_0x595403=_0x477c8e,_0x581e75=_0x595403['output'],_0x2ddb6a=_0x595403[_0x35f8b5(0x214)];try{const _0x2f578d=_0x581e75||_0xc17519+_0x35f8b5(0x28a);if(a27_0x1ad4a7[_0x35f8b5(0x26e)](_0x2f578d)&&!_0x2ddb6a){if(!_0x477c8e['yes']){const _0x2df9b0=await confirm(_0x35f8b5(0x1be)+_0x2f578d+_0x35f8b5(0x262));if(!_0x2df9b0)return console[_0x35f8b5(0x245)](_0x35f8b5(0x271)),0x0;}a27_0x1ad4a7['rmSync'](_0x2f578d,{'recursive':!![]});}const _0x5aae94=await withSpinner(_0x2ddb6a?_0x35f8b5(0x1ba)+_0xc17519+_0x35f8b5(0x1d8):_0x35f8b5(0x252)+_0xc17519+_0x35f8b5(0x1d8),()=>_0x4f5e2c[_0x35f8b5(0x263)][_0x35f8b5(0x264)](_0xc17519,_0x581e75,{'dryRun':_0x2ddb6a}),{'verbose':_0x477c8e['verbose']}),_0x374e14=_0x5aae94['data'];return _0x2ddb6a?console[_0x35f8b5(0x245)](_0x35f8b5(0x1ed)+_0x374e14[_0x35f8b5(0x1ef)]):console['log'](_0x35f8b5(0x225)+_0x374e14[_0x35f8b5(0x1ef)]),console[_0x35f8b5(0x245)](_0x35f8b5(0x1d4)+_0x374e14[_0x35f8b5(0x1f1)][_0x35f8b5(0x286)]),console[_0x35f8b5(0x245)](_0x35f8b5(0x209)+_0x374e14[_0x35f8b5(0x1f1)][_0x35f8b5(0x244)]),console['log']('\x20\x20Prompts:\x20'+_0x374e14['counts'][_0x35f8b5(0x22d)]),console[_0x35f8b5(0x245)]('\x20\x20Integrations:\x20'+_0x374e14['counts'][_0x35f8b5(0x20d)]),(_0x477c8e[_0x35f8b5(0x26d)]===_0x35f8b5(0x1f2)||_0x477c8e[_0x35f8b5(0x26d)]===_0x35f8b5(0x21a))&&await handleSDKOutput([_0x374e14],_0x477c8e),0x0;}catch(_0xe4a988){return handleSDKError(_0xe4a988,_0x477c8e),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{['name']=a27_0x312b8c(0x1f9);[a27_0x312b8c(0x236)]=a27_0x312b8c(0x200);async[a27_0x312b8c(0x204)](_0x40d04c){const _0x3e647c=a27_0x312b8c,{options:_0x558f9d,args:_0x39895f,tdx:_0x233aaf}=_0x40d04c,_0x50b01c=getChalk(_0x558f9d);console[_0x3e647c(0x245)](_0x50b01c[_0x3e647c(0x1fa)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.')),console[_0x3e647c(0x245)](_0x50b01c[_0x3e647c(0x1fa)](_0x3e647c(0x231))),console[_0x3e647c(0x245)](_0x50b01c[_0x3e647c(0x26b)](_0x3e647c(0x27f))),console['log'](_0x50b01c[_0x3e647c(0x26b)]('\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/')),console[_0x3e647c(0x245)](_0x50b01c['dim'](_0x3e647c(0x224))),console['log']();if(_0x39895f[_0x3e647c(0x1cd)]===0x0)return console[_0x3e647c(0x1b8)](_0x3e647c(0x23e)),console[_0x3e647c(0x1b8)](_0x3e647c(0x277)),0x1;const _0x4cfdfe=_0x39895f[0x0],_0x2d5fe0=_0x558f9d,_0x210548=_0x2d5fe0[_0x3e647c(0x219)],_0x502aef=_0x2d5fe0['dryRun'];try{if(!_0x502aef){const _0x5e1754=_0x233aaf[_0x3e647c(0x263)][_0x3e647c(0x281)](_0x4cfdfe),_0x598462=_0x210548||_0x5e1754[_0x3e647c(0x211)][_0x3e647c(0x242)],_0x405bb3=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x233aaf['llm'][_0x3e647c(0x274)](),{'verbose':_0x558f9d['verbose']}),_0x52e0d4=_0x405bb3[_0x3e647c(0x1c1)][_0x3e647c(0x1d3)](_0x58a854=>_0x58a854[_0x3e647c(0x215)][_0x3e647c(0x219)]===_0x598462);if(_0x52e0d4&&!_0x558f9d[_0x3e647c(0x269)]){const _0x2dbdb9=await confirm('A\x20project\x20named\x20\x27'+_0x598462+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x2dbdb9)return console['log']('Restore\x20cancelled.'),0x0;}}const _0x5c41e6=await withSpinner(_0x502aef?_0x3e647c(0x1cf)+_0x4cfdfe+_0x3e647c(0x1d8):'Restoring\x20project\x20from\x20\x27'+_0x4cfdfe+'\x27...',()=>_0x233aaf['llm']['restoreProject'](_0x4cfdfe,{'name':_0x210548,'dryRun':_0x502aef}),{'verbose':_0x558f9d[_0x3e647c(0x26c)]}),_0x3e98c2=_0x5c41e6[_0x3e647c(0x1c1)];return _0x3e98c2[_0x3e647c(0x1e8)]&&console[_0x3e647c(0x245)](_0x3e647c(0x28b)+_0x3e98c2[_0x3e647c(0x1e8)]+'\x27'),_0x502aef?console[_0x3e647c(0x245)](_0x3e647c(0x222)+_0x3e98c2[_0x3e647c(0x242)]):console[_0x3e647c(0x245)]('Project\x20restored:\x20'+_0x3e98c2[_0x3e647c(0x242)]+'\x20('+_0x3e98c2['projectId']+')'),console['log'](_0x3e647c(0x1d4)+_0x3e98c2[_0x3e647c(0x1f1)]['agents']),console[_0x3e647c(0x245)]('\x20\x20Knowledge\x20Bases:\x20'+_0x3e98c2['counts']['knowledgeBases']),console[_0x3e647c(0x245)]('\x20\x20Prompts:\x20'+_0x3e98c2[_0x3e647c(0x1f1)][_0x3e647c(0x22d)]),console[_0x3e647c(0x245)](_0x3e647c(0x24c)+_0x3e98c2[_0x3e647c(0x1f1)][_0x3e647c(0x20d)]),(_0x558f9d[_0x3e647c(0x26d)]===_0x3e647c(0x1f2)||_0x558f9d[_0x3e647c(0x26d)]===_0x3e647c(0x21a))&&await handleSDKOutput([_0x3e98c2],_0x558f9d),0x0;}catch(_0x3c391a){return handleSDKError(_0x3c391a,_0x558f9d),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x466307,_0x2e6298){const _0x40615f=a27_0x312b8c,_0xb1a745=_0x2e6298[_0x40615f(0x1b6)]||CHAT_SELECTOR_PAGE_SIZE;let _0x49795b=0x0,_0x463383=[];const _0x2c272d=(await import(_0x40615f(0x22d)))[_0x40615f(0x21d)],_0x5e506c=getChalk(_0x2e6298);while(!![]){const _0x286d3e=await withSpinner(_0x40615f(0x1fc),()=>_0x466307['llm'][_0x40615f(0x24a)](_0xb1a745+_0x49795b),{'verbose':_0x2e6298['verbose']});_0x463383=_0x286d3e[_0x40615f(0x1c1)];const _0x181727=_0x463383['slice'](_0x49795b,_0x49795b+_0xb1a745),_0x24fe23=_0x463383['length']>_0x49795b+_0xb1a745,_0x4ce3fc=[...new Set(_0x181727[_0x40615f(0x27e)](_0x60b4e4=>_0x60b4e4['attributes'][_0x40615f(0x25c)])[_0x40615f(0x1f3)](_0x26d791=>_0x26d791!==undefined))],_0x234b66=new Map();await Promise[_0x40615f(0x20e)](_0x4ce3fc[_0x40615f(0x27e)](async _0x3a1c2d=>{const _0x39c2d4=_0x40615f;try{const _0x2d5d38=await _0x466307['llm'][_0x39c2d4(0x287)](_0x3a1c2d);_0x234b66['set'](_0x3a1c2d,_0x2d5d38['attributes'][_0x39c2d4(0x219)]);}catch{_0x234b66[_0x39c2d4(0x1b9)](_0x3a1c2d,_0x3a1c2d);}}));const _0x167c77=_0x181727[_0x40615f(0x27e)](_0x4f0ba7=>{const _0x3bb9b6=_0x40615f,_0x31e8b7=_0x4f0ba7[_0x3bb9b6(0x215)]['firstInputContent']||_0x3bb9b6(0x22e),_0x1f5516=_0x31e8b7[_0x3bb9b6(0x288)]('\x0a')[0x0],_0x190c90=_0x1f5516['length']>0x50?_0x1f5516[_0x3bb9b6(0x20a)](0x0,0x4d)+_0x3bb9b6(0x21c):_0x1f5516,_0x19ede3=_0x4f0ba7[_0x3bb9b6(0x215)][_0x3bb9b6(0x25c)]?_0x234b66[_0x3bb9b6(0x1c2)](_0x4f0ba7['attributes'][_0x3bb9b6(0x25c)])||_0x4f0ba7[_0x3bb9b6(0x215)][_0x3bb9b6(0x25c)]:_0x3bb9b6(0x272),_0x2e69c5=_0x4f0ba7[_0x3bb9b6(0x215)]['lastConversationAt']||_0x4f0ba7['attributes']['updatedAt'],_0x8f5560=new Date(_0x2e69c5),_0x191d66=new Date(),_0x31467d=_0x191d66['getTime']()-_0x8f5560[_0x3bb9b6(0x270)](),_0x3b7f86=Math['floor'](_0x31467d/0xea60),_0x11ce81=Math[_0x3bb9b6(0x212)](_0x31467d/0x36ee80),_0x5a6f75=Math[_0x3bb9b6(0x212)](_0x31467d/0x5265c00);let _0x19cba4;if(_0x3b7f86<0x1)_0x19cba4='just\x20now';else{if(_0x3b7f86<0x3c)_0x19cba4=_0x3b7f86+_0x3bb9b6(0x1f8);else{if(_0x11ce81<0x18)_0x19cba4=_0x11ce81+_0x3bb9b6(0x22a);else _0x5a6f75<0x7?_0x19cba4=_0x5a6f75+'d\x20ago':_0x19cba4=_0x8f5560[_0x3bb9b6(0x230)](_0x3bb9b6(0x207),{'month':_0x3bb9b6(0x1bb),'day':'numeric'});}}return{'title':_0x190c90+'\x20'+_0x5e506c[_0x3bb9b6(0x26b)]('['+_0x19ede3+']\x20'+_0x19cba4),'value':_0x4f0ba7['id']};});_0x24fe23&&_0x167c77['push']({'title':_0x5e506c[_0x40615f(0x253)](_0x40615f(0x28c)),'value':_0x40615f(0x223)});const _0x14d530=await _0x2c272d({'type':_0x40615f(0x24e),'name':_0x40615f(0x1e9),'message':_0x40615f(0x208),'choices':_0x167c77,'hint':'Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel'});if(!_0x14d530[_0x40615f(0x1e9)])return undefined;if(_0x14d530[_0x40615f(0x1e9)]===_0x40615f(0x223)){_0x49795b+=_0xb1a745;continue;}return _0x14d530[_0x40615f(0x1e9)];}}export class ChatsCommand extends BaseCommand{[a27_0x312b8c(0x219)]=a27_0x312b8c(0x24a);[a27_0x312b8c(0x236)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a27_0x312b8c(0x204)](_0x37b5fe){return executeChatHistoryCommand(_0x37b5fe,'tdx\x20chats');}}
1
+ const a27_0x10790b=a27_0x1cb5;(function(_0xfd4bd9,_0x405f33){const _0x49edf8=a27_0x1cb5,_0x27abb3=_0xfd4bd9();while(!![]){try{const _0x1349ba=-parseInt(_0x49edf8(0x18a))/0x1+-parseInt(_0x49edf8(0x139))/0x2*(-parseInt(_0x49edf8(0x201))/0x3)+-parseInt(_0x49edf8(0x133))/0x4+parseInt(_0x49edf8(0x1ba))/0x5+parseInt(_0x49edf8(0x1bf))/0x6*(parseInt(_0x49edf8(0x1dc))/0x7)+parseInt(_0x49edf8(0x1ec))/0x8+parseInt(_0x49edf8(0x188))/0x9*(parseInt(_0x49edf8(0x1e1))/0xa);if(_0x1349ba===_0x405f33)break;else _0x27abb3['push'](_0x27abb3['shift']());}catch(_0x39e74e){_0x27abb3['push'](_0x27abb3['shift']());}}}(a27_0x3c05,0x537b5));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{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';import*as a27_0x181393 from'node:fs';function handleSDKError(_0x55cd2d,_0x21f59a){const _0x50caff=a27_0x1cb5;if(_0x55cd2d instanceof SDKError)console[_0x50caff(0x1d0)](_0x50caff(0x1e8)+_0x55cd2d[_0x50caff(0x157)]),_0x21f59a[_0x50caff(0x190)]&&(_0x55cd2d[_0x50caff(0x194)]&&console['error']('\x20\x20Cause:\x20'+_0x55cd2d[_0x50caff(0x194)]),_0x55cd2d[_0x50caff(0x1fb)]&&(console[_0x50caff(0x1d0)]('\x0aStack\x20trace:'),console['error'](_0x55cd2d[_0x50caff(0x1fb)])));else throw _0x55cd2d;}function formatChatHistoryEntry(_0x163894,_0x374c3c){const _0x3a2b7d=a27_0x1cb5,_0x2d8909=getChalk(_0x374c3c),_0x1e8eb9=_0x2d8909[_0x3a2b7d(0x1af)](_0x163894['at']);if(_0x3a2b7d(0x1dd)in _0x163894){const _0x18afb2=_0x2d8909[_0x3a2b7d(0x15c)](_0x3a2b7d(0x1ac));return _0x1e8eb9+'\x20'+_0x18afb2+':\x20'+_0x163894[_0x3a2b7d(0x1dd)];}if(_0x3a2b7d(0x1e6)in _0x163894){const _0x280edd=_0x2d8909[_0x3a2b7d(0x1da)]('[content]');return _0x1e8eb9+'\x20'+_0x280edd+':\x20'+_0x163894['content'];}if(_0x3a2b7d(0x18b)in _0x163894){const _0x232fd5=_0x2d8909[_0x3a2b7d(0x1d5)](_0x3a2b7d(0x13a)),{functionName:_0x1c7ec0,functionArguments:_0x5b6e4c,targetFunction:_0x2a095e}=_0x163894[_0x3a2b7d(0x18b)];let _0x150e3d=_0x1e8eb9+'\x20'+_0x232fd5+':\x20'+_0x2d8909[_0x3a2b7d(0x1b9)](_0x1c7ec0);if(_0x5b6e4c&&Object[_0x3a2b7d(0x132)](_0x5b6e4c)[_0x3a2b7d(0x1e9)]>0x0){const _0xeceee7=Object[_0x3a2b7d(0x130)](_0x5b6e4c)[_0x3a2b7d(0x1b1)](([_0x5cdc63,_0x1a9708])=>_0x5cdc63+'='+JSON[_0x3a2b7d(0x1fa)](_0x1a9708))[_0x3a2b7d(0x1b2)](',\x20');_0x150e3d+='('+_0xeceee7+')';}_0x2a095e&&(_0x150e3d+=_0x2d8909[_0x3a2b7d(0x1af)]('\x20['+_0x2a095e+']'));let _0x4885de='';if(_0x163894['tool_call'][_0x3a2b7d(0x1c5)])_0x4885de='\x20->\x20KB:'+_0x163894[_0x3a2b7d(0x18b)][_0x3a2b7d(0x1c5)][_0x3a2b7d(0x20a)];else{if(_0x163894['tool_call'][_0x3a2b7d(0x15b)])_0x4885de=_0x3a2b7d(0x1f0)+_0x163894[_0x3a2b7d(0x18b)][_0x3a2b7d(0x15b)][_0x3a2b7d(0x20a)];else{if(_0x163894[_0x3a2b7d(0x18b)][_0x3a2b7d(0x12c)])_0x4885de=_0x3a2b7d(0x15f)+_0x163894[_0x3a2b7d(0x18b)]['targetWebSearchTool']['name'];else _0x163894[_0x3a2b7d(0x18b)]['targetImageGenerator']&&(_0x4885de=_0x3a2b7d(0x13f)+_0x163894[_0x3a2b7d(0x18b)][_0x3a2b7d(0x155)][_0x3a2b7d(0x20a)]);}}return _0x150e3d+_0x4885de;}if(_0x3a2b7d(0x205)in _0x163894){const _0x5d3d57=_0x2d8909[_0x3a2b7d(0x14f)]('[tool]\x20\x20\x20'),{functionName:_0x325448,functionArguments:_0x5bbf7c,content:_0x141c3c,newChat:_0x16f2a9}=_0x163894[_0x3a2b7d(0x205)];let _0x3a4c03=_0x1e8eb9+'\x20'+_0x5d3d57+':\x20'+_0x2d8909[_0x3a2b7d(0x1b9)](_0x325448);if(_0x5bbf7c){const _0x46e63b=typeof _0x5bbf7c===_0x3a2b7d(0x16e)?_0x5bbf7c:JSON[_0x3a2b7d(0x1fa)](_0x5bbf7c);_0x3a4c03+='('+_0x46e63b+')';}return _0x141c3c&&(_0x3a4c03+='\x0a'+_0x2d8909[_0x3a2b7d(0x1af)](_0x141c3c)),_0x16f2a9&&(_0x3a4c03+=_0x2d8909['dim'](_0x3a2b7d(0x13d)+_0x16f2a9['id'])),_0x3a4c03;}if(_0x3a2b7d(0x197)in _0x163894){const _0x249c23=_0x2d8909['blue'](_0x3a2b7d(0x1e5));return _0x1e8eb9+'\x20'+_0x249c23+':\x20'+_0x163894['output']['name']+'\x20('+_0x163894[_0x3a2b7d(0x197)][_0x3a2b7d(0x1e6)][_0x3a2b7d(0x1e9)]+_0x3a2b7d(0x1db);}if(_0x3a2b7d(0x1e0)in _0x163894){const _0x4bf8b3=_0x2d8909[_0x3a2b7d(0x15a)](_0x3a2b7d(0x19c)),{width:_0x3051cc,height:_0xfe9344,headerText:_0x56c746}=_0x163894[_0x3a2b7d(0x1e0)],_0x72dd9f=_0x56c746?_0x3a2b7d(0x1a0)+_0x56c746:'';return _0x1e8eb9+'\x20'+_0x4bf8b3+':\x20'+_0x3051cc+'x'+_0xfe9344+_0x72dd9f;}if('error'in _0x163894){const _0x5b33a6=_0x2d8909[_0x3a2b7d(0x1c7)]('[error]\x20\x20');return _0x1e8eb9+'\x20'+_0x5b33a6+':\x20'+_0x163894[_0x3a2b7d(0x1d0)];}return _0x1e8eb9+'\x20'+_0x2d8909[_0x3a2b7d(0x1af)](_0x3a2b7d(0x176))+':\x20'+JSON['stringify'](_0x163894);}async function executeChatHistoryCommand(_0x5d2408,_0x36b6d7){const _0x308e5f=a27_0x1cb5,{options:_0x23eb8a,args:_0x58353b,tdx:_0x7dbf36}=_0x5d2408,_0x4934ca=_0x58353b[0x0],_0x19d172=_0x23eb8a,_0x175b8e=_0x19d172['last'];try{if(_0x175b8e&&_0x4934ca)return console[_0x308e5f(0x1d0)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x308e5f(0x1d0)](_0x308e5f(0x1f7)+_0x36b6d7+'\x20--last'),0x1;if(!_0x4934ca&&!_0x175b8e&&_0x23eb8a[_0x308e5f(0x144)]!==undefined){const _0x45c30d=resolveLimit(_0x23eb8a[_0x308e5f(0x1b6)],DEFAULT_LLM_LIMIT),_0x1f751c=await withSpinner(_0x308e5f(0x14a),()=>_0x7dbf36[_0x308e5f(0x17e)][_0x308e5f(0x1eb)](_0x45c30d),{'verbose':_0x23eb8a[_0x308e5f(0x190)]});return await handleSDKOutput(_0x1f751c['data'],_0x23eb8a),0x0;}const _0x118168=await getChatIdOrSelect(_0x7dbf36,_0x23eb8a,_0x175b8e,_0x4934ca);if(!_0x118168)return 0x0;return await displayChatHistory(_0x118168,_0x7dbf36,_0x23eb8a),0x0;}catch(_0x1c1628){return handleSDKError(_0x1c1628,_0x23eb8a),0x1;}}async function displayChatHistory(_0x394ea8,_0x5536a6,_0x26b202){const _0x4ef1d9=a27_0x1cb5,_0x267de9=await withSpinner(_0x4ef1d9(0x1a7)+_0x394ea8+_0x4ef1d9(0x1d8),()=>_0x5536a6[_0x4ef1d9(0x17e)][_0x4ef1d9(0x163)](_0x394ea8),{'verbose':_0x26b202[_0x4ef1d9(0x190)]}),_0x4fe5cf=_0x267de9['data']['data']??[];if(_0x4fe5cf[_0x4ef1d9(0x1e9)]===0x0){console[_0x4ef1d9(0x203)](_0x4ef1d9(0x1d1));return;}if(_0x26b202[_0x4ef1d9(0x144)]!==undefined)await handleSDKOutput(_0x4fe5cf,_0x26b202);else{const _0x1651ac=_0x4fe5cf[_0x4ef1d9(0x1b1)](_0x4c04de=>formatChatHistoryEntry(_0x4c04de,_0x26b202)),_0x5bd3ae=_0x1651ac['join']('\x0a');await writeOutput(_0x5bd3ae,_0x26b202[_0x4ef1d9(0x197)],_0x4ef1d9(0x152));}}async function getChatIdOrSelect(_0x3a1900,_0x25d4fd,_0x4ab076,_0x35f85c){const _0x58a283=a27_0x1cb5;if(_0x35f85c)return _0x35f85c;if(_0x4ab076){const _0x51eb30=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x3a1900[_0x58a283(0x17e)][_0x58a283(0x1eb)](0x1),{'verbose':_0x25d4fd[_0x58a283(0x190)]});if(_0x51eb30['data'][_0x58a283(0x1e9)]===0x0)return console[_0x58a283(0x203)](_0x58a283(0x135)),undefined;return _0x51eb30[_0x58a283(0x196)][0x0]['id'];}const _0x45de8b=await selectChatInteractively(_0x3a1900,_0x25d4fd);if(!_0x45de8b)return console[_0x58a283(0x203)](_0x58a283(0x1b7)),undefined;return _0x45de8b;}async function getProjectIdOrDefault(_0x39cfe4){const _0x1c4e2a=await getProjectWithName(_0x39cfe4);return _0x1c4e2a['id'];}async function getProjectWithName(_0x3e3773){const _0x276dcc=a27_0x1cb5,{tdx:_0x5db82a,options:_0x3af89d}=_0x3e3773,_0x9cd979=_0x3af89d['llmProject'];if(_0x9cd979){const _0x1e6868=await withSpinner(_0x276dcc(0x18d)+_0x9cd979+_0x276dcc(0x1d8),()=>_0x5db82a[_0x276dcc(0x17e)]['resolveProjectId'](_0x9cd979),{'verbose':_0x3af89d[_0x276dcc(0x190)]});return{'id':_0x1e6868[_0x276dcc(0x196)],'name':_0x9cd979};}const _0x5ee187=_0x5db82a[_0x276dcc(0x17e)][_0x276dcc(0x170)]();if(_0x5ee187){const _0x2a21bf=await _0x5db82a[_0x276dcc(0x17e)][_0x276dcc(0x1d9)](),_0x3f3177=_0x2a21bf[_0x276dcc(0x1be)](_0x1ef1d1=>_0x1ef1d1['id']===_0x5ee187);return{'id':_0x5ee187,'name':_0x3f3177?.[_0x276dcc(0x186)][_0x276dcc(0x20a)]||_0x276dcc(0x145)};}const _0x53a4fc=await withSpinner('Getting\x20default\x20project...',()=>_0x5db82a[_0x276dcc(0x17e)]['getOrCreateDefaultProject'](),{'verbose':_0x3af89d[_0x276dcc(0x190)]});return{'id':_0x53a4fc['data']['id'],'name':_0x53a4fc[_0x276dcc(0x196)]['attributes'][_0x276dcc(0x20a)]};}function toLLMProjectInfo(_0x4f2080){const _0x5a7fba=a27_0x1cb5;return{'name':_0x4f2080[_0x5a7fba(0x186)][_0x5a7fba(0x20a)],'description':_0x4f2080['attributes'][_0x5a7fba(0x1cb)],'createdAt':_0x4f2080['attributes'][_0x5a7fba(0x1d7)],'updatedAt':_0x4f2080[_0x5a7fba(0x186)][_0x5a7fba(0x1a9)]};}function toAgentInfo(_0x10d131){const _0x80a17=a27_0x1cb5;return{'name':_0x10d131['attributes'][_0x80a17(0x20a)],'description':_0x10d131[_0x80a17(0x186)][_0x80a17(0x1cb)],'prompt':truncatePrompt(_0x10d131[_0x80a17(0x186)][_0x80a17(0x12d)]),'createdAt':_0x10d131[_0x80a17(0x186)][_0x80a17(0x1d7)],'updatedAt':_0x10d131[_0x80a17(0x186)][_0x80a17(0x1a9)]};}function truncatePrompt(_0x360527){const _0x2cba32=a27_0x1cb5;if(!_0x360527)return undefined;const _0x2453eb=0x64;if(_0x360527['length']<=_0x2453eb)return _0x360527;return _0x360527[_0x2cba32(0x1c4)](0x0,_0x2453eb)+'...';}export class LLMModelsCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x158);[a27_0x10790b(0x1cb)]=a27_0x10790b(0x177);async[a27_0x10790b(0x1e4)](_0x22e752){const _0x5eb3aa=a27_0x10790b,{options:_0x2ee08f,tdx:_0x684893}=_0x22e752;try{const _0x2af5b9=await withSpinner(_0x5eb3aa(0x1b4),()=>_0x684893[_0x5eb3aa(0x17e)][_0x5eb3aa(0x151)](),{'verbose':_0x2ee08f[_0x5eb3aa(0x190)]});return await handleSDKOutput(_0x2af5b9[_0x5eb3aa(0x196)],_0x2ee08f),0x0;}catch(_0x1175d0){return handleSDKError(_0x1175d0,_0x2ee08f),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x178);[a27_0x10790b(0x1cb)]='List\x20all\x20LLM\x20projects';async[a27_0x10790b(0x1e4)](_0x23692d){const _0x53c7f4=a27_0x10790b,{options:_0x5b0241,args:_0x3f574d,tdx:_0xa514eb}=_0x23692d,_0x2228c2=getChalk(_0x5b0241),_0x4766b8=_0x5b0241[_0x53c7f4(0x143)],_0x199f41=_0x5b0241[_0x53c7f4(0x164)];try{const _0x46c5ac=_0x3f574d[0x0],_0x272450=resolveLimit(_0x5b0241[_0x53c7f4(0x1b6)],DEFAULT_LLM_LIMIT),_0x4e4692=await withSpinner(_0x53c7f4(0x1ad),()=>_0xa514eb[_0x53c7f4(0x17e)][_0x53c7f4(0x1d9)](_0x272450),{'verbose':_0x5b0241['verbose']});let _0x196ecb=_0x4e4692[_0x53c7f4(0x196)];_0x46c5ac&&(_0x196ecb=_0x4e4692[_0x53c7f4(0x196)][_0x53c7f4(0x191)](_0x36a256=>matchGlobPattern(_0x36a256[_0x53c7f4(0x186)][_0x53c7f4(0x20a)],_0x46c5ac)));const _0x212c38=_0x5b0241[_0x53c7f4(0x144)]===_0x53c7f4(0x180)||_0x5b0241[_0x53c7f4(0x144)]==='jsonl'||_0x5b0241[_0x53c7f4(0x144)]===_0x53c7f4(0x152)||_0x5b0241[_0x53c7f4(0x144)]===_0x53c7f4(0x207);if(_0x212c38){const _0x1b90cb=_0x196ecb[_0x53c7f4(0x1b1)](_0x3a80f8=>({...toLLMProjectInfo(_0x3a80f8),..._0x4766b8?{'url':getLLMProjectUrl(_0x199f41,_0x3a80f8['id'])}:{}}));await handleSDKOutput(_0x1b90cb,_0x5b0241);}else{const _0xa23c2b=[];if(_0x196ecb[_0x53c7f4(0x1e9)]===0x0)_0xa23c2b['push'](_0x2228c2['dim'](_0x53c7f4(0x183)));else{const _0x185653=[..._0x196ecb][_0x53c7f4(0x1a1)]((_0x48de57,_0x36198c)=>_0x48de57[_0x53c7f4(0x186)][_0x53c7f4(0x20a)]['localeCompare'](_0x36198c[_0x53c7f4(0x186)][_0x53c7f4(0x20a)]));for(const _0x2ed2a8 of _0x185653){if(_0x4766b8){const _0x1ce095=getLLMProjectUrl(_0x199f41,_0x2ed2a8['id']);_0xa23c2b[_0x53c7f4(0x18c)](_0x53c7f4(0x19b)+_0x2ed2a8['attributes']['name']+'\x20\x20'+_0x2228c2[_0x53c7f4(0x1af)](_0x1ce095));}else _0xa23c2b[_0x53c7f4(0x18c)]('⚒️\x20'+_0x2ed2a8[_0x53c7f4(0x186)][_0x53c7f4(0x20a)]);}_0xa23c2b[_0x53c7f4(0x18c)](_0x2228c2['dim'](_0x196ecb['length']+_0x53c7f4(0x208)));}await writeOutput(_0xa23c2b[_0x53c7f4(0x1b2)]('\x0a'),_0x5b0241[_0x53c7f4(0x197)],_0x53c7f4(0x152));}return 0x0;}catch(_0x1b4ee8){return handleSDKError(_0x1b4ee8,_0x5b0241),0x1;}}}function a27_0x1cb5(_0x661cf5,_0x38550f){_0x661cf5=_0x661cf5-0x12b;const _0x3c05d0=a27_0x3c05();let _0x1cb516=_0x3c05d0[_0x661cf5];return _0x1cb516;}export class LLMAgentsCommand extends BaseCommand{[a27_0x10790b(0x20a)]='llm:agents';[a27_0x10790b(0x1cb)]=a27_0x10790b(0x1ee);async[a27_0x10790b(0x1e4)](_0x288f36){const _0x10687d=a27_0x10790b,{options:_0x54f4c4,args:_0x3baeac,tdx:_0x276e46}=_0x288f36,_0x7e2182=getChalk(_0x54f4c4),_0x268929=_0x54f4c4['web'],_0x546965=_0x54f4c4[_0x10687d(0x164)];try{const _0x25c9b0=_0x3baeac[0x0];let _0x5f5690=_0x25c9b0,_0xf413f4,_0x16db8f;if(_0x25c9b0&&_0x25c9b0[_0x10687d(0x179)]('/')){const _0x144213=_0x25c9b0[_0x10687d(0x19f)]('/');if(_0x144213['length']===0x2){const [_0x2678d9,_0x40fdc4]=_0x144213,_0x33dcbc=await _0x276e46[_0x10687d(0x17e)][_0x10687d(0x1d9)](),_0x5a808c=_0x33dcbc[_0x10687d(0x1be)](_0x3f30fa=>_0x3f30fa['attributes'][_0x10687d(0x20a)][_0x10687d(0x198)]()===_0x2678d9[_0x10687d(0x198)]());if(!_0x5a808c)throw new SDKError(ErrorCode[_0x10687d(0x1bc)],_0x10687d(0x1d2)+_0x2678d9,undefined,{'helpText':_0x10687d(0x147)});_0xf413f4=_0x5a808c['id'],_0x16db8f=_0x5a808c[_0x10687d(0x186)][_0x10687d(0x20a)],_0x5f5690=_0x40fdc4;}else throw new SDKError(ErrorCode[_0x10687d(0x1a6)],_0x10687d(0x171)+_0x25c9b0,undefined,{'helpText':_0x10687d(0x149)});}else{const _0x7f7eed=await getProjectWithName(_0x288f36);_0xf413f4=_0x7f7eed['id'],_0x16db8f=_0x7f7eed[_0x10687d(0x20a)];}const _0x51447e=await withSpinner(_0x10687d(0x175),()=>_0x276e46[_0x10687d(0x17e)][_0x10687d(0x1b5)](_0xf413f4),{'verbose':_0x54f4c4['verbose']});let _0x5b4948=_0x51447e[_0x10687d(0x196)];_0x5f5690&&(_0x5b4948=_0x51447e[_0x10687d(0x196)][_0x10687d(0x191)](_0x249470=>matchGlobPattern(_0x249470['attributes'][_0x10687d(0x20a)],_0x5f5690)));const _0x506c14=_0x54f4c4[_0x10687d(0x144)]==='json'||_0x54f4c4[_0x10687d(0x144)]==='jsonl'||_0x54f4c4[_0x10687d(0x144)]===_0x10687d(0x152)||_0x54f4c4[_0x10687d(0x144)]===_0x10687d(0x207);if(_0x506c14){const _0x7c3eb9=_0x5b4948[_0x10687d(0x1b1)](_0x473bcd=>({...toAgentInfo(_0x473bcd),..._0x268929?{'chatUrl':getLLMAgentChatUrl(_0x546965,_0xf413f4,_0x473bcd['id'])}:{}}));await handleSDKOutput(_0x7c3eb9,_0x54f4c4);}else{const _0x529be0=[];_0x529be0[_0x10687d(0x18c)](_0x7e2182['dim']('['+_0x16db8f+']'));if(_0x5b4948[_0x10687d(0x1e9)]===0x0)_0x529be0[_0x10687d(0x18c)](_0x7e2182[_0x10687d(0x1af)]('No\x20agents\x20found'));else{const _0x1e4671=[..._0x5b4948][_0x10687d(0x1a1)]((_0x44b37f,_0x33394e)=>_0x44b37f[_0x10687d(0x186)][_0x10687d(0x20a)][_0x10687d(0x14e)](_0x33394e['attributes'][_0x10687d(0x20a)]));for(const _0x4de824 of _0x1e4671){if(_0x268929){const _0x1ced12=getLLMAgentChatUrl(_0x546965,_0xf413f4,_0x4de824['id']);_0x529be0[_0x10687d(0x18c)](_0x10687d(0x1ae)+_0x4de824[_0x10687d(0x186)][_0x10687d(0x20a)]+'\x20\x20'+_0x7e2182['dim'](_0x1ced12));}else _0x529be0[_0x10687d(0x18c)](_0x10687d(0x1ae)+_0x4de824['attributes'][_0x10687d(0x20a)]);}_0x529be0[_0x10687d(0x18c)](_0x7e2182[_0x10687d(0x1af)](_0x5b4948[_0x10687d(0x1e9)]+'\x20agent(s)'));}await writeOutput(_0x529be0['join']('\x0a'),_0x54f4c4[_0x10687d(0x197)],'table');}return 0x0;}catch(_0x2b9d68){return handleSDKError(_0x2b9d68,_0x54f4c4),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a27_0x10790b(0x20a)]='llm:agent:show';[a27_0x10790b(0x1cb)]=a27_0x10790b(0x200);async[a27_0x10790b(0x1e4)](_0x58ad57){const _0x53e779=a27_0x10790b,{options:_0x4d48be,args:_0x18adbb,tdx:_0x16241a}=_0x58ad57;if(_0x18adbb[_0x53e779(0x1e9)]===0x0)return console[_0x53e779(0x1d0)](_0x53e779(0x209)),console[_0x53e779(0x1d0)](_0x53e779(0x1a4)),0x1;const _0x11187c=_0x18adbb[0x0];try{const _0x19363=await getProjectIdOrDefault(_0x58ad57),_0xaae282=await withSpinner(_0x53e779(0x206)+_0x11187c+_0x53e779(0x1d8),()=>_0x16241a['llm'][_0x53e779(0x1ab)](_0x11187c,_0x19363),{'verbose':_0x4d48be['verbose']}),_0x117f2c=await withSpinner(_0x53e779(0x20d),()=>_0x16241a['llm'][_0x53e779(0x14b)](_0xaae282[_0x53e779(0x196)]),{'verbose':_0x4d48be[_0x53e779(0x190)]});return await handleSDKOutput([_0x117f2c[_0x53e779(0x196)]],_0x4d48be),0x0;}catch(_0x2e6209){return handleSDKError(_0x2e6209,_0x4d48be),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a27_0x10790b(0x20a)]='llm:agent:create';['description']=a27_0x10790b(0x13c);async[a27_0x10790b(0x1e4)](_0x3cdbe5){const _0x560f60=a27_0x10790b,{options:_0x3c613a,args:_0x4ab8f3,tdx:_0x275945}=_0x3cdbe5;if(_0x4ab8f3[_0x560f60(0x1e9)]===0x0)return console[_0x560f60(0x1d0)](_0x560f60(0x209)),console['error'](_0x560f60(0x181)),console[_0x560f60(0x1d0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x1c6121=_0x4ab8f3[0x0],_0x48c7e1=_0x3c613a,_0x4151f6=_0x48c7e1[_0x560f60(0x202)],_0xbf2661=_0x48c7e1['model']||_0x560f60(0x154),_0x564bd8=_0x48c7e1[_0x560f60(0x193)],_0x3a0542=_0x48c7e1['maxToolIterations']?Number(_0x48c7e1['maxToolIterations']):undefined,_0x50524f=_0x48c7e1['temperature']?Number(_0x48c7e1[_0x560f60(0x165)]):undefined;try{let _0x1399ad,_0x144f76;if(_0x1c6121['includes']('/')){const _0x575126=_0x1c6121['split']('/');if(_0x575126[_0x560f60(0x1e9)]===0x2){const [_0x5a2aa6,_0x3a03e4]=_0x575126,_0x2c2633=await withSpinner('Resolving\x20project\x20\x27'+_0x5a2aa6+_0x560f60(0x1d8),()=>_0x275945['llm'][_0x560f60(0x17a)](_0x5a2aa6),{'verbose':_0x3c613a[_0x560f60(0x190)]});_0x1399ad=_0x2c2633[_0x560f60(0x196)],_0x144f76=_0x3a03e4;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x560f60(0x171)+_0x1c6121,undefined,{'helpText':_0x560f60(0x149)});}else _0x1399ad=await getProjectIdOrDefault(_0x3cdbe5),_0x144f76=_0x1c6121;const _0x2de267=await withSpinner(_0x560f60(0x1f1)+_0x144f76+_0x560f60(0x1d8),()=>_0x275945['llm'][_0x560f60(0x148)]({'name':_0x144f76,'projectId':_0x1399ad,'modelType':_0xbf2661,'systemPrompt':_0x4151f6,'starterMessage':_0x564bd8,'maxToolIterations':_0x3a0542,'temperature':_0x50524f}),{'verbose':_0x3c613a['verbose']});return console[_0x560f60(0x203)](_0x560f60(0x15e)+_0x2de267['data']['id']),await handleSDKOutput([_0x2de267[_0x560f60(0x196)]],_0x3c613a),0x0;}catch(_0x49bc74){return handleSDKError(_0x49bc74,_0x3c613a),0x1;}}}function a27_0x3c05(){const _0x4e785b=['\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','select','Usage:\x20','Error:\x20Project\x20name\x20is\x20required','\x20\x20\x20Examples:','stringify','stack','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','knowledgeBases','tdx\x20chats','Setting\x20project\x20context\x20to\x20\x27','Show\x20agent\x20details','57IjvNxv','systemPrompt','log','llm:project:restore','tool','Resolving\x20agent\x20\x27','tsv','\x20project(s)','Error:\x20Agent\x20name\x20is\x20required','name','en-US','sourceSite','Fetching\x20agent...','deleteProject','m\x20ago','targetWebSearchTool','prompt','projectName','tdx\x20llm\x20history','entries','Restoring\x20project\x20from\x20\x27','keys','851672QMLeno','\x20\x20Agents:\x20','No\x20chat\x20sessions\x20found.','Analyzing\x20project\x20\x27','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','.llm','7670xXqQcf','[tool_call]','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Create\x20a\x20new\x20agent\x20in\x20current\x20project','\x20→\x20chat:\x20','Output\x20directory\x20\x27','\x20->\x20ImageGen:','chatId','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','agentId','web','format','Unknown','Checking\x20for\x20existing\x20projects...','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','createAgent','Use\x20format:\x20project-name/agent-name','Fetching\x20chat\x20sessions...','agent','\x20\x20Knowledge\x20Bases:\x20','numeric','localeCompare','magenta','deleteAgent','models','table','substring','claude-4.5-haiku','targetImageGenerator','Set\x20current\x20project\x20context','message','llm:models','Project\x20backed\x20up\x20to:\x20','blue','targetAgent','cyan','Project\x20context\x20set\x20to:\x20','Agent\x20created:\x20','\x20->\x20WebSearch:','Validating\x20backup\x20from\x20\x27','integrations','(no\x20agent)','history','site','temperature','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','firstInputContent','get','Deleting\x20project\x20\x27','Deleting\x20agent...','set','A\x20project\x20named\x20\x27','\x27\x20already\x20exists.\x20Overwrite?','string','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','getCurrentProject','Invalid\x20path\x20syntax:\x20','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','\x20\x20Integrations:\x20','projectId','Fetching\x20agents...','[unknown]','List\x20available\x20LLM\x20models','llm:projects','includes','resolveProjectId','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','llm:use','(no\x20message)','llm','updateAgent','json','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','prompts','No\x20projects\x20found','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','just\x20now','attributes','Restore\x20cancelled.','114885YbjYSr','Project\x20deleted:\x20','475065ftzskg','tool_call','push','Resolving\x20project\x20\x27','llm:agent:delete','h\x20ago','verbose','filter','exportedFrom','starterMessage','cause','getBackupMetadata','data','output','toLowerCase','Project\x20restored:\x20','\x20\x20Prompts:\x20','⚒️\x20','[image]\x20\x20','Load\x20more...','default','split','\x20-\x20','sort','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Creating\x20project\x20\x27','INVALID_ARGUMENT','Fetching\x20chat\x20history\x20for\x20\x27','Error:\x20Backup\x20folder\x20path\x20is\x20required','updatedAt','llm:project:create','resolveAgentId','[input]\x20\x20','Fetching\x20projects...','🤖\x20','dim','Delete\x20an\x20LLM\x20project','map','join','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','Fetching\x20available\x20models...','agents','limit','\x0aCancelled','lastConversationAt','bold','992615uEmzpK','Delete\x20an\x20agent','LLM_PROJECT_NOT_FOUND','createProject','find','831372rKJfjs','Backing\x20up\x20project\x20\x27','Create\x20a\x20new\x20LLM\x20project','jsonl','llm:history','slice','targetKnowledgeBase','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','red','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','counts','Backup\x20cancelled.','description','llm:project:backup','Select\x20a\x20chat\x20session:','d\x20ago','__load_more__','error','No\x20messages\x20found\x20in\x20chat\x20history.','Project\x20not\x20found:\x20','toLocaleDateString','floor','yellow','backupProject','createdAt','\x27...','projects','green','\x20bytes)','7Usxzdp','input','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','image','410FMPDGN','getTime','yes','execute','[output]\x20','content','...','Error:\x20','length','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','chats','772872cmAjSe','outputDir','List\x20agents\x20in\x20current\x20project','short','\x20->\x20Agent:','Creating\x20agent\x20\x27'];a27_0x3c05=function(){return _0x4e785b;};return a27_0x3c05();}export class LLMAgentUpdateCommand extends BaseCommand{[a27_0x10790b(0x20a)]='llm:agent:update';[a27_0x10790b(0x1cb)]='Update\x20an\x20existing\x20agent';async[a27_0x10790b(0x1e4)](_0x1ec111){const _0x2fd026=a27_0x10790b,{options:_0x3ab037,args:_0x4df3fe,tdx:_0x2415f2}=_0x1ec111;if(_0x4df3fe['length']===0x0)return console[_0x2fd026(0x1d0)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x2fd026(0x1d0)](_0x2fd026(0x1f3)),0x1;const _0x27320c=_0x4df3fe[0x0],_0x338062=_0x3ab037,_0x2f08f7=_0x338062[_0x2fd026(0x20a)],_0x312887=_0x338062[_0x2fd026(0x12d)],_0x3bb2ba=_0x338062[_0x2fd026(0x1cb)],_0x52b2b2=_0x338062[_0x2fd026(0x193)];if(!_0x2f08f7&&!_0x312887&&!_0x3bb2ba&&!_0x52b2b2)return console[_0x2fd026(0x1d0)](_0x2fd026(0x1a2)),console[_0x2fd026(0x1d0)](_0x2fd026(0x1a3)),0x1;try{const _0x2b25cd=await getProjectIdOrDefault(_0x1ec111),_0x715f7c=await withSpinner(_0x2fd026(0x206)+_0x27320c+_0x2fd026(0x1d8),()=>_0x2415f2[_0x2fd026(0x17e)]['resolveAgentId'](_0x27320c,_0x2b25cd),{'verbose':_0x3ab037['verbose']}),_0x4f29ac=_0x715f7c['data'],_0x4b27b5=await withSpinner('Updating\x20agent...',()=>_0x2415f2[_0x2fd026(0x17e)][_0x2fd026(0x17f)](_0x4f29ac,{'name':_0x2f08f7,'prompt':_0x312887,'description':_0x3bb2ba,'starterMessage':_0x52b2b2}),{'verbose':_0x3ab037[_0x2fd026(0x190)]});return console[_0x2fd026(0x203)]('Agent\x20updated:\x20'+_0x4b27b5[_0x2fd026(0x196)]['id']),await handleSDKOutput([_0x4b27b5['data']],_0x3ab037),0x0;}catch(_0x14d2c3){return handleSDKError(_0x14d2c3,_0x3ab037),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a27_0x10790b(0x18e);['description']=a27_0x10790b(0x1bb);async[a27_0x10790b(0x1e4)](_0x38c3cc){const _0x305385=a27_0x10790b,{options:_0x5632ba,args:_0x468ed0,tdx:_0x26ba64}=_0x38c3cc;if(_0x468ed0['length']===0x0)return console[_0x305385(0x1d0)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x305385(0x1d0)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x3b763a=_0x468ed0[0x0];try{const _0x41d326=await getProjectIdOrDefault(_0x38c3cc),_0x4a42c8=await withSpinner(_0x305385(0x206)+_0x3b763a+'\x27...',()=>_0x26ba64[_0x305385(0x17e)][_0x305385(0x1ab)](_0x3b763a,_0x41d326),{'verbose':_0x5632ba[_0x305385(0x190)]}),_0x451cf0=_0x4a42c8['data'];return await withSpinner(_0x305385(0x16a),()=>_0x26ba64[_0x305385(0x17e)][_0x305385(0x150)](_0x451cf0),{'verbose':_0x5632ba[_0x305385(0x190)]}),console[_0x305385(0x203)]('Agent\x20deleted:\x20'+_0x451cf0),0x0;}catch(_0x19cfef){return handleSDKError(_0x19cfef,_0x5632ba),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x1c3);['description']=a27_0x10790b(0x17b);async['execute'](_0x173f4e){const _0xb75615=a27_0x10790b;return executeChatHistoryCommand(_0x173f4e,_0xb75615(0x12f));}}export class LLMUseCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x17c);[a27_0x10790b(0x1cb)]=a27_0x10790b(0x156);async[a27_0x10790b(0x1e4)](_0x50c418){const _0x600f1b=a27_0x10790b,{options:_0x29b7d7,args:_0x1a88a7,tdx:_0x309d34}=_0x50c418;if(_0x1a88a7[_0x600f1b(0x1e9)]===0x0)return console['error'](_0x600f1b(0x1f8)),console[_0x600f1b(0x1d0)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x50d97e=_0x1a88a7[0x0];try{return await withSpinner(_0x600f1b(0x1ff)+_0x50d97e+_0x600f1b(0x1d8),()=>_0x309d34['llm']['setCurrentProject'](_0x50d97e),{'verbose':_0x29b7d7[_0x600f1b(0x190)]}),console[_0x600f1b(0x203)](_0x600f1b(0x15d)+_0x50d97e),0x0;}catch(_0x502173){return handleSDKError(_0x502173,_0x29b7d7),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a27_0x10790b(0x1aa);[a27_0x10790b(0x1cb)]=a27_0x10790b(0x1c1);async[a27_0x10790b(0x1e4)](_0x267086){const _0x21c2c2=a27_0x10790b,{options:_0x4652e6,args:_0x17435d,tdx:_0x20848c}=_0x267086;if(_0x17435d[_0x21c2c2(0x1e9)]===0x0)return console[_0x21c2c2(0x1d0)](_0x21c2c2(0x1f8)),console[_0x21c2c2(0x1d0)](_0x21c2c2(0x137)),0x1;const _0x11ba02=_0x17435d[0x0],_0xcecb5f=_0x4652e6,_0x5deca8=_0xcecb5f[_0x21c2c2(0x1cb)];try{const _0x511ecc=await withSpinner(_0x21c2c2(0x1a5)+_0x11ba02+_0x21c2c2(0x1d8),()=>_0x20848c[_0x21c2c2(0x17e)][_0x21c2c2(0x1bd)]({'name':_0x11ba02,'description':_0x5deca8}),{'verbose':_0x4652e6[_0x21c2c2(0x190)]});console[_0x21c2c2(0x203)]('Project\x20created:\x20'+_0x511ecc[_0x21c2c2(0x196)]['id']);const _0x5de622=toLLMProjectInfo(_0x511ecc['data']);return await handleSDKOutput([_0x5de622],_0x4652e6),0x0;}catch(_0x2255da){return handleSDKError(_0x2255da,_0x4652e6),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a27_0x10790b(0x20a)]='llm:project:delete';[a27_0x10790b(0x1cb)]=a27_0x10790b(0x1b0);async[a27_0x10790b(0x1e4)](_0x1d42c1){const _0x297594=a27_0x10790b,{options:_0x4912fe,args:_0x54c574,tdx:_0x508a29}=_0x1d42c1;if(_0x54c574[_0x297594(0x1e9)]===0x0)return console[_0x297594(0x1d0)](_0x297594(0x1f8)),console[_0x297594(0x1d0)](_0x297594(0x1c8)),0x1;const _0x18cc1f=_0x54c574[0x0];try{return await withSpinner(_0x297594(0x169)+_0x18cc1f+'\x27...',()=>_0x508a29[_0x297594(0x17e)][_0x297594(0x20e)](_0x18cc1f),{'verbose':_0x4912fe[_0x297594(0x190)]}),console[_0x297594(0x203)](_0x297594(0x189)+_0x18cc1f),0x0;}catch(_0x5bdf5f){return handleSDKError(_0x5bdf5f,_0x4912fe),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x1cc);[a27_0x10790b(0x1cb)]=a27_0x10790b(0x1b3);async[a27_0x10790b(0x1e4)](_0x2c2c37){const _0x2a81da=a27_0x10790b,{options:_0x23e372,args:_0x3f77cd,tdx:_0x2f5780}=_0x2c2c37,_0x4c05db=getChalk(_0x23e372);console[_0x2a81da(0x203)](_0x4c05db[_0x2a81da(0x1d5)](_0x2a81da(0x172))),console[_0x2a81da(0x203)](_0x4c05db[_0x2a81da(0x1d5)](_0x2a81da(0x1f5))),console[_0x2a81da(0x203)](_0x4c05db[_0x2a81da(0x1af)]('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console[_0x2a81da(0x203)]();if(_0x3f77cd[_0x2a81da(0x1e9)]===0x0)return console[_0x2a81da(0x1d0)](_0x2a81da(0x1f8)),console[_0x2a81da(0x1d0)](_0x2a81da(0x141)),0x1;const _0x4b4c1b=_0x3f77cd[0x0],_0x31482f=_0x23e372,_0x368885=_0x31482f[_0x2a81da(0x197)],_0x48be78=_0x31482f['dryRun'];try{const _0x28267a=_0x368885||_0x4b4c1b+_0x2a81da(0x138);if(a27_0x181393['existsSync'](_0x28267a)&&!_0x48be78){if(!_0x23e372[_0x2a81da(0x1e3)]){const _0x5d966b=await confirm(_0x2a81da(0x13e)+_0x28267a+_0x2a81da(0x16d));if(!_0x5d966b)return console[_0x2a81da(0x203)](_0x2a81da(0x1ca)),0x0;}a27_0x181393['rmSync'](_0x28267a,{'recursive':!![]});}const _0x22c3e4=await withSpinner(_0x48be78?_0x2a81da(0x136)+_0x4b4c1b+_0x2a81da(0x1d8):_0x2a81da(0x1c0)+_0x4b4c1b+'\x27...',()=>_0x2f5780[_0x2a81da(0x17e)][_0x2a81da(0x1d6)](_0x4b4c1b,_0x368885,{'dryRun':_0x48be78}),{'verbose':_0x23e372[_0x2a81da(0x190)]}),_0x3d8b33=_0x22c3e4[_0x2a81da(0x196)];return _0x48be78?console['log'](_0x2a81da(0x1fc)+_0x3d8b33[_0x2a81da(0x1ed)]):console['log'](_0x2a81da(0x159)+_0x3d8b33[_0x2a81da(0x1ed)]),console['log'](_0x2a81da(0x134)+_0x3d8b33[_0x2a81da(0x1c9)][_0x2a81da(0x1b5)]),console[_0x2a81da(0x203)](_0x2a81da(0x14c)+_0x3d8b33['counts'][_0x2a81da(0x1fd)]),console[_0x2a81da(0x203)]('\x20\x20Prompts:\x20'+_0x3d8b33[_0x2a81da(0x1c9)]['prompts']),console[_0x2a81da(0x203)](_0x2a81da(0x173)+_0x3d8b33['counts'][_0x2a81da(0x161)]),(_0x23e372[_0x2a81da(0x144)]===_0x2a81da(0x180)||_0x23e372[_0x2a81da(0x144)]===_0x2a81da(0x1c2))&&await handleSDKOutput([_0x3d8b33],_0x23e372),0x0;}catch(_0x33946a){return handleSDKError(_0x33946a,_0x23e372),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x204);[a27_0x10790b(0x1cb)]=a27_0x10790b(0x166);async[a27_0x10790b(0x1e4)](_0x5a27e0){const _0xa02623=a27_0x10790b,{options:_0x13de80,args:_0x46dc5c,tdx:_0x227cd7}=_0x5a27e0,_0x5ae15f=getChalk(_0x13de80);console[_0xa02623(0x203)](_0x5ae15f[_0xa02623(0x1d5)](_0xa02623(0x1ea))),console['log'](_0x5ae15f[_0xa02623(0x1d5)](_0xa02623(0x1f4))),console[_0xa02623(0x203)](_0x5ae15f[_0xa02623(0x1af)](_0xa02623(0x1f9))),console['log'](_0x5ae15f[_0xa02623(0x1af)](_0xa02623(0x13b))),console[_0xa02623(0x203)](_0x5ae15f['dim'](_0xa02623(0x16f))),console[_0xa02623(0x203)]();if(_0x46dc5c[_0xa02623(0x1e9)]===0x0)return console[_0xa02623(0x1d0)](_0xa02623(0x1a8)),console[_0xa02623(0x1d0)](_0xa02623(0x1c6)),0x1;const _0xd30c9b=_0x46dc5c[0x0],_0x4f6b87=_0x13de80,_0x4c6805=_0x4f6b87['name'],_0x51eed7=_0x4f6b87['dryRun'];try{if(!_0x51eed7){const _0x28c732=_0x227cd7[_0xa02623(0x17e)][_0xa02623(0x195)](_0xd30c9b),_0x1baf04=_0x4c6805||_0x28c732[_0xa02623(0x192)][_0xa02623(0x12e)],_0x30450a=await withSpinner(_0xa02623(0x146),()=>_0x227cd7[_0xa02623(0x17e)][_0xa02623(0x1d9)](),{'verbose':_0x13de80[_0xa02623(0x190)]}),_0x4efa77=_0x30450a[_0xa02623(0x196)][_0xa02623(0x1be)](_0x3fe860=>_0x3fe860[_0xa02623(0x186)][_0xa02623(0x20a)]===_0x1baf04);if(_0x4efa77&&!_0x13de80['yes']){const _0x2ea47a=await confirm(_0xa02623(0x16c)+_0x1baf04+_0xa02623(0x1f2));if(!_0x2ea47a)return console[_0xa02623(0x203)](_0xa02623(0x187)),0x0;}}const _0x58e2ce=await withSpinner(_0x51eed7?_0xa02623(0x160)+_0xd30c9b+_0xa02623(0x1d8):_0xa02623(0x131)+_0xd30c9b+_0xa02623(0x1d8),()=>_0x227cd7[_0xa02623(0x17e)]['restoreProject'](_0xd30c9b,{'name':_0x4c6805,'dryRun':_0x51eed7}),{'verbose':_0x13de80[_0xa02623(0x190)]}),_0x11f5d0=_0x58e2ce[_0xa02623(0x196)];return _0x11f5d0[_0xa02623(0x20c)]&&console[_0xa02623(0x203)](_0xa02623(0x184)+_0x11f5d0[_0xa02623(0x20c)]+'\x27'),_0x51eed7?console[_0xa02623(0x203)](_0xa02623(0x1de)+_0x11f5d0[_0xa02623(0x12e)]):console['log'](_0xa02623(0x199)+_0x11f5d0[_0xa02623(0x12e)]+'\x20('+_0x11f5d0[_0xa02623(0x174)]+')'),console[_0xa02623(0x203)]('\x20\x20Agents:\x20'+_0x11f5d0[_0xa02623(0x1c9)]['agents']),console[_0xa02623(0x203)](_0xa02623(0x14c)+_0x11f5d0[_0xa02623(0x1c9)][_0xa02623(0x1fd)]),console['log'](_0xa02623(0x19a)+_0x11f5d0[_0xa02623(0x1c9)][_0xa02623(0x182)]),console['log'](_0xa02623(0x173)+_0x11f5d0['counts'][_0xa02623(0x161)]),(_0x13de80['format']===_0xa02623(0x180)||_0x13de80[_0xa02623(0x144)]===_0xa02623(0x1c2))&&await handleSDKOutput([_0x11f5d0],_0x13de80),0x0;}catch(_0x28a799){return handleSDKError(_0x28a799,_0x13de80),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x507e4c,_0x5f06f3){const _0x95e39c=a27_0x10790b,_0xbe736a=_0x5f06f3[_0x95e39c(0x1b6)]||CHAT_SELECTOR_PAGE_SIZE;let _0x3e46ac=0x0,_0x3188de=[];const _0x29c2f2=(await import(_0x95e39c(0x182)))[_0x95e39c(0x19e)],_0x412556=getChalk(_0x5f06f3);while(!![]){const _0x41824b=await withSpinner(_0x95e39c(0x14a),()=>_0x507e4c[_0x95e39c(0x17e)][_0x95e39c(0x1eb)](_0xbe736a+_0x3e46ac),{'verbose':_0x5f06f3[_0x95e39c(0x190)]});_0x3188de=_0x41824b[_0x95e39c(0x196)];const _0x1302fc=_0x3188de['slice'](_0x3e46ac,_0x3e46ac+_0xbe736a),_0x1b43f4=_0x3188de[_0x95e39c(0x1e9)]>_0x3e46ac+_0xbe736a,_0x2f9ee4=[...new Set(_0x1302fc['map'](_0x257dff=>_0x257dff[_0x95e39c(0x186)][_0x95e39c(0x142)])[_0x95e39c(0x191)](_0x294204=>_0x294204!==undefined))],_0x217747=new Map();await Promise['all'](_0x2f9ee4[_0x95e39c(0x1b1)](async _0x2f646f=>{const _0x4c7f9f=_0x95e39c;try{const _0x1c8dcd=await _0x507e4c[_0x4c7f9f(0x17e)][_0x4c7f9f(0x14b)](_0x2f646f);_0x217747[_0x4c7f9f(0x16b)](_0x2f646f,_0x1c8dcd[_0x4c7f9f(0x186)]['name']);}catch{_0x217747[_0x4c7f9f(0x16b)](_0x2f646f,_0x2f646f);}}));const _0x65935d=_0x1302fc[_0x95e39c(0x1b1)](_0x3630d2=>{const _0x4f56f6=_0x95e39c,_0x19e3a5=_0x3630d2[_0x4f56f6(0x186)][_0x4f56f6(0x167)]||_0x4f56f6(0x17d),_0x17111f=_0x19e3a5[_0x4f56f6(0x19f)]('\x0a')[0x0],_0x1a5ded=_0x17111f[_0x4f56f6(0x1e9)]>0x50?_0x17111f[_0x4f56f6(0x153)](0x0,0x4d)+_0x4f56f6(0x1e7):_0x17111f,_0xea151d=_0x3630d2[_0x4f56f6(0x186)][_0x4f56f6(0x142)]?_0x217747[_0x4f56f6(0x168)](_0x3630d2['attributes'][_0x4f56f6(0x142)])||_0x3630d2[_0x4f56f6(0x186)][_0x4f56f6(0x142)]:_0x4f56f6(0x162),_0x31c4fe=_0x3630d2['attributes'][_0x4f56f6(0x1b8)]||_0x3630d2[_0x4f56f6(0x186)][_0x4f56f6(0x1a9)],_0x378d63=new Date(_0x31c4fe),_0xa00dc5=new Date(),_0x251193=_0xa00dc5[_0x4f56f6(0x1e2)]()-_0x378d63['getTime'](),_0x24de00=Math[_0x4f56f6(0x1d4)](_0x251193/0xea60),_0x46e915=Math[_0x4f56f6(0x1d4)](_0x251193/0x36ee80),_0x1749fd=Math[_0x4f56f6(0x1d4)](_0x251193/0x5265c00);let _0x580b5c;if(_0x24de00<0x1)_0x580b5c=_0x4f56f6(0x185);else{if(_0x24de00<0x3c)_0x580b5c=_0x24de00+_0x4f56f6(0x12b);else{if(_0x46e915<0x18)_0x580b5c=_0x46e915+_0x4f56f6(0x18f);else _0x1749fd<0x7?_0x580b5c=_0x1749fd+_0x4f56f6(0x1ce):_0x580b5c=_0x378d63[_0x4f56f6(0x1d3)](_0x4f56f6(0x20b),{'month':_0x4f56f6(0x1ef),'day':_0x4f56f6(0x14d)});}}return{'title':_0x1a5ded+'\x20'+_0x412556['dim']('['+_0xea151d+']\x20'+_0x580b5c),'value':_0x3630d2['id']};});_0x1b43f4&&_0x65935d['push']({'title':_0x412556[_0x95e39c(0x15c)](_0x95e39c(0x19d)),'value':_0x95e39c(0x1cf)});const _0x370bf5=await _0x29c2f2({'type':_0x95e39c(0x1f6),'name':_0x95e39c(0x140),'message':_0x95e39c(0x1cd),'choices':_0x65935d,'hint':'Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel'});if(!_0x370bf5['chatId'])return undefined;if(_0x370bf5[_0x95e39c(0x140)]==='__load_more__'){_0x3e46ac+=_0xbe736a;continue;}return _0x370bf5[_0x95e39c(0x140)];}}export class ChatsCommand extends BaseCommand{[a27_0x10790b(0x20a)]=a27_0x10790b(0x1eb);[a27_0x10790b(0x1cb)]=a27_0x10790b(0x1df);async[a27_0x10790b(0x1e4)](_0x52d87d){const _0x5e11c7=a27_0x10790b;return executeChatHistoryCommand(_0x52d87d,_0x5e11c7(0x1fe));}}
@@ -1 +1 @@
1
- function a28_0x1588(){const _0x385464=['created\x20on-demand\x20per\x20model','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','8DhTEaY','625828kyvXGF','description','2997444ORVIKp','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','log','http://0.0.0.0:','projects','12UAMrZz','llmProject','\x20\x20Site:','8641791IykauK','find','stop','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','llm:proxy','start','exit','yellow','green','SIGINT','white','\x20\x20Agents:','Server\x20Configuration:','58782Lvuxxz','\x20is\x20unavailable,\x20using\x20port\x20','name','NOT_FOUND','server','\x0aClaude\x20Code\x20Configuration:','dim','4307670SFvBeY','logger','site','execute','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','Resolving\x20project...','Starting\x20proxy\x20server...','llm','3882oqECRP','cyan','bold','close','468000jHJQVO','project','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','logLevel','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','✓\x20Proxy\x20server\x20stopped','Project\x20\x27','\x20\x20\x20\x20}','\x20\x20Project:','\x20\x20}','3682mWUVYK','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','attributes','Port\x20','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,','\x0a\x0aShutting\x20down\x20proxy\x20server...'];a28_0x1588=function(){return _0x385464;};return a28_0x1588();}const a28_0x4c5f0e=a28_0x509f;(function(_0x133bbc,_0x994bf6){const _0x428ffe=a28_0x509f,_0x25fee4=_0x133bbc();while(!![]){try{const _0x1d7a48=-parseInt(_0x428ffe(0xe2))/0x1+parseInt(_0x428ffe(0xf9))/0x2*(-parseInt(_0x428ffe(0xe9))/0x3)+parseInt(_0x428ffe(0xe4))/0x4+-parseInt(_0x428ffe(0x100))/0x5+-parseInt(_0x428ffe(0xcb))/0x6*(-parseInt(_0x428ffe(0xd9))/0x7)+parseInt(_0x428ffe(0xe1))/0x8*(parseInt(_0x428ffe(0xec))/0x9)+parseInt(_0x428ffe(0xcf))/0xa;if(_0x1d7a48===_0x994bf6)break;else _0x25fee4['push'](_0x25fee4['shift']());}catch(_0x3df871){_0x25fee4['push'](_0x25fee4['shift']());}}}(a28_0x1588,0x780ec));import a28_0x5e9362 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a28_0x509f(_0x4c2bd4,_0x27d686){_0x4c2bd4=_0x4c2bd4-0xca;const _0x1588cc=a28_0x1588();let _0x509f08=_0x1588cc[_0x4c2bd4];return _0x509f08;}import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x1c0abd,_0x50904f){const _0x56568a=a28_0x509f,{tdx:_0x495d82,options:_0x530f41}=_0x1c0abd,_0x3c163d=_0x50904f||_0x530f41[_0x56568a(0xea)];if(_0x3c163d){const _0x16b940=await _0x495d82[_0x56568a(0xca)][_0x56568a(0xe8)](),_0x1cfe49=_0x16b940['find'](_0x2aacc9=>_0x2aacc9[_0x56568a(0xdb)][_0x56568a(0xfb)]===_0x3c163d);if(!_0x1cfe49)throw new SDKError(ErrorCode[_0x56568a(0xfc)],_0x56568a(0xd5)+_0x3c163d+'\x27\x20not\x20found',undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x1cfe49['id'];}const _0x8f0548=await _0x495d82[_0x56568a(0xca)]['getOrCreateDefaultProject']();return _0x8f0548['id'];}export class LLMProxyCommand extends BaseCommand{[a28_0x4c5f0e(0xfb)]=a28_0x4c5f0e(0xf0);[a28_0x4c5f0e(0xe3)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a28_0x4c5f0e(0xfd)];['logger'];async[a28_0x4c5f0e(0x103)](_0x2a4608){const _0x257d1e=a28_0x4c5f0e,{tdx:_0x496572,options:_0x3dd490}=_0x2a4608;try{const _0x3129b9=_0x3dd490,_0x38efd0=_0x3129b9['port']||0xfa0,_0x1ecc7a=_0x3129b9[_0x257d1e(0xd0)],_0xa1bb17=await findAvailablePort(_0x38efd0);console['log'](a28_0x5e9362['dim'](_0x257d1e(0x105)));const _0xcab8a7=await getProjectIdOrDefault(_0x2a4608,_0x1ecc7a),_0x257488=await _0x496572['llm'][_0x257d1e(0xe8)](),_0x17c654=_0x257488[_0x257d1e(0xed)](_0x1775cf=>_0x1775cf['id']===_0xcab8a7);this[_0x257d1e(0x101)]=new TDXLogger(_0x3dd490[_0x257d1e(0xd2)]),await this[_0x257d1e(0x101)]['init'](),console[_0x257d1e(0xe6)](a28_0x5e9362['dim'](_0x257d1e(0x106)));_0xa1bb17!==_0x38efd0&&console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf3)](_0x257d1e(0xdc)+_0x38efd0+_0x257d1e(0xfa)+_0xa1bb17));this['server']=new ProxyServer({'port':_0xa1bb17,'projectId':_0xcab8a7,'tdx':_0x496572,'logger':this[_0x257d1e(0x101)],'site':_0x3dd490[_0x257d1e(0x102)]}),await this[_0x257d1e(0xfd)][_0x257d1e(0xf1)](),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf3)][_0x257d1e(0xcd)](_0x257d1e(0xe0))),console['log'](a28_0x5e9362['yellow'](_0x257d1e(0xda))),console['log'](a28_0x5e9362['yellow']('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf4)]['bold'](_0x257d1e(0xd1))),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xcc)](_0x257d1e(0xf8))),console[_0x257d1e(0xe6)](a28_0x5e9362['dim']('\x20\x20Address:'),a28_0x5e9362[_0x257d1e(0xf6)](_0x257d1e(0xe7)+_0xa1bb17)),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xff)](_0x257d1e(0xd7)),a28_0x5e9362['white'](_0x17c654?.[_0x257d1e(0xdb)][_0x257d1e(0xfb)]||_0xcab8a7)),console['log'](a28_0x5e9362['dim'](_0x257d1e(0xf7)),a28_0x5e9362['white'](_0x257d1e(0xdf))),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xff)](_0x257d1e(0xeb)),a28_0x5e9362[_0x257d1e(0xf6)](_0x3dd490['site'])),console['log'](a28_0x5e9362[_0x257d1e(0xcc)](_0x257d1e(0xfe))),console[_0x257d1e(0xe6)](a28_0x5e9362['dim'](_0x257d1e(0xd3))),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf6)]('\x20\x20{')),console[_0x257d1e(0xe6)](a28_0x5e9362['white']('\x20\x20\x20\x20\x22env\x22:\x20{')),console['log'](a28_0x5e9362[_0x257d1e(0xf6)](_0x257d1e(0xe5)+_0xa1bb17+'\x22,')),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf6)](_0x257d1e(0xdd))),console[_0x257d1e(0xe6)](a28_0x5e9362['white'](_0x257d1e(0x104))),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf6)](_0x257d1e(0xd6))),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf6)](_0x257d1e(0xd8))),console['log'](a28_0x5e9362['cyan']('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xff)](_0x257d1e(0xef))),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xff)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console[_0x257d1e(0xe6)](a28_0x5e9362['dim']('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x257d1e(0xe6)](a28_0x5e9362[_0x257d1e(0xf3)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x1af664=async()=>{const _0x29f965=_0x257d1e;console[_0x29f965(0xe6)](a28_0x5e9362[_0x29f965(0xff)](_0x29f965(0xde))),this[_0x29f965(0xfd)]&&await this[_0x29f965(0xfd)][_0x29f965(0xee)](),this[_0x29f965(0x101)]&&await this[_0x29f965(0x101)][_0x29f965(0xce)](),console['log'](a28_0x5e9362[_0x29f965(0xf4)](_0x29f965(0xd4))),process[_0x29f965(0xf2)](0x0);};return process['on'](_0x257d1e(0xf5),_0x1af664),process['on']('SIGTERM',_0x1af664),await new Promise(()=>{}),0x0;}catch(_0xd3ccc){this[_0x257d1e(0xfd)]&&await this[_0x257d1e(0xfd)][_0x257d1e(0xee)]();this['logger']&&await this[_0x257d1e(0x101)][_0x257d1e(0xce)]();throw _0xd3ccc;}}}
1
+ function a28_0x1bc9(_0x3c1e60,_0x1237a1){_0x3c1e60=_0x3c1e60-0x103;const _0x862602=a28_0x8626();let _0x1bc9d5=_0x862602[_0x3c1e60];return _0x1bc9d5;}const a28_0x134254=a28_0x1bc9;(function(_0x129e45,_0x15ef98){const _0x3fdf0e=a28_0x1bc9,_0x3f6a8b=_0x129e45();while(!![]){try{const _0x5d5d42=-parseInt(_0x3fdf0e(0x106))/0x1+-parseInt(_0x3fdf0e(0x13e))/0x2+-parseInt(_0x3fdf0e(0x129))/0x3*(parseInt(_0x3fdf0e(0x113))/0x4)+-parseInt(_0x3fdf0e(0x13d))/0x5*(-parseInt(_0x3fdf0e(0x121))/0x6)+parseInt(_0x3fdf0e(0x10c))/0x7+parseInt(_0x3fdf0e(0x11f))/0x8+parseInt(_0x3fdf0e(0x105))/0x9;if(_0x5d5d42===_0x15ef98)break;else _0x3f6a8b['push'](_0x3f6a8b['shift']());}catch(_0x399899){_0x3f6a8b['push'](_0x3f6a8b['shift']());}}}(a28_0x8626,0xbdf44));function a28_0x8626(){const _0x1bc159=['Port\x20','site','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','5iIiodS','2873906axTRnK','attributes','start','Server\x20Configuration:','logger','projects','cyan','\x0aTesting\x20with\x20Agent\x20SDK:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,','Starting\x20proxy\x20server...','15018183nZcmke','133903pbECeq','created\x20on-demand\x20per\x20model','dim','SIGTERM','\x20is\x20unavailable,\x20using\x20port\x20','SIGINT','2682204OQHfQO','find','white','\x20\x20\x20\x20\x22env\x22:\x20{','log','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','1948gZWdAU','llm','name','http://0.0.0.0:','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','stop','description','Project\x20\x27','\x20\x20Project:','logLevel','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','server','8363288dIbyJD','exit','2543082cKTeDQ','\x20\x20Address:','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','execute','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20Site:','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','7221qgPYHE','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','yellow','\x0aClaude\x20Code\x20Configuration:','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','llm:proxy','\x20\x20\x20\x20}','close','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','bold','✓\x20Proxy\x20server\x20stopped','init','\x20\x20Agents:','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','Resolving\x20project...','\x27\x20not\x20found','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.'];a28_0x8626=function(){return _0x1bc159;};return a28_0x8626();}import a28_0x5734ed from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x33d3f6,_0x4e02ad){const _0xceff50=a28_0x1bc9,{tdx:_0x474bc5,options:_0x23ba11}=_0x33d3f6,_0x44f9ba=_0x4e02ad||_0x23ba11['llmProject'];if(_0x44f9ba){const _0x5db379=await _0x474bc5[_0xceff50(0x114)][_0xceff50(0x143)](),_0x251381=_0x5db379[_0xceff50(0x10d)](_0x4558a9=>_0x4558a9[_0xceff50(0x13f)]['name']===_0x44f9ba);if(!_0x251381)throw new SDKError(ErrorCode['NOT_FOUND'],_0xceff50(0x11a)+_0x44f9ba+_0xceff50(0x138),undefined,{'helpText':_0xceff50(0x11d)});return _0x251381['id'];}const _0x5452bc=await _0x474bc5[_0xceff50(0x114)]['getOrCreateDefaultProject']();return _0x5452bc['id'];}export class LLMProxyCommand extends BaseCommand{[a28_0x134254(0x115)]=a28_0x134254(0x12e);[a28_0x134254(0x119)]=a28_0x134254(0x126);[a28_0x134254(0x11e)];['logger'];async[a28_0x134254(0x125)](_0x46e0a3){const _0x5b4f35=a28_0x134254,{tdx:_0x1d2249,options:_0x36ad05}=_0x46e0a3;try{const _0x1f312e=_0x36ad05,_0x1451d2=_0x1f312e['port']||0xfa0,_0x47ab8f=_0x1f312e['project'],_0x36973d=await findAvailablePort(_0x1451d2);console['log'](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x137)));const _0x350db5=await getProjectIdOrDefault(_0x46e0a3,_0x47ab8f),_0xa99073=await _0x1d2249[_0x5b4f35(0x114)][_0x5b4f35(0x143)](),_0x22cf0b=_0xa99073[_0x5b4f35(0x10d)](_0x1aa752=>_0x1aa752['id']===_0x350db5);this[_0x5b4f35(0x142)]=new TDXLogger(_0x36ad05[_0x5b4f35(0x11c)]),await this[_0x5b4f35(0x142)][_0x5b4f35(0x134)](),console['log'](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x104)));_0x36973d!==_0x1451d2&&console[_0x5b4f35(0x110)](a28_0x5734ed['yellow'](_0x5b4f35(0x13a)+_0x1451d2+_0x5b4f35(0x10a)+_0x36973d));this['server']=new ProxyServer({'port':_0x36973d,'projectId':_0x350db5,'tdx':_0x1d2249,'logger':this[_0x5b4f35(0x142)],'site':_0x36ad05['site']}),await this[_0x5b4f35(0x11e)][_0x5b4f35(0x140)](),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x12b)][_0x5b4f35(0x132)](_0x5b4f35(0x117))),console['log'](a28_0x5734ed[_0x5b4f35(0x12b)](_0x5b4f35(0x139))),console['log'](a28_0x5734ed['yellow'](_0x5b4f35(0x128))),console[_0x5b4f35(0x110)](a28_0x5734ed['green'][_0x5b4f35(0x132)](_0x5b4f35(0x12d))),console['log'](a28_0x5734ed['cyan'](_0x5b4f35(0x141))),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x122)),a28_0x5734ed['white'](_0x5b4f35(0x116)+_0x36973d)),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x11b)),a28_0x5734ed[_0x5b4f35(0x10e)](_0x22cf0b?.[_0x5b4f35(0x13f)][_0x5b4f35(0x115)]||_0x350db5)),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x135)),a28_0x5734ed[_0x5b4f35(0x10e)](_0x5b4f35(0x107))),console['log'](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x127)),a28_0x5734ed[_0x5b4f35(0x10e)](_0x36ad05[_0x5b4f35(0x13b)])),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x144)](_0x5b4f35(0x12c))),console['log'](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x123))),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x10e)]('\x20\x20{')),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x10e)](_0x5b4f35(0x10f))),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x10e)](_0x5b4f35(0x13c)+_0x36973d+'\x22,')),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x10e)](_0x5b4f35(0x103))),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x10e)](_0x5b4f35(0x131))),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x10e)](_0x5b4f35(0x12f))),console['log'](a28_0x5734ed[_0x5b4f35(0x10e)]('\x20\x20}')),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x144)](_0x5b4f35(0x145))),console[_0x5b4f35(0x110)](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x111))),console['log'](a28_0x5734ed[_0x5b4f35(0x108)](_0x5b4f35(0x136))),console[_0x5b4f35(0x110)](a28_0x5734ed['dim'](_0x5b4f35(0x12a))),console[_0x5b4f35(0x110)](a28_0x5734ed['yellow'](_0x5b4f35(0x112)));const _0x1f28db=async()=>{const _0xc4e4b3=_0x5b4f35;console[_0xc4e4b3(0x110)](a28_0x5734ed['dim'](_0xc4e4b3(0x124))),this[_0xc4e4b3(0x11e)]&&await this[_0xc4e4b3(0x11e)][_0xc4e4b3(0x118)](),this[_0xc4e4b3(0x142)]&&await this[_0xc4e4b3(0x142)]['close'](),console[_0xc4e4b3(0x110)](a28_0x5734ed['green'](_0xc4e4b3(0x133))),process[_0xc4e4b3(0x120)](0x0);};return process['on'](_0x5b4f35(0x10b),_0x1f28db),process['on'](_0x5b4f35(0x109),_0x1f28db),await new Promise(()=>{}),0x0;}catch(_0x45c225){this[_0x5b4f35(0x11e)]&&await this[_0x5b4f35(0x11e)]['stop']();this[_0x5b4f35(0x142)]&&await this[_0x5b4f35(0x142)][_0x5b4f35(0x130)]();throw _0x45c225;}}}
@@ -1 +1 @@
1
- const a29_0x192174=a29_0x193b;(function(_0x443d3d,_0x47e923){const _0x40d020=a29_0x193b,_0x5441ad=_0x443d3d();while(!![]){try{const _0x3542bc=parseInt(_0x40d020(0x29e))/0x1+parseInt(_0x40d020(0x1cc))/0x2+parseInt(_0x40d020(0x2c6))/0x3+-parseInt(_0x40d020(0x1be))/0x4+-parseInt(_0x40d020(0x25f))/0x5+-parseInt(_0x40d020(0x215))/0x6*(-parseInt(_0x40d020(0x281))/0x7)+-parseInt(_0x40d020(0x1dd))/0x8;if(_0x3542bc===_0x47e923)break;else _0x5441ad['push'](_0x5441ad['shift']());}catch(_0x5674db){_0x5441ad['push'](_0x5441ad['shift']());}}}(a29_0x20ad,0x30e6b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';function a29_0x20ad(){const _0x1b377a=['displaySampleData','stats','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','displayColumns','all','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','resolveParentId','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','schemaValid','allValid','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20--behavior\x20\x22','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','customerPercent','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','963660mrmxEt','Fetching\x20parent\x20segment\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','database','\x0aUsage:\x20tdx\x20ps\x20preview\x20','number','query','Session:','Analyzing\x20changes...','Master\x20Table','isDirectory','tdx\x20segment\x20parent\x20preview\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','550324wtFHuL','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20field','\x20parent\x20segment\x20\x27','\x20--attribute\x20\x22','getParentSQL','Created','yes','Resolving\x20parent\x20segment\x20\x27','open','sampleData','List\x20available\x20fields\x20for\x20segmentation','customersWithEvents','map','\x27\x20is\x20up\x20to\x20date','Rows:','toLocaleString','4320136rHJeNX','segment:parent:validate','joinKey','Listing\x20fields\x20for\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','name','match','Aborted.','.yml','behavior','YAML\x20file:\x20','parent_segment','\x20--enriched','red','elapsedTimeMillis','/{name}.yml\x0a','start','\x0aChanges\x20to\x20\x27','✔\x20No\x20changes\x20-\x20\x27','data','\x20=\x20','Attribute:','output','\x20--behavior\x20\x22<name>\x22','\x27...','✔\x20Query\x20completed:\x20Processed\x20','pushParentYaml','Status:','darwin','table','Source:','platform','jobId','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','format','dim','scheduleType','foreignKey','displayPreviewHints','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20--interval\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','listFields','attributes','yellow','Columns:','bold','\x27\x20is\x20already\x20up\x20to\x20date','\x20--attribute\x20\x22<name>\x22','Creating','Listing\x20parent\x20segments\x20matching\x20\x27','✔\x20Updated\x20parent\x20segment\x20\x27','displayBehaviorsStats','timezone','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','6Guutyr','\x5c$&','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','sort','addAttributes','Error:','displayValidateResults','Output\x20file:\x20','Database:\x20','\x20[Job\x20ID:\x20','segment:parent:fields','segment:parent:list','using\x20the\x20default\x20path:\x20','displayMasterInfo','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','To\x20view\x20sample\x20data:','List\x20parent\x20segments','customerGroup','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','workflowAttemptId','Fetching\x20current\x20configuration\x20for\x20\x27','segment:parent:show','Error:\x20File\x20not\x20found:\x20','log','totalEvents','scheduleOption','join','✔\x20Found\x20','Options\x20(one\x20required):\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Listing\x20parent\x20segments...','`\x20to\x20download\x20the\x20configuration\x20first','displayAttributesStats','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','segment:parent:pull','green','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','string','FINISHED','/\x20directories\x20exist.','Name:\x20','\x0aNew\x20parent\x20segment\x20\x27','apply','ignore','displaySummary','coveragePercent','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','master','/\x20directory.\x0a','Updating\x20parent\x20segment\x20\x27','Master\x20+\x20Attributes','/\x20→\x20','Master:','Options:\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','description','runParent','\x27\x20and\x20run\x20workflow?','schemaError','Preview:','Behaviors','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Behavior:','utf-8','✔\x20Created\x20parent\x20segment\x20\x27','.yaml','No\x20parent\x20segments\x20found','interval','parentSegment','segment:parent:desc','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','867455YmODfE','session','createParent','endsWith','Executing\x20parent\x20segment\x20query...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20kill','\x0aChanges\x20to\x20apply\x20to\x20\x27','run','addAttributesFile','column','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Available\x20behaviors:','test','workflowId','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Validating\x20configuration...','\x0a⚠️\x20\x20Migrating:\x20','/sessions/','Fetching\x20SQL\x20for\x20\x27','workflowSessionId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','jsonl','\x20\x20\x20\x20-\x20','previewParentYaml','Found\x20YAML\x20file:\x20','SQL\x20query:\x0a','/app/workflows/','Site:\x20','\x0a✔\x20Workflow\x20started','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','/attempt/','segment:parent:push','addBehaviors','2323454VIuMGC','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Apply\x20changes\x20to\x20\x27','\x27\x20with\x20ID:\x20','setJobId','\x20parent\x20segment','Errors:','cyan','👥\x20','segment','site','length','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','population','Error\x20reading\x20file:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Error:\x20Parent\x20segment\x20name\x20is\x20required','trim','toFixed','text','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','columns','Join\x20on:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','in\x20','Parent\x20segment:\x20','listParents','enriched','201153RKjfDm','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','json','varchar','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','attributesFile','/app/dw/parentSegments/','error','pullParentYaml','Coverage:','stop','\x20rows)','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','rowCount','customerGroupFile','displayPreviewResults','message','attribute','Customers:','matchedCount','Error\x20parsing\x20YAML:\x20','keys','execute','filter','replace','verbose','addBehaviorsFile','getParentFull','xdg-open','✔\x20Renamed\x20directory\x20to\x20','updateParent','Join:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20No\x20sample\x20data\x20available','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','errors','Pattern:\x20','repeat','1039455BqUfqJ','Validate:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','label','behaviors','preview','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Create\x20parent\x20segment\x20\x27','segment:parent:run','Updating'];a29_0x20ad=function(){return _0x1b377a;};return a29_0x20ad();}import a29_0x46e08e 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';function a29_0x193b(_0x44c409,_0x43ebbf){_0x44c409=_0x44c409-0x1b4;const _0x20adc4=a29_0x20ad();let _0x193ba8=_0x20adc4[_0x44c409];return _0x193ba8;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x4cd30e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0xcd05af){const _0x18542e=a29_0x193b,_0x209be4=process[_0x18542e(0x1fc)],_0x87378e=_0x209be4===_0x18542e(0x1f9)?_0x18542e(0x1d5):_0x209be4==='win32'?_0x18542e(0x1ed):_0x18542e(0x2bc);spawn(_0x87378e,[_0xcd05af],{'detached':!![],'stdio':_0x18542e(0x242)})['unref']();}function migrateLegacyDirectory(){const _0x1242f7=a29_0x193b;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x48b660=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x48b660[_0x1242f7(0x1c8)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x1242f7(0x2a6)](a29_0x4cd30e[_0x1242f7(0x20a)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x1242f7(0x23e))),console[_0x1242f7(0x2a6)](a29_0x4cd30e['dim'](_0x1242f7(0x25e)+LEGACY_PARENT_SEGMENT_DIR+_0x1242f7(0x247))),![];console[_0x1242f7(0x2a6)](a29_0x4cd30e[_0x1242f7(0x20a)](_0x1242f7(0x270)+LEGACY_PARENT_SEGMENT_DIR+_0x1242f7(0x24a)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x4cd30e[_0x1242f7(0x239)](_0x1242f7(0x2bd)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x22fd34){const _0x543522=_0x22fd34 instanceof Error?_0x22fd34[_0x1242f7(0x2b0)]:String(_0x22fd34);return console['error'](a29_0x4cd30e['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x543522+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x192174(0x267)](_0x1f18a6){const _0x5ffa0d=a29_0x192174;return migrateLegacyDirectory(),super[_0x5ffa0d(0x267)](_0x1f18a6);}}function resolveYamlFile(_0x4ff979){const _0x51f9c8=a29_0x192174;if(_0x4ff979[_0x51f9c8(0x262)](_0x51f9c8(0x1e5))||_0x4ff979[_0x51f9c8(0x262)](_0x51f9c8(0x258)))return _0x4ff979;return a29_0x46e08e[_0x51f9c8(0x22f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4ff979)+_0x51f9c8(0x1e5));}function formatProgressMessage(_0x5302a0){const _0x8299de=a29_0x192174,_0x20aba1=_0x5302a0[_0x8299de(0x1e3)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x20aba1){const [,_0x8388c9,_0x1d34a5,_0x29d37e='']=_0x20aba1;return a29_0x4cd30e[_0x8299de(0x201)](_0x8388c9+':')+'\x20'+_0x1d34a5+a29_0x4cd30e[_0x8299de(0x201)](_0x29d37e);}return a29_0x4cd30e[_0x8299de(0x201)](_0x5302a0);}function showFileNotFoundError(_0x5c6c39,_0x10e0f8){const _0x220ef6=a29_0x192174;console[_0x220ef6(0x2a6)](a29_0x4cd30e[_0x220ef6(0x1ea)](_0x220ef6(0x22b)+_0x5c6c39+'\x0a')),console[_0x220ef6(0x2a6)](a29_0x4cd30e['cyan'](_0x220ef6(0x26a)+_0x10e0f8+_0x220ef6(0x234)));}function showParentSegmentNotSetError(_0x4edbcc){const _0x2a390a=a29_0x192174;console[_0x2a390a(0x2a6)](a29_0x4cd30e[_0x2a390a(0x20a)](_0x2a390a(0x207))),console[_0x2a390a(0x2a6)](_0x4edbcc);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x220);[a29_0x192174(0x24e)]=a29_0x192174(0x225);async[a29_0x192174(0x2b6)](_0x4e56bc){const _0x1a159f=a29_0x192174,{options:_0x12d0a3,args:_0x57819b,tdx:_0x1dad05}=_0x4e56bc,_0x161021=_0x57819b[0x0];_0x12d0a3[_0x1a159f(0x2b9)]&&(console[_0x1a159f(0x2a6)](_0x1a159f(0x27b)+_0x12d0a3[_0x1a159f(0x28b)]),_0x161021&&console[_0x1a159f(0x2a6)](_0x1a159f(0x2c4)+_0x161021));const _0x11c498=await withSpinner(_0x161021?_0x1a159f(0x210)+_0x161021+_0x1a159f(0x1f5):_0x1a159f(0x233),()=>_0x1dad05['segment'][_0x1a159f(0x29c)](),{'verbose':_0x12d0a3[_0x1a159f(0x2b9)]});let _0x209410=_0x11c498['data'];if(_0x161021){const _0x62884a=_0x161021[_0x1a159f(0x2b8)](/[.+^${}()|[\]\\]/g,_0x1a159f(0x216))[_0x1a159f(0x2b8)](/\*/g,'.*')[_0x1a159f(0x2b8)](/\?/g,'.'),_0x42b4b2=new RegExp('^'+_0x62884a+'$','i');_0x209410=_0x209410[_0x1a159f(0x2b7)](_0x20a669=>_0x42b4b2[_0x1a159f(0x26c)](_0x20a669['attributes'][_0x1a159f(0x1e2)]));}_0x209410[_0x1a159f(0x218)]((_0xc09054,_0x347ecd)=>_0xc09054[_0x1a159f(0x209)][_0x1a159f(0x1e2)]['localeCompare'](_0x347ecd[_0x1a159f(0x209)][_0x1a159f(0x1e2)])),console['error']('✔\x20Found\x20'+_0x209410[_0x1a159f(0x28c)]+_0x1a159f(0x286)+(_0x209410[_0x1a159f(0x28c)]!==0x1?'s':''));if(_0x12d0a3[_0x1a159f(0x200)]===_0x1a159f(0x2a0)||_0x12d0a3[_0x1a159f(0x200)]===_0x1a159f(0x275))await handleSDKOutput(_0x209410,_0x12d0a3);else{if(_0x209410[_0x1a159f(0x28c)]===0x0)_0x161021?console['log']('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x161021):console['log'](_0x1a159f(0x259));else for(const _0x2fb2f9 of _0x209410){const _0x55a714=_0x2fb2f9[_0x1a159f(0x209)][_0x1a159f(0x28e)]?a29_0x4cd30e[_0x1a159f(0x201)]('\x20('+formatRows(_0x2fb2f9['attributes']['population'])+')'):'';console[_0x1a159f(0x22c)](_0x1a159f(0x289)+_0x2fb2f9['attributes']['name']+_0x55a714);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']='segment:parent:create';[a29_0x192174(0x24e)]=a29_0x192174(0x23b);async[a29_0x192174(0x2b6)](_0x264ef2){const _0x37d869=a29_0x192174,{options:_0x20fd97,args:_0x3360a6,tdx:_0x518c2e}=_0x264ef2;console[_0x37d869(0x2a6)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0xd2f34f=_0x20fd97;if(_0x3360a6[_0x37d869(0x28c)]===0x0)return console['error'](a29_0x4cd30e['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x37d869(0x2a6)](_0x37d869(0x296)),0x1;const _0x1ca10e=_0x3360a6[0x0];if(!_0xd2f34f['database']||!_0xd2f34f[_0x37d869(0x1fa)])return console['error'](_0x37d869(0x290)),console[_0x37d869(0x2a6)](_0x37d869(0x296)),0x1;_0xd2f34f[_0x37d869(0x2b9)]&&(console[_0x37d869(0x2a6)](_0x37d869(0x27b)+_0xd2f34f[_0x37d869(0x28b)]),console[_0x37d869(0x2a6)](_0x37d869(0x23f)+_0x1ca10e),console[_0x37d869(0x2a6)](_0x37d869(0x21d)+_0xd2f34f['database']),console[_0x37d869(0x2a6)]('Table:\x20'+_0xd2f34f[_0x37d869(0x1fa)]));const _0x455d8d=await loadJSONFromOptions(_0xd2f34f[_0x37d869(0x209)],_0xd2f34f[_0x37d869(0x2a4)]),_0x36c080=await loadJSONFromOptions(_0xd2f34f[_0x37d869(0x2cb)],_0xd2f34f['behaviorsFile']),_0x55fcae=await loadJSONFromOptions(_0xd2f34f[_0x37d869(0x226)],_0xd2f34f[_0x37d869(0x2ae)]),_0xbc87f={'name':_0x1ca10e,'description':_0xd2f34f[_0x37d869(0x24e)],'scheduleType':_0xd2f34f['scheduleType'],'scheduleOption':_0xd2f34f[_0x37d869(0x22e)],'timezone':_0xd2f34f[_0x37d869(0x213)],'master':{'parentDatabaseName':_0xd2f34f[_0x37d869(0x1c1)],'parentTableName':_0xd2f34f['table']},'attributes':_0x455d8d,'behaviors':_0x36c080,'customerGroup':_0x55fcae},_0x4e98dc=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1ca10e+_0x37d869(0x1f5),()=>_0x518c2e[_0x37d869(0x28a)][_0x37d869(0x261)](_0xbc87f),{'verbose':_0x20fd97[_0x37d869(0x2b9)]}),_0x23acde=_0x4e98dc[_0x37d869(0x1f0)];return console[_0x37d869(0x2a6)](_0x37d869(0x257)+_0x23acde[_0x37d869(0x1e2)]+_0x37d869(0x284)+_0x23acde['id']),await handleSDKOutput([_0x23acde],_0x20fd97),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x192174(0x1e2)]='segment:parent:update';[a29_0x192174(0x24e)]=a29_0x192174(0x291);async[a29_0x192174(0x2b6)](_0x1fbd45){const _0x573eb1=a29_0x192174,{options:_0x2f2c18,args:_0x281f06,tdx:_0x533bcf}=_0x1fbd45;console[_0x573eb1(0x2a6)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x573eb1(0x232));const _0x52812e=_0x2f2c18;if(_0x281f06[_0x573eb1(0x28c)]===0x0)return console[_0x573eb1(0x2a6)](a29_0x4cd30e['red'](_0x573eb1(0x292))),console['error'](_0x573eb1(0x254)),0x1;const _0x23bd34=_0x281f06[0x0];_0x52812e[_0x573eb1(0x2b9)]&&(console[_0x573eb1(0x2a6)](_0x573eb1(0x27b)+_0x52812e[_0x573eb1(0x28b)]),console[_0x573eb1(0x2a6)](_0x573eb1(0x29b)+_0x23bd34));const _0x4d75e8=await withSpinner(_0x573eb1(0x229)+_0x23bd34+'\x27...',()=>_0x533bcf[_0x573eb1(0x28a)][_0x573eb1(0x2bb)](_0x23bd34),{'verbose':_0x52812e[_0x573eb1(0x2b9)]}),_0x532aa3=_0x4d75e8[_0x573eb1(0x1f0)],_0x2f10e0=await loadJSONFromOptions(_0x52812e[_0x573eb1(0x219)],_0x52812e[_0x573eb1(0x268)]),_0x43c7f2=await loadJSONFromOptions(_0x52812e[_0x573eb1(0x280)],_0x52812e[_0x573eb1(0x2ba)]),_0x551a5d={'name':_0x532aa3[_0x573eb1(0x1e2)],'description':_0x52812e[_0x573eb1(0x24e)]!==undefined?_0x52812e[_0x573eb1(0x24e)]:_0x532aa3[_0x573eb1(0x24e)],'scheduleType':_0x52812e[_0x573eb1(0x202)]!==undefined?_0x52812e['scheduleType']:_0x532aa3[_0x573eb1(0x202)],'scheduleOption':_0x52812e[_0x573eb1(0x22e)]!==undefined?_0x52812e[_0x573eb1(0x22e)]:_0x532aa3[_0x573eb1(0x22e)],'timezone':_0x52812e['timezone']!==undefined?_0x52812e[_0x573eb1(0x213)]:_0x532aa3[_0x573eb1(0x213)],'master':_0x532aa3[_0x573eb1(0x246)],'attributes':_0x2f10e0?[..._0x532aa3[_0x573eb1(0x209)]||[],..._0x2f10e0]:_0x532aa3['attributes'],'behaviors':_0x43c7f2?[..._0x532aa3['behaviors']||[],..._0x43c7f2]:_0x532aa3[_0x573eb1(0x2cb)],'customerGroup':_0x532aa3[_0x573eb1(0x226)]},_0x485301=await withSpinner(_0x573eb1(0x248)+_0x23bd34+_0x573eb1(0x1f5),()=>_0x533bcf[_0x573eb1(0x28a)][_0x573eb1(0x2be)](_0x23bd34,_0x551a5d),{'verbose':_0x52812e[_0x573eb1(0x2b9)]}),_0x5e23e5=_0x485301[_0x573eb1(0x1f0)];return console[_0x573eb1(0x2a6)](_0x573eb1(0x211)+_0x5e23e5[_0x573eb1(0x1e2)]+'\x27'),await handleSDKOutput([_0x5e23e5],_0x52812e),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x238);[a29_0x192174(0x24e)]=a29_0x192174(0x1cd);async[a29_0x192174(0x2b6)](_0x5b62b3){const _0x471990=a29_0x192174,{options:_0x24881b,args:_0x972473,tdx:_0x51f1cd}=_0x5b62b3,_0x42881c=_0x24881b,_0x4e5554=_0x972473[0x0]||_0x24881b[_0x471990(0x25b)];if(!_0x4e5554)return showParentSegmentNotSetError(_0x471990(0x1cb)+_0x471990(0x2a2)),0x1;if(_0x42881c['use']&&_0x42881c['output'])return console['error'](a29_0x4cd30e[_0x471990(0x1ea)](_0x471990(0x2d4))),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x201)](_0x471990(0x1ca))),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x201)](_0x471990(0x221)+PARENT_SEGMENT_DIR+_0x471990(0x1ec))),console['error'](a29_0x4cd30e[_0x471990(0x288)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x154816=_0x42881c[_0x471990(0x1f3)]||a29_0x46e08e[_0x471990(0x22f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4e5554)+_0x471990(0x1e5));_0x42881c[_0x471990(0x2b9)]&&(console['error'](_0x471990(0x27b)+_0x42881c[_0x471990(0x28b)]),console[_0x471990(0x2a6)]('Parent\x20segment:\x20'+_0x4e5554),console[_0x471990(0x2a6)](_0x471990(0x21c)+_0x154816));const _0x207896=await withSpinner(_0x471990(0x1bf)+_0x4e5554+_0x471990(0x1f5),()=>_0x51f1cd[_0x471990(0x28a)][_0x471990(0x2a7)](_0x4e5554),{'verbose':_0x42881c[_0x471990(0x2b9)]}),_0x2d289b=_0x207896['data'];if(existsSync(_0x154816)){const _0x46dd99=readFileSync(_0x154816,_0x471990(0x256)),_0xa13606=generateDiff(_0x46dd99,_0x2d289b);if(!hasChanges(_0xa13606))console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x239)]('✔')+'\x20No\x20changes\x20-\x20'+a29_0x4cd30e[_0x471990(0x288)](_0x154816)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x471990(0x1ee)+_0x154816+'\x27:'),console[_0x471990(0x2a6)]('─'[_0x471990(0x2c5)](0x3c)),console[_0x471990(0x2a6)](formatDiffWithColors(_0xa13606)),console[_0x471990(0x2a6)]('─'[_0x471990(0x2c5)](0x3c));if(!_0x42881c['yes']){const _0x3b42e4=await confirmKey('Overwrite\x20\x27'+_0x154816+'\x27?');if(!_0x3b42e4)return console[_0x471990(0x2a6)]('Aborted.'),0x1;}writeFileSync(_0x154816,_0x2d289b,_0x471990(0x256)),console[_0x471990(0x2a6)](a29_0x4cd30e['green']('✔')+_0x471990(0x26e)+a29_0x4cd30e[_0x471990(0x288)](_0x154816));}}else{const _0x1f90fb=a29_0x46e08e['dirname'](_0x154816);!existsSync(_0x1f90fb)&&mkdirSync(_0x1f90fb,{'recursive':!![]}),writeFileSync(_0x154816,_0x2d289b,_0x471990(0x256)),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x239)]('✔')+_0x471990(0x26e)+a29_0x4cd30e[_0x471990(0x288)](_0x154816));}return saveSessionContext({'parent_segment':_0x4e5554},_0x42881c[_0x471990(0x260)]),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x239)]('✔')+'\x20Context\x20set:\x20'+a29_0x4cd30e[_0x471990(0x201)](_0x471990(0x1e8))+_0x471990(0x1f1)+a29_0x4cd30e[_0x471990(0x288)](_0x4e5554)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x27f);[a29_0x192174(0x24e)]=a29_0x192174(0x1ff);async[a29_0x192174(0x2b6)](_0x5b61a7){const _0x79d5d8=a29_0x192174,{options:_0x484730,args:_0x142f21,tdx:_0x1fd95}=_0x5b61a7,_0x52282d=_0x484730,_0x258d4b=_0x142f21[0x0]||_0x484730[_0x79d5d8(0x25b)];if(!_0x258d4b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x79d5d8(0x2d5)),0x1;const _0x44782d=resolveYamlFile(_0x258d4b);if(!existsSync(_0x44782d))return showFileNotFoundError(_0x44782d,_0x258d4b),0x1;_0x52282d[_0x79d5d8(0x2b9)]&&(console[_0x79d5d8(0x2a6)](_0x79d5d8(0x27b)+_0x52282d['site']),console[_0x79d5d8(0x2a6)](_0x79d5d8(0x1e7)+_0x44782d));let _0x13887f;try{_0x13887f=readFileSync(_0x44782d,'utf-8');}catch(_0x391209){const _0x58086d=_0x391209 instanceof Error?_0x391209[_0x79d5d8(0x2b0)]:String(_0x391209);return console[_0x79d5d8(0x2a6)]('Error\x20reading\x20file:\x20'+_0x58086d),0x1;}const _0x4cf654=await withSpinner(_0x79d5d8(0x1c6),()=>_0x1fd95[_0x79d5d8(0x28a)][_0x79d5d8(0x1f7)](_0x13887f),{'verbose':_0x52282d[_0x79d5d8(0x2b9)]}),_0x9689e6=_0x4cf654[_0x79d5d8(0x1f0)],{isNew:_0x358b2c,name:_0x18d017,hasChanges:_0x4be11a,diffFormatted:_0x1f5d5b}=_0x9689e6;if(!_0x4be11a)return console['error'](_0x79d5d8(0x1ef)+_0x18d017+_0x79d5d8(0x20d)),0x0;_0x358b2c?console[_0x79d5d8(0x2a6)](_0x79d5d8(0x240)+_0x18d017+'\x27:'):console[_0x79d5d8(0x2a6)](_0x79d5d8(0x266)+_0x18d017+'\x27:');console[_0x79d5d8(0x2a6)]('─'[_0x79d5d8(0x2c5)](0x3c)),console[_0x79d5d8(0x2a6)](_0x1f5d5b),console[_0x79d5d8(0x2a6)]('─'['repeat'](0x3c));const _0x3f797a=_0x358b2c?_0x79d5d8(0x2ce)+_0x18d017+'\x27?':_0x79d5d8(0x283)+_0x18d017+'\x27?';if(!_0x52282d[_0x79d5d8(0x1d3)]){const _0x3b185f=await confirmKey(_0x3f797a);if(!_0x3b185f)return console[_0x79d5d8(0x2a6)](_0x79d5d8(0x1e4)),0x1;}const _0x42bafd=_0x358b2c?_0x79d5d8(0x20f):_0x79d5d8(0x2d0),_0x58c31c=await withSpinner(_0x42bafd+_0x79d5d8(0x1cf)+_0x18d017+_0x79d5d8(0x1f5),()=>_0x9689e6[_0x79d5d8(0x241)](),{'verbose':_0x52282d[_0x79d5d8(0x2b9)]}),_0x36f2f1=_0x58c31c[_0x79d5d8(0x1f0)],_0x474117=getConsoleNextUrl(_0x52282d['site'],'/app/dw/parentSegments/'+_0x36f2f1['id']),_0x1b8e78=_0x358b2c?_0x79d5d8(0x1d2):'Updated';return console[_0x79d5d8(0x2a6)]('✔\x20'+_0x1b8e78+_0x79d5d8(0x1cf)+_0x36f2f1[_0x79d5d8(0x1e2)]+'\x27'),console[_0x79d5d8(0x2a6)]('\x20\x20'+_0x474117),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x1de);[a29_0x192174(0x24e)]=a29_0x192174(0x25d);async[a29_0x192174(0x2b6)](_0x39df52){const _0x50adf2=a29_0x192174,{options:_0x316094,args:_0x27222a,tdx:_0x5025ee}=_0x39df52,_0x4107fe=_0x316094,_0xb240b0=_0x27222a[0x0]||_0x316094[_0x50adf2(0x25b)];if(!_0xb240b0)return showParentSegmentNotSetError(_0x50adf2(0x2c2)+_0x50adf2(0x282)+_0x50adf2(0x24c)+_0x50adf2(0x2d3)+_0x50adf2(0x1fe)+_0x50adf2(0x1e1)),0x1;const _0x5428ae=resolveYamlFile(_0xb240b0);if(!existsSync(_0x5428ae))return showFileNotFoundError(_0x5428ae,_0xb240b0),0x1;_0x4107fe[_0x50adf2(0x2b9)]&&(console[_0x50adf2(0x2a6)](_0x50adf2(0x27b)+_0x4107fe[_0x50adf2(0x28b)]),console[_0x50adf2(0x2a6)]('YAML\x20file:\x20'+_0x5428ae));let _0x18ebac;try{_0x18ebac=readFileSync(_0x5428ae,_0x50adf2(0x256));}catch(_0x314c7f){const _0x3e198a=_0x314c7f instanceof Error?_0x314c7f['message']:String(_0x314c7f);return console[_0x50adf2(0x2a6)](_0x50adf2(0x28f)+_0x3e198a),0x1;}const _0x2ce437=createCommandSpinner(a29_0x4cd30e[_0x50adf2(0x201)](_0x50adf2(0x26f)),{'verbose':_0x4107fe[_0x50adf2(0x2b9)]});_0x2ce437[_0x50adf2(0x1ed)]();const _0x288c50={'onProgress':_0xfb62d8=>{const _0xedb851=_0x50adf2;_0x2ce437[_0xedb851(0x295)]=formatProgressMessage(_0xfb62d8);}};if(_0x4107fe[_0x50adf2(0x246)])_0x288c50[_0x50adf2(0x246)]=!![];if(_0x4107fe[_0x50adf2(0x29d)])_0x288c50[_0x50adf2(0x29d)]=!![];_0x4107fe[_0x50adf2(0x2b1)]&&(_0x288c50['attribute']=_0x4107fe['attribute']);_0x4107fe[_0x50adf2(0x1e6)]&&(_0x288c50['behavior']=_0x4107fe[_0x50adf2(0x1e6)]);if(_0x4107fe[_0x50adf2(0x25a)])_0x288c50[_0x50adf2(0x25a)]=_0x4107fe[_0x50adf2(0x25a)];let _0x123e62;try{_0x123e62=await _0x5025ee[_0x50adf2(0x28a)]['validateParentYaml'](_0x18ebac,_0x288c50),_0x2ce437[_0x50adf2(0x2a9)]();}catch(_0x47aee7){_0x2ce437[_0x50adf2(0x2a9)]();throw _0x47aee7;}const _0x92fdec=_0x4107fe[_0x50adf2(0x25a)]||'-1d';return this['displayValidateResults'](_0x123e62,_0x288c50,_0x5428ae,_0x92fdec),_0x123e62['allValid']?0x0:0x1;}[a29_0x192174(0x21b)](_0x4a10eb,_0x11dcca,_0x3e58b2,_0x2e32ec){const _0x423d9e=a29_0x192174;console['error']('\x0a'+a29_0x4cd30e[_0x423d9e(0x20c)](_0x423d9e(0x2c7))+'\x20'+_0x4a10eb[_0x423d9e(0x1e2)]),console[_0x423d9e(0x2a6)]('═'[_0x423d9e(0x2c5)](0x3c)),this[_0x423d9e(0x222)](_0x4a10eb);if(typeof _0x11dcca[_0x423d9e(0x2b1)]==='string'){this['displayAttributesStats'](_0x4a10eb),this[_0x423d9e(0x243)](_0x4a10eb),this[_0x423d9e(0x204)](_0x3e58b2,_0x2e32ec,_0x423d9e(0x2b1),_0x11dcca[_0x423d9e(0x2b1)]);return;}if(_0x11dcca[_0x423d9e(0x2b1)]===!![]){this[_0x423d9e(0x235)](_0x4a10eb),this[_0x423d9e(0x243)](_0x4a10eb),this[_0x423d9e(0x204)](_0x3e58b2,_0x2e32ec,_0x423d9e(0x209));return;}if(typeof _0x11dcca['behavior']===_0x423d9e(0x23c)){this[_0x423d9e(0x212)](_0x4a10eb,_0x2e32ec),this[_0x423d9e(0x243)](_0x4a10eb),this[_0x423d9e(0x204)](_0x3e58b2,_0x2e32ec,_0x423d9e(0x1e6),_0x11dcca[_0x423d9e(0x1e6)]);return;}if(_0x11dcca[_0x423d9e(0x1e6)]===!![]){this[_0x423d9e(0x212)](_0x4a10eb,_0x2e32ec),this[_0x423d9e(0x243)](_0x4a10eb),this['displayPreviewHints'](_0x3e58b2,_0x2e32ec,_0x423d9e(0x2cb));return;}this[_0x423d9e(0x235)](_0x4a10eb),this[_0x423d9e(0x212)](_0x4a10eb,_0x2e32ec),this[_0x423d9e(0x243)](_0x4a10eb),this['displayPreviewHints'](_0x3e58b2,_0x2e32ec,_0x423d9e(0x2d7));}[a29_0x192174(0x204)](_0x2e9287,_0x33e220,_0xe43cdb,_0x296cd2){const _0x44f6a8=a29_0x192174;console[_0x44f6a8(0x2a6)]('\x0a'+a29_0x4cd30e[_0x44f6a8(0x201)](_0x44f6a8(0x224)));const _0x501a75=_0x33e220!=='-1d'?_0x44f6a8(0x206)+_0x33e220:'';if(_0xe43cdb===_0x44f6a8(0x2b1)&&_0x296cd2)console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x44f6a8(0x201)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2e9287+_0x44f6a8(0x1d0)+_0x296cd2+'\x22'+_0x501a75));else{if(_0xe43cdb==='behavior'&&_0x296cd2)console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e['dim'](_0x44f6a8(0x1c9)+_0x2e9287+_0x44f6a8(0x1ba)+_0x296cd2+'\x22'+_0x501a75));else(_0xe43cdb===_0x44f6a8(0x209)||_0xe43cdb===_0x44f6a8(0x2d7))&&console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x44f6a8(0x201)](_0x44f6a8(0x1c9)+_0x2e9287+_0x44f6a8(0x20e)+_0x501a75));}(_0xe43cdb===_0x44f6a8(0x2cb)||_0xe43cdb===_0x44f6a8(0x2d7))&&console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e['dim'](_0x44f6a8(0x1c9)+_0x2e9287+_0x44f6a8(0x1f4)+_0x501a75)),_0xe43cdb===_0x44f6a8(0x2d7)&&console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x44f6a8(0x201)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2e9287+_0x44f6a8(0x1e9)+_0x501a75));}[a29_0x192174(0x222)](_0x56f01e){const _0x18cc72=a29_0x192174,{master:_0x449c63}=_0x56f01e,_0x27fa28=_0x449c63[_0x18cc72(0x1b7)]?a29_0x4cd30e[_0x18cc72(0x239)]('✔'):a29_0x4cd30e[_0x18cc72(0x1ea)]('✘');console[_0x18cc72(0x2a6)]('\x0a'+a29_0x4cd30e['dim'](_0x18cc72(0x1c7))),console['error'](_0x27fa28+'\x20'+a29_0x4cd30e[_0x18cc72(0x20c)](_0x449c63[_0x18cc72(0x1c1)]+'.'+_0x449c63['table'])),_0x449c63[_0x18cc72(0x1b7)]?_0x449c63[_0x18cc72(0x2ad)]!==undefined&&console[_0x18cc72(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x18cc72(0x201)](_0x18cc72(0x1db))+'\x20'+a29_0x4cd30e[_0x18cc72(0x288)](formatRows(_0x449c63['rowCount']))):console[_0x18cc72(0x2a6)]('\x20\x20'+a29_0x4cd30e['red'](_0x18cc72(0x21a))+'\x20'+_0x449c63['schemaError']);}[a29_0x192174(0x235)](_0x249ca8){const _0x1dad13=a29_0x192174;if(_0x249ca8[_0x1dad13(0x209)][_0x1dad13(0x28c)]===0x0)return;console['error']('\x0a'+a29_0x4cd30e[_0x1dad13(0x201)]('Attributes'));for(const _0x97efc0 of _0x249ca8[_0x1dad13(0x209)]){const _0x17867b=_0x97efc0[_0x1dad13(0x1b7)]?a29_0x4cd30e[_0x1dad13(0x239)]('✔'):a29_0x4cd30e['red']('✘');let _0x3328dd='';if(_0x97efc0[_0x1dad13(0x1b7)]&&_0x97efc0[_0x1dad13(0x2b3)]!==undefined&&_0x97efc0[_0x1dad13(0x244)]!==undefined){const _0x5f41c4=_0x97efc0[_0x1dad13(0x244)]['toFixed'](0x1),_0xc9d6f=_0x97efc0[_0x1dad13(0x244)]>=0x50?a29_0x4cd30e[_0x1dad13(0x239)]:_0x97efc0['coveragePercent']>=0x32?a29_0x4cd30e[_0x1dad13(0x20a)]:a29_0x4cd30e[_0x1dad13(0x1ea)];_0x3328dd='\x20'+a29_0x4cd30e[_0x1dad13(0x201)](_0x1dad13(0x2a8))+'\x20'+_0xc9d6f(_0x5f41c4+'%')+'\x20('+formatRows(_0x97efc0[_0x1dad13(0x2b3)])+_0x1dad13(0x2aa);}console[_0x1dad13(0x2a6)](_0x17867b+'\x20'+a29_0x4cd30e[_0x1dad13(0x20c)](_0x97efc0[_0x1dad13(0x1e2)])+_0x3328dd),console['error']('\x20\x20'+a29_0x4cd30e['dim']('Source:')+'\x20'+a29_0x4cd30e[_0x1dad13(0x20c)](_0x97efc0[_0x1dad13(0x1c1)]+'.'+_0x97efc0[_0x1dad13(0x1fa)]));const _0x187480=_0x97efc0[_0x1dad13(0x1df)]===_0x97efc0['foreignKey']?a29_0x4cd30e['dim'](_0x1dad13(0x298))+'\x20'+_0x97efc0[_0x1dad13(0x1df)]:a29_0x4cd30e[_0x1dad13(0x201)]('Join:')+'\x20'+_0x97efc0['joinKey']+_0x1dad13(0x1f1)+_0x97efc0[_0x1dad13(0x203)];console['error']('\x20\x20'+_0x187480),console[_0x1dad13(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x1dad13(0x201)](_0x1dad13(0x20b))),this[_0x1dad13(0x2d6)](_0x97efc0['columns']),!_0x97efc0[_0x1dad13(0x1b7)]&&console[_0x1dad13(0x2a6)]('\x20\x20'+a29_0x4cd30e['red'](_0x1dad13(0x21a))+'\x20'+_0x97efc0['schemaError']);}}[a29_0x192174(0x212)](_0x196f15,_0x26a7b0){const _0x5c3dc6=a29_0x192174;if(_0x196f15[_0x5c3dc6(0x2cb)][_0x5c3dc6(0x28c)]===0x0)return;console[_0x5c3dc6(0x2a6)]('\x0a'+a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x253))+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)]('('+_0x26a7b0+')'));for(const _0x2af336 of _0x196f15[_0x5c3dc6(0x2cb)]){const _0xc334ef=_0x2af336[_0x5c3dc6(0x1b7)]?a29_0x4cd30e[_0x5c3dc6(0x239)]('✔'):a29_0x4cd30e['red']('✘');let _0x3eb9cc='';if(_0x2af336[_0x5c3dc6(0x1b7)]&&_0x2af336['customersWithEvents']!==undefined&&_0x2af336[_0x5c3dc6(0x22d)]!==undefined){const _0x3222c2=_0x2af336['customerPercent']?.[_0x5c3dc6(0x294)](0x1)||'?',_0x5acfce=(_0x2af336[_0x5c3dc6(0x1bc)]??0x0)>=0x32?a29_0x4cd30e['green']:(_0x2af336[_0x5c3dc6(0x1bc)]??0x0)>=0x14?a29_0x4cd30e[_0x5c3dc6(0x20a)]:a29_0x4cd30e['red'];_0x3eb9cc='\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x2b2))+'\x20'+_0x5acfce(formatRows(_0x2af336[_0x5c3dc6(0x1d8)]))+'\x20('+_0x3222c2+'%)\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)]('Events:')+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x288)](formatRows(_0x2af336[_0x5c3dc6(0x22d)]));}console['error'](_0xc334ef+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x20c)](_0x2af336['name'])+_0x3eb9cc),console[_0x5c3dc6(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x1fb))+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x20c)](_0x2af336[_0x5c3dc6(0x1c1)]+'.'+_0x2af336[_0x5c3dc6(0x1fa)]));const _0x4c2015=_0x2af336[_0x5c3dc6(0x1df)]===_0x2af336[_0x5c3dc6(0x203)]?a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x298))+'\x20'+_0x2af336[_0x5c3dc6(0x1df)]:a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x2bf))+'\x20'+_0x2af336[_0x5c3dc6(0x1df)]+_0x5c3dc6(0x1f1)+_0x2af336[_0x5c3dc6(0x203)];console['error']('\x20\x20'+_0x4c2015),console[_0x5c3dc6(0x2a6)]('\x20\x20'+a29_0x4cd30e['dim'](_0x5c3dc6(0x20b))),this[_0x5c3dc6(0x2d6)](_0x2af336[_0x5c3dc6(0x297)]),!_0x2af336['schemaValid']&&console[_0x5c3dc6(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x5c3dc6(0x1ea)](_0x5c3dc6(0x21a))+'\x20'+_0x2af336[_0x5c3dc6(0x251)]);}}[a29_0x192174(0x2d6)](_0x4c00a3){const _0x3c0cf3=a29_0x192174;for(const _0x163add of _0x4c00a3){_0x163add[_0x3c0cf3(0x2ca)]===_0x163add[_0x3c0cf3(0x269)]||_0x163add[_0x3c0cf3(0x269)]==='*'?console['error'](_0x3c0cf3(0x276)+_0x163add[_0x3c0cf3(0x2ca)]):console[_0x3c0cf3(0x2a6)](_0x3c0cf3(0x276)+_0x163add[_0x3c0cf3(0x2ca)]+'\x20'+a29_0x4cd30e[_0x3c0cf3(0x201)]('('+_0x163add[_0x3c0cf3(0x269)]+')'));}}[a29_0x192174(0x243)](_0x3f8732){const _0x95da38=a29_0x192174;console[_0x95da38(0x2a6)]('─'[_0x95da38(0x2c5)](0x3c));if(_0x3f8732[_0x95da38(0x2c3)][_0x95da38(0x28c)]>0x0){console[_0x95da38(0x2a6)]('\x0a'+a29_0x4cd30e[_0x95da38(0x1ea)]('Errors:'));for(const _0x193845 of _0x3f8732[_0x95da38(0x2c3)]){console[_0x95da38(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x95da38(0x1ea)]('•')+'\x20'+_0x193845);}}_0x3f8732[_0x95da38(0x1b8)]&&console[_0x95da38(0x2a6)]('\x0a'+a29_0x4cd30e[_0x95da38(0x239)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]='segment:parent:preview';['description']=a29_0x192174(0x227);async['execute'](_0x4e19af){const _0x2709dc=a29_0x192174,{options:_0x4c33d3,args:_0x3d688e,tdx:_0x30f06e}=_0x4e19af,_0x550a40=_0x4c33d3,_0x266893=_0x3d688e[0x0]||_0x4c33d3[_0x2709dc(0x25b)];if(!_0x266893)return showParentSegmentNotSetError(_0x2709dc(0x214)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x2709dc(0x231)+_0x2709dc(0x1bd)+_0x2709dc(0x223)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x2709dc(0x1e1)),0x1;if(!_0x550a40[_0x2709dc(0x246)]&&!_0x550a40[_0x2709dc(0x2b1)]&&!_0x550a40[_0x2709dc(0x1e6)]&&!_0x550a40[_0x2709dc(0x29d)])return console['error'](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x23a))),console[_0x2709dc(0x2a6)](_0x2709dc(0x1b5)),console[_0x2709dc(0x2a6)]('Options:'),console[_0x2709dc(0x2a6)](_0x2709dc(0x2d8)),console[_0x2709dc(0x2a6)](_0x2709dc(0x299)),console[_0x2709dc(0x2a6)](_0x2709dc(0x28d)),console['error'](_0x2709dc(0x1b9)),0x1;const _0x2b1167=resolveYamlFile(_0x266893);if(!existsSync(_0x2b1167))return showFileNotFoundError(_0x2b1167,_0x266893),0x1;_0x550a40['verbose']&&(console['error'](_0x2709dc(0x27b)+_0x550a40[_0x2709dc(0x28b)]),console[_0x2709dc(0x2a6)]('YAML\x20file:\x20'+_0x2b1167));let _0x3c9d0d;try{_0x3c9d0d=readFileSync(_0x2b1167,_0x2709dc(0x256));}catch(_0x5905ea){const _0x4b8fe6=_0x5905ea instanceof Error?_0x5905ea[_0x2709dc(0x2b0)]:String(_0x5905ea);return console[_0x2709dc(0x2a6)](_0x2709dc(0x28f)+_0x4b8fe6),0x1;}let _0x533c13;try{_0x533c13=parseYamlString(_0x3c9d0d);}catch(_0x15e719){const _0x2ae555=_0x15e719 instanceof Error?_0x15e719['message']:String(_0x15e719);return console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x2b4)+_0x2ae555)),0x1;}if(_0x550a40[_0x2709dc(0x2b1)]===!![]||_0x550a40['attribute']===''){const _0x392e6c=_0x533c13[_0x2709dc(0x209)]?.[_0x2709dc(0x1d9)](_0x55bd3d=>_0x55bd3d[_0x2709dc(0x1e2)])||[];if(_0x392e6c['length']===0x0)console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x1bb)));else{console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x2c0))),console[_0x2709dc(0x2a6)]('Available\x20attributes:');for(const _0x22c28e of _0x392e6c){console[_0x2709dc(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x2709dc(0x288)](_0x22c28e));}console[_0x2709dc(0x2a6)](_0x2709dc(0x1c2)+_0x266893+_0x2709dc(0x1d0)+_0x392e6c[0x0]+'\x22');}return 0x1;}if(_0x550a40[_0x2709dc(0x1e6)]===!![]||_0x550a40['behavior']===''){const _0x646e0b=_0x533c13[_0x2709dc(0x2cb)]?.[_0x2709dc(0x1d9)](_0x406255=>_0x406255[_0x2709dc(0x1e2)])||[];if(_0x646e0b[_0x2709dc(0x28c)]===0x0)console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a29_0x4cd30e['red'](_0x2709dc(0x2c9))),console[_0x2709dc(0x2a6)](_0x2709dc(0x26b));for(const _0x2620c3 of _0x646e0b){console[_0x2709dc(0x2a6)]('\x20\x20'+a29_0x4cd30e['cyan'](_0x2620c3));}console[_0x2709dc(0x2a6)](_0x2709dc(0x1c2)+_0x266893+_0x2709dc(0x1ba)+_0x646e0b[0x0]+'\x22');}return 0x1;}const _0x27ee08=createCommandSpinner(a29_0x4cd30e['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x550a40['verbose']});_0x27ee08[_0x2709dc(0x1ed)]();const _0x2c2318={'onProgress':_0x1aeee5=>{_0x27ee08['text']=formatProgressMessage(_0x1aeee5);}};if(_0x550a40[_0x2709dc(0x246)])_0x2c2318['master']=!![];if(_0x550a40['attribute']&&typeof _0x550a40[_0x2709dc(0x2b1)]===_0x2709dc(0x23c))_0x2c2318[_0x2709dc(0x2b1)]=_0x550a40[_0x2709dc(0x2b1)];if(_0x550a40['behavior']&&typeof _0x550a40[_0x2709dc(0x1e6)]===_0x2709dc(0x23c))_0x2c2318['behavior']=_0x550a40['behavior'];if(_0x550a40[_0x2709dc(0x29d)])_0x2c2318[_0x2709dc(0x29d)]=!![];if(_0x550a40['interval'])_0x2c2318[_0x2709dc(0x25a)]=_0x550a40['interval'];let _0x400a24;try{_0x400a24=await _0x30f06e[_0x2709dc(0x28a)][_0x2709dc(0x277)](_0x3c9d0d,_0x2c2318),_0x27ee08[_0x2709dc(0x2a9)]();}catch(_0x288e58){_0x27ee08['stop']();throw _0x288e58;}return await this['displayPreviewResults'](_0x400a24,{'master':_0x550a40[_0x2709dc(0x246)],'attribute':typeof _0x550a40[_0x2709dc(0x2b1)]===_0x2709dc(0x23c)?_0x550a40[_0x2709dc(0x2b1)]:undefined,'behavior':typeof _0x550a40[_0x2709dc(0x1e6)]===_0x2709dc(0x23c)?_0x550a40[_0x2709dc(0x1e6)]:undefined,'enriched':_0x550a40[_0x2709dc(0x29d)]}),_0x400a24['allValid']?0x0:0x1;}async[a29_0x192174(0x2af)](_0x17b0da,_0xbfc97b){const _0x4c9ca6=a29_0x192174;console['error']('\x0a'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0x4c9ca6(0x252))+'\x20'+_0x17b0da[_0x4c9ca6(0x1e2)]),console[_0x4c9ca6(0x2a6)]('═'['repeat'](0x3c));if(_0xbfc97b['master']&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0x43ed2f=a29_0x4cd30e[_0x4c9ca6(0x201)](_0x4c9ca6(0x24b))+'\x20'+a29_0x4cd30e['bold'](_0x17b0da['master'][_0x4c9ca6(0x1c1)]+'.'+_0x17b0da[_0x4c9ca6(0x246)][_0x4c9ca6(0x1fa)]);await this[_0x4c9ca6(0x2d1)](_0x43ed2f,_0x17b0da['sampleData']);}else{if(_0xbfc97b[_0x4c9ca6(0x2b1)]&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0xd660a1=a29_0x4cd30e[_0x4c9ca6(0x201)](_0x4c9ca6(0x1f2))+'\x20'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0xbfc97b['attribute']);await this['displaySampleData'](_0xd660a1,_0x17b0da[_0x4c9ca6(0x1d6)]);}else{if(_0xbfc97b[_0x4c9ca6(0x1e6)]&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0x13b003=a29_0x4cd30e[_0x4c9ca6(0x201)](_0x4c9ca6(0x255))+'\x20'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0xbfc97b[_0x4c9ca6(0x1e6)]);await this[_0x4c9ca6(0x2d1)](_0x13b003,_0x17b0da[_0x4c9ca6(0x1d6)]);}else{if(_0xbfc97b['enriched']&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0x1aa849=a29_0x4cd30e['dim']('Enriched:')+'\x20'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0x4c9ca6(0x249));await this['displaySampleData'](_0x1aa849,_0x17b0da[_0x4c9ca6(0x1d6)]);}else!_0x17b0da['sampleData']&&console[_0x4c9ca6(0x2a6)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x17b0da[_0x4c9ca6(0x2c3)][_0x4c9ca6(0x28c)]>0x0){console[_0x4c9ca6(0x2a6)]('─'['repeat'](0x3c)),console[_0x4c9ca6(0x2a6)]('\x0a'+a29_0x4cd30e[_0x4c9ca6(0x1ea)](_0x4c9ca6(0x287)));for(const _0x30f4ba of _0x17b0da[_0x4c9ca6(0x2c3)]){console[_0x4c9ca6(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x4c9ca6(0x1ea)]('•')+'\x20'+_0x30f4ba);}}}async[a29_0x192174(0x2d1)](_0x307152,_0x5f23e1){const _0x329fea=a29_0x192174;if(_0x5f23e1[_0x329fea(0x28c)]===0x0){console[_0x329fea(0x2a6)]('\x0a'+_0x307152),console[_0x329fea(0x2a6)](_0x329fea(0x2c1));return;}console['error']('\x0a'+_0x307152);const _0x2c80fb=Object[_0x329fea(0x2b5)](_0x5f23e1[0x0])['map'](_0x56c67c=>({'name':_0x56c67c,'type':typeof _0x5f23e1[0x0][_0x56c67c]===_0x329fea(0x1c3)?_0x329fea(0x2ab):_0x329fea(0x2a1)})),_0x1bf3a7={'queryId':_0x329fea(0x2cc),'columns':_0x2c80fb,'data':_0x5f23e1,'stats':{'state':_0x329fea(0x23d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5f23e1[_0x329fea(0x28c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x58d84a=formatAsTable(_0x1bf3a7,_0x5f23e1[_0x329fea(0x28c)],!![]);await writeOutput(_0x58d84a,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x2cf);[a29_0x192174(0x24e)]=a29_0x192174(0x29f);async['execute'](_0x2ab6fb){const _0x3cd705=a29_0x192174,{options:_0x36df98,args:_0x1fde6e,tdx:_0x1d4a41}=_0x2ab6fb,_0x1c58a5=_0x36df98,_0xaf3cc=_0x1fde6e[0x0]||_0x36df98[_0x3cd705(0x25b)];if(!_0xaf3cc)return showParentSegmentNotSetError(_0x3cd705(0x27d)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x2f8c7b=resolveYamlFile(_0xaf3cc);if(existsSync(_0x2f8c7b)){_0x1c58a5[_0x3cd705(0x2b9)]&&console[_0x3cd705(0x2a6)](_0x3cd705(0x278)+_0x2f8c7b);let _0x3b6644;try{_0x3b6644=readFileSync(_0x2f8c7b,_0x3cd705(0x256));}catch(_0x596ef8){const _0x5347f6=_0x596ef8 instanceof Error?_0x596ef8[_0x3cd705(0x2b0)]:String(_0x596ef8);return console[_0x3cd705(0x2a6)](_0x3cd705(0x28f)+_0x5347f6),0x1;}const _0x2ce902=await withSpinner(_0x3cd705(0x1c6),()=>_0x1d4a41['segment']['pushParentYaml'](_0x3b6644),{'verbose':_0x1c58a5[_0x3cd705(0x2b9)]}),_0x34247d=_0x2ce902[_0x3cd705(0x1f0)],{isNew:_0x3c3035,name:_0x29207b,hasChanges:_0x47534d,diffFormatted:_0x152cd9}=_0x34247d;if(_0x47534d){_0x3c3035?console['error'](_0x3cd705(0x240)+_0x29207b+'\x27:'):console[_0x3cd705(0x2a6)](_0x3cd705(0x266)+_0x29207b+'\x27:');console[_0x3cd705(0x2a6)]('─'[_0x3cd705(0x2c5)](0x3c)),console[_0x3cd705(0x2a6)](_0x152cd9),console[_0x3cd705(0x2a6)]('─'['repeat'](0x3c));const _0x27568d=_0x3c3035?_0x3cd705(0x2ce)+_0x29207b+_0x3cd705(0x250):_0x3cd705(0x283)+_0x29207b+'\x27\x20and\x20run\x20workflow?';if(!_0x1c58a5[_0x3cd705(0x1d3)]){const _0x2c743=await confirmKey(_0x27568d);if(!_0x2c743)return console[_0x3cd705(0x2a6)](_0x3cd705(0x1e4)),0x1;}const _0x4fdd32=_0x3c3035?_0x3cd705(0x20f):_0x3cd705(0x2d0);await withSpinner(_0x4fdd32+_0x3cd705(0x1cf)+_0x29207b+_0x3cd705(0x1f5),()=>_0x34247d[_0x3cd705(0x241)](),{'verbose':_0x1c58a5[_0x3cd705(0x2b9)]});const _0x4f9356=_0x3c3035?'Created':'Updated';console[_0x3cd705(0x2a6)]('✔\x20'+_0x4f9356+_0x3cd705(0x1cf)+_0x29207b+'\x27');}else console[_0x3cd705(0x2a6)](_0x3cd705(0x1ef)+_0x29207b+_0x3cd705(0x1da));}const _0x482e71=await withSpinner(_0x3cd705(0x1c0)+_0xaf3cc+_0x3cd705(0x1f5),()=>_0x1d4a41[_0x3cd705(0x28a)][_0x3cd705(0x24f)](_0xaf3cc),{'verbose':_0x1c58a5[_0x3cd705(0x2b9)]}),_0x2c8065=_0x482e71['data'],_0x3d9e2d=getConsoleUrl(_0x1c58a5[_0x3cd705(0x28b)],_0x3cd705(0x27a)+_0x2c8065[_0x3cd705(0x26d)]+_0x3cd705(0x271)+_0x2c8065[_0x3cd705(0x273)]+_0x3cd705(0x27e)+_0x2c8065['workflowAttemptId']);return console[_0x3cd705(0x2a6)](_0x3cd705(0x27c)),console['error']('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)]('Audience\x20ID:')+'\x20'+_0x2c8065['audienceId']),console[_0x3cd705(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)](_0x3cd705(0x1f8))+'\x20'+_0x2c8065['status']),console[_0x3cd705(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)](_0x3cd705(0x1c5))+'\x20'+_0x2c8065[_0x3cd705(0x273)]),console['error']('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)]('Attempt:')+'\x20'+_0x2c8065['workflowAttemptId']),console['error']('\x20\x20'+_0x3d9e2d),console['error']('\x0a'+a29_0x4cd30e[_0x3cd705(0x201)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x2c8065[_0x3cd705(0x228)]+_0x3cd705(0x265)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x21f);['description']=a29_0x192174(0x1d7);async[a29_0x192174(0x2b6)](_0x439040){const _0x4f8ecd=a29_0x192174,{options:_0x52da37,args:_0x44754c,tdx:_0x16f2ab}=_0x439040,_0x45f9e3=_0x44754c[0x0]||_0x52da37[_0x4f8ecd(0x25b)];if(!_0x45f9e3)return showParentSegmentNotSetError(_0x4f8ecd(0x245)+_0x4f8ecd(0x2ac)),0x1;_0x52da37[_0x4f8ecd(0x2b9)]&&(console[_0x4f8ecd(0x2a6)](_0x4f8ecd(0x27b)+_0x52da37['site']),console[_0x4f8ecd(0x2a6)](_0x4f8ecd(0x29b)+_0x45f9e3));const _0x4ecf98=await withSpinner(_0x4f8ecd(0x1e0)+_0x45f9e3+_0x4f8ecd(0x1f5),()=>_0x16f2ab[_0x4f8ecd(0x28a)][_0x4f8ecd(0x208)](_0x45f9e3),{'verbose':_0x52da37[_0x4f8ecd(0x2b9)]}),_0x2775ed=_0x4ecf98[_0x4f8ecd(0x1f0)];console['error'](_0x4f8ecd(0x230)+_0x2775ed[_0x4f8ecd(0x28c)]+_0x4f8ecd(0x1ce)+(_0x2775ed[_0x4f8ecd(0x28c)]!==0x1?'s':''));if(_0x52da37[_0x4f8ecd(0x2a0)]||_0x52da37[_0x4f8ecd(0x275)])return await handleSDKOutput(_0x2775ed,_0x52da37),0x0;return displayFieldsHumanReadable(_0x2775ed,_0x45f9e3),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x192174(0x1e2)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async[a29_0x192174(0x2b6)](_0x1d4f1d){const _0x36b53f=a29_0x192174,{options:_0x39068e,args:_0x57d93d,tdx:_0xaf877e}=_0x1d4f1d,_0x445a00=_0x39068e,_0x4d006d=_0x57d93d[0x0]||_0x39068e['parentSegment'];if(!_0x4d006d)return showParentSegmentNotSetError(_0x36b53f(0x1b6)+_0x36b53f(0x274)+_0x36b53f(0x24c)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x39068e['verbose']&&(console[_0x36b53f(0x2a6)](_0x36b53f(0x27b)+_0x39068e['site']),console[_0x36b53f(0x2a6)]('Parent\x20segment:\x20'+_0x4d006d));const _0x5e87b2=await withSpinner(_0x36b53f(0x1bf)+_0x4d006d+'\x27...',()=>_0xaf877e[_0x36b53f(0x28a)][_0x36b53f(0x2bb)](_0x4d006d),{'verbose':_0x39068e[_0x36b53f(0x2b9)]}),_0xd64bc7=_0x5e87b2[_0x36b53f(0x1f0)];if(_0x445a00['web']){const _0x12f04f=getConsoleNextUrl(_0x445a00[_0x36b53f(0x28b)],_0x36b53f(0x2a5)+_0xd64bc7['id']);return console[_0x36b53f(0x2a6)](a29_0x4cd30e[_0x36b53f(0x239)]('✔')+'\x20Opening\x20'+a29_0x4cd30e[_0x36b53f(0x288)](_0x12f04f)),openBrowser(_0x12f04f),0x0;}return await handleSingleObjectOutput(_0xd64bc7,_0x39068e),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x25c);['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a29_0x192174(0x2b6)](_0x5db736){const _0xefd6d=a29_0x192174,{options:_0x439712,args:_0x4175af,tdx:_0x4d884c}=_0x5db736,_0x291ea5=_0x4175af[0x0]||_0x439712[_0xefd6d(0x25b)];if(!_0x291ea5)return showParentSegmentNotSetError(_0xefd6d(0x2c8)+_0xefd6d(0x264)),0x1;_0x439712[_0xefd6d(0x2b9)]&&(console[_0xefd6d(0x2a6)](_0xefd6d(0x27b)+_0x439712[_0xefd6d(0x28b)]),console[_0xefd6d(0x2a6)]('Parent\x20segment:\x20'+_0x291ea5));const _0x1039b9=await withSpinner(_0xefd6d(0x1d4)+_0x291ea5+_0xefd6d(0x1f5),()=>_0x4d884c[_0xefd6d(0x28a)]['resolveParentId'](_0x291ea5),{'verbose':_0x439712['verbose']}),_0x4f8e0c=_0x1039b9[_0xefd6d(0x1f0)],_0x5b31a2=await withSpinner(_0xefd6d(0x272)+_0x291ea5+_0xefd6d(0x1f5),()=>_0x4d884c['segment']['getParentSQL'](_0x4f8e0c),{'verbose':_0x439712[_0xefd6d(0x2b9)]}),_0x3749ea=await executeSchemaQuery(_0x5b31a2[_0xefd6d(0x1f0)],_0x4d884c,_0x439712);return await handleQueryOutput(_0x3749ea,_0x439712),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x192174(0x1e2)]='segment:parent:sql';[a29_0x192174(0x24e)]=a29_0x192174(0x205);async[a29_0x192174(0x2b6)](_0x65818a){const _0x2f9c8b=a29_0x192174,{options:_0x33216c,args:_0x78ae3,tdx:_0x72c597}=_0x65818a,_0x2f4e0d=_0x78ae3[0x0]||_0x33216c[_0x2f9c8b(0x25b)];if(!_0x2f4e0d)return showParentSegmentNotSetError(_0x2f9c8b(0x217)+_0x2f9c8b(0x237)),0x1;_0x33216c['verbose']&&(console[_0x2f9c8b(0x2a6)]('Site:\x20'+_0x33216c[_0x2f9c8b(0x28b)]),console[_0x2f9c8b(0x2a6)]('Parent\x20segment:\x20'+_0x2f4e0d));const _0x413f34=await withSpinner(_0x2f9c8b(0x1d4)+_0x2f4e0d+_0x2f9c8b(0x1f5),()=>_0x72c597[_0x2f9c8b(0x28a)][_0x2f9c8b(0x1b4)](_0x2f4e0d),{'verbose':_0x33216c['verbose']}),_0x11dca1=_0x413f34[_0x2f9c8b(0x1f0)],_0x7c118c=await withSpinner(_0x2f9c8b(0x272)+_0x2f4e0d+_0x2f9c8b(0x1f5),()=>_0x72c597[_0x2f9c8b(0x28a)][_0x2f9c8b(0x1d1)](_0x11dca1),{'verbose':_0x33216c[_0x2f9c8b(0x2b9)]}),_0x1d49b7=_0x7c118c[_0x2f9c8b(0x1f0)];return _0x33216c[_0x2f9c8b(0x200)]===_0x2f9c8b(0x2a0)||_0x33216c[_0x2f9c8b(0x200)]===_0x2f9c8b(0x275)?await handleSDKOutput([{'sql':_0x1d49b7}],_0x33216c):console[_0x2f9c8b(0x22c)](_0x1d49b7),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x22a);[a29_0x192174(0x24e)]=a29_0x192174(0x2cd);async['execute'](_0x373da3){const _0xea21d3=a29_0x192174,{options:_0x110ae5,args:_0x39c004,tdx:_0xf90b32}=_0x373da3,_0x2969aa=_0x39c004[0x0]||_0x110ae5['parentSegment'];if(!_0x2969aa)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0xea21d3(0x2a3)),0x1;_0x110ae5[_0xea21d3(0x2b9)]&&(console[_0xea21d3(0x2a6)](_0xea21d3(0x27b)+_0x110ae5[_0xea21d3(0x28b)]),console[_0xea21d3(0x2a6)](_0xea21d3(0x29b)+_0x2969aa));const _0x56e72c=await withSpinner(_0xea21d3(0x1d4)+_0x2969aa+_0xea21d3(0x1f5),()=>_0xf90b32[_0xea21d3(0x28a)][_0xea21d3(0x1b4)](_0x2969aa),{'verbose':_0x110ae5['verbose']}),_0x5eb46c=_0x56e72c[_0xea21d3(0x1f0)],_0x413898=await withSpinner(_0xea21d3(0x272)+_0x2969aa+_0xea21d3(0x1f5),()=>_0xf90b32['segment'][_0xea21d3(0x1d1)](_0x5eb46c),{'verbose':_0x110ae5[_0xea21d3(0x2b9)]});let _0x3fea7d=_0x413898[_0xea21d3(0x1f0)];const _0x69f07a=resolveLimit(_0x110ae5['limit'],DEFAULT_DISPLAY_LIMIT),_0x16fdfd=/\bLIMIT\s+\d+/i[_0xea21d3(0x26c)](_0x3fea7d);!_0x16fdfd&&(_0x3fea7d=_0x3fea7d[_0xea21d3(0x293)]()[_0xea21d3(0x2b8)](/;+$/,''),_0x3fea7d=_0xea21d3(0x236)+_0x3fea7d+_0xea21d3(0x24d)+_0x69f07a);_0x110ae5['verbose']&&console[_0xea21d3(0x2a6)](_0xea21d3(0x279)+_0x3fea7d);const _0x2af38b=await withQuerySpinner(_0xea21d3(0x263),async _0x3aadd4=>{const _0x56ca7e=_0xea21d3,_0x22a8c4=await _0xf90b32[_0x56ca7e(0x1c4)][_0x56ca7e(0x2b6)](_0x3fea7d,{'catalog':'td','schema':'information_schema','onJobId':_0x442c55=>{const _0x2fb30c=_0x56ca7e;_0x3aadd4[_0x2fb30c(0x285)](_0x442c55);}});return _0x22a8c4;},{'verbose':_0x110ae5['verbose']}),_0x2ca5a9=_0x2af38b['data'],_0x489c48=_0x2ca5a9[_0xea21d3(0x1fd)]?_0xea21d3(0x21e)+_0x2ca5a9['jobId']+']':'';return console['error'](_0xea21d3(0x1f6)+_0x2ca5a9['stats']['processedRows'][_0xea21d3(0x1dc)]()+'\x20rows\x20'+(_0xea21d3(0x29a)+formatElapsed(_0x2ca5a9[_0xea21d3(0x2d2)][_0xea21d3(0x1eb)])+_0x489c48)),await handleQueryOutput(_0x2ca5a9,_0x110ae5),0x0;}}
1
+ const a29_0x354af5=a29_0x28e4;(function(_0x40209a,_0x41d556){const _0x559e20=a29_0x28e4,_0x54cd2f=_0x40209a();while(!![]){try{const _0xcee8da=-parseInt(_0x559e20(0x23f))/0x1+parseInt(_0x559e20(0x280))/0x2+-parseInt(_0x559e20(0x1d4))/0x3+-parseInt(_0x559e20(0x1a0))/0x4+parseInt(_0x559e20(0x1db))/0x5*(-parseInt(_0x559e20(0x1e9))/0x6)+parseInt(_0x559e20(0x1f9))/0x7*(-parseInt(_0x559e20(0x258))/0x8)+parseInt(_0x559e20(0x251))/0x9*(parseInt(_0x559e20(0x17b))/0xa);if(_0xcee8da===_0x41d556)break;else _0x54cd2f['push'](_0x54cd2f['shift']());}catch(_0x305180){_0x54cd2f['push'](_0x54cd2f['shift']());}}}(a29_0x1024,0x6c6a2));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0x45cb35 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 a29_0x265ace from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a29_0x28e4(_0x1d4f42,_0x12dae2){_0x1d4f42=_0x1d4f42-0x16b;const _0x102450=a29_0x1024();let _0x28e42f=_0x102450[_0x1d4f42];return _0x28e42f;}const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a29_0x354af5(0x1d2);function openBrowser(_0x11513c){const _0xffd2aa=a29_0x354af5,_0x3f94e2=process['platform'],_0x263306=_0x3f94e2===_0xffd2aa(0x187)?_0xffd2aa(0x184):_0x3f94e2===_0xffd2aa(0x192)?'start':'xdg-open';spawn(_0x263306,[_0x11513c],{'detached':!![],'stdio':'ignore'})[_0xffd2aa(0x242)]();}function migrateLegacyDirectory(){const _0x5af697=a29_0x354af5;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x271364=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x271364[_0x5af697(0x193)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5af697(0x233)](a29_0x265ace['yellow'](_0x5af697(0x1fc)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x5af697(0x233)](a29_0x265ace[_0x5af697(0x1e1)](_0x5af697(0x290)+LEGACY_PARENT_SEGMENT_DIR+_0x5af697(0x225))),![];console[_0x5af697(0x233)](a29_0x265ace[_0x5af697(0x190)](_0x5af697(0x1ac)+LEGACY_PARENT_SEGMENT_DIR+_0x5af697(0x1ec)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5af697(0x233)](a29_0x265ace['green'](_0x5af697(0x212)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x15960c){const _0x62d10e=_0x15960c instanceof Error?_0x15960c[_0x5af697(0x185)]:String(_0x15960c);return console[_0x5af697(0x233)](a29_0x265ace[_0x5af697(0x1a2)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x62d10e+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x354af5(0x18e)](_0x50c78e){return migrateLegacyDirectory(),super['run'](_0x50c78e);}}function resolveYamlFile(_0x2e4024){const _0x5c47b0=a29_0x354af5;if(_0x2e4024[_0x5c47b0(0x1eb)](_0x5c47b0(0x1bf))||_0x2e4024[_0x5c47b0(0x1eb)]('.yaml'))return _0x2e4024;return a29_0x45cb35[_0x5c47b0(0x1e4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2e4024)+_0x5c47b0(0x1bf));}function formatProgressMessage(_0x44c12d){const _0x5ea6f5=a29_0x354af5,_0x4b56e0=_0x44c12d[_0x5ea6f5(0x248)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4b56e0){const [,_0x23897d,_0xff70d1,_0x5348c5='']=_0x4b56e0;return a29_0x265ace[_0x5ea6f5(0x1e1)](_0x23897d+':')+'\x20'+_0xff70d1+a29_0x265ace[_0x5ea6f5(0x1e1)](_0x5348c5);}return a29_0x265ace['dim'](_0x44c12d);}function showFileNotFoundError(_0x195ea9,_0x26ba4e){const _0x1c11b2=a29_0x354af5;console['error'](a29_0x265ace[_0x1c11b2(0x1a2)](_0x1c11b2(0x298)+_0x195ea9+'\x0a')),console[_0x1c11b2(0x233)](a29_0x265ace[_0x1c11b2(0x25b)](_0x1c11b2(0x19f)+_0x26ba4e+_0x1c11b2(0x18d)));}function showParentSegmentNotSetError(_0x217bad){const _0x7553d1=a29_0x354af5;console[_0x7553d1(0x233)](a29_0x265ace[_0x7553d1(0x190)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x7553d1(0x233)](_0x217bad);}export class ParentSegmentListCommand extends BaseCommand{['name']=a29_0x354af5(0x1a6);[a29_0x354af5(0x24c)]=a29_0x354af5(0x223);async['execute'](_0x12507c){const _0x300474=a29_0x354af5,{options:_0x1d4d65,args:_0x578fd2,tdx:_0x3d168d}=_0x12507c,_0x1958dc=_0x578fd2[0x0];_0x1d4d65[_0x300474(0x200)]&&(console[_0x300474(0x233)](_0x300474(0x1a8)+_0x1d4d65[_0x300474(0x282)]),_0x1958dc&&console['error'](_0x300474(0x170)+_0x1958dc));const _0x1fd2fb=await withSpinner(_0x1958dc?_0x300474(0x186)+_0x1958dc+'\x27...':_0x300474(0x181),()=>_0x3d168d[_0x300474(0x25e)][_0x300474(0x19b)](),{'verbose':_0x1d4d65[_0x300474(0x200)]});let _0x27c57f=_0x1fd2fb[_0x300474(0x20e)];if(_0x1958dc){const _0xa26915=_0x1958dc['replace'](/[.+^${}()|[\]\\]/g,_0x300474(0x1d1))[_0x300474(0x24b)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3aea85=new RegExp('^'+_0xa26915+'$','i');_0x27c57f=_0x27c57f[_0x300474(0x238)](_0x38e3b4=>_0x3aea85[_0x300474(0x27f)](_0x38e3b4['attributes'][_0x300474(0x272)]));}_0x27c57f['sort']((_0x5b9010,_0x438a0d)=>_0x5b9010[_0x300474(0x24d)]['name'][_0x300474(0x198)](_0x438a0d[_0x300474(0x24d)]['name'])),console['error'](_0x300474(0x245)+_0x27c57f['length']+_0x300474(0x1e2)+(_0x27c57f[_0x300474(0x24a)]!==0x1?'s':''));if(_0x1d4d65[_0x300474(0x17f)]===_0x300474(0x295)||_0x1d4d65[_0x300474(0x17f)]===_0x300474(0x18a))await handleSDKOutput(_0x27c57f,_0x1d4d65);else{if(_0x27c57f[_0x300474(0x24a)]===0x0)_0x1958dc?console['log'](_0x300474(0x1f7)+_0x1958dc):console[_0x300474(0x208)](_0x300474(0x209));else for(const _0xeeb2ac of _0x27c57f){const _0x242ec2=_0xeeb2ac[_0x300474(0x24d)][_0x300474(0x1be)]?a29_0x265ace['dim']('\x20('+formatRows(_0xeeb2ac[_0x300474(0x24d)]['population'])+')'):'';console['log'](_0x300474(0x218)+_0xeeb2ac[_0x300474(0x24d)][_0x300474(0x272)]+_0x242ec2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x257);[a29_0x354af5(0x24c)]=a29_0x354af5(0x1cf);async['execute'](_0x3a5feb){const _0x5d58ae=a29_0x354af5,{options:_0x16ab59,args:_0x15cb5f,tdx:_0x4fdcc0}=_0x3a5feb;console[_0x5d58ae(0x233)](_0x5d58ae(0x255)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x532e7e=_0x16ab59;if(_0x15cb5f[_0x5d58ae(0x24a)]===0x0)return console[_0x5d58ae(0x233)](a29_0x265ace[_0x5d58ae(0x1a2)](_0x5d58ae(0x1c2))),console[_0x5d58ae(0x233)](_0x5d58ae(0x1a4)),0x1;const _0x2cc029=_0x15cb5f[0x0];if(!_0x532e7e[_0x5d58ae(0x20a)]||!_0x532e7e[_0x5d58ae(0x268)])return console[_0x5d58ae(0x233)](_0x5d58ae(0x17c)),console[_0x5d58ae(0x233)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x532e7e[_0x5d58ae(0x200)]&&(console[_0x5d58ae(0x233)](_0x5d58ae(0x1a8)+_0x532e7e['site']),console[_0x5d58ae(0x233)](_0x5d58ae(0x217)+_0x2cc029),console['error'](_0x5d58ae(0x1dc)+_0x532e7e[_0x5d58ae(0x20a)]),console[_0x5d58ae(0x233)](_0x5d58ae(0x25d)+_0x532e7e[_0x5d58ae(0x268)]));const _0x58ad47=await loadJSONFromOptions(_0x532e7e['attributes'],_0x532e7e['attributesFile']),_0x40ce25=await loadJSONFromOptions(_0x532e7e[_0x5d58ae(0x194)],_0x532e7e[_0x5d58ae(0x1ee)]),_0x285f2d=await loadJSONFromOptions(_0x532e7e[_0x5d58ae(0x1df)],_0x532e7e[_0x5d58ae(0x224)]),_0x2e0ff6={'name':_0x2cc029,'description':_0x532e7e['description'],'scheduleType':_0x532e7e[_0x5d58ae(0x1bc)],'scheduleOption':_0x532e7e[_0x5d58ae(0x16c)],'timezone':_0x532e7e[_0x5d58ae(0x172)],'master':{'parentDatabaseName':_0x532e7e[_0x5d58ae(0x20a)],'parentTableName':_0x532e7e['table']},'attributes':_0x58ad47,'behaviors':_0x40ce25,'customerGroup':_0x285f2d},_0x58cb13=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2cc029+_0x5d58ae(0x1a5),()=>_0x4fdcc0[_0x5d58ae(0x25e)][_0x5d58ae(0x250)](_0x2e0ff6),{'verbose':_0x16ab59[_0x5d58ae(0x200)]}),_0x165927=_0x58cb13[_0x5d58ae(0x20e)];return console[_0x5d58ae(0x233)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x165927[_0x5d58ae(0x272)]+'\x27\x20with\x20ID:\x20'+_0x165927['id']),await handleSDKOutput([_0x165927],_0x16ab59),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x354af5(0x272)]='segment:parent:update';['description']=a29_0x354af5(0x1ab);async[a29_0x354af5(0x20d)](_0x19cf2){const _0xf9564=a29_0x354af5,{options:_0x452685,args:_0x20ba05,tdx:_0x64fa26}=_0x19cf2;console[_0xf9564(0x233)](_0xf9564(0x292)+_0xf9564(0x288)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x1d0005=_0x452685;if(_0x20ba05[_0xf9564(0x24a)]===0x0)return console[_0xf9564(0x233)](a29_0x265ace[_0xf9564(0x1a2)](_0xf9564(0x1c2))),console[_0xf9564(0x233)](_0xf9564(0x29a)),0x1;const _0x5b21cc=_0x20ba05[0x0];_0x1d0005[_0xf9564(0x200)]&&(console[_0xf9564(0x233)](_0xf9564(0x1a8)+_0x1d0005[_0xf9564(0x282)]),console['error'](_0xf9564(0x1de)+_0x5b21cc));const _0x3872ad=await withSpinner(_0xf9564(0x1c9)+_0x5b21cc+'\x27...',()=>_0x64fa26[_0xf9564(0x25e)][_0xf9564(0x264)](_0x5b21cc),{'verbose':_0x1d0005[_0xf9564(0x200)]}),_0x4ec605=_0x3872ad[_0xf9564(0x20e)],_0x48ca73=await loadJSONFromOptions(_0x1d0005[_0xf9564(0x1b1)],_0x1d0005[_0xf9564(0x21f)]),_0x284ca7=await loadJSONFromOptions(_0x1d0005[_0xf9564(0x1d8)],_0x1d0005[_0xf9564(0x171)]),_0x563599={'name':_0x4ec605[_0xf9564(0x272)],'description':_0x1d0005[_0xf9564(0x24c)]!==undefined?_0x1d0005['description']:_0x4ec605[_0xf9564(0x24c)],'scheduleType':_0x1d0005['scheduleType']!==undefined?_0x1d0005[_0xf9564(0x1bc)]:_0x4ec605[_0xf9564(0x1bc)],'scheduleOption':_0x1d0005['scheduleOption']!==undefined?_0x1d0005[_0xf9564(0x16c)]:_0x4ec605['scheduleOption'],'timezone':_0x1d0005[_0xf9564(0x172)]!==undefined?_0x1d0005[_0xf9564(0x172)]:_0x4ec605[_0xf9564(0x172)],'master':_0x4ec605[_0xf9564(0x1d7)],'attributes':_0x48ca73?[..._0x4ec605[_0xf9564(0x24d)]||[],..._0x48ca73]:_0x4ec605[_0xf9564(0x24d)],'behaviors':_0x284ca7?[..._0x4ec605['behaviors']||[],..._0x284ca7]:_0x4ec605[_0xf9564(0x194)],'customerGroup':_0x4ec605[_0xf9564(0x1df)]},_0xe49147=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x5b21cc+_0xf9564(0x1a5),()=>_0x64fa26[_0xf9564(0x25e)]['updateParent'](_0x5b21cc,_0x563599),{'verbose':_0x1d0005[_0xf9564(0x200)]}),_0x4cf63b=_0xe49147[_0xf9564(0x20e)];return console[_0xf9564(0x233)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x4cf63b[_0xf9564(0x272)]+'\x27'),await handleSDKOutput([_0x4cf63b],_0x1d0005),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a29_0x354af5(0x230);[a29_0x354af5(0x24c)]=a29_0x354af5(0x1f4);async[a29_0x354af5(0x20d)](_0x4ec206){const _0x276e4f=a29_0x354af5,{options:_0x5af38f,args:_0xf2c79d,tdx:_0x2a71a2}=_0x4ec206,_0x29e5f9=_0x5af38f,_0x3cf812=_0xf2c79d[0x0]||_0x5af38f[_0x276e4f(0x20b)];if(!_0x3cf812)return showParentSegmentNotSetError(_0x276e4f(0x270)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x29e5f9[_0x276e4f(0x1f3)]&&_0x29e5f9[_0x276e4f(0x22f)])return console[_0x276e4f(0x233)](a29_0x265ace[_0x276e4f(0x1a2)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x276e4f(0x233)](a29_0x265ace[_0x276e4f(0x1e1)](_0x276e4f(0x17d))),console[_0x276e4f(0x233)](a29_0x265ace[_0x276e4f(0x1e1)](_0x276e4f(0x22b)+PARENT_SEGMENT_DIR+_0x276e4f(0x249))),console[_0x276e4f(0x233)](a29_0x265ace[_0x276e4f(0x25b)](_0x276e4f(0x1fa))),0x1;const _0xbbc7e6=_0x29e5f9[_0x276e4f(0x22f)]||a29_0x45cb35[_0x276e4f(0x1e4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3cf812)+_0x276e4f(0x1bf));_0x29e5f9['verbose']&&(console[_0x276e4f(0x233)](_0x276e4f(0x1a8)+_0x29e5f9['site']),console[_0x276e4f(0x233)](_0x276e4f(0x1de)+_0x3cf812),console[_0x276e4f(0x233)](_0x276e4f(0x283)+_0xbbc7e6));const _0xa15c7a=await withSpinner(_0x276e4f(0x189)+_0x3cf812+_0x276e4f(0x1a5),()=>_0x2a71a2[_0x276e4f(0x25e)]['pullParentYaml'](_0x3cf812),{'verbose':_0x29e5f9[_0x276e4f(0x200)]}),_0x5c4789=_0xa15c7a[_0x276e4f(0x20e)];if(existsSync(_0xbbc7e6)){const _0x2bbb66=readFileSync(_0xbbc7e6,_0x276e4f(0x1ae)),_0x64e7dc=generateDiff(_0x2bbb66,_0x5c4789);if(!hasChanges(_0x64e7dc))console[_0x276e4f(0x233)](a29_0x265ace[_0x276e4f(0x1c7)]('✔')+_0x276e4f(0x179)+a29_0x265ace[_0x276e4f(0x25b)](_0xbbc7e6)+_0x276e4f(0x1ea));else{console[_0x276e4f(0x233)]('\x0aChanges\x20to\x20\x27'+_0xbbc7e6+'\x27:'),console[_0x276e4f(0x233)]('─'[_0x276e4f(0x28c)](0x3c)),console[_0x276e4f(0x233)](formatDiffWithColors(_0x64e7dc)),console[_0x276e4f(0x233)]('─'[_0x276e4f(0x28c)](0x3c));if(!_0x29e5f9['yes']){const _0x9760f1=await confirmKey(_0x276e4f(0x1f2)+_0xbbc7e6+'\x27?');if(!_0x9760f1)return console[_0x276e4f(0x233)](_0x276e4f(0x199)),0x1;}writeFileSync(_0xbbc7e6,_0x5c4789,_0x276e4f(0x1ae)),console[_0x276e4f(0x233)](a29_0x265ace[_0x276e4f(0x1c7)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a29_0x265ace[_0x276e4f(0x25b)](_0xbbc7e6));}}else{const _0x29d484=a29_0x45cb35[_0x276e4f(0x219)](_0xbbc7e6);!existsSync(_0x29d484)&&mkdirSync(_0x29d484,{'recursive':!![]}),writeFileSync(_0xbbc7e6,_0x5c4789,_0x276e4f(0x1ae)),console['error'](a29_0x265ace[_0x276e4f(0x1c7)]('✔')+_0x276e4f(0x195)+a29_0x265ace['cyan'](_0xbbc7e6));}return saveSessionContext({'parent_segment':_0x3cf812},_0x29e5f9[_0x276e4f(0x285)]),console[_0x276e4f(0x233)](a29_0x265ace['green']('✔')+_0x276e4f(0x1f6)+a29_0x265ace[_0x276e4f(0x1e1)]('parent_segment')+'\x20=\x20'+a29_0x265ace['cyan'](_0x3cf812)),0x0;}}function a29_0x1024(){const _0xcf2c40=['green','\x20Opening\x20','Fetching\x20current\x20configuration\x20for\x20\x27','Listing\x20fields\x20for\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20rows\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','customersWithEvents','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x5c$&','parent_segment','\x20--attribute\x20\x22','2398077NgiNHg','\x20parent\x20segment\x20\x27','coveragePercent','master','addBehaviors','workflowSessionId','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','1434635SKkWXq','Database:\x20','SQL\x20query:\x0a','Parent\x20segment:\x20','customerGroup','Show\x20parent\x20segment\x20details','dim','\x20parent\x20segment','segment:parent:fields','join','Updating','Enriched:','workflowId','Creating','6QgnIVj','\x20is\x20already\x20up\x20to\x20date','endsWith','/\x20→\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','behaviorsFile','toFixed','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','displayValidateResults','Overwrite\x20\x27','use','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','segment:parent:push','\x20Context\x20set:\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','22211PGiGXD','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Updated','\x0a⚠️\x20\x20Both\x20','\x20field','number','\x0a✔\x20Workflow\x20started','verbose','Options:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','keys','preview','%)\x20','displayAttributesStats','segment:parent:validate','log','No\x20parent\x20segments\x20found','database','parentSegment','displayColumns','execute','data','sampleData','Join:','Error\x20reading\x20file:\x20','✔\x20Renamed\x20directory\x20to\x20','segment:parent:desc','joinKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20kill','Name:\x20','👥\x20','dirname','Customers:','string','in\x20','runParent','Executing\x20parent\x20segment\x20query...','addAttributesFile','validateParentYaml','\x27\x20is\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','List\x20parent\x20segments','customerGroupFile','/\x20directory.\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','✔\x20Query\x20completed:\x20Processed\x20','jobId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','using\x20the\x20default\x20path:\x20','text','behavior','Analyzing\x20changes...','output','segment:parent:pull','Fetching\x20sample\x20data...','\x0aUsage:\x20tdx\x20ps\x20preview\x20','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','apply','\x20\x20\x20\x20-\x20','filter','allValid','varchar','Error\x20parsing\x20YAML:\x20','/attempt/','enriched','Master\x20Table','828228CwxlUC','start','/app/dw/parentSegments/','unref','tdx\x20segment\x20parent\x20preview\x20','foreignKey','✔\x20Found\x20','bold','Coverage:','match','/{name}.yml\x0a','length','replace','description','attributes','Columns:','\x20--behavior\x20\x22<name>\x22','createParent','30657699KziZBM','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20rows)','segment:parent:create','2168pRFKId','Get\x20SQL\x20query\x20for\x20parent\x20segment','Created','cyan','\x20--enriched','Table:\x20','segment','Options:\x0a','customerPercent','displayPreviewResults','displayPreviewHints','query','getParentFull','List\x20available\x20fields\x20for\x20segmentation','segment:parent:preview','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','table','To\x20cancel:','Apply\x20changes\x20to\x20\x27','YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Rows:','Join\x20on:','Events:','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','displayMasterInfo','name','audienceId','segment:parent:run','displaySampleData','previewParentYaml','\x27\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','trim','map','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','test','461544NtwaRx','column','site','Output\x20file:\x20','Validate:','session','Master:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20--attribute\x20\x22<name>\x22','Source:','columns','repeat','Attempt:','elapsedTimeMillis','Found\x20YAML\x20file:\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','stats','json','\x0aNew\x20parent\x20segment\x20\x27','To\x20view\x20sample\x20data:','Error:\x20File\x20not\x20found:\x20','schemaError','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:sql','scheduleOption','Available\x20behaviors:','✔\x20No\x20changes\x20-\x20\x27','displayBehaviorsStats','Pattern:\x20','addBehaviorsFile','timezone','totalEvents','web','all','errors','double','status','\x20No\x20changes\x20-\x20','Master\x20+\x20Attributes','10wxzMnC','Error:\x20--database\x20and\x20--table\x20are\x20required','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','information_schema','format','displaySummary','Listing\x20parent\x20segments...','\x20\x20No\x20sample\x20data\x20available','interval','open','message','Listing\x20parent\x20segments\x20matching\x20\x27','darwin','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Fetching\x20parent\x20segment\x20\x27','jsonl','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x27\x20and\x20run\x20workflow?','`\x20to\x20download\x20the\x20configuration\x20first','run','Status:','yellow','Fetching\x20SQL\x20for\x20\x27','win32','isDirectory','behaviors','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20Configuration\x20is\x20valid','yes','localeCompare','Aborted.','segment:parent:show','listParents','Error:\x20--attribute\x20requires\x20a\x20name\x0a','FINISHED','Attribute:','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','1674880aIGRkg','toLocaleString','red','label','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x27...','segment:parent:list','getParentSQL','Site:\x20','/app/workflows/','attribute','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0a⚠️\x20\x20Migrating:\x20','Options\x20(one\x20required):\x0a','utf-8','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','rowCount','addAttributes','Resolving\x20parent\x20segment\x20\x27','Error:','matchedCount','workflowAttemptId','\x0aChanges\x20to\x20apply\x20to\x20\x27','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','-1d','Create\x20parent\x20segment\x20\x27','\x20--behavior\x20\x22','resolveParentId','scheduleType','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','population','.yml','schemaValid','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','Errors:','stop','listFields','\x20=\x20'];a29_0x1024=function(){return _0xcf2c40;};return a29_0x1024();}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x1f5);[a29_0x354af5(0x24c)]=a29_0x354af5(0x252);async[a29_0x354af5(0x20d)](_0x5b86af){const _0xbe9049=a29_0x354af5,{options:_0x542528,args:_0x9f4ced,tdx:_0x3c9a34}=_0x5b86af,_0x3de9c1=_0x542528,_0x211fcb=_0x9f4ced[0x0]||_0x542528[_0xbe9049(0x20b)];if(!_0x211fcb)return showParentSegmentNotSetError(_0xbe9049(0x222)+_0xbe9049(0x27e)),0x1;const _0x5e5085=resolveYamlFile(_0x211fcb);if(!existsSync(_0x5e5085))return showFileNotFoundError(_0x5e5085,_0x211fcb),0x1;_0x3de9c1['verbose']&&(console['error'](_0xbe9049(0x1a8)+_0x3de9c1[_0xbe9049(0x282)]),console[_0xbe9049(0x233)](_0xbe9049(0x26b)+_0x5e5085));let _0x3f557a;try{_0x3f557a=readFileSync(_0x5e5085,_0xbe9049(0x1ae));}catch(_0x4e7f11){const _0x2ea1c2=_0x4e7f11 instanceof Error?_0x4e7f11[_0xbe9049(0x185)]:String(_0x4e7f11);return console[_0xbe9049(0x233)](_0xbe9049(0x211)+_0x2ea1c2),0x1;}const _0x1d6b08=await withSpinner(_0xbe9049(0x22e),()=>_0x3c9a34[_0xbe9049(0x25e)]['pushParentYaml'](_0x3f557a),{'verbose':_0x3de9c1[_0xbe9049(0x200)]}),_0x572366=_0x1d6b08[_0xbe9049(0x20e)],{isNew:_0x19cd51,name:_0x56b503,hasChanges:_0x32a44c,diffFormatted:_0x46be03}=_0x572366;if(!_0x32a44c)return console[_0xbe9049(0x233)](_0xbe9049(0x16e)+_0x56b503+_0xbe9049(0x277)),0x0;_0x19cd51?console[_0xbe9049(0x233)](_0xbe9049(0x296)+_0x56b503+'\x27:'):console[_0xbe9049(0x233)](_0xbe9049(0x1b6)+_0x56b503+'\x27:');console['error']('─'['repeat'](0x3c)),console[_0xbe9049(0x233)](_0x46be03),console[_0xbe9049(0x233)]('─'['repeat'](0x3c));const _0x53356f=_0x19cd51?'Create\x20parent\x20segment\x20\x27'+_0x56b503+'\x27?':_0xbe9049(0x26a)+_0x56b503+'\x27?';if(!_0x3de9c1[_0xbe9049(0x197)]){const _0x385e38=await confirmKey(_0x53356f);if(!_0x385e38)return console['error'](_0xbe9049(0x199)),0x1;}const _0x42f63c=_0x19cd51?'Creating':_0xbe9049(0x1e5),_0x3696c7=await withSpinner(_0x42f63c+'\x20parent\x20segment\x20\x27'+_0x56b503+_0xbe9049(0x1a5),()=>_0x572366['apply'](),{'verbose':_0x3de9c1['verbose']}),_0x28e03f=_0x3696c7[_0xbe9049(0x20e)],_0x2e852e=getConsoleNextUrl(_0x3de9c1[_0xbe9049(0x282)],'/app/dw/parentSegments/'+_0x28e03f['id']),_0x488b2e=_0x19cd51?_0xbe9049(0x25a):_0xbe9049(0x1fb);return console[_0xbe9049(0x233)]('✔\x20'+_0x488b2e+_0xbe9049(0x1d5)+_0x28e03f[_0xbe9049(0x272)]+'\x27'),console[_0xbe9049(0x233)]('\x20\x20'+_0x2e852e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x207);[a29_0x354af5(0x24c)]=a29_0x354af5(0x1f0);async['execute'](_0x2eda68){const _0x3486e5=a29_0x354af5,{options:_0x4d54bd,args:_0x3edbd9,tdx:_0x39d44e}=_0x2eda68,_0x4d1fc8=_0x4d54bd,_0x401146=_0x3edbd9[0x0]||_0x4d54bd[_0x3486e5(0x20b)];if(!_0x401146)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x3486e5(0x229)+_0x3486e5(0x25f)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x3486e5(0x291)+_0x3486e5(0x1da)),0x1;const _0xf990fd=resolveYamlFile(_0x401146);if(!existsSync(_0xf990fd))return showFileNotFoundError(_0xf990fd,_0x401146),0x1;_0x4d1fc8[_0x3486e5(0x200)]&&(console[_0x3486e5(0x233)](_0x3486e5(0x1a8)+_0x4d1fc8['site']),console['error'](_0x3486e5(0x26b)+_0xf990fd));let _0x2f5f08;try{_0x2f5f08=readFileSync(_0xf990fd,_0x3486e5(0x1ae));}catch(_0x2a6d5c){const _0x208c65=_0x2a6d5c instanceof Error?_0x2a6d5c['message']:String(_0x2a6d5c);return console[_0x3486e5(0x233)](_0x3486e5(0x211)+_0x208c65),0x1;}const _0x38e50f=createCommandSpinner(a29_0x265ace[_0x3486e5(0x1e1)]('Validating\x20configuration...'),{'verbose':_0x4d1fc8[_0x3486e5(0x200)]});_0x38e50f['start']();const _0x5811e7={'onProgress':_0x550d27=>{const _0x5bb2ed=_0x3486e5;_0x38e50f[_0x5bb2ed(0x22c)]=formatProgressMessage(_0x550d27);}};if(_0x4d1fc8[_0x3486e5(0x1d7)])_0x5811e7['master']=!![];if(_0x4d1fc8[_0x3486e5(0x23d)])_0x5811e7[_0x3486e5(0x23d)]=!![];_0x4d1fc8[_0x3486e5(0x1aa)]&&(_0x5811e7[_0x3486e5(0x1aa)]=_0x4d1fc8[_0x3486e5(0x1aa)]);_0x4d1fc8[_0x3486e5(0x22d)]&&(_0x5811e7['behavior']=_0x4d1fc8[_0x3486e5(0x22d)]);if(_0x4d1fc8['interval'])_0x5811e7[_0x3486e5(0x183)]=_0x4d1fc8['interval'];let _0x3438bf;try{_0x3438bf=await _0x39d44e['segment'][_0x3486e5(0x220)](_0x2f5f08,_0x5811e7),_0x38e50f[_0x3486e5(0x1c4)]();}catch(_0x17d8c5){_0x38e50f[_0x3486e5(0x1c4)]();throw _0x17d8c5;}const _0x3f6ff4=_0x4d1fc8['interval']||_0x3486e5(0x1b8);return this[_0x3486e5(0x1f1)](_0x3438bf,_0x5811e7,_0xf990fd,_0x3f6ff4),_0x3438bf['allValid']?0x0:0x1;}[a29_0x354af5(0x1f1)](_0x3105db,_0x10e569,_0xa17ab7,_0x13eb89){const _0x5b2430=a29_0x354af5;console[_0x5b2430(0x233)]('\x0a'+a29_0x265ace[_0x5b2430(0x246)](_0x5b2430(0x284))+'\x20'+_0x3105db[_0x5b2430(0x272)]),console[_0x5b2430(0x233)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x3105db);if(typeof _0x10e569[_0x5b2430(0x1aa)]===_0x5b2430(0x21b)){this['displayAttributesStats'](_0x3105db),this[_0x5b2430(0x180)](_0x3105db),this['displayPreviewHints'](_0xa17ab7,_0x13eb89,'attribute',_0x10e569['attribute']);return;}if(_0x10e569[_0x5b2430(0x1aa)]===!![]){this[_0x5b2430(0x206)](_0x3105db),this[_0x5b2430(0x180)](_0x3105db),this['displayPreviewHints'](_0xa17ab7,_0x13eb89,_0x5b2430(0x24d));return;}if(typeof _0x10e569[_0x5b2430(0x22d)]===_0x5b2430(0x21b)){this[_0x5b2430(0x16f)](_0x3105db,_0x13eb89),this[_0x5b2430(0x180)](_0x3105db),this[_0x5b2430(0x262)](_0xa17ab7,_0x13eb89,_0x5b2430(0x22d),_0x10e569[_0x5b2430(0x22d)]);return;}if(_0x10e569[_0x5b2430(0x22d)]===!![]){this['displayBehaviorsStats'](_0x3105db,_0x13eb89),this[_0x5b2430(0x180)](_0x3105db),this[_0x5b2430(0x262)](_0xa17ab7,_0x13eb89,_0x5b2430(0x194));return;}this['displayAttributesStats'](_0x3105db),this[_0x5b2430(0x16f)](_0x3105db,_0x13eb89),this[_0x5b2430(0x180)](_0x3105db),this['displayPreviewHints'](_0xa17ab7,_0x13eb89,_0x5b2430(0x175));}[a29_0x354af5(0x262)](_0x3cd4c5,_0x5224aa,_0x1b935b,_0x296958){const _0x37180f=a29_0x354af5;console[_0x37180f(0x233)]('\x0a'+a29_0x265ace[_0x37180f(0x1e1)](_0x37180f(0x297)));const _0x4f3716=_0x5224aa!==_0x37180f(0x1b8)?'\x20--interval\x20'+_0x5224aa:'';if(_0x1b935b===_0x37180f(0x1aa)&&_0x296958)console['error']('\x20\x20'+a29_0x265ace['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x3cd4c5+_0x37180f(0x1d3)+_0x296958+'\x22'+_0x4f3716));else{if(_0x1b935b===_0x37180f(0x22d)&&_0x296958)console[_0x37180f(0x233)]('\x20\x20'+a29_0x265ace[_0x37180f(0x1e1)]('tdx\x20segment\x20parent\x20preview\x20'+_0x3cd4c5+_0x37180f(0x1ba)+_0x296958+'\x22'+_0x4f3716));else(_0x1b935b===_0x37180f(0x24d)||_0x1b935b===_0x37180f(0x175))&&console['error']('\x20\x20'+a29_0x265ace['dim'](_0x37180f(0x243)+_0x3cd4c5+_0x37180f(0x289)+_0x4f3716));}(_0x1b935b===_0x37180f(0x194)||_0x1b935b===_0x37180f(0x175))&&console['error']('\x20\x20'+a29_0x265ace['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x3cd4c5+_0x37180f(0x24f)+_0x4f3716)),_0x1b935b===_0x37180f(0x175)&&console[_0x37180f(0x233)]('\x20\x20'+a29_0x265ace['dim'](_0x37180f(0x243)+_0x3cd4c5+_0x37180f(0x25c)+_0x4f3716));}[a29_0x354af5(0x271)](_0x1e3dba){const _0x1eb793=a29_0x354af5,{master:_0x32c5c2}=_0x1e3dba,_0x536377=_0x32c5c2[_0x1eb793(0x1c0)]?a29_0x265ace[_0x1eb793(0x1c7)]('✔'):a29_0x265ace[_0x1eb793(0x1a2)]('✘');console['error']('\x0a'+a29_0x265ace[_0x1eb793(0x1e1)](_0x1eb793(0x23e))),console[_0x1eb793(0x233)](_0x536377+'\x20'+a29_0x265ace[_0x1eb793(0x246)](_0x32c5c2[_0x1eb793(0x20a)]+'.'+_0x32c5c2[_0x1eb793(0x268)])),_0x32c5c2[_0x1eb793(0x1c0)]?_0x32c5c2[_0x1eb793(0x1b0)]!==undefined&&console['error']('\x20\x20'+a29_0x265ace[_0x1eb793(0x1e1)](_0x1eb793(0x26d))+'\x20'+a29_0x265ace[_0x1eb793(0x25b)](formatRows(_0x32c5c2['rowCount']))):console[_0x1eb793(0x233)]('\x20\x20'+a29_0x265ace[_0x1eb793(0x1a2)](_0x1eb793(0x1b3))+'\x20'+_0x32c5c2[_0x1eb793(0x299)]);}['displayAttributesStats'](_0x42d3ac){const _0x48dc87=a29_0x354af5;if(_0x42d3ac[_0x48dc87(0x24d)][_0x48dc87(0x24a)]===0x0)return;console[_0x48dc87(0x233)]('\x0a'+a29_0x265ace[_0x48dc87(0x1e1)]('Attributes'));for(const _0x1826e of _0x42d3ac['attributes']){const _0x41fa02=_0x1826e[_0x48dc87(0x1c0)]?a29_0x265ace[_0x48dc87(0x1c7)]('✔'):a29_0x265ace[_0x48dc87(0x1a2)]('✘');let _0x53e057='';if(_0x1826e[_0x48dc87(0x1c0)]&&_0x1826e[_0x48dc87(0x1b4)]!==undefined&&_0x1826e[_0x48dc87(0x1d6)]!==undefined){const _0x385f70=_0x1826e[_0x48dc87(0x1d6)]['toFixed'](0x1),_0x234540=_0x1826e['coveragePercent']>=0x50?a29_0x265ace[_0x48dc87(0x1c7)]:_0x1826e[_0x48dc87(0x1d6)]>=0x32?a29_0x265ace[_0x48dc87(0x190)]:a29_0x265ace[_0x48dc87(0x1a2)];_0x53e057='\x20'+a29_0x265ace[_0x48dc87(0x1e1)](_0x48dc87(0x247))+'\x20'+_0x234540(_0x385f70+'%')+'\x20('+formatRows(_0x1826e[_0x48dc87(0x1b4)])+_0x48dc87(0x256);}console[_0x48dc87(0x233)](_0x41fa02+'\x20'+a29_0x265ace[_0x48dc87(0x246)](_0x1826e[_0x48dc87(0x272)])+_0x53e057),console['error']('\x20\x20'+a29_0x265ace[_0x48dc87(0x1e1)](_0x48dc87(0x28a))+'\x20'+a29_0x265ace['bold'](_0x1826e[_0x48dc87(0x20a)]+'.'+_0x1826e[_0x48dc87(0x268)]));const _0x5243b9=_0x1826e[_0x48dc87(0x214)]===_0x1826e[_0x48dc87(0x244)]?a29_0x265ace[_0x48dc87(0x1e1)]('Join\x20on:')+'\x20'+_0x1826e[_0x48dc87(0x214)]:a29_0x265ace['dim'](_0x48dc87(0x210))+'\x20'+_0x1826e[_0x48dc87(0x214)]+_0x48dc87(0x1c6)+_0x1826e['foreignKey'];console[_0x48dc87(0x233)]('\x20\x20'+_0x5243b9),console[_0x48dc87(0x233)]('\x20\x20'+a29_0x265ace[_0x48dc87(0x1e1)](_0x48dc87(0x24e))),this[_0x48dc87(0x20c)](_0x1826e[_0x48dc87(0x28b)]),!_0x1826e['schemaValid']&&console['error']('\x20\x20'+a29_0x265ace[_0x48dc87(0x1a2)](_0x48dc87(0x1b3))+'\x20'+_0x1826e[_0x48dc87(0x299)]);}}[a29_0x354af5(0x16f)](_0x422977,_0xb0d0c8){const _0x518203=a29_0x354af5;if(_0x422977[_0x518203(0x194)][_0x518203(0x24a)]===0x0)return;console[_0x518203(0x233)]('\x0a'+a29_0x265ace[_0x518203(0x1e1)]('Behaviors')+'\x20'+a29_0x265ace[_0x518203(0x1e1)]('('+_0xb0d0c8+')'));for(const _0x537d11 of _0x422977['behaviors']){const _0x339a40=_0x537d11[_0x518203(0x1c0)]?a29_0x265ace['green']('✔'):a29_0x265ace[_0x518203(0x1a2)]('✘');let _0x3986eb='';if(_0x537d11[_0x518203(0x1c0)]&&_0x537d11[_0x518203(0x1ce)]!==undefined&&_0x537d11[_0x518203(0x173)]!==undefined){const _0x39675c=_0x537d11[_0x518203(0x260)]?.[_0x518203(0x1ef)](0x1)||'?',_0x20b8be=(_0x537d11[_0x518203(0x260)]??0x0)>=0x32?a29_0x265ace[_0x518203(0x1c7)]:(_0x537d11[_0x518203(0x260)]??0x0)>=0x14?a29_0x265ace['yellow']:a29_0x265ace[_0x518203(0x1a2)];_0x3986eb='\x20'+a29_0x265ace[_0x518203(0x1e1)](_0x518203(0x21a))+'\x20'+_0x20b8be(formatRows(_0x537d11[_0x518203(0x1ce)]))+'\x20('+_0x39675c+_0x518203(0x205)+a29_0x265ace[_0x518203(0x1e1)](_0x518203(0x26f))+'\x20'+a29_0x265ace['cyan'](formatRows(_0x537d11[_0x518203(0x173)]));}console[_0x518203(0x233)](_0x339a40+'\x20'+a29_0x265ace[_0x518203(0x246)](_0x537d11[_0x518203(0x272)])+_0x3986eb),console[_0x518203(0x233)]('\x20\x20'+a29_0x265ace[_0x518203(0x1e1)]('Source:')+'\x20'+a29_0x265ace[_0x518203(0x246)](_0x537d11[_0x518203(0x20a)]+'.'+_0x537d11[_0x518203(0x268)]));const _0x54c376=_0x537d11[_0x518203(0x214)]===_0x537d11[_0x518203(0x244)]?a29_0x265ace[_0x518203(0x1e1)](_0x518203(0x26e))+'\x20'+_0x537d11[_0x518203(0x214)]:a29_0x265ace[_0x518203(0x1e1)](_0x518203(0x210))+'\x20'+_0x537d11['joinKey']+_0x518203(0x1c6)+_0x537d11[_0x518203(0x244)];console[_0x518203(0x233)]('\x20\x20'+_0x54c376),console[_0x518203(0x233)]('\x20\x20'+a29_0x265ace[_0x518203(0x1e1)](_0x518203(0x24e))),this[_0x518203(0x20c)](_0x537d11['columns']),!_0x537d11['schemaValid']&&console[_0x518203(0x233)]('\x20\x20'+a29_0x265ace[_0x518203(0x1a2)](_0x518203(0x1b3))+'\x20'+_0x537d11['schemaError']);}}[a29_0x354af5(0x20c)](_0x18319b){const _0x4666e2=a29_0x354af5;for(const _0x142d25 of _0x18319b){_0x142d25[_0x4666e2(0x1a3)]===_0x142d25[_0x4666e2(0x281)]||_0x142d25[_0x4666e2(0x281)]==='*'?console[_0x4666e2(0x233)](_0x4666e2(0x237)+_0x142d25['label']):console[_0x4666e2(0x233)]('\x20\x20\x20\x20-\x20'+_0x142d25[_0x4666e2(0x1a3)]+'\x20'+a29_0x265ace['dim']('('+_0x142d25[_0x4666e2(0x281)]+')'));}}[a29_0x354af5(0x180)](_0x1872f9){const _0x2ff344=a29_0x354af5;console[_0x2ff344(0x233)]('─'[_0x2ff344(0x28c)](0x3c));if(_0x1872f9['errors'][_0x2ff344(0x24a)]>0x0){console['error']('\x0a'+a29_0x265ace[_0x2ff344(0x1a2)](_0x2ff344(0x1c3)));for(const _0x1ba519 of _0x1872f9['errors']){console[_0x2ff344(0x233)]('\x20\x20'+a29_0x265ace[_0x2ff344(0x1a2)]('•')+'\x20'+_0x1ba519);}}_0x1872f9[_0x2ff344(0x239)]&&console[_0x2ff344(0x233)]('\x0a'+a29_0x265ace[_0x2ff344(0x1c7)]('✔')+_0x2ff344(0x196));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a29_0x354af5(0x266);[a29_0x354af5(0x24c)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async['execute'](_0xfeb788){const _0x5253ed=a29_0x354af5,{options:_0x3a5ad5,args:_0x12e01e,tdx:_0x5b2dc6}=_0xfeb788,_0x4c285e=_0x3a5ad5,_0x5d7065=_0x12e01e[0x0]||_0x3a5ad5[_0x5253ed(0x20b)];if(!_0x5d7065)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x5253ed(0x27c)+_0x5253ed(0x1ad)+_0x5253ed(0x18b)+_0x5253ed(0x188)+_0x5253ed(0x27b)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x5253ed(0x1da)),0x1;if(!_0x4c285e[_0x5253ed(0x1d7)]&&!_0x4c285e['attribute']&&!_0x4c285e[_0x5253ed(0x22d)]&&!_0x4c285e['enriched'])return console['error'](a29_0x265ace[_0x5253ed(0x1a2)](_0x5253ed(0x253))),console['error'](_0x5253ed(0x1f8)),console[_0x5253ed(0x233)](_0x5253ed(0x201)),console[_0x5253ed(0x233)](_0x5253ed(0x1af)),console[_0x5253ed(0x233)](_0x5253ed(0x254)),console[_0x5253ed(0x233)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x5253ed(0x233)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x254710=resolveYamlFile(_0x5d7065);if(!existsSync(_0x254710))return showFileNotFoundError(_0x254710,_0x5d7065),0x1;_0x4c285e[_0x5253ed(0x200)]&&(console[_0x5253ed(0x233)]('Site:\x20'+_0x4c285e[_0x5253ed(0x282)]),console[_0x5253ed(0x233)](_0x5253ed(0x26b)+_0x254710));let _0x4ae82e;try{_0x4ae82e=readFileSync(_0x254710,_0x5253ed(0x1ae));}catch(_0x541701){const _0x320a3b=_0x541701 instanceof Error?_0x541701[_0x5253ed(0x185)]:String(_0x541701);return console[_0x5253ed(0x233)](_0x5253ed(0x211)+_0x320a3b),0x1;}let _0x30e842;try{_0x30e842=parseYamlString(_0x4ae82e);}catch(_0x330728){const _0x1d07cb=_0x330728 instanceof Error?_0x330728['message']:String(_0x330728);return console[_0x5253ed(0x233)](a29_0x265ace[_0x5253ed(0x1a2)](_0x5253ed(0x23b)+_0x1d07cb)),0x1;}if(_0x4c285e[_0x5253ed(0x1aa)]===!![]||_0x4c285e['attribute']===''){const _0xd854a7=_0x30e842[_0x5253ed(0x24d)]?.[_0x5253ed(0x27a)](_0x44aa56=>_0x44aa56[_0x5253ed(0x272)])||[];if(_0xd854a7[_0x5253ed(0x24a)]===0x0)console[_0x5253ed(0x233)](a29_0x265ace[_0x5253ed(0x1a2)](_0x5253ed(0x1bd)));else{console[_0x5253ed(0x233)](a29_0x265ace[_0x5253ed(0x1a2)](_0x5253ed(0x19c))),console['error']('Available\x20attributes:');for(const _0x29465f of _0xd854a7){console[_0x5253ed(0x233)]('\x20\x20'+a29_0x265ace[_0x5253ed(0x25b)](_0x29465f));}console[_0x5253ed(0x233)](_0x5253ed(0x232)+_0x5d7065+_0x5253ed(0x1d3)+_0xd854a7[0x0]+'\x22');}return 0x1;}if(_0x4c285e['behavior']===!![]||_0x4c285e['behavior']===''){const _0x5a17a2=_0x30e842['behaviors']?.[_0x5253ed(0x27a)](_0x2e02f5=>_0x2e02f5[_0x5253ed(0x272)])||[];if(_0x5a17a2['length']===0x0)console[_0x5253ed(0x233)](a29_0x265ace[_0x5253ed(0x1a2)](_0x5253ed(0x267)));else{console[_0x5253ed(0x233)](a29_0x265ace[_0x5253ed(0x1a2)](_0x5253ed(0x22a))),console[_0x5253ed(0x233)](_0x5253ed(0x16d));for(const _0x572dd5 of _0x5a17a2){console[_0x5253ed(0x233)]('\x20\x20'+a29_0x265ace['cyan'](_0x572dd5));}console[_0x5253ed(0x233)](_0x5253ed(0x232)+_0x5d7065+_0x5253ed(0x1ba)+_0x5a17a2[0x0]+'\x22');}return 0x1;}const _0x5603ed=createCommandSpinner(a29_0x265ace[_0x5253ed(0x1e1)](_0x5253ed(0x231)),{'verbose':_0x4c285e[_0x5253ed(0x200)]});_0x5603ed[_0x5253ed(0x240)]();const _0x3b7735={'onProgress':_0x1c0745=>{const _0x518f72=_0x5253ed;_0x5603ed[_0x518f72(0x22c)]=formatProgressMessage(_0x1c0745);}};if(_0x4c285e[_0x5253ed(0x1d7)])_0x3b7735[_0x5253ed(0x1d7)]=!![];if(_0x4c285e[_0x5253ed(0x1aa)]&&typeof _0x4c285e[_0x5253ed(0x1aa)]==='string')_0x3b7735['attribute']=_0x4c285e[_0x5253ed(0x1aa)];if(_0x4c285e[_0x5253ed(0x22d)]&&typeof _0x4c285e[_0x5253ed(0x22d)]===_0x5253ed(0x21b))_0x3b7735['behavior']=_0x4c285e[_0x5253ed(0x22d)];if(_0x4c285e['enriched'])_0x3b7735[_0x5253ed(0x23d)]=!![];if(_0x4c285e[_0x5253ed(0x183)])_0x3b7735[_0x5253ed(0x183)]=_0x4c285e['interval'];let _0x3573f5;try{_0x3573f5=await _0x5b2dc6[_0x5253ed(0x25e)][_0x5253ed(0x276)](_0x4ae82e,_0x3b7735),_0x5603ed[_0x5253ed(0x1c4)]();}catch(_0x341ee6){_0x5603ed[_0x5253ed(0x1c4)]();throw _0x341ee6;}return await this['displayPreviewResults'](_0x3573f5,{'master':_0x4c285e[_0x5253ed(0x1d7)],'attribute':typeof _0x4c285e[_0x5253ed(0x1aa)]==='string'?_0x4c285e['attribute']:undefined,'behavior':typeof _0x4c285e[_0x5253ed(0x22d)]===_0x5253ed(0x21b)?_0x4c285e[_0x5253ed(0x22d)]:undefined,'enriched':_0x4c285e[_0x5253ed(0x23d)]}),_0x3573f5[_0x5253ed(0x239)]?0x0:0x1;}async[a29_0x354af5(0x261)](_0x469259,_0x19f20a){const _0xa74ba=a29_0x354af5;console['error']('\x0a'+a29_0x265ace[_0xa74ba(0x246)]('Preview:')+'\x20'+_0x469259[_0xa74ba(0x272)]),console[_0xa74ba(0x233)]('═'[_0xa74ba(0x28c)](0x3c));if(_0x19f20a[_0xa74ba(0x1d7)]&&_0x469259[_0xa74ba(0x20f)]){const _0x167a03=a29_0x265ace[_0xa74ba(0x1e1)](_0xa74ba(0x286))+'\x20'+a29_0x265ace[_0xa74ba(0x246)](_0x469259['master'][_0xa74ba(0x20a)]+'.'+_0x469259[_0xa74ba(0x1d7)][_0xa74ba(0x268)]);await this[_0xa74ba(0x275)](_0x167a03,_0x469259[_0xa74ba(0x20f)]);}else{if(_0x19f20a[_0xa74ba(0x1aa)]&&_0x469259[_0xa74ba(0x20f)]){const _0x757649=a29_0x265ace[_0xa74ba(0x1e1)](_0xa74ba(0x19e))+'\x20'+a29_0x265ace[_0xa74ba(0x246)](_0x19f20a[_0xa74ba(0x1aa)]);await this[_0xa74ba(0x275)](_0x757649,_0x469259[_0xa74ba(0x20f)]);}else{if(_0x19f20a[_0xa74ba(0x22d)]&&_0x469259[_0xa74ba(0x20f)]){const _0x51283f=a29_0x265ace[_0xa74ba(0x1e1)]('Behavior:')+'\x20'+a29_0x265ace[_0xa74ba(0x246)](_0x19f20a[_0xa74ba(0x22d)]);await this[_0xa74ba(0x275)](_0x51283f,_0x469259[_0xa74ba(0x20f)]);}else{if(_0x19f20a[_0xa74ba(0x23d)]&&_0x469259[_0xa74ba(0x20f)]){const _0x126cbd=a29_0x265ace['dim'](_0xa74ba(0x1e6))+'\x20'+a29_0x265ace[_0xa74ba(0x246)](_0xa74ba(0x17a));await this['displaySampleData'](_0x126cbd,_0x469259['sampleData']);}else!_0x469259['sampleData']&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x469259[_0xa74ba(0x176)][_0xa74ba(0x24a)]>0x0){console[_0xa74ba(0x233)]('─'[_0xa74ba(0x28c)](0x3c)),console[_0xa74ba(0x233)]('\x0a'+a29_0x265ace[_0xa74ba(0x1a2)](_0xa74ba(0x1c3)));for(const _0x2fc2c8 of _0x469259[_0xa74ba(0x176)]){console[_0xa74ba(0x233)]('\x20\x20'+a29_0x265ace[_0xa74ba(0x1a2)]('•')+'\x20'+_0x2fc2c8);}}}async[a29_0x354af5(0x275)](_0x54b0c7,_0x553600){const _0x4342ae=a29_0x354af5;if(_0x553600[_0x4342ae(0x24a)]===0x0){console[_0x4342ae(0x233)]('\x0a'+_0x54b0c7),console[_0x4342ae(0x233)](_0x4342ae(0x182));return;}console[_0x4342ae(0x233)]('\x0a'+_0x54b0c7);const _0x6c4d21=Object[_0x4342ae(0x203)](_0x553600[0x0])[_0x4342ae(0x27a)](_0x296a82=>({'name':_0x296a82,'type':typeof _0x553600[0x0][_0x296a82]===_0x4342ae(0x1fe)?_0x4342ae(0x177):_0x4342ae(0x23a)})),_0x1f101c={'queryId':_0x4342ae(0x204),'columns':_0x6c4d21,'data':_0x553600,'stats':{'state':_0x4342ae(0x19d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x553600[_0x4342ae(0x24a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2759e6=formatAsTable(_0x1f101c,_0x553600[_0x4342ae(0x24a)],!![]);await writeOutput(_0x2759e6,undefined,_0x4342ae(0x268));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x274);[a29_0x354af5(0x24c)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a29_0x354af5(0x20d)](_0x13fe25){const _0x31a5c7=a29_0x354af5,{options:_0x554c2d,args:_0x4b0c98,tdx:_0x254d41}=_0x13fe25,_0x394a73=_0x554c2d,_0x46aad0=_0x4b0c98[0x0]||_0x554c2d[_0x31a5c7(0x20b)];if(!_0x46aad0)return showParentSegmentNotSetError(_0x31a5c7(0x278)+_0x31a5c7(0x215)),0x1;const _0x20edba=resolveYamlFile(_0x46aad0);if(existsSync(_0x20edba)){_0x394a73[_0x31a5c7(0x200)]&&console[_0x31a5c7(0x233)](_0x31a5c7(0x28f)+_0x20edba);let _0x158de5;try{_0x158de5=readFileSync(_0x20edba,_0x31a5c7(0x1ae));}catch(_0x4a7011){const _0x481427=_0x4a7011 instanceof Error?_0x4a7011[_0x31a5c7(0x185)]:String(_0x4a7011);return console[_0x31a5c7(0x233)]('Error\x20reading\x20file:\x20'+_0x481427),0x1;}const _0x42d4e2=await withSpinner(_0x31a5c7(0x22e),()=>_0x254d41[_0x31a5c7(0x25e)]['pushParentYaml'](_0x158de5),{'verbose':_0x394a73[_0x31a5c7(0x200)]}),_0x11b144=_0x42d4e2[_0x31a5c7(0x20e)],{isNew:_0x259dec,name:_0x4d09d5,hasChanges:_0x3cd5e5,diffFormatted:_0x73bd93}=_0x11b144;if(_0x3cd5e5){_0x259dec?console[_0x31a5c7(0x233)](_0x31a5c7(0x296)+_0x4d09d5+'\x27:'):console[_0x31a5c7(0x233)](_0x31a5c7(0x1b6)+_0x4d09d5+'\x27:');console[_0x31a5c7(0x233)]('─'[_0x31a5c7(0x28c)](0x3c)),console[_0x31a5c7(0x233)](_0x73bd93),console[_0x31a5c7(0x233)]('─'[_0x31a5c7(0x28c)](0x3c));const _0x2e9c30=_0x259dec?_0x31a5c7(0x1b9)+_0x4d09d5+_0x31a5c7(0x18c):'Apply\x20changes\x20to\x20\x27'+_0x4d09d5+_0x31a5c7(0x18c);if(!_0x394a73[_0x31a5c7(0x197)]){const _0x8926f=await confirmKey(_0x2e9c30);if(!_0x8926f)return console['error'](_0x31a5c7(0x199)),0x1;}const _0xd123c6=_0x259dec?_0x31a5c7(0x1e8):'Updating';await withSpinner(_0xd123c6+_0x31a5c7(0x1d5)+_0x4d09d5+_0x31a5c7(0x1a5),()=>_0x11b144[_0x31a5c7(0x236)](),{'verbose':_0x394a73[_0x31a5c7(0x200)]});const _0x4cf0fc=_0x259dec?_0x31a5c7(0x25a):_0x31a5c7(0x1fb);console[_0x31a5c7(0x233)]('✔\x20'+_0x4cf0fc+_0x31a5c7(0x1d5)+_0x4d09d5+'\x27');}else console[_0x31a5c7(0x233)](_0x31a5c7(0x16e)+_0x4d09d5+_0x31a5c7(0x221));}const _0x354384=await withSpinner(_0x31a5c7(0x293)+_0x46aad0+_0x31a5c7(0x1a5),()=>_0x254d41[_0x31a5c7(0x25e)][_0x31a5c7(0x21d)](_0x46aad0),{'verbose':_0x394a73[_0x31a5c7(0x200)]}),_0x2350f6=_0x354384['data'],_0x45da10=getConsoleUrl(_0x394a73[_0x31a5c7(0x282)],_0x31a5c7(0x1a9)+_0x2350f6[_0x31a5c7(0x1e7)]+'/sessions/'+_0x2350f6[_0x31a5c7(0x1d9)]+_0x31a5c7(0x23c)+_0x2350f6['workflowAttemptId']);return console['error'](_0x31a5c7(0x1ff)),console[_0x31a5c7(0x233)]('\x20\x20'+a29_0x265ace[_0x31a5c7(0x1e1)]('Audience\x20ID:')+'\x20'+_0x2350f6[_0x31a5c7(0x273)]),console[_0x31a5c7(0x233)]('\x20\x20'+a29_0x265ace[_0x31a5c7(0x1e1)](_0x31a5c7(0x18f))+'\x20'+_0x2350f6[_0x31a5c7(0x178)]),console[_0x31a5c7(0x233)]('\x20\x20'+a29_0x265ace[_0x31a5c7(0x1e1)]('Session:')+'\x20'+_0x2350f6[_0x31a5c7(0x1d9)]),console[_0x31a5c7(0x233)]('\x20\x20'+a29_0x265ace['dim'](_0x31a5c7(0x28d))+'\x20'+_0x2350f6[_0x31a5c7(0x1b5)]),console[_0x31a5c7(0x233)]('\x20\x20'+_0x45da10),console['error']('\x0a'+a29_0x265ace['dim'](_0x31a5c7(0x269))+'\x20tdx\x20wf\x20attempt\x20'+_0x2350f6['workflowAttemptId']+_0x31a5c7(0x216)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x1e3);[a29_0x354af5(0x24c)]=a29_0x354af5(0x265);async['execute'](_0x57eb03){const _0x216f86=a29_0x354af5,{options:_0x2f14c8,args:_0x19856b,tdx:_0x15cf83}=_0x57eb03,_0x54a00d=_0x19856b[0x0]||_0x2f14c8[_0x216f86(0x20b)];if(!_0x54a00d)return showParentSegmentNotSetError(_0x216f86(0x1cd)+_0x216f86(0x1d0)),0x1;_0x2f14c8[_0x216f86(0x200)]&&(console[_0x216f86(0x233)](_0x216f86(0x1a8)+_0x2f14c8[_0x216f86(0x282)]),console[_0x216f86(0x233)](_0x216f86(0x1de)+_0x54a00d));const _0x2b9320=await withSpinner(_0x216f86(0x1ca)+_0x54a00d+'\x27...',()=>_0x15cf83[_0x216f86(0x25e)][_0x216f86(0x1c5)](_0x54a00d),{'verbose':_0x2f14c8[_0x216f86(0x200)]}),_0x4df3b8=_0x2b9320[_0x216f86(0x20e)];console['error']('✔\x20Found\x20'+_0x4df3b8['length']+_0x216f86(0x1fd)+(_0x4df3b8[_0x216f86(0x24a)]!==0x1?'s':''));if(_0x2f14c8['json']||_0x2f14c8[_0x216f86(0x18a)])return await handleSDKOutput(_0x4df3b8,_0x2f14c8),0x0;return displayFieldsHumanReadable(_0x4df3b8,_0x54a00d),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x354af5(0x272)]='segment:parent:view';[a29_0x354af5(0x24c)]=a29_0x354af5(0x1e0);async[a29_0x354af5(0x20d)](_0x307020){const _0x2cf9cf=a29_0x354af5,{options:_0x4f9d84,args:_0x464ae4,tdx:_0x18a631}=_0x307020,_0x6279cb=_0x4f9d84,_0x2baf25=_0x464ae4[0x0]||_0x4f9d84[_0x2cf9cf(0x20b)];if(!_0x2baf25)return showParentSegmentNotSetError(_0x2cf9cf(0x1c1)+_0x2cf9cf(0x27d)+_0x2cf9cf(0x25f)+_0x2cf9cf(0x226)),0x1;_0x4f9d84[_0x2cf9cf(0x200)]&&(console[_0x2cf9cf(0x233)](_0x2cf9cf(0x1a8)+_0x4f9d84[_0x2cf9cf(0x282)]),console[_0x2cf9cf(0x233)](_0x2cf9cf(0x1de)+_0x2baf25));const _0xb5bb0=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2baf25+_0x2cf9cf(0x1a5),()=>_0x18a631[_0x2cf9cf(0x25e)][_0x2cf9cf(0x264)](_0x2baf25),{'verbose':_0x4f9d84['verbose']}),_0x1fa55d=_0xb5bb0[_0x2cf9cf(0x20e)];if(_0x6279cb[_0x2cf9cf(0x174)]){const _0xab9f78=getConsoleNextUrl(_0x6279cb[_0x2cf9cf(0x282)],_0x2cf9cf(0x241)+_0x1fa55d['id']);return console[_0x2cf9cf(0x233)](a29_0x265ace[_0x2cf9cf(0x1c7)]('✔')+_0x2cf9cf(0x1c8)+a29_0x265ace[_0x2cf9cf(0x25b)](_0xab9f78)),openBrowser(_0xab9f78),0x0;}return await handleSingleObjectOutput(_0x1fa55d,_0x4f9d84),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x213);[a29_0x354af5(0x24c)]=a29_0x354af5(0x1cb);async[a29_0x354af5(0x20d)](_0xf0a29b){const _0x124bcd=a29_0x354af5,{options:_0x51b488,args:_0x30210d,tdx:_0x4b5b8f}=_0xf0a29b,_0x2de8ad=_0x30210d[0x0]||_0x51b488[_0x124bcd(0x20b)];if(!_0x2de8ad)return showParentSegmentNotSetError(_0x124bcd(0x26c)+_0x124bcd(0x235)),0x1;_0x51b488[_0x124bcd(0x200)]&&(console[_0x124bcd(0x233)](_0x124bcd(0x1a8)+_0x51b488[_0x124bcd(0x282)]),console[_0x124bcd(0x233)](_0x124bcd(0x1de)+_0x2de8ad));const _0x47566a=await withSpinner(_0x124bcd(0x1b2)+_0x2de8ad+_0x124bcd(0x1a5),()=>_0x4b5b8f['segment'][_0x124bcd(0x1bb)](_0x2de8ad),{'verbose':_0x51b488[_0x124bcd(0x200)]}),_0x2ca2b6=_0x47566a[_0x124bcd(0x20e)],_0x1de741=await withSpinner(_0x124bcd(0x191)+_0x2de8ad+_0x124bcd(0x1a5),()=>_0x4b5b8f[_0x124bcd(0x25e)][_0x124bcd(0x1a7)](_0x2ca2b6),{'verbose':_0x51b488[_0x124bcd(0x200)]}),_0xdd6302=await executeSchemaQuery(_0x1de741[_0x124bcd(0x20e)],_0x4b5b8f,_0x51b488);return await handleQueryOutput(_0xdd6302,_0x51b488),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x16b);[a29_0x354af5(0x24c)]=a29_0x354af5(0x259);async[a29_0x354af5(0x20d)](_0x45787f){const _0x4dff77=a29_0x354af5,{options:_0x42b319,args:_0x339770,tdx:_0x2523da}=_0x45787f,_0x23e1ae=_0x339770[0x0]||_0x42b319['parentSegment'];if(!_0x23e1ae)return showParentSegmentNotSetError(_0x4dff77(0x1b7)+_0x4dff77(0x287)),0x1;_0x42b319['verbose']&&(console['error'](_0x4dff77(0x1a8)+_0x42b319[_0x4dff77(0x282)]),console[_0x4dff77(0x233)]('Parent\x20segment:\x20'+_0x23e1ae));const _0xd97dc8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x23e1ae+'\x27...',()=>_0x2523da[_0x4dff77(0x25e)]['resolveParentId'](_0x23e1ae),{'verbose':_0x42b319[_0x4dff77(0x200)]}),_0x4d010f=_0xd97dc8['data'],_0x37124d=await withSpinner(_0x4dff77(0x191)+_0x23e1ae+_0x4dff77(0x1a5),()=>_0x2523da[_0x4dff77(0x25e)][_0x4dff77(0x1a7)](_0x4d010f),{'verbose':_0x42b319['verbose']}),_0x5e8491=_0x37124d[_0x4dff77(0x20e)];return _0x42b319[_0x4dff77(0x17f)]===_0x4dff77(0x295)||_0x42b319[_0x4dff77(0x17f)]===_0x4dff77(0x18a)?await handleSDKOutput([{'sql':_0x5e8491}],_0x42b319):console[_0x4dff77(0x208)](_0x5e8491),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x354af5(0x272)]=a29_0x354af5(0x19a);[a29_0x354af5(0x24c)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x3f4967){const _0x546cab=a29_0x354af5,{options:_0x50af43,args:_0x20a1e3,tdx:_0x34c5b2}=_0x3f4967,_0x2bc00e=_0x20a1e3[0x0]||_0x50af43[_0x546cab(0x20b)];if(!_0x2bc00e)return showParentSegmentNotSetError(_0x546cab(0x202)+_0x546cab(0x234)),0x1;_0x50af43['verbose']&&(console[_0x546cab(0x233)](_0x546cab(0x1a8)+_0x50af43[_0x546cab(0x282)]),console[_0x546cab(0x233)](_0x546cab(0x1de)+_0x2bc00e));const _0x5903b4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2bc00e+_0x546cab(0x1a5),()=>_0x34c5b2[_0x546cab(0x25e)][_0x546cab(0x1bb)](_0x2bc00e),{'verbose':_0x50af43[_0x546cab(0x200)]}),_0x51dd26=_0x5903b4[_0x546cab(0x20e)],_0x190e42=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x2bc00e+'\x27...',()=>_0x34c5b2[_0x546cab(0x25e)]['getParentSQL'](_0x51dd26),{'verbose':_0x50af43[_0x546cab(0x200)]});let _0x4c4446=_0x190e42[_0x546cab(0x20e)];const _0x320e31=resolveLimit(_0x50af43['limit'],DEFAULT_DISPLAY_LIMIT),_0x33bc55=/\bLIMIT\s+\d+/i['test'](_0x4c4446);!_0x33bc55&&(_0x4c4446=_0x4c4446[_0x546cab(0x279)]()[_0x546cab(0x24b)](/;+$/,''),_0x4c4446='SELECT\x20*\x20FROM\x20(\x0a'+_0x4c4446+_0x546cab(0x1ed)+_0x320e31);_0x50af43['verbose']&&console['error'](_0x546cab(0x1dd)+_0x4c4446);const _0x471573=await withQuerySpinner(_0x546cab(0x21e),async _0x22f026=>{const _0x1609e3=_0x546cab,_0x44d84a=await _0x34c5b2[_0x1609e3(0x263)]['execute'](_0x4c4446,{'catalog':'td','schema':_0x1609e3(0x17e),'onJobId':_0x30aea6=>{_0x22f026['setJobId'](_0x30aea6);}});return _0x44d84a;},{'verbose':_0x50af43['verbose']}),_0xc0d1db=_0x471573['data'],_0x2cf372=_0xc0d1db[_0x546cab(0x228)]?'\x20[Job\x20ID:\x20'+_0xc0d1db['jobId']+']':'';return console[_0x546cab(0x233)](_0x546cab(0x227)+_0xc0d1db[_0x546cab(0x294)]['processedRows'][_0x546cab(0x1a1)]()+_0x546cab(0x1cc)+(_0x546cab(0x21c)+formatElapsed(_0xc0d1db[_0x546cab(0x294)][_0x546cab(0x28e)])+_0x2cf372)),await handleQueryOutput(_0xc0d1db,_0x50af43),0x0;}}
@@ -1 +1 @@
1
- const a30_0x20ebe7=a30_0x1802;(function(_0x4ce1e9,_0x4e3daf){const _0x1290a6=a30_0x1802,_0x1d489e=_0x4ce1e9();while(!![]){try{const _0x2535e9=parseInt(_0x1290a6(0x1eb))/0x1+parseInt(_0x1290a6(0x1f1))/0x2*(parseInt(_0x1290a6(0x1f8))/0x3)+parseInt(_0x1290a6(0x1f9))/0x4+parseInt(_0x1290a6(0x1f4))/0x5*(-parseInt(_0x1290a6(0x1ed))/0x6)+-parseInt(_0x1290a6(0x200))/0x7*(-parseInt(_0x1290a6(0x1f6))/0x8)+-parseInt(_0x1290a6(0x1ec))/0x9+parseInt(_0x1290a6(0x1f3))/0xa;if(_0x2535e9===_0x4e3daf)break;else _0x1d489e['push'](_0x1d489e['shift']());}catch(_0x128286){_0x1d489e['push'](_0x1d489e['shift']());}}}(a30_0x7ecb,0x74d91));import{BaseCommand}from'./command.js';function a30_0x1802(_0x5778fb,_0x381c59){_0x5778fb=_0x5778fb-0x1ea;const _0x7ecbae=a30_0x7ecb();let _0x1802d2=_0x7ecbae[_0x5778fb];return _0x1802d2;}function a30_0x7ecb(){const _0x673c95=['log','description','config','7irQBUo','length','message','546793YUrNPf','5930073pdKEYB','1278JbaqfQ','Error:\x20','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','profiles','8734MrxNrQ','name','3809880lWjVdc','20905IqqQPT','\x20\x20Global:\x20~/.config/tdx/tdx.json','580664zGjhvU','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','627xECgof','459968seGiSM','map','scope','List\x20all\x20available\x20profiles'];a30_0x7ecb=function(){return _0x673c95;};return a30_0x7ecb();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0x20ebe7(0x1f2)]=a30_0x20ebe7(0x1f0);[a30_0x20ebe7(0x1fe)]=a30_0x20ebe7(0x1fc);async['execute'](_0x5d3f9c){const _0x39caa5=a30_0x20ebe7,{options:_0x2b9ce1}=_0x5d3f9c;try{const _0x5aea8b=listProfiles(),_0xa56161=getActiveProfile();if(_0x5aea8b[_0x39caa5(0x201)]===0x0)return console[_0x39caa5(0x1fd)](_0x39caa5(0x1ef)),console[_0x39caa5(0x1fd)](_0x39caa5(0x1f7)),console[_0x39caa5(0x1fd)](_0x39caa5(0x1f5)),0x0;const _0x175861=_0x5aea8b[_0x39caa5(0x1fa)](_0x321412=>{const _0x440fa8=_0x39caa5,_0x1a648f=_0x321412[_0x440fa8(0x1f2)]===_0xa56161,_0x5ee529=getProfileParams(_0x321412[_0x440fa8(0x1ff)]);return{'name':_0x321412[_0x440fa8(0x1f2)],'active':_0x1a648f,'scope':_0x321412[_0x440fa8(0x1fb)],'description':_0x321412[_0x440fa8(0x1ff)]['description']||'','params':_0x5ee529};});return await handleSDKOutput(_0x175861,_0x2b9ce1),0x0;}catch(_0x355f25){return _0x355f25 instanceof Error&&console['error'](_0x39caa5(0x1ee)+_0x355f25[_0x39caa5(0x1ea)]),0x1;}}}
1
+ const a30_0x3e5728=a30_0x5665;function a30_0x4f05(){const _0x41015b=['log','4725798IYDozG','message','47424OvtYYy','2pyEfxx','description','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','execute','5540730FbVmJO','553BhtSGB','6390VKbFaP','24Hxekef','Error:\x20','length','17990863MUXSfm','config','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','map','error','name','53112HhBXCh','21040Txrqoq','246242uFECsL','\x20\x20Global:\x20~/.config/tdx/tdx.json','16hVNKvZ'];a30_0x4f05=function(){return _0x41015b;};return a30_0x4f05();}(function(_0x20360f,_0x3c5963){const _0x43051f=a30_0x5665,_0x2466f9=_0x20360f();while(!![]){try{const _0x59a883=parseInt(_0x43051f(0x82))/0x1*(parseInt(_0x43051f(0x94))/0x2)+-parseInt(_0x43051f(0x81))/0x3*(-parseInt(_0x43051f(0x7d))/0x4)+parseInt(_0x43051f(0x86))/0x5+parseInt(_0x43051f(0x7f))/0x6+parseInt(_0x43051f(0x87))/0x7*(parseInt(_0x43051f(0x92))/0x8)+parseInt(_0x43051f(0x88))/0x9*(parseInt(_0x43051f(0x93))/0xa)+-parseInt(_0x43051f(0x8c))/0xb*(parseInt(_0x43051f(0x89))/0xc);if(_0x59a883===_0x3c5963)break;else _0x2466f9['push'](_0x2466f9['shift']());}catch(_0x52be9b){_0x2466f9['push'](_0x2466f9['shift']());}}}(a30_0x4f05,0xe88bc));function a30_0x5665(_0x5d0918,_0x4cf80e){_0x5d0918=_0x5d0918-0x7d;const _0x4f059a=a30_0x4f05();let _0x566515=_0x4f059a[_0x5d0918];return _0x566515;}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{[a30_0x3e5728(0x91)]='profiles';[a30_0x3e5728(0x83)]='List\x20all\x20available\x20profiles';async[a30_0x3e5728(0x85)](_0x3da2fd){const _0x55aed6=a30_0x3e5728,{options:_0x597a20}=_0x3da2fd;try{const _0x12b0fa=listProfiles(),_0x47a01f=getActiveProfile();if(_0x12b0fa[_0x55aed6(0x8b)]===0x0)return console[_0x55aed6(0x7e)](_0x55aed6(0x8e)),console['log'](_0x55aed6(0x84)),console[_0x55aed6(0x7e)](_0x55aed6(0x95)),0x0;const _0x4b94c9=_0x12b0fa[_0x55aed6(0x8f)](_0xbf78c2=>{const _0x5a8266=_0x55aed6,_0x25ab0d=_0xbf78c2[_0x5a8266(0x91)]===_0x47a01f,_0x164fab=getProfileParams(_0xbf78c2[_0x5a8266(0x8d)]);return{'name':_0xbf78c2[_0x5a8266(0x91)],'active':_0x25ab0d,'scope':_0xbf78c2['scope'],'description':_0xbf78c2[_0x5a8266(0x8d)][_0x5a8266(0x83)]||'','params':_0x164fab};});return await handleSDKOutput(_0x4b94c9,_0x597a20),0x0;}catch(_0x457dea){return _0x457dea instanceof Error&&console[_0x55aed6(0x90)](_0x55aed6(0x8a)+_0x457dea[_0x55aed6(0x80)]),0x1;}}}