@treasuredata/tdx 0.8.1 → 0.8.3

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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.d.ts.map +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-command.js.map +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/connection-command.js +1 -1
  26. package/dist/commands/context-command.js +1 -1
  27. package/dist/commands/databases.js +1 -1
  28. package/dist/commands/describe.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segments.js +1 -1
  44. package/dist/commands/show.js +1 -1
  45. package/dist/commands/tables.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.d.ts +11 -19
  61. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js.map +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/context-signature.js +1 -1
  66. package/dist/proxy/conversation-utils.js +1 -1
  67. package/dist/proxy/conversation-utils.js.map +1 -1
  68. package/dist/proxy/server.d.ts.map +1 -1
  69. package/dist/proxy/server.js +1 -1
  70. package/dist/proxy/server.js.map +1 -1
  71. package/dist/proxy/session-cache.js +1 -1
  72. package/dist/sdk/api.js +1 -1
  73. package/dist/sdk/connection.js +1 -1
  74. package/dist/sdk/engage.js +1 -1
  75. package/dist/sdk/errors.js +1 -1
  76. package/dist/sdk/index.js +1 -1
  77. package/dist/sdk/job.js +1 -1
  78. package/dist/sdk/llm.js +1 -1
  79. package/dist/sdk/query.js +1 -1
  80. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  81. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  82. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  83. package/dist/sdk/segment.js +1 -1
  84. package/dist/sdk/user.js +1 -1
  85. package/dist/sdk/workflow.js +1 -1
  86. package/dist/types/endpoints.js +1 -1
  87. package/dist/types/index.js +1 -1
  88. package/dist/utils/agent-ref-parser.js +1 -1
  89. package/dist/utils/async.js +1 -1
  90. package/dist/utils/chat-cache.js +1 -1
  91. package/dist/utils/colors.js +1 -1
  92. package/dist/utils/command-output.js +1 -1
  93. package/dist/utils/constants.js +1 -1
  94. package/dist/utils/diff.js +1 -1
  95. package/dist/utils/fields-display.js +1 -1
  96. package/dist/utils/file-permissions.js +1 -1
  97. package/dist/utils/format-detector.js +1 -1
  98. package/dist/utils/formatters.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
