@treasuredata/tdx 0.1.15 → 0.1.16

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 (80) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/client/cdp-client.js +1 -1
  3. package/dist/client/http-client.js +1 -1
  4. package/dist/client/llm-client.js +1 -1
  5. package/dist/client/rate-limiter.js +1 -1
  6. package/dist/client/td-client.js +1 -1
  7. package/dist/client/trino-client.js +1 -1
  8. package/dist/client/workflow-client.js +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/command.js +1 -1
  14. package/dist/commands/context-command.js +1 -1
  15. package/dist/commands/databases.js +1 -1
  16. package/dist/commands/describe.js +1 -1
  17. package/dist/commands/job-command.js +1 -1
  18. package/dist/commands/llm-command.js +1 -1
  19. package/dist/commands/llm-proxy.js +1 -1
  20. package/dist/commands/parent-segment-command.js +1 -1
  21. package/dist/commands/profiles-command.js +1 -1
  22. package/dist/commands/query-command.js +1 -1
  23. package/dist/commands/segment-command.js +1 -1
  24. package/dist/commands/segment-create-command.js +1 -1
  25. package/dist/commands/segment-fields-command.js +1 -1
  26. package/dist/commands/segment-pwd-command.js +1 -1
  27. package/dist/commands/segment-update-command.js +1 -1
  28. package/dist/commands/segment-use-command.js +1 -1
  29. package/dist/commands/segments.js +1 -1
  30. package/dist/commands/show.js +1 -1
  31. package/dist/commands/tables.js +1 -1
  32. package/dist/commands/use-command.js +1 -1
  33. package/dist/commands/workflow-command.js +1 -1
  34. package/dist/core/auth.js +1 -1
  35. package/dist/core/config.js +1 -1
  36. package/dist/core/global-context.js +1 -1
  37. package/dist/core/profile.js +1 -1
  38. package/dist/core/project-config.js +1 -1
  39. package/dist/core/session.js +1 -1
  40. package/dist/index.js +1 -1
  41. package/dist/proxy/anthropic-adapter.d.ts +1 -0
  42. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  43. package/dist/proxy/anthropic-adapter.js +1 -1
  44. package/dist/proxy/anthropic-adapter.js.map +1 -1
  45. package/dist/proxy/server.js +1 -1
  46. package/dist/sdk/api.js +1 -1
  47. package/dist/sdk/database.js +1 -1
  48. package/dist/sdk/errors.js +1 -1
  49. package/dist/sdk/index.js +1 -1
  50. package/dist/sdk/job.js +1 -1
  51. package/dist/sdk/llm.js +1 -1
  52. package/dist/sdk/query.js +1 -1
  53. package/dist/sdk/segment.js +1 -1
  54. package/dist/sdk/table.js +1 -1
  55. package/dist/sdk/workflow.js +1 -1
  56. package/dist/types/endpoints.js +1 -1
  57. package/dist/types/index.js +1 -1
  58. package/dist/utils/agent-ref-parser.js +1 -1
  59. package/dist/utils/chat-cache.js +1 -1
  60. package/dist/utils/colors.js +1 -1
  61. package/dist/utils/command-output.js +1 -1
  62. package/dist/utils/file-permissions.js +1 -1
  63. package/dist/utils/format-detector.js +1 -1
  64. package/dist/utils/formatters.js +1 -1
  65. package/dist/utils/json-loader.js +1 -1
  66. package/dist/utils/model-aliases.js +1 -1
  67. package/dist/utils/option-validation.js +1 -1
  68. package/dist/utils/port.js +1 -1
  69. package/dist/utils/process.js +1 -1
  70. package/dist/utils/prompt.js +1 -1
  71. package/dist/utils/segment-path-parser.js +1 -1
  72. package/dist/utils/segment-ref-parser.js +1 -1
  73. package/dist/utils/spinner.js +1 -1
  74. package/dist/utils/sql-parser.js +1 -1
  75. package/dist/utils/sse-parser.js +1 -1
  76. package/dist/utils/string-utils.js +1 -1
  77. package/dist/utils/table-ref-parser.js +1 -1
  78. package/dist/utils/tree-formatter.js +1 -1
  79. package/dist/utils/workflow-utils.js +1 -1
  80. package/package.json +1 -1
