@treasuredata/tdx 0.1.19 → 0.1.20

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 (87) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-client.js +1 -1
  9. package/dist/client/trino-client.js +1 -1
  10. package/dist/client/workflow-client.js +1 -1
  11. package/dist/commands/activations.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/context-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/llm-command.js +1 -1
  21. package/dist/commands/llm-proxy.js +1 -1
  22. package/dist/commands/parent-segment-command.js +1 -1
  23. package/dist/commands/profiles-command.js +1 -1
  24. package/dist/commands/query-command.js +1 -1
  25. package/dist/commands/segment-command.js +1 -1
  26. package/dist/commands/segment-create-command.js +1 -1
  27. package/dist/commands/segment-fields-command.js +1 -1
  28. package/dist/commands/segment-pwd-command.js +1 -1
  29. package/dist/commands/segment-update-command.js +1 -1
  30. package/dist/commands/segment-use-command.js +1 -1
  31. package/dist/commands/segments.js +1 -1
  32. package/dist/commands/show.js +1 -1
  33. package/dist/commands/tables.js +1 -1
  34. package/dist/commands/use-command.js +1 -1
  35. package/dist/commands/workflow-command.js +1 -1
  36. package/dist/core/auth.js +1 -1
  37. package/dist/core/config.js +1 -1
  38. package/dist/core/global-context.js +1 -1
  39. package/dist/core/profile.js +1 -1
  40. package/dist/core/project-config.js +1 -1
  41. package/dist/core/session.js +1 -1
  42. package/dist/index.js +1 -1
  43. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  44. package/dist/proxy/anthropic-adapter.js +1 -1
  45. package/dist/proxy/anthropic-adapter.js.map +1 -1
  46. package/dist/proxy/server.d.ts.map +1 -1
  47. package/dist/proxy/server.js +1 -1
  48. package/dist/proxy/server.js.map +1 -1
  49. package/dist/sdk/api.js +1 -1
  50. package/dist/sdk/database.js +1 -1
  51. package/dist/sdk/errors.d.ts +3 -1
  52. package/dist/sdk/errors.d.ts.map +1 -1
  53. package/dist/sdk/errors.js +1 -1
  54. package/dist/sdk/errors.js.map +1 -1
  55. package/dist/sdk/index.js +1 -1
  56. package/dist/sdk/job.js +1 -1
  57. package/dist/sdk/llm.js +1 -1
  58. package/dist/sdk/query.js +1 -1
  59. package/dist/sdk/segment.js +1 -1
  60. package/dist/sdk/table.js +1 -1
  61. package/dist/sdk/workflow.js +1 -1
  62. package/dist/types/endpoints.js +1 -1
  63. package/dist/types/index.js +1 -1
  64. package/dist/utils/agent-ref-parser.js +1 -1
  65. package/dist/utils/chat-cache.js +1 -1
  66. package/dist/utils/colors.js +1 -1
  67. package/dist/utils/command-output.js +1 -1
  68. package/dist/utils/file-permissions.js +1 -1
  69. package/dist/utils/format-detector.js +1 -1
  70. package/dist/utils/formatters.js +1 -1
  71. package/dist/utils/json-loader.js +1 -1
  72. package/dist/utils/model-aliases.js +1 -1
  73. package/dist/utils/option-validation.js +1 -1
  74. package/dist/utils/port.js +1 -1
  75. package/dist/utils/process.js +1 -1
  76. package/dist/utils/prompt.js +1 -1
  77. package/dist/utils/segment-path-parser.js +1 -1
  78. package/dist/utils/segment-ref-parser.js +1 -1
  79. package/dist/utils/spinner.js +1 -1
  80. package/dist/utils/sql-parser.js +1 -1
  81. package/dist/utils/sse-parser.js +1 -1
  82. package/dist/utils/string-utils.js +1 -1
  83. package/dist/utils/table-ref-parser.js +1 -1
  84. package/dist/utils/tree-formatter.js +1 -1
  85. package/dist/utils/version-check.js +1 -1
  86. package/dist/utils/workflow-utils.js +1 -1
  87. package/package.json +1 -1