- function a24_0x3ca6(_0x956f45,_0x193f41){_0x956f45=_0x956f45-0x14a;const _0x1f32cd=a24_0x1f32();let _0x3ca6a0=_0x1f32cd[_0x956f45];return _0x3ca6a0;}const a24_0x3afaf6=a24_0x3ca6;(function(_0x15cd73,_0x243e37){const _0x37a6ff=a24_0x3ca6,_0x4fe855=_0x15cd73();while(!![]){try{const _0xdd7b23=parseInt(_0x37a6ff(0x178))/0x1+parseInt(_0x37a6ff(0x170))/0x2*(parseInt(_0x37a6ff(0x166))/0x3)+parseInt(_0x37a6ff(0x162))/0x4*(parseInt(_0x37a6ff(0x168))/0x5)+-parseInt(_0x37a6ff(0x199))/0x6+-parseInt(_0x37a6ff(0x195))/0x7+-parseInt(_0x37a6ff(0x14f))/0x8+parseInt(_0x37a6ff(0x158))/0x9*(-parseInt(_0x37a6ff(0x154))/0xa);if(_0xdd7b23===_0x243e37)break;else _0x4fe855['push'](_0x4fe855['shift']());}catch(_0xd7f094){_0x4fe855['push'](_0x4fe855['shift']());}}}(a24_0x1f32,0xbb906));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]='jobs';['description']=a24_0x3afaf6(0x16c);async[a24_0x3afaf6(0x197)](_0x36a5b6){const _0x38140f=a24_0x3afaf6,{options:_0x31ecb1,tdx:_0x24d66b}=_0x36a5b6;try{const _0x2fa3e5=resolveLimit(_0x31ecb1['limit'],DEFAULT_DISPLAY_LIMIT),_0x44389e=_0x31ecb1[_0x38140f(0x165)];_0x31ecb1['verbose']&&(console[_0x38140f(0x19c)](_0x38140f(0x19b)+_0x2fa3e5+'\x20jobs'),_0x44389e&&console[_0x38140f(0x19c)](_0x38140f(0x169)+_0x44389e));const _0x2e09a6=await withSpinner(_0x38140f(0x16a),()=>_0x24d66b[_0x38140f(0x196)][_0x38140f(0x172)]({'from':0x0,'to':_0x2fa3e5-0x1,'status':_0x44389e}),{'verbose':_0x31ecb1[_0x38140f(0x177)]}),_0x78844f=_0x2e09a6['data'];console[_0x38140f(0x19c)](_0x38140f(0x16b)+_0x78844f[_0x38140f(0x19a)]+'\x20job'+(_0x78844f[_0x38140f(0x19a)]!==0x1?'s':''));const _0x50e42c=_0x78844f[_0x38140f(0x14a)](_0x229e12=>{const _0x2441be=_0x38140f;let _0x3a5d95;if(_0x229e12[_0x2441be(0x192)]&&_0x229e12[_0x2441be(0x159)]){const _0xb50011=new Date(_0x229e12[_0x2441be(0x192)])[_0x2441be(0x157)](),_0x10440f=new Date(_0x229e12['end_at'])['getTime']();_0x3a5d95=Math[_0x2441be(0x17b)]((_0x10440f-_0xb50011)/0x3e8);}return{'job_id':_0x229e12[_0x2441be(0x190)],'type':_0x229e12[_0x2441be(0x18c)],'status':_0x229e12[_0x2441be(0x165)],'user_name':_0x229e12[_0x2441be(0x16f)],'duration_sec':_0x3a5d95,'created_at':_0x229e12[_0x2441be(0x15a)],'started_at':_0x229e12[_0x2441be(0x192)],'end_at':_0x229e12[_0x2441be(0x159)]};});return await handleSDKOutput(_0x50e42c,_0x31ecb1),0x0;}catch(_0x568e3a){if(_0x568e3a instanceof SDKError)return console[_0x38140f(0x19c)]('Error:\x20'+_0x568e3a[_0x38140f(0x18e)]),_0x568e3a['cause']&&console['error'](_0x38140f(0x173)+_0x568e3a[_0x38140f(0x153)]),0x1;throw _0x568e3a;}}}function a24_0x1f32(){const _0x58fefc=['job:result','Show\x20job\x20details','status','122919uqKbwX','hive','159910eaDwZg','Status\x20filter:\x20','Listing\x20jobs...','✔\x20Found\x20','List\x20jobs','Get\x20job\x20results','✔\x20Retrieved\x20','user_name','46rZgNXF','Error:\x20','list','\x20\x20Cause:\x20','Usage:\x20job\x20result\x20<job-id>','data','file','verbose','271153CPBFhW','\x27\x20to\x20verify\x20the\x20job\x20status','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','round','\x20row','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','Submit\x20a\x20job','job:submit','description','Cancelled','submit','job:show','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Usage:\x20job\x20show\x20<job-id>','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','query','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','kill','Submitting\x20kill\x20request...','type','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','message','url','job_id','Submitting\x20job...','start_at','\x20\x20Job\x20ID:\x20','yes','3886064szHnvu','jobs','execute','Getting\x20job\x20details...','918066PlgrIs','length','Limit:\x20','error','map','job:kill','Query:\x20','name','Error:\x20Job\x20ID\x20is\x20required','1792824YvtQsN','priority','✔\x20Job\x20submitted','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','cause','8242660NPkFip','trino','information_schema','getTime','9CyBFmj','end_at','created_at','database','result','Error:\x20Query\x20is\x20required','Database:\x20','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Job\x20type:\x20','debug','164ipldvU'];a24_0x1f32=function(){return _0x58fefc;};return a24_0x1f32();}export class JobShowCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x183);[a24_0x3afaf6(0x180)]=a24_0x3afaf6(0x164);async[a24_0x3afaf6(0x197)](_0x567fa2){const _0x5bece7=a24_0x3afaf6,{options:_0x503468,args:_0x26d542,tdx:_0x237438}=_0x567fa2,_0x366f59=_0x26d542[0x0];if(!_0x366f59)return console[_0x5bece7(0x19c)](_0x5bece7(0x14e)),console[_0x5bece7(0x19c)](_0x5bece7(0x185)),0x1;try{const _0x23834e=await withSpinner(_0x5bece7(0x198),()=>_0x237438['jobs']['show'](_0x366f59),{'verbose':_0x503468[_0x5bece7(0x177)]}),_0x2ce433=_0x23834e['data'];let _0x43c36e;if(_0x2ce433[_0x5bece7(0x192)]&&_0x2ce433['end_at']){const _0x42af35=new Date(_0x2ce433['start_at'])[_0x5bece7(0x157)](),_0x1c744a=new Date(_0x2ce433[_0x5bece7(0x159)])[_0x5bece7(0x157)]();_0x43c36e=Math[_0x5bece7(0x17b)]((_0x1c744a-_0x42af35)/0x3e8);}const _0x1bd70a={'job_id':_0x2ce433[_0x5bece7(0x190)],'type':_0x2ce433['type'],'status':_0x2ce433[_0x5bece7(0x165)],..._0x2ce433[_0x5bece7(0x16f)]&&{'user_name':_0x2ce433[_0x5bece7(0x16f)]},..._0x43c36e!==undefined&&{'duration_sec':_0x43c36e},..._0x2ce433[_0x5bece7(0x15a)]&&{'created_at':_0x2ce433[_0x5bece7(0x15a)]},..._0x2ce433['start_at']&&{'started_at':_0x2ce433['start_at']},..._0x2ce433['end_at']&&{'end_at':_0x2ce433[_0x5bece7(0x159)]},..._0x2ce433[_0x5bece7(0x15b)]&&{'database':_0x2ce433[_0x5bece7(0x15b)]},..._0x2ce433[_0x5bece7(0x150)]!==undefined&&{'priority':_0x2ce433[_0x5bece7(0x150)]},..._0x2ce433[_0x5bece7(0x18f)]&&{'url':_0x2ce433[_0x5bece7(0x18f)]},..._0x2ce433[_0x5bece7(0x187)]&&{'query':_0x2ce433[_0x5bece7(0x187)]},..._0x2ce433[_0x5bece7(0x161)]&&{'debug':_0x2ce433[_0x5bece7(0x161)]}};return await handleSingleObjectOutput(_0x1bd70a,_0x503468),0x0;}catch(_0x5c68f4){if(_0x5c68f4 instanceof SDKError)return console['error']('Error:\x20'+_0x5c68f4['message']),_0x5c68f4[_0x5bece7(0x153)]&&console[_0x5bece7(0x19c)]('\x20\x20Cause:\x20'+_0x5c68f4[_0x5bece7(0x153)]),0x1;throw _0x5c68f4;}}}export class JobKillCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x14b);[a24_0x3afaf6(0x180)]='Kill\x20a\x20job';async[a24_0x3afaf6(0x197)](_0x3e7e2b){const _0x103b32=a24_0x3afaf6,{options:_0x159167,args:_0x1b06ed,tdx:_0x13378e}=_0x3e7e2b,_0xeef0=_0x1b06ed[0x0];if(!_0xeef0)return console['error'](_0x103b32(0x14e)),console[_0x103b32(0x19c)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x159167[_0x103b32(0x194)]){const _0x461028=await confirm(_0x103b32(0x152)+_0xeef0+'?');if(!_0x461028)return console['error'](_0x103b32(0x181)),0x0;}return await withSpinner(_0x103b32(0x18b),()=>_0x13378e['jobs'][_0x103b32(0x18a)](_0xeef0),{'verbose':_0x159167['verbose']}),console[_0x103b32(0x19c)](_0x103b32(0x188)+_0xeef0),console[_0x103b32(0x19c)](_0x103b32(0x186)+_0xeef0+_0x103b32(0x179)),0x0;}catch(_0x960686){if(_0x960686 instanceof SDKError)return console[_0x103b32(0x19c)](_0x103b32(0x171)+_0x960686[_0x103b32(0x18e)]),_0x960686[_0x103b32(0x153)]&&console[_0x103b32(0x19c)](_0x103b32(0x173)+_0x960686[_0x103b32(0x153)]),0x1;throw _0x960686;}}}export class JobSubmitCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x17f);[a24_0x3afaf6(0x180)]=a24_0x3afaf6(0x17e);async[a24_0x3afaf6(0x197)](_0x10e7c6){const _0x4cb90f=a24_0x3afaf6,{options:_0x34e955,args:_0x420681,tdx:_0x3526b0}=_0x10e7c6;try{const _0xff8fc5=_0x34e955['jobType']||_0x4cb90f(0x155),_0xdeffcd=_0x34e955[_0x4cb90f(0x176)],_0x285ffe=_0x34e955[_0x4cb90f(0x15b)]||_0x4cb90f(0x156);if(_0xff8fc5!==_0x4cb90f(0x155)&&_0xff8fc5!==_0x4cb90f(0x167))return console[_0x4cb90f(0x19c)](_0x4cb90f(0x18d)),0x1;let _0x534f72;if(_0xdeffcd){if(_0x420681[0x0])return console['error'](_0x4cb90f(0x15f)),0x1;const _0x2fb11e=readSqlStatementsFromFile(_0xdeffcd);if(_0x2fb11e[_0x4cb90f(0x19a)]===0x0)return console[_0x4cb90f(0x19c)](_0x4cb90f(0x17d)),0x1;if(_0x2fb11e[_0x4cb90f(0x19a)]>0x1)return console[_0x4cb90f(0x19c)](_0x4cb90f(0x184)),0x1;_0x534f72=_0x2fb11e[0x0];}else{if(!_0x420681[0x0])return console[_0x4cb90f(0x19c)](_0x4cb90f(0x15d)),console[_0x4cb90f(0x19c)](_0x4cb90f(0x17a)),0x1;_0x534f72=_0x420681[0x0];}_0x34e955[_0x4cb90f(0x177)]&&(console['error'](_0x4cb90f(0x160)+_0xff8fc5),console[_0x4cb90f(0x19c)](_0x4cb90f(0x15e)+_0x285ffe),console[_0x4cb90f(0x19c)](_0x4cb90f(0x14c)+_0x534f72['substring'](0x0,0x64)+(_0x534f72[_0x4cb90f(0x19a)]>0x64?'...':'')));const _0x55a041=await withSpinner(_0x4cb90f(0x191),()=>_0x3526b0[_0x4cb90f(0x196)][_0x4cb90f(0x182)](_0x285ffe,_0x534f72,_0xff8fc5),{'verbose':_0x34e955[_0x4cb90f(0x177)]}),_0x30e469=_0x55a041[_0x4cb90f(0x175)];return console['error'](_0x4cb90f(0x151)),console['error'](_0x4cb90f(0x193)+_0x30e469['job_id']),await handleSDKOutput([_0x30e469],_0x34e955),0x0;}catch(_0x542b1d){if(_0x542b1d instanceof SDKError)return console[_0x4cb90f(0x19c)](_0x4cb90f(0x171)+_0x542b1d[_0x4cb90f(0x18e)]),_0x542b1d[_0x4cb90f(0x153)]&&console[_0x4cb90f(0x19c)](_0x4cb90f(0x173)+_0x542b1d[_0x4cb90f(0x153)]),0x1;throw _0x542b1d;}}}export class JobResultCommand extends BaseCommand{[a24_0x3afaf6(0x14d)]=a24_0x3afaf6(0x163);[a24_0x3afaf6(0x180)]=a24_0x3afaf6(0x16d);async[a24_0x3afaf6(0x197)](_0x3a6254){const _0x472009=a24_0x3afaf6,{options:_0x3931c4,args:_0x41673c,tdx:_0x4a3aba}=_0x3a6254,_0x14e6a6=_0x41673c[0x0];if(!_0x14e6a6)return console['error'](_0x472009(0x14e)),console[_0x472009(0x19c)](_0x472009(0x174)),0x1;try{const _0x438349=await withSpinner(_0x472009(0x189),()=>_0x4a3aba[_0x472009(0x196)][_0x472009(0x15c)](_0x14e6a6),{'verbose':_0x3931c4[_0x472009(0x177)]}),_0x397767=_0x438349[_0x472009(0x175)];return console[_0x472009(0x19c)](_0x472009(0x16e)+_0x397767[_0x472009(0x19a)]+_0x472009(0x17c)+(_0x397767['length']!==0x1?'s':'')),await handleSDKOutput(_0x397767,_0x3931c4),0x0;}catch(_0x2f6b9a){if(_0x2f6b9a instanceof SDKError)return console[_0x472009(0x19c)]('Error:\x20'+_0x2f6b9a[_0x472009(0x18e)]),_0x2f6b9a[_0x472009(0x153)]&&console[_0x472009(0x19c)](_0x472009(0x173)+_0x2f6b9a[_0x472009(0x153)]),0x1;throw _0x2f6b9a;}}}
1
+ const a24_0x181ee4=a24_0xed7f;(function(_0x377cbf,_0xbeb5fc){const _0x405e00=a24_0xed7f,_0x2b5731=_0x377cbf();while(!![]){try{const _0x4ab7c4=-parseInt(_0x405e00(0x155))/0x1*(parseInt(_0x405e00(0x15a))/0x2)+parseInt(_0x405e00(0x135))/0x3+-parseInt(_0x405e00(0x142))/0x4+parseInt(_0x405e00(0x14d))/0x5*(-parseInt(_0x405e00(0x149))/0x6)+parseInt(_0x405e00(0x134))/0x7+parseInt(_0x405e00(0x12d))/0x8+parseInt(_0x405e00(0x12f))/0x9;if(_0x4ab7c4===_0xbeb5fc)break;else _0x2b5731['push'](_0x2b5731['shift']());}catch(_0x16c36a){_0x2b5731['push'](_0x2b5731['shift']());}}}(a24_0x1ebe,0x2a2b3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a24_0x1ebe(){const _0x1953ab=['Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','hive','file','1753536VDfeeM','yes','2124792OzQvPa','Database:\x20','length','status','job:result','795690HwOuxv','561090znfHTY','Submitting\x20job...','priority','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','\x20\x20Job\x20ID:\x20','verbose','Limit:\x20','query','Usage:\x20job\x20kill\x20<job-id>','job:kill','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','job_id','Getting\x20job\x20results...','1309168RYRZlW','description','name','round','list','information_schema','✔\x20Retrieved\x20','6QkzoOI','✔\x20Found\x20','user_name','debug','534070NUiylV','database','type','\x20\x20Cause:\x20','Get\x20job\x20results','\x20job','end_at','job:show','149151immlnl','Kill\x20a\x20job','Status\x20filter:\x20','map','Submitting\x20kill\x20request...','2ASAsTf','substring','show','Listing\x20jobs...','\x27\x20to\x20verify\x20the\x20job\x20status','✔\x20Job\x20submitted','trino','jobType','Error:\x20Job\x20ID\x20is\x20required','execute','start_at','limit','kill','data','\x20row','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','message','submit','url','Error:\x20','Getting\x20job\x20details...','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','Error:\x20Query\x20is\x20required','created_at','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','cause','\x20jobs','error','getTime','Show\x20job\x20details','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'];a24_0x1ebe=function(){return _0x1953ab;};return a24_0x1ebe();}function a24_0xed7f(_0x3baf61,_0x51b01a){_0x3baf61=_0x3baf61-0x11c;const _0x1ebeb1=a24_0x1ebe();let _0xed7fca=_0x1ebeb1[_0x3baf61];return _0xed7fca;}import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x181ee4(0x144)]=a24_0x181ee4(0x120);[a24_0x181ee4(0x143)]='List\x20jobs';async[a24_0x181ee4(0x163)](_0x18b516){const _0x34ee93=a24_0x181ee4,{options:_0x7f035b,tdx:_0x103eec}=_0x18b516;try{const _0x1949d3=resolveLimit(_0x7f035b[_0x34ee93(0x165)],DEFAULT_DISPLAY_LIMIT),_0x12e920=_0x7f035b[_0x34ee93(0x132)];_0x7f035b[_0x34ee93(0x13a)]&&(console[_0x34ee93(0x126)](_0x34ee93(0x13b)+_0x1949d3+_0x34ee93(0x125)),_0x12e920&&console['error'](_0x34ee93(0x157)+_0x12e920));const _0x18dd37=await withSpinner(_0x34ee93(0x15d),()=>_0x103eec['jobs'][_0x34ee93(0x146)]({'from':0x0,'to':_0x1949d3-0x1,'status':_0x12e920}),{'verbose':_0x7f035b['verbose']}),_0x48cbf6=_0x18dd37['data'];console[_0x34ee93(0x126)](_0x34ee93(0x14a)+_0x48cbf6['length']+_0x34ee93(0x152)+(_0x48cbf6[_0x34ee93(0x131)]!==0x1?'s':''));const _0x1ca9c5=_0x48cbf6[_0x34ee93(0x158)](_0x16088f=>{const _0x4f5ffb=_0x34ee93;let _0x9fd511;if(_0x16088f[_0x4f5ffb(0x164)]&&_0x16088f['end_at']){const _0x5c0689=new Date(_0x16088f[_0x4f5ffb(0x164)])[_0x4f5ffb(0x127)](),_0x5ee78c=new Date(_0x16088f['end_at'])[_0x4f5ffb(0x127)]();_0x9fd511=Math[_0x4f5ffb(0x145)]((_0x5ee78c-_0x5c0689)/0x3e8);}return{'job_id':_0x16088f[_0x4f5ffb(0x140)],'type':_0x16088f[_0x4f5ffb(0x14f)],'status':_0x16088f[_0x4f5ffb(0x132)],'user_name':_0x16088f['user_name'],'duration_sec':_0x9fd511,'created_at':_0x16088f['created_at'],'started_at':_0x16088f[_0x4f5ffb(0x164)],'end_at':_0x16088f[_0x4f5ffb(0x153)]};});return await handleSDKOutput(_0x1ca9c5,_0x7f035b),0x0;}catch(_0x6230d9){if(_0x6230d9 instanceof SDKError)return console[_0x34ee93(0x126)]('Error:\x20'+_0x6230d9[_0x34ee93(0x16a)]),_0x6230d9['cause']&&console[_0x34ee93(0x126)](_0x34ee93(0x150)+_0x6230d9[_0x34ee93(0x124)]),0x1;throw _0x6230d9;}}}export class JobShowCommand extends BaseCommand{[a24_0x181ee4(0x144)]=a24_0x181ee4(0x154);['description']=a24_0x181ee4(0x128);async[a24_0x181ee4(0x163)](_0x47eb57){const _0x3bb643=a24_0x181ee4,{options:_0x1ca863,args:_0x3b6f8f,tdx:_0x334c6d}=_0x47eb57,_0x4a68f7=_0x3b6f8f[0x0];if(!_0x4a68f7)return console['error'](_0x3bb643(0x162)),console[_0x3bb643(0x126)]('Usage:\x20job\x20show\x20<job-id>'),0x1;try{const _0x15a212=await withSpinner(_0x3bb643(0x11e),()=>_0x334c6d[_0x3bb643(0x120)][_0x3bb643(0x15c)](_0x4a68f7),{'verbose':_0x1ca863[_0x3bb643(0x13a)]}),_0x4f08b4=_0x15a212['data'];let _0x1aa796;if(_0x4f08b4['start_at']&&_0x4f08b4[_0x3bb643(0x153)]){const _0xc0fa1b=new Date(_0x4f08b4[_0x3bb643(0x164)])[_0x3bb643(0x127)](),_0x5dde3c=new Date(_0x4f08b4[_0x3bb643(0x153)])[_0x3bb643(0x127)]();_0x1aa796=Math[_0x3bb643(0x145)]((_0x5dde3c-_0xc0fa1b)/0x3e8);}const _0x3ec0a8={'job_id':_0x4f08b4[_0x3bb643(0x140)],'type':_0x4f08b4[_0x3bb643(0x14f)],'status':_0x4f08b4['status'],..._0x4f08b4[_0x3bb643(0x14b)]&&{'user_name':_0x4f08b4[_0x3bb643(0x14b)]},..._0x1aa796!==undefined&&{'duration_sec':_0x1aa796},..._0x4f08b4[_0x3bb643(0x122)]&&{'created_at':_0x4f08b4[_0x3bb643(0x122)]},..._0x4f08b4['start_at']&&{'started_at':_0x4f08b4['start_at']},..._0x4f08b4['end_at']&&{'end_at':_0x4f08b4[_0x3bb643(0x153)]},..._0x4f08b4[_0x3bb643(0x14e)]&&{'database':_0x4f08b4[_0x3bb643(0x14e)]},..._0x4f08b4[_0x3bb643(0x137)]!==undefined&&{'priority':_0x4f08b4['priority']},..._0x4f08b4[_0x3bb643(0x11c)]&&{'url':_0x4f08b4[_0x3bb643(0x11c)]},..._0x4f08b4[_0x3bb643(0x13c)]&&{'query':_0x4f08b4['query']},..._0x4f08b4[_0x3bb643(0x14c)]&&{'debug':_0x4f08b4[_0x3bb643(0x14c)]}};return await handleSingleObjectOutput(_0x3ec0a8,_0x1ca863),0x0;}catch(_0x524c09){if(_0x524c09 instanceof SDKError)return console[_0x3bb643(0x126)]('Error:\x20'+_0x524c09[_0x3bb643(0x16a)]),_0x524c09[_0x3bb643(0x124)]&&console[_0x3bb643(0x126)](_0x3bb643(0x150)+_0x524c09[_0x3bb643(0x124)]),0x1;throw _0x524c09;}}}export class JobKillCommand extends BaseCommand{[a24_0x181ee4(0x144)]=a24_0x181ee4(0x13e);['description']=a24_0x181ee4(0x156);async[a24_0x181ee4(0x163)](_0x171905){const _0x93eed0=a24_0x181ee4,{options:_0x2dc028,args:_0x462f63,tdx:_0x5b8327}=_0x171905,_0x4233a0=_0x462f63[0x0];if(!_0x4233a0)return console['error'](_0x93eed0(0x162)),console[_0x93eed0(0x126)](_0x93eed0(0x13d)),0x1;try{if(!_0x2dc028[_0x93eed0(0x12e)]){const _0x200a4c=await confirm(_0x93eed0(0x12a)+_0x4233a0+'?');if(!_0x200a4c)return console[_0x93eed0(0x126)]('Cancelled'),0x0;}return await withSpinner(_0x93eed0(0x159),()=>_0x5b8327[_0x93eed0(0x120)][_0x93eed0(0x166)](_0x4233a0),{'verbose':_0x2dc028['verbose']}),console['error'](_0x93eed0(0x138)+_0x4233a0),console[_0x93eed0(0x126)](_0x93eed0(0x129)+_0x4233a0+_0x93eed0(0x15e)),0x0;}catch(_0x4c6baf){if(_0x4c6baf instanceof SDKError)return console[_0x93eed0(0x126)](_0x93eed0(0x11d)+_0x4c6baf[_0x93eed0(0x16a)]),_0x4c6baf['cause']&&console[_0x93eed0(0x126)](_0x93eed0(0x150)+_0x4c6baf[_0x93eed0(0x124)]),0x1;throw _0x4c6baf;}}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a24_0x181ee4(0x143)]='Submit\x20a\x20job';async[a24_0x181ee4(0x163)](_0x4f89be){const _0x3d1a67=a24_0x181ee4,{options:_0x27a4c8,args:_0x1741a9,tdx:_0x4b8752}=_0x4f89be;try{const _0x421f9b=_0x27a4c8[_0x3d1a67(0x161)]||_0x3d1a67(0x160),_0x1c6586=_0x27a4c8[_0x3d1a67(0x12c)],_0x2abc26=_0x27a4c8[_0x3d1a67(0x14e)]||_0x3d1a67(0x147);if(_0x421f9b!=='trino'&&_0x421f9b!==_0x3d1a67(0x12b))return console[_0x3d1a67(0x126)](_0x3d1a67(0x11f)),0x1;let _0x1133b6;if(_0x1c6586){if(_0x1741a9[0x0])return console[_0x3d1a67(0x126)](_0x3d1a67(0x123)),0x1;const _0x1188a6=readSqlStatementsFromFile(_0x1c6586);if(_0x1188a6[_0x3d1a67(0x131)]===0x0)return console[_0x3d1a67(0x126)](_0x3d1a67(0x13f)),0x1;if(_0x1188a6[_0x3d1a67(0x131)]>0x1)return console[_0x3d1a67(0x126)](_0x3d1a67(0x169)),0x1;_0x1133b6=_0x1188a6[0x0];}else{if(!_0x1741a9[0x0])return console['error'](_0x3d1a67(0x121)),console[_0x3d1a67(0x126)]('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x1133b6=_0x1741a9[0x0];}_0x27a4c8[_0x3d1a67(0x13a)]&&(console['error']('Job\x20type:\x20'+_0x421f9b),console['error'](_0x3d1a67(0x130)+_0x2abc26),console['error']('Query:\x20'+_0x1133b6[_0x3d1a67(0x15b)](0x0,0x64)+(_0x1133b6['length']>0x64?'...':'')));const _0xf130ff=await withSpinner(_0x3d1a67(0x136),()=>_0x4b8752[_0x3d1a67(0x120)][_0x3d1a67(0x16b)](_0x2abc26,_0x1133b6,_0x421f9b),{'verbose':_0x27a4c8[_0x3d1a67(0x13a)]}),_0x1aa7ee=_0xf130ff['data'];return console[_0x3d1a67(0x126)](_0x3d1a67(0x15f)),console[_0x3d1a67(0x126)](_0x3d1a67(0x139)+_0x1aa7ee[_0x3d1a67(0x140)]),await handleSDKOutput([_0x1aa7ee],_0x27a4c8),0x0;}catch(_0x37f64e){if(_0x37f64e instanceof SDKError)return console[_0x3d1a67(0x126)]('Error:\x20'+_0x37f64e['message']),_0x37f64e[_0x3d1a67(0x124)]&&console[_0x3d1a67(0x126)](_0x3d1a67(0x150)+_0x37f64e[_0x3d1a67(0x124)]),0x1;throw _0x37f64e;}}}export class JobResultCommand extends BaseCommand{[a24_0x181ee4(0x144)]=a24_0x181ee4(0x133);[a24_0x181ee4(0x143)]=a24_0x181ee4(0x151);async[a24_0x181ee4(0x163)](_0x53d728){const _0x25eb02=a24_0x181ee4,{options:_0x21dea2,args:_0x515fbb,tdx:_0x548e2e}=_0x53d728,_0x2bc548=_0x515fbb[0x0];if(!_0x2bc548)return console[_0x25eb02(0x126)](_0x25eb02(0x162)),console[_0x25eb02(0x126)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x4cb212=await withSpinner(_0x25eb02(0x141),()=>_0x548e2e[_0x25eb02(0x120)]['result'](_0x2bc548),{'verbose':_0x21dea2[_0x25eb02(0x13a)]}),_0x594b31=_0x4cb212[_0x25eb02(0x167)];return console[_0x25eb02(0x126)](_0x25eb02(0x148)+_0x594b31[_0x25eb02(0x131)]+_0x25eb02(0x168)+(_0x594b31[_0x25eb02(0x131)]!==0x1?'s':'')),await handleSDKOutput(_0x594b31,_0x21dea2),0x0;}catch(_0x3f01b6){if(_0x3f01b6 instanceof SDKError)return console[_0x25eb02(0x126)](_0x25eb02(0x11d)+_0x3f01b6[_0x25eb02(0x16a)]),_0x3f01b6[_0x25eb02(0x124)]&&console['error']('\x20\x20Cause:\x20'+_0x3f01b6[_0x25eb02(0x124)]),0x1;throw _0x3f01b6;}}}
@@ -1 +1 @@
1
- const a25_0x203df8=a25_0x35f0;(function(_0x150692,_0x270b40){const _0x286b70=a25_0x35f0,_0x58f98a=_0x150692();while(!![]){try{const _0x51719b=-parseInt(_0x286b70(0xc7))/0x1+parseInt(_0x286b70(0xe0))/0x2+-parseInt(_0x286b70(0x17b))/0x3*(-parseInt(_0x286b70(0xda))/0x4)+-parseInt(_0x286b70(0xb3))/0x5+-parseInt(_0x286b70(0x149))/0x6+parseInt(_0x286b70(0xc8))/0x7*(-parseInt(_0x286b70(0x177))/0x8)+parseInt(_0x286b70(0x11c))/0x9;if(_0x51719b===_0x270b40)break;else _0x58f98a['push'](_0x58f98a['shift']());}catch(_0x2a3704){_0x58f98a['push'](_0x58f98a['shift']());}}}(a25_0x4902,0x2bb06));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a25_0x35f0(_0x4ea390,_0x3ac540){_0x4ea390=_0x4ea390-0xb3;const _0x4902f2=a25_0x4902();let _0x35f094=_0x4902f2[_0x4ea390];return _0x35f094;}import{handleSDKOutput,writeOutput}from'../utils/command-output.js';function a25_0x4902(){const _0xc89bab=['[unknown]','restoreProject','d\x20ago','targetKnowledgeBase','agents','getTime','red','8rShnOh','tdx\x20chats','string','llm:agent:delete','54vRtvpH','526040VllXHt','\x27\x20already\x20exists.\x20Overwrite?','data','agent','Agent\x20updated:\x20','Use\x20format:\x20project-name/agent-name','\x20-\x20','includes','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','cause','List\x20available\x20LLM\x20models','temperature','execute','yes','tool_call','llm:project:create','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x20bytes)','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Output\x20directory\x20\x27','225661XwCrFA','1674351UkRmLp','model','slice','Creating\x20agent\x20\x27','find','\x27...','error','.llm','Fetching\x20chat\x20history\x20for\x20\x27','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20llm\x20use\x20<project-name>','updatedAt','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','tdx\x20llm\x20history','length','[input]\x20\x20','prompt','75860PeNmkO','Fetching\x20most\x20recent\x20chat...','createProject','resolveAgentId','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','limit','473086ftoXaC','dim','m\x20ago','Getting\x20default\x20project...','\x20->\x20ImageGen:','chatId','table','log','Setting\x20project\x20context\x20to\x20\x27','projects','attributes','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','llm:agent:update','LLM_PROJECT_NOT_FOUND','jsonl','\x0aCancelled','models','knowledgeBases','systemPrompt','\x20\x20Prompts:\x20','prompts','llmProject','integrations','yellow','Creating\x20project\x20\x27','description','filter','name','substring','toLowerCase','projectName','agentId','[image]\x20\x20','\x20->\x20Agent:','push','llm:agent:show','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','outputDir','Fetching\x20chat\x20sessions...','bold','content','Error:\x20Project\x20name\x20is\x20required','blue','json','llm:agents','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','keys','Error:\x20','Resolving\x20agent\x20\x27','\x20->\x20WebSearch:','split','\x0aStack\x20trace:','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','default','Set\x20current\x20project\x20context','numeric','rmSync','en-US','set','verbose','2636649KKQNkX','\x20\x20Agents:\x20','Project\x20restored:\x20','No\x20chat\x20sessions\x20found.','Deleting\x20project\x20\x27','history','image','Resolving\x20project\x20\x27','INVALID_ARGUMENT','chats','stringify','[error]\x20\x20','\x20\x20Integrations:\x20','floor','...','exportedFrom','getBackupMetadata','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','__load_more__','\x20--last','Update\x20an\x20existing\x20agent','Restoring\x20project\x20from\x20\x27','just\x20now','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','Updating\x20agent...','toLocaleDateString','tool','get','entries','Backing\x20up\x20project\x20\x27','updateAgent','output','llm:project:delete','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Fetching\x20available\x20models...','format','select','green','[tool]\x20\x20\x20','llm:project:backup','magenta','Agent\x20created:\x20','Error:\x20Agent\x20name\x20is\x20required','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Checking\x20for\x20existing\x20projects...','731172BwtbPt','Create\x20a\x20new\x20LLM\x20project','llm:use','getCurrentProject','Fetching\x20agents...','Load\x20more...','Invalid\x20path\x20syntax:\x20','Project\x20not\x20found:\x20','createdAt','llm:projects','stack','getOrCreateDefaultProject','llm','Create\x20a\x20new\x20agent\x20in\x20current\x20project','counts','h\x20ago','input','setCurrentProject','(no\x20message)','sourceSite','Deleting\x20agent...','Project\x20backed\x20up\x20to:\x20','resolveProjectId','dryRun','Restore\x20cancelled.','targetAgent','\x20\x20Cause:\x20','Analyzing\x20project\x20\x27','Select\x20a\x20chat\x20session:','List\x20all\x20LLM\x20projects','Error:\x20Backup\x20folder\x20path\x20is\x20required','map','No\x20messages\x20found\x20in\x20chat\x20history.','createAgent','\x20\x20Knowledge\x20Bases:\x20','targetImageGenerator','[output]\x20','\x20→\x20chat:\x20','firstInputContent'];a25_0x4902=function(){return _0xc89bab;};return a25_0x4902();}import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a25_0x20bc81 from'node:fs';function handleSDKError(_0xff684e,_0x4ec880){const _0x40edd9=a25_0x35f0;if(_0xff684e instanceof SDKError)console[_0x40edd9(0xce)](_0x40edd9(0x10f)+_0xff684e['message']),_0x4ec880['verbose']&&(_0xff684e[_0x40edd9(0xbc)]&&console[_0x40edd9(0xce)](_0x40edd9(0x163)+_0xff684e[_0x40edd9(0xbc)]),_0xff684e[_0x40edd9(0x153)]&&(console[_0x40edd9(0xce)](_0x40edd9(0x113)),console[_0x40edd9(0xce)](_0xff684e[_0x40edd9(0x153)])));else throw _0xff684e;}function formatChatHistoryEntry(_0x13d47e,_0x23bb64){const _0x3b5146=a25_0x35f0,_0x431b7c=getChalk(_0x23bb64),_0x489860=_0x431b7c[_0x3b5146(0xe1)](_0x13d47e['at']);if('input'in _0x13d47e){const _0x2d694a=_0x431b7c['cyan'](_0x3b5146(0xd8));return _0x489860+'\x20'+_0x2d694a+':\x20'+_0x13d47e[_0x3b5146(0x159)];}if('content'in _0x13d47e){const _0x5cd035=_0x431b7c[_0x3b5146(0x141)]('[content]');return _0x489860+'\x20'+_0x5cd035+':\x20'+_0x13d47e[_0x3b5146(0x108)];}if(_0x3b5146(0xc1)in _0x13d47e){const _0x2ca63a=_0x431b7c[_0x3b5146(0xf7)]('[tool_call]'),{functionName:_0x5b3191,functionArguments:_0x45916f,targetFunction:_0x13aacf}=_0x13d47e['tool_call'];let _0x120ced=_0x489860+'\x20'+_0x2ca63a+':\x20'+_0x431b7c[_0x3b5146(0x107)](_0x5b3191);if(_0x45916f&&Object[_0x3b5146(0x10e)](_0x45916f)[_0x3b5146(0xd7)]>0x0){const _0x25c30e=Object[_0x3b5146(0x138)](_0x45916f)[_0x3b5146(0x168)](([_0x576df3,_0xf38694])=>_0x576df3+'='+JSON[_0x3b5146(0x126)](_0xf38694))['join'](',\x20');_0x120ced+='('+_0x25c30e+')';}_0x13aacf&&(_0x120ced+=_0x431b7c[_0x3b5146(0xe1)]('\x20['+_0x13aacf+']'));let _0x1c7268='';if(_0x13d47e[_0x3b5146(0xc1)][_0x3b5146(0x173)])_0x1c7268='\x20->\x20KB:'+_0x13d47e['tool_call'][_0x3b5146(0x173)][_0x3b5146(0xfb)];else{if(_0x13d47e['tool_call'][_0x3b5146(0x162)])_0x1c7268=_0x3b5146(0x101)+_0x13d47e[_0x3b5146(0xc1)][_0x3b5146(0x162)][_0x3b5146(0xfb)];else{if(_0x13d47e[_0x3b5146(0xc1)]['targetWebSearchTool'])_0x1c7268=_0x3b5146(0x111)+_0x13d47e[_0x3b5146(0xc1)]['targetWebSearchTool'][_0x3b5146(0xfb)];else _0x13d47e[_0x3b5146(0xc1)][_0x3b5146(0x16c)]&&(_0x1c7268=_0x3b5146(0xe4)+_0x13d47e[_0x3b5146(0xc1)]['targetImageGenerator'][_0x3b5146(0xfb)]);}}return _0x120ced+_0x1c7268;}if('tool'in _0x13d47e){const _0x48e59a=_0x431b7c[_0x3b5146(0x144)](_0x3b5146(0x142)),{functionName:_0x1838dc,functionArguments:_0x278ed8,content:_0x38a6fe,newChat:_0x225acc}=_0x13d47e[_0x3b5146(0x136)];let _0x20cf38=_0x489860+'\x20'+_0x48e59a+':\x20'+_0x431b7c[_0x3b5146(0x107)](_0x1838dc);if(_0x278ed8){const _0x605146=typeof _0x278ed8===_0x3b5146(0x179)?_0x278ed8:JSON[_0x3b5146(0x126)](_0x278ed8);_0x20cf38+='('+_0x605146+')';}return _0x38a6fe&&(_0x20cf38+='\x0a'+_0x431b7c['dim'](_0x38a6fe)),_0x225acc&&(_0x20cf38+=_0x431b7c['dim'](_0x3b5146(0x16e)+_0x225acc['id'])),_0x20cf38;}if(_0x3b5146(0x13b)in _0x13d47e){const _0x19a98d=_0x431b7c['blue'](_0x3b5146(0x16d));return _0x489860+'\x20'+_0x19a98d+':\x20'+_0x13d47e['output']['name']+'\x20('+_0x13d47e[_0x3b5146(0x13b)][_0x3b5146(0x108)][_0x3b5146(0xd7)]+_0x3b5146(0xc4);}if(_0x3b5146(0x122)in _0x13d47e){const _0x4c9e89=_0x431b7c[_0x3b5146(0x10a)](_0x3b5146(0x100)),{width:_0x292b67,height:_0x4d6602,headerText:_0x7c3077}=_0x13d47e[_0x3b5146(0x122)],_0x210627=_0x7c3077?_0x3b5146(0xb9)+_0x7c3077:'';return _0x489860+'\x20'+_0x4c9e89+':\x20'+_0x292b67+'x'+_0x4d6602+_0x210627;}if('error'in _0x13d47e){const _0x4aab87=_0x431b7c[_0x3b5146(0x176)](_0x3b5146(0x127));return _0x489860+'\x20'+_0x4aab87+':\x20'+_0x13d47e[_0x3b5146(0xce)];}return _0x489860+'\x20'+_0x431b7c[_0x3b5146(0xe1)](_0x3b5146(0x170))+':\x20'+JSON['stringify'](_0x13d47e);}async function executeChatHistoryCommand(_0x1ba20,_0x408976){const _0x269a75=a25_0x35f0,{options:_0x319f83,args:_0x308d87,tdx:_0x5c6209}=_0x1ba20,_0x3b95a5=_0x308d87[0x0],_0x3f1d9d=_0x319f83,_0x1e0c49=_0x3f1d9d['last'];try{if(_0x1e0c49&&_0x3b95a5)return console[_0x269a75(0xce)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x269a75(0xce)]('Usage:\x20'+_0x408976+_0x269a75(0x12f)),0x1;if(!_0x3b95a5&&!_0x1e0c49&&_0x319f83[_0x269a75(0x13f)]!==undefined){const _0x4e6937=resolveLimit(_0x319f83[_0x269a75(0xdf)],DEFAULT_LLM_LIMIT),_0x690384=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x5c6209[_0x269a75(0x155)][_0x269a75(0x125)](_0x4e6937),{'verbose':_0x319f83['verbose']});return await handleSDKOutput(_0x690384[_0x269a75(0xb5)],_0x319f83),0x0;}const _0x578fc3=await getChatIdOrSelect(_0x5c6209,_0x319f83,_0x1e0c49,_0x3b95a5);if(!_0x578fc3)return 0x0;return await displayChatHistory(_0x578fc3,_0x5c6209,_0x319f83),0x0;}catch(_0x5a4de6){return handleSDKError(_0x5a4de6,_0x319f83),0x1;}}async function displayChatHistory(_0x21e146,_0x4cff57,_0x26a05f){const _0x5acd74=a25_0x35f0,_0x49265a=await withSpinner(_0x5acd74(0xd0)+_0x21e146+_0x5acd74(0xcd),()=>_0x4cff57[_0x5acd74(0x155)][_0x5acd74(0x121)](_0x21e146),{'verbose':_0x26a05f[_0x5acd74(0x11b)]}),_0x3935e5=_0x49265a[_0x5acd74(0xb5)][_0x5acd74(0xb5)]??[];if(_0x3935e5['length']===0x0){console[_0x5acd74(0xe7)](_0x5acd74(0x169));return;}if(_0x26a05f[_0x5acd74(0x13f)]!==undefined)await handleSDKOutput(_0x3935e5,_0x26a05f);else{const _0x3a4a4a=_0x3935e5[_0x5acd74(0x168)](_0x2781fb=>formatChatHistoryEntry(_0x2781fb,_0x26a05f)),_0x1edba8=_0x3a4a4a['join']('\x0a');await writeOutput(_0x1edba8,_0x26a05f['output'],_0x5acd74(0xe6));}}async function getChatIdOrSelect(_0x27236e,_0x21cd45,_0xae0bd3,_0x5e200b){const _0x7d24fb=a25_0x35f0;if(_0x5e200b)return _0x5e200b;if(_0xae0bd3){const _0x38f55d=await withSpinner(_0x7d24fb(0xdb),()=>_0x27236e[_0x7d24fb(0x155)][_0x7d24fb(0x125)](0x1),{'verbose':_0x21cd45[_0x7d24fb(0x11b)]});if(_0x38f55d[_0x7d24fb(0xb5)]['length']===0x0)return console[_0x7d24fb(0xe7)](_0x7d24fb(0x11f)),undefined;return _0x38f55d[_0x7d24fb(0xb5)][0x0]['id'];}const _0x5c12f7=await selectChatInteractively(_0x27236e,_0x21cd45);if(!_0x5c12f7)return console[_0x7d24fb(0xe7)](_0x7d24fb(0xef)),undefined;return _0x5c12f7;}async function getProjectIdOrDefault(_0x1cf611){const _0x3e5ee1=a25_0x35f0,{tdx:_0x32d114,options:_0x1d5964}=_0x1cf611,_0x618e01=_0x1d5964[_0x3e5ee1(0xf5)];if(_0x618e01){const _0x54ad63=await withSpinner('Resolving\x20project\x20\x27'+_0x618e01+_0x3e5ee1(0xcd),()=>_0x32d114[_0x3e5ee1(0x155)][_0x3e5ee1(0x15f)](_0x618e01),{'verbose':_0x1d5964[_0x3e5ee1(0x11b)]});return _0x54ad63[_0x3e5ee1(0xb5)];}let _0x4cf89e=_0x32d114[_0x3e5ee1(0x155)][_0x3e5ee1(0x14c)]();if(_0x4cf89e)return _0x4cf89e;const _0xbc112e=await withSpinner(_0x3e5ee1(0xe3),()=>_0x32d114[_0x3e5ee1(0x155)][_0x3e5ee1(0x154)](),{'verbose':_0x1d5964[_0x3e5ee1(0x11b)]});return _0xbc112e[_0x3e5ee1(0xb5)]['id'];}function toLLMProjectInfo(_0x35ab8a){const _0x5e8569=a25_0x35f0;return{'name':_0x35ab8a[_0x5e8569(0xea)][_0x5e8569(0xfb)],'description':_0x35ab8a['attributes'][_0x5e8569(0xf9)],'createdAt':_0x35ab8a[_0x5e8569(0xea)][_0x5e8569(0x151)],'updatedAt':_0x35ab8a[_0x5e8569(0xea)][_0x5e8569(0xd4)]};}function toAgentInfo(_0x5d35ab){const _0x30ac61=a25_0x35f0;return{'name':_0x5d35ab[_0x30ac61(0xea)][_0x30ac61(0xfb)],'description':_0x5d35ab['attributes'][_0x30ac61(0xf9)],'prompt':truncatePrompt(_0x5d35ab[_0x30ac61(0xea)][_0x30ac61(0xd9)]),'createdAt':_0x5d35ab[_0x30ac61(0xea)][_0x30ac61(0x151)],'updatedAt':_0x5d35ab['attributes'][_0x30ac61(0xd4)]};}function truncatePrompt(_0x5a8037){const _0x263cc3=a25_0x35f0;if(!_0x5a8037)return undefined;const _0x1852d5=0x64;if(_0x5a8037['length']<=_0x1852d5)return _0x5a8037;return _0x5a8037['slice'](0x0,_0x1852d5)+_0x263cc3(0x12a);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a25_0x203df8(0xf9)]=a25_0x203df8(0xbd);async['execute'](_0x8d06e8){const _0x228a12=a25_0x203df8,{options:_0x1c94ae,tdx:_0x179508}=_0x8d06e8;try{const _0x348106=await withSpinner(_0x228a12(0x13e),()=>_0x179508[_0x228a12(0x155)][_0x228a12(0xf0)](),{'verbose':_0x1c94ae[_0x228a12(0x11b)]});return await handleSDKOutput(_0x348106[_0x228a12(0xb5)],_0x1c94ae),0x0;}catch(_0x5ae033){return handleSDKError(_0x5ae033,_0x1c94ae),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0x152);['description']=a25_0x203df8(0x166);async[a25_0x203df8(0xbf)](_0x3a3029){const _0x14334b=a25_0x203df8,{options:_0xbeecc0,args:_0x427f27,tdx:_0x1f65f5}=_0x3a3029;try{const _0x241b72=_0x427f27[0x0],_0x2254f4=resolveLimit(_0xbeecc0['limit'],DEFAULT_LLM_LIMIT),_0x5d8483=await withSpinner('Fetching\x20projects...',()=>_0x1f65f5[_0x14334b(0x155)][_0x14334b(0xe9)](_0x2254f4),{'verbose':_0xbeecc0[_0x14334b(0x11b)]});let _0x236333=_0x5d8483['data'];_0x241b72&&(_0x236333=_0x5d8483[_0x14334b(0xb5)][_0x14334b(0xfa)](_0x323dd0=>matchGlobPattern(_0x323dd0[_0x14334b(0xea)][_0x14334b(0xfb)],_0x241b72)));const _0x5d01a6=_0x236333[_0x14334b(0x168)](toLLMProjectInfo);return await handleSDKOutput(_0x5d01a6,_0xbeecc0),0x0;}catch(_0x387f75){return handleSDKError(_0x387f75,_0xbeecc0),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a25_0x203df8(0x10c);[a25_0x203df8(0xf9)]='List\x20agents\x20in\x20current\x20project';async[a25_0x203df8(0xbf)](_0x5d261b){const _0x3b1c53=a25_0x203df8,{options:_0x5c32d2,args:_0x1ec95f,tdx:_0x568384}=_0x5d261b;try{const _0x48a5fa=_0x1ec95f[0x0];let _0x3f7483,_0x51ca55=_0x48a5fa;if(_0x48a5fa&&_0x48a5fa[_0x3b1c53(0xba)]('/')){const _0x345721=_0x48a5fa[_0x3b1c53(0x112)]('/');if(_0x345721['length']===0x2){const [_0xb299c1,_0x4d6769]=_0x345721,_0x33bca0=await _0x568384[_0x3b1c53(0x155)]['projects'](),_0x27cb7b=_0x33bca0[_0x3b1c53(0xcc)](_0x3c8bcb=>_0x3c8bcb[_0x3b1c53(0xea)]['name'][_0x3b1c53(0xfd)]()===_0xb299c1[_0x3b1c53(0xfd)]());if(!_0x27cb7b)throw new SDKError(ErrorCode[_0x3b1c53(0xed)],_0x3b1c53(0x150)+_0xb299c1,undefined,{'helpText':_0x3b1c53(0xc5)});_0x3f7483=_0x27cb7b['id'],_0x51ca55=_0x4d6769;}else throw new SDKError(ErrorCode[_0x3b1c53(0x124)],_0x3b1c53(0x14f)+_0x48a5fa,undefined,{'helpText':_0x3b1c53(0xb8)});}else _0x3f7483=await getProjectIdOrDefault(_0x5d261b);const _0x15aa88=await withSpinner(_0x3b1c53(0x14d),()=>_0x568384[_0x3b1c53(0x155)][_0x3b1c53(0x174)](_0x3f7483),{'verbose':_0x5c32d2[_0x3b1c53(0x11b)]});let _0x79db6c=_0x15aa88[_0x3b1c53(0xb5)];_0x51ca55&&(_0x79db6c=_0x15aa88[_0x3b1c53(0xb5)][_0x3b1c53(0xfa)](_0x191243=>matchGlobPattern(_0x191243[_0x3b1c53(0xea)][_0x3b1c53(0xfb)],_0x51ca55)));const _0x12bdb5=_0x79db6c[_0x3b1c53(0x168)](toAgentInfo);return await handleSDKOutput(_0x12bdb5,_0x5c32d2),0x0;}catch(_0x2f1d23){return handleSDKError(_0x2f1d23,_0x5c32d2),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a25_0x203df8(0x103);[a25_0x203df8(0xf9)]='Show\x20agent\x20details';async[a25_0x203df8(0xbf)](_0x2eb279){const _0x450751=a25_0x203df8,{options:_0x525613,args:_0x2e01d3,tdx:_0x2a62f5}=_0x2eb279;if(_0x2e01d3[_0x450751(0xd7)]===0x0)return console[_0x450751(0xce)](_0x450751(0x146)),console[_0x450751(0xce)](_0x450751(0xc3)),0x1;const _0xff8bb=_0x2e01d3[0x0];try{const _0x5e23e0=await getProjectIdOrDefault(_0x2eb279),_0x5976cd=await withSpinner(_0x450751(0x110)+_0xff8bb+'\x27...',()=>_0x2a62f5[_0x450751(0x155)][_0x450751(0xdd)](_0xff8bb,_0x5e23e0),{'verbose':_0x525613[_0x450751(0x11b)]}),_0x3aa993=await withSpinner('Fetching\x20agent...',()=>_0x2a62f5['llm']['agent'](_0x5976cd[_0x450751(0xb5)]),{'verbose':_0x525613[_0x450751(0x11b)]});return await handleSDKOutput([_0x3aa993[_0x450751(0xb5)]],_0x525613),0x0;}catch(_0x285db0){return handleSDKError(_0x285db0,_0x525613),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']='llm:agent:create';[a25_0x203df8(0xf9)]=a25_0x203df8(0x156);async[a25_0x203df8(0xbf)](_0x200bc6){const _0x12c140=a25_0x203df8,{options:_0xb3fbf4,args:_0x14ea97,tdx:_0xafac77}=_0x200bc6;if(_0x14ea97[_0x12c140(0xd7)]===0x0)return console[_0x12c140(0xce)](_0x12c140(0x146)),console[_0x12c140(0xce)]('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console[_0x12c140(0xce)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x2e465b=_0x14ea97[0x0],_0x5e2e5b=_0xb3fbf4,_0x4bd0f5=_0x5e2e5b[_0x12c140(0xf2)],_0x34027b=_0x5e2e5b[_0x12c140(0xc9)]||'claude-4.5-haiku',_0xa4dea9=_0x5e2e5b['starterMessage'],_0x2f616e=_0x5e2e5b['maxToolIterations']?Number(_0x5e2e5b['maxToolIterations']):undefined,_0x3f77cf=_0x5e2e5b[_0x12c140(0xbe)]?Number(_0x5e2e5b[_0x12c140(0xbe)]):undefined;try{let _0x9e1832,_0x25e8ff;if(_0x2e465b[_0x12c140(0xba)]('/')){const _0x5bb508=_0x2e465b[_0x12c140(0x112)]('/');if(_0x5bb508['length']===0x2){const [_0x479122,_0x5cca36]=_0x5bb508,_0x4814d8=await withSpinner(_0x12c140(0x123)+_0x479122+'\x27...',()=>_0xafac77[_0x12c140(0x155)][_0x12c140(0x15f)](_0x479122),{'verbose':_0xb3fbf4[_0x12c140(0x11b)]});_0x9e1832=_0x4814d8['data'],_0x25e8ff=_0x5cca36;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12c140(0x14f)+_0x2e465b,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x9e1832=await getProjectIdOrDefault(_0x200bc6),_0x25e8ff=_0x2e465b;const _0x4d67c1=await withSpinner(_0x12c140(0xcb)+_0x25e8ff+_0x12c140(0xcd),()=>_0xafac77[_0x12c140(0x155)][_0x12c140(0x16a)]({'name':_0x25e8ff,'projectId':_0x9e1832,'modelType':_0x34027b,'systemPrompt':_0x4bd0f5,'starterMessage':_0xa4dea9,'maxToolIterations':_0x2f616e,'temperature':_0x3f77cf}),{'verbose':_0xb3fbf4[_0x12c140(0x11b)]});return console[_0x12c140(0xe7)](_0x12c140(0x145)+_0x4d67c1[_0x12c140(0xb5)]['id']),await handleSDKOutput([_0x4d67c1['data']],_0xb3fbf4),0x0;}catch(_0x40c0e5){return handleSDKError(_0x40c0e5,_0xb3fbf4),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a25_0x203df8(0xec);[a25_0x203df8(0xf9)]=a25_0x203df8(0x130);async[a25_0x203df8(0xbf)](_0x38400f){const _0x26d1e3=a25_0x203df8,{options:_0x358682,args:_0x150184,tdx:_0x37ff02}=_0x38400f;if(_0x150184[_0x26d1e3(0xd7)]===0x0)return console[_0x26d1e3(0xce)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x26d1e3(0x13d)),0x1;const _0x503fa8=_0x150184[0x0],_0x17a662=_0x358682,_0x127b97=_0x17a662[_0x26d1e3(0xfb)],_0x3f5ad6=_0x17a662[_0x26d1e3(0xd9)],_0x34ea39=_0x17a662[_0x26d1e3(0xf9)],_0x119d46=_0x17a662['starterMessage'];if(!_0x127b97&&!_0x3f5ad6&&!_0x34ea39&&!_0x119d46)return console[_0x26d1e3(0xce)](_0x26d1e3(0xeb)),console['error'](_0x26d1e3(0x10d)),0x1;try{const _0x2f93b8=await getProjectIdOrDefault(_0x38400f),_0x53bcee=await withSpinner(_0x26d1e3(0x110)+_0x503fa8+_0x26d1e3(0xcd),()=>_0x37ff02[_0x26d1e3(0x155)][_0x26d1e3(0xdd)](_0x503fa8,_0x2f93b8),{'verbose':_0x358682[_0x26d1e3(0x11b)]}),_0xbc1e1d=_0x53bcee[_0x26d1e3(0xb5)],_0x57b25d=await withSpinner(_0x26d1e3(0x134),()=>_0x37ff02[_0x26d1e3(0x155)][_0x26d1e3(0x13a)](_0xbc1e1d,{'name':_0x127b97,'prompt':_0x3f5ad6,'description':_0x34ea39,'starterMessage':_0x119d46}),{'verbose':_0x358682['verbose']});return console[_0x26d1e3(0xe7)](_0x26d1e3(0xb7)+_0x57b25d[_0x26d1e3(0xb5)]['id']),await handleSDKOutput([_0x57b25d[_0x26d1e3(0xb5)]],_0x358682),0x0;}catch(_0x58edb4){return handleSDKError(_0x58edb4,_0x358682),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a25_0x203df8(0x17a);[a25_0x203df8(0xf9)]='Delete\x20an\x20agent';async[a25_0x203df8(0xbf)](_0x2ab8dc){const _0x4305e2=a25_0x203df8,{options:_0x3bceee,args:_0xf116e,tdx:_0x3a9597}=_0x2ab8dc;if(_0xf116e['length']===0x0)return console[_0x4305e2(0xce)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x4305e2(0xce)](_0x4305e2(0xd5)),0x1;const _0x583e32=_0xf116e[0x0];try{const _0x1fda7c=await getProjectIdOrDefault(_0x2ab8dc),_0x1a4ad1=await withSpinner(_0x4305e2(0x110)+_0x583e32+'\x27...',()=>_0x3a9597[_0x4305e2(0x155)][_0x4305e2(0xdd)](_0x583e32,_0x1fda7c),{'verbose':_0x3bceee[_0x4305e2(0x11b)]}),_0x531cac=_0x1a4ad1[_0x4305e2(0xb5)];return await withSpinner(_0x4305e2(0x15d),()=>_0x3a9597[_0x4305e2(0x155)]['deleteAgent'](_0x531cac),{'verbose':_0x3bceee[_0x4305e2(0x11b)]}),console[_0x4305e2(0xe7)]('Agent\x20deleted:\x20'+_0x531cac),0x0;}catch(_0x486449){return handleSDKError(_0x486449,_0x3bceee),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a25_0x203df8(0xfb)]='llm:history';[a25_0x203df8(0xf9)]=a25_0x203df8(0x147);async[a25_0x203df8(0xbf)](_0x5da60f){const _0x225996=a25_0x203df8;return executeChatHistoryCommand(_0x5da60f,_0x225996(0xd6));}}export class LLMUseCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0x14b);[a25_0x203df8(0xf9)]=a25_0x203df8(0x116);async[a25_0x203df8(0xbf)](_0x54ed96){const _0x2b0f16=a25_0x203df8,{options:_0x184951,args:_0x42b561,tdx:_0x6479f5}=_0x54ed96;if(_0x42b561['length']===0x0)return console[_0x2b0f16(0xce)](_0x2b0f16(0x109)),console[_0x2b0f16(0xce)](_0x2b0f16(0xd3)),0x1;const _0x1f9a64=_0x42b561[0x0];try{return await withSpinner(_0x2b0f16(0xe8)+_0x1f9a64+'\x27...',()=>_0x6479f5['llm'][_0x2b0f16(0x15a)](_0x1f9a64),{'verbose':_0x184951[_0x2b0f16(0x11b)]}),console[_0x2b0f16(0xe7)]('Project\x20context\x20set\x20to:\x20'+_0x1f9a64),0x0;}catch(_0x226b26){return handleSDKError(_0x226b26,_0x184951),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0xc2);[a25_0x203df8(0xf9)]=a25_0x203df8(0x14a);async[a25_0x203df8(0xbf)](_0x32fa48){const _0xc87100=a25_0x203df8,{options:_0x36a3a7,args:_0x13d1a4,tdx:_0x62b84d}=_0x32fa48;if(_0x13d1a4[_0xc87100(0xd7)]===0x0)return console[_0xc87100(0xce)](_0xc87100(0x109)),console['error'](_0xc87100(0xd2)),0x1;const _0x551438=_0x13d1a4[0x0],_0x17f0cb=_0x36a3a7,_0x35e8ef=_0x17f0cb['description'];try{const _0x4d7998=await withSpinner(_0xc87100(0xf8)+_0x551438+_0xc87100(0xcd),()=>_0x62b84d[_0xc87100(0x155)][_0xc87100(0xdc)]({'name':_0x551438,'description':_0x35e8ef}),{'verbose':_0x36a3a7[_0xc87100(0x11b)]});console[_0xc87100(0xe7)]('Project\x20created:\x20'+_0x4d7998[_0xc87100(0xb5)]['id']);const _0x15d7c0=toLLMProjectInfo(_0x4d7998['data']);return await handleSDKOutput([_0x15d7c0],_0x36a3a7),0x0;}catch(_0x36c461){return handleSDKError(_0x36c461,_0x36a3a7),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a25_0x203df8(0xfb)]=a25_0x203df8(0x13c);[a25_0x203df8(0xf9)]='Delete\x20an\x20LLM\x20project';async['execute'](_0x300938){const _0x5ca846=a25_0x203df8,{options:_0xeebc05,args:_0x185ac0,tdx:_0xe9f98d}=_0x300938;if(_0x185ac0[_0x5ca846(0xd7)]===0x0)return console[_0x5ca846(0xce)](_0x5ca846(0x109)),console['error']('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x3a3016=_0x185ac0[0x0];try{return await withSpinner(_0x5ca846(0x120)+_0x3a3016+_0x5ca846(0xcd),()=>_0xe9f98d[_0x5ca846(0x155)]['deleteProject'](_0x3a3016),{'verbose':_0xeebc05[_0x5ca846(0x11b)]}),console[_0x5ca846(0xe7)]('Project\x20deleted:\x20'+_0x3a3016),0x0;}catch(_0x1075b0){return handleSDKError(_0x1075b0,_0xeebc05),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a25_0x203df8(0x143);[a25_0x203df8(0xf9)]=a25_0x203df8(0x133);async['execute'](_0xed5640){const _0x3563cb=a25_0x203df8,{options:_0x2a9e82,args:_0x1a2c51,tdx:_0x5c1272}=_0xed5640;if(_0x1a2c51['length']===0x0)return console[_0x3563cb(0xce)](_0x3563cb(0x109)),console[_0x3563cb(0xce)]('Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]'),0x1;const _0x43803b=_0x1a2c51[0x0],_0x13e19a=_0x2a9e82,_0x3318f9=_0x13e19a[_0x3563cb(0x13b)],_0x4f885b=_0x13e19a[_0x3563cb(0x160)];try{const _0x823ca4=_0x3318f9||_0x43803b+_0x3563cb(0xcf);if(a25_0x20bc81['existsSync'](_0x823ca4)&&!_0x4f885b){if(!_0x2a9e82[_0x3563cb(0xc0)]){const _0x3b8382=await confirm(_0x3563cb(0xc6)+_0x823ca4+_0x3563cb(0xb4));if(!_0x3b8382)return console['log']('Backup\x20cancelled.'),0x0;}a25_0x20bc81[_0x3563cb(0x118)](_0x823ca4,{'recursive':!![]});}const _0x57588d=await withSpinner(_0x4f885b?_0x3563cb(0x164)+_0x43803b+_0x3563cb(0xcd):_0x3563cb(0x139)+_0x43803b+_0x3563cb(0xcd),()=>_0x5c1272[_0x3563cb(0x155)]['backupProject'](_0x43803b,_0x3318f9,{'dryRun':_0x4f885b}),{'verbose':_0x2a9e82['verbose']}),_0x54fe7=_0x57588d['data'];return _0x4f885b?console['log']('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0x54fe7[_0x3563cb(0x105)]):console[_0x3563cb(0xe7)](_0x3563cb(0x15e)+_0x54fe7['outputDir']),console[_0x3563cb(0xe7)](_0x3563cb(0x11d)+_0x54fe7[_0x3563cb(0x157)]['agents']),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x54fe7[_0x3563cb(0x157)]['knowledgeBases']),console[_0x3563cb(0xe7)](_0x3563cb(0xf3)+_0x54fe7['counts'][_0x3563cb(0xf4)]),console[_0x3563cb(0xe7)](_0x3563cb(0x128)+_0x54fe7['counts']['integrations']),(_0x2a9e82['format']===_0x3563cb(0x10b)||_0x2a9e82[_0x3563cb(0x13f)]===_0x3563cb(0xee))&&await handleSDKOutput([_0x54fe7],_0x2a9e82),0x0;}catch(_0xaee5f7){return handleSDKError(_0xaee5f7,_0x2a9e82),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a25_0x203df8(0xfb)]='llm:project:restore';[a25_0x203df8(0xf9)]=a25_0x203df8(0xbb);async['execute'](_0x1ee019){const _0x147b96=a25_0x203df8,{options:_0x16c1f3,args:_0x45dced,tdx:_0x463279}=_0x1ee019;if(_0x45dced[_0x147b96(0xd7)]===0x0)return console[_0x147b96(0xce)](_0x147b96(0x167)),console[_0x147b96(0xce)](_0x147b96(0x114)),0x1;const _0x1a0419=_0x45dced[0x0],_0xf02290=_0x16c1f3,_0xca93f8=_0xf02290['name'],_0x55acfd=_0xf02290['dryRun'];try{if(!_0x55acfd){const _0x4796c7=_0x463279['llm'][_0x147b96(0x12c)](_0x1a0419),_0x47ed65=_0xca93f8||_0x4796c7[_0x147b96(0x12b)][_0x147b96(0xfe)],_0x10aaba=await withSpinner(_0x147b96(0x148),()=>_0x463279[_0x147b96(0x155)][_0x147b96(0xe9)](),{'verbose':_0x16c1f3[_0x147b96(0x11b)]}),_0xa9ff1=_0x10aaba[_0x147b96(0xb5)][_0x147b96(0xcc)](_0x4af3b3=>_0x4af3b3['attributes'][_0x147b96(0xfb)]===_0x47ed65);if(_0xa9ff1&&!_0x16c1f3[_0x147b96(0xc0)]){const _0x17e623=await confirm('A\x20project\x20named\x20\x27'+_0x47ed65+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x17e623)return console[_0x147b96(0xe7)](_0x147b96(0x161)),0x0;}}const _0x2d7d80=await withSpinner(_0x55acfd?'Validating\x20backup\x20from\x20\x27'+_0x1a0419+'\x27...':_0x147b96(0x131)+_0x1a0419+_0x147b96(0xcd),()=>_0x463279[_0x147b96(0x155)][_0x147b96(0x171)](_0x1a0419,{'name':_0xca93f8,'dryRun':_0x55acfd}),{'verbose':_0x16c1f3[_0x147b96(0x11b)]}),_0x10c23e=_0x2d7d80['data'];return _0x10c23e[_0x147b96(0x15c)]&&console[_0x147b96(0xe7)](_0x147b96(0x12d)+_0x10c23e[_0x147b96(0x15c)]+'\x27'),_0x55acfd?console[_0x147b96(0xe7)](_0x147b96(0xde)+_0x10c23e[_0x147b96(0xfe)]):console['log'](_0x147b96(0x11e)+_0x10c23e['projectName']+'\x20('+_0x10c23e['projectId']+')'),console[_0x147b96(0xe7)](_0x147b96(0x11d)+_0x10c23e[_0x147b96(0x157)][_0x147b96(0x174)]),console[_0x147b96(0xe7)](_0x147b96(0x16b)+_0x10c23e['counts'][_0x147b96(0xf1)]),console['log']('\x20\x20Prompts:\x20'+_0x10c23e[_0x147b96(0x157)]['prompts']),console[_0x147b96(0xe7)]('\x20\x20Integrations:\x20'+_0x10c23e['counts'][_0x147b96(0xf6)]),(_0x16c1f3['format']===_0x147b96(0x10b)||_0x16c1f3[_0x147b96(0x13f)]==='jsonl')&&await handleSDKOutput([_0x10c23e],_0x16c1f3),0x0;}catch(_0x21290e){return handleSDKError(_0x21290e,_0x16c1f3),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x114172,_0x2ebc62){const _0x18226c=a25_0x203df8,_0x15faae=_0x2ebc62['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0xc2e239=0x0,_0x24fb30=[];const _0x36ec11=(await import('prompts'))[_0x18226c(0x115)],_0x51fb65=getChalk(_0x2ebc62);while(!![]){const _0x2f1066=await withSpinner(_0x18226c(0x106),()=>_0x114172[_0x18226c(0x155)][_0x18226c(0x125)](_0x15faae+_0xc2e239),{'verbose':_0x2ebc62[_0x18226c(0x11b)]});_0x24fb30=_0x2f1066[_0x18226c(0xb5)];const _0x52ecfd=_0x24fb30[_0x18226c(0xca)](_0xc2e239,_0xc2e239+_0x15faae),_0x22f7d5=_0x24fb30[_0x18226c(0xd7)]>_0xc2e239+_0x15faae,_0xe43126=[...new Set(_0x52ecfd['map'](_0xfa7db4=>_0xfa7db4[_0x18226c(0xea)][_0x18226c(0xff)])[_0x18226c(0xfa)](_0x222fad=>_0x222fad!==undefined))],_0x3cbc6a=new Map();await Promise['all'](_0xe43126[_0x18226c(0x168)](async _0x2d427c=>{const _0x3ad529=_0x18226c;try{const _0x4cbbd5=await _0x114172['llm'][_0x3ad529(0xb6)](_0x2d427c);_0x3cbc6a[_0x3ad529(0x11a)](_0x2d427c,_0x4cbbd5['attributes'][_0x3ad529(0xfb)]);}catch{_0x3cbc6a[_0x3ad529(0x11a)](_0x2d427c,_0x2d427c);}}));const _0x6c0311=_0x52ecfd[_0x18226c(0x168)](_0x486dc2=>{const _0x1249fa=_0x18226c,_0x4b1fa5=_0x486dc2[_0x1249fa(0xea)][_0x1249fa(0x16f)]||_0x1249fa(0x15b),_0x9c01da=_0x4b1fa5['split']('\x0a')[0x0],_0x3563d4=_0x9c01da[_0x1249fa(0xd7)]>0x50?_0x9c01da[_0x1249fa(0xfc)](0x0,0x4d)+_0x1249fa(0x12a):_0x9c01da,_0x1ab69c=_0x486dc2[_0x1249fa(0xea)][_0x1249fa(0xff)]?_0x3cbc6a[_0x1249fa(0x137)](_0x486dc2[_0x1249fa(0xea)]['agentId'])||_0x486dc2['attributes'][_0x1249fa(0xff)]:'(no\x20agent)',_0x577d1b=_0x486dc2[_0x1249fa(0xea)]['lastConversationAt']||_0x486dc2[_0x1249fa(0xea)][_0x1249fa(0xd4)],_0x3a7d58=new Date(_0x577d1b),_0x10e7bd=new Date(),_0x12cd48=_0x10e7bd[_0x1249fa(0x175)]()-_0x3a7d58[_0x1249fa(0x175)](),_0x2fb69a=Math[_0x1249fa(0x129)](_0x12cd48/0xea60),_0x376071=Math[_0x1249fa(0x129)](_0x12cd48/0x36ee80),_0x5dcff2=Math['floor'](_0x12cd48/0x5265c00);let _0x1825c2;if(_0x2fb69a<0x1)_0x1825c2=_0x1249fa(0x132);else{if(_0x2fb69a<0x3c)_0x1825c2=_0x2fb69a+_0x1249fa(0xe2);else{if(_0x376071<0x18)_0x1825c2=_0x376071+_0x1249fa(0x158);else _0x5dcff2<0x7?_0x1825c2=_0x5dcff2+_0x1249fa(0x172):_0x1825c2=_0x3a7d58[_0x1249fa(0x135)](_0x1249fa(0x119),{'month':'short','day':_0x1249fa(0x117)});}}return{'title':_0x3563d4+'\x20'+_0x51fb65[_0x1249fa(0xe1)]('['+_0x1ab69c+']\x20'+_0x1825c2),'value':_0x486dc2['id']};});_0x22f7d5&&_0x6c0311[_0x18226c(0x102)]({'title':_0x51fb65['cyan'](_0x18226c(0x14e)),'value':'__load_more__'});const _0x2d6841=await _0x36ec11({'type':_0x18226c(0x140),'name':_0x18226c(0xe5),'message':_0x18226c(0x165),'choices':_0x6c0311,'hint':_0x18226c(0xd1)});if(!_0x2d6841[_0x18226c(0xe5)])return undefined;if(_0x2d6841['chatId']===_0x18226c(0x12e)){_0xc2e239+=_0x15faae;continue;}return _0x2d6841[_0x18226c(0xe5)];}}export class ChatsCommand extends BaseCommand{[a25_0x203df8(0xfb)]='chats';[a25_0x203df8(0xf9)]=a25_0x203df8(0x104);async[a25_0x203df8(0xbf)](_0x32b030){const _0x1a7659=a25_0x203df8;return executeChatHistoryCommand(_0x32b030,_0x1a7659(0x178));}}
1
+ const a25_0x59ba4d=a25_0x12fd;(function(_0x29e7ed,_0x5ecab3){const _0x40c1ee=a25_0x12fd,_0x1fbfef=_0x29e7ed();while(!![]){try{const _0x25a58c=-parseInt(_0x40c1ee(0x28e))/0x1*(parseInt(_0x40c1ee(0x255))/0x2)+parseInt(_0x40c1ee(0x242))/0x3*(-parseInt(_0x40c1ee(0x21c))/0x4)+parseInt(_0x40c1ee(0x28a))/0x5*(parseInt(_0x40c1ee(0x251))/0x6)+parseInt(_0x40c1ee(0x228))/0x7+parseInt(_0x40c1ee(0x1ff))/0x8+-parseInt(_0x40c1ee(0x1f8))/0x9*(-parseInt(_0x40c1ee(0x27e))/0xa)+-parseInt(_0x40c1ee(0x26e))/0xb*(parseInt(_0x40c1ee(0x22c))/0xc);if(_0x25a58c===_0x5ecab3)break;else _0x1fbfef['push'](_0x1fbfef['shift']());}catch(_0x45fcd4){_0x1fbfef['push'](_0x1fbfef['shift']());}}}(a25_0x5cfd,0xa351e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a25_0x53556e from'node:fs';function handleSDKError(_0x428c19,_0x449255){const _0x116dea=a25_0x12fd;if(_0x428c19 instanceof SDKError)console[_0x116dea(0x222)](_0x116dea(0x1ed)+_0x428c19[_0x116dea(0x230)]),_0x449255[_0x116dea(0x27f)]&&(_0x428c19[_0x116dea(0x29c)]&&console[_0x116dea(0x222)]('\x20\x20Cause:\x20'+_0x428c19[_0x116dea(0x29c)]),_0x428c19['stack']&&(console[_0x116dea(0x222)](_0x116dea(0x25a)),console['error'](_0x428c19[_0x116dea(0x277)])));else throw _0x428c19;}function a25_0x12fd(_0x3f04a8,_0x5725a6){_0x3f04a8=_0x3f04a8-0x1e4;const _0x5cfd19=a25_0x5cfd();let _0x12fdc2=_0x5cfd19[_0x3f04a8];return _0x12fdc2;}function formatChatHistoryEntry(_0xde3e9f,_0x1ddc5f){const _0x415d8e=a25_0x12fd,_0x31b429=getChalk(_0x1ddc5f),_0x3ce457=_0x31b429[_0x415d8e(0x1f0)](_0xde3e9f['at']);if(_0x415d8e(0x27b)in _0xde3e9f){const _0x14e8db=_0x31b429[_0x415d8e(0x237)](_0x415d8e(0x248));return _0x3ce457+'\x20'+_0x14e8db+':\x20'+_0xde3e9f['input'];}if(_0x415d8e(0x243)in _0xde3e9f){const _0x545df=_0x31b429[_0x415d8e(0x1f3)](_0x415d8e(0x201));return _0x3ce457+'\x20'+_0x545df+':\x20'+_0xde3e9f['content'];}if(_0x415d8e(0x1ef)in _0xde3e9f){const _0x42322c=_0x31b429[_0x415d8e(0x2a2)]('[tool_call]'),{functionName:_0xecb80d,functionArguments:_0x53a195,targetFunction:_0xd2b425}=_0xde3e9f[_0x415d8e(0x1ef)];let _0x375a27=_0x3ce457+'\x20'+_0x42322c+':\x20'+_0x31b429[_0x415d8e(0x20b)](_0xecb80d);if(_0x53a195&&Object[_0x415d8e(0x1f1)](_0x53a195)[_0x415d8e(0x29e)]>0x0){const _0x441af7=Object[_0x415d8e(0x2aa)](_0x53a195)[_0x415d8e(0x23f)](([_0x2f9d3e,_0x32fb57])=>_0x2f9d3e+'='+JSON[_0x415d8e(0x2ad)](_0x32fb57))[_0x415d8e(0x227)](',\x20');_0x375a27+='('+_0x441af7+')';}_0xd2b425&&(_0x375a27+=_0x31b429[_0x415d8e(0x1f0)]('\x20['+_0xd2b425+']'));let _0x4aba67='';if(_0xde3e9f[_0x415d8e(0x1ef)]['targetKnowledgeBase'])_0x4aba67='\x20->\x20KB:'+_0xde3e9f[_0x415d8e(0x1ef)][_0x415d8e(0x29a)][_0x415d8e(0x212)];else{if(_0xde3e9f[_0x415d8e(0x1ef)][_0x415d8e(0x29b)])_0x4aba67=_0x415d8e(0x298)+_0xde3e9f['tool_call'][_0x415d8e(0x29b)]['name'];else{if(_0xde3e9f['tool_call'][_0x415d8e(0x288)])_0x4aba67=_0x415d8e(0x22a)+_0xde3e9f['tool_call'][_0x415d8e(0x288)][_0x415d8e(0x212)];else _0xde3e9f[_0x415d8e(0x1ef)][_0x415d8e(0x2a5)]&&(_0x4aba67=_0x415d8e(0x2a1)+_0xde3e9f[_0x415d8e(0x1ef)][_0x415d8e(0x2a5)]['name']);}}return _0x375a27+_0x4aba67;}if(_0x415d8e(0x232)in _0xde3e9f){const _0x523b17=_0x31b429[_0x415d8e(0x21a)](_0x415d8e(0x210)),{functionName:_0x50b43c,functionArguments:_0x576abb,content:_0x416500,newChat:_0x2cf0a6}=_0xde3e9f['tool'];let _0x5c24e4=_0x3ce457+'\x20'+_0x523b17+':\x20'+_0x31b429[_0x415d8e(0x20b)](_0x50b43c);if(_0x576abb){const _0x4e5edc=typeof _0x576abb===_0x415d8e(0x26a)?_0x576abb:JSON[_0x415d8e(0x2ad)](_0x576abb);_0x5c24e4+='('+_0x4e5edc+')';}return _0x416500&&(_0x5c24e4+='\x0a'+_0x31b429[_0x415d8e(0x1f0)](_0x416500)),_0x2cf0a6&&(_0x5c24e4+=_0x31b429[_0x415d8e(0x1f0)](_0x415d8e(0x246)+_0x2cf0a6['id'])),_0x5c24e4;}if(_0x415d8e(0x264)in _0xde3e9f){const _0x154f9a=_0x31b429[_0x415d8e(0x257)](_0x415d8e(0x24a));return _0x3ce457+'\x20'+_0x154f9a+':\x20'+_0xde3e9f[_0x415d8e(0x264)][_0x415d8e(0x212)]+'\x20('+_0xde3e9f[_0x415d8e(0x264)][_0x415d8e(0x243)][_0x415d8e(0x29e)]+_0x415d8e(0x25b);}if(_0x415d8e(0x240)in _0xde3e9f){const _0x10427b=_0x31b429[_0x415d8e(0x257)](_0x415d8e(0x2ac)),{width:_0x1819ed,height:_0x51ccfe,headerText:_0x4a6c01}=_0xde3e9f[_0x415d8e(0x240)],_0x2ddb72=_0x4a6c01?_0x415d8e(0x27d)+_0x4a6c01:'';return _0x3ce457+'\x20'+_0x10427b+':\x20'+_0x1819ed+'x'+_0x51ccfe+_0x2ddb72;}if(_0x415d8e(0x222)in _0xde3e9f){const _0x19bf6f=_0x31b429[_0x415d8e(0x24e)]('[error]\x20\x20');return _0x3ce457+'\x20'+_0x19bf6f+':\x20'+_0xde3e9f[_0x415d8e(0x222)];}return _0x3ce457+'\x20'+_0x31b429['dim']('[unknown]')+':\x20'+JSON[_0x415d8e(0x2ad)](_0xde3e9f);}async function executeChatHistoryCommand(_0x2ab11b,_0x2e7a94){const _0x235c7e=a25_0x12fd,{options:_0x20d01c,args:_0x2555d4,tdx:_0x37250b}=_0x2ab11b,_0x27e295=_0x2555d4[0x0],_0x5640a2=_0x20d01c,_0x4035ec=_0x5640a2[_0x235c7e(0x1f7)];try{if(_0x4035ec&&_0x27e295)return console['error'](_0x235c7e(0x2a4)),console[_0x235c7e(0x222)]('Usage:\x20'+_0x2e7a94+'\x20--last'),0x1;if(!_0x27e295&&!_0x4035ec&&_0x20d01c[_0x235c7e(0x2a8)]!==undefined){const _0x285a24=resolveLimit(_0x20d01c[_0x235c7e(0x216)],DEFAULT_LLM_LIMIT),_0x180957=await withSpinner(_0x235c7e(0x292),()=>_0x37250b[_0x235c7e(0x22d)]['chats'](_0x285a24),{'verbose':_0x20d01c[_0x235c7e(0x27f)]});return await handleSDKOutput(_0x180957[_0x235c7e(0x1fd)],_0x20d01c),0x0;}const _0x3a8548=await getChatIdOrSelect(_0x37250b,_0x20d01c,_0x4035ec,_0x27e295);if(!_0x3a8548)return 0x0;return await displayChatHistory(_0x3a8548,_0x37250b,_0x20d01c),0x0;}catch(_0x5b1f12){return handleSDKError(_0x5b1f12,_0x20d01c),0x1;}}async function displayChatHistory(_0x2803f3,_0x5d2ad6,_0x3164bb){const _0x3da393=a25_0x12fd,_0xfa8d1b=await withSpinner(_0x3da393(0x218)+_0x2803f3+_0x3da393(0x25c),()=>_0x5d2ad6[_0x3da393(0x22d)]['history'](_0x2803f3),{'verbose':_0x3164bb[_0x3da393(0x27f)]}),_0x5c8a61=_0xfa8d1b['data'][_0x3da393(0x1fd)]??[];if(_0x5c8a61[_0x3da393(0x29e)]===0x0){console[_0x3da393(0x224)]('No\x20messages\x20found\x20in\x20chat\x20history.');return;}if(_0x3164bb['format']!==undefined)await handleSDKOutput(_0x5c8a61,_0x3164bb);else{const _0x5e1fcb=_0x5c8a61['map'](_0x504dab=>formatChatHistoryEntry(_0x504dab,_0x3164bb)),_0x587aaf=_0x5e1fcb[_0x3da393(0x227)]('\x0a');await writeOutput(_0x587aaf,_0x3164bb[_0x3da393(0x264)],'table');}}async function getChatIdOrSelect(_0x5d4edb,_0x5a63ab,_0x393745,_0x4488d8){const _0x29fd60=a25_0x12fd;if(_0x4488d8)return _0x4488d8;if(_0x393745){const _0x4b2539=await withSpinner(_0x29fd60(0x280),()=>_0x5d4edb[_0x29fd60(0x22d)][_0x29fd60(0x1fc)](0x1),{'verbose':_0x5a63ab[_0x29fd60(0x27f)]});if(_0x4b2539['data']['length']===0x0)return console[_0x29fd60(0x224)](_0x29fd60(0x211)),undefined;return _0x4b2539[_0x29fd60(0x1fd)][0x0]['id'];}const _0x577b14=await selectChatInteractively(_0x5d4edb,_0x5a63ab);if(!_0x577b14)return console[_0x29fd60(0x224)](_0x29fd60(0x214)),undefined;return _0x577b14;}async function getProjectIdOrDefault(_0x5533f7){const _0x45b9d2=a25_0x12fd,{tdx:_0x48588c,options:_0x148824}=_0x5533f7,_0x4b7995=_0x148824['llmProject'];if(_0x4b7995){const _0x1d71af=await withSpinner(_0x45b9d2(0x24f)+_0x4b7995+_0x45b9d2(0x25c),()=>_0x48588c[_0x45b9d2(0x22d)][_0x45b9d2(0x1ee)](_0x4b7995),{'verbose':_0x148824[_0x45b9d2(0x27f)]});return _0x1d71af[_0x45b9d2(0x1fd)];}let _0x30dae6=_0x48588c[_0x45b9d2(0x22d)]['getCurrentProject']();if(_0x30dae6)return _0x30dae6;const _0x3ca50c=await withSpinner(_0x45b9d2(0x247),()=>_0x48588c[_0x45b9d2(0x22d)]['getOrCreateDefaultProject'](),{'verbose':_0x148824['verbose']});return _0x3ca50c[_0x45b9d2(0x1fd)]['id'];}function toLLMProjectInfo(_0x1912cf){const _0x15ed83=a25_0x12fd;return{'name':_0x1912cf[_0x15ed83(0x21f)][_0x15ed83(0x212)],'description':_0x1912cf['attributes']['description'],'createdAt':_0x1912cf[_0x15ed83(0x21f)]['createdAt'],'updatedAt':_0x1912cf[_0x15ed83(0x21f)][_0x15ed83(0x244)]};}function a25_0x5cfd(){const _0x856c5f=['408133rLFbAa','Agent\x20updated:\x20','(no\x20agent)','description','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','\x20\x20Knowledge\x20Bases:\x20','Restore\x20cancelled.','Load\x20more...','llm:models','stack','Deleting\x20project\x20\x27','filter','Error:\x20Project\x20name\x20is\x20required','input','models','\x20-\x20','69800ekqhid','verbose','Fetching\x20most\x20recent\x20chat...','List\x20agents\x20in\x20current\x20project','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','integrations','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Create\x20a\x20new\x20agent\x20in\x20current\x20project','toLowerCase','targetWebSearchTool','h\x20ago','15LJOfxz','default','Analyzing\x20project\x20\x27','Fetching\x20available\x20models...','5IyIDHs','Create\x20a\x20new\x20LLM\x20project','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','outputDir','Fetching\x20chat\x20sessions...','updateAgent','Usage:\x20tdx\x20llm\x20use\x20<project-name>','sourceSite','llm:use','Backing\x20up\x20project\x20\x27','\x20->\x20Agent:','backupProject','targetKnowledgeBase','targetAgent','cause','prompts','length','Agent\x20deleted:\x20','en-US','\x20->\x20ImageGen:','yellow','Project\x20context\x20set\x20to:\x20','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','targetImageGenerator','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','llm:project:create','format','llm:projects','entries','all','[image]\x20\x20','stringify','yes','Project\x20created:\x20','m\x20ago','\x20\x20Agents:\x20','llm:agent:delete','List\x20available\x20LLM\x20models','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','llm:project:backup','get','INVALID_ARGUMENT','counts','llm:agent:update','Error:\x20','resolveProjectId','tool_call','dim','keys','\x20\x20Integrations:\x20','green','Use\x20format:\x20project-name/agent-name','split','Resolving\x20agent\x20\x27','last','801FoJwKD','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','model','select','chats','data','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','410800EbcyjK','Checking\x20for\x20existing\x20projects...','[content]','d\x20ago','llm:agents','getTime','deleteAgent','exportedFrom','deleteProject','execute','Select\x20a\x20chat\x20session:','Project\x20restored:\x20','bold','Invalid\x20path\x20syntax:\x20','Output\x20directory\x20\x27','projectName','Validating\x20backup\x20from\x20\x27','[tool]\x20\x20\x20','No\x20chat\x20sessions\x20found.','name','chatId','\x0aCancelled','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','limit','Updating\x20agent...','Fetching\x20chat\x20history\x20for\x20\x27','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','magenta','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','154684YrDLJs','.llm','find','attributes','Creating\x20project\x20\x27','Delete\x20an\x20agent','error','llm:agent:create','log','LLM_PROJECT_NOT_FOUND','__load_more__','join','8032115UuBsKJ','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','\x20->\x20WebSearch:','Creating\x20agent\x20\x27','288ARmnSz','llm','Agent\x20created:\x20','tdx\x20chats','message','Project\x20deleted:\x20','tool','prompt','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','tdx\x20llm\x20history','Error:\x20Agent\x20name\x20is\x20required','cyan','just\x20now','lastConversationAt','maxToolIterations','getBackupMetadata','systemPrompt','...','floor','map','image','agents','9UFBnGn','content','updatedAt','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20→\x20chat:\x20','Getting\x20default\x20project...','[input]\x20\x20','A\x20project\x20named\x20\x27','[output]\x20','Update\x20an\x20existing\x20agent','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','dryRun','red','Resolving\x20project\x20\x27','agent','1295046IsMlMW','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','rmSync','Show\x20agent\x20details','316838JxCGjs','knowledgeBases','blue','(no\x20message)','createAgent','\x0aStack\x20trace:','\x20bytes)','\x27...','includes','slice','Project\x20backed\x20up\x20to:\x20','setCurrentProject','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Delete\x20an\x20LLM\x20project','temperature','output','llm:project:restore','resolveAgentId','Project\x20not\x20found:\x20','agentId','restoreProject','string','firstInputContent','set','llm:project:delete'];a25_0x5cfd=function(){return _0x856c5f;};return a25_0x5cfd();}function toAgentInfo(_0x234c91){const _0x40fb10=a25_0x12fd;return{'name':_0x234c91['attributes']['name'],'description':_0x234c91[_0x40fb10(0x21f)]['description'],'prompt':truncatePrompt(_0x234c91['attributes'][_0x40fb10(0x233)]),'createdAt':_0x234c91[_0x40fb10(0x21f)]['createdAt'],'updatedAt':_0x234c91[_0x40fb10(0x21f)][_0x40fb10(0x244)]};}function truncatePrompt(_0x343ce6){const _0x5a6da4=a25_0x12fd;if(!_0x343ce6)return undefined;const _0x2a2bb7=0x64;if(_0x343ce6['length']<=_0x2a2bb7)return _0x343ce6;return _0x343ce6[_0x5a6da4(0x25e)](0x0,_0x2a2bb7)+'...';}export class LLMModelsCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x276);['description']=a25_0x59ba4d(0x1e6);async[a25_0x59ba4d(0x208)](_0x3bbd77){const _0x3408ed=a25_0x59ba4d,{options:_0x503b2d,tdx:_0x55dd00}=_0x3bbd77;try{const _0x481842=await withSpinner(_0x3408ed(0x28d),()=>_0x55dd00[_0x3408ed(0x22d)][_0x3408ed(0x27c)](),{'verbose':_0x503b2d['verbose']});return await handleSDKOutput(_0x481842['data'],_0x503b2d),0x0;}catch(_0x1d8754){return handleSDKError(_0x1d8754,_0x503b2d),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x2a9);[a25_0x59ba4d(0x271)]='List\x20all\x20LLM\x20projects';async['execute'](_0x2d2cb6){const _0x54527d=a25_0x59ba4d,{options:_0x25653b,args:_0x59ae14,tdx:_0x5ebda8}=_0x2d2cb6;try{const _0x5cbb27=_0x59ae14[0x0],_0x5a2686=resolveLimit(_0x25653b['limit'],DEFAULT_LLM_LIMIT),_0x4bd4a8=await withSpinner('Fetching\x20projects...',()=>_0x5ebda8[_0x54527d(0x22d)]['projects'](_0x5a2686),{'verbose':_0x25653b[_0x54527d(0x27f)]});let _0x25c10b=_0x4bd4a8['data'];_0x5cbb27&&(_0x25c10b=_0x4bd4a8['data'][_0x54527d(0x279)](_0x117f95=>matchGlobPattern(_0x117f95['attributes']['name'],_0x5cbb27)));const _0x11faba=_0x25c10b[_0x54527d(0x23f)](toLLMProjectInfo);return await handleSDKOutput(_0x11faba,_0x25653b),0x0;}catch(_0x4d25f6){return handleSDKError(_0x4d25f6,_0x25653b),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a25_0x59ba4d(0x203);[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x281);async[a25_0x59ba4d(0x208)](_0x64aceb){const _0xaefce9=a25_0x59ba4d,{options:_0x6d9043,args:_0x3294d0,tdx:_0x1c6a18}=_0x64aceb;try{const _0x204a4b=_0x3294d0[0x0];let _0xf9e6a,_0x24b615=_0x204a4b;if(_0x204a4b&&_0x204a4b[_0xaefce9(0x25d)]('/')){const _0x7c45a3=_0x204a4b[_0xaefce9(0x1f5)]('/');if(_0x7c45a3[_0xaefce9(0x29e)]===0x2){const [_0x84dcdf,_0x424bdc]=_0x7c45a3,_0x2eed5d=await _0x1c6a18[_0xaefce9(0x22d)]['projects'](),_0x4de084=_0x2eed5d[_0xaefce9(0x21e)](_0x180541=>_0x180541['attributes'][_0xaefce9(0x212)][_0xaefce9(0x287)]()===_0x84dcdf[_0xaefce9(0x287)]());if(!_0x4de084)throw new SDKError(ErrorCode[_0xaefce9(0x225)],_0xaefce9(0x267)+_0x84dcdf,undefined,{'helpText':_0xaefce9(0x261)});_0xf9e6a=_0x4de084['id'],_0x24b615=_0x424bdc;}else throw new SDKError(ErrorCode[_0xaefce9(0x1ea)],_0xaefce9(0x20c)+_0x204a4b,undefined,{'helpText':_0xaefce9(0x1f4)});}else _0xf9e6a=await getProjectIdOrDefault(_0x64aceb);const _0x2b344c=await withSpinner('Fetching\x20agents...',()=>_0x1c6a18[_0xaefce9(0x22d)][_0xaefce9(0x241)](_0xf9e6a),{'verbose':_0x6d9043[_0xaefce9(0x27f)]});let _0xb1af02=_0x2b344c[_0xaefce9(0x1fd)];_0x24b615&&(_0xb1af02=_0x2b344c[_0xaefce9(0x1fd)][_0xaefce9(0x279)](_0x1fbcf9=>matchGlobPattern(_0x1fbcf9[_0xaefce9(0x21f)][_0xaefce9(0x212)],_0x24b615)));const _0x3f1045=_0xb1af02[_0xaefce9(0x23f)](toAgentInfo);return await handleSDKOutput(_0x3f1045,_0x6d9043),0x0;}catch(_0x32b61d){return handleSDKError(_0x32b61d,_0x6d9043),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a25_0x59ba4d(0x212)]='llm:agent:show';[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x254);async[a25_0x59ba4d(0x208)](_0x487074){const _0x56d70b=a25_0x59ba4d,{options:_0x47b026,args:_0x58fef2,tdx:_0x14897e}=_0x487074;if(_0x58fef2['length']===0x0)return console[_0x56d70b(0x222)](_0x56d70b(0x236)),console[_0x56d70b(0x222)](_0x56d70b(0x1f9)),0x1;const _0x315f63=_0x58fef2[0x0];try{const _0x28dfee=await getProjectIdOrDefault(_0x487074),_0x501049=await withSpinner('Resolving\x20agent\x20\x27'+_0x315f63+_0x56d70b(0x25c),()=>_0x14897e[_0x56d70b(0x22d)][_0x56d70b(0x266)](_0x315f63,_0x28dfee),{'verbose':_0x47b026[_0x56d70b(0x27f)]}),_0x75b5dc=await withSpinner('Fetching\x20agent...',()=>_0x14897e[_0x56d70b(0x22d)]['agent'](_0x501049['data']),{'verbose':_0x47b026[_0x56d70b(0x27f)]});return await handleSDKOutput([_0x75b5dc[_0x56d70b(0x1fd)]],_0x47b026),0x0;}catch(_0xbf0924){return handleSDKError(_0xbf0924,_0x47b026),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x223);[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x286);async[a25_0x59ba4d(0x208)](_0x40ed2d){const _0x55b87f=a25_0x59ba4d,{options:_0x2d5105,args:_0x22d760,tdx:_0x4c3582}=_0x40ed2d;if(_0x22d760[_0x55b87f(0x29e)]===0x0)return console[_0x55b87f(0x222)](_0x55b87f(0x236)),console[_0x55b87f(0x222)](_0x55b87f(0x1fe)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x138363=_0x22d760[0x0],_0x2c6f21=_0x2d5105,_0x5f1eb0=_0x2c6f21[_0x55b87f(0x23c)],_0x42fdce=_0x2c6f21[_0x55b87f(0x1fa)]||'claude-4.5-haiku',_0x1413dd=_0x2c6f21['starterMessage'],_0x599d1a=_0x2c6f21[_0x55b87f(0x23a)]?Number(_0x2c6f21[_0x55b87f(0x23a)]):undefined,_0x171804=_0x2c6f21['temperature']?Number(_0x2c6f21[_0x55b87f(0x263)]):undefined;try{let _0x23b67f,_0x2d2f83;if(_0x138363[_0x55b87f(0x25d)]('/')){const _0x480d94=_0x138363[_0x55b87f(0x1f5)]('/');if(_0x480d94[_0x55b87f(0x29e)]===0x2){const [_0x515d8e,_0x2c3680]=_0x480d94,_0x262e74=await withSpinner(_0x55b87f(0x24f)+_0x515d8e+'\x27...',()=>_0x4c3582[_0x55b87f(0x22d)][_0x55b87f(0x1ee)](_0x515d8e),{'verbose':_0x2d5105['verbose']});_0x23b67f=_0x262e74[_0x55b87f(0x1fd)],_0x2d2f83=_0x2c3680;}else throw new SDKError(ErrorCode[_0x55b87f(0x1ea)],_0x55b87f(0x20c)+_0x138363,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x23b67f=await getProjectIdOrDefault(_0x40ed2d),_0x2d2f83=_0x138363;const _0x2bf860=await withSpinner(_0x55b87f(0x22b)+_0x2d2f83+_0x55b87f(0x25c),()=>_0x4c3582[_0x55b87f(0x22d)][_0x55b87f(0x259)]({'name':_0x2d2f83,'projectId':_0x23b67f,'modelType':_0x42fdce,'systemPrompt':_0x5f1eb0,'starterMessage':_0x1413dd,'maxToolIterations':_0x599d1a,'temperature':_0x171804}),{'verbose':_0x2d5105[_0x55b87f(0x27f)]});return console[_0x55b87f(0x224)](_0x55b87f(0x22e)+_0x2bf860[_0x55b87f(0x1fd)]['id']),await handleSDKOutput([_0x2bf860[_0x55b87f(0x1fd)]],_0x2d5105),0x0;}catch(_0x16da38){return handleSDKError(_0x16da38,_0x2d5105),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x1ec);[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x24b);async[a25_0x59ba4d(0x208)](_0x7f472){const _0x101ced=a25_0x59ba4d,{options:_0x54145f,args:_0xaf345f,tdx:_0xd76960}=_0x7f472;if(_0xaf345f[_0x101ced(0x29e)]===0x0)return console['error'](_0x101ced(0x236)),console[_0x101ced(0x222)](_0x101ced(0x245)),0x1;const _0x1509d1=_0xaf345f[0x0],_0x30d870=_0x54145f,_0x1d60c0=_0x30d870[_0x101ced(0x212)],_0x3aabae=_0x30d870[_0x101ced(0x233)],_0x193025=_0x30d870[_0x101ced(0x271)],_0x22d6eb=_0x30d870['starterMessage'];if(!_0x1d60c0&&!_0x3aabae&&!_0x193025&&!_0x22d6eb)return console[_0x101ced(0x222)](_0x101ced(0x283)),console[_0x101ced(0x222)](_0x101ced(0x290)),0x1;try{const _0x568d27=await getProjectIdOrDefault(_0x7f472),_0x2d486a=await withSpinner(_0x101ced(0x1f6)+_0x1509d1+'\x27...',()=>_0xd76960[_0x101ced(0x22d)]['resolveAgentId'](_0x1509d1,_0x568d27),{'verbose':_0x54145f[_0x101ced(0x27f)]}),_0x2cfce4=_0x2d486a[_0x101ced(0x1fd)],_0x27cef5=await withSpinner(_0x101ced(0x217),()=>_0xd76960[_0x101ced(0x22d)][_0x101ced(0x293)](_0x2cfce4,{'name':_0x1d60c0,'prompt':_0x3aabae,'description':_0x193025,'starterMessage':_0x22d6eb}),{'verbose':_0x54145f[_0x101ced(0x27f)]});return console['log'](_0x101ced(0x26f)+_0x27cef5[_0x101ced(0x1fd)]['id']),await handleSDKOutput([_0x27cef5[_0x101ced(0x1fd)]],_0x54145f),0x0;}catch(_0x39dcb0){return handleSDKError(_0x39dcb0,_0x54145f),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x1e5);['description']=a25_0x59ba4d(0x221);async[a25_0x59ba4d(0x208)](_0xae2a4c){const _0x416b89=a25_0x59ba4d,{options:_0x5d9694,args:_0x140c44,tdx:_0x58f940}=_0xae2a4c;if(_0x140c44[_0x416b89(0x29e)]===0x0)return console[_0x416b89(0x222)](_0x416b89(0x236)),console['error'](_0x416b89(0x215)),0x1;const _0x2edcb8=_0x140c44[0x0];try{const _0x3bba2c=await getProjectIdOrDefault(_0xae2a4c),_0x28676c=await withSpinner('Resolving\x20agent\x20\x27'+_0x2edcb8+_0x416b89(0x25c),()=>_0x58f940[_0x416b89(0x22d)][_0x416b89(0x266)](_0x2edcb8,_0x3bba2c),{'verbose':_0x5d9694[_0x416b89(0x27f)]}),_0x4f6a8d=_0x28676c['data'];return await withSpinner('Deleting\x20agent...',()=>_0x58f940[_0x416b89(0x22d)][_0x416b89(0x205)](_0x4f6a8d),{'verbose':_0x5d9694['verbose']}),console[_0x416b89(0x224)](_0x416b89(0x29f)+_0x4f6a8d),0x0;}catch(_0x430704){return handleSDKError(_0x430704,_0x5d9694),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']='llm:history';[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x272);async[a25_0x59ba4d(0x208)](_0x1b322e){const _0x2dbbe0=a25_0x59ba4d;return executeChatHistoryCommand(_0x1b322e,_0x2dbbe0(0x235));}}export class LLMUseCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x296);[a25_0x59ba4d(0x271)]='Set\x20current\x20project\x20context';async[a25_0x59ba4d(0x208)](_0x96f132){const _0x2b2702=a25_0x59ba4d,{options:_0xfdb6ed,args:_0x43970e,tdx:_0x403158}=_0x96f132;if(_0x43970e[_0x2b2702(0x29e)]===0x0)return console[_0x2b2702(0x222)](_0x2b2702(0x27a)),console[_0x2b2702(0x222)](_0x2b2702(0x294)),0x1;const _0x58f9d7=_0x43970e[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x58f9d7+_0x2b2702(0x25c),()=>_0x403158[_0x2b2702(0x22d)][_0x2b2702(0x260)](_0x58f9d7),{'verbose':_0xfdb6ed['verbose']}),console[_0x2b2702(0x224)](_0x2b2702(0x2a3)+_0x58f9d7),0x0;}catch(_0x1581d2){return handleSDKError(_0x1581d2,_0xfdb6ed),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x2a7);['description']=a25_0x59ba4d(0x28f);async[a25_0x59ba4d(0x208)](_0x278ee5){const _0x4ab840=a25_0x59ba4d,{options:_0x2c08e1,args:_0x1b8799,tdx:_0x29386e}=_0x278ee5;if(_0x1b8799[_0x4ab840(0x29e)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x4ab840(0x282)),0x1;const _0x4ead1d=_0x1b8799[0x0],_0x1a0e10=_0x2c08e1,_0x2562ce=_0x1a0e10[_0x4ab840(0x271)];try{const _0x1e2458=await withSpinner(_0x4ab840(0x220)+_0x4ead1d+_0x4ab840(0x25c),()=>_0x29386e[_0x4ab840(0x22d)]['createProject']({'name':_0x4ead1d,'description':_0x2562ce}),{'verbose':_0x2c08e1['verbose']});console[_0x4ab840(0x224)](_0x4ab840(0x2af)+_0x1e2458['data']['id']);const _0x4d4a2d=toLLMProjectInfo(_0x1e2458[_0x4ab840(0x1fd)]);return await handleSDKOutput([_0x4d4a2d],_0x2c08e1),0x0;}catch(_0x30cb86){return handleSDKError(_0x30cb86,_0x2c08e1),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a25_0x59ba4d(0x212)]=a25_0x59ba4d(0x26d);[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x262);async[a25_0x59ba4d(0x208)](_0xf38b97){const _0x13339e=a25_0x59ba4d,{options:_0x505e17,args:_0x43f68b,tdx:_0x1d8dc2}=_0xf38b97;if(_0x43f68b[_0x13339e(0x29e)]===0x0)return console[_0x13339e(0x222)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x13339e(0x222)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0xdbd1c1=_0x43f68b[0x0];try{return await withSpinner(_0x13339e(0x278)+_0xdbd1c1+_0x13339e(0x25c),()=>_0x1d8dc2[_0x13339e(0x22d)][_0x13339e(0x207)](_0xdbd1c1),{'verbose':_0x505e17[_0x13339e(0x27f)]}),console[_0x13339e(0x224)](_0x13339e(0x231)+_0xdbd1c1),0x0;}catch(_0x57cd4a){return handleSDKError(_0x57cd4a,_0x505e17),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a25_0x59ba4d(0x1e8);[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x229);async[a25_0x59ba4d(0x208)](_0x128415){const _0x3e2098=a25_0x59ba4d,{options:_0x701df9,args:_0x560be4,tdx:_0x3916fd}=_0x128415;if(_0x560be4[_0x3e2098(0x29e)]===0x0)return console[_0x3e2098(0x222)](_0x3e2098(0x27a)),console['error'](_0x3e2098(0x1e7)),0x1;const _0x30db56=_0x560be4[0x0],_0x369547=_0x701df9,_0x3ed8d1=_0x369547['output'],_0x26b5b8=_0x369547[_0x3e2098(0x24d)];try{const _0x1dbcec=_0x3ed8d1||_0x30db56+_0x3e2098(0x21d);if(a25_0x53556e['existsSync'](_0x1dbcec)&&!_0x26b5b8){if(!_0x701df9['yes']){const _0x2c86a5=await confirm(_0x3e2098(0x20d)+_0x1dbcec+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x2c86a5)return console[_0x3e2098(0x224)]('Backup\x20cancelled.'),0x0;}a25_0x53556e[_0x3e2098(0x253)](_0x1dbcec,{'recursive':!![]});}const _0x1e381a=await withSpinner(_0x26b5b8?_0x3e2098(0x28c)+_0x30db56+_0x3e2098(0x25c):_0x3e2098(0x297)+_0x30db56+_0x3e2098(0x25c),()=>_0x3916fd[_0x3e2098(0x22d)][_0x3e2098(0x299)](_0x30db56,_0x3ed8d1,{'dryRun':_0x26b5b8}),{'verbose':_0x701df9[_0x3e2098(0x27f)]}),_0x1fe03f=_0x1e381a['data'];return _0x26b5b8?console[_0x3e2098(0x224)](_0x3e2098(0x21b)+_0x1fe03f[_0x3e2098(0x291)]):console['log'](_0x3e2098(0x25f)+_0x1fe03f[_0x3e2098(0x291)]),console[_0x3e2098(0x224)](_0x3e2098(0x1e4)+_0x1fe03f[_0x3e2098(0x1eb)]['agents']),console[_0x3e2098(0x224)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1fe03f[_0x3e2098(0x1eb)][_0x3e2098(0x256)]),console[_0x3e2098(0x224)]('\x20\x20Prompts:\x20'+_0x1fe03f['counts'][_0x3e2098(0x29d)]),console[_0x3e2098(0x224)](_0x3e2098(0x1f2)+_0x1fe03f[_0x3e2098(0x1eb)][_0x3e2098(0x284)]),(_0x701df9[_0x3e2098(0x2a8)]==='json'||_0x701df9[_0x3e2098(0x2a8)]==='jsonl')&&await handleSDKOutput([_0x1fe03f],_0x701df9),0x0;}catch(_0x47d02b){return handleSDKError(_0x47d02b,_0x701df9),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{['name']=a25_0x59ba4d(0x265);[a25_0x59ba4d(0x271)]='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder';async[a25_0x59ba4d(0x208)](_0x2ab7a8){const _0x26faa5=a25_0x59ba4d,{options:_0x6ef9fc,args:_0x4defe4,tdx:_0x3669a3}=_0x2ab7a8;if(_0x4defe4['length']===0x0)return console['error']('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console['error'](_0x26faa5(0x219)),0x1;const _0x1ccf8a=_0x4defe4[0x0],_0x4614c7=_0x6ef9fc,_0x3a385c=_0x4614c7[_0x26faa5(0x212)],_0xe6d557=_0x4614c7[_0x26faa5(0x24d)];try{if(!_0xe6d557){const _0x397a29=_0x3669a3[_0x26faa5(0x22d)][_0x26faa5(0x23b)](_0x1ccf8a),_0x559877=_0x3a385c||_0x397a29[_0x26faa5(0x206)][_0x26faa5(0x20e)],_0x3fc05c=await withSpinner(_0x26faa5(0x200),()=>_0x3669a3[_0x26faa5(0x22d)]['projects'](),{'verbose':_0x6ef9fc[_0x26faa5(0x27f)]}),_0x12cb71=_0x3fc05c[_0x26faa5(0x1fd)][_0x26faa5(0x21e)](_0x40c13c=>_0x40c13c[_0x26faa5(0x21f)][_0x26faa5(0x212)]===_0x559877);if(_0x12cb71&&!_0x6ef9fc[_0x26faa5(0x2ae)]){const _0x22db2d=await confirm(_0x26faa5(0x249)+_0x559877+_0x26faa5(0x234));if(!_0x22db2d)return console['log'](_0x26faa5(0x274)),0x0;}}const _0x3b153a=await withSpinner(_0xe6d557?_0x26faa5(0x20f)+_0x1ccf8a+_0x26faa5(0x25c):'Restoring\x20project\x20from\x20\x27'+_0x1ccf8a+_0x26faa5(0x25c),()=>_0x3669a3[_0x26faa5(0x22d)][_0x26faa5(0x269)](_0x1ccf8a,{'name':_0x3a385c,'dryRun':_0xe6d557}),{'verbose':_0x6ef9fc[_0x26faa5(0x27f)]}),_0xba72bf=_0x3b153a[_0x26faa5(0x1fd)];return _0xba72bf[_0x26faa5(0x295)]&&console[_0x26faa5(0x224)](_0x26faa5(0x2a6)+_0xba72bf[_0x26faa5(0x295)]+'\x27'),_0xe6d557?console[_0x26faa5(0x224)](_0x26faa5(0x24c)+_0xba72bf['projectName']):console[_0x26faa5(0x224)](_0x26faa5(0x20a)+_0xba72bf['projectName']+'\x20('+_0xba72bf['projectId']+')'),console[_0x26faa5(0x224)](_0x26faa5(0x1e4)+_0xba72bf[_0x26faa5(0x1eb)][_0x26faa5(0x241)]),console[_0x26faa5(0x224)](_0x26faa5(0x273)+_0xba72bf[_0x26faa5(0x1eb)][_0x26faa5(0x256)]),console[_0x26faa5(0x224)]('\x20\x20Prompts:\x20'+_0xba72bf['counts'][_0x26faa5(0x29d)]),console[_0x26faa5(0x224)](_0x26faa5(0x1f2)+_0xba72bf[_0x26faa5(0x1eb)]['integrations']),(_0x6ef9fc[_0x26faa5(0x2a8)]==='json'||_0x6ef9fc[_0x26faa5(0x2a8)]==='jsonl')&&await handleSDKOutput([_0xba72bf],_0x6ef9fc),0x0;}catch(_0x567365){return handleSDKError(_0x567365,_0x6ef9fc),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x1a890b,_0x514e5f){const _0x3e52c2=a25_0x59ba4d,_0x165214=_0x514e5f[_0x3e52c2(0x216)]||CHAT_SELECTOR_PAGE_SIZE;let _0x26d77b=0x0,_0xa32a59=[];const _0x14ebca=(await import(_0x3e52c2(0x29d)))[_0x3e52c2(0x28b)],_0x5f23f1=getChalk(_0x514e5f);while(!![]){const _0x5e1722=await withSpinner(_0x3e52c2(0x292),()=>_0x1a890b[_0x3e52c2(0x22d)][_0x3e52c2(0x1fc)](_0x165214+_0x26d77b),{'verbose':_0x514e5f['verbose']});_0xa32a59=_0x5e1722[_0x3e52c2(0x1fd)];const _0x2df2c=_0xa32a59[_0x3e52c2(0x25e)](_0x26d77b,_0x26d77b+_0x165214),_0x5d3702=_0xa32a59[_0x3e52c2(0x29e)]>_0x26d77b+_0x165214,_0x449bfd=[...new Set(_0x2df2c[_0x3e52c2(0x23f)](_0x1fc22b=>_0x1fc22b[_0x3e52c2(0x21f)][_0x3e52c2(0x268)])[_0x3e52c2(0x279)](_0xcb605=>_0xcb605!==undefined))],_0x37e059=new Map();await Promise[_0x3e52c2(0x2ab)](_0x449bfd[_0x3e52c2(0x23f)](async _0x5ec409=>{const _0x73f078=_0x3e52c2;try{const _0x53a550=await _0x1a890b[_0x73f078(0x22d)][_0x73f078(0x250)](_0x5ec409);_0x37e059[_0x73f078(0x26c)](_0x5ec409,_0x53a550['attributes'][_0x73f078(0x212)]);}catch{_0x37e059[_0x73f078(0x26c)](_0x5ec409,_0x5ec409);}}));const _0x94f9d1=_0x2df2c['map'](_0x529303=>{const _0x568762=_0x3e52c2,_0x24b40e=_0x529303[_0x568762(0x21f)][_0x568762(0x26b)]||_0x568762(0x258),_0x163800=_0x24b40e[_0x568762(0x1f5)]('\x0a')[0x0],_0x1c46e1=_0x163800[_0x568762(0x29e)]>0x50?_0x163800['substring'](0x0,0x4d)+_0x568762(0x23d):_0x163800,_0x18b4e4=_0x529303[_0x568762(0x21f)][_0x568762(0x268)]?_0x37e059[_0x568762(0x1e9)](_0x529303['attributes'][_0x568762(0x268)])||_0x529303[_0x568762(0x21f)][_0x568762(0x268)]:_0x568762(0x270),_0x321b7=_0x529303['attributes'][_0x568762(0x239)]||_0x529303['attributes'][_0x568762(0x244)],_0x5ee26d=new Date(_0x321b7),_0x3a8f1a=new Date(),_0x2497b3=_0x3a8f1a['getTime']()-_0x5ee26d[_0x568762(0x204)](),_0xe7f37c=Math['floor'](_0x2497b3/0xea60),_0x1e45d2=Math[_0x568762(0x23e)](_0x2497b3/0x36ee80),_0x5369f9=Math['floor'](_0x2497b3/0x5265c00);let _0x21dcd2;if(_0xe7f37c<0x1)_0x21dcd2=_0x568762(0x238);else{if(_0xe7f37c<0x3c)_0x21dcd2=_0xe7f37c+_0x568762(0x2b0);else{if(_0x1e45d2<0x18)_0x21dcd2=_0x1e45d2+_0x568762(0x289);else _0x5369f9<0x7?_0x21dcd2=_0x5369f9+_0x568762(0x202):_0x21dcd2=_0x5ee26d['toLocaleDateString'](_0x568762(0x2a0),{'month':'short','day':'numeric'});}}return{'title':_0x1c46e1+'\x20'+_0x5f23f1[_0x568762(0x1f0)]('['+_0x18b4e4+']\x20'+_0x21dcd2),'value':_0x529303['id']};});_0x5d3702&&_0x94f9d1['push']({'title':_0x5f23f1['cyan'](_0x3e52c2(0x275)),'value':_0x3e52c2(0x226)});const _0x7a262c=await _0x14ebca({'type':_0x3e52c2(0x1fb),'name':'chatId','message':_0x3e52c2(0x209),'choices':_0x94f9d1,'hint':_0x3e52c2(0x285)});if(!_0x7a262c[_0x3e52c2(0x213)])return undefined;if(_0x7a262c[_0x3e52c2(0x213)]===_0x3e52c2(0x226)){_0x26d77b+=_0x165214;continue;}return _0x7a262c[_0x3e52c2(0x213)];}}export class ChatsCommand extends BaseCommand{[a25_0x59ba4d(0x212)]='chats';[a25_0x59ba4d(0x271)]=a25_0x59ba4d(0x252);async[a25_0x59ba4d(0x208)](_0xabe4bd){const _0x141cb5=a25_0x59ba4d;return executeChatHistoryCommand(_0xabe4bd,_0x141cb5(0x22f));}}
@@ -1 +1 @@
1
- const a26_0x3c7251=a26_0x5b58;(function(_0x1e0748,_0x30005e){const _0x5a2deb=a26_0x5b58,_0x2f30e4=_0x1e0748();while(!![]){try{const _0x303dc6=-parseInt(_0x5a2deb(0x19e))/0x1+-parseInt(_0x5a2deb(0x1b5))/0x2*(-parseInt(_0x5a2deb(0x17f))/0x3)+parseInt(_0x5a2deb(0x19d))/0x4*(parseInt(_0x5a2deb(0x17b))/0x5)+parseInt(_0x5a2deb(0x193))/0x6*(-parseInt(_0x5a2deb(0x1a2))/0x7)+parseInt(_0x5a2deb(0x180))/0x8+-parseInt(_0x5a2deb(0x179))/0x9*(-parseInt(_0x5a2deb(0x17e))/0xa)+-parseInt(_0x5a2deb(0x1af))/0xb;if(_0x303dc6===_0x30005e)break;else _0x2f30e4['push'](_0x2f30e4['shift']());}catch(_0x54d94e){_0x2f30e4['push'](_0x2f30e4['shift']());}}}(a26_0x1b44,0x9052f));import a26_0x49ac94 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a26_0x5b58(_0xdd951e,_0x27b89d){_0xdd951e=_0xdd951e-0x173;const _0x1b44b1=a26_0x1b44();let _0x5b5817=_0x1b44b1[_0xdd951e];return _0x5b5817;}function a26_0x1b44(){const _0x2d8348=['765685yisGkS','yellow','Starting\x20proxy\x20server...','1013730nQcOmS','33INocYk','4064048aVAMlm','created\x20on-demand\x20per\x20model','Project\x20\x27','http://0.0.0.0:','\x20\x20}','\x0aTesting\x20with\x20Agent\x20SDK:','description','SIGINT','find','start','exit','execute','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','Server\x20Configuration:','\x0a\x0aShutting\x20down\x20proxy\x20server...','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','init','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','attributes','1890HUdPBN','SIGTERM','site','name','\x0aClaude\x20Code\x20Configuration:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','white','bold','Resolving\x20project...','log','12rFTDvP','59247WbSoVO','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','llm:proxy','✓\x20Proxy\x20server\x20stopped','8953bwWAii','port','green','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20\x20\x20}','NOT_FOUND','Port\x20','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20Address:','\x20\x20\x20\x20\x22env\x22:\x20{','logLevel','dim','project','14531231GsDDZA','logger','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','close','cyan','server','108346gEbikD','stop','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20Site:','\x20\x20{','llm','72umTKOl','projects'];a26_0x1b44=function(){return _0x2d8348;};return a26_0x1b44();}import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x543537,_0x2b7bb0){const _0x31b3f4=a26_0x5b58,{tdx:_0x385509,options:_0x59adbc}=_0x543537,_0x14444b=_0x2b7bb0||_0x59adbc['llmProject'];if(_0x14444b){const _0x223604=await _0x385509[_0x31b3f4(0x178)][_0x31b3f4(0x17a)](),_0x530885=_0x223604[_0x31b3f4(0x188)](_0x4e803e=>_0x4e803e[_0x31b3f4(0x192)]['name']===_0x14444b);if(!_0x530885)throw new SDKError(ErrorCode[_0x31b3f4(0x1a7)],_0x31b3f4(0x182)+_0x14444b+'\x27\x20not\x20found',undefined,{'helpText':_0x31b3f4(0x1a5)});return _0x530885['id'];}const _0x294923=await _0x385509['llm']['getOrCreateDefaultProject']();return _0x294923['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a26_0x3c7251(0x1a0);[a26_0x3c7251(0x186)]=a26_0x3c7251(0x175);[a26_0x3c7251(0x1b4)];[a26_0x3c7251(0x1b0)];async[a26_0x3c7251(0x18b)](_0x4b1b48){const _0x11bdfb=a26_0x3c7251,{tdx:_0x1d7823,options:_0x475888}=_0x4b1b48;try{const _0x4f8480=_0x475888,_0x5e80e6=_0x4f8480[_0x11bdfb(0x1a3)]||0xfa0,_0xc6bf76=_0x4f8480[_0x11bdfb(0x1ae)],_0x4de51d=await findAvailablePort(_0x5e80e6);console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x19b)));const _0x2db1e7=await getProjectIdOrDefault(_0x4b1b48,_0xc6bf76),_0x1d8eac=await _0x1d7823[_0x11bdfb(0x178)][_0x11bdfb(0x17a)](),_0x143f3c=_0x1d8eac['find'](_0x4e051e=>_0x4e051e['id']===_0x2db1e7);this[_0x11bdfb(0x1b0)]=new TDXLogger(_0x475888[_0x11bdfb(0x1ac)]),await this[_0x11bdfb(0x1b0)][_0x11bdfb(0x190)](),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x17d)));_0x4de51d!==_0x5e80e6&&console['log'](a26_0x49ac94['yellow'](_0x11bdfb(0x1a8)+_0x5e80e6+'\x20is\x20unavailable,\x20using\x20port\x20'+_0x4de51d));this[_0x11bdfb(0x1b4)]=new ProxyServer({'port':_0x4de51d,'projectId':_0x2db1e7,'tdx':_0x1d7823,'logger':this[_0x11bdfb(0x1b0)],'site':_0x475888[_0x11bdfb(0x195)]}),await this[_0x11bdfb(0x1b4)][_0x11bdfb(0x189)](),console['log'](a26_0x49ac94[_0x11bdfb(0x17c)]['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x11bdfb(0x19c)](a26_0x49ac94['yellow'](_0x11bdfb(0x18f))),console[_0x11bdfb(0x19c)](a26_0x49ac94['yellow'](_0x11bdfb(0x174))),console[_0x11bdfb(0x19c)](a26_0x49ac94['green'][_0x11bdfb(0x19a)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1b3)](_0x11bdfb(0x18d))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x1aa)),a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x183)+_0x4de51d)),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)]('\x20\x20Project:'),a26_0x49ac94['white'](_0x143f3c?.['attributes'][_0x11bdfb(0x196)]||_0x2db1e7)),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)]('\x20\x20Agents:'),a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x181))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x176)),a26_0x49ac94[_0x11bdfb(0x199)](_0x475888[_0x11bdfb(0x195)])),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1b3)](_0x11bdfb(0x197))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x19f))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x177))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x1ab))),console['log'](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x191)+_0x4de51d+'\x22,')),console[_0x11bdfb(0x19c)](a26_0x49ac94['white'](_0x11bdfb(0x198))),console[_0x11bdfb(0x19c)](a26_0x49ac94['white'](_0x11bdfb(0x1a6))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x199)](_0x11bdfb(0x184))),console['log'](a26_0x49ac94['cyan'](_0x11bdfb(0x185))),console['log'](a26_0x49ac94[_0x11bdfb(0x1ad)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x18c))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x1ad)](_0x11bdfb(0x1a9))),console[_0x11bdfb(0x19c)](a26_0x49ac94[_0x11bdfb(0x17c)](_0x11bdfb(0x1b1)));const _0x49c09f=async()=>{const _0x426f68=_0x11bdfb;console[_0x426f68(0x19c)](a26_0x49ac94[_0x426f68(0x1ad)](_0x426f68(0x18e))),this[_0x426f68(0x1b4)]&&await this[_0x426f68(0x1b4)][_0x426f68(0x173)](),this[_0x426f68(0x1b0)]&&await this[_0x426f68(0x1b0)][_0x426f68(0x1b2)](),console[_0x426f68(0x19c)](a26_0x49ac94[_0x426f68(0x1a4)](_0x426f68(0x1a1))),process[_0x426f68(0x18a)](0x0);};return process['on'](_0x11bdfb(0x187),_0x49c09f),process['on'](_0x11bdfb(0x194),_0x49c09f),await new Promise(()=>{}),0x0;}catch(_0x51dc52){this[_0x11bdfb(0x1b4)]&&await this[_0x11bdfb(0x1b4)][_0x11bdfb(0x173)]();this['logger']&&await this[_0x11bdfb(0x1b0)][_0x11bdfb(0x1b2)]();throw _0x51dc52;}}}
1
+ const a26_0x4305ea=a26_0x2cbb;(function(_0x1fbd70,_0xb74230){const _0x5080b0=a26_0x2cbb,_0x370cec=_0x1fbd70();while(!![]){try{const _0x5c3062=-parseInt(_0x5080b0(0xd4))/0x1*(parseInt(_0x5080b0(0xa8))/0x2)+parseInt(_0x5080b0(0xa0))/0x3+-parseInt(_0x5080b0(0xdc))/0x4+parseInt(_0x5080b0(0xc0))/0x5*(-parseInt(_0x5080b0(0xb7))/0x6)+-parseInt(_0x5080b0(0xb9))/0x7*(parseInt(_0x5080b0(0xb5))/0x8)+-parseInt(_0x5080b0(0xda))/0x9+-parseInt(_0x5080b0(0xaf))/0xa*(-parseInt(_0x5080b0(0xa4))/0xb);if(_0x5c3062===_0xb74230)break;else _0x370cec['push'](_0x370cec['shift']());}catch(_0x18129e){_0x370cec['push'](_0x370cec['shift']());}}}(a26_0x4631,0x28585));function a26_0x4631(){const _0x3cbd97=['Project\x20\x27','white','21TaXdtY','✓\x20Proxy\x20server\x20stopped','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x20\x20\x20\x20}','Resolving\x20project...','2621601xrqNhk','name','386760XSifol','cyan','llm','find','\x20is\x20unavailable,\x20using\x20port\x20','green','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20}','849378crXKEi','exit','port','llmProject','682110nuZpoo','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','yellow','9990pPMCdN','llm:proxy','SIGINT','created\x20on-demand\x20per\x20model','\x20\x20Site:','close','project','160UrAOrC','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','log','SIGTERM','Server\x20Configuration:','1880ZwkjCk','\x20\x20Agents:','7608auRqBf','\x20\x20\x20\x20\x22env\x22:\x20{','9583eTUQKm','getOrCreateDefaultProject','site','dim','logger','bold','init','1165pkHceD','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','description','stop','\x20\x20{','projects','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','\x0aTesting\x20with\x20Agent\x20SDK:','\x0aClaude\x20Code\x20Configuration:','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','Port\x20','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','logLevel','\x27\x20not\x20found','\x20\x20Address:','attributes','server'];a26_0x4631=function(){return _0x3cbd97;};return a26_0x4631();}import a26_0x36240e from'chalk';function a26_0x2cbb(_0x175973,_0x3c2d8a){_0x175973=_0x175973-0x99;const _0x46313f=a26_0x4631();let _0x2cbb10=_0x46313f[_0x175973];return _0x2cbb10;}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(_0x4ef6a2,_0x13966a){const _0x73005f=a26_0x2cbb,{tdx:_0x2c2c46,options:_0x338510}=_0x4ef6a2,_0x37baf8=_0x13966a||_0x338510[_0x73005f(0xa3)];if(_0x37baf8){const _0x189edf=await _0x2c2c46['llm'][_0x73005f(0xc5)](),_0x28897b=_0x189edf[_0x73005f(0x9b)](_0x1dbc8b=>_0x1dbc8b[_0x73005f(0xd0)][_0x73005f(0xdb)]===_0x37baf8);if(!_0x28897b)throw new SDKError(ErrorCode['NOT_FOUND'],_0x73005f(0xd2)+_0x37baf8+_0x73005f(0xce),undefined,{'helpText':_0x73005f(0xc9)});return _0x28897b['id'];}const _0x3cb8af=await _0x2c2c46[_0x73005f(0x9a)][_0x73005f(0xba)]();return _0x3cb8af['id'];}export class LLMProxyCommand extends BaseCommand{[a26_0x4305ea(0xdb)]=a26_0x4305ea(0xa9);[a26_0x4305ea(0xc2)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a26_0x4305ea(0xd1)];['logger'];async['execute'](_0x171e01){const _0x4a6b14=a26_0x4305ea,{tdx:_0x2223ce,options:_0x4ecaf2}=_0x171e01;try{const _0x1e0fcd=_0x4ecaf2,_0x1e6359=_0x1e0fcd[_0x4a6b14(0xa2)]||0xfa0,_0x105dca=_0x1e0fcd[_0x4a6b14(0xae)],_0x37de82=await findAvailablePort(_0x1e6359);console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xd9)));const _0x22264f=await getProjectIdOrDefault(_0x171e01,_0x105dca),_0x39b97c=await _0x2223ce[_0x4a6b14(0x9a)]['projects'](),_0x8d0a9a=_0x39b97c[_0x4a6b14(0x9b)](_0x5b4a26=>_0x5b4a26['id']===_0x22264f);this[_0x4a6b14(0xbd)]=new TDXLogger(_0x4ecaf2[_0x4a6b14(0xcd)]),await this[_0x4a6b14(0xbd)][_0x4a6b14(0xbf)](),console[_0x4a6b14(0xb2)](a26_0x36240e['dim']('Starting\x20proxy\x20server...'));_0x37de82!==_0x1e6359&&console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xcb)+_0x1e6359+_0x4a6b14(0x9c)+_0x37de82));this['server']=new ProxyServer({'port':_0x37de82,'projectId':_0x22264f,'tdx':_0x2223ce,'logger':this[_0x4a6b14(0xbd)],'site':_0x4ecaf2[_0x4a6b14(0xbb)]}),await this['server']['start'](),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xa7)]['bold'](_0x4a6b14(0xa6))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xa5))),console['log'](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xcc))),console['log'](a26_0x36240e['green'][_0x4a6b14(0xbe)](_0x4a6b14(0xd7))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0x99)](_0x4a6b14(0xb4))),console['log'](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xcf)),a26_0x36240e['white']('http://0.0.0.0:'+_0x37de82)),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)]('\x20\x20Project:'),a26_0x36240e[_0x4a6b14(0xd3)](_0x8d0a9a?.['attributes'][_0x4a6b14(0xdb)]||_0x22264f)),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xb6)),a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xab))),console['log'](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xac)),a26_0x36240e[_0x4a6b14(0xd3)](_0x4ecaf2[_0x4a6b14(0xbb)])),console['log'](a26_0x36240e[_0x4a6b14(0x99)](_0x4a6b14(0xc8))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xc1))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xc4))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xb8))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xb1)+_0x37de82+'\x22,')),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xc6))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xd8))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0x9f))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0x99)](_0x4a6b14(0xc7))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xca))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console['log'](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xd6))),console['log'](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xb0)));const _0x4e6c31=async()=>{const _0x510e84=_0x4a6b14;console[_0x510e84(0xb2)](a26_0x36240e[_0x510e84(0xbc)](_0x510e84(0x9e))),this['server']&&await this[_0x510e84(0xd1)][_0x510e84(0xc3)](),this[_0x510e84(0xbd)]&&await this[_0x510e84(0xbd)][_0x510e84(0xad)](),console['log'](a26_0x36240e[_0x510e84(0x9d)](_0x510e84(0xd5))),process[_0x510e84(0xa1)](0x0);};return process['on'](_0x4a6b14(0xaa),_0x4e6c31),process['on'](_0x4a6b14(0xb3),_0x4e6c31),await new Promise(()=>{}),0x0;}catch(_0x1da363){this[_0x4a6b14(0xd1)]&&await this[_0x4a6b14(0xd1)]['stop']();this['logger']&&await this[_0x4a6b14(0xbd)][_0x4a6b14(0xad)]();throw _0x1da363;}}}
@@ -1 +1 @@
1
- const a27_0x5f1085=a27_0xa2d9;(function(_0x49da18,_0x3fb43f){const _0x4ab8c8=a27_0xa2d9,_0x2eb221=_0x49da18();while(!![]){try{const _0x1fcfd3=parseInt(_0x4ab8c8(0x1c3))/0x1*(parseInt(_0x4ab8c8(0x23b))/0x2)+-parseInt(_0x4ab8c8(0x233))/0x3+-parseInt(_0x4ab8c8(0x247))/0x4*(parseInt(_0x4ab8c8(0x1e3))/0x5)+parseInt(_0x4ab8c8(0x24b))/0x6*(parseInt(_0x4ab8c8(0x254))/0x7)+-parseInt(_0x4ab8c8(0x217))/0x8*(-parseInt(_0x4ab8c8(0x1f9))/0x9)+-parseInt(_0x4ab8c8(0x19e))/0xa+parseInt(_0x4ab8c8(0x1f1))/0xb;if(_0x1fcfd3===_0x3fb43f)break;else _0x2eb221['push'](_0x2eb221['shift']());}catch(_0x328920){_0x2eb221['push'](_0x2eb221['shift']());}}}(a27_0x1165,0xed1e0));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0xf7f5a 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';function a27_0xa2d9(_0x1debd4,_0xc9f7a1){_0x1debd4=_0x1debd4-0x17f;const _0x1165e2=a27_0x1165();let _0xa2d940=_0x1165e2[_0x1debd4];return _0xa2d940;}import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x4111a0 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0x5f1085(0x182),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x314752){const _0xff2fa4=a27_0x5f1085,_0x16e93c=process[_0xff2fa4(0x1a6)],_0x541f2a=_0x16e93c==='darwin'?_0xff2fa4(0x18a):_0x16e93c===_0xff2fa4(0x1a1)?_0xff2fa4(0x1ab):_0xff2fa4(0x22d);spawn(_0x541f2a,[_0x314752],{'detached':!![],'stdio':_0xff2fa4(0x1a7)})[_0xff2fa4(0x286)]();}function sanitizeFileName(_0xa8100a){const _0x3d7cf4=a27_0x5f1085;return _0xa8100a[_0x3d7cf4(0x240)]()[_0x3d7cf4(0x1cb)](/[/\\:*?"<>|]/g,'-')[_0x3d7cf4(0x1cb)](/\s+/g,'-')['replace'](/-+/g,'-')['replace'](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0x12b5dd=a27_0x5f1085;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2f5778=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2f5778[_0x12b5dd(0x1c6)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x12b5dd(0x1bf)](a27_0x4111a0[_0x12b5dd(0x261)](_0x12b5dd(0x206)+LEGACY_PARENT_SEGMENT_DIR+_0x12b5dd(0x204)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x12b5dd(0x1bf)](a27_0x4111a0[_0x12b5dd(0x186)](_0x12b5dd(0x20d)+LEGACY_PARENT_SEGMENT_DIR+_0x12b5dd(0x1f4))),![];console['error'](a27_0x4111a0[_0x12b5dd(0x261)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x12b5dd(0x1fd)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x12b5dd(0x1bf)](a27_0x4111a0[_0x12b5dd(0x1de)](_0x12b5dd(0x265)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x15deb9){const _0x43ee4b=_0x15deb9 instanceof Error?_0x15deb9[_0x12b5dd(0x276)]:String(_0x15deb9);return console['error'](a27_0x4111a0[_0x12b5dd(0x258)](_0x12b5dd(0x299)+_0x43ee4b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0x5f1085(0x1a4)](_0x422960){const _0x47d199=a27_0x5f1085;return migrateLegacyDirectory(),super[_0x47d199(0x1a4)](_0x422960);}}function resolveYamlFile(_0x3ffa22){const _0x3be30b=a27_0x5f1085;if(_0x3ffa22[_0x3be30b(0x275)](_0x3be30b(0x18b))||_0x3ffa22[_0x3be30b(0x275)](_0x3be30b(0x199)))return _0x3ffa22;return a27_0xf7f5a[_0x3be30b(0x295)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3ffa22)+_0x3be30b(0x18b));}function a27_0x1165(){const _0x41dcae=['table','No\x20parent\x20segments\x20match\x20pattern:\x20','validateParentYaml','utf-8','xdg-open','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','label','cyan','map','population','3339231tJOcKC','stats','data','description','displayBehaviorsStats','repeat','\x27\x20and\x20run\x20workflow?','Error:\x20--database\x20and\x20--table\x20are\x20required','444646NrpLwr','\x20Opening\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','trim','\x20--interval\x20','toLowerCase','attributes','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','No\x20parent\x20segments\x20found','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','segment:parent:sql','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','3542192xNKFKe','behaviorsFile','segment:parent:preview','segment:parent:validate','6SpdxcE','all','allValid','execute','behaviors','\x0aUsage:\x20tdx\x20ps\x20preview\x20','segment:parent:show','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','Executing\x20parent\x20segment\x20query...','4283342akJuTe','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Fetching\x20SQL\x20for\x20\x27','rowCount','red','Preview:','Validate:','varchar','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','elapsedTimeMillis','\x20tdx\x20wf\x20attempt\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x27...','yellow','Aborted.','Status:','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','✔\x20Renamed\x20directory\x20to\x20','\x0aNew\x20parent\x20segment\x20\x27','scheduleType','Join:','totalEvents','enriched','\x27\x20is\x20already\x20up\x20to\x20date','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20\x20No\x20sample\x20data\x20available','customerPercent','Resolving\x20parent\x20segment\x20\x27','output','\x20--enriched','Fetching\x20sample\x20data...','\x0a✔\x20Workflow\x20started','Apply\x20changes\x20to\x20\x27','endsWith','message','Found\x20YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','previewParentYaml','workflowAttemptId','Error:','workflowSessionId','segment:parent:create','yes','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','displayPreviewHints','Available\x20behaviors:','Get\x20SQL\x20query\x20for\x20parent\x20segment','foreignKey','segment:parent:run','sort','unref','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','listFields','\x20=\x20','segment:parent:update','\x20\x20\x20\x20-\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','addAttributes','Events:','master','Pattern:\x20','behavior','Error:\x20File\x20not\x20found:\x20','length','✔\x20Created\x20parent\x20segment\x20\x27','join','createParent','string','match','✘\x20Failed\x20to\x20rename\x20directory:\x20','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','Name:\x20','apply','\x20field','Table:\x20','Behavior:','test','number','YAML\x20file:\x20','Attempt:','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','parent_segments','getParentFull','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','✔\x20Updated\x20parent\x20segment\x20\x27','dim','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20[Job\x20ID:\x20','Error\x20parsing\x20YAML:\x20','open','.yml','log','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','displayPreviewResults','site','use','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','parentSegment','Site:\x20','pushParentYaml','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','displayColumns','Columns:','Parent\x20segment:\x20','.yaml','customerGroupFile','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20Configuration\x20is\x20valid','To\x20view\x20sample\x20data:','1137040pTeIzd','name','%)\x20','win32','Output\x20file:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','run','displayValidateResults','platform','ignore','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','verbose','jobId','start','\x27\x20with\x20ID:\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','schemaValid','interval','attribute','text','SQL\x20query:\x0a','Listing\x20fields\x20for\x20\x27','\x20No\x20changes\x20-\x20','toFixed','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','parent_segment','using\x20the\x20default\x20path:\x20','stop','limit','/sessions/','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','updateParent','Updated','error','\x20rows\x20','resolveParentId','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','1YQGMpL','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','dirname','isDirectory','/app/workflows/','`\x20to\x20download\x20the\x20configuration\x20first','Available\x20attributes:','sampleData','replace','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Errors:','Source:','toLocaleString','schemaError','\x20rows)','coveragePercent','Fetching\x20current\x20configuration\x20for\x20\x27','matchedCount','customerGroup','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','setJobId','query','segment:parent:list','preview','Listing\x20parent\x20segments\x20matching\x20\x27','✔\x20Found\x20','Enriched:','green','jsonl','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','\x20--behavior\x20\x22','✔\x20Query\x20completed:\x20Processed\x20','5wdViDS','\x20--attribute\x20\x22','List\x20parent\x20segments','Analyzing\x20changes...','Fetching\x20parent\x20segment\x20\x27','\x20--attribute\x20\x22<name>\x22','format','Behaviors','Create\x20parent\x20segment\x20\x27','\x20parent\x20segment','\x20Context\x20set:\x20','audienceId','\x20is\x20already\x20up\x20to\x20date','Join\x20on:','22098846rVIXFd','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','displaySummary','/\x20directory.\x0a','Overwrite\x20\x27','keys','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','9EfwvIK','\x0aChanges\x20to\x20\x27','attributesFile','addBehaviorsFile','/\x20→\x20','processedRows','json','column','\x5c$&','bold','web','/\x20and\x20','tdx\x20segment\x20parent\x20preview\x20','\x0a⚠️\x20\x20Both\x20','Created','displaySampleData','timezone','customersWithEvents','scheduleOption','segment','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','joinKey','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','errors','status','Creating','displayAttributesStats','Options:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Master:','1922768HZTkMa','displayMasterInfo','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','database','✔\x20No\x20changes\x20-\x20\x27','getParentSQL','segment:parent:view','👥\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','\x20kill','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','segment:parent:push','\x20parent\x20segment\x20\x27','Error\x20reading\x20file:\x20','SELECT\x20*\x20FROM\x20(\x0a','Customers:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'];a27_0x1165=function(){return _0x41dcae;};return a27_0x1165();}function formatProgressMessage(_0x13513a){const _0xb61e=a27_0x5f1085,_0xd24c10=_0x13513a[_0xb61e(0x298)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xd24c10){const [,_0x4948ee,_0x3fb79,_0x4866f8='']=_0xd24c10;return a27_0x4111a0[_0xb61e(0x186)](_0x4948ee+':')+'\x20'+_0x3fb79+a27_0x4111a0[_0xb61e(0x186)](_0x4866f8);}return a27_0x4111a0['dim'](_0x13513a);}function showFileNotFoundError(_0x3bb1d7,_0x34f1fc){const _0x2de45e=a27_0x5f1085;console[_0x2de45e(0x1bf)](a27_0x4111a0[_0x2de45e(0x258)](_0x2de45e(0x292)+_0x3bb1d7+'\x0a')),console['error'](a27_0x4111a0[_0x2de45e(0x230)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x34f1fc+_0x2de45e(0x1c8)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x1d9);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x1e5);async[a27_0x5f1085(0x24e)](_0x33a38e){const _0x3683ce=a27_0x5f1085,{options:_0x28f0ab,args:_0x2133fe,tdx:_0x2bfd62}=_0x33a38e,_0x796d7b=_0x2133fe[0x0];_0x28f0ab['verbose']&&(console[_0x3683ce(0x1bf)](_0x3683ce(0x193)+_0x28f0ab['site']),_0x796d7b&&console['error'](_0x3683ce(0x290)+_0x796d7b));const _0x1772f1=await withSpinner(_0x796d7b?_0x3683ce(0x1db)+_0x796d7b+_0x3683ce(0x260):'Listing\x20parent\x20segments...',()=>_0x2bfd62['segment']['listParents'](),{'verbose':_0x28f0ab[_0x3683ce(0x1a9)]});let _0x218efd=_0x1772f1['data'];if(_0x796d7b){const _0x3d70b9=_0x796d7b[_0x3683ce(0x1cb)](/[.+^${}()|[\]\\]/g,_0x3683ce(0x201))['replace'](/\*/g,'.*')[_0x3683ce(0x1cb)](/\?/g,'.'),_0x3f786b=new RegExp('^'+_0x3d70b9+'$','i');_0x218efd=_0x218efd['filter'](_0x3f867a=>_0x3f786b[_0x3683ce(0x2a0)](_0x3f867a['attributes']['name']));}_0x218efd[_0x3683ce(0x285)]((_0x56bd14,_0x2e52de)=>_0x56bd14[_0x3683ce(0x241)][_0x3683ce(0x19f)]['localeCompare'](_0x2e52de['attributes'][_0x3683ce(0x19f)])),console[_0x3683ce(0x1bf)](_0x3683ce(0x1dc)+_0x218efd[_0x3683ce(0x293)]+_0x3683ce(0x1ec)+(_0x218efd[_0x3683ce(0x293)]!==0x1?'s':''));if(_0x28f0ab[_0x3683ce(0x1e9)]===_0x3683ce(0x1ff)||_0x28f0ab[_0x3683ce(0x1e9)]===_0x3683ce(0x1df))await handleSDKOutput(_0x218efd,_0x28f0ab);else{if(_0x218efd['length']===0x0)_0x796d7b?console['log'](_0x3683ce(0x22a)+_0x796d7b):console[_0x3683ce(0x18c)](_0x3683ce(0x243));else for(const _0x1a6273 of _0x218efd){const _0x4f7681=_0x1a6273[_0x3683ce(0x241)]['population']?a27_0x4111a0[_0x3683ce(0x186)]('\x20('+formatRows(_0x1a6273[_0x3683ce(0x241)][_0x3683ce(0x232)])+')'):'';console[_0x3683ce(0x18c)](_0x3683ce(0x21e)+_0x1a6273[_0x3683ce(0x241)][_0x3683ce(0x19f)]+_0x4f7681);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x27d);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x1ad);async[a27_0x5f1085(0x24e)](_0x27ae71){const _0x1b8a7e=a27_0x5f1085,{options:_0x143561,args:_0x298780,tdx:_0x1256e8}=_0x27ae71;console[_0x1b8a7e(0x1bf)](_0x1b8a7e(0x1f7)+_0x1b8a7e(0x27f)+_0x1b8a7e(0x1c4));const _0x5f39c7=_0x143561;if(_0x298780['length']===0x0)return console[_0x1b8a7e(0x1bf)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1b8a7e(0x1bf)](_0x1b8a7e(0x228)),0x1;const _0x3a2029=_0x298780[0x0];if(!_0x5f39c7[_0x1b8a7e(0x21a)]||!_0x5f39c7[_0x1b8a7e(0x229)])return console['error'](_0x1b8a7e(0x23a)),console['error'](_0x1b8a7e(0x228)),0x1;_0x5f39c7[_0x1b8a7e(0x1a9)]&&(console['error'](_0x1b8a7e(0x193)+_0x5f39c7[_0x1b8a7e(0x18f)]),console[_0x1b8a7e(0x1bf)](_0x1b8a7e(0x29b)+_0x3a2029),console[_0x1b8a7e(0x1bf)]('Database:\x20'+_0x5f39c7[_0x1b8a7e(0x21a)]),console['error'](_0x1b8a7e(0x29e)+_0x5f39c7[_0x1b8a7e(0x229)]));const _0x1ed5fc=await loadJSONFromOptions(_0x5f39c7[_0x1b8a7e(0x241)],_0x5f39c7[_0x1b8a7e(0x1fb)]),_0x1b0c96=await loadJSONFromOptions(_0x5f39c7[_0x1b8a7e(0x24f)],_0x5f39c7[_0x1b8a7e(0x248)]),_0x59c148=await loadJSONFromOptions(_0x5f39c7[_0x1b8a7e(0x1d5)],_0x5f39c7[_0x1b8a7e(0x19a)]),_0x38deb2={'name':_0x3a2029,'description':_0x5f39c7[_0x1b8a7e(0x236)],'scheduleType':_0x5f39c7['scheduleType'],'scheduleOption':_0x5f39c7[_0x1b8a7e(0x20b)],'timezone':_0x5f39c7[_0x1b8a7e(0x209)],'master':{'parentDatabaseName':_0x5f39c7[_0x1b8a7e(0x21a)],'parentTableName':_0x5f39c7[_0x1b8a7e(0x229)]},'attributes':_0x1ed5fc,'behaviors':_0x1b0c96,'customerGroup':_0x59c148},_0x2172e1=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x3a2029+'\x27...',()=>_0x1256e8[_0x1b8a7e(0x20c)][_0x1b8a7e(0x296)](_0x38deb2),{'verbose':_0x143561[_0x1b8a7e(0x1a9)]}),_0x3d7825=_0x2172e1[_0x1b8a7e(0x235)];return console['error'](_0x1b8a7e(0x294)+_0x3d7825[_0x1b8a7e(0x19f)]+_0x1b8a7e(0x1ac)+_0x3d7825['id']),await handleSDKOutput([_0x3d7825],_0x143561),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x28a);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x246);async[a27_0x5f1085(0x24e)](_0x1f0db8){const _0x185ef7=a27_0x5f1085,{options:_0x2d4795,args:_0x5b88df,tdx:_0x2fdc8a}=_0x1f0db8;console[_0x185ef7(0x1bf)](_0x185ef7(0x20f)+_0x185ef7(0x27f)+_0x185ef7(0x1c4));const _0x582622=_0x2d4795;if(_0x5b88df[_0x185ef7(0x293)]===0x0)return console['error'](_0x185ef7(0x1a3)),console['error'](_0x185ef7(0x1c2)),0x1;const _0x3e009d=_0x5b88df[0x0];_0x582622[_0x185ef7(0x1a9)]&&(console[_0x185ef7(0x1bf)]('Site:\x20'+_0x582622[_0x185ef7(0x18f)]),console['error'](_0x185ef7(0x198)+_0x3e009d));const _0x14c8ac=await withSpinner(_0x185ef7(0x1d3)+_0x3e009d+_0x185ef7(0x260),()=>_0x2fdc8a[_0x185ef7(0x20c)][_0x185ef7(0x183)](_0x3e009d),{'verbose':_0x582622[_0x185ef7(0x1a9)]}),_0x497827=_0x14c8ac[_0x185ef7(0x235)],_0x389b10=await loadJSONFromOptions(_0x582622[_0x185ef7(0x28d)],_0x582622['addAttributesFile']),_0x538324=await loadJSONFromOptions(_0x582622['addBehaviors'],_0x582622[_0x185ef7(0x1fc)]),_0x4bbd2d={'name':_0x497827[_0x185ef7(0x19f)],'description':_0x582622[_0x185ef7(0x236)]!==undefined?_0x582622['description']:_0x497827[_0x185ef7(0x236)],'scheduleType':_0x582622[_0x185ef7(0x267)]!==undefined?_0x582622[_0x185ef7(0x267)]:_0x497827[_0x185ef7(0x267)],'scheduleOption':_0x582622[_0x185ef7(0x20b)]!==undefined?_0x582622[_0x185ef7(0x20b)]:_0x497827[_0x185ef7(0x20b)],'timezone':_0x582622[_0x185ef7(0x209)]!==undefined?_0x582622[_0x185ef7(0x209)]:_0x497827['timezone'],'master':_0x497827[_0x185ef7(0x28f)],'attributes':_0x389b10?[..._0x497827[_0x185ef7(0x241)]||[],..._0x389b10]:_0x497827[_0x185ef7(0x241)],'behaviors':_0x538324?[..._0x497827[_0x185ef7(0x24f)]||[],..._0x538324]:_0x497827[_0x185ef7(0x24f)],'customerGroup':_0x497827[_0x185ef7(0x1d5)]},_0x395170=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x3e009d+'\x27...',()=>_0x2fdc8a[_0x185ef7(0x20c)][_0x185ef7(0x1bd)](_0x3e009d,_0x4bbd2d),{'verbose':_0x582622[_0x185ef7(0x1a9)]}),_0x427df9=_0x395170[_0x185ef7(0x235)];return console['error'](_0x185ef7(0x185)+_0x427df9['name']+'\x27'),await handleSDKOutput([_0x427df9],_0x582622),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a27_0x5f1085(0x236)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a27_0x5f1085(0x24e)](_0x192374){const _0x5001b5=a27_0x5f1085,{options:_0x45fc9d,args:_0x13812f,tdx:_0x264ced}=_0x192374,_0x54fb20=_0x45fc9d,_0x26fc62=_0x13812f[0x0]||_0x45fc9d[_0x5001b5(0x192)];if(!_0x26fc62)return console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x258)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x5001b5(0x1bf)](_0x5001b5(0x191)),console['error'](a27_0x4111a0[_0x5001b5(0x230)](_0x5001b5(0x18d))),0x1;if(_0x54fb20[_0x5001b5(0x190)]&&_0x54fb20[_0x5001b5(0x270)])return console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x258)](_0x5001b5(0x242))),console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x186)](_0x5001b5(0x195))),console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x186)](_0x5001b5(0x1b8)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x230)](_0x5001b5(0x219))),0x1;const _0x3b337d=_0x54fb20[_0x5001b5(0x270)]||a27_0xf7f5a[_0x5001b5(0x295)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x26fc62)+_0x5001b5(0x18b));_0x54fb20[_0x5001b5(0x1a9)]&&(console[_0x5001b5(0x1bf)](_0x5001b5(0x193)+_0x54fb20[_0x5001b5(0x18f)]),console['error'](_0x5001b5(0x198)+_0x26fc62),console[_0x5001b5(0x1bf)](_0x5001b5(0x1a2)+_0x3b337d));const _0x57d2b9=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x26fc62+_0x5001b5(0x260),()=>_0x264ced[_0x5001b5(0x20c)]['pullParentYaml'](_0x26fc62),{'verbose':_0x54fb20[_0x5001b5(0x1a9)]}),_0x197a61=_0x57d2b9[_0x5001b5(0x235)];if(existsSync(_0x3b337d)){const _0x5395cc=readFileSync(_0x3b337d,_0x5001b5(0x22c)),_0x2097d3=generateDiff(_0x5395cc,_0x197a61);if(!hasChanges(_0x2097d3))console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x1de)]('✔')+_0x5001b5(0x1b4)+a27_0x4111a0[_0x5001b5(0x230)](_0x3b337d)+_0x5001b5(0x1ef));else{console[_0x5001b5(0x1bf)](_0x5001b5(0x1fa)+_0x3b337d+'\x27:'),console[_0x5001b5(0x1bf)]('─'['repeat'](0x3c)),console['error'](formatDiffWithColors(_0x2097d3)),console[_0x5001b5(0x1bf)]('─'[_0x5001b5(0x238)](0x3c));if(!_0x54fb20[_0x5001b5(0x27e)]){const _0x2721ea=await confirmKey(_0x5001b5(0x1f5)+_0x3b337d+'\x27?');if(!_0x2721ea)return console[_0x5001b5(0x1bf)](_0x5001b5(0x262)),0x1;}writeFileSync(_0x3b337d,_0x197a61,_0x5001b5(0x22c)),console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x1de)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a27_0x4111a0[_0x5001b5(0x230)](_0x3b337d));}}else{const _0x5514a1=a27_0xf7f5a[_0x5001b5(0x1c5)](_0x3b337d);!existsSync(_0x5514a1)&&mkdirSync(_0x5514a1,{'recursive':!![]}),writeFileSync(_0x3b337d,_0x197a61,_0x5001b5(0x22c)),console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x1de)]('✔')+_0x5001b5(0x187)+a27_0x4111a0[_0x5001b5(0x230)](_0x3b337d));}return saveSessionContext({'parent_segment':_0x26fc62},_0x54fb20['session']),console[_0x5001b5(0x1bf)](a27_0x4111a0[_0x5001b5(0x1de)]('✔')+_0x5001b5(0x1ed)+a27_0x4111a0['dim'](_0x5001b5(0x1b7))+_0x5001b5(0x289)+a27_0x4111a0[_0x5001b5(0x230)](_0x26fc62)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x223);['description']=a27_0x5f1085(0x1f2);async[a27_0x5f1085(0x24e)](_0x189df0){const _0x2173f6=a27_0x5f1085,{options:_0x58cb2b,args:_0x474733,tdx:_0x423690}=_0x189df0,_0x355fb7=_0x58cb2b,_0x2826f4=_0x474733[0x0]||_0x58cb2b['parentSegment'];if(!_0x2826f4)return console[_0x2173f6(0x1bf)](a27_0x4111a0['red'](_0x2173f6(0x1e0))),console[_0x2173f6(0x1bf)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x2173f6(0x1bf)](a27_0x4111a0[_0x2173f6(0x230)](_0x2173f6(0x252))),0x1;const _0xe2d784=resolveYamlFile(_0x2826f4);if(!existsSync(_0xe2d784))return showFileNotFoundError(_0xe2d784,_0x2826f4),0x1;_0x355fb7[_0x2173f6(0x1a9)]&&(console[_0x2173f6(0x1bf)](_0x2173f6(0x193)+_0x355fb7[_0x2173f6(0x18f)]),console[_0x2173f6(0x1bf)](_0x2173f6(0x17f)+_0xe2d784));let _0x56a518;try{_0x56a518=readFileSync(_0xe2d784,_0x2173f6(0x22c));}catch(_0x5391ef){const _0x2f6bb9=_0x5391ef instanceof Error?_0x5391ef[_0x2173f6(0x276)]:String(_0x5391ef);return console[_0x2173f6(0x1bf)](_0x2173f6(0x225)+_0x2f6bb9),0x1;}const _0x147c15=await withSpinner(_0x2173f6(0x1e6),()=>_0x423690[_0x2173f6(0x20c)][_0x2173f6(0x194)](_0x56a518),{'verbose':_0x355fb7[_0x2173f6(0x1a9)]}),_0x1cf991=_0x147c15[_0x2173f6(0x235)],{isNew:_0x3cae83,name:_0x22f89b,hasChanges:_0x453db8,diffFormatted:_0x266c7c}=_0x1cf991;if(!_0x453db8)return console[_0x2173f6(0x1bf)]('✔\x20No\x20changes\x20-\x20\x27'+_0x22f89b+_0x2173f6(0x26b)),0x0;_0x3cae83?console[_0x2173f6(0x1bf)](_0x2173f6(0x266)+_0x22f89b+'\x27:'):console[_0x2173f6(0x1bf)](_0x2173f6(0x23d)+_0x22f89b+'\x27:');console[_0x2173f6(0x1bf)]('─'[_0x2173f6(0x238)](0x3c)),console[_0x2173f6(0x1bf)](_0x266c7c),console[_0x2173f6(0x1bf)]('─'[_0x2173f6(0x238)](0x3c));const _0x4b38a8=_0x3cae83?_0x2173f6(0x1eb)+_0x22f89b+'\x27?':_0x2173f6(0x274)+_0x22f89b+'\x27?';if(!_0x355fb7[_0x2173f6(0x27e)]){const _0x494617=await confirmKey(_0x4b38a8);if(!_0x494617)return console['error'](_0x2173f6(0x262)),0x1;}const _0x3cb17b=_0x3cae83?_0x2173f6(0x212):'Updating',_0x4d7a13=await withSpinner(_0x3cb17b+_0x2173f6(0x224)+_0x22f89b+_0x2173f6(0x260),()=>_0x1cf991[_0x2173f6(0x29c)](),{'verbose':_0x355fb7[_0x2173f6(0x1a9)]}),_0x3158da=_0x4d7a13[_0x2173f6(0x235)],_0x5c9e09=getConsoleNextUrl(_0x355fb7[_0x2173f6(0x18f)],'/app/dw/parentSegments/'+_0x3158da['id']),_0x414555=_0x3cae83?_0x2173f6(0x207):'Updated';return console['error']('✔\x20'+_0x414555+_0x2173f6(0x224)+_0x3158da[_0x2173f6(0x19f)]+'\x27'),console[_0x2173f6(0x1bf)]('\x20\x20'+_0x5c9e09),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x24a);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x25f);async[a27_0x5f1085(0x24e)](_0x1396f1){const _0x5a5331=a27_0x5f1085,{options:_0x5d640c,args:_0x2e8dfc,tdx:_0xcc67ff}=_0x1396f1,_0x1764a6=_0x5d640c,_0x2206bf=_0x2e8dfc[0x0]||_0x5d640c[_0x5a5331(0x192)];if(!_0x2206bf)return console[_0x5a5331(0x1bf)](a27_0x4111a0[_0x5a5331(0x258)](_0x5a5331(0x1e0))),console[_0x5a5331(0x1bf)](_0x5a5331(0x222)),console['error']('Options:'),console[_0x5a5331(0x1bf)](_0x5a5331(0x21f)),console['error'](_0x5a5331(0x221)),console[_0x5a5331(0x1bf)](_0x5a5331(0x1cc)),console[_0x5a5331(0x1bf)](a27_0x4111a0[_0x5a5331(0x230)]('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x4a7b9b=resolveYamlFile(_0x2206bf);if(!existsSync(_0x4a7b9b))return showFileNotFoundError(_0x4a7b9b,_0x2206bf),0x1;_0x1764a6[_0x5a5331(0x1a9)]&&(console['error'](_0x5a5331(0x193)+_0x1764a6['site']),console[_0x5a5331(0x1bf)](_0x5a5331(0x17f)+_0x4a7b9b));let _0x1b2d19;try{_0x1b2d19=readFileSync(_0x4a7b9b,_0x5a5331(0x22c));}catch(_0x442b11){const _0x26f1da=_0x442b11 instanceof Error?_0x442b11[_0x5a5331(0x276)]:String(_0x442b11);return console[_0x5a5331(0x1bf)](_0x5a5331(0x225)+_0x26f1da),0x1;}const _0xa94860=createCommandSpinner(a27_0x4111a0[_0x5a5331(0x186)]('Validating\x20configuration...'),{'verbose':_0x1764a6[_0x5a5331(0x1a9)]});_0xa94860[_0x5a5331(0x1ab)]();const _0x2fe192={'onProgress':_0x2e1cfa=>{const _0xe1e670=_0x5a5331;_0xa94860[_0xe1e670(0x1b1)]=formatProgressMessage(_0x2e1cfa);}};if(_0x1764a6[_0x5a5331(0x28f)])_0x2fe192[_0x5a5331(0x28f)]=!![];if(_0x1764a6[_0x5a5331(0x26a)])_0x2fe192[_0x5a5331(0x26a)]=!![];_0x1764a6[_0x5a5331(0x1b0)]&&(_0x2fe192[_0x5a5331(0x1b0)]=_0x1764a6[_0x5a5331(0x1b0)]);_0x1764a6[_0x5a5331(0x291)]&&(_0x2fe192[_0x5a5331(0x291)]=_0x1764a6[_0x5a5331(0x291)]);if(_0x1764a6[_0x5a5331(0x1af)])_0x2fe192[_0x5a5331(0x1af)]=_0x1764a6[_0x5a5331(0x1af)];let _0x233842;try{_0x233842=await _0xcc67ff[_0x5a5331(0x20c)][_0x5a5331(0x22b)](_0x1b2d19,_0x2fe192),_0xa94860[_0x5a5331(0x1b9)]();}catch(_0x45200c){_0xa94860[_0x5a5331(0x1b9)]();throw _0x45200c;}const _0x229df7=_0x1764a6[_0x5a5331(0x1af)]||'-1d';return this[_0x5a5331(0x1a5)](_0x233842,_0x2fe192,_0x4a7b9b,_0x229df7),_0x233842[_0x5a5331(0x24d)]?0x0:0x1;}[a27_0x5f1085(0x1a5)](_0x16ebe8,_0x348cfc,_0x14fc82,_0x2a11f4){const _0x1a72f8=a27_0x5f1085;console[_0x1a72f8(0x1bf)]('\x0a'+a27_0x4111a0['bold'](_0x1a72f8(0x25a))+'\x20'+_0x16ebe8[_0x1a72f8(0x19f)]),console['error']('═'[_0x1a72f8(0x238)](0x3c)),this[_0x1a72f8(0x218)](_0x16ebe8);if(typeof _0x348cfc[_0x1a72f8(0x1b0)]===_0x1a72f8(0x297)){this['displayAttributesStats'](_0x16ebe8),this['displaySummary'](_0x16ebe8),this['displayPreviewHints'](_0x14fc82,_0x2a11f4,'attribute',_0x348cfc['attribute']);return;}if(_0x348cfc[_0x1a72f8(0x1b0)]===!![]){this[_0x1a72f8(0x213)](_0x16ebe8),this['displaySummary'](_0x16ebe8),this[_0x1a72f8(0x280)](_0x14fc82,_0x2a11f4,_0x1a72f8(0x241));return;}if(typeof _0x348cfc[_0x1a72f8(0x291)]===_0x1a72f8(0x297)){this['displayBehaviorsStats'](_0x16ebe8,_0x2a11f4),this[_0x1a72f8(0x1f3)](_0x16ebe8),this[_0x1a72f8(0x280)](_0x14fc82,_0x2a11f4,_0x1a72f8(0x291),_0x348cfc[_0x1a72f8(0x291)]);return;}if(_0x348cfc[_0x1a72f8(0x291)]===!![]){this[_0x1a72f8(0x237)](_0x16ebe8,_0x2a11f4),this[_0x1a72f8(0x1f3)](_0x16ebe8),this['displayPreviewHints'](_0x14fc82,_0x2a11f4,_0x1a72f8(0x24f));return;}this['displayAttributesStats'](_0x16ebe8),this[_0x1a72f8(0x237)](_0x16ebe8,_0x2a11f4),this['displaySummary'](_0x16ebe8),this['displayPreviewHints'](_0x14fc82,_0x2a11f4,_0x1a72f8(0x24c));}[a27_0x5f1085(0x280)](_0xdc19e4,_0x4369c5,_0x3e560f,_0xb07fd4){const _0x780f7a=a27_0x5f1085;console[_0x780f7a(0x1bf)]('\x0a'+a27_0x4111a0[_0x780f7a(0x186)](_0x780f7a(0x19d)));const _0x346e93=_0x4369c5!=='-1d'?_0x780f7a(0x23f)+_0x4369c5:'';if(_0x3e560f===_0x780f7a(0x1b0)&&_0xb07fd4)console[_0x780f7a(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x780f7a(0x186)]('tdx\x20segment\x20parent\x20preview\x20'+_0xdc19e4+_0x780f7a(0x1e4)+_0xb07fd4+'\x22'+_0x346e93));else{if(_0x3e560f===_0x780f7a(0x291)&&_0xb07fd4)console[_0x780f7a(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x780f7a(0x186)](_0x780f7a(0x205)+_0xdc19e4+'\x20--behavior\x20\x22'+_0xb07fd4+'\x22'+_0x346e93));else(_0x3e560f===_0x780f7a(0x241)||_0x3e560f==='all')&&console[_0x780f7a(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x780f7a(0x186)](_0x780f7a(0x205)+_0xdc19e4+_0x780f7a(0x1e8)+_0x346e93));}(_0x3e560f===_0x780f7a(0x24f)||_0x3e560f===_0x780f7a(0x24c))&&console[_0x780f7a(0x1bf)]('\x20\x20'+a27_0x4111a0['dim'](_0x780f7a(0x205)+_0xdc19e4+'\x20--behavior\x20\x22<name>\x22'+_0x346e93)),_0x3e560f===_0x780f7a(0x24c)&&console['error']('\x20\x20'+a27_0x4111a0[_0x780f7a(0x186)](_0x780f7a(0x205)+_0xdc19e4+_0x780f7a(0x271)+_0x346e93));}[a27_0x5f1085(0x218)](_0x275642){const _0x1968ee=a27_0x5f1085,{master:_0x5bf801}=_0x275642,_0x56cdff=_0x5bf801['schemaValid']?a27_0x4111a0[_0x1968ee(0x1de)]('✔'):a27_0x4111a0[_0x1968ee(0x258)]('✘');console[_0x1968ee(0x1bf)]('\x0a'+a27_0x4111a0[_0x1968ee(0x186)]('Master\x20Table')),console['error'](_0x56cdff+'\x20'+a27_0x4111a0[_0x1968ee(0x202)](_0x5bf801[_0x1968ee(0x21a)]+'.'+_0x5bf801[_0x1968ee(0x229)])),_0x5bf801[_0x1968ee(0x1ae)]?_0x5bf801[_0x1968ee(0x257)]!==undefined&&console[_0x1968ee(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x1968ee(0x186)]('Rows:')+'\x20'+a27_0x4111a0['cyan'](formatRows(_0x5bf801[_0x1968ee(0x257)]))):console['error']('\x20\x20'+a27_0x4111a0[_0x1968ee(0x258)](_0x1968ee(0x27b))+'\x20'+_0x5bf801[_0x1968ee(0x1d0)]);}[a27_0x5f1085(0x213)](_0x53fec4){const _0x42cde0=a27_0x5f1085;if(_0x53fec4[_0x42cde0(0x241)]['length']===0x0)return;console['error']('\x0a'+a27_0x4111a0[_0x42cde0(0x186)]('Attributes'));for(const _0x279f5f of _0x53fec4[_0x42cde0(0x241)]){const _0x195a99=_0x279f5f[_0x42cde0(0x1ae)]?a27_0x4111a0['green']('✔'):a27_0x4111a0[_0x42cde0(0x258)]('✘');let _0x19fbfa='';if(_0x279f5f[_0x42cde0(0x1ae)]&&_0x279f5f['matchedCount']!==undefined&&_0x279f5f[_0x42cde0(0x1d2)]!==undefined){const _0x34bfcc=_0x279f5f[_0x42cde0(0x1d2)]['toFixed'](0x1),_0x302152=_0x279f5f['coveragePercent']>=0x50?a27_0x4111a0['green']:_0x279f5f['coveragePercent']>=0x32?a27_0x4111a0[_0x42cde0(0x261)]:a27_0x4111a0['red'];_0x19fbfa='\x20'+a27_0x4111a0[_0x42cde0(0x186)]('Coverage:')+'\x20'+_0x302152(_0x34bfcc+'%')+'\x20('+formatRows(_0x279f5f[_0x42cde0(0x1d4)])+_0x42cde0(0x1d1);}console[_0x42cde0(0x1bf)](_0x195a99+'\x20'+a27_0x4111a0['bold'](_0x279f5f[_0x42cde0(0x19f)])+_0x19fbfa),console[_0x42cde0(0x1bf)]('\x20\x20'+a27_0x4111a0['dim'](_0x42cde0(0x1ce))+'\x20'+a27_0x4111a0['bold'](_0x279f5f['database']+'.'+_0x279f5f[_0x42cde0(0x229)]));const _0x7b6e3d=_0x279f5f[_0x42cde0(0x20e)]===_0x279f5f[_0x42cde0(0x283)]?a27_0x4111a0['dim'](_0x42cde0(0x1f0))+'\x20'+_0x279f5f['joinKey']:a27_0x4111a0[_0x42cde0(0x186)](_0x42cde0(0x268))+'\x20'+_0x279f5f['joinKey']+_0x42cde0(0x289)+_0x279f5f[_0x42cde0(0x283)];console[_0x42cde0(0x1bf)]('\x20\x20'+_0x7b6e3d),console[_0x42cde0(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x42cde0(0x186)](_0x42cde0(0x197))),this[_0x42cde0(0x196)](_0x279f5f['columns']),!_0x279f5f[_0x42cde0(0x1ae)]&&console[_0x42cde0(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x42cde0(0x258)](_0x42cde0(0x27b))+'\x20'+_0x279f5f['schemaError']);}}[a27_0x5f1085(0x237)](_0xa46525,_0xd0b6df){const _0x170a10=a27_0x5f1085;if(_0xa46525[_0x170a10(0x24f)][_0x170a10(0x293)]===0x0)return;console['error']('\x0a'+a27_0x4111a0[_0x170a10(0x186)](_0x170a10(0x1ea))+'\x20'+a27_0x4111a0[_0x170a10(0x186)]('('+_0xd0b6df+')'));for(const _0x2acbd8 of _0xa46525[_0x170a10(0x24f)]){const _0x1f7df6=_0x2acbd8[_0x170a10(0x1ae)]?a27_0x4111a0[_0x170a10(0x1de)]('✔'):a27_0x4111a0[_0x170a10(0x258)]('✘');let _0x46b2cf='';if(_0x2acbd8['schemaValid']&&_0x2acbd8['customersWithEvents']!==undefined&&_0x2acbd8['totalEvents']!==undefined){const _0x2345d2=_0x2acbd8[_0x170a10(0x26e)]?.[_0x170a10(0x1b5)](0x1)||'?',_0x2ad160=(_0x2acbd8[_0x170a10(0x26e)]??0x0)>=0x32?a27_0x4111a0[_0x170a10(0x1de)]:(_0x2acbd8[_0x170a10(0x26e)]??0x0)>=0x14?a27_0x4111a0[_0x170a10(0x261)]:a27_0x4111a0[_0x170a10(0x258)];_0x46b2cf='\x20'+a27_0x4111a0['dim'](_0x170a10(0x227))+'\x20'+_0x2ad160(formatRows(_0x2acbd8[_0x170a10(0x20a)]))+'\x20('+_0x2345d2+_0x170a10(0x1a0)+a27_0x4111a0[_0x170a10(0x186)](_0x170a10(0x28e))+'\x20'+a27_0x4111a0[_0x170a10(0x230)](formatRows(_0x2acbd8[_0x170a10(0x269)]));}console[_0x170a10(0x1bf)](_0x1f7df6+'\x20'+a27_0x4111a0[_0x170a10(0x202)](_0x2acbd8[_0x170a10(0x19f)])+_0x46b2cf),console[_0x170a10(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x170a10(0x186)](_0x170a10(0x1ce))+'\x20'+a27_0x4111a0[_0x170a10(0x202)](_0x2acbd8[_0x170a10(0x21a)]+'.'+_0x2acbd8[_0x170a10(0x229)]));const _0xf10840=_0x2acbd8[_0x170a10(0x20e)]===_0x2acbd8[_0x170a10(0x283)]?a27_0x4111a0['dim'](_0x170a10(0x1f0))+'\x20'+_0x2acbd8[_0x170a10(0x20e)]:a27_0x4111a0[_0x170a10(0x186)](_0x170a10(0x268))+'\x20'+_0x2acbd8[_0x170a10(0x20e)]+_0x170a10(0x289)+_0x2acbd8[_0x170a10(0x283)];console[_0x170a10(0x1bf)]('\x20\x20'+_0xf10840),console['error']('\x20\x20'+a27_0x4111a0['dim'](_0x170a10(0x197))),this[_0x170a10(0x196)](_0x2acbd8['columns']),!_0x2acbd8['schemaValid']&&console[_0x170a10(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x170a10(0x258)](_0x170a10(0x27b))+'\x20'+_0x2acbd8['schemaError']);}}['displayColumns'](_0x4b1927){const _0x10b6fa=a27_0x5f1085;for(const _0x4e9784 of _0x4b1927){_0x4e9784[_0x10b6fa(0x22f)]===_0x4e9784[_0x10b6fa(0x200)]||_0x4e9784[_0x10b6fa(0x200)]==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x4e9784[_0x10b6fa(0x22f)]):console[_0x10b6fa(0x1bf)](_0x10b6fa(0x28b)+_0x4e9784[_0x10b6fa(0x22f)]+'\x20'+a27_0x4111a0[_0x10b6fa(0x186)]('('+_0x4e9784['column']+')'));}}['displaySummary'](_0x443157){const _0x7783ba=a27_0x5f1085;console['error']('─'['repeat'](0x3c));if(_0x443157[_0x7783ba(0x210)][_0x7783ba(0x293)]>0x0){console['error']('\x0a'+a27_0x4111a0['red'](_0x7783ba(0x1cd)));for(const _0x2d4dfb of _0x443157['errors']){console['error']('\x20\x20'+a27_0x4111a0[_0x7783ba(0x258)]('•')+'\x20'+_0x2d4dfb);}}_0x443157[_0x7783ba(0x24d)]&&console['error']('\x0a'+a27_0x4111a0[_0x7783ba(0x1de)]('✔')+_0x7783ba(0x19c));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x249);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x287);async[a27_0x5f1085(0x24e)](_0x5ed23a){const _0x45891e=a27_0x5f1085,{options:_0x57459c,args:_0x4eb401,tdx:_0x93414b}=_0x5ed23a,_0x2a615f=_0x57459c,_0x69bb57=_0x4eb401[0x0]||_0x57459c[_0x45891e(0x192)];if(!_0x69bb57)return console[_0x45891e(0x1bf)](a27_0x4111a0[_0x45891e(0x258)](_0x45891e(0x1e0))),console['error'](_0x45891e(0x181)),console['error']('Options\x20(one\x20required):'),console['error'](_0x45891e(0x1bc)),console[_0x45891e(0x1bf)](_0x45891e(0x215)),console[_0x45891e(0x1bf)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x45891e(0x1a8)),console[_0x45891e(0x1bf)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console[_0x45891e(0x1bf)](a27_0x4111a0['cyan'](_0x45891e(0x244))),0x1;if(!_0x2a615f[_0x45891e(0x28f)]&&!_0x2a615f[_0x45891e(0x1b0)]&&!_0x2a615f['behavior']&&!_0x2a615f[_0x45891e(0x26a)])return console[_0x45891e(0x1bf)](a27_0x4111a0[_0x45891e(0x258)](_0x45891e(0x1f8))),console[_0x45891e(0x1bf)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console['error'](_0x45891e(0x214)),console['error'](_0x45891e(0x1bc)),console['error'](_0x45891e(0x215)),console[_0x45891e(0x1bf)](_0x45891e(0x255)),console[_0x45891e(0x1bf)](_0x45891e(0x1a8)),0x1;const _0x3e32ec=resolveYamlFile(_0x69bb57);if(!existsSync(_0x3e32ec))return showFileNotFoundError(_0x3e32ec,_0x69bb57),0x1;_0x2a615f['verbose']&&(console[_0x45891e(0x1bf)](_0x45891e(0x193)+_0x2a615f['site']),console[_0x45891e(0x1bf)](_0x45891e(0x17f)+_0x3e32ec));let _0x1afc9f;try{_0x1afc9f=readFileSync(_0x3e32ec,'utf-8');}catch(_0x135d65){const _0x3acec9=_0x135d65 instanceof Error?_0x135d65['message']:String(_0x135d65);return console[_0x45891e(0x1bf)](_0x45891e(0x225)+_0x3acec9),0x1;}let _0x55dbe2;try{_0x55dbe2=parseYamlString(_0x1afc9f);}catch(_0x43251b){const _0x4da266=_0x43251b instanceof Error?_0x43251b[_0x45891e(0x276)]:String(_0x43251b);return console[_0x45891e(0x1bf)](a27_0x4111a0[_0x45891e(0x258)](_0x45891e(0x189)+_0x4da266)),0x1;}if(_0x2a615f['attribute']===!![]||_0x2a615f[_0x45891e(0x1b0)]===''){const _0x18689b=_0x55dbe2[_0x45891e(0x241)]?.[_0x45891e(0x231)](_0xb816dd=>_0xb816dd['name'])||[];if(_0x18689b['length']===0x0)console[_0x45891e(0x1bf)](a27_0x4111a0[_0x45891e(0x258)](_0x45891e(0x26c)));else{console[_0x45891e(0x1bf)](a27_0x4111a0[_0x45891e(0x258)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error'](_0x45891e(0x1c9));for(const _0xb633dc of _0x18689b){console['error']('\x20\x20'+a27_0x4111a0[_0x45891e(0x230)](_0xb633dc));}console['error'](_0x45891e(0x250)+_0x69bb57+_0x45891e(0x1e4)+_0x18689b[0x0]+'\x22');}return 0x1;}if(_0x2a615f[_0x45891e(0x291)]===!![]||_0x2a615f[_0x45891e(0x291)]===''){const _0x270f92=_0x55dbe2[_0x45891e(0x24f)]?.['map'](_0x62b4ef=>_0x62b4ef[_0x45891e(0x19f)])||[];if(_0x270f92[_0x45891e(0x293)]===0x0)console[_0x45891e(0x1bf)](a27_0x4111a0[_0x45891e(0x258)](_0x45891e(0x264)));else{console[_0x45891e(0x1bf)](a27_0x4111a0['red'](_0x45891e(0x28c))),console[_0x45891e(0x1bf)](_0x45891e(0x281));for(const _0x8319df of _0x270f92){console['error']('\x20\x20'+a27_0x4111a0[_0x45891e(0x230)](_0x8319df));}console['error'](_0x45891e(0x250)+_0x69bb57+_0x45891e(0x1e1)+_0x270f92[0x0]+'\x22');}return 0x1;}const _0x58a043=createCommandSpinner(a27_0x4111a0[_0x45891e(0x186)](_0x45891e(0x272)),{'verbose':_0x2a615f[_0x45891e(0x1a9)]});_0x58a043['start']();const _0x12bdec={'onProgress':_0x565c67=>{const _0xff2b63=_0x45891e;_0x58a043[_0xff2b63(0x1b1)]=formatProgressMessage(_0x565c67);}};if(_0x2a615f[_0x45891e(0x28f)])_0x12bdec[_0x45891e(0x28f)]=!![];if(_0x2a615f['attribute']&&typeof _0x2a615f[_0x45891e(0x1b0)]==='string')_0x12bdec['attribute']=_0x2a615f[_0x45891e(0x1b0)];if(_0x2a615f[_0x45891e(0x291)]&&typeof _0x2a615f['behavior']===_0x45891e(0x297))_0x12bdec[_0x45891e(0x291)]=_0x2a615f['behavior'];if(_0x2a615f[_0x45891e(0x26a)])_0x12bdec['enriched']=!![];if(_0x2a615f[_0x45891e(0x1af)])_0x12bdec['interval']=_0x2a615f['interval'];let _0x547111;try{_0x547111=await _0x93414b[_0x45891e(0x20c)][_0x45891e(0x279)](_0x1afc9f,_0x12bdec),_0x58a043['stop']();}catch(_0x31e649){_0x58a043[_0x45891e(0x1b9)]();throw _0x31e649;}return await this[_0x45891e(0x18e)](_0x547111,{'master':_0x2a615f[_0x45891e(0x28f)],'attribute':typeof _0x2a615f[_0x45891e(0x1b0)]==='string'?_0x2a615f[_0x45891e(0x1b0)]:undefined,'behavior':typeof _0x2a615f[_0x45891e(0x291)]==='string'?_0x2a615f[_0x45891e(0x291)]:undefined,'enriched':_0x2a615f['enriched']}),_0x547111[_0x45891e(0x24d)]?0x0:0x1;}async[a27_0x5f1085(0x18e)](_0x57f2e9,_0x2e23ae){const _0x2557c4=a27_0x5f1085;console['error']('\x0a'+a27_0x4111a0[_0x2557c4(0x202)](_0x2557c4(0x259))+'\x20'+_0x57f2e9['name']),console[_0x2557c4(0x1bf)]('═'[_0x2557c4(0x238)](0x3c));if(_0x2e23ae[_0x2557c4(0x28f)]&&_0x57f2e9[_0x2557c4(0x1ca)]){const _0x183554=a27_0x4111a0[_0x2557c4(0x186)](_0x2557c4(0x216))+'\x20'+a27_0x4111a0[_0x2557c4(0x202)](_0x57f2e9[_0x2557c4(0x28f)][_0x2557c4(0x21a)]+'.'+_0x57f2e9['master'][_0x2557c4(0x229)]);await this[_0x2557c4(0x208)](_0x183554,_0x57f2e9[_0x2557c4(0x1ca)]);}else{if(_0x2e23ae[_0x2557c4(0x1b0)]&&_0x57f2e9[_0x2557c4(0x1ca)]){const _0x50ff27=a27_0x4111a0[_0x2557c4(0x186)]('Attribute:')+'\x20'+a27_0x4111a0[_0x2557c4(0x202)](_0x2e23ae[_0x2557c4(0x1b0)]);await this[_0x2557c4(0x208)](_0x50ff27,_0x57f2e9[_0x2557c4(0x1ca)]);}else{if(_0x2e23ae['behavior']&&_0x57f2e9['sampleData']){const _0x1e51f7=a27_0x4111a0[_0x2557c4(0x186)](_0x2557c4(0x29f))+'\x20'+a27_0x4111a0[_0x2557c4(0x202)](_0x2e23ae['behavior']);await this[_0x2557c4(0x208)](_0x1e51f7,_0x57f2e9[_0x2557c4(0x1ca)]);}else{if(_0x2e23ae['enriched']&&_0x57f2e9[_0x2557c4(0x1ca)]){const _0x17e835=a27_0x4111a0[_0x2557c4(0x186)](_0x2557c4(0x1dd))+'\x20'+a27_0x4111a0[_0x2557c4(0x202)]('Master\x20+\x20Attributes');await this[_0x2557c4(0x208)](_0x17e835,_0x57f2e9['sampleData']);}else!_0x57f2e9[_0x2557c4(0x1ca)]&&console[_0x2557c4(0x1bf)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x57f2e9[_0x2557c4(0x210)]['length']>0x0){console[_0x2557c4(0x1bf)]('─'[_0x2557c4(0x238)](0x3c)),console['error']('\x0a'+a27_0x4111a0[_0x2557c4(0x258)](_0x2557c4(0x1cd)));for(const _0x3e99c5 of _0x57f2e9[_0x2557c4(0x210)]){console[_0x2557c4(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x2557c4(0x258)]('•')+'\x20'+_0x3e99c5);}}}async[a27_0x5f1085(0x208)](_0x4bb3fc,_0x296d1){const _0x233704=a27_0x5f1085;if(_0x296d1[_0x233704(0x293)]===0x0){console['error']('\x0a'+_0x4bb3fc),console['error'](_0x233704(0x26d));return;}console[_0x233704(0x1bf)]('\x0a'+_0x4bb3fc);const _0x34e13d=Object[_0x233704(0x1f6)](_0x296d1[0x0])['map'](_0x337d8b=>({'name':_0x337d8b,'type':typeof _0x296d1[0x0][_0x337d8b]===_0x233704(0x2a1)?'double':_0x233704(0x25b)})),_0x303664={'queryId':_0x233704(0x1da),'columns':_0x34e13d,'data':_0x296d1,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x296d1['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2a182a=formatAsTable(_0x303664,_0x296d1[_0x233704(0x293)],!![]);await writeOutput(_0x2a182a,undefined,_0x233704(0x229));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x284);[a27_0x5f1085(0x236)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a27_0x5f1085(0x24e)](_0x3d6414){const _0x5b7ae9=a27_0x5f1085,{options:_0x77ab54,args:_0x3780d0,tdx:_0x3532b1}=_0x3d6414,_0x9787c8=_0x77ab54,_0x300be8=_0x3780d0[0x0]||_0x77ab54[_0x5b7ae9(0x192)];if(!_0x300be8)return console['error'](a27_0x4111a0[_0x5b7ae9(0x258)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x29a)),console[_0x5b7ae9(0x1bf)](a27_0x4111a0[_0x5b7ae9(0x230)](_0x5b7ae9(0x18d))),0x1;const _0x5dbf2e=resolveYamlFile(_0x300be8);if(existsSync(_0x5dbf2e)){_0x9787c8[_0x5b7ae9(0x1a9)]&&console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x277)+_0x5dbf2e);let _0x37af1d;try{_0x37af1d=readFileSync(_0x5dbf2e,_0x5b7ae9(0x22c));}catch(_0x3cf2c3){const _0x1edb5b=_0x3cf2c3 instanceof Error?_0x3cf2c3['message']:String(_0x3cf2c3);return console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x225)+_0x1edb5b),0x1;}const _0x52974a=await withSpinner('Analyzing\x20changes...',()=>_0x3532b1[_0x5b7ae9(0x20c)][_0x5b7ae9(0x194)](_0x37af1d),{'verbose':_0x9787c8[_0x5b7ae9(0x1a9)]}),_0x196855=_0x52974a[_0x5b7ae9(0x235)],{isNew:_0x5cfec6,name:_0x42723b,hasChanges:_0x277dd6,diffFormatted:_0x4e78fa}=_0x196855;if(_0x277dd6){_0x5cfec6?console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x266)+_0x42723b+'\x27:'):console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x23d)+_0x42723b+'\x27:');console[_0x5b7ae9(0x1bf)]('─'['repeat'](0x3c)),console[_0x5b7ae9(0x1bf)](_0x4e78fa),console['error']('─'[_0x5b7ae9(0x238)](0x3c));const _0x1e461b=_0x5cfec6?_0x5b7ae9(0x1eb)+_0x42723b+_0x5b7ae9(0x239):'Apply\x20changes\x20to\x20\x27'+_0x42723b+_0x5b7ae9(0x239);if(!_0x9787c8['yes']){const _0x53bdef=await confirmKey(_0x1e461b);if(!_0x53bdef)return console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x262)),0x1;}const _0x20aa10=_0x5cfec6?'Creating':'Updating';await withSpinner(_0x20aa10+_0x5b7ae9(0x224)+_0x42723b+'\x27...',()=>_0x196855['apply'](),{'verbose':_0x9787c8[_0x5b7ae9(0x1a9)]});const _0x2ff6ce=_0x5cfec6?_0x5b7ae9(0x207):_0x5b7ae9(0x1be);console['error']('✔\x20'+_0x2ff6ce+_0x5b7ae9(0x224)+_0x42723b+'\x27');}else console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x21b)+_0x42723b+'\x27\x20is\x20up\x20to\x20date');}const _0x5d0b17=await withSpinner(_0x5b7ae9(0x19b)+_0x300be8+_0x5b7ae9(0x260),()=>_0x3532b1[_0x5b7ae9(0x20c)]['runParent'](_0x300be8),{'verbose':_0x9787c8['verbose']}),_0x1f91a2=_0x5d0b17[_0x5b7ae9(0x235)],_0x56e48e=getConsoleUrl(_0x9787c8[_0x5b7ae9(0x18f)],_0x5b7ae9(0x1c7)+_0x1f91a2['workflowId']+_0x5b7ae9(0x1bb)+_0x1f91a2[_0x5b7ae9(0x27c)]+'/attempt/'+_0x1f91a2[_0x5b7ae9(0x27a)]);return console[_0x5b7ae9(0x1bf)](_0x5b7ae9(0x273)),console['error']('\x20\x20'+a27_0x4111a0[_0x5b7ae9(0x186)]('Audience\x20ID:')+'\x20'+_0x1f91a2[_0x5b7ae9(0x1ee)]),console[_0x5b7ae9(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x5b7ae9(0x186)](_0x5b7ae9(0x263))+'\x20'+_0x1f91a2[_0x5b7ae9(0x211)]),console[_0x5b7ae9(0x1bf)]('\x20\x20'+a27_0x4111a0[_0x5b7ae9(0x186)]('Session:')+'\x20'+_0x1f91a2[_0x5b7ae9(0x27c)]),console['error']('\x20\x20'+a27_0x4111a0['dim'](_0x5b7ae9(0x180))+'\x20'+_0x1f91a2[_0x5b7ae9(0x27a)]),console['error']('\x20\x20'+_0x56e48e),console[_0x5b7ae9(0x1bf)]('\x0a'+a27_0x4111a0['dim']('To\x20cancel:')+_0x5b7ae9(0x25e)+_0x1f91a2[_0x5b7ae9(0x27a)]+_0x5b7ae9(0x220)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0x5f1085(0x19f)]='segment:parent:fields';[a27_0x5f1085(0x236)]='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x5f1085(0x24e)](_0x2a9837){const _0x1116c2=a27_0x5f1085,{options:_0x139480,args:_0x58f943,tdx:_0x1dc3ed}=_0x2a9837,_0x3fe0a8=_0x58f943[0x0]||_0x139480[_0x1116c2(0x192)];if(!_0x3fe0a8)return console[_0x1116c2(0x1bf)](a27_0x4111a0[_0x1116c2(0x258)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x1116c2(0x1bf)](_0x1116c2(0x184)),console[_0x1116c2(0x1bf)](a27_0x4111a0['cyan'](_0x1116c2(0x18d))),0x1;_0x139480[_0x1116c2(0x1a9)]&&(console[_0x1116c2(0x1bf)](_0x1116c2(0x193)+_0x139480[_0x1116c2(0x18f)]),console[_0x1116c2(0x1bf)](_0x1116c2(0x198)+_0x3fe0a8));const _0x4dd5c9=await withSpinner(_0x1116c2(0x1b3)+_0x3fe0a8+'\x27...',()=>_0x1dc3ed[_0x1116c2(0x20c)][_0x1116c2(0x288)](_0x3fe0a8),{'verbose':_0x139480[_0x1116c2(0x1a9)]}),_0x3a621f=_0x4dd5c9['data'];console[_0x1116c2(0x1bf)]('✔\x20Found\x20'+_0x3a621f[_0x1116c2(0x293)]+_0x1116c2(0x29d)+(_0x3a621f['length']!==0x1?'s':''));if(_0x139480['json']||_0x139480[_0x1116c2(0x1df)])return await handleSDKOutput(_0x3a621f,_0x139480),0x0;return displayFieldsHumanReadable(_0x3a621f,_0x3fe0a8),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x21d);[a27_0x5f1085(0x236)]='Show\x20parent\x20segment\x20details';async[a27_0x5f1085(0x24e)](_0x2cbbb1){const _0x227cda=a27_0x5f1085,{options:_0x154109,args:_0x1b928f,tdx:_0x42147a}=_0x2cbbb1,_0x4fc2db=_0x154109,_0x1de7b1=_0x1b928f[0x0]||_0x154109[_0x227cda(0x192)];if(!_0x1de7b1)return console[_0x227cda(0x1bf)](a27_0x4111a0[_0x227cda(0x258)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console['error'](_0x227cda(0x25c)),console[_0x227cda(0x1bf)](_0x227cda(0x214)),console[_0x227cda(0x1bf)](_0x227cda(0x1b6)),console[_0x227cda(0x1bf)](a27_0x4111a0[_0x227cda(0x230)](_0x227cda(0x244))),0x1;_0x154109[_0x227cda(0x1a9)]&&(console[_0x227cda(0x1bf)](_0x227cda(0x193)+_0x154109['site']),console[_0x227cda(0x1bf)]('Parent\x20segment:\x20'+_0x1de7b1));const _0x27b344=await withSpinner(_0x227cda(0x1e7)+_0x1de7b1+_0x227cda(0x260),()=>_0x42147a['segment']['getParentFull'](_0x1de7b1),{'verbose':_0x154109['verbose']}),_0x46c5e5=_0x27b344[_0x227cda(0x235)];if(_0x4fc2db[_0x227cda(0x203)]){const _0x13bda5=getConsoleNextUrl(_0x4fc2db[_0x227cda(0x18f)],'/app/dw/parentSegments/'+_0x46c5e5['id']);return console[_0x227cda(0x1bf)](a27_0x4111a0[_0x227cda(0x1de)]('✔')+_0x227cda(0x23c)+a27_0x4111a0[_0x227cda(0x230)](_0x13bda5)),openBrowser(_0x13bda5),0x0;}return await handleSingleObjectOutput(_0x46c5e5,_0x154109),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0x5f1085(0x19f)]='segment:parent:desc';[a27_0x5f1085(0x236)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a27_0x5f1085(0x24e)](_0x1d7310){const _0x1892d9=a27_0x5f1085,{options:_0x59f9e7,args:_0x26581d,tdx:_0x39f029}=_0x1d7310,_0x50ed2c=_0x26581d[0x0]||_0x59f9e7['parentSegment'];if(!_0x50ed2c)return console[_0x1892d9(0x1bf)](a27_0x4111a0['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x1892d9(0x1bf)]('Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a'),console[_0x1892d9(0x1bf)](a27_0x4111a0[_0x1892d9(0x230)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x59f9e7[_0x1892d9(0x1a9)]&&(console[_0x1892d9(0x1bf)]('Site:\x20'+_0x59f9e7[_0x1892d9(0x18f)]),console['error']('Parent\x20segment:\x20'+_0x50ed2c));const _0x4ad64c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x50ed2c+_0x1892d9(0x260),()=>_0x39f029[_0x1892d9(0x20c)][_0x1892d9(0x1c1)](_0x50ed2c),{'verbose':_0x59f9e7[_0x1892d9(0x1a9)]}),_0x8b5a1b=_0x4ad64c['data'],_0x38bc1b=await withSpinner(_0x1892d9(0x256)+_0x50ed2c+_0x1892d9(0x260),()=>_0x39f029[_0x1892d9(0x20c)][_0x1892d9(0x21c)](_0x8b5a1b),{'verbose':_0x59f9e7['verbose']}),_0x237e6e=await executeSchemaQuery(_0x38bc1b[_0x1892d9(0x235)],_0x39f029,_0x59f9e7);return await handleQueryOutput(_0x237e6e,_0x59f9e7),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0x5f1085(0x19f)]=a27_0x5f1085(0x245);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x282);async[a27_0x5f1085(0x24e)](_0x1bac8c){const _0x318ca7=a27_0x5f1085,{options:_0x36ac4d,args:_0x5b2a4a,tdx:_0x2cc8f0}=_0x1bac8c,_0x122f11=_0x5b2a4a[0x0]||_0x36ac4d[_0x318ca7(0x192)];if(!_0x122f11)return console['error'](a27_0x4111a0['red'](_0x318ca7(0x1e0))),console[_0x318ca7(0x1bf)](_0x318ca7(0x278)),console[_0x318ca7(0x1bf)](a27_0x4111a0[_0x318ca7(0x230)](_0x318ca7(0x18d))),0x1;_0x36ac4d[_0x318ca7(0x1a9)]&&(console[_0x318ca7(0x1bf)](_0x318ca7(0x193)+_0x36ac4d[_0x318ca7(0x18f)]),console[_0x318ca7(0x1bf)](_0x318ca7(0x198)+_0x122f11));const _0x472b1a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x122f11+_0x318ca7(0x260),()=>_0x2cc8f0[_0x318ca7(0x20c)][_0x318ca7(0x1c1)](_0x122f11),{'verbose':_0x36ac4d[_0x318ca7(0x1a9)]}),_0xbe059f=_0x472b1a[_0x318ca7(0x235)],_0x1413c5=await withSpinner(_0x318ca7(0x256)+_0x122f11+_0x318ca7(0x260),()=>_0x2cc8f0[_0x318ca7(0x20c)][_0x318ca7(0x21c)](_0xbe059f),{'verbose':_0x36ac4d['verbose']}),_0x487ca8=_0x1413c5['data'];return _0x36ac4d[_0x318ca7(0x1e9)]==='json'||_0x36ac4d['format']==='jsonl'?await handleSDKOutput([{'sql':_0x487ca8}],_0x36ac4d):console['log'](_0x487ca8),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a27_0x5f1085(0x251);[a27_0x5f1085(0x236)]=a27_0x5f1085(0x22e);async[a27_0x5f1085(0x24e)](_0x1d036a){const _0xb72a08=a27_0x5f1085,{options:_0x12e14a,args:_0x4445cd,tdx:_0x4f19bc}=_0x1d036a,_0x2539b0=_0x4445cd[0x0]||_0x12e14a[_0xb72a08(0x192)];if(!_0x2539b0)return console[_0xb72a08(0x1bf)](a27_0x4111a0['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console['error']('Usage:\x20tdx\x20ps\x20show\x20[name]\x0a'),console[_0xb72a08(0x1bf)](a27_0x4111a0[_0xb72a08(0x230)](_0xb72a08(0x18d))),0x1;_0x12e14a[_0xb72a08(0x1a9)]&&(console[_0xb72a08(0x1bf)]('Site:\x20'+_0x12e14a[_0xb72a08(0x18f)]),console[_0xb72a08(0x1bf)](_0xb72a08(0x198)+_0x2539b0));const _0x4eef86=await withSpinner(_0xb72a08(0x26f)+_0x2539b0+_0xb72a08(0x260),()=>_0x4f19bc[_0xb72a08(0x20c)][_0xb72a08(0x1c1)](_0x2539b0),{'verbose':_0x12e14a[_0xb72a08(0x1a9)]}),_0x3ab308=_0x4eef86[_0xb72a08(0x235)],_0x2c1634=await withSpinner(_0xb72a08(0x256)+_0x2539b0+_0xb72a08(0x260),()=>_0x4f19bc[_0xb72a08(0x20c)][_0xb72a08(0x21c)](_0x3ab308),{'verbose':_0x12e14a[_0xb72a08(0x1a9)]});let _0x1a97d2=_0x2c1634['data'];const _0x3a9e1c=resolveLimit(_0x12e14a[_0xb72a08(0x1ba)],DEFAULT_DISPLAY_LIMIT),_0x4704bb=/\bLIMIT\s+\d+/i[_0xb72a08(0x2a0)](_0x1a97d2);!_0x4704bb&&(_0x1a97d2=_0x1a97d2[_0xb72a08(0x23e)]()[_0xb72a08(0x1cb)](/;+$/,''),_0x1a97d2=_0xb72a08(0x226)+_0x1a97d2+_0xb72a08(0x1d6)+_0x3a9e1c);_0x12e14a['verbose']&&console[_0xb72a08(0x1bf)](_0xb72a08(0x1b2)+_0x1a97d2);const _0x16e72d=await withQuerySpinner(_0xb72a08(0x253),async _0x5d0ea7=>{const _0x1025b5=_0xb72a08,_0xe374e7=await _0x4f19bc[_0x1025b5(0x1d8)]['execute'](_0x1a97d2,{'catalog':'td','schema':'information_schema','onJobId':_0x4937dd=>{const _0xc17871=_0x1025b5;_0x5d0ea7[_0xc17871(0x1d7)](_0x4937dd);}});return _0xe374e7;},{'verbose':_0x12e14a[_0xb72a08(0x1a9)]}),_0x4f5dc8=_0x16e72d[_0xb72a08(0x235)],_0xb0f810=_0x4f5dc8[_0xb72a08(0x1aa)]?_0xb72a08(0x188)+_0x4f5dc8[_0xb72a08(0x1aa)]+']':'';return console[_0xb72a08(0x1bf)](_0xb72a08(0x1e2)+_0x4f5dc8['stats'][_0xb72a08(0x1fe)][_0xb72a08(0x1cf)]()+_0xb72a08(0x1c0)+('in\x20'+formatElapsed(_0x4f5dc8[_0xb72a08(0x234)][_0xb72a08(0x25d)])+_0xb0f810)),await handleQueryOutput(_0x4f5dc8,_0x12e14a),0x0;}}
1
+ const a27_0x30a75a=a27_0x35ca;(function(_0x23f6e8,_0x4096c9){const _0x3fcca8=a27_0x35ca,_0x46043c=_0x23f6e8();while(!![]){try{const _0x4bbd72=parseInt(_0x3fcca8(0x230))/0x1+parseInt(_0x3fcca8(0x229))/0x2*(-parseInt(_0x3fcca8(0x2b3))/0x3)+parseInt(_0x3fcca8(0x215))/0x4*(parseInt(_0x3fcca8(0x2ec))/0x5)+parseInt(_0x3fcca8(0x2bb))/0x6*(-parseInt(_0x3fcca8(0x1f4))/0x7)+-parseInt(_0x3fcca8(0x24f))/0x8+parseInt(_0x3fcca8(0x2a7))/0x9+parseInt(_0x3fcca8(0x21c))/0xa;if(_0x4bbd72===_0x4096c9)break;else _0x46043c['push'](_0x46043c['shift']());}catch(_0x498c1c){_0x46043c['push'](_0x46043c['shift']());}}}(a27_0x36e2,0xc0d35));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0xb285cd 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';function a27_0x36e2(){const _0x33b68e=['filter','preview','\x0a⚠️\x20\x20Both\x20','format','bold','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Resolving\x20parent\x20segment\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','sort','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','green','jobId','\x27\x20and\x20run\x20workflow?','Overwrite\x20\x27','ignore','\x20tdx\x20wf\x20attempt\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','allValid','segment:parent:fields','Coverage:','keys','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','Fetching\x20parent\x20segment\x20\x27','label','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20Configuration\x20is\x20valid','xdg-open','\x27...','join','rowCount','Events:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','population','\x0a✔\x20Workflow\x20started','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','tdx\x20segment\x20parent\x20preview\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20is\x20already\x20up\x20to\x20date','Created','win32','text','Site:\x20','Enriched:','parent_segments','joinKey','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','processedRows','Analyzing\x20changes...','displayValidateResults','Available\x20behaviors:','Errors:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Pattern:\x20','Listing\x20fields\x20for\x20\x27','Join\x20on:','log','output','test','Show\x20parent\x20segment\x20schema\x20(column\x20types)','json','displaySummary','getParentSQL','Attributes','parentSegment','displayPreviewHints','\x20Opening\x20','/app/dw/parentSegments/','updateParent','customersWithEvents','schemaValid','YAML\x20file:\x20','varchar','Executing\x20parent\x20segment\x20query...','scheduleOption','displayPreviewResults','Creating','1993077NXFBVy','Join:','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','No\x20parent\x20segments\x20found','\x20=\x20','\x27\x20with\x20ID:\x20','columns','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✘\x20Failed\x20to\x20rename\x20directory:\x20','pullParentYaml','coveragePercent','36609vXtcMS','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','length','runParent','Columns:','errors','✔\x20No\x20changes\x20-\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','6dIPvjE','Attempt:','\x20--behavior\x20\x22','apply','SQL\x20query:\x0a','listFields','matchedCount','Updating','foreignKey','Source:','segment:parent:validate','\x20No\x20changes\x20-\x20','/sessions/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','toLowerCase','utf-8','Error:\x20--behavior\x20requires\x20a\x20name\x0a','message','Updating\x20parent\x20segment\x20\x27','👥\x20','scheduleType','workflowAttemptId','Error:\x20--attribute\x20requires\x20a\x20name\x0a','previewParentYaml','dim','double','Audience\x20ID:','Database:\x20','\x0aChanges\x20to\x20\x27','\x20--behavior\x20\x22<name>\x22','.yaml','totalEvents','Behavior:','FINISHED','toLocaleString','name','Options:','List\x20parent\x20segments','Show\x20parent\x20segment\x20details','attributes','Listing\x20parent\x20segments...','trim','table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','Master\x20Table','\x20[Job\x20ID:\x20','behavior','\x20Context\x20set:\x20','displayMasterInfo','3800675aFJYfM','resolveParentId','Fetching\x20sample\x20data...','\x20parent\x20segment','createParent','segment:parent:create','\x0a⚠️\x20\x20Migrating:\x20','stats','start','jsonl','customerGroupFile','Output\x20file:\x20','`\x20to\x20download\x20the\x20configuration\x20first','segment:parent:show','match','toFixed','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','.yml','platform','pushParentYaml','interval','Preview:','Parent\x20segment:\x20','stop','using\x20the\x20default\x20path:\x20','replace','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','yes','Create\x20parent\x20segment\x20\x27','attribute','data','Apply\x20changes\x20to\x20\x27','\x0aNo\x20sample\x20data\x20available','open','cyan','behaviorsFile','verbose','in\x20','\x20--enriched','yellow','Listing\x20parent\x20segments\x20matching\x20\x27','darwin','SELECT\x20*\x20FROM\x20(\x0a','audienceId','\x20--interval\x20','/\x20→\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','5236882EUiyZi','workflowId','Fetching\x20current\x20configuration\x20for\x20\x27','addAttributes','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','column','segment:parent:desc','displayBehaviorsStats','Customers:','setJobId','schemaError','Available\x20attributes:','enriched','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','✔\x20Found\x20','-1d','error','✔\x20Renamed\x20directory\x20to\x20','\x20kill','\x20\x20\x20\x20-\x20','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','unref','displaySampleData','Aborted.','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','red','\x20--attribute\x20\x22','\x20\x20No\x20sample\x20data\x20available','sampleData','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','addAttributesFile','isDirectory','4IiUzrp','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x0aChanges\x20to\x20apply\x20to\x20\x27','use','workflowSessionId','repeat','segment:parent:run','14147010QXNAxe','getParentFull','Error\x20reading\x20file:\x20','/{name}.yml\x0a','validateParentYaml','database','Updated','session','string','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','displayColumns','\x27\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','82cCfSao','timezone','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','localeCompare','/\x20directory.\x0a','\x20rows)','1180151rEkWfh','behaviors','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','listParents','\x0aNew\x20parent\x20segment\x20\x27','execute','Error:\x20--database\x20and\x20--table\x20are\x20required','customerPercent','site','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','run','description','Behaviors','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment','all','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Fetching\x20SQL\x20for\x20\x27','\x20parent\x20segment\x20\x27','Options\x20(one\x20required):','\x0aUsage:\x20tdx\x20ps\x20preview\x20','✔\x20Query\x20completed:\x20Processed\x20','addBehaviorsFile','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','dirname','addBehaviors','displayAttributesStats','Error:','parent_segment','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:push','12305424qrOCpQ','endsWith','number','\x20rows\x20','query','Attribute:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Status:','master'];a27_0x36e2=function(){return _0x33b68e;};return a27_0x36e2();}function a27_0x35ca(_0x439e34,_0x59b56f){_0x439e34=_0x439e34-0x1e5;const _0x36e288=a27_0x36e2();let _0x35ca1e=_0x36e288[_0x439e34];return _0x35ca1e;}import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x44fedf from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0x30a75a(0x284),LEGACY_PARENT_SEGMENT_DIR=a27_0x30a75a(0x24c);function openBrowser(_0xb7f3cb){const _0x5c2927=a27_0x30a75a,_0x428ef7=process[_0x5c2927(0x2fe)],_0x5927c8=_0x428ef7===_0x5c2927(0x1ee)?_0x5c2927(0x1e6):_0x428ef7===_0x5c2927(0x280)?_0x5c2927(0x2f4):_0x5c2927(0x273);spawn(_0x5927c8,[_0xb7f3cb],{'detached':!![],'stdio':_0x5c2927(0x266)})[_0x5c2927(0x20a)]();}function sanitizeFileName(_0x188f75){const _0x34e308=a27_0x30a75a;return _0x188f75[_0x34e308(0x2c9)]()[_0x34e308(0x305)](/[/\\:*?"<>|]/g,'-')[_0x34e308(0x305)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x34e308(0x305)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0x5a7608=a27_0x30a75a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x568617=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x568617[_0x5a7608(0x214)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5a7608(0x205)](a27_0x44fedf['yellow'](_0x5a7608(0x25a)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x5a7608(0x205)](a27_0x44fedf[_0x5a7608(0x2d3)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5a7608(0x22e))),![];console['error'](a27_0x44fedf['yellow'](_0x5a7608(0x2f2)+LEGACY_PARENT_SEGMENT_DIR+_0x5a7608(0x1f2)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5a7608(0x205)](a27_0x44fedf[_0x5a7608(0x262)](_0x5a7608(0x206)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x512dc7){const _0x368565=_0x512dc7 instanceof Error?_0x512dc7[_0x5a7608(0x2cc)]:String(_0x512dc7);return console['error'](a27_0x44fedf['red'](_0x5a7608(0x2b0)+_0x368565+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x3f789a){const _0x546d6c=a27_0x30a75a;return migrateLegacyDirectory(),super[_0x546d6c(0x23a)](_0x3f789a);}}function resolveYamlFile(_0x3be3f8){const _0x2984f1=a27_0x30a75a;if(_0x3be3f8['endsWith'](_0x2984f1(0x2fd))||_0x3be3f8[_0x2984f1(0x250)](_0x2984f1(0x2d9)))return _0x3be3f8;return a27_0xb285cd[_0x2984f1(0x275)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3be3f8)+'.yml');}function formatProgressMessage(_0x2cf8ff){const _0x4095b3=a27_0x30a75a,_0x809bf0=_0x2cf8ff[_0x4095b3(0x2fa)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x809bf0){const [,_0x3df69c,_0x1a5a3e,_0x1e367c='']=_0x809bf0;return a27_0x44fedf['dim'](_0x3df69c+':')+'\x20'+_0x1a5a3e+a27_0x44fedf[_0x4095b3(0x2d3)](_0x1e367c);}return a27_0x44fedf[_0x4095b3(0x2d3)](_0x2cf8ff);}function showFileNotFoundError(_0x19875f,_0x467aef){const _0x2604f7=a27_0x30a75a;console['error'](a27_0x44fedf[_0x2604f7(0x20e)]('Error:\x20File\x20not\x20found:\x20'+_0x19875f+'\x0a')),console[_0x2604f7(0x205)](a27_0x44fedf[_0x2604f7(0x1e7)](_0x2604f7(0x27d)+_0x467aef+_0x2604f7(0x2f8)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:list';['description']=a27_0x30a75a(0x2e0);async[a27_0x30a75a(0x235)](_0x301dec){const _0x196d99=a27_0x30a75a,{options:_0x335d33,args:_0x519a2f,tdx:_0x56ea1c}=_0x301dec,_0x2229e9=_0x519a2f[0x0];_0x335d33['verbose']&&(console['error'](_0x196d99(0x282)+_0x335d33[_0x196d99(0x238)]),_0x2229e9&&console[_0x196d99(0x205)](_0x196d99(0x28f)+_0x2229e9));const _0x1fe611=await withSpinner(_0x2229e9?_0x196d99(0x1ed)+_0x2229e9+_0x196d99(0x274):_0x196d99(0x2e3),()=>_0x56ea1c['segment'][_0x196d99(0x233)](),{'verbose':_0x335d33[_0x196d99(0x1e9)]});let _0x57a615=_0x1fe611[_0x196d99(0x30a)];if(_0x2229e9){const _0x4d6f37=_0x2229e9['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x196d99(0x305)](/\*/g,'.*')[_0x196d99(0x305)](/\?/g,'.'),_0x5e2c8e=new RegExp('^'+_0x4d6f37+'$','i');_0x57a615=_0x57a615[_0x196d99(0x258)](_0x3f76ac=>_0x5e2c8e[_0x196d99(0x294)](_0x3f76ac['attributes']['name']));}_0x57a615[_0x196d99(0x260)]((_0x38e090,_0x170b21)=>_0x38e090['attributes'][_0x196d99(0x2de)][_0x196d99(0x22d)](_0x170b21[_0x196d99(0x2e2)][_0x196d99(0x2de)])),console['error'](_0x196d99(0x203)+_0x57a615[_0x196d99(0x2b5)]+_0x196d99(0x2ef)+(_0x57a615[_0x196d99(0x2b5)]!==0x1?'s':''));if(_0x335d33['format']===_0x196d99(0x296)||_0x335d33['format']===_0x196d99(0x2f5))await handleSDKOutput(_0x57a615,_0x335d33);else{if(_0x57a615[_0x196d99(0x2b5)]===0x0)_0x2229e9?console[_0x196d99(0x292)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2229e9):console[_0x196d99(0x292)](_0x196d99(0x2ab));else for(const _0x3ea2eb of _0x57a615){const _0xbb2b0c=_0x3ea2eb[_0x196d99(0x2e2)]['population']?a27_0x44fedf['dim']('\x20('+formatRows(_0x3ea2eb[_0x196d99(0x2e2)][_0x196d99(0x279)])+')'):'';console[_0x196d99(0x292)](_0x196d99(0x2ce)+_0x3ea2eb['attributes'][_0x196d99(0x2de)]+_0xbb2b0c);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2f1);['description']=a27_0x30a75a(0x2af);async[a27_0x30a75a(0x235)](_0x219eba){const _0x10dbca=a27_0x30a75a,{options:_0x4b506a,args:_0x2ec14a,tdx:_0x544b11}=_0x219eba;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x10dbca(0x28e)+_0x10dbca(0x228));const _0xfdd04c=_0x4b506a;if(_0x2ec14a['length']===0x0)return console[_0x10dbca(0x205)](_0x10dbca(0x23d)),console[_0x10dbca(0x205)](_0x10dbca(0x2aa)),0x1;const _0x224523=_0x2ec14a[0x0];if(!_0xfdd04c['database']||!_0xfdd04c['table'])return console[_0x10dbca(0x205)](_0x10dbca(0x236)),console[_0x10dbca(0x205)](_0x10dbca(0x2aa)),0x1;_0xfdd04c[_0x10dbca(0x1e9)]&&(console['error'](_0x10dbca(0x282)+_0xfdd04c[_0x10dbca(0x238)]),console[_0x10dbca(0x205)]('Name:\x20'+_0x224523),console[_0x10dbca(0x205)](_0x10dbca(0x2d6)+_0xfdd04c[_0x10dbca(0x221)]),console[_0x10dbca(0x205)]('Table:\x20'+_0xfdd04c['table']));const _0x233ab4=await loadJSONFromOptions(_0xfdd04c[_0x10dbca(0x2e2)],_0xfdd04c['attributesFile']),_0x5b0aa8=await loadJSONFromOptions(_0xfdd04c['behaviors'],_0xfdd04c[_0x10dbca(0x1e8)]),_0x3ecf4d=await loadJSONFromOptions(_0xfdd04c['customerGroup'],_0xfdd04c[_0x10dbca(0x2f6)]),_0x368fa9={'name':_0x224523,'description':_0xfdd04c[_0x10dbca(0x23b)],'scheduleType':_0xfdd04c[_0x10dbca(0x2cf)],'scheduleOption':_0xfdd04c[_0x10dbca(0x2a4)],'timezone':_0xfdd04c[_0x10dbca(0x22a)],'master':{'parentDatabaseName':_0xfdd04c[_0x10dbca(0x221)],'parentTableName':_0xfdd04c[_0x10dbca(0x2e5)]},'attributes':_0x233ab4,'behaviors':_0x5b0aa8,'customerGroup':_0x3ecf4d},_0x16fad2=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x224523+_0x10dbca(0x274),()=>_0x544b11[_0x10dbca(0x23e)][_0x10dbca(0x2f0)](_0x368fa9),{'verbose':_0x4b506a[_0x10dbca(0x1e9)]}),_0xe539f6=_0x16fad2['data'];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0xe539f6['name']+_0x10dbca(0x2ad)+_0xe539f6['id']),await handleSDKOutput([_0xe539f6],_0x4b506a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:update';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x232);async[a27_0x30a75a(0x235)](_0xbe24e5){const _0x2425da=a27_0x30a75a,{options:_0x16b2c6,args:_0x209eda,tdx:_0x209392}=_0xbe24e5;console[_0x2425da(0x205)](_0x2425da(0x2c8)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2425da(0x228));const _0x890642=_0x16b2c6;if(_0x209eda[_0x2425da(0x2b5)]===0x0)return console[_0x2425da(0x205)](_0x2425da(0x23d)),console[_0x2425da(0x205)](_0x2425da(0x212)),0x1;const _0x556617=_0x209eda[0x0];_0x890642[_0x2425da(0x1e9)]&&(console['error'](_0x2425da(0x282)+_0x890642[_0x2425da(0x238)]),console['error'](_0x2425da(0x302)+_0x556617));const _0x188af9=await withSpinner(_0x2425da(0x1f6)+_0x556617+_0x2425da(0x274),()=>_0x209392[_0x2425da(0x23e)][_0x2425da(0x21d)](_0x556617),{'verbose':_0x890642[_0x2425da(0x1e9)]}),_0x1f3f00=_0x188af9[_0x2425da(0x30a)],_0x2c6a51=await loadJSONFromOptions(_0x890642[_0x2425da(0x1f7)],_0x890642[_0x2425da(0x213)]),_0x3bb1ba=await loadJSONFromOptions(_0x890642[_0x2425da(0x249)],_0x890642[_0x2425da(0x246)]),_0x3e0207={'name':_0x1f3f00[_0x2425da(0x2de)],'description':_0x890642[_0x2425da(0x23b)]!==undefined?_0x890642[_0x2425da(0x23b)]:_0x1f3f00[_0x2425da(0x23b)],'scheduleType':_0x890642['scheduleType']!==undefined?_0x890642[_0x2425da(0x2cf)]:_0x1f3f00['scheduleType'],'scheduleOption':_0x890642[_0x2425da(0x2a4)]!==undefined?_0x890642[_0x2425da(0x2a4)]:_0x1f3f00[_0x2425da(0x2a4)],'timezone':_0x890642[_0x2425da(0x22a)]!==undefined?_0x890642['timezone']:_0x1f3f00[_0x2425da(0x22a)],'master':_0x1f3f00[_0x2425da(0x257)],'attributes':_0x2c6a51?[..._0x1f3f00[_0x2425da(0x2e2)]||[],..._0x2c6a51]:_0x1f3f00[_0x2425da(0x2e2)],'behaviors':_0x3bb1ba?[..._0x1f3f00[_0x2425da(0x231)]||[],..._0x3bb1ba]:_0x1f3f00[_0x2425da(0x231)],'customerGroup':_0x1f3f00['customerGroup']},_0x312e1d=await withSpinner(_0x2425da(0x2cd)+_0x556617+_0x2425da(0x274),()=>_0x209392[_0x2425da(0x23e)][_0x2425da(0x29e)](_0x556617,_0x3e0207),{'verbose':_0x890642[_0x2425da(0x1e9)]}),_0x15c430=_0x312e1d[_0x2425da(0x30a)];return console[_0x2425da(0x205)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x15c430['name']+'\x27'),await handleSDKOutput([_0x15c430],_0x890642),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]='segment:parent:pull';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x255);async[a27_0x30a75a(0x235)](_0x10b570){const _0x1b0bfb=a27_0x30a75a,{options:_0xb9253e,args:_0x2ff880,tdx:_0x27866d}=_0x10b570,_0x51f581=_0xb9253e,_0x31ce8f=_0x2ff880[0x0]||_0xb9253e['parentSegment'];if(!_0x31ce8f)return console[_0x1b0bfb(0x205)](a27_0x44fedf['red'](_0x1b0bfb(0x22c))),console[_0x1b0bfb(0x205)](_0x1b0bfb(0x287)),console['error'](a27_0x44fedf[_0x1b0bfb(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;if(_0x51f581[_0x1b0bfb(0x218)]&&_0x51f581[_0x1b0bfb(0x293)])return console[_0x1b0bfb(0x205)](a27_0x44fedf['red']('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x1b0bfb(0x205)](a27_0x44fedf[_0x1b0bfb(0x2d3)](_0x1b0bfb(0x216))),console[_0x1b0bfb(0x205)](a27_0x44fedf['dim'](_0x1b0bfb(0x304)+PARENT_SEGMENT_DIR+_0x1b0bfb(0x21f))),console[_0x1b0bfb(0x205)](a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x1b0bfb(0x2b4))),0x1;const _0x6583c=_0x51f581[_0x1b0bfb(0x293)]||a27_0xb285cd[_0x1b0bfb(0x275)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x31ce8f)+_0x1b0bfb(0x2fd));_0x51f581[_0x1b0bfb(0x1e9)]&&(console['error']('Site:\x20'+_0x51f581[_0x1b0bfb(0x238)]),console['error'](_0x1b0bfb(0x302)+_0x31ce8f),console[_0x1b0bfb(0x205)](_0x1b0bfb(0x2f7)+_0x6583c));const _0x16a614=await withSpinner(_0x1b0bfb(0x26e)+_0x31ce8f+_0x1b0bfb(0x274),()=>_0x27866d[_0x1b0bfb(0x23e)][_0x1b0bfb(0x2b1)](_0x31ce8f),{'verbose':_0x51f581[_0x1b0bfb(0x1e9)]}),_0x4faa91=_0x16a614[_0x1b0bfb(0x30a)];if(existsSync(_0x6583c)){const _0x586b5d=readFileSync(_0x6583c,'utf-8'),_0x2df525=generateDiff(_0x586b5d,_0x4faa91);if(!hasChanges(_0x2df525))console['error'](a27_0x44fedf['green']('✔')+_0x1b0bfb(0x2c6)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c)+_0x1b0bfb(0x27e));else{console[_0x1b0bfb(0x205)](_0x1b0bfb(0x2d7)+_0x6583c+'\x27:'),console[_0x1b0bfb(0x205)]('─'[_0x1b0bfb(0x21a)](0x3c)),console['error'](formatDiffWithColors(_0x2df525)),console[_0x1b0bfb(0x205)]('─'[_0x1b0bfb(0x21a)](0x3c));if(!_0x51f581[_0x1b0bfb(0x307)]){const _0x1468df=await confirmKey(_0x1b0bfb(0x265)+_0x6583c+'\x27?');if(!_0x1468df)return console['error'](_0x1b0bfb(0x20c)),0x1;}writeFileSync(_0x6583c,_0x4faa91,_0x1b0bfb(0x2ca)),console['error'](a27_0x44fedf[_0x1b0bfb(0x262)]('✔')+_0x1b0bfb(0x268)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c));}}else{const _0x9194a8=a27_0xb285cd[_0x1b0bfb(0x248)](_0x6583c);!existsSync(_0x9194a8)&&mkdirSync(_0x9194a8,{'recursive':!![]}),writeFileSync(_0x6583c,_0x4faa91,_0x1b0bfb(0x2ca)),console['error'](a27_0x44fedf[_0x1b0bfb(0x262)]('✔')+_0x1b0bfb(0x268)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c));}return saveSessionContext({'parent_segment':_0x31ce8f},_0x51f581[_0x1b0bfb(0x223)]),console[_0x1b0bfb(0x205)](a27_0x44fedf['green']('✔')+_0x1b0bfb(0x2ea)+a27_0x44fedf[_0x1b0bfb(0x2d3)](_0x1b0bfb(0x24c))+_0x1b0bfb(0x2ac)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x31ce8f)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0x30a75a(0x24e);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x306);async[a27_0x30a75a(0x235)](_0x485597){const _0x182f14=a27_0x30a75a,{options:_0x21affd,args:_0x1f5540,tdx:_0x4c0f6e}=_0x485597,_0x4e7138=_0x21affd,_0x198d2f=_0x1f5540[0x0]||_0x21affd[_0x182f14(0x29a)];if(!_0x198d2f)return console['error'](a27_0x44fedf[_0x182f14(0x20e)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x182f14(0x205)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console['error'](a27_0x44fedf[_0x182f14(0x1e7)](_0x182f14(0x27b))),0x1;const _0x45fe2c=resolveYamlFile(_0x198d2f);if(!existsSync(_0x45fe2c))return showFileNotFoundError(_0x45fe2c,_0x198d2f),0x1;_0x4e7138[_0x182f14(0x1e9)]&&(console['error'](_0x182f14(0x282)+_0x4e7138[_0x182f14(0x238)]),console['error'](_0x182f14(0x2a1)+_0x45fe2c));let _0x5220d0;try{_0x5220d0=readFileSync(_0x45fe2c,_0x182f14(0x2ca));}catch(_0x400434){const _0x340c86=_0x400434 instanceof Error?_0x400434[_0x182f14(0x2cc)]:String(_0x400434);return console['error'](_0x182f14(0x21e)+_0x340c86),0x1;}const _0x12283d=await withSpinner(_0x182f14(0x28a),()=>_0x4c0f6e[_0x182f14(0x23e)][_0x182f14(0x2ff)](_0x5220d0),{'verbose':_0x4e7138['verbose']}),_0x35f20b=_0x12283d[_0x182f14(0x30a)],{isNew:_0x32ddb0,name:_0x566c53,hasChanges:_0x28dead,diffFormatted:_0x235431}=_0x35f20b;if(!_0x28dead)return console[_0x182f14(0x205)]('✔\x20No\x20changes\x20-\x20\x27'+_0x566c53+_0x182f14(0x227)),0x0;_0x32ddb0?console[_0x182f14(0x205)](_0x182f14(0x234)+_0x566c53+'\x27:'):console['error'](_0x182f14(0x217)+_0x566c53+'\x27:');console['error']('─'[_0x182f14(0x21a)](0x3c)),console[_0x182f14(0x205)](_0x235431),console[_0x182f14(0x205)]('─'['repeat'](0x3c));const _0x210743=_0x32ddb0?_0x182f14(0x308)+_0x566c53+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x566c53+'\x27?';if(!_0x4e7138['yes']){const _0x5e1dea=await confirmKey(_0x210743);if(!_0x5e1dea)return console[_0x182f14(0x205)](_0x182f14(0x20c)),0x1;}const _0x37d0b1=_0x32ddb0?_0x182f14(0x2a6):_0x182f14(0x2c2),_0x953f71=await withSpinner(_0x37d0b1+_0x182f14(0x242)+_0x566c53+_0x182f14(0x274),()=>_0x35f20b[_0x182f14(0x2be)](),{'verbose':_0x4e7138[_0x182f14(0x1e9)]}),_0x3f0c74=_0x953f71[_0x182f14(0x30a)],_0x2ed640=getConsoleNextUrl(_0x4e7138['site'],_0x182f14(0x29d)+_0x3f0c74['id']),_0x1fc621=_0x32ddb0?_0x182f14(0x27f):_0x182f14(0x222);return console['error']('✔\x20'+_0x1fc621+'\x20parent\x20segment\x20\x27'+_0x3f0c74[_0x182f14(0x2de)]+'\x27'),console[_0x182f14(0x205)]('\x20\x20'+_0x2ed640),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2c5);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x1f3);async[a27_0x30a75a(0x235)](_0x5a48c1){const _0x49196e=a27_0x30a75a,{options:_0x194548,args:_0x471aa3,tdx:_0x470d67}=_0x5a48c1,_0x5660f4=_0x194548,_0x3b7536=_0x471aa3[0x0]||_0x194548[_0x49196e(0x29a)];if(!_0x3b7536)return console[_0x49196e(0x205)](a27_0x44fedf['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x49196e(0x205)](_0x49196e(0x225)),console[_0x49196e(0x205)]('Options:'),console[_0x49196e(0x205)](_0x49196e(0x202)),console[_0x49196e(0x205)](_0x49196e(0x2e6)),console[_0x49196e(0x205)](_0x49196e(0x240)),console[_0x49196e(0x205)](a27_0x44fedf[_0x49196e(0x1e7)]('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x26d7db=resolveYamlFile(_0x3b7536);if(!existsSync(_0x26d7db))return showFileNotFoundError(_0x26d7db,_0x3b7536),0x1;_0x5660f4[_0x49196e(0x1e9)]&&(console[_0x49196e(0x205)](_0x49196e(0x282)+_0x5660f4[_0x49196e(0x238)]),console[_0x49196e(0x205)](_0x49196e(0x2a1)+_0x26d7db));let _0x547f44;try{_0x547f44=readFileSync(_0x26d7db,'utf-8');}catch(_0x483aa5){const _0x5efa6a=_0x483aa5 instanceof Error?_0x483aa5['message']:String(_0x483aa5);return console[_0x49196e(0x205)](_0x49196e(0x21e)+_0x5efa6a),0x1;}const _0x47db24=createCommandSpinner(a27_0x44fedf['dim']('Validating\x20configuration...'),{'verbose':_0x5660f4[_0x49196e(0x1e9)]});_0x47db24['start']();const _0x8b91bd={'onProgress':_0x907597=>{_0x47db24['text']=formatProgressMessage(_0x907597);}};if(_0x5660f4[_0x49196e(0x257)])_0x8b91bd[_0x49196e(0x257)]=!![];if(_0x5660f4[_0x49196e(0x201)])_0x8b91bd[_0x49196e(0x201)]=!![];_0x5660f4['attribute']&&(_0x8b91bd[_0x49196e(0x309)]=_0x5660f4[_0x49196e(0x309)]);_0x5660f4[_0x49196e(0x2e9)]&&(_0x8b91bd[_0x49196e(0x2e9)]=_0x5660f4[_0x49196e(0x2e9)]);if(_0x5660f4[_0x49196e(0x300)])_0x8b91bd['interval']=_0x5660f4[_0x49196e(0x300)];let _0x4c9760;try{_0x4c9760=await _0x470d67[_0x49196e(0x23e)][_0x49196e(0x220)](_0x547f44,_0x8b91bd),_0x47db24[_0x49196e(0x303)]();}catch(_0x19dbad){_0x47db24[_0x49196e(0x303)]();throw _0x19dbad;}const _0xb334b9=_0x5660f4[_0x49196e(0x300)]||_0x49196e(0x204);return this[_0x49196e(0x28b)](_0x4c9760,_0x8b91bd,_0x26d7db,_0xb334b9),_0x4c9760[_0x49196e(0x269)]?0x0:0x1;}['displayValidateResults'](_0x42e583,_0x23daa2,_0x1f7f73,_0xe5fd9c){const _0x59eb2a=a27_0x30a75a;console[_0x59eb2a(0x205)]('\x0a'+a27_0x44fedf[_0x59eb2a(0x25c)]('Validate:')+'\x20'+_0x42e583[_0x59eb2a(0x2de)]),console['error']('═'[_0x59eb2a(0x21a)](0x3c)),this[_0x59eb2a(0x2eb)](_0x42e583);if(typeof _0x23daa2[_0x59eb2a(0x309)]==='string'){this['displayAttributesStats'](_0x42e583),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x309),_0x23daa2['attribute']);return;}if(_0x23daa2[_0x59eb2a(0x309)]===!![]){this[_0x59eb2a(0x24a)](_0x42e583),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x2e2));return;}if(typeof _0x23daa2[_0x59eb2a(0x2e9)]===_0x59eb2a(0x224)){this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this[_0x59eb2a(0x29b)](_0x1f7f73,_0xe5fd9c,'behavior',_0x23daa2['behavior']);return;}if(_0x23daa2[_0x59eb2a(0x2e9)]===!![]){this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,'behaviors');return;}this[_0x59eb2a(0x24a)](_0x42e583),this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this[_0x59eb2a(0x29b)](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x23f));}[a27_0x30a75a(0x29b)](_0x131945,_0x17908b,_0x419fe1,_0x4b8d30){const _0x56197a=a27_0x30a75a;console[_0x56197a(0x205)]('\x0a'+a27_0x44fedf[_0x56197a(0x2d3)]('To\x20view\x20sample\x20data:'));const _0x51149a=_0x17908b!=='-1d'?_0x56197a(0x1f1)+_0x17908b:'';if(_0x419fe1==='attribute'&&_0x4b8d30)console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)]('tdx\x20segment\x20parent\x20preview\x20'+_0x131945+_0x56197a(0x20f)+_0x4b8d30+'\x22'+_0x51149a));else{if(_0x419fe1===_0x56197a(0x2e9)&&_0x4b8d30)console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x56197a(0x27c)+_0x131945+_0x56197a(0x2bd)+_0x4b8d30+'\x22'+_0x51149a));else(_0x419fe1===_0x56197a(0x2e2)||_0x419fe1===_0x56197a(0x23f))&&console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)](_0x56197a(0x27c)+_0x131945+'\x20--attribute\x20\x22<name>\x22'+_0x51149a));}(_0x419fe1==='behaviors'||_0x419fe1===_0x56197a(0x23f))&&console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x56197a(0x27c)+_0x131945+_0x56197a(0x2d8)+_0x51149a)),_0x419fe1==='all'&&console['error']('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)](_0x56197a(0x27c)+_0x131945+_0x56197a(0x1eb)+_0x51149a));}['displayMasterInfo'](_0x1de8d9){const _0x3010f1=a27_0x30a75a,{master:_0x2a38ba}=_0x1de8d9,_0x4c88d0=_0x2a38ba[_0x3010f1(0x2a0)]?a27_0x44fedf[_0x3010f1(0x262)]('✔'):a27_0x44fedf[_0x3010f1(0x20e)]('✘');console[_0x3010f1(0x205)]('\x0a'+a27_0x44fedf[_0x3010f1(0x2d3)](_0x3010f1(0x2e7))),console['error'](_0x4c88d0+'\x20'+a27_0x44fedf['bold'](_0x2a38ba[_0x3010f1(0x221)]+'.'+_0x2a38ba['table'])),_0x2a38ba[_0x3010f1(0x2a0)]?_0x2a38ba[_0x3010f1(0x276)]!==undefined&&console[_0x3010f1(0x205)]('\x20\x20'+a27_0x44fedf[_0x3010f1(0x2d3)]('Rows:')+'\x20'+a27_0x44fedf[_0x3010f1(0x1e7)](formatRows(_0x2a38ba[_0x3010f1(0x276)]))):console[_0x3010f1(0x205)]('\x20\x20'+a27_0x44fedf[_0x3010f1(0x20e)](_0x3010f1(0x24b))+'\x20'+_0x2a38ba['schemaError']);}[a27_0x30a75a(0x24a)](_0xb1e83f){const _0x594535=a27_0x30a75a;if(_0xb1e83f[_0x594535(0x2e2)][_0x594535(0x2b5)]===0x0)return;console[_0x594535(0x205)]('\x0a'+a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x299)));for(const _0x534552 of _0xb1e83f['attributes']){const _0x2f7d4e=_0x534552[_0x594535(0x2a0)]?a27_0x44fedf[_0x594535(0x262)]('✔'):a27_0x44fedf[_0x594535(0x20e)]('✘');let _0x1d5e64='';if(_0x534552['schemaValid']&&_0x534552[_0x594535(0x2c1)]!==undefined&&_0x534552[_0x594535(0x2b2)]!==undefined){const _0x968d34=_0x534552['coveragePercent'][_0x594535(0x2fb)](0x1),_0x370d05=_0x534552[_0x594535(0x2b2)]>=0x50?a27_0x44fedf[_0x594535(0x262)]:_0x534552['coveragePercent']>=0x32?a27_0x44fedf[_0x594535(0x1ec)]:a27_0x44fedf['red'];_0x1d5e64='\x20'+a27_0x44fedf['dim'](_0x594535(0x26b))+'\x20'+_0x370d05(_0x968d34+'%')+'\x20('+formatRows(_0x534552['matchedCount'])+_0x594535(0x22f);}console['error'](_0x2f7d4e+'\x20'+a27_0x44fedf[_0x594535(0x25c)](_0x534552['name'])+_0x1d5e64),console[_0x594535(0x205)]('\x20\x20'+a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x2c4))+'\x20'+a27_0x44fedf['bold'](_0x534552[_0x594535(0x221)]+'.'+_0x534552[_0x594535(0x2e5)]));const _0x2016aa=_0x534552['joinKey']===_0x534552[_0x594535(0x2c3)]?a27_0x44fedf['dim'](_0x594535(0x291))+'\x20'+_0x534552[_0x594535(0x285)]:a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x2a8))+'\x20'+_0x534552[_0x594535(0x285)]+_0x594535(0x2ac)+_0x534552[_0x594535(0x2c3)];console[_0x594535(0x205)]('\x20\x20'+_0x2016aa),console[_0x594535(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x594535(0x2b7))),this[_0x594535(0x226)](_0x534552[_0x594535(0x2ae)]),!_0x534552[_0x594535(0x2a0)]&&console['error']('\x20\x20'+a27_0x44fedf[_0x594535(0x20e)](_0x594535(0x24b))+'\x20'+_0x534552[_0x594535(0x1ff)]);}}[a27_0x30a75a(0x1fc)](_0x2edd66,_0x1e5b02){const _0x4838fc=a27_0x30a75a;if(_0x2edd66[_0x4838fc(0x231)][_0x4838fc(0x2b5)]===0x0)return;console[_0x4838fc(0x205)]('\x0a'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x23c))+'\x20'+a27_0x44fedf[_0x4838fc(0x2d3)]('('+_0x1e5b02+')'));for(const _0x4dbf15 of _0x2edd66[_0x4838fc(0x231)]){const _0xa53356=_0x4dbf15[_0x4838fc(0x2a0)]?a27_0x44fedf[_0x4838fc(0x262)]('✔'):a27_0x44fedf[_0x4838fc(0x20e)]('✘');let _0x3bae14='';if(_0x4dbf15['schemaValid']&&_0x4dbf15['customersWithEvents']!==undefined&&_0x4dbf15[_0x4838fc(0x2da)]!==undefined){const _0x29e1e3=_0x4dbf15['customerPercent']?.[_0x4838fc(0x2fb)](0x1)||'?',_0x1c5e8e=(_0x4dbf15[_0x4838fc(0x237)]??0x0)>=0x32?a27_0x44fedf[_0x4838fc(0x262)]:(_0x4dbf15['customerPercent']??0x0)>=0x14?a27_0x44fedf[_0x4838fc(0x1ec)]:a27_0x44fedf[_0x4838fc(0x20e)];_0x3bae14='\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x1fd))+'\x20'+_0x1c5e8e(formatRows(_0x4dbf15[_0x4838fc(0x29f)]))+'\x20('+_0x29e1e3+'%)\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x277))+'\x20'+a27_0x44fedf[_0x4838fc(0x1e7)](formatRows(_0x4dbf15['totalEvents']));}console[_0x4838fc(0x205)](_0xa53356+'\x20'+a27_0x44fedf[_0x4838fc(0x25c)](_0x4dbf15['name'])+_0x3bae14),console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x4838fc(0x2c4))+'\x20'+a27_0x44fedf[_0x4838fc(0x25c)](_0x4dbf15[_0x4838fc(0x221)]+'.'+_0x4dbf15[_0x4838fc(0x2e5)]));const _0x46aa22=_0x4dbf15['joinKey']===_0x4dbf15[_0x4838fc(0x2c3)]?a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x291))+'\x20'+_0x4dbf15[_0x4838fc(0x285)]:a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x2a8))+'\x20'+_0x4dbf15[_0x4838fc(0x285)]+'\x20=\x20'+_0x4dbf15[_0x4838fc(0x2c3)];console['error']('\x20\x20'+_0x46aa22),console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x2b7))),this['displayColumns'](_0x4dbf15['columns']),!_0x4dbf15[_0x4838fc(0x2a0)]&&console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf[_0x4838fc(0x20e)](_0x4838fc(0x24b))+'\x20'+_0x4dbf15[_0x4838fc(0x1ff)]);}}['displayColumns'](_0x19f3b5){const _0x326685=a27_0x30a75a;for(const _0x5570bd of _0x19f3b5){_0x5570bd[_0x326685(0x26f)]===_0x5570bd[_0x326685(0x1fa)]||_0x5570bd[_0x326685(0x1fa)]==='*'?console[_0x326685(0x205)](_0x326685(0x208)+_0x5570bd[_0x326685(0x26f)]):console[_0x326685(0x205)](_0x326685(0x208)+_0x5570bd[_0x326685(0x26f)]+'\x20'+a27_0x44fedf[_0x326685(0x2d3)]('('+_0x5570bd['column']+')'));}}[a27_0x30a75a(0x297)](_0x17bded){const _0x321be5=a27_0x30a75a;console[_0x321be5(0x205)]('─'[_0x321be5(0x21a)](0x3c));if(_0x17bded[_0x321be5(0x2b8)][_0x321be5(0x2b5)]>0x0){console['error']('\x0a'+a27_0x44fedf[_0x321be5(0x20e)]('Errors:'));for(const _0x2c500f of _0x17bded[_0x321be5(0x2b8)]){console[_0x321be5(0x205)]('\x20\x20'+a27_0x44fedf[_0x321be5(0x20e)]('•')+'\x20'+_0x2c500f);}}_0x17bded[_0x321be5(0x269)]&&console[_0x321be5(0x205)]('\x0a'+a27_0x44fedf[_0x321be5(0x262)]('✔')+_0x321be5(0x272));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]='segment:parent:preview';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x22b);async[a27_0x30a75a(0x235)](_0x47bda4){const _0x42389a=a27_0x30a75a,{options:_0x394aad,args:_0x51bebf,tdx:_0x5a6e85}=_0x47bda4,_0xcfb746=_0x394aad,_0xca4540=_0x51bebf[0x0]||_0x394aad[_0x42389a(0x29a)];if(!_0xca4540)return console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x22c))),console[_0x42389a(0x205)](_0x42389a(0x271)),console[_0x42389a(0x205)](_0x42389a(0x243)),console[_0x42389a(0x205)](_0x42389a(0x1f8)),console[_0x42389a(0x205)](_0x42389a(0x278)),console['error'](_0x42389a(0x2fc)),console[_0x42389a(0x205)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x42389a(0x205)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x1e7)](_0x42389a(0x209))),0x1;if(!_0xcfb746[_0x42389a(0x257)]&&!_0xcfb746['attribute']&&!_0xcfb746[_0x42389a(0x2e9)]&&!_0xcfb746['enriched'])return console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x1f9))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x42389a(0x205)](_0x42389a(0x2df)),console[_0x42389a(0x205)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x42389a(0x205)](_0x42389a(0x278)),console[_0x42389a(0x205)](_0x42389a(0x2fc)),console[_0x42389a(0x205)](_0x42389a(0x2ba)),0x1;const _0x116d89=resolveYamlFile(_0xca4540);if(!existsSync(_0x116d89))return showFileNotFoundError(_0x116d89,_0xca4540),0x1;_0xcfb746['verbose']&&(console['error']('Site:\x20'+_0xcfb746['site']),console[_0x42389a(0x205)](_0x42389a(0x2a1)+_0x116d89));let _0x34af0a;try{_0x34af0a=readFileSync(_0x116d89,'utf-8');}catch(_0x2d1093){const _0x3ede24=_0x2d1093 instanceof Error?_0x2d1093[_0x42389a(0x2cc)]:String(_0x2d1093);return console[_0x42389a(0x205)](_0x42389a(0x21e)+_0x3ede24),0x1;}let _0x545212;try{_0x545212=parseYamlString(_0x34af0a);}catch(_0x32d8f8){const _0x351df8=_0x32d8f8 instanceof Error?_0x32d8f8['message']:String(_0x32d8f8);return console[_0x42389a(0x205)](a27_0x44fedf['red'](_0x42389a(0x270)+_0x351df8)),0x1;}if(_0xcfb746['attribute']===!![]||_0xcfb746[_0x42389a(0x309)]===''){const _0x1635da=_0x545212[_0x42389a(0x2e2)]?.['map'](_0x3b51ae=>_0x3b51ae[_0x42389a(0x2de)])||[];if(_0x1635da['length']===0x0)console[_0x42389a(0x205)](a27_0x44fedf['red'](_0x42389a(0x247)));else{console['error'](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x2d1))),console[_0x42389a(0x205)](_0x42389a(0x200));for(const _0x126cf7 of _0x1635da){console[_0x42389a(0x205)]('\x20\x20'+a27_0x44fedf[_0x42389a(0x1e7)](_0x126cf7));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xca4540+'\x20--attribute\x20\x22'+_0x1635da[0x0]+'\x22');}return 0x1;}if(_0xcfb746[_0x42389a(0x2e9)]===!![]||_0xcfb746[_0x42389a(0x2e9)]===''){const _0x4ba45b=_0x545212['behaviors']?.['map'](_0x255442=>_0x255442['name'])||[];if(_0x4ba45b[_0x42389a(0x2b5)]===0x0)console['error'](a27_0x44fedf['red'](_0x42389a(0x24d)));else{console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x2cb))),console[_0x42389a(0x205)](_0x42389a(0x28c));for(const _0x49f7bc of _0x4ba45b){console[_0x42389a(0x205)]('\x20\x20'+a27_0x44fedf['cyan'](_0x49f7bc));}console['error'](_0x42389a(0x244)+_0xca4540+_0x42389a(0x2bd)+_0x4ba45b[0x0]+'\x22');}return 0x1;}const _0x187f26=createCommandSpinner(a27_0x44fedf[_0x42389a(0x2d3)](_0x42389a(0x2ee)),{'verbose':_0xcfb746['verbose']});_0x187f26[_0x42389a(0x2f4)]();const _0x4a8a3b={'onProgress':_0x159ef2=>{const _0x5051c1=_0x42389a;_0x187f26[_0x5051c1(0x281)]=formatProgressMessage(_0x159ef2);}};if(_0xcfb746[_0x42389a(0x257)])_0x4a8a3b[_0x42389a(0x257)]=!![];if(_0xcfb746[_0x42389a(0x309)]&&typeof _0xcfb746['attribute']==='string')_0x4a8a3b[_0x42389a(0x309)]=_0xcfb746[_0x42389a(0x309)];if(_0xcfb746[_0x42389a(0x2e9)]&&typeof _0xcfb746[_0x42389a(0x2e9)]==='string')_0x4a8a3b['behavior']=_0xcfb746[_0x42389a(0x2e9)];if(_0xcfb746[_0x42389a(0x201)])_0x4a8a3b[_0x42389a(0x201)]=!![];if(_0xcfb746['interval'])_0x4a8a3b[_0x42389a(0x300)]=_0xcfb746[_0x42389a(0x300)];let _0x48535f;try{_0x48535f=await _0x5a6e85[_0x42389a(0x23e)][_0x42389a(0x2d2)](_0x34af0a,_0x4a8a3b),_0x187f26['stop']();}catch(_0x28e829){_0x187f26[_0x42389a(0x303)]();throw _0x28e829;}return await this[_0x42389a(0x2a5)](_0x48535f,{'master':_0xcfb746[_0x42389a(0x257)],'attribute':typeof _0xcfb746['attribute']==='string'?_0xcfb746[_0x42389a(0x309)]:undefined,'behavior':typeof _0xcfb746[_0x42389a(0x2e9)]===_0x42389a(0x224)?_0xcfb746[_0x42389a(0x2e9)]:undefined,'enriched':_0xcfb746['enriched']}),_0x48535f[_0x42389a(0x269)]?0x0:0x1;}async[a27_0x30a75a(0x2a5)](_0x122d28,_0x3e4aea){const _0x1c784a=a27_0x30a75a;console['error']('\x0a'+a27_0x44fedf['bold'](_0x1c784a(0x301))+'\x20'+_0x122d28[_0x1c784a(0x2de)]),console[_0x1c784a(0x205)]('═'[_0x1c784a(0x21a)](0x3c));if(_0x3e4aea['master']&&_0x122d28['sampleData']){const _0x1d6a3f=a27_0x44fedf[_0x1c784a(0x2d3)]('Master:')+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)](_0x122d28[_0x1c784a(0x257)]['database']+'.'+_0x122d28['master'][_0x1c784a(0x2e5)]);await this[_0x1c784a(0x20b)](_0x1d6a3f,_0x122d28['sampleData']);}else{if(_0x3e4aea[_0x1c784a(0x309)]&&_0x122d28[_0x1c784a(0x211)]){const _0xf481d0=a27_0x44fedf[_0x1c784a(0x2d3)](_0x1c784a(0x254))+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)](_0x3e4aea[_0x1c784a(0x309)]);await this[_0x1c784a(0x20b)](_0xf481d0,_0x122d28[_0x1c784a(0x211)]);}else{if(_0x3e4aea['behavior']&&_0x122d28[_0x1c784a(0x211)]){const _0x15f43c=a27_0x44fedf['dim'](_0x1c784a(0x2db))+'\x20'+a27_0x44fedf['bold'](_0x3e4aea[_0x1c784a(0x2e9)]);await this[_0x1c784a(0x20b)](_0x15f43c,_0x122d28[_0x1c784a(0x211)]);}else{if(_0x3e4aea[_0x1c784a(0x201)]&&_0x122d28['sampleData']){const _0x2892e1=a27_0x44fedf[_0x1c784a(0x2d3)](_0x1c784a(0x283))+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)]('Master\x20+\x20Attributes');await this[_0x1c784a(0x20b)](_0x2892e1,_0x122d28[_0x1c784a(0x211)]);}else!_0x122d28['sampleData']&&console['error'](_0x1c784a(0x1e5));}}}if(_0x122d28['errors'][_0x1c784a(0x2b5)]>0x0){console[_0x1c784a(0x205)]('─'[_0x1c784a(0x21a)](0x3c)),console[_0x1c784a(0x205)]('\x0a'+a27_0x44fedf[_0x1c784a(0x20e)](_0x1c784a(0x28d)));for(const _0x1adaea of _0x122d28['errors']){console[_0x1c784a(0x205)]('\x20\x20'+a27_0x44fedf[_0x1c784a(0x20e)]('•')+'\x20'+_0x1adaea);}}}async['displaySampleData'](_0x8dceb3,_0x55f920){const _0x465127=a27_0x30a75a;if(_0x55f920[_0x465127(0x2b5)]===0x0){console['error']('\x0a'+_0x8dceb3),console[_0x465127(0x205)](_0x465127(0x210));return;}console[_0x465127(0x205)]('\x0a'+_0x8dceb3);const _0xb1f503=Object[_0x465127(0x26c)](_0x55f920[0x0])['map'](_0xff0499=>({'name':_0xff0499,'type':typeof _0x55f920[0x0][_0xff0499]===_0x465127(0x251)?_0x465127(0x2d4):_0x465127(0x2a2)})),_0x36337d={'queryId':_0x465127(0x259),'columns':_0xb1f503,'data':_0x55f920,'stats':{'state':_0x465127(0x2dc),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x55f920[_0x465127(0x2b5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x21a893=formatAsTable(_0x36337d,_0x55f920[_0x465127(0x2b5)],!![]);await writeOutput(_0x21a893,undefined,_0x465127(0x2e5));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a27_0x30a75a(0x21b);[a27_0x30a75a(0x23b)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a27_0x30a75a(0x235)](_0x392c83){const _0x3a43ad=a27_0x30a75a,{options:_0x1d3756,args:_0x59d3d8,tdx:_0x271b9d}=_0x392c83,_0x977c04=_0x1d3756,_0x32d041=_0x59d3d8[0x0]||_0x1d3756[_0x3a43ad(0x29a)];if(!_0x32d041)return console[_0x3a43ad(0x205)](a27_0x44fedf[_0x3a43ad(0x20e)](_0x3a43ad(0x22c))),console[_0x3a43ad(0x205)]('Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a'),console[_0x3a43ad(0x205)](a27_0x44fedf[_0x3a43ad(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x26af5f=resolveYamlFile(_0x32d041);if(existsSync(_0x26af5f)){_0x977c04[_0x3a43ad(0x1e9)]&&console[_0x3a43ad(0x205)]('Found\x20YAML\x20file:\x20'+_0x26af5f);let _0x4a41ae;try{_0x4a41ae=readFileSync(_0x26af5f,_0x3a43ad(0x2ca));}catch(_0x4b5e88){const _0x111993=_0x4b5e88 instanceof Error?_0x4b5e88[_0x3a43ad(0x2cc)]:String(_0x4b5e88);return console[_0x3a43ad(0x205)](_0x3a43ad(0x21e)+_0x111993),0x1;}const _0x5b5eb9=await withSpinner(_0x3a43ad(0x28a),()=>_0x271b9d['segment']['pushParentYaml'](_0x4a41ae),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]}),_0x98b980=_0x5b5eb9[_0x3a43ad(0x30a)],{isNew:_0x50862e,name:_0x2a4b8a,hasChanges:_0x160fef,diffFormatted:_0x4830ff}=_0x98b980;if(_0x160fef){_0x50862e?console[_0x3a43ad(0x205)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2a4b8a+'\x27:'):console[_0x3a43ad(0x205)](_0x3a43ad(0x217)+_0x2a4b8a+'\x27:');console[_0x3a43ad(0x205)]('─'[_0x3a43ad(0x21a)](0x3c)),console[_0x3a43ad(0x205)](_0x4830ff),console[_0x3a43ad(0x205)]('─'[_0x3a43ad(0x21a)](0x3c));const _0x2287c1=_0x50862e?_0x3a43ad(0x308)+_0x2a4b8a+_0x3a43ad(0x264):_0x3a43ad(0x30b)+_0x2a4b8a+_0x3a43ad(0x264);if(!_0x977c04[_0x3a43ad(0x307)]){const _0x366986=await confirmKey(_0x2287c1);if(!_0x366986)return console[_0x3a43ad(0x205)](_0x3a43ad(0x20c)),0x1;}const _0x409840=_0x50862e?_0x3a43ad(0x2a6):_0x3a43ad(0x2c2);await withSpinner(_0x409840+_0x3a43ad(0x242)+_0x2a4b8a+_0x3a43ad(0x274),()=>_0x98b980[_0x3a43ad(0x2be)](),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]});const _0xae1497=_0x50862e?_0x3a43ad(0x27f):'Updated';console['error']('✔\x20'+_0xae1497+_0x3a43ad(0x242)+_0x2a4b8a+'\x27');}else console[_0x3a43ad(0x205)](_0x3a43ad(0x2b9)+_0x2a4b8a+'\x27\x20is\x20up\x20to\x20date');}const _0x2786ab=await withSpinner(_0x3a43ad(0x25d)+_0x32d041+'\x27...',()=>_0x271b9d[_0x3a43ad(0x23e)][_0x3a43ad(0x2b6)](_0x32d041),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]}),_0x2301b5=_0x2786ab[_0x3a43ad(0x30a)],_0x2f7c42=getConsoleUrl(_0x977c04[_0x3a43ad(0x238)],'/app/workflows/'+_0x2301b5[_0x3a43ad(0x1f5)]+_0x3a43ad(0x2c7)+_0x2301b5[_0x3a43ad(0x219)]+'/attempt/'+_0x2301b5['workflowAttemptId']);return console[_0x3a43ad(0x205)](_0x3a43ad(0x27a)),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x2d5))+'\x20'+_0x2301b5[_0x3a43ad(0x1f0)]),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x256))+'\x20'+_0x2301b5['status']),console['error']('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)]('Session:')+'\x20'+_0x2301b5[_0x3a43ad(0x219)]),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x2bc))+'\x20'+_0x2301b5[_0x3a43ad(0x2d0)]),console['error']('\x20\x20'+_0x2f7c42),console[_0x3a43ad(0x205)]('\x0a'+a27_0x44fedf[_0x3a43ad(0x2d3)]('To\x20cancel:')+_0x3a43ad(0x267)+_0x2301b5[_0x3a43ad(0x2d0)]+_0x3a43ad(0x207)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x26a);['description']=a27_0x30a75a(0x2a9);async[a27_0x30a75a(0x235)](_0x8a1c10){const _0x43a4cd=a27_0x30a75a,{options:_0x545e4b,args:_0x2c6065,tdx:_0x1670c4}=_0x8a1c10,_0x24e3b2=_0x2c6065[0x0]||_0x545e4b['parentSegment'];if(!_0x24e3b2)return console[_0x43a4cd(0x205)](a27_0x44fedf[_0x43a4cd(0x20e)](_0x43a4cd(0x22c))),console[_0x43a4cd(0x205)](_0x43a4cd(0x26d)),console[_0x43a4cd(0x205)](a27_0x44fedf['cyan'](_0x43a4cd(0x288))),0x1;_0x545e4b[_0x43a4cd(0x1e9)]&&(console[_0x43a4cd(0x205)](_0x43a4cd(0x282)+_0x545e4b[_0x43a4cd(0x238)]),console[_0x43a4cd(0x205)](_0x43a4cd(0x302)+_0x24e3b2));const _0x294f3f=await withSpinner(_0x43a4cd(0x290)+_0x24e3b2+_0x43a4cd(0x274),()=>_0x1670c4[_0x43a4cd(0x23e)][_0x43a4cd(0x2c0)](_0x24e3b2),{'verbose':_0x545e4b[_0x43a4cd(0x1e9)]}),_0x53110d=_0x294f3f['data'];console[_0x43a4cd(0x205)](_0x43a4cd(0x203)+_0x53110d['length']+'\x20field'+(_0x53110d['length']!==0x1?'s':''));if(_0x545e4b[_0x43a4cd(0x296)]||_0x545e4b[_0x43a4cd(0x2f5)])return await handleSDKOutput(_0x53110d,_0x545e4b),0x0;return displayFieldsHumanReadable(_0x53110d,_0x24e3b2),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:view';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x2e1);async[a27_0x30a75a(0x235)](_0x296d83){const _0x18d720=a27_0x30a75a,{options:_0x239273,args:_0x263fcf,tdx:_0x55d578}=_0x296d83,_0x5bb925=_0x239273,_0x529b6f=_0x263fcf[0x0]||_0x239273['parentSegment'];if(!_0x529b6f)return console[_0x18d720(0x205)](a27_0x44fedf[_0x18d720(0x20e)](_0x18d720(0x22c))),console[_0x18d720(0x205)]('Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a'),console[_0x18d720(0x205)](_0x18d720(0x2df)),console['error'](_0x18d720(0x20d)),console['error'](a27_0x44fedf['cyan']('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x239273[_0x18d720(0x1e9)]&&(console[_0x18d720(0x205)](_0x18d720(0x282)+_0x239273[_0x18d720(0x238)]),console[_0x18d720(0x205)](_0x18d720(0x302)+_0x529b6f));const _0x2202ad=await withSpinner(_0x18d720(0x26e)+_0x529b6f+'\x27...',()=>_0x55d578['segment'][_0x18d720(0x21d)](_0x529b6f),{'verbose':_0x239273[_0x18d720(0x1e9)]}),_0x28f0bd=_0x2202ad[_0x18d720(0x30a)];if(_0x5bb925['web']){const _0xcb1cd=getConsoleNextUrl(_0x5bb925['site'],_0x18d720(0x29d)+_0x28f0bd['id']);return console['error'](a27_0x44fedf['green']('✔')+_0x18d720(0x29c)+a27_0x44fedf['cyan'](_0xcb1cd)),openBrowser(_0xcb1cd),0x0;}return await handleSingleObjectOutput(_0x28f0bd,_0x239273),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a27_0x30a75a(0x1fb);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x295);async[a27_0x30a75a(0x235)](_0x1eb9ef){const _0x4389e8=a27_0x30a75a,{options:_0x3353be,args:_0x1cead5,tdx:_0x2598c8}=_0x1eb9ef,_0x3f6bf2=_0x1cead5[0x0]||_0x3353be[_0x4389e8(0x29a)];if(!_0x3f6bf2)return console[_0x4389e8(0x205)](a27_0x44fedf['red'](_0x4389e8(0x22c))),console[_0x4389e8(0x205)](_0x4389e8(0x239)),console[_0x4389e8(0x205)](a27_0x44fedf[_0x4389e8(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x3353be[_0x4389e8(0x1e9)]&&(console['error'](_0x4389e8(0x282)+_0x3353be[_0x4389e8(0x238)]),console[_0x4389e8(0x205)](_0x4389e8(0x302)+_0x3f6bf2));const _0x155404=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f6bf2+_0x4389e8(0x274),()=>_0x2598c8['segment'][_0x4389e8(0x2ed)](_0x3f6bf2),{'verbose':_0x3353be[_0x4389e8(0x1e9)]}),_0x449c5a=_0x155404['data'],_0x17a50=await withSpinner(_0x4389e8(0x241)+_0x3f6bf2+_0x4389e8(0x274),()=>_0x2598c8['segment']['getParentSQL'](_0x449c5a),{'verbose':_0x3353be[_0x4389e8(0x1e9)]}),_0x19ee6e=await executeSchemaQuery(_0x17a50[_0x4389e8(0x30a)],_0x2598c8,_0x3353be);return await handleQueryOutput(_0x19ee6e,_0x3353be),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:sql';[a27_0x30a75a(0x23b)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a27_0x30a75a(0x235)](_0xcf8a97){const _0x33a08a=a27_0x30a75a,{options:_0x7537a2,args:_0x56eb83,tdx:_0x58640d}=_0xcf8a97,_0xdd0e2f=_0x56eb83[0x0]||_0x7537a2[_0x33a08a(0x29a)];if(!_0xdd0e2f)return console[_0x33a08a(0x205)](a27_0x44fedf[_0x33a08a(0x20e)](_0x33a08a(0x22c))),console['error']('Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a'),console[_0x33a08a(0x205)](a27_0x44fedf[_0x33a08a(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x7537a2[_0x33a08a(0x1e9)]&&(console[_0x33a08a(0x205)](_0x33a08a(0x282)+_0x7537a2['site']),console['error'](_0x33a08a(0x302)+_0xdd0e2f));const _0x3c5956=await withSpinner(_0x33a08a(0x25e)+_0xdd0e2f+'\x27...',()=>_0x58640d['segment'][_0x33a08a(0x2ed)](_0xdd0e2f),{'verbose':_0x7537a2['verbose']}),_0x81d5da=_0x3c5956['data'],_0x3f7794=await withSpinner(_0x33a08a(0x241)+_0xdd0e2f+_0x33a08a(0x274),()=>_0x58640d[_0x33a08a(0x23e)][_0x33a08a(0x298)](_0x81d5da),{'verbose':_0x7537a2[_0x33a08a(0x1e9)]}),_0x4fdb87=_0x3f7794[_0x33a08a(0x30a)];return _0x7537a2[_0x33a08a(0x25b)]==='json'||_0x7537a2[_0x33a08a(0x25b)]===_0x33a08a(0x2f5)?await handleSDKOutput([{'sql':_0x4fdb87}],_0x7537a2):console[_0x33a08a(0x292)](_0x4fdb87),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2f9);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x261);async[a27_0x30a75a(0x235)](_0x6f19d0){const _0x2f6df9=a27_0x30a75a,{options:_0x2f2995,args:_0x27f45e,tdx:_0x5d70a1}=_0x6f19d0,_0x107506=_0x27f45e[0x0]||_0x2f2995[_0x2f6df9(0x29a)];if(!_0x107506)return console['error'](a27_0x44fedf[_0x2f6df9(0x20e)](_0x2f6df9(0x22c))),console[_0x2f6df9(0x205)](_0x2f6df9(0x286)),console[_0x2f6df9(0x205)](a27_0x44fedf['cyan'](_0x2f6df9(0x288))),0x1;_0x2f2995['verbose']&&(console[_0x2f6df9(0x205)](_0x2f6df9(0x282)+_0x2f2995['site']),console[_0x2f6df9(0x205)](_0x2f6df9(0x302)+_0x107506));const _0x166eda=await withSpinner(_0x2f6df9(0x25e)+_0x107506+_0x2f6df9(0x274),()=>_0x5d70a1[_0x2f6df9(0x23e)][_0x2f6df9(0x2ed)](_0x107506),{'verbose':_0x2f2995['verbose']}),_0x58bd44=_0x166eda['data'],_0x2a644b=await withSpinner(_0x2f6df9(0x241)+_0x107506+_0x2f6df9(0x274),()=>_0x5d70a1['segment'][_0x2f6df9(0x298)](_0x58bd44),{'verbose':_0x2f2995[_0x2f6df9(0x1e9)]});let _0x37b7a9=_0x2a644b[_0x2f6df9(0x30a)];const _0x26b952=resolveLimit(_0x2f2995['limit'],DEFAULT_DISPLAY_LIMIT),_0x4aedd0=/\bLIMIT\s+\d+/i['test'](_0x37b7a9);!_0x4aedd0&&(_0x37b7a9=_0x37b7a9[_0x2f6df9(0x2e4)]()[_0x2f6df9(0x305)](/;+$/,''),_0x37b7a9=_0x2f6df9(0x1ef)+_0x37b7a9+_0x2f6df9(0x25f)+_0x26b952);_0x2f2995[_0x2f6df9(0x1e9)]&&console[_0x2f6df9(0x205)](_0x2f6df9(0x2bf)+_0x37b7a9);const _0x3a2d80=await withQuerySpinner(_0x2f6df9(0x2a3),async _0x81e43f=>{const _0x405a27=_0x2f6df9,_0x434db4=await _0x5d70a1[_0x405a27(0x253)]['execute'](_0x37b7a9,{'catalog':'td','schema':'information_schema','onJobId':_0x5fd164=>{const _0x4622cb=_0x405a27;_0x81e43f[_0x4622cb(0x1fe)](_0x5fd164);}});return _0x434db4;},{'verbose':_0x2f2995[_0x2f6df9(0x1e9)]}),_0x4a17db=_0x3a2d80['data'],_0x2deced=_0x4a17db[_0x2f6df9(0x263)]?_0x2f6df9(0x2e8)+_0x4a17db[_0x2f6df9(0x263)]+']':'';return console['error'](_0x2f6df9(0x245)+_0x4a17db[_0x2f6df9(0x2f3)][_0x2f6df9(0x289)][_0x2f6df9(0x2dd)]()+_0x2f6df9(0x252)+(_0x2f6df9(0x1ea)+formatElapsed(_0x4a17db[_0x2f6df9(0x2f3)]['elapsedTimeMillis'])+_0x2deced)),await handleQueryOutput(_0x4a17db,_0x2f2995),0x0;}}