@treasuredata/tdx 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) 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.js +1 -1
  61. package/dist/proxy/claude-usage-tracker.js +1 -1
  62. package/dist/proxy/context-signature.js +1 -1
  63. package/dist/proxy/conversation-utils.js +1 -1
  64. package/dist/proxy/server.js +1 -1
  65. package/dist/proxy/session-cache.js +1 -1
  66. package/dist/sdk/api.js +1 -1
  67. package/dist/sdk/connection.js +1 -1
  68. package/dist/sdk/engage.js +1 -1
  69. package/dist/sdk/errors.js +1 -1
  70. package/dist/sdk/index.js +1 -1
  71. package/dist/sdk/job.js +1 -1
  72. package/dist/sdk/llm.js +1 -1
  73. package/dist/sdk/query.js +1 -1
  74. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  75. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  76. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  77. package/dist/sdk/segment.js +1 -1
  78. package/dist/sdk/user.js +1 -1
  79. package/dist/sdk/workflow.js +1 -1
  80. package/dist/types/endpoints.js +1 -1
  81. package/dist/types/index.js +1 -1
  82. package/dist/utils/agent-ref-parser.js +1 -1
  83. package/dist/utils/async.js +1 -1
  84. package/dist/utils/chat-cache.js +1 -1
  85. package/dist/utils/colors.js +1 -1
  86. package/dist/utils/command-output.js +1 -1
  87. package/dist/utils/constants.js +1 -1
  88. package/dist/utils/diff.js +1 -1
  89. package/dist/utils/fields-display.js +1 -1
  90. package/dist/utils/file-permissions.js +1 -1
  91. package/dist/utils/format-detector.js +1 -1
  92. package/dist/utils/formatters.js +1 -1
  93. package/dist/utils/json-loader.js +1 -1
  94. package/dist/utils/llm-backup-utils.js +1 -1
  95. package/dist/utils/model-aliases.js +1 -1
  96. package/dist/utils/model-factors.js +1 -1
  97. package/dist/utils/option-validation.js +1 -1
  98. package/dist/utils/port.js +1 -1
  99. package/dist/utils/process.js +1 -1
  100. package/dist/utils/prompt.js +1 -1
  101. package/dist/utils/segment-path-parser.js +1 -1
  102. package/dist/utils/segment-ref-parser.js +1 -1
  103. package/dist/utils/spinner.js +1 -1
  104. package/dist/utils/sql-parser.js +1 -1
  105. package/dist/utils/sse-parser.js +1 -1
  106. package/dist/utils/string-utils.js +1 -1
  107. package/dist/utils/table-ref-parser.js +1 -1
  108. package/dist/utils/tdx-config.js +1 -1
  109. package/dist/utils/tdx-logger.js +1 -1
  110. package/dist/utils/tree-formatter.js +1 -1
  111. package/dist/utils/version-check.js +1 -1
  112. package/dist/utils/workflow-utils.js +1 -1
  113. 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_0x5e4d6c=a24_0x1f54;(function(_0x52ff7d,_0x5adc36){const _0x677402=a24_0x1f54,_0x27cff9=_0x52ff7d();while(!![]){try{const _0x602e76=-parseInt(_0x677402(0x1df))/0x1+parseInt(_0x677402(0x1fe))/0x2+-parseInt(_0x677402(0x1d1))/0x3*(-parseInt(_0x677402(0x1d4))/0x4)+parseInt(_0x677402(0x205))/0x5+-parseInt(_0x677402(0x1f5))/0x6*(parseInt(_0x677402(0x1e2))/0x7)+parseInt(_0x677402(0x1d8))/0x8+-parseInt(_0x677402(0x1c3))/0x9;if(_0x602e76===_0x5adc36)break;else _0x27cff9['push'](_0x27cff9['shift']());}catch(_0x266356){_0x27cff9['push'](_0x27cff9['shift']());}}}(a24_0x925e,0x99b97));import{BaseCommand}from'./command.js';function a24_0x1f54(_0x1a4ab1,_0xa61688){_0x1a4ab1=_0x1a4ab1-0x1bc;const _0x925e7=a24_0x925e();let _0x1f54dc=_0x925e7[_0x1a4ab1];return _0x1f54dc;}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{['name']='jobs';[a24_0x5e4d6c(0x1e7)]=a24_0x5e4d6c(0x1cc);async[a24_0x5e4d6c(0x1c1)](_0x194912){const _0x7c5e=a24_0x5e4d6c,{options:_0x9b12fd,tdx:_0x4322a7}=_0x194912;try{const _0x19279d=resolveLimit(_0x9b12fd[_0x7c5e(0x1e0)],DEFAULT_DISPLAY_LIMIT),_0x87e3a9=_0x9b12fd[_0x7c5e(0x1ec)];_0x9b12fd['verbose']&&(console['error'](_0x7c5e(0x200)+_0x19279d+_0x7c5e(0x1bc)),_0x87e3a9&&console[_0x7c5e(0x1ce)](_0x7c5e(0x1ca)+_0x87e3a9));const _0x2ffd8a=await withSpinner(_0x7c5e(0x1fa),()=>_0x4322a7[_0x7c5e(0x1d5)][_0x7c5e(0x1c7)]({'from':0x0,'to':_0x19279d-0x1,'status':_0x87e3a9}),{'verbose':_0x9b12fd[_0x7c5e(0x1e1)]}),_0x3b56b8=_0x2ffd8a['data'];console[_0x7c5e(0x1ce)](_0x7c5e(0x1ea)+_0x3b56b8['length']+_0x7c5e(0x204)+(_0x3b56b8[_0x7c5e(0x1c0)]!==0x1?'s':''));const _0x5d0901=_0x3b56b8[_0x7c5e(0x1f9)](_0x358f97=>{const _0xb5e23e=_0x7c5e;let _0x18ff77;if(_0x358f97[_0xb5e23e(0x202)]&&_0x358f97[_0xb5e23e(0x1ff)]){const _0xb1e242=new Date(_0x358f97[_0xb5e23e(0x202)])[_0xb5e23e(0x1f8)](),_0xfda037=new Date(_0x358f97[_0xb5e23e(0x1ff)])[_0xb5e23e(0x1f8)]();_0x18ff77=Math[_0xb5e23e(0x1f4)]((_0xfda037-_0xb1e242)/0x3e8);}return{'job_id':_0x358f97['job_id'],'type':_0x358f97[_0xb5e23e(0x1bf)],'status':_0x358f97[_0xb5e23e(0x1ec)],'user_name':_0x358f97[_0xb5e23e(0x1f7)],'duration_sec':_0x18ff77,'created_at':_0x358f97[_0xb5e23e(0x1d6)],'started_at':_0x358f97[_0xb5e23e(0x202)],'end_at':_0x358f97['end_at']};});return await handleSDKOutput(_0x5d0901,_0x9b12fd),0x0;}catch(_0xa01e81){if(_0xa01e81 instanceof SDKError)return console[_0x7c5e(0x1ce)](_0x7c5e(0x1eb)+_0xa01e81[_0x7c5e(0x1d3)]),_0xa01e81[_0x7c5e(0x1fb)]&&console[_0x7c5e(0x1ce)](_0x7c5e(0x1e4)+_0xa01e81[_0x7c5e(0x1fb)]),0x1;throw _0xa01e81;}}}export class JobShowCommand extends BaseCommand{[a24_0x5e4d6c(0x1d0)]=a24_0x5e4d6c(0x203);['description']=a24_0x5e4d6c(0x1cd);async[a24_0x5e4d6c(0x1c1)](_0xa00e45){const _0x3bbcd7=a24_0x5e4d6c,{options:_0x203e7d,args:_0x451c7e,tdx:_0x42d0fc}=_0xa00e45,_0x579c0c=_0x451c7e[0x0];if(!_0x579c0c)return console[_0x3bbcd7(0x1ce)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x3bbcd7(0x1ce)](_0x3bbcd7(0x1c4)),0x1;try{const _0x4386fa=await withSpinner(_0x3bbcd7(0x1f1),()=>_0x42d0fc[_0x3bbcd7(0x1d5)]['show'](_0x579c0c),{'verbose':_0x203e7d[_0x3bbcd7(0x1e1)]}),_0x46bcfc=_0x4386fa[_0x3bbcd7(0x1f0)];let _0x163b01;if(_0x46bcfc[_0x3bbcd7(0x202)]&&_0x46bcfc[_0x3bbcd7(0x1ff)]){const _0x224276=new Date(_0x46bcfc[_0x3bbcd7(0x202)])[_0x3bbcd7(0x1f8)](),_0x2eafe4=new Date(_0x46bcfc['end_at'])['getTime']();_0x163b01=Math['round']((_0x2eafe4-_0x224276)/0x3e8);}const _0x328f8c={'job_id':_0x46bcfc[_0x3bbcd7(0x1ee)],'type':_0x46bcfc[_0x3bbcd7(0x1bf)],'status':_0x46bcfc[_0x3bbcd7(0x1ec)],..._0x46bcfc[_0x3bbcd7(0x1f7)]&&{'user_name':_0x46bcfc[_0x3bbcd7(0x1f7)]},..._0x163b01!==undefined&&{'duration_sec':_0x163b01},..._0x46bcfc[_0x3bbcd7(0x1d6)]&&{'created_at':_0x46bcfc[_0x3bbcd7(0x1d6)]},..._0x46bcfc['start_at']&&{'started_at':_0x46bcfc[_0x3bbcd7(0x202)]},..._0x46bcfc[_0x3bbcd7(0x1ff)]&&{'end_at':_0x46bcfc[_0x3bbcd7(0x1ff)]},..._0x46bcfc['database']&&{'database':_0x46bcfc['database']},..._0x46bcfc[_0x3bbcd7(0x1fd)]!==undefined&&{'priority':_0x46bcfc['priority']},..._0x46bcfc[_0x3bbcd7(0x1c2)]&&{'url':_0x46bcfc['url']},..._0x46bcfc[_0x3bbcd7(0x1c8)]&&{'query':_0x46bcfc['query']},..._0x46bcfc[_0x3bbcd7(0x1c6)]&&{'debug':_0x46bcfc[_0x3bbcd7(0x1c6)]}};return await handleSingleObjectOutput(_0x328f8c,_0x203e7d),0x0;}catch(_0x25ae30){if(_0x25ae30 instanceof SDKError)return console[_0x3bbcd7(0x1ce)]('Error:\x20'+_0x25ae30[_0x3bbcd7(0x1d3)]),_0x25ae30[_0x3bbcd7(0x1fb)]&&console[_0x3bbcd7(0x1ce)](_0x3bbcd7(0x1e4)+_0x25ae30['cause']),0x1;throw _0x25ae30;}}}export class JobKillCommand extends BaseCommand{['name']=a24_0x5e4d6c(0x1dc);[a24_0x5e4d6c(0x1e7)]=a24_0x5e4d6c(0x1da);async[a24_0x5e4d6c(0x1c1)](_0x238128){const _0x218b83=a24_0x5e4d6c,{options:_0x544f29,args:_0xda454f,tdx:_0x225981}=_0x238128,_0xdaecc=_0xda454f[0x0];if(!_0xdaecc)return console[_0x218b83(0x1ce)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x218b83(0x1ce)](_0x218b83(0x1de)),0x1;try{if(!_0x544f29[_0x218b83(0x1e3)]){const _0x19d5cc=await confirm(_0x218b83(0x1e6)+_0xdaecc+'?');if(!_0x19d5cc)return console['error']('Cancelled'),0x0;}return await withSpinner(_0x218b83(0x1cf),()=>_0x225981[_0x218b83(0x1d5)]['kill'](_0xdaecc),{'verbose':_0x544f29['verbose']}),console[_0x218b83(0x1ce)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0xdaecc),console['error'](_0x218b83(0x1d2)+_0xdaecc+_0x218b83(0x1f2)),0x0;}catch(_0x3b0f88){if(_0x3b0f88 instanceof SDKError)return console['error'](_0x218b83(0x1eb)+_0x3b0f88[_0x218b83(0x1d3)]),_0x3b0f88[_0x218b83(0x1fb)]&&console[_0x218b83(0x1ce)](_0x218b83(0x1e4)+_0x3b0f88[_0x218b83(0x1fb)]),0x1;throw _0x3b0f88;}}}export class JobSubmitCommand extends BaseCommand{[a24_0x5e4d6c(0x1d0)]=a24_0x5e4d6c(0x1ed);[a24_0x5e4d6c(0x1e7)]='Submit\x20a\x20job';async[a24_0x5e4d6c(0x1c1)](_0x127d3a){const _0x57c1cc=a24_0x5e4d6c,{options:_0x1c27e4,args:_0x312201,tdx:_0x61ff36}=_0x127d3a;try{const _0x1201dc=_0x1c27e4[_0x57c1cc(0x1be)]||_0x57c1cc(0x1d9),_0x1481bd=_0x1c27e4[_0x57c1cc(0x1d7)],_0x3b2663=_0x1c27e4[_0x57c1cc(0x1e8)]||'information_schema';if(_0x1201dc!=='trino'&&_0x1201dc!=='hive')return console[_0x57c1cc(0x1ce)](_0x57c1cc(0x1ef)),0x1;let _0x14e6cb;if(_0x1481bd){if(_0x312201[0x0])return console[_0x57c1cc(0x1ce)](_0x57c1cc(0x1fc)),0x1;const _0x572f17=readSqlStatementsFromFile(_0x1481bd);if(_0x572f17['length']===0x0)return console[_0x57c1cc(0x1ce)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x572f17[_0x57c1cc(0x1c0)]>0x1)return console[_0x57c1cc(0x1ce)](_0x57c1cc(0x1c5)),0x1;_0x14e6cb=_0x572f17[0x0];}else{if(!_0x312201[0x0])return console[_0x57c1cc(0x1ce)](_0x57c1cc(0x201)),console[_0x57c1cc(0x1ce)](_0x57c1cc(0x1cb)),0x1;_0x14e6cb=_0x312201[0x0];}_0x1c27e4[_0x57c1cc(0x1e1)]&&(console[_0x57c1cc(0x1ce)](_0x57c1cc(0x1f6)+_0x1201dc),console[_0x57c1cc(0x1ce)]('Database:\x20'+_0x3b2663),console['error']('Query:\x20'+_0x14e6cb[_0x57c1cc(0x1c9)](0x0,0x64)+(_0x14e6cb[_0x57c1cc(0x1c0)]>0x64?_0x57c1cc(0x1f3):'')));const _0x589ea7=await withSpinner('Submitting\x20job...',()=>_0x61ff36[_0x57c1cc(0x1d5)]['submit'](_0x3b2663,_0x14e6cb,_0x1201dc),{'verbose':_0x1c27e4[_0x57c1cc(0x1e1)]}),_0x12e25d=_0x589ea7[_0x57c1cc(0x1f0)];return console[_0x57c1cc(0x1ce)]('✔\x20Job\x20submitted'),console[_0x57c1cc(0x1ce)]('\x20\x20Job\x20ID:\x20'+_0x12e25d[_0x57c1cc(0x1ee)]),await handleSDKOutput([_0x12e25d],_0x1c27e4),0x0;}catch(_0x596410){if(_0x596410 instanceof SDKError)return console[_0x57c1cc(0x1ce)](_0x57c1cc(0x1eb)+_0x596410[_0x57c1cc(0x1d3)]),_0x596410['cause']&&console[_0x57c1cc(0x1ce)]('\x20\x20Cause:\x20'+_0x596410['cause']),0x1;throw _0x596410;}}}export class JobResultCommand extends BaseCommand{[a24_0x5e4d6c(0x1d0)]=a24_0x5e4d6c(0x1db);[a24_0x5e4d6c(0x1e7)]='Get\x20job\x20results';async[a24_0x5e4d6c(0x1c1)](_0x4c5886){const _0x401c61=a24_0x5e4d6c,{options:_0x2822ca,args:_0x4a906e,tdx:_0x1d8218}=_0x4c5886,_0x5eafe8=_0x4a906e[0x0];if(!_0x5eafe8)return console[_0x401c61(0x1ce)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x401c61(0x1ce)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x1107be=await withSpinner(_0x401c61(0x1bd),()=>_0x1d8218[_0x401c61(0x1d5)][_0x401c61(0x1e9)](_0x5eafe8),{'verbose':_0x2822ca[_0x401c61(0x1e1)]}),_0x38ddbf=_0x1107be[_0x401c61(0x1f0)];return console[_0x401c61(0x1ce)](_0x401c61(0x1dd)+_0x38ddbf[_0x401c61(0x1c0)]+_0x401c61(0x1e5)+(_0x38ddbf[_0x401c61(0x1c0)]!==0x1?'s':'')),await handleSDKOutput(_0x38ddbf,_0x2822ca),0x0;}catch(_0x1900f1){if(_0x1900f1 instanceof SDKError)return console[_0x401c61(0x1ce)](_0x401c61(0x1eb)+_0x1900f1[_0x401c61(0x1d3)]),_0x1900f1[_0x401c61(0x1fb)]&&console[_0x401c61(0x1ce)](_0x401c61(0x1e4)+_0x1900f1[_0x401c61(0x1fb)]),0x1;throw _0x1900f1;}}}function a24_0x925e(){const _0x2bf0b6=['jobs','created_at','file','7968784ADkuAd','trino','Kill\x20a\x20job','job:result','job:kill','✔\x20Retrieved\x20','Usage:\x20job\x20kill\x20<job-id>','544183NAPVwL','limit','verbose','602mYafJg','yes','\x20\x20Cause:\x20','\x20row','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','description','database','result','✔\x20Found\x20','Error:\x20','status','job:submit','job_id','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','data','Getting\x20job\x20details...','\x27\x20to\x20verify\x20the\x20job\x20status','...','round','80814STtTBN','Job\x20type:\x20','user_name','getTime','map','Listing\x20jobs...','cause','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','priority','2275718fhWnqx','end_at','Limit:\x20','Error:\x20Query\x20is\x20required','start_at','job:show','\x20job','4213200YdLSwC','\x20jobs','Getting\x20job\x20results...','jobType','type','length','execute','url','6230808RLBrwz','Usage:\x20job\x20show\x20<job-id>','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','debug','list','query','substring','Status\x20filter:\x20','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','List\x20jobs','Show\x20job\x20details','error','Submitting\x20kill\x20request...','name','21ojzmbw','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','message','27364IMhdxR'];a24_0x925e=function(){return _0x2bf0b6;};return a24_0x925e();}