@@ -1 +1 @@
1
- const a12_0x1eeea5=a12_0x3b4d;function a12_0x3b4d(_0x343165,_0x455585){const _0x248f7e=a12_0x248f();return a12_0x3b4d=function(_0x3b4d35,_0x48bc16){_0x3b4d35=_0x3b4d35-0xfd;let _0x240077=_0x248f7e[_0x3b4d35];return _0x240077;},a12_0x3b4d(_0x343165,_0x455585);}(function(_0x27c2b0,_0x52c854){const _0x5469b3=a12_0x3b4d,_0x2b4a56=_0x27c2b0();while(!![]){try{const _0x5b8423=-parseInt(_0x5469b3(0x11d))/0x1+-parseInt(_0x5469b3(0x108))/0x2+-parseInt(_0x5469b3(0x10a))/0x3*(parseInt(_0x5469b3(0x105))/0x4)+parseInt(_0x5469b3(0x118))/0x5*(parseInt(_0x5469b3(0x115))/0x6)+-parseInt(_0x5469b3(0x114))/0x7+-parseInt(_0x5469b3(0x11c))/0x8+parseInt(_0x5469b3(0x107))/0x9;if(_0x5b8423===_0x52c854)break;else _0x2b4a56['push'](_0x2b4a56['shift']());}catch(_0x5f2d34){_0x2b4a56['push'](_0x2b4a56['shift']());}}}(a12_0x248f,0x7b4a2));import{validateLimitOption}from'../utils/option-validation.js';export class BaseCommand{['validateGlobalOptions'](_0xfeccb6){const _0x7af07d=a12_0x3b4d,{options:_0x5e707f}=_0xfeccb6,_0x2a2a50=_0x5e707f[_0x7af07d(0xfe)],_0x1d2e9d=_0x2a2a50!==undefined?typeof _0x2a2a50===_0x7af07d(0x10f)?_0x2a2a50:parseInt(_0x2a2a50,0xa):0x28;if(isNaN(_0x1d2e9d))return _0x7af07d(0xff)+_0x2a2a50+_0x7af07d(0x100);const _0x11eef8=validateLimitOption(_0x1d2e9d);if(!_0x11eef8[_0x7af07d(0x11f)])return _0x11eef8[_0x7af07d(0x11e)];return _0xfeccb6[_0x7af07d(0x106)][_0x7af07d(0xfe)]=_0x11eef8[_0x7af07d(0x113)],undefined;}[a12_0x1eeea5(0x10b)](_0x10db08){return undefined;}async[a12_0x1eeea5(0x101)](_0x30a9c5){const _0x5dd2e4=a12_0x1eeea5;try{const _0x4e9c3a=this[_0x5dd2e4(0x103)](_0x30a9c5);if(_0x4e9c3a)return console[_0x5dd2e4(0x11e)](_0x5dd2e4(0x10d)+_0x4e9c3a),0x1;const _0x1616cd=this['validate'](_0x30a9c5);if(_0x1616cd){const _0xb7a10b=/^\s*(Usage|Note|Warning|Error):/i[_0x5dd2e4(0x111)](_0x1616cd);return _0xb7a10b?console[_0x5dd2e4(0x11e)](_0x1616cd):console[_0x5dd2e4(0x11e)](_0x5dd2e4(0x10d)+_0x1616cd),0x1;}const _0x295b04=await this['execute'](_0x30a9c5);return _0x295b04??0x0;}catch(_0x33469f){if(_0x33469f instanceof Error){console['error'](_0x5dd2e4(0x10d)+_0x33469f[_0x5dd2e4(0x10c)]);const _0x4fc04b=_0x33469f;_0x4fc04b[_0x5dd2e4(0x104)]&&console[_0x5dd2e4(0x11e)](_0x4fc04b[_0x5dd2e4(0x104)]),_0x33469f[_0x5dd2e4(0x11a)]&&console[_0x5dd2e4(0x11e)](_0x5dd2e4(0x119)+_0x33469f[_0x5dd2e4(0x11a)]);}else console[_0x5dd2e4(0x11e)]('Error:\x20'+String(_0x33469f));return 0x1;}}}export class CommandRegistry{[a12_0x1eeea5(0x117)]=new Map();[a12_0x1eeea5(0x109)](_0x2ce569){const _0xf3eee7=a12_0x1eeea5;if(this['commands'][_0xf3eee7(0x102)](_0x2ce569[_0xf3eee7(0x11b)]))throw new Error(_0xf3eee7(0xfd)+_0x2ce569['name']+_0xf3eee7(0x112));this[_0xf3eee7(0x117)]['set'](_0x2ce569['name'],_0x2ce569);}['get'](_0x5da911){const _0x45d3c2=a12_0x1eeea5;return this['commands'][_0x45d3c2(0x10e)](_0x5da911);}[a12_0x1eeea5(0x110)](){const _0x22738b=a12_0x1eeea5;return Array['from'](this[_0x22738b(0x117)][_0x22738b(0x116)]());}[a12_0x1eeea5(0x102)](_0x13791c){const _0x48e05c=a12_0x1eeea5;return this[_0x48e05c(0x117)][_0x48e05c(0x102)](_0x13791c);}}function a12_0x248f(){const _0x2efacc=['\x0aStack\x20trace:\x0a','stack','name','6348184FzBFqU','857727uZqOeY','error','isValid','Command\x20\x27','limit','Invalid\x20limit\x20value:\x20','.\x20Must\x20be\x20a\x20number.','run','has','validateGlobalOptions','helpText','8usQEsh','options','31374855UBvQHN','790936egnBUz','register','217428ldeOwm','validate','message','Error:\x20','get','number','getAll','test','\x27\x20is\x20already\x20registered','value','6326523Bmqmvc','6aypXdB','values','commands','571790Ysscpi'];a12_0x248f=function(){return _0x2efacc;};return a12_0x248f();}export const registry=new CommandRegistry();
1
+ const a12_0x113060=a12_0x5452;function a12_0x5452(_0x5dc0dd,_0xfd6356){const _0xe4d47b=a12_0xe4d4();return a12_0x5452=function(_0x54528c,_0x266cbd){_0x54528c=_0x54528c-0x1e7;let _0x1c70c7=_0xe4d47b[_0x54528c];return _0x1c70c7;},a12_0x5452(_0x5dc0dd,_0xfd6356);}(function(_0x5255dc,_0x2e2392){const _0x174229=a12_0x5452,_0xc73c9a=_0x5255dc();while(!![]){try{const _0x3e1ed7=-parseInt(_0x174229(0x203))/0x1+parseInt(_0x174229(0x201))/0x2*(parseInt(_0x174229(0x1ea))/0x3)+parseInt(_0x174229(0x1fb))/0x4+parseInt(_0x174229(0x1e7))/0x5+-parseInt(_0x174229(0x1f2))/0x6+parseInt(_0x174229(0x1ec))/0x7*(parseInt(_0x174229(0x1ef))/0x8)+parseInt(_0x174229(0x1f8))/0x9*(-parseInt(_0x174229(0x204))/0xa);if(_0x3e1ed7===_0x2e2392)break;else _0xc73c9a['push'](_0xc73c9a['shift']());}catch(_0x2373a4){_0xc73c9a['push'](_0xc73c9a['shift']());}}}(a12_0xe4d4,0x6d9e2));import{validateLimitOption}from'../utils/option-validation.js';function a12_0xe4d4(){const _0x1e2c62=['limit','validateGlobalOptions','328710hDABBO','register','run','Invalid\x20limit\x20value:\x20','get','\x27\x20is\x20already\x20registered','12430458DjYWdQ','name','execute','2901204GBYixT','value','options','Error:\x20','error','commands','2mqELNj','validate','359136Nkpomd','10HqMTVg','.\x20Must\x20be\x20a\x20number.','values','Command\x20\x27','1234455FnPibX','\x0aStack\x20trace:\x0a','stack','2537745mozlHh','has','63EwRQnY','helpText','set','378640MOlRmg'];a12_0xe4d4=function(){return _0x1e2c62;};return a12_0xe4d4();}export class BaseCommand{[a12_0x113060(0x1f1)](_0x59fce2){const _0x329aa7=a12_0x113060,{options:_0x20b24c}=_0x59fce2,_0x22c544=_0x20b24c['limit'],_0x5ecd2f=_0x22c544!==undefined?typeof _0x22c544==='number'?_0x22c544:parseInt(_0x22c544,0xa):0x28;if(isNaN(_0x5ecd2f))return _0x329aa7(0x1f5)+_0x22c544+_0x329aa7(0x205);const _0x5332f4=validateLimitOption(_0x5ecd2f);if(!_0x5332f4['isValid'])return _0x5332f4[_0x329aa7(0x1ff)];return _0x59fce2[_0x329aa7(0x1fd)][_0x329aa7(0x1f0)]=_0x5332f4[_0x329aa7(0x1fc)],undefined;}[a12_0x113060(0x202)](_0x4a022c){return undefined;}async[a12_0x113060(0x1f4)](_0x25d44e){const _0x53f8c4=a12_0x113060;try{const _0x4fda90=this[_0x53f8c4(0x1f1)](_0x25d44e);if(_0x4fda90)return console[_0x53f8c4(0x1ff)](_0x53f8c4(0x1fe)+_0x4fda90),0x1;const _0x2ea056=this[_0x53f8c4(0x202)](_0x25d44e);if(_0x2ea056){const _0x5eaccf=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x2ea056);return _0x5eaccf?console['error'](_0x2ea056):console['error'](_0x53f8c4(0x1fe)+_0x2ea056),0x1;}const _0x5b8a9a=await this[_0x53f8c4(0x1fa)](_0x25d44e);return _0x5b8a9a??0x0;}catch(_0x10b31e){if(_0x10b31e instanceof Error){console[_0x53f8c4(0x1ff)](_0x53f8c4(0x1fe)+_0x10b31e['message']);const _0x464e7c=_0x10b31e;_0x464e7c[_0x53f8c4(0x1ed)]&&console[_0x53f8c4(0x1ff)](_0x464e7c[_0x53f8c4(0x1ed)]),_0x10b31e[_0x53f8c4(0x1e9)]&&console[_0x53f8c4(0x1ff)](_0x53f8c4(0x1e8)+_0x10b31e[_0x53f8c4(0x1e9)]);}else console[_0x53f8c4(0x1ff)](_0x53f8c4(0x1fe)+String(_0x10b31e));return 0x1;}}}export class CommandRegistry{[a12_0x113060(0x200)]=new Map();[a12_0x113060(0x1f3)](_0xe0d438){const _0x28d6cf=a12_0x113060;if(this['commands'][_0x28d6cf(0x1eb)](_0xe0d438['name']))throw new Error(_0x28d6cf(0x207)+_0xe0d438[_0x28d6cf(0x1f9)]+_0x28d6cf(0x1f7));this[_0x28d6cf(0x200)][_0x28d6cf(0x1ee)](_0xe0d438[_0x28d6cf(0x1f9)],_0xe0d438);}[a12_0x113060(0x1f6)](_0x52f8c0){const _0x1f4ae1=a12_0x113060;return this[_0x1f4ae1(0x200)]['get'](_0x52f8c0);}['getAll'](){const _0xaf4905=a12_0x113060;return Array['from'](this[_0xaf4905(0x200)][_0xaf4905(0x206)]());}[a12_0x113060(0x1eb)](_0x3cb48b){const _0x3aff92=a12_0x113060;return this[_0x3aff92(0x200)][_0x3aff92(0x1eb)](_0x3cb48b);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x44349d=a13_0x4121;(function(_0x464ec5,_0x7f22d0){const _0x516140=a13_0x4121,_0xaf25d0=_0x464ec5();while(!![]){try{const _0x50145d=-parseInt(_0x516140(0x97))/0x1*(-parseInt(_0x516140(0x95))/0x2)+parseInt(_0x516140(0x8e))/0x3+parseInt(_0x516140(0x8c))/0x4+parseInt(_0x516140(0x94))/0x5*(parseInt(_0x516140(0x8d))/0x6)+parseInt(_0x516140(0x9d))/0x7*(-parseInt(_0x516140(0x91))/0x8)+-parseInt(_0x516140(0x99))/0x9+-parseInt(_0x516140(0x9b))/0xa*(parseInt(_0x516140(0xa2))/0xb);if(_0x50145d===_0x7f22d0)break;else _0xaf25d0['push'](_0xaf25d0['shift']());}catch(_0xbde4e5){_0xaf25d0['push'](_0xaf25d0['shift']());}}}(a13_0x37a9,0x5de04));import{BaseCommand}from'./command.js';function a13_0x37a9(){const _0x270b08=['session','1927120AImURR','2953728UbAcoI','2014863HIHkfM','name','debug','1811192XwBbZl','toString','displayWithSources','5jVuYXU','516554MAcWgB','description','2wgcezz','log','2882952qNjqYs','message','3348670XxOQwq','Error:\x20','14kpJeEk','Session\x20context\x20cleared\x20(session:\x20','clear','display','error','33GPQTgC','context'];a13_0x37a9=function(){return _0x270b08;};return a13_0x37a9();}function a13_0x4121(_0x2b2160,_0x4628ee){const _0x37a9b1=a13_0x37a9();return a13_0x4121=function(_0x41217e,_0x14e653){_0x41217e=_0x41217e-0x8a;let _0x36ded6=_0x37a9b1[_0x41217e];return _0x36ded6;},a13_0x4121(_0x2b2160,_0x4628ee);}import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';export class ContextCommand extends BaseCommand{[a13_0x44349d(0x8f)]=a13_0x44349d(0x8a);[a13_0x44349d(0x96)]='Show\x20current\x20resolved\x20context';async['execute'](_0x4494d9){const _0x315b07=a13_0x44349d,{options:_0x456623}=_0x4494d9,_0x3a2ce7=_0x456623[_0x315b07(0x90)],_0x1d1b9e=_0x456623[_0x315b07(0x9f)];cleanExpiredSessions();try{if(_0x1d1b9e){clearSessionContext(_0x456623[_0x315b07(0x8b)]);const _0x12b4d5=_0x456623[_0x315b07(0x8b)]||getCurrentSessionPID()[_0x315b07(0x92)]();return console[_0x315b07(0x98)](_0x315b07(0x9e)+_0x12b4d5+')'),0x0;}const _0xedaf6=new GlobalContext(_0x456623);return _0x3a2ce7?_0xedaf6[_0x315b07(0x93)]():_0xedaf6[_0x315b07(0xa0)](),0x0;}catch(_0x1d29b2){return _0x1d29b2 instanceof Error&&console[_0x315b07(0xa1)](_0x315b07(0x9c)+_0x1d29b2[_0x315b07(0x9a)]),0x1;}}}
1
+ const a13_0x35e752=a13_0x5dfe;(function(_0x63f608,_0x133b0c){const _0xacc15e=a13_0x5dfe,_0x432707=_0x63f608();while(!![]){try{const _0x3b3f66=parseInt(_0xacc15e(0x12e))/0x1+-parseInt(_0xacc15e(0x132))/0x2+-parseInt(_0xacc15e(0x12c))/0x3+-parseInt(_0xacc15e(0x12b))/0x4+-parseInt(_0xacc15e(0x127))/0x5+parseInt(_0xacc15e(0x130))/0x6+-parseInt(_0xacc15e(0x131))/0x7*(-parseInt(_0xacc15e(0x126))/0x8);if(_0x3b3f66===_0x133b0c)break;else _0x432707['push'](_0x432707['shift']());}catch(_0x345964){_0x432707['push'](_0x432707['shift']());}}}(a13_0x3a56,0x9a83e));function a13_0x5dfe(_0x15acc,_0x116a20){const _0x3a56e4=a13_0x3a56();return a13_0x5dfe=function(_0x5dfe1d,_0x4e7748){_0x5dfe1d=_0x5dfe1d-0x124;let _0x3da945=_0x3a56e4[_0x5dfe1d];return _0x3da945;},a13_0x5dfe(_0x15acc,_0x116a20);}import{BaseCommand}from'./command.js';function a13_0x3a56(){const _0x2edaa0=['1946gNAbAU','1510378hOqBoR','session','name','message','log','35760JgGcWS','2032265HeQHUx','description','context','clear','1358352Fknbbs','447087qGkNEB','displayWithSources','813775zJsREL','display','1360308CxEnvN'];a13_0x3a56=function(){return _0x2edaa0;};return a13_0x3a56();}import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';export class ContextCommand extends BaseCommand{[a13_0x35e752(0x134)]=a13_0x35e752(0x129);[a13_0x35e752(0x128)]='Show\x20current\x20resolved\x20context';async['execute'](_0x241347){const _0x366dcb=a13_0x35e752,{options:_0x47c180}=_0x241347,_0x171c41=_0x47c180['debug'],_0x5e1e31=_0x47c180[_0x366dcb(0x12a)];cleanExpiredSessions();try{if(_0x5e1e31){clearSessionContext(_0x47c180[_0x366dcb(0x133)]);const _0x397854=_0x47c180[_0x366dcb(0x133)]||getCurrentSessionPID()['toString']();return console[_0x366dcb(0x125)]('Session\x20context\x20cleared\x20(session:\x20'+_0x397854+')'),0x0;}const _0x202f41=new GlobalContext(_0x47c180);return _0x171c41?_0x202f41[_0x366dcb(0x12d)]():_0x202f41[_0x366dcb(0x12f)](),0x0;}catch(_0x443a67){return _0x443a67 instanceof Error&&console['error']('Error:\x20'+_0x443a67[_0x366dcb(0x124)]),0x1;}}}
@@ -1 +1 @@
1
- const a14_0x18eb3e=a14_0x3165;(function(_0x434f21,_0x554d7b){const _0x4f8ae7=a14_0x3165,_0x33770b=_0x434f21();while(!![]){try{const _0x13dea1=-parseInt(_0x4f8ae7(0x196))/0x1*(-parseInt(_0x4f8ae7(0x199))/0x2)+-parseInt(_0x4f8ae7(0x180))/0x3+-parseInt(_0x4f8ae7(0x186))/0x4*(-parseInt(_0x4f8ae7(0x18e))/0x5)+parseInt(_0x4f8ae7(0x18c))/0x6*(-parseInt(_0x4f8ae7(0x191))/0x7)+parseInt(_0x4f8ae7(0x194))/0x8+parseInt(_0x4f8ae7(0x18f))/0x9*(-parseInt(_0x4f8ae7(0x185))/0xa)+parseInt(_0x4f8ae7(0x184))/0xb;if(_0x13dea1===_0x554d7b)break;else _0x33770b['push'](_0x33770b['shift']());}catch(_0xc062bd){_0x33770b['push'](_0x33770b['shift']());}}}(a14_0xefcc,0x8b883));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a14_0xefcc(){const _0x59c60a=['Listing\x20databases...','10457799mqIyft','10jcBwaH','2468pQZDIf','Site:\x20','name','\x20database','cause','\x20\x20Cause:\x20','227334sEmWBp','✔\x20Found\x20','1660CYpZTn','7043562JFUdOb','List\x20all\x20databases','140UGjbqD','verbose','databases','5228456HByyBz','error','50808vXBMUz','database','message','14xvxHie','158535MGQMKt','Error:\x20','length'];a14_0xefcc=function(){return _0x59c60a;};return a14_0xefcc();}function a14_0x3165(_0xf95f9a,_0x57ec33){const _0xefcc5f=a14_0xefcc();return a14_0x3165=function(_0x3165e7,_0x40ffbb){_0x3165e7=_0x3165e7-0x180;let _0x4653e5=_0xefcc5f[_0x3165e7];return _0x4653e5;},a14_0x3165(_0xf95f9a,_0x57ec33);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class DatabasesCommand extends BaseCommand{[a14_0x18eb3e(0x188)]=a14_0x18eb3e(0x193);['description']=a14_0x18eb3e(0x190);async['execute'](_0x5a164c){const _0xeda5b3=a14_0x18eb3e,{options:_0x452f1f,args:_0x28efab,tdx:_0x2fea39}=_0x5a164c,_0x1712a2=_0x28efab[0x0];try{_0x452f1f[_0xeda5b3(0x192)]&&(console['error'](_0xeda5b3(0x187)+_0x452f1f['site']),_0x1712a2&&console[_0xeda5b3(0x195)]('Pattern:\x20'+_0x1712a2));const _0x2a362e=await withSpinner(_0xeda5b3(0x183),()=>_0x2fea39[_0xeda5b3(0x197)]['list'](_0x1712a2),{'verbose':_0x452f1f['verbose']}),_0x2a269a=_0x2a362e['data'];return console['error'](_0xeda5b3(0x18d)+_0x2a269a['length']+_0xeda5b3(0x189)+(_0x2a269a[_0xeda5b3(0x182)]!==0x1?'s':'')),await handleSDKOutput(_0x2a269a,_0x452f1f),0x0;}catch(_0x5cc733){if(_0x5cc733 instanceof SDKError)return console[_0xeda5b3(0x195)](_0xeda5b3(0x181)+_0x5cc733[_0xeda5b3(0x198)]),_0x5cc733[_0xeda5b3(0x18a)]&&console[_0xeda5b3(0x195)](_0xeda5b3(0x18b)+_0x5cc733[_0xeda5b3(0x18a)]),0x1;throw _0x5cc733;}}}
1
+ const a14_0x36d19b=a14_0x45cb;(function(_0x373351,_0x20fb70){const _0x2ab4f6=a14_0x45cb,_0xc18c4b=_0x373351();while(!![]){try{const _0x1e5606=-parseInt(_0x2ab4f6(0x1b5))/0x1+parseInt(_0x2ab4f6(0x1ad))/0x2*(parseInt(_0x2ab4f6(0x1a4))/0x3)+-parseInt(_0x2ab4f6(0x1a7))/0x4+parseInt(_0x2ab4f6(0x1a3))/0x5+-parseInt(_0x2ab4f6(0x1a5))/0x6*(parseInt(_0x2ab4f6(0x1a1))/0x7)+-parseInt(_0x2ab4f6(0x1b2))/0x8*(-parseInt(_0x2ab4f6(0x1a2))/0x9)+-parseInt(_0x2ab4f6(0x1b7))/0xa*(-parseInt(_0x2ab4f6(0x1ae))/0xb);if(_0x1e5606===_0x20fb70)break;else _0xc18c4b['push'](_0xc18c4b['shift']());}catch(_0x14fb34){_0xc18c4b['push'](_0xc18c4b['shift']());}}}(a14_0x5e67,0x35a9a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a14_0x5e67(){const _0xbcc072=['\x20\x20Cause:\x20','verbose','460236omduHj','5085NDrPxC','1638385rnixFh','3bKSruf','36itExGm','Error:\x20','1429636zFURDe','list','length','databases','✔\x20Found\x20','Site:\x20','314438aWQfcv','649huwPTA','name','Listing\x20databases...','database','4232vKeiEY','error','cause','301251CRWUFN','List\x20all\x20databases','82910iBgWVo','execute','message'];a14_0x5e67=function(){return _0xbcc072;};return a14_0x5e67();}import{withSpinner}from'../utils/spinner.js';function a14_0x45cb(_0x5e8427,_0x2194b0){const _0x5e67e1=a14_0x5e67();return a14_0x45cb=function(_0x45cb41,_0x2d42b8){_0x45cb41=_0x45cb41-0x1a0;let _0x185f23=_0x5e67e1[_0x45cb41];return _0x185f23;},a14_0x45cb(_0x5e8427,_0x2194b0);}export class DatabasesCommand extends BaseCommand{[a14_0x36d19b(0x1af)]=a14_0x36d19b(0x1aa);['description']=a14_0x36d19b(0x1b6);async[a14_0x36d19b(0x1b8)](_0x43ab31){const _0x662272=a14_0x36d19b,{options:_0x18dc8b,args:_0x5a9e8b,tdx:_0xb0714}=_0x43ab31,_0x25cfe0=_0x5a9e8b[0x0];try{_0x18dc8b[_0x662272(0x1a0)]&&(console['error'](_0x662272(0x1ac)+_0x18dc8b['site']),_0x25cfe0&&console[_0x662272(0x1b3)]('Pattern:\x20'+_0x25cfe0));const _0x4f8cd9=await withSpinner(_0x662272(0x1b0),()=>_0xb0714[_0x662272(0x1b1)][_0x662272(0x1a8)](_0x25cfe0),{'verbose':_0x18dc8b[_0x662272(0x1a0)]}),_0x30cf94=_0x4f8cd9['data'];return console['error'](_0x662272(0x1ab)+_0x30cf94[_0x662272(0x1a9)]+'\x20database'+(_0x30cf94[_0x662272(0x1a9)]!==0x1?'s':'')),await handleSDKOutput(_0x30cf94,_0x18dc8b),0x0;}catch(_0x3a95e4){if(_0x3a95e4 instanceof SDKError)return console[_0x662272(0x1b3)](_0x662272(0x1a6)+_0x3a95e4[_0x662272(0x1b9)]),_0x3a95e4['cause']&&console[_0x662272(0x1b3)](_0x662272(0x1ba)+_0x3a95e4[_0x662272(0x1b4)]),0x1;throw _0x3a95e4;}}}
@@ -1 +1 @@
1
- function a15_0x3cf1(_0x26de7d,_0x28442f){const _0x5add67=a15_0x5add();return a15_0x3cf1=function(_0x3cf1b8,_0xbf44f5){_0x3cf1b8=_0x3cf1b8-0x6c;let _0x24205a=_0x5add67[_0x3cf1b8];return _0x24205a;},a15_0x3cf1(_0x26de7d,_0x28442f);}const a15_0x1706a3=a15_0x3cf1;(function(_0x53b008,_0x117ec6){const _0x36ee83=a15_0x3cf1,_0x51b704=_0x53b008();while(!![]){try{const _0x755f68=-parseInt(_0x36ee83(0x6d))/0x1*(parseInt(_0x36ee83(0x89))/0x2)+-parseInt(_0x36ee83(0x70))/0x3+-parseInt(_0x36ee83(0x72))/0x4+parseInt(_0x36ee83(0x82))/0x5+-parseInt(_0x36ee83(0x7b))/0x6+-parseInt(_0x36ee83(0x80))/0x7*(-parseInt(_0x36ee83(0x6e))/0x8)+parseInt(_0x36ee83(0x8d))/0x9;if(_0x755f68===_0x117ec6)break;else _0x51b704['push'](_0x51b704['shift']());}catch(_0x4e2c11){_0x51b704['push'](_0x51b704['shift']());}}}(a15_0x5add,0x723c8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a15_0x5add(){const _0x1cbbbd=['Site:\x20','database','Error:\x20','description','66CCjzYZ','Database:\x20','\x20\x20Cause:\x20','validate','19237014WskbOK','...','22276ORjWQL','248EEadDH','Table:\x20','1975857CVEOxC','site','3077672JGEhOo','data','args','length','verbose','error','message','table','Describe\x20table\x20schema','2090994aBYatZ','Describing\x20table\x20','name','✔\x20Found\x20','describeTable','141239XWrCXh','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','1083115lRbPwA','describe','cause'];a15_0x5add=function(){return _0x1cbbbd;};return a15_0x5add();}export class DescribeCommand extends BaseCommand{[a15_0x1706a3(0x7d)]='describe';[a15_0x1706a3(0x88)]=a15_0x1706a3(0x7a);async['execute'](_0x35c356){const _0x2b9350=a15_0x1706a3;return this[_0x2b9350(0x7f)](_0x35c356);}async[a15_0x1706a3(0x7f)](_0x44c3f8){const _0x50fbb8=a15_0x1706a3,{options:_0x35c7fd,args:_0x516b1b,tdx:_0x5bf67c}=_0x44c3f8;let _0x403049;try{_0x403049=parseTableReference(_0x516b1b[0x0]);const _0x115ac9=_0x35c7fd[_0x50fbb8(0x86)];!_0x403049[_0x50fbb8(0x86)]&&_0x115ac9&&(_0x403049[_0x50fbb8(0x86)]=_0x115ac9);const _0x557ba7=validateTableDescribeReference(_0x403049);if(_0x557ba7)return console['error']('Error:\x20'+_0x557ba7),0x1;}catch(_0x233527){return console[_0x50fbb8(0x77)](_0x50fbb8(0x87)+_0x233527[_0x50fbb8(0x78)]),0x1;}const _0x315f91=_0x403049[_0x50fbb8(0x86)],_0x33715d=_0x403049['table'];try{_0x35c7fd['verbose']&&(console[_0x50fbb8(0x77)](_0x50fbb8(0x85)+_0x35c7fd[_0x50fbb8(0x71)]),console[_0x50fbb8(0x77)](_0x50fbb8(0x8a)+_0x315f91),console[_0x50fbb8(0x77)](_0x50fbb8(0x6f)+_0x33715d));const _0x4c40a8=await withSpinner(_0x50fbb8(0x7c)+_0x315f91+'.'+_0x33715d+_0x50fbb8(0x6c),()=>_0x5bf67c[_0x50fbb8(0x79)][_0x50fbb8(0x83)](_0x315f91,_0x33715d),{'verbose':_0x35c7fd[_0x50fbb8(0x76)]}),_0x12da88=_0x4c40a8[_0x50fbb8(0x73)];if(_0x12da88[_0x50fbb8(0x75)]===0x0)return console['error']('✖\x20Table\x20not\x20found'),console[_0x50fbb8(0x77)]('Table\x20\x27'+_0x315f91+'.'+_0x33715d+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x50fbb8(0x77)](_0x50fbb8(0x7e)+_0x12da88[_0x50fbb8(0x75)]+'\x20column'+(_0x12da88[_0x50fbb8(0x75)]!==0x1?'s':'')+'\x20in\x20'+_0x315f91+'.'+_0x33715d),await handleSDKOutput(_0x12da88,_0x35c7fd),0x0;}catch(_0x49b7bd){if(_0x49b7bd instanceof SDKError)return console[_0x50fbb8(0x77)](_0x50fbb8(0x87)+_0x49b7bd[_0x50fbb8(0x78)]),_0x49b7bd[_0x50fbb8(0x84)]&&console['error'](_0x50fbb8(0x8b)+_0x49b7bd['cause']),0x1;throw _0x49b7bd;}}[a15_0x1706a3(0x8c)](_0x217802){const _0x367d76=a15_0x1706a3;if(_0x217802[_0x367d76(0x74)]['length']===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x217802[_0x367d76(0x74)][_0x367d76(0x75)]>0x1)return _0x367d76(0x81);return undefined;}}
1
+ const a15_0x35b090=a15_0x2b88;(function(_0x9560c,_0x43e883){const _0x313a3f=a15_0x2b88,_0x3eac40=_0x9560c();while(!![]){try{const _0x947982=parseInt(_0x313a3f(0x171))/0x1*(-parseInt(_0x313a3f(0x15b))/0x2)+parseInt(_0x313a3f(0x168))/0x3+parseInt(_0x313a3f(0x173))/0x4*(parseInt(_0x313a3f(0x166))/0x5)+parseInt(_0x313a3f(0x161))/0x6+parseInt(_0x313a3f(0x16e))/0x7*(-parseInt(_0x313a3f(0x162))/0x8)+-parseInt(_0x313a3f(0x159))/0x9*(-parseInt(_0x313a3f(0x170))/0xa)+-parseInt(_0x313a3f(0x156))/0xb*(parseInt(_0x313a3f(0x15a))/0xc);if(_0x947982===_0x43e883)break;else _0x3eac40['push'](_0x3eac40['shift']());}catch(_0x38b917){_0x3eac40['push'](_0x3eac40['shift']());}}}(a15_0x55e8,0xb70a7));import{BaseCommand}from'./command.js';function a15_0x2b88(_0x1a71fa,_0x389ef6){const _0x55e8b2=a15_0x55e8();return a15_0x2b88=function(_0x2b88d6,_0x203edf){_0x2b88d6=_0x2b88d6-0x154;let _0x301c2e=_0x55e8b2[_0x2b88d6];return _0x301c2e;},a15_0x2b88(_0x1a71fa,_0x389ef6);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x35b090(0x16c)]=a15_0x35b090(0x160);[a15_0x35b090(0x175)]='Describe\x20table\x20schema';async[a15_0x35b090(0x16a)](_0x384f3c){const _0xfafdbb=a15_0x35b090;return this[_0xfafdbb(0x167)](_0x384f3c);}async[a15_0x35b090(0x167)](_0x6bdac5){const _0x3c7fce=a15_0x35b090,{options:_0x1da95d,args:_0x1974ae,tdx:_0x411bfa}=_0x6bdac5;let _0x3250b9;try{_0x3250b9=parseTableReference(_0x1974ae[0x0]);const _0x51b40e=_0x1da95d['database'];!_0x3250b9['database']&&_0x51b40e&&(_0x3250b9['database']=_0x51b40e);const _0x3a4105=validateTableDescribeReference(_0x3250b9);if(_0x3a4105)return console['error']('Error:\x20'+_0x3a4105),0x1;}catch(_0x2a5cf0){return console[_0x3c7fce(0x174)](_0x3c7fce(0x163)+_0x2a5cf0[_0x3c7fce(0x164)]),0x1;}const _0xe5fce0=_0x3250b9['database'],_0xb95c99=_0x3250b9[_0x3c7fce(0x16d)];try{_0x1da95d['verbose']&&(console['error'](_0x3c7fce(0x154)+_0x1da95d[_0x3c7fce(0x155)]),console[_0x3c7fce(0x174)]('Database:\x20'+_0xe5fce0),console[_0x3c7fce(0x174)]('Table:\x20'+_0xb95c99));const _0x27b2ed=await withSpinner(_0x3c7fce(0x15d)+_0xe5fce0+'.'+_0xb95c99+'...',()=>_0x411bfa[_0x3c7fce(0x16d)]['describe'](_0xe5fce0,_0xb95c99),{'verbose':_0x1da95d[_0x3c7fce(0x16f)]}),_0x2ca4e2=_0x27b2ed[_0x3c7fce(0x157)];if(_0x2ca4e2[_0x3c7fce(0x158)]===0x0)return console[_0x3c7fce(0x174)]('✖\x20Table\x20not\x20found'),console[_0x3c7fce(0x174)](_0x3c7fce(0x176)+_0xe5fce0+'.'+_0xb95c99+_0x3c7fce(0x15c)),0x1;return console[_0x3c7fce(0x174)](_0x3c7fce(0x172)+_0x2ca4e2[_0x3c7fce(0x158)]+_0x3c7fce(0x16b)+(_0x2ca4e2[_0x3c7fce(0x158)]!==0x1?'s':'')+_0x3c7fce(0x169)+_0xe5fce0+'.'+_0xb95c99),await handleSDKOutput(_0x2ca4e2,_0x1da95d),0x0;}catch(_0xa04424){if(_0xa04424 instanceof SDKError)return console[_0x3c7fce(0x174)](_0x3c7fce(0x163)+_0xa04424[_0x3c7fce(0x164)]),_0xa04424[_0x3c7fce(0x177)]&&console[_0x3c7fce(0x174)](_0x3c7fce(0x165)+_0xa04424[_0x3c7fce(0x177)]),0x1;throw _0xa04424;}}[a15_0x35b090(0x178)](_0x725e1f){const _0xac884f=a15_0x35b090;if(_0x725e1f[_0xac884f(0x15e)]['length']===0x0)return _0xac884f(0x15f);if(_0x725e1f['args']['length']>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';return undefined;}}function a15_0x55e8(){const _0x4d59f7=['cause','validate','Site:\x20','site','11ktKmHY','data','length','45zyrzET','5957364BNGehL','8624gvPVMd','\x27\x20does\x20not\x20exist','Describing\x20table\x20','args','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','describe','1653456XYGpcA','368VudSrw','Error:\x20','message','\x20\x20Cause:\x20','638840GwGuNS','describeTable','829818jOyFDL','\x20in\x20','execute','\x20column','name','table','204757wIOpxl','verbose','2328020pOLDWA','34rhpoLV','✔\x20Found\x20','32DqOSeh','error','description','Table\x20\x27'];a15_0x55e8=function(){return _0x4d59f7;};return a15_0x55e8();}
@@ -1 +1 @@
1
- const a16_0x194b6c=a16_0x4a5d;(function(_0x48db34,_0x2a00bb){const _0x21d075=a16_0x4a5d,_0x47bcff=_0x48db34();while(!![]){try{const _0x8d756e=-parseInt(_0x21d075(0x211))/0x1*(parseInt(_0x21d075(0x1e3))/0x2)+parseInt(_0x21d075(0x21e))/0x3+parseInt(_0x21d075(0x1f7))/0x4+-parseInt(_0x21d075(0x1fe))/0x5*(parseInt(_0x21d075(0x201))/0x6)+-parseInt(_0x21d075(0x1fb))/0x7*(-parseInt(_0x21d075(0x21a))/0x8)+parseInt(_0x21d075(0x1ff))/0x9+parseInt(_0x21d075(0x214))/0xa*(parseInt(_0x21d075(0x21f))/0xb);if(_0x8d756e===_0x2a00bb)break;else _0x47bcff['push'](_0x47bcff['shift']());}catch(_0x5cb545){_0x47bcff['push'](_0x47bcff['shift']());}}}(a16_0x564d,0x6f2b8));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';function a16_0x564d(){const _0x946d6d=['\x20row','job:submit','status','result','created_at','trino','url','verbose','915084dluqSj','type','message','job:result','1940953QHOmnH','getTime','Get\x20job\x20results','15cSIpCj','1481481BwFUUT','priority','1507026CAgKkY','description','Usage:\x20job\x20kill\x20<job-id>','name','...','job:kill','Error:\x20','error','list','Status\x20filter:\x20','✔\x20Job\x20submitted','Query:\x20','✔\x20Found\x20','show','\x20\x20Job\x20ID:\x20','Database:\x20','25Rhbsks','job_id','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','760yImxoF','job:show','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','kill','file','Submit\x20a\x20job','8bnzmvN','debug','jobs','execute','2614725AARmlV','23991tGTBZc','Submitting\x20job...','information_schema','cause','length','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','hive','limit','Listing\x20jobs...','database','user_name','query','Usage:\x20job\x20result\x20<job-id>','end_at','substring','submit','Getting\x20job\x20details...','Usage:\x20job\x20show\x20<job-id>','Limit:\x20','39930ysglBh','Job\x20type:\x20','\x20job','data','✔\x20Retrieved\x20','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','\x20\x20Cause:\x20','start_at','\x20jobs','Error:\x20Job\x20ID\x20is\x20required','Submitting\x20kill\x20request...'];a16_0x564d=function(){return _0x946d6d;};return a16_0x564d();}export class JobListCommand extends BaseCommand{[a16_0x194b6c(0x204)]=a16_0x194b6c(0x21c);[a16_0x194b6c(0x202)]='List\x20jobs';async[a16_0x194b6c(0x21d)](_0x87a6cd){const _0x55ff39=a16_0x194b6c,{options:_0x11868f,tdx:_0x1b290b}=_0x87a6cd;try{const _0x14f4ea=parseInt(String(_0x11868f[_0x55ff39(0x1d7)]),0xa)||0x28,_0x48c735=_0x11868f[_0x55ff39(0x1f1)];_0x11868f[_0x55ff39(0x1f6)]&&(console[_0x55ff39(0x208)](_0x55ff39(0x1e2)+_0x14f4ea+_0x55ff39(0x1ec)),_0x48c735&&console['error'](_0x55ff39(0x20a)+_0x48c735));const _0x53225b=await withSpinner(_0x55ff39(0x1d8),()=>_0x1b290b['jobs'][_0x55ff39(0x209)]({'from':0x0,'to':_0x14f4ea-0x1,'status':_0x48c735}),{'verbose':_0x11868f[_0x55ff39(0x1f6)]}),_0x216849=_0x53225b[_0x55ff39(0x1e6)];console[_0x55ff39(0x208)](_0x55ff39(0x20d)+_0x216849[_0x55ff39(0x223)]+_0x55ff39(0x1e5)+(_0x216849[_0x55ff39(0x223)]!==0x1?'s':''));const _0x130fb3=_0x216849['map'](_0x3d7e2a=>{const _0x14a644=_0x55ff39;let _0x2bb1f0;if(_0x3d7e2a[_0x14a644(0x1eb)]&&_0x3d7e2a[_0x14a644(0x1dd)]){const _0x73a69a=new Date(_0x3d7e2a['start_at'])['getTime'](),_0x2f0450=new Date(_0x3d7e2a['end_at'])[_0x14a644(0x1fc)]();_0x2bb1f0=Math['round']((_0x2f0450-_0x73a69a)/0x3e8);}return{'job_id':_0x3d7e2a[_0x14a644(0x212)],'type':_0x3d7e2a[_0x14a644(0x1f8)],'status':_0x3d7e2a[_0x14a644(0x1f1)],'user_name':_0x3d7e2a[_0x14a644(0x1da)],'duration_sec':_0x2bb1f0,'created_at':_0x3d7e2a['created_at'],'started_at':_0x3d7e2a['start_at'],'end_at':_0x3d7e2a['end_at']};});return await handleSDKOutput(_0x130fb3,_0x11868f),0x0;}catch(_0x1d81d6){if(_0x1d81d6 instanceof SDKError)return console['error']('Error:\x20'+_0x1d81d6[_0x55ff39(0x1f9)]),_0x1d81d6[_0x55ff39(0x222)]&&console[_0x55ff39(0x208)](_0x55ff39(0x1ea)+_0x1d81d6[_0x55ff39(0x222)]),0x1;throw _0x1d81d6;}}}export class JobShowCommand extends BaseCommand{[a16_0x194b6c(0x204)]=a16_0x194b6c(0x215);[a16_0x194b6c(0x202)]='Show\x20job\x20details';async[a16_0x194b6c(0x21d)](_0x4a05fe){const _0x5c69fd=a16_0x194b6c,{options:_0x2712db,args:_0x492e59,tdx:_0x4d00eb}=_0x4a05fe,_0x478594=_0x492e59[0x0];if(!_0x478594)return console[_0x5c69fd(0x208)](_0x5c69fd(0x1ed)),console[_0x5c69fd(0x208)](_0x5c69fd(0x1e1)),0x1;try{const _0x3e4eaa=await withSpinner(_0x5c69fd(0x1e0),()=>_0x4d00eb[_0x5c69fd(0x21c)][_0x5c69fd(0x20e)](_0x478594),{'verbose':_0x2712db['verbose']}),_0x47d7b9=_0x3e4eaa['data'];let _0x739954;if(_0x47d7b9[_0x5c69fd(0x1eb)]&&_0x47d7b9[_0x5c69fd(0x1dd)]){const _0x2ef7f4=new Date(_0x47d7b9[_0x5c69fd(0x1eb)])[_0x5c69fd(0x1fc)](),_0x5712b0=new Date(_0x47d7b9[_0x5c69fd(0x1dd)])[_0x5c69fd(0x1fc)]();_0x739954=Math['round']((_0x5712b0-_0x2ef7f4)/0x3e8);}const _0x3eeced={'job_id':_0x47d7b9[_0x5c69fd(0x212)],'type':_0x47d7b9[_0x5c69fd(0x1f8)],'status':_0x47d7b9['status'],..._0x47d7b9['user_name']&&{'user_name':_0x47d7b9[_0x5c69fd(0x1da)]},..._0x739954!==undefined&&{'duration_sec':_0x739954},..._0x47d7b9['created_at']&&{'created_at':_0x47d7b9[_0x5c69fd(0x1f3)]},..._0x47d7b9[_0x5c69fd(0x1eb)]&&{'started_at':_0x47d7b9[_0x5c69fd(0x1eb)]},..._0x47d7b9[_0x5c69fd(0x1dd)]&&{'end_at':_0x47d7b9['end_at']},..._0x47d7b9['database']&&{'database':_0x47d7b9[_0x5c69fd(0x1d9)]},..._0x47d7b9[_0x5c69fd(0x200)]!==undefined&&{'priority':_0x47d7b9[_0x5c69fd(0x200)]},..._0x47d7b9[_0x5c69fd(0x1f5)]&&{'url':_0x47d7b9['url']},..._0x47d7b9[_0x5c69fd(0x1db)]&&{'query':_0x47d7b9[_0x5c69fd(0x1db)]},..._0x47d7b9[_0x5c69fd(0x21b)]&&{'debug':_0x47d7b9['debug']}};return await handleSingleObjectOutput(_0x3eeced,_0x2712db),0x0;}catch(_0x5e734c){if(_0x5e734c instanceof SDKError)return console[_0x5c69fd(0x208)](_0x5c69fd(0x207)+_0x5e734c['message']),_0x5e734c['cause']&&console[_0x5c69fd(0x208)](_0x5c69fd(0x1ea)+_0x5e734c[_0x5c69fd(0x222)]),0x1;throw _0x5e734c;}}}export class JobKillCommand extends BaseCommand{[a16_0x194b6c(0x204)]=a16_0x194b6c(0x206);[a16_0x194b6c(0x202)]='Kill\x20a\x20job';async[a16_0x194b6c(0x21d)](_0x17cbdc){const _0x1bc198=a16_0x194b6c,{options:_0x4bbca9,args:_0x3749b9,tdx:_0x5071a5}=_0x17cbdc,_0x50227d=_0x3749b9[0x0];if(!_0x50227d)return console['error'](_0x1bc198(0x1ed)),console['error'](_0x1bc198(0x203)),0x1;try{if(!_0x4bbca9['yes']){const _0x1518ee=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x50227d+'?');if(!_0x1518ee)return console[_0x1bc198(0x208)]('Cancelled'),0x0;}return await withSpinner(_0x1bc198(0x1ee),()=>_0x5071a5[_0x1bc198(0x21c)][_0x1bc198(0x217)](_0x50227d),{'verbose':_0x4bbca9['verbose']}),console['error']('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x50227d),console[_0x1bc198(0x208)](_0x1bc198(0x216)+_0x50227d+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}catch(_0x247306){if(_0x247306 instanceof SDKError)return console[_0x1bc198(0x208)](_0x1bc198(0x207)+_0x247306[_0x1bc198(0x1f9)]),_0x247306[_0x1bc198(0x222)]&&console[_0x1bc198(0x208)](_0x1bc198(0x1ea)+_0x247306[_0x1bc198(0x222)]),0x1;throw _0x247306;}}}export class JobSubmitCommand extends BaseCommand{[a16_0x194b6c(0x204)]=a16_0x194b6c(0x1f0);[a16_0x194b6c(0x202)]=a16_0x194b6c(0x219);async[a16_0x194b6c(0x21d)](_0x4b7ed2){const _0x1eae23=a16_0x194b6c,{options:_0x20e9bf,args:_0x58ae0e,tdx:_0x168bfb}=_0x4b7ed2;try{const _0x280a45=_0x20e9bf['jobType']||_0x1eae23(0x1f4),_0x54a0fd=_0x20e9bf[_0x1eae23(0x218)],_0x1f986d=_0x20e9bf[_0x1eae23(0x1d9)]||_0x1eae23(0x221);if(_0x280a45!=='trino'&&_0x280a45!==_0x1eae23(0x1d6))return console['error'](_0x1eae23(0x1e8)),0x1;let _0x15a919;if(_0x54a0fd){if(_0x58ae0e[0x0])return console['error'](_0x1eae23(0x1d5)),0x1;const _0x4914dd=readSqlStatementsFromFile(_0x54a0fd);if(_0x4914dd[_0x1eae23(0x223)]===0x0)return console[_0x1eae23(0x208)](_0x1eae23(0x213)),0x1;if(_0x4914dd[_0x1eae23(0x223)]>0x1)return console[_0x1eae23(0x208)](_0x1eae23(0x1e9)),0x1;_0x15a919=_0x4914dd[0x0];}else{if(!_0x58ae0e[0x0])return console[_0x1eae23(0x208)]('Error:\x20Query\x20is\x20required'),console[_0x1eae23(0x208)]('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x15a919=_0x58ae0e[0x0];}_0x20e9bf[_0x1eae23(0x1f6)]&&(console[_0x1eae23(0x208)](_0x1eae23(0x1e4)+_0x280a45),console[_0x1eae23(0x208)](_0x1eae23(0x210)+_0x1f986d),console[_0x1eae23(0x208)](_0x1eae23(0x20c)+_0x15a919[_0x1eae23(0x1de)](0x0,0x64)+(_0x15a919['length']>0x64?_0x1eae23(0x205):'')));const _0xdffe27=await withSpinner(_0x1eae23(0x220),()=>_0x168bfb[_0x1eae23(0x21c)][_0x1eae23(0x1df)](_0x1f986d,_0x15a919,_0x280a45),{'verbose':_0x20e9bf[_0x1eae23(0x1f6)]}),_0x407f24=_0xdffe27[_0x1eae23(0x1e6)];return console[_0x1eae23(0x208)](_0x1eae23(0x20b)),console['error'](_0x1eae23(0x20f)+_0x407f24[_0x1eae23(0x212)]),await handleSDKOutput([_0x407f24],_0x20e9bf),0x0;}catch(_0x1c9deb){if(_0x1c9deb instanceof SDKError)return console['error'](_0x1eae23(0x207)+_0x1c9deb[_0x1eae23(0x1f9)]),_0x1c9deb['cause']&&console['error']('\x20\x20Cause:\x20'+_0x1c9deb['cause']),0x1;throw _0x1c9deb;}}}function a16_0x4a5d(_0x2ce5b4,_0xfd9a95){const _0x564d7b=a16_0x564d();return a16_0x4a5d=function(_0x4a5d0c,_0xba5911){_0x4a5d0c=_0x4a5d0c-0x1d5;let _0x18e3ee=_0x564d7b[_0x4a5d0c];return _0x18e3ee;},a16_0x4a5d(_0x2ce5b4,_0xfd9a95);}export class JobResultCommand extends BaseCommand{['name']=a16_0x194b6c(0x1fa);[a16_0x194b6c(0x202)]=a16_0x194b6c(0x1fd);async['execute'](_0x2d2970){const _0x58ec2a=a16_0x194b6c,{options:_0x14b781,args:_0xb59cab,tdx:_0x39ad8c}=_0x2d2970,_0x36905a=_0xb59cab[0x0];if(!_0x36905a)return console[_0x58ec2a(0x208)](_0x58ec2a(0x1ed)),console[_0x58ec2a(0x208)](_0x58ec2a(0x1dc)),0x1;try{const _0x40498c=await withSpinner('Getting\x20job\x20results...',()=>_0x39ad8c[_0x58ec2a(0x21c)][_0x58ec2a(0x1f2)](_0x36905a),{'verbose':_0x14b781[_0x58ec2a(0x1f6)]}),_0x5a3b4a=_0x40498c['data'];return console[_0x58ec2a(0x208)](_0x58ec2a(0x1e7)+_0x5a3b4a[_0x58ec2a(0x223)]+_0x58ec2a(0x1ef)+(_0x5a3b4a[_0x58ec2a(0x223)]!==0x1?'s':'')),await handleSDKOutput(_0x5a3b4a,_0x14b781),0x0;}catch(_0x22a19f){if(_0x22a19f instanceof SDKError)return console[_0x58ec2a(0x208)](_0x58ec2a(0x207)+_0x22a19f[_0x58ec2a(0x1f9)]),_0x22a19f[_0x58ec2a(0x222)]&&console['error'](_0x58ec2a(0x1ea)+_0x22a19f['cause']),0x1;throw _0x22a19f;}}}
1
+ const a16_0x2091e1=a16_0x5abf;(function(_0x274e63,_0x389431){const _0x1ad0df=a16_0x5abf,_0x2b8c29=_0x274e63();while(!![]){try{const _0x5cf996=parseInt(_0x1ad0df(0x1f0))/0x1*(parseInt(_0x1ad0df(0x1aa))/0x2)+-parseInt(_0x1ad0df(0x1a8))/0x3*(parseInt(_0x1ad0df(0x1ab))/0x4)+-parseInt(_0x1ad0df(0x1e9))/0x5*(-parseInt(_0x1ad0df(0x1ad))/0x6)+parseInt(_0x1ad0df(0x1bf))/0x7+-parseInt(_0x1ad0df(0x1bb))/0x8+-parseInt(_0x1ad0df(0x1ea))/0x9*(parseInt(_0x1ad0df(0x1c8))/0xa)+parseInt(_0x1ad0df(0x1fb))/0xb;if(_0x5cf996===_0x389431)break;else _0x2b8c29['push'](_0x2b8c29['shift']());}catch(_0x29ff7d){_0x2b8c29['push'](_0x2b8c29['shift']());}}}(a16_0x1157,0xb23c4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a16_0x5abf(_0x224135,_0x1931e1){const _0x115796=a16_0x1157();return a16_0x5abf=function(_0x5abff8,_0x13c997){_0x5abff8=_0x5abff8-0x1a8;let _0x7f0a95=_0x115796[_0x5abff8];return _0x7f0a95;},a16_0x5abf(_0x224135,_0x1931e1);}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';export class JobListCommand extends BaseCommand{['name']=a16_0x2091e1(0x1dc);['description']=a16_0x2091e1(0x1b6);async[a16_0x2091e1(0x1d1)](_0x437f36){const _0x249491=a16_0x2091e1,{options:_0x5deca1,tdx:_0x5adbcf}=_0x437f36;try{const _0x5ab72b=parseInt(String(_0x5deca1[_0x249491(0x1dd)]),0xa)||0x28,_0x5f0d54=_0x5deca1[_0x249491(0x1bc)];_0x5deca1[_0x249491(0x1d0)]&&(console[_0x249491(0x1b7)](_0x249491(0x1b4)+_0x5ab72b+_0x249491(0x1cb)),_0x5f0d54&&console[_0x249491(0x1b7)](_0x249491(0x1b0)+_0x5f0d54));const _0x41a89e=await withSpinner(_0x249491(0x1be),()=>_0x5adbcf[_0x249491(0x1dc)][_0x249491(0x1de)]({'from':0x0,'to':_0x5ab72b-0x1,'status':_0x5f0d54}),{'verbose':_0x5deca1[_0x249491(0x1d0)]}),_0x5b98fb=_0x41a89e[_0x249491(0x1c9)];console[_0x249491(0x1b7)](_0x249491(0x1d4)+_0x5b98fb[_0x249491(0x1f4)]+_0x249491(0x1c5)+(_0x5b98fb[_0x249491(0x1f4)]!==0x1?'s':''));const _0x4b5a26=_0x5b98fb[_0x249491(0x1d2)](_0x23cd34=>{const _0x1827bb=_0x249491;let _0x5e617b;if(_0x23cd34[_0x1827bb(0x1e8)]&&_0x23cd34[_0x1827bb(0x1da)]){const _0x496d23=new Date(_0x23cd34[_0x1827bb(0x1e8)])[_0x1827bb(0x1fa)](),_0x4d143b=new Date(_0x23cd34[_0x1827bb(0x1da)])[_0x1827bb(0x1fa)]();_0x5e617b=Math[_0x1827bb(0x1cc)]((_0x4d143b-_0x496d23)/0x3e8);}return{'job_id':_0x23cd34[_0x1827bb(0x1ed)],'type':_0x23cd34['type'],'status':_0x23cd34[_0x1827bb(0x1bc)],'user_name':_0x23cd34[_0x1827bb(0x1ee)],'duration_sec':_0x5e617b,'created_at':_0x23cd34['created_at'],'started_at':_0x23cd34[_0x1827bb(0x1e8)],'end_at':_0x23cd34[_0x1827bb(0x1da)]};});return await handleSDKOutput(_0x4b5a26,_0x5deca1),0x0;}catch(_0x4a9690){if(_0x4a9690 instanceof SDKError)return console[_0x249491(0x1b7)](_0x249491(0x1d5)+_0x4a9690[_0x249491(0x1ba)]),_0x4a9690[_0x249491(0x1e4)]&&console[_0x249491(0x1b7)](_0x249491(0x1b8)+_0x4a9690[_0x249491(0x1e4)]),0x1;throw _0x4a9690;}}}function a16_0x1157(){const _0x4cf03b=['limit','list','created_at','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','information_schema','url','Error:\x20Job\x20ID\x20is\x20required','cause','substring','result','hive','start_at','525YScWeS','1341Niaamv','submit','description','job_id','user_name','Job\x20type:\x20','1303tDvMfg','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Usage:\x20job\x20result\x20<job-id>','Kill\x20a\x20job','length','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20\x20Job\x20ID:\x20','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Show\x20job\x20details','Cancelled','getTime','32815552yyLDhK','3VyCdqy','job:result','262ffvWDj','4118836YLPxav','name','3246KGmtir','Get\x20job\x20results','✔\x20Job\x20submitted','Status\x20filter:\x20','debug','✔\x20Retrieved\x20','job:show','Limit:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','List\x20jobs','error','\x20\x20Cause:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','message','2670888BmoAjO','status','Database:\x20','Listing\x20jobs...','2129421CdcSjd','Getting\x20job\x20details...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','type','Getting\x20job\x20results...','yes','\x20job','priority','file','95390xDCrWS','data','Query:\x20','\x20jobs','round','query','Error:\x20Query\x20is\x20required','Submitting\x20kill\x20request...','verbose','execute','map','Usage:\x20job\x20kill\x20<job-id>','✔\x20Found\x20','Error:\x20','jobType','Submitting\x20job...','database','Submit\x20a\x20job','end_at','trino','jobs'];a16_0x1157=function(){return _0x4cf03b;};return a16_0x1157();}export class JobShowCommand extends BaseCommand{[a16_0x2091e1(0x1ac)]=a16_0x2091e1(0x1b3);['description']=a16_0x2091e1(0x1f8);async[a16_0x2091e1(0x1d1)](_0x44a5be){const _0x3d6d42=a16_0x2091e1,{options:_0x3818d2,args:_0x3ae7a9,tdx:_0x25face}=_0x44a5be,_0x1eda7b=_0x3ae7a9[0x0];if(!_0x1eda7b)return console[_0x3d6d42(0x1b7)](_0x3d6d42(0x1e3)),console[_0x3d6d42(0x1b7)]('Usage:\x20job\x20show\x20<job-id>'),0x1;try{const _0x25c108=await withSpinner(_0x3d6d42(0x1c0),()=>_0x25face[_0x3d6d42(0x1dc)]['show'](_0x1eda7b),{'verbose':_0x3818d2[_0x3d6d42(0x1d0)]}),_0x5bf083=_0x25c108[_0x3d6d42(0x1c9)];let _0x2109bb;if(_0x5bf083['start_at']&&_0x5bf083[_0x3d6d42(0x1da)]){const _0x4f810f=new Date(_0x5bf083[_0x3d6d42(0x1e8)])[_0x3d6d42(0x1fa)](),_0x23644e=new Date(_0x5bf083[_0x3d6d42(0x1da)])[_0x3d6d42(0x1fa)]();_0x2109bb=Math[_0x3d6d42(0x1cc)]((_0x23644e-_0x4f810f)/0x3e8);}const _0x30066b={'job_id':_0x5bf083[_0x3d6d42(0x1ed)],'type':_0x5bf083[_0x3d6d42(0x1c2)],'status':_0x5bf083[_0x3d6d42(0x1bc)],..._0x5bf083[_0x3d6d42(0x1ee)]&&{'user_name':_0x5bf083[_0x3d6d42(0x1ee)]},..._0x2109bb!==undefined&&{'duration_sec':_0x2109bb},..._0x5bf083[_0x3d6d42(0x1df)]&&{'created_at':_0x5bf083[_0x3d6d42(0x1df)]},..._0x5bf083[_0x3d6d42(0x1e8)]&&{'started_at':_0x5bf083['start_at']},..._0x5bf083[_0x3d6d42(0x1da)]&&{'end_at':_0x5bf083['end_at']},..._0x5bf083[_0x3d6d42(0x1d8)]&&{'database':_0x5bf083[_0x3d6d42(0x1d8)]},..._0x5bf083[_0x3d6d42(0x1c6)]!==undefined&&{'priority':_0x5bf083[_0x3d6d42(0x1c6)]},..._0x5bf083[_0x3d6d42(0x1e2)]&&{'url':_0x5bf083['url']},..._0x5bf083[_0x3d6d42(0x1cd)]&&{'query':_0x5bf083[_0x3d6d42(0x1cd)]},..._0x5bf083[_0x3d6d42(0x1b1)]&&{'debug':_0x5bf083[_0x3d6d42(0x1b1)]}};return await handleSingleObjectOutput(_0x30066b,_0x3818d2),0x0;}catch(_0x22eff1){if(_0x22eff1 instanceof SDKError)return console['error']('Error:\x20'+_0x22eff1[_0x3d6d42(0x1ba)]),_0x22eff1[_0x3d6d42(0x1e4)]&&console[_0x3d6d42(0x1b7)](_0x3d6d42(0x1b8)+_0x22eff1[_0x3d6d42(0x1e4)]),0x1;throw _0x22eff1;}}}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a16_0x2091e1(0x1f3);async[a16_0x2091e1(0x1d1)](_0x4a8c8f){const _0x32a3db=a16_0x2091e1,{options:_0x4f5d5f,args:_0x4bdcd2,tdx:_0x186cc1}=_0x4a8c8f,_0x5c0ae3=_0x4bdcd2[0x0];if(!_0x5c0ae3)return console[_0x32a3db(0x1b7)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x32a3db(0x1b7)](_0x32a3db(0x1d3)),0x1;try{if(!_0x4f5d5f[_0x32a3db(0x1c4)]){const _0x39db8a=await confirm(_0x32a3db(0x1c1)+_0x5c0ae3+'?');if(!_0x39db8a)return console[_0x32a3db(0x1b7)](_0x32a3db(0x1f9)),0x0;}return await withSpinner(_0x32a3db(0x1cf),()=>_0x186cc1[_0x32a3db(0x1dc)]['kill'](_0x5c0ae3),{'verbose':_0x4f5d5f[_0x32a3db(0x1d0)]}),console[_0x32a3db(0x1b7)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x5c0ae3),console[_0x32a3db(0x1b7)](_0x32a3db(0x1b5)+_0x5c0ae3+_0x32a3db(0x1b9)),0x0;}catch(_0x1843d9){if(_0x1843d9 instanceof SDKError)return console[_0x32a3db(0x1b7)]('Error:\x20'+_0x1843d9[_0x32a3db(0x1ba)]),_0x1843d9['cause']&&console[_0x32a3db(0x1b7)](_0x32a3db(0x1b8)+_0x1843d9['cause']),0x1;throw _0x1843d9;}}}export class JobSubmitCommand extends BaseCommand{[a16_0x2091e1(0x1ac)]='job:submit';[a16_0x2091e1(0x1ec)]=a16_0x2091e1(0x1d9);async[a16_0x2091e1(0x1d1)](_0x1e33c8){const _0x58a6a2=a16_0x2091e1,{options:_0x47fbb9,args:_0x12e011,tdx:_0x297054}=_0x1e33c8;try{const _0x905d=_0x47fbb9[_0x58a6a2(0x1d6)]||_0x58a6a2(0x1db),_0x6d246=_0x47fbb9[_0x58a6a2(0x1c7)],_0x1c97b7=_0x47fbb9[_0x58a6a2(0x1d8)]||_0x58a6a2(0x1e1);if(_0x905d!==_0x58a6a2(0x1db)&&_0x905d!==_0x58a6a2(0x1e7))return console['error'](_0x58a6a2(0x1f7)),0x1;let _0xb7981;if(_0x6d246){if(_0x12e011[0x0])return console['error'](_0x58a6a2(0x1f1)),0x1;const _0xaaac86=readSqlStatementsFromFile(_0x6d246);if(_0xaaac86['length']===0x0)return console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1e0)),0x1;if(_0xaaac86[_0x58a6a2(0x1f4)]>0x1)return console[_0x58a6a2(0x1b7)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0xb7981=_0xaaac86[0x0];}else{if(!_0x12e011[0x0])return console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1ce)),console['error'](_0x58a6a2(0x1f5)),0x1;_0xb7981=_0x12e011[0x0];}_0x47fbb9[_0x58a6a2(0x1d0)]&&(console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1ef)+_0x905d),console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1bd)+_0x1c97b7),console['error'](_0x58a6a2(0x1ca)+_0xb7981[_0x58a6a2(0x1e5)](0x0,0x64)+(_0xb7981[_0x58a6a2(0x1f4)]>0x64?'...':'')));const _0xd40803=await withSpinner(_0x58a6a2(0x1d7),()=>_0x297054['jobs'][_0x58a6a2(0x1eb)](_0x1c97b7,_0xb7981,_0x905d),{'verbose':_0x47fbb9[_0x58a6a2(0x1d0)]}),_0x4ba971=_0xd40803[_0x58a6a2(0x1c9)];return console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1af)),console['error'](_0x58a6a2(0x1f6)+_0x4ba971[_0x58a6a2(0x1ed)]),await handleSDKOutput([_0x4ba971],_0x47fbb9),0x0;}catch(_0x416b67){if(_0x416b67 instanceof SDKError)return console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1d5)+_0x416b67[_0x58a6a2(0x1ba)]),_0x416b67[_0x58a6a2(0x1e4)]&&console[_0x58a6a2(0x1b7)](_0x58a6a2(0x1b8)+_0x416b67[_0x58a6a2(0x1e4)]),0x1;throw _0x416b67;}}}export class JobResultCommand extends BaseCommand{[a16_0x2091e1(0x1ac)]=a16_0x2091e1(0x1a9);[a16_0x2091e1(0x1ec)]=a16_0x2091e1(0x1ae);async[a16_0x2091e1(0x1d1)](_0x2d6e6d){const _0x1b79db=a16_0x2091e1,{options:_0x23aed1,args:_0x20a2f5,tdx:_0x2ea060}=_0x2d6e6d,_0x1c58dd=_0x20a2f5[0x0];if(!_0x1c58dd)return console[_0x1b79db(0x1b7)](_0x1b79db(0x1e3)),console[_0x1b79db(0x1b7)](_0x1b79db(0x1f2)),0x1;try{const _0x11d8da=await withSpinner(_0x1b79db(0x1c3),()=>_0x2ea060['jobs'][_0x1b79db(0x1e6)](_0x1c58dd),{'verbose':_0x23aed1[_0x1b79db(0x1d0)]}),_0x4eccc2=_0x11d8da['data'];return console[_0x1b79db(0x1b7)](_0x1b79db(0x1b2)+_0x4eccc2['length']+'\x20row'+(_0x4eccc2[_0x1b79db(0x1f4)]!==0x1?'s':'')),await handleSDKOutput(_0x4eccc2,_0x23aed1),0x0;}catch(_0x388497){if(_0x388497 instanceof SDKError)return console[_0x1b79db(0x1b7)](_0x1b79db(0x1d5)+_0x388497[_0x1b79db(0x1ba)]),_0x388497[_0x1b79db(0x1e4)]&&console[_0x1b79db(0x1b7)](_0x1b79db(0x1b8)+_0x388497[_0x1b79db(0x1e4)]),0x1;throw _0x388497;}}}
@@ -1 +1 @@
1
- const a17_0x391712=a17_0x32af;(function(_0x37d853,_0x38d32e){const _0x1c44a4=a17_0x32af,_0x2255d7=_0x37d853();while(!![]){try{const _0x3628ef=parseInt(_0x1c44a4(0x14d))/0x1+parseInt(_0x1c44a4(0x107))/0x2+-parseInt(_0x1c44a4(0xf7))/0x3*(-parseInt(_0x1c44a4(0xed))/0x4)+-parseInt(_0x1c44a4(0x11b))/0x5*(-parseInt(_0x1c44a4(0x134))/0x6)+-parseInt(_0x1c44a4(0x12a))/0x7+parseInt(_0x1c44a4(0xe9))/0x8*(parseInt(_0x1c44a4(0xf9))/0x9)+-parseInt(_0x1c44a4(0x13e))/0xa*(parseInt(_0x1c44a4(0x135))/0xb);if(_0x3628ef===_0x38d32e)break;else _0x2255d7['push'](_0x2255d7['shift']());}catch(_0x50de5d){_0x2255d7['push'](_0x2255d7['shift']());}}}(a17_0x23fe,0x788ef));import{BaseCommand}from'./command.js';import{SDKError}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';function handleSDKError(_0x50906f,_0x3175cf){const _0x161eff=a17_0x32af;if(_0x50906f instanceof SDKError)console[_0x161eff(0xfa)](_0x161eff(0xe3)+_0x50906f[_0x161eff(0x130)]),_0x3175cf[_0x161eff(0x15f)]&&(_0x50906f['cause']&&console[_0x161eff(0xfa)](_0x161eff(0xfc)+_0x50906f['cause']),_0x50906f[_0x161eff(0x142)]&&(console[_0x161eff(0xfa)](_0x161eff(0xfd)),console['error'](_0x50906f[_0x161eff(0x142)])));else throw _0x50906f;}function formatChatHistoryEntry(_0x10ee14,_0x57d955){const _0x43fed0=a17_0x32af,_0xf6bbdf=getChalk(_0x57d955),_0x45b3ce=_0xf6bbdf[_0x43fed0(0xff)](_0x10ee14['at']);if(_0x43fed0(0xde)in _0x10ee14){const _0x21bf5c=_0xf6bbdf[_0x43fed0(0x127)](_0x43fed0(0x10e));return _0x45b3ce+'\x20'+_0x21bf5c+':\x20'+_0x10ee14['input'];}if(_0x43fed0(0x116)in _0x10ee14){const _0x30d5a6=_0xf6bbdf['green'](_0x43fed0(0x11f));return _0x45b3ce+'\x20'+_0x30d5a6+':\x20'+_0x10ee14[_0x43fed0(0x116)];}if(_0x43fed0(0xdd)in _0x10ee14){const _0x2b2ae0=_0xf6bbdf[_0x43fed0(0x129)](_0x43fed0(0x12d)),{functionName:_0x40b0c0,functionArguments:_0x9b0247,targetFunction:_0x1828c2}=_0x10ee14[_0x43fed0(0xdd)];let _0x213341=_0x45b3ce+'\x20'+_0x2b2ae0+':\x20'+_0xf6bbdf[_0x43fed0(0x146)](_0x40b0c0);if(_0x9b0247&&Object[_0x43fed0(0xea)](_0x9b0247)['length']>0x0){const _0xd8fdd3=Object[_0x43fed0(0x113)](_0x9b0247)[_0x43fed0(0x124)](([_0x2ace0c,_0x18377d])=>_0x2ace0c+'='+JSON[_0x43fed0(0x111)](_0x18377d))['join'](',\x20');_0x213341+='('+_0xd8fdd3+')';}_0x1828c2&&(_0x213341+=_0xf6bbdf[_0x43fed0(0xff)]('\x20['+_0x1828c2+']'));let _0xf67c90='';if(_0x10ee14['tool_call'][_0x43fed0(0x15b)])_0xf67c90=_0x43fed0(0x13b)+_0x10ee14[_0x43fed0(0xdd)][_0x43fed0(0x15b)][_0x43fed0(0x155)];else{if(_0x10ee14['tool_call'][_0x43fed0(0xf5)])_0xf67c90=_0x43fed0(0x136)+_0x10ee14[_0x43fed0(0xdd)]['targetAgent'][_0x43fed0(0x155)];else{if(_0x10ee14['tool_call'][_0x43fed0(0xe0)])_0xf67c90=_0x43fed0(0x108)+_0x10ee14[_0x43fed0(0xdd)][_0x43fed0(0xe0)][_0x43fed0(0x155)];else _0x10ee14[_0x43fed0(0xdd)][_0x43fed0(0x15c)]&&(_0xf67c90='\x20->\x20ImageGen:'+_0x10ee14[_0x43fed0(0xdd)]['targetImageGenerator'][_0x43fed0(0x155)]);}}return _0x213341+_0xf67c90;}if('tool'in _0x10ee14){const _0x5164d9=_0xf6bbdf[_0x43fed0(0x10c)](_0x43fed0(0x110)),{functionName:_0x1a0954,functionArguments:_0x5ce01d,content:_0x35d226,newChat:_0x105f27}=_0x10ee14['tool'];let _0x509a3b=_0x45b3ce+'\x20'+_0x5164d9+':\x20'+_0xf6bbdf[_0x43fed0(0x146)](_0x1a0954);if(_0x5ce01d){const _0x391cb8=typeof _0x5ce01d===_0x43fed0(0x152)?_0x5ce01d:JSON[_0x43fed0(0x111)](_0x5ce01d);_0x509a3b+='('+_0x391cb8+')';}return _0x35d226&&(_0x509a3b+='\x0a'+_0xf6bbdf[_0x43fed0(0xff)](_0x35d226)),_0x105f27&&(_0x509a3b+=_0xf6bbdf['dim'](_0x43fed0(0x15d)+_0x105f27['id'])),_0x509a3b;}if(_0x43fed0(0x12f)in _0x10ee14){const _0x3f5e2c=_0xf6bbdf[_0x43fed0(0x101)](_0x43fed0(0xf8));return _0x45b3ce+'\x20'+_0x3f5e2c+':\x20'+_0x10ee14[_0x43fed0(0x12f)][_0x43fed0(0x155)]+'\x20('+_0x10ee14[_0x43fed0(0x12f)]['content'][_0x43fed0(0x143)]+_0x43fed0(0x122);}if('image'in _0x10ee14){const _0x285b73=_0xf6bbdf[_0x43fed0(0x101)](_0x43fed0(0x106)),{width:_0x45cd24,height:_0x1b49fd,headerText:_0x1f86e8}=_0x10ee14[_0x43fed0(0x158)],_0x505e93=_0x1f86e8?_0x43fed0(0x12c)+_0x1f86e8:'';return _0x45b3ce+'\x20'+_0x285b73+':\x20'+_0x45cd24+'x'+_0x1b49fd+_0x505e93;}if('error'in _0x10ee14){const _0x313309=_0xf6bbdf[_0x43fed0(0xee)](_0x43fed0(0x150));return _0x45b3ce+'\x20'+_0x313309+':\x20'+_0x10ee14['error'];}return _0x45b3ce+'\x20'+_0xf6bbdf[_0x43fed0(0xff)](_0x43fed0(0xec))+':\x20'+JSON[_0x43fed0(0x111)](_0x10ee14);}function a17_0x32af(_0x37fe26,_0x3de709){const _0x23fe93=a17_0x23fe();return a17_0x32af=function(_0x32af56,_0x9641ef){_0x32af56=_0x32af56-0xdd;let _0x144533=_0x23fe93[_0x32af56];return _0x144533;},a17_0x32af(_0x37fe26,_0x3de709);}async function getProjectIdOrDefault(_0x5e700e){const _0x5d2cd4=a17_0x32af,{tdx:_0x14c652,options:_0x1259bf}=_0x5e700e,_0xdc20d6=_0x1259bf[_0x5d2cd4(0x13c)];if(_0xdc20d6){const _0x386eb3=await withSpinner(_0x5d2cd4(0x15a)+_0xdc20d6+_0x5d2cd4(0x13f),()=>_0x14c652[_0x5d2cd4(0x157)][_0x5d2cd4(0x112)](_0xdc20d6),{'verbose':_0x1259bf[_0x5d2cd4(0x15f)]});return _0x386eb3['data'];}let _0xcf485b=_0x14c652[_0x5d2cd4(0x157)][_0x5d2cd4(0xe6)]();if(_0xcf485b)return _0xcf485b;const _0x258f34=await withSpinner(_0x5d2cd4(0x141),()=>_0x14c652[_0x5d2cd4(0x157)][_0x5d2cd4(0xfb)](),{'verbose':_0x1259bf[_0x5d2cd4(0x15f)]});return _0x258f34[_0x5d2cd4(0xeb)]['id'];}function toLLMProjectInfo(_0x16a7c4){const _0x571081=a17_0x32af;return{'name':_0x16a7c4[_0x571081(0xf4)][_0x571081(0x155)],'description':_0x16a7c4[_0x571081(0xf4)][_0x571081(0x144)],'createdAt':_0x16a7c4[_0x571081(0xf4)][_0x571081(0x119)],'updatedAt':_0x16a7c4[_0x571081(0xf4)][_0x571081(0x12b)]};}function toAgentInfo(_0x1f44e0){const _0x3a2a3c=a17_0x32af;return{'name':_0x1f44e0[_0x3a2a3c(0xf4)]['name'],'description':_0x1f44e0[_0x3a2a3c(0xf4)][_0x3a2a3c(0x144)],'prompt':truncatePrompt(_0x1f44e0[_0x3a2a3c(0xf4)]['prompt']),'createdAt':_0x1f44e0[_0x3a2a3c(0xf4)]['createdAt'],'updatedAt':_0x1f44e0[_0x3a2a3c(0xf4)][_0x3a2a3c(0x12b)]};}function truncatePrompt(_0x2bffd2){const _0x444375=a17_0x32af;if(!_0x2bffd2)return undefined;const _0x512284=0x64;if(_0x2bffd2[_0x444375(0x143)]<=_0x512284)return _0x2bffd2;return _0x2bffd2[_0x444375(0x102)](0x0,_0x512284)+_0x444375(0xe4);}export class LLMModelsCommand extends BaseCommand{[a17_0x391712(0x155)]='llm:models';[a17_0x391712(0x144)]=a17_0x391712(0xe7);async[a17_0x391712(0xe8)](_0x28c315){const _0x3ba9da=a17_0x391712,{options:_0x2ba864,tdx:_0x238e9d}=_0x28c315;try{const _0xe0e8d=await withSpinner(_0x3ba9da(0xef),()=>_0x238e9d[_0x3ba9da(0x157)][_0x3ba9da(0xdf)](),{'verbose':_0x2ba864[_0x3ba9da(0x15f)]});return await handleSDKOutput(_0xe0e8d[_0x3ba9da(0xeb)],_0x2ba864),0x0;}catch(_0x3d4f08){return handleSDKError(_0x3d4f08,_0x2ba864),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a17_0x391712(0x10d);[a17_0x391712(0x144)]=a17_0x391712(0x140);async[a17_0x391712(0xe8)](_0x4e0710){const _0x43ddf6=a17_0x391712,{options:_0x122a5c,args:_0x10a511,tdx:_0x34bf5c}=_0x4e0710;try{const _0x52998a=_0x10a511[0x0],_0x2aae64=_0x122a5c[_0x43ddf6(0x11c)]?Number(_0x122a5c[_0x43ddf6(0x11c)]):0x32,_0x55a1f4=await withSpinner(_0x43ddf6(0x159),()=>_0x34bf5c[_0x43ddf6(0x157)]['projects'](_0x2aae64),{'verbose':_0x122a5c[_0x43ddf6(0x15f)]});let _0x58c205=_0x55a1f4['data'];_0x52998a&&(_0x58c205=_0x55a1f4[_0x43ddf6(0xeb)][_0x43ddf6(0x132)](_0x37ed04=>matchGlobPattern(_0x37ed04[_0x43ddf6(0xf4)][_0x43ddf6(0x155)],_0x52998a)));const _0x3728e4=_0x58c205[_0x43ddf6(0x124)](toLLMProjectInfo);return await handleSDKOutput(_0x3728e4,_0x122a5c),0x0;}catch(_0x47c4c5){return handleSDKError(_0x47c4c5,_0x122a5c),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x14c);[a17_0x391712(0x144)]=a17_0x391712(0x117);async[a17_0x391712(0xe8)](_0x1c7dff){const _0x4fc24e=a17_0x391712,{options:_0x45c6ce,args:_0x5c709f,tdx:_0x3dd36c}=_0x1c7dff;try{const _0x23da58=_0x5c709f[0x0],_0x571549=await getProjectIdOrDefault(_0x1c7dff),_0x535c3e=await withSpinner(_0x4fc24e(0x131),()=>_0x3dd36c[_0x4fc24e(0x157)][_0x4fc24e(0x145)](_0x571549),{'verbose':_0x45c6ce['verbose']});let _0x569344=_0x535c3e[_0x4fc24e(0xeb)];_0x23da58&&(_0x569344=_0x535c3e[_0x4fc24e(0xeb)][_0x4fc24e(0x132)](_0x314514=>matchGlobPattern(_0x314514[_0x4fc24e(0xf4)][_0x4fc24e(0x155)],_0x23da58)));const _0x60c5ed=_0x569344[_0x4fc24e(0x124)](toAgentInfo);return await handleSDKOutput(_0x60c5ed,_0x45c6ce),0x0;}catch(_0x277ae7){return handleSDKError(_0x277ae7,_0x45c6ce),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x139);[a17_0x391712(0x144)]=a17_0x391712(0x104);async[a17_0x391712(0xe8)](_0x588019){const _0x422206=a17_0x391712,{options:_0x1f59a8,args:_0x1d0ab2,tdx:_0x44e8d1}=_0x588019;if(_0x1d0ab2[_0x422206(0x143)]===0x0)return console[_0x422206(0xfa)](_0x422206(0x10b)),console[_0x422206(0xfa)](_0x422206(0x148)),0x1;const _0x2bdb99=_0x1d0ab2[0x0];try{const _0x1b8647=await getProjectIdOrDefault(_0x588019),_0x316f8b=await withSpinner(_0x422206(0x154)+_0x2bdb99+_0x422206(0x13f),()=>_0x44e8d1['llm'][_0x422206(0x118)](_0x2bdb99,_0x1b8647),{'verbose':_0x1f59a8['verbose']}),_0x8d3db5=await withSpinner('Fetching\x20agent...',()=>_0x44e8d1[_0x422206(0x157)]['agent'](_0x316f8b[_0x422206(0xeb)]),{'verbose':_0x1f59a8[_0x422206(0x15f)]});return await handleSDKOutput([_0x8d3db5[_0x422206(0xeb)]],_0x1f59a8),0x0;}catch(_0x4d10f4){return handleSDKError(_0x4d10f4,_0x1f59a8),0x1;}}}function a17_0x23fe(){const _0x2c7a4b=['log','Creating\x20agent\x20\x27','llm:agents','722508jvzHla','setCurrentProject','llm:agent:delete','[error]\x20\x20','createAgent','string','llm:agent:update','Resolving\x20agent\x20\x27','name','Create\x20a\x20new\x20agent\x20in\x20current\x20project','llm','image','Fetching\x20projects...','Resolving\x20project\x20\x27','targetKnowledgeBase','targetImageGenerator','\x20→\x20chat:\x20','llm:agent:create','verbose','llm:project:create','table','tool_call','input','models','targetWebSearchTool','updateAgent','Agent\x20deleted:\x20','Error:\x20','...','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','getCurrentProject','List\x20available\x20LLM\x20models','execute','53296yaRrCm','keys','data','[unknown]','3279444JUARaW','red','Fetching\x20available\x20models...','Update\x20an\x20existing\x20agent','Deleting\x20agent...','maxToolIterations','history','attributes','targetAgent','llm:project:delete','3kAXVyO','[output]\x20','1287tYqeJh','error','getOrCreateDefaultProject','\x20\x20Cause:\x20','\x0aStack\x20trace:','Deleting\x20project\x20\x27','dim','chats','blue','slice','claude-4.5-haiku','Show\x20agent\x20details','Agent\x20updated:\x20','[image]\x20\x20','13196svjgVT','\x20->\x20WebSearch:','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','jsonl','Error:\x20Agent\x20name\x20is\x20required','magenta','llm:projects','[input]\x20\x20','Creating\x20project\x20\x27','[tool]\x20\x20\x20','stringify','resolveProjectId','entries','deleteAgent','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','content','List\x20agents\x20in\x20current\x20project','resolveAgentId','createdAt','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','205RnpaHn','limit','tsv','Usage:\x20tdx\x20llm\x20use\x20<project-name>','[content]','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Project\x20context\x20set\x20to:\x20','\x20bytes)','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','map','json','starterMessage','cyan','Delete\x20an\x20agent','yellow','6661767nIIime','updatedAt','\x20-\x20','[tool_call]','Project\x20deleted:\x20','output','message','Fetching\x20agents...','filter','Error:\x20Project\x20name\x20is\x20required','78054XezaTL','33znIqHh','\x20->\x20Agent:','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','deleteProject','llm:agent:show','Updating\x20agent...','\x20->\x20KB:','llmProject','model','5298380DtrxOl','\x27...','List\x20all\x20LLM\x20projects','Getting\x20default\x20project...','stack','length','description','agents','bold','llm:use','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','format'];a17_0x23fe=function(){return _0x2c7a4b;};return a17_0x23fe();}export class LLMAgentCreateCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x15e);[a17_0x391712(0x144)]=a17_0x391712(0x156);async[a17_0x391712(0xe8)](_0x1adaca){const _0xcc7ee3=a17_0x391712,{options:_0x3bf7cd,args:_0x1fe85f,tdx:_0x2c7845}=_0x1adaca;if(_0x1fe85f[_0xcc7ee3(0x143)]===0x0)return console[_0xcc7ee3(0xfa)](_0xcc7ee3(0x10b)),console[_0xcc7ee3(0xfa)](_0xcc7ee3(0x123)),0x1;const _0x58bc6a=_0x1fe85f[0x0],_0x18d686=_0x3bf7cd,_0x4e55e4=_0x18d686['systemPrompt'],_0x2d02fd=_0x18d686[_0xcc7ee3(0x13d)]||_0xcc7ee3(0x103),_0x394ba5=_0x18d686['starterMessage'],_0xd1d7a7=_0x18d686[_0xcc7ee3(0xf2)]?Number(_0x18d686[_0xcc7ee3(0xf2)]):undefined,_0x43142f=_0x18d686['temperature']?Number(_0x18d686['temperature']):undefined;try{const _0x26d306=await getProjectIdOrDefault(_0x1adaca),_0x3f5640=await withSpinner(_0xcc7ee3(0x14b)+_0x58bc6a+_0xcc7ee3(0x13f),()=>_0x2c7845[_0xcc7ee3(0x157)][_0xcc7ee3(0x151)]({'name':_0x58bc6a,'projectId':_0x26d306,'modelType':_0x2d02fd,'systemPrompt':_0x4e55e4,'starterMessage':_0x394ba5,'maxToolIterations':_0xd1d7a7,'temperature':_0x43142f}),{'verbose':_0x3bf7cd['verbose']});return console[_0xcc7ee3(0x14a)]('Agent\x20created:\x20'+_0x3f5640['data']['id']),await handleSDKOutput([_0x3f5640[_0xcc7ee3(0xeb)]],_0x3bf7cd),0x0;}catch(_0x3aba52){return handleSDKError(_0x3aba52,_0x3bf7cd),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x153);[a17_0x391712(0x144)]=a17_0x391712(0xf0);async[a17_0x391712(0xe8)](_0x25ccdb){const _0x39036d=a17_0x391712,{options:_0x4262ed,args:_0x2643b8,tdx:_0x5397eb}=_0x25ccdb;if(_0x2643b8[_0x39036d(0x143)]===0x0)return console['error'](_0x39036d(0x10b)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x3dbad7=_0x2643b8[0x0],_0x2f53e1=_0x4262ed,_0x157dda=_0x2f53e1[_0x39036d(0x155)],_0x3a077e=_0x2f53e1['prompt'],_0x18b300=_0x2f53e1[_0x39036d(0x144)],_0x2bfd62=_0x2f53e1[_0x39036d(0x126)];if(!_0x157dda&&!_0x3a077e&&!_0x18b300&&!_0x2bfd62)return console[_0x39036d(0xfa)](_0x39036d(0x137)),console[_0x39036d(0xfa)](_0x39036d(0x120)),0x1;try{const _0x44f226=await getProjectIdOrDefault(_0x25ccdb),_0xf89739=await withSpinner(_0x39036d(0x154)+_0x3dbad7+'\x27...',()=>_0x5397eb[_0x39036d(0x157)][_0x39036d(0x118)](_0x3dbad7,_0x44f226),{'verbose':_0x4262ed[_0x39036d(0x15f)]}),_0x80447b=_0xf89739[_0x39036d(0xeb)],_0x5aacbe=await withSpinner(_0x39036d(0x13a),()=>_0x5397eb[_0x39036d(0x157)][_0x39036d(0xe1)](_0x80447b,{'name':_0x157dda,'prompt':_0x3a077e,'description':_0x18b300,'starterMessage':_0x2bfd62}),{'verbose':_0x4262ed[_0x39036d(0x15f)]});return console['log'](_0x39036d(0x105)+_0x5aacbe[_0x39036d(0xeb)]['id']),await handleSDKOutput([_0x5aacbe[_0x39036d(0xeb)]],_0x4262ed),0x0;}catch(_0x51bcac){return handleSDKError(_0x51bcac,_0x4262ed),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x14f);[a17_0x391712(0x144)]=a17_0x391712(0x128);async[a17_0x391712(0xe8)](_0x4e1068){const _0x4548f7=a17_0x391712,{options:_0x4ac2a8,args:_0x356a88,tdx:_0x13cec8}=_0x4e1068;if(_0x356a88[_0x4548f7(0x143)]===0x0)return console[_0x4548f7(0xfa)](_0x4548f7(0x10b)),console['error'](_0x4548f7(0x115)),0x1;const _0x41fa00=_0x356a88[0x0];try{const _0x44a8ab=await getProjectIdOrDefault(_0x4e1068),_0x435ce6=await withSpinner(_0x4548f7(0x154)+_0x41fa00+_0x4548f7(0x13f),()=>_0x13cec8['llm']['resolveAgentId'](_0x41fa00,_0x44a8ab),{'verbose':_0x4ac2a8['verbose']}),_0x23a126=_0x435ce6[_0x4548f7(0xeb)];return await withSpinner(_0x4548f7(0xf1),()=>_0x13cec8[_0x4548f7(0x157)][_0x4548f7(0x114)](_0x23a126),{'verbose':_0x4ac2a8['verbose']}),console[_0x4548f7(0x14a)](_0x4548f7(0xe2)+_0x23a126),0x0;}catch(_0x466b46){return handleSDKError(_0x466b46,_0x4ac2a8),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x391712(0x155)]='llm:history';[a17_0x391712(0x144)]=a17_0x391712(0x11a);async[a17_0x391712(0xe8)](_0x10f8c3){const _0x10d63c=a17_0x391712,{options:_0x591476,args:_0x3aba64,tdx:_0x4830f3}=_0x10f8c3,_0x4a6d74=_0x3aba64[0x0];try{if(!_0x4a6d74){const _0x513660=_0x591476['limit']?Number(_0x591476[_0x10d63c(0x11c)]):0x32,_0x14dd8a=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x4830f3[_0x10d63c(0x157)][_0x10d63c(0x100)](_0x513660),{'verbose':_0x591476[_0x10d63c(0x15f)]});if(_0x591476[_0x10d63c(0x149)]===_0x10d63c(0x125)||_0x591476[_0x10d63c(0x149)]===_0x10d63c(0x10a))await handleSDKOutput(_0x14dd8a['data'],_0x591476);else{const _0x1c855b=_0x14dd8a[_0x10d63c(0xeb)][_0x10d63c(0x124)](_0x5979c8=>({'created_at':_0x5979c8[_0x10d63c(0xf4)][_0x10d63c(0x119)],'chat_id':_0x5979c8['id'],'first_input':_0x5979c8[_0x10d63c(0xf4)]['firstInputContent']||'(no\x20message)'}));await handleSDKOutput(_0x1c855b,_0x591476);}return 0x0;}else{const _0x3cf517=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x4a6d74+_0x10d63c(0x13f),()=>_0x4830f3[_0x10d63c(0x157)][_0x10d63c(0xf3)](_0x4a6d74),{'verbose':_0x591476[_0x10d63c(0x15f)]}),_0x4221cc=_0x3cf517[_0x10d63c(0xeb)][_0x10d63c(0xeb)]??[];if(_0x4221cc[_0x10d63c(0x143)]===0x0)return console[_0x10d63c(0x14a)]('No\x20messages\x20found\x20in\x20chat\x20history.'),0x0;if(_0x591476[_0x10d63c(0x149)]===_0x10d63c(0x125)||_0x591476[_0x10d63c(0x149)]===_0x10d63c(0x10a)||_0x591476[_0x10d63c(0x149)]===_0x10d63c(0x161)||_0x591476[_0x10d63c(0x149)]===_0x10d63c(0x11d))await handleSDKOutput(_0x4221cc,_0x591476);else for(const _0x556403 of _0x4221cc){console['log'](formatChatHistoryEntry(_0x556403,_0x591476));}return 0x0;}}catch(_0x3de97c){return handleSDKError(_0x3de97c,_0x591476),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x147);['description']='Set\x20current\x20project\x20context';async[a17_0x391712(0xe8)](_0x3d06de){const _0x1d33af=a17_0x391712,{options:_0x3fc9f4,args:_0x596f36,tdx:_0x5adcc7}=_0x3d06de;if(_0x596f36[_0x1d33af(0x143)]===0x0)return console[_0x1d33af(0xfa)](_0x1d33af(0x133)),console[_0x1d33af(0xfa)](_0x1d33af(0x11e)),0x1;const _0x1a027f=_0x596f36[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x1a027f+_0x1d33af(0x13f),()=>_0x5adcc7[_0x1d33af(0x157)][_0x1d33af(0x14e)](_0x1a027f),{'verbose':_0x3fc9f4[_0x1d33af(0x15f)]}),console[_0x1d33af(0x14a)](_0x1d33af(0x121)+_0x1a027f),0x0;}catch(_0x2a70b3){return handleSDKError(_0x2a70b3,_0x3fc9f4),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0x160);[a17_0x391712(0x144)]='Create\x20a\x20new\x20LLM\x20project';async[a17_0x391712(0xe8)](_0x3d969a){const _0x18fcf3=a17_0x391712,{options:_0x2d39f8,args:_0x4f8088,tdx:_0x46070c}=_0x3d969a;if(_0x4f8088[_0x18fcf3(0x143)]===0x0)return console['error'](_0x18fcf3(0x133)),console[_0x18fcf3(0xfa)](_0x18fcf3(0xe5)),0x1;const _0x4d62f6=_0x4f8088[0x0],_0x434e0b=_0x2d39f8,_0xc72c4b=_0x434e0b[_0x18fcf3(0x144)];try{const _0x332e1b=await withSpinner(_0x18fcf3(0x10f)+_0x4d62f6+_0x18fcf3(0x13f),()=>_0x46070c[_0x18fcf3(0x157)]['createProject']({'name':_0x4d62f6,'description':_0xc72c4b}),{'verbose':_0x2d39f8[_0x18fcf3(0x15f)]});console[_0x18fcf3(0x14a)]('Project\x20created:\x20'+_0x332e1b[_0x18fcf3(0xeb)]['id']);const _0x1094d2=toLLMProjectInfo(_0x332e1b[_0x18fcf3(0xeb)]);return await handleSDKOutput([_0x1094d2],_0x2d39f8),0x0;}catch(_0x4580a2){return handleSDKError(_0x4580a2,_0x2d39f8),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x391712(0x155)]=a17_0x391712(0xf6);[a17_0x391712(0x144)]='Delete\x20an\x20LLM\x20project';async[a17_0x391712(0xe8)](_0x382773){const _0x5bdb81=a17_0x391712,{options:_0x327b2f,args:_0x45c4f7,tdx:_0x7d26dc}=_0x382773;if(_0x45c4f7[_0x5bdb81(0x143)]===0x0)return console[_0x5bdb81(0xfa)](_0x5bdb81(0x133)),console[_0x5bdb81(0xfa)](_0x5bdb81(0x109)),0x1;const _0x21eff8=_0x45c4f7[0x0];try{return await withSpinner(_0x5bdb81(0xfe)+_0x21eff8+'\x27...',()=>_0x7d26dc[_0x5bdb81(0x157)][_0x5bdb81(0x138)](_0x21eff8),{'verbose':_0x327b2f['verbose']}),console[_0x5bdb81(0x14a)](_0x5bdb81(0x12e)+_0x21eff8),0x0;}catch(_0x39afd8){return handleSDKError(_0x39afd8,_0x327b2f),0x1;}}}
1
+ function a17_0x444d(){const _0xac6290=['Updating\x20agent...','Create\x20a\x20new\x20LLM\x20project','createdAt','llm:projects','history','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','getOrCreateDefaultProject','getCurrentProject','Fetching\x20chat\x20sessions...','stack','error','Update\x20an\x20existing\x20agent','Create\x20a\x20new\x20agent\x20in\x20current\x20project','yellow','models','table','llm:use','resolveProjectId','llm:agents','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','targetImageGenerator','Deleting\x20agent...','[output]\x20','[tool]\x20\x20\x20','3258712QOnJuV','attributes','name','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20bytes)','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','string','Resolving\x20agent\x20\x27','projects','Delete\x20an\x20agent','\x20-\x20','4epfBOe','targetKnowledgeBase','red','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','728sOdCqs','[image]\x20\x20','Fetching\x20agents...','execute','deleteAgent','Agent\x20updated:\x20','input','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Fetching\x20available\x20models...','List\x20available\x20LLM\x20models','targetAgent','agents','Creating\x20agent\x20\x27','cyan','data','keys','33mtECEd','List\x20all\x20LLM\x20projects','Project\x20context\x20set\x20to:\x20','slice','setCurrentProject','llm:history','\x20→\x20chat:\x20','\x20->\x20WebSearch:','(no\x20message)','Error:\x20Project\x20name\x20is\x20required','image','Deleting\x20project\x20\x27','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','verbose','updatedAt','green','length','Set\x20current\x20project\x20context','output','cause','[error]\x20\x20','Error:\x20','model','\x27...','200250BvCvPW','targetWebSearchTool','llm:models','Error:\x20Agent\x20name\x20is\x20required','llm:agent:create','chats','description','starterMessage','prompt','\x20->\x20KB:','llm:agent:show','systemPrompt','entries','llm:project:delete','[unknown]','dim','deleteProject','No\x20messages\x20found\x20in\x20chat\x20history.','tool_call','limit','content','List\x20agents\x20in\x20current\x20project','stringify','[content]','llm','map','message','Fetching\x20chat\x20history\x20for\x20\x27','\x20->\x20Agent:','554886ufcKXF','\x20->\x20ImageGen:','3IOKszM','temperature','join','1894876IkubJX','createProject','filter','3092135LLdrSR','log','Project\x20deleted:\x20','json','resolveAgentId','llmProject','format','tool','\x0aStack\x20trace:','Creating\x20project\x20\x27','[input]\x20\x20','maxToolIterations','bold','11094dcrFZg','Agent\x20deleted:\x20','8169102qoZCpU','blue','claude-4.5-haiku','updateAgent'];a17_0x444d=function(){return _0xac6290;};return a17_0x444d();}const a17_0x7c43b3=a17_0x27ea;(function(_0x15d6e5,_0x2ff35d){const _0x317afb=a17_0x27ea,_0x3f6675=_0x15d6e5();while(!![]){try{const _0x3237be=-parseInt(_0x317afb(0x145))/0x1*(-parseInt(_0x317afb(0x107))/0x2)+-parseInt(_0x317afb(0x109))/0x3*(-parseInt(_0x317afb(0x10c))/0x4)+-parseInt(_0x317afb(0x10f))/0x5+-parseInt(_0x317afb(0x11c))/0x6*(-parseInt(_0x317afb(0x149))/0x7)+parseInt(_0x317afb(0x13a))/0x8+-parseInt(_0x317afb(0x11e))/0x9+parseInt(_0x317afb(0xea))/0xa*(-parseInt(_0x317afb(0x159))/0xb);if(_0x3237be===_0x2ff35d)break;else _0x3f6675['push'](_0x3f6675['shift']());}catch(_0x518e5b){_0x3f6675['push'](_0x3f6675['shift']());}}}(a17_0x444d,0x91bd2));function a17_0x27ea(_0x1d0b55,_0x3b76a7){const _0x444de8=a17_0x444d();return a17_0x27ea=function(_0x27eae9,_0x22ca2c){_0x27eae9=_0x27eae9-0xde;let _0x1c448d=_0x444de8[_0x27eae9];return _0x1c448d;},a17_0x27ea(_0x1d0b55,_0x3b76a7);}import{BaseCommand}from'./command.js';import{SDKError}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';function handleSDKError(_0x1b0adf,_0x260e37){const _0x51799b=a17_0x27ea;if(_0x1b0adf instanceof SDKError)console[_0x51799b(0x12c)](_0x51799b(0xe7)+_0x1b0adf[_0x51799b(0x104)]),_0x260e37[_0x51799b(0xdf)]&&(_0x1b0adf[_0x51799b(0xe5)]&&console[_0x51799b(0x12c)]('\x20\x20Cause:\x20'+_0x1b0adf['cause']),_0x1b0adf[_0x51799b(0x12b)]&&(console[_0x51799b(0x12c)](_0x51799b(0x117)),console[_0x51799b(0x12c)](_0x1b0adf[_0x51799b(0x12b)])));else throw _0x1b0adf;}function formatChatHistoryEntry(_0x31333c,_0x24d9dc){const _0x21ab87=a17_0x27ea,_0x520ae3=getChalk(_0x24d9dc),_0x4d555d=_0x520ae3[_0x21ab87(0xf9)](_0x31333c['at']);if('input'in _0x31333c){const _0x4c08a6=_0x520ae3[_0x21ab87(0x156)](_0x21ab87(0x119));return _0x4d555d+'\x20'+_0x4c08a6+':\x20'+_0x31333c[_0x21ab87(0x14f)];}if('content'in _0x31333c){const _0x142dcb=_0x520ae3[_0x21ab87(0xe1)](_0x21ab87(0x101));return _0x4d555d+'\x20'+_0x142dcb+':\x20'+_0x31333c[_0x21ab87(0xfe)];}if('tool_call'in _0x31333c){const _0x3579ca=_0x520ae3[_0x21ab87(0x12f)]('[tool_call]'),{functionName:_0x514406,functionArguments:_0x53b545,targetFunction:_0x3329e6}=_0x31333c[_0x21ab87(0xfc)];let _0x2ad44b=_0x4d555d+'\x20'+_0x3579ca+':\x20'+_0x520ae3['bold'](_0x514406);if(_0x53b545&&Object[_0x21ab87(0x158)](_0x53b545)[_0x21ab87(0xe2)]>0x0){const _0x54d399=Object[_0x21ab87(0xf6)](_0x53b545)[_0x21ab87(0x103)](([_0x4bcea4,_0x1d0f91])=>_0x4bcea4+'='+JSON['stringify'](_0x1d0f91))[_0x21ab87(0x10b)](',\x20');_0x2ad44b+='('+_0x54d399+')';}_0x3329e6&&(_0x2ad44b+=_0x520ae3[_0x21ab87(0xf9)]('\x20['+_0x3329e6+']'));let _0xdfcd7='';if(_0x31333c[_0x21ab87(0xfc)][_0x21ab87(0x146)])_0xdfcd7=_0x21ab87(0xf3)+_0x31333c[_0x21ab87(0xfc)][_0x21ab87(0x146)][_0x21ab87(0x13c)];else{if(_0x31333c[_0x21ab87(0xfc)][_0x21ab87(0x153)])_0xdfcd7=_0x21ab87(0x106)+_0x31333c[_0x21ab87(0xfc)]['targetAgent']['name'];else{if(_0x31333c[_0x21ab87(0xfc)][_0x21ab87(0xeb)])_0xdfcd7=_0x21ab87(0x160)+_0x31333c[_0x21ab87(0xfc)][_0x21ab87(0xeb)][_0x21ab87(0x13c)];else _0x31333c[_0x21ab87(0xfc)][_0x21ab87(0x136)]&&(_0xdfcd7=_0x21ab87(0x108)+_0x31333c['tool_call']['targetImageGenerator']['name']);}}return _0x2ad44b+_0xdfcd7;}if(_0x21ab87(0x116)in _0x31333c){const _0x2beb54=_0x520ae3['magenta'](_0x21ab87(0x139)),{functionName:_0x3cff3f,functionArguments:_0x2365bb,content:_0x3d67c0,newChat:_0x365848}=_0x31333c[_0x21ab87(0x116)];let _0xc61062=_0x4d555d+'\x20'+_0x2beb54+':\x20'+_0x520ae3[_0x21ab87(0x11b)](_0x3cff3f);if(_0x2365bb){const _0x3050e2=typeof _0x2365bb===_0x21ab87(0x140)?_0x2365bb:JSON[_0x21ab87(0x100)](_0x2365bb);_0xc61062+='('+_0x3050e2+')';}return _0x3d67c0&&(_0xc61062+='\x0a'+_0x520ae3['dim'](_0x3d67c0)),_0x365848&&(_0xc61062+=_0x520ae3[_0x21ab87(0xf9)](_0x21ab87(0x15f)+_0x365848['id'])),_0xc61062;}if(_0x21ab87(0xe4)in _0x31333c){const _0x1884d2=_0x520ae3[_0x21ab87(0x11f)](_0x21ab87(0x138));return _0x4d555d+'\x20'+_0x1884d2+':\x20'+_0x31333c[_0x21ab87(0xe4)][_0x21ab87(0x13c)]+'\x20('+_0x31333c['output'][_0x21ab87(0xfe)][_0x21ab87(0xe2)]+_0x21ab87(0x13e);}if('image'in _0x31333c){const _0x5d3d3a=_0x520ae3['blue'](_0x21ab87(0x14a)),{width:_0x5dcaf4,height:_0xca29ad,headerText:_0x283c9a}=_0x31333c[_0x21ab87(0x163)],_0x3a9d07=_0x283c9a?_0x21ab87(0x144)+_0x283c9a:'';return _0x4d555d+'\x20'+_0x5d3d3a+':\x20'+_0x5dcaf4+'x'+_0xca29ad+_0x3a9d07;}if('error'in _0x31333c){const _0x386218=_0x520ae3[_0x21ab87(0x147)](_0x21ab87(0xe6));return _0x4d555d+'\x20'+_0x386218+':\x20'+_0x31333c[_0x21ab87(0x12c)];}return _0x4d555d+'\x20'+_0x520ae3['dim'](_0x21ab87(0xf8))+':\x20'+JSON['stringify'](_0x31333c);}async function getProjectIdOrDefault(_0x4c4f8a){const _0x1385a1=a17_0x27ea,{tdx:_0x46d6b3,options:_0x569fb0}=_0x4c4f8a,_0x14903d=_0x569fb0[_0x1385a1(0x114)];if(_0x14903d){const _0x28e465=await withSpinner('Resolving\x20project\x20\x27'+_0x14903d+'\x27...',()=>_0x46d6b3[_0x1385a1(0x102)][_0x1385a1(0x133)](_0x14903d),{'verbose':_0x569fb0[_0x1385a1(0xdf)]});return _0x28e465['data'];}let _0xc556e4=_0x46d6b3[_0x1385a1(0x102)][_0x1385a1(0x129)]();if(_0xc556e4)return _0xc556e4;const _0x106c85=await withSpinner('Getting\x20default\x20project...',()=>_0x46d6b3['llm'][_0x1385a1(0x128)](),{'verbose':_0x569fb0['verbose']});return _0x106c85['data']['id'];}function toLLMProjectInfo(_0x14323f){const _0x41874e=a17_0x27ea;return{'name':_0x14323f[_0x41874e(0x13b)][_0x41874e(0x13c)],'description':_0x14323f[_0x41874e(0x13b)][_0x41874e(0xf0)],'createdAt':_0x14323f['attributes']['createdAt'],'updatedAt':_0x14323f[_0x41874e(0x13b)][_0x41874e(0xe0)]};}function toAgentInfo(_0x282174){const _0x5449ee=a17_0x27ea;return{'name':_0x282174[_0x5449ee(0x13b)][_0x5449ee(0x13c)],'description':_0x282174['attributes'][_0x5449ee(0xf0)],'prompt':truncatePrompt(_0x282174[_0x5449ee(0x13b)][_0x5449ee(0xf2)]),'createdAt':_0x282174[_0x5449ee(0x13b)][_0x5449ee(0x124)],'updatedAt':_0x282174[_0x5449ee(0x13b)]['updatedAt']};}function truncatePrompt(_0x1d86f6){const _0x31c072=a17_0x27ea;if(!_0x1d86f6)return undefined;const _0xbec5a1=0x64;if(_0x1d86f6['length']<=_0xbec5a1)return _0x1d86f6;return _0x1d86f6[_0x31c072(0x15c)](0x0,_0xbec5a1)+'...';}export class LLMModelsCommand extends BaseCommand{['name']=a17_0x7c43b3(0xec);[a17_0x7c43b3(0xf0)]=a17_0x7c43b3(0x152);async[a17_0x7c43b3(0x14c)](_0xe7b21f){const _0xc3b426=a17_0x7c43b3,{options:_0x5efbd7,tdx:_0x2f5cd3}=_0xe7b21f;try{const _0x262677=await withSpinner(_0xc3b426(0x151),()=>_0x2f5cd3[_0xc3b426(0x102)][_0xc3b426(0x130)](),{'verbose':_0x5efbd7[_0xc3b426(0xdf)]});return await handleSDKOutput(_0x262677[_0xc3b426(0x157)],_0x5efbd7),0x0;}catch(_0x13042e){return handleSDKError(_0x13042e,_0x5efbd7),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a17_0x7c43b3(0x125);[a17_0x7c43b3(0xf0)]=a17_0x7c43b3(0x15a);async[a17_0x7c43b3(0x14c)](_0x1e55c7){const _0x464fc7=a17_0x7c43b3,{options:_0x338607,args:_0x3e6dd2,tdx:_0x210aeb}=_0x1e55c7;try{const _0x375e03=_0x3e6dd2[0x0],_0x2afaf1=_0x338607[_0x464fc7(0xfd)]?Number(_0x338607[_0x464fc7(0xfd)]):0x32,_0x3b6489=await withSpinner('Fetching\x20projects...',()=>_0x210aeb[_0x464fc7(0x102)][_0x464fc7(0x142)](_0x2afaf1),{'verbose':_0x338607[_0x464fc7(0xdf)]});let _0x33fdf6=_0x3b6489[_0x464fc7(0x157)];_0x375e03&&(_0x33fdf6=_0x3b6489[_0x464fc7(0x157)]['filter'](_0x9b2583=>matchGlobPattern(_0x9b2583['attributes'][_0x464fc7(0x13c)],_0x375e03)));const _0x51f5e0=_0x33fdf6[_0x464fc7(0x103)](toLLMProjectInfo);return await handleSDKOutput(_0x51f5e0,_0x338607),0x0;}catch(_0x376670){return handleSDKError(_0x376670,_0x338607),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x7c43b3(0x13c)]=a17_0x7c43b3(0x134);['description']=a17_0x7c43b3(0xff);async[a17_0x7c43b3(0x14c)](_0x1835e1){const _0x42b959=a17_0x7c43b3,{options:_0x3cb001,args:_0x4a04ab,tdx:_0xa31a38}=_0x1835e1;try{const _0x5a1188=_0x4a04ab[0x0],_0x4e3b4e=await getProjectIdOrDefault(_0x1835e1),_0x3e6856=await withSpinner(_0x42b959(0x14b),()=>_0xa31a38[_0x42b959(0x102)][_0x42b959(0x154)](_0x4e3b4e),{'verbose':_0x3cb001[_0x42b959(0xdf)]});let _0x2f803a=_0x3e6856[_0x42b959(0x157)];_0x5a1188&&(_0x2f803a=_0x3e6856[_0x42b959(0x157)][_0x42b959(0x10e)](_0x566da1=>matchGlobPattern(_0x566da1[_0x42b959(0x13b)][_0x42b959(0x13c)],_0x5a1188)));const _0xc431f6=_0x2f803a[_0x42b959(0x103)](toAgentInfo);return await handleSDKOutput(_0xc431f6,_0x3cb001),0x0;}catch(_0x228969){return handleSDKError(_0x228969,_0x3cb001),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a17_0x7c43b3(0xf4);[a17_0x7c43b3(0xf0)]='Show\x20agent\x20details';async['execute'](_0x5a1e8f){const _0xb5ae06=a17_0x7c43b3,{options:_0x24a628,args:_0x17efa0,tdx:_0x538313}=_0x5a1e8f;if(_0x17efa0[_0xb5ae06(0xe2)]===0x0)return console[_0xb5ae06(0x12c)](_0xb5ae06(0xed)),console[_0xb5ae06(0x12c)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x474969=_0x17efa0[0x0];try{const _0x4131e1=await getProjectIdOrDefault(_0x5a1e8f),_0x166174=await withSpinner('Resolving\x20agent\x20\x27'+_0x474969+_0xb5ae06(0xe9),()=>_0x538313[_0xb5ae06(0x102)][_0xb5ae06(0x113)](_0x474969,_0x4131e1),{'verbose':_0x24a628[_0xb5ae06(0xdf)]}),_0x4128af=await withSpinner('Fetching\x20agent...',()=>_0x538313[_0xb5ae06(0x102)]['agent'](_0x166174[_0xb5ae06(0x157)]),{'verbose':_0x24a628['verbose']});return await handleSDKOutput([_0x4128af['data']],_0x24a628),0x0;}catch(_0x1edc45){return handleSDKError(_0x1edc45,_0x24a628),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a17_0x7c43b3(0xee);[a17_0x7c43b3(0xf0)]=a17_0x7c43b3(0x12e);async['execute'](_0x424456){const _0x4fd382=a17_0x7c43b3,{options:_0x564509,args:_0x30b9dd,tdx:_0x4a0917}=_0x424456;if(_0x30b9dd[_0x4fd382(0xe2)]===0x0)return console['error'](_0x4fd382(0xed)),console[_0x4fd382(0x12c)](_0x4fd382(0x13f)),0x1;const _0x48704d=_0x30b9dd[0x0],_0x5ea972=_0x564509,_0x2c57a6=_0x5ea972[_0x4fd382(0xf5)],_0x3c3f9b=_0x5ea972[_0x4fd382(0xe8)]||_0x4fd382(0x120),_0x6bea01=_0x5ea972[_0x4fd382(0xf1)],_0x42e23d=_0x5ea972['maxToolIterations']?Number(_0x5ea972[_0x4fd382(0x11a)]):undefined,_0x2ebf07=_0x5ea972[_0x4fd382(0x10a)]?Number(_0x5ea972[_0x4fd382(0x10a)]):undefined;try{const _0x55a42f=await getProjectIdOrDefault(_0x424456),_0x27709a=await withSpinner(_0x4fd382(0x155)+_0x48704d+_0x4fd382(0xe9),()=>_0x4a0917[_0x4fd382(0x102)]['createAgent']({'name':_0x48704d,'projectId':_0x55a42f,'modelType':_0x3c3f9b,'systemPrompt':_0x2c57a6,'starterMessage':_0x6bea01,'maxToolIterations':_0x42e23d,'temperature':_0x2ebf07}),{'verbose':_0x564509[_0x4fd382(0xdf)]});return console[_0x4fd382(0x110)]('Agent\x20created:\x20'+_0x27709a[_0x4fd382(0x157)]['id']),await handleSDKOutput([_0x27709a[_0x4fd382(0x157)]],_0x564509),0x0;}catch(_0x9ba075){return handleSDKError(_0x9ba075,_0x564509),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x7c43b3(0x13c)]='llm:agent:update';['description']=a17_0x7c43b3(0x12d);async[a17_0x7c43b3(0x14c)](_0x4add70){const _0x54e4c8=a17_0x7c43b3,{options:_0x19e9cc,args:_0x3cbed7,tdx:_0x33edbf}=_0x4add70;if(_0x3cbed7[_0x54e4c8(0xe2)]===0x0)return console[_0x54e4c8(0x12c)](_0x54e4c8(0xed)),console[_0x54e4c8(0x12c)](_0x54e4c8(0x13d)),0x1;const _0x4dd297=_0x3cbed7[0x0],_0x849d8e=_0x19e9cc,_0x4857e6=_0x849d8e[_0x54e4c8(0x13c)],_0x2acd52=_0x849d8e[_0x54e4c8(0xf2)],_0x2a67ac=_0x849d8e[_0x54e4c8(0xf0)],_0x43dfe2=_0x849d8e[_0x54e4c8(0xf1)];if(!_0x4857e6&&!_0x2acd52&&!_0x2a67ac&&!_0x43dfe2)return console[_0x54e4c8(0x12c)]('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console[_0x54e4c8(0x12c)](_0x54e4c8(0x150)),0x1;try{const _0x5363fd=await getProjectIdOrDefault(_0x4add70),_0x1dee98=await withSpinner(_0x54e4c8(0x141)+_0x4dd297+_0x54e4c8(0xe9),()=>_0x33edbf['llm'][_0x54e4c8(0x113)](_0x4dd297,_0x5363fd),{'verbose':_0x19e9cc[_0x54e4c8(0xdf)]}),_0x421be6=_0x1dee98[_0x54e4c8(0x157)],_0x18a101=await withSpinner(_0x54e4c8(0x122),()=>_0x33edbf[_0x54e4c8(0x102)][_0x54e4c8(0x121)](_0x421be6,{'name':_0x4857e6,'prompt':_0x2acd52,'description':_0x2a67ac,'starterMessage':_0x43dfe2}),{'verbose':_0x19e9cc[_0x54e4c8(0xdf)]});return console['log'](_0x54e4c8(0x14e)+_0x18a101[_0x54e4c8(0x157)]['id']),await handleSDKOutput([_0x18a101[_0x54e4c8(0x157)]],_0x19e9cc),0x0;}catch(_0x28a255){return handleSDKError(_0x28a255,_0x19e9cc),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']='llm:agent:delete';['description']=a17_0x7c43b3(0x143);async['execute'](_0x3ab486){const _0x58b865=a17_0x7c43b3,{options:_0x4c2997,args:_0x141898,tdx:_0x308e6e}=_0x3ab486;if(_0x141898[_0x58b865(0xe2)]===0x0)return console[_0x58b865(0x12c)](_0x58b865(0xed)),console[_0x58b865(0x12c)](_0x58b865(0x127)),0x1;const _0x2a0847=_0x141898[0x0];try{const _0x56be42=await getProjectIdOrDefault(_0x3ab486),_0x178afb=await withSpinner(_0x58b865(0x141)+_0x2a0847+_0x58b865(0xe9),()=>_0x308e6e['llm'][_0x58b865(0x113)](_0x2a0847,_0x56be42),{'verbose':_0x4c2997[_0x58b865(0xdf)]}),_0x521939=_0x178afb[_0x58b865(0x157)];return await withSpinner(_0x58b865(0x137),()=>_0x308e6e[_0x58b865(0x102)][_0x58b865(0x14d)](_0x521939),{'verbose':_0x4c2997[_0x58b865(0xdf)]}),console[_0x58b865(0x110)](_0x58b865(0x11d)+_0x521939),0x0;}catch(_0x2fd65f){return handleSDKError(_0x2fd65f,_0x4c2997),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x7c43b3(0x13c)]=a17_0x7c43b3(0x15e);[a17_0x7c43b3(0xf0)]=a17_0x7c43b3(0x148);async['execute'](_0x2a4e30){const _0x47288b=a17_0x7c43b3,{options:_0x22f982,args:_0x5aa1f8,tdx:_0x45d795}=_0x2a4e30,_0x4d5465=_0x5aa1f8[0x0];try{if(!_0x4d5465){const _0x623c6a=_0x22f982[_0x47288b(0xfd)]?Number(_0x22f982[_0x47288b(0xfd)]):0x32,_0x237ef7=await withSpinner(_0x47288b(0x12a),()=>_0x45d795[_0x47288b(0x102)][_0x47288b(0xef)](_0x623c6a),{'verbose':_0x22f982['verbose']});if(_0x22f982[_0x47288b(0x115)]===_0x47288b(0x112)||_0x22f982[_0x47288b(0x115)]==='jsonl')await handleSDKOutput(_0x237ef7[_0x47288b(0x157)],_0x22f982);else{const _0x48e528=_0x237ef7[_0x47288b(0x157)][_0x47288b(0x103)](_0x43f7ce=>({'created_at':_0x43f7ce[_0x47288b(0x13b)][_0x47288b(0x124)],'chat_id':_0x43f7ce['id'],'first_input':_0x43f7ce['attributes']['firstInputContent']||_0x47288b(0x161)}));await handleSDKOutput(_0x48e528,_0x22f982);}return 0x0;}else{const _0x361a14=await withSpinner(_0x47288b(0x105)+_0x4d5465+_0x47288b(0xe9),()=>_0x45d795[_0x47288b(0x102)][_0x47288b(0x126)](_0x4d5465),{'verbose':_0x22f982[_0x47288b(0xdf)]}),_0x2cdd46=_0x361a14[_0x47288b(0x157)][_0x47288b(0x157)]??[];if(_0x2cdd46[_0x47288b(0xe2)]===0x0)return console[_0x47288b(0x110)](_0x47288b(0xfb)),0x0;if(_0x22f982['format']===_0x47288b(0x112)||_0x22f982[_0x47288b(0x115)]==='jsonl'||_0x22f982[_0x47288b(0x115)]===_0x47288b(0x131)||_0x22f982[_0x47288b(0x115)]==='tsv')await handleSDKOutput(_0x2cdd46,_0x22f982);else for(const _0x1aceb8 of _0x2cdd46){console[_0x47288b(0x110)](formatChatHistoryEntry(_0x1aceb8,_0x22f982));}return 0x0;}}catch(_0x41f58f){return handleSDKError(_0x41f58f,_0x22f982),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x7c43b3(0x13c)]=a17_0x7c43b3(0x132);[a17_0x7c43b3(0xf0)]=a17_0x7c43b3(0xe3);async[a17_0x7c43b3(0x14c)](_0x20d0fd){const _0x3cddda=a17_0x7c43b3,{options:_0x521734,args:_0x3e41d0,tdx:_0x386ead}=_0x20d0fd;if(_0x3e41d0[_0x3cddda(0xe2)]===0x0)return console[_0x3cddda(0x12c)](_0x3cddda(0x162)),console[_0x3cddda(0x12c)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x8328a1=_0x3e41d0[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x8328a1+_0x3cddda(0xe9),()=>_0x386ead['llm'][_0x3cddda(0x15d)](_0x8328a1),{'verbose':_0x521734[_0x3cddda(0xdf)]}),console[_0x3cddda(0x110)](_0x3cddda(0x15b)+_0x8328a1),0x0;}catch(_0x25f560){return handleSDKError(_0x25f560,_0x521734),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']='llm:project:create';[a17_0x7c43b3(0xf0)]=a17_0x7c43b3(0x123);async[a17_0x7c43b3(0x14c)](_0x10e955){const _0x2eea08=a17_0x7c43b3,{options:_0x189313,args:_0x2b7140,tdx:_0x53a44f}=_0x10e955;if(_0x2b7140[_0x2eea08(0xe2)]===0x0)return console[_0x2eea08(0x12c)](_0x2eea08(0x162)),console[_0x2eea08(0x12c)](_0x2eea08(0xde)),0x1;const _0x31fbad=_0x2b7140[0x0],_0x4cd567=_0x189313,_0x4dad2e=_0x4cd567['description'];try{const _0x5daf6b=await withSpinner(_0x2eea08(0x118)+_0x31fbad+_0x2eea08(0xe9),()=>_0x53a44f['llm'][_0x2eea08(0x10d)]({'name':_0x31fbad,'description':_0x4dad2e}),{'verbose':_0x189313[_0x2eea08(0xdf)]});console['log']('Project\x20created:\x20'+_0x5daf6b['data']['id']);const _0x454809=toLLMProjectInfo(_0x5daf6b['data']);return await handleSDKOutput([_0x454809],_0x189313),0x0;}catch(_0x5a8f20){return handleSDKError(_0x5a8f20,_0x189313),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x7c43b3(0x13c)]=a17_0x7c43b3(0xf7);[a17_0x7c43b3(0xf0)]='Delete\x20an\x20LLM\x20project';async[a17_0x7c43b3(0x14c)](_0xd9b063){const _0x1d04a4=a17_0x7c43b3,{options:_0x276c01,args:_0x5a8499,tdx:_0x36166d}=_0xd9b063;if(_0x5a8499[_0x1d04a4(0xe2)]===0x0)return console[_0x1d04a4(0x12c)](_0x1d04a4(0x162)),console[_0x1d04a4(0x12c)](_0x1d04a4(0x135)),0x1;const _0x530777=_0x5a8499[0x0];try{return await withSpinner(_0x1d04a4(0x164)+_0x530777+_0x1d04a4(0xe9),()=>_0x36166d[_0x1d04a4(0x102)][_0x1d04a4(0xfa)](_0x530777),{'verbose':_0x276c01[_0x1d04a4(0xdf)]}),console[_0x1d04a4(0x110)](_0x1d04a4(0x111)+_0x530777),0x0;}catch(_0x21862c){return handleSDKError(_0x21862c,_0x276c01),0x1;}}}
@@ -1 +1 @@
1
- const a18_0x5b723d=a18_0x1d69;(function(_0x5ad11e,_0x26cc31){const _0x55bdd9=a18_0x1d69,_0x1fbaee=_0x5ad11e();while(!![]){try{const _0x51e8c1=parseInt(_0x55bdd9(0xc8))/0x1+parseInt(_0x55bdd9(0xd3))/0x2+parseInt(_0x55bdd9(0xb5))/0x3+-parseInt(_0x55bdd9(0xcc))/0x4*(parseInt(_0x55bdd9(0xb0))/0x5)+parseInt(_0x55bdd9(0xa8))/0x6+parseInt(_0x55bdd9(0xb2))/0x7*(-parseInt(_0x55bdd9(0xdb))/0x8)+-parseInt(_0x55bdd9(0xa0))/0x9;if(_0x51e8c1===_0x26cc31)break;else _0x1fbaee['push'](_0x1fbaee['shift']());}catch(_0x2bfb35){_0x1fbaee['push'](_0x1fbaee['shift']());}}}(a18_0x4771,0x5472d));function a18_0x1d69(_0xf7a53d,_0x5b5029){const _0x477110=a18_0x4771();return a18_0x1d69=function(_0x1d6972,_0x4394c6){_0x1d6972=_0x1d6972-0xa0;let _0x4edcdf=_0x477110[_0x1d6972];return _0x4edcdf;},a18_0x1d69(_0xf7a53d,_0x5b5029);}import a18_0x430df0 from'chalk';function a18_0x4771(){const _0x748ae9=['4120344gUlCrG','yellow','\x0aClaude\x20Code\x20Configuration:','llmProject','bold','site','\x27\x20not\x20found','exit','75seZmPN','getOrCreateDefaultProject','7doGHlf','project','description','1867728dePUOQ','Server\x20Configuration:','log','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','port','Project\x20\x27','stop','http://0.0.0.0:','NOT_FOUND','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','find','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','green','Resolving\x20project...','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','server','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','name','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22dummy\x22,','459674dkgHFX','\x20is\x20unavailable,\x20using\x20port\x20','\x20\x20\x20\x20\x22env\x22:\x20{','SIGTERM','139452YhUvob','\x0aTesting\x20with\x20Agent\x20SDK:','\x20\x20}','cyan','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','white','702686EcApjT','start','SIGINT','dim','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','✓\x20Proxy\x20server\x20stopped','attributes','created\x20on-demand\x20per\x20model','2448624pLjQMm','8508537ffvrCc','\x20\x20Site:','llm:proxy','execute','Port\x20','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','\x20\x20Agents:','llm'];a18_0x4771=function(){return _0x748ae9;};return a18_0x4771();}import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x19abb9,_0x3b0a82){const _0x41a79c=a18_0x1d69,{tdx:_0x971e1d,options:_0x2b28a5}=_0x19abb9,_0x27ddd6=_0x3b0a82||_0x2b28a5[_0x41a79c(0xab)];if(_0x27ddd6){const _0x11e417=await _0x971e1d[_0x41a79c(0xa7)]['projects'](),_0x5b06e7=_0x11e417['find'](_0x27d28f=>_0x27d28f[_0x41a79c(0xd9)][_0x41a79c(0xc6)]===_0x27ddd6);if(!_0x5b06e7)throw new SDKError(ErrorCode[_0x41a79c(0xbd)],_0x41a79c(0xba)+_0x27ddd6+_0x41a79c(0xae),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x5b06e7['id'];}const _0x545759=await _0x971e1d[_0x41a79c(0xa7)][_0x41a79c(0xb1)]();return _0x545759['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a18_0x5b723d(0xa2);[a18_0x5b723d(0xb4)]=a18_0x5b723d(0xc5);['server'];async[a18_0x5b723d(0xa3)](_0x435783){const _0x372a58=a18_0x5b723d,{tdx:_0x275ffe,options:_0x1dacaf}=_0x435783;try{const _0x1354d9=_0x1dacaf,_0x5c610d=_0x1354d9[_0x372a58(0xb9)]||0xfa0,_0x4d8c20=_0x1354d9[_0x372a58(0xb3)],_0xe61271=_0x1354d9['debug'],_0xdd99d7=await findAvailablePort(_0x5c610d);console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd6)](_0x372a58(0xc2)));const _0x6fb81b=await getProjectIdOrDefault(_0x435783,_0x4d8c20),_0x1a9609=await _0x275ffe[_0x372a58(0xa7)]['projects'](),_0x3e0481=_0x1a9609[_0x372a58(0xbf)](_0x34bf71=>_0x34bf71['id']===_0x6fb81b);console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd6)]('Starting\x20proxy\x20server...'));_0xdd99d7!==_0x5c610d&&console['log'](a18_0x430df0[_0x372a58(0xa9)](_0x372a58(0xa4)+_0x5c610d+_0x372a58(0xc9)+_0xdd99d7));this['server']=new ProxyServer({'port':_0xdd99d7,'projectId':_0x6fb81b,'tdx':_0x275ffe,'debug':_0xe61271}),await this['server'][_0x372a58(0xd4)](),console['log'](a18_0x430df0['yellow'][_0x372a58(0xac)](_0x372a58(0xd0))),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xa9)](_0x372a58(0xbe))),console['log'](a18_0x430df0[_0x372a58(0xa9)](_0x372a58(0xd1))),console['log'](a18_0x430df0[_0x372a58(0xc1)][_0x372a58(0xac)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xcf)](_0x372a58(0xb6))),console['log'](a18_0x430df0[_0x372a58(0xd6)]('\x20\x20Address:'),a18_0x430df0[_0x372a58(0xd2)](_0x372a58(0xbc)+_0xdd99d7)),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd6)]('\x20\x20Project:'),a18_0x430df0[_0x372a58(0xd2)](_0x3e0481?.[_0x372a58(0xd9)][_0x372a58(0xc6)]||_0x6fb81b)),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd6)](_0x372a58(0xa6)),a18_0x430df0['white'](_0x372a58(0xda))),console['log'](a18_0x430df0[_0x372a58(0xd6)](_0x372a58(0xa1)),a18_0x430df0[_0x372a58(0xd2)](_0x1dacaf[_0x372a58(0xad)]));_0xe61271&&console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xa9)]('\x20\x20Debug:'),a18_0x430df0[_0x372a58(0xd2)]('enabled\x20(request/response\x20logging\x20to\x20stderr)'));console['log'](a18_0x430df0[_0x372a58(0xcf)](_0x372a58(0xaa))),console[_0x372a58(0xb7)](a18_0x430df0['dim'](_0x372a58(0xc3))),console['log'](a18_0x430df0[_0x372a58(0xd2)]('\x20\x20{')),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd2)](_0x372a58(0xca))),console[_0x372a58(0xb7)](a18_0x430df0['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0xdd99d7+'\x22,')),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd2)](_0x372a58(0xc7))),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd2)](_0x372a58(0xa5))),console['log'](a18_0x430df0[_0x372a58(0xd2)]('\x20\x20\x20\x20}')),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd2)](_0x372a58(0xce))),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xcf)](_0x372a58(0xcd))),console['log'](a18_0x430df0[_0x372a58(0xd6)](_0x372a58(0xb8))),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd6)](_0x372a58(0xd7))),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xd6)](_0x372a58(0xc0))),console[_0x372a58(0xb7)](a18_0x430df0[_0x372a58(0xa9)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x2aecb8=async()=>{const _0x462a2b=_0x372a58;console['log'](a18_0x430df0['dim']('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this['server']&&await this['server'][_0x462a2b(0xbb)](),console[_0x462a2b(0xb7)](a18_0x430df0[_0x462a2b(0xc1)](_0x462a2b(0xd8))),process[_0x462a2b(0xaf)](0x0);};return process['on'](_0x372a58(0xd5),_0x2aecb8),process['on'](_0x372a58(0xcb),_0x2aecb8),await new Promise(()=>{}),0x0;}catch(_0x48f85b){this[_0x372a58(0xc4)]&&await this[_0x372a58(0xc4)]['stop']();throw _0x48f85b;}}}
1
+ const a18_0x1c9f4e=a18_0xa971;function a18_0xa971(_0x2bbadf,_0x24d4da){const _0x322491=a18_0x3224();return a18_0xa971=function(_0xa9718d,_0x37285d){_0xa9718d=_0xa9718d-0x131;let _0xfea1eb=_0x322491[_0xa9718d];return _0xfea1eb;},a18_0xa971(_0x2bbadf,_0x24d4da);}(function(_0x43b89e,_0x5824f8){const _0x330963=a18_0xa971,_0x21a6e=_0x43b89e();while(!![]){try{const _0x29f4d7=parseInt(_0x330963(0x15a))/0x1*(parseInt(_0x330963(0x15d))/0x2)+parseInt(_0x330963(0x163))/0x3+parseInt(_0x330963(0x14d))/0x4*(-parseInt(_0x330963(0x13b))/0x5)+parseInt(_0x330963(0x169))/0x6*(parseInt(_0x330963(0x15f))/0x7)+-parseInt(_0x330963(0x141))/0x8+-parseInt(_0x330963(0x150))/0x9*(-parseInt(_0x330963(0x158))/0xa)+-parseInt(_0x330963(0x139))/0xb*(parseInt(_0x330963(0x13f))/0xc);if(_0x29f4d7===_0x5824f8)break;else _0x21a6e['push'](_0x21a6e['shift']());}catch(_0x5650b5){_0x21a6e['push'](_0x21a6e['shift']());}}}(a18_0x3224,0xf24ec));import a18_0x108241 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x3fd1d3,_0x21188f){const _0xe9d39e=a18_0xa971,{tdx:_0x46e2de,options:_0x357a62}=_0x3fd1d3,_0x9baa2e=_0x21188f||_0x357a62[_0xe9d39e(0x154)];if(_0x9baa2e){const _0x3722ce=await _0x46e2de['llm'][_0xe9d39e(0x162)](),_0x21e503=_0x3722ce[_0xe9d39e(0x14f)](_0xa38adb=>_0xa38adb[_0xe9d39e(0x14c)][_0xe9d39e(0x166)]===_0x9baa2e);if(!_0x21e503)throw new SDKError(ErrorCode[_0xe9d39e(0x16f)],'Project\x20\x27'+_0x9baa2e+_0xe9d39e(0x153),undefined,{'helpText':_0xe9d39e(0x160)});return _0x21e503['id'];}const _0x70ff24=await _0x46e2de[_0xe9d39e(0x156)]['getOrCreateDefaultProject']();return _0x70ff24['id'];}export class LLMProxyCommand extends BaseCommand{[a18_0x1c9f4e(0x166)]=a18_0x1c9f4e(0x16a);[a18_0x1c9f4e(0x148)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';['server'];async[a18_0x1c9f4e(0x13e)](_0x175eb2){const _0x1c812f=a18_0x1c9f4e,{tdx:_0x167875,options:_0x280edf}=_0x175eb2;try{const _0x37229f=_0x280edf,_0xd6e20d=_0x37229f[_0x1c812f(0x167)]||0xfa0,_0x36b8f0=_0x37229f[_0x1c812f(0x143)],_0x4c16e2=_0x37229f[_0x1c812f(0x159)],_0x211325=await findAvailablePort(_0xd6e20d);console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x147)]('Resolving\x20project...'));const _0x3a70b6=await getProjectIdOrDefault(_0x175eb2,_0x36b8f0),_0x5854f9=await _0x167875[_0x1c812f(0x156)][_0x1c812f(0x162)](),_0x2f1137=_0x5854f9[_0x1c812f(0x14f)](_0x5b9c03=>_0x5b9c03['id']===_0x3a70b6);console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x147)]('Starting\x20proxy\x20server...'));_0x211325!==_0xd6e20d&&console[_0x1c812f(0x14b)](a18_0x108241['yellow'](_0x1c812f(0x134)+_0xd6e20d+_0x1c812f(0x13c)+_0x211325));this['server']=new ProxyServer({'port':_0x211325,'projectId':_0x3a70b6,'tdx':_0x167875,'debug':_0x4c16e2}),await this[_0x1c812f(0x16c)][_0x1c812f(0x149)](),console['log'](a18_0x108241['yellow']['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x1c812f(0x14b)](a18_0x108241['yellow']('This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.')),console['log'](a18_0x108241[_0x1c812f(0x157)](_0x1c812f(0x146))),console['log'](a18_0x108241[_0x1c812f(0x15b)][_0x1c812f(0x15c)](_0x1c812f(0x131))),console[_0x1c812f(0x14b)](a18_0x108241['cyan'](_0x1c812f(0x133))),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x147)](_0x1c812f(0x161)),a18_0x108241[_0x1c812f(0x144)](_0x1c812f(0x14a)+_0x211325)),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x147)](_0x1c812f(0x13a)),a18_0x108241[_0x1c812f(0x144)](_0x2f1137?.[_0x1c812f(0x14c)][_0x1c812f(0x166)]||_0x3a70b6)),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x147)](_0x1c812f(0x16e)),a18_0x108241[_0x1c812f(0x144)](_0x1c812f(0x14e))),console[_0x1c812f(0x14b)](a18_0x108241['dim'](_0x1c812f(0x16d)),a18_0x108241[_0x1c812f(0x144)](_0x280edf[_0x1c812f(0x132)]));_0x4c16e2&&console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x157)](_0x1c812f(0x140)),a18_0x108241[_0x1c812f(0x144)]('enabled\x20(request/response\x20logging\x20to\x20stderr)'));console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x137)](_0x1c812f(0x152))),console[_0x1c812f(0x14b)](a18_0x108241['dim']('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x144)](_0x1c812f(0x165))),console['log'](a18_0x108241[_0x1c812f(0x144)](_0x1c812f(0x13d))),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x144)](_0x1c812f(0x171)+_0x211325+'\x22,')),console[_0x1c812f(0x14b)](a18_0x108241['white'](_0x1c812f(0x164))),console[_0x1c812f(0x14b)](a18_0x108241['white'](_0x1c812f(0x168))),console[_0x1c812f(0x14b)](a18_0x108241['white'](_0x1c812f(0x16b))),console['log'](a18_0x108241['white'](_0x1c812f(0x155))),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x137)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0x1c812f(0x14b)](a18_0x108241['dim'](_0x1c812f(0x145))),console['log'](a18_0x108241[_0x1c812f(0x147)](_0x1c812f(0x142))),console['log'](a18_0x108241[_0x1c812f(0x147)](_0x1c812f(0x170))),console[_0x1c812f(0x14b)](a18_0x108241[_0x1c812f(0x157)](_0x1c812f(0x15e)));const _0x45b84f=async()=>{const _0x5a13eb=_0x1c812f;console[_0x5a13eb(0x14b)](a18_0x108241[_0x5a13eb(0x147)](_0x5a13eb(0x136))),this[_0x5a13eb(0x16c)]&&await this[_0x5a13eb(0x16c)][_0x5a13eb(0x151)](),console['log'](a18_0x108241[_0x5a13eb(0x15b)]('✓\x20Proxy\x20server\x20stopped')),process['exit'](0x0);};return process['on'](_0x1c812f(0x138),_0x45b84f),process['on'](_0x1c812f(0x135),_0x45b84f),await new Promise(()=>{}),0x0;}catch(_0x3971bf){this['server']&&await this['server'][_0x1c812f(0x151)]();throw _0x3971bf;}}}function a18_0x3224(){const _0x41323f=['Server\x20Configuration:','Port\x20','SIGTERM','\x0a\x0aShutting\x20down\x20proxy\x20server...','cyan','SIGINT','11LzMEmc','\x20\x20Project:','30rIQVsn','\x20is\x20unavailable,\x20using\x20port\x20','\x20\x20\x20\x20\x22env\x22:\x20{','execute','29853588DGxujO','\x20\x20Debug:','8961864CTJFEX','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','project','white','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','dim','description','start','http://0.0.0.0:','log','attributes','1004620EiuZMV','created\x20on-demand\x20per\x20model','find','62244ucHTaF','stop','\x0aClaude\x20Code\x20Configuration:','\x27\x20not\x20found','llmProject','\x20\x20}','llm','yellow','1830BdbBJo','debug','900eKlhWx','green','bold','4126ciUFaE','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','81319UkYLre','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20Address:','projects','5574831TQxaTP','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22dummy\x22,','\x20\x20{','name','port','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','582MCpful','llm:proxy','\x20\x20\x20\x20}','server','\x20\x20Site:','\x20\x20Agents:','NOT_FOUND','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','site'];a18_0x3224=function(){return _0x41323f;};return a18_0x3224();}
@@ -1 +1 @@
1
- const a19_0x938094=a19_0x551a;function a19_0x551a(_0x26fe72,_0x3970e4){const _0x516324=a19_0x5163();return a19_0x551a=function(_0x551acd,_0x38cb13){_0x551acd=_0x551acd-0x14c;let _0x468aab=_0x516324[_0x551acd];return _0x468aab;},a19_0x551a(_0x26fe72,_0x3970e4);}(function(_0x46f05b,_0x5a592c){const _0x215f73=a19_0x551a,_0x124c35=_0x46f05b();while(!![]){try{const _0x49f105=parseInt(_0x215f73(0x162))/0x1+-parseInt(_0x215f73(0x157))/0x2+-parseInt(_0x215f73(0x15e))/0x3+parseInt(_0x215f73(0x165))/0x4*(-parseInt(_0x215f73(0x178))/0x5)+-parseInt(_0x215f73(0x169))/0x6+parseInt(_0x215f73(0x16e))/0x7*(parseInt(_0x215f73(0x15b))/0x8)+-parseInt(_0x215f73(0x155))/0x9*(-parseInt(_0x215f73(0x14f))/0xa);if(_0x49f105===_0x5a592c)break;else _0x124c35['push'](_0x124c35['shift']());}catch(_0xb64f4e){_0x124c35['push'](_0x124c35['shift']());}}}(a19_0x5163,0x45e7b));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';function a19_0x5163(){const _0x21038e=['table','createParent','site','9rxSPWG','master','612858JPLFPs','segment:parent:create','addAttributes','addBehaviorsFile','248gfkOwK','✔\x20Created\x20parent\x20segment\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)','250974wgSKxo','\x27...','customerGroup','Site:\x20','11021sxvmPX','execute','description','2032588JVVFHq','addAttributesFile','Update\x20existing\x20parent\x20segment\x20(audience)','name','3115740GkBnpF','Error:\x20--database\x20and\x20--table\x20are\x20required','Parent\x20segment:\x20','updateParent','attributes','58933BkPAyl','addBehaviors','data','verbose','behaviorsFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Database:\x20','scheduleOption','behaviors','timezone','5CXklld','scheduleType','length','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Error:\x20Parent\x20segment\x20name\x20is\x20required','database','Name:\x20','segment','segment:parent:update','Table:\x20','14318450OerlxW','error','\x27\x20with\x20ID:\x20'];a19_0x5163=function(){return _0x21038e;};return a19_0x5163();}export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x938094(0x168)]=a19_0x938094(0x158);[a19_0x938094(0x164)]=a19_0x938094(0x15d);async['execute'](_0x2023bb){const _0x5bb1ec=a19_0x938094,{options:_0x2d3622,args:_0x4cb9ae,tdx:_0x2b4ddc}=_0x2023bb,_0x2a4541=_0x2d3622;if(_0x4cb9ae[_0x5bb1ec(0x17a)]===0x0)return console[_0x5bb1ec(0x150)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x173)),0x1;const _0x122c9e=_0x4cb9ae[0x0];if(!_0x2a4541['database']||!_0x2a4541[_0x5bb1ec(0x152)])return console[_0x5bb1ec(0x150)](_0x5bb1ec(0x16a)),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x173)),0x1;_0x2a4541[_0x5bb1ec(0x171)]&&(console[_0x5bb1ec(0x150)](_0x5bb1ec(0x161)+_0x2a4541[_0x5bb1ec(0x154)]),console['error'](_0x5bb1ec(0x17f)+_0x122c9e),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x174)+_0x2a4541[_0x5bb1ec(0x17e)]),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x14e)+_0x2a4541[_0x5bb1ec(0x152)]));const _0x379b24=await loadJSONFromOptions(_0x2a4541[_0x5bb1ec(0x16d)],_0x2a4541['attributesFile']),_0x548968=await loadJSONFromOptions(_0x2a4541['behaviors'],_0x2a4541[_0x5bb1ec(0x172)]),_0x29a622=await loadJSONFromOptions(_0x2a4541[_0x5bb1ec(0x160)],_0x2a4541['customerGroupFile']),_0x528207={'name':_0x122c9e,'description':_0x2a4541[_0x5bb1ec(0x164)],'scheduleType':_0x2a4541['scheduleType'],'scheduleOption':_0x2a4541[_0x5bb1ec(0x175)],'timezone':_0x2a4541[_0x5bb1ec(0x177)],'master':{'parentDatabaseName':_0x2a4541[_0x5bb1ec(0x17e)],'parentTableName':_0x2a4541[_0x5bb1ec(0x152)]},'attributes':_0x379b24,'behaviors':_0x548968,'customerGroup':_0x29a622},_0x27d8de=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x122c9e+'\x27...',()=>_0x2b4ddc[_0x5bb1ec(0x14c)][_0x5bb1ec(0x153)](_0x528207),{'verbose':_0x2d3622[_0x5bb1ec(0x171)]}),_0x3c8499=_0x27d8de[_0x5bb1ec(0x170)];return console[_0x5bb1ec(0x150)](_0x5bb1ec(0x15c)+_0x3c8499[_0x5bb1ec(0x168)]+_0x5bb1ec(0x151)+_0x3c8499['id']),await handleSDKOutput([_0x3c8499],_0x2d3622),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x938094(0x14d);[a19_0x938094(0x164)]=a19_0x938094(0x167);async[a19_0x938094(0x163)](_0x449d80){const _0x3e3f98=a19_0x938094,{options:_0x3afa42,args:_0xc42d71,tdx:_0x154290}=_0x449d80,_0x4c6ea3=_0x3afa42;if(_0xc42d71[_0x3e3f98(0x17a)]===0x0)return console[_0x3e3f98(0x150)](_0x3e3f98(0x17d)),console[_0x3e3f98(0x150)](_0x3e3f98(0x17c)),0x1;const _0x55798c=_0xc42d71[0x0];_0x4c6ea3[_0x3e3f98(0x171)]&&(console[_0x3e3f98(0x150)](_0x3e3f98(0x161)+_0x4c6ea3[_0x3e3f98(0x154)]),console[_0x3e3f98(0x150)](_0x3e3f98(0x16b)+_0x55798c));const _0x5b6263=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x55798c+_0x3e3f98(0x15f),()=>_0x154290[_0x3e3f98(0x14c)]['getParentFull'](_0x55798c),{'verbose':_0x4c6ea3[_0x3e3f98(0x171)]}),_0x28acde=_0x5b6263['data'],_0x1ec822=await loadJSONFromOptions(_0x4c6ea3[_0x3e3f98(0x159)],_0x4c6ea3[_0x3e3f98(0x166)]),_0x3b326e=await loadJSONFromOptions(_0x4c6ea3[_0x3e3f98(0x16f)],_0x4c6ea3[_0x3e3f98(0x15a)]),_0x227b18={'name':_0x28acde[_0x3e3f98(0x168)],'description':_0x4c6ea3[_0x3e3f98(0x164)]!==undefined?_0x4c6ea3['description']:_0x28acde[_0x3e3f98(0x164)],'scheduleType':_0x4c6ea3[_0x3e3f98(0x179)]!==undefined?_0x4c6ea3[_0x3e3f98(0x179)]:_0x28acde[_0x3e3f98(0x179)],'scheduleOption':_0x4c6ea3['scheduleOption']!==undefined?_0x4c6ea3[_0x3e3f98(0x175)]:_0x28acde[_0x3e3f98(0x175)],'timezone':_0x4c6ea3[_0x3e3f98(0x177)]!==undefined?_0x4c6ea3[_0x3e3f98(0x177)]:_0x28acde[_0x3e3f98(0x177)],'master':_0x28acde[_0x3e3f98(0x156)],'attributes':_0x1ec822?[..._0x28acde[_0x3e3f98(0x16d)]||[],..._0x1ec822]:_0x28acde[_0x3e3f98(0x16d)],'behaviors':_0x3b326e?[..._0x28acde[_0x3e3f98(0x176)]||[],..._0x3b326e]:_0x28acde[_0x3e3f98(0x176)],'customerGroup':_0x28acde['customerGroup']},_0x14652e=await withSpinner(_0x3e3f98(0x17b)+_0x55798c+'\x27...',()=>_0x154290[_0x3e3f98(0x14c)][_0x3e3f98(0x16c)](_0x55798c,_0x227b18),{'verbose':_0x4c6ea3[_0x3e3f98(0x171)]}),_0xbde26b=_0x14652e[_0x3e3f98(0x170)];return console[_0x3e3f98(0x150)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0xbde26b[_0x3e3f98(0x168)]+'\x27'),await handleSDKOutput([_0xbde26b],_0x4c6ea3),0x0;}}
1
+ const a19_0x2ee633=a19_0xb70d;(function(_0x166297,_0xc967ac){const _0x3e84f0=a19_0xb70d,_0x1e9061=_0x166297();while(!![]){try{const _0x28122e=parseInt(_0x3e84f0(0x1c8))/0x1*(parseInt(_0x3e84f0(0x1dd))/0x2)+-parseInt(_0x3e84f0(0x1d7))/0x3+parseInt(_0x3e84f0(0x1d6))/0x4+parseInt(_0x3e84f0(0x1ca))/0x5+parseInt(_0x3e84f0(0x1d9))/0x6+parseInt(_0x3e84f0(0x1f0))/0x7*(-parseInt(_0x3e84f0(0x1d3))/0x8)+-parseInt(_0x3e84f0(0x1c5))/0x9*(parseInt(_0x3e84f0(0x1f5))/0xa);if(_0x28122e===_0xc967ac)break;else _0x1e9061['push'](_0x1e9061['shift']());}catch(_0x1b3dc2){_0x1e9061['push'](_0x1e9061['shift']());}}}(a19_0x1def,0xd83fc));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';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x2ee633(0x1d1)]=a19_0x2ee633(0x1e8);[a19_0x2ee633(0x1dc)]=a19_0x2ee633(0x1d5);async[a19_0x2ee633(0x1f6)](_0x1eca9c){const _0x4fd46f=a19_0x2ee633,{options:_0x248b7b,args:_0x23bd73,tdx:_0x4810c6}=_0x1eca9c,_0x308d78=_0x248b7b;if(_0x23bd73[_0x4fd46f(0x1f7)]===0x0)return console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1db)),console[_0x4fd46f(0x1d8)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x15c0b6=_0x23bd73[0x0];if(!_0x308d78[_0x4fd46f(0x1cb)]||!_0x308d78[_0x4fd46f(0x1f2)])return console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1ef)),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1f4)),0x1;_0x308d78[_0x4fd46f(0x1ec)]&&(console['error'](_0x4fd46f(0x1de)+_0x308d78[_0x4fd46f(0x1e9)]),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1e0)+_0x15c0b6),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1c9)+_0x308d78['database']),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1cd)+_0x308d78[_0x4fd46f(0x1f2)]));const _0x3d5d92=await loadJSONFromOptions(_0x308d78[_0x4fd46f(0x1d0)],_0x308d78[_0x4fd46f(0x1d4)]),_0x32234e=await loadJSONFromOptions(_0x308d78[_0x4fd46f(0x1e4)],_0x308d78[_0x4fd46f(0x1f8)]),_0x46d1f6=await loadJSONFromOptions(_0x308d78['customerGroup'],_0x308d78[_0x4fd46f(0x1c4)]),_0x2c3845={'name':_0x15c0b6,'description':_0x308d78['description'],'scheduleType':_0x308d78['scheduleType'],'scheduleOption':_0x308d78[_0x4fd46f(0x1df)],'timezone':_0x308d78['timezone'],'master':{'parentDatabaseName':_0x308d78[_0x4fd46f(0x1cb)],'parentTableName':_0x308d78[_0x4fd46f(0x1f2)]},'attributes':_0x3d5d92,'behaviors':_0x32234e,'customerGroup':_0x46d1f6},_0x1238fe=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x15c0b6+'\x27...',()=>_0x4810c6[_0x4fd46f(0x1c7)][_0x4fd46f(0x1eb)](_0x2c3845),{'verbose':_0x248b7b[_0x4fd46f(0x1ec)]}),_0x2e547a=_0x1238fe[_0x4fd46f(0x1ea)];return console[_0x4fd46f(0x1d8)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x2e547a[_0x4fd46f(0x1d1)]+'\x27\x20with\x20ID:\x20'+_0x2e547a['id']),await handleSDKOutput([_0x2e547a],_0x248b7b),0x0;}}function a19_0xb70d(_0x4adcd1,_0x585ca6){const _0x1def07=a19_0x1def();return a19_0xb70d=function(_0xb70d83,_0x48a756){_0xb70d83=_0xb70d83-0x1c3;let _0x564b33=_0x1def07[_0xb70d83];return _0x564b33;},a19_0xb70d(_0x4adcd1,_0x585ca6);}function a19_0x1def(){const _0x50f40d=['Updating\x20parent\x20segment\x20\x27','table','getParentFull','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','20TWFToy','execute','length','behaviorsFile','addAttributes','customerGroupFile','6176664LCoPSz','Fetching\x20current\x20configuration\x20for\x20\x27','segment','63839iHBFRU','Database:\x20','5544020MEkkJl','database','addBehaviors','Table:\x20','addBehaviorsFile','Update\x20existing\x20parent\x20segment\x20(audience)','attributes','name','\x27...','40QjFygC','attributesFile','Create\x20new\x20parent\x20segment\x20(audience)','5946044rBgWQU','830262MqRjio','error','2057802zqQlvc','updateParent','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','10WWihgl','Site:\x20','scheduleOption','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:update','✔\x20Updated\x20parent\x20segment\x20\x27','behaviors','scheduleType','timezone','Parent\x20segment:\x20','segment:parent:create','site','data','createParent','verbose','customerGroup','master','Error:\x20--database\x20and\x20--table\x20are\x20required','1011325UTLHQM'];a19_0x1def=function(){return _0x50f40d;};return a19_0x1def();}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x2ee633(0x1e2);[a19_0x2ee633(0x1dc)]=a19_0x2ee633(0x1cf);async[a19_0x2ee633(0x1f6)](_0x1190a2){const _0x291a76=a19_0x2ee633,{options:_0x13ac30,args:_0x255cd2,tdx:_0x249815}=_0x1190a2,_0x327174=_0x13ac30;if(_0x255cd2[_0x291a76(0x1f7)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x291a76(0x1d8)](_0x291a76(0x1e1)),0x1;const _0x54e971=_0x255cd2[0x0];_0x327174['verbose']&&(console[_0x291a76(0x1d8)]('Site:\x20'+_0x327174[_0x291a76(0x1e9)]),console[_0x291a76(0x1d8)](_0x291a76(0x1e7)+_0x54e971));const _0x75a7b7=await withSpinner(_0x291a76(0x1c6)+_0x54e971+_0x291a76(0x1d2),()=>_0x249815[_0x291a76(0x1c7)][_0x291a76(0x1f3)](_0x54e971),{'verbose':_0x327174[_0x291a76(0x1ec)]}),_0x23a50b=_0x75a7b7[_0x291a76(0x1ea)],_0x31ac85=await loadJSONFromOptions(_0x327174[_0x291a76(0x1c3)],_0x327174['addAttributesFile']),_0x3addd7=await loadJSONFromOptions(_0x327174[_0x291a76(0x1cc)],_0x327174[_0x291a76(0x1ce)]),_0x4de4bf={'name':_0x23a50b[_0x291a76(0x1d1)],'description':_0x327174['description']!==undefined?_0x327174['description']:_0x23a50b['description'],'scheduleType':_0x327174[_0x291a76(0x1e5)]!==undefined?_0x327174[_0x291a76(0x1e5)]:_0x23a50b[_0x291a76(0x1e5)],'scheduleOption':_0x327174[_0x291a76(0x1df)]!==undefined?_0x327174[_0x291a76(0x1df)]:_0x23a50b[_0x291a76(0x1df)],'timezone':_0x327174['timezone']!==undefined?_0x327174[_0x291a76(0x1e6)]:_0x23a50b[_0x291a76(0x1e6)],'master':_0x23a50b[_0x291a76(0x1ee)],'attributes':_0x31ac85?[..._0x23a50b[_0x291a76(0x1d0)]||[],..._0x31ac85]:_0x23a50b[_0x291a76(0x1d0)],'behaviors':_0x3addd7?[..._0x23a50b['behaviors']||[],..._0x3addd7]:_0x23a50b['behaviors'],'customerGroup':_0x23a50b[_0x291a76(0x1ed)]},_0x2022b4=await withSpinner(_0x291a76(0x1f1)+_0x54e971+_0x291a76(0x1d2),()=>_0x249815[_0x291a76(0x1c7)][_0x291a76(0x1da)](_0x54e971,_0x4de4bf),{'verbose':_0x327174[_0x291a76(0x1ec)]}),_0x4bf4c8=_0x2022b4[_0x291a76(0x1ea)];return console[_0x291a76(0x1d8)](_0x291a76(0x1e3)+_0x4bf4c8[_0x291a76(0x1d1)]+'\x27'),await handleSDKOutput([_0x4bf4c8],_0x327174),0x0;}}
@@ -1 +1 @@
1
- const a20_0x12d757=a20_0x2b38;(function(_0x4b86fd,_0x40cf69){const _0x458848=a20_0x2b38,_0x5721c2=_0x4b86fd();while(!![]){try{const _0x72a340=-parseInt(_0x458848(0x190))/0x1*(-parseInt(_0x458848(0x18e))/0x2)+-parseInt(_0x458848(0x18f))/0x3*(parseInt(_0x458848(0x184))/0x4)+parseInt(_0x458848(0x183))/0x5+-parseInt(_0x458848(0x186))/0x6+parseInt(_0x458848(0x181))/0x7+-parseInt(_0x458848(0x193))/0x8+parseInt(_0x458848(0x192))/0x9;if(_0x72a340===_0x40cf69)break;else _0x5721c2['push'](_0x5721c2['shift']());}catch(_0x45f5b7){_0x5721c2['push'](_0x5721c2['shift']());}}}(a20_0x47de,0x35965));import{BaseCommand}from'./command.js';function a20_0x47de(){const _0x26b90c=['profiles','log','109576CmYEaq','3bbXcyw','3aLSpFi','config','3113856TpUbIU','582904RJUCwb','672588dFGpwP','name','1024890RfntDE','1507228aPWZsy','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','853482UDYdPD','description','scope','map','Error:\x20','List\x20all\x20available\x20profiles'];a20_0x47de=function(){return _0x26b90c;};return a20_0x47de();}function a20_0x2b38(_0x4b529c,_0x166fef){const _0x47de18=a20_0x47de();return a20_0x2b38=function(_0x2b386e,_0x2c0824){_0x2b386e=_0x2b386e-0x181;let _0x22e925=_0x47de18[_0x2b386e];return _0x22e925;},a20_0x2b38(_0x4b529c,_0x166fef);}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x12d757(0x182)]=a20_0x12d757(0x18c);['description']=a20_0x12d757(0x18b);async['execute'](_0x74c12a){const _0x236bf9=a20_0x12d757,{options:_0x518daf}=_0x74c12a;try{const _0x8eb783=listProfiles(),_0xeed69d=getActiveProfile();if(_0x8eb783['length']===0x0)return console[_0x236bf9(0x18d)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x236bf9(0x18d)](_0x236bf9(0x185)),console[_0x236bf9(0x18d)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x4098c5=_0x8eb783[_0x236bf9(0x189)](_0x10aac2=>{const _0x118d46=_0x236bf9,_0x40e6a7=_0x10aac2['name']===_0xeed69d,_0x422e92=getProfileParams(_0x10aac2[_0x118d46(0x191)]);return{'name':_0x10aac2['name'],'active':_0x40e6a7,'scope':_0x10aac2[_0x118d46(0x188)],'description':_0x10aac2[_0x118d46(0x191)][_0x118d46(0x187)]||'','params':_0x422e92};});return await handleSDKOutput(_0x4098c5,_0x518daf),0x0;}catch(_0x1935d4){return _0x1935d4 instanceof Error&&console['error'](_0x236bf9(0x18a)+_0x1935d4['message']),0x1;}}}
1
+ function a20_0x5138(){const _0x49101=['name','map','profiles','370404ornisS','1623096xsQzsb','37130kBsgWl','execute','message','2ettzOE','\x20\x20Global:\x20~/.config/tdx/tdx.json','Error:\x20','361134UNWgqJ','16fTSpmh','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','21WxqtsY','List\x20all\x20available\x20profiles','log','141882KsHWwr','description','143oEYqTH','6497088wUanLQ','config','13064oBxDjV','390KxEvIl','scope'];a20_0x5138=function(){return _0x49101;};return a20_0x5138();}function a20_0x5ded(_0x5ebc5d,_0x10cbb6){const _0x5138b8=a20_0x5138();return a20_0x5ded=function(_0x5ded5b,_0x5a621d){_0x5ded5b=_0x5ded5b-0x15d;let _0x8b0895=_0x5138b8[_0x5ded5b];return _0x8b0895;},a20_0x5ded(_0x5ebc5d,_0x10cbb6);}const a20_0x35216a=a20_0x5ded;(function(_0x3738c7,_0x6adde2){const _0x299ec7=a20_0x5ded,_0x41f9b5=_0x3738c7();while(!![]){try{const _0x3498e2=parseInt(_0x299ec7(0x16b))/0x1+parseInt(_0x299ec7(0x170))/0x2*(-parseInt(_0x299ec7(0x173))/0x3)+-parseInt(_0x299ec7(0x165))/0x4*(parseInt(_0x299ec7(0x166))/0x5)+-parseInt(_0x299ec7(0x160))/0x6*(-parseInt(_0x299ec7(0x15d))/0x7)+parseInt(_0x299ec7(0x174))/0x8*(-parseInt(_0x299ec7(0x16c))/0x9)+parseInt(_0x299ec7(0x16d))/0xa*(-parseInt(_0x299ec7(0x162))/0xb)+parseInt(_0x299ec7(0x163))/0xc;if(_0x3498e2===_0x6adde2)break;else _0x41f9b5['push'](_0x41f9b5['shift']());}catch(_0xbca8ad){_0x41f9b5['push'](_0x41f9b5['shift']());}}}(a20_0x5138,0x3081e));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_0x35216a(0x168)]=a20_0x35216a(0x16a);[a20_0x35216a(0x161)]=a20_0x35216a(0x15e);async[a20_0x35216a(0x16e)](_0x2aea34){const _0x56faad=a20_0x35216a,{options:_0x57eb4b}=_0x2aea34;try{const _0x5c77c7=listProfiles(),_0x9fdba8=getActiveProfile();if(_0x5c77c7['length']===0x0)return console[_0x56faad(0x15f)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x56faad(0x15f)](_0x56faad(0x175)),console[_0x56faad(0x15f)](_0x56faad(0x171)),0x0;const _0x13c0b5=_0x5c77c7[_0x56faad(0x169)](_0x5b717e=>{const _0x4e3302=_0x56faad,_0x486766=_0x5b717e['name']===_0x9fdba8,_0x592e6a=getProfileParams(_0x5b717e[_0x4e3302(0x164)]);return{'name':_0x5b717e[_0x4e3302(0x168)],'active':_0x486766,'scope':_0x5b717e[_0x4e3302(0x167)],'description':_0x5b717e['config']['description']||'','params':_0x592e6a};});return await handleSDKOutput(_0x13c0b5,_0x57eb4b),0x0;}catch(_0x43d6e1){return _0x43d6e1 instanceof Error&&console['error'](_0x56faad(0x172)+_0x43d6e1[_0x56faad(0x16f)]),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x2fb6b=a21_0x1252;function a21_0x3933(){const _0x5ca5fa=['elapsedTimeMillis','completedSplits','output','\x20splits','execute','Executing\x20query...','length','4UtOPjx','stats','\x20rows\x20','../utils/command-output.js','Error:\x20','Executing\x20query\x20[','state','processedRows','totalSplits','information_schema','message','\x20[Job\x20ID:\x20','args','in\x20','file','originalMessage','22itnegc','608594iokuHL','catalog','...','Catalog:\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','name','setPhase','Statement\x20','verbose','4537550lcRcig','\x20-\x20','2725479PsqBgj','27856WzDNnw','options','data','query','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','1300953XgACMP','setExtra','Run\x20Trino\x20queries\x20(streaming)','741480bpkwLP','description','8iTIWCi','error','485375uLzGmK','validate','setJobId','join'];a21_0x3933=function(){return _0x5ca5fa;};return a21_0x3933();}function a21_0x1252(_0x5dd3d4,_0x54a4d5){const _0x39335b=a21_0x3933();return a21_0x1252=function(_0x125227,_0x259bdd){_0x125227=_0x125227-0xd2;let _0x4f076a=_0x39335b[_0x125227];return _0x4f076a;},a21_0x1252(_0x5dd3d4,_0x54a4d5);}(function(_0x32da85,_0x5ec800){const _0x53b3ce=a21_0x1252,_0x249d2a=_0x32da85();while(!![]){try{const _0x5b9c31=parseInt(_0x53b3ce(0xe0))/0x1*(-parseInt(_0x53b3ce(0xd3))/0x2)+-parseInt(_0x53b3ce(0xe5))/0x3*(-parseInt(_0x53b3ce(0xf7))/0x4)+-parseInt(_0x53b3ce(0xec))/0x5+parseInt(_0x53b3ce(0xe8))/0x6+-parseInt(_0x53b3ce(0xd4))/0x7*(parseInt(_0x53b3ce(0xea))/0x8)+-parseInt(_0x53b3ce(0xdf))/0x9+parseInt(_0x53b3ce(0xdd))/0xa;if(_0x5b9c31===_0x5ec800)break;else _0x249d2a['push'](_0x249d2a['shift']());}catch(_0x363dfa){_0x249d2a['push'](_0x249d2a['shift']());}}}(a21_0x3933,0x3527a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput}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_0x2fb6b(0xd9)]=a21_0x2fb6b(0xe3);[a21_0x2fb6b(0xe9)]=a21_0x2fb6b(0xe7);async[a21_0x2fb6b(0xf4)](_0x5784dd){const _0x21f479=a21_0x2fb6b,{options:_0x4df3f8,args:_0x3c59cc,tdx:_0x558e91}=_0x5784dd,_0x382c98=_0x3c59cc[0x0],_0x53a612=_0x4df3f8[_0x21f479(0x105)];let _0x4f3e25;if(_0x53a612)try{_0x4f3e25=readSqlStatementsFromFile(_0x53a612);}catch(_0x53a798){return console[_0x21f479(0xeb)]('Error:\x20'+_0x53a798[_0x21f479(0x101)]),0x1;}else try{_0x4f3e25=splitSqlStatements(_0x382c98);}catch(_0x420cff){return console[_0x21f479(0xeb)](_0x21f479(0xfb)+_0x420cff[_0x21f479(0x101)]),0x1;}const _0x3c078e=_0x4df3f8['database']||_0x21f479(0x100),_0x3281d7=_0x4df3f8[_0x21f479(0xd5)];try{const _0x191f75=[],_0x54ecce=!!_0x4df3f8[_0x21f479(0xf2)];for(let _0x4bc93e=0x0;_0x4bc93e<_0x4f3e25[_0x21f479(0xf6)];_0x4bc93e++){const _0x44bab3=_0x4f3e25[_0x4bc93e],_0x5a10f0=_0x4bc93e+0x1,_0x2642fc=_0x4f3e25[_0x21f479(0xf6)],_0x101ce8=_0x2642fc>0x1;_0x4df3f8['verbose']&&(console[_0x21f479(0xeb)]('\x0a'+(_0x101ce8?_0x21f479(0xdb)+_0x5a10f0+'/'+_0x2642fc+':':'')),console[_0x21f479(0xeb)]('Site:\x20'+_0x4df3f8['site']),console['error'](_0x21f479(0xd7)+(_0x3281d7||'td')),console[_0x21f479(0xeb)]('Schema:\x20'+_0x3c078e),console['error']('SQL:\x20'+_0x44bab3));const _0x1bb932=_0x101ce8?'Executing\x20statement\x20'+_0x5a10f0+'/'+_0x2642fc+_0x21f479(0xd6):_0x21f479(0xf5);try{const _0x3dd4cf=await withQuerySpinner(_0x1bb932,async _0x173b25=>{const _0x47b6b3=_0x21f479,_0xf76101=await _0x558e91[_0x47b6b3(0xe3)](_0x44bab3,{'catalog':_0x3281d7,'schema':_0x3c078e,'onJobId':_0x5aec23=>{const _0x4eab1e=_0x47b6b3;_0x173b25[_0x4eab1e(0xee)](_0x5aec23);},'onProgress':_0x31445a=>{const _0x240a1d=_0x47b6b3;_0x173b25[_0x240a1d(0xda)](_0x240a1d(0xfc)+_0x31445a[_0x240a1d(0xfd)]+']'),_0x173b25[_0x240a1d(0xe6)](formatRows(_0x31445a['processedRows'])+_0x240a1d(0xf9)+_0x31445a[_0x240a1d(0xf1)]+'/'+_0x31445a[_0x240a1d(0xff)]+_0x240a1d(0xf3));}});return _0xf76101;},{'verbose':_0x4df3f8[_0x21f479(0xdc)]}),_0x2b8f28=_0x3dd4cf[_0x21f479(0xe2)],_0x1a42e2=_0x2b8f28['jobId']?_0x21f479(0x102)+_0x2b8f28['jobId']+']':'',_0x1d6d18=_0x101ce8?_0x21f479(0xdb)+_0x5a10f0+'/'+_0x2642fc+_0x21f479(0xde):'';console[_0x21f479(0xeb)]('✔\x20'+_0x1d6d18+'Query\x20completed:\x20Processed\x20'+formatRows(_0x2b8f28[_0x21f479(0xf8)][_0x21f479(0xfe)])+_0x21f479(0xf9)+(_0x21f479(0x104)+formatElapsed(_0x2b8f28[_0x21f479(0xf8)][_0x21f479(0xf0)])+_0x1a42e2));if(_0x101ce8&&_0x54ecce){const {formatQueryOutput:_0x28ad07,resolveOutputOptions:_0x5deb13}=await import(_0x21f479(0xfa)),_0x57ee0d=_0x5deb13(_0x4df3f8),_0xb4fc32=await _0x28ad07(_0x2b8f28,_0x57ee0d);_0x191f75['push'](_0xb4fc32);}else await handleQueryOutput(_0x2b8f28,_0x4df3f8);}catch(_0x28a531){const _0x3b55a7=_0x101ce8?'Statement\x20'+_0x5a10f0+'/'+_0x2642fc+':\x0a':'',_0x19e3cf=_0x28a531 instanceof SDKError?_0x28a531[_0x21f479(0xd2)]:_0x28a531['message'];return console[_0x21f479(0xeb)](''+_0x3b55a7+_0x19e3cf),0x1;}}if(_0x4f3e25[_0x21f479(0xf6)]>0x1&&_0x54ecce&&_0x191f75[_0x21f479(0xf6)]>0x0){const _0x12b324=_0x191f75[_0x21f479(0xef)]('\x0a');writeFileSync(_0x4df3f8['output'],_0x12b324),console['error']('\x0aAll\x20results\x20saved\x20to\x20'+_0x4df3f8[_0x21f479(0xf2)]);}return 0x0;}catch(_0x144df1){throw _0x144df1;}}[a21_0x2fb6b(0xed)](_0x2fccb4){const _0x53475d=a21_0x2fb6b,_0x23e1e8=_0x2fccb4[_0x53475d(0x103)][0x0],_0x4eb242=_0x2fccb4[_0x53475d(0xe1)][_0x53475d(0x105)];if(!_0x23e1e8&&!_0x4eb242)return _0x53475d(0xd8);if(_0x23e1e8&&_0x4eb242)return _0x53475d(0xe4);return undefined;}}
1
+ const a21_0x1f0b26=a21_0x55ca;(function(_0x138479,_0x3bf6df){const _0x48b2f4=a21_0x55ca,_0x140627=_0x138479();while(!![]){try{const _0x1b2efd=-parseInt(_0x48b2f4(0x16b))/0x1*(parseInt(_0x48b2f4(0x189))/0x2)+parseInt(_0x48b2f4(0x165))/0x3*(-parseInt(_0x48b2f4(0x187))/0x4)+-parseInt(_0x48b2f4(0x15c))/0x5+-parseInt(_0x48b2f4(0x166))/0x6+-parseInt(_0x48b2f4(0x17c))/0x7*(-parseInt(_0x48b2f4(0x161))/0x8)+parseInt(_0x48b2f4(0x18a))/0x9*(parseInt(_0x48b2f4(0x169))/0xa)+parseInt(_0x48b2f4(0x185))/0xb;if(_0x1b2efd===_0x3bf6df)break;else _0x140627['push'](_0x140627['shift']());}catch(_0x2c5202){_0x140627['push'](_0x140627['shift']());}}}(a21_0x30f1,0x88c5e));import{BaseCommand}from'./command.js';function a21_0x55ca(_0x3554fe,_0x54374f){const _0x30f106=a21_0x30f1();return a21_0x55ca=function(_0x55caa8,_0x418221){_0x55caa8=_0x55caa8-0x15a;let _0x387b19=_0x30f106[_0x55caa8];return _0x387b19;},a21_0x55ca(_0x3554fe,_0x54374f);}function a21_0x30f1(){const _0x29aa8d=['message','validate','Executing\x20query...','Schema:\x20','data','1092539hMXoIF','Site:\x20','stats','Executing\x20statement\x20','../utils/command-output.js','\x20rows\x20','file','Error:\x20','error','26745092cwaZuR','processedRows','6504AdbQpq','information_schema','2178872vLyhVI','18pjlCSK','Query\x20completed:\x20Processed\x20','join','name','args','2632990iKaWYp','description','verbose','in\x20','output','8kerqhw','Catalog:\x20','\x0aAll\x20results\x20saved\x20to\x20','elapsedTimeMillis','1707uCbDoR','2356806WeACyz','length','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','4534010kgrNXp','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','1KfGhOu','database','Statement\x20','push','originalMessage','jobId','setJobId','state','Executing\x20query\x20[','query','execute','setPhase'];a21_0x30f1=function(){return _0x29aa8d;};return a21_0x30f1();}import{SDKError}from'../sdk/index.js';import{handleQueryOutput}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_0x1f0b26(0x15a)]=a21_0x1f0b26(0x174);[a21_0x1f0b26(0x15d)]='Run\x20Trino\x20queries\x20(streaming)';async[a21_0x1f0b26(0x175)](_0x230f4e){const _0x554839=a21_0x1f0b26,{options:_0x3ed46d,args:_0x19e677,tdx:_0x266473}=_0x230f4e,_0x622efd=_0x19e677[0x0],_0x7625b7=_0x3ed46d[_0x554839(0x182)];let _0x10e01f;if(_0x7625b7)try{_0x10e01f=readSqlStatementsFromFile(_0x7625b7);}catch(_0x2c5bf2){return console['error'](_0x554839(0x183)+_0x2c5bf2[_0x554839(0x177)]),0x1;}else try{_0x10e01f=splitSqlStatements(_0x622efd);}catch(_0x4c5c14){return console[_0x554839(0x184)](_0x554839(0x183)+_0x4c5c14[_0x554839(0x177)]),0x1;}const _0x56c361=_0x3ed46d[_0x554839(0x16c)]||_0x554839(0x188),_0x14d5ae=_0x3ed46d['catalog'];try{const _0x4f6d23=[],_0x285397=!!_0x3ed46d[_0x554839(0x160)];for(let _0x4bf437=0x0;_0x4bf437<_0x10e01f[_0x554839(0x167)];_0x4bf437++){const _0x145a74=_0x10e01f[_0x4bf437],_0x353ea9=_0x4bf437+0x1,_0x23e53c=_0x10e01f[_0x554839(0x167)],_0x3f4be1=_0x23e53c>0x1;_0x3ed46d['verbose']&&(console[_0x554839(0x184)]('\x0a'+(_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+':':'')),console[_0x554839(0x184)](_0x554839(0x17d)+_0x3ed46d['site']),console[_0x554839(0x184)](_0x554839(0x162)+(_0x14d5ae||'td')),console[_0x554839(0x184)](_0x554839(0x17a)+_0x56c361),console[_0x554839(0x184)]('SQL:\x20'+_0x145a74));const _0x769f0d=_0x3f4be1?_0x554839(0x17f)+_0x353ea9+'/'+_0x23e53c+'...':_0x554839(0x179);try{const _0x318c55=await withQuerySpinner(_0x769f0d,async _0x362089=>{const _0x1d89b9=_0x554839,_0x563827=await _0x266473[_0x1d89b9(0x174)](_0x145a74,{'catalog':_0x14d5ae,'schema':_0x56c361,'onJobId':_0x1b4272=>{const _0x1efbeb=_0x1d89b9;_0x362089[_0x1efbeb(0x171)](_0x1b4272);},'onProgress':_0x55977a=>{const _0x6b52c7=_0x1d89b9;_0x362089[_0x6b52c7(0x176)](_0x6b52c7(0x173)+_0x55977a[_0x6b52c7(0x172)]+']'),_0x362089['setExtra'](formatRows(_0x55977a[_0x6b52c7(0x186)])+_0x6b52c7(0x181)+_0x55977a['completedSplits']+'/'+_0x55977a['totalSplits']+'\x20splits');}});return _0x563827;},{'verbose':_0x3ed46d[_0x554839(0x15e)]}),_0x1d7bb4=_0x318c55[_0x554839(0x17b)],_0x2c73c2=_0x1d7bb4[_0x554839(0x170)]?'\x20[Job\x20ID:\x20'+_0x1d7bb4[_0x554839(0x170)]+']':'',_0x4832fe=_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+'\x20-\x20':'';console['error']('✔\x20'+_0x4832fe+_0x554839(0x18b)+formatRows(_0x1d7bb4[_0x554839(0x17e)][_0x554839(0x186)])+_0x554839(0x181)+(_0x554839(0x15f)+formatElapsed(_0x1d7bb4[_0x554839(0x17e)][_0x554839(0x164)])+_0x2c73c2));if(_0x3f4be1&&_0x285397){const {formatQueryOutput:_0x280909,resolveOutputOptions:_0x555af5}=await import(_0x554839(0x180)),_0x4db11d=_0x555af5(_0x3ed46d),_0x4c1cca=await _0x280909(_0x1d7bb4,_0x4db11d);_0x4f6d23[_0x554839(0x16e)](_0x4c1cca);}else await handleQueryOutput(_0x1d7bb4,_0x3ed46d);}catch(_0x4f7e9d){const _0x42a12d=_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+':\x0a':'',_0x2c6bd6=_0x4f7e9d instanceof SDKError?_0x4f7e9d[_0x554839(0x16f)]:_0x4f7e9d[_0x554839(0x177)];return console['error'](''+_0x42a12d+_0x2c6bd6),0x1;}}if(_0x10e01f[_0x554839(0x167)]>0x1&&_0x285397&&_0x4f6d23[_0x554839(0x167)]>0x0){const _0xd0507b=_0x4f6d23[_0x554839(0x18c)]('\x0a');writeFileSync(_0x3ed46d[_0x554839(0x160)],_0xd0507b),console[_0x554839(0x184)](_0x554839(0x163)+_0x3ed46d['output']);}return 0x0;}catch(_0x4f590e){throw _0x4f590e;}}[a21_0x1f0b26(0x178)](_0x459c80){const _0x5e47b1=a21_0x1f0b26,_0x1072d7=_0x459c80[_0x5e47b1(0x15b)][0x0],_0x265786=_0x459c80['options'][_0x5e47b1(0x182)];if(!_0x1072d7&&!_0x265786)return _0x5e47b1(0x16a);if(_0x1072d7&&_0x265786)return _0x5e47b1(0x168);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x6aa9a0=a22_0x3b02;(function(_0x536975,_0x3669ab){const _0x3654f2=a22_0x3b02,_0x76324d=_0x536975();while(!![]){try{const _0x324ffa=parseInt(_0x3654f2(0x18c))/0x1+-parseInt(_0x3654f2(0x164))/0x2+parseInt(_0x3654f2(0x187))/0x3*(parseInt(_0x3654f2(0x141))/0x4)+parseInt(_0x3654f2(0x16f))/0x5+-parseInt(_0x3654f2(0x14e))/0x6*(-parseInt(_0x3654f2(0x179))/0x7)+parseInt(_0x3654f2(0x14c))/0x8+parseInt(_0x3654f2(0x13a))/0x9*(-parseInt(_0x3654f2(0x17d))/0xa);if(_0x324ffa===_0x3669ab)break;else _0x76324d['push'](_0x76324d['shift']());}catch(_0x40de57){_0x76324d['push'](_0x76324d['shift']());}}}(a22_0x3554,0xd5145));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';function a22_0x3554(){const _0x56f382=['message','folder','Fetching\x20folder\x20\x27','getSegmentSQL','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Fetching\x20folder\x20details...','INTERNAL','query','toLocaleString','261GztdPi','description','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','length','folderId','segmentId','name','4lVZRpb','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','in\x20','segment','Creating\x20folder\x20\x27','Parent\x20name:\x20','stats','parent','site','includes','9280000lZxrLS','Fetching\x20SQL\x20for\x20segment...','1230GghRYf','limit','cause','format','Usage:\x20tdx\x20segment\x20describe\x20<path>','code','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20path\x20\x27','createFolder','segment:describe','jobId','error','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Examples:','setJobId','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','execute','Fetching\x20segment\x20details...','parentId','1384396NjIffa','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parentFolder','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','getParentSQL','\x27\x20with\x20ID:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','resolveParentId','Error:\x20Path\x20or\x20name\x20is\x20required','getFolder','5145555VcXTKg','Parent\x20segment:\x20','\x20folder','Create\x20segment\x20folder\x20for\x20organization','type','Usage:\x20tdx\x20segment\x20show\x20<path>','processedRows','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','✖\x20Query\x20failed\x20[','Resolved\x20relative\x20path\x20to:\x20','7406dzstvq','segment:folder:list','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27...','1034560MPQgWE','segment:show','getSegment','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','segment:sql','Folder\x20name:\x20','Resolved\x20folder\x20ID:\x20','\x20[Job\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','Segment\x20ID:\x20','2720871wnkSzH','\x20rows\x20','information_schema','resolvePathToResource','SQL\x20query:\x0a','1252237sudulw','Error:\x20Folder\x20reference\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','verbose','Error:\x20','segmentPath','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','resolveFolderId','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Site:\x20','Show\x20segment\x20folder\x20details','data','\x20\x20Cause:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'];a22_0x3554=function(){return _0x56f382;};return a22_0x3554();}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{['name']=a22_0x6aa9a0(0x157);[a22_0x6aa9a0(0x13b)]='Show\x20segment\x20or\x20folder\x20details';async[a22_0x6aa9a0(0x161)](_0x3efd96){const _0x546715=a22_0x6aa9a0,{options:_0x25a5ab,args:_0x28554f,tdx:_0x4a26e7}=_0x3efd96;if(_0x28554f[_0x546715(0x13d)]===0x0)return console['error'](_0x546715(0x16d)),console['error'](_0x546715(0x152)),console[_0x546715(0x159)](_0x546715(0x15e)),console[_0x546715(0x159)](_0x546715(0x15d)),console[_0x546715(0x159)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x546715(0x195)),0x1;try{const _0x34bf27=_0x28554f[0x0],_0x3f80a9=_0x25a5ab[_0x546715(0x191)];let _0x582eff=_0x34bf27;_0x3f80a9&&!_0x34bf27[_0x546715(0x14b)]('/')&&(_0x582eff=_0x3f80a9+'/'+_0x34bf27,_0x25a5ab[_0x546715(0x18f)]&&console[_0x546715(0x159)](_0x546715(0x178)+_0x582eff));const _0x418dd7=await withSpinner(_0x546715(0x155)+_0x582eff+_0x546715(0x17c),()=>_0x4a26e7[_0x546715(0x145)][_0x546715(0x18a)](_0x582eff),{'verbose':_0x25a5ab['verbose']}),_0x14e66e=_0x418dd7[_0x546715(0x19a)];_0x25a5ab[_0x546715(0x18f)]&&(console['error'](_0x546715(0x15c)+_0x14e66e[_0x546715(0x173)]),console[_0x546715(0x159)](_0x546715(0x19f)+_0x14e66e[_0x546715(0x163)]),_0x14e66e[_0x546715(0x13e)]&&console[_0x546715(0x159)]('Folder\x20ID:\x20'+_0x14e66e['folderId']),_0x14e66e[_0x546715(0x13f)]&&console[_0x546715(0x159)](_0x546715(0x186)+_0x14e66e[_0x546715(0x13f)]));if(_0x14e66e[_0x546715(0x173)]===_0x546715(0x149)){const _0x4823ee=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x4a26e7[_0x546715(0x145)]['getParent'](_0x14e66e[_0x546715(0x163)]),{'verbose':_0x25a5ab[_0x546715(0x18f)]});await handleSDKOutput([_0x4823ee['data']],_0x25a5ab);}else{if(_0x14e66e['type']===_0x546715(0x132)){if(!_0x14e66e[_0x546715(0x13e)])throw new SDKError(ErrorCode[_0x546715(0x137)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x824cf9=await withSpinner(_0x546715(0x136),()=>_0x4a26e7['segment']['getFolder'](_0x14e66e[_0x546715(0x13e)]),{'verbose':_0x25a5ab[_0x546715(0x18f)]});await handleSDKOutput([_0x824cf9[_0x546715(0x19a)]],_0x25a5ab);}else{if(_0x14e66e['type']===_0x546715(0x145)){if(!_0x14e66e['segmentId'])throw new SDKError(ErrorCode[_0x546715(0x137)],_0x546715(0x19c));const _0x55e291=await withSpinner(_0x546715(0x162),()=>_0x4a26e7[_0x546715(0x145)][_0x546715(0x17f)](_0x14e66e[_0x546715(0x163)],_0x14e66e[_0x546715(0x13f)]),{'verbose':_0x25a5ab[_0x546715(0x18f)]});await handleSDKOutput([_0x55e291['data']],_0x25a5ab);}}}return 0x0;}catch(_0x58902d){if(_0x58902d instanceof SDKError)return console[_0x546715(0x159)](_0x546715(0x190)+_0x58902d[_0x546715(0x1a1)]),_0x58902d[_0x546715(0x150)]&&console[_0x546715(0x159)]('\x20\x20Cause:\x20'+_0x58902d[_0x546715(0x150)]),0x1;throw _0x58902d;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]=a22_0x6aa9a0(0x17e);[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x160);async[a22_0x6aa9a0(0x161)](_0x8887f8){const _0x1ab5b2=a22_0x6aa9a0,{options:_0x4de180,args:_0x30df0b,tdx:_0x1285ef}=_0x8887f8;if(_0x30df0b[_0x1ab5b2(0x13d)]===0x0)return console['error'](_0x1ab5b2(0x17b)),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x174)),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x15e)),console['error'](_0x1ab5b2(0x135)),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x1a0)),console[_0x1ab5b2(0x159)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x21fb9b=_0x30df0b[0x0],_0xf06781=_0x4de180[_0x1ab5b2(0x191)];let _0x4e0def=_0x21fb9b;_0xf06781&&!_0x21fb9b[_0x1ab5b2(0x14b)]('/')&&(_0x4e0def=_0xf06781+'/'+_0x21fb9b,_0x4de180[_0x1ab5b2(0x18f)]&&console[_0x1ab5b2(0x159)](_0x1ab5b2(0x178)+_0x4e0def));const _0x15dc8a=await withSpinner('Resolving\x20path\x20\x27'+_0x4e0def+'\x27...',()=>_0x1285ef[_0x1ab5b2(0x145)][_0x1ab5b2(0x18a)](_0x4e0def),{'verbose':_0x4de180['verbose']}),_0x4e620b=_0x15dc8a['data'];_0x4de180[_0x1ab5b2(0x18f)]&&(console['error'](_0x1ab5b2(0x15c)+_0x4e620b['type']),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x19f)+_0x4e620b['parentId']));if(_0x4e620b[_0x1ab5b2(0x173)]==='folder')return console[_0x1ab5b2(0x159)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0x1ab5b2(0x154)),0x1;let _0x1b38c3;if(_0x4e620b[_0x1ab5b2(0x173)]===_0x1ab5b2(0x149)){const _0x5adf4f=await withSpinner(_0x1ab5b2(0x16b),()=>_0x1285ef[_0x1ab5b2(0x145)][_0x1ab5b2(0x169)](_0x4e620b[_0x1ab5b2(0x163)]),{'verbose':_0x4de180[_0x1ab5b2(0x18f)]});_0x1b38c3=_0x5adf4f[_0x1ab5b2(0x19a)];}else{if(!_0x4e620b[_0x1ab5b2(0x13f)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e708f=await withSpinner(_0x1ab5b2(0x14d),()=>_0x1285ef['segment'][_0x1ab5b2(0x134)](_0x4e620b[_0x1ab5b2(0x163)],_0x4e620b[_0x1ab5b2(0x13f)]),{'verbose':_0x4de180['verbose']});_0x1b38c3=_0x2e708f['data'];}const _0x2724b6=_0x4de180[_0x1ab5b2(0x14f)],_0xbea732=/\bLIMIT\s+\d+/i['test'](_0x1b38c3);!_0xbea732&&(_0x1b38c3=_0x1b38c3['trim']()['replace'](/;+$/,''),_0x1b38c3=_0x1ab5b2(0x185)+_0x1b38c3+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2724b6);_0x4de180['verbose']&&console[_0x1ab5b2(0x159)](_0x1ab5b2(0x18b)+_0x1b38c3);const _0x34ea77=await withQuerySpinner(_0x1ab5b2(0x167),async _0x1f0db9=>{const _0x2c3104=_0x1ab5b2,_0x4ebfca=await _0x1285ef[_0x2c3104(0x138)](_0x1b38c3,{'catalog':'td','schema':_0x2c3104(0x189),'onJobId':_0x51a2d8=>{const _0x2bc4c6=_0x2c3104;_0x1f0db9[_0x2bc4c6(0x15f)](_0x51a2d8);}});return _0x4ebfca;},{'verbose':_0x4de180[_0x1ab5b2(0x18f)]}),_0xaef9d7=_0x34ea77[_0x1ab5b2(0x19a)],_0x42fef9=_0xaef9d7['jobId']?_0x1ab5b2(0x184)+_0xaef9d7[_0x1ab5b2(0x158)]+']':'';return console[_0x1ab5b2(0x159)](_0x1ab5b2(0x19d)+_0xaef9d7[_0x1ab5b2(0x148)][_0x1ab5b2(0x175)][_0x1ab5b2(0x139)]()+_0x1ab5b2(0x188)+(_0x1ab5b2(0x144)+formatElapsed(_0xaef9d7[_0x1ab5b2(0x148)]['elapsedTimeMillis'])+_0x42fef9)),await handleQueryOutput(_0xaef9d7,_0x4de180),0x0;}catch(_0x580257){if(_0x580257 instanceof SDKError)return console[_0x1ab5b2(0x159)](_0x1ab5b2(0x177)+_0x580257[_0x1ab5b2(0x153)]+']'),console['error']('\x0a'+_0x580257[_0x1ab5b2(0x1a1)]),0x1;throw _0x580257;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a22_0x6aa9a0(0x17a);[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x165);async[a22_0x6aa9a0(0x161)](_0x32b433){const _0x443c18=a22_0x6aa9a0,{options:_0x3868e5,args:_0x57962c,tdx:_0x1c438f}=_0x32b433;if(_0x57962c[_0x443c18(0x13d)]===0x0)return console[_0x443c18(0x159)](_0x443c18(0x19e)),console[_0x443c18(0x159)](_0x443c18(0x15b)),0x1;const _0x34b24e=_0x57962c[0x0];try{_0x3868e5[_0x443c18(0x18f)]&&(console['error'](_0x443c18(0x198)+_0x3868e5[_0x443c18(0x14a)]),console[_0x443c18(0x159)](_0x443c18(0x147)+_0x34b24e));const _0x4c6d3c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x34b24e+_0x443c18(0x17c),()=>_0x1c438f[_0x443c18(0x145)][_0x443c18(0x16c)](_0x34b24e),{'verbose':_0x3868e5['verbose']}),_0x59b5cc=_0x4c6d3c[_0x443c18(0x19a)];_0x3868e5[_0x443c18(0x18f)]&&console['error'](_0x443c18(0x142)+_0x59b5cc);const _0x1e1fc8=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x34b24e+'\x27...',()=>_0x1c438f[_0x443c18(0x145)]['listFolders'](_0x59b5cc),{'verbose':_0x3868e5[_0x443c18(0x18f)]}),_0x3700ee=_0x1e1fc8['data'];return console[_0x443c18(0x159)]('✔\x20Found\x20'+_0x3700ee[_0x443c18(0x13d)]+_0x443c18(0x171)+(_0x3700ee[_0x443c18(0x13d)]!==0x1?'s':'')),await handleSDKOutput(_0x3700ee,_0x3868e5),0x0;}catch(_0x29a081){if(_0x29a081 instanceof SDKError)return console[_0x443c18(0x159)](_0x443c18(0x190)+_0x29a081[_0x443c18(0x1a1)]),_0x29a081[_0x443c18(0x150)]&&console[_0x443c18(0x159)](_0x443c18(0x19b)+_0x29a081[_0x443c18(0x150)]),0x1;throw _0x29a081;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]='segment:folder:show';['description']=a22_0x6aa9a0(0x199);async[a22_0x6aa9a0(0x161)](_0x3ddd1d){const _0x32d27d=a22_0x6aa9a0,{options:_0x3409ec,args:_0x2e6ef3,tdx:_0x5215d5}=_0x3ddd1d;if(_0x2e6ef3[_0x32d27d(0x13d)]===0x0)return console[_0x32d27d(0x159)](_0x32d27d(0x18d)),console[_0x32d27d(0x159)](_0x32d27d(0x197)),0x1;try{const {parentId:_0x394bed,childId:_0x2f3af2}=parseSegmentRef(_0x2e6ef3[0x0]);_0x3409ec[_0x32d27d(0x18f)]&&(console[_0x32d27d(0x159)](_0x32d27d(0x198)+_0x3409ec[_0x32d27d(0x14a)]),console['error'](_0x32d27d(0x147)+_0x394bed),_0x2f3af2&&console[_0x32d27d(0x159)](_0x32d27d(0x182)+_0x2f3af2));if(!_0x2f3af2)return console[_0x32d27d(0x159)](_0x32d27d(0x176)),0x1;const _0x3b9823=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x394bed+'\x27...',()=>_0x5215d5[_0x32d27d(0x145)][_0x32d27d(0x16c)](_0x394bed),{'verbose':_0x3409ec[_0x32d27d(0x18f)]}),_0x55123f=_0x3b9823[_0x32d27d(0x19a)];_0x3409ec[_0x32d27d(0x18f)]&&console[_0x32d27d(0x159)](_0x32d27d(0x142)+_0x55123f);const _0x320e8d=await withSpinner(_0x32d27d(0x194)+_0x2f3af2+_0x32d27d(0x17c),()=>_0x5215d5['segment'][_0x32d27d(0x193)](_0x55123f,_0x2f3af2),{'verbose':_0x3409ec[_0x32d27d(0x18f)]}),_0x520c9d=_0x320e8d[_0x32d27d(0x19a)];_0x3409ec[_0x32d27d(0x18f)]&&console[_0x32d27d(0x159)](_0x32d27d(0x183)+_0x520c9d);const _0x2a5f35=await withSpinner(_0x32d27d(0x133)+_0x2f3af2+_0x32d27d(0x17c),()=>_0x5215d5[_0x32d27d(0x145)][_0x32d27d(0x16e)](_0x520c9d),{'verbose':_0x3409ec[_0x32d27d(0x18f)]});return await handleSDKOutput([_0x2a5f35['data']],_0x3409ec),0x0;}catch(_0x22c1ee){if(_0x22c1ee instanceof SDKError)return console[_0x32d27d(0x159)]('Error:\x20'+_0x22c1ee['message']),_0x22c1ee['cause']&&console['error'](_0x32d27d(0x19b)+_0x22c1ee[_0x32d27d(0x150)]),0x1;throw _0x22c1ee;}}}function a22_0x3b02(_0x6324fb,_0x266986){const _0x35546f=a22_0x3554();return a22_0x3b02=function(_0x3b027d,_0x2a9953){_0x3b027d=_0x3b027d-0x132;let _0xb1f282=_0x35546f[_0x3b027d];return _0xb1f282;},a22_0x3b02(_0x6324fb,_0x266986);}export class SegmentSQLCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]=a22_0x6aa9a0(0x181);[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x180);async[a22_0x6aa9a0(0x161)](_0x2b1818){const _0x4fecc8=a22_0x6aa9a0,{options:_0x45d9a6,args:_0x9e977e,tdx:_0x2dfa98}=_0x2b1818;if(_0x9e977e[_0x4fecc8(0x13d)]===0x0)return console['error'](_0x4fecc8(0x17b)),console[_0x4fecc8(0x159)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x4fecc8(0x159)]('Examples:'),console[_0x4fecc8(0x159)](_0x4fecc8(0x13c)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x4fecc8(0x168)),0x1;try{const _0x2ac7c6=_0x9e977e[0x0],_0x5e0878=_0x45d9a6[_0x4fecc8(0x191)];let _0x345913=_0x2ac7c6;_0x5e0878&&!_0x2ac7c6[_0x4fecc8(0x14b)]('/')&&(_0x345913=_0x5e0878+'/'+_0x2ac7c6,_0x45d9a6[_0x4fecc8(0x18f)]&&console[_0x4fecc8(0x159)](_0x4fecc8(0x178)+_0x345913));const _0x41efb3=await withSpinner(_0x4fecc8(0x155)+_0x345913+_0x4fecc8(0x17c),()=>_0x2dfa98[_0x4fecc8(0x145)][_0x4fecc8(0x18a)](_0x345913),{'verbose':_0x45d9a6[_0x4fecc8(0x18f)]}),_0x8a293=_0x41efb3['data'];_0x45d9a6[_0x4fecc8(0x18f)]&&(console[_0x4fecc8(0x159)]('Resolved\x20type:\x20'+_0x8a293['type']),console[_0x4fecc8(0x159)](_0x4fecc8(0x19f)+_0x8a293[_0x4fecc8(0x163)]));if(_0x8a293[_0x4fecc8(0x173)]===_0x4fecc8(0x132))return console[_0x4fecc8(0x159)](_0x4fecc8(0x192)),console[_0x4fecc8(0x159)](_0x4fecc8(0x196)),0x1;let _0x395275;if(_0x8a293[_0x4fecc8(0x173)]===_0x4fecc8(0x149)){const _0x47caa5=await withSpinner(_0x4fecc8(0x16b),()=>_0x2dfa98[_0x4fecc8(0x145)][_0x4fecc8(0x169)](_0x8a293[_0x4fecc8(0x163)]),{'verbose':_0x45d9a6[_0x4fecc8(0x18f)]});_0x395275=_0x47caa5[_0x4fecc8(0x19a)];}else{if(!_0x8a293[_0x4fecc8(0x13f)])throw new SDKError(ErrorCode[_0x4fecc8(0x137)],_0x4fecc8(0x19c));const _0x40cf93=await withSpinner(_0x4fecc8(0x14d),()=>_0x2dfa98[_0x4fecc8(0x145)][_0x4fecc8(0x134)](_0x8a293[_0x4fecc8(0x163)],_0x8a293[_0x4fecc8(0x13f)]),{'verbose':_0x45d9a6['verbose']});_0x395275=_0x40cf93[_0x4fecc8(0x19a)];}return _0x45d9a6[_0x4fecc8(0x151)]==='json'||_0x45d9a6[_0x4fecc8(0x151)]==='jsonl'?await handleSDKOutput([{'sql':_0x395275}],_0x45d9a6):console['log'](_0x395275),0x0;}catch(_0x168178){if(_0x168178 instanceof SDKError)return console[_0x4fecc8(0x159)](_0x4fecc8(0x190)+_0x168178['message']),_0x168178['cause']&&console[_0x4fecc8(0x159)]('\x20\x20Cause:\x20'+_0x168178[_0x4fecc8(0x150)]),0x1;throw _0x168178;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]='segment:folder:create';[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x172);async['execute'](_0x4fe84a){const _0x1e983e=a22_0x6aa9a0,{options:_0x4de514,args:_0x5ef6dd,tdx:_0x3d488f}=_0x4fe84a,_0xd0590a=_0x4de514;if(_0x5ef6dd[_0x1e983e(0x13d)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1e983e(0x159)](_0x1e983e(0x18e)),0x1;const _0x150b8c=_0x5ef6dd[0x0],_0x44bf63=_0x5ef6dd[0x1];_0xd0590a[_0x1e983e(0x18f)]&&(console[_0x1e983e(0x159)]('Site:\x20'+_0xd0590a['site']),console[_0x1e983e(0x159)](_0x1e983e(0x170)+_0x150b8c),console[_0x1e983e(0x159)](_0x1e983e(0x182)+_0x44bf63));let _0xdd43e;if(_0xd0590a[_0x1e983e(0x166)]){const _0x383b9b=_0xd0590a[_0x1e983e(0x166)],_0x3c4c63=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x150b8c+_0x1e983e(0x17c),()=>_0x3d488f[_0x1e983e(0x145)][_0x1e983e(0x16c)](_0x150b8c),{'verbose':_0xd0590a['verbose']}),_0x4dc232=_0x3c4c63[_0x1e983e(0x19a)],_0x44b3c1=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x383b9b+'\x27...',()=>_0x3d488f['segment'][_0x1e983e(0x193)](_0x4dc232,_0x383b9b),{'verbose':_0xd0590a[_0x1e983e(0x18f)]});_0xdd43e=_0x44b3c1[_0x1e983e(0x19a)],_0xd0590a[_0x1e983e(0x18f)]&&console[_0x1e983e(0x159)](_0x1e983e(0x143)+_0xdd43e);}const _0x4f2318={'name':_0x44bf63,'description':_0xd0590a[_0x1e983e(0x13b)],'parentFolderId':_0xdd43e},_0x1c731c=await withSpinner(_0x1e983e(0x146)+_0x44bf63+_0x1e983e(0x17c),()=>_0x3d488f['segment'][_0x1e983e(0x156)](_0x150b8c,_0x4f2318),{'verbose':_0xd0590a[_0x1e983e(0x18f)]}),_0x9180=_0x1c731c[_0x1e983e(0x19a)];return console[_0x1e983e(0x159)](_0x1e983e(0x15a)+_0x9180[_0x1e983e(0x140)]+_0x1e983e(0x16a)+_0x9180['id']),await handleSDKOutput([_0x9180],_0xd0590a),0x0;}}
1
+ const a22_0x411ca8=a22_0x1ec7;(function(_0x19e4e8,_0x578ec7){const _0x38e101=a22_0x1ec7,_0x39e8da=_0x19e4e8();while(!![]){try{const _0xb63161=parseInt(_0x38e101(0x101))/0x1*(-parseInt(_0x38e101(0xf1))/0x2)+parseInt(_0x38e101(0x102))/0x3*(-parseInt(_0x38e101(0xe3))/0x4)+parseInt(_0x38e101(0x10c))/0x5+parseInt(_0x38e101(0x13d))/0x6*(-parseInt(_0x38e101(0xda))/0x7)+parseInt(_0x38e101(0x13a))/0x8*(-parseInt(_0x38e101(0x11c))/0x9)+parseInt(_0x38e101(0x11b))/0xa+-parseInt(_0x38e101(0x140))/0xb*(-parseInt(_0x38e101(0xd7))/0xc);if(_0xb63161===_0x578ec7)break;else _0x39e8da['push'](_0x39e8da['shift']());}catch(_0x400e8a){_0x39e8da['push'](_0x39e8da['shift']());}}}(a22_0x5afa,0x526e3));function a22_0x1ec7(_0x513435,_0x406c85){const _0x5afab9=a22_0x5afa();return a22_0x1ec7=function(_0x1ec707,_0x2d0bd3){_0x1ec707=_0x1ec707-0xcb;let _0x45b81f=_0x5afab9[_0x1ec707];return _0x45b81f;},a22_0x1ec7(_0x513435,_0x406c85);}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';export class SegmentDescribeCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0x117);['description']=a22_0x411ca8(0x103);async['execute'](_0x34b88c){const _0x1300e0=a22_0x411ca8,{options:_0x5c96a2,args:_0x531d71,tdx:_0x4885ff}=_0x34b88c;if(_0x531d71[_0x1300e0(0x11d)]===0x0)return console[_0x1300e0(0x128)](_0x1300e0(0xd9)),console[_0x1300e0(0x128)](_0x1300e0(0x108)),console[_0x1300e0(0x128)](_0x1300e0(0x12d)),console[_0x1300e0(0x128)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1300e0(0x128)](_0x1300e0(0x12a)),console[_0x1300e0(0x128)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x20ce92=_0x531d71[0x0],_0x105069=_0x5c96a2['segmentPath'];let _0x320ef5=_0x20ce92;_0x105069&&!_0x20ce92[_0x1300e0(0x123)]('/')&&(_0x320ef5=_0x105069+'/'+_0x20ce92,_0x5c96a2['verbose']&&console[_0x1300e0(0x128)](_0x1300e0(0xd1)+_0x320ef5));const _0x586431=await withSpinner(_0x1300e0(0x125)+_0x320ef5+'\x27...',()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x130)](_0x320ef5),{'verbose':_0x5c96a2[_0x1300e0(0x104)]}),_0x18fe18=_0x586431[_0x1300e0(0xdb)];_0x5c96a2[_0x1300e0(0x104)]&&(console[_0x1300e0(0x128)](_0x1300e0(0x112)+_0x18fe18['type']),console['error'](_0x1300e0(0x12c)+_0x18fe18[_0x1300e0(0x107)]),_0x18fe18[_0x1300e0(0x122)]&&console[_0x1300e0(0x128)](_0x1300e0(0x106)+_0x18fe18[_0x1300e0(0x122)]),_0x18fe18[_0x1300e0(0xe9)]&&console[_0x1300e0(0x128)](_0x1300e0(0xd0)+_0x18fe18[_0x1300e0(0xe9)]));if(_0x18fe18[_0x1300e0(0x109)]==='parent'){const _0x5471ad=await withSpinner(_0x1300e0(0xe1),()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x136)](_0x18fe18[_0x1300e0(0x107)]),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x5471ad[_0x1300e0(0xdb)]],_0x5c96a2);}else{if(_0x18fe18[_0x1300e0(0x109)]===_0x1300e0(0xdc)){if(!_0x18fe18[_0x1300e0(0x122)])throw new SDKError(ErrorCode[_0x1300e0(0xf0)],_0x1300e0(0x10d));const _0x52a65d=await withSpinner(_0x1300e0(0xfb),()=>_0x4885ff[_0x1300e0(0x134)]['getFolder'](_0x18fe18['folderId']),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x52a65d[_0x1300e0(0xdb)]],_0x5c96a2);}else{if(_0x18fe18['type']===_0x1300e0(0x134)){if(!_0x18fe18[_0x1300e0(0xe9)])throw new SDKError(ErrorCode['INTERNAL'],_0x1300e0(0x133));const _0x238f99=await withSpinner(_0x1300e0(0xd8),()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x12e)](_0x18fe18[_0x1300e0(0x107)],_0x18fe18['segmentId']),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x238f99[_0x1300e0(0xdb)]],_0x5c96a2);}}}return 0x0;}catch(_0x36afa6){if(_0x36afa6 instanceof SDKError)return console[_0x1300e0(0x128)](_0x1300e0(0xd5)+_0x36afa6[_0x1300e0(0xdf)]),_0x36afa6[_0x1300e0(0xd4)]&&console[_0x1300e0(0x128)](_0x1300e0(0x11f)+_0x36afa6[_0x1300e0(0xd4)]),0x1;throw _0x36afa6;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xef);[a22_0x411ca8(0xe2)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a22_0x411ca8(0x10a)](_0x3db8d8){const _0x51c945=a22_0x411ca8,{options:_0x3106f0,args:_0xd718a0,tdx:_0x22dea4}=_0x3db8d8;if(_0xd718a0[_0x51c945(0x11d)]===0x0)return console[_0x51c945(0x128)](_0x51c945(0xdd)),console['error'](_0x51c945(0xd6)),console['error'](_0x51c945(0x12d)),console[_0x51c945(0x128)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x51c945(0x128)](_0x51c945(0x120)),console[_0x51c945(0x128)](_0x51c945(0xf4)),0x1;try{const _0x362308=_0xd718a0[0x0],_0x5e7775=_0x3106f0[_0x51c945(0x126)];let _0x55b32d=_0x362308;_0x5e7775&&!_0x362308[_0x51c945(0x123)]('/')&&(_0x55b32d=_0x5e7775+'/'+_0x362308,_0x3106f0[_0x51c945(0x104)]&&console[_0x51c945(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x55b32d));const _0x567e56=await withSpinner('Resolving\x20path\x20\x27'+_0x55b32d+'\x27...',()=>_0x22dea4[_0x51c945(0x134)][_0x51c945(0x130)](_0x55b32d),{'verbose':_0x3106f0['verbose']}),_0x268791=_0x567e56[_0x51c945(0xdb)];_0x3106f0[_0x51c945(0x104)]&&(console[_0x51c945(0x128)]('Resolved\x20type:\x20'+_0x268791[_0x51c945(0x109)]),console[_0x51c945(0x128)](_0x51c945(0x12c)+_0x268791[_0x51c945(0x107)]));if(_0x268791[_0x51c945(0x109)]===_0x51c945(0xdc))return console[_0x51c945(0x128)](_0x51c945(0x13c)),console[_0x51c945(0x128)](_0x51c945(0x10b)),0x1;let _0x287b62;if(_0x268791['type']==='parent'){const _0x56c668=await withSpinner(_0x51c945(0x13e),()=>_0x22dea4[_0x51c945(0x134)]['getParentSQL'](_0x268791[_0x51c945(0x107)]),{'verbose':_0x3106f0[_0x51c945(0x104)]});_0x287b62=_0x56c668[_0x51c945(0xdb)];}else{if(!_0x268791[_0x51c945(0xe9)])throw new SDKError(ErrorCode[_0x51c945(0xf0)],_0x51c945(0x133));const _0x527d5d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x22dea4[_0x51c945(0x134)][_0x51c945(0xfa)](_0x268791['parentId'],_0x268791[_0x51c945(0xe9)]),{'verbose':_0x3106f0[_0x51c945(0x104)]});_0x287b62=_0x527d5d['data'];}const _0x5ef0dd=_0x3106f0[_0x51c945(0x10f)],_0x3f702c=/\bLIMIT\s+\d+/i['test'](_0x287b62);!_0x3f702c&&(_0x287b62=_0x287b62['trim']()[_0x51c945(0xe4)](/;+$/,''),_0x287b62=_0x51c945(0xe7)+_0x287b62+_0x51c945(0x12b)+_0x5ef0dd);_0x3106f0[_0x51c945(0x104)]&&console[_0x51c945(0x128)](_0x51c945(0x124)+_0x287b62);const _0x3ea9c6=await withQuerySpinner('Executing\x20segment\x20query...',async _0x3b9757=>{const _0xfa0afd=_0x51c945,_0x18eb30=await _0x22dea4[_0xfa0afd(0x139)](_0x287b62,{'catalog':'td','schema':_0xfa0afd(0x127),'onJobId':_0x58a643=>{_0x3b9757['setJobId'](_0x58a643);}});return _0x18eb30;},{'verbose':_0x3106f0['verbose']}),_0x451602=_0x3ea9c6[_0x51c945(0xdb)],_0x31adcf=_0x451602[_0x51c945(0x135)]?_0x51c945(0x11e)+_0x451602['jobId']+']':'';return console[_0x51c945(0x128)](_0x51c945(0xea)+_0x451602[_0x51c945(0x138)][_0x51c945(0xfd)][_0x51c945(0xcb)]()+_0x51c945(0x12f)+(_0x51c945(0xf5)+formatElapsed(_0x451602[_0x51c945(0x138)][_0x51c945(0xd2)])+_0x31adcf)),await handleQueryOutput(_0x451602,_0x3106f0),0x0;}catch(_0x3940a2){if(_0x3940a2 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x3940a2[_0x51c945(0x10e)]+']'),console['error']('\x0a'+_0x3940a2[_0x51c945(0xdf)]),0x1;throw _0x3940a2;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0x115);[a22_0x411ca8(0xe2)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a22_0x411ca8(0x10a)](_0x1ef747){const _0x3ca105=a22_0x411ca8,{options:_0x26c031,args:_0x55fcdb,tdx:_0xdf2c1f}=_0x1ef747;if(_0x55fcdb[_0x3ca105(0x11d)]===0x0)return console[_0x3ca105(0x128)](_0x3ca105(0xed)),console[_0x3ca105(0x128)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2476be=_0x55fcdb[0x0];try{_0x26c031[_0x3ca105(0x104)]&&(console[_0x3ca105(0x128)](_0x3ca105(0xcc)+_0x26c031[_0x3ca105(0xfc)]),console[_0x3ca105(0x128)](_0x3ca105(0xde)+_0x2476be));const _0x4e1227=await withSpinner(_0x3ca105(0xf8)+_0x2476be+_0x3ca105(0x118),()=>_0xdf2c1f[_0x3ca105(0x134)][_0x3ca105(0xf9)](_0x2476be),{'verbose':_0x26c031[_0x3ca105(0x104)]}),_0x27db7e=_0x4e1227[_0x3ca105(0xdb)];_0x26c031[_0x3ca105(0x104)]&&console[_0x3ca105(0x128)](_0x3ca105(0x119)+_0x27db7e);const _0x43baa6=await withSpinner(_0x3ca105(0xce)+_0x2476be+_0x3ca105(0x118),()=>_0xdf2c1f[_0x3ca105(0x134)]['listFolders'](_0x27db7e),{'verbose':_0x26c031['verbose']}),_0x1a8999=_0x43baa6['data'];return console[_0x3ca105(0x128)](_0x3ca105(0x11a)+_0x1a8999[_0x3ca105(0x11d)]+'\x20folder'+(_0x1a8999[_0x3ca105(0x11d)]!==0x1?'s':'')),await handleSDKOutput(_0x1a8999,_0x26c031),0x0;}catch(_0x5f5203){if(_0x5f5203 instanceof SDKError)return console[_0x3ca105(0x128)](_0x3ca105(0xd5)+_0x5f5203['message']),_0x5f5203[_0x3ca105(0xd4)]&&console[_0x3ca105(0x128)](_0x3ca105(0x11f)+_0x5f5203[_0x3ca105(0xd4)]),0x1;throw _0x5f5203;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xcf);[a22_0x411ca8(0xe2)]=a22_0x411ca8(0x100);async[a22_0x411ca8(0x10a)](_0x553bbe){const _0x46e8fd=a22_0x411ca8,{options:_0x47ae89,args:_0x92ac80,tdx:_0x2da2f5}=_0x553bbe;if(_0x92ac80[_0x46e8fd(0x11d)]===0x0)return console['error'](_0x46e8fd(0x110)),console[_0x46e8fd(0x128)](_0x46e8fd(0x129)),0x1;try{const {parentId:_0x52b42,childId:_0x554fbe}=parseSegmentRef(_0x92ac80[0x0]);_0x47ae89[_0x46e8fd(0x104)]&&(console[_0x46e8fd(0x128)]('Site:\x20'+_0x47ae89[_0x46e8fd(0xfc)]),console['error'](_0x46e8fd(0xde)+_0x52b42),_0x554fbe&&console[_0x46e8fd(0x128)](_0x46e8fd(0xee)+_0x554fbe));if(!_0x554fbe)return console[_0x46e8fd(0x128)](_0x46e8fd(0x114)),0x1;const _0x144ad6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x52b42+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)][_0x46e8fd(0xf9)](_0x52b42),{'verbose':_0x47ae89[_0x46e8fd(0x104)]}),_0x47038a=_0x144ad6[_0x46e8fd(0xdb)];_0x47ae89[_0x46e8fd(0x104)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0x119)+_0x47038a);const _0x2d6f58=await withSpinner(_0x46e8fd(0xec)+_0x554fbe+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)]['resolveFolderId'](_0x47038a,_0x554fbe),{'verbose':_0x47ae89[_0x46e8fd(0x104)]}),_0x5a9a8b=_0x2d6f58[_0x46e8fd(0xdb)];_0x47ae89[_0x46e8fd(0x104)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0xff)+_0x5a9a8b);const _0x3b241d=await withSpinner(_0x46e8fd(0x105)+_0x554fbe+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)][_0x46e8fd(0xd3)](_0x5a9a8b),{'verbose':_0x47ae89[_0x46e8fd(0x104)]});return await handleSDKOutput([_0x3b241d[_0x46e8fd(0xdb)]],_0x47ae89),0x0;}catch(_0x4025fe){if(_0x4025fe instanceof SDKError)return console[_0x46e8fd(0x128)](_0x46e8fd(0xd5)+_0x4025fe['message']),_0x4025fe[_0x46e8fd(0xd4)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0x11f)+_0x4025fe[_0x46e8fd(0xd4)]),0x1;throw _0x4025fe;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xe8);['description']=a22_0x411ca8(0xeb);async['execute'](_0x2e22d9){const _0x199f05=a22_0x411ca8,{options:_0x3641c4,args:_0x342d8c,tdx:_0x250fc7}=_0x2e22d9;if(_0x342d8c[_0x199f05(0x11d)]===0x0)return console[_0x199f05(0x128)](_0x199f05(0xdd)),console['error'](_0x199f05(0x113)),console[_0x199f05(0x128)]('Examples:'),console[_0x199f05(0x128)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console['error'](_0x199f05(0xfe)),console[_0x199f05(0x128)](_0x199f05(0x13b)),0x1;try{const _0x14718e=_0x342d8c[0x0],_0x3fa4ff=_0x3641c4[_0x199f05(0x126)];let _0x2c7662=_0x14718e;_0x3fa4ff&&!_0x14718e['includes']('/')&&(_0x2c7662=_0x3fa4ff+'/'+_0x14718e,_0x3641c4[_0x199f05(0x104)]&&console[_0x199f05(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2c7662));const _0xd12287=await withSpinner(_0x199f05(0x125)+_0x2c7662+_0x199f05(0x118),()=>_0x250fc7[_0x199f05(0x134)][_0x199f05(0x130)](_0x2c7662),{'verbose':_0x3641c4[_0x199f05(0x104)]}),_0x22ac60=_0xd12287['data'];_0x3641c4[_0x199f05(0x104)]&&(console[_0x199f05(0x128)]('Resolved\x20type:\x20'+_0x22ac60[_0x199f05(0x109)]),console['error']('Parent\x20ID:\x20'+_0x22ac60[_0x199f05(0x107)]));if(_0x22ac60[_0x199f05(0x109)]===_0x199f05(0xdc))return console[_0x199f05(0x128)](_0x199f05(0x137)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x494771;if(_0x22ac60[_0x199f05(0x109)]===_0x199f05(0x131)){const _0x4e0a81=await withSpinner(_0x199f05(0x13e),()=>_0x250fc7[_0x199f05(0x134)][_0x199f05(0x121)](_0x22ac60['parentId']),{'verbose':_0x3641c4[_0x199f05(0x104)]});_0x494771=_0x4e0a81[_0x199f05(0xdb)];}else{if(!_0x22ac60[_0x199f05(0xe9)])throw new SDKError(ErrorCode['INTERNAL'],_0x199f05(0x133));const _0x10de6c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x250fc7['segment'][_0x199f05(0xfa)](_0x22ac60[_0x199f05(0x107)],_0x22ac60[_0x199f05(0xe9)]),{'verbose':_0x3641c4[_0x199f05(0x104)]});_0x494771=_0x10de6c[_0x199f05(0xdb)];}return _0x3641c4[_0x199f05(0xf3)]===_0x199f05(0xe0)||_0x3641c4[_0x199f05(0xf3)]===_0x199f05(0xcd)?await handleSDKOutput([{'sql':_0x494771}],_0x3641c4):console[_0x199f05(0xf6)](_0x494771),0x0;}catch(_0x17fd0a){if(_0x17fd0a instanceof SDKError)return console[_0x199f05(0x128)](_0x199f05(0xd5)+_0x17fd0a['message']),_0x17fd0a[_0x199f05(0xd4)]&&console[_0x199f05(0x128)]('\x20\x20Cause:\x20'+_0x17fd0a[_0x199f05(0xd4)]),0x1;throw _0x17fd0a;}}}function a22_0x5afa(){const _0x38e764=['segment','jobId','getParent','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','stats','query','31568XAkbwS','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','14172hawegY','Fetching\x20SQL\x20for\x20parent\x20segment...','Parent\x20segment:\x20','451ehxArv','toLocaleString','Site:\x20','jsonl','Listing\x20folders\x20for\x20parent\x20\x27','segment:folder:show','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','elapsedTimeMillis','getFolder','cause','Error:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','265884qwFhdS','Fetching\x20segment\x20details...','Error:\x20Path\x20or\x20name\x20is\x20required','287GDXIAw','data','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20name:\x20','message','json','Fetching\x20parent\x20segment\x20details...','description','48wThrXN','replace','Resolved\x20parent\x20folder\x20ID:\x20','✔\x20Created\x20folder\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','segment:sql','segmentId','✔\x20Query\x20completed:\x20Processed\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Resolving\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','Folder\x20name:\x20','segment:show','INTERNAL','554liDeML','name','format','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','in\x20','log','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','resolveParentId','getSegmentSQL','Fetching\x20folder\x20details...','site','processedRows','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20folder\x20ID:\x20','Show\x20segment\x20folder\x20details','787PLEqQj','51855ArcxBU','Show\x20segment\x20or\x20folder\x20details','verbose','Fetching\x20folder\x20\x27','Folder\x20ID:\x20','parentId','Usage:\x20tdx\x20segment\x20describe\x20<path>','type','execute','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','2561565qYrhLS','Folder\x20ID\x20missing\x20from\x20resolved\x20path','code','limit','Error:\x20Folder\x20reference\x20is\x20required','createFolder','Resolved\x20type:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:describe','\x27...','Resolved\x20parent\x20ID:\x20','✔\x20Found\x20','823440ppIFhI','1467dTYxfR','length','\x20[Job\x20ID:\x20','\x20\x20Cause:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getParentSQL','folderId','includes','SQL\x20query:\x0a','Resolving\x20path\x20\x27','segmentPath','information_schema','error','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20ID:\x20','Examples:','getSegment','\x20rows\x20','resolvePathToResource','parent','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a22_0x5afa=function(){return _0x38e764;};return a22_0x5afa();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a22_0x411ca8(0xe2)]='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x411ca8(0x10a)](_0x3a3521){const _0x633a0f=a22_0x411ca8,{options:_0x2044dc,args:_0xa244e8,tdx:_0xf7f0db}=_0x3a3521,_0x179098=_0x2044dc;if(_0xa244e8[_0x633a0f(0x11d)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x633a0f(0x116)),0x1;const _0x359e19=_0xa244e8[0x0],_0x2cd29c=_0xa244e8[0x1];_0x179098['verbose']&&(console['error']('Site:\x20'+_0x179098[_0x633a0f(0xfc)]),console['error'](_0x633a0f(0x13f)+_0x359e19),console[_0x633a0f(0x128)](_0x633a0f(0xee)+_0x2cd29c));let _0x575990;if(_0x179098[_0x633a0f(0x132)]){const _0x353d0d=_0x179098[_0x633a0f(0x132)],_0x19933e=await withSpinner(_0x633a0f(0xf8)+_0x359e19+_0x633a0f(0x118),()=>_0xf7f0db['segment'][_0x633a0f(0xf9)](_0x359e19),{'verbose':_0x179098[_0x633a0f(0x104)]}),_0x35d470=_0x19933e[_0x633a0f(0xdb)],_0x5af6b0=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x353d0d+_0x633a0f(0x118),()=>_0xf7f0db[_0x633a0f(0x134)]['resolveFolderId'](_0x35d470,_0x353d0d),{'verbose':_0x179098['verbose']});_0x575990=_0x5af6b0[_0x633a0f(0xdb)],_0x179098[_0x633a0f(0x104)]&&console[_0x633a0f(0x128)](_0x633a0f(0xe5)+_0x575990);}const _0x1aa519={'name':_0x2cd29c,'description':_0x179098[_0x633a0f(0xe2)],'parentFolderId':_0x575990},_0x577424=await withSpinner('Creating\x20folder\x20\x27'+_0x2cd29c+_0x633a0f(0x118),()=>_0xf7f0db[_0x633a0f(0x134)][_0x633a0f(0x111)](_0x359e19,_0x1aa519),{'verbose':_0x179098[_0x633a0f(0x104)]}),_0x2c6a38=_0x577424[_0x633a0f(0xdb)];return console['error'](_0x633a0f(0xe6)+_0x2c6a38[_0x633a0f(0xf2)]+_0x633a0f(0xf7)+_0x2c6a38['id']),await handleSDKOutput([_0x2c6a38],_0x179098),0x0;}}