@treasuredata/tdx 0.2.5 → 0.2.6

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 (83) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.js +1 -1
  5. package/dist/client/llm-client.js +1 -1
  6. package/dist/client/rate-limiter.js +1 -1
  7. package/dist/client/td-client.js +1 -1
  8. package/dist/client/trino-client.js +1 -1
  9. package/dist/client/workflow-client.js +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/context-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/job-command.js +1 -1
  19. package/dist/commands/llm-command.js +1 -1
  20. package/dist/commands/llm-proxy.js +1 -1
  21. package/dist/commands/parent-segment-command.js +1 -1
  22. package/dist/commands/profiles-command.js +1 -1
  23. package/dist/commands/query-command.js +1 -1
  24. package/dist/commands/segment-command.js +1 -1
  25. package/dist/commands/segment-create-command.js +1 -1
  26. package/dist/commands/segment-fields-command.js +1 -1
  27. package/dist/commands/segment-pwd-command.js +1 -1
  28. package/dist/commands/segment-update-command.js +1 -1
  29. package/dist/commands/segment-use-command.js +1 -1
  30. package/dist/commands/segments.js +1 -1
  31. package/dist/commands/show.js +1 -1
  32. package/dist/commands/tables.js +1 -1
  33. package/dist/commands/use-command.js +1 -1
  34. package/dist/commands/workflow-command.js +1 -1
  35. package/dist/core/auth.js +1 -1
  36. package/dist/core/config.js +1 -1
  37. package/dist/core/global-context.js +1 -1
  38. package/dist/core/profile.js +1 -1
  39. package/dist/core/project-config.js +1 -1
  40. package/dist/core/session.js +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/proxy/anthropic-adapter.js +1 -1
  43. package/dist/proxy/server.js +1 -1
  44. package/dist/proxy/server.js.map +1 -1
  45. package/dist/proxy/session-cache.js +1 -1
  46. package/dist/sdk/api.js +1 -1
  47. package/dist/sdk/database.js +1 -1
  48. package/dist/sdk/errors.js +1 -1
  49. package/dist/sdk/index.js +1 -1
  50. package/dist/sdk/job.js +1 -1
  51. package/dist/sdk/llm.js +1 -1
  52. package/dist/sdk/query.js +1 -1
  53. package/dist/sdk/segment.js +1 -1
  54. package/dist/sdk/table.js +1 -1
  55. package/dist/sdk/workflow.js +1 -1
  56. package/dist/types/endpoints.js +1 -1
  57. package/dist/types/index.js +1 -1
  58. package/dist/utils/agent-ref-parser.js +1 -1
  59. package/dist/utils/chat-cache.js +1 -1
  60. package/dist/utils/colors.js +1 -1
  61. package/dist/utils/command-output.js +1 -1
  62. package/dist/utils/constants.js +1 -1
  63. package/dist/utils/file-permissions.js +1 -1
  64. package/dist/utils/format-detector.js +1 -1
  65. package/dist/utils/formatters.js +1 -1
  66. package/dist/utils/json-loader.js +1 -1
  67. package/dist/utils/model-aliases.js +1 -1
  68. package/dist/utils/option-validation.js +1 -1
  69. package/dist/utils/port.js +1 -1
  70. package/dist/utils/process.js +1 -1
  71. package/dist/utils/prompt.js +1 -1
  72. package/dist/utils/segment-path-parser.js +1 -1
  73. package/dist/utils/segment-ref-parser.js +1 -1
  74. package/dist/utils/spinner.js +1 -1
  75. package/dist/utils/sql-parser.js +1 -1
  76. package/dist/utils/sse-parser.js +1 -1
  77. package/dist/utils/string-utils.js +1 -1
  78. package/dist/utils/table-ref-parser.js +1 -1
  79. package/dist/utils/tdx-logger.js +1 -1
  80. package/dist/utils/tree-formatter.js +1 -1
  81. package/dist/utils/version-check.js +1 -1
  82. package/dist/utils/workflow-utils.js +1 -1
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- const a16_0x23f5e2=a16_0x417c;(function(_0x4285fb,_0x2053b9){const _0x47959d=a16_0x417c,_0xdbb9bd=_0x4285fb();while(!![]){try{const _0x45818e=parseInt(_0x47959d(0x20b))/0x1*(-parseInt(_0x47959d(0x1fd))/0x2)+parseInt(_0x47959d(0x1dc))/0x3*(parseInt(_0x47959d(0x1d6))/0x4)+parseInt(_0x47959d(0x203))/0x5+-parseInt(_0x47959d(0x20a))/0x6+-parseInt(_0x47959d(0x20e))/0x7+-parseInt(_0x47959d(0x1ef))/0x8*(-parseInt(_0x47959d(0x1cf))/0x9)+parseInt(_0x47959d(0x1fe))/0xa;if(_0x45818e===_0x2053b9)break;else _0xdbb9bd['push'](_0xdbb9bd['shift']());}catch(_0x2fe02a){_0xdbb9bd['push'](_0xdbb9bd['shift']());}}}(a16_0x2594,0x2d5e2));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';function a16_0x417c(_0x1a594d,_0x123778){const _0x259455=a16_0x2594();return a16_0x417c=function(_0x417c16,_0x41d820){_0x417c16=_0x417c16-0x1c4;let _0x2030b9=_0x259455[_0x417c16];return _0x2030b9;},a16_0x417c(_0x1a594d,_0x123778);}export class JobListCommand extends BaseCommand{[a16_0x23f5e2(0x1e9)]=a16_0x23f5e2(0x1d1);['description']='List\x20jobs';async[a16_0x23f5e2(0x1f7)](_0x3118f2){const _0x4c5f64=a16_0x23f5e2,{options:_0x37364f,tdx:_0x5b4caf}=_0x3118f2;try{const _0x2f614d=resolveLimit(_0x37364f[_0x4c5f64(0x1da)],DEFAULT_DISPLAY_LIMIT),_0x1c824d=_0x37364f[_0x4c5f64(0x1ca)];_0x37364f[_0x4c5f64(0x1e5)]&&(console[_0x4c5f64(0x1c7)](_0x4c5f64(0x1d7)+_0x2f614d+_0x4c5f64(0x1f9)),_0x1c824d&&console['error'](_0x4c5f64(0x1fc)+_0x1c824d));const _0x1d27eb=await withSpinner(_0x4c5f64(0x1db),()=>_0x5b4caf[_0x4c5f64(0x1d1)]['list']({'from':0x0,'to':_0x2f614d-0x1,'status':_0x1c824d}),{'verbose':_0x37364f['verbose']}),_0x1e7f24=_0x1d27eb['data'];console[_0x4c5f64(0x1c7)](_0x4c5f64(0x1f3)+_0x1e7f24[_0x4c5f64(0x1ff)]+_0x4c5f64(0x1cd)+(_0x1e7f24[_0x4c5f64(0x1ff)]!==0x1?'s':''));const _0x577baa=_0x1e7f24[_0x4c5f64(0x1d9)](_0x146cfa=>{const _0x3b1912=_0x4c5f64;let _0x2a0214;if(_0x146cfa[_0x3b1912(0x209)]&&_0x146cfa[_0x3b1912(0x200)]){const _0x23a8b4=new Date(_0x146cfa[_0x3b1912(0x209)])[_0x3b1912(0x1e4)](),_0x15ac47=new Date(_0x146cfa[_0x3b1912(0x200)])[_0x3b1912(0x1e4)]();_0x2a0214=Math[_0x3b1912(0x207)]((_0x15ac47-_0x23a8b4)/0x3e8);}return{'job_id':_0x146cfa[_0x3b1912(0x1c6)],'type':_0x146cfa[_0x3b1912(0x1de)],'status':_0x146cfa[_0x3b1912(0x1ca)],'user_name':_0x146cfa[_0x3b1912(0x1dd)],'duration_sec':_0x2a0214,'created_at':_0x146cfa['created_at'],'started_at':_0x146cfa['start_at'],'end_at':_0x146cfa[_0x3b1912(0x200)]};});return await handleSDKOutput(_0x577baa,_0x37364f),0x0;}catch(_0x9b022c){if(_0x9b022c instanceof SDKError)return console[_0x4c5f64(0x1c7)](_0x4c5f64(0x20f)+_0x9b022c[_0x4c5f64(0x1f6)]),_0x9b022c['cause']&&console[_0x4c5f64(0x1c7)](_0x4c5f64(0x1e0)+_0x9b022c[_0x4c5f64(0x1f2)]),0x1;throw _0x9b022c;}}}export class JobShowCommand extends BaseCommand{[a16_0x23f5e2(0x1e9)]=a16_0x23f5e2(0x1f5);['description']=a16_0x23f5e2(0x202);async[a16_0x23f5e2(0x1f7)](_0x38cfcb){const _0x5f1b15=a16_0x23f5e2,{options:_0x3b7606,args:_0x31175e,tdx:_0x46b380}=_0x38cfcb,_0x18d255=_0x31175e[0x0];if(!_0x18d255)return console[_0x5f1b15(0x1c7)]('Error:\x20Job\x20ID\x20is\x20required'),console['error']('Usage:\x20job\x20show\x20<job-id>'),0x1;try{const _0x59e1db=await withSpinner('Getting\x20job\x20details...',()=>_0x46b380[_0x5f1b15(0x1d1)]['show'](_0x18d255),{'verbose':_0x3b7606[_0x5f1b15(0x1e5)]}),_0x3bad34=_0x59e1db['data'];let _0x25daf6;if(_0x3bad34[_0x5f1b15(0x209)]&&_0x3bad34[_0x5f1b15(0x200)]){const _0x390d27=new Date(_0x3bad34[_0x5f1b15(0x209)])['getTime'](),_0x15bda5=new Date(_0x3bad34[_0x5f1b15(0x200)])[_0x5f1b15(0x1e4)]();_0x25daf6=Math['round']((_0x15bda5-_0x390d27)/0x3e8);}const _0x14d5de={'job_id':_0x3bad34[_0x5f1b15(0x1c6)],'type':_0x3bad34[_0x5f1b15(0x1de)],'status':_0x3bad34[_0x5f1b15(0x1ca)],..._0x3bad34['user_name']&&{'user_name':_0x3bad34[_0x5f1b15(0x1dd)]},..._0x25daf6!==undefined&&{'duration_sec':_0x25daf6},..._0x3bad34[_0x5f1b15(0x1fa)]&&{'created_at':_0x3bad34[_0x5f1b15(0x1fa)]},..._0x3bad34[_0x5f1b15(0x209)]&&{'started_at':_0x3bad34['start_at']},..._0x3bad34['end_at']&&{'end_at':_0x3bad34[_0x5f1b15(0x200)]},..._0x3bad34['database']&&{'database':_0x3bad34[_0x5f1b15(0x1df)]},..._0x3bad34['priority']!==undefined&&{'priority':_0x3bad34['priority']},..._0x3bad34[_0x5f1b15(0x1ed)]&&{'url':_0x3bad34['url']},..._0x3bad34['query']&&{'query':_0x3bad34['query']},..._0x3bad34[_0x5f1b15(0x1f8)]&&{'debug':_0x3bad34[_0x5f1b15(0x1f8)]}};return await handleSingleObjectOutput(_0x14d5de,_0x3b7606),0x0;}catch(_0x24131a){if(_0x24131a instanceof SDKError)return console[_0x5f1b15(0x1c7)]('Error:\x20'+_0x24131a[_0x5f1b15(0x1f6)]),_0x24131a[_0x5f1b15(0x1f2)]&&console[_0x5f1b15(0x1c7)]('\x20\x20Cause:\x20'+_0x24131a[_0x5f1b15(0x1f2)]),0x1;throw _0x24131a;}}}function a16_0x2594(){const _0x5e6561=['Getting\x20job\x20results...','name','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','submit','description','url','jobType','280344OLejlK','\x20\x20Job\x20ID:\x20','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','cause','✔\x20Found\x20','✔\x20Retrieved\x20','job:show','message','execute','debug','\x20jobs','created_at','...','Status\x20filter:\x20','146374IKXdhJ','4546930Xtddhh','length','end_at','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Show\x20job\x20details','1222050cmXvOO','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:result','\x20row','round','Error:\x20Job\x20ID\x20is\x20required','start_at','2211210MKoHwn','1FQMnjX','trino','Query:\x20','1616496kgcdyn','Error:\x20','job:submit','Submitting\x20job...','job_id','error','yes','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','status','data','result','\x20job','Get\x20job\x20results','27tOggoq','kill','jobs','Usage:\x20job\x20kill\x20<job-id>','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Submitting\x20kill\x20request...','Kill\x20a\x20job','764JuSjdo','Limit:\x20','Error:\x20Query\x20is\x20required','map','limit','Listing\x20jobs...','852UIAMwV','user_name','type','database','\x20\x20Cause:\x20','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','file','\x27\x20to\x20verify\x20the\x20job\x20status','getTime','verbose','Job\x20type:\x20','✔\x20Job\x20submitted'];a16_0x2594=function(){return _0x5e6561;};return a16_0x2594();}export class JobKillCommand extends BaseCommand{[a16_0x23f5e2(0x1e9)]='job:kill';[a16_0x23f5e2(0x1ec)]=a16_0x23f5e2(0x1d5);async['execute'](_0x9ebbc4){const _0x6762c1=a16_0x23f5e2,{options:_0x59bd3c,args:_0x87f739,tdx:_0x1a9a51}=_0x9ebbc4,_0x3202f5=_0x87f739[0x0];if(!_0x3202f5)return console[_0x6762c1(0x1c7)](_0x6762c1(0x208)),console[_0x6762c1(0x1c7)](_0x6762c1(0x1d2)),0x1;try{if(!_0x59bd3c[_0x6762c1(0x1c8)]){const _0x44fd31=await confirm(_0x6762c1(0x201)+_0x3202f5+'?');if(!_0x44fd31)return console['error']('Cancelled'),0x0;}return await withSpinner(_0x6762c1(0x1d4),()=>_0x1a9a51[_0x6762c1(0x1d1)][_0x6762c1(0x1d0)](_0x3202f5),{'verbose':_0x59bd3c[_0x6762c1(0x1e5)]}),console[_0x6762c1(0x1c7)](_0x6762c1(0x1c9)+_0x3202f5),console[_0x6762c1(0x1c7)](_0x6762c1(0x1ea)+_0x3202f5+_0x6762c1(0x1e3)),0x0;}catch(_0x5e6b80){if(_0x5e6b80 instanceof SDKError)return console[_0x6762c1(0x1c7)](_0x6762c1(0x20f)+_0x5e6b80['message']),_0x5e6b80['cause']&&console['error'](_0x6762c1(0x1e0)+_0x5e6b80['cause']),0x1;throw _0x5e6b80;}}}export class JobSubmitCommand extends BaseCommand{['name']=a16_0x23f5e2(0x1c4);[a16_0x23f5e2(0x1ec)]='Submit\x20a\x20job';async[a16_0x23f5e2(0x1f7)](_0x2cf55){const _0x2856cc=a16_0x23f5e2,{options:_0x5bf793,args:_0x5d1387,tdx:_0xdfd5b1}=_0x2cf55;try{const _0x7b5d6f=_0x5bf793[_0x2856cc(0x1ee)]||_0x2856cc(0x20c),_0x1e73a6=_0x5bf793[_0x2856cc(0x1e2)],_0x5c2a6f=_0x5bf793['database']||'information_schema';if(_0x7b5d6f!==_0x2856cc(0x20c)&&_0x7b5d6f!=='hive')return console[_0x2856cc(0x1c7)](_0x2856cc(0x1d3)),0x1;let _0x4b1a6d;if(_0x1e73a6){if(_0x5d1387[0x0])return console[_0x2856cc(0x1c7)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x4635e6=readSqlStatementsFromFile(_0x1e73a6);if(_0x4635e6['length']===0x0)return console[_0x2856cc(0x1c7)](_0x2856cc(0x1f1)),0x1;if(_0x4635e6[_0x2856cc(0x1ff)]>0x1)return console[_0x2856cc(0x1c7)](_0x2856cc(0x204)),0x1;_0x4b1a6d=_0x4635e6[0x0];}else{if(!_0x5d1387[0x0])return console[_0x2856cc(0x1c7)](_0x2856cc(0x1d8)),console[_0x2856cc(0x1c7)](_0x2856cc(0x1e1)),0x1;_0x4b1a6d=_0x5d1387[0x0];}_0x5bf793[_0x2856cc(0x1e5)]&&(console[_0x2856cc(0x1c7)](_0x2856cc(0x1e6)+_0x7b5d6f),console[_0x2856cc(0x1c7)]('Database:\x20'+_0x5c2a6f),console[_0x2856cc(0x1c7)](_0x2856cc(0x20d)+_0x4b1a6d['substring'](0x0,0x64)+(_0x4b1a6d[_0x2856cc(0x1ff)]>0x64?_0x2856cc(0x1fb):'')));const _0x3d3a2d=await withSpinner(_0x2856cc(0x1c5),()=>_0xdfd5b1[_0x2856cc(0x1d1)][_0x2856cc(0x1eb)](_0x5c2a6f,_0x4b1a6d,_0x7b5d6f),{'verbose':_0x5bf793[_0x2856cc(0x1e5)]}),_0x6760e7=_0x3d3a2d[_0x2856cc(0x1cb)];return console[_0x2856cc(0x1c7)](_0x2856cc(0x1e7)),console[_0x2856cc(0x1c7)](_0x2856cc(0x1f0)+_0x6760e7[_0x2856cc(0x1c6)]),await handleSDKOutput([_0x6760e7],_0x5bf793),0x0;}catch(_0x35261e){if(_0x35261e instanceof SDKError)return console[_0x2856cc(0x1c7)]('Error:\x20'+_0x35261e[_0x2856cc(0x1f6)]),_0x35261e[_0x2856cc(0x1f2)]&&console[_0x2856cc(0x1c7)](_0x2856cc(0x1e0)+_0x35261e[_0x2856cc(0x1f2)]),0x1;throw _0x35261e;}}}export class JobResultCommand extends BaseCommand{['name']=a16_0x23f5e2(0x205);[a16_0x23f5e2(0x1ec)]=a16_0x23f5e2(0x1ce);async[a16_0x23f5e2(0x1f7)](_0x2e04f6){const _0x52f52c=a16_0x23f5e2,{options:_0x5795ee,args:_0x4c6f6a,tdx:_0x3b51da}=_0x2e04f6,_0x388dc1=_0x4c6f6a[0x0];if(!_0x388dc1)return console[_0x52f52c(0x1c7)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x52f52c(0x1c7)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x2788f3=await withSpinner(_0x52f52c(0x1e8),()=>_0x3b51da[_0x52f52c(0x1d1)][_0x52f52c(0x1cc)](_0x388dc1),{'verbose':_0x5795ee['verbose']}),_0x8c02da=_0x2788f3['data'];return console[_0x52f52c(0x1c7)](_0x52f52c(0x1f4)+_0x8c02da[_0x52f52c(0x1ff)]+_0x52f52c(0x206)+(_0x8c02da[_0x52f52c(0x1ff)]!==0x1?'s':'')),await handleSDKOutput(_0x8c02da,_0x5795ee),0x0;}catch(_0x1c1286){if(_0x1c1286 instanceof SDKError)return console[_0x52f52c(0x1c7)](_0x52f52c(0x20f)+_0x1c1286[_0x52f52c(0x1f6)]),_0x1c1286['cause']&&console['error'](_0x52f52c(0x1e0)+_0x1c1286['cause']),0x1;throw _0x1c1286;}}}
1
+ const a16_0x1dd964=a16_0x4142;(function(_0x1e8d6f,_0x142272){const _0x30d9d7=a16_0x4142,_0x444a46=_0x1e8d6f();while(!![]){try{const _0x19bfe1=-parseInt(_0x30d9d7(0xc3))/0x1*(-parseInt(_0x30d9d7(0xc0))/0x2)+parseInt(_0x30d9d7(0x103))/0x3+parseInt(_0x30d9d7(0xce))/0x4*(-parseInt(_0x30d9d7(0xd9))/0x5)+-parseInt(_0x30d9d7(0xfb))/0x6+parseInt(_0x30d9d7(0xd2))/0x7*(-parseInt(_0x30d9d7(0xd1))/0x8)+-parseInt(_0x30d9d7(0xfe))/0x9+parseInt(_0x30d9d7(0xe7))/0xa;if(_0x19bfe1===_0x142272)break;else _0x444a46['push'](_0x444a46['shift']());}catch(_0x5544e0){_0x444a46['push'](_0x444a46['shift']());}}}(a16_0x1c8d,0x4caf1));import{BaseCommand}from'./command.js';function a16_0x4142(_0x4e6562,_0xe94d9a){const _0x1c8da2=a16_0x1c8d();return a16_0x4142=function(_0x41421d,_0x20868f){_0x41421d=_0x41421d-0xb8;let _0x49c9d1=_0x1c8da2[_0x41421d];return _0x49c9d1;},a16_0x4142(_0x4e6562,_0xe94d9a);}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';function a16_0x1c8d(){const _0x848612=['Getting\x20job\x20details...','31yKjsGd','...','list','map','Submit\x20a\x20job','limit','job:result','Show\x20job\x20details','message','job:show','status','2453204YBpAwR','file','error','8fvPGPM','3581018uaHEnm','show','query','\x20job','Submitting\x20job...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submitting\x20kill\x20request...','5dktABI','created_at','jobType','round','job_id','cause','Kill\x20a\x20job','\x20\x20Job\x20ID:\x20','description','yes','database','Error:\x20Job\x20ID\x20is\x20required','kill','Query:\x20','8432420gpHfmr','\x20row','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','name','end_at','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','user_name','type','Cancelled','result','information_schema','execute','job:kill','verbose','trino','submit','getTime','jobs','2245740yYzpsA','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Error:\x20','470322XGOeCn','Status\x20filter:\x20','\x20\x20Cause:\x20','Usage:\x20job\x20show\x20<job-id>','data','1803057thrmPO','debug','Usage:\x20job\x20result\x20<job-id>','Limit:\x20','length','Getting\x20job\x20results...','Listing\x20jobs...','✔\x20Found\x20','start_at','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','\x20jobs','27178SBbOju','url'];a16_0x1c8d=function(){return _0x848612;};return a16_0x1c8d();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a16_0x1dd964(0xea)]=a16_0x1dd964(0xfa);['description']='List\x20jobs';async[a16_0x1dd964(0xf4)](_0x2a667a){const _0x4a4b77=a16_0x1dd964,{options:_0x114a24,tdx:_0x52f380}=_0x2a667a;try{const _0xcf24d2=resolveLimit(_0x114a24[_0x4a4b77(0xc8)],DEFAULT_DISPLAY_LIMIT),_0x41bae1=_0x114a24[_0x4a4b77(0xcd)];_0x114a24[_0x4a4b77(0xf6)]&&(console[_0x4a4b77(0xd0)](_0x4a4b77(0xb8)+_0xcf24d2+_0x4a4b77(0xbf)),_0x41bae1&&console[_0x4a4b77(0xd0)](_0x4a4b77(0xff)+_0x41bae1));const _0x4f2c0c=await withSpinner(_0x4a4b77(0xbb),()=>_0x52f380['jobs'][_0x4a4b77(0xc5)]({'from':0x0,'to':_0xcf24d2-0x1,'status':_0x41bae1}),{'verbose':_0x114a24[_0x4a4b77(0xf6)]}),_0x4e7cb1=_0x4f2c0c['data'];console[_0x4a4b77(0xd0)](_0x4a4b77(0xbc)+_0x4e7cb1[_0x4a4b77(0xb9)]+_0x4a4b77(0xd5)+(_0x4e7cb1[_0x4a4b77(0xb9)]!==0x1?'s':''));const _0x1bc4a8=_0x4e7cb1[_0x4a4b77(0xc6)](_0xc9753=>{const _0x4e0f4a=_0x4a4b77;let _0x39ae4d;if(_0xc9753[_0x4e0f4a(0xbd)]&&_0xc9753[_0x4e0f4a(0xeb)]){const _0x3e3f13=new Date(_0xc9753['start_at'])[_0x4e0f4a(0xf9)](),_0x3f25cb=new Date(_0xc9753[_0x4e0f4a(0xeb)])[_0x4e0f4a(0xf9)]();_0x39ae4d=Math[_0x4e0f4a(0xdc)]((_0x3f25cb-_0x3e3f13)/0x3e8);}return{'job_id':_0xc9753['job_id'],'type':_0xc9753['type'],'status':_0xc9753[_0x4e0f4a(0xcd)],'user_name':_0xc9753[_0x4e0f4a(0xef)],'duration_sec':_0x39ae4d,'created_at':_0xc9753[_0x4e0f4a(0xda)],'started_at':_0xc9753['start_at'],'end_at':_0xc9753[_0x4e0f4a(0xeb)]};});return await handleSDKOutput(_0x1bc4a8,_0x114a24),0x0;}catch(_0x4af63e){if(_0x4af63e instanceof SDKError)return console[_0x4a4b77(0xd0)](_0x4a4b77(0xfd)+_0x4af63e[_0x4a4b77(0xcb)]),_0x4af63e[_0x4a4b77(0xde)]&&console[_0x4a4b77(0xd0)]('\x20\x20Cause:\x20'+_0x4af63e['cause']),0x1;throw _0x4af63e;}}}export class JobShowCommand extends BaseCommand{['name']=a16_0x1dd964(0xcc);[a16_0x1dd964(0xe1)]=a16_0x1dd964(0xca);async['execute'](_0x248d22){const _0x3411fb=a16_0x1dd964,{options:_0x2fe603,args:_0x2ce9f2,tdx:_0x30ab5c}=_0x248d22,_0x120741=_0x2ce9f2[0x0];if(!_0x120741)return console[_0x3411fb(0xd0)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x3411fb(0xd0)](_0x3411fb(0x101)),0x1;try{const _0x438961=await withSpinner(_0x3411fb(0xc2),()=>_0x30ab5c[_0x3411fb(0xfa)][_0x3411fb(0xd3)](_0x120741),{'verbose':_0x2fe603['verbose']}),_0xfbef4a=_0x438961[_0x3411fb(0x102)];let _0x1b84b3;if(_0xfbef4a[_0x3411fb(0xbd)]&&_0xfbef4a['end_at']){const _0x103dda=new Date(_0xfbef4a[_0x3411fb(0xbd)])['getTime'](),_0x4aba75=new Date(_0xfbef4a[_0x3411fb(0xeb)])['getTime']();_0x1b84b3=Math[_0x3411fb(0xdc)]((_0x4aba75-_0x103dda)/0x3e8);}const _0x14c802={'job_id':_0xfbef4a[_0x3411fb(0xdd)],'type':_0xfbef4a[_0x3411fb(0xf0)],'status':_0xfbef4a[_0x3411fb(0xcd)],..._0xfbef4a['user_name']&&{'user_name':_0xfbef4a[_0x3411fb(0xef)]},..._0x1b84b3!==undefined&&{'duration_sec':_0x1b84b3},..._0xfbef4a[_0x3411fb(0xda)]&&{'created_at':_0xfbef4a[_0x3411fb(0xda)]},..._0xfbef4a[_0x3411fb(0xbd)]&&{'started_at':_0xfbef4a[_0x3411fb(0xbd)]},..._0xfbef4a[_0x3411fb(0xeb)]&&{'end_at':_0xfbef4a[_0x3411fb(0xeb)]},..._0xfbef4a[_0x3411fb(0xe3)]&&{'database':_0xfbef4a[_0x3411fb(0xe3)]},..._0xfbef4a['priority']!==undefined&&{'priority':_0xfbef4a['priority']},..._0xfbef4a[_0x3411fb(0xc1)]&&{'url':_0xfbef4a[_0x3411fb(0xc1)]},..._0xfbef4a[_0x3411fb(0xd4)]&&{'query':_0xfbef4a[_0x3411fb(0xd4)]},..._0xfbef4a[_0x3411fb(0x104)]&&{'debug':_0xfbef4a[_0x3411fb(0x104)]}};return await handleSingleObjectOutput(_0x14c802,_0x2fe603),0x0;}catch(_0x434d73){if(_0x434d73 instanceof SDKError)return console[_0x3411fb(0xd0)](_0x3411fb(0xfd)+_0x434d73[_0x3411fb(0xcb)]),_0x434d73[_0x3411fb(0xde)]&&console[_0x3411fb(0xd0)]('\x20\x20Cause:\x20'+_0x434d73[_0x3411fb(0xde)]),0x1;throw _0x434d73;}}}export class JobKillCommand extends BaseCommand{[a16_0x1dd964(0xea)]=a16_0x1dd964(0xf5);[a16_0x1dd964(0xe1)]=a16_0x1dd964(0xdf);async[a16_0x1dd964(0xf4)](_0x1b81f9){const _0x5a5390=a16_0x1dd964,{options:_0x362b19,args:_0x4b70ce,tdx:_0x13f240}=_0x1b81f9,_0x28bca2=_0x4b70ce[0x0];if(!_0x28bca2)return console[_0x5a5390(0xd0)](_0x5a5390(0xe4)),console[_0x5a5390(0xd0)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x362b19[_0x5a5390(0xe2)]){const _0xff2fe0=await confirm(_0x5a5390(0xd7)+_0x28bca2+'?');if(!_0xff2fe0)return console[_0x5a5390(0xd0)](_0x5a5390(0xf1)),0x0;}return await withSpinner(_0x5a5390(0xd8),()=>_0x13f240[_0x5a5390(0xfa)][_0x5a5390(0xe5)](_0x28bca2),{'verbose':_0x362b19[_0x5a5390(0xf6)]}),console[_0x5a5390(0xd0)](_0x5a5390(0xe9)+_0x28bca2),console[_0x5a5390(0xd0)](_0x5a5390(0xed)+_0x28bca2+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}catch(_0x3a7573){if(_0x3a7573 instanceof SDKError)return console[_0x5a5390(0xd0)](_0x5a5390(0xfd)+_0x3a7573[_0x5a5390(0xcb)]),_0x3a7573['cause']&&console['error'](_0x5a5390(0x100)+_0x3a7573[_0x5a5390(0xde)]),0x1;throw _0x3a7573;}}}export class JobSubmitCommand extends BaseCommand{[a16_0x1dd964(0xea)]='job:submit';['description']=a16_0x1dd964(0xc7);async['execute'](_0x199dcb){const _0x5b176f=a16_0x1dd964,{options:_0x16dfb1,args:_0x35ef83,tdx:_0x43ccaa}=_0x199dcb;try{const _0x88531=_0x16dfb1[_0x5b176f(0xdb)]||_0x5b176f(0xf7),_0x4cdd12=_0x16dfb1[_0x5b176f(0xcf)],_0xd491cd=_0x16dfb1[_0x5b176f(0xe3)]||_0x5b176f(0xf3);if(_0x88531!=='trino'&&_0x88531!=='hive')return console[_0x5b176f(0xd0)](_0x5b176f(0xfc)),0x1;let _0x152b69;if(_0x4cdd12){if(_0x35ef83[0x0])return console[_0x5b176f(0xd0)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0xd3bbff=readSqlStatementsFromFile(_0x4cdd12);if(_0xd3bbff[_0x5b176f(0xb9)]===0x0)return console[_0x5b176f(0xd0)](_0x5b176f(0xbe)),0x1;if(_0xd3bbff[_0x5b176f(0xb9)]>0x1)return console[_0x5b176f(0xd0)](_0x5b176f(0xec)),0x1;_0x152b69=_0xd3bbff[0x0];}else{if(!_0x35ef83[0x0])return console[_0x5b176f(0xd0)]('Error:\x20Query\x20is\x20required'),console[_0x5b176f(0xd0)](_0x5b176f(0xee)),0x1;_0x152b69=_0x35ef83[0x0];}_0x16dfb1['verbose']&&(console[_0x5b176f(0xd0)]('Job\x20type:\x20'+_0x88531),console[_0x5b176f(0xd0)]('Database:\x20'+_0xd491cd),console[_0x5b176f(0xd0)](_0x5b176f(0xe6)+_0x152b69['substring'](0x0,0x64)+(_0x152b69[_0x5b176f(0xb9)]>0x64?_0x5b176f(0xc4):'')));const _0x130b1b=await withSpinner(_0x5b176f(0xd6),()=>_0x43ccaa[_0x5b176f(0xfa)][_0x5b176f(0xf8)](_0xd491cd,_0x152b69,_0x88531),{'verbose':_0x16dfb1['verbose']}),_0x7a2c6d=_0x130b1b[_0x5b176f(0x102)];return console[_0x5b176f(0xd0)]('✔\x20Job\x20submitted'),console[_0x5b176f(0xd0)](_0x5b176f(0xe0)+_0x7a2c6d['job_id']),await handleSDKOutput([_0x7a2c6d],_0x16dfb1),0x0;}catch(_0x136c5a){if(_0x136c5a instanceof SDKError)return console[_0x5b176f(0xd0)]('Error:\x20'+_0x136c5a[_0x5b176f(0xcb)]),_0x136c5a[_0x5b176f(0xde)]&&console['error']('\x20\x20Cause:\x20'+_0x136c5a['cause']),0x1;throw _0x136c5a;}}}export class JobResultCommand extends BaseCommand{[a16_0x1dd964(0xea)]=a16_0x1dd964(0xc9);[a16_0x1dd964(0xe1)]='Get\x20job\x20results';async[a16_0x1dd964(0xf4)](_0x2f0998){const _0x20b666=a16_0x1dd964,{options:_0xea3f13,args:_0x108a2e,tdx:_0x4dfef9}=_0x2f0998,_0x3a9a83=_0x108a2e[0x0];if(!_0x3a9a83)return console[_0x20b666(0xd0)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x20b666(0xd0)](_0x20b666(0x105)),0x1;try{const _0x28f180=await withSpinner(_0x20b666(0xba),()=>_0x4dfef9['jobs'][_0x20b666(0xf2)](_0x3a9a83),{'verbose':_0xea3f13[_0x20b666(0xf6)]}),_0x452df7=_0x28f180['data'];return console[_0x20b666(0xd0)]('✔\x20Retrieved\x20'+_0x452df7['length']+_0x20b666(0xe8)+(_0x452df7[_0x20b666(0xb9)]!==0x1?'s':'')),await handleSDKOutput(_0x452df7,_0xea3f13),0x0;}catch(_0x4ff9a0){if(_0x4ff9a0 instanceof SDKError)return console[_0x20b666(0xd0)](_0x20b666(0xfd)+_0x4ff9a0[_0x20b666(0xcb)]),_0x4ff9a0['cause']&&console[_0x20b666(0xd0)](_0x20b666(0x100)+_0x4ff9a0[_0x20b666(0xde)]),0x1;throw _0x4ff9a0;}}}
@@ -1 +1 @@
1
- const a17_0x163a48=a17_0x1264;(function(_0x119d54,_0x2ec791){const _0x53ea30=a17_0x1264,_0x4bb0ca=_0x119d54();while(!![]){try{const _0x48bb72=parseInt(_0x53ea30(0x13a))/0x1+-parseInt(_0x53ea30(0x14b))/0x2+-parseInt(_0x53ea30(0x128))/0x3*(-parseInt(_0x53ea30(0xeb))/0x4)+parseInt(_0x53ea30(0x160))/0x5*(-parseInt(_0x53ea30(0x133))/0x6)+parseInt(_0x53ea30(0x165))/0x7+parseInt(_0x53ea30(0xee))/0x8*(parseInt(_0x53ea30(0x127))/0x9)+-parseInt(_0x53ea30(0x155))/0xa;if(_0x48bb72===_0x2ec791)break;else _0x4bb0ca['push'](_0x4bb0ca['shift']());}catch(_0x409585){_0x4bb0ca['push'](_0x4bb0ca['shift']());}}}(a17_0x3965,0x5ad53));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function handleSDKError(_0x3fac4e,_0x3d591e){const _0x2e87b3=a17_0x1264;if(_0x3fac4e instanceof SDKError)console['error'](_0x2e87b3(0xe9)+_0x3fac4e[_0x2e87b3(0x131)]),_0x3d591e[_0x2e87b3(0x134)]&&(_0x3fac4e['cause']&&console[_0x2e87b3(0xe0)](_0x2e87b3(0x109)+_0x3fac4e[_0x2e87b3(0xf4)]),_0x3fac4e[_0x2e87b3(0x137)]&&(console[_0x2e87b3(0xe0)](_0x2e87b3(0x11c)),console['error'](_0x3fac4e['stack'])));else throw _0x3fac4e;}function formatChatHistoryEntry(_0x2ee857,_0x4d4a75){const _0x54e7d4=a17_0x1264,_0x534ce0=getChalk(_0x4d4a75),_0xf2c7e0=_0x534ce0[_0x54e7d4(0x12c)](_0x2ee857['at']);if(_0x54e7d4(0x16b)in _0x2ee857){const _0x3d6f61=_0x534ce0['cyan'](_0x54e7d4(0xe3));return _0xf2c7e0+'\x20'+_0x3d6f61+':\x20'+_0x2ee857[_0x54e7d4(0x16b)];}if(_0x54e7d4(0x118)in _0x2ee857){const _0x386e07=_0x534ce0['green'](_0x54e7d4(0x145));return _0xf2c7e0+'\x20'+_0x386e07+':\x20'+_0x2ee857['content'];}if(_0x54e7d4(0x15f)in _0x2ee857){const _0x3a77a7=_0x534ce0[_0x54e7d4(0x125)](_0x54e7d4(0x14d)),{functionName:_0x295ab9,functionArguments:_0x38070f,targetFunction:_0x51e0b4}=_0x2ee857['tool_call'];let _0x3ae253=_0xf2c7e0+'\x20'+_0x3a77a7+':\x20'+_0x534ce0['bold'](_0x295ab9);if(_0x38070f&&Object['keys'](_0x38070f)['length']>0x0){const _0x438658=Object['entries'](_0x38070f)[_0x54e7d4(0xe4)](([_0x54e53f,_0x226630])=>_0x54e53f+'='+JSON['stringify'](_0x226630))['join'](',\x20');_0x3ae253+='('+_0x438658+')';}_0x51e0b4&&(_0x3ae253+=_0x534ce0[_0x54e7d4(0x12c)]('\x20['+_0x51e0b4+']'));let _0x3c4dc8='';if(_0x2ee857[_0x54e7d4(0x15f)][_0x54e7d4(0x11f)])_0x3c4dc8='\x20->\x20KB:'+_0x2ee857[_0x54e7d4(0x15f)][_0x54e7d4(0x11f)][_0x54e7d4(0x12b)];else{if(_0x2ee857[_0x54e7d4(0x15f)]['targetAgent'])_0x3c4dc8=_0x54e7d4(0x15e)+_0x2ee857[_0x54e7d4(0x15f)][_0x54e7d4(0xe8)][_0x54e7d4(0x12b)];else{if(_0x2ee857['tool_call']['targetWebSearchTool'])_0x3c4dc8=_0x54e7d4(0x11a)+_0x2ee857[_0x54e7d4(0x15f)][_0x54e7d4(0x101)][_0x54e7d4(0x12b)];else _0x2ee857['tool_call']['targetImageGenerator']&&(_0x3c4dc8=_0x54e7d4(0x152)+_0x2ee857['tool_call'][_0x54e7d4(0xf7)][_0x54e7d4(0x12b)]);}}return _0x3ae253+_0x3c4dc8;}if(_0x54e7d4(0x129)in _0x2ee857){const _0x289316=_0x534ce0[_0x54e7d4(0xfb)](_0x54e7d4(0x108)),{functionName:_0x125f8a,functionArguments:_0x44b740,content:_0x44508d,newChat:_0x2a2213}=_0x2ee857[_0x54e7d4(0x129)];let _0x1a6c88=_0xf2c7e0+'\x20'+_0x289316+':\x20'+_0x534ce0['bold'](_0x125f8a);if(_0x44b740){const _0x3528ab=typeof _0x44b740===_0x54e7d4(0x142)?_0x44b740:JSON[_0x54e7d4(0x107)](_0x44b740);_0x1a6c88+='('+_0x3528ab+')';}return _0x44508d&&(_0x1a6c88+='\x0a'+_0x534ce0[_0x54e7d4(0x12c)](_0x44508d)),_0x2a2213&&(_0x1a6c88+=_0x534ce0['dim'](_0x54e7d4(0x164)+_0x2a2213['id'])),_0x1a6c88;}if(_0x54e7d4(0x11d)in _0x2ee857){const _0x34c773=_0x534ce0['blue'](_0x54e7d4(0xfe));return _0xf2c7e0+'\x20'+_0x34c773+':\x20'+_0x2ee857[_0x54e7d4(0x11d)]['name']+'\x20('+_0x2ee857[_0x54e7d4(0x11d)][_0x54e7d4(0x118)][_0x54e7d4(0x110)]+_0x54e7d4(0x124);}if('image'in _0x2ee857){const _0x1c828f=_0x534ce0[_0x54e7d4(0x13c)](_0x54e7d4(0x154)),{width:_0xec1ec6,height:_0x48386c,headerText:_0x17a538}=_0x2ee857[_0x54e7d4(0x16d)],_0x178813=_0x17a538?_0x54e7d4(0x115)+_0x17a538:'';return _0xf2c7e0+'\x20'+_0x1c828f+':\x20'+_0xec1ec6+'x'+_0x48386c+_0x178813;}if(_0x54e7d4(0xe0)in _0x2ee857){const _0x405201=_0x534ce0[_0x54e7d4(0x139)](_0x54e7d4(0x147));return _0xf2c7e0+'\x20'+_0x405201+':\x20'+_0x2ee857[_0x54e7d4(0xe0)];}return _0xf2c7e0+'\x20'+_0x534ce0['dim'](_0x54e7d4(0x143))+':\x20'+JSON[_0x54e7d4(0x107)](_0x2ee857);}async function getProjectIdOrDefault(_0x14932f){const _0x4f3a2b=a17_0x1264,{tdx:_0x273fc4,options:_0x3841c0}=_0x14932f,_0xc7ffc7=_0x3841c0[_0x4f3a2b(0xda)];if(_0xc7ffc7){const _0x2b4d16=await withSpinner(_0x4f3a2b(0x11b)+_0xc7ffc7+_0x4f3a2b(0x126),()=>_0x273fc4[_0x4f3a2b(0xf3)][_0x4f3a2b(0xe2)](_0xc7ffc7),{'verbose':_0x3841c0[_0x4f3a2b(0x134)]});return _0x2b4d16['data'];}let _0x193cae=_0x273fc4['llm'][_0x4f3a2b(0x13d)]();if(_0x193cae)return _0x193cae;const _0x3ecf9c=await withSpinner(_0x4f3a2b(0x14c),()=>_0x273fc4[_0x4f3a2b(0xf3)][_0x4f3a2b(0x10a)](),{'verbose':_0x3841c0['verbose']});return _0x3ecf9c['data']['id'];}function toLLMProjectInfo(_0x390918){const _0x2b00b8=a17_0x1264;return{'name':_0x390918[_0x2b00b8(0x16c)]['name'],'description':_0x390918[_0x2b00b8(0x16c)][_0x2b00b8(0x132)],'createdAt':_0x390918[_0x2b00b8(0x16c)][_0x2b00b8(0x123)],'updatedAt':_0x390918[_0x2b00b8(0x16c)][_0x2b00b8(0x105)]};}function toAgentInfo(_0x2809e6){const _0x21be59=a17_0x1264;return{'name':_0x2809e6[_0x21be59(0x16c)][_0x21be59(0x12b)],'description':_0x2809e6[_0x21be59(0x16c)]['description'],'prompt':truncatePrompt(_0x2809e6[_0x21be59(0x16c)][_0x21be59(0xf8)]),'createdAt':_0x2809e6[_0x21be59(0x16c)][_0x21be59(0x123)],'updatedAt':_0x2809e6['attributes'][_0x21be59(0x105)]};}function a17_0x1264(_0x510cfe,_0x4a9c11){const _0x39651a=a17_0x3965();return a17_0x1264=function(_0x1264c2,_0x476723){_0x1264c2=_0x1264c2-0xd7;let _0x32d6fc=_0x39651a[_0x1264c2];return _0x32d6fc;},a17_0x1264(_0x510cfe,_0x4a9c11);}function truncatePrompt(_0x9c4e39){const _0x5a5e98=a17_0x1264;if(!_0x9c4e39)return undefined;const _0x346e2a=0x64;if(_0x9c4e39[_0x5a5e98(0x110)]<=_0x346e2a)return _0x9c4e39;return _0x9c4e39[_0x5a5e98(0x146)](0x0,_0x346e2a)+_0x5a5e98(0x10d);}export class LLMModelsCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x122);[a17_0x163a48(0x132)]=a17_0x163a48(0xe5);async[a17_0x163a48(0xf0)](_0x3a2163){const _0x20bcab=a17_0x163a48,{options:_0x3644f9,tdx:_0x3673ee}=_0x3a2163;try{const _0x30be41=await withSpinner('Fetching\x20available\x20models...',()=>_0x3673ee[_0x20bcab(0xf3)][_0x20bcab(0xd8)](),{'verbose':_0x3644f9['verbose']});return await handleSDKOutput(_0x30be41[_0x20bcab(0x153)],_0x3644f9),0x0;}catch(_0x129beb){return handleSDKError(_0x129beb,_0x3644f9),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x15c);[a17_0x163a48(0x132)]=a17_0x163a48(0x111);async[a17_0x163a48(0xf0)](_0x252525){const _0x5bdded=a17_0x163a48,{options:_0x49fd27,args:_0x53975e,tdx:_0x12abd8}=_0x252525;try{const _0x235958=_0x53975e[0x0],_0x3d2611=resolveLimit(_0x49fd27[_0x5bdded(0x10e)],DEFAULT_LLM_LIMIT),_0x5896bd=await withSpinner(_0x5bdded(0x13f),()=>_0x12abd8[_0x5bdded(0xf3)][_0x5bdded(0x161)](_0x3d2611),{'verbose':_0x49fd27[_0x5bdded(0x134)]});let _0x18e4fc=_0x5896bd[_0x5bdded(0x153)];_0x235958&&(_0x18e4fc=_0x5896bd[_0x5bdded(0x153)][_0x5bdded(0xf5)](_0x22a085=>matchGlobPattern(_0x22a085[_0x5bdded(0x16c)][_0x5bdded(0x12b)],_0x235958)));const _0x50c05a=_0x18e4fc[_0x5bdded(0xe4)](toLLMProjectInfo);return await handleSDKOutput(_0x50c05a,_0x49fd27),0x0;}catch(_0x3deb69){return handleSDKError(_0x3deb69,_0x49fd27),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a17_0x163a48(0x12a);[a17_0x163a48(0x132)]='List\x20agents\x20in\x20current\x20project';async[a17_0x163a48(0xf0)](_0x4edf35){const _0x18d034=a17_0x163a48,{options:_0x57f325,args:_0x4d7504,tdx:_0x336369}=_0x4edf35;try{const _0x3afd55=_0x4d7504[0x0];let _0x1e6eb3,_0xb2e670=_0x3afd55;if(_0x3afd55&&_0x3afd55[_0x18d034(0x144)]('/')){const _0x5e1928=_0x3afd55[_0x18d034(0x104)]('/');if(_0x5e1928[_0x18d034(0x110)]===0x2){const [_0x2e5790,_0x4af8f4]=_0x5e1928,_0x4349e5=await _0x336369[_0x18d034(0xf3)]['projects'](),_0xd0b4ec=_0x4349e5[_0x18d034(0xed)](_0x393137=>_0x393137['attributes']['name'][_0x18d034(0x151)]()===_0x2e5790['toLowerCase']());if(!_0xd0b4ec)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x18d034(0xe7)+_0x2e5790,undefined,{'helpText':_0x18d034(0xde)});_0x1e6eb3=_0xd0b4ec['id'],_0xb2e670=_0x4af8f4;}else throw new SDKError(ErrorCode[_0x18d034(0x15a)],_0x18d034(0x163)+_0x3afd55,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x1e6eb3=await getProjectIdOrDefault(_0x4edf35);const _0x298eb7=await withSpinner('Fetching\x20agents...',()=>_0x336369['llm']['agents'](_0x1e6eb3),{'verbose':_0x57f325[_0x18d034(0x134)]});let _0x57fd67=_0x298eb7[_0x18d034(0x153)];_0xb2e670&&(_0x57fd67=_0x298eb7[_0x18d034(0x153)]['filter'](_0x3cb050=>matchGlobPattern(_0x3cb050[_0x18d034(0x16c)][_0x18d034(0x12b)],_0xb2e670)));const _0xe77ad1=_0x57fd67[_0x18d034(0xe4)](toAgentInfo);return await handleSDKOutput(_0xe77ad1,_0x57f325),0x0;}catch(_0x101aee){return handleSDKError(_0x101aee,_0x57f325),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x15d);[a17_0x163a48(0x132)]=a17_0x163a48(0x12e);async[a17_0x163a48(0xf0)](_0x90d401){const _0x13b51e=a17_0x163a48,{options:_0x20d632,args:_0x4b1fa0,tdx:_0x44062c}=_0x90d401;if(_0x4b1fa0[_0x13b51e(0x110)]===0x0)return console[_0x13b51e(0xe0)](_0x13b51e(0x114)),console[_0x13b51e(0xe0)](_0x13b51e(0x103)),0x1;const _0x36ea04=_0x4b1fa0[0x0];try{const _0x26ffc5=await getProjectIdOrDefault(_0x90d401),_0x5c7156=await withSpinner(_0x13b51e(0xf1)+_0x36ea04+_0x13b51e(0x126),()=>_0x44062c[_0x13b51e(0xf3)][_0x13b51e(0x130)](_0x36ea04,_0x26ffc5),{'verbose':_0x20d632['verbose']}),_0x17dede=await withSpinner(_0x13b51e(0x140),()=>_0x44062c[_0x13b51e(0xf3)][_0x13b51e(0x10f)](_0x5c7156['data']),{'verbose':_0x20d632[_0x13b51e(0x134)]});return await handleSDKOutput([_0x17dede['data']],_0x20d632),0x0;}catch(_0x50c59a){return handleSDKError(_0x50c59a,_0x20d632),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x150);[a17_0x163a48(0x132)]=a17_0x163a48(0x10b);async['execute'](_0x558801){const _0x666bb2=a17_0x163a48,{options:_0x4e2d17,args:_0x2b1e7e,tdx:_0x5d10df}=_0x558801;if(_0x2b1e7e[_0x666bb2(0x110)]===0x0)return console[_0x666bb2(0xe0)](_0x666bb2(0x114)),console[_0x666bb2(0xe0)](_0x666bb2(0x12d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x3ea908=_0x2b1e7e[0x0],_0x44ccab=_0x4e2d17,_0x307aef=_0x44ccab[_0x666bb2(0x157)],_0xeeea44=_0x44ccab[_0x666bb2(0x121)]||_0x666bb2(0x158),_0x5d5ac9=_0x44ccab['starterMessage'],_0x546795=_0x44ccab[_0x666bb2(0xec)]?Number(_0x44ccab[_0x666bb2(0xec)]):undefined,_0x291a3c=_0x44ccab[_0x666bb2(0xf6)]?Number(_0x44ccab[_0x666bb2(0xf6)]):undefined;try{let _0x47f2cd,_0x1e150f;if(_0x3ea908['includes']('/')){const _0x54a89b=_0x3ea908[_0x666bb2(0x104)]('/');if(_0x54a89b[_0x666bb2(0x110)]===0x2){const [_0x16b0dd,_0x460103]=_0x54a89b,_0x44dced=await withSpinner(_0x666bb2(0x11b)+_0x16b0dd+_0x666bb2(0x126),()=>_0x5d10df['llm']['resolveProjectId'](_0x16b0dd),{'verbose':_0x4e2d17[_0x666bb2(0x134)]});_0x47f2cd=_0x44dced['data'],_0x1e150f=_0x460103;}else throw new SDKError(ErrorCode[_0x666bb2(0x15a)],_0x666bb2(0x163)+_0x3ea908,undefined,{'helpText':_0x666bb2(0xd7)});}else _0x47f2cd=await getProjectIdOrDefault(_0x558801),_0x1e150f=_0x3ea908;const _0x1cfe0f=await withSpinner('Creating\x20agent\x20\x27'+_0x1e150f+_0x666bb2(0x126),()=>_0x5d10df['llm'][_0x666bb2(0xff)]({'name':_0x1e150f,'projectId':_0x47f2cd,'modelType':_0xeeea44,'systemPrompt':_0x307aef,'starterMessage':_0x5d5ac9,'maxToolIterations':_0x546795,'temperature':_0x291a3c}),{'verbose':_0x4e2d17[_0x666bb2(0x134)]});return console[_0x666bb2(0x16e)](_0x666bb2(0x136)+_0x1cfe0f[_0x666bb2(0x153)]['id']),await handleSDKOutput([_0x1cfe0f[_0x666bb2(0x153)]],_0x4e2d17),0x0;}catch(_0x25d68b){return handleSDKError(_0x25d68b,_0x4e2d17),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x13e);[a17_0x163a48(0x132)]=a17_0x163a48(0xf9);async[a17_0x163a48(0xf0)](_0x1eea75){const _0x3e1117=a17_0x163a48,{options:_0x124350,args:_0x375c86,tdx:_0x190175}=_0x1eea75;if(_0x375c86[_0x3e1117(0x110)]===0x0)return console['error'](_0x3e1117(0x114)),console[_0x3e1117(0xe0)](_0x3e1117(0xef)),0x1;const _0x45919b=_0x375c86[0x0],_0x2055f9=_0x124350,_0x1c28b7=_0x2055f9['name'],_0x1543f3=_0x2055f9['prompt'],_0x3cdefb=_0x2055f9[_0x3e1117(0x132)],_0x123ca6=_0x2055f9[_0x3e1117(0x166)];if(!_0x1c28b7&&!_0x1543f3&&!_0x3cdefb&&!_0x123ca6)return console[_0x3e1117(0xe0)](_0x3e1117(0xf2)),console[_0x3e1117(0xe0)](_0x3e1117(0x159)),0x1;try{const _0x53a65e=await getProjectIdOrDefault(_0x1eea75),_0x3fda2e=await withSpinner(_0x3e1117(0xf1)+_0x45919b+_0x3e1117(0x126),()=>_0x190175[_0x3e1117(0xf3)]['resolveAgentId'](_0x45919b,_0x53a65e),{'verbose':_0x124350[_0x3e1117(0x134)]}),_0x3b1cb9=_0x3fda2e[_0x3e1117(0x153)],_0xa1f2da=await withSpinner('Updating\x20agent...',()=>_0x190175['llm'][_0x3e1117(0x15b)](_0x3b1cb9,{'name':_0x1c28b7,'prompt':_0x1543f3,'description':_0x3cdefb,'starterMessage':_0x123ca6}),{'verbose':_0x124350['verbose']});return console['log']('Agent\x20updated:\x20'+_0xa1f2da[_0x3e1117(0x153)]['id']),await handleSDKOutput([_0xa1f2da['data']],_0x124350),0x0;}catch(_0xf04b4f){return handleSDKError(_0xf04b4f,_0x124350),0x1;}}}function a17_0x3965(){const _0x368c94=['\x27...','14661awHlvu','897747wnJlYc','tool','llm:agents','name','dim','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','Show\x20agent\x20details','chats','resolveAgentId','message','description','1368icYiqL','verbose','deleteProject','Agent\x20created:\x20','stack','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','red','241554SwUExX','No\x20chat\x20sessions\x20found.','blue','getCurrentProject','llm:agent:update','Fetching\x20projects...','Fetching\x20agent...','Delete\x20an\x20agent','string','[unknown]','includes','[content]','slice','[error]\x20\x20','(no\x20message)','Deleting\x20project\x20\x27','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','943258auiKpa','Getting\x20default\x20project...','[tool_call]','Project\x20created:\x20','deleteAgent','llm:agent:create','toLowerCase','\x20->\x20ImageGen:','data','[image]\x20\x20','6134100Clmyhs','last','systemPrompt','claude-4.5-haiku','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','INVALID_ARGUMENT','updateAgent','llm:projects','llm:agent:show','\x20->\x20Agent:','tool_call','7085VbPmbh','projects','Agent\x20deleted:\x20','Invalid\x20path\x20syntax:\x20','\x20→\x20chat:\x20','4901148vXgIui','starterMessage','Set\x20current\x20project\x20context','createProject','firstInputContent','Error:\x20Project\x20name\x20is\x20required','input','attributes','image','log','format','Use\x20format:\x20project-name/agent-name','models','Fetching\x20chat\x20history\x20for\x20\x27','llmProject','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','No\x20messages\x20found\x20in\x20chat\x20history.','table','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','llm:project:create','error','Fetching\x20most\x20recent\x20chat...','resolveProjectId','[input]\x20\x20','map','List\x20available\x20LLM\x20models','Fetching\x20chat\x20sessions...','Project\x20not\x20found:\x20','targetAgent','Error:\x20','history','4WlBPBN','maxToolIterations','find','2648QxIXsl','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','execute','Resolving\x20agent\x20\x27','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','llm','cause','filter','temperature','targetImageGenerator','prompt','Update\x20an\x20existing\x20agent','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','magenta','Project\x20context\x20set\x20to:\x20','Creating\x20project\x20\x27','[output]\x20','createAgent','Project\x20deleted:\x20','targetWebSearchTool','llm:agent:delete','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','split','updatedAt','json','stringify','[tool]\x20\x20\x20','\x20\x20Cause:\x20','getOrCreateDefaultProject','Create\x20a\x20new\x20agent\x20in\x20current\x20project','llm:history','...','limit','agent','length','List\x20all\x20LLM\x20projects','Create\x20a\x20new\x20LLM\x20project','jsonl','Error:\x20Agent\x20name\x20is\x20required','\x20-\x20','llm:project:delete','tsv','content','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','\x20->\x20WebSearch:','Resolving\x20project\x20\x27','\x0aStack\x20trace:','output','Usage:\x20tdx\x20llm\x20history\x20--last','targetKnowledgeBase','Deleting\x20agent...','model','llm:models','createdAt','\x20bytes)','yellow'];a17_0x3965=function(){return _0x368c94;};return a17_0x3965();}export class LLMAgentDeleteCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x102);[a17_0x163a48(0x132)]=a17_0x163a48(0x141);async[a17_0x163a48(0xf0)](_0x3ad107){const _0x3328a2=a17_0x163a48,{options:_0xbae365,args:_0x31d15a,tdx:_0x2941da}=_0x3ad107;if(_0x31d15a[_0x3328a2(0x110)]===0x0)return console[_0x3328a2(0xe0)](_0x3328a2(0x114)),console[_0x3328a2(0xe0)](_0x3328a2(0xfa)),0x1;const _0xc1f2f=_0x31d15a[0x0];try{const _0x46206b=await getProjectIdOrDefault(_0x3ad107),_0x53516e=await withSpinner(_0x3328a2(0xf1)+_0xc1f2f+_0x3328a2(0x126),()=>_0x2941da[_0x3328a2(0xf3)]['resolveAgentId'](_0xc1f2f,_0x46206b),{'verbose':_0xbae365[_0x3328a2(0x134)]}),_0x3f21f7=_0x53516e['data'];return await withSpinner(_0x3328a2(0x120),()=>_0x2941da[_0x3328a2(0xf3)][_0x3328a2(0x14f)](_0x3f21f7),{'verbose':_0xbae365[_0x3328a2(0x134)]}),console[_0x3328a2(0x16e)](_0x3328a2(0x162)+_0x3f21f7),0x0;}catch(_0x4daf95){return handleSDKError(_0x4daf95,_0xbae365),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a17_0x163a48(0x10c);[a17_0x163a48(0x132)]=a17_0x163a48(0xdb);async[a17_0x163a48(0xf0)](_0x1b0f9b){const _0x8ae0e8=a17_0x163a48,{options:_0x59acfe,args:_0x2c6505,tdx:_0x144fc6}=_0x1b0f9b;let _0x58549f=_0x2c6505[0x0];const _0x3a1750=_0x59acfe,_0x38cf41=_0x3a1750[_0x8ae0e8(0x156)];try{if(_0x38cf41){if(_0x58549f)return console[_0x8ae0e8(0xe0)](_0x8ae0e8(0x138)),console[_0x8ae0e8(0xe0)](_0x8ae0e8(0x11e)),0x1;const _0x53d10a=await withSpinner(_0x8ae0e8(0xe1),()=>_0x144fc6[_0x8ae0e8(0xf3)][_0x8ae0e8(0x12f)](0x1),{'verbose':_0x59acfe['verbose']});if(_0x53d10a[_0x8ae0e8(0x153)][_0x8ae0e8(0x110)]===0x0)return console[_0x8ae0e8(0x16e)](_0x8ae0e8(0x13b)),0x0;_0x58549f=_0x53d10a['data'][0x0]['id'];}if(!_0x58549f){const _0x520039=resolveLimit(_0x59acfe[_0x8ae0e8(0x10e)],DEFAULT_LLM_LIMIT),_0x1a7c72=await withSpinner(_0x8ae0e8(0xe6),()=>_0x144fc6[_0x8ae0e8(0xf3)][_0x8ae0e8(0x12f)](_0x520039),{'verbose':_0x59acfe[_0x8ae0e8(0x134)]});if(_0x59acfe['format']===_0x8ae0e8(0x106)||_0x59acfe['format']===_0x8ae0e8(0x113))await handleSDKOutput(_0x1a7c72[_0x8ae0e8(0x153)],_0x59acfe);else{const _0x1f8cf=_0x1a7c72[_0x8ae0e8(0x153)][_0x8ae0e8(0xe4)](_0x30851d=>({'created_at':_0x30851d[_0x8ae0e8(0x16c)][_0x8ae0e8(0x123)],'chat_id':_0x30851d['id'],'first_input':_0x30851d[_0x8ae0e8(0x16c)][_0x8ae0e8(0x169)]||_0x8ae0e8(0x148)}));await handleSDKOutput(_0x1f8cf,_0x59acfe);}return 0x0;}else{const _0x29a92a=await withSpinner(_0x8ae0e8(0xd9)+_0x58549f+_0x8ae0e8(0x126),()=>_0x144fc6[_0x8ae0e8(0xf3)][_0x8ae0e8(0xea)](_0x58549f),{'verbose':_0x59acfe[_0x8ae0e8(0x134)]}),_0x3ce826=_0x29a92a['data'][_0x8ae0e8(0x153)]??[];if(_0x3ce826[_0x8ae0e8(0x110)]===0x0)return console[_0x8ae0e8(0x16e)](_0x8ae0e8(0xdc)),0x0;if(_0x59acfe['format']==='json'||_0x59acfe[_0x8ae0e8(0x16f)]==='jsonl'||_0x59acfe[_0x8ae0e8(0x16f)]===_0x8ae0e8(0xdd)||_0x59acfe['format']===_0x8ae0e8(0x117))await handleSDKOutput(_0x3ce826,_0x59acfe);else for(const _0x540da3 of _0x3ce826){console['log'](formatChatHistoryEntry(_0x540da3,_0x59acfe));}return 0x0;}}catch(_0x21152f){return handleSDKError(_0x21152f,_0x59acfe),0x1;}}}export class LLMUseCommand extends BaseCommand{['name']='llm:use';[a17_0x163a48(0x132)]=a17_0x163a48(0x167);async[a17_0x163a48(0xf0)](_0xfd83e4){const _0x275d34=a17_0x163a48,{options:_0x34a247,args:_0x4f680f,tdx:_0x275301}=_0xfd83e4;if(_0x4f680f[_0x275d34(0x110)]===0x0)return console[_0x275d34(0xe0)](_0x275d34(0x16a)),console[_0x275d34(0xe0)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x52a530=_0x4f680f[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x52a530+_0x275d34(0x126),()=>_0x275301[_0x275d34(0xf3)]['setCurrentProject'](_0x52a530),{'verbose':_0x34a247[_0x275d34(0x134)]}),console[_0x275d34(0x16e)](_0x275d34(0xfc)+_0x52a530),0x0;}catch(_0x15470f){return handleSDKError(_0x15470f,_0x34a247),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a17_0x163a48(0xdf);[a17_0x163a48(0x132)]=a17_0x163a48(0x112);async['execute'](_0x5dbf40){const _0x57d6c3=a17_0x163a48,{options:_0x45983a,args:_0x46ad1b,tdx:_0x569680}=_0x5dbf40;if(_0x46ad1b[_0x57d6c3(0x110)]===0x0)return console['error'](_0x57d6c3(0x16a)),console['error'](_0x57d6c3(0x119)),0x1;const _0x51813b=_0x46ad1b[0x0],_0x33f837=_0x45983a,_0x53b652=_0x33f837[_0x57d6c3(0x132)];try{const _0x505de8=await withSpinner(_0x57d6c3(0xfd)+_0x51813b+'\x27...',()=>_0x569680[_0x57d6c3(0xf3)][_0x57d6c3(0x168)]({'name':_0x51813b,'description':_0x53b652}),{'verbose':_0x45983a[_0x57d6c3(0x134)]});console['log'](_0x57d6c3(0x14e)+_0x505de8[_0x57d6c3(0x153)]['id']);const _0x3951f9=toLLMProjectInfo(_0x505de8[_0x57d6c3(0x153)]);return await handleSDKOutput([_0x3951f9],_0x45983a),0x0;}catch(_0x3478a3){return handleSDKError(_0x3478a3,_0x45983a),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x163a48(0x12b)]=a17_0x163a48(0x116);['description']='Delete\x20an\x20LLM\x20project';async[a17_0x163a48(0xf0)](_0x33aab0){const _0x28338c=a17_0x163a48,{options:_0x610a31,args:_0xf65061,tdx:_0x239882}=_0x33aab0;if(_0xf65061['length']===0x0)return console[_0x28338c(0xe0)](_0x28338c(0x16a)),console['error'](_0x28338c(0x14a)),0x1;const _0x140be4=_0xf65061[0x0];try{return await withSpinner(_0x28338c(0x149)+_0x140be4+_0x28338c(0x126),()=>_0x239882[_0x28338c(0xf3)][_0x28338c(0x135)](_0x140be4),{'verbose':_0x610a31[_0x28338c(0x134)]}),console[_0x28338c(0x16e)](_0x28338c(0x100)+_0x140be4),0x0;}catch(_0xaa8e8b){return handleSDKError(_0xaa8e8b,_0x610a31),0x1;}}}
1
+ const a17_0x27ab6f=a17_0x1b44;(function(_0xe42838,_0x10d1d9){const _0x1de733=a17_0x1b44,_0x335259=_0xe42838();while(!![]){try{const _0x226a1d=parseInt(_0x1de733(0x143))/0x1*(-parseInt(_0x1de733(0x174))/0x2)+-parseInt(_0x1de733(0x151))/0x3*(-parseInt(_0x1de733(0x149))/0x4)+-parseInt(_0x1de733(0x13b))/0x5+-parseInt(_0x1de733(0x182))/0x6+-parseInt(_0x1de733(0x193))/0x7*(-parseInt(_0x1de733(0x196))/0x8)+parseInt(_0x1de733(0x1c0))/0x9+-parseInt(_0x1de733(0x1a4))/0xa*(-parseInt(_0x1de733(0x1a3))/0xb);if(_0x226a1d===_0x10d1d9)break;else _0x335259['push'](_0x335259['shift']());}catch(_0x5efa57){_0x335259['push'](_0x335259['shift']());}}}(a17_0x3b82,0xc29a3));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function handleSDKError(_0x1eb583,_0x451647){const _0x3ad4e0=a17_0x1b44;if(_0x1eb583 instanceof SDKError)console[_0x3ad4e0(0x166)](_0x3ad4e0(0x18a)+_0x1eb583[_0x3ad4e0(0x16c)]),_0x451647[_0x3ad4e0(0x16e)]&&(_0x1eb583[_0x3ad4e0(0x198)]&&console[_0x3ad4e0(0x166)](_0x3ad4e0(0x16a)+_0x1eb583[_0x3ad4e0(0x198)]),_0x1eb583['stack']&&(console['error'](_0x3ad4e0(0x14d)),console[_0x3ad4e0(0x166)](_0x1eb583['stack'])));else throw _0x1eb583;}function formatChatHistoryEntry(_0x41c068,_0x1cba78){const _0x771705=a17_0x1b44,_0x3f612c=getChalk(_0x1cba78),_0x7a0a4d=_0x3f612c[_0x771705(0x1b6)](_0x41c068['at']);if(_0x771705(0x1a7)in _0x41c068){const _0x32abdd=_0x3f612c[_0x771705(0x1a0)](_0x771705(0x1a1));return _0x7a0a4d+'\x20'+_0x32abdd+':\x20'+_0x41c068['input'];}if(_0x771705(0x147)in _0x41c068){const _0x47aca5=_0x3f612c[_0x771705(0x172)](_0x771705(0x1b5));return _0x7a0a4d+'\x20'+_0x47aca5+':\x20'+_0x41c068[_0x771705(0x147)];}if(_0x771705(0x140)in _0x41c068){const _0x13c9d6=_0x3f612c[_0x771705(0x136)](_0x771705(0x19f)),{functionName:_0x1d5f9b,functionArguments:_0x4c1c08,targetFunction:_0x5372a1}=_0x41c068[_0x771705(0x140)];let _0x16ec39=_0x7a0a4d+'\x20'+_0x13c9d6+':\x20'+_0x3f612c[_0x771705(0x1ac)](_0x1d5f9b);if(_0x4c1c08&&Object[_0x771705(0x13f)](_0x4c1c08)[_0x771705(0x156)]>0x0){const _0x3da834=Object['entries'](_0x4c1c08)['map'](([_0x5a38bd,_0x504432])=>_0x5a38bd+'='+JSON[_0x771705(0x1af)](_0x504432))[_0x771705(0x160)](',\x20');_0x16ec39+='('+_0x3da834+')';}_0x5372a1&&(_0x16ec39+=_0x3f612c['dim']('\x20['+_0x5372a1+']'));let _0xb6c534='';if(_0x41c068[_0x771705(0x140)][_0x771705(0x19c)])_0xb6c534=_0x771705(0x187)+_0x41c068[_0x771705(0x140)]['targetKnowledgeBase'][_0x771705(0x1c2)];else{if(_0x41c068['tool_call'][_0x771705(0x18b)])_0xb6c534=_0x771705(0x18c)+_0x41c068[_0x771705(0x140)][_0x771705(0x18b)][_0x771705(0x1c2)];else{if(_0x41c068['tool_call'][_0x771705(0x1a6)])_0xb6c534=_0x771705(0x169)+_0x41c068['tool_call'][_0x771705(0x1a6)][_0x771705(0x1c2)];else _0x41c068[_0x771705(0x140)][_0x771705(0x1bf)]&&(_0xb6c534=_0x771705(0x1a8)+_0x41c068[_0x771705(0x140)]['targetImageGenerator'][_0x771705(0x1c2)]);}}return _0x16ec39+_0xb6c534;}if('tool'in _0x41c068){const _0x36e0eb=_0x3f612c[_0x771705(0x16d)](_0x771705(0x159)),{functionName:_0x312ed8,functionArguments:_0xbaae5a,content:_0x29c548,newChat:_0x2d0652}=_0x41c068[_0x771705(0x163)];let _0x6b505a=_0x7a0a4d+'\x20'+_0x36e0eb+':\x20'+_0x3f612c[_0x771705(0x1ac)](_0x312ed8);if(_0xbaae5a){const _0x8f5ca3=typeof _0xbaae5a==='string'?_0xbaae5a:JSON[_0x771705(0x1af)](_0xbaae5a);_0x6b505a+='('+_0x8f5ca3+')';}return _0x29c548&&(_0x6b505a+='\x0a'+_0x3f612c['dim'](_0x29c548)),_0x2d0652&&(_0x6b505a+=_0x3f612c[_0x771705(0x1b6)]('\x20→\x20chat:\x20'+_0x2d0652['id'])),_0x6b505a;}if(_0x771705(0x161)in _0x41c068){const _0xddcad=_0x3f612c['blue'](_0x771705(0x19d));return _0x7a0a4d+'\x20'+_0xddcad+':\x20'+_0x41c068[_0x771705(0x161)]['name']+'\x20('+_0x41c068[_0x771705(0x161)][_0x771705(0x147)][_0x771705(0x156)]+_0x771705(0x1c1);}if('image'in _0x41c068){const _0x236831=_0x3f612c[_0x771705(0x14c)](_0x771705(0x13d)),{width:_0x46534a,height:_0x5ef215,headerText:_0x339151}=_0x41c068['image'],_0xbfbf4c=_0x339151?_0x771705(0x1ba)+_0x339151:'';return _0x7a0a4d+'\x20'+_0x236831+':\x20'+_0x46534a+'x'+_0x5ef215+_0xbfbf4c;}if(_0x771705(0x166)in _0x41c068){const _0x307432=_0x3f612c[_0x771705(0x164)](_0x771705(0x137));return _0x7a0a4d+'\x20'+_0x307432+':\x20'+_0x41c068[_0x771705(0x166)];}return _0x7a0a4d+'\x20'+_0x3f612c['dim'](_0x771705(0x155))+':\x20'+JSON[_0x771705(0x1af)](_0x41c068);}function a17_0x1b44(_0x43a37b,_0x4fc88e){const _0x3b82e3=a17_0x3b82();return a17_0x1b44=function(_0x1b44dc,_0x13dee9){_0x1b44dc=_0x1b44dc-0x132;let _0x1a2c2f=_0x3b82e3[_0x1b44dc];return _0x1a2c2f;},a17_0x1b44(_0x43a37b,_0x4fc88e);}async function getProjectIdOrDefault(_0x7db95c){const _0xf49a33=a17_0x1b44,{tdx:_0x48a80e,options:_0x3b6800}=_0x7db95c,_0x45f1ea=_0x3b6800[_0xf49a33(0x192)];if(_0x45f1ea){const _0x1e5def=await withSpinner(_0xf49a33(0x15c)+_0x45f1ea+_0xf49a33(0x139),()=>_0x48a80e[_0xf49a33(0x19b)][_0xf49a33(0x13c)](_0x45f1ea),{'verbose':_0x3b6800['verbose']});return _0x1e5def[_0xf49a33(0x1b3)];}let _0x4cfd86=_0x48a80e[_0xf49a33(0x19b)][_0xf49a33(0x15e)]();if(_0x4cfd86)return _0x4cfd86;const _0x2ecaab=await withSpinner('Getting\x20default\x20project...',()=>_0x48a80e[_0xf49a33(0x19b)][_0xf49a33(0x146)](),{'verbose':_0x3b6800[_0xf49a33(0x16e)]});return _0x2ecaab['data']['id'];}function toLLMProjectInfo(_0x1c633a){const _0x33c51f=a17_0x1b44;return{'name':_0x1c633a[_0x33c51f(0x153)][_0x33c51f(0x1c2)],'description':_0x1c633a[_0x33c51f(0x153)]['description'],'createdAt':_0x1c633a[_0x33c51f(0x153)]['createdAt'],'updatedAt':_0x1c633a[_0x33c51f(0x153)]['updatedAt']};}function a17_0x3b82(){const _0x8777b7=['map','llm:agent:delete','llm:project:create','LLM_PROJECT_NOT_FOUND','...','llmProject','7TrsUuY','jsonl','projects','12073504gNbjaY','Fetching\x20available\x20models...','cause','Updating\x20agent...','Create\x20a\x20new\x20LLM\x20project','llm','targetKnowledgeBase','[output]\x20','includes','[tool_call]','cyan','[input]\x20\x20','resolveAgentId','297FCGgFM','258710rkvZLX','Fetching\x20chat\x20history\x20for\x20\x27','targetWebSearchTool','input','\x20->\x20ImageGen:','agents','agent','Creating\x20agent\x20\x27','bold','Usage:\x20tdx\x20llm\x20use\x20<project-name>','No\x20messages\x20found\x20in\x20chat\x20history.','stringify','llm:agent:create','Error:\x20Agent\x20name\x20is\x20required','maxToolIterations','data','Create\x20a\x20new\x20agent\x20in\x20current\x20project','[content]','dim','chats','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','prompt','\x20-\x20','No\x20chat\x20sessions\x20found.','llm:project:delete','tsv','createAgent','targetImageGenerator','3795489ilnSdO','\x20bytes)','name','Set\x20current\x20project\x20context','llm:projects','Project\x20not\x20found:\x20','Update\x20an\x20existing\x20agent','yellow','[error]\x20\x20','List\x20available\x20LLM\x20models','\x27...','deleteAgent','2343770CLdTeX','resolveProjectId','[image]\x20\x20','Creating\x20project\x20\x27','keys','tool_call','llm:agent:update','claude-4.5-haiku','1oZfwvI','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','getOrCreateDefaultProject','content','Usage:\x20tdx\x20llm\x20history\x20--last','123524itHoPu','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Use\x20format:\x20project-name/agent-name','blue','\x0aStack\x20trace:','List\x20all\x20LLM\x20projects','llm:models','(no\x20message)','12iRnleR','filter','attributes','Deleting\x20agent...','[unknown]','length','Fetching\x20chat\x20sessions...','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[tool]\x20\x20\x20','starterMessage','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Resolving\x20project\x20\x27','updatedAt','getCurrentProject','description','join','output','deleteProject','tool','red','slice','error','split','Agent\x20updated:\x20','\x20->\x20WebSearch:','\x20\x20Cause:\x20','execute','message','magenta','verbose','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','llm:history','createdAt','green','temperature','220648PRSZDa','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Fetching\x20most\x20recent\x20chat...','INVALID_ARGUMENT','Fetching\x20agent...','find','llm:use','json','format','Setting\x20project\x20context\x20to\x20\x27','Resolving\x20agent\x20\x27','List\x20agents\x20in\x20current\x20project','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','log','8260686WxysqI','updateAgent','systemPrompt','setCurrentProject','Invalid\x20path\x20syntax:\x20','\x20->\x20KB:','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Error:\x20','targetAgent','\x20->\x20Agent:'];a17_0x3b82=function(){return _0x8777b7;};return a17_0x3b82();}function toAgentInfo(_0x42715b){const _0x3f4616=a17_0x1b44;return{'name':_0x42715b[_0x3f4616(0x153)][_0x3f4616(0x1c2)],'description':_0x42715b[_0x3f4616(0x153)]['description'],'prompt':truncatePrompt(_0x42715b['attributes'][_0x3f4616(0x1b9)]),'createdAt':_0x42715b[_0x3f4616(0x153)][_0x3f4616(0x171)],'updatedAt':_0x42715b[_0x3f4616(0x153)][_0x3f4616(0x15d)]};}function truncatePrompt(_0x4bde0f){const _0x359bdb=a17_0x1b44;if(!_0x4bde0f)return undefined;const _0x26756e=0x64;if(_0x4bde0f[_0x359bdb(0x156)]<=_0x26756e)return _0x4bde0f;return _0x4bde0f[_0x359bdb(0x165)](0x0,_0x26756e)+_0x359bdb(0x191);}export class LLMModelsCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x14f);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x138);async[a17_0x27ab6f(0x16b)](_0x48613c){const _0x356b82=a17_0x27ab6f,{options:_0x225787,tdx:_0x1cc98c}=_0x48613c;try{const _0x64126e=await withSpinner(_0x356b82(0x197),()=>_0x1cc98c[_0x356b82(0x19b)]['models'](),{'verbose':_0x225787[_0x356b82(0x16e)]});return await handleSDKOutput(_0x64126e[_0x356b82(0x1b3)],_0x225787),0x0;}catch(_0x281100){return handleSDKError(_0x281100,_0x225787),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a17_0x27ab6f(0x133);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x14e);async[a17_0x27ab6f(0x16b)](_0x85021a){const _0x413503=a17_0x27ab6f,{options:_0x50a41b,args:_0x56c127,tdx:_0x2be85c}=_0x85021a;try{const _0x3177ae=_0x56c127[0x0],_0x55fca4=resolveLimit(_0x50a41b['limit'],DEFAULT_LLM_LIMIT),_0x28cec2=await withSpinner('Fetching\x20projects...',()=>_0x2be85c[_0x413503(0x19b)][_0x413503(0x195)](_0x55fca4),{'verbose':_0x50a41b[_0x413503(0x16e)]});let _0x4dd12f=_0x28cec2['data'];_0x3177ae&&(_0x4dd12f=_0x28cec2[_0x413503(0x1b3)]['filter'](_0x3ddbe4=>matchGlobPattern(_0x3ddbe4[_0x413503(0x153)][_0x413503(0x1c2)],_0x3177ae)));const _0x2d2dd3=_0x4dd12f[_0x413503(0x18d)](toLLMProjectInfo);return await handleSDKOutput(_0x2d2dd3,_0x50a41b),0x0;}catch(_0x5afa96){return handleSDKError(_0x5afa96,_0x50a41b),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]='llm:agents';[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x17f);async[a17_0x27ab6f(0x16b)](_0x361731){const _0x4d6413=a17_0x27ab6f,{options:_0x550295,args:_0x1e1f7b,tdx:_0x97eace}=_0x361731;try{const _0x1e4da5=_0x1e1f7b[0x0];let _0x45560a,_0x4a8616=_0x1e4da5;if(_0x1e4da5&&_0x1e4da5['includes']('/')){const _0x2cc57c=_0x1e4da5[_0x4d6413(0x167)]('/');if(_0x2cc57c['length']===0x2){const [_0x51b1a5,_0x1b329c]=_0x2cc57c,_0x210ace=await _0x97eace[_0x4d6413(0x19b)]['projects'](),_0x383fd4=_0x210ace[_0x4d6413(0x179)](_0x58278f=>_0x58278f['attributes']['name']['toLowerCase']()===_0x51b1a5['toLowerCase']());if(!_0x383fd4)throw new SDKError(ErrorCode[_0x4d6413(0x190)],_0x4d6413(0x134)+_0x51b1a5,undefined,{'helpText':_0x4d6413(0x158)});_0x45560a=_0x383fd4['id'],_0x4a8616=_0x1b329c;}else throw new SDKError(ErrorCode[_0x4d6413(0x177)],_0x4d6413(0x186)+_0x1e4da5,undefined,{'helpText':_0x4d6413(0x14b)});}else _0x45560a=await getProjectIdOrDefault(_0x361731);const _0x45b898=await withSpinner('Fetching\x20agents...',()=>_0x97eace[_0x4d6413(0x19b)][_0x4d6413(0x1a9)](_0x45560a),{'verbose':_0x550295[_0x4d6413(0x16e)]});let _0xa746dd=_0x45b898[_0x4d6413(0x1b3)];_0x4a8616&&(_0xa746dd=_0x45b898[_0x4d6413(0x1b3)][_0x4d6413(0x152)](_0x513ab0=>matchGlobPattern(_0x513ab0[_0x4d6413(0x153)][_0x4d6413(0x1c2)],_0x4a8616)));const _0xf64e43=_0xa746dd['map'](toAgentInfo);return await handleSDKOutput(_0xf64e43,_0x550295),0x0;}catch(_0x56fbd2){return handleSDKError(_0x56fbd2,_0x550295),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]='llm:agent:show';[a17_0x27ab6f(0x15f)]='Show\x20agent\x20details';async[a17_0x27ab6f(0x16b)](_0x5daa4b){const _0x89c512=a17_0x27ab6f,{options:_0x57d38d,args:_0x342f78,tdx:_0x4e7f92}=_0x5daa4b;if(_0x342f78[_0x89c512(0x156)]===0x0)return console['error'](_0x89c512(0x1b1)),console[_0x89c512(0x166)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x309367=_0x342f78[0x0];try{const _0x1a0862=await getProjectIdOrDefault(_0x5daa4b),_0x278b29=await withSpinner('Resolving\x20agent\x20\x27'+_0x309367+_0x89c512(0x139),()=>_0x4e7f92['llm'][_0x89c512(0x1a2)](_0x309367,_0x1a0862),{'verbose':_0x57d38d[_0x89c512(0x16e)]}),_0x294064=await withSpinner(_0x89c512(0x178),()=>_0x4e7f92[_0x89c512(0x19b)][_0x89c512(0x1aa)](_0x278b29['data']),{'verbose':_0x57d38d['verbose']});return await handleSDKOutput([_0x294064[_0x89c512(0x1b3)]],_0x57d38d),0x0;}catch(_0x20b016){return handleSDKError(_0x20b016,_0x57d38d),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a17_0x27ab6f(0x1b0);['description']=a17_0x27ab6f(0x1b4);async[a17_0x27ab6f(0x16b)](_0x304e12){const _0x23e835=a17_0x27ab6f,{options:_0x36eab9,args:_0x53ee6e,tdx:_0x501753}=_0x304e12;if(_0x53ee6e[_0x23e835(0x156)]===0x0)return console[_0x23e835(0x166)](_0x23e835(0x1b1)),console['error'](_0x23e835(0x188)),console['error'](_0x23e835(0x189)),0x1;const _0x1dcd0d=_0x53ee6e[0x0],_0x33eb19=_0x36eab9,_0x3b8909=_0x33eb19[_0x23e835(0x184)],_0x4de2c0=_0x33eb19['model']||_0x23e835(0x142),_0x1714af=_0x33eb19[_0x23e835(0x15a)],_0x2f13bc=_0x33eb19[_0x23e835(0x1b2)]?Number(_0x33eb19[_0x23e835(0x1b2)]):undefined,_0x18e961=_0x33eb19[_0x23e835(0x173)]?Number(_0x33eb19[_0x23e835(0x173)]):undefined;try{let _0xc45611,_0x3bf034;if(_0x1dcd0d[_0x23e835(0x19e)]('/')){const _0x1eec6b=_0x1dcd0d[_0x23e835(0x167)]('/');if(_0x1eec6b[_0x23e835(0x156)]===0x2){const [_0x59c914,_0x1cbd39]=_0x1eec6b,_0x3eedd4=await withSpinner(_0x23e835(0x15c)+_0x59c914+'\x27...',()=>_0x501753['llm'][_0x23e835(0x13c)](_0x59c914),{'verbose':_0x36eab9[_0x23e835(0x16e)]});_0xc45611=_0x3eedd4['data'],_0x3bf034=_0x1cbd39;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23e835(0x186)+_0x1dcd0d,undefined,{'helpText':_0x23e835(0x14b)});}else _0xc45611=await getProjectIdOrDefault(_0x304e12),_0x3bf034=_0x1dcd0d;const _0x4f882a=await withSpinner(_0x23e835(0x1ab)+_0x3bf034+_0x23e835(0x139),()=>_0x501753['llm'][_0x23e835(0x1be)]({'name':_0x3bf034,'projectId':_0xc45611,'modelType':_0x4de2c0,'systemPrompt':_0x3b8909,'starterMessage':_0x1714af,'maxToolIterations':_0x2f13bc,'temperature':_0x18e961}),{'verbose':_0x36eab9[_0x23e835(0x16e)]});return console['log']('Agent\x20created:\x20'+_0x4f882a[_0x23e835(0x1b3)]['id']),await handleSDKOutput([_0x4f882a[_0x23e835(0x1b3)]],_0x36eab9),0x0;}catch(_0x5304f0){return handleSDKError(_0x5304f0,_0x36eab9),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x141);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x135);async['execute'](_0x19f277){const _0x546191=a17_0x27ab6f,{options:_0x4f7d78,args:_0x2dbe11,tdx:_0x1ceb8c}=_0x19f277;if(_0x2dbe11[_0x546191(0x156)]===0x0)return console[_0x546191(0x166)](_0x546191(0x1b1)),console[_0x546191(0x166)](_0x546191(0x145)),0x1;const _0x5bee63=_0x2dbe11[0x0],_0xe4d7cb=_0x4f7d78,_0x51a26a=_0xe4d7cb[_0x546191(0x1c2)],_0x365a01=_0xe4d7cb['prompt'],_0x2b3ac3=_0xe4d7cb['description'],_0x39d911=_0xe4d7cb['starterMessage'];if(!_0x51a26a&&!_0x365a01&&!_0x2b3ac3&&!_0x39d911)return console['error'](_0x546191(0x15b)),console[_0x546191(0x166)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x41a0ec=await getProjectIdOrDefault(_0x19f277),_0x3aa439=await withSpinner(_0x546191(0x17e)+_0x5bee63+_0x546191(0x139),()=>_0x1ceb8c[_0x546191(0x19b)][_0x546191(0x1a2)](_0x5bee63,_0x41a0ec),{'verbose':_0x4f7d78[_0x546191(0x16e)]}),_0x105e82=_0x3aa439['data'],_0x7b8e94=await withSpinner(_0x546191(0x199),()=>_0x1ceb8c[_0x546191(0x19b)][_0x546191(0x183)](_0x105e82,{'name':_0x51a26a,'prompt':_0x365a01,'description':_0x2b3ac3,'starterMessage':_0x39d911}),{'verbose':_0x4f7d78[_0x546191(0x16e)]});return console[_0x546191(0x181)](_0x546191(0x168)+_0x7b8e94[_0x546191(0x1b3)]['id']),await handleSDKOutput([_0x7b8e94['data']],_0x4f7d78),0x0;}catch(_0x16fb83){return handleSDKError(_0x16fb83,_0x4f7d78),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a17_0x27ab6f(0x18e);[a17_0x27ab6f(0x15f)]='Delete\x20an\x20agent';async['execute'](_0x3ba2d5){const _0x27d345=a17_0x27ab6f,{options:_0x3bf17d,args:_0x46bea8,tdx:_0x49eec3}=_0x3ba2d5;if(_0x46bea8[_0x27d345(0x156)]===0x0)return console[_0x27d345(0x166)](_0x27d345(0x1b1)),console[_0x27d345(0x166)](_0x27d345(0x16f)),0x1;const _0x35ff2e=_0x46bea8[0x0];try{const _0x56673c=await getProjectIdOrDefault(_0x3ba2d5),_0x4326e5=await withSpinner(_0x27d345(0x17e)+_0x35ff2e+_0x27d345(0x139),()=>_0x49eec3[_0x27d345(0x19b)][_0x27d345(0x1a2)](_0x35ff2e,_0x56673c),{'verbose':_0x3bf17d[_0x27d345(0x16e)]}),_0x441160=_0x4326e5[_0x27d345(0x1b3)];return await withSpinner(_0x27d345(0x154),()=>_0x49eec3['llm'][_0x27d345(0x13a)](_0x441160),{'verbose':_0x3bf17d['verbose']}),console[_0x27d345(0x181)]('Agent\x20deleted:\x20'+_0x441160),0x0;}catch(_0x32fc7e){return handleSDKError(_0x32fc7e,_0x3bf17d),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x170);['description']=a17_0x27ab6f(0x1b8);async[a17_0x27ab6f(0x16b)](_0x5142f4){const _0x18b8f3=a17_0x27ab6f,{options:_0x4df3f5,args:_0x23bd64,tdx:_0x1646d9}=_0x5142f4;let _0x2952a8=_0x23bd64[0x0];const _0x24f00b=_0x4df3f5,_0x18e4d4=_0x24f00b['last'];try{if(_0x18e4d4){if(_0x2952a8)return console['error'](_0x18b8f3(0x175)),console['error'](_0x18b8f3(0x148)),0x1;const _0x391a62=await withSpinner(_0x18b8f3(0x176),()=>_0x1646d9[_0x18b8f3(0x19b)]['chats'](0x1),{'verbose':_0x4df3f5[_0x18b8f3(0x16e)]});if(_0x391a62[_0x18b8f3(0x1b3)]['length']===0x0)return console['log'](_0x18b8f3(0x1bb)),0x0;_0x2952a8=_0x391a62[_0x18b8f3(0x1b3)][0x0]['id'];}if(!_0x2952a8){const _0x335838=resolveLimit(_0x4df3f5['limit'],DEFAULT_LLM_LIMIT),_0x2f831b=await withSpinner(_0x18b8f3(0x157),()=>_0x1646d9[_0x18b8f3(0x19b)][_0x18b8f3(0x1b7)](_0x335838),{'verbose':_0x4df3f5[_0x18b8f3(0x16e)]});if(_0x4df3f5[_0x18b8f3(0x17c)]===_0x18b8f3(0x17b)||_0x4df3f5[_0x18b8f3(0x17c)]===_0x18b8f3(0x194))await handleSDKOutput(_0x2f831b[_0x18b8f3(0x1b3)],_0x4df3f5);else{const _0x3d82b7=_0x2f831b['data'][_0x18b8f3(0x18d)](_0xba08e3=>({'created_at':_0xba08e3[_0x18b8f3(0x153)][_0x18b8f3(0x171)],'chat_id':_0xba08e3['id'],'first_input':_0xba08e3[_0x18b8f3(0x153)]['firstInputContent']||_0x18b8f3(0x150)}));await handleSDKOutput(_0x3d82b7,_0x4df3f5);}return 0x0;}else{const _0x3d8645=await withSpinner(_0x18b8f3(0x1a5)+_0x2952a8+_0x18b8f3(0x139),()=>_0x1646d9[_0x18b8f3(0x19b)]['history'](_0x2952a8),{'verbose':_0x4df3f5[_0x18b8f3(0x16e)]}),_0x47038e=_0x3d8645[_0x18b8f3(0x1b3)][_0x18b8f3(0x1b3)]??[];if(_0x47038e['length']===0x0)return console[_0x18b8f3(0x181)](_0x18b8f3(0x1ae)),0x0;if(_0x4df3f5[_0x18b8f3(0x17c)]==='json'||_0x4df3f5['format']==='jsonl'||_0x4df3f5[_0x18b8f3(0x17c)]==='table'||_0x4df3f5[_0x18b8f3(0x17c)]===_0x18b8f3(0x1bd))await handleSDKOutput(_0x47038e,_0x4df3f5);else for(const _0x1d15c7 of _0x47038e){console['log'](formatChatHistoryEntry(_0x1d15c7,_0x4df3f5));}return 0x0;}}catch(_0x486e99){return handleSDKError(_0x486e99,_0x4df3f5),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x17a);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x132);async[a17_0x27ab6f(0x16b)](_0x596ac0){const _0x588c75=a17_0x27ab6f,{options:_0x27bbbf,args:_0x5a36db,tdx:_0x16d703}=_0x596ac0;if(_0x5a36db[_0x588c75(0x156)]===0x0)return console[_0x588c75(0x166)](_0x588c75(0x144)),console['error'](_0x588c75(0x1ad)),0x1;const _0x18081a=_0x5a36db[0x0];try{return await withSpinner(_0x588c75(0x17d)+_0x18081a+_0x588c75(0x139),()=>_0x16d703[_0x588c75(0x19b)][_0x588c75(0x185)](_0x18081a),{'verbose':_0x27bbbf[_0x588c75(0x16e)]}),console['log']('Project\x20context\x20set\x20to:\x20'+_0x18081a),0x0;}catch(_0x2d4bf4){return handleSDKError(_0x2d4bf4,_0x27bbbf),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a17_0x27ab6f(0x18f);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x19a);async[a17_0x27ab6f(0x16b)](_0x54d0f0){const _0x1ed0ff=a17_0x27ab6f,{options:_0x5c9940,args:_0x2a5fcc,tdx:_0x557c80}=_0x54d0f0;if(_0x2a5fcc[_0x1ed0ff(0x156)]===0x0)return console[_0x1ed0ff(0x166)](_0x1ed0ff(0x144)),console[_0x1ed0ff(0x166)](_0x1ed0ff(0x180)),0x1;const _0x455501=_0x2a5fcc[0x0],_0x318210=_0x5c9940,_0x2946e2=_0x318210[_0x1ed0ff(0x15f)];try{const _0x3eda05=await withSpinner(_0x1ed0ff(0x13e)+_0x455501+'\x27...',()=>_0x557c80[_0x1ed0ff(0x19b)]['createProject']({'name':_0x455501,'description':_0x2946e2}),{'verbose':_0x5c9940['verbose']});console[_0x1ed0ff(0x181)]('Project\x20created:\x20'+_0x3eda05[_0x1ed0ff(0x1b3)]['id']);const _0xbff244=toLLMProjectInfo(_0x3eda05[_0x1ed0ff(0x1b3)]);return await handleSDKOutput([_0xbff244],_0x5c9940),0x0;}catch(_0x2ebc99){return handleSDKError(_0x2ebc99,_0x5c9940),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x1bc);[a17_0x27ab6f(0x15f)]='Delete\x20an\x20LLM\x20project';async[a17_0x27ab6f(0x16b)](_0x4bf48b){const _0x539dd=a17_0x27ab6f,{options:_0x56a5a1,args:_0x418b41,tdx:_0x7bd6b8}=_0x4bf48b;if(_0x418b41[_0x539dd(0x156)]===0x0)return console[_0x539dd(0x166)](_0x539dd(0x144)),console[_0x539dd(0x166)](_0x539dd(0x14a)),0x1;const _0x2ffdd8=_0x418b41[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x2ffdd8+'\x27...',()=>_0x7bd6b8[_0x539dd(0x19b)][_0x539dd(0x162)](_0x2ffdd8),{'verbose':_0x56a5a1[_0x539dd(0x16e)]}),console[_0x539dd(0x181)]('Project\x20deleted:\x20'+_0x2ffdd8),0x0;}catch(_0x1ac122){return handleSDKError(_0x1ac122,_0x56a5a1),0x1;}}}
@@ -1 +1 @@
1
- function a18_0x3094(_0x221478,_0x2c6117){const _0x3d4248=a18_0x3d42();return a18_0x3094=function(_0x309498,_0x556042){_0x309498=_0x309498-0xc0;let _0xb76e32=_0x3d4248[_0x309498];return _0xb76e32;},a18_0x3094(_0x221478,_0x2c6117);}const a18_0x421cd9=a18_0x3094;(function(_0x9b486c,_0x39f0ba){const _0x2081f1=a18_0x3094,_0x276655=_0x9b486c();while(!![]){try{const _0x2a87c5=-parseInt(_0x2081f1(0xe6))/0x1*(-parseInt(_0x2081f1(0xc4))/0x2)+parseInt(_0x2081f1(0xd9))/0x3*(-parseInt(_0x2081f1(0xec))/0x4)+-parseInt(_0x2081f1(0xd2))/0x5*(parseInt(_0x2081f1(0xc8))/0x6)+-parseInt(_0x2081f1(0xdc))/0x7*(parseInt(_0x2081f1(0xcf))/0x8)+-parseInt(_0x2081f1(0xdd))/0x9+-parseInt(_0x2081f1(0xcb))/0xa+parseInt(_0x2081f1(0xc7))/0xb*(parseInt(_0x2081f1(0xd3))/0xc);if(_0x2a87c5===_0x39f0ba)break;else _0x276655['push'](_0x276655['shift']());}catch(_0x58ebc6){_0x276655['push'](_0x276655['shift']());}}}(a18_0x3d42,0x8964f));import a18_0x1b9ea4 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a18_0x3d42(){const _0x3d5f06=['\x20\x20Agents:','log','http://0.0.0.0:','name','3144roZRGP','server','stop','dim','find','\x20\x20}','Port\x20','bold','\x20\x20Site:','project','site','white','\x20\x20Address:','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','llmProject','NOT_FOUND','✓\x20Proxy\x20server\x20stopped','cyan','Server\x20Configuration:','2upXwsb','yellow','\x20is\x20unavailable,\x20using\x20port\x20','21571528xCzEMv','18132RLICPS','\x20\x20\x20\x20}','llm:proxy','10992560OnsGRI','\x20\x20Project:','init','port','2215464NdOSwG','logger','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','725PEoagx','24rvSIky','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','projects','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','start','Starting\x20proxy\x20server...','1275NLQpsb','green','close','21bOXotn','7846533UQLCJQ','execute','\x0aClaude\x20Code\x20Configuration:','SIGINT','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20\x20\x20\x22env\x22:\x20{','llm','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','attributes','214803GLRPKk','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK'];a18_0x3d42=function(){return _0x3d5f06;};return a18_0x3d42();}import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x8539e1,_0x498aea){const _0x343c66=a18_0x3094,{tdx:_0x35637c,options:_0x5d1f8b}=_0x8539e1,_0x1b3324=_0x498aea||_0x5d1f8b[_0x343c66(0xfa)];if(_0x1b3324){const _0x3865a4=await _0x35637c['llm'][_0x343c66(0xd5)](),_0x951aa7=_0x3865a4[_0x343c66(0xf0)](_0x4ab582=>_0x4ab582['attributes'][_0x343c66(0xeb)]===_0x1b3324);if(!_0x951aa7)throw new SDKError(ErrorCode[_0x343c66(0xc0)],'Project\x20\x27'+_0x1b3324+'\x27\x20not\x20found',undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x951aa7['id'];}const _0x3ca51a=await _0x35637c[_0x343c66(0xe3)]['getOrCreateDefaultProject']();return _0x3ca51a['id'];}export class LLMProxyCommand extends BaseCommand{[a18_0x421cd9(0xeb)]=a18_0x421cd9(0xca);['description']='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a18_0x421cd9(0xed)];[a18_0x421cd9(0xd0)];async[a18_0x421cd9(0xde)](_0x4f531d){const _0x1289f2=a18_0x421cd9,{tdx:_0x1a8490,options:_0x2758eb}=_0x4f531d;try{const _0x51babd=_0x2758eb,_0x72b576=_0x51babd[_0x1289f2(0xce)]||0xfa0,_0x20fe2a=_0x51babd[_0x1289f2(0xf5)],_0x56c77d=await findAvailablePort(_0x72b576);console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xef)]('Resolving\x20project...'));const _0xcfcfe2=await getProjectIdOrDefault(_0x4f531d,_0x20fe2a),_0x4d45d4=await _0x1a8490[_0x1289f2(0xe3)][_0x1289f2(0xd5)](),_0x146b19=_0x4d45d4[_0x1289f2(0xf0)](_0x21acbe=>_0x21acbe['id']===_0xcfcfe2);this[_0x1289f2(0xd0)]=new TDXLogger(_0x2758eb['logLevel']),await this[_0x1289f2(0xd0)][_0x1289f2(0xcd)](),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xef)](_0x1289f2(0xd8)));_0x56c77d!==_0x72b576&&console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xc5)](_0x1289f2(0xf2)+_0x72b576+_0x1289f2(0xc6)+_0x56c77d));this[_0x1289f2(0xed)]=new ProxyServer({'port':_0x56c77d,'projectId':_0xcfcfe2,'tdx':_0x1a8490,'logger':this[_0x1289f2(0xd0)]}),await this['server'][_0x1289f2(0xd7)](),console['log'](a18_0x1b9ea4[_0x1289f2(0xc5)][_0x1289f2(0xf3)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xc5)]('This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.')),console['log'](a18_0x1b9ea4[_0x1289f2(0xc5)](_0x1289f2(0xd1))),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xda)][_0x1289f2(0xf3)](_0x1289f2(0xe4))),console[_0x1289f2(0xe9)](a18_0x1b9ea4['cyan'](_0x1289f2(0xc3))),console['log'](a18_0x1b9ea4[_0x1289f2(0xef)](_0x1289f2(0xf8)),a18_0x1b9ea4[_0x1289f2(0xf7)](_0x1289f2(0xea)+_0x56c77d)),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xef)](_0x1289f2(0xcc)),a18_0x1b9ea4[_0x1289f2(0xf7)](_0x146b19?.[_0x1289f2(0xe5)][_0x1289f2(0xeb)]||_0xcfcfe2)),console[_0x1289f2(0xe9)](a18_0x1b9ea4['dim'](_0x1289f2(0xe8)),a18_0x1b9ea4['white']('created\x20on-demand\x20per\x20model')),console['log'](a18_0x1b9ea4[_0x1289f2(0xef)](_0x1289f2(0xf4)),a18_0x1b9ea4['white'](_0x2758eb[_0x1289f2(0xf6)])),console['log'](a18_0x1b9ea4[_0x1289f2(0xc2)](_0x1289f2(0xdf))),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xef)](_0x1289f2(0xf9))),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xf7)]('\x20\x20{')),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xf7)](_0x1289f2(0xe2))),console[_0x1289f2(0xe9)](a18_0x1b9ea4['white'](_0x1289f2(0xd4)+_0x56c77d+'\x22,')),console[_0x1289f2(0xe9)](a18_0x1b9ea4['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xf7)](_0x1289f2(0xc9))),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xf7)](_0x1289f2(0xf1))),console['log'](a18_0x1b9ea4['cyan']('\x0aTesting\x20with\x20Agent\x20SDK:')),console['log'](a18_0x1b9ea4['dim'](_0x1289f2(0xe7))),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xef)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console[_0x1289f2(0xe9)](a18_0x1b9ea4[_0x1289f2(0xef)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console['log'](a18_0x1b9ea4[_0x1289f2(0xc5)](_0x1289f2(0xd6)));const _0x149e51=async()=>{const _0x13b6f8=_0x1289f2;console[_0x13b6f8(0xe9)](a18_0x1b9ea4[_0x13b6f8(0xef)](_0x13b6f8(0xe1))),this[_0x13b6f8(0xed)]&&await this[_0x13b6f8(0xed)][_0x13b6f8(0xee)](),this['logger']&&await this['logger']['close'](),console['log'](a18_0x1b9ea4[_0x13b6f8(0xda)](_0x13b6f8(0xc1))),process['exit'](0x0);};return process['on'](_0x1289f2(0xe0),_0x149e51),process['on']('SIGTERM',_0x149e51),await new Promise(()=>{}),0x0;}catch(_0x94899e){this['server']&&await this[_0x1289f2(0xed)][_0x1289f2(0xee)]();this['logger']&&await this[_0x1289f2(0xd0)][_0x1289f2(0xdb)]();throw _0x94899e;}}}
1
+ const a18_0x49bc2d=a18_0x2d82;(function(_0x7478e1,_0x3d23da){const _0x4548d5=a18_0x2d82,_0xaa2c35=_0x7478e1();while(!![]){try{const _0xdd8a81=parseInt(_0x4548d5(0x1e4))/0x1+parseInt(_0x4548d5(0x1d6))/0x2+-parseInt(_0x4548d5(0x1fa))/0x3*(parseInt(_0x4548d5(0x200))/0x4)+-parseInt(_0x4548d5(0x1f2))/0x5*(-parseInt(_0x4548d5(0x1da))/0x6)+-parseInt(_0x4548d5(0x1e3))/0x7+parseInt(_0x4548d5(0x1ff))/0x8+parseInt(_0x4548d5(0x1e2))/0x9*(-parseInt(_0x4548d5(0x209))/0xa);if(_0xdd8a81===_0x3d23da)break;else _0xaa2c35['push'](_0xaa2c35['shift']());}catch(_0x35040c){_0xaa2c35['push'](_0xaa2c35['shift']());}}}(a18_0x1924,0xe8f03));function a18_0x2d82(_0x5418f4,_0x452275){const _0x1924b5=a18_0x1924();return a18_0x2d82=function(_0x2d82d6,_0x257c5e){_0x2d82d6=_0x2d82d6-0x1d1;let _0x5edf17=_0x1924b5[_0x2d82d6];return _0x5edf17;},a18_0x2d82(_0x5418f4,_0x452275);}import a18_0x1987d7 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';function a18_0x1924(){const _0x39b422=['\x0aClaude\x20Code\x20Configuration:','llm','2794895mKNbcu','\x20\x20Address:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','server','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','log','bold','created\x20on-demand\x20per\x20model','1332AayzJg','SIGINT','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','14668992dgkzgC','13844uACQaB','stop','NOT_FOUND','name','start','\x20\x20Project:','\x0aTesting\x20with\x20Agent\x20SDK:','logLevel','attributes','14841740RMSWOX','find','init','Project\x20\x27','Starting\x20proxy\x20server...','cyan','projects','\x20\x20\x20\x20\x22env\x22:\x20{','2458146HixOGq','close','green','\x20is\x20unavailable,\x20using\x20port\x20','12XxpnCc','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','✓\x20Proxy\x20server\x20stopped','project','\x20\x20}','dim','\x20\x20{','white','9UYAPer','9151093KxGVVm','1101617nFdbvQ','http://0.0.0.0:','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','yellow','execute','SIGTERM','\x20\x20Agents:','llmProject','logger','port','llm:proxy','\x20\x20\x20\x20}'];a18_0x1924=function(){return _0x39b422;};return a18_0x1924();}async function getProjectIdOrDefault(_0x22f805,_0x3dc13f){const _0xe88b48=a18_0x2d82,{tdx:_0x36af3b,options:_0x1051ff}=_0x22f805,_0x2bc84c=_0x3dc13f||_0x1051ff[_0xe88b48(0x1eb)];if(_0x2bc84c){const _0x121bc4=await _0x36af3b[_0xe88b48(0x1f1)]['projects'](),_0x2c6cb2=_0x121bc4['find'](_0x2814b9=>_0x2814b9[_0xe88b48(0x208)][_0xe88b48(0x203)]===_0x2bc84c);if(!_0x2c6cb2)throw new SDKError(ErrorCode[_0xe88b48(0x202)],_0xe88b48(0x1d1)+_0x2bc84c+'\x27\x20not\x20found',undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x2c6cb2['id'];}const _0x41c6d3=await _0x36af3b['llm']['getOrCreateDefaultProject']();return _0x41c6d3['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a18_0x49bc2d(0x1ee);['description']=a18_0x49bc2d(0x1fe);['server'];[a18_0x49bc2d(0x1ec)];async[a18_0x49bc2d(0x1e8)](_0x3c5f2a){const _0x14d092=a18_0x49bc2d,{tdx:_0x5ac90c,options:_0xb0c71f}=_0x3c5f2a;try{const _0x30b1f0=_0xb0c71f,_0x4c221e=_0x30b1f0[_0x14d092(0x1ed)]||0xfa0,_0x24278c=_0x30b1f0[_0x14d092(0x1dd)],_0x129964=await findAvailablePort(_0x4c221e);console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)]('Resolving\x20project...'));const _0x226c47=await getProjectIdOrDefault(_0x3c5f2a,_0x24278c),_0x1443a3=await _0x5ac90c[_0x14d092(0x1f1)][_0x14d092(0x1d4)](),_0x21d8bc=_0x1443a3[_0x14d092(0x20a)](_0x6c9ea3=>_0x6c9ea3['id']===_0x226c47);this[_0x14d092(0x1ec)]=new TDXLogger(_0xb0c71f[_0x14d092(0x207)]),await this['logger'][_0x14d092(0x20b)](),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1d2)));_0x129964!==_0x4c221e&&console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e7)]('Port\x20'+_0x4c221e+_0x14d092(0x1d9)+_0x129964));this['server']=new ProxyServer({'port':_0x129964,'projectId':_0x226c47,'tdx':_0x5ac90c,'logger':this[_0x14d092(0x1ec)]}),await this[_0x14d092(0x1f5)][_0x14d092(0x204)](),console['log'](a18_0x1987d7['yellow'][_0x14d092(0x1f8)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e7)](_0x14d092(0x1fc))),console[_0x14d092(0x1f7)](a18_0x1987d7['yellow']('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1d8)][_0x14d092(0x1f8)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console['log'](a18_0x1987d7[_0x14d092(0x1d3)]('Server\x20Configuration:')),console[_0x14d092(0x1f7)](a18_0x1987d7['dim'](_0x14d092(0x1f3)),a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1e5)+_0x129964)),console['log'](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x205)),a18_0x1987d7[_0x14d092(0x1e1)](_0x21d8bc?.[_0x14d092(0x208)][_0x14d092(0x203)]||_0x226c47)),console['log'](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1ea)),a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1f9))),console['log'](a18_0x1987d7['dim']('\x20\x20Site:'),a18_0x1987d7[_0x14d092(0x1e1)](_0xb0c71f['site'])),console[_0x14d092(0x1f7)](a18_0x1987d7['cyan'](_0x14d092(0x1f0))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console['log'](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1e0))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1d5))),console['log'](a18_0x1987d7['white'](_0x14d092(0x1f4)+_0x129964+'\x22,')),console['log'](a18_0x1987d7['white'](_0x14d092(0x1db))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1ef))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1de))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1d3)](_0x14d092(0x206))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1f6))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1fd))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e7)](_0x14d092(0x1e6)));const _0x237d02=async()=>{const _0x4a2e7a=_0x14d092;console['log'](a18_0x1987d7[_0x4a2e7a(0x1df)]('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x4a2e7a(0x1f5)]&&await this[_0x4a2e7a(0x1f5)][_0x4a2e7a(0x201)](),this[_0x4a2e7a(0x1ec)]&&await this[_0x4a2e7a(0x1ec)][_0x4a2e7a(0x1d7)](),console[_0x4a2e7a(0x1f7)](a18_0x1987d7[_0x4a2e7a(0x1d8)](_0x4a2e7a(0x1dc))),process['exit'](0x0);};return process['on'](_0x14d092(0x1fb),_0x237d02),process['on'](_0x14d092(0x1e9),_0x237d02),await new Promise(()=>{}),0x0;}catch(_0x1979f7){this['server']&&await this[_0x14d092(0x1f5)][_0x14d092(0x201)]();this[_0x14d092(0x1ec)]&&await this[_0x14d092(0x1ec)][_0x14d092(0x1d7)]();throw _0x1979f7;}}}
@@ -1 +1 @@
1
- const a19_0x5948db=a19_0x3682;(function(_0x54963c,_0x5557d0){const _0x161a1f=a19_0x3682,_0x20a733=_0x54963c();while(!![]){try{const _0x2398f8=-parseInt(_0x161a1f(0x88))/0x1*(-parseInt(_0x161a1f(0x87))/0x2)+-parseInt(_0x161a1f(0x9f))/0x3+parseInt(_0x161a1f(0x8e))/0x4+-parseInt(_0x161a1f(0x83))/0x5+-parseInt(_0x161a1f(0x86))/0x6*(-parseInt(_0x161a1f(0x9b))/0x7)+parseInt(_0x161a1f(0x94))/0x8*(-parseInt(_0x161a1f(0x85))/0x9)+parseInt(_0x161a1f(0x97))/0xa*(parseInt(_0x161a1f(0xa0))/0xb);if(_0x2398f8===_0x5557d0)break;else _0x20a733['push'](_0x20a733['shift']());}catch(_0x55dfe2){_0x20a733['push'](_0x20a733['shift']());}}}(a19_0x3379,0xdb45e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a19_0x3379(){const _0x3da08b=['addAttributes','Error:\x20Parent\x20segment\x20name\x20is\x20required','Creating\x20parent\x20segment\x20\x27','segment:parent:create','customerGroup','updateParent','attributes','Database:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','addBehaviors','timezone','verbose','behaviors','segment','error','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','description','execute','\x27...','length','behaviorsFile','Name:\x20','8925210MDsQBP','scheduleOption','27XvRpJk','66oxDQqh','2022ttHTTW','316GXeeIv','name','Fetching\x20current\x20configuration\x20for\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','scheduleType','Parent\x20segment:\x20','4552844pXVxHA','addBehaviorsFile','database','Table:\x20','getParentFull','site','2285256aujhlm','Site:\x20','Update\x20existing\x20parent\x20segment\x20(audience)','2004650HGKEVs','customerGroupFile','data','\x27\x20with\x20ID:\x20','211939bOZbqS','Updating\x20parent\x20segment\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','table','3772662CiQhMA','165UIRfmw'];a19_0x3379=function(){return _0x3da08b;};return a19_0x3379();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a19_0x3682(_0x15bac1,_0x1a3fc7){const _0x337963=a19_0x3379();return a19_0x3682=function(_0x36824e,_0x268ad5){_0x36824e=_0x36824e-0x72;let _0x352653=_0x337963[_0x36824e];return _0x352653;},a19_0x3682(_0x15bac1,_0x1a3fc7);}export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x5948db(0x89)]=a19_0x5948db(0xa4);[a19_0x5948db(0x7d)]='Create\x20new\x20parent\x20segment\x20(audience)';async['execute'](_0x53caf6){const _0x53874c=a19_0x5948db,{options:_0x4ce5d2,args:_0x515240,tdx:_0xdb6622}=_0x53caf6,_0x399c4d=_0x4ce5d2;if(_0x515240[_0x53874c(0x80)]===0x0)return console[_0x53874c(0x7b)](_0x53874c(0xa2)),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x154cbb=_0x515240[0x0];if(!_0x399c4d[_0x53874c(0x90)]||!_0x399c4d[_0x53874c(0x9e)])return console[_0x53874c(0x7b)](_0x53874c(0x9d)),console[_0x53874c(0x7b)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x399c4d[_0x53874c(0x78)]&&(console[_0x53874c(0x7b)](_0x53874c(0x95)+_0x399c4d[_0x53874c(0x93)]),console[_0x53874c(0x7b)](_0x53874c(0x82)+_0x154cbb),console[_0x53874c(0x7b)](_0x53874c(0x74)+_0x399c4d[_0x53874c(0x90)]),console[_0x53874c(0x7b)](_0x53874c(0x91)+_0x399c4d[_0x53874c(0x9e)]));const _0x1fd677=await loadJSONFromOptions(_0x399c4d[_0x53874c(0x73)],_0x399c4d['attributesFile']),_0x2111bf=await loadJSONFromOptions(_0x399c4d[_0x53874c(0x79)],_0x399c4d[_0x53874c(0x81)]),_0x6dfa7d=await loadJSONFromOptions(_0x399c4d[_0x53874c(0xa5)],_0x399c4d[_0x53874c(0x98)]),_0x478263={'name':_0x154cbb,'description':_0x399c4d[_0x53874c(0x7d)],'scheduleType':_0x399c4d[_0x53874c(0x8c)],'scheduleOption':_0x399c4d[_0x53874c(0x84)],'timezone':_0x399c4d[_0x53874c(0x77)],'master':{'parentDatabaseName':_0x399c4d[_0x53874c(0x90)],'parentTableName':_0x399c4d[_0x53874c(0x9e)]},'attributes':_0x1fd677,'behaviors':_0x2111bf,'customerGroup':_0x6dfa7d},_0xa3e0cb=await withSpinner(_0x53874c(0xa3)+_0x154cbb+_0x53874c(0x7f),()=>_0xdb6622['segment']['createParent'](_0x478263),{'verbose':_0x4ce5d2[_0x53874c(0x78)]}),_0x3bc8fc=_0xa3e0cb[_0x53874c(0x99)];return console[_0x53874c(0x7b)](_0x53874c(0x8b)+_0x3bc8fc[_0x53874c(0x89)]+_0x53874c(0x9a)+_0x3bc8fc['id']),await handleSDKOutput([_0x3bc8fc],_0x4ce5d2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x5948db(0x89)]='segment:parent:update';['description']=a19_0x5948db(0x96);async[a19_0x5948db(0x7e)](_0x39c146){const _0x27f5dc=a19_0x5948db,{options:_0x3874b8,args:_0xe0458e,tdx:_0x5b5051}=_0x39c146,_0x455f4a=_0x3874b8;if(_0xe0458e[_0x27f5dc(0x80)]===0x0)return console[_0x27f5dc(0x7b)](_0x27f5dc(0xa2)),console[_0x27f5dc(0x7b)](_0x27f5dc(0x7c)),0x1;const _0xdac518=_0xe0458e[0x0];_0x455f4a[_0x27f5dc(0x78)]&&(console[_0x27f5dc(0x7b)](_0x27f5dc(0x95)+_0x455f4a[_0x27f5dc(0x93)]),console[_0x27f5dc(0x7b)](_0x27f5dc(0x8d)+_0xdac518));const _0x507737=await withSpinner(_0x27f5dc(0x8a)+_0xdac518+_0x27f5dc(0x7f),()=>_0x5b5051['segment'][_0x27f5dc(0x92)](_0xdac518),{'verbose':_0x455f4a[_0x27f5dc(0x78)]}),_0x3822d8=_0x507737[_0x27f5dc(0x99)],_0x298d69=await loadJSONFromOptions(_0x455f4a[_0x27f5dc(0xa1)],_0x455f4a['addAttributesFile']),_0x39798b=await loadJSONFromOptions(_0x455f4a[_0x27f5dc(0x76)],_0x455f4a[_0x27f5dc(0x8f)]),_0x412efd={'name':_0x3822d8[_0x27f5dc(0x89)],'description':_0x455f4a[_0x27f5dc(0x7d)]!==undefined?_0x455f4a['description']:_0x3822d8[_0x27f5dc(0x7d)],'scheduleType':_0x455f4a[_0x27f5dc(0x8c)]!==undefined?_0x455f4a['scheduleType']:_0x3822d8['scheduleType'],'scheduleOption':_0x455f4a[_0x27f5dc(0x84)]!==undefined?_0x455f4a[_0x27f5dc(0x84)]:_0x3822d8[_0x27f5dc(0x84)],'timezone':_0x455f4a[_0x27f5dc(0x77)]!==undefined?_0x455f4a[_0x27f5dc(0x77)]:_0x3822d8[_0x27f5dc(0x77)],'master':_0x3822d8['master'],'attributes':_0x298d69?[..._0x3822d8[_0x27f5dc(0x73)]||[],..._0x298d69]:_0x3822d8['attributes'],'behaviors':_0x39798b?[..._0x3822d8[_0x27f5dc(0x79)]||[],..._0x39798b]:_0x3822d8[_0x27f5dc(0x79)],'customerGroup':_0x3822d8[_0x27f5dc(0xa5)]},_0x4eae70=await withSpinner(_0x27f5dc(0x9c)+_0xdac518+'\x27...',()=>_0x5b5051[_0x27f5dc(0x7a)][_0x27f5dc(0x72)](_0xdac518,_0x412efd),{'verbose':_0x455f4a['verbose']}),_0x22658d=_0x4eae70[_0x27f5dc(0x99)];return console['error'](_0x27f5dc(0x75)+_0x22658d[_0x27f5dc(0x89)]+'\x27'),await handleSDKOutput([_0x22658d],_0x455f4a),0x0;}}
1
+ function a19_0x26bf(_0x2d2dd4,_0x1ea68e){const _0x2900b3=a19_0x2900();return a19_0x26bf=function(_0x26bfe4,_0x54cf17){_0x26bfe4=_0x26bfe4-0xa2;let _0x1b842c=_0x2900b3[_0x26bfe4];return _0x1b842c;},a19_0x26bf(_0x2d2dd4,_0x1ea68e);}const a19_0x2ef768=a19_0x26bf;(function(_0x4ef89c,_0x2d2e55){const _0xb1e107=a19_0x26bf,_0x480a19=_0x4ef89c();while(!![]){try{const _0x4b5a4b=parseInt(_0xb1e107(0xb8))/0x1+-parseInt(_0xb1e107(0xc3))/0x2*(parseInt(_0xb1e107(0xc8))/0x3)+-parseInt(_0xb1e107(0xbb))/0x4*(-parseInt(_0xb1e107(0xa2))/0x5)+-parseInt(_0xb1e107(0xa5))/0x6*(parseInt(_0xb1e107(0xcd))/0x7)+parseInt(_0xb1e107(0xb4))/0x8+-parseInt(_0xb1e107(0xc1))/0x9+-parseInt(_0xb1e107(0xba))/0xa*(-parseInt(_0xb1e107(0xb1))/0xb);if(_0x4b5a4b===_0x2d2e55)break;else _0x480a19['push'](_0x480a19['shift']());}catch(_0xdd44b4){_0x480a19['push'](_0x480a19['shift']());}}}(a19_0x2900,0xea726));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a19_0x2900(){const _0x1e38fd=['Updating\x20parent\x20segment\x20\x27','scheduleType','Site:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','10eUptUH','Table:\x20','segment','36gtRjVf','timezone','\x27\x20with\x20ID:\x20','Fetching\x20current\x20configuration\x20for\x20\x27','database','behaviorsFile','addBehaviorsFile','data','customerGroupFile','Create\x20new\x20parent\x20segment\x20(audience)','segment:parent:create','behaviors','1133YQbyAE','addBehaviors','Database:\x20','3311488XWdnKt','attributes','description','segment:parent:update','37344XqIEka','execute','281180CfJKVX','2969012zmlysu','updateParent','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','length','Name:\x20','table','7198209OYuigT','Creating\x20parent\x20segment\x20\x27','3130562opKSDW','name','Parent\x20segment:\x20','✔\x20Created\x20parent\x20segment\x20\x27','attributesFile','3pHRSOF','error','customerGroup','addAttributesFile','verbose','1757658tsOGfj','site','\x27...','master','scheduleOption'];a19_0x2900=function(){return _0x1e38fd;};return a19_0x2900();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x2ef768(0xc4)]=a19_0x2ef768(0xaf);['description']=a19_0x2ef768(0xae);async['execute'](_0x38c1cb){const _0x4af2f4=a19_0x2ef768,{options:_0x214624,args:_0x1d7f57,tdx:_0xe41a52}=_0x38c1cb,_0x280f89=_0x214624;if(_0x1d7f57[_0x4af2f4(0xbe)]===0x0)return console[_0x4af2f4(0xc9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4af2f4(0xc9)](_0x4af2f4(0xbd)),0x1;const _0x2ff083=_0x1d7f57[0x0];if(!_0x280f89[_0x4af2f4(0xa9)]||!_0x280f89[_0x4af2f4(0xc0)])return console[_0x4af2f4(0xc9)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x4af2f4(0xc9)](_0x4af2f4(0xbd)),0x1;_0x280f89[_0x4af2f4(0xcc)]&&(console['error']('Site:\x20'+_0x280f89['site']),console[_0x4af2f4(0xc9)](_0x4af2f4(0xbf)+_0x2ff083),console[_0x4af2f4(0xc9)](_0x4af2f4(0xb3)+_0x280f89[_0x4af2f4(0xa9)]),console[_0x4af2f4(0xc9)](_0x4af2f4(0xa3)+_0x280f89['table']));const _0x338d7a=await loadJSONFromOptions(_0x280f89[_0x4af2f4(0xb5)],_0x280f89[_0x4af2f4(0xc7)]),_0x37d2df=await loadJSONFromOptions(_0x280f89[_0x4af2f4(0xb0)],_0x280f89[_0x4af2f4(0xaa)]),_0xd9edca=await loadJSONFromOptions(_0x280f89[_0x4af2f4(0xca)],_0x280f89[_0x4af2f4(0xad)]),_0xa6b526={'name':_0x2ff083,'description':_0x280f89[_0x4af2f4(0xb6)],'scheduleType':_0x280f89[_0x4af2f4(0xd3)],'scheduleOption':_0x280f89[_0x4af2f4(0xd1)],'timezone':_0x280f89[_0x4af2f4(0xa6)],'master':{'parentDatabaseName':_0x280f89[_0x4af2f4(0xa9)],'parentTableName':_0x280f89[_0x4af2f4(0xc0)]},'attributes':_0x338d7a,'behaviors':_0x37d2df,'customerGroup':_0xd9edca},_0x1e32e5=await withSpinner(_0x4af2f4(0xc2)+_0x2ff083+_0x4af2f4(0xcf),()=>_0xe41a52[_0x4af2f4(0xa4)]['createParent'](_0xa6b526),{'verbose':_0x214624[_0x4af2f4(0xcc)]}),_0x34e85e=_0x1e32e5[_0x4af2f4(0xac)];return console['error'](_0x4af2f4(0xc6)+_0x34e85e[_0x4af2f4(0xc4)]+_0x4af2f4(0xa7)+_0x34e85e['id']),await handleSDKOutput([_0x34e85e],_0x214624),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x2ef768(0xc4)]=a19_0x2ef768(0xb7);[a19_0x2ef768(0xb6)]='Update\x20existing\x20parent\x20segment\x20(audience)';async[a19_0x2ef768(0xb9)](_0x46730c){const _0x5dc6d5=a19_0x2ef768,{options:_0x100e65,args:_0x50da2c,tdx:_0x1431aa}=_0x46730c,_0x2b221f=_0x100e65;if(_0x50da2c['length']===0x0)return console[_0x5dc6d5(0xc9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5dc6d5(0xc9)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x418c3a=_0x50da2c[0x0];_0x2b221f[_0x5dc6d5(0xcc)]&&(console[_0x5dc6d5(0xc9)](_0x5dc6d5(0xd4)+_0x2b221f[_0x5dc6d5(0xce)]),console[_0x5dc6d5(0xc9)](_0x5dc6d5(0xc5)+_0x418c3a));const _0x3f2c25=await withSpinner(_0x5dc6d5(0xa8)+_0x418c3a+_0x5dc6d5(0xcf),()=>_0x1431aa[_0x5dc6d5(0xa4)]['getParentFull'](_0x418c3a),{'verbose':_0x2b221f['verbose']}),_0x38757e=_0x3f2c25[_0x5dc6d5(0xac)],_0x3092ce=await loadJSONFromOptions(_0x2b221f['addAttributes'],_0x2b221f[_0x5dc6d5(0xcb)]),_0x2875ce=await loadJSONFromOptions(_0x2b221f[_0x5dc6d5(0xb2)],_0x2b221f[_0x5dc6d5(0xab)]),_0x54a8ea={'name':_0x38757e[_0x5dc6d5(0xc4)],'description':_0x2b221f[_0x5dc6d5(0xb6)]!==undefined?_0x2b221f[_0x5dc6d5(0xb6)]:_0x38757e[_0x5dc6d5(0xb6)],'scheduleType':_0x2b221f[_0x5dc6d5(0xd3)]!==undefined?_0x2b221f['scheduleType']:_0x38757e['scheduleType'],'scheduleOption':_0x2b221f[_0x5dc6d5(0xd1)]!==undefined?_0x2b221f[_0x5dc6d5(0xd1)]:_0x38757e[_0x5dc6d5(0xd1)],'timezone':_0x2b221f['timezone']!==undefined?_0x2b221f[_0x5dc6d5(0xa6)]:_0x38757e[_0x5dc6d5(0xa6)],'master':_0x38757e[_0x5dc6d5(0xd0)],'attributes':_0x3092ce?[..._0x38757e[_0x5dc6d5(0xb5)]||[],..._0x3092ce]:_0x38757e[_0x5dc6d5(0xb5)],'behaviors':_0x2875ce?[..._0x38757e[_0x5dc6d5(0xb0)]||[],..._0x2875ce]:_0x38757e[_0x5dc6d5(0xb0)],'customerGroup':_0x38757e[_0x5dc6d5(0xca)]},_0x1c6c8e=await withSpinner(_0x5dc6d5(0xd2)+_0x418c3a+_0x5dc6d5(0xcf),()=>_0x1431aa[_0x5dc6d5(0xa4)][_0x5dc6d5(0xbc)](_0x418c3a,_0x54a8ea),{'verbose':_0x2b221f['verbose']}),_0x444356=_0x1c6c8e[_0x5dc6d5(0xac)];return console['error'](_0x5dc6d5(0xd5)+_0x444356[_0x5dc6d5(0xc4)]+'\x27'),await handleSDKOutput([_0x444356],_0x2b221f),0x0;}}
@@ -1 +1 @@
1
- function a20_0x3098(_0x33fa95,_0x43cdd4){const _0x1ef29b=a20_0x1ef2();return a20_0x3098=function(_0x309869,_0x364d05){_0x309869=_0x309869-0x17a;let _0x4b2f2e=_0x1ef29b[_0x309869];return _0x4b2f2e;},a20_0x3098(_0x33fa95,_0x43cdd4);}const a20_0x423a01=a20_0x3098;function a20_0x1ef2(){const _0x373791=['profiles','description','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','5504580iiyOuO','List\x20all\x20available\x20profiles','599767pyrXkK','map','38255752qRqnXt','1079551DlZKVn','message','6798168kDPVeL','9iXwTnB','321676nlnmAg','error','name','25bWgNLb','Error:\x20','config','1009380XzBziC','log','\x20\x20Global:\x20~/.config/tdx/tdx.json'];a20_0x1ef2=function(){return _0x373791;};return a20_0x1ef2();}(function(_0x33da84,_0x4a8b81){const _0x5a9d24=a20_0x3098,_0x4ab978=_0x33da84();while(!![]){try{const _0x558fa6=-parseInt(_0x5a9d24(0x188))/0x1+-parseInt(_0x5a9d24(0x18c))/0x2+-parseInt(_0x5a9d24(0x183))/0x3+-parseInt(_0x5a9d24(0x18a))/0x4+parseInt(_0x5a9d24(0x17a))/0x5*(parseInt(_0x5a9d24(0x17d))/0x6)+parseInt(_0x5a9d24(0x185))/0x7+parseInt(_0x5a9d24(0x187))/0x8*(parseInt(_0x5a9d24(0x18b))/0x9);if(_0x558fa6===_0x4a8b81)break;else _0x4ab978['push'](_0x4ab978['shift']());}catch(_0x3289e7){_0x4ab978['push'](_0x4ab978['shift']());}}}(a20_0x1ef2,0xe4079));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x423a01(0x18e)]=a20_0x423a01(0x180);[a20_0x423a01(0x181)]=a20_0x423a01(0x184);async['execute'](_0x22a1be){const _0x33895b=a20_0x423a01,{options:_0x4987e9}=_0x22a1be;try{const _0x175fd4=listProfiles(),_0x564af6=getActiveProfile();if(_0x175fd4['length']===0x0)return console[_0x33895b(0x17e)](_0x33895b(0x182)),console[_0x33895b(0x17e)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x33895b(0x17e)](_0x33895b(0x17f)),0x0;const _0x251b97=_0x175fd4[_0x33895b(0x186)](_0x3d4049=>{const _0x2de723=_0x33895b,_0x53b60c=_0x3d4049['name']===_0x564af6,_0x2c64da=getProfileParams(_0x3d4049[_0x2de723(0x17c)]);return{'name':_0x3d4049[_0x2de723(0x18e)],'active':_0x53b60c,'scope':_0x3d4049['scope'],'description':_0x3d4049[_0x2de723(0x17c)][_0x2de723(0x181)]||'','params':_0x2c64da};});return await handleSDKOutput(_0x251b97,_0x4987e9),0x0;}catch(_0x561b21){return _0x561b21 instanceof Error&&console[_0x33895b(0x18d)](_0x33895b(0x17b)+_0x561b21[_0x33895b(0x189)]),0x1;}}}
1
+ const a20_0x4ec802=a20_0x1e5c;(function(_0x35e45a,_0x486423){const _0xbdc6ff=a20_0x1e5c,_0xe271b1=_0x35e45a();while(!![]){try{const _0xf09610=-parseInt(_0xbdc6ff(0x167))/0x1+-parseInt(_0xbdc6ff(0x160))/0x2+-parseInt(_0xbdc6ff(0x165))/0x3*(-parseInt(_0xbdc6ff(0x16f))/0x4)+parseInt(_0xbdc6ff(0x16b))/0x5*(-parseInt(_0xbdc6ff(0x170))/0x6)+parseInt(_0xbdc6ff(0x15c))/0x7*(parseInt(_0xbdc6ff(0x164))/0x8)+-parseInt(_0xbdc6ff(0x16a))/0x9+parseInt(_0xbdc6ff(0x163))/0xa;if(_0xf09610===_0x486423)break;else _0xe271b1['push'](_0xe271b1['shift']());}catch(_0x7d67d5){_0xe271b1['push'](_0xe271b1['shift']());}}}(a20_0x172e,0x4d10b));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a20_0x1e5c(_0x4ee7af,_0x273462){const _0x172ef0=a20_0x172e();return a20_0x1e5c=function(_0x1e5ce3,_0x1c3ab){_0x1e5ce3=_0x1e5ce3-0x15c;let _0x23fd12=_0x172ef0[_0x1e5ce3];return _0x23fd12;},a20_0x1e5c(_0x4ee7af,_0x273462);}import{handleSDKOutput}from'../utils/command-output.js';function a20_0x172e(){const _0x233fea=['config','328896HgaHIk','\x20\x20Global:\x20~/.config/tdx/tdx.json','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2124756Hzebwx','1915925OPhCVJ','log','Error:\x20','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','274540fYCGzf','6NuPMIi','14Qllowi','length','map','name','228006Rlnsng','description','error','8596960xZKjcL','699824AodzLB','15HWPPAS'];a20_0x172e=function(){return _0x233fea;};return a20_0x172e();}export class ProfilesCommand extends BaseCommand{[a20_0x4ec802(0x15f)]='profiles';[a20_0x4ec802(0x161)]='List\x20all\x20available\x20profiles';async['execute'](_0x5d9ebe){const _0x365dd1=a20_0x4ec802,{options:_0xa22c2c}=_0x5d9ebe;try{const _0xa98521=listProfiles(),_0x593c5d=getActiveProfile();if(_0xa98521[_0x365dd1(0x15d)]===0x0)return console['log'](_0x365dd1(0x16e)),console['log'](_0x365dd1(0x169)),console[_0x365dd1(0x16c)](_0x365dd1(0x168)),0x0;const _0x55a4d8=_0xa98521[_0x365dd1(0x15e)](_0x15dffa=>{const _0x3aef44=_0x365dd1,_0x2958b1=_0x15dffa['name']===_0x593c5d,_0x39887c=getProfileParams(_0x15dffa['config']);return{'name':_0x15dffa['name'],'active':_0x2958b1,'scope':_0x15dffa['scope'],'description':_0x15dffa[_0x3aef44(0x166)][_0x3aef44(0x161)]||'','params':_0x39887c};});return await handleSDKOutput(_0x55a4d8,_0xa22c2c),0x0;}catch(_0x24a964){return _0x24a964 instanceof Error&&console[_0x365dd1(0x162)](_0x365dd1(0x16d)+_0x24a964['message']),0x1;}}}
@@ -1 +1 @@
1
- function a21_0x3db8(){const _0x16b1b1=['error','\x20[Job\x20ID:\x20','setPhase','6TwVWcc','totalSplits','Executing\x20statement\x20','289640AmUmdC','2142945EeeszF','completedSplits','Site:\x20','658952rNpFzz','push','1708235aluAis','length','site','Statement\x20','SQL:\x20','originalMessage','259761pVHQzI','output','\x20splits','elapsedTimeMillis','Error:\x20','information_schema','processedRows','16bIAqhI','setExtra','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','jobId','file','stats','message','in\x20','11uojtJW','query','282887TKSTjk','Schema:\x20','database','setJobId','description','name','\x20rows\x20','options','49RKMcCv','9240410OGrhus','\x20-\x20','verbose','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','state'];a21_0x3db8=function(){return _0x16b1b1;};return a21_0x3db8();}const a21_0x217f41=a21_0x587e;function a21_0x587e(_0x385430,_0x3af96e){const _0x3db88a=a21_0x3db8();return a21_0x587e=function(_0x587e09,_0x1767b8){_0x587e09=_0x587e09-0xcb;let _0x5c7177=_0x3db88a[_0x587e09];return _0x5c7177;},a21_0x587e(_0x385430,_0x3af96e);}(function(_0x3ea112,_0x52a276){const _0x37ce1a=a21_0x587e,_0x700e8d=_0x3ea112();while(!![]){try{const _0x57ea3e=parseInt(_0x37ce1a(0xdd))/0x1+-parseInt(_0x37ce1a(0xf5))/0x2+parseInt(_0x37ce1a(0xcc))/0x3*(parseInt(_0x37ce1a(0xd3))/0x4)+-parseInt(_0x37ce1a(0xf7))/0x5*(-parseInt(_0x37ce1a(0xee))/0x6)+parseInt(_0x37ce1a(0xe5))/0x7*(parseInt(_0x37ce1a(0xf1))/0x8)+parseInt(_0x37ce1a(0xf2))/0x9+parseInt(_0x37ce1a(0xe6))/0xa*(-parseInt(_0x37ce1a(0xdb))/0xb);if(_0x57ea3e===_0x52a276)break;else _0x700e8d['push'](_0x700e8d['shift']());}catch(_0x1871e7){_0x700e8d['push'](_0x700e8d['shift']());}}}(a21_0x3db8,0x33009));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x217f41(0xe2)]=a21_0x217f41(0xdc);[a21_0x217f41(0xe1)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x54cdde){const _0x2f979f=a21_0x217f41,{options:_0x1822a7,args:_0x3cff89,tdx:_0x50e8a4}=_0x54cdde,_0xe55aed=_0x3cff89[0x0],_0x15395d=_0x1822a7[_0x2f979f(0xd7)];let _0x1d24cb;if(_0x15395d)try{_0x1d24cb=readSqlStatementsFromFile(_0x15395d);}catch(_0xf1f1f2){return console[_0x2f979f(0xeb)](_0x2f979f(0xd0)+_0xf1f1f2[_0x2f979f(0xd9)]),0x1;}else try{_0x1d24cb=splitSqlStatements(_0xe55aed);}catch(_0x519f83){return console[_0x2f979f(0xeb)](_0x2f979f(0xd0)+_0x519f83[_0x2f979f(0xd9)]),0x1;}const _0x50a45a=_0x1822a7[_0x2f979f(0xdf)]||_0x2f979f(0xd1),_0x2fdb32=_0x1822a7['catalog'];try{const _0x197334=[],_0x264560=!!_0x1822a7[_0x2f979f(0xcd)];for(let _0x3cf89a=0x0;_0x3cf89a<_0x1d24cb[_0x2f979f(0xf8)];_0x3cf89a++){const _0x39a78a=_0x1d24cb[_0x3cf89a],_0x1633d5=_0x3cf89a+0x1,_0x54b09b=_0x1d24cb[_0x2f979f(0xf8)],_0x582211=_0x54b09b>0x1;_0x1822a7[_0x2f979f(0xe8)]&&(console[_0x2f979f(0xeb)]('\x0a'+(_0x582211?_0x2f979f(0xfa)+_0x1633d5+'/'+_0x54b09b+':':'')),console[_0x2f979f(0xeb)](_0x2f979f(0xf4)+_0x1822a7[_0x2f979f(0xf9)]),console['error']('Catalog:\x20'+(_0x2fdb32||'td')),console['error'](_0x2f979f(0xde)+_0x50a45a),console[_0x2f979f(0xeb)](_0x2f979f(0xfb)+_0x39a78a));const _0x2eaabd=_0x582211?_0x2f979f(0xf0)+_0x1633d5+'/'+_0x54b09b+'...':'Executing\x20query...';try{const _0x329af0=await withQuerySpinner(_0x2eaabd,async _0x55d6db=>{const _0x18e844=await _0x50e8a4['query'](_0x39a78a,{'catalog':_0x2fdb32,'schema':_0x50a45a,'onJobId':_0xbd394c=>{const _0x48129d=a21_0x587e;_0x55d6db[_0x48129d(0xe0)](_0xbd394c);},'onProgress':_0x4d3129=>{const _0x2d50ec=a21_0x587e;_0x55d6db[_0x2d50ec(0xed)]('Executing\x20query\x20['+_0x4d3129[_0x2d50ec(0xea)]+']'),_0x55d6db[_0x2d50ec(0xd4)](formatRows(_0x4d3129[_0x2d50ec(0xd2)])+_0x2d50ec(0xe3)+_0x4d3129[_0x2d50ec(0xf3)]+'/'+_0x4d3129[_0x2d50ec(0xef)]+_0x2d50ec(0xce));}});return _0x18e844;},{'verbose':_0x1822a7[_0x2f979f(0xe8)]}),_0x47484c=_0x329af0['data'],_0x53e749=_0x47484c[_0x2f979f(0xd6)]?_0x2f979f(0xec)+_0x47484c[_0x2f979f(0xd6)]+']':'',_0x28b60f=_0x582211?_0x2f979f(0xfa)+_0x1633d5+'/'+_0x54b09b+_0x2f979f(0xe7):'';console[_0x2f979f(0xeb)]('✔\x20'+_0x28b60f+'Query\x20completed:\x20Processed\x20'+formatRows(_0x47484c['stats'][_0x2f979f(0xd2)])+'\x20rows\x20'+(_0x2f979f(0xda)+formatElapsed(_0x47484c[_0x2f979f(0xd8)][_0x2f979f(0xcf)])+_0x53e749));if(_0x582211&&_0x264560){const _0x3f7ce8=resolveOutputOptions(_0x1822a7),_0x4794b6=await formatQueryOutput(_0x47484c,_0x3f7ce8);_0x197334[_0x2f979f(0xf6)](_0x4794b6);}else await handleQueryOutput(_0x47484c,_0x1822a7);}catch(_0x23657c){const _0x194707=_0x582211?'Statement\x20'+_0x1633d5+'/'+_0x54b09b+':\x0a':'',_0x327e13=_0x23657c instanceof SDKError?_0x23657c[_0x2f979f(0xcb)]:_0x23657c[_0x2f979f(0xd9)];return console[_0x2f979f(0xeb)](''+_0x194707+_0x327e13),0x1;}}if(_0x1d24cb[_0x2f979f(0xf8)]>0x1&&_0x264560&&_0x197334[_0x2f979f(0xf8)]>0x0){const _0xeef4a8=_0x197334['join']('\x0a');writeFileSync(_0x1822a7[_0x2f979f(0xcd)],_0xeef4a8),console['error']('\x0aAll\x20results\x20saved\x20to\x20'+_0x1822a7['output']);}return 0x0;}catch(_0x4ea117){throw _0x4ea117;}}['validate'](_0x245d93){const _0x1b2d26=a21_0x217f41,_0x4a2e8c=_0x245d93['args'][0x0],_0x347bad=_0x245d93[_0x1b2d26(0xe4)][_0x1b2d26(0xd7)];if(!_0x4a2e8c&&!_0x347bad)return _0x1b2d26(0xd5);if(_0x4a2e8c&&_0x347bad)return _0x1b2d26(0xe9);return undefined;}}
1
+ const a21_0x3784a5=a21_0x6d66;(function(_0x435af9,_0x1e1984){const _0x4c54bf=a21_0x6d66,_0x105666=_0x435af9();while(!![]){try{const _0x4c0701=-parseInt(_0x4c54bf(0x1da))/0x1*(-parseInt(_0x4c54bf(0x1ea))/0x2)+-parseInt(_0x4c54bf(0x1e1))/0x3*(-parseInt(_0x4c54bf(0x1d8))/0x4)+-parseInt(_0x4c54bf(0x1e5))/0x5+parseInt(_0x4c54bf(0x1fb))/0x6*(parseInt(_0x4c54bf(0x1ff))/0x7)+-parseInt(_0x4c54bf(0x1fc))/0x8+-parseInt(_0x4c54bf(0x203))/0x9*(-parseInt(_0x4c54bf(0x1db))/0xa)+parseInt(_0x4c54bf(0x1ed))/0xb*(-parseInt(_0x4c54bf(0x205))/0xc);if(_0x4c0701===_0x1e1984)break;else _0x105666['push'](_0x105666['shift']());}catch(_0x58b8b4){_0x105666['push'](_0x105666['shift']());}}}(a21_0x4224,0x877b5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a21_0x4224(){const _0x54edf2=['stats','length','Statement\x20','\x20[Job\x20ID:\x20','\x20-\x20','Site:\x20','5716BpwlEC','Run\x20Trino\x20queries\x20(streaming)','189080ZIJIkz','10892970PhPPJp','SQL:\x20','Catalog:\x20','state','options','Executing\x20query\x20[','177yVXQId','name','information_schema','args','5102935uNCiQL','\x0aAll\x20results\x20saved\x20to\x20','Error:\x20','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','message','4drHZUh','setPhase','file','33IUbbKL','totalSplits','completedSplits','jobId','output','join','Executing\x20statement\x20','\x20rows\x20','setJobId','processedRows','originalMessage','verbose','error','elapsedTimeMillis','115254kDJtuU','1976464AiEbrq','site','query','161HnlUTZ','\x20splits','in\x20','push','9lLKjFd','execute','683988aeKLUG','Executing\x20query...'];a21_0x4224=function(){return _0x54edf2;};return a21_0x4224();}import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a21_0x6d66(_0x1b795d,_0x234e30){const _0x42249b=a21_0x4224();return a21_0x6d66=function(_0x6d66e4,_0x1fb81b){_0x6d66e4=_0x6d66e4-0x1d7;let _0x3b2e3c=_0x42249b[_0x6d66e4];return _0x3b2e3c;},a21_0x6d66(_0x1b795d,_0x234e30);}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x3784a5(0x1e2)]=a21_0x3784a5(0x1fe);['description']=a21_0x3784a5(0x1d9);async[a21_0x3784a5(0x204)](_0x249b94){const _0x26077c=a21_0x3784a5,{options:_0x4cb098,args:_0x183073,tdx:_0x3cc815}=_0x249b94,_0x2ebb6d=_0x183073[0x0],_0x29b437=_0x4cb098[_0x26077c(0x1ec)];let _0x17d80a;if(_0x29b437)try{_0x17d80a=readSqlStatementsFromFile(_0x29b437);}catch(_0x565638){return console[_0x26077c(0x1f9)](_0x26077c(0x1e7)+_0x565638[_0x26077c(0x1e9)]),0x1;}else try{_0x17d80a=splitSqlStatements(_0x2ebb6d);}catch(_0x1b053d){return console[_0x26077c(0x1f9)]('Error:\x20'+_0x1b053d[_0x26077c(0x1e9)]),0x1;}const _0x29019d=_0x4cb098['database']||_0x26077c(0x1e3),_0x347b4a=_0x4cb098['catalog'];try{const _0x140bf8=[],_0x36e695=!!_0x4cb098[_0x26077c(0x1f1)];for(let _0x15ec4a=0x0;_0x15ec4a<_0x17d80a[_0x26077c(0x208)];_0x15ec4a++){const _0x1be4a3=_0x17d80a[_0x15ec4a],_0xfc300a=_0x15ec4a+0x1,_0x4c6049=_0x17d80a[_0x26077c(0x208)],_0x125e1d=_0x4c6049>0x1;_0x4cb098['verbose']&&(console[_0x26077c(0x1f9)]('\x0a'+(_0x125e1d?_0x26077c(0x209)+_0xfc300a+'/'+_0x4c6049+':':'')),console[_0x26077c(0x1f9)](_0x26077c(0x1d7)+_0x4cb098[_0x26077c(0x1fd)]),console['error'](_0x26077c(0x1dd)+(_0x347b4a||'td')),console[_0x26077c(0x1f9)]('Schema:\x20'+_0x29019d),console[_0x26077c(0x1f9)](_0x26077c(0x1dc)+_0x1be4a3));const _0x3776e1=_0x125e1d?_0x26077c(0x1f3)+_0xfc300a+'/'+_0x4c6049+'...':_0x26077c(0x206);try{const _0x571e9e=await withQuerySpinner(_0x3776e1,async _0x59b28d=>{const _0x213d5e=_0x26077c,_0x10a8b7=await _0x3cc815[_0x213d5e(0x1fe)](_0x1be4a3,{'catalog':_0x347b4a,'schema':_0x29019d,'onJobId':_0x20211b=>{const _0x39ff57=_0x213d5e;_0x59b28d[_0x39ff57(0x1f5)](_0x20211b);},'onProgress':_0x24bd2e=>{const _0x309e9b=_0x213d5e;_0x59b28d[_0x309e9b(0x1eb)](_0x309e9b(0x1e0)+_0x24bd2e[_0x309e9b(0x1de)]+']'),_0x59b28d['setExtra'](formatRows(_0x24bd2e[_0x309e9b(0x1f6)])+_0x309e9b(0x1f4)+_0x24bd2e[_0x309e9b(0x1ef)]+'/'+_0x24bd2e[_0x309e9b(0x1ee)]+_0x309e9b(0x200));}});return _0x10a8b7;},{'verbose':_0x4cb098[_0x26077c(0x1f8)]}),_0x4143a1=_0x571e9e['data'],_0x5f46d8=_0x4143a1[_0x26077c(0x1f0)]?_0x26077c(0x20a)+_0x4143a1['jobId']+']':'',_0x174d71=_0x125e1d?_0x26077c(0x209)+_0xfc300a+'/'+_0x4c6049+_0x26077c(0x20b):'';console[_0x26077c(0x1f9)]('✔\x20'+_0x174d71+'Query\x20completed:\x20Processed\x20'+formatRows(_0x4143a1[_0x26077c(0x207)][_0x26077c(0x1f6)])+_0x26077c(0x1f4)+(_0x26077c(0x201)+formatElapsed(_0x4143a1[_0x26077c(0x207)][_0x26077c(0x1fa)])+_0x5f46d8));if(_0x125e1d&&_0x36e695){const _0x472b8a=resolveOutputOptions(_0x4cb098),_0x5cd419=await formatQueryOutput(_0x4143a1,_0x472b8a);_0x140bf8[_0x26077c(0x202)](_0x5cd419);}else await handleQueryOutput(_0x4143a1,_0x4cb098);}catch(_0xbf4a70){const _0xd4613c=_0x125e1d?'Statement\x20'+_0xfc300a+'/'+_0x4c6049+':\x0a':'',_0x1391c1=_0xbf4a70 instanceof SDKError?_0xbf4a70[_0x26077c(0x1f7)]:_0xbf4a70[_0x26077c(0x1e9)];return console['error'](''+_0xd4613c+_0x1391c1),0x1;}}if(_0x17d80a['length']>0x1&&_0x36e695&&_0x140bf8[_0x26077c(0x208)]>0x0){const _0x15c63d=_0x140bf8[_0x26077c(0x1f2)]('\x0a');writeFileSync(_0x4cb098[_0x26077c(0x1f1)],_0x15c63d),console['error'](_0x26077c(0x1e6)+_0x4cb098[_0x26077c(0x1f1)]);}return 0x0;}catch(_0x5634fe){throw _0x5634fe;}}['validate'](_0x3c1292){const _0x3e9cb9=a21_0x3784a5,_0xe842c2=_0x3c1292[_0x3e9cb9(0x1e4)][0x0],_0x4a53a4=_0x3c1292[_0x3e9cb9(0x1df)][_0x3e9cb9(0x1ec)];if(!_0xe842c2&&!_0x4a53a4)return _0x3e9cb9(0x1e8);if(_0xe842c2&&_0x4a53a4)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
@@ -1 +1 @@
1
- const a22_0x4c4bb5=a22_0x4686;(function(_0x3e26ad,_0x567c89){const _0x4c7f58=a22_0x4686,_0x3784d7=_0x3e26ad();while(!![]){try{const _0x3e08bb=parseInt(_0x4c7f58(0x1bc))/0x1*(-parseInt(_0x4c7f58(0x1bf))/0x2)+parseInt(_0x4c7f58(0x189))/0x3*(-parseInt(_0x4c7f58(0x19a))/0x4)+parseInt(_0x4c7f58(0x16a))/0x5+-parseInt(_0x4c7f58(0x1a6))/0x6+parseInt(_0x4c7f58(0x194))/0x7*(parseInt(_0x4c7f58(0x17a))/0x8)+parseInt(_0x4c7f58(0x1ad))/0x9*(-parseInt(_0x4c7f58(0x1af))/0xa)+parseInt(_0x4c7f58(0x17d))/0xb;if(_0x3e08bb===_0x567c89)break;else _0x3784d7['push'](_0x3784d7['shift']());}catch(_0x563474){_0x3784d7['push'](_0x3784d7['shift']());}}}(a22_0x4e9b,0xbd3ae));function a22_0x4686(_0x18558a,_0x31778b){const _0x4e9b0c=a22_0x4e9b();return a22_0x4686=function(_0x468696,_0x38e525){_0x468696=_0x468696-0x164;let _0x4c1c48=_0x4e9b0c[_0x468696];return _0x4c1c48;},a22_0x4686(_0x18558a,_0x31778b);}import{BaseCommand}from'./command.js';function a22_0x4e9b(){const _0x26382e=['✔\x20Found\x20','INTERNAL','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','828ofEufm','elapsedTimeMillis','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','jobId','segment','\x20\x20Cause:\x20','\x20folder','Fetching\x20SQL\x20for\x20parent\x20segment...','Resolved\x20relative\x20path\x20to:\x20','Fetching\x20folder\x20details...','getSegment','Show\x20segment\x20or\x20folder\x20details','2159226SqVtHp','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','SQL\x20query:\x0a','setJobId','Parent\x20segment:\x20','SELECT\x20*\x20FROM\x20(\x0a','Folder\x20ID:\x20','18NYYngp','segment:show','6688710pqWlLx','verbose','Usage:\x20tdx\x20segment\x20show\x20<path>','execute','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Listing\x20folders\x20for\x20parent\x20\x27','✖\x20Query\x20failed\x20[','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','listFolders','Resolved\x20parent\x20ID:\x20','Resolved\x20folder\x20ID:\x20','2VQrNHe','✔\x20Created\x20folder\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','1316918cSuRCo','parentFolder','resolvePathToResource','getSegmentSQL','segment:folder:create','createFolder','log','getFolder','name','resolveFolderId','message','Error:\x20Parent\x20segment\x20name\x20is\x20required','Segment\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','parent','limit','segmentPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','json','segment:folder:show','getParent','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x27...','error','description','cause','resolveParentId','Usage:\x20tdx\x20segment\x20sql\x20<path>','stats','Site:\x20','test','4737500eLaGzz','Resolving\x20parent\x20folder\x20\x27','Resolving\x20path\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','format','getParentSQL','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','type','Resolving\x20parent\x20segment\x20\x27','code','Executing\x20segment\x20query...','Creating\x20folder\x20\x27','data','trim','toLocaleString','Fetching\x20SQL\x20for\x20segment...','16xLKGvC','processedRows','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','43521874gyktei','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','parentId','Parent\x20ID:\x20','includes','Examples:','Error:\x20','site','information_schema','segmentId','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Show\x20segment\x20folder\x20details','17223NstFSb','Resolved\x20type:\x20','Folder\x20name:\x20','jsonl','folder','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment:describe','folderId','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20[Job\x20ID:\x20','length','258895oMnJUH','query'];a22_0x4e9b=function(){return _0x26382e;};return a22_0x4e9b();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x4c4bb5(0x1c7)]=a22_0x4c4bb5(0x18f);[a22_0x4c4bb5(0x1d8)]=a22_0x4c4bb5(0x1a5);async[a22_0x4c4bb5(0x1b2)](_0x465b53){const _0x261830=a22_0x4c4bb5,{options:_0x1c3509,args:_0x40f946,tdx:_0x1b88ef}=_0x465b53;if(_0x40f946['length']===0x0)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x261830(0x1d7)](_0x261830(0x1d5)),console[_0x261830(0x1d7)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x261830(0x1d7)](_0x261830(0x1d0)),console[_0x261830(0x1d7)](_0x261830(0x199)),0x1;try{const _0x10518b=_0x40f946[0x0],_0x4fbe8c=_0x1c3509[_0x261830(0x1cf)];let _0x5db586=_0x10518b;_0x4fbe8c&&!_0x10518b[_0x261830(0x181)]('/')&&(_0x5db586=_0x4fbe8c+'/'+_0x10518b,_0x1c3509[_0x261830(0x1b0)]&&console[_0x261830(0x1d7)](_0x261830(0x1a2)+_0x5db586));const _0x280cf7=await withSpinner(_0x261830(0x16c)+_0x5db586+'\x27...',()=>_0x1b88ef[_0x261830(0x19e)][_0x261830(0x1c1)](_0x5db586),{'verbose':_0x1c3509['verbose']}),_0x5583fa=_0x280cf7[_0x261830(0x176)];_0x1c3509['verbose']&&(console[_0x261830(0x1d7)](_0x261830(0x18a)+_0x5583fa[_0x261830(0x171)]),console[_0x261830(0x1d7)](_0x261830(0x180)+_0x5583fa[_0x261830(0x17f)]),_0x5583fa[_0x261830(0x190)]&&console[_0x261830(0x1d7)](_0x261830(0x1ac)+_0x5583fa['folderId']),_0x5583fa[_0x261830(0x186)]&&console['error'](_0x261830(0x1cb)+_0x5583fa[_0x261830(0x186)]));if(_0x5583fa[_0x261830(0x171)]==='parent'){const _0x5eb0a5=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1b88ef['segment'][_0x261830(0x1d4)](_0x5583fa[_0x261830(0x17f)]),{'verbose':_0x1c3509[_0x261830(0x1b0)]});await handleSDKOutput([_0x5eb0a5['data']],_0x1c3509);}else{if(_0x5583fa['type']===_0x261830(0x18d)){if(!_0x5583fa[_0x261830(0x190)])throw new SDKError(ErrorCode[_0x261830(0x197)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2c412d=await withSpinner(_0x261830(0x1a3),()=>_0x1b88ef[_0x261830(0x19e)][_0x261830(0x1c6)](_0x5583fa[_0x261830(0x190)]),{'verbose':_0x1c3509[_0x261830(0x1b0)]});await handleSDKOutput([_0x2c412d[_0x261830(0x176)]],_0x1c3509);}else{if(_0x5583fa['type']===_0x261830(0x19e)){if(!_0x5583fa['segmentId'])throw new SDKError(ErrorCode[_0x261830(0x197)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x431148=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1b88ef[_0x261830(0x19e)][_0x261830(0x1a4)](_0x5583fa[_0x261830(0x17f)],_0x5583fa['segmentId']),{'verbose':_0x1c3509[_0x261830(0x1b0)]});await handleSDKOutput([_0x431148['data']],_0x1c3509);}}}return 0x0;}catch(_0x3f4945){if(_0x3f4945 instanceof SDKError)return console[_0x261830(0x1d7)](_0x261830(0x183)+_0x3f4945[_0x261830(0x1c9)]),_0x3f4945['cause']&&console[_0x261830(0x1d7)](_0x261830(0x19f)+_0x3f4945['cause']),0x1;throw _0x3f4945;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x4c4bb5(0x1c7)]=a22_0x4c4bb5(0x1ae);[a22_0x4c4bb5(0x1d8)]=a22_0x4c4bb5(0x18e);async[a22_0x4c4bb5(0x1b2)](_0x4c4eaf){const _0x3fd9c5=a22_0x4c4bb5,{options:_0x2ec78a,args:_0x427e68,tdx:_0x4324f1}=_0x4c4eaf;if(_0x427e68[_0x3fd9c5(0x193)]===0x0)return console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x17e)),console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x1b1)),console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x182)),console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x198)),console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x17c)),console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x1d1)),0x1;try{const _0x2c0543=_0x427e68[0x0],_0x31f6a6=_0x2ec78a[_0x3fd9c5(0x1cf)];let _0x2f14ae=_0x2c0543;_0x31f6a6&&!_0x2c0543[_0x3fd9c5(0x181)]('/')&&(_0x2f14ae=_0x31f6a6+'/'+_0x2c0543,_0x2ec78a[_0x3fd9c5(0x1b0)]&&console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x1a2)+_0x2f14ae));const _0xf85efb=await withSpinner(_0x3fd9c5(0x16c)+_0x2f14ae+'\x27...',()=>_0x4324f1[_0x3fd9c5(0x19e)][_0x3fd9c5(0x1c1)](_0x2f14ae),{'verbose':_0x2ec78a[_0x3fd9c5(0x1b0)]}),_0x1da6d0=_0xf85efb[_0x3fd9c5(0x176)];_0x2ec78a[_0x3fd9c5(0x1b0)]&&(console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x18a)+_0x1da6d0[_0x3fd9c5(0x171)]),console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x180)+_0x1da6d0[_0x3fd9c5(0x17f)]));if(_0x1da6d0[_0x3fd9c5(0x171)]===_0x3fd9c5(0x18d))return console[_0x3fd9c5(0x1d7)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3fd9c5(0x1d7)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x2dbbdb;if(_0x1da6d0[_0x3fd9c5(0x171)]===_0x3fd9c5(0x1cd)){const _0x1109f9=await withSpinner(_0x3fd9c5(0x1a1),()=>_0x4324f1['segment'][_0x3fd9c5(0x16f)](_0x1da6d0['parentId']),{'verbose':_0x2ec78a[_0x3fd9c5(0x1b0)]});_0x2dbbdb=_0x1109f9[_0x3fd9c5(0x176)];}else{if(!_0x1da6d0[_0x3fd9c5(0x186)])throw new SDKError(ErrorCode['INTERNAL'],_0x3fd9c5(0x16d));const _0x42aa48=await withSpinner(_0x3fd9c5(0x179),()=>_0x4324f1['segment'][_0x3fd9c5(0x1c2)](_0x1da6d0['parentId'],_0x1da6d0[_0x3fd9c5(0x186)]),{'verbose':_0x2ec78a[_0x3fd9c5(0x1b0)]});_0x2dbbdb=_0x42aa48[_0x3fd9c5(0x176)];}const _0x514439=resolveLimit(_0x2ec78a[_0x3fd9c5(0x1ce)],DEFAULT_DISPLAY_LIMIT),_0x2dbbb4=/\bLIMIT\s+\d+/i[_0x3fd9c5(0x169)](_0x2dbbdb);!_0x2dbbb4&&(_0x2dbbdb=_0x2dbbdb[_0x3fd9c5(0x177)]()['replace'](/;+$/,''),_0x2dbbdb=_0x3fd9c5(0x1ab)+_0x2dbbdb+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x514439);_0x2ec78a[_0x3fd9c5(0x1b0)]&&console['error'](_0x3fd9c5(0x1a8)+_0x2dbbdb);const _0x1ba6d5=await withQuerySpinner(_0x3fd9c5(0x174),async _0x15eb31=>{const _0x2b5573=_0x3fd9c5,_0x40154a=await _0x4324f1[_0x2b5573(0x195)](_0x2dbbdb,{'catalog':'td','schema':_0x2b5573(0x185),'onJobId':_0x21377d=>{const _0x14201a=_0x2b5573;_0x15eb31[_0x14201a(0x1a9)](_0x21377d);}});return _0x40154a;},{'verbose':_0x2ec78a['verbose']}),_0x4db779=_0x1ba6d5[_0x3fd9c5(0x176)],_0xa3c49=_0x4db779[_0x3fd9c5(0x19d)]?_0x3fd9c5(0x192)+_0x4db779['jobId']+']':'';return console[_0x3fd9c5(0x1d7)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x4db779[_0x3fd9c5(0x167)][_0x3fd9c5(0x17b)][_0x3fd9c5(0x178)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x4db779[_0x3fd9c5(0x167)][_0x3fd9c5(0x19b)])+_0xa3c49)),await handleQueryOutput(_0x4db779,_0x2ec78a),0x0;}catch(_0x175154){if(_0x175154 instanceof SDKError)return console[_0x3fd9c5(0x1d7)](_0x3fd9c5(0x1b5)+_0x175154[_0x3fd9c5(0x173)]+']'),console[_0x3fd9c5(0x1d7)]('\x0a'+_0x175154[_0x3fd9c5(0x1c9)]),0x1;throw _0x175154;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x4c4bb5(0x1c7)]=a22_0x4c4bb5(0x1b7);[a22_0x4c4bb5(0x1d8)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a22_0x4c4bb5(0x1b2)](_0x3078f8){const _0x2a1e22=a22_0x4c4bb5,{options:_0x21a4ca,args:_0x1edcb6,tdx:_0x372365}=_0x3078f8;if(_0x1edcb6['length']===0x0)return console[_0x2a1e22(0x1d7)](_0x2a1e22(0x1ca)),console[_0x2a1e22(0x1d7)](_0x2a1e22(0x170)),0x1;const _0xfe2f3a=_0x1edcb6[0x0];try{_0x21a4ca[_0x2a1e22(0x1b0)]&&(console[_0x2a1e22(0x1d7)](_0x2a1e22(0x168)+_0x21a4ca[_0x2a1e22(0x184)]),console['error']('Parent\x20name:\x20'+_0xfe2f3a));const _0x120ce1=await withSpinner(_0x2a1e22(0x172)+_0xfe2f3a+'\x27...',()=>_0x372365[_0x2a1e22(0x19e)][_0x2a1e22(0x165)](_0xfe2f3a),{'verbose':_0x21a4ca[_0x2a1e22(0x1b0)]}),_0x3d0de8=_0x120ce1[_0x2a1e22(0x176)];_0x21a4ca[_0x2a1e22(0x1b0)]&&console[_0x2a1e22(0x1d7)](_0x2a1e22(0x1ba)+_0x3d0de8);const _0x5745e1=await withSpinner(_0x2a1e22(0x1b4)+_0xfe2f3a+_0x2a1e22(0x1d6),()=>_0x372365[_0x2a1e22(0x19e)][_0x2a1e22(0x1b9)](_0x3d0de8),{'verbose':_0x21a4ca[_0x2a1e22(0x1b0)]}),_0x57d675=_0x5745e1[_0x2a1e22(0x176)];return console['error'](_0x2a1e22(0x196)+_0x57d675[_0x2a1e22(0x193)]+_0x2a1e22(0x1a0)+(_0x57d675[_0x2a1e22(0x193)]!==0x1?'s':'')),await handleSDKOutput(_0x57d675,_0x21a4ca),0x0;}catch(_0x548f50){if(_0x548f50 instanceof SDKError)return console['error'](_0x2a1e22(0x183)+_0x548f50['message']),_0x548f50[_0x2a1e22(0x164)]&&console[_0x2a1e22(0x1d7)](_0x2a1e22(0x19f)+_0x548f50[_0x2a1e22(0x164)]),0x1;throw _0x548f50;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x4c4bb5(0x1c7)]=a22_0x4c4bb5(0x1d3);['description']=a22_0x4c4bb5(0x188);async[a22_0x4c4bb5(0x1b2)](_0x308dc3){const _0x5a1ec9=a22_0x4c4bb5,{options:_0x425b17,args:_0x14e8eb,tdx:_0x26c045}=_0x308dc3;if(_0x14e8eb['length']===0x0)return console[_0x5a1ec9(0x1d7)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x5a1ec9(0x1d7)](_0x5a1ec9(0x1b8)),0x1;try{const {parentId:_0x1dfd5f,childId:_0x4f8079}=parseSegmentRef(_0x14e8eb[0x0]);_0x425b17['verbose']&&(console['error']('Site:\x20'+_0x425b17[_0x5a1ec9(0x184)]),console['error']('Parent\x20name:\x20'+_0x1dfd5f),_0x4f8079&&console[_0x5a1ec9(0x1d7)]('Folder\x20name:\x20'+_0x4f8079));if(!_0x4f8079)return console[_0x5a1ec9(0x1d7)](_0x5a1ec9(0x1be)),0x1;const _0x2c0aa1=await withSpinner(_0x5a1ec9(0x172)+_0x1dfd5f+_0x5a1ec9(0x1d6),()=>_0x26c045['segment'][_0x5a1ec9(0x165)](_0x1dfd5f),{'verbose':_0x425b17[_0x5a1ec9(0x1b0)]}),_0x3cbd64=_0x2c0aa1['data'];_0x425b17[_0x5a1ec9(0x1b0)]&&console[_0x5a1ec9(0x1d7)](_0x5a1ec9(0x1ba)+_0x3cbd64);const _0x52ca82=await withSpinner('Resolving\x20folder\x20\x27'+_0x4f8079+_0x5a1ec9(0x1d6),()=>_0x26c045[_0x5a1ec9(0x19e)][_0x5a1ec9(0x1c8)](_0x3cbd64,_0x4f8079),{'verbose':_0x425b17[_0x5a1ec9(0x1b0)]}),_0x2a9ec4=_0x52ca82[_0x5a1ec9(0x176)];_0x425b17[_0x5a1ec9(0x1b0)]&&console['error'](_0x5a1ec9(0x1bb)+_0x2a9ec4);const _0x2da4d6=await withSpinner('Fetching\x20folder\x20\x27'+_0x4f8079+_0x5a1ec9(0x1d6),()=>_0x26c045[_0x5a1ec9(0x19e)]['getFolder'](_0x2a9ec4),{'verbose':_0x425b17[_0x5a1ec9(0x1b0)]});return await handleSDKOutput([_0x2da4d6['data']],_0x425b17),0x0;}catch(_0x32d020){if(_0x32d020 instanceof SDKError)return console[_0x5a1ec9(0x1d7)](_0x5a1ec9(0x183)+_0x32d020[_0x5a1ec9(0x1c9)]),_0x32d020[_0x5a1ec9(0x164)]&&console[_0x5a1ec9(0x1d7)]('\x20\x20Cause:\x20'+_0x32d020[_0x5a1ec9(0x164)]),0x1;throw _0x32d020;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x4c4bb5(0x1c7)]='segment:sql';[a22_0x4c4bb5(0x1d8)]=a22_0x4c4bb5(0x19c);async[a22_0x4c4bb5(0x1b2)](_0x934bd){const _0xb9da1d=a22_0x4c4bb5,{options:_0x4a8ebb,args:_0x3b6735,tdx:_0x5ad718}=_0x934bd;if(_0x3b6735['length']===0x0)return console[_0xb9da1d(0x1d7)](_0xb9da1d(0x17e)),console[_0xb9da1d(0x1d7)](_0xb9da1d(0x166)),console[_0xb9da1d(0x1d7)](_0xb9da1d(0x182)),console['error'](_0xb9da1d(0x1b3)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0xb9da1d(0x1d7)](_0xb9da1d(0x191)),0x1;try{const _0x4f8041=_0x3b6735[0x0],_0x1ac949=_0x4a8ebb['segmentPath'];let _0x5ef1cf=_0x4f8041;_0x1ac949&&!_0x4f8041[_0xb9da1d(0x181)]('/')&&(_0x5ef1cf=_0x1ac949+'/'+_0x4f8041,_0x4a8ebb[_0xb9da1d(0x1b0)]&&console[_0xb9da1d(0x1d7)](_0xb9da1d(0x1a2)+_0x5ef1cf));const _0x150e90=await withSpinner(_0xb9da1d(0x16c)+_0x5ef1cf+_0xb9da1d(0x1d6),()=>_0x5ad718[_0xb9da1d(0x19e)][_0xb9da1d(0x1c1)](_0x5ef1cf),{'verbose':_0x4a8ebb[_0xb9da1d(0x1b0)]}),_0x3e937d=_0x150e90['data'];_0x4a8ebb[_0xb9da1d(0x1b0)]&&(console['error'](_0xb9da1d(0x18a)+_0x3e937d[_0xb9da1d(0x171)]),console[_0xb9da1d(0x1d7)](_0xb9da1d(0x180)+_0x3e937d[_0xb9da1d(0x17f)]));if(_0x3e937d['type']===_0xb9da1d(0x18d))return console[_0xb9da1d(0x1d7)](_0xb9da1d(0x187)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x52d698;if(_0x3e937d['type']==='parent'){const _0x25ee95=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x5ad718[_0xb9da1d(0x19e)][_0xb9da1d(0x16f)](_0x3e937d[_0xb9da1d(0x17f)]),{'verbose':_0x4a8ebb[_0xb9da1d(0x1b0)]});_0x52d698=_0x25ee95[_0xb9da1d(0x176)];}else{if(!_0x3e937d[_0xb9da1d(0x186)])throw new SDKError(ErrorCode[_0xb9da1d(0x197)],_0xb9da1d(0x16d));const _0x3b1b57=await withSpinner(_0xb9da1d(0x179),()=>_0x5ad718[_0xb9da1d(0x19e)]['getSegmentSQL'](_0x3e937d['parentId'],_0x3e937d[_0xb9da1d(0x186)]),{'verbose':_0x4a8ebb[_0xb9da1d(0x1b0)]});_0x52d698=_0x3b1b57[_0xb9da1d(0x176)];}return _0x4a8ebb[_0xb9da1d(0x16e)]===_0xb9da1d(0x1d2)||_0x4a8ebb['format']===_0xb9da1d(0x18c)?await handleSDKOutput([{'sql':_0x52d698}],_0x4a8ebb):console[_0xb9da1d(0x1c5)](_0x52d698),0x0;}catch(_0x23dff1){if(_0x23dff1 instanceof SDKError)return console[_0xb9da1d(0x1d7)](_0xb9da1d(0x183)+_0x23dff1[_0xb9da1d(0x1c9)]),_0x23dff1['cause']&&console[_0xb9da1d(0x1d7)]('\x20\x20Cause:\x20'+_0x23dff1[_0xb9da1d(0x164)]),0x1;throw _0x23dff1;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a22_0x4c4bb5(0x1c3);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x4c4bb5(0x1b2)](_0x1959b5){const _0x257d6a=a22_0x4c4bb5,{options:_0x440435,args:_0x45a1b9,tdx:_0x51f742}=_0x1959b5,_0x2f93e5=_0x440435;if(_0x45a1b9[_0x257d6a(0x193)]<0x2)return console[_0x257d6a(0x1d7)](_0x257d6a(0x1b6)),console[_0x257d6a(0x1d7)](_0x257d6a(0x1a7)),0x1;const _0x480d32=_0x45a1b9[0x0],_0x53f7a8=_0x45a1b9[0x1];_0x2f93e5[_0x257d6a(0x1b0)]&&(console[_0x257d6a(0x1d7)](_0x257d6a(0x168)+_0x2f93e5['site']),console[_0x257d6a(0x1d7)](_0x257d6a(0x1aa)+_0x480d32),console['error'](_0x257d6a(0x18b)+_0x53f7a8));let _0x47799b;if(_0x2f93e5[_0x257d6a(0x1c0)]){const _0x2fe5f8=_0x2f93e5[_0x257d6a(0x1c0)],_0x8f6e36=await withSpinner(_0x257d6a(0x172)+_0x480d32+_0x257d6a(0x1d6),()=>_0x51f742[_0x257d6a(0x19e)]['resolveParentId'](_0x480d32),{'verbose':_0x2f93e5[_0x257d6a(0x1b0)]}),_0x211b53=_0x8f6e36[_0x257d6a(0x176)],_0x5dfeb4=await withSpinner(_0x257d6a(0x16b)+_0x2fe5f8+_0x257d6a(0x1d6),()=>_0x51f742[_0x257d6a(0x19e)][_0x257d6a(0x1c8)](_0x211b53,_0x2fe5f8),{'verbose':_0x2f93e5[_0x257d6a(0x1b0)]});_0x47799b=_0x5dfeb4['data'],_0x2f93e5['verbose']&&console[_0x257d6a(0x1d7)](_0x257d6a(0x1cc)+_0x47799b);}const _0x241e5b={'name':_0x53f7a8,'description':_0x2f93e5[_0x257d6a(0x1d8)],'parentFolderId':_0x47799b},_0x4dd117=await withSpinner(_0x257d6a(0x175)+_0x53f7a8+_0x257d6a(0x1d6),()=>_0x51f742[_0x257d6a(0x19e)][_0x257d6a(0x1c4)](_0x480d32,_0x241e5b),{'verbose':_0x2f93e5[_0x257d6a(0x1b0)]}),_0x75d641=_0x4dd117['data'];return console['error'](_0x257d6a(0x1bd)+_0x75d641[_0x257d6a(0x1c7)]+'\x27\x20with\x20ID:\x20'+_0x75d641['id']),await handleSDKOutput([_0x75d641],_0x2f93e5),0x0;}}
1
+ const a22_0x1e14fc=a22_0x3975;(function(_0x7bef9d,_0x30efb9){const _0x4ef1cf=a22_0x3975,_0x372ca6=_0x7bef9d();while(!![]){try{const _0x5cc10f=-parseInt(_0x4ef1cf(0x142))/0x1+-parseInt(_0x4ef1cf(0x11e))/0x2*(-parseInt(_0x4ef1cf(0x104))/0x3)+parseInt(_0x4ef1cf(0x148))/0x4*(parseInt(_0x4ef1cf(0x14a))/0x5)+parseInt(_0x4ef1cf(0x125))/0x6*(parseInt(_0x4ef1cf(0x11f))/0x7)+-parseInt(_0x4ef1cf(0x12f))/0x8*(parseInt(_0x4ef1cf(0x122))/0x9)+-parseInt(_0x4ef1cf(0x131))/0xa+-parseInt(_0x4ef1cf(0x101))/0xb*(-parseInt(_0x4ef1cf(0xf3))/0xc);if(_0x5cc10f===_0x30efb9)break;else _0x372ca6['push'](_0x372ca6['shift']());}catch(_0x407f22){_0x372ca6['push'](_0x372ca6['shift']());}}}(a22_0x4598,0xa949b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0xef);[a22_0x1e14fc(0x103)]='Show\x20segment\x20or\x20folder\x20details';async[a22_0x1e14fc(0x10e)](_0x65139c){const _0x3bfe25=a22_0x1e14fc,{options:_0x1a8639,args:_0x5f295f,tdx:_0xbafc20}=_0x65139c;if(_0x5f295f[_0x3bfe25(0x156)]===0x0)return console['error'](_0x3bfe25(0x149)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xfb)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xed)),console[_0x3bfe25(0x10c)](_0x3bfe25(0x123)),console[_0x3bfe25(0x10c)](_0x3bfe25(0x10f)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xfa)),0x1;try{const _0x4f1913=_0x5f295f[0x0],_0x53e51b=_0x1a8639['segmentPath'];let _0x38db5b=_0x4f1913;_0x53e51b&&!_0x4f1913[_0x3bfe25(0x153)]('/')&&(_0x38db5b=_0x53e51b+'/'+_0x4f1913,_0x1a8639[_0x3bfe25(0xfe)]&&console[_0x3bfe25(0x10c)](_0x3bfe25(0x10b)+_0x38db5b));const _0x12b67b=await withSpinner(_0x3bfe25(0xfd)+_0x38db5b+_0x3bfe25(0x152),()=>_0xbafc20[_0x3bfe25(0x140)]['resolvePathToResource'](_0x38db5b),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]}),_0x141381=_0x12b67b['data'];_0x1a8639['verbose']&&(console[_0x3bfe25(0x10c)]('Resolved\x20type:\x20'+_0x141381[_0x3bfe25(0x12e)]),console[_0x3bfe25(0x10c)]('Parent\x20ID:\x20'+_0x141381[_0x3bfe25(0x13a)]),_0x141381[_0x3bfe25(0x137)]&&console[_0x3bfe25(0x10c)](_0x3bfe25(0x14d)+_0x141381[_0x3bfe25(0x137)]),_0x141381[_0x3bfe25(0xec)]&&console['error'](_0x3bfe25(0x158)+_0x141381[_0x3bfe25(0xec)]));if(_0x141381['type']===_0x3bfe25(0x105)){const _0x4720d0=await withSpinner(_0x3bfe25(0x139),()=>_0xbafc20['segment'][_0x3bfe25(0x113)](_0x141381['parentId']),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]});await handleSDKOutput([_0x4720d0[_0x3bfe25(0x106)]],_0x1a8639);}else{if(_0x141381[_0x3bfe25(0x12e)]===_0x3bfe25(0x107)){if(!_0x141381[_0x3bfe25(0x137)])throw new SDKError(ErrorCode['INTERNAL'],_0x3bfe25(0x15a));const _0x8cc8f2=await withSpinner('Fetching\x20folder\x20details...',()=>_0xbafc20['segment'][_0x3bfe25(0x15d)](_0x141381[_0x3bfe25(0x137)]),{'verbose':_0x1a8639['verbose']});await handleSDKOutput([_0x8cc8f2[_0x3bfe25(0x106)]],_0x1a8639);}else{if(_0x141381[_0x3bfe25(0x12e)]===_0x3bfe25(0x140)){if(!_0x141381[_0x3bfe25(0xec)])throw new SDKError(ErrorCode[_0x3bfe25(0x14f)],_0x3bfe25(0x13c));const _0x1f3c1f=await withSpinner(_0x3bfe25(0x121),()=>_0xbafc20[_0x3bfe25(0x140)]['getSegment'](_0x141381[_0x3bfe25(0x13a)],_0x141381[_0x3bfe25(0xec)]),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]});await handleSDKOutput([_0x1f3c1f[_0x3bfe25(0x106)]],_0x1a8639);}}}return 0x0;}catch(_0x254d6f){if(_0x254d6f instanceof SDKError)return console['error'](_0x3bfe25(0x118)+_0x254d6f[_0x3bfe25(0x13f)]),_0x254d6f['cause']&&console['error'](_0x3bfe25(0x13b)+_0x254d6f[_0x3bfe25(0x119)]),0x1;throw _0x254d6f;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0x144);[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x133);async['execute'](_0x304b0b){const _0x47c54e=a22_0x1e14fc,{options:_0x198585,args:_0xa42028,tdx:_0x3cce35}=_0x304b0b;if(_0xa42028[_0x47c54e(0x156)]===0x0)return console[_0x47c54e(0x10c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x47c54e(0x10c)](_0x47c54e(0x10a)),console[_0x47c54e(0x10c)](_0x47c54e(0xed)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x47c54e(0x136)),console[_0x47c54e(0x10c)](_0x47c54e(0x15b)),0x1;try{const _0x5c6da5=_0xa42028[0x0],_0x4d7064=_0x198585[_0x47c54e(0x11a)];let _0x48ef4f=_0x5c6da5;_0x4d7064&&!_0x5c6da5[_0x47c54e(0x153)]('/')&&(_0x48ef4f=_0x4d7064+'/'+_0x5c6da5,_0x198585[_0x47c54e(0xfe)]&&console[_0x47c54e(0x10c)](_0x47c54e(0x10b)+_0x48ef4f));const _0x2d6933=await withSpinner(_0x47c54e(0xfd)+_0x48ef4f+_0x47c54e(0x152),()=>_0x3cce35[_0x47c54e(0x140)]['resolvePathToResource'](_0x48ef4f),{'verbose':_0x198585[_0x47c54e(0xfe)]}),_0x14364b=_0x2d6933[_0x47c54e(0x106)];_0x198585[_0x47c54e(0xfe)]&&(console['error']('Resolved\x20type:\x20'+_0x14364b[_0x47c54e(0x12e)]),console[_0x47c54e(0x10c)](_0x47c54e(0xf2)+_0x14364b['parentId']));if(_0x14364b[_0x47c54e(0x12e)]===_0x47c54e(0x107))return console['error'](_0x47c54e(0x11c)),console[_0x47c54e(0x10c)](_0x47c54e(0x11b)),0x1;let _0x167d52;if(_0x14364b['type']===_0x47c54e(0x105)){const _0x1062c5=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x3cce35[_0x47c54e(0x140)][_0x47c54e(0x13e)](_0x14364b['parentId']),{'verbose':_0x198585['verbose']});_0x167d52=_0x1062c5['data'];}else{if(!_0x14364b[_0x47c54e(0xec)])throw new SDKError(ErrorCode[_0x47c54e(0x14f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x398572=await withSpinner(_0x47c54e(0xf7),()=>_0x3cce35[_0x47c54e(0x140)][_0x47c54e(0x14b)](_0x14364b['parentId'],_0x14364b[_0x47c54e(0xec)]),{'verbose':_0x198585[_0x47c54e(0xfe)]});_0x167d52=_0x398572['data'];}const _0x32cbf7=resolveLimit(_0x198585[_0x47c54e(0xf4)],DEFAULT_DISPLAY_LIMIT),_0x2ba327=/\bLIMIT\s+\d+/i['test'](_0x167d52);!_0x2ba327&&(_0x167d52=_0x167d52[_0x47c54e(0x15e)]()[_0x47c54e(0x129)](/;+$/,''),_0x167d52=_0x47c54e(0xee)+_0x167d52+_0x47c54e(0xf1)+_0x32cbf7);_0x198585[_0x47c54e(0xfe)]&&console[_0x47c54e(0x10c)](_0x47c54e(0x157)+_0x167d52);const _0x3e0d11=await withQuerySpinner(_0x47c54e(0x127),async _0x489bf1=>{const _0x48c734=_0x47c54e,_0x345fc3=await _0x3cce35['query'](_0x167d52,{'catalog':'td','schema':_0x48c734(0x110),'onJobId':_0x540e3f=>{_0x489bf1['setJobId'](_0x540e3f);}});return _0x345fc3;},{'verbose':_0x198585['verbose']}),_0x1e1025=_0x3e0d11[_0x47c54e(0x106)],_0xaa8732=_0x1e1025[_0x47c54e(0x155)]?_0x47c54e(0x111)+_0x1e1025[_0x47c54e(0x155)]+']':'';return console[_0x47c54e(0x10c)](_0x47c54e(0x154)+_0x1e1025['stats'][_0x47c54e(0x108)]['toLocaleString']()+_0x47c54e(0x146)+(_0x47c54e(0x12d)+formatElapsed(_0x1e1025['stats']['elapsedTimeMillis'])+_0xaa8732)),await handleQueryOutput(_0x1e1025,_0x198585),0x0;}catch(_0x523fac){if(_0x523fac instanceof SDKError)return console[_0x47c54e(0x10c)](_0x47c54e(0xf8)+_0x523fac[_0x47c54e(0x141)]+']'),console[_0x47c54e(0x10c)]('\x0a'+_0x523fac['message']),0x1;throw _0x523fac;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0x100);[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x14e);async['execute'](_0x3d0c36){const _0x50f55e=a22_0x1e14fc,{options:_0x3af545,args:_0x7deb6c,tdx:_0x42d8f1}=_0x3d0c36;if(_0x7deb6c['length']===0x0)return console[_0x50f55e(0x10c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x5d9616=_0x7deb6c[0x0];try{_0x3af545[_0x50f55e(0xfe)]&&(console[_0x50f55e(0x10c)](_0x50f55e(0x135)+_0x3af545[_0x50f55e(0x112)]),console['error'](_0x50f55e(0x151)+_0x5d9616));const _0x1a68e5=await withSpinner(_0x50f55e(0x138)+_0x5d9616+'\x27...',()=>_0x42d8f1[_0x50f55e(0x140)][_0x50f55e(0x102)](_0x5d9616),{'verbose':_0x3af545[_0x50f55e(0xfe)]}),_0x295bf4=_0x1a68e5['data'];_0x3af545[_0x50f55e(0xfe)]&&console[_0x50f55e(0x10c)](_0x50f55e(0x115)+_0x295bf4);const _0x4affc2=await withSpinner(_0x50f55e(0xf9)+_0x5d9616+_0x50f55e(0x152),()=>_0x42d8f1[_0x50f55e(0x140)]['listFolders'](_0x295bf4),{'verbose':_0x3af545[_0x50f55e(0xfe)]}),_0x2c8fc2=_0x4affc2['data'];return console['error'](_0x50f55e(0x109)+_0x2c8fc2[_0x50f55e(0x156)]+_0x50f55e(0x15c)+(_0x2c8fc2[_0x50f55e(0x156)]!==0x1?'s':'')),await handleSDKOutput(_0x2c8fc2,_0x3af545),0x0;}catch(_0x17f638){if(_0x17f638 instanceof SDKError)return console['error'](_0x50f55e(0x118)+_0x17f638['message']),_0x17f638[_0x50f55e(0x119)]&&console[_0x50f55e(0x10c)](_0x50f55e(0x13b)+_0x17f638['cause']),0x1;throw _0x17f638;}}}function a22_0x3975(_0x5bb802,_0x69622e){const _0x459837=a22_0x4598();return a22_0x3975=function(_0x39757e,_0x16174e){_0x39757e=_0x39757e-0xec;let _0x1dc39a=_0x459837[_0x39757e];return _0x1dc39a;},a22_0x3975(_0x5bb802,_0x69622e);}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:folder:show';['description']=a22_0x1e14fc(0x116);async[a22_0x1e14fc(0x10e)](_0x461ee5){const _0x5a75d2=a22_0x1e14fc,{options:_0x58d419,args:_0x446b8b,tdx:_0xe3e7c1}=_0x461ee5;if(_0x446b8b['length']===0x0)return console[_0x5a75d2(0x10c)](_0x5a75d2(0x120)),console[_0x5a75d2(0x10c)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x196bb0,childId:_0x1f9af3}=parseSegmentRef(_0x446b8b[0x0]);_0x58d419[_0x5a75d2(0xfe)]&&(console[_0x5a75d2(0x10c)](_0x5a75d2(0x135)+_0x58d419[_0x5a75d2(0x112)]),console['error'](_0x5a75d2(0x151)+_0x196bb0),_0x1f9af3&&console['error'](_0x5a75d2(0xf6)+_0x1f9af3));if(!_0x1f9af3)return console[_0x5a75d2(0x10c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x857cca=await withSpinner(_0x5a75d2(0x138)+_0x196bb0+'\x27...',()=>_0xe3e7c1[_0x5a75d2(0x140)][_0x5a75d2(0x102)](_0x196bb0),{'verbose':_0x58d419['verbose']}),_0x4f0bc7=_0x857cca[_0x5a75d2(0x106)];_0x58d419[_0x5a75d2(0xfe)]&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x115)+_0x4f0bc7);const _0x36acbc=await withSpinner(_0x5a75d2(0x147)+_0x1f9af3+_0x5a75d2(0x152),()=>_0xe3e7c1[_0x5a75d2(0x140)][_0x5a75d2(0x128)](_0x4f0bc7,_0x1f9af3),{'verbose':_0x58d419['verbose']}),_0x35cf4f=_0x36acbc[_0x5a75d2(0x106)];_0x58d419['verbose']&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x150)+_0x35cf4f);const _0xa50964=await withSpinner(_0x5a75d2(0x126)+_0x1f9af3+_0x5a75d2(0x152),()=>_0xe3e7c1['segment'][_0x5a75d2(0x15d)](_0x35cf4f),{'verbose':_0x58d419[_0x5a75d2(0xfe)]});return await handleSDKOutput([_0xa50964[_0x5a75d2(0x106)]],_0x58d419),0x0;}catch(_0x3b5e35){if(_0x3b5e35 instanceof SDKError)return console[_0x5a75d2(0x10c)]('Error:\x20'+_0x3b5e35[_0x5a75d2(0x13f)]),_0x3b5e35[_0x5a75d2(0x119)]&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x13b)+_0x3b5e35[_0x5a75d2(0x119)]),0x1;throw _0x3b5e35;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:sql';[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x117);async[a22_0x1e14fc(0x10e)](_0x32aed9){const _0x13d62d=a22_0x1e14fc,{options:_0x228686,args:_0x15301c,tdx:_0x44fdbd}=_0x32aed9;if(_0x15301c['length']===0x0)return console[_0x13d62d(0x10c)](_0x13d62d(0x13d)),console['error'](_0x13d62d(0x159)),console[_0x13d62d(0x10c)](_0x13d62d(0xed)),console[_0x13d62d(0x10c)](_0x13d62d(0xf5)),console[_0x13d62d(0x10c)](_0x13d62d(0x134)),console[_0x13d62d(0x10c)](_0x13d62d(0x12b)),0x1;try{const _0x294755=_0x15301c[0x0],_0x45bf64=_0x228686['segmentPath'];let _0x42e561=_0x294755;_0x45bf64&&!_0x294755[_0x13d62d(0x153)]('/')&&(_0x42e561=_0x45bf64+'/'+_0x294755,_0x228686[_0x13d62d(0xfe)]&&console['error'](_0x13d62d(0x10b)+_0x42e561));const _0x3a104c=await withSpinner(_0x13d62d(0xfd)+_0x42e561+_0x13d62d(0x152),()=>_0x44fdbd[_0x13d62d(0x140)]['resolvePathToResource'](_0x42e561),{'verbose':_0x228686[_0x13d62d(0xfe)]}),_0x4292e0=_0x3a104c[_0x13d62d(0x106)];_0x228686['verbose']&&(console[_0x13d62d(0x10c)]('Resolved\x20type:\x20'+_0x4292e0[_0x13d62d(0x12e)]),console[_0x13d62d(0x10c)]('Parent\x20ID:\x20'+_0x4292e0[_0x13d62d(0x13a)]));if(_0x4292e0['type']===_0x13d62d(0x107))return console[_0x13d62d(0x10c)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x13d62d(0x10c)](_0x13d62d(0x12c)),0x1;let _0x7b0093;if(_0x4292e0[_0x13d62d(0x12e)]===_0x13d62d(0x105)){const _0x379feb=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x44fdbd[_0x13d62d(0x140)]['getParentSQL'](_0x4292e0[_0x13d62d(0x13a)]),{'verbose':_0x228686['verbose']});_0x7b0093=_0x379feb[_0x13d62d(0x106)];}else{if(!_0x4292e0[_0x13d62d(0xec)])throw new SDKError(ErrorCode[_0x13d62d(0x14f)],_0x13d62d(0x13c));const _0x5efa91=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x44fdbd[_0x13d62d(0x140)]['getSegmentSQL'](_0x4292e0[_0x13d62d(0x13a)],_0x4292e0[_0x13d62d(0xec)]),{'verbose':_0x228686[_0x13d62d(0xfe)]});_0x7b0093=_0x5efa91[_0x13d62d(0x106)];}return _0x228686[_0x13d62d(0xff)]===_0x13d62d(0x14c)||_0x228686['format']==='jsonl'?await handleSDKOutput([{'sql':_0x7b0093}],_0x228686):console[_0x13d62d(0x132)](_0x7b0093),0x0;}catch(_0x237291){if(_0x237291 instanceof SDKError)return console['error']('Error:\x20'+_0x237291[_0x13d62d(0x13f)]),_0x237291['cause']&&console['error'](_0x13d62d(0x13b)+_0x237291[_0x13d62d(0x119)]),0x1;throw _0x237291;}}}function a22_0x4598(){const _0x4df051=['\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Folder\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','✖\x20Query\x20failed\x20[','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20segment\x20describe\x20<path>','✔\x20Created\x20folder\x20\x27','Resolving\x20path\x20\x27','verbose','format','segment:folder:list','237457NDprOS','resolveParentId','description','100209WRIsZY','parent','data','folder','processedRows','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','Resolved\x20relative\x20path\x20to:\x20','error','Resolving\x20parent\x20folder\x20\x27','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','information_schema','\x20[Job\x20ID:\x20','site','getParent','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','Show\x20segment\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Error:\x20','cause','segmentPath','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20parent\x20folder\x20ID:\x20','82GPDsnI','1386763UGQpPC','Error:\x20Folder\x20reference\x20is\x20required','Fetching\x20segment\x20details...','1783989RYtXCy','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','24dsbbGW','Fetching\x20folder\x20\x27','Executing\x20segment\x20query...','resolveFolderId','replace','Parent\x20segment:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','in\x20','type','48RvMAsY','name','9620140lYmiWY','log','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderId','Resolving\x20parent\x20segment\x20\x27','Fetching\x20parent\x20segment\x20details...','parentId','\x20\x20Cause:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','getParentSQL','message','segment','code','384685uoYvRx','\x27\x20with\x20ID:\x20','segment:show','createFolder','\x20rows\x20','Resolving\x20folder\x20\x27','1304zxnrSz','Error:\x20Path\x20or\x20name\x20is\x20required','8095caMgiJ','getSegmentSQL','json','Folder\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','INTERNAL','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','\x27...','includes','✔\x20Query\x20completed:\x20Processed\x20','jobId','length','SQL\x20query:\x0a','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20folder','getFolder','trim','segmentId','Examples:','SELECT\x20*\x20FROM\x20(\x0a','segment:describe','parentFolder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20ID:\x20','300mdcQCJ','limit'];a22_0x4598=function(){return _0x4df051;};return a22_0x4598();}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:folder:create';[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x124);async[a22_0x1e14fc(0x10e)](_0x197885){const _0x11e23c=a22_0x1e14fc,{options:_0x1a36fb,args:_0x5740ae,tdx:_0x588080}=_0x197885,_0x3838fe=_0x1a36fb;if(_0x5740ae[_0x11e23c(0x156)]<0x2)return console[_0x11e23c(0x10c)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x11e23c(0x10c)](_0x11e23c(0x114)),0x1;const _0x457123=_0x5740ae[0x0],_0x1793a8=_0x5740ae[0x1];_0x3838fe[_0x11e23c(0xfe)]&&(console['error'](_0x11e23c(0x135)+_0x3838fe[_0x11e23c(0x112)]),console[_0x11e23c(0x10c)](_0x11e23c(0x12a)+_0x457123),console[_0x11e23c(0x10c)](_0x11e23c(0xf6)+_0x1793a8));let _0x32f184;if(_0x3838fe[_0x11e23c(0xf0)]){const _0x14bbc2=_0x3838fe[_0x11e23c(0xf0)],_0x5ce834=await withSpinner(_0x11e23c(0x138)+_0x457123+_0x11e23c(0x152),()=>_0x588080[_0x11e23c(0x140)][_0x11e23c(0x102)](_0x457123),{'verbose':_0x3838fe[_0x11e23c(0xfe)]}),_0x83be2d=_0x5ce834[_0x11e23c(0x106)],_0x8374b=await withSpinner(_0x11e23c(0x10d)+_0x14bbc2+_0x11e23c(0x152),()=>_0x588080[_0x11e23c(0x140)][_0x11e23c(0x128)](_0x83be2d,_0x14bbc2),{'verbose':_0x3838fe[_0x11e23c(0xfe)]});_0x32f184=_0x8374b[_0x11e23c(0x106)],_0x3838fe[_0x11e23c(0xfe)]&&console[_0x11e23c(0x10c)](_0x11e23c(0x11d)+_0x32f184);}const _0x50a591={'name':_0x1793a8,'description':_0x3838fe[_0x11e23c(0x103)],'parentFolderId':_0x32f184},_0x2163c0=await withSpinner('Creating\x20folder\x20\x27'+_0x1793a8+'\x27...',()=>_0x588080['segment'][_0x11e23c(0x145)](_0x457123,_0x50a591),{'verbose':_0x3838fe[_0x11e23c(0xfe)]}),_0x194ff0=_0x2163c0[_0x11e23c(0x106)];return console[_0x11e23c(0x10c)](_0x11e23c(0xfc)+_0x194ff0[_0x11e23c(0x130)]+_0x11e23c(0x143)+_0x194ff0['id']),await handleSDKOutput([_0x194ff0],_0x3838fe),0x0;}}
@@ -1 +1 @@
1
- const a23_0x5209a4=a23_0x1b4d;(function(_0x39eef4,_0x5a2ccb){const _0x4ecc9f=a23_0x1b4d,_0x604842=_0x39eef4();while(!![]){try{const _0x1eba59=-parseInt(_0x4ecc9f(0xf6))/0x1*(parseInt(_0x4ecc9f(0x117))/0x2)+parseInt(_0x4ecc9f(0x104))/0x3+parseInt(_0x4ecc9f(0x10f))/0x4*(parseInt(_0x4ecc9f(0xfe))/0x5)+-parseInt(_0x4ecc9f(0x11c))/0x6*(-parseInt(_0x4ecc9f(0x12c))/0x7)+parseInt(_0x4ecc9f(0x108))/0x8+parseInt(_0x4ecc9f(0x11b))/0x9*(parseInt(_0x4ecc9f(0xf8))/0xa)+-parseInt(_0x4ecc9f(0x100))/0xb;if(_0x1eba59===_0x5a2ccb)break;else _0x604842['push'](_0x604842['shift']());}catch(_0x17b76c){_0x604842['push'](_0x604842['shift']());}}}(a23_0x43a3,0xec283));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a23_0x1b4d(_0x132663,_0x137c84){const _0x43a3ed=a23_0x43a3();return a23_0x1b4d=function(_0x1b4d17,_0x8c73ea){_0x1b4d17=_0x1b4d17-0xf6;let _0x3dfacd=_0x43a3ed[_0x1b4d17];return _0x3dfacd;},a23_0x1b4d(_0x132663,_0x137c84);}export class SegmentCreateCommand extends BaseCommand{['name']=a23_0x5209a4(0x114);['description']=a23_0x5209a4(0x105);async[a23_0x5209a4(0x10e)](_0x5a6965){const _0x473dee=a23_0x5209a4,{options:_0x4a4e99,args:_0xf1be47,tdx:_0x7244ce}=_0x5a6965,_0x146e88=_0x4a4e99;if(_0xf1be47[_0x473dee(0x11d)]===0x0)return console[_0x473dee(0x115)](_0x473dee(0x112)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x473dee(0x115)](_0x473dee(0x10d)),console[_0x473dee(0x115)](_0x473dee(0x12b)),console[_0x473dee(0x115)](_0x473dee(0x10a)),console[_0x473dee(0x115)](_0x473dee(0x102)),0x1;const _0x1d5f08=_0xf1be47[0x0],_0x11f11c=_0x4a4e99[_0x473dee(0x11f)];let _0xf08146=_0x1d5f08;_0x11f11c&&!_0x1d5f08['includes']('/')&&(_0xf08146=_0x11f11c+'/'+_0x1d5f08,_0x146e88[_0x473dee(0x129)]&&console[_0x473dee(0x115)](_0x473dee(0xfc)+_0xf08146));const _0x34105b=parsePath(_0xf08146);if(_0x34105b[_0x473dee(0xfd)][_0x473dee(0x11d)]<0x2)return console[_0x473dee(0x115)](_0x473dee(0xf9)),console['error'](_0x473dee(0x10c)),0x1;const _0x3e43d4=_0x34105b[_0x473dee(0xfd)][0x0],_0x3a430d=getBaseName(_0xf08146),_0x41b13e=getParentPath(_0xf08146);_0x146e88[_0x473dee(0x129)]&&(console[_0x473dee(0x115)](_0x473dee(0xfb)+_0x146e88['site']),console['error'](_0x473dee(0x116)+_0xf08146),console[_0x473dee(0x115)](_0x473dee(0x121)+_0x3e43d4),console[_0x473dee(0x115)](_0x473dee(0x101)+_0x3a430d),console[_0x473dee(0x115)]('Parent\x20path:\x20'+_0x41b13e));const _0x593a81=await withSpinner(_0x473dee(0x126)+_0x3e43d4+_0x473dee(0x107),()=>_0x7244ce[_0x473dee(0x127)][_0x473dee(0x124)](_0x3e43d4),{'verbose':_0x146e88[_0x473dee(0x129)]}),_0x4c9087=_0x593a81[_0x473dee(0x122)];let _0x310838;if(_0x34105b[_0x473dee(0xfd)]['length']>0x2){const _0x27bfaf=await withSpinner(_0x473dee(0x120)+_0x41b13e+'\x27...',()=>_0x7244ce[_0x473dee(0x127)][_0x473dee(0x109)](_0x41b13e),{'verbose':_0x146e88[_0x473dee(0x129)]}),_0x1be877=_0x27bfaf['data'];if(_0x1be877[_0x473dee(0x106)]!==_0x473dee(0x113)&&_0x1be877['type']!==_0x473dee(0x118))return console[_0x473dee(0x115)](_0x473dee(0x110)),0x1;_0x310838=_0x1be877[_0x473dee(0xff)];}else{if(_0x146e88[_0x473dee(0x113)]){const _0x5a7e91=await withSpinner(_0x473dee(0x10b)+_0x146e88[_0x473dee(0x113)]+'\x27...',()=>_0x7244ce['segment'][_0x473dee(0xf7)](_0x4c9087,_0x146e88[_0x473dee(0x113)]),{'verbose':_0x146e88[_0x473dee(0x129)]});_0x310838=_0x5a7e91[_0x473dee(0x122)];}}_0x146e88['verbose']&&_0x310838&&console['error'](_0x473dee(0x12a)+_0x310838);const _0xe5c0f8=await loadJSONFromOptions(_0x146e88[_0x473dee(0x111)],_0x146e88[_0x473dee(0x123)]),_0xc2f3e3={'name':_0x3a430d,'description':_0x146e88[_0x473dee(0x11e)],'rule':_0xe5c0f8,'kind':_0x146e88['kind']!==undefined?parseInt(_0x146e88['kind'],0xa):undefined,'isVisible':_0x146e88[_0x473dee(0x119)]?![]:undefined,'segmentFolderId':_0x310838,'countPopulation':_0x146e88[_0x473dee(0x128)]?![]:undefined},_0x310822=await withSpinner(_0x473dee(0xfa)+_0x3a430d+_0x473dee(0x107),()=>_0x7244ce[_0x473dee(0x127)]['createSegment'](_0x4c9087,_0xc2f3e3),{'verbose':_0x146e88[_0x473dee(0x129)]}),_0x2d75c3=_0x310822[_0x473dee(0x122)];return console[_0x473dee(0x115)](_0x473dee(0x11a)+_0x2d75c3['name']+_0x473dee(0x125)+_0x2d75c3['id']),_0xf08146!==_0x1d5f08&&console[_0x473dee(0x115)](_0x473dee(0x103)+_0xf08146),await handleSDKOutput([_0x2d75c3],_0x146e88),0x0;}}function a23_0x43a3(){const _0x2fa1f2=['Resolved\x20relative\x20path\x20to:\x20','segments','696545ViUJmw','folderId','31283131LcyHbZ','Segment\x20name:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20\x20Path:\x20','1319133pFtNXN','Create\x20child\x20segment\x20with\x20filtering\x20rules','type','\x27...','5614424nqsorH','resolvePathToResource','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Examples:','execute','44aeqSsk','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','rule','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder','segment:create','error','Target\x20path:\x20','16dOcUJc','parent','invisible','✔\x20Created\x20segment\x20\x27','261vdGQia','89934dcpPNA','length','description','segmentPath','Resolving\x20folder\x20path\x20\x27','Parent:\x20','data','ruleFile','resolveParentId','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','segment','noCountPopulation','verbose','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','392kiyfRD','48886uombTu','resolveFolderId','237590xKkyIa','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Creating\x20segment\x20\x27','Site:\x20'];a23_0x43a3=function(){return _0x2fa1f2;};return a23_0x43a3();}
1
+ const a23_0xb16e67=a23_0x1bd1;function a23_0x1bd1(_0x4f8dd1,_0x58933c){const _0x36cec3=a23_0x36ce();return a23_0x1bd1=function(_0x1bd1a1,_0x2e2044){_0x1bd1a1=_0x1bd1a1-0x1b4;let _0x203f80=_0x36cec3[_0x1bd1a1];return _0x203f80;},a23_0x1bd1(_0x4f8dd1,_0x58933c);}(function(_0x57c35c,_0x55566a){const _0x2d4884=a23_0x1bd1,_0x3c9927=_0x57c35c();while(!![]){try{const _0x5a3057=parseInt(_0x2d4884(0x1cc))/0x1+-parseInt(_0x2d4884(0x1c2))/0x2*(-parseInt(_0x2d4884(0x1e5))/0x3)+parseInt(_0x2d4884(0x1de))/0x4+parseInt(_0x2d4884(0x1c4))/0x5+parseInt(_0x2d4884(0x1d0))/0x6*(-parseInt(_0x2d4884(0x1c9))/0x7)+parseInt(_0x2d4884(0x1c5))/0x8+-parseInt(_0x2d4884(0x1b8))/0x9;if(_0x5a3057===_0x55566a)break;else _0x3c9927['push'](_0x3c9927['shift']());}catch(_0x5f24bb){_0x3c9927['push'](_0x3c9927['shift']());}}}(a23_0x36ce,0x3f7da));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a23_0x36ce(){const _0x13d590=['resolveParentId','verbose','length','Parent:\x20','parent','rule','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Create\x20child\x20segment\x20with\x20filtering\x20rules','602316zDuuee','execute','✔\x20Created\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','kind','Examples:','description','303gvuaSp','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment','error','\x20\x20\x20Path:\x20','1391229CwXJCz','segmentPath','data','folder','type','Creating\x20segment\x20\x27','resolveFolderId','Target\x20path:\x20','folderId','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','596ixVMoy','resolvePathToResource','307490Oloupm','57192DohjzK','Resolving\x20folder\x20path\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Resolving\x20folder\x20\x27','4242UmwJmD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','site','273789zPwNOb','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','ruleFile','1074EvPLRp','name','\x27...','Resolved\x20folder\x20ID:\x20','segments'];a23_0x36ce=function(){return _0x13d590;};return a23_0x36ce();}export class SegmentCreateCommand extends BaseCommand{[a23_0xb16e67(0x1d1)]=a23_0xb16e67(0x1db);[a23_0xb16e67(0x1e4)]=a23_0xb16e67(0x1dd);async[a23_0xb16e67(0x1df)](_0x4b6fdd){const _0x1f61bc=a23_0xb16e67,{options:_0x482fa5,args:_0x118fce,tdx:_0x4752c0}=_0x4b6fdd,_0x3097a6=_0x482fa5;if(_0x118fce[_0x1f61bc(0x1d7)]===0x0)return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1ca)),console['error'](_0x1f61bc(0x1b4)),console['error'](_0x1f61bc(0x1e3)),console[_0x1f61bc(0x1b6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x1f61bc(0x1b6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x1f61bc(0x1dc)),0x1;const _0x1198c5=_0x118fce[0x0],_0x558430=_0x482fa5[_0x1f61bc(0x1b9)];let _0x277516=_0x1198c5;_0x558430&&!_0x1198c5['includes']('/')&&(_0x277516=_0x558430+'/'+_0x1198c5,_0x3097a6['verbose']&&console['error'](_0x1f61bc(0x1cd)+_0x277516));const _0x1e3568=parsePath(_0x277516);if(_0x1e3568[_0x1f61bc(0x1d4)][_0x1f61bc(0x1d7)]<0x2)return console['error'](_0x1f61bc(0x1c1)),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1c7)),0x1;const _0xe7041b=_0x1e3568[_0x1f61bc(0x1d4)][0x0],_0x3de008=getBaseName(_0x277516),_0x386e68=getParentPath(_0x277516);_0x3097a6[_0x1f61bc(0x1d6)]&&(console[_0x1f61bc(0x1b6)]('Site:\x20'+_0x3097a6[_0x1f61bc(0x1cb)]),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1bf)+_0x277516),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1d8)+_0xe7041b),console[_0x1f61bc(0x1b6)]('Segment\x20name:\x20'+_0x3de008),console[_0x1f61bc(0x1b6)]('Parent\x20path:\x20'+_0x386e68));const _0x295a53=await withSpinner(_0x1f61bc(0x1e1)+_0xe7041b+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1d5)](_0xe7041b),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0x24be4c=_0x295a53[_0x1f61bc(0x1ba)];let _0x124da1;if(_0x1e3568['segments']['length']>0x2){const _0x21bffa=await withSpinner(_0x1f61bc(0x1c6)+_0x386e68+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1c3)](_0x386e68),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0xc666d9=_0x21bffa['data'];if(_0xc666d9[_0x1f61bc(0x1bc)]!==_0x1f61bc(0x1bb)&&_0xc666d9[_0x1f61bc(0x1bc)]!==_0x1f61bc(0x1d9))return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1ce)),0x1;_0x124da1=_0xc666d9[_0x1f61bc(0x1c0)];}else{if(_0x3097a6[_0x1f61bc(0x1bb)]){const _0x19b048=await withSpinner(_0x1f61bc(0x1c8)+_0x3097a6['folder']+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1be)](_0x24be4c,_0x3097a6[_0x1f61bc(0x1bb)]),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]});_0x124da1=_0x19b048[_0x1f61bc(0x1ba)];}}_0x3097a6['verbose']&&_0x124da1&&console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1d3)+_0x124da1);const _0x5b2977=await loadJSONFromOptions(_0x3097a6[_0x1f61bc(0x1da)],_0x3097a6[_0x1f61bc(0x1cf)]),_0x2f7701={'name':_0x3de008,'description':_0x3097a6[_0x1f61bc(0x1e4)],'rule':_0x5b2977,'kind':_0x3097a6['kind']!==undefined?parseInt(_0x3097a6[_0x1f61bc(0x1e2)],0xa):undefined,'isVisible':_0x3097a6['invisible']?![]:undefined,'segmentFolderId':_0x124da1,'countPopulation':_0x3097a6['noCountPopulation']?![]:undefined},_0x2e2929=await withSpinner(_0x1f61bc(0x1bd)+_0x3de008+_0x1f61bc(0x1d2),()=>_0x4752c0['segment']['createSegment'](_0x24be4c,_0x2f7701),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0xb1c26e=_0x2e2929[_0x1f61bc(0x1ba)];return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1e0)+_0xb1c26e['name']+'\x27\x20with\x20ID:\x20'+_0xb1c26e['id']),_0x277516!==_0x1198c5&&console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1b7)+_0x277516),await handleSDKOutput([_0xb1c26e],_0x3097a6),0x0;}}
@@ -1 +1 @@
1
- const a24_0x366099=a24_0x3f8c;function a24_0x3f8c(_0x420ec5,_0x50cec1){const _0x30082e=a24_0x3008();return a24_0x3f8c=function(_0x3f8cf0,_0x164531){_0x3f8cf0=_0x3f8cf0-0x1d7;let _0x4fb0aa=_0x30082e[_0x3f8cf0];return _0x4fb0aa;},a24_0x3f8c(_0x420ec5,_0x50cec1);}(function(_0x19736a,_0xe2fc4){const _0x52116b=a24_0x3f8c,_0x3a2a16=_0x19736a();while(!![]){try{const _0x4853ff=parseInt(_0x52116b(0x1dd))/0x1+parseInt(_0x52116b(0x1ea))/0x2+parseInt(_0x52116b(0x1d9))/0x3*(parseInt(_0x52116b(0x1e9))/0x4)+parseInt(_0x52116b(0x1e3))/0x5*(parseInt(_0x52116b(0x1ef))/0x6)+parseInt(_0x52116b(0x1e7))/0x7*(parseInt(_0x52116b(0x1ee))/0x8)+parseInt(_0x52116b(0x1e8))/0x9*(parseInt(_0x52116b(0x1de))/0xa)+-parseInt(_0x52116b(0x1e1))/0xb;if(_0x4853ff===_0xe2fc4)break;else _0x3a2a16['push'](_0x3a2a16['shift']());}catch(_0x57fcf8){_0x3a2a16['push'](_0x3a2a16['shift']());}}}(a24_0x3008,0x8fcf2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a24_0x3008(){const _0x2fe415=['description','error','length','7FbdQoZ','9XAgZVd','2142100kHrlYY','286554kRLrFq','Listing\x20fields\x20for\x20\x27','execute','Parent\x20segment:\x20','6000784CtGXOx','48VogUNO','List\x20available\x20fields\x20for\x20segmentation','site','segment','3yrnuaI','verbose','name','segment:fields','321712hqGrHr','3613220SPUByF','✔\x20Found\x20','listFields','26012580OqosBx','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','526180Kbmxpa'];a24_0x3008=function(){return _0x2fe415;};return a24_0x3008();}export class SegmentFieldsCommand extends BaseCommand{[a24_0x366099(0x1db)]=a24_0x366099(0x1dc);[a24_0x366099(0x1e4)]=a24_0x366099(0x1f0);async[a24_0x366099(0x1ec)](_0x3fd397){const _0x64d4d6=a24_0x366099,{options:_0x313d57,args:_0xf20bdb,tdx:_0x55a342}=_0x3fd397;if(_0xf20bdb['length']===0x0)return console[_0x64d4d6(0x1e5)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x64d4d6(0x1e5)](_0x64d4d6(0x1e2)),0x1;const _0x4c2531=_0xf20bdb[0x0];_0x313d57[_0x64d4d6(0x1da)]&&(console[_0x64d4d6(0x1e5)]('Site:\x20'+_0x313d57[_0x64d4d6(0x1d7)]),console[_0x64d4d6(0x1e5)](_0x64d4d6(0x1ed)+_0x4c2531));const _0x3a4d45=await withSpinner(_0x64d4d6(0x1eb)+_0x4c2531+'\x27...',()=>_0x55a342[_0x64d4d6(0x1d8)][_0x64d4d6(0x1e0)](_0x4c2531),{'verbose':_0x313d57[_0x64d4d6(0x1da)]}),_0x18a817=_0x3a4d45['data'];return console[_0x64d4d6(0x1e5)](_0x64d4d6(0x1df)+_0x18a817[_0x64d4d6(0x1e6)]+'\x20field'+(_0x18a817[_0x64d4d6(0x1e6)]!==0x1?'s':'')),await handleSDKOutput(_0x18a817,_0x313d57),0x0;}}
1
+ function a24_0x531f(_0x119687,_0x376631){const _0x236811=a24_0x2368();return a24_0x531f=function(_0x531f8b,_0x2b0b3e){_0x531f8b=_0x531f8b-0x15a;let _0x21b7a3=_0x236811[_0x531f8b];return _0x21b7a3;},a24_0x531f(_0x119687,_0x376631);}const a24_0x6b3d10=a24_0x531f;(function(_0x346e6,_0x252850){const _0x1c33d1=a24_0x531f,_0x1ceed0=_0x346e6();while(!![]){try{const _0x3d88a4=parseInt(_0x1c33d1(0x15b))/0x1+parseInt(_0x1c33d1(0x171))/0x2*(parseInt(_0x1c33d1(0x165))/0x3)+-parseInt(_0x1c33d1(0x160))/0x4+parseInt(_0x1c33d1(0x15a))/0x5*(parseInt(_0x1c33d1(0x15f))/0x6)+parseInt(_0x1c33d1(0x16a))/0x7*(parseInt(_0x1c33d1(0x15d))/0x8)+parseInt(_0x1c33d1(0x164))/0x9*(parseInt(_0x1c33d1(0x16e))/0xa)+parseInt(_0x1c33d1(0x166))/0xb*(-parseInt(_0x1c33d1(0x167))/0xc);if(_0x3d88a4===_0x252850)break;else _0x1ceed0['push'](_0x1ceed0['shift']());}catch(_0x395fca){_0x1ceed0['push'](_0x1ceed0['shift']());}}}(a24_0x2368,0x2ef69));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a24_0x2368(){const _0x134016=['101066JJASyl','name','✔\x20Found\x20','data','error','5bkaHeJ','89590MxQByG','site','2000336CvTheD','segment:fields','1168572YQCGPl','1337408wPwibZ','\x27...','Listing\x20fields\x20for\x20\x27','execute','2554731AuFJDI','9BAJoKM','187xsIFDc','312804izhrPd','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','7RDOBwV','\x20field','Parent\x20segment:\x20','Site:\x20','10XCPwuk','verbose','length'];a24_0x2368=function(){return _0x134016;};return a24_0x2368();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x6b3d10(0x172)]=a24_0x6b3d10(0x15e);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a24_0x6b3d10(0x163)](_0x181835){const _0xefd34c=a24_0x6b3d10,{options:_0x5ae7d9,args:_0x4bbc1a,tdx:_0x4aa85d}=_0x181835;if(_0x4bbc1a['length']===0x0)return console[_0xefd34c(0x175)](_0xefd34c(0x168)),console[_0xefd34c(0x175)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x5d731a=_0x4bbc1a[0x0];_0x5ae7d9[_0xefd34c(0x16f)]&&(console[_0xefd34c(0x175)](_0xefd34c(0x16d)+_0x5ae7d9[_0xefd34c(0x15c)]),console[_0xefd34c(0x175)](_0xefd34c(0x16c)+_0x5d731a));const _0x1e45a3=await withSpinner(_0xefd34c(0x162)+_0x5d731a+_0xefd34c(0x161),()=>_0x4aa85d['segment'][_0xefd34c(0x169)](_0x5d731a),{'verbose':_0x5ae7d9['verbose']}),_0x163e40=_0x1e45a3[_0xefd34c(0x174)];return console['error'](_0xefd34c(0x173)+_0x163e40[_0xefd34c(0x170)]+_0xefd34c(0x16b)+(_0x163e40['length']!==0x1?'s':'')),await handleSDKOutput(_0x163e40,_0x5ae7d9),0x0;}}
@@ -1 +1 @@
1
- const a25_0x358700=a25_0x2416;(function(_0x1fd882,_0x18311d){const _0x2aaf2e=a25_0x2416,_0x13083d=_0x1fd882();while(!![]){try{const _0x42db0b=parseInt(_0x2aaf2e(0x15b))/0x1*(-parseInt(_0x2aaf2e(0x161))/0x2)+-parseInt(_0x2aaf2e(0x14a))/0x3*(-parseInt(_0x2aaf2e(0x159))/0x4)+parseInt(_0x2aaf2e(0x15e))/0x5+parseInt(_0x2aaf2e(0x150))/0x6+-parseInt(_0x2aaf2e(0x15a))/0x7+parseInt(_0x2aaf2e(0x158))/0x8*(parseInt(_0x2aaf2e(0x14c))/0x9)+-parseInt(_0x2aaf2e(0x149))/0xa*(parseInt(_0x2aaf2e(0x156))/0xb);if(_0x42db0b===_0x18311d)break;else _0x13083d['push'](_0x13083d['shift']());}catch(_0x31001f){_0x13083d['push'](_0x13083d['shift']());}}}(a25_0x225f,0xd9e8e));function a25_0x2416(_0xb8aba3,_0x1920cb){const _0x225f9b=a25_0x225f();return a25_0x2416=function(_0x2416f4,_0x43dc02){_0x2416f4=_0x2416f4-0x149;let _0x19b910=_0x225f9b[_0x2416f4];return _0x19b910;},a25_0x2416(_0xb8aba3,_0x1920cb);}function a25_0x225f(){const _0x41dec8=['232cmkBrY','88SrzMVd','5198914fxCwaG','993NSGYOe','Context\x20details:','description','2764990bKxWZt','\x20\x20Path:\x20','format','2102OkzOQn','error','jsonl','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','50XxOXRo','74661AhxsMv','log','298071AMkaOf','Show\x20current\x20segment/folder\x20context','root','json','7909800wnnxLT','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','segment:pwd','name','execute','stringify','1540792aMBluT','segmentPath'];a25_0x225f=function(){return _0x41dec8;};return a25_0x225f();}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a25_0x358700(0x153)]=a25_0x358700(0x152);[a25_0x358700(0x15d)]=a25_0x358700(0x14d);async[a25_0x358700(0x154)](_0x52e9e2){const _0x4f3a81=a25_0x358700,{options:_0x532562}=_0x52e9e2;try{const _0x35cba7=_0x532562[_0x4f3a81(0x157)];if(!_0x35cba7)return _0x532562[_0x4f3a81(0x160)]===_0x4f3a81(0x14f)||_0x532562['format']===_0x4f3a81(0x163)?console[_0x4f3a81(0x14b)](JSON[_0x4f3a81(0x155)]({'path':'/','type':_0x4f3a81(0x14e)})):console['log']('/'),0x0;if(_0x532562[_0x4f3a81(0x160)]===_0x4f3a81(0x14f)||_0x532562[_0x4f3a81(0x160)]===_0x4f3a81(0x163)){const _0x28b820={'path':_0x35cba7};console[_0x4f3a81(0x14b)](JSON[_0x4f3a81(0x155)](_0x28b820));}else console[_0x4f3a81(0x14b)](_0x35cba7),_0x532562['verbose']&&(console[_0x4f3a81(0x162)](''),console[_0x4f3a81(0x162)](_0x4f3a81(0x15c)),console[_0x4f3a81(0x162)](_0x4f3a81(0x15f)+_0x35cba7),console[_0x4f3a81(0x162)](''),console[_0x4f3a81(0x162)](_0x4f3a81(0x164)),console[_0x4f3a81(0x162)](_0x4f3a81(0x151)));return 0x0;}catch(_0x5dbfe4){throw _0x5dbfe4;}}}
1
+ const a25_0x5603ff=a25_0xf46d;(function(_0x188f9f,_0x40672d){const _0x230bd2=a25_0xf46d,_0x267edc=_0x188f9f();while(!![]){try{const _0x2e8e6c=parseInt(_0x230bd2(0xa5))/0x1*(-parseInt(_0x230bd2(0xa6))/0x2)+parseInt(_0x230bd2(0x9d))/0x3*(parseInt(_0x230bd2(0x9e))/0x4)+-parseInt(_0x230bd2(0xa7))/0x5+-parseInt(_0x230bd2(0xa8))/0x6*(-parseInt(_0x230bd2(0x96))/0x7)+parseInt(_0x230bd2(0xa0))/0x8+parseInt(_0x230bd2(0x95))/0x9+-parseInt(_0x230bd2(0x91))/0xa*(-parseInt(_0x230bd2(0x90))/0xb);if(_0x2e8e6c===_0x40672d)break;else _0x267edc['push'](_0x267edc['shift']());}catch(_0x4e24fc){_0x267edc['push'](_0x267edc['shift']());}}}(a25_0x1d73,0xd5e84));function a25_0x1d73(){const _0x134f48=['jsonl','1247EVKgMk','604rTJOLH','7993885bpEIMr','6KFvBsg','segmentPath','770iWgyeF','43690DzhOfd','log','json','execute','6121377kMlNGj','7959343AEGaYx','name','format','error','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segment:pwd','description','3TOQTSB','2121524zDdsDr','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','1584976hHFVFY','verbose','Context\x20details:','\x20\x20Path:\x20'];a25_0x1d73=function(){return _0x134f48;};return a25_0x1d73();}import{BaseCommand}from'./command.js';function a25_0xf46d(_0x153722,_0x93b6f7){const _0x1d732f=a25_0x1d73();return a25_0xf46d=function(_0xf46dad,_0x2350bb){_0xf46dad=_0xf46dad-0x8f;let _0xe12844=_0x1d732f[_0xf46dad];return _0xe12844;},a25_0xf46d(_0x153722,_0x93b6f7);}export class SegmentPwdCommand extends BaseCommand{[a25_0x5603ff(0x97)]=a25_0x5603ff(0x9b);[a25_0x5603ff(0x9c)]='Show\x20current\x20segment/folder\x20context';async[a25_0x5603ff(0x94)](_0x4a2472){const _0x5504f3=a25_0x5603ff,{options:_0x2280f5}=_0x4a2472;try{const _0x14c232=_0x2280f5[_0x5504f3(0x8f)];if(!_0x14c232)return _0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0x93)||_0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0xa4)?console[_0x5504f3(0x92)](JSON['stringify']({'path':'/','type':'root'})):console[_0x5504f3(0x92)]('/'),0x0;if(_0x2280f5['format']===_0x5504f3(0x93)||_0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0xa4)){const _0x5e46d3={'path':_0x14c232};console[_0x5504f3(0x92)](JSON['stringify'](_0x5e46d3));}else console['log'](_0x14c232),_0x2280f5[_0x5504f3(0xa1)]&&(console[_0x5504f3(0x99)](''),console[_0x5504f3(0x99)](_0x5504f3(0xa2)),console[_0x5504f3(0x99)](_0x5504f3(0xa3)+_0x14c232),console[_0x5504f3(0x99)](''),console['error'](_0x5504f3(0x9a)),console[_0x5504f3(0x99)](_0x5504f3(0x9f)));return 0x0;}catch(_0x2e523f){throw _0x2e523f;}}}