@@ -1 +1 @@
1
- const a17_0x245033=a17_0x420b;(function(_0x144ddb,_0x4a1c63){const _0x4fb747=a17_0x420b,_0x38b8ad=_0x144ddb();while(!![]){try{const _0x4fbe04=parseInt(_0x4fb747(0x133))/0x1*(-parseInt(_0x4fb747(0x13c))/0x2)+-parseInt(_0x4fb747(0x165))/0x3*(parseInt(_0x4fb747(0x158))/0x4)+parseInt(_0x4fb747(0x12d))/0x5+parseInt(_0x4fb747(0x14d))/0x6*(parseInt(_0x4fb747(0x155))/0x7)+parseInt(_0x4fb747(0x148))/0x8*(-parseInt(_0x4fb747(0x174))/0x9)+-parseInt(_0x4fb747(0x14a))/0xa*(parseInt(_0x4fb747(0x152))/0xb)+parseInt(_0x4fb747(0x16b))/0xc;if(_0x4fbe04===_0x4a1c63)break;else _0x38b8ad['push'](_0x38b8ad['shift']());}catch(_0x14a78f){_0x38b8ad['push'](_0x38b8ad['shift']());}}}(a17_0x1402,0xa58d2));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';function handleSDKError(_0x34e672,_0xe3eefc){const _0x166839=a17_0x420b;if(_0x34e672 instanceof SDKError)console[_0x166839(0x149)](_0x166839(0x177)+_0x34e672[_0x166839(0x13b)]),_0xe3eefc['verbose']&&(_0x34e672[_0x166839(0x129)]&&console['error']('\x20\x20Cause:\x20'+_0x34e672[_0x166839(0x129)]),_0x34e672[_0x166839(0x13f)]&&(console[_0x166839(0x149)](_0x166839(0x17b)),console['error'](_0x34e672[_0x166839(0x13f)])));else throw _0x34e672;}async function getProjectIdOrDefault(_0x1ffea7){const _0x1bb1fe=a17_0x420b,{tdx:_0x3232c6,options:_0x5b2338}=_0x1ffea7,_0x39397a=_0x5b2338[_0x1bb1fe(0x16d)];if(_0x39397a){const _0x3c462d=await withSpinner(_0x1bb1fe(0x15d)+_0x39397a+'\x27...',()=>_0x3232c6[_0x1bb1fe(0x136)][_0x1bb1fe(0x139)](_0x39397a),{'verbose':_0x5b2338[_0x1bb1fe(0x16f)]});return _0x3c462d['data'];}let _0x2ca196=_0x3232c6[_0x1bb1fe(0x136)][_0x1bb1fe(0x16c)]();if(_0x2ca196)return _0x2ca196;const _0xe6d82a=await withSpinner(_0x1bb1fe(0x15b),()=>_0x3232c6['llm'][_0x1bb1fe(0x17a)](),{'verbose':_0x5b2338[_0x1bb1fe(0x16f)]});return _0xe6d82a['data']['id'];}function toLLMProjectInfo(_0x59a892){const _0x149343=a17_0x420b;return{'name':_0x59a892[_0x149343(0x138)][_0x149343(0x15e)],'description':_0x59a892[_0x149343(0x138)]['description'],'createdAt':_0x59a892[_0x149343(0x138)][_0x149343(0x150)],'updatedAt':_0x59a892['attributes']['updatedAt']};}function a17_0x1402(){const _0x30df5b=['Creating\x20project\x20\x27','attributes','resolveProjectId','data','message','34iQhuZW','\x27...','map','stack','Fetching\x20chat\x20sessions...','history','temperature','Agent\x20created:\x20','Create\x20a\x20new\x20agent\x20in\x20current\x20project','Error:\x20Agent\x20name\x20is\x20required','setCurrentProject','execute','8lpnNZi','error','10TuGkyf','Fetching\x20chat\x20history\x20for\x20\x27','length','115602piXZDe','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','createdAt','limit','3210042GWZKTD','Project\x20deleted:\x20','Resolving\x20agent\x20\x27','329bHkrJc','projects','starterMessage','16FpoxIx','maxToolIterations','slice','Getting\x20default\x20project...','filter','Resolving\x20project\x20\x27','name','Error:\x20Project\x20name\x20is\x20required','deleteProject','List\x20available\x20LLM\x20models','messages','Deleting\x20project\x20\x27','agents','818709vAlqbC','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','claude-4.5-haiku','createAgent','description','12059868sShSHM','getCurrentProject','llmProject','Update\x20an\x20existing\x20agent','verbose','Fetching\x20agents...','llm:agents','llm:projects','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','964125uDfPyS','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','prompt','Error:\x20','llm:agent:update','Creating\x20agent\x20\x27','getOrCreateDefaultProject','\x0aStack\x20trace:','llm:agent:create','llm:agent:show','...','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','log','createProject','llm:project:create','resolveAgentId','cause','Fetching\x20agent...','llm:project:delete','Fetching\x20available\x20models...','6562040mdWNxx','Updating\x20agent...','models','llm:history','Agent\x20updated:\x20','updatedAt','62017iTUPxD','Deleting\x20agent...','Delete\x20an\x20agent','llm'];a17_0x1402=function(){return _0x30df5b;};return a17_0x1402();}function toAgentInfo(_0x4e4b9b){const _0x53ecc5=a17_0x420b;return{'name':_0x4e4b9b[_0x53ecc5(0x138)][_0x53ecc5(0x15e)],'description':_0x4e4b9b[_0x53ecc5(0x138)][_0x53ecc5(0x16a)],'prompt':truncatePrompt(_0x4e4b9b[_0x53ecc5(0x138)][_0x53ecc5(0x176)]),'createdAt':_0x4e4b9b['attributes']['createdAt'],'updatedAt':_0x4e4b9b['attributes'][_0x53ecc5(0x132)]};}function truncatePrompt(_0x34d3f6){const _0x12b28d=a17_0x420b;if(!_0x34d3f6)return undefined;const _0x290683=0x64;if(_0x34d3f6['length']<=_0x290683)return _0x34d3f6;return _0x34d3f6[_0x12b28d(0x15a)](0x0,_0x290683)+_0x12b28d(0x17e);}export class LLMModelsCommand extends BaseCommand{[a17_0x245033(0x15e)]='llm:models';[a17_0x245033(0x16a)]=a17_0x245033(0x161);async[a17_0x245033(0x147)](_0x3b562e){const _0x126ebe=a17_0x245033,{options:_0x3ce326,tdx:_0x3e7bb3}=_0x3b562e;try{const _0x26c390=await withSpinner(_0x126ebe(0x12c),()=>_0x3e7bb3[_0x126ebe(0x136)][_0x126ebe(0x12f)](),{'verbose':_0x3ce326[_0x126ebe(0x16f)]});return await handleSDKOutput(_0x26c390['data'],_0x3ce326),0x0;}catch(_0x4b74c1){return handleSDKError(_0x4b74c1,_0x3ce326),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0x245033(0x15e)]=a17_0x245033(0x172);['description']='List\x20all\x20LLM\x20projects';async[a17_0x245033(0x147)](_0x19dce4){const _0x5c7353=a17_0x245033,{options:_0xaf1484,args:_0x2e1f45,tdx:_0x5a0165}=_0x19dce4;try{const _0x3fd955=_0x2e1f45[0x0],_0x27681d=_0xaf1484[_0x5c7353(0x151)]?Number(_0xaf1484[_0x5c7353(0x151)]):0x32,_0x39c76b=await withSpinner('Fetching\x20projects...',()=>_0x5a0165[_0x5c7353(0x136)][_0x5c7353(0x156)](_0x27681d),{'verbose':_0xaf1484['verbose']});let _0x609a7f=_0x39c76b[_0x5c7353(0x13a)];_0x3fd955&&(_0x609a7f=_0x39c76b[_0x5c7353(0x13a)][_0x5c7353(0x15c)](_0x21ff95=>matchGlobPattern(_0x21ff95[_0x5c7353(0x138)][_0x5c7353(0x15e)],_0x3fd955)));const _0x19fab8=_0x609a7f[_0x5c7353(0x13e)](toLLMProjectInfo);return await handleSDKOutput(_0x19fab8,_0xaf1484),0x0;}catch(_0x36d89d){return handleSDKError(_0x36d89d,_0xaf1484),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x245033(0x15e)]=a17_0x245033(0x171);['description']='List\x20agents\x20in\x20current\x20project';async[a17_0x245033(0x147)](_0x3de1fc){const _0x523a77=a17_0x245033,{options:_0xe5fa46,args:_0x3f8431,tdx:_0x396cd3}=_0x3de1fc;try{const _0x2b0d1e=_0x3f8431[0x0],_0x2ebc64=await getProjectIdOrDefault(_0x3de1fc),_0x4849fe=await withSpinner(_0x523a77(0x170),()=>_0x396cd3[_0x523a77(0x136)][_0x523a77(0x164)](_0x2ebc64),{'verbose':_0xe5fa46[_0x523a77(0x16f)]});let _0x4b5c60=_0x4849fe['data'];_0x2b0d1e&&(_0x4b5c60=_0x4849fe[_0x523a77(0x13a)][_0x523a77(0x15c)](_0x4425b8=>matchGlobPattern(_0x4425b8[_0x523a77(0x138)]['name'],_0x2b0d1e)));const _0x920ea8=_0x4b5c60[_0x523a77(0x13e)](toAgentInfo);return await handleSDKOutput(_0x920ea8,_0xe5fa46),0x0;}catch(_0x482cd9){return handleSDKError(_0x482cd9,_0xe5fa46),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a17_0x245033(0x17d);[a17_0x245033(0x16a)]='Show\x20agent\x20details';async[a17_0x245033(0x147)](_0x24073e){const _0x25c3dc=a17_0x245033,{options:_0x5dd9f8,args:_0x43c130,tdx:_0x519b0c}=_0x24073e;if(_0x43c130[_0x25c3dc(0x14c)]===0x0)return console[_0x25c3dc(0x149)](_0x25c3dc(0x145)),console[_0x25c3dc(0x149)](_0x25c3dc(0x173)),0x1;const _0x5be440=_0x43c130[0x0];try{const _0x34573d=await getProjectIdOrDefault(_0x24073e),_0x5b7ba8=await withSpinner('Resolving\x20agent\x20\x27'+_0x5be440+_0x25c3dc(0x13d),()=>_0x519b0c[_0x25c3dc(0x136)][_0x25c3dc(0x128)](_0x5be440,_0x34573d),{'verbose':_0x5dd9f8[_0x25c3dc(0x16f)]}),_0x15f5ae=await withSpinner(_0x25c3dc(0x12a),()=>_0x519b0c[_0x25c3dc(0x136)]['agent'](_0x5b7ba8[_0x25c3dc(0x13a)]),{'verbose':_0x5dd9f8[_0x25c3dc(0x16f)]});return await handleSDKOutput([_0x15f5ae[_0x25c3dc(0x13a)]],_0x5dd9f8),0x0;}catch(_0x27482b){return handleSDKError(_0x27482b,_0x5dd9f8),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a17_0x245033(0x15e)]=a17_0x245033(0x17c);[a17_0x245033(0x16a)]=a17_0x245033(0x144);async[a17_0x245033(0x147)](_0x3d60e0){const _0x18d704=a17_0x245033,{options:_0x51bb4e,args:_0x2da589,tdx:_0x326e4a}=_0x3d60e0;if(_0x2da589[_0x18d704(0x14c)]===0x0)return console[_0x18d704(0x149)](_0x18d704(0x145)),console[_0x18d704(0x149)](_0x18d704(0x175)),0x1;const _0x100fd7=_0x2da589[0x0],_0x111b52=_0x51bb4e,_0x50b655=_0x111b52['systemPrompt'],_0x41e025=_0x111b52['model']||_0x18d704(0x168),_0x19db0b=_0x111b52[_0x18d704(0x157)],_0x1ffc60=_0x111b52['maxToolIterations']?Number(_0x111b52[_0x18d704(0x159)]):undefined,_0x4e6141=_0x111b52['temperature']?Number(_0x111b52[_0x18d704(0x142)]):undefined;try{const _0x1604e0=await getProjectIdOrDefault(_0x3d60e0),_0xc7d096=await withSpinner(_0x18d704(0x179)+_0x100fd7+_0x18d704(0x13d),()=>_0x326e4a[_0x18d704(0x136)][_0x18d704(0x169)]({'name':_0x100fd7,'projectId':_0x1604e0,'modelType':_0x41e025,'systemPrompt':_0x50b655,'starterMessage':_0x19db0b,'maxToolIterations':_0x1ffc60,'temperature':_0x4e6141}),{'verbose':_0x51bb4e[_0x18d704(0x16f)]});return console[_0x18d704(0x180)](_0x18d704(0x143)+_0xc7d096[_0x18d704(0x13a)]['id']),await handleSDKOutput([_0xc7d096['data']],_0x51bb4e),0x0;}catch(_0x3ffa53){return handleSDKError(_0x3ffa53,_0x51bb4e),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x245033(0x15e)]=a17_0x245033(0x178);['description']=a17_0x245033(0x16e);async['execute'](_0x4a3fbb){const _0x52b447=a17_0x245033,{options:_0x4edab1,args:_0x2568d3,tdx:_0x11d708}=_0x4a3fbb;if(_0x2568d3[_0x52b447(0x14c)]===0x0)return console[_0x52b447(0x149)](_0x52b447(0x145)),console[_0x52b447(0x149)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x55b1e8=_0x2568d3[0x0],_0x32b390=_0x4edab1,_0x455d88=_0x32b390[_0x52b447(0x15e)],_0x51a446=_0x32b390['prompt'],_0x1c654b=_0x32b390[_0x52b447(0x16a)],_0x5761e5=_0x32b390[_0x52b447(0x157)];if(!_0x455d88&&!_0x51a446&&!_0x1c654b&&!_0x5761e5)return console[_0x52b447(0x149)](_0x52b447(0x14f)),console['error']('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x1ccb8e=await getProjectIdOrDefault(_0x4a3fbb),_0x1d4158=await withSpinner('Resolving\x20agent\x20\x27'+_0x55b1e8+'\x27...',()=>_0x11d708['llm']['resolveAgentId'](_0x55b1e8,_0x1ccb8e),{'verbose':_0x4edab1['verbose']}),_0xeb3d61=_0x1d4158[_0x52b447(0x13a)],_0x3a2b92=await withSpinner(_0x52b447(0x12e),()=>_0x11d708[_0x52b447(0x136)]['updateAgent'](_0xeb3d61,{'name':_0x455d88,'prompt':_0x51a446,'description':_0x1c654b,'starterMessage':_0x5761e5}),{'verbose':_0x4edab1[_0x52b447(0x16f)]});return console[_0x52b447(0x180)](_0x52b447(0x131)+_0x3a2b92[_0x52b447(0x13a)]['id']),await handleSDKOutput([_0x3a2b92['data']],_0x4edab1),0x0;}catch(_0x5eff76){return handleSDKError(_0x5eff76,_0x4edab1),0x1;}}}function a17_0x420b(_0x11f7ea,_0x43fdd1){const _0x1402c6=a17_0x1402();return a17_0x420b=function(_0x420bab,_0x38c10f){_0x420bab=_0x420bab-0x128;let _0xa5e1ca=_0x1402c6[_0x420bab];return _0xa5e1ca;},a17_0x420b(_0x11f7ea,_0x43fdd1);}export class LLMAgentDeleteCommand extends BaseCommand{[a17_0x245033(0x15e)]='llm:agent:delete';[a17_0x245033(0x16a)]=a17_0x245033(0x135);async[a17_0x245033(0x147)](_0x175831){const _0x3c3987=a17_0x245033,{options:_0x27974b,args:_0x358bb7,tdx:_0x112c24}=_0x175831;if(_0x358bb7[_0x3c3987(0x14c)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x3c3987(0x149)](_0x3c3987(0x17f)),0x1;const _0x714482=_0x358bb7[0x0];try{const _0x4dc8e3=await getProjectIdOrDefault(_0x175831),_0xcc4ef3=await withSpinner(_0x3c3987(0x154)+_0x714482+_0x3c3987(0x13d),()=>_0x112c24[_0x3c3987(0x136)][_0x3c3987(0x128)](_0x714482,_0x4dc8e3),{'verbose':_0x27974b[_0x3c3987(0x16f)]}),_0x29dd70=_0xcc4ef3[_0x3c3987(0x13a)];return await withSpinner(_0x3c3987(0x134),()=>_0x112c24['llm']['deleteAgent'](_0x29dd70),{'verbose':_0x27974b['verbose']}),console['log']('Agent\x20deleted:\x20'+_0x29dd70),0x0;}catch(_0x55977b){return handleSDKError(_0x55977b,_0x27974b),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x245033(0x15e)]=a17_0x245033(0x130);['description']='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async['execute'](_0x4030bb){const _0x266ddd=a17_0x245033,{options:_0x5ae280,args:_0x579830,tdx:_0x2ea142}=_0x4030bb,_0x1e34f2=_0x579830[0x0];try{if(!_0x1e34f2){const _0x50a62c=_0x5ae280[_0x266ddd(0x151)]?Number(_0x5ae280['limit']):0x32,_0x5f2686=await withSpinner(_0x266ddd(0x140),()=>_0x2ea142['llm']['chats'](_0x50a62c),{'verbose':_0x5ae280[_0x266ddd(0x16f)]});return await handleSDKOutput(_0x5f2686[_0x266ddd(0x13a)],_0x5ae280),0x0;}else{const _0x2bc9c1=await withSpinner(_0x266ddd(0x14b)+_0x1e34f2+_0x266ddd(0x13d),()=>_0x2ea142['llm'][_0x266ddd(0x141)](_0x1e34f2),{'verbose':_0x5ae280[_0x266ddd(0x16f)]});return await handleSDKOutput(_0x2bc9c1[_0x266ddd(0x13a)][_0x266ddd(0x162)],_0x5ae280),0x0;}}catch(_0x2ec1a3){return handleSDKError(_0x2ec1a3,_0x5ae280),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x245033(0x15e)]='llm:use';[a17_0x245033(0x16a)]='Set\x20current\x20project\x20context';async[a17_0x245033(0x147)](_0xba5999){const _0x56a2e4=a17_0x245033,{options:_0x3030c5,args:_0x258618,tdx:_0x3bc184}=_0xba5999;if(_0x258618['length']===0x0)return console[_0x56a2e4(0x149)](_0x56a2e4(0x15f)),console['error'](_0x56a2e4(0x166)),0x1;const _0x4ba2a5=_0x258618[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x4ba2a5+_0x56a2e4(0x13d),()=>_0x3bc184['llm'][_0x56a2e4(0x146)](_0x4ba2a5),{'verbose':_0x3030c5[_0x56a2e4(0x16f)]}),console[_0x56a2e4(0x180)]('Project\x20context\x20set\x20to:\x20'+_0x4ba2a5),0x0;}catch(_0x1a48d6){return handleSDKError(_0x1a48d6,_0x3030c5),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a17_0x245033(0x182);[a17_0x245033(0x16a)]='Create\x20a\x20new\x20LLM\x20project';async[a17_0x245033(0x147)](_0xdfc4f9){const _0x586e76=a17_0x245033,{options:_0x18f560,args:_0x4c90ec,tdx:_0x2386f8}=_0xdfc4f9;if(_0x4c90ec[_0x586e76(0x14c)]===0x0)return console[_0x586e76(0x149)](_0x586e76(0x15f)),console['error'](_0x586e76(0x167)),0x1;const _0x1fb750=_0x4c90ec[0x0],_0x4287f8=_0x18f560,_0x5f4236=_0x4287f8[_0x586e76(0x16a)];try{const _0x3b9adb=await withSpinner(_0x586e76(0x137)+_0x1fb750+_0x586e76(0x13d),()=>_0x2386f8[_0x586e76(0x136)][_0x586e76(0x181)]({'name':_0x1fb750,'description':_0x5f4236}),{'verbose':_0x18f560['verbose']});console[_0x586e76(0x180)]('Project\x20created:\x20'+_0x3b9adb[_0x586e76(0x13a)]['id']);const _0x1b6bf5=toLLMProjectInfo(_0x3b9adb[_0x586e76(0x13a)]);return await handleSDKOutput([_0x1b6bf5],_0x18f560),0x0;}catch(_0x3ba84e){return handleSDKError(_0x3ba84e,_0x18f560),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x245033(0x15e)]=a17_0x245033(0x12b);[a17_0x245033(0x16a)]='Delete\x20an\x20LLM\x20project';async[a17_0x245033(0x147)](_0x5ceae2){const _0x57a9aa=a17_0x245033,{options:_0x2906ad,args:_0x9f298b,tdx:_0x39a6f5}=_0x5ceae2;if(_0x9f298b[_0x57a9aa(0x14c)]===0x0)return console[_0x57a9aa(0x149)](_0x57a9aa(0x15f)),console[_0x57a9aa(0x149)](_0x57a9aa(0x14e)),0x1;const _0x32a332=_0x9f298b[0x0];try{return await withSpinner(_0x57a9aa(0x163)+_0x32a332+'\x27...',()=>_0x39a6f5['llm'][_0x57a9aa(0x160)](_0x32a332),{'verbose':_0x2906ad[_0x57a9aa(0x16f)]}),console['log'](_0x57a9aa(0x153)+_0x32a332),0x0;}catch(_0x32fd31){return handleSDKError(_0x32fd31,_0x2906ad),0x1;}}}
1
+ const a17_0x167337=a17_0x8b35;(function(_0x2de15f,_0x639fb5){const _0x3d4368=a17_0x8b35,_0x2e6140=_0x2de15f();while(!![]){try{const _0x105f56=parseInt(_0x3d4368(0x21b))/0x1*(parseInt(_0x3d4368(0x1f9))/0x2)+parseInt(_0x3d4368(0x218))/0x3*(parseInt(_0x3d4368(0x212))/0x4)+parseInt(_0x3d4368(0x1ea))/0x5*(-parseInt(_0x3d4368(0x1de))/0x6)+-parseInt(_0x3d4368(0x20b))/0x7+parseInt(_0x3d4368(0x213))/0x8+-parseInt(_0x3d4368(0x1fb))/0x9*(-parseInt(_0x3d4368(0x1e5))/0xa)+-parseInt(_0x3d4368(0x1d9))/0xb;if(_0x105f56===_0x639fb5)break;else _0x2e6140['push'](_0x2e6140['shift']());}catch(_0x22e04a){_0x2e6140['push'](_0x2e6140['shift']());}}}(a17_0x3f65,0xc7bed));function a17_0x8b35(_0x23e923,_0x44559c){const _0x3f652b=a17_0x3f65();return a17_0x8b35=function(_0x8b353,_0x16a4df){_0x8b353=_0x8b353-0x1c7;let _0x54b757=_0x3f652b[_0x8b353];return _0x54b757;},a17_0x8b35(_0x23e923,_0x44559c);}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';function handleSDKError(_0x4ffdf8,_0x1df1e0){const _0x5eb751=a17_0x8b35;if(_0x4ffdf8 instanceof SDKError)console[_0x5eb751(0x201)](_0x5eb751(0x222)+_0x4ffdf8['message']),_0x1df1e0['verbose']&&(_0x4ffdf8[_0x5eb751(0x223)]&&console[_0x5eb751(0x201)](_0x5eb751(0x1dd)+_0x4ffdf8[_0x5eb751(0x223)]),_0x4ffdf8[_0x5eb751(0x204)]&&(console[_0x5eb751(0x201)](_0x5eb751(0x1fd)),console[_0x5eb751(0x201)](_0x4ffdf8[_0x5eb751(0x204)])));else throw _0x4ffdf8;}async function getProjectIdOrDefault(_0x3eff93){const _0xf3a8c5=a17_0x8b35,{tdx:_0x5f17ce,options:_0x1d9694}=_0x3eff93,_0x58591e=_0x1d9694[_0xf3a8c5(0x1cc)];if(_0x58591e){const _0x110225=await withSpinner(_0xf3a8c5(0x20a)+_0x58591e+_0xf3a8c5(0x1da),()=>_0x5f17ce[_0xf3a8c5(0x1d0)]['resolveProjectId'](_0x58591e),{'verbose':_0x1d9694[_0xf3a8c5(0x1e4)]});return _0x110225[_0xf3a8c5(0x1ff)];}let _0x2defb8=_0x5f17ce['llm']['getCurrentProject']();if(_0x2defb8)return _0x2defb8;const _0xcfbf19=await withSpinner(_0xf3a8c5(0x1d5),()=>_0x5f17ce[_0xf3a8c5(0x1d0)][_0xf3a8c5(0x1ca)](),{'verbose':_0x1d9694[_0xf3a8c5(0x1e4)]});return _0xcfbf19[_0xf3a8c5(0x1ff)]['id'];}function toLLMProjectInfo(_0x3b2c95){const _0x4dfa15=a17_0x8b35;return{'name':_0x3b2c95['attributes'][_0x4dfa15(0x1f6)],'description':_0x3b2c95[_0x4dfa15(0x1fe)][_0x4dfa15(0x1d1)],'createdAt':_0x3b2c95['attributes'][_0x4dfa15(0x1cb)],'updatedAt':_0x3b2c95['attributes'][_0x4dfa15(0x1cf)]};}function toAgentInfo(_0x51fa5d){const _0x52bf33=a17_0x8b35;return{'name':_0x51fa5d[_0x52bf33(0x1fe)][_0x52bf33(0x1f6)],'description':_0x51fa5d['attributes'][_0x52bf33(0x1d1)],'prompt':truncatePrompt(_0x51fa5d['attributes'][_0x52bf33(0x211)]),'createdAt':_0x51fa5d[_0x52bf33(0x1fe)][_0x52bf33(0x1cb)],'updatedAt':_0x51fa5d[_0x52bf33(0x1fe)][_0x52bf33(0x1cf)]};}function truncatePrompt(_0x214ea2){const _0x585421=a17_0x8b35;if(!_0x214ea2)return undefined;const _0x4c6ce3=0x64;if(_0x214ea2[_0x585421(0x1e7)]<=_0x4c6ce3)return _0x214ea2;return _0x214ea2[_0x585421(0x1d2)](0x0,_0x4c6ce3)+_0x585421(0x21a);}export class LLMModelsCommand extends BaseCommand{[a17_0x167337(0x1f6)]='llm:models';[a17_0x167337(0x1d1)]=a17_0x167337(0x220);async[a17_0x167337(0x1f1)](_0x4c2ee5){const _0xb90c59=a17_0x167337,{options:_0x35fc80,tdx:_0x527b86}=_0x4c2ee5;try{const _0x44cf53=await withSpinner('Fetching\x20available\x20models...',()=>_0x527b86[_0xb90c59(0x1d0)][_0xb90c59(0x20f)](),{'verbose':_0x35fc80[_0xb90c59(0x1e4)]});return await handleSDKOutput(_0x44cf53[_0xb90c59(0x1ff)],_0x35fc80),0x0;}catch(_0x41a0d1){return handleSDKError(_0x41a0d1,_0x35fc80),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0x167337(0x1f6)]=a17_0x167337(0x209);[a17_0x167337(0x1d1)]=a17_0x167337(0x20e);async[a17_0x167337(0x1f1)](_0x37b4df){const _0x55ecf0=a17_0x167337,{options:_0x1d47a5,args:_0x927144,tdx:_0x593739}=_0x37b4df;try{const _0x5565f5=_0x927144[0x0],_0x2c0a4a=_0x1d47a5['limit']?Number(_0x1d47a5[_0x55ecf0(0x1e6)]):0x32,_0x55aa98=await withSpinner(_0x55ecf0(0x1f2),()=>_0x593739[_0x55ecf0(0x1d0)][_0x55ecf0(0x1d8)](_0x2c0a4a),{'verbose':_0x1d47a5[_0x55ecf0(0x1e4)]});let _0x2e58c5=_0x55aa98[_0x55ecf0(0x1ff)];_0x5565f5&&(_0x2e58c5=_0x55aa98[_0x55ecf0(0x1ff)][_0x55ecf0(0x1e1)](_0x2185e6=>matchGlobPattern(_0x2185e6[_0x55ecf0(0x1fe)]['name'],_0x5565f5)));const _0x19bb70=_0x2e58c5[_0x55ecf0(0x208)](toLLMProjectInfo);return await handleSDKOutput(_0x19bb70,_0x1d47a5),0x0;}catch(_0x42ef51){return handleSDKError(_0x42ef51,_0x1d47a5),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x167337(0x1f6)]=a17_0x167337(0x1ef);[a17_0x167337(0x1d1)]=a17_0x167337(0x206);async[a17_0x167337(0x1f1)](_0x2fa450){const _0x438caa=a17_0x167337,{options:_0x437640,args:_0x2f1587,tdx:_0xdc0ded}=_0x2fa450;try{const _0x39f9d8=_0x2f1587[0x0],_0x22ebe9=await getProjectIdOrDefault(_0x2fa450),_0x4ff86b=await withSpinner(_0x438caa(0x1e8),()=>_0xdc0ded['llm'][_0x438caa(0x200)](_0x22ebe9),{'verbose':_0x437640[_0x438caa(0x1e4)]});let _0x317516=_0x4ff86b[_0x438caa(0x1ff)];_0x39f9d8&&(_0x317516=_0x4ff86b['data']['filter'](_0x3548be=>matchGlobPattern(_0x3548be['attributes'][_0x438caa(0x1f6)],_0x39f9d8)));const _0x305dae=_0x317516['map'](toAgentInfo);return await handleSDKOutput(_0x305dae,_0x437640),0x0;}catch(_0x2d7228){return handleSDKError(_0x2d7228,_0x437640),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a17_0x167337(0x1c8);[a17_0x167337(0x1d1)]=a17_0x167337(0x203);async['execute'](_0x498264){const _0x50ab4c=a17_0x167337,{options:_0x453580,args:_0x10aaa5,tdx:_0x209de8}=_0x498264;if(_0x10aaa5['length']===0x0)return console[_0x50ab4c(0x201)](_0x50ab4c(0x214)),console[_0x50ab4c(0x201)](_0x50ab4c(0x210)),0x1;const _0x4c0dfb=_0x10aaa5[0x0];try{const _0x1de012=await getProjectIdOrDefault(_0x498264),_0x4aa06f=await withSpinner(_0x50ab4c(0x1d4)+_0x4c0dfb+_0x50ab4c(0x1da),()=>_0x209de8['llm'][_0x50ab4c(0x1d6)](_0x4c0dfb,_0x1de012),{'verbose':_0x453580[_0x50ab4c(0x1e4)]}),_0x240212=await withSpinner(_0x50ab4c(0x1ed),()=>_0x209de8[_0x50ab4c(0x1d0)][_0x50ab4c(0x21e)](_0x4aa06f[_0x50ab4c(0x1ff)]),{'verbose':_0x453580['verbose']});return await handleSDKOutput([_0x240212[_0x50ab4c(0x1ff)]],_0x453580),0x0;}catch(_0x1aa66c){return handleSDKError(_0x1aa66c,_0x453580),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a17_0x167337(0x1f6)]=a17_0x167337(0x216);[a17_0x167337(0x1d1)]=a17_0x167337(0x1c7);async[a17_0x167337(0x1f1)](_0x4a02e0){const _0x3565be=a17_0x167337,{options:_0x1f3ee8,args:_0xb0f546,tdx:_0x42cdc4}=_0x4a02e0;if(_0xb0f546[_0x3565be(0x1e7)]===0x0)return console[_0x3565be(0x201)](_0x3565be(0x214)),console[_0x3565be(0x201)](_0x3565be(0x1cd)),0x1;const _0x1cc89c=_0xb0f546[0x0],_0x70e9c7=_0x1f3ee8,_0x419202=_0x70e9c7[_0x3565be(0x20c)],_0x424144=_0x70e9c7[_0x3565be(0x207)]||'claude-4.5-haiku',_0xea9e9=_0x70e9c7[_0x3565be(0x20d)],_0x154f72=_0x70e9c7[_0x3565be(0x202)]?Number(_0x70e9c7[_0x3565be(0x202)]):undefined,_0xa93eb8=_0x70e9c7[_0x3565be(0x1dc)]?Number(_0x70e9c7['temperature']):undefined;try{const _0x2ef4b3=await getProjectIdOrDefault(_0x4a02e0),_0x15aaf0=await withSpinner('Creating\x20agent\x20\x27'+_0x1cc89c+'\x27...',()=>_0x42cdc4['llm'][_0x3565be(0x1fa)]({'name':_0x1cc89c,'projectId':_0x2ef4b3,'modelType':_0x424144,'systemPrompt':_0x419202,'starterMessage':_0xea9e9,'maxToolIterations':_0x154f72,'temperature':_0xa93eb8}),{'verbose':_0x1f3ee8[_0x3565be(0x1e4)]});return console[_0x3565be(0x1ee)]('Agent\x20created:\x20'+_0x15aaf0[_0x3565be(0x1ff)]['id']),await handleSDKOutput([_0x15aaf0['data']],_0x1f3ee8),0x0;}catch(_0x50c730){return handleSDKError(_0x50c730,_0x1f3ee8),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a17_0x167337(0x1f4);['description']=a17_0x167337(0x21c);async[a17_0x167337(0x1f1)](_0x2b51a3){const _0x534181=a17_0x167337,{options:_0x5ed30b,args:_0x167e31,tdx:_0x42e52a}=_0x2b51a3;if(_0x167e31[_0x534181(0x1e7)]===0x0)return console[_0x534181(0x201)](_0x534181(0x214)),console['error'](_0x534181(0x1f0)),0x1;const _0x200224=_0x167e31[0x0],_0x49de99=_0x5ed30b,_0x50f5ae=_0x49de99['name'],_0x4b407e=_0x49de99[_0x534181(0x211)],_0x4abca8=_0x49de99[_0x534181(0x1d1)],_0x1eb1f2=_0x49de99[_0x534181(0x20d)];if(!_0x50f5ae&&!_0x4b407e&&!_0x4abca8&&!_0x1eb1f2)return console['error'](_0x534181(0x1ec)),console[_0x534181(0x201)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x10f1e9=await getProjectIdOrDefault(_0x2b51a3),_0x3c4f3f=await withSpinner('Resolving\x20agent\x20\x27'+_0x200224+_0x534181(0x1da),()=>_0x42e52a[_0x534181(0x1d0)][_0x534181(0x1d6)](_0x200224,_0x10f1e9),{'verbose':_0x5ed30b[_0x534181(0x1e4)]}),_0x8cc51=_0x3c4f3f['data'],_0x358b01=await withSpinner('Updating\x20agent...',()=>_0x42e52a['llm'][_0x534181(0x217)](_0x8cc51,{'name':_0x50f5ae,'prompt':_0x4b407e,'description':_0x4abca8,'starterMessage':_0x1eb1f2}),{'verbose':_0x5ed30b['verbose']});return console[_0x534181(0x1ee)](_0x534181(0x1c9)+_0x358b01[_0x534181(0x1ff)]['id']),await handleSDKOutput([_0x358b01['data']],_0x5ed30b),0x0;}catch(_0x156c53){return handleSDKError(_0x156c53,_0x5ed30b),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a17_0x167337(0x1fc);[a17_0x167337(0x1d1)]=a17_0x167337(0x21d);async[a17_0x167337(0x1f1)](_0x1575fe){const _0x495f6c=a17_0x167337,{options:_0x234dc8,args:_0x53aed0,tdx:_0x350b09}=_0x1575fe;if(_0x53aed0['length']===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x495f6c(0x201)](_0x495f6c(0x1db)),0x1;const _0x2010b4=_0x53aed0[0x0];try{const _0x55bae4=await getProjectIdOrDefault(_0x1575fe),_0x87fa2=await withSpinner(_0x495f6c(0x1d4)+_0x2010b4+'\x27...',()=>_0x350b09['llm']['resolveAgentId'](_0x2010b4,_0x55bae4),{'verbose':_0x234dc8[_0x495f6c(0x1e4)]}),_0x1aa5d7=_0x87fa2[_0x495f6c(0x1ff)];return await withSpinner(_0x495f6c(0x1e2),()=>_0x350b09['llm']['deleteAgent'](_0x1aa5d7),{'verbose':_0x234dc8[_0x495f6c(0x1e4)]}),console['log'](_0x495f6c(0x1f5)+_0x1aa5d7),0x0;}catch(_0x3b4569){return handleSDKError(_0x3b4569,_0x234dc8),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a17_0x167337(0x1eb);[a17_0x167337(0x1d1)]=a17_0x167337(0x1df);async[a17_0x167337(0x1f1)](_0x23bc1c){const _0x432553=a17_0x167337,{options:_0x20ef7d,args:_0xdcb6d8,tdx:_0x39868f}=_0x23bc1c,_0x32c588=_0xdcb6d8[0x0];try{if(!_0x32c588){const _0x1d49bd=_0x20ef7d[_0x432553(0x1e6)]?Number(_0x20ef7d[_0x432553(0x1e6)]):0x32,_0x2a162b=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x39868f[_0x432553(0x1d0)]['chats'](_0x1d49bd),{'verbose':_0x20ef7d[_0x432553(0x1e4)]});return await handleSDKOutput(_0x2a162b[_0x432553(0x1ff)],_0x20ef7d),0x0;}else{const _0x41dd72=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x32c588+_0x432553(0x1da),()=>_0x39868f[_0x432553(0x1d0)]['history'](_0x32c588),{'verbose':_0x20ef7d[_0x432553(0x1e4)]});return await handleSDKOutput(_0x41dd72[_0x432553(0x1ff)][_0x432553(0x1e3)],_0x20ef7d),0x0;}}catch(_0x577556){return handleSDKError(_0x577556,_0x20ef7d),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x167337(0x1f6)]='llm:use';[a17_0x167337(0x1d1)]=a17_0x167337(0x221);async[a17_0x167337(0x1f1)](_0x1fed5c){const _0x26ec9e=a17_0x167337,{options:_0x25dded,args:_0x3c4ee7,tdx:_0x6ebf6}=_0x1fed5c;if(_0x3c4ee7[_0x26ec9e(0x1e7)]===0x0)return console[_0x26ec9e(0x201)](_0x26ec9e(0x1d7)),console[_0x26ec9e(0x201)](_0x26ec9e(0x1f8)),0x1;const _0x586d54=_0x3c4ee7[0x0];try{return await withSpinner(_0x26ec9e(0x205)+_0x586d54+'\x27...',()=>_0x6ebf6['llm'][_0x26ec9e(0x224)](_0x586d54),{'verbose':_0x25dded[_0x26ec9e(0x1e4)]}),console[_0x26ec9e(0x1ee)](_0x26ec9e(0x1f3)+_0x586d54),0x0;}catch(_0x1918cd){return handleSDKError(_0x1918cd,_0x25dded),0x1;}}}function a17_0x3f65(){const _0xefaee8=['llm:agents','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','execute','Fetching\x20projects...','Project\x20context\x20set\x20to:\x20','llm:agent:update','Agent\x20deleted:\x20','name','Creating\x20project\x20\x27','Usage:\x20tdx\x20llm\x20use\x20<project-name>','1428IZvCcp','createAgent','153kITeTH','llm:agent:delete','\x0aStack\x20trace:','attributes','data','agents','error','maxToolIterations','Show\x20agent\x20details','stack','Setting\x20project\x20context\x20to\x20\x27','List\x20agents\x20in\x20current\x20project','model','map','llm:projects','Resolving\x20project\x20\x27','2412102NUXLod','systemPrompt','starterMessage','List\x20all\x20LLM\x20projects','models','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','prompt','50108JbzBGz','1161336ENgSZA','Error:\x20Agent\x20name\x20is\x20required','Project\x20created:\x20','llm:agent:create','updateAgent','87GSxPTK','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','...','127Kaxstt','Update\x20an\x20existing\x20agent','Delete\x20an\x20agent','agent','Project\x20deleted:\x20','List\x20available\x20LLM\x20models','Set\x20current\x20project\x20context','Error:\x20','cause','setCurrentProject','Create\x20a\x20new\x20agent\x20in\x20current\x20project','llm:agent:show','Agent\x20updated:\x20','getOrCreateDefaultProject','createdAt','llmProject','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','Delete\x20an\x20LLM\x20project','updatedAt','llm','description','slice','Deleting\x20project\x20\x27','Resolving\x20agent\x20\x27','Getting\x20default\x20project...','resolveAgentId','Error:\x20Project\x20name\x20is\x20required','projects','2182851qOqBDE','\x27...','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','temperature','\x20\x20Cause:\x20','4713438sMbxqA','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Create\x20a\x20new\x20LLM\x20project','filter','Deleting\x20agent...','messages','verbose','910370VcAYEx','limit','length','Fetching\x20agents...','llm:project:delete','5TDpCWv','llm:history','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Fetching\x20agent...','log'];a17_0x3f65=function(){return _0xefaee8;};return a17_0x3f65();}export class LLMProjectCreateCommand extends BaseCommand{[a17_0x167337(0x1f6)]='llm:project:create';['description']=a17_0x167337(0x1e0);async[a17_0x167337(0x1f1)](_0x5886ef){const _0x2c3ade=a17_0x167337,{options:_0x3fd460,args:_0x337570,tdx:_0x797774}=_0x5886ef;if(_0x337570[_0x2c3ade(0x1e7)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x2c3ade(0x201)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x33b10a=_0x337570[0x0],_0x1cbf00=_0x3fd460,_0x4b45cf=_0x1cbf00['description'];try{const _0x169aea=await withSpinner(_0x2c3ade(0x1f7)+_0x33b10a+_0x2c3ade(0x1da),()=>_0x797774[_0x2c3ade(0x1d0)]['createProject']({'name':_0x33b10a,'description':_0x4b45cf}),{'verbose':_0x3fd460[_0x2c3ade(0x1e4)]});console[_0x2c3ade(0x1ee)](_0x2c3ade(0x215)+_0x169aea[_0x2c3ade(0x1ff)]['id']);const _0x2fed7b=toLLMProjectInfo(_0x169aea[_0x2c3ade(0x1ff)]);return await handleSDKOutput([_0x2fed7b],_0x3fd460),0x0;}catch(_0x2ed35d){return handleSDKError(_0x2ed35d,_0x3fd460),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a17_0x167337(0x1e9);[a17_0x167337(0x1d1)]=a17_0x167337(0x1ce);async[a17_0x167337(0x1f1)](_0x20dd8c){const _0x3af2f8=a17_0x167337,{options:_0x547598,args:_0x1a553c,tdx:_0x4a48a5}=_0x20dd8c;if(_0x1a553c[_0x3af2f8(0x1e7)]===0x0)return console[_0x3af2f8(0x201)](_0x3af2f8(0x1d7)),console[_0x3af2f8(0x201)](_0x3af2f8(0x219)),0x1;const _0x2e4cbc=_0x1a553c[0x0];try{return await withSpinner(_0x3af2f8(0x1d3)+_0x2e4cbc+'\x27...',()=>_0x4a48a5[_0x3af2f8(0x1d0)]['deleteProject'](_0x2e4cbc),{'verbose':_0x547598[_0x3af2f8(0x1e4)]}),console['log'](_0x3af2f8(0x21f)+_0x2e4cbc),0x0;}catch(_0x89ae01){return handleSDKError(_0x89ae01,_0x547598),0x1;}}}
@@ -1 +1 @@
1
- const a18_0x2de3c9=a18_0x539a;function a18_0x35b9(){const _0x35e082=['3328254KuPSbl','\x20\x20\x20\x20\x22env\x22:\x20{','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22dummy\x22,','Resolving\x20project\x20and\x20agent...','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20see\x20available\x20agents','projects','description','execute','311260WHvNVM','SIGINT','\x20\x20}','\x20\x20\x20\x20}','white','Starting\x20proxy\x20server...','getOrCreateDefaultAgent','dim','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x27\x20not\x20found','\x20\x20Debug:','debug','1IVXWSQ','attributes','329318XgZZzA','Agent\x20\x27','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','llmAgent','\x0aTesting\x20with\x20Agent\x20SDK:','123960HbMTzO','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','NOT_FOUND','server','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','find','5194768prVqRT','stop','\x27\x20not\x20found\x20in\x20project','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','6276850GEypfF','site','yellow','9FhaoGI','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','name','llm','✓\x20Proxy\x20server\x20stopped','SIGTERM','log','green','371RpeFra','exit','\x20is\x20unavailable,\x20using\x20port\x20','cyan','\x20\x20Agent:','11052248DOYFee','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20{','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','Port\x20','\x20\x20Address:','start','http://0.0.0.0:','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','Project\x20\x27','bold','llm:proxy'];a18_0x35b9=function(){return _0x35e082;};return a18_0x35b9();}(function(_0xf292f5,_0x43c57f){const _0x414508=a18_0x539a,_0x1ec6d0=_0xf292f5();while(!![]){try{const _0xc45a9b=-parseInt(_0x414508(0x203))/0x1*(-parseInt(_0x414508(0x205))/0x2)+parseInt(_0x414508(0x1ee))/0x3+-parseInt(_0x414508(0x1ce))/0x4+-parseInt(_0x414508(0x1f7))/0x5+-parseInt(_0x414508(0x1c7))/0x6*(parseInt(_0x414508(0x1dd))/0x7)+parseInt(_0x414508(0x1e2))/0x8*(parseInt(_0x414508(0x1d5))/0x9)+parseInt(_0x414508(0x1d2))/0xa;if(_0xc45a9b===_0x43c57f)break;else _0x1ec6d0['push'](_0x1ec6d0['shift']());}catch(_0x486812){_0x1ec6d0['push'](_0x1ec6d0['shift']());}}}(a18_0x35b9,0xc9fe9));import a18_0xf821a9 from'chalk';function a18_0x539a(_0x1e2500,_0x475cf1){const _0x35b9c1=a18_0x35b9();return a18_0x539a=function(_0x539a19,_0x208f33){_0x539a19=_0x539a19-0x1c7;let _0x246924=_0x35b9c1[_0x539a19];return _0x246924;},a18_0x539a(_0x1e2500,_0x475cf1);}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(_0x35ae7b,_0x5f03d7){const _0x57ea3d=a18_0x539a,{tdx:_0x2d0b7e,options:_0x25c3c0}=_0x35ae7b,_0xa3aaa4=_0x5f03d7||_0x25c3c0['llmProject'];if(_0xa3aaa4){const _0x12b76e=await _0x2d0b7e[_0x57ea3d(0x1d8)][_0x57ea3d(0x1f4)](),_0x2cfc3a=_0x12b76e[_0x57ea3d(0x1cd)](_0x48eb78=>_0x48eb78[_0x57ea3d(0x204)][_0x57ea3d(0x1d7)]===_0xa3aaa4);if(!_0x2cfc3a)throw new SDKError(ErrorCode['NOT_FOUND'],_0x57ea3d(0x1eb)+_0xa3aaa4+_0x57ea3d(0x200),undefined,{'helpText':_0x57ea3d(0x1f2)});return _0x2cfc3a['id'];}const _0x5db001=await _0x2d0b7e[_0x57ea3d(0x1d8)]['getOrCreateDefaultProject']();return _0x5db001['id'];}async function getAgentIdOrDefault(_0x37b99c,_0xbc396,_0x568e9f){const _0x585cfa=a18_0x539a,{tdx:_0x54db51,options:_0x247d16}=_0x37b99c,_0x280712=_0x568e9f||_0x247d16[_0x585cfa(0x208)];if(_0x280712){const _0x1b3031=await _0x54db51[_0x585cfa(0x1d8)]['agents'](_0xbc396),_0x31356d=_0x1b3031[_0x585cfa(0x1cd)](_0x52f807=>_0x52f807[_0x585cfa(0x204)]['name']===_0x280712);if(!_0x31356d)throw new SDKError(ErrorCode[_0x585cfa(0x1ca)],_0x585cfa(0x206)+_0x280712+_0x585cfa(0x1d0),undefined,{'helpText':_0x585cfa(0x1f3)});return _0x31356d['id'];}const _0x3624d0=await _0x54db51[_0x585cfa(0x1d8)][_0x585cfa(0x1fd)]();return _0x3624d0['id'];}export class LLMProxyCommand extends BaseCommand{[a18_0x2de3c9(0x1d7)]=a18_0x2de3c9(0x1ed);[a18_0x2de3c9(0x1f5)]=a18_0x2de3c9(0x1cc);[a18_0x2de3c9(0x1cb)];async[a18_0x2de3c9(0x1f6)](_0x5beb58){const _0x263fb3=a18_0x2de3c9,{tdx:_0x375ffa,options:_0x921c25}=_0x5beb58;try{const _0x3b47f1=_0x921c25,_0x2b55c1=_0x3b47f1['port']||0xfa0,_0xea6c90=_0x3b47f1['project'],_0x58d7e1=_0x3b47f1['agent'],_0x4dce91=_0x3b47f1[_0x263fb3(0x202)],_0x424d0b=await findAvailablePort(_0x2b55c1);console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1f1)));const _0x23a9cf=await getProjectIdOrDefault(_0x5beb58,_0xea6c90),_0x5a6ae7=await getAgentIdOrDefault(_0x5beb58,_0x23a9cf,_0x58d7e1),_0x3de48a=await _0x375ffa['llm']['projects'](),_0x11ecec=_0x3de48a[_0x263fb3(0x1cd)](_0x165801=>_0x165801['id']===_0x23a9cf),_0x13f96e=await _0x375ffa['llm']['agents'](_0x23a9cf),_0x3ea9f0=_0x13f96e[_0x263fb3(0x1cd)](_0x52e24c=>_0x52e24c['id']===_0x5a6ae7);console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1fc)));_0x424d0b!==_0x2b55c1&&console[_0x263fb3(0x1db)](a18_0xf821a9['yellow'](_0x263fb3(0x1e6)+_0x2b55c1+_0x263fb3(0x1df)+_0x424d0b));this[_0x263fb3(0x1cb)]=new ProxyServer({'port':_0x424d0b,'projectId':_0x23a9cf,'agentId':_0x5a6ae7,'tdx':_0x375ffa,'debug':_0x4dce91}),await this[_0x263fb3(0x1cb)][_0x263fb3(0x1e8)](),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1d4)][_0x263fb3(0x1ec)](_0x263fb3(0x207))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1d4)](_0x263fb3(0x1e5))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1d4)]('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1dc)][_0x263fb3(0x1ec)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1e0)]('Server\x20Configuration:')),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1e7)),a18_0xf821a9['white'](_0x263fb3(0x1e9)+_0x424d0b)),console['log'](a18_0xf821a9[_0x263fb3(0x1fe)]('\x20\x20Project:'),a18_0xf821a9[_0x263fb3(0x1fb)](_0x11ecec?.[_0x263fb3(0x204)][_0x263fb3(0x1d7)]||_0x23a9cf)),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1e1)),a18_0xf821a9['white'](_0x3ea9f0?.[_0x263fb3(0x204)]['name']||_0x5a6ae7)),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)]('\x20\x20Site:'),a18_0xf821a9[_0x263fb3(0x1fb)](_0x921c25[_0x263fb3(0x1d3)]));_0x4dce91&&console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1d4)](_0x263fb3(0x201)),a18_0xf821a9[_0x263fb3(0x1fb)]('enabled\x20(request/response\x20logging\x20to\x20stderr)'));console['log'](a18_0xf821a9[_0x263fb3(0x1e0)]('\x0aClaude\x20Code\x20Configuration:')),console['log'](a18_0xf821a9['dim'](_0x263fb3(0x1c9))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)](_0x263fb3(0x1e4))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)](_0x263fb3(0x1ef))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x424d0b+'\x22,')),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)](_0x263fb3(0x1f0))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)](_0x263fb3(0x1d1))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)](_0x263fb3(0x1fa))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fb)](_0x263fb3(0x1f9))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1e0)](_0x263fb3(0x209))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1c8))),console['log'](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1ea))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1fe)](_0x263fb3(0x1d6))),console[_0x263fb3(0x1db)](a18_0xf821a9[_0x263fb3(0x1d4)](_0x263fb3(0x1e3)));const _0x27ee8d=async()=>{const _0x30bde9=_0x263fb3;console[_0x30bde9(0x1db)](a18_0xf821a9[_0x30bde9(0x1fe)](_0x30bde9(0x1ff))),this[_0x30bde9(0x1cb)]&&await this['server']['stop'](),console['log'](a18_0xf821a9[_0x30bde9(0x1dc)](_0x30bde9(0x1d9))),process[_0x30bde9(0x1de)](0x0);};return process['on'](_0x263fb3(0x1f8),_0x27ee8d),process['on'](_0x263fb3(0x1da),_0x27ee8d),await new Promise(()=>{}),0x0;}catch(_0x3f33b1){this['server']&&await this[_0x263fb3(0x1cb)][_0x263fb3(0x1cf)]();throw _0x3f33b1;}}}
1
+ const a18_0x36b577=a18_0x4646;(function(_0x3edbdb,_0x3f6598){const _0x384018=a18_0x4646,_0x1d9694=_0x3edbdb();while(!![]){try{const _0x39a572=parseInt(_0x384018(0xad))/0x1*(-parseInt(_0x384018(0x9f))/0x2)+-parseInt(_0x384018(0xaf))/0x3+-parseInt(_0x384018(0x81))/0x4*(-parseInt(_0x384018(0x9a))/0x5)+parseInt(_0x384018(0x7e))/0x6+parseInt(_0x384018(0x97))/0x7+parseInt(_0x384018(0x89))/0x8*(-parseInt(_0x384018(0xac))/0x9)+parseInt(_0x384018(0xb7))/0xa;if(_0x39a572===_0x3f6598)break;else _0x1d9694['push'](_0x1d9694['shift']());}catch(_0x18bb74){_0x1d9694['push'](_0x1d9694['shift']());}}}(a18_0x4d35,0xa48a5));function a18_0x4d35(){const _0x99f4fc=['NOT_FOUND','name','getOrCreateDefaultProject','SIGTERM','port','enabled\x20(request/response\x20logging\x20to\x20stderr)','server','exit','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','description','2443175vpUvTh','projects','llm:proxy','5yZvefQ','green','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','llmProject','stop','2506gadyZt','find','log','\x27\x20not\x20found','\x20\x20}','site','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','attributes','llmAgent','agents','\x20\x20Project:','\x20\x20Debug:','2453256xwnjxV','766qnYvyk','Server\x20Configuration:','1910172qmqliw','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20see\x20available\x20agents','white','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','execute','\x20\x20Address:','agent','bold','17066000nxpywA','yellow','SIGINT','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x0aTesting\x20with\x20Agent\x20SDK:','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','start','2870982DVhbmS','cyan','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','35764jKSNxB','\x0aClaude\x20Code\x20Configuration:','llm','\x27\x20not\x20found\x20in\x20project','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','\x20\x20Site:','Resolving\x20project\x20and\x20agent...','dim','8MrIrUZ','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','\x20\x20\x20\x20}','\x20is\x20unavailable,\x20using\x20port\x20'];a18_0x4d35=function(){return _0x99f4fc;};return a18_0x4d35();}import a18_0x52e654 from'chalk';import{BaseCommand}from'./command.js';function a18_0x4646(_0x2e9af5,_0x263bd8){const _0x4d3508=a18_0x4d35();return a18_0x4646=function(_0x4646a2,_0x46d2d7){_0x4646a2=_0x4646a2-0x78;let _0xbe0100=_0x4d3508[_0x4646a2];return _0xbe0100;},a18_0x4646(_0x2e9af5,_0x263bd8);}import{ProxyServer}from'../proxy/server.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x52954c,_0x41da33){const _0x3352eb=a18_0x4646,{tdx:_0x5176b5,options:_0x4254ec}=_0x52954c,_0x514dc2=_0x41da33||_0x4254ec[_0x3352eb(0x9d)];if(_0x514dc2){const _0x3a90e0=await _0x5176b5[_0x3352eb(0x83)][_0x3352eb(0x98)](),_0x591a3f=_0x3a90e0[_0x3352eb(0xa0)](_0x118ce8=>_0x118ce8['attributes'][_0x3352eb(0x8e)]===_0x514dc2);if(!_0x591a3f)throw new SDKError(ErrorCode[_0x3352eb(0x8d)],'Project\x20\x27'+_0x514dc2+_0x3352eb(0xa2),undefined,{'helpText':_0x3352eb(0x9c)});return _0x591a3f['id'];}const _0x1e6f65=await _0x5176b5[_0x3352eb(0x83)][_0x3352eb(0x8f)]();return _0x1e6f65['id'];}async function getAgentIdOrDefault(_0x4ed590,_0x4e25af,_0x498da3){const _0x55d89a=a18_0x4646,{tdx:_0x2b1201,options:_0x3f9f35}=_0x4ed590,_0x3c72de=_0x498da3||_0x3f9f35[_0x55d89a(0xa8)];if(_0x3c72de){const _0x1bc6e0=await _0x2b1201[_0x55d89a(0x83)][_0x55d89a(0xa9)](_0x4e25af),_0x13eb87=_0x1bc6e0[_0x55d89a(0xa0)](_0x3ef2cc=>_0x3ef2cc[_0x55d89a(0xa7)][_0x55d89a(0x8e)]===_0x3c72de);if(!_0x13eb87)throw new SDKError(ErrorCode[_0x55d89a(0x8d)],'Agent\x20\x27'+_0x3c72de+_0x55d89a(0x84),undefined,{'helpText':_0x55d89a(0xb0)});return _0x13eb87['id'];}const _0x509eda=await _0x2b1201['llm']['getOrCreateDefaultAgent']();return _0x509eda['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a18_0x36b577(0x99);[a18_0x36b577(0x96)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';['server'];async[a18_0x36b577(0xb3)](_0x5f4c93){const _0x5f1dc0=a18_0x36b577,{tdx:_0x82f3f1,options:_0x24a97a}=_0x5f4c93;try{const _0x299b87=_0x24a97a,_0x4b5922=_0x299b87[_0x5f1dc0(0x91)]||0xfa0,_0x3861ab=_0x299b87['project'],_0x5b4f63=_0x299b87[_0x5f1dc0(0xb5)],_0x3a75d4=_0x299b87['debug'],_0x56beef=await findAvailablePort(_0x4b5922);console['log'](a18_0x52e654[_0x5f1dc0(0x88)](_0x5f1dc0(0x87)));const _0x4b0318=await getProjectIdOrDefault(_0x5f4c93,_0x3861ab),_0x5e8b9c=await getAgentIdOrDefault(_0x5f4c93,_0x4b0318,_0x5b4f63),_0x42b349=await _0x82f3f1[_0x5f1dc0(0x83)][_0x5f1dc0(0x98)](),_0x2c8503=_0x42b349[_0x5f1dc0(0xa0)](_0x4817e9=>_0x4817e9['id']===_0x4b0318),_0x136a1e=await _0x82f3f1[_0x5f1dc0(0x83)][_0x5f1dc0(0xa9)](_0x4b0318),_0x2302eb=_0x136a1e[_0x5f1dc0(0xa0)](_0x16c33d=>_0x16c33d['id']===_0x5e8b9c);console[_0x5f1dc0(0xa1)](a18_0x52e654['dim']('Starting\x20proxy\x20server...'));_0x56beef!==_0x4b5922&&console[_0x5f1dc0(0xa1)](a18_0x52e654['yellow']('Port\x20'+_0x4b5922+_0x5f1dc0(0x8c)+_0x56beef));this['server']=new ProxyServer({'port':_0x56beef,'projectId':_0x4b0318,'agentId':_0x5e8b9c,'tdx':_0x82f3f1,'debug':_0x3a75d4}),await this['server'][_0x5f1dc0(0x7d)](),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x78)][_0x5f1dc0(0xb6)](_0x5f1dc0(0xb2))),console['log'](a18_0x52e654[_0x5f1dc0(0x78)](_0x5f1dc0(0xa5))),console['log'](a18_0x52e654[_0x5f1dc0(0x78)](_0x5f1dc0(0x80))),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x9b)][_0x5f1dc0(0xb6)](_0x5f1dc0(0x7a))),console[_0x5f1dc0(0xa1)](a18_0x52e654['cyan'](_0x5f1dc0(0xae))),console['log'](a18_0x52e654[_0x5f1dc0(0x88)](_0x5f1dc0(0xb4)),a18_0x52e654[_0x5f1dc0(0xb1)]('http://0.0.0.0:'+_0x56beef)),console['log'](a18_0x52e654['dim'](_0x5f1dc0(0xaa)),a18_0x52e654[_0x5f1dc0(0xb1)](_0x2c8503?.[_0x5f1dc0(0xa7)][_0x5f1dc0(0x8e)]||_0x4b0318)),console['log'](a18_0x52e654[_0x5f1dc0(0x88)]('\x20\x20Agent:'),a18_0x52e654['white'](_0x2302eb?.[_0x5f1dc0(0xa7)][_0x5f1dc0(0x8e)]||_0x5e8b9c)),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x88)](_0x5f1dc0(0x86)),a18_0x52e654[_0x5f1dc0(0xb1)](_0x24a97a[_0x5f1dc0(0xa4)]));_0x3a75d4&&console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x78)](_0x5f1dc0(0xab)),a18_0x52e654[_0x5f1dc0(0xb1)](_0x5f1dc0(0x92)));console[_0x5f1dc0(0xa1)](a18_0x52e654['cyan'](_0x5f1dc0(0x82))),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x88)](_0x5f1dc0(0xa6))),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0xb1)]('\x20\x20{')),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0xb1)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0xb1)](_0x5f1dc0(0x8a)+_0x56beef+'\x22,')),console[_0x5f1dc0(0xa1)](a18_0x52e654['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22dummy\x22,')),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0xb1)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console['log'](a18_0x52e654[_0x5f1dc0(0xb1)](_0x5f1dc0(0x8b))),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0xb1)](_0x5f1dc0(0xa3))),console['log'](a18_0x52e654[_0x5f1dc0(0x7f)](_0x5f1dc0(0x7b))),console[_0x5f1dc0(0xa1)](a18_0x52e654['dim'](_0x5f1dc0(0x7c))),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x88)](_0x5f1dc0(0x85))),console[_0x5f1dc0(0xa1)](a18_0x52e654[_0x5f1dc0(0x88)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console['log'](a18_0x52e654[_0x5f1dc0(0x78)](_0x5f1dc0(0x95)));const _0x352002=async()=>{const _0x47ea6a=_0x5f1dc0;console[_0x47ea6a(0xa1)](a18_0x52e654[_0x47ea6a(0x88)]('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x47ea6a(0x93)]&&await this[_0x47ea6a(0x93)][_0x47ea6a(0x9e)](),console[_0x47ea6a(0xa1)](a18_0x52e654[_0x47ea6a(0x9b)]('✓\x20Proxy\x20server\x20stopped')),process[_0x47ea6a(0x94)](0x0);};return process['on'](_0x5f1dc0(0x79),_0x352002),process['on'](_0x5f1dc0(0x90),_0x352002),await new Promise(()=>{}),0x0;}catch(_0x124934){this['server']&&await this[_0x5f1dc0(0x93)][_0x5f1dc0(0x9e)]();throw _0x124934;}}}
@@ -1 +1 @@
1
- const a19_0x9aefbf=a19_0x1c3a;(function(_0x37045b,_0x1c9c8a){const _0x236c57=a19_0x1c3a,_0x85b7c2=_0x37045b();while(!![]){try{const _0x47bd12=parseInt(_0x236c57(0x1c2))/0x1+parseInt(_0x236c57(0x1d2))/0x2+-parseInt(_0x236c57(0x1c3))/0x3+parseInt(_0x236c57(0x1d5))/0x4+-parseInt(_0x236c57(0x1bf))/0x5*(parseInt(_0x236c57(0x1c9))/0x6)+parseInt(_0x236c57(0x1d0))/0x7+parseInt(_0x236c57(0x1c6))/0x8*(parseInt(_0x236c57(0x1ae))/0x9);if(_0x47bd12===_0x1c9c8a)break;else _0x85b7c2['push'](_0x85b7c2['shift']());}catch(_0x1503e9){_0x85b7c2['push'](_0x85b7c2['shift']());}}}(a19_0x338e,0x45315));function a19_0x338e(){const _0x545d6a=['getParentFull','execute','42ZGztew','✔\x20Updated\x20parent\x20segment\x20\x27','Update\x20existing\x20parent\x20segment\x20(audience)','segment','Error:\x20--database\x20and\x20--table\x20are\x20required','table','Error:\x20Parent\x20segment\x20name\x20is\x20required','517223eKDYKx','name','555162nENDfq','Name:\x20','Updating\x20parent\x20segment\x20\x27','717656tHORVA','attributesFile','Site:\x20','\x27\x20with\x20ID:\x20','\x27...','verbose','Database:\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','master','segment:parent:create','behaviors','customerGroupFile','3627dzIdfu','Fetching\x20current\x20configuration\x20for\x20\x27','behaviorsFile','addBehaviorsFile','updateParent','customerGroup','attributes','length','database','Create\x20new\x20parent\x20segment\x20(audience)','addAttributes','scheduleOption','segment:parent:update','error','timezone','data','Table:\x20','280555nzjmQW','site','scheduleType','116367BgwwPY','1594902WEasEy','Creating\x20parent\x20segment\x20\x27','description','11128xeJtRl'];a19_0x338e=function(){return _0x545d6a;};return a19_0x338e();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a19_0x1c3a(_0xf2b04,_0x4166a2){const _0x338eb7=a19_0x338e();return a19_0x1c3a=function(_0x1c3ab4,_0x14498a){_0x1c3ab4=_0x1c3ab4-0x1a3;let _0x89f201=_0x338eb7[_0x1c3ab4];return _0x89f201;},a19_0x1c3a(_0xf2b04,_0x4166a2);}import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x9aefbf(0x1d1)]=a19_0x9aefbf(0x1ab);[a19_0x9aefbf(0x1c5)]=a19_0x9aefbf(0x1b7);async[a19_0x9aefbf(0x1c8)](_0x8ecda0){const _0x167f7d=a19_0x9aefbf,{options:_0x10d15c,args:_0x120033,tdx:_0x33acab}=_0x8ecda0,_0x250740=_0x10d15c;if(_0x120033[_0x167f7d(0x1b5)]===0x0)return console[_0x167f7d(0x1bb)](_0x167f7d(0x1cf)),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x4ba87b=_0x120033[0x0];if(!_0x250740[_0x167f7d(0x1b6)]||!_0x250740[_0x167f7d(0x1ce)])return console[_0x167f7d(0x1bb)](_0x167f7d(0x1cd)),console[_0x167f7d(0x1bb)](_0x167f7d(0x1a9)),0x1;_0x250740['verbose']&&(console[_0x167f7d(0x1bb)](_0x167f7d(0x1a4)+_0x250740['site']),console[_0x167f7d(0x1bb)](_0x167f7d(0x1d3)+_0x4ba87b),console[_0x167f7d(0x1bb)](_0x167f7d(0x1a8)+_0x250740[_0x167f7d(0x1b6)]),console[_0x167f7d(0x1bb)](_0x167f7d(0x1be)+_0x250740[_0x167f7d(0x1ce)]));const _0x21bdf2=await loadJSONFromOptions(_0x250740['attributes'],_0x250740[_0x167f7d(0x1a3)]),_0xfaef52=await loadJSONFromOptions(_0x250740[_0x167f7d(0x1ac)],_0x250740[_0x167f7d(0x1b0)]),_0x2c75b4=await loadJSONFromOptions(_0x250740[_0x167f7d(0x1b3)],_0x250740[_0x167f7d(0x1ad)]),_0x4feb2b={'name':_0x4ba87b,'description':_0x250740[_0x167f7d(0x1c5)],'scheduleType':_0x250740[_0x167f7d(0x1c1)],'scheduleOption':_0x250740['scheduleOption'],'timezone':_0x250740[_0x167f7d(0x1bc)],'master':{'parentDatabaseName':_0x250740[_0x167f7d(0x1b6)],'parentTableName':_0x250740[_0x167f7d(0x1ce)]},'attributes':_0x21bdf2,'behaviors':_0xfaef52,'customerGroup':_0x2c75b4},_0x19aebf=await withSpinner(_0x167f7d(0x1c4)+_0x4ba87b+'\x27...',()=>_0x33acab[_0x167f7d(0x1cc)]['createParent'](_0x4feb2b),{'verbose':_0x10d15c[_0x167f7d(0x1a7)]}),_0x1bdea9=_0x19aebf[_0x167f7d(0x1bd)];return console[_0x167f7d(0x1bb)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x1bdea9['name']+_0x167f7d(0x1a5)+_0x1bdea9['id']),await handleSDKOutput([_0x1bdea9],_0x10d15c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x9aefbf(0x1ba);[a19_0x9aefbf(0x1c5)]=a19_0x9aefbf(0x1cb);async['execute'](_0x55db3b){const _0x1e716e=a19_0x9aefbf,{options:_0x4e62e2,args:_0x290b1f,tdx:_0x1d440}=_0x55db3b,_0x46ed04=_0x4e62e2;if(_0x290b1f[_0x1e716e(0x1b5)]===0x0)return console[_0x1e716e(0x1bb)](_0x1e716e(0x1cf)),console['error']('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x4e345e=_0x290b1f[0x0];_0x46ed04['verbose']&&(console[_0x1e716e(0x1bb)](_0x1e716e(0x1a4)+_0x46ed04[_0x1e716e(0x1c0)]),console['error']('Parent\x20segment:\x20'+_0x4e345e));const _0x439a2d=await withSpinner(_0x1e716e(0x1af)+_0x4e345e+_0x1e716e(0x1a6),()=>_0x1d440['segment'][_0x1e716e(0x1c7)](_0x4e345e),{'verbose':_0x46ed04['verbose']}),_0x2b69d1=_0x439a2d[_0x1e716e(0x1bd)],_0x205953=await loadJSONFromOptions(_0x46ed04[_0x1e716e(0x1b8)],_0x46ed04['addAttributesFile']),_0x3f831b=await loadJSONFromOptions(_0x46ed04['addBehaviors'],_0x46ed04[_0x1e716e(0x1b1)]),_0x30aab5={'name':_0x2b69d1[_0x1e716e(0x1d1)],'description':_0x46ed04[_0x1e716e(0x1c5)]!==undefined?_0x46ed04[_0x1e716e(0x1c5)]:_0x2b69d1[_0x1e716e(0x1c5)],'scheduleType':_0x46ed04[_0x1e716e(0x1c1)]!==undefined?_0x46ed04[_0x1e716e(0x1c1)]:_0x2b69d1[_0x1e716e(0x1c1)],'scheduleOption':_0x46ed04[_0x1e716e(0x1b9)]!==undefined?_0x46ed04[_0x1e716e(0x1b9)]:_0x2b69d1['scheduleOption'],'timezone':_0x46ed04[_0x1e716e(0x1bc)]!==undefined?_0x46ed04[_0x1e716e(0x1bc)]:_0x2b69d1[_0x1e716e(0x1bc)],'master':_0x2b69d1[_0x1e716e(0x1aa)],'attributes':_0x205953?[..._0x2b69d1[_0x1e716e(0x1b4)]||[],..._0x205953]:_0x2b69d1[_0x1e716e(0x1b4)],'behaviors':_0x3f831b?[..._0x2b69d1[_0x1e716e(0x1ac)]||[],..._0x3f831b]:_0x2b69d1[_0x1e716e(0x1ac)],'customerGroup':_0x2b69d1[_0x1e716e(0x1b3)]},_0x17c826=await withSpinner(_0x1e716e(0x1d4)+_0x4e345e+'\x27...',()=>_0x1d440[_0x1e716e(0x1cc)][_0x1e716e(0x1b2)](_0x4e345e,_0x30aab5),{'verbose':_0x46ed04[_0x1e716e(0x1a7)]}),_0x5677d0=_0x17c826['data'];return console[_0x1e716e(0x1bb)](_0x1e716e(0x1ca)+_0x5677d0[_0x1e716e(0x1d1)]+'\x27'),await handleSDKOutput([_0x5677d0],_0x46ed04),0x0;}}
1
+ function a19_0x2db5(){const _0x31feba=['Create\x20new\x20parent\x20segment\x20(audience)','master','Error:\x20--database\x20and\x20--table\x20are\x20required','name','data','47814MLQsbF','Updating\x20parent\x20segment\x20\x27','1181448vUCALr','description','addAttributesFile','verbose','1930012SGLlHk','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','segment:parent:create','database','updateParent','Table:\x20','timezone','execute','✔\x20Updated\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Fetching\x20current\x20configuration\x20for\x20\x27','behaviorsFile','error','customerGroup','segment:parent:update','Name:\x20','table','30LavVbM','285518cwgdsc','scheduleType','392279eoBwbP','getParentFull','scheduleOption','Database:\x20','length','\x27...','250MKSLvF','Site:\x20','1642908DWBDUa','createParent','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','customerGroupFile','site','Parent\x20segment:\x20','attributes','behaviors','Creating\x20parent\x20segment\x20\x27','6lmXcFX','1661841pRwHUZ','addBehaviorsFile','segment'];a19_0x2db5=function(){return _0x31feba;};return a19_0x2db5();}const a19_0x373309=a19_0x12ff;function a19_0x12ff(_0xa90cbb,_0x2c5851){const _0x2db57a=a19_0x2db5();return a19_0x12ff=function(_0x12ff92,_0x42d822){_0x12ff92=_0x12ff92-0x8f;let _0x5352bc=_0x2db57a[_0x12ff92];return _0x5352bc;},a19_0x12ff(_0xa90cbb,_0x2c5851);}(function(_0x154136,_0x1e0a2c){const _0xbdf72e=a19_0x12ff,_0x1b7113=_0x154136();while(!![]){try{const _0x22f582=parseInt(_0xbdf72e(0xb6))/0x1+parseInt(_0xbdf72e(0xb4))/0x2*(parseInt(_0xbdf72e(0x92))/0x3)+parseInt(_0xbdf72e(0xbe))/0x4+-parseInt(_0xbdf72e(0xbc))/0x5*(parseInt(_0xbdf72e(0x9b))/0x6)+parseInt(_0xbdf72e(0xa1))/0x7+-parseInt(_0xbdf72e(0x9d))/0x8+-parseInt(_0xbdf72e(0x93))/0x9*(parseInt(_0xbdf72e(0xb3))/0xa);if(_0x22f582===_0x1e0a2c)break;else _0x1b7113['push'](_0x1b7113['shift']());}catch(_0x5506ba){_0x1b7113['push'](_0x1b7113['shift']());}}}(a19_0x2db5,0x407e2));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_0x373309(0x99)]=a19_0x373309(0xa4);['description']=a19_0x373309(0x96);async[a19_0x373309(0xa9)](_0x276268){const _0x2df721=a19_0x373309,{options:_0x43f725,args:_0x1c92b0,tdx:_0x3c11a0}=_0x276268,_0x5eac1d=_0x43f725;if(_0x1c92b0[_0x2df721(0xba)]===0x0)return console[_0x2df721(0xae)](_0x2df721(0xa2)),console[_0x2df721(0xae)](_0x2df721(0xab)),0x1;const _0x55be77=_0x1c92b0[0x0];if(!_0x5eac1d[_0x2df721(0xa5)]||!_0x5eac1d[_0x2df721(0xb2)])return console[_0x2df721(0xae)](_0x2df721(0x98)),console['error'](_0x2df721(0xab)),0x1;_0x5eac1d[_0x2df721(0xa0)]&&(console[_0x2df721(0xae)](_0x2df721(0xbd)+_0x5eac1d[_0x2df721(0xc2)]),console['error'](_0x2df721(0xb1)+_0x55be77),console[_0x2df721(0xae)](_0x2df721(0xb9)+_0x5eac1d[_0x2df721(0xa5)]),console['error'](_0x2df721(0xa7)+_0x5eac1d[_0x2df721(0xb2)]));const _0x2348db=await loadJSONFromOptions(_0x5eac1d['attributes'],_0x5eac1d['attributesFile']),_0x978714=await loadJSONFromOptions(_0x5eac1d[_0x2df721(0x90)],_0x5eac1d[_0x2df721(0xad)]),_0x5129b8=await loadJSONFromOptions(_0x5eac1d['customerGroup'],_0x5eac1d[_0x2df721(0xc1)]),_0x2662a6={'name':_0x55be77,'description':_0x5eac1d[_0x2df721(0x9e)],'scheduleType':_0x5eac1d['scheduleType'],'scheduleOption':_0x5eac1d[_0x2df721(0xb8)],'timezone':_0x5eac1d[_0x2df721(0xa8)],'master':{'parentDatabaseName':_0x5eac1d['database'],'parentTableName':_0x5eac1d[_0x2df721(0xb2)]},'attributes':_0x2348db,'behaviors':_0x978714,'customerGroup':_0x5129b8},_0x50142a=await withSpinner(_0x2df721(0x91)+_0x55be77+_0x2df721(0xbb),()=>_0x3c11a0['segment'][_0x2df721(0xbf)](_0x2662a6),{'verbose':_0x43f725[_0x2df721(0xa0)]}),_0x32403e=_0x50142a[_0x2df721(0x9a)];return console[_0x2df721(0xae)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x32403e[_0x2df721(0x99)]+_0x2df721(0xa3)+_0x32403e['id']),await handleSDKOutput([_0x32403e],_0x43f725),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x373309(0x99)]=a19_0x373309(0xb0);[a19_0x373309(0x9e)]='Update\x20existing\x20parent\x20segment\x20(audience)';async[a19_0x373309(0xa9)](_0xb74e97){const _0xfd3b80=a19_0x373309,{options:_0x7434e0,args:_0x6461a1,tdx:_0x1c87de}=_0xb74e97,_0x396975=_0x7434e0;if(_0x6461a1[_0xfd3b80(0xba)]===0x0)return console['error'](_0xfd3b80(0xa2)),console['error'](_0xfd3b80(0xc0)),0x1;const _0x20a4be=_0x6461a1[0x0];_0x396975[_0xfd3b80(0xa0)]&&(console['error'](_0xfd3b80(0xbd)+_0x396975[_0xfd3b80(0xc2)]),console[_0xfd3b80(0xae)](_0xfd3b80(0xc3)+_0x20a4be));const _0x43ccac=await withSpinner(_0xfd3b80(0xac)+_0x20a4be+_0xfd3b80(0xbb),()=>_0x1c87de[_0xfd3b80(0x95)][_0xfd3b80(0xb7)](_0x20a4be),{'verbose':_0x396975['verbose']}),_0x2ca865=_0x43ccac[_0xfd3b80(0x9a)],_0x4c3561=await loadJSONFromOptions(_0x396975['addAttributes'],_0x396975[_0xfd3b80(0x9f)]),_0x427d6a=await loadJSONFromOptions(_0x396975['addBehaviors'],_0x396975[_0xfd3b80(0x94)]),_0x4899e2={'name':_0x2ca865[_0xfd3b80(0x99)],'description':_0x396975[_0xfd3b80(0x9e)]!==undefined?_0x396975[_0xfd3b80(0x9e)]:_0x2ca865[_0xfd3b80(0x9e)],'scheduleType':_0x396975[_0xfd3b80(0xb5)]!==undefined?_0x396975[_0xfd3b80(0xb5)]:_0x2ca865[_0xfd3b80(0xb5)],'scheduleOption':_0x396975[_0xfd3b80(0xb8)]!==undefined?_0x396975['scheduleOption']:_0x2ca865['scheduleOption'],'timezone':_0x396975[_0xfd3b80(0xa8)]!==undefined?_0x396975[_0xfd3b80(0xa8)]:_0x2ca865['timezone'],'master':_0x2ca865[_0xfd3b80(0x97)],'attributes':_0x4c3561?[..._0x2ca865[_0xfd3b80(0x8f)]||[],..._0x4c3561]:_0x2ca865[_0xfd3b80(0x8f)],'behaviors':_0x427d6a?[..._0x2ca865['behaviors']||[],..._0x427d6a]:_0x2ca865[_0xfd3b80(0x90)],'customerGroup':_0x2ca865[_0xfd3b80(0xaf)]},_0x13ff54=await withSpinner(_0xfd3b80(0x9c)+_0x20a4be+_0xfd3b80(0xbb),()=>_0x1c87de[_0xfd3b80(0x95)][_0xfd3b80(0xa6)](_0x20a4be,_0x4899e2),{'verbose':_0x396975[_0xfd3b80(0xa0)]}),_0x31186d=_0x13ff54[_0xfd3b80(0x9a)];return console[_0xfd3b80(0xae)](_0xfd3b80(0xaa)+_0x31186d[_0xfd3b80(0x99)]+'\x27'),await handleSDKOutput([_0x31186d],_0x396975),0x0;}}
@@ -1 +1 @@
1
- const a20_0x248cc7=a20_0x4d1c;(function(_0x438331,_0x152a91){const _0x2f7e66=a20_0x4d1c,_0x1739cd=_0x438331();while(!![]){try{const _0x2685ae=parseInt(_0x2f7e66(0xfb))/0x1+-parseInt(_0x2f7e66(0xfc))/0x2*(parseInt(_0x2f7e66(0x100))/0x3)+-parseInt(_0x2f7e66(0xee))/0x4*(parseInt(_0x2f7e66(0xef))/0x5)+-parseInt(_0x2f7e66(0xf2))/0x6*(parseInt(_0x2f7e66(0xf8))/0x7)+parseInt(_0x2f7e66(0xf1))/0x8*(-parseInt(_0x2f7e66(0xf7))/0x9)+parseInt(_0x2f7e66(0x105))/0xa+parseInt(_0x2f7e66(0xf5))/0xb;if(_0x2685ae===_0x152a91)break;else _0x1739cd['push'](_0x1739cd['shift']());}catch(_0x15da13){_0x1739cd['push'](_0x1739cd['shift']());}}}(a20_0x357d,0x52086));function a20_0x4d1c(_0x12a555,_0x443f39){const _0x357daa=a20_0x357d();return a20_0x4d1c=function(_0x4d1c5f,_0x29e419){_0x4d1c5f=_0x4d1c5f-0xed;let _0x48009c=_0x357daa[_0x4d1c5f];return _0x48009c;},a20_0x4d1c(_0x12a555,_0x443f39);}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a20_0x357d(){const _0x57bb15=['15550yKsois','length','8AIuzFy','105702NpyPmz','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','error','10304448XhXAfn','execute','5043483TPAalM','140DjhiyJ','config','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','288001bgZCWy','394VfguCH','\x20\x20Global:\x20~/.config/tdx/tdx.json','Error:\x20','name','6327ttBxPz','log','message','profiles','map','4612070tjLmiB','description','28TYCFHS'];a20_0x357d=function(){return _0x57bb15;};return a20_0x357d();}export class ProfilesCommand extends BaseCommand{[a20_0x248cc7(0xff)]=a20_0x248cc7(0x103);['description']='List\x20all\x20available\x20profiles';async[a20_0x248cc7(0xf6)](_0xe3ad91){const _0x14abb0=a20_0x248cc7,{options:_0x116124}=_0xe3ad91;try{const _0xf2a981=listProfiles(),_0x5e5648=getActiveProfile();if(_0xf2a981[_0x14abb0(0xf0)]===0x0)return console[_0x14abb0(0x101)](_0x14abb0(0xf3)),console['log'](_0x14abb0(0xfa)),console[_0x14abb0(0x101)](_0x14abb0(0xfd)),0x0;const _0x1c0b5a=_0xf2a981[_0x14abb0(0x104)](_0x33944f=>{const _0x2a8e7d=_0x14abb0,_0x3725eb=_0x33944f[_0x2a8e7d(0xff)]===_0x5e5648,_0x5aebc0=getProfileParams(_0x33944f['config']);return{'name':_0x33944f['name'],'active':_0x3725eb,'scope':_0x33944f['scope'],'description':_0x33944f[_0x2a8e7d(0xf9)][_0x2a8e7d(0xed)]||'','params':_0x5aebc0};});return await handleSDKOutput(_0x1c0b5a,_0x116124),0x0;}catch(_0x5861d3){return _0x5861d3 instanceof Error&&console[_0x14abb0(0xf4)](_0x14abb0(0xfe)+_0x5861d3[_0x14abb0(0x102)]),0x1;}}}
1
+ const a20_0x15be58=a20_0x1219;(function(_0xae78ae,_0x52e019){const _0x4c8a23=a20_0x1219,_0x4d0338=_0xae78ae();while(!![]){try{const _0x5d6753=parseInt(_0x4c8a23(0x10a))/0x1+-parseInt(_0x4c8a23(0x104))/0x2+-parseInt(_0x4c8a23(0x116))/0x3+-parseInt(_0x4c8a23(0x103))/0x4*(parseInt(_0x4c8a23(0x110))/0x5)+parseInt(_0x4c8a23(0x10f))/0x6*(parseInt(_0x4c8a23(0x114))/0x7)+parseInt(_0x4c8a23(0x107))/0x8+parseInt(_0x4c8a23(0x109))/0x9*(parseInt(_0x4c8a23(0x115))/0xa);if(_0x5d6753===_0x52e019)break;else _0x4d0338['push'](_0x4d0338['shift']());}catch(_0x577020){_0x4d0338['push'](_0x4d0338['shift']());}}}(a20_0x2c36,0xc054d));import{BaseCommand}from'./command.js';function a20_0x1219(_0x3e4dd2,_0x49c6dd){const _0x2c3638=a20_0x2c36();return a20_0x1219=function(_0x1219e5,_0x2d8a32){_0x1219e5=_0x1219e5-0x102;let _0x5d970d=_0x2c3638[_0x1219e5];return _0x5d970d;},a20_0x1219(_0x3e4dd2,_0x49c6dd);}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a20_0x2c36(){const _0x440b45=['\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','608YEWwlQ','1291798xLppcU','profiles','description','10542192kFyFYc','config','135Xfnjrx','90561dDeCpk','name','map','error','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','204voptxq','42425LSNemj','scope','Error:\x20','List\x20all\x20available\x20profiles','131908rJWuJH','1340980fXSTFW','4011279QhStEe','log'];a20_0x2c36=function(){return _0x440b45;};return a20_0x2c36();}export class ProfilesCommand extends BaseCommand{[a20_0x15be58(0x10b)]=a20_0x15be58(0x105);[a20_0x15be58(0x106)]=a20_0x15be58(0x113);async['execute'](_0x3ef27b){const _0x433821=a20_0x15be58,{options:_0xbec055}=_0x3ef27b;try{const _0x2beaad=listProfiles(),_0xdb3b7f=getActiveProfile();if(_0x2beaad['length']===0x0)return console[_0x433821(0x117)](_0x433821(0x10e)),console[_0x433821(0x117)](_0x433821(0x102)),console['log']('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x152020=_0x2beaad[_0x433821(0x10c)](_0x52ec22=>{const _0x34dd45=_0x433821,_0x5722f0=_0x52ec22[_0x34dd45(0x10b)]===_0xdb3b7f,_0x4ed216=getProfileParams(_0x52ec22[_0x34dd45(0x108)]);return{'name':_0x52ec22[_0x34dd45(0x10b)],'active':_0x5722f0,'scope':_0x52ec22[_0x34dd45(0x111)],'description':_0x52ec22[_0x34dd45(0x108)][_0x34dd45(0x106)]||'','params':_0x4ed216};});return await handleSDKOutput(_0x152020,_0xbec055),0x0;}catch(_0x480b8a){return _0x480b8a instanceof Error&&console[_0x433821(0x10d)](_0x433821(0x112)+_0x480b8a['message']),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x57b9c9=a21_0x3995;(function(_0x58fbc2,_0x426f1c){const _0x14c33d=a21_0x3995,_0x2f86ca=_0x58fbc2();while(!![]){try{const _0x59a465=-parseInt(_0x14c33d(0x100))/0x1+parseInt(_0x14c33d(0xee))/0x2*(-parseInt(_0x14c33d(0x113))/0x3)+parseInt(_0x14c33d(0x111))/0x4*(parseInt(_0x14c33d(0x11c))/0x5)+parseInt(_0x14c33d(0xf5))/0x6+parseInt(_0x14c33d(0xfd))/0x7+-parseInt(_0x14c33d(0x10d))/0x8+parseInt(_0x14c33d(0xf1))/0x9*(parseInt(_0x14c33d(0x117))/0xa);if(_0x59a465===_0x426f1c)break;else _0x2f86ca['push'](_0x2f86ca['shift']());}catch(_0x15b2c7){_0x2f86ca['push'](_0x2f86ca['shift']());}}}(a21_0x2cfd,0x81063));import{BaseCommand}from'./command.js';function a21_0x2cfd(){const _0x41a8b2=['Statement\x20','stats','...','1111768aWEKwq','Catalog:\x20','69OWrCWu','message','Executing\x20query...','execute','80pnPcMl','setPhase','state','elapsedTimeMillis','SQL:\x20','5tupxGe','name','Error:\x20','validate','\x20rows\x20','join','13238hWnwfY','Run\x20Trino\x20queries\x20(streaming)','\x20[Job\x20ID:\x20','448353eqBzpn','file','Site:\x20','query','2831778ujWJyz','args','setJobId','error','push','description','Executing\x20statement\x20','totalSplits','6846637dnLqcZ','processedRows','options','579718kgIndv','jobId','in\x20','information_schema','verbose','output','\x20splits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','originalMessage','\x0aAll\x20results\x20saved\x20to\x20','length','site','\x20-\x20','6928752OwSzPJ'];a21_0x2cfd=function(){return _0x41a8b2;};return a21_0x2cfd();}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';function a21_0x3995(_0x307652,_0x136bd3){const _0x2cfdf3=a21_0x2cfd();return a21_0x3995=function(_0x399555,_0x5d4b47){_0x399555=_0x399555-0xed;let _0x5b0106=_0x2cfdf3[_0x399555];return _0x5b0106;},a21_0x3995(_0x307652,_0x136bd3);}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x57b9c9(0x11d)]=a21_0x57b9c9(0xf4);[a21_0x57b9c9(0xfa)]=a21_0x57b9c9(0xef);async[a21_0x57b9c9(0x116)](_0x4784be){const _0x44edde=a21_0x57b9c9,{options:_0xee4074,args:_0x4c6ae9,tdx:_0x44d2b4}=_0x4784be,_0x24d967=_0x4c6ae9[0x0],_0x3dafd2=_0xee4074[_0x44edde(0xf2)];let _0x1a1522;if(_0x3dafd2)try{_0x1a1522=readSqlStatementsFromFile(_0x3dafd2);}catch(_0x3d78c1){return console[_0x44edde(0xf8)]('Error:\x20'+_0x3d78c1[_0x44edde(0x114)]),0x1;}else try{_0x1a1522=splitSqlStatements(_0x24d967);}catch(_0x246723){return console[_0x44edde(0xf8)](_0x44edde(0x11e)+_0x246723[_0x44edde(0x114)]),0x1;}const _0x2f8ce9=_0xee4074['database']||_0x44edde(0x103),_0x413c36=_0xee4074['catalog'];try{const _0x5e0ae9=[],_0x40407f=!!_0xee4074[_0x44edde(0x105)];for(let _0x12b1dc=0x0;_0x12b1dc<_0x1a1522['length'];_0x12b1dc++){const _0x3ef573=_0x1a1522[_0x12b1dc],_0x5bc3b6=_0x12b1dc+0x1,_0x4e933a=_0x1a1522[_0x44edde(0x10a)],_0x19bed6=_0x4e933a>0x1;_0xee4074['verbose']&&(console[_0x44edde(0xf8)]('\x0a'+(_0x19bed6?_0x44edde(0x10e)+_0x5bc3b6+'/'+_0x4e933a+':':'')),console[_0x44edde(0xf8)](_0x44edde(0xf3)+_0xee4074[_0x44edde(0x10b)]),console[_0x44edde(0xf8)](_0x44edde(0x112)+(_0x413c36||'td')),console['error']('Schema:\x20'+_0x2f8ce9),console[_0x44edde(0xf8)](_0x44edde(0x11b)+_0x3ef573));const _0x3273e9=_0x19bed6?_0x44edde(0xfb)+_0x5bc3b6+'/'+_0x4e933a+_0x44edde(0x110):_0x44edde(0x115);try{const _0x1cb74a=await withQuerySpinner(_0x3273e9,async _0x5876a1=>{const _0x2ebe63=await _0x44d2b4['query'](_0x3ef573,{'catalog':_0x413c36,'schema':_0x2f8ce9,'onJobId':_0x4b80c7=>{const _0x1d4b49=a21_0x3995;_0x5876a1[_0x1d4b49(0xf7)](_0x4b80c7);},'onProgress':_0x415523=>{const _0x207697=a21_0x3995;_0x5876a1[_0x207697(0x118)]('Executing\x20query\x20['+_0x415523[_0x207697(0x119)]+']'),_0x5876a1['setExtra'](formatRows(_0x415523[_0x207697(0xfe)])+_0x207697(0x120)+_0x415523['completedSplits']+'/'+_0x415523[_0x207697(0xfc)]+_0x207697(0x106));}});return _0x2ebe63;},{'verbose':_0xee4074[_0x44edde(0x104)]}),_0x50b06b=_0x1cb74a['data'],_0x4fae5c=_0x50b06b[_0x44edde(0x101)]?_0x44edde(0xf0)+_0x50b06b[_0x44edde(0x101)]+']':'',_0x2d0688=_0x19bed6?_0x44edde(0x10e)+_0x5bc3b6+'/'+_0x4e933a+_0x44edde(0x10c):'';console[_0x44edde(0xf8)]('✔\x20'+_0x2d0688+'Query\x20completed:\x20Processed\x20'+formatRows(_0x50b06b[_0x44edde(0x10f)][_0x44edde(0xfe)])+'\x20rows\x20'+(_0x44edde(0x102)+formatElapsed(_0x50b06b[_0x44edde(0x10f)][_0x44edde(0x11a)])+_0x4fae5c));if(_0x19bed6&&_0x40407f){const {formatQueryOutput:_0x2c2660,resolveOutputOptions:_0x39c3bc}=await import('../utils/command-output.js'),_0x3497ef=_0x39c3bc(_0xee4074),_0x2a9305=await _0x2c2660(_0x50b06b,_0x3497ef);_0x5e0ae9[_0x44edde(0xf9)](_0x2a9305);}else await handleQueryOutput(_0x50b06b,_0xee4074);}catch(_0x882c08){const _0x1e1af7=_0x19bed6?_0x44edde(0x10e)+_0x5bc3b6+'/'+_0x4e933a+':\x0a':'',_0x349d4a=_0x882c08 instanceof SDKError?_0x882c08[_0x44edde(0x108)]:_0x882c08[_0x44edde(0x114)];return console['error'](''+_0x1e1af7+_0x349d4a),0x1;}}if(_0x1a1522[_0x44edde(0x10a)]>0x1&&_0x40407f&&_0x5e0ae9['length']>0x0){const _0x5ee70f=_0x5e0ae9[_0x44edde(0xed)]('\x0a');writeFileSync(_0xee4074['output'],_0x5ee70f),console[_0x44edde(0xf8)](_0x44edde(0x109)+_0xee4074[_0x44edde(0x105)]);}return 0x0;}catch(_0x218a18){throw _0x218a18;}}[a21_0x57b9c9(0x11f)](_0x237238){const _0x4b39d1=a21_0x57b9c9,_0x48cfe1=_0x237238[_0x4b39d1(0xf6)][0x0],_0x2f51b9=_0x237238[_0x4b39d1(0xff)][_0x4b39d1(0xf2)];if(!_0x48cfe1&&!_0x2f51b9)return'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';if(_0x48cfe1&&_0x2f51b9)return _0x4b39d1(0x107);return undefined;}}
1
+ const a21_0x522d0c=a21_0x39f0;function a21_0x39f0(_0x459bdd,_0x90ff17){const _0x192f01=a21_0x192f();return a21_0x39f0=function(_0x39f0e6,_0x433dc8){_0x39f0e6=_0x39f0e6-0xed;let _0x3d7141=_0x192f01[_0x39f0e6];return _0x3d7141;},a21_0x39f0(_0x459bdd,_0x90ff17);}(function(_0x2d996c,_0x50fe19){const _0x4ecb85=a21_0x39f0,_0x4e828a=_0x2d996c();while(!![]){try{const _0xc2c3ff=parseInt(_0x4ecb85(0xf8))/0x1+-parseInt(_0x4ecb85(0x119))/0x2+-parseInt(_0x4ecb85(0xfd))/0x3*(parseInt(_0x4ecb85(0xf4))/0x4)+-parseInt(_0x4ecb85(0xed))/0x5+-parseInt(_0x4ecb85(0xf2))/0x6*(parseInt(_0x4ecb85(0x11e))/0x7)+-parseInt(_0x4ecb85(0xee))/0x8+parseInt(_0x4ecb85(0x115))/0x9;if(_0xc2c3ff===_0x50fe19)break;else _0x4e828a['push'](_0x4e828a['shift']());}catch(_0x3f9543){_0x4e828a['push'](_0x4e828a['shift']());}}}(a21_0x192f,0x1a4aa));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_0x522d0c(0xef)]='query';[a21_0x522d0c(0x10d)]=a21_0x522d0c(0x107);async[a21_0x522d0c(0x108)](_0x12cf72){const _0x193cd1=a21_0x522d0c,{options:_0x244cd0,args:_0x184d2d,tdx:_0x2b006c}=_0x12cf72,_0x290949=_0x184d2d[0x0],_0x5a27b2=_0x244cd0['file'];let _0x4a96ad;if(_0x5a27b2)try{_0x4a96ad=readSqlStatementsFromFile(_0x5a27b2);}catch(_0x259c54){return console['error'](_0x193cd1(0xfe)+_0x259c54[_0x193cd1(0x10e)]),0x1;}else try{_0x4a96ad=splitSqlStatements(_0x290949);}catch(_0x3dc441){return console[_0x193cd1(0x118)](_0x193cd1(0xfe)+_0x3dc441['message']),0x1;}const _0x3cd0ca=_0x244cd0['database']||_0x193cd1(0x11b),_0xb22b19=_0x244cd0['catalog'];try{const _0x31d3a0=[],_0x472c55=!!_0x244cd0[_0x193cd1(0x106)];for(let _0x42b0a3=0x0;_0x42b0a3<_0x4a96ad['length'];_0x42b0a3++){const _0x1729bd=_0x4a96ad[_0x42b0a3],_0x407146=_0x42b0a3+0x1,_0x472bbe=_0x4a96ad['length'],_0x2f79c4=_0x472bbe>0x1;_0x244cd0['verbose']&&(console[_0x193cd1(0x118)]('\x0a'+(_0x2f79c4?_0x193cd1(0x103)+_0x407146+'/'+_0x472bbe+':':'')),console[_0x193cd1(0x118)](_0x193cd1(0xf3)+_0x244cd0['site']),console[_0x193cd1(0x118)](_0x193cd1(0x102)+(_0xb22b19||'td')),console['error'](_0x193cd1(0x10c)+_0x3cd0ca),console['error'](_0x193cd1(0x10a)+_0x1729bd));const _0x20f1cc=_0x2f79c4?'Executing\x20statement\x20'+_0x407146+'/'+_0x472bbe+_0x193cd1(0x104):_0x193cd1(0x11f);try{const _0xc8460c=await withQuerySpinner(_0x20f1cc,async _0x4a231a=>{const _0x3793f1=_0x193cd1,_0xd7a84d=await _0x2b006c[_0x3793f1(0xf7)](_0x1729bd,{'catalog':_0xb22b19,'schema':_0x3cd0ca,'onJobId':_0x28553c=>{const _0x410afd=_0x3793f1;_0x4a231a[_0x410afd(0x11c)](_0x28553c);},'onProgress':_0x5345e3=>{const _0x2af887=_0x3793f1;_0x4a231a[_0x2af887(0x101)](_0x2af887(0x113)+_0x5345e3[_0x2af887(0xfc)]+']'),_0x4a231a[_0x2af887(0x114)](formatRows(_0x5345e3[_0x2af887(0xfa)])+_0x2af887(0x110)+_0x5345e3[_0x2af887(0xff)]+'/'+_0x5345e3[_0x2af887(0x10f)]+_0x2af887(0x111));}});return _0xd7a84d;},{'verbose':_0x244cd0[_0x193cd1(0x10b)]}),_0x161d56=_0xc8460c[_0x193cd1(0xf0)],_0x598c96=_0x161d56[_0x193cd1(0x121)]?_0x193cd1(0xf1)+_0x161d56['jobId']+']':'',_0x4e0cb8=_0x2f79c4?'Statement\x20'+_0x407146+'/'+_0x472bbe+_0x193cd1(0xf5):'';console['error']('✔\x20'+_0x4e0cb8+_0x193cd1(0x116)+formatRows(_0x161d56['stats'][_0x193cd1(0xfa)])+_0x193cd1(0x110)+(_0x193cd1(0x105)+formatElapsed(_0x161d56[_0x193cd1(0xfb)]['elapsedTimeMillis'])+_0x598c96));if(_0x2f79c4&&_0x472c55){const {formatQueryOutput:_0x1663f2,resolveOutputOptions:_0x1fbb91}=await import('../utils/command-output.js'),_0x5f0e83=_0x1fbb91(_0x244cd0),_0x1dd390=await _0x1663f2(_0x161d56,_0x5f0e83);_0x31d3a0[_0x193cd1(0x109)](_0x1dd390);}else await handleQueryOutput(_0x161d56,_0x244cd0);}catch(_0x335424){const _0xc43995=_0x2f79c4?_0x193cd1(0x103)+_0x407146+'/'+_0x472bbe+':\x0a':'',_0x4d8b5a=_0x335424 instanceof SDKError?_0x335424[_0x193cd1(0x11d)]:_0x335424['message'];return console[_0x193cd1(0x118)](''+_0xc43995+_0x4d8b5a),0x1;}}if(_0x4a96ad[_0x193cd1(0x100)]>0x1&&_0x472c55&&_0x31d3a0['length']>0x0){const _0x47f1ba=_0x31d3a0[_0x193cd1(0xf6)]('\x0a');writeFileSync(_0x244cd0['output'],_0x47f1ba),console[_0x193cd1(0x118)](_0x193cd1(0x11a)+_0x244cd0[_0x193cd1(0x106)]);}return 0x0;}catch(_0x4bab7f){throw _0x4bab7f;}}[a21_0x522d0c(0x120)](_0x5b274c){const _0x28b6c3=a21_0x522d0c,_0x5c1f5b=_0x5b274c[_0x28b6c3(0xf9)][0x0],_0x3d28c4=_0x5b274c[_0x28b6c3(0x112)]['file'];if(!_0x5c1f5b&&!_0x3d28c4)return'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';if(_0x5c1f5b&&_0x3d28c4)return _0x28b6c3(0x117);return undefined;}}function a21_0x192f(){const _0x42bcb3=['setPhase','Catalog:\x20','Statement\x20','...','in\x20','output','Run\x20Trino\x20queries\x20(streaming)','execute','push','SQL:\x20','verbose','Schema:\x20','description','message','totalSplits','\x20rows\x20','\x20splits','options','Executing\x20query\x20[','setExtra','5395284WsbWtv','Query\x20completed:\x20Processed\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','error','397412lADdUY','\x0aAll\x20results\x20saved\x20to\x20','information_schema','setJobId','originalMessage','1343090qwSPoU','Executing\x20query...','validate','jobId','83330kTQeCI','715744SlnnDo','name','data','\x20[Job\x20ID:\x20','6ObTTgH','Site:\x20','16HiaoGL','\x20-\x20','join','query','117560UomYPU','args','processedRows','stats','state','84477RhRupK','Error:\x20','completedSplits','length'];a21_0x192f=function(){return _0x42bcb3;};return a21_0x192f();}
@@ -1 +1 @@
1
- const a22_0x567610=a22_0x2e85;(function(_0x118e7c,_0x3acafd){const _0x28cb16=a22_0x2e85,_0x58dfe6=_0x118e7c();while(!![]){try{const _0x576002=parseInt(_0x28cb16(0x1be))/0x1*(-parseInt(_0x28cb16(0x1d9))/0x2)+-parseInt(_0x28cb16(0x1f4))/0x3+-parseInt(_0x28cb16(0x1e0))/0x4*(parseInt(_0x28cb16(0x1c4))/0x5)+parseInt(_0x28cb16(0x1f5))/0x6*(-parseInt(_0x28cb16(0x1c3))/0x7)+-parseInt(_0x28cb16(0x214))/0x8+-parseInt(_0x28cb16(0x1b8))/0x9*(-parseInt(_0x28cb16(0x1d6))/0xa)+-parseInt(_0x28cb16(0x1cc))/0xb*(-parseInt(_0x28cb16(0x1c9))/0xc);if(_0x576002===_0x3acafd)break;else _0x58dfe6['push'](_0x58dfe6['shift']());}catch(_0x3505a0){_0x58dfe6['push'](_0x58dfe6['shift']());}}}(a22_0x13c4,0xcdbf4));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_0x567610(0x209)]=a22_0x567610(0x1db);[a22_0x567610(0x1e5)]=a22_0x567610(0x1cf);async[a22_0x567610(0x20f)](_0x43b15d){const _0x7ad628=a22_0x567610,{options:_0x4f8367,args:_0x5d266a,tdx:_0x21c4d6}=_0x43b15d;if(_0x5d266a['length']===0x0)return console[_0x7ad628(0x1c7)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x7ad628(0x1c7)](_0x7ad628(0x212)),console[_0x7ad628(0x1c7)](_0x7ad628(0x1ba)),console[_0x7ad628(0x1c7)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x7ad628(0x1c7)](_0x7ad628(0x202)),console[_0x7ad628(0x1c7)](_0x7ad628(0x1e3)),0x1;try{const _0x56c1d7=_0x5d266a[0x0],_0x2b187c=_0x4f8367['segmentPath'];let _0x457ed4=_0x56c1d7;_0x2b187c&&!_0x56c1d7[_0x7ad628(0x20a)]('/')&&(_0x457ed4=_0x2b187c+'/'+_0x56c1d7,_0x4f8367[_0x7ad628(0x213)]&&console['error'](_0x7ad628(0x1af)+_0x457ed4));const _0x1bc5f0=await withSpinner('Resolving\x20path\x20\x27'+_0x457ed4+_0x7ad628(0x21d),()=>_0x21c4d6[_0x7ad628(0x1f0)]['resolvePathToResource'](_0x457ed4),{'verbose':_0x4f8367['verbose']}),_0x14f95d=_0x1bc5f0['data'];_0x4f8367[_0x7ad628(0x213)]&&(console[_0x7ad628(0x1c7)]('Resolved\x20type:\x20'+_0x14f95d[_0x7ad628(0x1b3)]),console['error'](_0x7ad628(0x1c6)+_0x14f95d['parentId']),_0x14f95d[_0x7ad628(0x1ac)]&&console[_0x7ad628(0x1c7)](_0x7ad628(0x1c8)+_0x14f95d[_0x7ad628(0x1ac)]),_0x14f95d['segmentId']&&console[_0x7ad628(0x1c7)](_0x7ad628(0x1c1)+_0x14f95d[_0x7ad628(0x203)]));if(_0x14f95d[_0x7ad628(0x1b3)]==='parent'){const _0x22f3c7=await withSpinner(_0x7ad628(0x208),()=>_0x21c4d6[_0x7ad628(0x1f0)][_0x7ad628(0x1b1)](_0x14f95d[_0x7ad628(0x210)]),{'verbose':_0x4f8367['verbose']});await handleSDKOutput([_0x22f3c7[_0x7ad628(0x1cd)]],_0x4f8367);}else{if(_0x14f95d[_0x7ad628(0x1b3)]===_0x7ad628(0x1ff)){if(!_0x14f95d[_0x7ad628(0x1ac)])throw new SDKError(ErrorCode['INTERNAL'],_0x7ad628(0x1c5));const _0x519e82=await withSpinner(_0x7ad628(0x205),()=>_0x21c4d6[_0x7ad628(0x1f0)][_0x7ad628(0x1ec)](_0x14f95d[_0x7ad628(0x1ac)]),{'verbose':_0x4f8367[_0x7ad628(0x213)]});await handleSDKOutput([_0x519e82['data']],_0x4f8367);}else{if(_0x14f95d['type']===_0x7ad628(0x1f0)){if(!_0x14f95d[_0x7ad628(0x203)])throw new SDKError(ErrorCode[_0x7ad628(0x20c)],_0x7ad628(0x1f3));const _0x498158=await withSpinner('Fetching\x20segment\x20details...',()=>_0x21c4d6[_0x7ad628(0x1f0)][_0x7ad628(0x1ed)](_0x14f95d[_0x7ad628(0x210)],_0x14f95d[_0x7ad628(0x203)]),{'verbose':_0x4f8367[_0x7ad628(0x213)]});await handleSDKOutput([_0x498158[_0x7ad628(0x1cd)]],_0x4f8367);}}}return 0x0;}catch(_0x504582){if(_0x504582 instanceof SDKError)return console['error']('Error:\x20'+_0x504582[_0x7ad628(0x1d5)]),_0x504582[_0x7ad628(0x1f1)]&&console[_0x7ad628(0x1c7)](_0x7ad628(0x1b2)+_0x504582[_0x7ad628(0x1f1)]),0x1;throw _0x504582;}}}function a22_0x2e85(_0x2ccf5f,_0x1dab90){const _0x13c429=a22_0x13c4();return a22_0x2e85=function(_0x2e858c,_0x452781){_0x2e858c=_0x2e858c-0x1ab;let _0xd918c9=_0x13c429[_0x2e858c];return _0xd918c9;},a22_0x2e85(_0x2ccf5f,_0x1dab90);}export class SegmentShowCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1eb);['description']=a22_0x567610(0x1ee);async[a22_0x567610(0x20f)](_0x493b47){const _0x558cef=a22_0x567610,{options:_0x1cf9f5,args:_0x15c3db,tdx:_0x4d0f68}=_0x493b47;if(_0x15c3db[_0x558cef(0x200)]===0x0)return console[_0x558cef(0x1c7)](_0x558cef(0x1fa)),console[_0x558cef(0x1c7)](_0x558cef(0x215)),console[_0x558cef(0x1c7)]('Examples:'),console[_0x558cef(0x1c7)](_0x558cef(0x20b)),console[_0x558cef(0x1c7)](_0x558cef(0x204)),console[_0x558cef(0x1c7)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x2789f9=_0x15c3db[0x0],_0x463b12=_0x1cf9f5[_0x558cef(0x1d4)];let _0x38f95e=_0x2789f9;_0x463b12&&!_0x2789f9[_0x558cef(0x20a)]('/')&&(_0x38f95e=_0x463b12+'/'+_0x2789f9,_0x1cf9f5[_0x558cef(0x213)]&&console[_0x558cef(0x1c7)](_0x558cef(0x1af)+_0x38f95e));const _0x558a22=await withSpinner(_0x558cef(0x21c)+_0x38f95e+_0x558cef(0x21d),()=>_0x4d0f68[_0x558cef(0x1f0)][_0x558cef(0x1e6)](_0x38f95e),{'verbose':_0x1cf9f5[_0x558cef(0x213)]}),_0x4690be=_0x558a22[_0x558cef(0x1cd)];_0x1cf9f5[_0x558cef(0x213)]&&(console['error'](_0x558cef(0x1bf)+_0x4690be['type']),console['error'](_0x558cef(0x1c6)+_0x4690be['parentId']));if(_0x4690be[_0x558cef(0x1b3)]==='folder')return console[_0x558cef(0x1c7)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x558cef(0x1c7)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x19ec7e;if(_0x4690be['type']===_0x558cef(0x219)){const _0x4adc51=await withSpinner(_0x558cef(0x1b5),()=>_0x4d0f68['segment'][_0x558cef(0x1b6)](_0x4690be[_0x558cef(0x210)]),{'verbose':_0x1cf9f5[_0x558cef(0x213)]});_0x19ec7e=_0x4adc51[_0x558cef(0x1cd)];}else{if(!_0x4690be[_0x558cef(0x203)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3749b1=await withSpinner(_0x558cef(0x1fd),()=>_0x4d0f68['segment'][_0x558cef(0x1ab)](_0x4690be[_0x558cef(0x210)],_0x4690be['segmentId']),{'verbose':_0x1cf9f5[_0x558cef(0x213)]});_0x19ec7e=_0x3749b1['data'];}const _0x189776=_0x1cf9f5[_0x558cef(0x1b7)],_0x5cd37f=/\bLIMIT\s+\d+/i['test'](_0x19ec7e);!_0x5cd37f&&(_0x19ec7e=_0x19ec7e[_0x558cef(0x1ef)]()[_0x558cef(0x211)](/;+$/,''),_0x19ec7e='SELECT\x20*\x20FROM\x20(\x0a'+_0x19ec7e+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x189776);_0x1cf9f5['verbose']&&console['error']('SQL\x20query:\x0a'+_0x19ec7e);const _0x50f3d4=await withQuerySpinner(_0x558cef(0x1dc),async _0x48d37e=>{const _0xabc15c=_0x558cef,_0xd30914=await _0x4d0f68[_0xabc15c(0x1e4)](_0x19ec7e,{'catalog':'td','schema':'information_schema','onJobId':_0x3b4c59=>{const _0x2e4b7e=_0xabc15c;_0x48d37e[_0x2e4b7e(0x1ce)](_0x3b4c59);}});return _0xd30914;},{'verbose':_0x1cf9f5[_0x558cef(0x213)]}),_0x4b4571=_0x50f3d4[_0x558cef(0x1cd)],_0x2e30c8=_0x4b4571[_0x558cef(0x217)]?_0x558cef(0x201)+_0x4b4571[_0x558cef(0x217)]+']':'';return console['error'](_0x558cef(0x1d7)+_0x4b4571[_0x558cef(0x1c0)][_0x558cef(0x1f8)]['toLocaleString']()+'\x20rows\x20'+(_0x558cef(0x1bd)+formatElapsed(_0x4b4571[_0x558cef(0x1c0)][_0x558cef(0x1e1)])+_0x2e30c8)),await handleQueryOutput(_0x4b4571,_0x1cf9f5),0x0;}catch(_0x2aced3){if(_0x2aced3 instanceof SDKError)return console[_0x558cef(0x1c7)]('✖\x20Query\x20failed\x20['+_0x2aced3[_0x558cef(0x20d)]+']'),console[_0x558cef(0x1c7)]('\x0a'+_0x2aced3[_0x558cef(0x1d5)]),0x1;throw _0x2aced3;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a22_0x567610(0x1f6);[a22_0x567610(0x1e5)]=a22_0x567610(0x1ad);async[a22_0x567610(0x20f)](_0x4b33e9){const _0x48200d=a22_0x567610,{options:_0x27cf97,args:_0xa75120,tdx:_0x345d5f}=_0x4b33e9;if(_0xa75120[_0x48200d(0x200)]===0x0)return console['error'](_0x48200d(0x207)),console[_0x48200d(0x1c7)](_0x48200d(0x1dd)),0x1;const _0x5801a4=_0xa75120[0x0];try{_0x27cf97[_0x48200d(0x213)]&&(console[_0x48200d(0x1c7)](_0x48200d(0x1fe)+_0x27cf97['site']),console[_0x48200d(0x1c7)](_0x48200d(0x1c2)+_0x5801a4));const _0xda88c6=await withSpinner(_0x48200d(0x21b)+_0x5801a4+'\x27...',()=>_0x345d5f['segment'][_0x48200d(0x1f2)](_0x5801a4),{'verbose':_0x27cf97['verbose']}),_0x111189=_0xda88c6[_0x48200d(0x1cd)];_0x27cf97[_0x48200d(0x213)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x111189);const _0x1533ac=await withSpinner(_0x48200d(0x1b0)+_0x5801a4+_0x48200d(0x21d),()=>_0x345d5f[_0x48200d(0x1f0)]['listFolders'](_0x111189),{'verbose':_0x27cf97[_0x48200d(0x213)]}),_0x5c011c=_0x1533ac['data'];return console['error']('✔\x20Found\x20'+_0x5c011c[_0x48200d(0x200)]+'\x20folder'+(_0x5c011c[_0x48200d(0x200)]!==0x1?'s':'')),await handleSDKOutput(_0x5c011c,_0x27cf97),0x0;}catch(_0x513dad){if(_0x513dad instanceof SDKError)return console['error'](_0x48200d(0x1b4)+_0x513dad[_0x48200d(0x1d5)]),_0x513dad[_0x48200d(0x1f1)]&&console[_0x48200d(0x1c7)]('\x20\x20Cause:\x20'+_0x513dad[_0x48200d(0x1f1)]),0x1;throw _0x513dad;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1d3);[a22_0x567610(0x1e5)]=a22_0x567610(0x21a);async[a22_0x567610(0x20f)](_0x4bc5a6){const _0x37d538=a22_0x567610,{options:_0x37f4b6,args:_0xd99c53,tdx:_0x5070d1}=_0x4bc5a6;if(_0xd99c53[_0x37d538(0x200)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x3671df,childId:_0x380c42}=parseSegmentRef(_0xd99c53[0x0]);_0x37f4b6[_0x37d538(0x213)]&&(console['error']('Site:\x20'+_0x37f4b6[_0x37d538(0x1e9)]),console[_0x37d538(0x1c7)](_0x37d538(0x1c2)+_0x3671df),_0x380c42&&console[_0x37d538(0x1c7)](_0x37d538(0x1e7)+_0x380c42));if(!_0x380c42)return console['error'](_0x37d538(0x1ca)),0x1;const _0x45c606=await withSpinner(_0x37d538(0x21b)+_0x3671df+_0x37d538(0x21d),()=>_0x5070d1['segment']['resolveParentId'](_0x3671df),{'verbose':_0x37f4b6[_0x37d538(0x213)]}),_0x49944c=_0x45c606[_0x37d538(0x1cd)];_0x37f4b6['verbose']&&console['error'](_0x37d538(0x1fb)+_0x49944c);const _0x2cc10a=await withSpinner(_0x37d538(0x1f7)+_0x380c42+_0x37d538(0x21d),()=>_0x5070d1['segment']['resolveFolderId'](_0x49944c,_0x380c42),{'verbose':_0x37f4b6[_0x37d538(0x213)]}),_0xd3f284=_0x2cc10a['data'];_0x37f4b6[_0x37d538(0x213)]&&console[_0x37d538(0x1c7)](_0x37d538(0x1ea)+_0xd3f284);const _0x5616c2=await withSpinner(_0x37d538(0x1d2)+_0x380c42+_0x37d538(0x21d),()=>_0x5070d1[_0x37d538(0x1f0)][_0x37d538(0x1ec)](_0xd3f284),{'verbose':_0x37f4b6[_0x37d538(0x213)]});return await handleSDKOutput([_0x5616c2['data']],_0x37f4b6),0x0;}catch(_0x3c9966){if(_0x3c9966 instanceof SDKError)return console[_0x37d538(0x1c7)](_0x37d538(0x1b4)+_0x3c9966[_0x37d538(0x1d5)]),_0x3c9966['cause']&&console[_0x37d538(0x1c7)](_0x37d538(0x1b2)+_0x3c9966[_0x37d538(0x1f1)]),0x1;throw _0x3c9966;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1e2);['description']=a22_0x567610(0x1d8);async[a22_0x567610(0x20f)](_0x2c6ff6){const _0x19f4bc=a22_0x567610,{options:_0x56ed01,args:_0x3455c4,tdx:_0x3178f8}=_0x2c6ff6;if(_0x3455c4['length']===0x0)return console['error'](_0x19f4bc(0x1fa)),console['error'](_0x19f4bc(0x218)),console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1ba)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1df)),console[_0x19f4bc(0x1c7)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x2c113c=_0x3455c4[0x0],_0x38b764=_0x56ed01['segmentPath'];let _0x15140c=_0x2c113c;_0x38b764&&!_0x2c113c[_0x19f4bc(0x20a)]('/')&&(_0x15140c=_0x38b764+'/'+_0x2c113c,_0x56ed01[_0x19f4bc(0x213)]&&console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1af)+_0x15140c));const _0x2d0012=await withSpinner(_0x19f4bc(0x21c)+_0x15140c+'\x27...',()=>_0x3178f8[_0x19f4bc(0x1f0)]['resolvePathToResource'](_0x15140c),{'verbose':_0x56ed01['verbose']}),_0x2ac932=_0x2d0012[_0x19f4bc(0x1cd)];_0x56ed01['verbose']&&(console[_0x19f4bc(0x1c7)]('Resolved\x20type:\x20'+_0x2ac932[_0x19f4bc(0x1b3)]),console['error'](_0x19f4bc(0x1c6)+_0x2ac932[_0x19f4bc(0x210)]));if(_0x2ac932[_0x19f4bc(0x1b3)]===_0x19f4bc(0x1ff))return console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1e8)),console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1d0)),0x1;let _0x4ee4fb;if(_0x2ac932[_0x19f4bc(0x1b3)]==='parent'){const _0x332a8a=await withSpinner(_0x19f4bc(0x1b5),()=>_0x3178f8[_0x19f4bc(0x1f0)][_0x19f4bc(0x1b6)](_0x2ac932[_0x19f4bc(0x210)]),{'verbose':_0x56ed01[_0x19f4bc(0x213)]});_0x4ee4fb=_0x332a8a[_0x19f4bc(0x1cd)];}else{if(!_0x2ac932[_0x19f4bc(0x203)])throw new SDKError(ErrorCode[_0x19f4bc(0x20c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2659d=await withSpinner(_0x19f4bc(0x1fd),()=>_0x3178f8[_0x19f4bc(0x1f0)][_0x19f4bc(0x1ab)](_0x2ac932[_0x19f4bc(0x210)],_0x2ac932['segmentId']),{'verbose':_0x56ed01[_0x19f4bc(0x213)]});_0x4ee4fb=_0x2659d[_0x19f4bc(0x1cd)];}return _0x56ed01[_0x19f4bc(0x1d1)]==='json'||_0x56ed01['format']==='jsonl'?await handleSDKOutput([{'sql':_0x4ee4fb}],_0x56ed01):console['log'](_0x4ee4fb),0x0;}catch(_0x55625b){if(_0x55625b instanceof SDKError)return console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1b4)+_0x55625b[_0x19f4bc(0x1d5)]),_0x55625b[_0x19f4bc(0x1f1)]&&console[_0x19f4bc(0x1c7)]('\x20\x20Cause:\x20'+_0x55625b[_0x19f4bc(0x1f1)]),0x1;throw _0x55625b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1bc);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x567610(0x20f)](_0x3d62c0){const _0x4aab36=a22_0x567610,{options:_0x30294a,args:_0x12f970,tdx:_0x11649b}=_0x3d62c0,_0x508011=_0x30294a;if(_0x12f970[_0x4aab36(0x200)]<0x2)return console[_0x4aab36(0x1c7)](_0x4aab36(0x1b9)),console['error'](_0x4aab36(0x1bb)),0x1;const _0x5350b6=_0x12f970[0x0],_0x1c6206=_0x12f970[0x1];_0x508011[_0x4aab36(0x213)]&&(console[_0x4aab36(0x1c7)](_0x4aab36(0x1fe)+_0x508011[_0x4aab36(0x1e9)]),console[_0x4aab36(0x1c7)](_0x4aab36(0x206)+_0x5350b6),console[_0x4aab36(0x1c7)]('Folder\x20name:\x20'+_0x1c6206));let _0x2f7051;if(_0x508011['parentFolder']){const _0x2dd3a6=_0x508011[_0x4aab36(0x20e)],_0x43f499=await withSpinner(_0x4aab36(0x21b)+_0x5350b6+'\x27...',()=>_0x11649b[_0x4aab36(0x1f0)][_0x4aab36(0x1f2)](_0x5350b6),{'verbose':_0x508011[_0x4aab36(0x213)]}),_0x35025f=_0x43f499[_0x4aab36(0x1cd)],_0x393b21=await withSpinner(_0x4aab36(0x1da)+_0x2dd3a6+_0x4aab36(0x21d),()=>_0x11649b[_0x4aab36(0x1f0)][_0x4aab36(0x1cb)](_0x35025f,_0x2dd3a6),{'verbose':_0x508011[_0x4aab36(0x213)]});_0x2f7051=_0x393b21['data'],_0x508011[_0x4aab36(0x213)]&&console[_0x4aab36(0x1c7)](_0x4aab36(0x1fc)+_0x2f7051);}const _0x1942fe={'name':_0x1c6206,'description':_0x508011[_0x4aab36(0x1e5)],'parentFolderId':_0x2f7051},_0x3d5931=await withSpinner(_0x4aab36(0x1f9)+_0x1c6206+'\x27...',()=>_0x11649b['segment'][_0x4aab36(0x216)](_0x5350b6,_0x1942fe),{'verbose':_0x508011[_0x4aab36(0x213)]}),_0x6e3f4c=_0x3d5931[_0x4aab36(0x1cd)];return console[_0x4aab36(0x1c7)](_0x4aab36(0x1ae)+_0x6e3f4c[_0x4aab36(0x209)]+_0x4aab36(0x1de)+_0x6e3f4c['id']),await handleSDKOutput([_0x6e3f4c],_0x508011),0x0;}}function a22_0x13c4(){const _0x552f57=['90Mghwnc','✔\x20Query\x20completed:\x20Processed\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','582374LmLOns','Resolving\x20parent\x20folder\x20\x27','segment:describe','Executing\x20segment\x20query...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','416NjwijK','elapsedTimeMillis','segment:sql','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','query','description','resolvePathToResource','Folder\x20name:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','site','Resolved\x20folder\x20ID:\x20','segment:show','getFolder','getSegment','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','trim','segment','cause','resolveParentId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','2910171izqkQc','282jmMGuU','segment:folder:list','Resolving\x20folder\x20\x27','processedRows','Creating\x20folder\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Site:\x20','folder','length','\x20[Job\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20folder\x20details...','Parent\x20segment:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20details...','name','includes','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','INTERNAL','code','parentFolder','execute','parentId','replace','Usage:\x20tdx\x20segment\x20describe\x20<path>','verbose','6511760qWRCYW','Usage:\x20tdx\x20segment\x20show\x20<path>','createFolder','jobId','Usage:\x20tdx\x20segment\x20sql\x20<path>','parent','Show\x20segment\x20folder\x20details','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x27...','getSegmentSQL','folderId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','✔\x20Created\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Listing\x20folders\x20for\x20parent\x20\x27','getParent','\x20\x20Cause:\x20','type','Error:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','getParentSQL','limit','1668096cbCxFL','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Examples:','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:folder:create','in\x20','4nvVxge','Resolved\x20type:\x20','stats','Segment\x20ID:\x20','Parent\x20name:\x20','32074CcWzZc','19595XNzQaO','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','error','Folder\x20ID:\x20','32956188VrEbiQ','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','resolveFolderId','11IXeUKO','data','setJobId','Show\x20segment\x20or\x20folder\x20details','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','format','Fetching\x20folder\x20\x27','segment:folder:show','segmentPath','message'];a22_0x13c4=function(){return _0x552f57;};return a22_0x13c4();}
1
+ const a22_0x2f57a5=a22_0x548f;(function(_0x451db9,_0x268c7b){const _0x452b88=a22_0x548f,_0x5e533e=_0x451db9();while(!![]){try{const _0xb452f0=-parseInt(_0x452b88(0x1d5))/0x1*(-parseInt(_0x452b88(0x1ad))/0x2)+parseInt(_0x452b88(0x1f1))/0x3*(parseInt(_0x452b88(0x1bd))/0x4)+parseInt(_0x452b88(0x1c8))/0x5+-parseInt(_0x452b88(0x1e7))/0x6+parseInt(_0x452b88(0x1c1))/0x7+-parseInt(_0x452b88(0x1ba))/0x8*(parseInt(_0x452b88(0x19e))/0x9)+-parseInt(_0x452b88(0x1b6))/0xa*(parseInt(_0x452b88(0x1ab))/0xb);if(_0xb452f0===_0x268c7b)break;else _0x5e533e['push'](_0x5e533e['shift']());}catch(_0x3425f1){_0x5e533e['push'](_0x5e533e['shift']());}}}(a22_0x3f09,0x8304d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';function a22_0x548f(_0x3b2740,_0xf08107){const _0x3f09d6=a22_0x3f09();return a22_0x548f=function(_0x548f55,_0x257fcd){_0x548f55=_0x548f55-0x17b;let _0x2d2de1=_0x3f09d6[_0x548f55];return _0x2d2de1;},a22_0x548f(_0x3b2740,_0xf08107);}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x3f09(){const _0x2c5cec=['8680370iRHbYV','Resolving\x20parent\x20folder\x20\x27','jsonl','Creating\x20folder\x20\x27','496248eUeblv','Fetching\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','2492JWcVOj','resolvePathToResource','length','execute','3643010UVvXKA','Parent\x20ID:\x20','SQL\x20query:\x0a','code','Parent\x20name:\x20','segmentId','Site:\x20','4059080wTfqMU','Error:\x20','Resolving\x20parent\x20segment\x20\x27','test','cause','site','createFolder','\x20folder','getSegmentSQL','\x20\x20Cause:\x20','getFolder','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','data','1cDZfOY','segment:describe','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','toLocaleString','jobId','setJobId','Fetching\x20SQL\x20for\x20parent\x20segment...','format','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20rows\x20','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','folder','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','description','includes','parentFolder','2421132KKtjKr','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','segment:folder:create','\x27...','Show\x20segment\x20folder\x20details','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment:folder:show','3099dJKSvM','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','json','trim','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','getParentSQL','Resolved\x20parent\x20ID:\x20','Show\x20segment\x20or\x20folder\x20details','type','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','resolveParentId','✖\x20Query\x20failed\x20[','Resolved\x20parent\x20folder\x20ID:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Examples:','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Parent\x20segment:\x20','in\x20','processedRows','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','replace','Executing\x20segment\x20query...','segmentPath','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','SELECT\x20*\x20FROM\x20(\x0a','query','✔\x20Found\x20','segment:show','listFolders','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment','Resolving\x20folder\x20\x27','144uIcOYs','parent','name','message','log','segment:folder:list','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','information_schema','folderId','parentId','Resolving\x20path\x20\x27','stats','verbose','11TKiPYg','INTERNAL','1649806SoZEAw','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','error','Fetching\x20segment\x20details...','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Folder\x20ID:\x20','Segment\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20SQL\x20for\x20segment...'];a22_0x3f09=function(){return _0x2c5cec;};return a22_0x3f09();}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x2f57a5(0x1a0)]=a22_0x2f57a5(0x1d6);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x184);async[a22_0x2f57a5(0x1c0)](_0xdf8316){const _0x530318=a22_0x2f57a5,{options:_0x8909d4,args:_0x23ccf9,tdx:_0x271b9b}=_0xdf8316;if(_0x23ccf9[_0x530318(0x1bf)]===0x0)return console['error'](_0x530318(0x180)),console['error'](_0x530318(0x1ef)),console[_0x530318(0x1af)](_0x530318(0x18b)),console['error'](_0x530318(0x1d7)),console[_0x530318(0x1af)](_0x530318(0x1e0)),console[_0x530318(0x1af)](_0x530318(0x19b)),0x1;try{const _0x7e0034=_0x23ccf9[0x0],_0x1c0073=_0x8909d4['segmentPath'];let _0x48463c=_0x7e0034;_0x1c0073&&!_0x7e0034[_0x530318(0x1e5)]('/')&&(_0x48463c=_0x1c0073+'/'+_0x7e0034,_0x8909d4[_0x530318(0x1aa)]&&console['error'](_0x530318(0x18c)+_0x48463c));const _0x2385e0=await withSpinner(_0x530318(0x1a8)+_0x48463c+'\x27...',()=>_0x271b9b[_0x530318(0x19c)][_0x530318(0x1be)](_0x48463c),{'verbose':_0x8909d4[_0x530318(0x1aa)]}),_0x4ea133=_0x2385e0['data'];_0x8909d4[_0x530318(0x1aa)]&&(console[_0x530318(0x1af)](_0x530318(0x1df)+_0x4ea133[_0x530318(0x185)]),console['error'](_0x530318(0x1c2)+_0x4ea133[_0x530318(0x1a7)]),_0x4ea133['folderId']&&console[_0x530318(0x1af)](_0x530318(0x1b2)+_0x4ea133['folderId']),_0x4ea133[_0x530318(0x1c6)]&&console[_0x530318(0x1af)](_0x530318(0x1b3)+_0x4ea133['segmentId']));if(_0x4ea133[_0x530318(0x185)]===_0x530318(0x19f)){const _0x3e7a5c=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x271b9b['segment']['getParent'](_0x4ea133[_0x530318(0x1a7)]),{'verbose':_0x8909d4[_0x530318(0x1aa)]});await handleSDKOutput([_0x3e7a5c[_0x530318(0x1d4)]],_0x8909d4);}else{if(_0x4ea133[_0x530318(0x185)]===_0x530318(0x1e2)){if(!_0x4ea133[_0x530318(0x1a6)])throw new SDKError(ErrorCode['INTERNAL'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x281bdc=await withSpinner('Fetching\x20folder\x20details...',()=>_0x271b9b[_0x530318(0x19c)]['getFolder'](_0x4ea133[_0x530318(0x1a6)]),{'verbose':_0x8909d4[_0x530318(0x1aa)]});await handleSDKOutput([_0x281bdc['data']],_0x8909d4);}else{if(_0x4ea133[_0x530318(0x185)]===_0x530318(0x19c)){if(!_0x4ea133[_0x530318(0x1c6)])throw new SDKError(ErrorCode[_0x530318(0x1ac)],_0x530318(0x1bc));const _0x35edc3=await withSpinner(_0x530318(0x1b0),()=>_0x271b9b['segment'][_0x530318(0x1e1)](_0x4ea133[_0x530318(0x1a7)],_0x4ea133[_0x530318(0x1c6)]),{'verbose':_0x8909d4['verbose']});await handleSDKOutput([_0x35edc3[_0x530318(0x1d4)]],_0x8909d4);}}}return 0x0;}catch(_0x4503f5){if(_0x4503f5 instanceof SDKError)return console[_0x530318(0x1af)](_0x530318(0x1c9)+_0x4503f5['message']),_0x4503f5[_0x530318(0x1cc)]&&console['error'](_0x530318(0x1d1)+_0x4503f5[_0x530318(0x1cc)]),0x1;throw _0x4503f5;}}}export class SegmentShowCommand extends BaseCommand{['name']=a22_0x2f57a5(0x199);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x1d3);async['execute'](_0x344cab){const _0x2b3ac2=a22_0x2f57a5,{options:_0x48def8,args:_0x295898,tdx:_0x1cb361}=_0x344cab;if(_0x295898['length']===0x0)return console[_0x2b3ac2(0x1af)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2b3ac2(0x1af)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x18b)),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1ee)),console['error'](_0x2b3ac2(0x1dd)),console[_0x2b3ac2(0x1af)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x35cf47=_0x295898[0x0],_0x270537=_0x48def8[_0x2b3ac2(0x194)];let _0x30ab55=_0x35cf47;_0x270537&&!_0x35cf47[_0x2b3ac2(0x1e5)]('/')&&(_0x30ab55=_0x270537+'/'+_0x35cf47,_0x48def8[_0x2b3ac2(0x1aa)]&&console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x18c)+_0x30ab55));const _0x179e59=await withSpinner(_0x2b3ac2(0x1a8)+_0x30ab55+_0x2b3ac2(0x1eb),()=>_0x1cb361[_0x2b3ac2(0x19c)][_0x2b3ac2(0x1be)](_0x30ab55),{'verbose':_0x48def8['verbose']}),_0x1255e6=_0x179e59[_0x2b3ac2(0x1d4)];_0x48def8[_0x2b3ac2(0x1aa)]&&(console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1df)+_0x1255e6['type']),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1c2)+_0x1255e6[_0x2b3ac2(0x1a7)]));if(_0x1255e6[_0x2b3ac2(0x185)]==='folder')return console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x181)),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1e9)),0x1;let _0x5ab848;if(_0x1255e6['type']==='parent'){const _0x4f7f56=await withSpinner(_0x2b3ac2(0x1db),()=>_0x1cb361[_0x2b3ac2(0x19c)][_0x2b3ac2(0x182)](_0x1255e6[_0x2b3ac2(0x1a7)]),{'verbose':_0x48def8[_0x2b3ac2(0x1aa)]});_0x5ab848=_0x4f7f56['data'];}else{if(!_0x1255e6[_0x2b3ac2(0x1c6)])throw new SDKError(ErrorCode[_0x2b3ac2(0x1ac)],_0x2b3ac2(0x1bc));const _0x5c3101=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1cb361[_0x2b3ac2(0x19c)]['getSegmentSQL'](_0x1255e6['parentId'],_0x1255e6[_0x2b3ac2(0x1c6)]),{'verbose':_0x48def8[_0x2b3ac2(0x1aa)]});_0x5ab848=_0x5c3101['data'];}const _0x46b838=_0x48def8['limit'],_0x105dec=/\bLIMIT\s+\d+/i[_0x2b3ac2(0x1cb)](_0x5ab848);!_0x105dec&&(_0x5ab848=_0x5ab848[_0x2b3ac2(0x17d)]()[_0x2b3ac2(0x192)](/;+$/,''),_0x5ab848=_0x2b3ac2(0x196)+_0x5ab848+_0x2b3ac2(0x17e)+_0x46b838);_0x48def8['verbose']&&console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1c3)+_0x5ab848);const _0x273405=await withQuerySpinner(_0x2b3ac2(0x193),async _0x374402=>{const _0x1fee18=_0x2b3ac2,_0x4db2c2=await _0x1cb361[_0x1fee18(0x197)](_0x5ab848,{'catalog':'td','schema':_0x1fee18(0x1a5),'onJobId':_0x259cd3=>{const _0x18b73d=_0x1fee18;_0x374402[_0x18b73d(0x1da)](_0x259cd3);}});return _0x4db2c2;},{'verbose':_0x48def8[_0x2b3ac2(0x1aa)]}),_0x13dc84=_0x273405[_0x2b3ac2(0x1d4)],_0x1f2c6d=_0x13dc84[_0x2b3ac2(0x1d9)]?'\x20[Job\x20ID:\x20'+_0x13dc84[_0x2b3ac2(0x1d9)]+']':'';return console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1b4)+_0x13dc84[_0x2b3ac2(0x1a9)][_0x2b3ac2(0x190)][_0x2b3ac2(0x1d8)]()+_0x2b3ac2(0x1de)+(_0x2b3ac2(0x18f)+formatElapsed(_0x13dc84[_0x2b3ac2(0x1a9)]['elapsedTimeMillis'])+_0x1f2c6d)),await handleQueryOutput(_0x13dc84,_0x48def8),0x0;}catch(_0x5ac234){if(_0x5ac234 instanceof SDKError)return console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x188)+_0x5ac234[_0x2b3ac2(0x1c4)]+']'),console[_0x2b3ac2(0x1af)]('\x0a'+_0x5ac234['message']),0x1;throw _0x5ac234;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x2f57a5(0x1a0)]=a22_0x2f57a5(0x1a3);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x1b1);async[a22_0x2f57a5(0x1c0)](_0x3fb56e){const _0x1ee06e=a22_0x2f57a5,{options:_0x502be1,args:_0x40c82c,tdx:_0x29b20d}=_0x3fb56e;if(_0x40c82c[_0x1ee06e(0x1bf)]===0x0)return console[_0x1ee06e(0x1af)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1ee06e(0x1af)](_0x1ee06e(0x1e3)),0x1;const _0x993b=_0x40c82c[0x0];try{_0x502be1[_0x1ee06e(0x1aa)]&&(console['error'](_0x1ee06e(0x1c7)+_0x502be1[_0x1ee06e(0x1cd)]),console[_0x1ee06e(0x1af)](_0x1ee06e(0x1c5)+_0x993b));const _0x5e61bd=await withSpinner(_0x1ee06e(0x1ca)+_0x993b+_0x1ee06e(0x1eb),()=>_0x29b20d['segment'][_0x1ee06e(0x187)](_0x993b),{'verbose':_0x502be1[_0x1ee06e(0x1aa)]}),_0x26238f=_0x5e61bd['data'];_0x502be1['verbose']&&console[_0x1ee06e(0x1af)](_0x1ee06e(0x183)+_0x26238f);const _0x3b6d8b=await withSpinner(_0x1ee06e(0x18a)+_0x993b+'\x27...',()=>_0x29b20d[_0x1ee06e(0x19c)][_0x1ee06e(0x19a)](_0x26238f),{'verbose':_0x502be1[_0x1ee06e(0x1aa)]}),_0x498981=_0x3b6d8b[_0x1ee06e(0x1d4)];return console[_0x1ee06e(0x1af)](_0x1ee06e(0x198)+_0x498981[_0x1ee06e(0x1bf)]+_0x1ee06e(0x1cf)+(_0x498981[_0x1ee06e(0x1bf)]!==0x1?'s':'')),await handleSDKOutput(_0x498981,_0x502be1),0x0;}catch(_0x1b38d8){if(_0x1b38d8 instanceof SDKError)return console['error'](_0x1ee06e(0x1c9)+_0x1b38d8[_0x1ee06e(0x1a1)]),_0x1b38d8[_0x1ee06e(0x1cc)]&&console[_0x1ee06e(0x1af)](_0x1ee06e(0x1d1)+_0x1b38d8[_0x1ee06e(0x1cc)]),0x1;throw _0x1b38d8;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x2f57a5(0x1f0);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x1ec);async[a22_0x2f57a5(0x1c0)](_0x474dca){const _0xe94027=a22_0x2f57a5,{options:_0x53e75d,args:_0x3f836d,tdx:_0x4bc095}=_0x474dca;if(_0x3f836d[_0xe94027(0x1bf)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xe94027(0x1af)](_0xe94027(0x191)),0x1;try{const {parentId:_0x56fffe,childId:_0x88f5a1}=parseSegmentRef(_0x3f836d[0x0]);_0x53e75d['verbose']&&(console[_0xe94027(0x1af)](_0xe94027(0x1c7)+_0x53e75d[_0xe94027(0x1cd)]),console[_0xe94027(0x1af)]('Parent\x20name:\x20'+_0x56fffe),_0x88f5a1&&console[_0xe94027(0x1af)](_0xe94027(0x1f2)+_0x88f5a1));if(!_0x88f5a1)return console[_0xe94027(0x1af)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5c8715=await withSpinner(_0xe94027(0x1ca)+_0x56fffe+_0xe94027(0x1eb),()=>_0x4bc095[_0xe94027(0x19c)][_0xe94027(0x187)](_0x56fffe),{'verbose':_0x53e75d['verbose']}),_0x656f0a=_0x5c8715['data'];_0x53e75d['verbose']&&console[_0xe94027(0x1af)](_0xe94027(0x183)+_0x656f0a);const _0x6c7402=await withSpinner(_0xe94027(0x19d)+_0x88f5a1+_0xe94027(0x1eb),()=>_0x4bc095[_0xe94027(0x19c)]['resolveFolderId'](_0x656f0a,_0x88f5a1),{'verbose':_0x53e75d[_0xe94027(0x1aa)]}),_0x20c6dc=_0x6c7402[_0xe94027(0x1d4)];_0x53e75d['verbose']&&console[_0xe94027(0x1af)](_0xe94027(0x1ed)+_0x20c6dc);const _0x5804cf=await withSpinner(_0xe94027(0x1bb)+_0x88f5a1+'\x27...',()=>_0x4bc095[_0xe94027(0x19c)][_0xe94027(0x1d2)](_0x20c6dc),{'verbose':_0x53e75d[_0xe94027(0x1aa)]});return await handleSDKOutput([_0x5804cf[_0xe94027(0x1d4)]],_0x53e75d),0x0;}catch(_0xf4c115){if(_0xf4c115 instanceof SDKError)return console[_0xe94027(0x1af)](_0xe94027(0x1c9)+_0xf4c115['message']),_0xf4c115['cause']&&console[_0xe94027(0x1af)](_0xe94027(0x1d1)+_0xf4c115[_0xe94027(0x1cc)]),0x1;throw _0xf4c115;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x2f57a5(0x1a0)]='segment:sql';['description']='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async[a22_0x2f57a5(0x1c0)](_0x27fa26){const _0x5c7a54=a22_0x2f57a5,{options:_0x56cffa,args:_0x49628a,tdx:_0x2c2671}=_0x27fa26;if(_0x49628a[_0x5c7a54(0x1bf)]===0x0)return console[_0x5c7a54(0x1af)](_0x5c7a54(0x1ae)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x18d)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x18b)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x186)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x1e8)),console[_0x5c7a54(0x1af)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x121271=_0x49628a[0x0],_0x50232c=_0x56cffa['segmentPath'];let _0x1538ae=_0x121271;_0x50232c&&!_0x121271[_0x5c7a54(0x1e5)]('/')&&(_0x1538ae=_0x50232c+'/'+_0x121271,_0x56cffa[_0x5c7a54(0x1aa)]&&console[_0x5c7a54(0x1af)](_0x5c7a54(0x18c)+_0x1538ae));const _0x86d665=await withSpinner(_0x5c7a54(0x1a8)+_0x1538ae+'\x27...',()=>_0x2c2671['segment'][_0x5c7a54(0x1be)](_0x1538ae),{'verbose':_0x56cffa[_0x5c7a54(0x1aa)]}),_0x1736c3=_0x86d665[_0x5c7a54(0x1d4)];_0x56cffa['verbose']&&(console[_0x5c7a54(0x1af)]('Resolved\x20type:\x20'+_0x1736c3[_0x5c7a54(0x185)]),console['error'](_0x5c7a54(0x1c2)+_0x1736c3[_0x5c7a54(0x1a7)]));if(_0x1736c3['type']===_0x5c7a54(0x1e2))return console[_0x5c7a54(0x1af)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x5c7a54(0x1af)](_0x5c7a54(0x1a4)),0x1;let _0x194a7f;if(_0x1736c3[_0x5c7a54(0x185)]===_0x5c7a54(0x19f)){const _0x4ba06f=await withSpinner(_0x5c7a54(0x1db),()=>_0x2c2671[_0x5c7a54(0x19c)][_0x5c7a54(0x182)](_0x1736c3[_0x5c7a54(0x1a7)]),{'verbose':_0x56cffa[_0x5c7a54(0x1aa)]});_0x194a7f=_0x4ba06f['data'];}else{if(!_0x1736c3[_0x5c7a54(0x1c6)])throw new SDKError(ErrorCode[_0x5c7a54(0x1ac)],_0x5c7a54(0x1bc));const _0x22aeec=await withSpinner(_0x5c7a54(0x1b5),()=>_0x2c2671['segment'][_0x5c7a54(0x1d0)](_0x1736c3[_0x5c7a54(0x1a7)],_0x1736c3['segmentId']),{'verbose':_0x56cffa[_0x5c7a54(0x1aa)]});_0x194a7f=_0x22aeec[_0x5c7a54(0x1d4)];}return _0x56cffa[_0x5c7a54(0x1dc)]===_0x5c7a54(0x17c)||_0x56cffa['format']===_0x5c7a54(0x1b8)?await handleSDKOutput([{'sql':_0x194a7f}],_0x56cffa):console[_0x5c7a54(0x1a2)](_0x194a7f),0x0;}catch(_0x2e7197){if(_0x2e7197 instanceof SDKError)return console[_0x5c7a54(0x1af)]('Error:\x20'+_0x2e7197['message']),_0x2e7197[_0x5c7a54(0x1cc)]&&console[_0x5c7a54(0x1af)](_0x5c7a54(0x1d1)+_0x2e7197['cause']),0x1;throw _0x2e7197;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a22_0x2f57a5(0x1ea);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x17f);async[a22_0x2f57a5(0x1c0)](_0x3abfdd){const _0x4da58f=a22_0x2f57a5,{options:_0x12ce4f,args:_0x543c12,tdx:_0x11e3c2}=_0x3abfdd,_0x53a0b5=_0x12ce4f;if(_0x543c12['length']<0x2)return console[_0x4da58f(0x1af)](_0x4da58f(0x195)),console[_0x4da58f(0x1af)](_0x4da58f(0x17b)),0x1;const _0x3c3824=_0x543c12[0x0],_0x21df32=_0x543c12[0x1];_0x53a0b5['verbose']&&(console[_0x4da58f(0x1af)](_0x4da58f(0x1c7)+_0x53a0b5[_0x4da58f(0x1cd)]),console[_0x4da58f(0x1af)](_0x4da58f(0x18e)+_0x3c3824),console['error'](_0x4da58f(0x1f2)+_0x21df32));let _0x4d3576;if(_0x53a0b5[_0x4da58f(0x1e6)]){const _0x5bcd67=_0x53a0b5[_0x4da58f(0x1e6)],_0xb60423=await withSpinner(_0x4da58f(0x1ca)+_0x3c3824+_0x4da58f(0x1eb),()=>_0x11e3c2['segment'][_0x4da58f(0x187)](_0x3c3824),{'verbose':_0x53a0b5[_0x4da58f(0x1aa)]}),_0x5b2aa2=_0xb60423[_0x4da58f(0x1d4)],_0x6b42a5=await withSpinner(_0x4da58f(0x1b7)+_0x5bcd67+'\x27...',()=>_0x11e3c2[_0x4da58f(0x19c)]['resolveFolderId'](_0x5b2aa2,_0x5bcd67),{'verbose':_0x53a0b5[_0x4da58f(0x1aa)]});_0x4d3576=_0x6b42a5[_0x4da58f(0x1d4)],_0x53a0b5[_0x4da58f(0x1aa)]&&console['error'](_0x4da58f(0x189)+_0x4d3576);}const _0x1193a0={'name':_0x21df32,'description':_0x53a0b5[_0x4da58f(0x1e4)],'parentFolderId':_0x4d3576},_0x4ad705=await withSpinner(_0x4da58f(0x1b9)+_0x21df32+_0x4da58f(0x1eb),()=>_0x11e3c2[_0x4da58f(0x19c)][_0x4da58f(0x1ce)](_0x3c3824,_0x1193a0),{'verbose':_0x53a0b5[_0x4da58f(0x1aa)]}),_0x292192=_0x4ad705[_0x4da58f(0x1d4)];return console[_0x4da58f(0x1af)]('✔\x20Created\x20folder\x20\x27'+_0x292192[_0x4da58f(0x1a0)]+'\x27\x20with\x20ID:\x20'+_0x292192['id']),await handleSDKOutput([_0x292192],_0x53a0b5),0x0;}}
@@ -1 +1 @@
1
- const a23_0x1ed19a=a23_0x4397;function a23_0x4e4d(){const _0x4dcbd2=['Parent:\x20','invisible','resolveFolderId','\x27...','data','Target\x20path:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','segments','error','includes','492140NgEcgN','resolveParentId','230900uCbrYg','285699HykuDw','15490330XJDUFG','segment','kind','Segment\x20name:\x20','createSegment','Examples:','30askXvV','Resolved\x20relative\x20path\x20to:\x20','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','type','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Site:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','470540hSrwle','segment:create','name','folderId','execute','4YRUuKn','resolvePathToResource','verbose','noCountPopulation','Resolving\x20folder\x20path\x20\x27','parent','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','description','9TExWyI','folder','rule','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','6229680NOpjML','3307824LkVTqD','\x20\x20\x20Path:\x20','length','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'];a23_0x4e4d=function(){return _0x4dcbd2;};return a23_0x4e4d();}(function(_0xac6991,_0x9a1191){const _0x295b08=a23_0x4397,_0x5d3c29=_0xac6991();while(!![]){try{const _0x14bf66=parseInt(_0x295b08(0x165))/0x1*(parseInt(_0x295b08(0x150))/0x2)+parseInt(_0x295b08(0x151))/0x3+parseInt(_0x295b08(0x14e))/0x4+-parseInt(_0x295b08(0x171))/0x5+parseInt(_0x295b08(0x158))/0x6*(parseInt(_0x295b08(0x160))/0x7)+-parseInt(_0x295b08(0x172))/0x8+-parseInt(_0x295b08(0x16d))/0x9*(-parseInt(_0x295b08(0x152))/0xa);if(_0x14bf66===_0x9a1191)break;else _0x5d3c29['push'](_0x5d3c29['shift']());}catch(_0x5a05bf){_0x5d3c29['push'](_0x5d3c29['shift']());}}}(a23_0x4e4d,0xdd23b));import{BaseCommand}from'./command.js';function a23_0x4397(_0x1f07bb,_0x49ee92){const _0x4e4d30=a23_0x4e4d();return a23_0x4397=function(_0x439705,_0x50db00){_0x439705=_0x439705-0x147;let _0x162133=_0x4e4d30[_0x439705];return _0x162133;},a23_0x4397(_0x1f07bb,_0x49ee92);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x1ed19a(0x162)]=a23_0x1ed19a(0x161);[a23_0x1ed19a(0x16c)]=a23_0x1ed19a(0x15f);async[a23_0x1ed19a(0x164)](_0x1150d4){const _0x5af9d0=a23_0x1ed19a,{options:_0xd0ac96,args:_0xd812e8,tdx:_0x1b1134}=_0x1150d4,_0x4665ac=_0xd0ac96;if(_0xd812e8[_0x5af9d0(0x174)]===0x0)return console[_0x5af9d0(0x14c)](_0x5af9d0(0x16b)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x15b)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x157)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x149)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x175)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x15d)),0x1;const _0x436498=_0xd812e8[0x0],_0x17c84e=_0xd0ac96[_0x5af9d0(0x15a)];let _0x273330=_0x436498;_0x17c84e&&!_0x436498[_0x5af9d0(0x14d)]('/')&&(_0x273330=_0x17c84e+'/'+_0x436498,_0x4665ac[_0x5af9d0(0x167)]&&console['error'](_0x5af9d0(0x159)+_0x273330));const _0x19dc35=parsePath(_0x273330);if(_0x19dc35['segments'][_0x5af9d0(0x174)]<0x2)return console[_0x5af9d0(0x14c)](_0x5af9d0(0x148)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x170)),0x1;const _0x500414=_0x19dc35[_0x5af9d0(0x14b)][0x0],_0x1a8e5e=getBaseName(_0x273330),_0x491066=getParentPath(_0x273330);_0x4665ac[_0x5af9d0(0x167)]&&(console[_0x5af9d0(0x14c)](_0x5af9d0(0x15e)+_0x4665ac['site']),console[_0x5af9d0(0x14c)](_0x5af9d0(0x147)+_0x273330),console['error'](_0x5af9d0(0x176)+_0x500414),console['error'](_0x5af9d0(0x155)+_0x1a8e5e),console[_0x5af9d0(0x14c)]('Parent\x20path:\x20'+_0x491066));const _0x467983=await withSpinner(_0x5af9d0(0x14a)+_0x500414+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x14f)](_0x500414),{'verbose':_0x4665ac[_0x5af9d0(0x167)]}),_0xf28d94=_0x467983[_0x5af9d0(0x17a)];let _0x3b69b7;if(_0x19dc35['segments'][_0x5af9d0(0x174)]>0x2){const _0x6e1fcf=await withSpinner(_0x5af9d0(0x169)+_0x491066+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x166)](_0x491066),{'verbose':_0x4665ac[_0x5af9d0(0x167)]}),_0x2d263d=_0x6e1fcf[_0x5af9d0(0x17a)];if(_0x2d263d[_0x5af9d0(0x15c)]!==_0x5af9d0(0x16e)&&_0x2d263d[_0x5af9d0(0x15c)]!==_0x5af9d0(0x16a))return console[_0x5af9d0(0x14c)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x3b69b7=_0x2d263d[_0x5af9d0(0x163)];}else{if(_0x4665ac[_0x5af9d0(0x16e)]){const _0xb30593=await withSpinner('Resolving\x20folder\x20\x27'+_0x4665ac['folder']+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x178)](_0xf28d94,_0x4665ac[_0x5af9d0(0x16e)]),{'verbose':_0x4665ac[_0x5af9d0(0x167)]});_0x3b69b7=_0xb30593[_0x5af9d0(0x17a)];}}_0x4665ac[_0x5af9d0(0x167)]&&_0x3b69b7&&console[_0x5af9d0(0x14c)]('Resolved\x20folder\x20ID:\x20'+_0x3b69b7);const _0x52225b=await loadJSONFromOptions(_0x4665ac[_0x5af9d0(0x16f)],_0x4665ac['ruleFile']),_0x56a18b={'name':_0x1a8e5e,'description':_0x4665ac['description'],'rule':_0x52225b,'kind':_0x4665ac[_0x5af9d0(0x154)]!==undefined?parseInt(_0x4665ac[_0x5af9d0(0x154)],0xa):undefined,'isVisible':_0x4665ac[_0x5af9d0(0x177)]?![]:undefined,'segmentFolderId':_0x3b69b7,'countPopulation':_0x4665ac[_0x5af9d0(0x168)]?![]:undefined},_0x5962a9=await withSpinner('Creating\x20segment\x20\x27'+_0x1a8e5e+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x156)](_0xf28d94,_0x56a18b),{'verbose':_0x4665ac[_0x5af9d0(0x167)]}),_0x4c5d88=_0x5962a9[_0x5af9d0(0x17a)];return console[_0x5af9d0(0x14c)]('✔\x20Created\x20segment\x20\x27'+_0x4c5d88[_0x5af9d0(0x162)]+'\x27\x20with\x20ID:\x20'+_0x4c5d88['id']),_0x273330!==_0x436498&&console['error'](_0x5af9d0(0x173)+_0x273330),await handleSDKOutput([_0x4c5d88],_0x4665ac),0x0;}}
1
+ const a23_0x3364f1=a23_0x104b;function a23_0x104b(_0x368e21,_0xf8200b){const _0x2677d6=a23_0x2677();return a23_0x104b=function(_0x104be9,_0x15fcd8){_0x104be9=_0x104be9-0xfc;let _0x538f80=_0x2677d6[_0x104be9];return _0x538f80;},a23_0x104b(_0x368e21,_0xf8200b);}(function(_0x56bf4a,_0x52ff9d){const _0x32cbb9=a23_0x104b,_0x572642=_0x56bf4a();while(!![]){try{const _0x5b7118=parseInt(_0x32cbb9(0x121))/0x1+parseInt(_0x32cbb9(0x12c))/0x2*(parseInt(_0x32cbb9(0x11e))/0x3)+-parseInt(_0x32cbb9(0x103))/0x4*(-parseInt(_0x32cbb9(0x119))/0x5)+parseInt(_0x32cbb9(0x122))/0x6*(-parseInt(_0x32cbb9(0x10c))/0x7)+parseInt(_0x32cbb9(0x120))/0x8*(parseInt(_0x32cbb9(0x107))/0x9)+-parseInt(_0x32cbb9(0x11d))/0xa*(parseInt(_0x32cbb9(0x125))/0xb)+-parseInt(_0x32cbb9(0x105))/0xc*(parseInt(_0x32cbb9(0x10b))/0xd);if(_0x5b7118===_0x52ff9d)break;else _0x572642['push'](_0x572642['shift']());}catch(_0x3f71d9){_0x572642['push'](_0x572642['shift']());}}}(a23_0x2677,0xa3430));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a23_0x2677(){const _0x1f4fda=['segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','18514015YOqmPr','14WwVHeW','ruleFile','kind','verbose','description','\x27...','Resolved\x20folder\x20ID:\x20','segment','segment:create','length','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','createSegment','error','8420oErqHb','invisible','Examples:','data','10oKpnvS','703533JGIDOd','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1664MgYJjO','318627SUUgQc','215466JoCcuG','resolveFolderId','execute','12575134nFtzRJ','\x27\x20with\x20ID:\x20','folderId','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','name','8GaRZLR','resolveParentId','✔\x20Created\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Target\x20path:\x20','Parent:\x20','includes','site','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Site:\x20','2980MclMxV','Resolving\x20folder\x20path\x20\x27','12XcPElm','folder','34470WkNDFL','Create\x20child\x20segment\x20with\x20filtering\x20rules'];a23_0x2677=function(){return _0x1f4fda;};return a23_0x2677();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x3364f1(0x12b)]=a23_0x3364f1(0x114);[a23_0x3364f1(0x110)]=a23_0x3364f1(0x108);async[a23_0x3364f1(0x124)](_0x24baec){const _0x228f27=a23_0x3364f1,{options:_0x49b21a,args:_0x35e0d3,tdx:_0x2c109b}=_0x24baec,_0x4b3823=_0x49b21a;if(_0x35e0d3['length']===0x0)return console['error'](_0x228f27(0xfc)),console['error'](_0x228f27(0x11f)),console[_0x228f27(0x118)](_0x228f27(0x11b)),console[_0x228f27(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x228f27(0x118)](_0x228f27(0x101)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3a3e9c=_0x35e0d3[0x0],_0x3e690d=_0x49b21a['segmentPath'];let _0x16d20b=_0x3a3e9c;_0x3e690d&&!_0x3a3e9c[_0x228f27(0xff)]('/')&&(_0x16d20b=_0x3e690d+'/'+_0x3a3e9c,_0x4b3823[_0x228f27(0x10f)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x16d20b));const _0x3ec7cf=parsePath(_0x16d20b);if(_0x3ec7cf[_0x228f27(0x109)][_0x228f27(0x115)]<0x2)return console[_0x228f27(0x118)](_0x228f27(0x10a)),console[_0x228f27(0x118)](_0x228f27(0x129)),0x1;const _0x15e13f=_0x3ec7cf[_0x228f27(0x109)][0x0],_0x61c335=getBaseName(_0x16d20b),_0x58e6bd=getParentPath(_0x16d20b);_0x4b3823[_0x228f27(0x10f)]&&(console['error'](_0x228f27(0x102)+_0x4b3823[_0x228f27(0x100)]),console[_0x228f27(0x118)](_0x228f27(0xfd)+_0x16d20b),console[_0x228f27(0x118)](_0x228f27(0xfe)+_0x15e13f),console['error'](_0x228f27(0x12a)+_0x61c335),console[_0x228f27(0x118)]('Parent\x20path:\x20'+_0x58e6bd));const _0x36eb5a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x15e13f+'\x27...',()=>_0x2c109b[_0x228f27(0x113)][_0x228f27(0x12d)](_0x15e13f),{'verbose':_0x4b3823[_0x228f27(0x10f)]}),_0x379ec9=_0x36eb5a[_0x228f27(0x11c)];let _0x4da8aa;if(_0x3ec7cf['segments'][_0x228f27(0x115)]>0x2){const _0x112565=await withSpinner(_0x228f27(0x104)+_0x58e6bd+_0x228f27(0x111),()=>_0x2c109b['segment'][_0x228f27(0x128)](_0x58e6bd),{'verbose':_0x4b3823['verbose']}),_0x34e17c=_0x112565[_0x228f27(0x11c)];if(_0x34e17c['type']!==_0x228f27(0x106)&&_0x34e17c['type']!=='parent')return console[_0x228f27(0x118)](_0x228f27(0x116)),0x1;_0x4da8aa=_0x34e17c[_0x228f27(0x127)];}else{if(_0x4b3823['folder']){const _0x201f43=await withSpinner('Resolving\x20folder\x20\x27'+_0x4b3823[_0x228f27(0x106)]+_0x228f27(0x111),()=>_0x2c109b[_0x228f27(0x113)][_0x228f27(0x123)](_0x379ec9,_0x4b3823[_0x228f27(0x106)]),{'verbose':_0x4b3823[_0x228f27(0x10f)]});_0x4da8aa=_0x201f43[_0x228f27(0x11c)];}}_0x4b3823['verbose']&&_0x4da8aa&&console[_0x228f27(0x118)](_0x228f27(0x112)+_0x4da8aa);const _0x3be43e=await loadJSONFromOptions(_0x4b3823['rule'],_0x4b3823[_0x228f27(0x10d)]),_0x436679={'name':_0x61c335,'description':_0x4b3823['description'],'rule':_0x3be43e,'kind':_0x4b3823[_0x228f27(0x10e)]!==undefined?parseInt(_0x4b3823[_0x228f27(0x10e)],0xa):undefined,'isVisible':_0x4b3823[_0x228f27(0x11a)]?![]:undefined,'segmentFolderId':_0x4da8aa,'countPopulation':_0x4b3823['noCountPopulation']?![]:undefined},_0x5091f6=await withSpinner('Creating\x20segment\x20\x27'+_0x61c335+_0x228f27(0x111),()=>_0x2c109b[_0x228f27(0x113)][_0x228f27(0x117)](_0x379ec9,_0x436679),{'verbose':_0x4b3823[_0x228f27(0x10f)]}),_0x242332=_0x5091f6['data'];return console['error'](_0x228f27(0x12e)+_0x242332[_0x228f27(0x12b)]+_0x228f27(0x126)+_0x242332['id']),_0x16d20b!==_0x3a3e9c&&console[_0x228f27(0x118)]('\x20\x20\x20Path:\x20'+_0x16d20b),await handleSDKOutput([_0x242332],_0x4b3823),0x0;}}
@@ -1 +1 @@
1
- const a24_0x55753b=a24_0x166c;function a24_0x166c(_0x421d05,_0x480524){const _0x191f99=a24_0x191f();return a24_0x166c=function(_0x166c21,_0x5880ca){_0x166c21=_0x166c21-0x16d;let _0x24addb=_0x191f99[_0x166c21];return _0x24addb;},a24_0x166c(_0x421d05,_0x480524);}(function(_0x2a0bef,_0x2ea3fc){const _0x1e68e0=a24_0x166c,_0x51ee66=_0x2a0bef();while(!![]){try{const _0xcb2692=-parseInt(_0x1e68e0(0x181))/0x1+-parseInt(_0x1e68e0(0x174))/0x2*(-parseInt(_0x1e68e0(0x176))/0x3)+parseInt(_0x1e68e0(0x17a))/0x4+-parseInt(_0x1e68e0(0x171))/0x5+-parseInt(_0x1e68e0(0x17b))/0x6+-parseInt(_0x1e68e0(0x178))/0x7+parseInt(_0x1e68e0(0x177))/0x8;if(_0xcb2692===_0x2ea3fc)break;else _0x51ee66['push'](_0x51ee66['shift']());}catch(_0x2d4783){_0x51ee66['push'](_0x51ee66['shift']());}}}(a24_0x191f,0xb50f2));import{BaseCommand}from'./command.js';function a24_0x191f(){const _0x187e4d=['length','Parent\x20segment:\x20','872590oBkXeH','Site:\x20','\x20field','20198wEnERg','description','141Srwluz','9392936urPYvL','1359547qHUxaS','error','5080472ksaSyD','7320894MKLFan','List\x20available\x20fields\x20for\x20segmentation','site','verbose','listFields','\x27...','588382ZUtqXB','Error:\x20Parent\x20segment\x20name\x20is\x20required','data','Listing\x20fields\x20for\x20\x27'];a24_0x191f=function(){return _0x187e4d;};return a24_0x191f();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a24_0x55753b(0x175)]=a24_0x55753b(0x17c);async['execute'](_0x4a84e3){const _0xec86fc=a24_0x55753b,{options:_0x373bdf,args:_0x4599d9,tdx:_0x5cbb27}=_0x4a84e3;if(_0x4599d9[_0xec86fc(0x16f)]===0x0)return console[_0xec86fc(0x179)](_0xec86fc(0x182)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x2f8cc8=_0x4599d9[0x0];_0x373bdf[_0xec86fc(0x17e)]&&(console[_0xec86fc(0x179)](_0xec86fc(0x172)+_0x373bdf[_0xec86fc(0x17d)]),console[_0xec86fc(0x179)](_0xec86fc(0x170)+_0x2f8cc8));const _0x5629ef=await withSpinner(_0xec86fc(0x16e)+_0x2f8cc8+_0xec86fc(0x180),()=>_0x5cbb27['segment'][_0xec86fc(0x17f)](_0x2f8cc8),{'verbose':_0x373bdf[_0xec86fc(0x17e)]}),_0x376559=_0x5629ef[_0xec86fc(0x16d)];return console[_0xec86fc(0x179)]('✔\x20Found\x20'+_0x376559[_0xec86fc(0x16f)]+_0xec86fc(0x173)+(_0x376559[_0xec86fc(0x16f)]!==0x1?'s':'')),await handleSDKOutput(_0x376559,_0x373bdf),0x0;}}
1
+ function a24_0xef35(_0x2163fb,_0x1c95e9){const _0x262157=a24_0x2621();return a24_0xef35=function(_0xef356f,_0x550d00){_0xef356f=_0xef356f-0x1ee;let _0x5ca62a=_0x262157[_0xef356f];return _0x5ca62a;},a24_0xef35(_0x2163fb,_0x1c95e9);}const a24_0x4e09f0=a24_0xef35;(function(_0x75511e,_0x3a5e65){const _0x387a8e=a24_0xef35,_0x29c0d1=_0x75511e();while(!![]){try{const _0x527775=parseInt(_0x387a8e(0x1f2))/0x1+-parseInt(_0x387a8e(0x1f6))/0x2+-parseInt(_0x387a8e(0x1fd))/0x3*(-parseInt(_0x387a8e(0x1ee))/0x4)+-parseInt(_0x387a8e(0x201))/0x5+-parseInt(_0x387a8e(0x204))/0x6*(-parseInt(_0x387a8e(0x1f0))/0x7)+-parseInt(_0x387a8e(0x1f1))/0x8+parseInt(_0x387a8e(0x1f4))/0x9*(parseInt(_0x387a8e(0x203))/0xa);if(_0x527775===_0x3a5e65)break;else _0x29c0d1['push'](_0x29c0d1['shift']());}catch(_0x737075){_0x29c0d1['push'](_0x29c0d1['shift']());}}}(a24_0x2621,0xbd255));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a24_0x2621(){const _0x272638=['site','Parent\x20segment:\x20','2477210lmMwLf','description','24257620yacRBn','496860cmxuId','name','20ARhNvb','\x27...','21JdfCAG','6326488BrfyLh','127082zSkuUV','error','9aIVUmk','execute','1694580mIGuRc','segment:fields','\x20field','segment','✔\x20Found\x20','verbose','length','64206DWiWiN','List\x20available\x20fields\x20for\x20segmentation'];a24_0x2621=function(){return _0x272638;};return a24_0x2621();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x4e09f0(0x205)]=a24_0x4e09f0(0x1f7);[a24_0x4e09f0(0x202)]=a24_0x4e09f0(0x1fe);async[a24_0x4e09f0(0x1f5)](_0x480787){const _0x67d960=a24_0x4e09f0,{options:_0x291939,args:_0x15c3dc,tdx:_0x17cbc1}=_0x480787;if(_0x15c3dc['length']===0x0)return console[_0x67d960(0x1f3)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x67d960(0x1f3)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x4c2ede=_0x15c3dc[0x0];_0x291939[_0x67d960(0x1fb)]&&(console[_0x67d960(0x1f3)]('Site:\x20'+_0x291939[_0x67d960(0x1ff)]),console[_0x67d960(0x1f3)](_0x67d960(0x200)+_0x4c2ede));const _0x3a8e62=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4c2ede+_0x67d960(0x1ef),()=>_0x17cbc1[_0x67d960(0x1f9)]['listFields'](_0x4c2ede),{'verbose':_0x291939[_0x67d960(0x1fb)]}),_0x551142=_0x3a8e62['data'];return console[_0x67d960(0x1f3)](_0x67d960(0x1fa)+_0x551142[_0x67d960(0x1fc)]+_0x67d960(0x1f8)+(_0x551142[_0x67d960(0x1fc)]!==0x1?'s':'')),await handleSDKOutput(_0x551142,_0x291939),0x0;}}
@@ -1 +1 @@
1
- const a25_0x532977=a25_0x181a;(function(_0x176155,_0x55db85){const _0x265582=a25_0x181a,_0x450897=_0x176155();while(!![]){try{const _0x42f612=parseInt(_0x265582(0x1a2))/0x1*(parseInt(_0x265582(0x1b2))/0x2)+-parseInt(_0x265582(0x1a3))/0x3*(parseInt(_0x265582(0x1aa))/0x4)+parseInt(_0x265582(0x19b))/0x5*(parseInt(_0x265582(0x1a4))/0x6)+-parseInt(_0x265582(0x1a9))/0x7+parseInt(_0x265582(0x1ae))/0x8+-parseInt(_0x265582(0x1a6))/0x9*(-parseInt(_0x265582(0x19e))/0xa)+parseInt(_0x265582(0x1b1))/0xb*(-parseInt(_0x265582(0x1a0))/0xc);if(_0x42f612===_0x55db85)break;else _0x450897['push'](_0x450897['shift']());}catch(_0x6f1da7){_0x450897['push'](_0x450897['shift']());}}}(a25_0x1194,0x5c57a));function a25_0x1194(){const _0x32c842=['22ogMRMq','segmentPath','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','jsonl','\x20\x20Path:\x20','705JPiUmL','Show\x20current\x20segment/folder\x20context','description','210lvYoke','name','9253644WctedG','execute','26582TdPrlk','5112VCKSOW','31506iqQPuL','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','94644SqXcpr','verbose','log','1601012ESzvPM','412KNlqhd','stringify','error','format','2399760IVQKAr','root','json','11URlCKu'];a25_0x1194=function(){return _0x32c842;};return a25_0x1194();}import{BaseCommand}from'./command.js';function a25_0x181a(_0xe0cb5a,_0x4ed44e){const _0x1194a5=a25_0x1194();return a25_0x181a=function(_0x181a44,_0x1f9f64){_0x181a44=_0x181a44-0x198;let _0xda6cc4=_0x1194a5[_0x181a44];return _0xda6cc4;},a25_0x181a(_0xe0cb5a,_0x4ed44e);}export class SegmentPwdCommand extends BaseCommand{[a25_0x532977(0x19f)]='segment:pwd';[a25_0x532977(0x19d)]=a25_0x532977(0x19c);async[a25_0x532977(0x1a1)](_0x551ee6){const _0x29cb20=a25_0x532977,{options:_0x1b0c92}=_0x551ee6;try{const _0x62594a=_0x1b0c92[_0x29cb20(0x1b3)];if(!_0x62594a)return _0x1b0c92[_0x29cb20(0x1ad)]==='json'||_0x1b0c92['format']===_0x29cb20(0x199)?console[_0x29cb20(0x1a8)](JSON[_0x29cb20(0x1ab)]({'path':'/','type':_0x29cb20(0x1af)})):console[_0x29cb20(0x1a8)]('/'),0x0;if(_0x1b0c92[_0x29cb20(0x1ad)]===_0x29cb20(0x1b0)||_0x1b0c92[_0x29cb20(0x1ad)]===_0x29cb20(0x199)){const _0x124dae={'path':_0x62594a};console[_0x29cb20(0x1a8)](JSON['stringify'](_0x124dae));}else console[_0x29cb20(0x1a8)](_0x62594a),_0x1b0c92[_0x29cb20(0x1a7)]&&(console[_0x29cb20(0x1ac)](''),console[_0x29cb20(0x1ac)]('Context\x20details:'),console['error'](_0x29cb20(0x19a)+_0x62594a),console[_0x29cb20(0x1ac)](''),console[_0x29cb20(0x1ac)](_0x29cb20(0x198)),console['error'](_0x29cb20(0x1a5)));return 0x0;}catch(_0x3d0b21){throw _0x3d0b21;}}}
1
+ const a25_0x3a78cc=a25_0x1867;(function(_0x35027e,_0x291182){const _0x23630d=a25_0x1867,_0x539128=_0x35027e();while(!![]){try{const _0x4dd3d0=parseInt(_0x23630d(0x1a3))/0x1*(parseInt(_0x23630d(0x1a4))/0x2)+-parseInt(_0x23630d(0x193))/0x3*(-parseInt(_0x23630d(0x1a2))/0x4)+parseInt(_0x23630d(0x19f))/0x5*(parseInt(_0x23630d(0x195))/0x6)+-parseInt(_0x23630d(0x190))/0x7*(-parseInt(_0x23630d(0x19d))/0x8)+parseInt(_0x23630d(0x1a1))/0x9+-parseInt(_0x23630d(0x196))/0xa+-parseInt(_0x23630d(0x18f))/0xb*(parseInt(_0x23630d(0x18c))/0xc);if(_0x4dd3d0===_0x291182)break;else _0x539128['push'](_0x539128['shift']());}catch(_0x2191ba){_0x539128['push'](_0x539128['shift']());}}}(a25_0x4f58,0x23f63));import{BaseCommand}from'./command.js';function a25_0x4f58(){const _0x5cf978=['4bLKFYm','46ImTToS','8434Rhulyo','name','89748iYKgyd','segmentPath','jsonl','1111AAraFw','1077209gMqczh','json','Show\x20current\x20segment/folder\x20context','392613yQpKka','error','1340634dcoZVg','48340tJGTkQ','format','execute','stringify','verbose','Context\x20details:','log','8driAAj','description','5LDdQaz','\x20\x20Path:\x20','1847997NoSfbn'];a25_0x4f58=function(){return _0x5cf978;};return a25_0x4f58();}function a25_0x1867(_0x4f2f06,_0x33f80f){const _0x4f5848=a25_0x4f58();return a25_0x1867=function(_0x186755,_0x31d83b){_0x186755=_0x186755-0x18c;let _0x2bdb64=_0x4f5848[_0x186755];return _0x2bdb64;},a25_0x1867(_0x4f2f06,_0x33f80f);}export class SegmentPwdCommand extends BaseCommand{[a25_0x3a78cc(0x1a5)]='segment:pwd';[a25_0x3a78cc(0x19e)]=a25_0x3a78cc(0x192);async[a25_0x3a78cc(0x198)](_0x4ad7d6){const _0x5e3ab3=a25_0x3a78cc,{options:_0x39d0a1}=_0x4ad7d6;try{const _0x2bd4f0=_0x39d0a1[_0x5e3ab3(0x18d)];if(!_0x2bd4f0)return _0x39d0a1[_0x5e3ab3(0x197)]==='json'||_0x39d0a1[_0x5e3ab3(0x197)]===_0x5e3ab3(0x18e)?console[_0x5e3ab3(0x19c)](JSON['stringify']({'path':'/','type':'root'})):console['log']('/'),0x0;if(_0x39d0a1[_0x5e3ab3(0x197)]===_0x5e3ab3(0x191)||_0x39d0a1[_0x5e3ab3(0x197)]===_0x5e3ab3(0x18e)){const _0x4a5aec={'path':_0x2bd4f0};console[_0x5e3ab3(0x19c)](JSON[_0x5e3ab3(0x199)](_0x4a5aec));}else console[_0x5e3ab3(0x19c)](_0x2bd4f0),_0x39d0a1[_0x5e3ab3(0x19a)]&&(console[_0x5e3ab3(0x194)](''),console[_0x5e3ab3(0x194)](_0x5e3ab3(0x19b)),console[_0x5e3ab3(0x194)](_0x5e3ab3(0x1a0)+_0x2bd4f0),console['error'](''),console[_0x5e3ab3(0x194)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x5e3ab3(0x194)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x26f9f2){throw _0x26f9f2;}}}
@@ -1 +1 @@
1
- const a26_0x156149=a26_0x4e2e;(function(_0x2cba2b,_0x167b05){const _0x2ca9c3=a26_0x4e2e,_0x18776c=_0x2cba2b();while(!![]){try{const _0x465fe0=parseInt(_0x2ca9c3(0x146))/0x1*(parseInt(_0x2ca9c3(0x142))/0x2)+-parseInt(_0x2ca9c3(0x14a))/0x3+parseInt(_0x2ca9c3(0x14c))/0x4+-parseInt(_0x2ca9c3(0x13e))/0x5*(parseInt(_0x2ca9c3(0x15d))/0x6)+parseInt(_0x2ca9c3(0x143))/0x7*(-parseInt(_0x2ca9c3(0x160))/0x8)+parseInt(_0x2ca9c3(0x151))/0x9+parseInt(_0x2ca9c3(0x153))/0xa;if(_0x465fe0===_0x167b05)break;else _0x18776c['push'](_0x18776c['shift']());}catch(_0x3d1a33){_0x18776c['push'](_0x18776c['shift']());}}}(a26_0x124a,0xc8f1a));import{BaseCommand}from'./command.js';function a26_0x124a(){const _0x1c0746=['INTERNAL','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','rule','2223775aUMCho','error','type','segmentPath','6URGnWO','2115239OVNCAZ','Resolved\x20folder\x20ID:\x20','Resolving\x20path\x20\x27','50001tcWHhz','Update\x20existing\x20child\x20segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Updating\x20segment\x20\x27','790503TytEKK','kind','661128HqTwYn','description','resolvePathToResource','ruleFile','data','5175729sbVHeg','length','9431330AXNSkK','Error:\x20Cannot\x20update\x20','Examples:','verbose','segment:update','Segment\x20ID:\x20','folder','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolved\x20type:\x20','segment','6KNQzxz','name','segmentName','8htSRGt','Resolving\x20folder\x20\x27','parentId','updateSegmentById','segmentId','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x27...'];a26_0x124a=function(){return _0x1c0746;};return a26_0x124a();}function a26_0x4e2e(_0x3f0c31,_0x2623b4){const _0x124ae5=a26_0x124a();return a26_0x4e2e=function(_0x4e2e53,_0x2b5960){_0x4e2e53=_0x4e2e53-0x137;let _0x25f2eb=_0x124ae5[_0x4e2e53];return _0x25f2eb;},a26_0x4e2e(_0x3f0c31,_0x2623b4);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x156149(0x15e)]=a26_0x156149(0x157);[a26_0x156149(0x14d)]=a26_0x156149(0x147);async['execute'](_0x4466f8){const _0x1d50b0=a26_0x156149,{options:_0x514ca1,args:_0x5f0dd2,tdx:_0x341869}=_0x4466f8,_0x196808=_0x514ca1;if(_0x5f0dd2[_0x1d50b0(0x152)]===0x0)return console[_0x1d50b0(0x13f)](_0x1d50b0(0x148)),console['error'](_0x1d50b0(0x138)),console[_0x1d50b0(0x13f)](_0x1d50b0(0x155)),console[_0x1d50b0(0x13f)](_0x1d50b0(0x13c)),console[_0x1d50b0(0x13f)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x19d515=_0x5f0dd2[0x0],_0x49412a=_0x514ca1[_0x1d50b0(0x141)];let _0x36c5a4=_0x19d515;_0x49412a&&!_0x19d515['includes']('/')&&(_0x36c5a4=_0x49412a+'/'+_0x19d515,_0x196808[_0x1d50b0(0x156)]&&console[_0x1d50b0(0x13f)](_0x1d50b0(0x13b)+_0x36c5a4));const _0x6a6e5d=await withSpinner(_0x1d50b0(0x145)+_0x36c5a4+_0x1d50b0(0x139),()=>_0x341869[_0x1d50b0(0x15c)][_0x1d50b0(0x14e)](_0x36c5a4),{'verbose':_0x196808['verbose']}),_0xf14ed6=_0x6a6e5d[_0x1d50b0(0x150)];_0x196808[_0x1d50b0(0x156)]&&console['error'](_0x1d50b0(0x15b)+_0xf14ed6[_0x1d50b0(0x140)]);if(_0xf14ed6[_0x1d50b0(0x140)]!==_0x1d50b0(0x15c))return console['error'](_0x1d50b0(0x154)+_0xf14ed6[_0x1d50b0(0x140)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x1d50b0(0x13f)](_0x1d50b0(0x15a)),0x1;if(!_0xf14ed6[_0x1d50b0(0x137)])throw new SDKError(ErrorCode[_0x1d50b0(0x13a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x32e91e=_0xf14ed6[_0x1d50b0(0x162)],_0x104c3e=_0xf14ed6[_0x1d50b0(0x137)];_0x196808['verbose']&&(console[_0x1d50b0(0x13f)]('Parent\x20ID:\x20'+_0x32e91e),console[_0x1d50b0(0x13f)](_0x1d50b0(0x158)+_0x104c3e));let _0x24a484;if(_0x196808[_0x1d50b0(0x159)]){const _0x69d2eb=_0x196808['folder'],_0x1b82b1=await withSpinner(_0x1d50b0(0x161)+_0x69d2eb+'\x27...',()=>_0x341869[_0x1d50b0(0x15c)]['resolveFolderId'](_0x32e91e,_0x69d2eb),{'verbose':_0x196808[_0x1d50b0(0x156)]});_0x24a484=parseInt(_0x1b82b1[_0x1d50b0(0x150)],0xa),_0x196808[_0x1d50b0(0x156)]&&console['error'](_0x1d50b0(0x144)+_0x24a484);}const _0x4ac034=await loadJSONFromOptions(_0x196808[_0x1d50b0(0x13d)],_0x196808[_0x1d50b0(0x14f)]),_0x2801ca={'name':_0x196808[_0x1d50b0(0x15e)],'description':_0x196808[_0x1d50b0(0x14d)],'rule':_0x4ac034,'kind':_0x196808['kind']!==undefined?parseInt(_0x196808[_0x1d50b0(0x14b)],0xa):undefined,'segmentFolderId':_0x24a484},_0x12635d=await withSpinner(_0x1d50b0(0x149)+_0xf14ed6[_0x1d50b0(0x15f)]+_0x1d50b0(0x139),()=>_0x341869['segment'][_0x1d50b0(0x163)](_0x32e91e,_0x104c3e,_0x2801ca),{'verbose':_0x196808['verbose']}),_0x129961=_0x12635d['data'];return console[_0x1d50b0(0x13f)]('✔\x20Updated\x20segment\x20\x27'+_0x129961[_0x1d50b0(0x15e)]+'\x27'),_0x36c5a4!==_0x19d515&&console[_0x1d50b0(0x13f)]('\x20\x20\x20Path:\x20'+_0x36c5a4),await handleSDKOutput([_0x129961],_0x196808),0x0;}}
1
+ const a26_0x52befe=a26_0x3420;function a26_0x3420(_0xf5d057,_0x36a1fe){const _0x49abf7=a26_0x49ab();return a26_0x3420=function(_0x342046,_0x187542){_0x342046=_0x342046-0x1bb;let _0x1f08f9=_0x49abf7[_0x342046];return _0x1f08f9;},a26_0x3420(_0xf5d057,_0x36a1fe);}(function(_0x48dff0,_0x996baa){const _0x4a3353=a26_0x3420,_0x42d448=_0x48dff0();while(!![]){try{const _0x5e8947=parseInt(_0x4a3353(0x1d9))/0x1+-parseInt(_0x4a3353(0x1e5))/0x2+parseInt(_0x4a3353(0x1bd))/0x3+-parseInt(_0x4a3353(0x1c7))/0x4*(-parseInt(_0x4a3353(0x1d1))/0x5)+-parseInt(_0x4a3353(0x1c8))/0x6+parseInt(_0x4a3353(0x1dd))/0x7+-parseInt(_0x4a3353(0x1c2))/0x8;if(_0x5e8947===_0x996baa)break;else _0x42d448['push'](_0x42d448['shift']());}catch(_0x355f93){_0x42d448['push'](_0x42d448['shift']());}}}(a26_0x49ab,0x383ab));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0x49ab(){const _0x2df24a=['Resolved\x20folder\x20ID:\x20','Resolving\x20folder\x20\x27','ruleFile','type','Parent\x20ID:\x20','857335DvTtCM','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','segment','Examples:','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','166220SLuLuv','\x27...','\x20\x20\x20Path:\x20','parentId','606263omQCbQ','error','segmentId','folder','segmentPath','length','kind','Updating\x20segment\x20\x27','232858zcsqHB','Resolved\x20relative\x20path\x20to:\x20','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1026090AHbJIB','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','2706184xkdNWS','resolvePathToResource','name','data','description','8nFbOQn','1516656cLwgHV','Segment\x20ID\x20missing\x20from\x20resolved\x20path','updateSegmentById','Error:\x20Cannot\x20update\x20'];a26_0x49ab=function(){return _0x2df24a;};return a26_0x49ab();}export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a26_0x52befe(0x1c6)]='Update\x20existing\x20child\x20segment';async[a26_0x52befe(0x1c1)](_0x91471b){const _0x5534b5=a26_0x52befe,{options:_0x273776,args:_0x853bb4,tdx:_0x5d3971}=_0x91471b,_0x1d21b2=_0x273776;if(_0x853bb4[_0x5534b5(0x1e2)]===0x0)return console[_0x5534b5(0x1de)](_0x5534b5(0x1be)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d2)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d6)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d4)),console[_0x5534b5(0x1de)](_0x5534b5(0x1c0)),0x1;const _0x55e0e1=_0x853bb4[0x0],_0x33553=_0x273776[_0x5534b5(0x1e1)];let _0x88cb5e=_0x55e0e1;_0x33553&&!_0x55e0e1['includes']('/')&&(_0x88cb5e=_0x33553+'/'+_0x55e0e1,_0x1d21b2[_0x5534b5(0x1d3)]&&console[_0x5534b5(0x1de)](_0x5534b5(0x1bb)+_0x88cb5e));const _0x3ec8ce=await withSpinner(_0x5534b5(0x1d8)+_0x88cb5e+_0x5534b5(0x1da),()=>_0x5d3971[_0x5534b5(0x1d5)][_0x5534b5(0x1c3)](_0x88cb5e),{'verbose':_0x1d21b2['verbose']}),_0x7c58b4=_0x3ec8ce[_0x5534b5(0x1c5)];_0x1d21b2[_0x5534b5(0x1d3)]&&console[_0x5534b5(0x1de)](_0x5534b5(0x1bf)+_0x7c58b4[_0x5534b5(0x1cf)]);if(_0x7c58b4[_0x5534b5(0x1cf)]!==_0x5534b5(0x1d5))return console['error'](_0x5534b5(0x1cb)+_0x7c58b4['type']+_0x5534b5(0x1bc)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d7)),0x1;if(!_0x7c58b4[_0x5534b5(0x1df)])throw new SDKError(ErrorCode['INTERNAL'],_0x5534b5(0x1c9));const _0x2ef99d=_0x7c58b4[_0x5534b5(0x1dc)],_0x2682a0=_0x7c58b4['segmentId'];_0x1d21b2[_0x5534b5(0x1d3)]&&(console[_0x5534b5(0x1de)](_0x5534b5(0x1d0)+_0x2ef99d),console[_0x5534b5(0x1de)]('Segment\x20ID:\x20'+_0x2682a0));let _0x129921;if(_0x1d21b2[_0x5534b5(0x1e0)]){const _0x44b224=_0x1d21b2[_0x5534b5(0x1e0)],_0x2eee0e=await withSpinner(_0x5534b5(0x1cd)+_0x44b224+'\x27...',()=>_0x5d3971[_0x5534b5(0x1d5)]['resolveFolderId'](_0x2ef99d,_0x44b224),{'verbose':_0x1d21b2[_0x5534b5(0x1d3)]});_0x129921=parseInt(_0x2eee0e[_0x5534b5(0x1c5)],0xa),_0x1d21b2[_0x5534b5(0x1d3)]&&console['error'](_0x5534b5(0x1cc)+_0x129921);}const _0x43f0eb=await loadJSONFromOptions(_0x1d21b2['rule'],_0x1d21b2[_0x5534b5(0x1ce)]),_0x4c01d2={'name':_0x1d21b2[_0x5534b5(0x1c4)],'description':_0x1d21b2[_0x5534b5(0x1c6)],'rule':_0x43f0eb,'kind':_0x1d21b2[_0x5534b5(0x1e3)]!==undefined?parseInt(_0x1d21b2['kind'],0xa):undefined,'segmentFolderId':_0x129921},_0x39a9d8=await withSpinner(_0x5534b5(0x1e4)+_0x7c58b4['segmentName']+_0x5534b5(0x1da),()=>_0x5d3971[_0x5534b5(0x1d5)][_0x5534b5(0x1ca)](_0x2ef99d,_0x2682a0,_0x4c01d2),{'verbose':_0x1d21b2[_0x5534b5(0x1d3)]}),_0x53bacd=_0x39a9d8[_0x5534b5(0x1c5)];return console[_0x5534b5(0x1de)]('✔\x20Updated\x20segment\x20\x27'+_0x53bacd[_0x5534b5(0x1c4)]+'\x27'),_0x88cb5e!==_0x55e0e1&&console[_0x5534b5(0x1de)](_0x5534b5(0x1db)+_0x88cb5e),await handleSDKOutput([_0x53bacd],_0x1d21b2),0x0;}}