@@ -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_0x3869c4=a25_0xf4db;(function(_0x9383bd,_0x420416){const _0x827e02=a25_0xf4db,_0x1a3938=_0x9383bd();while(!![]){try{const _0x2ea993=parseInt(_0x827e02(0x266))/0x1+parseInt(_0x827e02(0x276))/0x2*(-parseInt(_0x827e02(0x288))/0x3)+parseInt(_0x827e02(0x263))/0x4+-parseInt(_0x827e02(0x29d))/0x5*(-parseInt(_0x827e02(0x236))/0x6)+-parseInt(_0x827e02(0x24b))/0x7*(parseInt(_0x827e02(0x211))/0x8)+parseInt(_0x827e02(0x277))/0x9*(parseInt(_0x827e02(0x210))/0xa)+-parseInt(_0x827e02(0x1fa))/0xb*(-parseInt(_0x827e02(0x205))/0xc);if(_0x2ea993===_0x420416)break;else _0x1a3938['push'](_0x1a3938['shift']());}catch(_0x447811){_0x1a3938['push'](_0x1a3938['shift']());}}}(a25_0x40e2,0x4f619));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a25_0x5bb442 from'node:fs';function handleSDKError(_0x4862fe,_0x231ef6){const _0x41f9ff=a25_0xf4db;if(_0x4862fe instanceof SDKError)console[_0x41f9ff(0x27c)](_0x41f9ff(0x2a3)+_0x4862fe[_0x41f9ff(0x21c)]),_0x231ef6[_0x41f9ff(0x257)]&&(_0x4862fe['cause']&&console[_0x41f9ff(0x27c)](_0x41f9ff(0x281)+_0x4862fe['cause']),_0x4862fe[_0x41f9ff(0x282)]&&(console[_0x41f9ff(0x27c)](_0x41f9ff(0x1f8)),console['error'](_0x4862fe[_0x41f9ff(0x282)])));else throw _0x4862fe;}function formatChatHistoryEntry(_0x2348f7,_0x1bea06){const _0x32c7c0=a25_0xf4db,_0x5ed74f=getChalk(_0x1bea06),_0x567ea2=_0x5ed74f[_0x32c7c0(0x2be)](_0x2348f7['at']);if(_0x32c7c0(0x261)in _0x2348f7){const _0xd6dff6=_0x5ed74f[_0x32c7c0(0x23f)]('[input]\x20\x20');return _0x567ea2+'\x20'+_0xd6dff6+':\x20'+_0x2348f7['input'];}if(_0x32c7c0(0x212)in _0x2348f7){const _0x56f5d6=_0x5ed74f[_0x32c7c0(0x242)]('[content]');return _0x567ea2+'\x20'+_0x56f5d6+':\x20'+_0x2348f7[_0x32c7c0(0x212)];}if(_0x32c7c0(0x291)in _0x2348f7){const _0x594948=_0x5ed74f['yellow']('[tool_call]'),{functionName:_0x5b9535,functionArguments:_0x33cb43,targetFunction:_0xfde629}=_0x2348f7['tool_call'];let _0x1331bb=_0x567ea2+'\x20'+_0x594948+':\x20'+_0x5ed74f[_0x32c7c0(0x251)](_0x5b9535);if(_0x33cb43&&Object['keys'](_0x33cb43)[_0x32c7c0(0x1f5)]>0x0){const _0x14b39f=Object['entries'](_0x33cb43)[_0x32c7c0(0x287)](([_0x15d363,_0x30021d])=>_0x15d363+'='+JSON[_0x32c7c0(0x2a0)](_0x30021d))['join'](',\x20');_0x1331bb+='('+_0x14b39f+')';}_0xfde629&&(_0x1331bb+=_0x5ed74f[_0x32c7c0(0x2be)]('\x20['+_0xfde629+']'));let _0x191fc5='';if(_0x2348f7['tool_call']['targetKnowledgeBase'])_0x191fc5='\x20->\x20KB:'+_0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x238)][_0x32c7c0(0x2a1)];else{if(_0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x237)])_0x191fc5='\x20->\x20Agent:'+_0x2348f7['tool_call'][_0x32c7c0(0x237)]['name'];else{if(_0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x209)])_0x191fc5=_0x32c7c0(0x28b)+_0x2348f7['tool_call'][_0x32c7c0(0x209)]['name'];else _0x2348f7[_0x32c7c0(0x291)][_0x32c7c0(0x1fe)]&&(_0x191fc5=_0x32c7c0(0x1fc)+_0x2348f7[_0x32c7c0(0x291)]['targetImageGenerator'][_0x32c7c0(0x2a1)]);}}return _0x1331bb+_0x191fc5;}if('tool'in _0x2348f7){const _0x29c660=_0x5ed74f['magenta'](_0x32c7c0(0x28d)),{functionName:_0x21c1f5,functionArguments:_0x50b461,content:_0x8f168a,newChat:_0x5a71ea}=_0x2348f7[_0x32c7c0(0x22e)];let _0x59033e=_0x567ea2+'\x20'+_0x29c660+':\x20'+_0x5ed74f['bold'](_0x21c1f5);if(_0x50b461){const _0x147a16=typeof _0x50b461===_0x32c7c0(0x253)?_0x50b461:JSON[_0x32c7c0(0x2a0)](_0x50b461);_0x59033e+='('+_0x147a16+')';}return _0x8f168a&&(_0x59033e+='\x0a'+_0x5ed74f[_0x32c7c0(0x2be)](_0x8f168a)),_0x5a71ea&&(_0x59033e+=_0x5ed74f[_0x32c7c0(0x2be)](_0x32c7c0(0x23c)+_0x5a71ea['id'])),_0x59033e;}if(_0x32c7c0(0x2ba)in _0x2348f7){const _0x14d426=_0x5ed74f[_0x32c7c0(0x24a)](_0x32c7c0(0x218));return _0x567ea2+'\x20'+_0x14d426+':\x20'+_0x2348f7[_0x32c7c0(0x2ba)][_0x32c7c0(0x2a1)]+'\x20('+_0x2348f7[_0x32c7c0(0x2ba)]['content'][_0x32c7c0(0x1f5)]+_0x32c7c0(0x24c);}if(_0x32c7c0(0x269)in _0x2348f7){const _0x5535cd=_0x5ed74f[_0x32c7c0(0x24a)]('[image]\x20\x20'),{width:_0x509dd6,height:_0x551214,headerText:_0x8b7c6d}=_0x2348f7['image'],_0x35507a=_0x8b7c6d?'\x20-\x20'+_0x8b7c6d:'';return _0x567ea2+'\x20'+_0x5535cd+':\x20'+_0x509dd6+'x'+_0x551214+_0x35507a;}if(_0x32c7c0(0x27c)in _0x2348f7){const _0x2451ec=_0x5ed74f[_0x32c7c0(0x2ac)](_0x32c7c0(0x290));return _0x567ea2+'\x20'+_0x2451ec+':\x20'+_0x2348f7['error'];}return _0x567ea2+'\x20'+_0x5ed74f[_0x32c7c0(0x2be)](_0x32c7c0(0x1fb))+':\x20'+JSON['stringify'](_0x2348f7);}async function executeChatHistoryCommand(_0x195f82,_0x1d5324){const _0x79b3a5=a25_0xf4db,{options:_0x23ea1b,args:_0x23fc56,tdx:_0x15cd70}=_0x195f82,_0x2b9bde=_0x23fc56[0x0],_0x152c35=_0x23ea1b,_0x354731=_0x152c35[_0x79b3a5(0x2ab)];try{if(_0x354731&&_0x2b9bde)return console['error'](_0x79b3a5(0x25d)),console[_0x79b3a5(0x27c)](_0x79b3a5(0x2c1)+_0x1d5324+'\x20--last'),0x1;if(!_0x2b9bde&&!_0x354731&&_0x23ea1b[_0x79b3a5(0x22c)]!==undefined){const _0x3261e2=resolveLimit(_0x23ea1b[_0x79b3a5(0x20a)],DEFAULT_LLM_LIMIT),_0x11ea31=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x15cd70[_0x79b3a5(0x2b7)][_0x79b3a5(0x23e)](_0x3261e2),{'verbose':_0x23ea1b[_0x79b3a5(0x257)]});return await handleSDKOutput(_0x11ea31['data'],_0x23ea1b),0x0;}const _0x553f6f=await getChatIdOrSelect(_0x15cd70,_0x23ea1b,_0x354731,_0x2b9bde);if(!_0x553f6f)return 0x0;return await displayChatHistory(_0x553f6f,_0x15cd70,_0x23ea1b),0x0;}catch(_0x455ef2){return handleSDKError(_0x455ef2,_0x23ea1b),0x1;}}async function displayChatHistory(_0x4dd9ef,_0x130092,_0x408bce){const _0x494072=a25_0xf4db,_0x42c04d=await withSpinner(_0x494072(0x2b4)+_0x4dd9ef+_0x494072(0x2b5),()=>_0x130092[_0x494072(0x2b7)][_0x494072(0x208)](_0x4dd9ef),{'verbose':_0x408bce[_0x494072(0x257)]}),_0x435449=_0x42c04d[_0x494072(0x289)][_0x494072(0x289)]??[];if(_0x435449['length']===0x0){console[_0x494072(0x200)](_0x494072(0x204));return;}if(_0x408bce[_0x494072(0x22c)]!==undefined)await handleSDKOutput(_0x435449,_0x408bce);else{const _0x1a9ec2=_0x435449[_0x494072(0x287)](_0x256af1=>formatChatHistoryEntry(_0x256af1,_0x408bce)),_0x13c7ac=_0x1a9ec2['join']('\x0a');await writeOutput(_0x13c7ac,_0x408bce[_0x494072(0x2ba)],_0x494072(0x278));}}function a25_0x40e2(){const _0x43a3ba=['\x20\x20Agents:\x20','just\x20now','stringify','name','getOrCreateDefaultProject','Error:\x20','floor','\x27\x20already\x20exists.\x20Overwrite?','Fetching\x20chat\x20sessions...','Resolving\x20project\x20\x27','json','resolveProjectId','starterMessage','last','red','get','Backing\x20up\x20project\x20\x27','llm:agents','Update\x20an\x20existing\x20agent','__load_more__','deleteAgent','llm:agent:update','Fetching\x20chat\x20history\x20for\x20\x27','\x27...','yes','llm','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','...','output','restoreProject','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','model','dim','Select\x20a\x20chat\x20session:','default','Usage:\x20','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','length','Create\x20a\x20new\x20agent\x20in\x20current\x20project','getBackupMetadata','\x0aStack\x20trace:','Deleting\x20project\x20\x27','927586JKNxeG','[unknown]','\x20->\x20ImageGen:','find','targetImageGenerator','Usage:\x20tdx\x20llm\x20use\x20<project-name>','log','llmProject','firstInputContent','llm:project:backup','No\x20messages\x20found\x20in\x20chat\x20history.','24gZwpSY','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Show\x20agent\x20details','history','targetWebSearchTool','limit','createProject','createdAt','backupProject','includes','Delete\x20an\x20LLM\x20project','490XoXNHV','184tiIfac','content','llm:agent:show','A\x20project\x20named\x20\x27','maxToolIterations','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','chatId','[output]\x20','push','prompts','updatedAt','message','systemPrompt','Analyzing\x20project\x20\x27','all','Error:\x20Backup\x20folder\x20path\x20is\x20required','Checking\x20for\x20existing\x20projects...','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','Deleting\x20agent...','Fetching\x20projects...','Fetching\x20agent...','llm:history','Delete\x20an\x20agent','Error:\x20Agent\x20name\x20is\x20required','projects','exportedFrom','format','filter','tool','Agent\x20updated:\x20','Project\x20context\x20set\x20to:\x20','Use\x20format:\x20project-name/agent-name','agents','llm:use','Backup\x20cancelled.','counts','3325254vGcFQt','targetAgent','targetKnowledgeBase','split','Getting\x20default\x20project...','execute','\x20→\x20chat:\x20','dryRun','chats','cyan','toLowerCase','.llm','green','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','getTime','integrations','projectName','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','llm:agent:create','Setting\x20project\x20context\x20to\x20\x27','blue','90174jyuunM','\x20bytes)','llm:project:restore','Create\x20a\x20new\x20LLM\x20project','short','Project\x20not\x20found:\x20','bold','lastConversationAt','string','projectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Error:\x20Project\x20name\x20is\x20required','verbose','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Set\x20current\x20project\x20context','Project\x20created:\x20','rmSync','Agent\x20deleted:\x20','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','m\x20ago','Restoring\x20project\x20from\x20\x27','tdx\x20llm\x20history','input','set','126360upTpHB','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','258346MQUoKa','\x20\x20Knowledge\x20Bases:\x20','List\x20agents\x20in\x20current\x20project','image','Resolving\x20agent\x20\x27','numeric','outputDir','No\x20chat\x20sessions\x20found.','getCurrentProject','LLM_PROJECT_NOT_FOUND','agent','Project\x20backed\x20up\x20to:\x20','prompt','createAgent','Restore\x20cancelled.','agentId','478gfEdAb','153gAhYqC','table','slice','\x20\x20Prompts:\x20','Load\x20more...','error','llm:agent:delete','(no\x20agent)','Output\x20directory\x20\x27','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','\x20\x20Cause:\x20','stack','description','attributes','temperature','Validating\x20backup\x20from\x20\x27','map','4923yYLzIB','data','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20->\x20WebSearch:','List\x20available\x20LLM\x20models','[tool]\x20\x20\x20','\x20\x20Integrations:\x20','resolveAgentId','[error]\x20\x20','tool_call','Agent\x20created:\x20','substring','Updating\x20agent...','jsonl','knowledgeBases','sourceSite','INVALID_ARGUMENT','Project\x20deleted:\x20','Fetching\x20agents...','Creating\x20project\x20\x27','llm:project:delete','5fnsXOJ'];a25_0x40e2=function(){return _0x43a3ba;};return a25_0x40e2();}async function getChatIdOrSelect(_0x11f176,_0x4806bc,_0x480d6e,_0x3148d2){const _0x2fa302=a25_0xf4db;if(_0x3148d2)return _0x3148d2;if(_0x480d6e){const _0x261201=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x11f176[_0x2fa302(0x2b7)][_0x2fa302(0x23e)](0x1),{'verbose':_0x4806bc[_0x2fa302(0x257)]});if(_0x261201[_0x2fa302(0x289)][_0x2fa302(0x1f5)]===0x0)return console[_0x2fa302(0x200)](_0x2fa302(0x26d)),undefined;return _0x261201[_0x2fa302(0x289)][0x0]['id'];}const _0x3e06a6=await selectChatInteractively(_0x11f176,_0x4806bc);if(!_0x3e06a6)return console[_0x2fa302(0x200)]('\x0aCancelled'),undefined;return _0x3e06a6;}async function getProjectIdOrDefault(_0x2d86b2){const _0x599b16=a25_0xf4db,{tdx:_0x3d93bc,options:_0xdefc3}=_0x2d86b2,_0x2916ef=_0xdefc3[_0x599b16(0x201)];if(_0x2916ef){const _0x2d3342=await withSpinner(_0x599b16(0x2a7)+_0x2916ef+_0x599b16(0x2b5),()=>_0x3d93bc[_0x599b16(0x2b7)][_0x599b16(0x2a9)](_0x2916ef),{'verbose':_0xdefc3[_0x599b16(0x257)]});return _0x2d3342[_0x599b16(0x289)];}let _0x15f6a5=_0x3d93bc[_0x599b16(0x2b7)][_0x599b16(0x26e)]();if(_0x15f6a5)return _0x15f6a5;const _0x545b04=await withSpinner(_0x599b16(0x23a),()=>_0x3d93bc[_0x599b16(0x2b7)][_0x599b16(0x2a2)](),{'verbose':_0xdefc3[_0x599b16(0x257)]});return _0x545b04[_0x599b16(0x289)]['id'];}function toLLMProjectInfo(_0x189266){const _0x191aad=a25_0xf4db;return{'name':_0x189266[_0x191aad(0x284)]['name'],'description':_0x189266[_0x191aad(0x284)][_0x191aad(0x283)],'createdAt':_0x189266[_0x191aad(0x284)]['createdAt'],'updatedAt':_0x189266[_0x191aad(0x284)][_0x191aad(0x21b)]};}function toAgentInfo(_0x33370f){const _0x5d9c30=a25_0xf4db;return{'name':_0x33370f[_0x5d9c30(0x284)]['name'],'description':_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x283)],'prompt':truncatePrompt(_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x272)]),'createdAt':_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x20c)],'updatedAt':_0x33370f[_0x5d9c30(0x284)][_0x5d9c30(0x21b)]};}function truncatePrompt(_0x5f4322){const _0x4f6b6e=a25_0xf4db;if(!_0x5f4322)return undefined;const _0x185c11=0x64;if(_0x5f4322[_0x4f6b6e(0x1f5)]<=_0x185c11)return _0x5f4322;return _0x5f4322['slice'](0x0,_0x185c11)+_0x4f6b6e(0x2b9);}export class LLMModelsCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]='llm:models';[a25_0x3869c4(0x283)]=a25_0x3869c4(0x28c);async[a25_0x3869c4(0x23b)](_0x50d74f){const _0x5380c1=a25_0x3869c4,{options:_0x1718c1,tdx:_0x26143a}=_0x50d74f;try{const _0x2ca9d7=await withSpinner('Fetching\x20available\x20models...',()=>_0x26143a['llm']['models'](),{'verbose':_0x1718c1['verbose']});return await handleSDKOutput(_0x2ca9d7[_0x5380c1(0x289)],_0x1718c1),0x0;}catch(_0x1ae524){return handleSDKError(_0x1ae524,_0x1718c1),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']='llm:projects';[a25_0x3869c4(0x283)]='List\x20all\x20LLM\x20projects';async[a25_0x3869c4(0x23b)](_0x2f6ec1){const _0x58ab7b=a25_0x3869c4,{options:_0x413ffe,args:_0x10eb5b,tdx:_0xf21fa1}=_0x2f6ec1;try{const _0x44c4e9=_0x10eb5b[0x0],_0x2641b6=resolveLimit(_0x413ffe[_0x58ab7b(0x20a)],DEFAULT_LLM_LIMIT),_0x203f16=await withSpinner(_0x58ab7b(0x225),()=>_0xf21fa1['llm'][_0x58ab7b(0x22a)](_0x2641b6),{'verbose':_0x413ffe[_0x58ab7b(0x257)]});let _0x295b11=_0x203f16[_0x58ab7b(0x289)];_0x44c4e9&&(_0x295b11=_0x203f16['data']['filter'](_0x47cdde=>matchGlobPattern(_0x47cdde[_0x58ab7b(0x284)][_0x58ab7b(0x2a1)],_0x44c4e9)));const _0x4dc2c8=_0x295b11['map'](toLLMProjectInfo);return await handleSDKOutput(_0x4dc2c8,_0x413ffe),0x0;}catch(_0x222b6e){return handleSDKError(_0x222b6e,_0x413ffe),0x1;}}}function a25_0xf4db(_0x4bfe2c,_0x1db85a){_0x4bfe2c=_0x4bfe2c-0x1f4;const _0x40e2de=a25_0x40e2();let _0xf4db=_0x40e2de[_0x4bfe2c];return _0xf4db;}export class LLMAgentsCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x2af);['description']=a25_0x3869c4(0x268);async['execute'](_0x497d6d){const _0x59db36=a25_0x3869c4,{options:_0xe310aa,args:_0x42f610,tdx:_0x2058f7}=_0x497d6d;try{const _0x16a607=_0x42f610[0x0];let _0x140da0,_0x265a3c=_0x16a607;if(_0x16a607&&_0x16a607[_0x59db36(0x20e)]('/')){const _0x4ffa16=_0x16a607[_0x59db36(0x239)]('/');if(_0x4ffa16[_0x59db36(0x1f5)]===0x2){const [_0x5959ba,_0x195233]=_0x4ffa16,_0x4e70d3=await _0x2058f7[_0x59db36(0x2b7)][_0x59db36(0x22a)](),_0x4f5179=_0x4e70d3[_0x59db36(0x1fd)](_0x45336c=>_0x45336c[_0x59db36(0x284)][_0x59db36(0x2a1)][_0x59db36(0x240)]()===_0x5959ba[_0x59db36(0x240)]());if(!_0x4f5179)throw new SDKError(ErrorCode[_0x59db36(0x26f)],_0x59db36(0x250)+_0x5959ba,undefined,{'helpText':_0x59db36(0x258)});_0x140da0=_0x4f5179['id'],_0x265a3c=_0x195233;}else throw new SDKError(ErrorCode[_0x59db36(0x298)],'Invalid\x20path\x20syntax:\x20'+_0x16a607,undefined,{'helpText':_0x59db36(0x231)});}else _0x140da0=await getProjectIdOrDefault(_0x497d6d);const _0x224720=await withSpinner(_0x59db36(0x29a),()=>_0x2058f7[_0x59db36(0x2b7)][_0x59db36(0x232)](_0x140da0),{'verbose':_0xe310aa['verbose']});let _0x416411=_0x224720[_0x59db36(0x289)];_0x265a3c&&(_0x416411=_0x224720['data'][_0x59db36(0x22d)](_0x16faa2=>matchGlobPattern(_0x16faa2[_0x59db36(0x284)]['name'],_0x265a3c)));const _0x2a5a9c=_0x416411[_0x59db36(0x287)](toAgentInfo);return await handleSDKOutput(_0x2a5a9c,_0xe310aa),0x0;}catch(_0x13b21b){return handleSDKError(_0x13b21b,_0xe310aa),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x213);['description']=a25_0x3869c4(0x207);async[a25_0x3869c4(0x23b)](_0x1676ca){const _0x199e93=a25_0x3869c4,{options:_0x222dfb,args:_0x3ce08d,tdx:_0x2fe054}=_0x1676ca;if(_0x3ce08d['length']===0x0)return console['error'](_0x199e93(0x229)),console['error'](_0x199e93(0x216)),0x1;const _0x8f9313=_0x3ce08d[0x0];try{const _0x4f5faf=await getProjectIdOrDefault(_0x1676ca),_0x4afc53=await withSpinner(_0x199e93(0x26a)+_0x8f9313+'\x27...',()=>_0x2fe054[_0x199e93(0x2b7)]['resolveAgentId'](_0x8f9313,_0x4f5faf),{'verbose':_0x222dfb[_0x199e93(0x257)]}),_0x110a5f=await withSpinner(_0x199e93(0x226),()=>_0x2fe054[_0x199e93(0x2b7)][_0x199e93(0x270)](_0x4afc53[_0x199e93(0x289)]),{'verbose':_0x222dfb[_0x199e93(0x257)]});return await handleSDKOutput([_0x110a5f['data']],_0x222dfb),0x0;}catch(_0x380451){return handleSDKError(_0x380451,_0x222dfb),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x248);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x1f6);async[a25_0x3869c4(0x23b)](_0x245385){const _0x54e08c=a25_0x3869c4,{options:_0xa31c28,args:_0x36c7f3,tdx:_0x10ba25}=_0x245385;if(_0x36c7f3['length']===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x54e08c(0x27c)](_0x54e08c(0x1f4)),console[_0x54e08c(0x27c)](_0x54e08c(0x255)),0x1;const _0x22fff0=_0x36c7f3[0x0],_0x560b8f=_0xa31c28,_0x515131=_0x560b8f[_0x54e08c(0x21d)],_0x1d92e4=_0x560b8f[_0x54e08c(0x2bd)]||'claude-4.5-haiku',_0x586010=_0x560b8f[_0x54e08c(0x2aa)],_0x4f96e9=_0x560b8f[_0x54e08c(0x215)]?Number(_0x560b8f['maxToolIterations']):undefined,_0x10882e=_0x560b8f[_0x54e08c(0x285)]?Number(_0x560b8f['temperature']):undefined;try{let _0x25c65d,_0x1d8882;if(_0x22fff0['includes']('/')){const _0x424e86=_0x22fff0['split']('/');if(_0x424e86[_0x54e08c(0x1f5)]===0x2){const [_0xa6f7f5,_0x1bd057]=_0x424e86,_0x439fe5=await withSpinner(_0x54e08c(0x2a7)+_0xa6f7f5+_0x54e08c(0x2b5),()=>_0x10ba25['llm'][_0x54e08c(0x2a9)](_0xa6f7f5),{'verbose':_0xa31c28['verbose']});_0x25c65d=_0x439fe5['data'],_0x1d8882=_0x1bd057;}else throw new SDKError(ErrorCode[_0x54e08c(0x298)],'Invalid\x20path\x20syntax:\x20'+_0x22fff0,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x25c65d=await getProjectIdOrDefault(_0x245385),_0x1d8882=_0x22fff0;const _0x465988=await withSpinner('Creating\x20agent\x20\x27'+_0x1d8882+_0x54e08c(0x2b5),()=>_0x10ba25['llm'][_0x54e08c(0x273)]({'name':_0x1d8882,'projectId':_0x25c65d,'modelType':_0x1d92e4,'systemPrompt':_0x515131,'starterMessage':_0x586010,'maxToolIterations':_0x4f96e9,'temperature':_0x10882e}),{'verbose':_0xa31c28[_0x54e08c(0x257)]});return console[_0x54e08c(0x200)](_0x54e08c(0x292)+_0x465988[_0x54e08c(0x289)]['id']),await handleSDKOutput([_0x465988[_0x54e08c(0x289)]],_0xa31c28),0x0;}catch(_0x2b8935){return handleSDKError(_0x2b8935,_0xa31c28),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x2b3);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x2b0);async[a25_0x3869c4(0x23b)](_0x34296c){const _0x39d382=a25_0x3869c4,{options:_0x3d7f52,args:_0x31e470,tdx:_0x5df8cd}=_0x34296c;if(_0x31e470[_0x39d382(0x1f5)]===0x0)return console[_0x39d382(0x27c)](_0x39d382(0x229)),console[_0x39d382(0x27c)](_0x39d382(0x28a)),0x1;const _0x4048df=_0x31e470[0x0],_0x5729c8=_0x3d7f52,_0x1b4b3e=_0x5729c8[_0x39d382(0x2a1)],_0x50cb36=_0x5729c8[_0x39d382(0x272)],_0x24cdfd=_0x5729c8['description'],_0x5d30c1=_0x5729c8[_0x39d382(0x2aa)];if(!_0x1b4b3e&&!_0x50cb36&&!_0x24cdfd&&!_0x5d30c1)return console[_0x39d382(0x27c)](_0x39d382(0x247)),console[_0x39d382(0x27c)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x551145=await getProjectIdOrDefault(_0x34296c),_0x4a6144=await withSpinner(_0x39d382(0x26a)+_0x4048df+'\x27...',()=>_0x5df8cd['llm'][_0x39d382(0x28f)](_0x4048df,_0x551145),{'verbose':_0x3d7f52[_0x39d382(0x257)]}),_0x556432=_0x4a6144['data'],_0x20ee3b=await withSpinner(_0x39d382(0x294),()=>_0x5df8cd[_0x39d382(0x2b7)]['updateAgent'](_0x556432,{'name':_0x1b4b3e,'prompt':_0x50cb36,'description':_0x24cdfd,'starterMessage':_0x5d30c1}),{'verbose':_0x3d7f52[_0x39d382(0x257)]});return console['log'](_0x39d382(0x22f)+_0x20ee3b[_0x39d382(0x289)]['id']),await handleSDKOutput([_0x20ee3b[_0x39d382(0x289)]],_0x3d7f52),0x0;}catch(_0x1aa1a6){return handleSDKError(_0x1aa1a6,_0x3d7f52),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x27d);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x228);async[a25_0x3869c4(0x23b)](_0x12e446){const _0x268e9a=a25_0x3869c4,{options:_0x115c52,args:_0x411fc4,tdx:_0x3a8e8c}=_0x12e446;if(_0x411fc4[_0x268e9a(0x1f5)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x268e9a(0x27c)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x380d7b=_0x411fc4[0x0];try{const _0x59904f=await getProjectIdOrDefault(_0x12e446),_0x58640c=await withSpinner(_0x268e9a(0x26a)+_0x380d7b+_0x268e9a(0x2b5),()=>_0x3a8e8c['llm'][_0x268e9a(0x28f)](_0x380d7b,_0x59904f),{'verbose':_0x115c52['verbose']}),_0x42a180=_0x58640c[_0x268e9a(0x289)];return await withSpinner(_0x268e9a(0x224),()=>_0x3a8e8c[_0x268e9a(0x2b7)][_0x268e9a(0x2b2)](_0x42a180),{'verbose':_0x115c52[_0x268e9a(0x257)]}),console[_0x268e9a(0x200)](_0x268e9a(0x25c)+_0x42a180),0x0;}catch(_0x3879ce){return handleSDKError(_0x3879ce,_0x115c52),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x227);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x206);async[a25_0x3869c4(0x23b)](_0x1a21d2){const _0x23046c=a25_0x3869c4;return executeChatHistoryCommand(_0x1a21d2,_0x23046c(0x260));}}export class LLMUseCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x233);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x259);async[a25_0x3869c4(0x23b)](_0x289c7b){const _0x4630a6=a25_0x3869c4,{options:_0x6c1901,args:_0x2f0cd9,tdx:_0x3acd45}=_0x289c7b;if(_0x2f0cd9[_0x4630a6(0x1f5)]===0x0)return console[_0x4630a6(0x27c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4630a6(0x27c)](_0x4630a6(0x1ff)),0x1;const _0x24c894=_0x2f0cd9[0x0];try{return await withSpinner(_0x4630a6(0x249)+_0x24c894+_0x4630a6(0x2b5),()=>_0x3acd45['llm']['setCurrentProject'](_0x24c894),{'verbose':_0x6c1901[_0x4630a6(0x257)]}),console[_0x4630a6(0x200)](_0x4630a6(0x230)+_0x24c894),0x0;}catch(_0x190c9b){return handleSDKError(_0x190c9b,_0x6c1901),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']='llm:project:create';[a25_0x3869c4(0x283)]=a25_0x3869c4(0x24e);async[a25_0x3869c4(0x23b)](_0x17897b){const _0x12dfad=a25_0x3869c4,{options:_0x30e8e8,args:_0x5a7bed,tdx:_0x5e9a2d}=_0x17897b;if(_0x5a7bed[_0x12dfad(0x1f5)]===0x0)return console['error'](_0x12dfad(0x256)),console[_0x12dfad(0x27c)](_0x12dfad(0x2b8)),0x1;const _0x37f698=_0x5a7bed[0x0],_0x5e7bc6=_0x30e8e8,_0x585996=_0x5e7bc6[_0x12dfad(0x283)];try{const _0x33813b=await withSpinner(_0x12dfad(0x29b)+_0x37f698+'\x27...',()=>_0x5e9a2d[_0x12dfad(0x2b7)][_0x12dfad(0x20b)]({'name':_0x37f698,'description':_0x585996}),{'verbose':_0x30e8e8[_0x12dfad(0x257)]});console[_0x12dfad(0x200)](_0x12dfad(0x25a)+_0x33813b[_0x12dfad(0x289)]['id']);const _0x3521c7=toLLMProjectInfo(_0x33813b[_0x12dfad(0x289)]);return await handleSDKOutput([_0x3521c7],_0x30e8e8),0x0;}catch(_0x5305f1){return handleSDKError(_0x5305f1,_0x30e8e8),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x29c);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x20f);async[a25_0x3869c4(0x23b)](_0x16425a){const _0xff80f8=a25_0x3869c4,{options:_0x1605bc,args:_0x1c35d0,tdx:_0x2612de}=_0x16425a;if(_0x1c35d0[_0xff80f8(0x1f5)]===0x0)return console[_0xff80f8(0x27c)](_0xff80f8(0x256)),console[_0xff80f8(0x27c)](_0xff80f8(0x280)),0x1;const _0x52f14b=_0x1c35d0[0x0];try{return await withSpinner(_0xff80f8(0x1f9)+_0x52f14b+_0xff80f8(0x2b5),()=>_0x2612de[_0xff80f8(0x2b7)]['deleteProject'](_0x52f14b),{'verbose':_0x1605bc[_0xff80f8(0x257)]}),console['log'](_0xff80f8(0x299)+_0x52f14b),0x0;}catch(_0x4a53a8){return handleSDKError(_0x4a53a8,_0x1605bc),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x203);['description']=a25_0x3869c4(0x2bc);async[a25_0x3869c4(0x23b)](_0x6ac865){const _0x39f026=a25_0x3869c4,{options:_0x4cb90a,args:_0x3a6739,tdx:_0x1968bd}=_0x6ac865;if(_0x3a6739[_0x39f026(0x1f5)]===0x0)return console['error'](_0x39f026(0x256)),console[_0x39f026(0x27c)](_0x39f026(0x264)),0x1;const _0x378538=_0x3a6739[0x0],_0x4cc0fd=_0x4cb90a,_0x2666f2=_0x4cc0fd['output'],_0x450531=_0x4cc0fd[_0x39f026(0x23d)];try{const _0xa5b95b=_0x2666f2||_0x378538+_0x39f026(0x241);if(a25_0x5bb442['existsSync'](_0xa5b95b)&&!_0x450531){if(!_0x4cb90a[_0x39f026(0x2b6)]){const _0x1c7800=await confirm(_0x39f026(0x27f)+_0xa5b95b+_0x39f026(0x2a5));if(!_0x1c7800)return console[_0x39f026(0x200)](_0x39f026(0x234)),0x0;}a25_0x5bb442[_0x39f026(0x25b)](_0xa5b95b,{'recursive':!![]});}const _0x4528f0=await withSpinner(_0x450531?_0x39f026(0x21e)+_0x378538+'\x27...':_0x39f026(0x2ae)+_0x378538+_0x39f026(0x2b5),()=>_0x1968bd[_0x39f026(0x2b7)][_0x39f026(0x20d)](_0x378538,_0x2666f2,{'dryRun':_0x450531}),{'verbose':_0x4cb90a[_0x39f026(0x257)]}),_0x1a492a=_0x4528f0[_0x39f026(0x289)];return _0x450531?console[_0x39f026(0x200)](_0x39f026(0x223)+_0x1a492a[_0x39f026(0x26c)]):console[_0x39f026(0x200)](_0x39f026(0x271)+_0x1a492a[_0x39f026(0x26c)]),console[_0x39f026(0x200)](_0x39f026(0x29e)+_0x1a492a[_0x39f026(0x235)][_0x39f026(0x232)]),console[_0x39f026(0x200)](_0x39f026(0x267)+_0x1a492a['counts'][_0x39f026(0x296)]),console[_0x39f026(0x200)](_0x39f026(0x27a)+_0x1a492a[_0x39f026(0x235)]['prompts']),console[_0x39f026(0x200)](_0x39f026(0x28e)+_0x1a492a[_0x39f026(0x235)]['integrations']),(_0x4cb90a[_0x39f026(0x22c)]===_0x39f026(0x2a8)||_0x4cb90a['format']==='jsonl')&&await handleSDKOutput([_0x1a492a],_0x4cb90a),0x0;}catch(_0x34ed07){return handleSDKError(_0x34ed07,_0x4cb90a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a25_0x3869c4(0x2a1)]=a25_0x3869c4(0x24d);[a25_0x3869c4(0x283)]=a25_0x3869c4(0x243);async['execute'](_0x4380a2){const _0x22c455=a25_0x3869c4,{options:_0x24e6e7,args:_0x5d4cc5,tdx:_0x4afc0f}=_0x4380a2;if(_0x5d4cc5['length']===0x0)return console[_0x22c455(0x27c)](_0x22c455(0x220)),console[_0x22c455(0x27c)]('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x5a187e=_0x5d4cc5[0x0],_0x240ab5=_0x24e6e7,_0x336b56=_0x240ab5[_0x22c455(0x2a1)],_0x44115e=_0x240ab5[_0x22c455(0x23d)];try{if(!_0x44115e){const _0x3ccf52=_0x4afc0f[_0x22c455(0x2b7)][_0x22c455(0x1f7)](_0x5a187e),_0x94b49a=_0x336b56||_0x3ccf52[_0x22c455(0x22b)][_0x22c455(0x246)],_0x12cd52=await withSpinner(_0x22c455(0x221),()=>_0x4afc0f['llm'][_0x22c455(0x22a)](),{'verbose':_0x24e6e7[_0x22c455(0x257)]}),_0x157387=_0x12cd52[_0x22c455(0x289)]['find'](_0x33ad28=>_0x33ad28[_0x22c455(0x284)][_0x22c455(0x2a1)]===_0x94b49a);if(_0x157387&&!_0x24e6e7['yes']){const _0x3c9061=await confirm(_0x22c455(0x214)+_0x94b49a+_0x22c455(0x265));if(!_0x3c9061)return console[_0x22c455(0x200)](_0x22c455(0x274)),0x0;}}const _0x548363=await withSpinner(_0x44115e?_0x22c455(0x286)+_0x5a187e+_0x22c455(0x2b5):_0x22c455(0x25f)+_0x5a187e+'\x27...',()=>_0x4afc0f[_0x22c455(0x2b7)][_0x22c455(0x2bb)](_0x5a187e,{'name':_0x336b56,'dryRun':_0x44115e}),{'verbose':_0x24e6e7[_0x22c455(0x257)]}),_0x487b88=_0x548363[_0x22c455(0x289)];return _0x487b88[_0x22c455(0x297)]&&console[_0x22c455(0x200)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x487b88[_0x22c455(0x297)]+'\x27'),_0x44115e?console[_0x22c455(0x200)]('[DRY\x20RUN]\x20Would\x20restore\x20project:\x20'+_0x487b88[_0x22c455(0x246)]):console[_0x22c455(0x200)]('Project\x20restored:\x20'+_0x487b88[_0x22c455(0x246)]+'\x20('+_0x487b88[_0x22c455(0x254)]+')'),console[_0x22c455(0x200)](_0x22c455(0x29e)+_0x487b88[_0x22c455(0x235)][_0x22c455(0x232)]),console[_0x22c455(0x200)](_0x22c455(0x267)+_0x487b88[_0x22c455(0x235)][_0x22c455(0x296)]),console[_0x22c455(0x200)](_0x22c455(0x27a)+_0x487b88[_0x22c455(0x235)]['prompts']),console[_0x22c455(0x200)](_0x22c455(0x28e)+_0x487b88['counts'][_0x22c455(0x245)]),(_0x24e6e7[_0x22c455(0x22c)]===_0x22c455(0x2a8)||_0x24e6e7[_0x22c455(0x22c)]===_0x22c455(0x295))&&await handleSDKOutput([_0x487b88],_0x24e6e7),0x0;}catch(_0x24e600){return handleSDKError(_0x24e600,_0x24e6e7),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x226a4e,_0x125c64){const _0x111527=a25_0x3869c4,_0x506dbe=_0x125c64['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0x141939=0x0,_0x1e61d3=[];const _0x1d322d=(await import(_0x111527(0x21a)))[_0x111527(0x2c0)],_0x554f80=getChalk(_0x125c64);while(!![]){const _0x309120=await withSpinner(_0x111527(0x2a6),()=>_0x226a4e['llm'][_0x111527(0x23e)](_0x506dbe+_0x141939),{'verbose':_0x125c64[_0x111527(0x257)]});_0x1e61d3=_0x309120[_0x111527(0x289)];const _0x15feb8=_0x1e61d3[_0x111527(0x279)](_0x141939,_0x141939+_0x506dbe),_0x14576b=_0x1e61d3[_0x111527(0x1f5)]>_0x141939+_0x506dbe,_0x265884=[...new Set(_0x15feb8['map'](_0x5f2d6c=>_0x5f2d6c[_0x111527(0x284)]['agentId'])[_0x111527(0x22d)](_0x13cf06=>_0x13cf06!==undefined))],_0x5402ab=new Map();await Promise[_0x111527(0x21f)](_0x265884['map'](async _0x47b72d=>{const _0xa97eee=_0x111527;try{const _0x2ba2b0=await _0x226a4e[_0xa97eee(0x2b7)][_0xa97eee(0x270)](_0x47b72d);_0x5402ab[_0xa97eee(0x262)](_0x47b72d,_0x2ba2b0['attributes'][_0xa97eee(0x2a1)]);}catch{_0x5402ab['set'](_0x47b72d,_0x47b72d);}}));const _0x142db1=_0x15feb8[_0x111527(0x287)](_0x5c17a3=>{const _0x10f7fe=_0x111527,_0x979528=_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x202)]||'(no\x20message)',_0xd0b539=_0x979528['split']('\x0a')[0x0],_0x425d76=_0xd0b539[_0x10f7fe(0x1f5)]>0x50?_0xd0b539[_0x10f7fe(0x293)](0x0,0x4d)+_0x10f7fe(0x2b9):_0xd0b539,_0x12d597=_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x275)]?_0x5402ab[_0x10f7fe(0x2ad)](_0x5c17a3[_0x10f7fe(0x284)]['agentId'])||_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x275)]:_0x10f7fe(0x27e),_0x522a70=_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x252)]||_0x5c17a3[_0x10f7fe(0x284)][_0x10f7fe(0x21b)],_0x545f59=new Date(_0x522a70),_0x69318e=new Date(),_0x51e7e9=_0x69318e[_0x10f7fe(0x244)]()-_0x545f59[_0x10f7fe(0x244)](),_0xf7c922=Math['floor'](_0x51e7e9/0xea60),_0x4f240d=Math[_0x10f7fe(0x2a4)](_0x51e7e9/0x36ee80),_0x464d5a=Math[_0x10f7fe(0x2a4)](_0x51e7e9/0x5265c00);let _0x2b34ce;if(_0xf7c922<0x1)_0x2b34ce=_0x10f7fe(0x29f);else{if(_0xf7c922<0x3c)_0x2b34ce=_0xf7c922+_0x10f7fe(0x25e);else{if(_0x4f240d<0x18)_0x2b34ce=_0x4f240d+'h\x20ago';else _0x464d5a<0x7?_0x2b34ce=_0x464d5a+'d\x20ago':_0x2b34ce=_0x545f59['toLocaleDateString']('en-US',{'month':_0x10f7fe(0x24f),'day':_0x10f7fe(0x26b)});}}return{'title':_0x425d76+'\x20'+_0x554f80[_0x10f7fe(0x2be)]('['+_0x12d597+']\x20'+_0x2b34ce),'value':_0x5c17a3['id']};});_0x14576b&&_0x142db1[_0x111527(0x219)]({'title':_0x554f80[_0x111527(0x23f)](_0x111527(0x27b)),'value':_0x111527(0x2b1)});const _0x1c48b8=await _0x1d322d({'type':'select','name':_0x111527(0x217),'message':_0x111527(0x2bf),'choices':_0x142db1,'hint':_0x111527(0x222)});if(!_0x1c48b8['chatId'])return undefined;if(_0x1c48b8[_0x111527(0x217)]===_0x111527(0x2b1)){_0x141939+=_0x506dbe;continue;}return _0x1c48b8[_0x111527(0x217)];}}export class ChatsCommand extends BaseCommand{['name']=a25_0x3869c4(0x23e);['description']='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a25_0x3869c4(0x23b)](_0x3abcbd){return executeChatHistoryCommand(_0x3abcbd,'tdx\x20chats');}}
@@ -1 +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_0x2d88f3=a26_0x2cc4;(function(_0x513970,_0x56398f){const _0x5881c6=a26_0x2cc4,_0xa8f3f1=_0x513970();while(!![]){try{const _0x9a087a=parseInt(_0x5881c6(0xc9))/0x1*(parseInt(_0x5881c6(0xe0))/0x2)+parseInt(_0x5881c6(0xbb))/0x3+-parseInt(_0x5881c6(0xd7))/0x4*(-parseInt(_0x5881c6(0xcb))/0x5)+-parseInt(_0x5881c6(0xc0))/0x6+parseInt(_0x5881c6(0xee))/0x7+-parseInt(_0x5881c6(0xf1))/0x8*(parseInt(_0x5881c6(0xca))/0x9)+parseInt(_0x5881c6(0xce))/0xa*(-parseInt(_0x5881c6(0xf4))/0xb);if(_0x9a087a===_0x56398f)break;else _0xa8f3f1['push'](_0xa8f3f1['shift']());}catch(_0x4b43ca){_0xa8f3f1['push'](_0xa8f3f1['shift']());}}}(a26_0x43c3,0x43a11));import a26_0x5c1fa4 from'chalk';function a26_0x43c3(){const _0x29a764=['white','description','init','dim','green','92WAJGkY','close','llmProject','yellow','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','log','site','cyan','stop','714qNOUAM','Port\x20','✓\x20Proxy\x20server\x20stopped','created\x20on-demand\x20per\x20model','llm','getOrCreateDefaultProject','\x20is\x20unavailable,\x20using\x20port\x20','server','find','logLevel','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','http://0.0.0.0:','Server\x20Configuration:','projects','1357433hebXlZ','exit','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','8ZUXvnC','name','Project\x20\x27','712536LVhtSc','\x20\x20Agents:','Resolving\x20project...','286998Ziwtxl','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0aTesting\x20with\x20Agent\x20SDK:','logger','\x20\x20}','1842816bzqzhn','port','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20\x20\x20}','SIGTERM','attributes','execute','bold','Starting\x20proxy\x20server...','1263DWQaUt','1405044caGaeS','14035vOBLAn','\x27\x20not\x20found','\x0aClaude\x20Code\x20Configuration:','10KOLJzY','\x20\x20Site:','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','NOT_FOUND'];a26_0x43c3=function(){return _0x29a764;};return a26_0x43c3();}import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a26_0x2cc4(_0x33ad4b,_0x5e144a){_0x33ad4b=_0x33ad4b-0xba;const _0x43c316=a26_0x43c3();let _0x2cc4f0=_0x43c316[_0x33ad4b];return _0x2cc4f0;}import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x1b0994,_0x32cc9a){const _0x285898=a26_0x2cc4,{tdx:_0x1a1f5d,options:_0x2c5ed9}=_0x1b0994,_0x640d85=_0x32cc9a||_0x2c5ed9[_0x285898(0xd9)];if(_0x640d85){const _0x452f83=await _0x1a1f5d['llm']['projects'](),_0x37d1a2=_0x452f83[_0x285898(0xe8)](_0x4af2cf=>_0x4af2cf[_0x285898(0xc5)][_0x285898(0xf2)]===_0x640d85);if(!_0x37d1a2)throw new SDKError(ErrorCode[_0x285898(0xd1)],_0x285898(0xf3)+_0x640d85+_0x285898(0xcc),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x37d1a2['id'];}const _0x2c7048=await _0x1a1f5d[_0x285898(0xe4)][_0x285898(0xe5)]();return _0x2c7048['id'];}export class LLMProxyCommand extends BaseCommand{[a26_0x2d88f3(0xf2)]='llm:proxy';[a26_0x2d88f3(0xd3)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a26_0x2d88f3(0xe7)];['logger'];async[a26_0x2d88f3(0xc6)](_0x3c584e){const _0x3cd40a=a26_0x2d88f3,{tdx:_0x240f15,options:_0x573018}=_0x3c584e;try{const _0x13b478=_0x573018,_0x55be9b=_0x13b478[_0x3cd40a(0xc1)]||0xfa0,_0x313ab0=_0x13b478['project'],_0x589ada=await findAvailablePort(_0x55be9b);console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xba)));const _0x3e4231=await getProjectIdOrDefault(_0x3c584e,_0x313ab0),_0x4c19ef=await _0x240f15[_0x3cd40a(0xe4)][_0x3cd40a(0xed)](),_0x28f196=_0x4c19ef['find'](_0x4ebbdd=>_0x4ebbdd['id']===_0x3e4231);this[_0x3cd40a(0xbe)]=new TDXLogger(_0x573018[_0x3cd40a(0xe9)]),await this[_0x3cd40a(0xbe)][_0x3cd40a(0xd4)](),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xc8)));_0x589ada!==_0x55be9b&&console[_0x3cd40a(0xdc)](a26_0x5c1fa4['yellow'](_0x3cd40a(0xe1)+_0x55be9b+_0x3cd40a(0xe6)+_0x589ada));this['server']=new ProxyServer({'port':_0x589ada,'projectId':_0x3e4231,'tdx':_0x240f15,'logger':this[_0x3cd40a(0xbe)],'site':_0x573018[_0x3cd40a(0xdd)]}),await this[_0x3cd40a(0xe7)]['start'](),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['yellow'][_0x3cd40a(0xc7)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xda)]('This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xda)](_0x3cd40a(0xbc))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['green'][_0x3cd40a(0xc7)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xde)](_0x3cd40a(0xec))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)]('\x20\x20Address:'),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xeb)+_0x589ada)),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['dim']('\x20\x20Project:'),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x28f196?.[_0x3cd40a(0xc5)][_0x3cd40a(0xf2)]||_0x3e4231)),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xf5)),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xe3))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xcf)),a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x573018['site'])),console['log'](a26_0x5c1fa4[_0x3cd40a(0xde)](_0x3cd40a(0xcd))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xdb))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd2)]('\x20\x20{')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['white']('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd2)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x589ada+'\x22,')),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd2)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xc3))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd2)](_0x3cd40a(0xbf))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xde)](_0x3cd40a(0xbd))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xd0))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['dim'](_0x3cd40a(0xf0))),console['log'](a26_0x5c1fa4[_0x3cd40a(0xd5)](_0x3cd40a(0xea))),console[_0x3cd40a(0xdc)](a26_0x5c1fa4['yellow']('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0xe22039=async()=>{const _0x5ca4bb=_0x3cd40a;console['log'](a26_0x5c1fa4['dim'](_0x5ca4bb(0xc2))),this[_0x5ca4bb(0xe7)]&&await this[_0x5ca4bb(0xe7)][_0x5ca4bb(0xdf)](),this[_0x5ca4bb(0xbe)]&&await this['logger'][_0x5ca4bb(0xd8)](),console[_0x5ca4bb(0xdc)](a26_0x5c1fa4[_0x5ca4bb(0xd6)](_0x5ca4bb(0xe2))),process[_0x5ca4bb(0xef)](0x0);};return process['on']('SIGINT',_0xe22039),process['on'](_0x3cd40a(0xc4),_0xe22039),await new Promise(()=>{}),0x0;}catch(_0xdd147b){this[_0x3cd40a(0xe7)]&&await this[_0x3cd40a(0xe7)][_0x3cd40a(0xdf)]();this[_0x3cd40a(0xbe)]&&await this[_0x3cd40a(0xbe)]['close']();throw _0xdd147b;}}}
@@ -1 +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_0xe4513=a27_0x545b;(function(_0x445de0,_0x59044d){const _0x6886b3=a27_0x545b,_0x6a0ae6=_0x445de0();while(!![]){try{const _0x34688c=parseInt(_0x6886b3(0x28e))/0x1+parseInt(_0x6886b3(0x1c7))/0x2+-parseInt(_0x6886b3(0x196))/0x3+parseInt(_0x6886b3(0x192))/0x4+parseInt(_0x6886b3(0x27f))/0x5*(parseInt(_0x6886b3(0x176))/0x6)+parseInt(_0x6886b3(0x1c6))/0x7*(parseInt(_0x6886b3(0x25b))/0x8)+-parseInt(_0x6886b3(0x25c))/0x9;if(_0x34688c===_0x59044d)break;else _0x6a0ae6['push'](_0x6a0ae6['shift']());}catch(_0x25acbd){_0x6a0ae6['push'](_0x6a0ae6['shift']());}}}(a27_0x32a9,0xbafbd));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0x2eadbd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x393c4e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0xe4513(0x270),LEGACY_PARENT_SEGMENT_DIR=a27_0xe4513(0x190);function openBrowser(_0x1bcf64){const _0xd1b997=a27_0xe4513,_0x17b786=process[_0xd1b997(0x182)],_0x5a1389=_0x17b786==='darwin'?_0xd1b997(0x181):_0x17b786===_0xd1b997(0x251)?_0xd1b997(0x246):_0xd1b997(0x21b);spawn(_0x5a1389,[_0x1bcf64],{'detached':!![],'stdio':_0xd1b997(0x211)})['unref']();}function sanitizeFileName(_0x1d7209){const _0x5dc4e3=a27_0xe4513;return _0x1d7209[_0x5dc4e3(0x1c4)]()[_0x5dc4e3(0x1bf)](/[/\\:*?"<>|]/g,'-')[_0x5dc4e3(0x1bf)](/\s+/g,'-')[_0x5dc4e3(0x1bf)](/-+/g,'-')[_0x5dc4e3(0x1bf)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0xed170b=a27_0xe4513;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x547270=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x547270['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xed170b(0x257)](a27_0x393c4e['yellow'](_0xed170b(0x19b)+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x256)+PARENT_SEGMENT_DIR+_0xed170b(0x1dd))),console[_0xed170b(0x257)](a27_0x393c4e['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x259))),![];console[_0xed170b(0x257)](a27_0x393c4e[_0xed170b(0x274)](_0xed170b(0x1f2)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a27_0x393c4e[_0xed170b(0x20c)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3f1f5d){const _0x45176f=_0x3f1f5d instanceof Error?_0x3f1f5d[_0xed170b(0x1d5)]:String(_0x3f1f5d);return console[_0xed170b(0x257)](a27_0x393c4e['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x45176f+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0xe4513(0x1d0)](_0x596470){const _0x1d1c9a=a27_0xe4513;return migrateLegacyDirectory(),super[_0x1d1c9a(0x1d0)](_0x596470);}}function resolveYamlFile(_0xbf1dc5){const _0xb2aae=a27_0xe4513;if(_0xbf1dc5['endsWith'](_0xb2aae(0x24b))||_0xbf1dc5[_0xb2aae(0x220)](_0xb2aae(0x1c3)))return _0xbf1dc5;return a27_0x2eadbd[_0xb2aae(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xbf1dc5)+'.yml');}function formatProgressMessage(_0x555582){const _0x5d31d0=a27_0xe4513,_0x7fc1cd=_0x555582[_0x5d31d0(0x1ff)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7fc1cd){const [,_0x3b973d,_0x2dc7f3,_0x36fe5e='']=_0x7fc1cd;return a27_0x393c4e[_0x5d31d0(0x21d)](_0x3b973d+':')+'\x20'+_0x2dc7f3+a27_0x393c4e[_0x5d31d0(0x21d)](_0x36fe5e);}return a27_0x393c4e[_0x5d31d0(0x21d)](_0x555582);}function showFileNotFoundError(_0x3d64cc,_0x62b8f8){const _0x120742=a27_0xe4513;console[_0x120742(0x257)](a27_0x393c4e[_0x120742(0x25f)](_0x120742(0x267)+_0x3d64cc+'\x0a')),console['error'](a27_0x393c4e[_0x120742(0x1cc)](_0x120742(0x177)+_0x62b8f8+_0x120742(0x1e5)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x20a);[a27_0xe4513(0x21f)]=a27_0xe4513(0x283);async[a27_0xe4513(0x1b0)](_0x5414e4){const _0x1c25e7=a27_0xe4513,{options:_0x2a4f94,args:_0x361bb6,tdx:_0x297cad}=_0x5414e4,_0x5d3294=_0x361bb6[0x0];_0x2a4f94[_0x1c25e7(0x28f)]&&(console[_0x1c25e7(0x257)](_0x1c25e7(0x175)+_0x2a4f94[_0x1c25e7(0x27c)]),_0x5d3294&&console[_0x1c25e7(0x257)]('Pattern:\x20'+_0x5d3294));const _0x1e5493=await withSpinner(_0x5d3294?_0x1c25e7(0x26a)+_0x5d3294+'\x27...':_0x1c25e7(0x277),()=>_0x297cad[_0x1c25e7(0x20f)]['listParents'](),{'verbose':_0x2a4f94[_0x1c25e7(0x28f)]});let _0x434746=_0x1e5493['data'];if(_0x5d3294){const _0x4e49b3=_0x5d3294[_0x1c25e7(0x1bf)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x1c25e7(0x1bf)](/\?/g,'.'),_0x273e84=new RegExp('^'+_0x4e49b3+'$','i');_0x434746=_0x434746[_0x1c25e7(0x247)](_0x1b9496=>_0x273e84[_0x1c25e7(0x236)](_0x1b9496[_0x1c25e7(0x189)][_0x1c25e7(0x262)]));}_0x434746[_0x1c25e7(0x210)]((_0x43175f,_0x78e1e0)=>_0x43175f[_0x1c25e7(0x189)][_0x1c25e7(0x262)][_0x1c25e7(0x215)](_0x78e1e0['attributes'][_0x1c25e7(0x262)])),console[_0x1c25e7(0x257)](_0x1c25e7(0x25d)+_0x434746[_0x1c25e7(0x239)]+_0x1c25e7(0x1f1)+(_0x434746[_0x1c25e7(0x239)]!==0x1?'s':''));if(_0x2a4f94[_0x1c25e7(0x1cf)]===_0x1c25e7(0x253)||_0x2a4f94[_0x1c25e7(0x1cf)]==='jsonl')await handleSDKOutput(_0x434746,_0x2a4f94);else{if(_0x434746['length']===0x0)_0x5d3294?console['log'](_0x1c25e7(0x22c)+_0x5d3294):console['log']('No\x20parent\x20segments\x20found');else for(const _0x4c0560 of _0x434746){const _0x34238d=_0x4c0560['attributes'][_0x1c25e7(0x282)]?a27_0x393c4e[_0x1c25e7(0x21d)]('\x20('+formatRows(_0x4c0560['attributes'][_0x1c25e7(0x282)])+')'):'';console['log'](_0x1c25e7(0x1f7)+_0x4c0560[_0x1c25e7(0x189)][_0x1c25e7(0x262)]+_0x34238d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x184);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x375306){const _0x467244=a27_0xe4513,{options:_0x1d2980,args:_0x28b50d,tdx:_0x523542}=_0x375306;console[_0x467244(0x257)](_0x467244(0x1ab)+_0x467244(0x18a)+_0x467244(0x233));const _0x34bf47=_0x1d2980;if(_0x28b50d[_0x467244(0x239)]===0x0)return console['error'](_0x467244(0x1f6)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;const _0x50ab66=_0x28b50d[0x0];if(!_0x34bf47[_0x467244(0x19a)]||!_0x34bf47['table'])return console[_0x467244(0x257)](_0x467244(0x1e0)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;_0x34bf47[_0x467244(0x28f)]&&(console['error'](_0x467244(0x175)+_0x34bf47[_0x467244(0x27c)]),console[_0x467244(0x257)](_0x467244(0x24e)+_0x50ab66),console['error'](_0x467244(0x248)+_0x34bf47['database']),console[_0x467244(0x257)](_0x467244(0x1f3)+_0x34bf47['table']));const _0x382391=await loadJSONFromOptions(_0x34bf47['attributes'],_0x34bf47[_0x467244(0x261)]),_0x142f3b=await loadJSONFromOptions(_0x34bf47[_0x467244(0x1a1)],_0x34bf47[_0x467244(0x1f5)]),_0x52e895=await loadJSONFromOptions(_0x34bf47[_0x467244(0x243)],_0x34bf47[_0x467244(0x183)]),_0x3eb728={'name':_0x50ab66,'description':_0x34bf47[_0x467244(0x21f)],'scheduleType':_0x34bf47[_0x467244(0x279)],'scheduleOption':_0x34bf47[_0x467244(0x1a0)],'timezone':_0x34bf47[_0x467244(0x255)],'master':{'parentDatabaseName':_0x34bf47['database'],'parentTableName':_0x34bf47[_0x467244(0x258)]},'attributes':_0x382391,'behaviors':_0x142f3b,'customerGroup':_0x52e895},_0x2cc7fc=await withSpinner(_0x467244(0x221)+_0x50ab66+'\x27...',()=>_0x523542[_0x467244(0x20f)]['createParent'](_0x3eb728),{'verbose':_0x1d2980[_0x467244(0x28f)]}),_0x9ab870=_0x2cc7fc[_0x467244(0x226)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x9ab870[_0x467244(0x262)]+_0x467244(0x1af)+_0x9ab870['id']),await handleSDKOutput([_0x9ab870],_0x1d2980),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x3d28c1){const _0x2db336=a27_0xe4513,{options:_0xf5407a,args:_0x29243d,tdx:_0xdd5c59}=_0x3d28c1;console[_0x2db336(0x257)](_0x2db336(0x1b5)+_0x2db336(0x18a)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3aabc9=_0xf5407a;if(_0x29243d[_0x2db336(0x239)]===0x0)return console[_0x2db336(0x257)](_0x2db336(0x1f6)),console[_0x2db336(0x257)](_0x2db336(0x288)),0x1;const _0x1a64ac=_0x29243d[0x0];_0x3aabc9[_0x2db336(0x28f)]&&(console[_0x2db336(0x257)](_0x2db336(0x175)+_0x3aabc9[_0x2db336(0x27c)]),console['error'](_0x2db336(0x198)+_0x1a64ac));const _0x13e8ea=await withSpinner(_0x2db336(0x241)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59['segment']['getParentFull'](_0x1a64ac),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x14f8b1=_0x13e8ea['data'],_0x505bc7=await loadJSONFromOptions(_0x3aabc9['addAttributes'],_0x3aabc9[_0x2db336(0x1bc)]),_0x813b1e=await loadJSONFromOptions(_0x3aabc9[_0x2db336(0x23b)],_0x3aabc9['addBehaviorsFile']),_0x5bb024={'name':_0x14f8b1['name'],'description':_0x3aabc9['description']!==undefined?_0x3aabc9['description']:_0x14f8b1[_0x2db336(0x21f)],'scheduleType':_0x3aabc9[_0x2db336(0x279)]!==undefined?_0x3aabc9[_0x2db336(0x279)]:_0x14f8b1['scheduleType'],'scheduleOption':_0x3aabc9['scheduleOption']!==undefined?_0x3aabc9[_0x2db336(0x1a0)]:_0x14f8b1[_0x2db336(0x1a0)],'timezone':_0x3aabc9[_0x2db336(0x255)]!==undefined?_0x3aabc9[_0x2db336(0x255)]:_0x14f8b1['timezone'],'master':_0x14f8b1[_0x2db336(0x1ec)],'attributes':_0x505bc7?[..._0x14f8b1['attributes']||[],..._0x505bc7]:_0x14f8b1[_0x2db336(0x189)],'behaviors':_0x813b1e?[..._0x14f8b1[_0x2db336(0x1a1)]||[],..._0x813b1e]:_0x14f8b1[_0x2db336(0x1a1)],'customerGroup':_0x14f8b1[_0x2db336(0x243)]},_0x1471d6=await withSpinner(_0x2db336(0x1d9)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59[_0x2db336(0x20f)][_0x2db336(0x23a)](_0x1a64ac,_0x5bb024),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x205037=_0x1471d6[_0x2db336(0x226)];return console['error'](_0x2db336(0x24d)+_0x205037['name']+'\x27'),await handleSDKOutput([_0x205037],_0x3aabc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x18b);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x39978e){const _0x706327=a27_0xe4513,{options:_0x360a04,args:_0x434c6,tdx:_0x204405}=_0x39978e,_0x2feb6a=_0x360a04,_0x4559e2=_0x434c6[0x0]||_0x360a04[_0x706327(0x17a)];if(!_0x4559e2)return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)](_0x706327(0x229))),console['error'](_0x706327(0x1bb)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)](_0x706327(0x1c2))),0x1;if(_0x2feb6a[_0x706327(0x214)]&&_0x2feb6a[_0x706327(0x292)])return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a27_0x393c4e['dim'](_0x706327(0x1a4))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x21d)](_0x706327(0x18f)+PARENT_SEGMENT_DIR+_0x706327(0x240))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x534a91=_0x2feb6a[_0x706327(0x292)]||a27_0x2eadbd[_0x706327(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4559e2)+_0x706327(0x24b));_0x2feb6a['verbose']&&(console[_0x706327(0x257)]('Site:\x20'+_0x2feb6a['site']),console[_0x706327(0x257)]('Parent\x20segment:\x20'+_0x4559e2),console['error'](_0x706327(0x271)+_0x534a91));const _0x4dd2ba=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4559e2+'\x27...',()=>_0x204405[_0x706327(0x20f)][_0x706327(0x26d)](_0x4559e2),{'verbose':_0x2feb6a[_0x706327(0x28f)]}),_0x553d9e=_0x4dd2ba['data'];if(existsSync(_0x534a91)){const _0x4bddb5=readFileSync(_0x534a91,_0x706327(0x1d1)),_0xff2e1c=generateDiff(_0x4bddb5,_0x553d9e);if(!hasChanges(_0xff2e1c))console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x266)+a27_0x393c4e['cyan'](_0x534a91)+_0x706327(0x289));else{console[_0x706327(0x257)]('\x0aChanges\x20to\x20\x27'+_0x534a91+'\x27:'),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c)),console['error'](formatDiffWithColors(_0xff2e1c)),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c));if(!_0x2feb6a[_0x706327(0x22e)]){const _0x54a040=await confirmKey('Overwrite\x20\x27'+_0x534a91+'\x27?');if(!_0x54a040)return console[_0x706327(0x257)](_0x706327(0x260)),0x1;}writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e[_0x706327(0x1cc)](_0x534a91));}}else{const _0x5e3cb4=a27_0x2eadbd[_0x706327(0x205)](_0x534a91);!existsSync(_0x5e3cb4)&&mkdirSync(_0x5e3cb4,{'recursive':!![]}),writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e['cyan'](_0x534a91));}return saveSessionContext({'parent_segment':_0x4559e2},_0x2feb6a['session']),console[_0x706327(0x257)](a27_0x393c4e['green']('✔')+'\x20Context\x20set:\x20'+a27_0x393c4e['dim'](_0x706327(0x190))+_0x706327(0x18c)+a27_0x393c4e[_0x706327(0x1cc)](_0x4559e2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x1a5);[a27_0xe4513(0x21f)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x3be310){const _0x51e7e3=a27_0xe4513,{options:_0xe40479,args:_0x4a4bc2,tdx:_0x2036d0}=_0x3be310,_0x1b6870=_0xe40479,_0x2fd141=_0x4a4bc2[0x0]||_0xe40479[_0x51e7e3(0x17a)];if(!_0x2fd141)return console[_0x51e7e3(0x257)](a27_0x393c4e['red'](_0x51e7e3(0x229))),console[_0x51e7e3(0x257)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x51e7e3(0x257)](a27_0x393c4e['cyan']('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first')),0x1;const _0xaebbc2=resolveYamlFile(_0x2fd141);if(!existsSync(_0xaebbc2))return showFileNotFoundError(_0xaebbc2,_0x2fd141),0x1;_0x1b6870['verbose']&&(console[_0x51e7e3(0x257)]('Site:\x20'+_0x1b6870[_0x51e7e3(0x27c)]),console[_0x51e7e3(0x257)]('YAML\x20file:\x20'+_0xaebbc2));let _0x314748;try{_0x314748=readFileSync(_0xaebbc2,_0x51e7e3(0x1d1));}catch(_0x33e732){const _0x2932d5=_0x33e732 instanceof Error?_0x33e732[_0x51e7e3(0x1d5)]:String(_0x33e732);return console[_0x51e7e3(0x257)](_0x51e7e3(0x278)+_0x2932d5),0x1;}const _0x3a7f8a=await withSpinner(_0x51e7e3(0x1fd),()=>_0x2036d0[_0x51e7e3(0x20f)]['pushParentYaml'](_0x314748),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x557f1a=_0x3a7f8a[_0x51e7e3(0x226)],{isNew:_0x24704c,name:_0x5a23c3,hasChanges:_0x936347,diffFormatted:_0x50f9e2}=_0x557f1a;if(!_0x936347)return console[_0x51e7e3(0x257)](_0x51e7e3(0x1a3)+_0x5a23c3+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x24704c?console[_0x51e7e3(0x257)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5a23c3+'\x27:'):console[_0x51e7e3(0x257)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x5a23c3+'\x27:');console[_0x51e7e3(0x257)]('─'[_0x51e7e3(0x18d)](0x3c)),console[_0x51e7e3(0x257)](_0x50f9e2),console['error']('─'[_0x51e7e3(0x18d)](0x3c));const _0x2f1ee5=_0x24704c?_0x51e7e3(0x197)+_0x5a23c3+'\x27?':_0x51e7e3(0x18e)+_0x5a23c3+'\x27?';if(!_0x1b6870['yes']){const _0x45a613=await confirmKey(_0x2f1ee5);if(!_0x45a613)return console[_0x51e7e3(0x257)]('Aborted.'),0x1;}const _0x4a095d=_0x24704c?_0x51e7e3(0x28a):_0x51e7e3(0x204),_0x1ad3ba=await withSpinner(_0x4a095d+_0x51e7e3(0x1b4)+_0x5a23c3+_0x51e7e3(0x275),()=>_0x557f1a[_0x51e7e3(0x27e)](),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x3991f0=_0x1ad3ba['data'],_0x390646=getConsoleNextUrl(_0x1b6870[_0x51e7e3(0x27c)],_0x51e7e3(0x26b)+_0x3991f0['id']),_0x9a7de6=_0x24704c?_0x51e7e3(0x20b):_0x51e7e3(0x1da);return console['error']('✔\x20'+_0x9a7de6+'\x20parent\x20segment\x20\x27'+_0x3991f0[_0x51e7e3(0x262)]+'\x27'),console[_0x51e7e3(0x257)]('\x20\x20'+_0x390646),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x21a);[a27_0xe4513(0x21f)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a27_0xe4513(0x1b0)](_0x537193){const _0x454202=a27_0xe4513,{options:_0x52384b,args:_0x15dd46,tdx:_0x4370e4}=_0x537193,_0x1e063a=_0x52384b,_0xddacae=_0x15dd46[0x0]||_0x52384b['parentSegment'];if(!_0xddacae)return console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x454202(0x257)](_0x454202(0x23d)),console[_0x454202(0x257)](_0x454202(0x1f0)),console[_0x454202(0x257)](_0x454202(0x1f9)),console['error']('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x454202(0x257)](_0x454202(0x193)),console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x1cc)](_0x454202(0x1ca))),0x1;const _0x521335=resolveYamlFile(_0xddacae);if(!existsSync(_0x521335))return showFileNotFoundError(_0x521335,_0xddacae),0x1;_0x1e063a[_0x454202(0x28f)]&&(console[_0x454202(0x257)](_0x454202(0x175)+_0x1e063a['site']),console['error'](_0x454202(0x1b2)+_0x521335));let _0x35f1bc;try{_0x35f1bc=readFileSync(_0x521335,_0x454202(0x1d1));}catch(_0x342500){const _0x374612=_0x342500 instanceof Error?_0x342500[_0x454202(0x1d5)]:String(_0x342500);return console[_0x454202(0x257)](_0x454202(0x278)+_0x374612),0x1;}const _0x2a99d8=createCommandSpinner(a27_0x393c4e[_0x454202(0x21d)]('Validating\x20configuration...'),{'verbose':_0x1e063a[_0x454202(0x28f)]});_0x2a99d8[_0x454202(0x246)]();const _0x39e43c={'onProgress':_0x1a83e9=>{const _0x28272e=_0x454202;_0x2a99d8[_0x28272e(0x1de)]=formatProgressMessage(_0x1a83e9);}};if(_0x1e063a[_0x454202(0x1ec)])_0x39e43c[_0x454202(0x1ec)]=!![];if(_0x1e063a[_0x454202(0x17f)])_0x39e43c[_0x454202(0x17f)]=!![];_0x1e063a[_0x454202(0x219)]&&(_0x39e43c[_0x454202(0x219)]=_0x1e063a[_0x454202(0x219)]);_0x1e063a[_0x454202(0x206)]&&(_0x39e43c['behavior']=_0x1e063a[_0x454202(0x206)]);if(_0x1e063a['interval'])_0x39e43c['interval']=_0x1e063a[_0x454202(0x1bd)];let _0x3f65ad;try{_0x3f65ad=await _0x4370e4[_0x454202(0x20f)][_0x454202(0x208)](_0x35f1bc,_0x39e43c),_0x2a99d8[_0x454202(0x1b3)]();}catch(_0xe196d1){_0x2a99d8[_0x454202(0x1b3)]();throw _0xe196d1;}const _0x48c68c=_0x1e063a[_0x454202(0x1bd)]||_0x454202(0x1dc);return this[_0x454202(0x272)](_0x3f65ad,_0x39e43c,_0x521335,_0x48c68c),_0x3f65ad['allValid']?0x0:0x1;}[a27_0xe4513(0x272)](_0x143da4,_0x10d31d,_0x139a06,_0x1f9cf1){const _0x42c44d=a27_0xe4513;console[_0x42c44d(0x257)]('\x0a'+a27_0x393c4e[_0x42c44d(0x1d6)](_0x42c44d(0x269))+'\x20'+_0x143da4['name']),console[_0x42c44d(0x257)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x143da4);if(typeof _0x10d31d[_0x42c44d(0x219)]===_0x42c44d(0x1a6)){this['displayAttributesStats'](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'attribute',_0x10d31d[_0x42c44d(0x219)]);return;}if(_0x10d31d[_0x42c44d(0x219)]===!![]){this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x189));return;}if(typeof _0x10d31d['behavior']==='string'){this['displayBehaviorsStats'](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x206),_0x10d31d[_0x42c44d(0x206)]);return;}if(_0x10d31d[_0x42c44d(0x206)]===!![]){this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this['displayPreviewHints'](_0x139a06,_0x1f9cf1,_0x42c44d(0x1a1));return;}this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'all');}['displayPreviewHints'](_0x248f3e,_0x2190a4,_0x224222,_0x43602f){const _0x1a148a=a27_0xe4513;console[_0x1a148a(0x257)]('\x0a'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x252)));const _0x437d63=_0x2190a4!==_0x1a148a(0x1dc)?_0x1a148a(0x232)+_0x2190a4:'';if(_0x224222==='attribute'&&_0x43602f)console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x22a)+_0x43602f+'\x22'+_0x437d63));else{if(_0x224222===_0x1a148a(0x206)&&_0x43602f)console['error']('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x24f)+_0x43602f+'\x22'+_0x437d63));else(_0x224222===_0x1a148a(0x189)||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x19d)+_0x437d63));}(_0x224222==='behaviors'||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)]('tdx\x20segment\x20parent\x20preview\x20'+_0x248f3e+_0x1a148a(0x1c9)+_0x437d63)),_0x224222===_0x1a148a(0x1fb)&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x1a7)+_0x437d63));}['displayMasterInfo'](_0x1f773d){const _0x15f35b=a27_0xe4513,{master:_0x590b65}=_0x1f773d,_0x118efa=_0x590b65[_0x15f35b(0x24a)]?a27_0x393c4e[_0x15f35b(0x20c)]('✔'):a27_0x393c4e['red']('✘');console[_0x15f35b(0x257)]('\x0a'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1eb))),console['error'](_0x118efa+'\x20'+a27_0x393c4e[_0x15f35b(0x1d6)](_0x590b65[_0x15f35b(0x19a)]+'.'+_0x590b65[_0x15f35b(0x258)])),_0x590b65[_0x15f35b(0x24a)]?_0x590b65[_0x15f35b(0x20e)]!==undefined&&console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1e2))+'\x20'+a27_0x393c4e[_0x15f35b(0x1cc)](formatRows(_0x590b65['rowCount']))):console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e['red'](_0x15f35b(0x1ba))+'\x20'+_0x590b65[_0x15f35b(0x213)]);}[a27_0xe4513(0x245)](_0x4fa0d2){const _0x1ffb6c=a27_0xe4513;if(_0x4fa0d2[_0x1ffb6c(0x189)]['length']===0x0)return;console[_0x1ffb6c(0x257)]('\x0a'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1fa)));for(const _0x14598f of _0x4fa0d2['attributes']){const _0x46e617=_0x14598f[_0x1ffb6c(0x24a)]?a27_0x393c4e[_0x1ffb6c(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x59ecce='';if(_0x14598f[_0x1ffb6c(0x24a)]&&_0x14598f[_0x1ffb6c(0x291)]!==undefined&&_0x14598f[_0x1ffb6c(0x17d)]!==undefined){const _0x53567a=_0x14598f[_0x1ffb6c(0x17d)][_0x1ffb6c(0x19f)](0x1),_0x450d75=_0x14598f[_0x1ffb6c(0x17d)]>=0x50?a27_0x393c4e[_0x1ffb6c(0x20c)]:_0x14598f[_0x1ffb6c(0x17d)]>=0x32?a27_0x393c4e[_0x1ffb6c(0x274)]:a27_0x393c4e['red'];_0x59ecce='\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Coverage:')+'\x20'+_0x450d75(_0x53567a+'%')+'\x20('+formatRows(_0x14598f[_0x1ffb6c(0x291)])+_0x1ffb6c(0x263);}console[_0x1ffb6c(0x257)](_0x46e617+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f[_0x1ffb6c(0x262)])+_0x59ecce),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1e8))+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f['database']+'.'+_0x14598f[_0x1ffb6c(0x258)]));const _0x6bea5c=_0x14598f['joinKey']===_0x14598f[_0x1ffb6c(0x27a)]?a27_0x393c4e[_0x1ffb6c(0x21d)]('Join\x20on:')+'\x20'+_0x14598f['joinKey']:a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x254))+'\x20'+_0x14598f[_0x1ffb6c(0x25a)]+_0x1ffb6c(0x18c)+_0x14598f[_0x1ffb6c(0x27a)];console[_0x1ffb6c(0x257)]('\x20\x20'+_0x6bea5c),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Columns:')),this[_0x1ffb6c(0x1cd)](_0x14598f[_0x1ffb6c(0x199)]),!_0x14598f[_0x1ffb6c(0x24a)]&&console[_0x1ffb6c(0x257)]('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x25f)](_0x1ffb6c(0x1ba))+'\x20'+_0x14598f['schemaError']);}}[a27_0xe4513(0x223)](_0x284d70,_0x5c0d0b){const _0x383aee=a27_0xe4513;if(_0x284d70['behaviors'][_0x383aee(0x239)]===0x0)return;console[_0x383aee(0x257)]('\x0a'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1c1))+'\x20'+a27_0x393c4e[_0x383aee(0x21d)]('('+_0x5c0d0b+')'));for(const _0x479c3a of _0x284d70['behaviors']){const _0x1f9b2e=_0x479c3a[_0x383aee(0x24a)]?a27_0x393c4e[_0x383aee(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x4efea2='';if(_0x479c3a['schemaValid']&&_0x479c3a['customersWithEvents']!==undefined&&_0x479c3a[_0x383aee(0x25e)]!==undefined){const _0x2d4e01=_0x479c3a[_0x383aee(0x280)]?.[_0x383aee(0x19f)](0x1)||'?',_0x42cfe1=(_0x479c3a['customerPercent']??0x0)>=0x32?a27_0x393c4e[_0x383aee(0x20c)]:(_0x479c3a[_0x383aee(0x280)]??0x0)>=0x14?a27_0x393c4e[_0x383aee(0x274)]:a27_0x393c4e[_0x383aee(0x25f)];_0x4efea2='\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1ed))+'\x20'+_0x42cfe1(formatRows(_0x479c3a[_0x383aee(0x231)]))+'\x20('+_0x2d4e01+'%)\x20'+a27_0x393c4e['dim'](_0x383aee(0x1c0))+'\x20'+a27_0x393c4e['cyan'](formatRows(_0x479c3a[_0x383aee(0x25e)]));}console[_0x383aee(0x257)](_0x1f9b2e+'\x20'+a27_0x393c4e['bold'](_0x479c3a['name'])+_0x4efea2),console[_0x383aee(0x257)]('\x20\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1e8))+'\x20'+a27_0x393c4e[_0x383aee(0x1d6)](_0x479c3a[_0x383aee(0x19a)]+'.'+_0x479c3a[_0x383aee(0x258)]));const _0x9a5840=_0x479c3a[_0x383aee(0x25a)]===_0x479c3a[_0x383aee(0x27a)]?a27_0x393c4e['dim'](_0x383aee(0x1db))+'\x20'+_0x479c3a[_0x383aee(0x25a)]:a27_0x393c4e['dim'](_0x383aee(0x254))+'\x20'+_0x479c3a['joinKey']+_0x383aee(0x18c)+_0x479c3a[_0x383aee(0x27a)];console[_0x383aee(0x257)]('\x20\x20'+_0x9a5840),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x383aee(0x1d7))),this[_0x383aee(0x1cd)](_0x479c3a[_0x383aee(0x199)]),!_0x479c3a[_0x383aee(0x24a)]&&console['error']('\x20\x20'+a27_0x393c4e[_0x383aee(0x25f)]('Error:')+'\x20'+_0x479c3a['schemaError']);}}[a27_0xe4513(0x1cd)](_0x2f3615){const _0x5557cb=a27_0xe4513;for(const _0xf8eeb7 of _0x2f3615){_0xf8eeb7['label']===_0xf8eeb7[_0x5557cb(0x187)]||_0xf8eeb7[_0x5557cb(0x187)]==='*'?console[_0x5557cb(0x257)](_0x5557cb(0x1f8)+_0xf8eeb7['label']):console['error'](_0x5557cb(0x1f8)+_0xf8eeb7[_0x5557cb(0x188)]+'\x20'+a27_0x393c4e['dim']('('+_0xf8eeb7[_0x5557cb(0x187)]+')'));}}[a27_0xe4513(0x1f4)](_0x308b3e){const _0x31f453=a27_0xe4513;console[_0x31f453(0x257)]('─'[_0x31f453(0x18d)](0x3c));if(_0x308b3e[_0x31f453(0x17c)][_0x31f453(0x239)]>0x0){console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x25f)](_0x31f453(0x1b9)));for(const _0x995649 of _0x308b3e['errors']){console[_0x31f453(0x257)]('\x20\x20'+a27_0x393c4e[_0x31f453(0x25f)]('•')+'\x20'+_0x995649);}}_0x308b3e[_0x31f453(0x222)]&&console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x20c)]('✔')+_0x31f453(0x28d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x264);[a27_0xe4513(0x21f)]=a27_0xe4513(0x1b6);async[a27_0xe4513(0x1b0)](_0x980ec9){const _0x573298=a27_0xe4513,{options:_0x4b4117,args:_0x164bf6,tdx:_0x19cd02}=_0x980ec9,_0x1238db=_0x4b4117,_0x43ec50=_0x164bf6[0x0]||_0x4b4117[_0x573298(0x17a)];if(!_0x43ec50)return console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x229))),console[_0x573298(0x257)](_0x573298(0x1ae)),console[_0x573298(0x257)](_0x573298(0x1e4)),console['error'](_0x573298(0x1e9)),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x573298(0x257)](_0x573298(0x193)),console[_0x573298(0x257)](a27_0x393c4e['cyan'](_0x573298(0x1ca))),0x1;if(!_0x1238db[_0x573298(0x1ec)]&&!_0x1238db[_0x573298(0x219)]&&!_0x1238db[_0x573298(0x206)]&&!_0x1238db[_0x573298(0x17f)])return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x194))),console[_0x573298(0x257)](_0x573298(0x1ae)),console['error'](_0x573298(0x1f0)),console[_0x573298(0x257)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)](_0x573298(0x227)),0x1;const _0x544844=resolveYamlFile(_0x43ec50);if(!existsSync(_0x544844))return showFileNotFoundError(_0x544844,_0x43ec50),0x1;_0x1238db[_0x573298(0x28f)]&&(console[_0x573298(0x257)](_0x573298(0x175)+_0x1238db[_0x573298(0x27c)]),console[_0x573298(0x257)](_0x573298(0x1b2)+_0x544844));let _0x1e6c6a;try{_0x1e6c6a=readFileSync(_0x544844,_0x573298(0x1d1));}catch(_0x11e38e){const _0xedcfb0=_0x11e38e instanceof Error?_0x11e38e['message']:String(_0x11e38e);return console[_0x573298(0x257)](_0x573298(0x278)+_0xedcfb0),0x1;}let _0x274b95;try{_0x274b95=parseYamlString(_0x1e6c6a);}catch(_0x380012){const _0x412180=_0x380012 instanceof Error?_0x380012[_0x573298(0x1d5)]:String(_0x380012);return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error\x20parsing\x20YAML:\x20'+_0x412180)),0x1;}if(_0x1238db[_0x573298(0x219)]===!![]||_0x1238db[_0x573298(0x219)]===''){const _0x4e64e4=_0x274b95[_0x573298(0x189)]?.['map'](_0x1c971a=>_0x1c971a[_0x573298(0x262)])||[];if(_0x4e64e4[_0x573298(0x239)]===0x0)console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x1a8)));else{console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x202))),console[_0x573298(0x257)](_0x573298(0x287));for(const _0x49b7dc of _0x4e64e4){console[_0x573298(0x257)]('\x20\x20'+a27_0x393c4e[_0x573298(0x1cc)](_0x49b7dc));}console['error'](_0x573298(0x265)+_0x43ec50+'\x20--attribute\x20\x22'+_0x4e64e4[0x0]+'\x22');}return 0x1;}if(_0x1238db[_0x573298(0x206)]===!![]||_0x1238db[_0x573298(0x206)]===''){const _0x11c77f=_0x274b95[_0x573298(0x1a1)]?.[_0x573298(0x200)](_0x2dea67=>_0x2dea67[_0x573298(0x262)])||[];if(_0x11c77f[_0x573298(0x239)]===0x0)console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x217))),console['error'](_0x573298(0x1d4));for(const _0x5e303a of _0x11c77f){console['error']('\x20\x20'+a27_0x393c4e['cyan'](_0x5e303a));}console[_0x573298(0x257)](_0x573298(0x265)+_0x43ec50+_0x573298(0x24f)+_0x11c77f[0x0]+'\x22');}return 0x1;}const _0x7ea2a8=createCommandSpinner(a27_0x393c4e[_0x573298(0x21d)](_0x573298(0x249)),{'verbose':_0x1238db[_0x573298(0x28f)]});_0x7ea2a8[_0x573298(0x246)]();const _0x2a3b15={'onProgress':_0x46be19=>{const _0x57e2cc=_0x573298;_0x7ea2a8[_0x57e2cc(0x1de)]=formatProgressMessage(_0x46be19);}};if(_0x1238db[_0x573298(0x1ec)])_0x2a3b15['master']=!![];if(_0x1238db[_0x573298(0x219)]&&typeof _0x1238db['attribute']===_0x573298(0x1a6))_0x2a3b15[_0x573298(0x219)]=_0x1238db[_0x573298(0x219)];if(_0x1238db[_0x573298(0x206)]&&typeof _0x1238db[_0x573298(0x206)]===_0x573298(0x1a6))_0x2a3b15['behavior']=_0x1238db[_0x573298(0x206)];if(_0x1238db[_0x573298(0x17f)])_0x2a3b15[_0x573298(0x17f)]=!![];if(_0x1238db[_0x573298(0x1bd)])_0x2a3b15[_0x573298(0x1bd)]=_0x1238db[_0x573298(0x1bd)];let _0x486efb;try{_0x486efb=await _0x19cd02['segment'][_0x573298(0x21e)](_0x1e6c6a,_0x2a3b15),_0x7ea2a8[_0x573298(0x1b3)]();}catch(_0x5a5ecc){_0x7ea2a8[_0x573298(0x1b3)]();throw _0x5a5ecc;}return await this[_0x573298(0x191)](_0x486efb,{'master':_0x1238db[_0x573298(0x1ec)],'attribute':typeof _0x1238db[_0x573298(0x219)]===_0x573298(0x1a6)?_0x1238db[_0x573298(0x219)]:undefined,'behavior':typeof _0x1238db[_0x573298(0x206)]==='string'?_0x1238db[_0x573298(0x206)]:undefined,'enriched':_0x1238db[_0x573298(0x17f)]}),_0x486efb['allValid']?0x0:0x1;}async[a27_0xe4513(0x191)](_0x5a4e2e,_0x2f9989){const _0x5d4e7b=a27_0xe4513;console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5d4e7b(0x1d2))+'\x20'+_0x5a4e2e[_0x5d4e7b(0x262)]),console[_0x5d4e7b(0x257)]('═'['repeat'](0x3c));if(_0x2f9989['master']&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x521585=a27_0x393c4e[_0x5d4e7b(0x21d)]('Master:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5a4e2e[_0x5d4e7b(0x1ec)][_0x5d4e7b(0x19a)]+'.'+_0x5a4e2e[_0x5d4e7b(0x1ec)]['table']);await this[_0x5d4e7b(0x24c)](_0x521585,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x219)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x579597=a27_0x393c4e[_0x5d4e7b(0x21d)](_0x5d4e7b(0x28b))+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989['attribute']);await this[_0x5d4e7b(0x24c)](_0x579597,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x206)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x131c3c=a27_0x393c4e['dim']('Behavior:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989[_0x5d4e7b(0x206)]);await this[_0x5d4e7b(0x24c)](_0x131c3c,_0x5a4e2e['sampleData']);}else{if(_0x2f9989[_0x5d4e7b(0x17f)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x41ecef=a27_0x393c4e[_0x5d4e7b(0x21d)]('Enriched:')+'\x20'+a27_0x393c4e['bold'](_0x5d4e7b(0x235));await this[_0x5d4e7b(0x24c)](_0x41ecef,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else!_0x5a4e2e['sampleData']&&console[_0x5d4e7b(0x257)](_0x5d4e7b(0x1df));}}}if(_0x5a4e2e['errors'][_0x5d4e7b(0x239)]>0x0){console[_0x5d4e7b(0x257)]('─'['repeat'](0x3c)),console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e['red']('Errors:'));for(const _0x37467c of _0x5a4e2e[_0x5d4e7b(0x17c)]){console['error']('\x20\x20'+a27_0x393c4e['red']('•')+'\x20'+_0x37467c);}}}async[a27_0xe4513(0x24c)](_0x2d37dd,_0x467583){const _0x426667=a27_0xe4513;if(_0x467583[_0x426667(0x239)]===0x0){console['error']('\x0a'+_0x2d37dd),console[_0x426667(0x257)](_0x426667(0x17b));return;}console[_0x426667(0x257)]('\x0a'+_0x2d37dd);const _0x398837=Object[_0x426667(0x284)](_0x467583[0x0])['map'](_0x223ba0=>({'name':_0x223ba0,'type':typeof _0x467583[0x0][_0x223ba0]===_0x426667(0x22f)?_0x426667(0x201):_0x426667(0x238)})),_0x3aee7f={'queryId':_0x426667(0x244),'columns':_0x398837,'data':_0x467583,'stats':{'state':_0x426667(0x1ad),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x467583[_0x426667(0x239)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x7f9d10=formatAsTable(_0x3aee7f,_0x467583[_0x426667(0x239)],!![]);await writeOutput(_0x7f9d10,undefined,_0x426667(0x258));}}function a27_0x545b(_0x47f12d,_0x521d1c){_0x47f12d=_0x47f12d-0x175;const _0x32a9bd=a27_0x32a9();let _0x545b49=_0x32a9bd[_0x47f12d];return _0x545b49;}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x23f);[a27_0xe4513(0x21f)]=a27_0xe4513(0x26e);async[a27_0xe4513(0x1b0)](_0x39bc7e){const _0x20524e=a27_0xe4513,{options:_0x4ec766,args:_0x3eb623,tdx:_0x1f538e}=_0x39bc7e,_0x479fbf=_0x4ec766,_0x10278f=_0x3eb623[0x0]||_0x4ec766[_0x20524e(0x17a)];if(!_0x10278f)return console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x20524e(0x257)](_0x20524e(0x1c5)),console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x1cc)](_0x20524e(0x1c2))),0x1;const _0x3880c6=resolveYamlFile(_0x10278f);if(existsSync(_0x3880c6)){_0x479fbf['verbose']&&console[_0x20524e(0x257)]('Found\x20YAML\x20file:\x20'+_0x3880c6);let _0x2daed;try{_0x2daed=readFileSync(_0x3880c6,_0x20524e(0x1d1));}catch(_0x58ddbb){const _0x53184b=_0x58ddbb instanceof Error?_0x58ddbb[_0x20524e(0x1d5)]:String(_0x58ddbb);return console[_0x20524e(0x257)](_0x20524e(0x278)+_0x53184b),0x1;}const _0x2b0bb4=await withSpinner(_0x20524e(0x1fd),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23c)](_0x2daed),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x72163c=_0x2b0bb4[_0x20524e(0x226)],{isNew:_0x6af045,name:_0x40a8b2,hasChanges:_0x26b37c,diffFormatted:_0x53003b}=_0x72163c;if(_0x26b37c){_0x6af045?console['error'](_0x20524e(0x1d3)+_0x40a8b2+'\x27:'):console[_0x20524e(0x257)](_0x20524e(0x26c)+_0x40a8b2+'\x27:');console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c)),console[_0x20524e(0x257)](_0x53003b),console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c));const _0x3f3250=_0x6af045?_0x20524e(0x197)+_0x40a8b2+_0x20524e(0x22b):'Apply\x20changes\x20to\x20\x27'+_0x40a8b2+_0x20524e(0x22b);if(!_0x479fbf[_0x20524e(0x22e)]){const _0x1cf0b0=await confirmKey(_0x3f3250);if(!_0x1cf0b0)return console[_0x20524e(0x257)]('Aborted.'),0x1;}const _0x5e6152=_0x6af045?_0x20524e(0x28a):_0x20524e(0x204);await withSpinner(_0x5e6152+_0x20524e(0x1b4)+_0x40a8b2+_0x20524e(0x275),()=>_0x72163c[_0x20524e(0x27e)](),{'verbose':_0x479fbf['verbose']});const _0x300cb2=_0x6af045?_0x20524e(0x20b):_0x20524e(0x1da);console[_0x20524e(0x257)]('✔\x20'+_0x300cb2+_0x20524e(0x1b4)+_0x40a8b2+'\x27');}else console[_0x20524e(0x257)](_0x20524e(0x1a3)+_0x40a8b2+_0x20524e(0x207));}const _0x6e7f36=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x10278f+_0x20524e(0x275),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23e)](_0x10278f),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x377259=_0x6e7f36[_0x20524e(0x226)],_0x301faf=getConsoleUrl(_0x479fbf[_0x20524e(0x27c)],_0x20524e(0x242)+_0x377259[_0x20524e(0x17e)]+_0x20524e(0x1e1)+_0x377259[_0x20524e(0x19e)]+_0x20524e(0x234)+_0x377259[_0x20524e(0x228)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x218))+'\x20'+_0x377259['audienceId']),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x21c))+'\x20'+_0x377259[_0x20524e(0x1b1)]),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x180))+'\x20'+_0x377259[_0x20524e(0x19e)]),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x20524e(0x225))+'\x20'+_0x377259[_0x20524e(0x228)]),console[_0x20524e(0x257)]('\x20\x20'+_0x301faf),console[_0x20524e(0x257)]('\x0a'+a27_0x393c4e['dim'](_0x20524e(0x27b))+_0x20524e(0x1ce)+_0x377259[_0x20524e(0x228)]+_0x20524e(0x1e7)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x1b7);[a27_0xe4513(0x21f)]=a27_0xe4513(0x185);async[a27_0xe4513(0x1b0)](_0x125af1){const _0x17779d=a27_0xe4513,{options:_0x26196,args:_0x33d7d5,tdx:_0x146ac6}=_0x125af1,_0x24c200=_0x33d7d5[0x0]||_0x26196[_0x17779d(0x17a)];if(!_0x24c200)return console['error'](a27_0x393c4e[_0x17779d(0x25f)](_0x17779d(0x229))),console[_0x17779d(0x257)](_0x17779d(0x28c)),console[_0x17779d(0x257)](a27_0x393c4e[_0x17779d(0x1cc)](_0x17779d(0x1c2))),0x1;_0x26196['verbose']&&(console['error'](_0x17779d(0x175)+_0x26196['site']),console[_0x17779d(0x257)](_0x17779d(0x198)+_0x24c200));const _0x1f5e89=await withSpinner(_0x17779d(0x290)+_0x24c200+'\x27...',()=>_0x146ac6[_0x17779d(0x20f)]['listFields'](_0x24c200),{'verbose':_0x26196['verbose']}),_0x362d1c=_0x1f5e89[_0x17779d(0x226)];console['error'](_0x17779d(0x25d)+_0x362d1c[_0x17779d(0x239)]+'\x20field'+(_0x362d1c['length']!==0x1?'s':''));if(_0x26196[_0x17779d(0x253)]||_0x26196['jsonl'])return await handleSDKOutput(_0x362d1c,_0x26196),0x0;return displayFieldsHumanReadable(_0x362d1c,_0x24c200),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async[a27_0xe4513(0x1b0)](_0x2647ac){const _0x4f4c3b=a27_0xe4513,{options:_0x624d66,args:_0xb886b7,tdx:_0x537ad5}=_0x2647ac,_0x19f858=_0x624d66,_0x40a441=_0xb886b7[0x0]||_0x624d66[_0x4f4c3b(0x17a)];if(!_0x40a441)return console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x25f)](_0x4f4c3b(0x229))),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1be)),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1f0)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x4f4c3b(0x1ca))),0x1;_0x624d66[_0x4f4c3b(0x28f)]&&(console[_0x4f4c3b(0x257)](_0x4f4c3b(0x175)+_0x624d66[_0x4f4c3b(0x27c)]),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x198)+_0x40a441));const _0x5fd958=await withSpinner(_0x4f4c3b(0x1e6)+_0x40a441+'\x27...',()=>_0x537ad5[_0x4f4c3b(0x20f)]['getParentFull'](_0x40a441),{'verbose':_0x624d66[_0x4f4c3b(0x28f)]}),_0x2bbfab=_0x5fd958['data'];if(_0x19f858[_0x4f4c3b(0x216)]){const _0x40a56f=getConsoleNextUrl(_0x19f858[_0x4f4c3b(0x27c)],_0x4f4c3b(0x26b)+_0x2bbfab['id']);return console['error'](a27_0x393c4e[_0x4f4c3b(0x20c)]('✔')+'\x20Opening\x20'+a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x40a56f)),openBrowser(_0x40a56f),0x0;}return await handleSingleObjectOutput(_0x2bbfab,_0x624d66),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x186);['description']=a27_0xe4513(0x250);async['execute'](_0x1bed8a){const _0xacb483=a27_0xe4513,{options:_0x30191e,args:_0x343cad,tdx:_0x5ab886}=_0x1bed8a,_0x3fa2b1=_0x343cad[0x0]||_0x30191e['parentSegment'];if(!_0x3fa2b1)return console[_0xacb483(0x257)](a27_0x393c4e[_0xacb483(0x25f)](_0xacb483(0x229))),console[_0xacb483(0x257)](_0xacb483(0x1cb)),console[_0xacb483(0x257)](a27_0x393c4e['cyan'](_0xacb483(0x1c2))),0x1;_0x30191e[_0xacb483(0x28f)]&&(console['error']('Site:\x20'+_0x30191e[_0xacb483(0x27c)]),console[_0xacb483(0x257)](_0xacb483(0x198)+_0x3fa2b1));const _0x5d4f3f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886['segment'][_0xacb483(0x212)](_0x3fa2b1),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x287d7d=_0x5d4f3f['data'],_0x336910=await withSpinner(_0xacb483(0x1a2)+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886[_0xacb483(0x20f)][_0xacb483(0x1e3)](_0x287d7d),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x2894cd=await executeSchemaQuery(_0x336910[_0xacb483(0x226)],_0x5ab886,_0x30191e);return await handleQueryOutput(_0x2894cd,_0x30191e),0x0;}}function a27_0x32a9(){const _0x23918a=['Fetching\x20SQL\x20for\x20\x27','✔\x20No\x20changes\x20-\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','segment:parent:push','string','\x20--enriched','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','jsonl','join','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','FINISHED','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x27\x20with\x20ID:\x20','execute','status','YAML\x20file:\x20','stop','\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:fields','stats','Errors:','Error:','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','addAttributesFile','interval','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','replace','Events:','Behaviors','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','.yaml','toLowerCase','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','77mEWmLv','245336CGWHvz','processedRows','\x20--behavior\x20\x22<name>\x22','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','cyan','displayColumns','\x20tdx\x20wf\x20attempt\x20','format','run','utf-8','Preview:','\x0aNew\x20parent\x20segment\x20\x27','Available\x20behaviors:','message','bold','Columns:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Updating\x20parent\x20segment\x20\x27','Updated','Join\x20on:','-1d','/\x20directories\x20exist.','text','\x0aNo\x20sample\x20data\x20available','Error:\x20--database\x20and\x20--table\x20are\x20required','/sessions/','Rows:','getParentSQL','Options\x20(one\x20required):','`\x20to\x20download\x20the\x20configuration\x20first','Fetching\x20parent\x20segment\x20\x27','\x20kill','Source:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','sampleData','Master\x20Table','master','Customers:','limit','✔\x20Query\x20completed:\x20Processed\x20','Options:','\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','Table:\x20','displaySummary','behaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','👥\x20','\x20\x20\x20\x20-\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','Attributes','all','setJobId','Analyzing\x20changes...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','match','map','double','Error:\x20--attribute\x20requires\x20a\x20name\x0a','information_schema','Updating','dirname','behavior','\x27\x20is\x20up\x20to\x20date','validateParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:parent:list','Created','green','in\x20','rowCount','segment','sort','ignore','resolveParentId','schemaError','use','localeCompare','web','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Audience\x20ID:','attribute','segment:parent:validate','xdg-open','Status:','dim','previewParentYaml','description','endsWith','Creating\x20parent\x20segment\x20\x27','allValid','displayBehaviorsStats','elapsedTimeMillis','Attempt:','data','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','workflowAttemptId','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','\x20--attribute\x20\x22','\x27\x20and\x20run\x20workflow?','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:sql','yes','number','displayPreviewHints','customersWithEvents','\x20--interval\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','/attempt/','Master\x20+\x20Attributes','test','Get\x20SQL\x20query\x20for\x20parent\x20segment','varchar','length','updateParent','addBehaviors','pushParentYaml','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','runParent','segment:parent:run','/{name}.yml\x0a','Fetching\x20current\x20configuration\x20for\x20\x27','/app/workflows/','customerGroup','preview','displayAttributesStats','start','filter','Database:\x20','Fetching\x20sample\x20data...','schemaValid','.yml','displaySampleData','✔\x20Updated\x20parent\x20segment\x20\x27','Name:\x20','\x20--behavior\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','win32','To\x20view\x20sample\x20data:','json','Join:','timezone','/\x20and\x20','error','table','/\x20directory.\x0a','joinKey','924656jxIioK','30213837qaXGxR','✔\x20Found\x20','totalEvents','red','Aborted.','attributesFile','name','\x20rows)','segment:parent:preview','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20No\x20changes\x20-\x20','Error:\x20File\x20not\x20found:\x20','tdx\x20segment\x20parent\x20preview\x20','Validate:','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','\x0aChanges\x20to\x20apply\x20to\x20\x27','pullParentYaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20rows\x20','parent_segments','Output\x20file:\x20','displayValidateResults','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','yellow','\x27...','jobId','Listing\x20parent\x20segments...','Error\x20reading\x20file:\x20','scheduleType','foreignKey','To\x20cancel:','site','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','apply','204415ZMoSPd','customerPercent','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','population','List\x20parent\x20segments','keys','trim','SQL\x20query:\x0a','Available\x20attributes:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20is\x20already\x20up\x20to\x20date','Creating','Attribute:','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','\x20Configuration\x20is\x20valid','850662iZTuCI','verbose','Listing\x20fields\x20for\x20\x27','matchedCount','output','Site:\x20','168pigaYj','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Resolving\x20parent\x20segment\x20\x27','toLocaleString','parentSegment','\x20\x20No\x20sample\x20data\x20available','errors','coveragePercent','workflowId','enriched','Session:','open','platform','customerGroupFile','segment:parent:create','List\x20available\x20fields\x20for\x20segmentation','segment:parent:desc','column','label','attributes','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','segment:parent:pull','\x20=\x20','repeat','Apply\x20changes\x20to\x20\x27','using\x20the\x20default\x20path:\x20','parent_segment','displayPreviewResults','5752088utOlAM','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SELECT\x20*\x20FROM\x20(\x0a','2113500cEXzzX','Create\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','columns','database','\x0a⚠️\x20\x20Both\x20','Executing\x20parent\x20segment\x20query...','\x20--attribute\x20\x22<name>\x22','workflowSessionId','toFixed','scheduleOption','behaviors'];a27_0x32a9=function(){return _0x23918a;};return a27_0x32a9();}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x22d);[a27_0xe4513(0x21f)]=a27_0xe4513(0x237);async[a27_0xe4513(0x1b0)](_0x5a57d0){const _0x40bf1b=a27_0xe4513,{options:_0x103209,args:_0x18f87b,tdx:_0x411b74}=_0x5a57d0,_0x49e4d7=_0x18f87b[0x0]||_0x103209['parentSegment'];if(!_0x49e4d7)return console[_0x40bf1b(0x257)](a27_0x393c4e[_0x40bf1b(0x25f)](_0x40bf1b(0x229))),console[_0x40bf1b(0x257)](_0x40bf1b(0x1ac)),console[_0x40bf1b(0x257)](a27_0x393c4e['cyan'](_0x40bf1b(0x1c2))),0x1;_0x103209[_0x40bf1b(0x28f)]&&(console[_0x40bf1b(0x257)]('Site:\x20'+_0x103209[_0x40bf1b(0x27c)]),console['error'](_0x40bf1b(0x198)+_0x49e4d7));const _0x116043=await withSpinner(_0x40bf1b(0x178)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x212)](_0x49e4d7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x2dd4f7=_0x116043[_0x40bf1b(0x226)],_0x319bf6=await withSpinner(_0x40bf1b(0x1a2)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x1e3)](_0x2dd4f7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x1c2b37=_0x319bf6[_0x40bf1b(0x226)];return _0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x253)||_0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x1a9)?await handleSDKOutput([{'sql':_0x1c2b37}],_0x103209):console['log'](_0x1c2b37),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:show';[a27_0xe4513(0x21f)]=a27_0xe4513(0x281);async[a27_0xe4513(0x1b0)](_0x516264){const _0x2718c1=a27_0xe4513,{options:_0x20f6e2,args:_0x1ea97f,tdx:_0x4a1f42}=_0x516264,_0x5c6626=_0x1ea97f[0x0]||_0x20f6e2['parentSegment'];if(!_0x5c6626)return console[_0x2718c1(0x257)](a27_0x393c4e[_0x2718c1(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x2718c1(0x257)]('Usage:\x20tdx\x20ps\x20show\x20[name]\x0a'),console['error'](a27_0x393c4e[_0x2718c1(0x1cc)](_0x2718c1(0x1c2))),0x1;_0x20f6e2[_0x2718c1(0x28f)]&&(console[_0x2718c1(0x257)]('Site:\x20'+_0x20f6e2[_0x2718c1(0x27c)]),console[_0x2718c1(0x257)]('Parent\x20segment:\x20'+_0x5c6626));const _0x406a8c=await withSpinner(_0x2718c1(0x178)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment'][_0x2718c1(0x212)](_0x5c6626),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x376079=_0x406a8c[_0x2718c1(0x226)],_0x568eb7=await withSpinner(_0x2718c1(0x1a2)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment']['getParentSQL'](_0x376079),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]});let _0x4b96ad=_0x568eb7[_0x2718c1(0x226)];const _0x4824df=resolveLimit(_0x20f6e2[_0x2718c1(0x1ee)],DEFAULT_DISPLAY_LIMIT),_0x1b9111=/\bLIMIT\s+\d+/i[_0x2718c1(0x236)](_0x4b96ad);!_0x1b9111&&(_0x4b96ad=_0x4b96ad[_0x2718c1(0x285)]()[_0x2718c1(0x1bf)](/;+$/,''),_0x4b96ad=_0x2718c1(0x195)+_0x4b96ad+_0x2718c1(0x209)+_0x4824df);_0x20f6e2[_0x2718c1(0x28f)]&&console[_0x2718c1(0x257)](_0x2718c1(0x286)+_0x4b96ad);const _0x1d2b5d=await withQuerySpinner(_0x2718c1(0x19c),async _0x59f800=>{const _0x41475a=_0x2718c1,_0xb696fb=await _0x4a1f42['query'][_0x41475a(0x1b0)](_0x4b96ad,{'catalog':'td','schema':_0x41475a(0x203),'onJobId':_0x3906c0=>{const _0x281684=_0x41475a;_0x59f800[_0x281684(0x1fc)](_0x3906c0);}});return _0xb696fb;},{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x532816=_0x1d2b5d[_0x2718c1(0x226)],_0x4f6fa0=_0x532816[_0x2718c1(0x276)]?'\x20[Job\x20ID:\x20'+_0x532816[_0x2718c1(0x276)]+']':'';return console[_0x2718c1(0x257)](_0x2718c1(0x1ef)+_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x1c8)][_0x2718c1(0x179)]()+_0x2718c1(0x26f)+(_0x2718c1(0x20d)+formatElapsed(_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x224)])+_0x4f6fa0)),await handleQueryOutput(_0x532816,_0x20f6e2),0x0;}}