@treasuredata/tdx 0.2.8 → 0.3.0

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 (111) hide show
  1. package/README.md +71 -11
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli.js +1 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/client/cdp-client.js +1 -1
  6. package/dist/client/http-client.js +1 -1
  7. package/dist/client/http-client.js.map +1 -1
  8. package/dist/client/llm-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-client.d.ts +9 -1
  11. package/dist/client/td-client.d.ts.map +1 -1
  12. package/dist/client/td-client.js +1 -1
  13. package/dist/client/td-client.js.map +1 -1
  14. package/dist/client/trino-client.js +1 -1
  15. package/dist/client/workflow-client.js +1 -1
  16. package/dist/commands/activations.js +1 -1
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.d.ts +23 -0
  19. package/dist/commands/auth-command.d.ts.map +1 -0
  20. package/dist/commands/auth-command.js +1 -0
  21. package/dist/commands/auth-command.js.map +1 -0
  22. package/dist/commands/chat-command.js +1 -1
  23. package/dist/commands/claude-command.js +1 -1
  24. package/dist/commands/command.d.ts.map +1 -1
  25. package/dist/commands/command.js +1 -1
  26. package/dist/commands/command.js.map +1 -1
  27. package/dist/commands/context-command.js +1 -1
  28. package/dist/commands/databases.js +1 -1
  29. package/dist/commands/describe.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pwd-command.js +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.d.ts +13 -2
  49. package/dist/core/config.d.ts.map +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/config.js.map +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/profile.d.ts +8 -1
  54. package/dist/core/profile.d.ts.map +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/profile.js.map +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  61. package/dist/proxy/anthropic-adapter.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js.map +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/database.js +1 -1
  67. package/dist/sdk/errors.js +1 -1
  68. package/dist/sdk/index.d.ts +6 -5
  69. package/dist/sdk/index.d.ts.map +1 -1
  70. package/dist/sdk/index.js +1 -1
  71. package/dist/sdk/index.js.map +1 -1
  72. package/dist/sdk/job.js +1 -1
  73. package/dist/sdk/llm.js +1 -1
  74. package/dist/sdk/query.js +1 -1
  75. package/dist/sdk/segment.js +1 -1
  76. package/dist/sdk/table.js +1 -1
  77. package/dist/sdk/workflow.js +1 -1
  78. package/dist/types/endpoints.d.ts +12 -0
  79. package/dist/types/endpoints.d.ts.map +1 -1
  80. package/dist/types/endpoints.js +1 -1
  81. package/dist/types/endpoints.js.map +1 -1
  82. package/dist/types/index.d.ts +17 -0
  83. package/dist/types/index.d.ts.map +1 -1
  84. package/dist/types/index.js +1 -1
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/utils/agent-ref-parser.js +1 -1
  87. package/dist/utils/chat-cache.js +1 -1
  88. package/dist/utils/colors.js +1 -1
  89. package/dist/utils/command-output.js +1 -1
  90. package/dist/utils/constants.js +1 -1
  91. package/dist/utils/file-permissions.js +1 -1
  92. package/dist/utils/format-detector.js +1 -1
  93. package/dist/utils/formatters.js +1 -1
  94. package/dist/utils/json-loader.js +1 -1
  95. package/dist/utils/model-aliases.js +1 -1
  96. package/dist/utils/option-validation.js +1 -1
  97. package/dist/utils/port.js +1 -1
  98. package/dist/utils/process.js +1 -1
  99. package/dist/utils/prompt.js +1 -1
  100. package/dist/utils/segment-path-parser.js +1 -1
  101. package/dist/utils/segment-ref-parser.js +1 -1
  102. package/dist/utils/spinner.js +1 -1
  103. package/dist/utils/sql-parser.js +1 -1
  104. package/dist/utils/sse-parser.js +1 -1
  105. package/dist/utils/string-utils.js +1 -1
  106. package/dist/utils/table-ref-parser.js +1 -1
  107. package/dist/utils/tdx-logger.js +1 -1
  108. package/dist/utils/tree-formatter.js +1 -1
  109. package/dist/utils/version-check.js +1 -1
  110. package/dist/utils/workflow-utils.js +1 -1
  111. package/package.json +3 -1
@@ -1 +1 @@
1
- const a17_0x100729=a17_0x19a6;(function(_0x14ff27,_0x42ba5d){const _0x2feb82=a17_0x19a6,_0x233ed3=_0x14ff27();while(!![]){try{const _0x5dcc42=-parseInt(_0x2feb82(0x202))/0x1*(-parseInt(_0x2feb82(0x1a6))/0x2)+parseInt(_0x2feb82(0x18a))/0x3*(-parseInt(_0x2feb82(0x18f))/0x4)+-parseInt(_0x2feb82(0x1d1))/0x5+parseInt(_0x2feb82(0x1fb))/0x6*(parseInt(_0x2feb82(0x1a9))/0x7)+-parseInt(_0x2feb82(0x1ee))/0x8*(-parseInt(_0x2feb82(0x1fa))/0x9)+parseInt(_0x2feb82(0x197))/0xa+parseInt(_0x2feb82(0x1b5))/0xb;if(_0x5dcc42===_0x42ba5d)break;else _0x233ed3['push'](_0x233ed3['shift']());}catch(_0x5d4a04){_0x233ed3['push'](_0x233ed3['shift']());}}}(a17_0x44db,0xdd5ae));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function handleSDKError(_0x4623c3,_0x4bfb28){const _0x1a8aeb=a17_0x19a6;if(_0x4623c3 instanceof SDKError)console[_0x1a8aeb(0x1ff)](_0x1a8aeb(0x1a2)+_0x4623c3['message']),_0x4bfb28[_0x1a8aeb(0x1d3)]&&(_0x4623c3[_0x1a8aeb(0x1fd)]&&console['error']('\x20\x20Cause:\x20'+_0x4623c3[_0x1a8aeb(0x1fd)]),_0x4623c3[_0x1a8aeb(0x1f1)]&&(console[_0x1a8aeb(0x1ff)](_0x1a8aeb(0x1fc)),console[_0x1a8aeb(0x1ff)](_0x4623c3['stack'])));else throw _0x4623c3;}function a17_0x19a6(_0x56c40c,_0x29d2b1){const _0x44db37=a17_0x44db();return a17_0x19a6=function(_0x19a653,_0x3fd8b4){_0x19a653=_0x19a653-0x16a;let _0x1db5f3=_0x44db37[_0x19a653];return _0x1db5f3;},a17_0x19a6(_0x56c40c,_0x29d2b1);}function formatChatHistoryEntry(_0x246db0,_0x4efbb0){const _0x3595f9=a17_0x19a6,_0x57bddd=getChalk(_0x4efbb0),_0x419aaf=_0x57bddd[_0x3595f9(0x1c5)](_0x246db0['at']);if('input'in _0x246db0){const _0x43f088=_0x57bddd[_0x3595f9(0x1fe)](_0x3595f9(0x171));return _0x419aaf+'\x20'+_0x43f088+':\x20'+_0x246db0[_0x3595f9(0x1db)];}if('content'in _0x246db0){const _0x5cea4c=_0x57bddd[_0x3595f9(0x1d5)](_0x3595f9(0x1bc));return _0x419aaf+'\x20'+_0x5cea4c+':\x20'+_0x246db0[_0x3595f9(0x19c)];}if(_0x3595f9(0x1f0)in _0x246db0){const _0x109ccd=_0x57bddd[_0x3595f9(0x19f)](_0x3595f9(0x1c3)),{functionName:_0x25cdcb,functionArguments:_0x45a787,targetFunction:_0x308369}=_0x246db0[_0x3595f9(0x1f0)];let _0x123c48=_0x419aaf+'\x20'+_0x109ccd+':\x20'+_0x57bddd[_0x3595f9(0x200)](_0x25cdcb);if(_0x45a787&&Object[_0x3595f9(0x1c7)](_0x45a787)[_0x3595f9(0x1ab)]>0x0){const _0x4ea715=Object[_0x3595f9(0x1be)](_0x45a787)[_0x3595f9(0x18d)](([_0x304731,_0x260921])=>_0x304731+'='+JSON['stringify'](_0x260921))[_0x3595f9(0x1d6)](',\x20');_0x123c48+='('+_0x4ea715+')';}_0x308369&&(_0x123c48+=_0x57bddd['dim']('\x20['+_0x308369+']'));let _0x92c41b='';if(_0x246db0[_0x3595f9(0x1f0)][_0x3595f9(0x1cc)])_0x92c41b=_0x3595f9(0x1bb)+_0x246db0['tool_call'][_0x3595f9(0x1cc)]['name'];else{if(_0x246db0[_0x3595f9(0x1f0)][_0x3595f9(0x192)])_0x92c41b=_0x3595f9(0x1cd)+_0x246db0[_0x3595f9(0x1f0)]['targetAgent'][_0x3595f9(0x19b)];else{if(_0x246db0[_0x3595f9(0x1f0)][_0x3595f9(0x1e0)])_0x92c41b=_0x3595f9(0x170)+_0x246db0[_0x3595f9(0x1f0)]['targetWebSearchTool'][_0x3595f9(0x19b)];else _0x246db0[_0x3595f9(0x1f0)][_0x3595f9(0x1e4)]&&(_0x92c41b=_0x3595f9(0x1a8)+_0x246db0[_0x3595f9(0x1f0)][_0x3595f9(0x1e4)]['name']);}}return _0x123c48+_0x92c41b;}if(_0x3595f9(0x183)in _0x246db0){const _0x4ac554=_0x57bddd['magenta'](_0x3595f9(0x1ed)),{functionName:_0x3f9e56,functionArguments:_0x2e0122,content:_0x362b13,newChat:_0x22ba40}=_0x246db0[_0x3595f9(0x183)];let _0x5e1740=_0x419aaf+'\x20'+_0x4ac554+':\x20'+_0x57bddd['bold'](_0x3f9e56);if(_0x2e0122){const _0x5176ce=typeof _0x2e0122===_0x3595f9(0x1c9)?_0x2e0122:JSON['stringify'](_0x2e0122);_0x5e1740+='('+_0x5176ce+')';}return _0x362b13&&(_0x5e1740+='\x0a'+_0x57bddd['dim'](_0x362b13)),_0x22ba40&&(_0x5e1740+=_0x57bddd[_0x3595f9(0x1c5)](_0x3595f9(0x1ad)+_0x22ba40['id'])),_0x5e1740;}if(_0x3595f9(0x188)in _0x246db0){const _0x1bb421=_0x57bddd[_0x3595f9(0x17a)]('[output]\x20');return _0x419aaf+'\x20'+_0x1bb421+':\x20'+_0x246db0[_0x3595f9(0x188)][_0x3595f9(0x19b)]+'\x20('+_0x246db0[_0x3595f9(0x188)][_0x3595f9(0x19c)][_0x3595f9(0x1ab)]+_0x3595f9(0x1b3);}if(_0x3595f9(0x1cf)in _0x246db0){const _0x56df52=_0x57bddd['blue'](_0x3595f9(0x1ef)),{width:_0x5523a5,height:_0x2ff521,headerText:_0x2d069c}=_0x246db0[_0x3595f9(0x1cf)],_0xa1b9ff=_0x2d069c?_0x3595f9(0x16e)+_0x2d069c:'';return _0x419aaf+'\x20'+_0x56df52+':\x20'+_0x5523a5+'x'+_0x2ff521+_0xa1b9ff;}if('error'in _0x246db0){const _0x41bff5=_0x57bddd['red'](_0x3595f9(0x18c));return _0x419aaf+'\x20'+_0x41bff5+':\x20'+_0x246db0['error'];}return _0x419aaf+'\x20'+_0x57bddd[_0x3595f9(0x1c5)]('[unknown]')+':\x20'+JSON[_0x3595f9(0x186)](_0x246db0);}async function getProjectIdOrDefault(_0x53bdb8){const _0x540552=a17_0x19a6,{tdx:_0x4b9fa0,options:_0x843084}=_0x53bdb8,_0x45c251=_0x843084['llmProject'];if(_0x45c251){const _0x39db0b=await withSpinner('Resolving\x20project\x20\x27'+_0x45c251+_0x540552(0x1e5),()=>_0x4b9fa0[_0x540552(0x1a7)][_0x540552(0x1c8)](_0x45c251),{'verbose':_0x843084[_0x540552(0x1d3)]});return _0x39db0b['data'];}let _0x56f6c2=_0x4b9fa0[_0x540552(0x1a7)]['getCurrentProject']();if(_0x56f6c2)return _0x56f6c2;const _0x22665e=await withSpinner(_0x540552(0x1ec),()=>_0x4b9fa0[_0x540552(0x1a7)][_0x540552(0x178)](),{'verbose':_0x843084[_0x540552(0x1d3)]});return _0x22665e['data']['id'];}function toLLMProjectInfo(_0x3610bb){const _0x9a78c=a17_0x19a6;return{'name':_0x3610bb[_0x9a78c(0x16f)][_0x9a78c(0x19b)],'description':_0x3610bb[_0x9a78c(0x16f)][_0x9a78c(0x175)],'createdAt':_0x3610bb['attributes'][_0x9a78c(0x1b7)],'updatedAt':_0x3610bb[_0x9a78c(0x16f)]['updatedAt']};}function toAgentInfo(_0x379a7c){const _0x5517c1=a17_0x19a6;return{'name':_0x379a7c[_0x5517c1(0x16f)][_0x5517c1(0x19b)],'description':_0x379a7c['attributes'][_0x5517c1(0x175)],'prompt':truncatePrompt(_0x379a7c[_0x5517c1(0x16f)]['prompt']),'createdAt':_0x379a7c[_0x5517c1(0x16f)]['createdAt'],'updatedAt':_0x379a7c['attributes']['updatedAt']};}function truncatePrompt(_0x4e5bb8){const _0x4393aa=a17_0x19a6;if(!_0x4e5bb8)return undefined;const _0x5d311=0x64;if(_0x4e5bb8[_0x4393aa(0x1ab)]<=_0x5d311)return _0x4e5bb8;return _0x4e5bb8[_0x4393aa(0x1e3)](0x0,_0x5d311)+_0x4393aa(0x1b6);}export class LLMModelsCommand extends BaseCommand{[a17_0x100729(0x19b)]=a17_0x100729(0x180);[a17_0x100729(0x175)]=a17_0x100729(0x1e1);async[a17_0x100729(0x1b9)](_0x1d302c){const _0x50139b=a17_0x100729,{options:_0x54da5a,tdx:_0x29e928}=_0x1d302c;try{const _0x2c79af=await withSpinner(_0x50139b(0x182),()=>_0x29e928[_0x50139b(0x1a7)][_0x50139b(0x1f2)](),{'verbose':_0x54da5a[_0x50139b(0x1d3)]});return await handleSDKOutput(_0x2c79af[_0x50139b(0x1bd)],_0x54da5a),0x0;}catch(_0xe038ce){return handleSDKError(_0xe038ce,_0x54da5a),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0x100729(0x19b)]='llm:projects';[a17_0x100729(0x175)]='List\x20all\x20LLM\x20projects';async[a17_0x100729(0x1b9)](_0x150031){const _0x56b915=a17_0x100729,{options:_0x68a3cd,args:_0x4e543d,tdx:_0x54d1c5}=_0x150031;try{const _0x289cc3=_0x4e543d[0x0],_0x10c55d=resolveLimit(_0x68a3cd['limit'],DEFAULT_LLM_LIMIT),_0x50505d=await withSpinner(_0x56b915(0x1eb),()=>_0x54d1c5[_0x56b915(0x1a7)][_0x56b915(0x1dd)](_0x10c55d),{'verbose':_0x68a3cd['verbose']});let _0x11e227=_0x50505d['data'];_0x289cc3&&(_0x11e227=_0x50505d[_0x56b915(0x1bd)]['filter'](_0x2d497f=>matchGlobPattern(_0x2d497f[_0x56b915(0x16f)][_0x56b915(0x19b)],_0x289cc3)));const _0x35d044=_0x11e227[_0x56b915(0x18d)](toLLMProjectInfo);return await handleSDKOutput(_0x35d044,_0x68a3cd),0x0;}catch(_0x141a39){return handleSDKError(_0x141a39,_0x68a3cd),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x100729(0x19b)]=a17_0x100729(0x1de);[a17_0x100729(0x175)]=a17_0x100729(0x1c6);async[a17_0x100729(0x1b9)](_0x7a7c5d){const _0x39ba79=a17_0x100729,{options:_0x44ff23,args:_0x54fc9e,tdx:_0x2994fb}=_0x7a7c5d;try{const _0x496376=_0x54fc9e[0x0];let _0x1f1af4,_0x4e4961=_0x496376;if(_0x496376&&_0x496376[_0x39ba79(0x195)]('/')){const _0xd2419b=_0x496376[_0x39ba79(0x1ba)]('/');if(_0xd2419b[_0x39ba79(0x1ab)]===0x2){const [_0x3cbcfd,_0x559d74]=_0xd2419b,_0x56120e=await _0x2994fb[_0x39ba79(0x1a7)]['projects'](),_0x302b73=_0x56120e[_0x39ba79(0x19a)](_0x1dffd5=>_0x1dffd5['attributes'][_0x39ba79(0x19b)][_0x39ba79(0x198)]()===_0x3cbcfd[_0x39ba79(0x198)]());if(!_0x302b73)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x39ba79(0x1b2)+_0x3cbcfd,undefined,{'helpText':_0x39ba79(0x1f4)});_0x1f1af4=_0x302b73['id'],_0x4e4961=_0x559d74;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x39ba79(0x1bf)+_0x496376,undefined,{'helpText':_0x39ba79(0x179)});}else _0x1f1af4=await getProjectIdOrDefault(_0x7a7c5d);const _0x51eddd=await withSpinner(_0x39ba79(0x174),()=>_0x2994fb[_0x39ba79(0x1a7)][_0x39ba79(0x194)](_0x1f1af4),{'verbose':_0x44ff23['verbose']});let _0x5cd64b=_0x51eddd[_0x39ba79(0x1bd)];_0x4e4961&&(_0x5cd64b=_0x51eddd[_0x39ba79(0x1bd)][_0x39ba79(0x1a5)](_0x5aa2d0=>matchGlobPattern(_0x5aa2d0[_0x39ba79(0x16f)][_0x39ba79(0x19b)],_0x4e4961)));const _0x52f67a=_0x5cd64b[_0x39ba79(0x18d)](toAgentInfo);return await handleSDKOutput(_0x52f67a,_0x44ff23),0x0;}catch(_0x54dd3d){return handleSDKError(_0x54dd3d,_0x44ff23),0x1;}}}function a17_0x44db(){const _0x788e46=['green','join','(no\x20message)','agent','Deleting\x20agent...','json','input','temperature','projects','llm:agents','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','targetWebSearchTool','List\x20available\x20LLM\x20models','Update\x20an\x20existing\x20agent','slice','targetImageGenerator','\x27...','systemPrompt','Delete\x20an\x20LLM\x20project','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Error:\x20Agent\x20name\x20is\x20required','setCurrentProject','Fetching\x20projects...','Getting\x20default\x20project...','[tool]\x20\x20\x20','4415208AlvlaW','[image]\x20\x20','tool_call','stack','models','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Delete\x20an\x20agent','history','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Fetching\x20chat\x20sessions...','27PtfJCV','654cPfpaw','\x0aStack\x20trace:','cause','cyan','error','bold','Resolving\x20agent\x20\x27','22879ItBtav','Project\x20deleted:\x20','Deleting\x20project\x20\x27','Resolving\x20project\x20\x27','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','\x20-\x20','attributes','\x20->\x20WebSearch:','[input]\x20\x20','llm:agent:create','Create\x20a\x20new\x20LLM\x20project','Fetching\x20agents...','description','deleteAgent','jsonl','getOrCreateDefaultProject','Use\x20format:\x20project-name/agent-name','blue','llm:history','Fetching\x20most\x20recent\x20chat...','Fetching\x20chat\x20history\x20for\x20\x27','claude-4.5-haiku','Creating\x20project\x20\x27','llm:models','INVALID_ARGUMENT','Fetching\x20available\x20models...','tool','resolveAgentId','format','stringify','firstInputContent','output','Agent\x20created:\x20','3UkbQij','Creating\x20agent\x20\x27','[error]\x20\x20','map','last','5566964VVuiHA','createProject','maxToolIterations','targetAgent','Usage:\x20tdx\x20llm\x20history\x20--last','agents','includes','Agent\x20updated:\x20','5842010nbRFUl','toLowerCase','starterMessage','find','name','content','llm:project:delete','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','yellow','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','prompt','Error:\x20','Create\x20a\x20new\x20agent\x20in\x20current\x20project','llm:agent:update','filter','10syYNxP','llm','\x20->\x20ImageGen:','62993ztQePm','limit','length','Updating\x20agent...','\x20→\x20chat:\x20','llm:agent:show','Agent\x20deleted:\x20','Set\x20current\x20project\x20context','Error:\x20Project\x20name\x20is\x20required','Project\x20not\x20found:\x20','\x20bytes)','updateAgent','2817408IfjpJP','...','createdAt','chats','execute','split','\x20->\x20KB:','[content]','data','entries','Invalid\x20path\x20syntax:\x20','No\x20chat\x20sessions\x20found.','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','llm:use','[tool_call]','tsv','dim','List\x20agents\x20in\x20current\x20project','keys','resolveProjectId','string','Fetching\x20agent...','model','targetKnowledgeBase','\x20->\x20Agent:','log','image','No\x20messages\x20found\x20in\x20chat\x20history.','6464535iCNvWh','table','verbose','createAgent'];a17_0x44db=function(){return _0x788e46;};return a17_0x44db();}export class LLMAgentShowCommand extends BaseCommand{['name']=a17_0x100729(0x1ae);[a17_0x100729(0x175)]='Show\x20agent\x20details';async[a17_0x100729(0x1b9)](_0x140bac){const _0x3acf02=a17_0x100729,{options:_0x165b02,args:_0x396d38,tdx:_0x4063f4}=_0x140bac;if(_0x396d38[_0x3acf02(0x1ab)]===0x0)return console[_0x3acf02(0x1ff)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x3acf02(0x1f3)),0x1;const _0x52d3cf=_0x396d38[0x0];try{const _0x14c4eb=await getProjectIdOrDefault(_0x140bac),_0x3afe7e=await withSpinner(_0x3acf02(0x201)+_0x52d3cf+'\x27...',()=>_0x4063f4[_0x3acf02(0x1a7)]['resolveAgentId'](_0x52d3cf,_0x14c4eb),{'verbose':_0x165b02[_0x3acf02(0x1d3)]}),_0x268ab5=await withSpinner(_0x3acf02(0x1ca),()=>_0x4063f4[_0x3acf02(0x1a7)][_0x3acf02(0x1d8)](_0x3afe7e[_0x3acf02(0x1bd)]),{'verbose':_0x165b02['verbose']});return await handleSDKOutput([_0x268ab5[_0x3acf02(0x1bd)]],_0x165b02),0x0;}catch(_0x235097){return handleSDKError(_0x235097,_0x165b02),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a17_0x100729(0x172);[a17_0x100729(0x175)]=a17_0x100729(0x1a3);async[a17_0x100729(0x1b9)](_0x42d920){const _0x2f6a56=a17_0x100729,{options:_0x419fab,args:_0x43403d,tdx:_0x4c9d35}=_0x42d920;if(_0x43403d[_0x2f6a56(0x1ab)]===0x0)return console[_0x2f6a56(0x1ff)]('Error:\x20Agent\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console[_0x2f6a56(0x1ff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x15b66e=_0x43403d[0x0],_0x558f95=_0x419fab,_0xe4bdbf=_0x558f95[_0x2f6a56(0x1e6)],_0x114232=_0x558f95[_0x2f6a56(0x1cb)]||_0x2f6a56(0x17e),_0x14d23f=_0x558f95[_0x2f6a56(0x199)],_0x7f1522=_0x558f95[_0x2f6a56(0x191)]?Number(_0x558f95['maxToolIterations']):undefined,_0x706d5d=_0x558f95[_0x2f6a56(0x1dc)]?Number(_0x558f95[_0x2f6a56(0x1dc)]):undefined;try{let _0x57a48d,_0x34ea79;if(_0x15b66e['includes']('/')){const _0x5c7780=_0x15b66e['split']('/');if(_0x5c7780[_0x2f6a56(0x1ab)]===0x2){const [_0x407f9a,_0x53f0e5]=_0x5c7780,_0x4c9e03=await withSpinner(_0x2f6a56(0x16c)+_0x407f9a+_0x2f6a56(0x1e5),()=>_0x4c9d35[_0x2f6a56(0x1a7)]['resolveProjectId'](_0x407f9a),{'verbose':_0x419fab[_0x2f6a56(0x1d3)]});_0x57a48d=_0x4c9e03['data'],_0x34ea79=_0x53f0e5;}else throw new SDKError(ErrorCode[_0x2f6a56(0x181)],_0x2f6a56(0x1bf)+_0x15b66e,undefined,{'helpText':_0x2f6a56(0x179)});}else _0x57a48d=await getProjectIdOrDefault(_0x42d920),_0x34ea79=_0x15b66e;const _0xd832af=await withSpinner(_0x2f6a56(0x18b)+_0x34ea79+_0x2f6a56(0x1e5),()=>_0x4c9d35[_0x2f6a56(0x1a7)][_0x2f6a56(0x1d4)]({'name':_0x34ea79,'projectId':_0x57a48d,'modelType':_0x114232,'systemPrompt':_0xe4bdbf,'starterMessage':_0x14d23f,'maxToolIterations':_0x7f1522,'temperature':_0x706d5d}),{'verbose':_0x419fab[_0x2f6a56(0x1d3)]});return console['log'](_0x2f6a56(0x189)+_0xd832af['data']['id']),await handleSDKOutput([_0xd832af[_0x2f6a56(0x1bd)]],_0x419fab),0x0;}catch(_0x29c48d){return handleSDKError(_0x29c48d,_0x419fab),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x100729(0x19b)]=a17_0x100729(0x1a4);[a17_0x100729(0x175)]=a17_0x100729(0x1e2);async[a17_0x100729(0x1b9)](_0x430f12){const _0x1ca78a=a17_0x100729,{options:_0x5586ae,args:_0x413199,tdx:_0x44a9ff}=_0x430f12;if(_0x413199['length']===0x0)return console[_0x1ca78a(0x1ff)](_0x1ca78a(0x1e9)),console['error'](_0x1ca78a(0x1e8)),0x1;const _0x3ccc77=_0x413199[0x0],_0x5c5788=_0x5586ae,_0x49cf21=_0x5c5788[_0x1ca78a(0x19b)],_0x2cafa1=_0x5c5788[_0x1ca78a(0x1a1)],_0x547fa2=_0x5c5788[_0x1ca78a(0x175)],_0x4168ad=_0x5c5788[_0x1ca78a(0x199)];if(!_0x49cf21&&!_0x2cafa1&&!_0x547fa2&&!_0x4168ad)return console['error'](_0x1ca78a(0x1f8)),console[_0x1ca78a(0x1ff)](_0x1ca78a(0x19e)),0x1;try{const _0x3b2910=await getProjectIdOrDefault(_0x430f12),_0x55e525=await withSpinner('Resolving\x20agent\x20\x27'+_0x3ccc77+'\x27...',()=>_0x44a9ff[_0x1ca78a(0x1a7)][_0x1ca78a(0x184)](_0x3ccc77,_0x3b2910),{'verbose':_0x5586ae[_0x1ca78a(0x1d3)]}),_0x5c1231=_0x55e525[_0x1ca78a(0x1bd)],_0x226b05=await withSpinner(_0x1ca78a(0x1ac),()=>_0x44a9ff['llm'][_0x1ca78a(0x1b4)](_0x5c1231,{'name':_0x49cf21,'prompt':_0x2cafa1,'description':_0x547fa2,'starterMessage':_0x4168ad}),{'verbose':_0x5586ae[_0x1ca78a(0x1d3)]});return console[_0x1ca78a(0x1ce)](_0x1ca78a(0x196)+_0x226b05[_0x1ca78a(0x1bd)]['id']),await handleSDKOutput([_0x226b05['data']],_0x5586ae),0x0;}catch(_0x1e1f54){return handleSDKError(_0x1e1f54,_0x5586ae),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a17_0x100729(0x19b)]='llm:agent:delete';[a17_0x100729(0x175)]=a17_0x100729(0x1f6);async['execute'](_0x2f7245){const _0x446802=a17_0x100729,{options:_0x1f895d,args:_0x2ebde3,tdx:_0x4272db}=_0x2f7245;if(_0x2ebde3[_0x446802(0x1ab)]===0x0)return console[_0x446802(0x1ff)](_0x446802(0x1e9)),console[_0x446802(0x1ff)](_0x446802(0x1df)),0x1;const _0x18024f=_0x2ebde3[0x0];try{const _0x8b930f=await getProjectIdOrDefault(_0x2f7245),_0x34d9b4=await withSpinner(_0x446802(0x201)+_0x18024f+_0x446802(0x1e5),()=>_0x4272db['llm'][_0x446802(0x184)](_0x18024f,_0x8b930f),{'verbose':_0x1f895d['verbose']}),_0x29aefd=_0x34d9b4[_0x446802(0x1bd)];return await withSpinner(_0x446802(0x1d9),()=>_0x4272db[_0x446802(0x1a7)][_0x446802(0x176)](_0x29aefd),{'verbose':_0x1f895d['verbose']}),console['log'](_0x446802(0x1af)+_0x29aefd),0x0;}catch(_0x3e04b6){return handleSDKError(_0x3e04b6,_0x1f895d),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x100729(0x19b)]=a17_0x100729(0x17b);['description']=a17_0x100729(0x16d);async['execute'](_0x227b2b){const _0x40d5ae=a17_0x100729,{options:_0x158e58,args:_0x3803d7,tdx:_0x40c860}=_0x227b2b;let _0x5d8cdc=_0x3803d7[0x0];const _0x3ec580=_0x158e58,_0xe90fab=_0x3ec580[_0x40d5ae(0x18e)];try{if(_0xe90fab){if(_0x5d8cdc)return console[_0x40d5ae(0x1ff)](_0x40d5ae(0x1c1)),console[_0x40d5ae(0x1ff)](_0x40d5ae(0x193)),0x1;const _0x4210c1=await withSpinner(_0x40d5ae(0x17c),()=>_0x40c860[_0x40d5ae(0x1a7)][_0x40d5ae(0x1b8)](0x1),{'verbose':_0x158e58[_0x40d5ae(0x1d3)]});if(_0x4210c1[_0x40d5ae(0x1bd)][_0x40d5ae(0x1ab)]===0x0)return console['log'](_0x40d5ae(0x1c0)),0x0;_0x5d8cdc=_0x4210c1[_0x40d5ae(0x1bd)][0x0]['id'];}if(!_0x5d8cdc){const _0x4d3677=resolveLimit(_0x158e58[_0x40d5ae(0x1aa)],DEFAULT_LLM_LIMIT),_0x4e5d12=await withSpinner(_0x40d5ae(0x1f9),()=>_0x40c860[_0x40d5ae(0x1a7)][_0x40d5ae(0x1b8)](_0x4d3677),{'verbose':_0x158e58[_0x40d5ae(0x1d3)]});if(_0x158e58[_0x40d5ae(0x185)]==='json'||_0x158e58[_0x40d5ae(0x185)]===_0x40d5ae(0x177))await handleSDKOutput(_0x4e5d12[_0x40d5ae(0x1bd)],_0x158e58);else{const _0x4322c3=_0x4e5d12[_0x40d5ae(0x1bd)][_0x40d5ae(0x18d)](_0x2e1415=>({'created_at':_0x2e1415[_0x40d5ae(0x16f)][_0x40d5ae(0x1b7)],'chat_id':_0x2e1415['id'],'first_input':_0x2e1415[_0x40d5ae(0x16f)][_0x40d5ae(0x187)]||_0x40d5ae(0x1d7)}));await handleSDKOutput(_0x4322c3,_0x158e58);}return 0x0;}else{const _0x37814a=await withSpinner(_0x40d5ae(0x17d)+_0x5d8cdc+_0x40d5ae(0x1e5),()=>_0x40c860[_0x40d5ae(0x1a7)][_0x40d5ae(0x1f7)](_0x5d8cdc),{'verbose':_0x158e58[_0x40d5ae(0x1d3)]}),_0x26e8fc=_0x37814a['data']['data']??[];if(_0x26e8fc[_0x40d5ae(0x1ab)]===0x0)return console['log'](_0x40d5ae(0x1d0)),0x0;if(_0x158e58['format']===_0x40d5ae(0x1da)||_0x158e58[_0x40d5ae(0x185)]===_0x40d5ae(0x177)||_0x158e58[_0x40d5ae(0x185)]===_0x40d5ae(0x1d2)||_0x158e58[_0x40d5ae(0x185)]===_0x40d5ae(0x1c4))await handleSDKOutput(_0x26e8fc,_0x158e58);else for(const _0x1b040d of _0x26e8fc){console[_0x40d5ae(0x1ce)](formatChatHistoryEntry(_0x1b040d,_0x158e58));}return 0x0;}}catch(_0x1bda1f){return handleSDKError(_0x1bda1f,_0x158e58),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x100729(0x19b)]=a17_0x100729(0x1c2);['description']=a17_0x100729(0x1b0);async[a17_0x100729(0x1b9)](_0x2bf9b1){const _0x2e9f7d=a17_0x100729,{options:_0x27f8e5,args:_0x5f1f81,tdx:_0x40f17d}=_0x2bf9b1;if(_0x5f1f81[_0x2e9f7d(0x1ab)]===0x0)return console['error'](_0x2e9f7d(0x1b1)),console['error']('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x44498b=_0x5f1f81[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x44498b+_0x2e9f7d(0x1e5),()=>_0x40f17d[_0x2e9f7d(0x1a7)][_0x2e9f7d(0x1ea)](_0x44498b),{'verbose':_0x27f8e5['verbose']}),console[_0x2e9f7d(0x1ce)]('Project\x20context\x20set\x20to:\x20'+_0x44498b),0x0;}catch(_0x4b4c2c){return handleSDKError(_0x4b4c2c,_0x27f8e5),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a17_0x100729(0x19b)]='llm:project:create';[a17_0x100729(0x175)]=a17_0x100729(0x173);async[a17_0x100729(0x1b9)](_0x284c6c){const _0x482404=a17_0x100729,{options:_0xb1ba20,args:_0x28c53d,tdx:_0x43b9e7}=_0x284c6c;if(_0x28c53d[_0x482404(0x1ab)]===0x0)return console['error'](_0x482404(0x1b1)),console[_0x482404(0x1ff)](_0x482404(0x1a0)),0x1;const _0x2a845f=_0x28c53d[0x0],_0x35d937=_0xb1ba20,_0x1032c4=_0x35d937[_0x482404(0x175)];try{const _0x4131ac=await withSpinner(_0x482404(0x17f)+_0x2a845f+_0x482404(0x1e5),()=>_0x43b9e7[_0x482404(0x1a7)][_0x482404(0x190)]({'name':_0x2a845f,'description':_0x1032c4}),{'verbose':_0xb1ba20['verbose']});console[_0x482404(0x1ce)]('Project\x20created:\x20'+_0x4131ac[_0x482404(0x1bd)]['id']);const _0x13cd2f=toLLMProjectInfo(_0x4131ac['data']);return await handleSDKOutput([_0x13cd2f],_0xb1ba20),0x0;}catch(_0x1c92f3){return handleSDKError(_0x1c92f3,_0xb1ba20),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x100729(0x19b)]=a17_0x100729(0x19d);[a17_0x100729(0x175)]=a17_0x100729(0x1e7);async['execute'](_0x26ae67){const _0x22f443=a17_0x100729,{options:_0x4fcdfa,args:_0x1889ca,tdx:_0x1d98a6}=_0x26ae67;if(_0x1889ca['length']===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x22f443(0x1f5)),0x1;const _0x38e746=_0x1889ca[0x0];try{return await withSpinner(_0x22f443(0x16b)+_0x38e746+'\x27...',()=>_0x1d98a6[_0x22f443(0x1a7)]['deleteProject'](_0x38e746),{'verbose':_0x4fcdfa[_0x22f443(0x1d3)]}),console[_0x22f443(0x1ce)](_0x22f443(0x16a)+_0x38e746),0x0;}catch(_0x1bf849){return handleSDKError(_0x1bf849,_0x4fcdfa),0x1;}}}
1
+ const a18_0x210e91=a18_0x55e4;(function(_0x569ce9,_0x208e45){const _0x59bcc8=a18_0x55e4,_0x31f789=_0x569ce9();while(!![]){try{const _0x37e32b=parseInt(_0x59bcc8(0x184))/0x1+-parseInt(_0x59bcc8(0x1a7))/0x2+-parseInt(_0x59bcc8(0x193))/0x3+-parseInt(_0x59bcc8(0x19b))/0x4*(-parseInt(_0x59bcc8(0x13e))/0x5)+-parseInt(_0x59bcc8(0x1ad))/0x6*(-parseInt(_0x59bcc8(0x1b0))/0x7)+-parseInt(_0x59bcc8(0x187))/0x8*(parseInt(_0x59bcc8(0x11b))/0x9)+-parseInt(_0x59bcc8(0x17d))/0xa*(-parseInt(_0x59bcc8(0x174))/0xb);if(_0x37e32b===_0x208e45)break;else _0x31f789['push'](_0x31f789['shift']());}catch(_0x408cd5){_0x31f789['push'](_0x31f789['shift']());}}}(a18_0x49b7,0x7902e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';function a18_0x55e4(_0x21ff2c,_0xafba1f){const _0x49b700=a18_0x49b7();return a18_0x55e4=function(_0x55e486,_0x4b61df){_0x55e486=_0x55e486-0x11a;let _0x2e7432=_0x49b700[_0x55e486];return _0x2e7432;},a18_0x55e4(_0x21ff2c,_0xafba1f);}import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function handleSDKError(_0xbe611e,_0x43a736){const _0x4e4247=a18_0x55e4;if(_0xbe611e instanceof SDKError)console['error'](_0x4e4247(0x138)+_0xbe611e[_0x4e4247(0x15b)]),_0x43a736[_0x4e4247(0x147)]&&(_0xbe611e['cause']&&console[_0x4e4247(0x13d)](_0x4e4247(0x1ac)+_0xbe611e[_0x4e4247(0x180)]),_0xbe611e[_0x4e4247(0x14e)]&&(console[_0x4e4247(0x13d)]('\x0aStack\x20trace:'),console['error'](_0xbe611e[_0x4e4247(0x14e)])));else throw _0xbe611e;}function formatChatHistoryEntry(_0x4052d4,_0x513729){const _0x594b57=a18_0x55e4,_0x4dd53a=getChalk(_0x513729),_0x412586=_0x4dd53a['dim'](_0x4052d4['at']);if(_0x594b57(0x18d)in _0x4052d4){const _0xca575=_0x4dd53a[_0x594b57(0x155)](_0x594b57(0x165));return _0x412586+'\x20'+_0xca575+':\x20'+_0x4052d4[_0x594b57(0x18d)];}if('content'in _0x4052d4){const _0x19389c=_0x4dd53a[_0x594b57(0x159)]('[content]');return _0x412586+'\x20'+_0x19389c+':\x20'+_0x4052d4['content'];}if(_0x594b57(0x126)in _0x4052d4){const _0x33866c=_0x4dd53a[_0x594b57(0x156)]('[tool_call]'),{functionName:_0x45aadd,functionArguments:_0x4f05b6,targetFunction:_0x4f4c35}=_0x4052d4[_0x594b57(0x126)];let _0x775708=_0x412586+'\x20'+_0x33866c+':\x20'+_0x4dd53a[_0x594b57(0x125)](_0x45aadd);if(_0x4f05b6&&Object[_0x594b57(0x12c)](_0x4f05b6)[_0x594b57(0x189)]>0x0){const _0x2471d4=Object[_0x594b57(0x12a)](_0x4f05b6)[_0x594b57(0x197)](([_0x4213f4,_0x208318])=>_0x4213f4+'='+JSON[_0x594b57(0x17c)](_0x208318))['join'](',\x20');_0x775708+='('+_0x2471d4+')';}_0x4f4c35&&(_0x775708+=_0x4dd53a[_0x594b57(0x141)]('\x20['+_0x4f4c35+']'));let _0x41fdd9='';if(_0x4052d4['tool_call'][_0x594b57(0x162)])_0x41fdd9=_0x594b57(0x1af)+_0x4052d4[_0x594b57(0x126)][_0x594b57(0x162)]['name'];else{if(_0x4052d4[_0x594b57(0x126)][_0x594b57(0x133)])_0x41fdd9=_0x594b57(0x14d)+_0x4052d4[_0x594b57(0x126)][_0x594b57(0x133)][_0x594b57(0x161)];else{if(_0x4052d4[_0x594b57(0x126)][_0x594b57(0x1a3)])_0x41fdd9='\x20->\x20WebSearch:'+_0x4052d4[_0x594b57(0x126)]['targetWebSearchTool'][_0x594b57(0x161)];else _0x4052d4[_0x594b57(0x126)][_0x594b57(0x142)]&&(_0x41fdd9=_0x594b57(0x148)+_0x4052d4[_0x594b57(0x126)]['targetImageGenerator']['name']);}}return _0x775708+_0x41fdd9;}if(_0x594b57(0x136)in _0x4052d4){const _0x5687d3=_0x4dd53a['magenta'](_0x594b57(0x11d)),{functionName:_0x20754a,functionArguments:_0x206db7,content:_0x1cf47e,newChat:_0x801911}=_0x4052d4[_0x594b57(0x136)];let _0x404bce=_0x412586+'\x20'+_0x5687d3+':\x20'+_0x4dd53a[_0x594b57(0x125)](_0x20754a);if(_0x206db7){const _0x113b0e=typeof _0x206db7===_0x594b57(0x160)?_0x206db7:JSON[_0x594b57(0x17c)](_0x206db7);_0x404bce+='('+_0x113b0e+')';}return _0x1cf47e&&(_0x404bce+='\x0a'+_0x4dd53a[_0x594b57(0x141)](_0x1cf47e)),_0x801911&&(_0x404bce+=_0x4dd53a['dim']('\x20→\x20chat:\x20'+_0x801911['id'])),_0x404bce;}if(_0x594b57(0x167)in _0x4052d4){const _0x389de7=_0x4dd53a[_0x594b57(0x11e)](_0x594b57(0x12e));return _0x412586+'\x20'+_0x389de7+':\x20'+_0x4052d4[_0x594b57(0x167)][_0x594b57(0x161)]+'\x20('+_0x4052d4[_0x594b57(0x167)][_0x594b57(0x1a8)][_0x594b57(0x189)]+_0x594b57(0x172);}if(_0x594b57(0x182)in _0x4052d4){const _0x317dad=_0x4dd53a[_0x594b57(0x11e)](_0x594b57(0x17f)),{width:_0xb30c5e,height:_0x18043a,headerText:_0x2e0a52}=_0x4052d4['image'],_0x4a0cf2=_0x2e0a52?_0x594b57(0x135)+_0x2e0a52:'';return _0x412586+'\x20'+_0x317dad+':\x20'+_0xb30c5e+'x'+_0x18043a+_0x4a0cf2;}if('error'in _0x4052d4){const _0x320501=_0x4dd53a['red'](_0x594b57(0x1a2));return _0x412586+'\x20'+_0x320501+':\x20'+_0x4052d4[_0x594b57(0x13d)];}return _0x412586+'\x20'+_0x4dd53a[_0x594b57(0x141)](_0x594b57(0x132))+':\x20'+JSON[_0x594b57(0x17c)](_0x4052d4);}async function getProjectIdOrDefault(_0x5cf320){const _0x26ee5c=a18_0x55e4,{tdx:_0x59042f,options:_0x59c9d0}=_0x5cf320,_0x38cdab=_0x59c9d0[_0x26ee5c(0x127)];if(_0x38cdab){const _0x4cb479=await withSpinner(_0x26ee5c(0x14c)+_0x38cdab+'\x27...',()=>_0x59042f['llm'][_0x26ee5c(0x16e)](_0x38cdab),{'verbose':_0x59c9d0[_0x26ee5c(0x147)]});return _0x4cb479[_0x26ee5c(0x19d)];}let _0x3987be=_0x59042f[_0x26ee5c(0x1ae)][_0x26ee5c(0x168)]();if(_0x3987be)return _0x3987be;const _0x144e77=await withSpinner(_0x26ee5c(0x12d),()=>_0x59042f[_0x26ee5c(0x1ae)][_0x26ee5c(0x196)](),{'verbose':_0x59c9d0['verbose']});return _0x144e77[_0x26ee5c(0x19d)]['id'];}function toLLMProjectInfo(_0x230b4e){const _0x55bb7e=a18_0x55e4;return{'name':_0x230b4e[_0x55bb7e(0x140)][_0x55bb7e(0x161)],'description':_0x230b4e[_0x55bb7e(0x140)][_0x55bb7e(0x15c)],'createdAt':_0x230b4e[_0x55bb7e(0x140)][_0x55bb7e(0x191)],'updatedAt':_0x230b4e[_0x55bb7e(0x140)][_0x55bb7e(0x1a1)]};}function a18_0x49b7(){const _0x5bfb66=['cause','List\x20available\x20LLM\x20models','image','llm:projects','336302zOnISl','json','Agent\x20deleted:\x20','1405912PTlqqU','jsonl','length','llm:models','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','tsv','input','llm:agent:create','Use\x20format:\x20project-name/agent-name','Create\x20a\x20new\x20agent\x20in\x20current\x20project','createdAt','split','2481318TLoWai','table','firstInputContent','getOrCreateDefaultProject','map','format','model','Creating\x20project\x20\x27','16QFqTEO','log','data','agents','List\x20agents\x20in\x20current\x20project','Show\x20agent\x20details','updatedAt','[error]\x20\x20','targetWebSearchTool','llm:history','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','Fetching\x20projects...','1079674NvnVnC','content','Fetching\x20chat\x20history\x20for\x20\x27','temperature','...','\x20\x20Cause:\x20','3633318oszztL','llm','\x20->\x20KB:','7LMQedh','Fetching\x20most\x20recent\x20chat...','36khqQUN','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[tool]\x20\x20\x20','blue','Error:\x20Agent\x20name\x20is\x20required','Fetching\x20available\x20models...','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','find','prompt','Fetching\x20chat\x20sessions...','bold','tool_call','llmProject','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','entries','Error:\x20Project\x20name\x20is\x20required','keys','Getting\x20default\x20project...','[output]\x20','llm:project:create','includes','Set\x20current\x20project\x20context','[unknown]','targetAgent','Resolving\x20agent\x20\x27','\x20-\x20','tool','Setting\x20project\x20context\x20to\x20\x27','Error:\x20','createAgent','maxToolIterations','chats','agent','error','583870jujkmI','createProject','attributes','dim','targetImageGenerator','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','toLowerCase','verbose','\x20->\x20ImageGen:','Usage:\x20tdx\x20llm\x20use\x20<project-name>','(no\x20message)','Project\x20deleted:\x20','Resolving\x20project\x20\x27','\x20->\x20Agent:','stack','Agent\x20created:\x20','Update\x20an\x20existing\x20agent','Fetching\x20agent...','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Deleting\x20project\x20\x27','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','cyan','yellow','LLM_PROJECT_NOT_FOUND','setCurrentProject','green','starterMessage','message','description','updateAgent','llm:agents','deleteProject','string','name','targetKnowledgeBase','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Fetching\x20agents...','[input]\x20\x20','last','output','getCurrentProject','Delete\x20an\x20LLM\x20project','Invalid\x20path\x20syntax:\x20','models','Creating\x20agent\x20\x27','claude-4.5-haiku','resolveProjectId','INVALID_ARGUMENT','resolveAgentId','llm:agent:update','\x20bytes)','llm:agent:delete','62062fkVwRX','Project\x20created:\x20','\x27...','projects','Project\x20context\x20set\x20to:\x20','llm:use','execute','No\x20messages\x20found\x20in\x20chat\x20history.','stringify','2050RmwBtq','Updating\x20agent...','[image]\x20\x20'];a18_0x49b7=function(){return _0x5bfb66;};return a18_0x49b7();}function toAgentInfo(_0x36ea31){const _0x1d9f43=a18_0x55e4;return{'name':_0x36ea31[_0x1d9f43(0x140)][_0x1d9f43(0x161)],'description':_0x36ea31['attributes']['description'],'prompt':truncatePrompt(_0x36ea31['attributes'][_0x1d9f43(0x123)]),'createdAt':_0x36ea31[_0x1d9f43(0x140)]['createdAt'],'updatedAt':_0x36ea31[_0x1d9f43(0x140)][_0x1d9f43(0x1a1)]};}function truncatePrompt(_0x34e297){const _0x4bf652=a18_0x55e4;if(!_0x34e297)return undefined;const _0x467d53=0x64;if(_0x34e297[_0x4bf652(0x189)]<=_0x467d53)return _0x34e297;return _0x34e297['slice'](0x0,_0x467d53)+_0x4bf652(0x1ab);}export class LLMModelsCommand extends BaseCommand{['name']=a18_0x210e91(0x18a);[a18_0x210e91(0x15c)]=a18_0x210e91(0x181);async[a18_0x210e91(0x17a)](_0x4085e6){const _0x58da18=a18_0x210e91,{options:_0x431bfa,tdx:_0x14d630}=_0x4085e6;try{const _0x4e414f=await withSpinner(_0x58da18(0x120),()=>_0x14d630['llm'][_0x58da18(0x16b)](),{'verbose':_0x431bfa[_0x58da18(0x147)]});return await handleSDKOutput(_0x4e414f[_0x58da18(0x19d)],_0x431bfa),0x0;}catch(_0x190d28){return handleSDKError(_0x190d28,_0x431bfa),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a18_0x210e91(0x161)]=a18_0x210e91(0x183);[a18_0x210e91(0x15c)]='List\x20all\x20LLM\x20projects';async[a18_0x210e91(0x17a)](_0xf62dea){const _0x1ffaf2=a18_0x210e91,{options:_0x26bae4,args:_0x391924,tdx:_0x4a0bb5}=_0xf62dea;try{const _0x2211c1=_0x391924[0x0],_0x182dc8=resolveLimit(_0x26bae4['limit'],DEFAULT_LLM_LIMIT),_0x115bf3=await withSpinner(_0x1ffaf2(0x1a6),()=>_0x4a0bb5[_0x1ffaf2(0x1ae)][_0x1ffaf2(0x177)](_0x182dc8),{'verbose':_0x26bae4[_0x1ffaf2(0x147)]});let _0x588c8d=_0x115bf3['data'];_0x2211c1&&(_0x588c8d=_0x115bf3[_0x1ffaf2(0x19d)]['filter'](_0x280bc6=>matchGlobPattern(_0x280bc6[_0x1ffaf2(0x140)]['name'],_0x2211c1)));const _0x4cdca7=_0x588c8d['map'](toLLMProjectInfo);return await handleSDKOutput(_0x4cdca7,_0x26bae4),0x0;}catch(_0x3f8070){return handleSDKError(_0x3f8070,_0x26bae4),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a18_0x210e91(0x15e);['description']=a18_0x210e91(0x19f);async[a18_0x210e91(0x17a)](_0xc8b0c7){const _0x21d1c4=a18_0x210e91,{options:_0xb1613a,args:_0x249ca9,tdx:_0x44a043}=_0xc8b0c7;try{const _0x167de4=_0x249ca9[0x0];let _0x2c55e2,_0x1aaaaf=_0x167de4;if(_0x167de4&&_0x167de4[_0x21d1c4(0x130)]('/')){const _0x2bd0db=_0x167de4[_0x21d1c4(0x192)]('/');if(_0x2bd0db[_0x21d1c4(0x189)]===0x2){const [_0x30c504,_0x79e04a]=_0x2bd0db,_0xf0975b=await _0x44a043['llm'][_0x21d1c4(0x177)](),_0x2b2f41=_0xf0975b[_0x21d1c4(0x122)](_0x470d22=>_0x470d22['attributes']['name'][_0x21d1c4(0x146)]()===_0x30c504[_0x21d1c4(0x146)]());if(!_0x2b2f41)throw new SDKError(ErrorCode[_0x21d1c4(0x157)],'Project\x20not\x20found:\x20'+_0x30c504,undefined,{'helpText':_0x21d1c4(0x11c)});_0x2c55e2=_0x2b2f41['id'],_0x1aaaaf=_0x79e04a;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20path\x20syntax:\x20'+_0x167de4,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x2c55e2=await getProjectIdOrDefault(_0xc8b0c7);const _0x24a1bd=await withSpinner(_0x21d1c4(0x164),()=>_0x44a043[_0x21d1c4(0x1ae)][_0x21d1c4(0x19e)](_0x2c55e2),{'verbose':_0xb1613a[_0x21d1c4(0x147)]});let _0x47d5b3=_0x24a1bd[_0x21d1c4(0x19d)];_0x1aaaaf&&(_0x47d5b3=_0x24a1bd['data']['filter'](_0x2b79de=>matchGlobPattern(_0x2b79de[_0x21d1c4(0x140)][_0x21d1c4(0x161)],_0x1aaaaf)));const _0x49ee62=_0x47d5b3[_0x21d1c4(0x197)](toAgentInfo);return await handleSDKOutput(_0x49ee62,_0xb1613a),0x0;}catch(_0x48e0a4){return handleSDKError(_0x48e0a4,_0xb1613a),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a18_0x210e91(0x161)]='llm:agent:show';['description']=a18_0x210e91(0x1a0);async[a18_0x210e91(0x17a)](_0x35cd65){const _0x139b8b=a18_0x210e91,{options:_0x37d96f,args:_0x4d3c96,tdx:_0xdcd094}=_0x35cd65;if(_0x4d3c96[_0x139b8b(0x189)]===0x0)return console[_0x139b8b(0x13d)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x139b8b(0x13d)](_0x139b8b(0x163)),0x1;const _0x2a1253=_0x4d3c96[0x0];try{const _0x1d1bf1=await getProjectIdOrDefault(_0x35cd65),_0x214f07=await withSpinner('Resolving\x20agent\x20\x27'+_0x2a1253+_0x139b8b(0x176),()=>_0xdcd094[_0x139b8b(0x1ae)][_0x139b8b(0x170)](_0x2a1253,_0x1d1bf1),{'verbose':_0x37d96f[_0x139b8b(0x147)]}),_0x115cd5=await withSpinner(_0x139b8b(0x151),()=>_0xdcd094[_0x139b8b(0x1ae)][_0x139b8b(0x13c)](_0x214f07['data']),{'verbose':_0x37d96f[_0x139b8b(0x147)]});return await handleSDKOutput([_0x115cd5[_0x139b8b(0x19d)]],_0x37d96f),0x0;}catch(_0x1ed9ca){return handleSDKError(_0x1ed9ca,_0x37d96f),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a18_0x210e91(0x161)]=a18_0x210e91(0x18e);[a18_0x210e91(0x15c)]=a18_0x210e91(0x190);async[a18_0x210e91(0x17a)](_0x571b31){const _0x251f16=a18_0x210e91,{options:_0x27f91f,args:_0x363c5f,tdx:_0x529023}=_0x571b31;if(_0x363c5f[_0x251f16(0x189)]===0x0)return console[_0x251f16(0x13d)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x251f16(0x129)),console[_0x251f16(0x13d)](_0x251f16(0x145)),0x1;const _0x584ee0=_0x363c5f[0x0],_0x588ee7=_0x27f91f,_0x35c3e0=_0x588ee7['systemPrompt'],_0x54caf6=_0x588ee7[_0x251f16(0x199)]||_0x251f16(0x16d),_0x434e93=_0x588ee7[_0x251f16(0x15a)],_0x11f263=_0x588ee7[_0x251f16(0x13a)]?Number(_0x588ee7[_0x251f16(0x13a)]):undefined,_0x33aac5=_0x588ee7['temperature']?Number(_0x588ee7[_0x251f16(0x1aa)]):undefined;try{let _0x345e56,_0x1ba777;if(_0x584ee0[_0x251f16(0x130)]('/')){const _0x3c0af8=_0x584ee0[_0x251f16(0x192)]('/');if(_0x3c0af8[_0x251f16(0x189)]===0x2){const [_0x3553a1,_0x220e89]=_0x3c0af8,_0x4f7bf5=await withSpinner(_0x251f16(0x14c)+_0x3553a1+_0x251f16(0x176),()=>_0x529023[_0x251f16(0x1ae)][_0x251f16(0x16e)](_0x3553a1),{'verbose':_0x27f91f[_0x251f16(0x147)]});_0x345e56=_0x4f7bf5[_0x251f16(0x19d)],_0x1ba777=_0x220e89;}else throw new SDKError(ErrorCode[_0x251f16(0x16f)],_0x251f16(0x16a)+_0x584ee0,undefined,{'helpText':_0x251f16(0x18f)});}else _0x345e56=await getProjectIdOrDefault(_0x571b31),_0x1ba777=_0x584ee0;const _0x22536b=await withSpinner(_0x251f16(0x16c)+_0x1ba777+_0x251f16(0x176),()=>_0x529023['llm'][_0x251f16(0x139)]({'name':_0x1ba777,'projectId':_0x345e56,'modelType':_0x54caf6,'systemPrompt':_0x35c3e0,'starterMessage':_0x434e93,'maxToolIterations':_0x11f263,'temperature':_0x33aac5}),{'verbose':_0x27f91f[_0x251f16(0x147)]});return console[_0x251f16(0x19c)](_0x251f16(0x14f)+_0x22536b[_0x251f16(0x19d)]['id']),await handleSDKOutput([_0x22536b[_0x251f16(0x19d)]],_0x27f91f),0x0;}catch(_0x4f70e2){return handleSDKError(_0x4f70e2,_0x27f91f),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a18_0x210e91(0x161)]=a18_0x210e91(0x171);['description']=a18_0x210e91(0x150);async[a18_0x210e91(0x17a)](_0x51428a){const _0xfe0539=a18_0x210e91,{options:_0x26540b,args:_0x2a8980,tdx:_0x2d6157}=_0x51428a;if(_0x2a8980[_0xfe0539(0x189)]===0x0)return console[_0xfe0539(0x13d)](_0xfe0539(0x11f)),console[_0xfe0539(0x13d)](_0xfe0539(0x143)),0x1;const _0xa80dc8=_0x2a8980[0x0],_0x1df071=_0x26540b,_0x26d5d3=_0x1df071[_0xfe0539(0x161)],_0x321e0c=_0x1df071[_0xfe0539(0x123)],_0x441c9c=_0x1df071[_0xfe0539(0x15c)],_0xf8353a=_0x1df071[_0xfe0539(0x15a)];if(!_0x26d5d3&&!_0x321e0c&&!_0x441c9c&&!_0xf8353a)return console[_0xfe0539(0x13d)](_0xfe0539(0x121)),console['error'](_0xfe0539(0x18b)),0x1;try{const _0x8e25eb=await getProjectIdOrDefault(_0x51428a),_0x45d7a6=await withSpinner(_0xfe0539(0x134)+_0xa80dc8+_0xfe0539(0x176),()=>_0x2d6157[_0xfe0539(0x1ae)][_0xfe0539(0x170)](_0xa80dc8,_0x8e25eb),{'verbose':_0x26540b['verbose']}),_0x3a4753=_0x45d7a6[_0xfe0539(0x19d)],_0x4a97af=await withSpinner(_0xfe0539(0x17e),()=>_0x2d6157[_0xfe0539(0x1ae)][_0xfe0539(0x15d)](_0x3a4753,{'name':_0x26d5d3,'prompt':_0x321e0c,'description':_0x441c9c,'starterMessage':_0xf8353a}),{'verbose':_0x26540b[_0xfe0539(0x147)]});return console['log']('Agent\x20updated:\x20'+_0x4a97af['data']['id']),await handleSDKOutput([_0x4a97af[_0xfe0539(0x19d)]],_0x26540b),0x0;}catch(_0xe84e0){return handleSDKError(_0xe84e0,_0x26540b),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a18_0x210e91(0x161)]=a18_0x210e91(0x173);[a18_0x210e91(0x15c)]='Delete\x20an\x20agent';async[a18_0x210e91(0x17a)](_0x259320){const _0x52aec9=a18_0x210e91,{options:_0x465c0f,args:_0x252079,tdx:_0x5af437}=_0x259320;if(_0x252079[_0x52aec9(0x189)]===0x0)return console[_0x52aec9(0x13d)](_0x52aec9(0x11f)),console[_0x52aec9(0x13d)](_0x52aec9(0x1a5)),0x1;const _0x586a54=_0x252079[0x0];try{const _0x319abf=await getProjectIdOrDefault(_0x259320),_0x598137=await withSpinner(_0x52aec9(0x134)+_0x586a54+'\x27...',()=>_0x5af437['llm'][_0x52aec9(0x170)](_0x586a54,_0x319abf),{'verbose':_0x465c0f['verbose']}),_0x3ba31f=_0x598137[_0x52aec9(0x19d)];return await withSpinner('Deleting\x20agent...',()=>_0x5af437[_0x52aec9(0x1ae)]['deleteAgent'](_0x3ba31f),{'verbose':_0x465c0f['verbose']}),console[_0x52aec9(0x19c)](_0x52aec9(0x186)+_0x3ba31f),0x0;}catch(_0xd65032){return handleSDKError(_0xd65032,_0x465c0f),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a18_0x210e91(0x1a4);['description']=a18_0x210e91(0x154);async['execute'](_0x3df389){const _0x3b487e=a18_0x210e91,{options:_0x4c041d,args:_0x4a3d84,tdx:_0x5f9227}=_0x3df389;let _0x20b904=_0x4a3d84[0x0];const _0x583a6b=_0x4c041d,_0x114f90=_0x583a6b[_0x3b487e(0x166)];try{if(_0x114f90){if(_0x20b904)return console[_0x3b487e(0x13d)](_0x3b487e(0x152)),console[_0x3b487e(0x13d)]('Usage:\x20tdx\x20llm\x20history\x20--last'),0x1;const _0x1f2b7c=await withSpinner(_0x3b487e(0x11a),()=>_0x5f9227[_0x3b487e(0x1ae)][_0x3b487e(0x13b)](0x1),{'verbose':_0x4c041d[_0x3b487e(0x147)]});if(_0x1f2b7c[_0x3b487e(0x19d)][_0x3b487e(0x189)]===0x0)return console[_0x3b487e(0x19c)]('No\x20chat\x20sessions\x20found.'),0x0;_0x20b904=_0x1f2b7c['data'][0x0]['id'];}if(!_0x20b904){const _0x3b7d92=resolveLimit(_0x4c041d['limit'],DEFAULT_LLM_LIMIT),_0x169136=await withSpinner(_0x3b487e(0x124),()=>_0x5f9227[_0x3b487e(0x1ae)][_0x3b487e(0x13b)](_0x3b7d92),{'verbose':_0x4c041d[_0x3b487e(0x147)]});if(_0x4c041d[_0x3b487e(0x198)]==='json'||_0x4c041d[_0x3b487e(0x198)]===_0x3b487e(0x188))await handleSDKOutput(_0x169136['data'],_0x4c041d);else{const _0x319260=_0x169136['data']['map'](_0x40c113=>({'created_at':_0x40c113[_0x3b487e(0x140)][_0x3b487e(0x191)],'chat_id':_0x40c113['id'],'first_input':_0x40c113['attributes'][_0x3b487e(0x195)]||_0x3b487e(0x14a)}));await handleSDKOutput(_0x319260,_0x4c041d);}return 0x0;}else{const _0xe28fca=await withSpinner(_0x3b487e(0x1a9)+_0x20b904+'\x27...',()=>_0x5f9227[_0x3b487e(0x1ae)]['history'](_0x20b904),{'verbose':_0x4c041d[_0x3b487e(0x147)]}),_0x225f40=_0xe28fca[_0x3b487e(0x19d)][_0x3b487e(0x19d)]??[];if(_0x225f40[_0x3b487e(0x189)]===0x0)return console['log'](_0x3b487e(0x17b)),0x0;if(_0x4c041d['format']===_0x3b487e(0x185)||_0x4c041d[_0x3b487e(0x198)]===_0x3b487e(0x188)||_0x4c041d[_0x3b487e(0x198)]===_0x3b487e(0x194)||_0x4c041d[_0x3b487e(0x198)]===_0x3b487e(0x18c))await handleSDKOutput(_0x225f40,_0x4c041d);else for(const _0x128fe2 of _0x225f40){console['log'](formatChatHistoryEntry(_0x128fe2,_0x4c041d));}return 0x0;}}catch(_0x34e427){return handleSDKError(_0x34e427,_0x4c041d),0x1;}}}export class LLMUseCommand extends BaseCommand{[a18_0x210e91(0x161)]=a18_0x210e91(0x179);[a18_0x210e91(0x15c)]=a18_0x210e91(0x131);async['execute'](_0x1c9c83){const _0x18104d=a18_0x210e91,{options:_0x4e1b92,args:_0x1f2887,tdx:_0x77e7e}=_0x1c9c83;if(_0x1f2887['length']===0x0)return console[_0x18104d(0x13d)](_0x18104d(0x12b)),console[_0x18104d(0x13d)](_0x18104d(0x149)),0x1;const _0x405909=_0x1f2887[0x0];try{return await withSpinner(_0x18104d(0x137)+_0x405909+_0x18104d(0x176),()=>_0x77e7e['llm'][_0x18104d(0x158)](_0x405909),{'verbose':_0x4e1b92[_0x18104d(0x147)]}),console[_0x18104d(0x19c)](_0x18104d(0x178)+_0x405909),0x0;}catch(_0x16a2ea){return handleSDKError(_0x16a2ea,_0x4e1b92),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a18_0x210e91(0x161)]=a18_0x210e91(0x12f);[a18_0x210e91(0x15c)]='Create\x20a\x20new\x20LLM\x20project';async['execute'](_0x5d422e){const _0x44a7b9=a18_0x210e91,{options:_0x5e8c59,args:_0x492445,tdx:_0x4cd58c}=_0x5d422e;if(_0x492445[_0x44a7b9(0x189)]===0x0)return console['error'](_0x44a7b9(0x12b)),console[_0x44a7b9(0x13d)](_0x44a7b9(0x128)),0x1;const _0x5c7cf1=_0x492445[0x0],_0xd6119f=_0x5e8c59,_0x461e2b=_0xd6119f[_0x44a7b9(0x15c)];try{const _0x2fbca5=await withSpinner(_0x44a7b9(0x19a)+_0x5c7cf1+'\x27...',()=>_0x4cd58c[_0x44a7b9(0x1ae)][_0x44a7b9(0x13f)]({'name':_0x5c7cf1,'description':_0x461e2b}),{'verbose':_0x5e8c59[_0x44a7b9(0x147)]});console[_0x44a7b9(0x19c)](_0x44a7b9(0x175)+_0x2fbca5[_0x44a7b9(0x19d)]['id']);const _0x5cec66=toLLMProjectInfo(_0x2fbca5[_0x44a7b9(0x19d)]);return await handleSDKOutput([_0x5cec66],_0x5e8c59),0x0;}catch(_0x3ab62e){return handleSDKError(_0x3ab62e,_0x5e8c59),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a18_0x210e91(0x161)]='llm:project:delete';[a18_0x210e91(0x15c)]=a18_0x210e91(0x169);async[a18_0x210e91(0x17a)](_0x1744fc){const _0x4d4d6d=a18_0x210e91,{options:_0xaccc10,args:_0x50e81e,tdx:_0x1a8f7e}=_0x1744fc;if(_0x50e81e[_0x4d4d6d(0x189)]===0x0)return console[_0x4d4d6d(0x13d)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x4d4d6d(0x144)),0x1;const _0x5c8c2d=_0x50e81e[0x0];try{return await withSpinner(_0x4d4d6d(0x153)+_0x5c8c2d+_0x4d4d6d(0x176),()=>_0x1a8f7e[_0x4d4d6d(0x1ae)][_0x4d4d6d(0x15f)](_0x5c8c2d),{'verbose':_0xaccc10[_0x4d4d6d(0x147)]}),console[_0x4d4d6d(0x19c)](_0x4d4d6d(0x14b)+_0x5c8c2d),0x0;}catch(_0x173fad){return handleSDKError(_0x173fad,_0xaccc10),0x1;}}}
@@ -1 +1 @@
1
- function a18_0x419d(_0x12e824,_0x5019ca){const _0x59b7c6=a18_0x59b7();return a18_0x419d=function(_0x419d12,_0x41980d){_0x419d12=_0x419d12-0xc0;let _0x59c0e3=_0x59b7c6[_0x419d12];return _0x59c0e3;},a18_0x419d(_0x12e824,_0x5019ca);}const a18_0x2ffd2c=a18_0x419d;(function(_0x27f39a,_0x4bee5f){const _0x28d0a1=a18_0x419d,_0x46778a=_0x27f39a();while(!![]){try{const _0x3101c3=-parseInt(_0x28d0a1(0xe2))/0x1*(parseInt(_0x28d0a1(0xc5))/0x2)+-parseInt(_0x28d0a1(0xe6))/0x3*(-parseInt(_0x28d0a1(0xe0))/0x4)+-parseInt(_0x28d0a1(0xe1))/0x5*(-parseInt(_0x28d0a1(0xdd))/0x6)+parseInt(_0x28d0a1(0xe9))/0x7+parseInt(_0x28d0a1(0xcf))/0x8+parseInt(_0x28d0a1(0xcd))/0x9+-parseInt(_0x28d0a1(0xe7))/0xa;if(_0x3101c3===_0x4bee5f)break;else _0x46778a['push'](_0x46778a['shift']());}catch(_0x5cbca8){_0x46778a['push'](_0x46778a['shift']());}}}(a18_0x59b7,0xef6f4));import a18_0x5e9e72 from'chalk';function a18_0x59b7(){const _0x2d45c0=['49549270CrEiBD','getOrCreateDefaultProject','264929OprBUO','\x20\x20Address:','yellow','\x20\x20{','SIGTERM','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x20\x20Site:','port','Project\x20\x27','Resolving\x20project...','description','bold','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','execute','\x20\x20Agents:','\x0aClaude\x20Code\x20Configuration:','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','dim','NOT_FOUND','Starting\x20proxy\x20server...','\x20is\x20unavailable,\x20using\x20port\x20','Server\x20Configuration:','logger','\x0a\x0aShutting\x20down\x20proxy\x20server...','log','logLevel','llmProject','5086uVAVeg','stop','\x0aTesting\x20with\x20Agent\x20SDK:','close','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','http://0.0.0.0:','Port\x20','find','15405543rYozLh','exit','14089832DljpoF','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','\x20\x20\x20\x20}','\x20\x20Project:','server','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','projects','site','white','green','\x20\x20}','cyan','llm:proxy','11295846wEHQkA','name','attributes','4579592aPunke','5WffSCQ','237wfPHwE','\x20\x20\x20\x20\x22env\x22:\x20{','project','llm','3pXsPre'];a18_0x59b7=function(){return _0x2d45c0;};return a18_0x59b7();}import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x4158c2,_0x23c061){const _0x340add=a18_0x419d,{tdx:_0xb2bc8c,options:_0x593af9}=_0x4158c2,_0xa51860=_0x23c061||_0x593af9[_0x340add(0xc4)];if(_0xa51860){const _0x3acdf5=await _0xb2bc8c[_0x340add(0xe5)][_0x340add(0xd6)](),_0x2c3e82=_0x3acdf5[_0x340add(0xcc)](_0x2733c3=>_0x2733c3[_0x340add(0xdf)][_0x340add(0xde)]===_0xa51860);if(!_0x2c3e82)throw new SDKError(ErrorCode[_0x340add(0xfb)],_0x340add(0xf1)+_0xa51860+'\x27\x20not\x20found',undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x2c3e82['id'];}const _0x2438db=await _0xb2bc8c[_0x340add(0xe5)][_0x340add(0xe8)]();return _0x2438db['id'];}export class LLMProxyCommand extends BaseCommand{[a18_0x2ffd2c(0xde)]=a18_0x2ffd2c(0xdc);[a18_0x2ffd2c(0xf3)]=a18_0x2ffd2c(0xc9);[a18_0x2ffd2c(0xd4)];[a18_0x2ffd2c(0xc0)];async[a18_0x2ffd2c(0xf6)](_0x434c77){const _0x3928bf=a18_0x2ffd2c,{tdx:_0x164628,options:_0x4a0eeb}=_0x434c77;try{const _0x4b480e=_0x4a0eeb,_0x13f372=_0x4b480e[_0x3928bf(0xf0)]||0xfa0,_0x1313b6=_0x4b480e[_0x3928bf(0xe4)],_0x4aeefd=await findAvailablePort(_0x13f372);console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xf2)));const _0x283862=await getProjectIdOrDefault(_0x434c77,_0x1313b6),_0x171141=await _0x164628['llm'][_0x3928bf(0xd6)](),_0x2099e5=_0x171141[_0x3928bf(0xcc)](_0x300d7e=>_0x300d7e['id']===_0x283862);this['logger']=new TDXLogger(_0x4a0eeb[_0x3928bf(0xc3)]),await this[_0x3928bf(0xc0)]['init'](),console['log'](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xfc)));_0x4aeefd!==_0x13f372&&console['log'](a18_0x5e9e72[_0x3928bf(0xeb)](_0x3928bf(0xcb)+_0x13f372+_0x3928bf(0xfd)+_0x4aeefd));this['server']=new ProxyServer({'port':_0x4aeefd,'projectId':_0x283862,'tdx':_0x164628,'logger':this[_0x3928bf(0xc0)],'site':_0x4a0eeb[_0x3928bf(0xd7)]}),await this['server']['start'](),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xeb)][_0x3928bf(0xf4)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xeb)]('This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.')),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xeb)]('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xd9)][_0x3928bf(0xf4)](_0x3928bf(0xf9))),console[_0x3928bf(0xc2)](a18_0x5e9e72['cyan'](_0x3928bf(0xfe))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xea)),a18_0x5e9e72[_0x3928bf(0xd8)](_0x3928bf(0xca)+_0x4aeefd)),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xd3)),a18_0x5e9e72[_0x3928bf(0xd8)](_0x2099e5?.['attributes'][_0x3928bf(0xde)]||_0x283862)),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xf7)),a18_0x5e9e72[_0x3928bf(0xd8)]('created\x20on-demand\x20per\x20model')),console[_0x3928bf(0xc2)](a18_0x5e9e72['dim'](_0x3928bf(0xef)),a18_0x5e9e72[_0x3928bf(0xd8)](_0x4a0eeb[_0x3928bf(0xd7)])),console['log'](a18_0x5e9e72['cyan'](_0x3928bf(0xf8))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xee))),console['log'](a18_0x5e9e72[_0x3928bf(0xd8)](_0x3928bf(0xec))),console[_0x3928bf(0xc2)](a18_0x5e9e72['white'](_0x3928bf(0xe3))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xd8)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x4aeefd+'\x22,')),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xd8)](_0x3928bf(0xd5))),console[_0x3928bf(0xc2)](a18_0x5e9e72['white'](_0x3928bf(0xd2))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xd8)](_0x3928bf(0xda))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xdb)](_0x3928bf(0xc7))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xd0))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)](_0x3928bf(0xd1))),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xfa)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x3928bf(0xc2)](a18_0x5e9e72[_0x3928bf(0xeb)](_0x3928bf(0xf5)));const _0x53836c=async()=>{const _0x14df53=_0x3928bf;console[_0x14df53(0xc2)](a18_0x5e9e72[_0x14df53(0xfa)](_0x14df53(0xc1))),this[_0x14df53(0xd4)]&&await this[_0x14df53(0xd4)][_0x14df53(0xc6)](),this[_0x14df53(0xc0)]&&await this[_0x14df53(0xc0)][_0x14df53(0xc8)](),console[_0x14df53(0xc2)](a18_0x5e9e72[_0x14df53(0xd9)]('✓\x20Proxy\x20server\x20stopped')),process[_0x14df53(0xce)](0x0);};return process['on']('SIGINT',_0x53836c),process['on'](_0x3928bf(0xed),_0x53836c),await new Promise(()=>{}),0x0;}catch(_0x2ef370){this[_0x3928bf(0xd4)]&&await this['server']['stop']();this[_0x3928bf(0xc0)]&&await this[_0x3928bf(0xc0)][_0x3928bf(0xc8)]();throw _0x2ef370;}}}
1
+ const a19_0x2b7d57=a19_0x81b2;(function(_0x233139,_0x4c49ca){const _0xb38a28=a19_0x81b2,_0x5bb4d5=_0x233139();while(!![]){try{const _0x29a397=-parseInt(_0xb38a28(0xc2))/0x1*(parseInt(_0xb38a28(0xc6))/0x2)+parseInt(_0xb38a28(0xe9))/0x3+-parseInt(_0xb38a28(0xdf))/0x4*(-parseInt(_0xb38a28(0xca))/0x5)+parseInt(_0xb38a28(0xcd))/0x6*(-parseInt(_0xb38a28(0xcc))/0x7)+parseInt(_0xb38a28(0xe8))/0x8+parseInt(_0xb38a28(0xf5))/0x9+parseInt(_0xb38a28(0xea))/0xa*(-parseInt(_0xb38a28(0xcb))/0xb);if(_0x29a397===_0x4c49ca)break;else _0x5bb4d5['push'](_0x5bb4d5['shift']());}catch(_0x1612b3){_0x5bb4d5['push'](_0x5bb4d5['shift']());}}}(a19_0x1152,0xb6cdd));import a19_0x3e4847 from'chalk';import{BaseCommand}from'./command.js';function a19_0x1152(){const _0x4ef872=['Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','1383fBiAHp','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','NOT_FOUND','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','346hZEtwc','\x27\x20not\x20found','logLevel','SIGINT','85ToLkWr','16550908VfVlrc','5725349vlNTgm','6CWSmXz','Resolving\x20project...','white','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','SIGTERM','\x20\x20Site:','Project\x20\x27','yellow','attributes','llmProject','\x0a\x0aShutting\x20down\x20proxy\x20server...','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','server','projects','llm:proxy','logger','Server\x20Configuration:','\x20\x20Address:','263724HzBuhG','\x20\x20Agents:','bold','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x20\x20\x20\x20\x22env\x22:\x20{','find','port','name','start','7513272rHhfkb','228075YPMyJq','10oTzGBZ','llm','green','close','project','\x20\x20{','log','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','Starting\x20proxy\x20server...','created\x20on-demand\x20per\x20model','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','10570932SOnWMg','stop','dim','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','http://0.0.0.0:','\x20is\x20unavailable,\x20using\x20port\x20','site','✓\x20Proxy\x20server\x20stopped','description','cyan','\x20\x20\x20\x20}','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x0aClaude\x20Code\x20Configuration:','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','execute'];a19_0x1152=function(){return _0x4ef872;};return a19_0x1152();}import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a19_0x81b2(_0x18e1db,_0x1a1971){const _0x1152ca=a19_0x1152();return a19_0x81b2=function(_0x81b22d,_0x1f3a5b){_0x81b22d=_0x81b22d-0xbe;let _0x5e3ad0=_0x1152ca[_0x81b22d];return _0x5e3ad0;},a19_0x81b2(_0x18e1db,_0x1a1971);}import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x2bfbd1,_0x461220){const _0x5e51f6=a19_0x81b2,{tdx:_0x5c23ff,options:_0x214657}=_0x2bfbd1,_0x3d19b7=_0x461220||_0x214657[_0x5e51f6(0xd6)];if(_0x3d19b7){const _0x1dd6b5=await _0x5c23ff['llm'][_0x5e51f6(0xda)](),_0x4a3f4a=_0x1dd6b5[_0x5e51f6(0xe4)](_0xba2aee=>_0xba2aee[_0x5e51f6(0xd5)][_0x5e51f6(0xe6)]===_0x3d19b7);if(!_0x4a3f4a)throw new SDKError(ErrorCode[_0x5e51f6(0xc4)],_0x5e51f6(0xd3)+_0x3d19b7+_0x5e51f6(0xc7),undefined,{'helpText':_0x5e51f6(0xf1)});return _0x4a3f4a['id'];}const _0x1bb8ff=await _0x5c23ff[_0x5e51f6(0xeb)]['getOrCreateDefaultProject']();return _0x1bb8ff['id'];}export class LLMProxyCommand extends BaseCommand{[a19_0x2b7d57(0xe6)]=a19_0x2b7d57(0xdb);[a19_0x2b7d57(0xfd)]=a19_0x2b7d57(0xd0);[a19_0x2b7d57(0xd9)];[a19_0x2b7d57(0xdc)];async[a19_0x2b7d57(0xbf)](_0x2bb196){const _0xecef8c=a19_0x2b7d57,{tdx:_0x537f9f,options:_0xb9741d}=_0x2bb196;try{const _0x4595a6=_0xb9741d,_0x1abac8=_0x4595a6[_0xecef8c(0xe5)]||0xfa0,_0x50207c=_0x4595a6[_0xecef8c(0xee)],_0x194298=await findAvailablePort(_0x1abac8);console[_0xecef8c(0xf0)](a19_0x3e4847['dim'](_0xecef8c(0xce)));const _0x8506d=await getProjectIdOrDefault(_0x2bb196,_0x50207c),_0x74dae4=await _0x537f9f[_0xecef8c(0xeb)][_0xecef8c(0xda)](),_0x23973d=_0x74dae4[_0xecef8c(0xe4)](_0x368350=>_0x368350['id']===_0x8506d);this['logger']=new TDXLogger(_0xb9741d[_0xecef8c(0xc8)]),await this[_0xecef8c(0xdc)]['init'](),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xf7)](_0xecef8c(0xf2)));_0x194298!==_0x1abac8&&console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xd4)]('Port\x20'+_0x1abac8+_0xecef8c(0xfa)+_0x194298));this[_0xecef8c(0xd9)]=new ProxyServer({'port':_0x194298,'projectId':_0x8506d,'tdx':_0x537f9f,'logger':this[_0xecef8c(0xdc)],'site':_0xb9741d[_0xecef8c(0xfb)]}),await this['server'][_0xecef8c(0xe7)](),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xd4)][_0xecef8c(0xe1)](_0xecef8c(0x102))),console['log'](a19_0x3e4847[_0xecef8c(0xd4)](_0xecef8c(0xc3))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xd4)](_0xecef8c(0xc0))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xec)]['bold'](_0xecef8c(0xd8))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xfe)](_0xecef8c(0xdd))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xf7)](_0xecef8c(0xde)),a19_0x3e4847[_0xecef8c(0xcf)](_0xecef8c(0xf9)+_0x194298)),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xf7)]('\x20\x20Project:'),a19_0x3e4847[_0xecef8c(0xcf)](_0x23973d?.[_0xecef8c(0xd5)][_0xecef8c(0xe6)]||_0x8506d)),console['log'](a19_0x3e4847['dim'](_0xecef8c(0xe0)),a19_0x3e4847['white'](_0xecef8c(0xf3))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xf7)](_0xecef8c(0xd2)),a19_0x3e4847[_0xecef8c(0xcf)](_0xb9741d[_0xecef8c(0xfb)])),console[_0xecef8c(0xf0)](a19_0x3e4847['cyan'](_0xecef8c(0x101))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xf7)](_0xecef8c(0xe2))),console['log'](a19_0x3e4847['white'](_0xecef8c(0xef))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xcf)](_0xecef8c(0xe3))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xcf)](_0xecef8c(0xf4)+_0x194298+'\x22,')),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xcf)](_0xecef8c(0xc5))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xcf)](_0xecef8c(0xff))),console['log'](a19_0x3e4847['white']('\x20\x20}')),console['log'](a19_0x3e4847[_0xecef8c(0xfe)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0xecef8c(0xf0)](a19_0x3e4847['dim'](_0xecef8c(0xc1))),console['log'](a19_0x3e4847[_0xecef8c(0xf7)](_0xecef8c(0xbe))),console['log'](a19_0x3e4847[_0xecef8c(0xf7)](_0xecef8c(0x100))),console[_0xecef8c(0xf0)](a19_0x3e4847[_0xecef8c(0xd4)](_0xecef8c(0xf8)));const _0x440482=async()=>{const _0x5e2d37=_0xecef8c;console[_0x5e2d37(0xf0)](a19_0x3e4847[_0x5e2d37(0xf7)](_0x5e2d37(0xd7))),this[_0x5e2d37(0xd9)]&&await this[_0x5e2d37(0xd9)][_0x5e2d37(0xf6)](),this[_0x5e2d37(0xdc)]&&await this[_0x5e2d37(0xdc)][_0x5e2d37(0xed)](),console[_0x5e2d37(0xf0)](a19_0x3e4847[_0x5e2d37(0xec)](_0x5e2d37(0xfc))),process['exit'](0x0);};return process['on'](_0xecef8c(0xc9),_0x440482),process['on'](_0xecef8c(0xd1),_0x440482),await new Promise(()=>{}),0x0;}catch(_0x2b4896){this[_0xecef8c(0xd9)]&&await this['server']['stop']();this[_0xecef8c(0xdc)]&&await this[_0xecef8c(0xdc)][_0xecef8c(0xed)]();throw _0x2b4896;}}}
@@ -1 +1 @@
1
- const a19_0x221464=a19_0x36ca;(function(_0x50f1a0,_0x5ea718){const _0x2dcbad=a19_0x36ca,_0x288ca8=_0x50f1a0();while(!![]){try{const _0x2b33cf=-parseInt(_0x2dcbad(0x116))/0x1*(parseInt(_0x2dcbad(0x123))/0x2)+parseInt(_0x2dcbad(0x119))/0x3*(parseInt(_0x2dcbad(0x112))/0x4)+parseInt(_0x2dcbad(0x12d))/0x5*(-parseInt(_0x2dcbad(0x135))/0x6)+-parseInt(_0x2dcbad(0x138))/0x7+parseInt(_0x2dcbad(0x12e))/0x8*(-parseInt(_0x2dcbad(0x137))/0x9)+-parseInt(_0x2dcbad(0x13a))/0xa+parseInt(_0x2dcbad(0x126))/0xb;if(_0x2b33cf===_0x5ea718)break;else _0x288ca8['push'](_0x288ca8['shift']());}catch(_0xa74e21){_0x288ca8['push'](_0x288ca8['shift']());}}}(a19_0x164b,0x884a0));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a19_0x164b(){const _0x187502=['35918652zBimqK','\x27...','master','createParent','site','addAttributes','Table:\x20','565bEzlII','8ITbDve','segment:parent:create','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','customerGroup','✔\x20Created\x20parent\x20segment\x20\x27','Database:\x20','database','14778uFrwxb','Updating\x20parent\x20segment\x20\x27','2908494OZZFAW','4357752MNSiDr','timezone','8902640aNvwnG','table','segment','customerGroupFile','data','scheduleType','error','Site:\x20','execute','Update\x20existing\x20parent\x20segment\x20(audience)','108DXirrr','behaviors','getParentFull','segment:parent:update','536339GBYXnc','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','verbose','53319ubjOVH','scheduleOption','description','\x27\x20with\x20ID:\x20','addAttributesFile','Error:\x20--database\x20and\x20--table\x20are\x20required','attributesFile','name','Parent\x20segment:\x20','behaviorsFile','4RXLEww','✔\x20Updated\x20parent\x20segment\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27'];a19_0x164b=function(){return _0x187502;};return a19_0x164b();}function a19_0x36ca(_0x97f5c7,_0x4bdaf8){const _0x164b1d=a19_0x164b();return a19_0x36ca=function(_0x36ca8b,_0x2b97e5){_0x36ca8b=_0x36ca8b-0x110;let _0x5822c4=_0x164b1d[_0x36ca8b];return _0x5822c4;},a19_0x36ca(_0x97f5c7,_0x4bdaf8);}import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x221464(0x120)]=a19_0x221464(0x12f);[a19_0x221464(0x11b)]='Create\x20new\x20parent\x20segment\x20(audience)';async['execute'](_0x57fbac){const _0x4490f9=a19_0x221464,{options:_0x4cdedf,args:_0x236ce6,tdx:_0x5ce7f0}=_0x57fbac,_0x3c2d07=_0x4cdedf;if(_0x236ce6['length']===0x0)return console[_0x4490f9(0x140)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4490f9(0x140)](_0x4490f9(0x130)),0x1;const _0x48b734=_0x236ce6[0x0];if(!_0x3c2d07['database']||!_0x3c2d07['table'])return console['error'](_0x4490f9(0x11e)),console['error'](_0x4490f9(0x130)),0x1;_0x3c2d07[_0x4490f9(0x118)]&&(console[_0x4490f9(0x140)](_0x4490f9(0x141)+_0x3c2d07[_0x4490f9(0x12a)]),console[_0x4490f9(0x140)]('Name:\x20'+_0x48b734),console[_0x4490f9(0x140)](_0x4490f9(0x133)+_0x3c2d07[_0x4490f9(0x134)]),console[_0x4490f9(0x140)](_0x4490f9(0x12c)+_0x3c2d07[_0x4490f9(0x13b)]));const _0x41c3f9=await loadJSONFromOptions(_0x3c2d07['attributes'],_0x3c2d07[_0x4490f9(0x11f)]),_0x557f90=await loadJSONFromOptions(_0x3c2d07[_0x4490f9(0x113)],_0x3c2d07[_0x4490f9(0x122)]),_0x25cb52=await loadJSONFromOptions(_0x3c2d07[_0x4490f9(0x131)],_0x3c2d07[_0x4490f9(0x13d)]),_0x5b8a52={'name':_0x48b734,'description':_0x3c2d07[_0x4490f9(0x11b)],'scheduleType':_0x3c2d07[_0x4490f9(0x13f)],'scheduleOption':_0x3c2d07[_0x4490f9(0x11a)],'timezone':_0x3c2d07['timezone'],'master':{'parentDatabaseName':_0x3c2d07['database'],'parentTableName':_0x3c2d07['table']},'attributes':_0x41c3f9,'behaviors':_0x557f90,'customerGroup':_0x25cb52},_0x10bf8a=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x48b734+'\x27...',()=>_0x5ce7f0[_0x4490f9(0x13c)][_0x4490f9(0x129)](_0x5b8a52),{'verbose':_0x4cdedf[_0x4490f9(0x118)]}),_0xa41ec4=_0x10bf8a['data'];return console['error'](_0x4490f9(0x132)+_0xa41ec4[_0x4490f9(0x120)]+_0x4490f9(0x11c)+_0xa41ec4['id']),await handleSDKOutput([_0xa41ec4],_0x4cdedf),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x221464(0x115);['description']=a19_0x221464(0x111);async[a19_0x221464(0x110)](_0xc1767a){const _0x237d98=a19_0x221464,{options:_0x1cb71e,args:_0x34b83,tdx:_0x14e26f}=_0xc1767a,_0x10bb6c=_0x1cb71e;if(_0x34b83['length']===0x0)return console[_0x237d98(0x140)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x237d98(0x140)](_0x237d98(0x117)),0x1;const _0x42f637=_0x34b83[0x0];_0x10bb6c[_0x237d98(0x118)]&&(console['error']('Site:\x20'+_0x10bb6c['site']),console[_0x237d98(0x140)](_0x237d98(0x121)+_0x42f637));const _0x1a0bff=await withSpinner(_0x237d98(0x125)+_0x42f637+_0x237d98(0x127),()=>_0x14e26f[_0x237d98(0x13c)][_0x237d98(0x114)](_0x42f637),{'verbose':_0x10bb6c[_0x237d98(0x118)]}),_0x3b469c=_0x1a0bff[_0x237d98(0x13e)],_0x278134=await loadJSONFromOptions(_0x10bb6c[_0x237d98(0x12b)],_0x10bb6c[_0x237d98(0x11d)]),_0x178f98=await loadJSONFromOptions(_0x10bb6c['addBehaviors'],_0x10bb6c['addBehaviorsFile']),_0x386800={'name':_0x3b469c[_0x237d98(0x120)],'description':_0x10bb6c[_0x237d98(0x11b)]!==undefined?_0x10bb6c['description']:_0x3b469c['description'],'scheduleType':_0x10bb6c['scheduleType']!==undefined?_0x10bb6c[_0x237d98(0x13f)]:_0x3b469c['scheduleType'],'scheduleOption':_0x10bb6c[_0x237d98(0x11a)]!==undefined?_0x10bb6c[_0x237d98(0x11a)]:_0x3b469c[_0x237d98(0x11a)],'timezone':_0x10bb6c[_0x237d98(0x139)]!==undefined?_0x10bb6c[_0x237d98(0x139)]:_0x3b469c[_0x237d98(0x139)],'master':_0x3b469c[_0x237d98(0x128)],'attributes':_0x278134?[..._0x3b469c['attributes']||[],..._0x278134]:_0x3b469c['attributes'],'behaviors':_0x178f98?[..._0x3b469c[_0x237d98(0x113)]||[],..._0x178f98]:_0x3b469c[_0x237d98(0x113)],'customerGroup':_0x3b469c[_0x237d98(0x131)]},_0x51eaf1=await withSpinner(_0x237d98(0x136)+_0x42f637+_0x237d98(0x127),()=>_0x14e26f[_0x237d98(0x13c)]['updateParent'](_0x42f637,_0x386800),{'verbose':_0x10bb6c[_0x237d98(0x118)]}),_0x212fde=_0x51eaf1[_0x237d98(0x13e)];return console[_0x237d98(0x140)](_0x237d98(0x124)+_0x212fde[_0x237d98(0x120)]+'\x27'),await handleSDKOutput([_0x212fde],_0x10bb6c),0x0;}}
1
+ const a20_0x2e2666=a20_0x2084;(function(_0x20df69,_0x50d9d3){const _0x403905=a20_0x2084,_0x3cca52=_0x20df69();while(!![]){try{const _0x325819=parseInt(_0x403905(0x97))/0x1*(-parseInt(_0x403905(0x8f))/0x2)+parseInt(_0x403905(0x93))/0x3+-parseInt(_0x403905(0xa1))/0x4*(-parseInt(_0x403905(0x94))/0x5)+-parseInt(_0x403905(0x98))/0x6+-parseInt(_0x403905(0x83))/0x7*(parseInt(_0x403905(0x9f))/0x8)+-parseInt(_0x403905(0x9e))/0x9*(parseInt(_0x403905(0x6c))/0xa)+parseInt(_0x403905(0x71))/0xb*(parseInt(_0x403905(0x82))/0xc);if(_0x325819===_0x50d9d3)break;else _0x3cca52['push'](_0x3cca52['shift']());}catch(_0x1279dd){_0x3cca52['push'](_0x3cca52['shift']());}}}(a20_0x48de,0x4799e));function a20_0x2084(_0x5d62a9,_0x3739b5){const _0x48de28=a20_0x48de();return a20_0x2084=function(_0x2084eb,_0x25cf09){_0x2084eb=_0x2084eb-0x6c;let _0x9b99d0=_0x48de28[_0x2084eb];return _0x9b99d0;},a20_0x2084(_0x5d62a9,_0x3739b5);}import{BaseCommand}from'./command.js';function a20_0x48de(){const _0x3d5629=['1055826jRSArY','length','\x27\x20with\x20ID:\x20','addAttributes','table','error','9XkTKCd','2080toPczi','Database:\x20','44xsWvlG','Table:\x20','Fetching\x20current\x20configuration\x20for\x20\x27','5416230ZFFMUH','description','scheduleOption','name','Site:\x20','517FlOZIc','Creating\x20parent\x20segment\x20\x27','attributes','Error:\x20--database\x20and\x20--table\x20are\x20required','data','Update\x20existing\x20parent\x20segment\x20(audience)','site','addAttributesFile','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x27...','✔\x20Created\x20parent\x20segment\x20\x27','verbose','database','segment:parent:create','segment','addBehaviors','391224ZHCEDP','14539kFCLUd','Error:\x20Parent\x20segment\x20name\x20is\x20required','execute','Create\x20new\x20parent\x20segment\x20(audience)','scheduleType','addBehaviorsFile','customerGroup','createParent','getParentFull','customerGroupFile','Parent\x20segment:\x20','updateParent','2ypzvLw','timezone','Updating\x20parent\x20segment\x20\x27','behaviors','367494pVbvdq','188645beyHrt','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','master','518919IYjwvx'];a20_0x48de=function(){return _0x3d5629;};return a20_0x48de();}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{[a20_0x2e2666(0x6f)]=a20_0x2e2666(0x7f);[a20_0x2e2666(0x6d)]=a20_0x2e2666(0x86);async['execute'](_0x1af114){const _0x1b6088=a20_0x2e2666,{options:_0x67428a,args:_0x2ffed0,tdx:_0x2b7836}=_0x1af114,_0x97865b=_0x67428a;if(_0x2ffed0[_0x1b6088(0x99)]===0x0)return console['error'](_0x1b6088(0x84)),console[_0x1b6088(0x9d)](_0x1b6088(0x7a)),0x1;const _0x5a8ab8=_0x2ffed0[0x0];if(!_0x97865b[_0x1b6088(0x7e)]||!_0x97865b['table'])return console[_0x1b6088(0x9d)](_0x1b6088(0x74)),console['error'](_0x1b6088(0x7a)),0x1;_0x97865b[_0x1b6088(0x7d)]&&(console['error'](_0x1b6088(0x70)+_0x97865b[_0x1b6088(0x77)]),console['error']('Name:\x20'+_0x5a8ab8),console[_0x1b6088(0x9d)](_0x1b6088(0xa0)+_0x97865b['database']),console[_0x1b6088(0x9d)](_0x1b6088(0xa2)+_0x97865b[_0x1b6088(0x9c)]));const _0x4196c4=await loadJSONFromOptions(_0x97865b[_0x1b6088(0x73)],_0x97865b[_0x1b6088(0x79)]),_0x16c3c5=await loadJSONFromOptions(_0x97865b['behaviors'],_0x97865b['behaviorsFile']),_0x31e866=await loadJSONFromOptions(_0x97865b[_0x1b6088(0x89)],_0x97865b[_0x1b6088(0x8c)]),_0x5cf72c={'name':_0x5a8ab8,'description':_0x97865b[_0x1b6088(0x6d)],'scheduleType':_0x97865b[_0x1b6088(0x87)],'scheduleOption':_0x97865b[_0x1b6088(0x6e)],'timezone':_0x97865b[_0x1b6088(0x90)],'master':{'parentDatabaseName':_0x97865b['database'],'parentTableName':_0x97865b['table']},'attributes':_0x4196c4,'behaviors':_0x16c3c5,'customerGroup':_0x31e866},_0x1faad7=await withSpinner(_0x1b6088(0x72)+_0x5a8ab8+_0x1b6088(0x7b),()=>_0x2b7836[_0x1b6088(0x80)][_0x1b6088(0x8a)](_0x5cf72c),{'verbose':_0x67428a[_0x1b6088(0x7d)]}),_0x3e0192=_0x1faad7[_0x1b6088(0x75)];return console[_0x1b6088(0x9d)](_0x1b6088(0x7c)+_0x3e0192[_0x1b6088(0x6f)]+_0x1b6088(0x9a)+_0x3e0192['id']),await handleSDKOutput([_0x3e0192],_0x67428a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a20_0x2e2666(0x6f)]='segment:parent:update';[a20_0x2e2666(0x6d)]=a20_0x2e2666(0x76);async[a20_0x2e2666(0x85)](_0x145da2){const _0x20832a=a20_0x2e2666,{options:_0x1500a8,args:_0x1e2cc5,tdx:_0x15366a}=_0x145da2,_0x394092=_0x1500a8;if(_0x1e2cc5['length']===0x0)return console['error'](_0x20832a(0x84)),console[_0x20832a(0x9d)](_0x20832a(0x95)),0x1;const _0x54ace4=_0x1e2cc5[0x0];_0x394092[_0x20832a(0x7d)]&&(console['error']('Site:\x20'+_0x394092['site']),console[_0x20832a(0x9d)](_0x20832a(0x8d)+_0x54ace4));const _0x9f39c9=await withSpinner(_0x20832a(0xa3)+_0x54ace4+_0x20832a(0x7b),()=>_0x15366a[_0x20832a(0x80)][_0x20832a(0x8b)](_0x54ace4),{'verbose':_0x394092['verbose']}),_0x3d27ef=_0x9f39c9[_0x20832a(0x75)],_0x488779=await loadJSONFromOptions(_0x394092[_0x20832a(0x9b)],_0x394092[_0x20832a(0x78)]),_0x4eb679=await loadJSONFromOptions(_0x394092[_0x20832a(0x81)],_0x394092[_0x20832a(0x88)]),_0x1a8491={'name':_0x3d27ef[_0x20832a(0x6f)],'description':_0x394092[_0x20832a(0x6d)]!==undefined?_0x394092[_0x20832a(0x6d)]:_0x3d27ef[_0x20832a(0x6d)],'scheduleType':_0x394092['scheduleType']!==undefined?_0x394092[_0x20832a(0x87)]:_0x3d27ef['scheduleType'],'scheduleOption':_0x394092[_0x20832a(0x6e)]!==undefined?_0x394092['scheduleOption']:_0x3d27ef['scheduleOption'],'timezone':_0x394092[_0x20832a(0x90)]!==undefined?_0x394092[_0x20832a(0x90)]:_0x3d27ef[_0x20832a(0x90)],'master':_0x3d27ef[_0x20832a(0x96)],'attributes':_0x488779?[..._0x3d27ef['attributes']||[],..._0x488779]:_0x3d27ef['attributes'],'behaviors':_0x4eb679?[..._0x3d27ef[_0x20832a(0x92)]||[],..._0x4eb679]:_0x3d27ef[_0x20832a(0x92)],'customerGroup':_0x3d27ef['customerGroup']},_0x1de020=await withSpinner(_0x20832a(0x91)+_0x54ace4+_0x20832a(0x7b),()=>_0x15366a[_0x20832a(0x80)][_0x20832a(0x8e)](_0x54ace4,_0x1a8491),{'verbose':_0x394092['verbose']}),_0x55c695=_0x1de020[_0x20832a(0x75)];return console[_0x20832a(0x9d)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x55c695[_0x20832a(0x6f)]+'\x27'),await handleSDKOutput([_0x55c695],_0x394092),0x0;}}
@@ -1 +1 @@
1
- function a20_0x1266(_0x20295b,_0x51583a){const _0x120cb9=a20_0x120c();return a20_0x1266=function(_0x12661e,_0x516176){_0x12661e=_0x12661e-0x18b;let _0x4b04a7=_0x120cb9[_0x12661e];return _0x4b04a7;},a20_0x1266(_0x20295b,_0x51583a);}const a20_0x45ae95=a20_0x1266;(function(_0x12aa0b,_0x43ce5b){const _0x37127a=a20_0x1266,_0x4fb209=_0x12aa0b();while(!![]){try{const _0x469e23=-parseInt(_0x37127a(0x18c))/0x1+-parseInt(_0x37127a(0x19e))/0x2*(parseInt(_0x37127a(0x190))/0x3)+-parseInt(_0x37127a(0x19b))/0x4*(parseInt(_0x37127a(0x1a0))/0x5)+-parseInt(_0x37127a(0x196))/0x6+parseInt(_0x37127a(0x19c))/0x7+-parseInt(_0x37127a(0x19f))/0x8*(-parseInt(_0x37127a(0x18e))/0x9)+parseInt(_0x37127a(0x194))/0xa;if(_0x469e23===_0x43ce5b)break;else _0x4fb209['push'](_0x4fb209['shift']());}catch(_0x3e4637){_0x4fb209['push'](_0x4fb209['shift']());}}}(a20_0x120c,0x96020));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a20_0x120c(){const _0x3bf94c=['List\x20all\x20available\x20profiles','message','map','132LukZoY','1021013CjsAcY','name','28586ettchN','128soOqXd','147310wZcMWb','length','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','102041FVdCFN','error','644733AqSkEV','execute','183BwwFgN','\x20\x20Global:\x20~/.config/tdx/tdx.json','description','config','15222190mxyUbY','log','1522068UwGqgN','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'];a20_0x120c=function(){return _0x3bf94c;};return a20_0x120c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x45ae95(0x19d)]='profiles';[a20_0x45ae95(0x192)]=a20_0x45ae95(0x198);async[a20_0x45ae95(0x18f)](_0x22accf){const _0x20cfee=a20_0x45ae95,{options:_0xbc58ec}=_0x22accf;try{const _0x3420d4=listProfiles(),_0x4540e2=getActiveProfile();if(_0x3420d4[_0x20cfee(0x1a1)]===0x0)return console[_0x20cfee(0x195)](_0x20cfee(0x18b)),console[_0x20cfee(0x195)](_0x20cfee(0x197)),console[_0x20cfee(0x195)](_0x20cfee(0x191)),0x0;const _0x31ef50=_0x3420d4[_0x20cfee(0x19a)](_0x256db1=>{const _0x4fae7a=_0x20cfee,_0x93a377=_0x256db1[_0x4fae7a(0x19d)]===_0x4540e2,_0x2a37f6=getProfileParams(_0x256db1['config']);return{'name':_0x256db1[_0x4fae7a(0x19d)],'active':_0x93a377,'scope':_0x256db1['scope'],'description':_0x256db1[_0x4fae7a(0x193)][_0x4fae7a(0x192)]||'','params':_0x2a37f6};});return await handleSDKOutput(_0x31ef50,_0xbc58ec),0x0;}catch(_0x445c9b){return _0x445c9b instanceof Error&&console[_0x20cfee(0x18d)]('Error:\x20'+_0x445c9b[_0x20cfee(0x199)]),0x1;}}}
1
+ function a21_0xf4f5(_0x8e0348,_0x426590){const _0x2cffa9=a21_0x2cff();return a21_0xf4f5=function(_0xf4f5d,_0x79bcd3){_0xf4f5d=_0xf4f5d-0x14a;let _0x1469ff=_0x2cffa9[_0xf4f5d];return _0x1469ff;},a21_0xf4f5(_0x8e0348,_0x426590);}const a21_0x48c196=a21_0xf4f5;(function(_0x4969bc,_0x56656a){const _0xd7e8f4=a21_0xf4f5,_0x253f37=_0x4969bc();while(!![]){try{const _0x182721=parseInt(_0xd7e8f4(0x151))/0x1*(parseInt(_0xd7e8f4(0x162))/0x2)+parseInt(_0xd7e8f4(0x152))/0x3+parseInt(_0xd7e8f4(0x14b))/0x4*(-parseInt(_0xd7e8f4(0x15f))/0x5)+-parseInt(_0xd7e8f4(0x159))/0x6*(-parseInt(_0xd7e8f4(0x158))/0x7)+parseInt(_0xd7e8f4(0x163))/0x8*(-parseInt(_0xd7e8f4(0x155))/0x9)+parseInt(_0xd7e8f4(0x150))/0xa*(parseInt(_0xd7e8f4(0x160))/0xb)+-parseInt(_0xd7e8f4(0x14c))/0xc*(-parseInt(_0xd7e8f4(0x15a))/0xd);if(_0x182721===_0x56656a)break;else _0x253f37['push'](_0x253f37['shift']());}catch(_0x1f4b6b){_0x253f37['push'](_0x253f37['shift']());}}}(a21_0x2cff,0x2ef41));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a21_0x48c196(0x15e)]=a21_0x48c196(0x161);[a21_0x48c196(0x14e)]=a21_0x48c196(0x14f);async['execute'](_0x3618b3){const _0x4d5fa4=a21_0x48c196,{options:_0xe69667}=_0x3618b3;try{const _0xe2cd1d=listProfiles(),_0x3751fa=getActiveProfile();if(_0xe2cd1d[_0x4d5fa4(0x14d)]===0x0)return console[_0x4d5fa4(0x156)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x4d5fa4(0x156)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x4d5fa4(0x156)](_0x4d5fa4(0x15c)),0x0;const _0x3c2848=_0xe2cd1d[_0x4d5fa4(0x15d)](_0x465f0f=>{const _0x590a61=_0x4d5fa4,_0x120496=_0x465f0f[_0x590a61(0x15e)]===_0x3751fa,_0x190853=getProfileParams(_0x465f0f[_0x590a61(0x154)]);return{'name':_0x465f0f[_0x590a61(0x15e)],'active':_0x120496,'scope':_0x465f0f[_0x590a61(0x153)],'description':_0x465f0f[_0x590a61(0x154)]['description']||'','params':_0x190853};});return await handleSDKOutput(_0x3c2848,_0xe69667),0x0;}catch(_0x4126e3){return _0x4126e3 instanceof Error&&console[_0x4d5fa4(0x14a)](_0x4d5fa4(0x15b)+_0x4126e3[_0x4d5fa4(0x157)]),0x1;}}}function a21_0x2cff(){const _0x4f4ead=['469079HbgEWX','Error:\x20','\x20\x20Global:\x20~/.config/tdx/tdx.json','map','name','5tUtXvP','33OgXpIe','profiles','6daHmHs','8ZVkKDP','error','1318220irDuMu','36ujFPlO','length','description','List\x20all\x20available\x20profiles','329890jTUkBl','28859GVVYAM','773433biuDkt','scope','config','1249911UfJFiv','log','message','24647fMBIha','186RbxCdw'];a21_0x2cff=function(){return _0x4f4ead;};return a21_0x2cff();}
@@ -1 +1 @@
1
- function a21_0x3446(){const _0x3e1eaf=['\x20splits','Statement\x20','file','setJobId','completedSplits','information_schema','stats','1251162kYVfTy','5845LEekAe','Schema:\x20','push','setExtra','data','name','error','message','jobId','Run\x20Trino\x20queries\x20(streaming)','489156ZbQKuz','description','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','setPhase','verbose','\x0aAll\x20results\x20saved\x20to\x20','10QOlNRb','query','Executing\x20query...','Site:\x20','processedRows','output','11pIfuBJ','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','2570892DaPtTa','join','9016wFNnxV','elapsedTimeMillis','Executing\x20statement\x20','3976gIIOHO','...','totalSplits','Catalog:\x20','originalMessage','length','Executing\x20query\x20[','database','validate','Error:\x20','in\x20','2171490OcGrEB','Query\x20completed:\x20Processed\x20','3916017klquYG','5NYWgts'];a21_0x3446=function(){return _0x3e1eaf;};return a21_0x3446();}const a21_0x48e1f0=a21_0x154f;(function(_0x4f76ed,_0xfd0aeb){const _0x159552=a21_0x154f,_0xfdc8b8=_0x4f76ed();while(!![]){try{const _0x1e3b14=parseInt(_0x159552(0xe9))/0x1*(parseInt(_0x159552(0x113))/0x2)+-parseInt(_0x159552(0x102))/0x3+-parseInt(_0x159552(0x10d))/0x4*(-parseInt(_0x159552(0xfa))/0x5)+parseInt(_0x159552(0x11b))/0x6+-parseInt(_0x159552(0x103))/0x7*(-parseInt(_0x159552(0xec))/0x8)+-parseInt(_0x159552(0xf9))/0x9+-parseInt(_0x159552(0xf7))/0xa*(-parseInt(_0x159552(0x119))/0xb);if(_0x1e3b14===_0xfd0aeb)break;else _0xfdc8b8['push'](_0xfdc8b8['shift']());}catch(_0x5bba9f){_0xfdc8b8['push'](_0xfdc8b8['shift']());}}}(a21_0x3446,0x5bc14));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a21_0x154f(_0x35d28b,_0x558f11){const _0x344677=a21_0x3446();return a21_0x154f=function(_0x154f48,_0x2bf249){_0x154f48=_0x154f48-0xe9;let _0x2e5f56=_0x344677[_0x154f48];return _0x2e5f56;},a21_0x154f(_0x35d28b,_0x558f11);}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_0x48e1f0(0x108)]=a21_0x48e1f0(0x114);[a21_0x48e1f0(0x10e)]=a21_0x48e1f0(0x10c);async['execute'](_0x549f24){const _0x108d98=a21_0x48e1f0,{options:_0x129c9,args:_0x464dda,tdx:_0x464930}=_0x549f24,_0x417e3d=_0x464dda[0x0],_0x20f660=_0x129c9[_0x108d98(0xfd)];let _0x44bff7;if(_0x20f660)try{_0x44bff7=readSqlStatementsFromFile(_0x20f660);}catch(_0x4433a1){return console[_0x108d98(0x109)](_0x108d98(0xf5)+_0x4433a1['message']),0x1;}else try{_0x44bff7=splitSqlStatements(_0x417e3d);}catch(_0x424689){return console[_0x108d98(0x109)](_0x108d98(0xf5)+_0x424689[_0x108d98(0x10a)]),0x1;}const _0x1bd554=_0x129c9[_0x108d98(0xf3)]||_0x108d98(0x100),_0x1f0529=_0x129c9['catalog'];try{const _0x178839=[],_0x2e795f=!!_0x129c9[_0x108d98(0x118)];for(let _0x2ccf14=0x0;_0x2ccf14<_0x44bff7['length'];_0x2ccf14++){const _0x3ba046=_0x44bff7[_0x2ccf14],_0x593fbf=_0x2ccf14+0x1,_0x114b8a=_0x44bff7[_0x108d98(0xf1)],_0x2debd3=_0x114b8a>0x1;_0x129c9[_0x108d98(0x111)]&&(console[_0x108d98(0x109)]('\x0a'+(_0x2debd3?'Statement\x20'+_0x593fbf+'/'+_0x114b8a+':':'')),console[_0x108d98(0x109)](_0x108d98(0x116)+_0x129c9['site']),console['error'](_0x108d98(0xef)+(_0x1f0529||'td')),console['error'](_0x108d98(0x104)+_0x1bd554),console[_0x108d98(0x109)]('SQL:\x20'+_0x3ba046));const _0x5729d4=_0x2debd3?_0x108d98(0xeb)+_0x593fbf+'/'+_0x114b8a+_0x108d98(0xed):_0x108d98(0x115);try{const _0x3cc735=await withQuerySpinner(_0x5729d4,async _0x2ccb81=>{const _0x24f243=await _0x464930['query'](_0x3ba046,{'catalog':_0x1f0529,'schema':_0x1bd554,'onJobId':_0x268da5=>{const _0x475f1a=a21_0x154f;_0x2ccb81[_0x475f1a(0xfe)](_0x268da5);},'onProgress':_0x3b9785=>{const _0x328c5d=a21_0x154f;_0x2ccb81[_0x328c5d(0x110)](_0x328c5d(0xf2)+_0x3b9785['state']+']'),_0x2ccb81[_0x328c5d(0x106)](formatRows(_0x3b9785['processedRows'])+'\x20rows\x20'+_0x3b9785[_0x328c5d(0xff)]+'/'+_0x3b9785[_0x328c5d(0xee)]+_0x328c5d(0xfb));}});return _0x24f243;},{'verbose':_0x129c9[_0x108d98(0x111)]}),_0xb80e63=_0x3cc735[_0x108d98(0x107)],_0x323b70=_0xb80e63[_0x108d98(0x10b)]?'\x20[Job\x20ID:\x20'+_0xb80e63[_0x108d98(0x10b)]+']':'',_0x258549=_0x2debd3?_0x108d98(0xfc)+_0x593fbf+'/'+_0x114b8a+'\x20-\x20':'';console[_0x108d98(0x109)]('✔\x20'+_0x258549+_0x108d98(0xf8)+formatRows(_0xb80e63[_0x108d98(0x101)][_0x108d98(0x117)])+'\x20rows\x20'+(_0x108d98(0xf6)+formatElapsed(_0xb80e63[_0x108d98(0x101)][_0x108d98(0xea)])+_0x323b70));if(_0x2debd3&&_0x2e795f){const _0x3065d1=resolveOutputOptions(_0x129c9),_0x230118=await formatQueryOutput(_0xb80e63,_0x3065d1);_0x178839[_0x108d98(0x105)](_0x230118);}else await handleQueryOutput(_0xb80e63,_0x129c9);}catch(_0x543065){const _0x4c0925=_0x2debd3?_0x108d98(0xfc)+_0x593fbf+'/'+_0x114b8a+':\x0a':'',_0x103cd3=_0x543065 instanceof SDKError?_0x543065[_0x108d98(0xf0)]:_0x543065['message'];return console[_0x108d98(0x109)](''+_0x4c0925+_0x103cd3),0x1;}}if(_0x44bff7[_0x108d98(0xf1)]>0x1&&_0x2e795f&&_0x178839['length']>0x0){const _0x5823d3=_0x178839[_0x108d98(0x11c)]('\x0a');writeFileSync(_0x129c9[_0x108d98(0x118)],_0x5823d3),console[_0x108d98(0x109)](_0x108d98(0x112)+_0x129c9[_0x108d98(0x118)]);}return 0x0;}catch(_0x231beb){throw _0x231beb;}}[a21_0x48e1f0(0xf4)](_0x5ec372){const _0x48c4b2=a21_0x48e1f0,_0xecd757=_0x5ec372['args'][0x0],_0x54b13c=_0x5ec372['options'][_0x48c4b2(0xfd)];if(!_0xecd757&&!_0x54b13c)return _0x48c4b2(0x10f);if(_0xecd757&&_0x54b13c)return _0x48c4b2(0x11a);return undefined;}}
1
+ const a22_0x3bf9ae=a22_0x52d7;(function(_0x2c96aa,_0x270cb9){const _0xdf0485=a22_0x52d7,_0x7c68c2=_0x2c96aa();while(!![]){try{const _0x125cfc=-parseInt(_0xdf0485(0x1ec))/0x1*(-parseInt(_0xdf0485(0x1f1))/0x2)+-parseInt(_0xdf0485(0x1f6))/0x3*(parseInt(_0xdf0485(0x1de))/0x4)+parseInt(_0xdf0485(0x1da))/0x5+parseInt(_0xdf0485(0x1e1))/0x6+parseInt(_0xdf0485(0x1ee))/0x7+parseInt(_0xdf0485(0x1d7))/0x8+-parseInt(_0xdf0485(0x1e6))/0x9;if(_0x125cfc===_0x270cb9)break;else _0x7c68c2['push'](_0x7c68c2['shift']());}catch(_0x5bc0d3){_0x7c68c2['push'](_0x7c68c2['shift']());}}}(a22_0x33ea,0xe3ce7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a22_0x52d7(_0x39bc49,_0x543f58){const _0x33ea2e=a22_0x33ea();return a22_0x52d7=function(_0x52d7cc,_0x5872a7){_0x52d7cc=_0x52d7cc-0x1ca;let _0x396420=_0x33ea2e[_0x52d7cc];return _0x396420;},a22_0x52d7(_0x39bc49,_0x543f58);}import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x33ea(){const _0x305332=['args','length','...','completedSplits','execute','Query\x20completed:\x20Processed\x20','processedRows','Executing\x20query...','query','push','\x20rows\x20','Run\x20Trino\x20queries\x20(streaming)','setPhase','join','\x20-\x20','\x20splits','totalSplits','14359872kgXVdc','output','options','3647900rtrnEb','setExtra','file','in\x20','1536jwrrSQ','catalog','SQL:\x20','87690lfCqha','site','name','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','Catalog:\x20','42314220qZYVBD','Schema:\x20','originalMessage','Statement\x20','stats','verbose','1682787JPgtql','error','11641539eWcLmL','message','Error:\x20','2eXfUSl','elapsedTimeMillis','Site:\x20','database','jobId','1956esbvVH','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'];a22_0x33ea=function(){return _0x305332;};return a22_0x33ea();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a22_0x3bf9ae(0x1e3)]='query';['description']=a22_0x3bf9ae(0x1d1);async[a22_0x3bf9ae(0x1ca)](_0x4be3d1){const _0x3f01ad=a22_0x3bf9ae,{options:_0x5aabfb,args:_0x3f625a,tdx:_0x5c3c54}=_0x4be3d1,_0x3dffad=_0x3f625a[0x0],_0x3a1e6b=_0x5aabfb['file'];let _0x474121;if(_0x3a1e6b)try{_0x474121=readSqlStatementsFromFile(_0x3a1e6b);}catch(_0x52b257){return console[_0x3f01ad(0x1ed)](_0x3f01ad(0x1f0)+_0x52b257[_0x3f01ad(0x1ef)]),0x1;}else try{_0x474121=splitSqlStatements(_0x3dffad);}catch(_0x51cf55){return console[_0x3f01ad(0x1ed)](_0x3f01ad(0x1f0)+_0x51cf55[_0x3f01ad(0x1ef)]),0x1;}const _0x35477d=_0x5aabfb[_0x3f01ad(0x1f4)]||'information_schema',_0x21f320=_0x5aabfb[_0x3f01ad(0x1df)];try{const _0x3c69da=[],_0x5bd68b=!!_0x5aabfb[_0x3f01ad(0x1d8)];for(let _0x2cf24d=0x0;_0x2cf24d<_0x474121[_0x3f01ad(0x1f9)];_0x2cf24d++){const _0x22f792=_0x474121[_0x2cf24d],_0x480cd1=_0x2cf24d+0x1,_0x25d1fb=_0x474121[_0x3f01ad(0x1f9)],_0x4ceef7=_0x25d1fb>0x1;_0x5aabfb['verbose']&&(console[_0x3f01ad(0x1ed)]('\x0a'+(_0x4ceef7?'Statement\x20'+_0x480cd1+'/'+_0x25d1fb+':':'')),console[_0x3f01ad(0x1ed)](_0x3f01ad(0x1f3)+_0x5aabfb[_0x3f01ad(0x1e2)]),console['error'](_0x3f01ad(0x1e5)+(_0x21f320||'td')),console[_0x3f01ad(0x1ed)](_0x3f01ad(0x1e7)+_0x35477d),console[_0x3f01ad(0x1ed)](_0x3f01ad(0x1e0)+_0x22f792));const _0x3ee99a=_0x4ceef7?'Executing\x20statement\x20'+_0x480cd1+'/'+_0x25d1fb+_0x3f01ad(0x1fa):_0x3f01ad(0x1cd);try{const _0x41a5ad=await withQuerySpinner(_0x3ee99a,async _0xb12d7a=>{const _0x5784d7=_0x3f01ad,_0xdcaedf=await _0x5c3c54[_0x5784d7(0x1ce)](_0x22f792,{'catalog':_0x21f320,'schema':_0x35477d,'onJobId':_0x2d76d0=>{_0xb12d7a['setJobId'](_0x2d76d0);},'onProgress':_0x316f42=>{const _0x62e9de=_0x5784d7;_0xb12d7a[_0x62e9de(0x1d2)]('Executing\x20query\x20['+_0x316f42['state']+']'),_0xb12d7a[_0x62e9de(0x1db)](formatRows(_0x316f42['processedRows'])+_0x62e9de(0x1d0)+_0x316f42[_0x62e9de(0x1fb)]+'/'+_0x316f42[_0x62e9de(0x1d6)]+_0x62e9de(0x1d5));}});return _0xdcaedf;},{'verbose':_0x5aabfb[_0x3f01ad(0x1eb)]}),_0x57c8b7=_0x41a5ad['data'],_0x475041=_0x57c8b7[_0x3f01ad(0x1f5)]?'\x20[Job\x20ID:\x20'+_0x57c8b7['jobId']+']':'',_0x110cff=_0x4ceef7?_0x3f01ad(0x1e9)+_0x480cd1+'/'+_0x25d1fb+_0x3f01ad(0x1d4):'';console['error']('✔\x20'+_0x110cff+_0x3f01ad(0x1cb)+formatRows(_0x57c8b7[_0x3f01ad(0x1ea)][_0x3f01ad(0x1cc)])+_0x3f01ad(0x1d0)+(_0x3f01ad(0x1dd)+formatElapsed(_0x57c8b7[_0x3f01ad(0x1ea)][_0x3f01ad(0x1f2)])+_0x475041));if(_0x4ceef7&&_0x5bd68b){const _0x4173a4=resolveOutputOptions(_0x5aabfb),_0x14b88d=await formatQueryOutput(_0x57c8b7,_0x4173a4);_0x3c69da[_0x3f01ad(0x1cf)](_0x14b88d);}else await handleQueryOutput(_0x57c8b7,_0x5aabfb);}catch(_0x240d09){const _0x487552=_0x4ceef7?_0x3f01ad(0x1e9)+_0x480cd1+'/'+_0x25d1fb+':\x0a':'',_0x30a4b0=_0x240d09 instanceof SDKError?_0x240d09[_0x3f01ad(0x1e8)]:_0x240d09[_0x3f01ad(0x1ef)];return console[_0x3f01ad(0x1ed)](''+_0x487552+_0x30a4b0),0x1;}}if(_0x474121[_0x3f01ad(0x1f9)]>0x1&&_0x5bd68b&&_0x3c69da[_0x3f01ad(0x1f9)]>0x0){const _0x7753b9=_0x3c69da[_0x3f01ad(0x1d3)]('\x0a');writeFileSync(_0x5aabfb[_0x3f01ad(0x1d8)],_0x7753b9),console[_0x3f01ad(0x1ed)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x5aabfb[_0x3f01ad(0x1d8)]);}return 0x0;}catch(_0x1f2c0d){throw _0x1f2c0d;}}['validate'](_0x1bb9f3){const _0x4d1dff=a22_0x3bf9ae,_0x2d52f8=_0x1bb9f3[_0x4d1dff(0x1f8)][0x0],_0x2f58eb=_0x1bb9f3[_0x4d1dff(0x1d9)][_0x4d1dff(0x1dc)];if(!_0x2d52f8&&!_0x2f58eb)return _0x4d1dff(0x1f7);if(_0x2d52f8&&_0x2f58eb)return _0x4d1dff(0x1e4);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x22b1fd=a22_0x4942;(function(_0x388dfc,_0x3586e7){const _0x3dc287=a22_0x4942,_0x33c4a2=_0x388dfc();while(!![]){try{const _0x44135a=parseInt(_0x3dc287(0x17f))/0x1*(parseInt(_0x3dc287(0x19b))/0x2)+-parseInt(_0x3dc287(0x140))/0x3+parseInt(_0x3dc287(0x17b))/0x4+parseInt(_0x3dc287(0x18a))/0x5*(-parseInt(_0x3dc287(0x155))/0x6)+-parseInt(_0x3dc287(0x14b))/0x7*(parseInt(_0x3dc287(0x160))/0x8)+-parseInt(_0x3dc287(0x14e))/0x9+-parseInt(_0x3dc287(0x16c))/0xa*(-parseInt(_0x3dc287(0x182))/0xb);if(_0x44135a===_0x3586e7)break;else _0x33c4a2['push'](_0x33c4a2['shift']());}catch(_0x52e89c){_0x33c4a2['push'](_0x33c4a2['shift']());}}}(a22_0x4596,0xe32a1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a22_0x4942(_0x2a5611,_0x2ddf13){const _0x459685=a22_0x4596();return a22_0x4942=function(_0x4942b1,_0x15df9a){_0x4942b1=_0x4942b1-0x132;let _0x474cac=_0x459685[_0x4942b1];return _0x474cac;},a22_0x4942(_0x2a5611,_0x2ddf13);}export class SegmentDescribeCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]=a22_0x22b1fd(0x141);['description']=a22_0x22b1fd(0x193);async[a22_0x22b1fd(0x188)](_0x4c1e2f){const _0x5796f9=a22_0x22b1fd,{options:_0x24e40d,args:_0x543db7,tdx:_0x1a7448}=_0x4c1e2f;if(_0x543db7[_0x5796f9(0x194)]===0x0)return console[_0x5796f9(0x134)](_0x5796f9(0x13d)),console[_0x5796f9(0x134)](_0x5796f9(0x19c)),console[_0x5796f9(0x134)](_0x5796f9(0x195)),console[_0x5796f9(0x134)](_0x5796f9(0x14d)),console[_0x5796f9(0x134)](_0x5796f9(0x18f)),console[_0x5796f9(0x134)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x5514ec=_0x543db7[0x0],_0x42f1bc=_0x24e40d[_0x5796f9(0x169)];let _0x5de153=_0x5514ec;_0x42f1bc&&!_0x5514ec[_0x5796f9(0x13b)]('/')&&(_0x5de153=_0x42f1bc+'/'+_0x5514ec,_0x24e40d['verbose']&&console[_0x5796f9(0x134)](_0x5796f9(0x137)+_0x5de153));const _0x7443a2=await withSpinner(_0x5796f9(0x146)+_0x5de153+'\x27...',()=>_0x1a7448['segment'][_0x5796f9(0x163)](_0x5de153),{'verbose':_0x24e40d[_0x5796f9(0x170)]}),_0x230c35=_0x7443a2[_0x5796f9(0x168)];_0x24e40d[_0x5796f9(0x170)]&&(console[_0x5796f9(0x134)](_0x5796f9(0x164)+_0x230c35[_0x5796f9(0x161)]),console[_0x5796f9(0x134)](_0x5796f9(0x148)+_0x230c35[_0x5796f9(0x18d)]),_0x230c35['folderId']&&console[_0x5796f9(0x134)](_0x5796f9(0x1a2)+_0x230c35[_0x5796f9(0x176)]),_0x230c35[_0x5796f9(0x14c)]&&console[_0x5796f9(0x134)](_0x5796f9(0x150)+_0x230c35[_0x5796f9(0x14c)]));if(_0x230c35[_0x5796f9(0x161)]===_0x5796f9(0x13a)){const _0x50443c=await withSpinner(_0x5796f9(0x1a0),()=>_0x1a7448['segment'][_0x5796f9(0x174)](_0x230c35[_0x5796f9(0x18d)]),{'verbose':_0x24e40d[_0x5796f9(0x170)]});await handleSDKOutput([_0x50443c[_0x5796f9(0x168)]],_0x24e40d);}else{if(_0x230c35[_0x5796f9(0x161)]===_0x5796f9(0x179)){if(!_0x230c35['folderId'])throw new SDKError(ErrorCode[_0x5796f9(0x13f)],_0x5796f9(0x18e));const _0x18084d=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1a7448[_0x5796f9(0x1a8)]['getFolder'](_0x230c35[_0x5796f9(0x176)]),{'verbose':_0x24e40d[_0x5796f9(0x170)]});await handleSDKOutput([_0x18084d['data']],_0x24e40d);}else{if(_0x230c35[_0x5796f9(0x161)]===_0x5796f9(0x1a8)){if(!_0x230c35[_0x5796f9(0x14c)])throw new SDKError(ErrorCode[_0x5796f9(0x13f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2db466=await withSpinner(_0x5796f9(0x139),()=>_0x1a7448[_0x5796f9(0x1a8)][_0x5796f9(0x18c)](_0x230c35[_0x5796f9(0x18d)],_0x230c35[_0x5796f9(0x14c)]),{'verbose':_0x24e40d['verbose']});await handleSDKOutput([_0x2db466[_0x5796f9(0x168)]],_0x24e40d);}}}return 0x0;}catch(_0xb5da1d){if(_0xb5da1d instanceof SDKError)return console[_0x5796f9(0x134)](_0x5796f9(0x152)+_0xb5da1d[_0x5796f9(0x16f)]),_0xb5da1d[_0x5796f9(0x1aa)]&&console[_0x5796f9(0x134)](_0x5796f9(0x1a7)+_0xb5da1d[_0x5796f9(0x1aa)]),0x1;throw _0xb5da1d;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]='segment:show';['description']=a22_0x22b1fd(0x17d);async[a22_0x22b1fd(0x188)](_0x45a4f4){const _0x245c3a=a22_0x22b1fd,{options:_0x271f00,args:_0x5cd6d5,tdx:_0x3644b1}=_0x45a4f4;if(_0x5cd6d5[_0x245c3a(0x194)]===0x0)return console[_0x245c3a(0x134)](_0x245c3a(0x190)),console['error'](_0x245c3a(0x151)),console['error'](_0x245c3a(0x195)),console[_0x245c3a(0x134)](_0x245c3a(0x19a)),console[_0x245c3a(0x134)](_0x245c3a(0x17a)),console[_0x245c3a(0x134)](_0x245c3a(0x1a3)),0x1;try{const _0x1a0153=_0x5cd6d5[0x0],_0x130681=_0x271f00[_0x245c3a(0x169)];let _0x176ab9=_0x1a0153;_0x130681&&!_0x1a0153[_0x245c3a(0x13b)]('/')&&(_0x176ab9=_0x130681+'/'+_0x1a0153,_0x271f00[_0x245c3a(0x170)]&&console[_0x245c3a(0x134)]('Resolved\x20relative\x20path\x20to:\x20'+_0x176ab9));const _0x2362ce=await withSpinner(_0x245c3a(0x146)+_0x176ab9+_0x245c3a(0x167),()=>_0x3644b1[_0x245c3a(0x1a8)][_0x245c3a(0x163)](_0x176ab9),{'verbose':_0x271f00[_0x245c3a(0x170)]}),_0x54e6fa=_0x2362ce[_0x245c3a(0x168)];_0x271f00[_0x245c3a(0x170)]&&(console[_0x245c3a(0x134)]('Resolved\x20type:\x20'+_0x54e6fa[_0x245c3a(0x161)]),console[_0x245c3a(0x134)](_0x245c3a(0x148)+_0x54e6fa[_0x245c3a(0x18d)]));if(_0x54e6fa['type']===_0x245c3a(0x179))return console[_0x245c3a(0x134)](_0x245c3a(0x153)),console[_0x245c3a(0x134)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x406bfd;if(_0x54e6fa[_0x245c3a(0x161)]===_0x245c3a(0x13a)){const _0x2b712c=await withSpinner(_0x245c3a(0x199),()=>_0x3644b1[_0x245c3a(0x1a8)][_0x245c3a(0x13c)](_0x54e6fa[_0x245c3a(0x18d)]),{'verbose':_0x271f00[_0x245c3a(0x170)]});_0x406bfd=_0x2b712c[_0x245c3a(0x168)];}else{if(!_0x54e6fa['segmentId'])throw new SDKError(ErrorCode[_0x245c3a(0x13f)],_0x245c3a(0x177));const _0x2a8195=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3644b1[_0x245c3a(0x1a8)][_0x245c3a(0x1a9)](_0x54e6fa['parentId'],_0x54e6fa[_0x245c3a(0x14c)]),{'verbose':_0x271f00[_0x245c3a(0x170)]});_0x406bfd=_0x2a8195[_0x245c3a(0x168)];}const _0x2f0091=resolveLimit(_0x271f00[_0x245c3a(0x191)],DEFAULT_DISPLAY_LIMIT),_0x129717=/\bLIMIT\s+\d+/i[_0x245c3a(0x15f)](_0x406bfd);!_0x129717&&(_0x406bfd=_0x406bfd[_0x245c3a(0x154)]()[_0x245c3a(0x143)](/;+$/,''),_0x406bfd=_0x245c3a(0x138)+_0x406bfd+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2f0091);_0x271f00['verbose']&&console[_0x245c3a(0x134)](_0x245c3a(0x145)+_0x406bfd);const _0x25a4d4=await withQuerySpinner(_0x245c3a(0x173),async _0x2a50ff=>{const _0x2012f2=_0x245c3a,_0x40d807=await _0x3644b1[_0x2012f2(0x18b)](_0x406bfd,{'catalog':'td','schema':'information_schema','onJobId':_0x22cd72=>{const _0x150cd6=_0x2012f2;_0x2a50ff[_0x150cd6(0x192)](_0x22cd72);}});return _0x40d807;},{'verbose':_0x271f00['verbose']}),_0x291f4d=_0x25a4d4['data'],_0x5b44ea=_0x291f4d[_0x245c3a(0x165)]?_0x245c3a(0x15b)+_0x291f4d[_0x245c3a(0x165)]+']':'';return console['error'](_0x245c3a(0x16b)+_0x291f4d[_0x245c3a(0x13e)][_0x245c3a(0x14a)][_0x245c3a(0x136)]()+'\x20rows\x20'+(_0x245c3a(0x189)+formatElapsed(_0x291f4d[_0x245c3a(0x13e)]['elapsedTimeMillis'])+_0x5b44ea)),await handleQueryOutput(_0x291f4d,_0x271f00),0x0;}catch(_0x34636b){if(_0x34636b instanceof SDKError)return console[_0x245c3a(0x134)]('✖\x20Query\x20failed\x20['+_0x34636b[_0x245c3a(0x135)]+']'),console[_0x245c3a(0x134)]('\x0a'+_0x34636b[_0x245c3a(0x16f)]),0x1;throw _0x34636b;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]=a22_0x22b1fd(0x166);[a22_0x22b1fd(0x175)]=a22_0x22b1fd(0x19d);async[a22_0x22b1fd(0x188)](_0x268a51){const _0x488537=a22_0x22b1fd,{options:_0xe604e3,args:_0x2bfc95,tdx:_0x33f243}=_0x268a51;if(_0x2bfc95['length']===0x0)return console[_0x488537(0x134)](_0x488537(0x180)),console[_0x488537(0x134)](_0x488537(0x178)),0x1;const _0x26bb3e=_0x2bfc95[0x0];try{_0xe604e3[_0x488537(0x170)]&&(console[_0x488537(0x134)](_0x488537(0x15c)+_0xe604e3[_0x488537(0x14f)]),console['error'](_0x488537(0x17e)+_0x26bb3e));const _0x425b56=await withSpinner(_0x488537(0x185)+_0x26bb3e+_0x488537(0x167),()=>_0x33f243[_0x488537(0x1a8)]['resolveParentId'](_0x26bb3e),{'verbose':_0xe604e3['verbose']}),_0x1a6c2e=_0x425b56[_0x488537(0x168)];_0xe604e3[_0x488537(0x170)]&&console['error'](_0x488537(0x16d)+_0x1a6c2e);const _0x855005=await withSpinner(_0x488537(0x1a6)+_0x26bb3e+_0x488537(0x167),()=>_0x33f243[_0x488537(0x1a8)][_0x488537(0x132)](_0x1a6c2e),{'verbose':_0xe604e3['verbose']}),_0x1674f1=_0x855005[_0x488537(0x168)];return console['error']('✔\x20Found\x20'+_0x1674f1[_0x488537(0x194)]+_0x488537(0x197)+(_0x1674f1[_0x488537(0x194)]!==0x1?'s':'')),await handleSDKOutput(_0x1674f1,_0xe604e3),0x0;}catch(_0x44076f){if(_0x44076f instanceof SDKError)return console[_0x488537(0x134)](_0x488537(0x152)+_0x44076f['message']),_0x44076f[_0x488537(0x1aa)]&&console[_0x488537(0x134)](_0x488537(0x1a7)+_0x44076f['cause']),0x1;throw _0x44076f;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x22b1fd(0x15d);['description']='Show\x20segment\x20folder\x20details';async['execute'](_0x5e212c){const _0x5685fc=a22_0x22b1fd,{options:_0x39bd36,args:_0x22eb63,tdx:_0x2b5a0e}=_0x5e212c;if(_0x22eb63[_0x5685fc(0x194)]===0x0)return console[_0x5685fc(0x134)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x5685fc(0x134)](_0x5685fc(0x15e)),0x1;try{const {parentId:_0x2d14c2,childId:_0x267fdb}=parseSegmentRef(_0x22eb63[0x0]);_0x39bd36[_0x5685fc(0x170)]&&(console[_0x5685fc(0x134)](_0x5685fc(0x15c)+_0x39bd36[_0x5685fc(0x14f)]),console[_0x5685fc(0x134)](_0x5685fc(0x17e)+_0x2d14c2),_0x267fdb&&console['error'](_0x5685fc(0x159)+_0x267fdb));if(!_0x267fdb)return console[_0x5685fc(0x134)](_0x5685fc(0x198)),0x1;const _0x2295b8=await withSpinner(_0x5685fc(0x185)+_0x2d14c2+_0x5685fc(0x167),()=>_0x2b5a0e[_0x5685fc(0x1a8)][_0x5685fc(0x15a)](_0x2d14c2),{'verbose':_0x39bd36[_0x5685fc(0x170)]}),_0x2d2b9d=_0x2295b8['data'];_0x39bd36[_0x5685fc(0x170)]&&console[_0x5685fc(0x134)](_0x5685fc(0x16d)+_0x2d2b9d);const _0x3cfdf0=await withSpinner(_0x5685fc(0x149)+_0x267fdb+'\x27...',()=>_0x2b5a0e['segment'][_0x5685fc(0x181)](_0x2d2b9d,_0x267fdb),{'verbose':_0x39bd36[_0x5685fc(0x170)]}),_0x5c773e=_0x3cfdf0['data'];_0x39bd36[_0x5685fc(0x170)]&&console[_0x5685fc(0x134)](_0x5685fc(0x17c)+_0x5c773e);const _0x39bc5a=await withSpinner(_0x5685fc(0x19e)+_0x267fdb+_0x5685fc(0x167),()=>_0x2b5a0e[_0x5685fc(0x1a8)]['getFolder'](_0x5c773e),{'verbose':_0x39bd36[_0x5685fc(0x170)]});return await handleSDKOutput([_0x39bc5a[_0x5685fc(0x168)]],_0x39bd36),0x0;}catch(_0x252034){if(_0x252034 instanceof SDKError)return console[_0x5685fc(0x134)](_0x5685fc(0x152)+_0x252034[_0x5685fc(0x16f)]),_0x252034[_0x5685fc(0x1aa)]&&console[_0x5685fc(0x134)](_0x5685fc(0x1a7)+_0x252034[_0x5685fc(0x1aa)]),0x1;throw _0x252034;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]=a22_0x22b1fd(0x19f);[a22_0x22b1fd(0x175)]=a22_0x22b1fd(0x172);async[a22_0x22b1fd(0x188)](_0x415eed){const _0x26b5ad=a22_0x22b1fd,{options:_0x476010,args:_0x566a73,tdx:_0x1d3978}=_0x415eed;if(_0x566a73['length']===0x0)return console[_0x26b5ad(0x134)](_0x26b5ad(0x190)),console['error'](_0x26b5ad(0x16a)),console['error'](_0x26b5ad(0x195)),console[_0x26b5ad(0x134)](_0x26b5ad(0x171)),console[_0x26b5ad(0x134)](_0x26b5ad(0x157)),console[_0x26b5ad(0x134)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x1bd9e8=_0x566a73[0x0],_0x591091=_0x476010[_0x26b5ad(0x169)];let _0x4ead76=_0x1bd9e8;_0x591091&&!_0x1bd9e8[_0x26b5ad(0x13b)]('/')&&(_0x4ead76=_0x591091+'/'+_0x1bd9e8,_0x476010['verbose']&&console[_0x26b5ad(0x134)](_0x26b5ad(0x137)+_0x4ead76));const _0x5516c4=await withSpinner('Resolving\x20path\x20\x27'+_0x4ead76+_0x26b5ad(0x167),()=>_0x1d3978[_0x26b5ad(0x1a8)][_0x26b5ad(0x163)](_0x4ead76),{'verbose':_0x476010[_0x26b5ad(0x170)]}),_0x17a2ee=_0x5516c4['data'];_0x476010[_0x26b5ad(0x170)]&&(console['error'](_0x26b5ad(0x164)+_0x17a2ee['type']),console[_0x26b5ad(0x134)](_0x26b5ad(0x148)+_0x17a2ee[_0x26b5ad(0x18d)]));if(_0x17a2ee[_0x26b5ad(0x161)]==='folder')return console['error'](_0x26b5ad(0x133)),console[_0x26b5ad(0x134)](_0x26b5ad(0x144)),0x1;let _0xbdf34f;if(_0x17a2ee[_0x26b5ad(0x161)]===_0x26b5ad(0x13a)){const _0x2dc355=await withSpinner(_0x26b5ad(0x199),()=>_0x1d3978[_0x26b5ad(0x1a8)][_0x26b5ad(0x13c)](_0x17a2ee[_0x26b5ad(0x18d)]),{'verbose':_0x476010[_0x26b5ad(0x170)]});_0xbdf34f=_0x2dc355['data'];}else{if(!_0x17a2ee[_0x26b5ad(0x14c)])throw new SDKError(ErrorCode[_0x26b5ad(0x13f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4338d5=await withSpinner(_0x26b5ad(0x162),()=>_0x1d3978[_0x26b5ad(0x1a8)]['getSegmentSQL'](_0x17a2ee[_0x26b5ad(0x18d)],_0x17a2ee['segmentId']),{'verbose':_0x476010['verbose']});_0xbdf34f=_0x4338d5[_0x26b5ad(0x168)];}return _0x476010['format']===_0x26b5ad(0x142)||_0x476010['format']===_0x26b5ad(0x187)?await handleSDKOutput([{'sql':_0xbdf34f}],_0x476010):console[_0x26b5ad(0x183)](_0xbdf34f),0x0;}catch(_0x328a0f){if(_0x328a0f instanceof SDKError)return console[_0x26b5ad(0x134)](_0x26b5ad(0x152)+_0x328a0f[_0x26b5ad(0x16f)]),_0x328a0f[_0x26b5ad(0x1aa)]&&console[_0x26b5ad(0x134)](_0x26b5ad(0x1a7)+_0x328a0f[_0x26b5ad(0x1aa)]),0x1;throw _0x328a0f;}}}function a22_0x4596(){const _0x388fa3=['trim','1528506ixDAKx','createFolder','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20parent\x20folder\x20ID:\x20','Folder\x20name:\x20','resolveParentId','\x20[Job\x20ID:\x20','Site:\x20','segment:folder:show','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','test','5680zgSZxR','type','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','Resolved\x20type:\x20','jobId','segment:folder:list','\x27...','data','segmentPath','Usage:\x20tdx\x20segment\x20sql\x20<path>','✔\x20Query\x20completed:\x20Processed\x20','380fBfeYW','Resolved\x20parent\x20ID:\x20','Parent\x20segment:\x20','message','verbose','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Executing\x20segment\x20query...','getParent','description','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','folder','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','1495056ZtVXsn','Resolved\x20folder\x20ID:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20name:\x20','707fYaKYV','Error:\x20Parent\x20segment\x20name\x20is\x20required','resolveFolderId','1588477JWvGMB','log','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20parent\x20segment\x20\x27','parentFolder','jsonl','execute','in\x20','30UmYpTG','query','getSegment','parentId','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','limit','setJobId','Show\x20segment\x20or\x20folder\x20details','length','Examples:','\x27\x20with\x20ID:\x20','\x20folder','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Fetching\x20SQL\x20for\x20parent\x20segment...','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','2252cJSXPH','Usage:\x20tdx\x20segment\x20describe\x20<path>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Fetching\x20folder\x20\x27','segment:sql','Fetching\x20parent\x20segment\x20details...','name','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Creating\x20folder\x20\x27','Resolving\x20parent\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20Cause:\x20','segment','getSegmentSQL','cause','listFolders','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','error','code','toLocaleString','Resolved\x20relative\x20path\x20to:\x20','SELECT\x20*\x20FROM\x20(\x0a','Fetching\x20segment\x20details...','parent','includes','getParentSQL','Error:\x20Path\x20or\x20name\x20is\x20required','stats','INTERNAL','3034347cjcAID','segment:describe','json','replace','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','SQL\x20query:\x0a','Resolving\x20path\x20\x27','✔\x20Created\x20folder\x20\x27','Parent\x20ID:\x20','Resolving\x20folder\x20\x27','processedRows','14728BHpmOV','segmentId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','15237468ZgcQWa','site','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','Error:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'];a22_0x4596=function(){return _0x388fa3;};return a22_0x4596();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a22_0x22b1fd(0x175)]='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x22b1fd(0x188)](_0x366fab){const _0x5c5073=a22_0x22b1fd,{options:_0x29eedb,args:_0x362ebc,tdx:_0x26c9c9}=_0x366fab,_0x149b48=_0x29eedb;if(_0x362ebc[_0x5c5073(0x194)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x5c5073(0x134)](_0x5c5073(0x184)),0x1;const _0x519040=_0x362ebc[0x0],_0x1d4124=_0x362ebc[0x1];_0x149b48['verbose']&&(console[_0x5c5073(0x134)](_0x5c5073(0x15c)+_0x149b48[_0x5c5073(0x14f)]),console['error'](_0x5c5073(0x16e)+_0x519040),console[_0x5c5073(0x134)](_0x5c5073(0x159)+_0x1d4124));let _0x16e27b;if(_0x149b48[_0x5c5073(0x186)]){const _0x1a7111=_0x149b48['parentFolder'],_0x5ef77e=await withSpinner(_0x5c5073(0x185)+_0x519040+_0x5c5073(0x167),()=>_0x26c9c9[_0x5c5073(0x1a8)][_0x5c5073(0x15a)](_0x519040),{'verbose':_0x149b48[_0x5c5073(0x170)]}),_0x16e1f3=_0x5ef77e['data'],_0x4c978b=await withSpinner(_0x5c5073(0x1a5)+_0x1a7111+_0x5c5073(0x167),()=>_0x26c9c9['segment'][_0x5c5073(0x181)](_0x16e1f3,_0x1a7111),{'verbose':_0x149b48[_0x5c5073(0x170)]});_0x16e27b=_0x4c978b['data'],_0x149b48[_0x5c5073(0x170)]&&console[_0x5c5073(0x134)](_0x5c5073(0x158)+_0x16e27b);}const _0x29b857={'name':_0x1d4124,'description':_0x149b48['description'],'parentFolderId':_0x16e27b},_0x2160d7=await withSpinner(_0x5c5073(0x1a4)+_0x1d4124+_0x5c5073(0x167),()=>_0x26c9c9[_0x5c5073(0x1a8)][_0x5c5073(0x156)](_0x519040,_0x29b857),{'verbose':_0x149b48[_0x5c5073(0x170)]}),_0x42873d=_0x2160d7[_0x5c5073(0x168)];return console[_0x5c5073(0x134)](_0x5c5073(0x147)+_0x42873d[_0x5c5073(0x1a1)]+_0x5c5073(0x196)+_0x42873d['id']),await handleSDKOutput([_0x42873d],_0x149b48),0x0;}}
1
+ const a23_0x392698=a23_0x5d14;(function(_0x204d64,_0x4bda56){const _0x15db6c=a23_0x5d14,_0x1a724c=_0x204d64();while(!![]){try{const _0x521b96=parseInt(_0x15db6c(0x1d6))/0x1*(parseInt(_0x15db6c(0x1c2))/0x2)+parseInt(_0x15db6c(0x1d2))/0x3+-parseInt(_0x15db6c(0x1e0))/0x4*(-parseInt(_0x15db6c(0x182))/0x5)+-parseInt(_0x15db6c(0x1b0))/0x6+-parseInt(_0x15db6c(0x1c8))/0x7+-parseInt(_0x15db6c(0x1ae))/0x8+parseInt(_0x15db6c(0x1a7))/0x9*(parseInt(_0x15db6c(0x1c4))/0xa);if(_0x521b96===_0x4bda56)break;else _0x1a724c['push'](_0x1a724c['shift']());}catch(_0x218eae){_0x1a724c['push'](_0x1a724c['shift']());}}}(a23_0x2800,0x3128e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x392698(0x1a2)]=a23_0x392698(0x1b7);['description']=a23_0x392698(0x1b5);async[a23_0x392698(0x19b)](_0x319b2b){const _0x2de301=a23_0x392698,{options:_0x2cb7cc,args:_0x1570bf,tdx:_0x15ed48}=_0x319b2b;if(_0x1570bf['length']===0x0)return console[_0x2de301(0x1c5)](_0x2de301(0x197)),console[_0x2de301(0x1c5)](_0x2de301(0x1a8)),console[_0x2de301(0x1c5)](_0x2de301(0x1d4)),console[_0x2de301(0x1c5)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x2de301(0x1c5)](_0x2de301(0x1ad)),console[_0x2de301(0x1c5)](_0x2de301(0x194)),0x1;try{const _0x1b29da=_0x1570bf[0x0],_0x3672a6=_0x2cb7cc[_0x2de301(0x1a3)];let _0x47809e=_0x1b29da;_0x3672a6&&!_0x1b29da[_0x2de301(0x1cc)]('/')&&(_0x47809e=_0x3672a6+'/'+_0x1b29da,_0x2cb7cc[_0x2de301(0x19d)]&&console[_0x2de301(0x1c5)](_0x2de301(0x1be)+_0x47809e));const _0x3a9908=await withSpinner(_0x2de301(0x18a)+_0x47809e+_0x2de301(0x17e),()=>_0x15ed48['segment'][_0x2de301(0x198)](_0x47809e),{'verbose':_0x2cb7cc[_0x2de301(0x19d)]}),_0x44a3ec=_0x3a9908[_0x2de301(0x1ba)];_0x2cb7cc[_0x2de301(0x19d)]&&(console[_0x2de301(0x1c5)](_0x2de301(0x1a0)+_0x44a3ec[_0x2de301(0x1ea)]),console['error'](_0x2de301(0x1e7)+_0x44a3ec[_0x2de301(0x19c)]),_0x44a3ec[_0x2de301(0x1eb)]&&console[_0x2de301(0x1c5)](_0x2de301(0x19f)+_0x44a3ec[_0x2de301(0x1eb)]),_0x44a3ec['segmentId']&&console[_0x2de301(0x1c5)]('Segment\x20ID:\x20'+_0x44a3ec['segmentId']));if(_0x44a3ec[_0x2de301(0x1ea)]==='parent'){const _0x16029e=await withSpinner(_0x2de301(0x177),()=>_0x15ed48['segment'][_0x2de301(0x186)](_0x44a3ec[_0x2de301(0x19c)]),{'verbose':_0x2cb7cc[_0x2de301(0x19d)]});await handleSDKOutput([_0x16029e[_0x2de301(0x1ba)]],_0x2cb7cc);}else{if(_0x44a3ec[_0x2de301(0x1ea)]===_0x2de301(0x199)){if(!_0x44a3ec['folderId'])throw new SDKError(ErrorCode[_0x2de301(0x1bb)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4cf61a=await withSpinner(_0x2de301(0x1e9),()=>_0x15ed48[_0x2de301(0x1ca)][_0x2de301(0x1b4)](_0x44a3ec[_0x2de301(0x1eb)]),{'verbose':_0x2cb7cc[_0x2de301(0x19d)]});await handleSDKOutput([_0x4cf61a[_0x2de301(0x1ba)]],_0x2cb7cc);}else{if(_0x44a3ec['type']==='segment'){if(!_0x44a3ec['segmentId'])throw new SDKError(ErrorCode[_0x2de301(0x1bb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1ae6d6=await withSpinner(_0x2de301(0x1e3),()=>_0x15ed48[_0x2de301(0x1ca)][_0x2de301(0x19e)](_0x44a3ec[_0x2de301(0x19c)],_0x44a3ec[_0x2de301(0x1ce)]),{'verbose':_0x2cb7cc[_0x2de301(0x19d)]});await handleSDKOutput([_0x1ae6d6[_0x2de301(0x1ba)]],_0x2cb7cc);}}}return 0x0;}catch(_0x4aced6){if(_0x4aced6 instanceof SDKError)return console[_0x2de301(0x1c5)](_0x2de301(0x1ec)+_0x4aced6[_0x2de301(0x17f)]),_0x4aced6[_0x2de301(0x1d5)]&&console[_0x2de301(0x1c5)](_0x2de301(0x18e)+_0x4aced6[_0x2de301(0x1d5)]),0x1;throw _0x4aced6;}}}function a23_0x5d14(_0x130dec,_0x379dbc){const _0x28004f=a23_0x2800();return a23_0x5d14=function(_0x5d14e0,_0x2e88bb){_0x5d14e0=_0x5d14e0-0x176;let _0x43f562=_0x28004f[_0x5d14e0];return _0x43f562;},a23_0x5d14(_0x130dec,_0x379dbc);}export class SegmentShowCommand extends BaseCommand{[a23_0x392698(0x1a2)]=a23_0x392698(0x1c0);[a23_0x392698(0x1c7)]=a23_0x392698(0x187);async[a23_0x392698(0x19b)](_0xe082d7){const _0x58b167=a23_0x392698,{options:_0x5cf3c9,args:_0x470c91,tdx:_0x484207}=_0xe082d7;if(_0x470c91['length']===0x0)return console[_0x58b167(0x1c5)](_0x58b167(0x180)),console['error'](_0x58b167(0x1dd)),console[_0x58b167(0x1c5)](_0x58b167(0x1d4)),console[_0x58b167(0x1c5)](_0x58b167(0x1a5)),console['error'](_0x58b167(0x176)),console[_0x58b167(0x1c5)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x408e60=_0x470c91[0x0],_0x433958=_0x5cf3c9['segmentPath'];let _0x555ae7=_0x408e60;_0x433958&&!_0x408e60[_0x58b167(0x1cc)]('/')&&(_0x555ae7=_0x433958+'/'+_0x408e60,_0x5cf3c9[_0x58b167(0x19d)]&&console[_0x58b167(0x1c5)](_0x58b167(0x1be)+_0x555ae7));const _0x19d930=await withSpinner(_0x58b167(0x18a)+_0x555ae7+'\x27...',()=>_0x484207[_0x58b167(0x1ca)]['resolvePathToResource'](_0x555ae7),{'verbose':_0x5cf3c9[_0x58b167(0x19d)]}),_0x24ec17=_0x19d930['data'];_0x5cf3c9[_0x58b167(0x19d)]&&(console[_0x58b167(0x1c5)](_0x58b167(0x1a0)+_0x24ec17[_0x58b167(0x1ea)]),console[_0x58b167(0x1c5)](_0x58b167(0x1e7)+_0x24ec17[_0x58b167(0x19c)]));if(_0x24ec17[_0x58b167(0x1ea)]===_0x58b167(0x199))return console[_0x58b167(0x1c5)](_0x58b167(0x1da)),console[_0x58b167(0x1c5)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x5f4a66;if(_0x24ec17[_0x58b167(0x1ea)]===_0x58b167(0x1c9)){const _0x2a8026=await withSpinner(_0x58b167(0x1b2),()=>_0x484207[_0x58b167(0x1ca)][_0x58b167(0x1e1)](_0x24ec17[_0x58b167(0x19c)]),{'verbose':_0x5cf3c9[_0x58b167(0x19d)]});_0x5f4a66=_0x2a8026[_0x58b167(0x1ba)];}else{if(!_0x24ec17['segmentId'])throw new SDKError(ErrorCode[_0x58b167(0x1bb)],_0x58b167(0x184));const _0x3ac8ac=await withSpinner(_0x58b167(0x1e5),()=>_0x484207[_0x58b167(0x1ca)]['getSegmentSQL'](_0x24ec17[_0x58b167(0x19c)],_0x24ec17[_0x58b167(0x1ce)]),{'verbose':_0x5cf3c9['verbose']});_0x5f4a66=_0x3ac8ac[_0x58b167(0x1ba)];}const _0x3e41d5=resolveLimit(_0x5cf3c9[_0x58b167(0x1c1)],DEFAULT_DISPLAY_LIMIT),_0x2e314d=/\bLIMIT\s+\d+/i[_0x58b167(0x1cd)](_0x5f4a66);!_0x2e314d&&(_0x5f4a66=_0x5f4a66[_0x58b167(0x1d3)]()[_0x58b167(0x1a9)](/;+$/,''),_0x5f4a66=_0x58b167(0x1cf)+_0x5f4a66+_0x58b167(0x1d8)+_0x3e41d5);_0x5cf3c9['verbose']&&console[_0x58b167(0x1c5)]('SQL\x20query:\x0a'+_0x5f4a66);const _0x38c187=await withQuerySpinner(_0x58b167(0x1d7),async _0x35ea07=>{const _0xe341d2=_0x58b167,_0x233944=await _0x484207['query'](_0x5f4a66,{'catalog':'td','schema':_0xe341d2(0x195),'onJobId':_0x4dd538=>{const _0x379845=_0xe341d2;_0x35ea07[_0x379845(0x1af)](_0x4dd538);}});return _0x233944;},{'verbose':_0x5cf3c9[_0x58b167(0x19d)]}),_0x1d7dc1=_0x38c187['data'],_0x5e8730=_0x1d7dc1['jobId']?'\x20[Job\x20ID:\x20'+_0x1d7dc1[_0x58b167(0x17a)]+']':'';return console[_0x58b167(0x1c5)](_0x58b167(0x17c)+_0x1d7dc1['stats'][_0x58b167(0x1e6)][_0x58b167(0x1a1)]()+_0x58b167(0x17b)+(_0x58b167(0x1e8)+formatElapsed(_0x1d7dc1[_0x58b167(0x183)][_0x58b167(0x1de)])+_0x5e8730)),await handleQueryOutput(_0x1d7dc1,_0x5cf3c9),0x0;}catch(_0xc7fcb8){if(_0xc7fcb8 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0xc7fcb8['code']+']'),console[_0x58b167(0x1c5)]('\x0a'+_0xc7fcb8[_0x58b167(0x17f)]),0x1;throw _0xc7fcb8;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x392698(0x1a2)]=a23_0x392698(0x1e2);[a23_0x392698(0x1c7)]=a23_0x392698(0x196);async['execute'](_0x4823b5){const _0x43b342=a23_0x392698,{options:_0x34f002,args:_0x1d210c,tdx:_0x523600}=_0x4823b5;if(_0x1d210c[_0x43b342(0x1c3)]===0x0)return console['error'](_0x43b342(0x1bf)),console[_0x43b342(0x1c5)](_0x43b342(0x1aa)),0x1;const _0x1ac3b4=_0x1d210c[0x0];try{_0x34f002[_0x43b342(0x19d)]&&(console['error'](_0x43b342(0x1ac)+_0x34f002[_0x43b342(0x1a6)]),console['error'](_0x43b342(0x1d9)+_0x1ac3b4));const _0x40059d=await withSpinner(_0x43b342(0x179)+_0x1ac3b4+_0x43b342(0x17e),()=>_0x523600[_0x43b342(0x1ca)]['resolveParentId'](_0x1ac3b4),{'verbose':_0x34f002['verbose']}),_0x4a4297=_0x40059d[_0x43b342(0x1ba)];_0x34f002[_0x43b342(0x19d)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4a4297);const _0x461cda=await withSpinner(_0x43b342(0x1b3)+_0x1ac3b4+'\x27...',()=>_0x523600[_0x43b342(0x1ca)]['listFolders'](_0x4a4297),{'verbose':_0x34f002[_0x43b342(0x19d)]}),_0x21b54b=_0x461cda[_0x43b342(0x1ba)];return console[_0x43b342(0x1c5)](_0x43b342(0x18c)+_0x21b54b[_0x43b342(0x1c3)]+'\x20folder'+(_0x21b54b[_0x43b342(0x1c3)]!==0x1?'s':'')),await handleSDKOutput(_0x21b54b,_0x34f002),0x0;}catch(_0x2322c2){if(_0x2322c2 instanceof SDKError)return console[_0x43b342(0x1c5)](_0x43b342(0x1ec)+_0x2322c2['message']),_0x2322c2[_0x43b342(0x1d5)]&&console['error']('\x20\x20Cause:\x20'+_0x2322c2[_0x43b342(0x1d5)]),0x1;throw _0x2322c2;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x392698(0x1a2)]=a23_0x392698(0x1d1);[a23_0x392698(0x1c7)]=a23_0x392698(0x1e4);async[a23_0x392698(0x19b)](_0x8ff713){const _0x59796b=a23_0x392698,{options:_0x237a02,args:_0x48cf40,tdx:_0x69135a}=_0x8ff713;if(_0x48cf40[_0x59796b(0x1c3)]===0x0)return console[_0x59796b(0x1c5)](_0x59796b(0x192)),console['error'](_0x59796b(0x1df)),0x1;try{const {parentId:_0x4587cc,childId:_0x239d3d}=parseSegmentRef(_0x48cf40[0x0]);_0x237a02[_0x59796b(0x19d)]&&(console['error']('Site:\x20'+_0x237a02[_0x59796b(0x1a6)]),console[_0x59796b(0x1c5)]('Parent\x20name:\x20'+_0x4587cc),_0x239d3d&&console[_0x59796b(0x1c5)](_0x59796b(0x190)+_0x239d3d));if(!_0x239d3d)return console[_0x59796b(0x1c5)](_0x59796b(0x1ab)),0x1;const _0x3395fa=await withSpinner(_0x59796b(0x179)+_0x4587cc+_0x59796b(0x17e),()=>_0x69135a[_0x59796b(0x1ca)][_0x59796b(0x1b8)](_0x4587cc),{'verbose':_0x237a02[_0x59796b(0x19d)]}),_0x3fb57c=_0x3395fa['data'];_0x237a02[_0x59796b(0x19d)]&&console[_0x59796b(0x1c5)]('Resolved\x20parent\x20ID:\x20'+_0x3fb57c);const _0x1f195b=await withSpinner(_0x59796b(0x1bc)+_0x239d3d+_0x59796b(0x17e),()=>_0x69135a[_0x59796b(0x1ca)]['resolveFolderId'](_0x3fb57c,_0x239d3d),{'verbose':_0x237a02['verbose']}),_0x218bcc=_0x1f195b[_0x59796b(0x1ba)];_0x237a02[_0x59796b(0x19d)]&&console[_0x59796b(0x1c5)](_0x59796b(0x1bd)+_0x218bcc);const _0x5afcc8=await withSpinner(_0x59796b(0x1db)+_0x239d3d+_0x59796b(0x17e),()=>_0x69135a[_0x59796b(0x1ca)][_0x59796b(0x1b4)](_0x218bcc),{'verbose':_0x237a02[_0x59796b(0x19d)]});return await handleSDKOutput([_0x5afcc8['data']],_0x237a02),0x0;}catch(_0x59b5b0){if(_0x59b5b0 instanceof SDKError)return console[_0x59796b(0x1c5)](_0x59796b(0x1ec)+_0x59b5b0[_0x59796b(0x17f)]),_0x59b5b0['cause']&&console[_0x59796b(0x1c5)]('\x20\x20Cause:\x20'+_0x59b5b0[_0x59796b(0x1d5)]),0x1;throw _0x59b5b0;}}}function a23_0x2800(){const _0x4cb959=['cause','18841urMHhD','Executing\x20segment\x20query...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20name:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Fetching\x20folder\x20\x27','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20show\x20<path>','elapsedTimeMillis','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','8yfOXjf','getParentSQL','segment:folder:list','Fetching\x20segment\x20details...','Show\x20segment\x20folder\x20details','Fetching\x20SQL\x20for\x20segment...','processedRows','Parent\x20ID:\x20','in\x20','Fetching\x20folder\x20details...','type','folderId','Error:\x20','jsonl','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20parent\x20segment\x20details...','segment:sql','Resolving\x20parent\x20segment\x20\x27','jobId','\x20rows\x20','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x27...','message','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','✔\x20Created\x20folder\x20\x27','675365pLaVKw','stats','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20folder\x20ID:\x20','getParent','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','resolveFolderId','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','✔\x20Found\x20','\x27\x20with\x20ID:\x20','\x20\x20Cause:\x20','createFolder','Folder\x20name:\x20','Parent\x20segment:\x20','Error:\x20Folder\x20reference\x20is\x20required','format','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','information_schema','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Path\x20or\x20name\x20is\x20required','resolvePathToResource','folder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','execute','parentId','verbose','getSegment','Folder\x20ID:\x20','Resolved\x20type:\x20','toLocaleString','name','segmentPath','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','site','1620BDbTDA','Usage:\x20tdx\x20segment\x20describe\x20<path>','replace','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Site:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','2686048nXUgCn','setJobId','823140bmIKtv','segment:folder:create','Fetching\x20SQL\x20for\x20parent\x20segment...','Listing\x20folders\x20for\x20parent\x20\x27','getFolder','Show\x20segment\x20or\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','segment:describe','resolveParentId','json','data','INTERNAL','Resolving\x20folder\x20\x27','Resolved\x20folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:show','limit','38TJqMJw','length','17740mboMCQ','error','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','description','2809338GoQejm','parent','segment','log','includes','test','segmentId','SELECT\x20*\x20FROM\x20(\x0a','parentFolder','segment:folder:show','384579JMFSRK','trim','Examples:'];a23_0x2800=function(){return _0x4cb959;};return a23_0x2800();}export class SegmentSQLCommand extends BaseCommand{[a23_0x392698(0x1a2)]=a23_0x392698(0x178);[a23_0x392698(0x1c7)]=a23_0x392698(0x1b6);async[a23_0x392698(0x19b)](_0x5a944d){const _0x3242ae=a23_0x392698,{options:_0x3af54b,args:_0x387ca3,tdx:_0x36509e}=_0x5a944d;if(_0x387ca3['length']===0x0)return console['error'](_0x3242ae(0x180)),console['error']('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x3242ae(0x1c5)](_0x3242ae(0x1d4)),console[_0x3242ae(0x1c5)](_0x3242ae(0x1c6)),console[_0x3242ae(0x1c5)](_0x3242ae(0x18b)),console[_0x3242ae(0x1c5)](_0x3242ae(0x19a)),0x1;try{const _0x1743fa=_0x387ca3[0x0],_0x43252d=_0x3af54b['segmentPath'];let _0x53e15c=_0x1743fa;_0x43252d&&!_0x1743fa[_0x3242ae(0x1cc)]('/')&&(_0x53e15c=_0x43252d+'/'+_0x1743fa,_0x3af54b[_0x3242ae(0x19d)]&&console[_0x3242ae(0x1c5)](_0x3242ae(0x1be)+_0x53e15c));const _0x54b2cd=await withSpinner('Resolving\x20path\x20\x27'+_0x53e15c+_0x3242ae(0x17e),()=>_0x36509e[_0x3242ae(0x1ca)][_0x3242ae(0x198)](_0x53e15c),{'verbose':_0x3af54b[_0x3242ae(0x19d)]}),_0x39bd67=_0x54b2cd[_0x3242ae(0x1ba)];_0x3af54b['verbose']&&(console['error'](_0x3242ae(0x1a0)+_0x39bd67[_0x3242ae(0x1ea)]),console['error'](_0x3242ae(0x1e7)+_0x39bd67[_0x3242ae(0x19c)]));if(_0x39bd67[_0x3242ae(0x1ea)]===_0x3242ae(0x199))return console[_0x3242ae(0x1c5)](_0x3242ae(0x17d)),console[_0x3242ae(0x1c5)](_0x3242ae(0x188)),0x1;let _0x2ee9cd;if(_0x39bd67[_0x3242ae(0x1ea)]===_0x3242ae(0x1c9)){const _0x4e059c=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x36509e[_0x3242ae(0x1ca)][_0x3242ae(0x1e1)](_0x39bd67['parentId']),{'verbose':_0x3af54b[_0x3242ae(0x19d)]});_0x2ee9cd=_0x4e059c[_0x3242ae(0x1ba)];}else{if(!_0x39bd67[_0x3242ae(0x1ce)])throw new SDKError(ErrorCode['INTERNAL'],_0x3242ae(0x184));const _0x1a3935=await withSpinner(_0x3242ae(0x1e5),()=>_0x36509e[_0x3242ae(0x1ca)]['getSegmentSQL'](_0x39bd67[_0x3242ae(0x19c)],_0x39bd67['segmentId']),{'verbose':_0x3af54b[_0x3242ae(0x19d)]});_0x2ee9cd=_0x1a3935[_0x3242ae(0x1ba)];}return _0x3af54b[_0x3242ae(0x193)]===_0x3242ae(0x1b9)||_0x3af54b[_0x3242ae(0x193)]===_0x3242ae(0x1ed)?await handleSDKOutput([{'sql':_0x2ee9cd}],_0x3af54b):console[_0x3242ae(0x1cb)](_0x2ee9cd),0x0;}catch(_0x5660fb){if(_0x5660fb instanceof SDKError)return console[_0x3242ae(0x1c5)]('Error:\x20'+_0x5660fb[_0x3242ae(0x17f)]),_0x5660fb[_0x3242ae(0x1d5)]&&console[_0x3242ae(0x1c5)]('\x20\x20Cause:\x20'+_0x5660fb[_0x3242ae(0x1d5)]),0x1;throw _0x5660fb;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a23_0x392698(0x1b1);[a23_0x392698(0x1c7)]='Create\x20segment\x20folder\x20for\x20organization';async[a23_0x392698(0x19b)](_0x477e35){const _0x2edadf=a23_0x392698,{options:_0x1a867a,args:_0x3c6b87,tdx:_0x55ea74}=_0x477e35,_0x43b6df=_0x1a867a;if(_0x3c6b87[_0x2edadf(0x1c3)]<0x2)return console['error'](_0x2edadf(0x1a4)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3bcab4=_0x3c6b87[0x0],_0x33564d=_0x3c6b87[0x1];_0x43b6df[_0x2edadf(0x19d)]&&(console[_0x2edadf(0x1c5)]('Site:\x20'+_0x43b6df[_0x2edadf(0x1a6)]),console['error'](_0x2edadf(0x191)+_0x3bcab4),console[_0x2edadf(0x1c5)](_0x2edadf(0x190)+_0x33564d));let _0x394cec;if(_0x43b6df[_0x2edadf(0x1d0)]){const _0x364b12=_0x43b6df[_0x2edadf(0x1d0)],_0x1c2f5a=await withSpinner(_0x2edadf(0x179)+_0x3bcab4+_0x2edadf(0x17e),()=>_0x55ea74[_0x2edadf(0x1ca)][_0x2edadf(0x1b8)](_0x3bcab4),{'verbose':_0x43b6df[_0x2edadf(0x19d)]}),_0x12e1c0=_0x1c2f5a[_0x2edadf(0x1ba)],_0x3bab1c=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x364b12+_0x2edadf(0x17e),()=>_0x55ea74[_0x2edadf(0x1ca)][_0x2edadf(0x189)](_0x12e1c0,_0x364b12),{'verbose':_0x43b6df[_0x2edadf(0x19d)]});_0x394cec=_0x3bab1c['data'],_0x43b6df[_0x2edadf(0x19d)]&&console[_0x2edadf(0x1c5)](_0x2edadf(0x185)+_0x394cec);}const _0x121df8={'name':_0x33564d,'description':_0x43b6df[_0x2edadf(0x1c7)],'parentFolderId':_0x394cec},_0x1a2f20=await withSpinner(_0x2edadf(0x1dc)+_0x33564d+'\x27...',()=>_0x55ea74[_0x2edadf(0x1ca)][_0x2edadf(0x18f)](_0x3bcab4,_0x121df8),{'verbose':_0x43b6df[_0x2edadf(0x19d)]}),_0x465f60=_0x1a2f20['data'];return console[_0x2edadf(0x1c5)](_0x2edadf(0x181)+_0x465f60[_0x2edadf(0x1a2)]+_0x2edadf(0x18d)+_0x465f60['id']),await handleSDKOutput([_0x465f60],_0x43b6df),0x0;}}
@@ -1 +1 @@
1
- function a23_0x440d(_0x52efe3,_0xe22ccd){const _0x181e2b=a23_0x181e();return a23_0x440d=function(_0x440db7,_0x4b3aa9){_0x440db7=_0x440db7-0x105;let _0x3365b4=_0x181e2b[_0x440db7];return _0x3365b4;},a23_0x440d(_0x52efe3,_0xe22ccd);}const a23_0x4f0b06=a23_0x440d;(function(_0x477278,_0x344efa){const _0x4bbd44=a23_0x440d,_0x11ebd5=_0x477278();while(!![]){try{const _0x30cd6c=-parseInt(_0x4bbd44(0x105))/0x1+parseInt(_0x4bbd44(0x12c))/0x2*(-parseInt(_0x4bbd44(0x106))/0x3)+-parseInt(_0x4bbd44(0x114))/0x4*(parseInt(_0x4bbd44(0x115))/0x5)+-parseInt(_0x4bbd44(0x10c))/0x6+parseInt(_0x4bbd44(0x111))/0x7+-parseInt(_0x4bbd44(0x126))/0x8*(-parseInt(_0x4bbd44(0x11b))/0x9)+parseInt(_0x4bbd44(0x108))/0xa;if(_0x30cd6c===_0x344efa)break;else _0x11ebd5['push'](_0x11ebd5['shift']());}catch(_0x355cf6){_0x11ebd5['push'](_0x11ebd5['shift']());}}}(a23_0x181e,0xd5ba9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a23_0x181e(){const _0x450ef9=['1108HhlTnI','8165FxLBww','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','error','noCountPopulation','\x27\x20with\x20ID:\x20','1275174oIGYkn','data','Examples:','segment','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20','execute','createSegment','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','description','72QmQsnu','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segments','type','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','2NFCrEX','segment:create','verbose','Parent:\x20','includes','1741935vYfAaZ','4423482qkoXzB','Create\x20child\x20segment\x20with\x20filtering\x20rules','39375160OXiaIt','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','name','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','7873032DPdpbL','length','resolveParentId','\x27...','Resolving\x20folder\x20path\x20\x27','4505795wyVjoV','folder','Parent\x20path:\x20'];a23_0x181e=function(){return _0x450ef9;};return a23_0x181e();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x4f0b06(0x10a)]=a23_0x4f0b06(0x12d);[a23_0x4f0b06(0x125)]=a23_0x4f0b06(0x107);async[a23_0x4f0b06(0x121)](_0x5925fa){const _0x48b984=a23_0x4f0b06,{options:_0x2d6009,args:_0x5f4e18,tdx:_0x37a783}=_0x5925fa,_0x358813=_0x2d6009;if(_0x5f4e18[_0x48b984(0x10d)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x48b984(0x118)](_0x48b984(0x10b)),console[_0x48b984(0x118)](_0x48b984(0x11d)),console[_0x48b984(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x48b984(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x48b984(0x118)](_0x48b984(0x109)),0x1;const _0x40e8c4=_0x5f4e18[0x0],_0x1b239e=_0x2d6009[_0x48b984(0x116)];let _0x357dba=_0x40e8c4;_0x1b239e&&!_0x40e8c4[_0x48b984(0x130)]('/')&&(_0x357dba=_0x1b239e+'/'+_0x40e8c4,_0x358813['verbose']&&console['error'](_0x48b984(0x124)+_0x357dba));const _0x11a40d=parsePath(_0x357dba);if(_0x11a40d['segments'][_0x48b984(0x10d)]<0x2)return console[_0x48b984(0x118)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x48b984(0x118)](_0x48b984(0x117)),0x1;const _0x221464=_0x11a40d[_0x48b984(0x128)][0x0],_0x498ee1=getBaseName(_0x357dba),_0x52d8bf=getParentPath(_0x357dba);_0x358813[_0x48b984(0x12e)]&&(console[_0x48b984(0x118)](_0x48b984(0x123)+_0x358813['site']),console[_0x48b984(0x118)]('Target\x20path:\x20'+_0x357dba),console[_0x48b984(0x118)](_0x48b984(0x12f)+_0x221464),console[_0x48b984(0x118)]('Segment\x20name:\x20'+_0x498ee1),console[_0x48b984(0x118)](_0x48b984(0x113)+_0x52d8bf));const _0x3c6c42=await withSpinner(_0x48b984(0x12a)+_0x221464+_0x48b984(0x10f),()=>_0x37a783[_0x48b984(0x11e)][_0x48b984(0x10e)](_0x221464),{'verbose':_0x358813['verbose']}),_0x1b9f40=_0x3c6c42[_0x48b984(0x11c)];let _0x445de4;if(_0x11a40d[_0x48b984(0x128)]['length']>0x2){const _0x3278a4=await withSpinner(_0x48b984(0x110)+_0x52d8bf+'\x27...',()=>_0x37a783[_0x48b984(0x11e)]['resolvePathToResource'](_0x52d8bf),{'verbose':_0x358813[_0x48b984(0x12e)]}),_0x5f5654=_0x3278a4[_0x48b984(0x11c)];if(_0x5f5654['type']!==_0x48b984(0x112)&&_0x5f5654[_0x48b984(0x129)]!=='parent')return console[_0x48b984(0x118)](_0x48b984(0x127)),0x1;_0x445de4=_0x5f5654['folderId'];}else{if(_0x358813[_0x48b984(0x112)]){const _0x275f45=await withSpinner(_0x48b984(0x11f)+_0x358813[_0x48b984(0x112)]+_0x48b984(0x10f),()=>_0x37a783[_0x48b984(0x11e)][_0x48b984(0x12b)](_0x1b9f40,_0x358813[_0x48b984(0x112)]),{'verbose':_0x358813['verbose']});_0x445de4=_0x275f45[_0x48b984(0x11c)];}}_0x358813[_0x48b984(0x12e)]&&_0x445de4&&console[_0x48b984(0x118)]('Resolved\x20folder\x20ID:\x20'+_0x445de4);const _0x17e32d=await loadJSONFromOptions(_0x358813['rule'],_0x358813['ruleFile']),_0x4455be={'name':_0x498ee1,'description':_0x358813[_0x48b984(0x125)],'rule':_0x17e32d,'kind':_0x358813['kind']!==undefined?parseInt(_0x358813['kind'],0xa):undefined,'isVisible':_0x358813['invisible']?![]:undefined,'segmentFolderId':_0x445de4,'countPopulation':_0x358813[_0x48b984(0x119)]?![]:undefined},_0x2e59dd=await withSpinner('Creating\x20segment\x20\x27'+_0x498ee1+_0x48b984(0x10f),()=>_0x37a783[_0x48b984(0x11e)][_0x48b984(0x122)](_0x1b9f40,_0x4455be),{'verbose':_0x358813[_0x48b984(0x12e)]}),_0x58c996=_0x2e59dd['data'];return console[_0x48b984(0x118)]('✔\x20Created\x20segment\x20\x27'+_0x58c996[_0x48b984(0x10a)]+_0x48b984(0x11a)+_0x58c996['id']),_0x357dba!==_0x40e8c4&&console[_0x48b984(0x118)](_0x48b984(0x120)+_0x357dba),await handleSDKOutput([_0x58c996],_0x358813),0x0;}}
1
+ const a24_0x11f326=a24_0x2e89;function a24_0x2e89(_0x4dc628,_0x280a08){const _0x58ca22=a24_0x58ca();return a24_0x2e89=function(_0x2e8918,_0x3b9edb){_0x2e8918=_0x2e8918-0x1d2;let _0x3d9a13=_0x58ca22[_0x2e8918];return _0x3d9a13;},a24_0x2e89(_0x4dc628,_0x280a08);}(function(_0x356cdb,_0x536506){const _0x570fd7=a24_0x2e89,_0x36d40d=_0x356cdb();while(!![]){try{const _0x3136dd=parseInt(_0x570fd7(0x1e6))/0x1+-parseInt(_0x570fd7(0x1da))/0x2+-parseInt(_0x570fd7(0x1df))/0x3+parseInt(_0x570fd7(0x1f3))/0x4*(-parseInt(_0x570fd7(0x1fb))/0x5)+-parseInt(_0x570fd7(0x206))/0x6*(-parseInt(_0x570fd7(0x1e3))/0x7)+-parseInt(_0x570fd7(0x1ee))/0x8*(parseInt(_0x570fd7(0x1f6))/0x9)+parseInt(_0x570fd7(0x1f9))/0xa;if(_0x3136dd===_0x536506)break;else _0x36d40d['push'](_0x36d40d['shift']());}catch(_0x59ff22){_0x36d40d['push'](_0x36d40d['shift']());}}}(a24_0x58ca,0xc6e3f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a24_0x58ca(){const _0x59aba9=['description','\x20\x20\x20Path:\x20','21geLnmF','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20relative\x20path\x20to:\x20','1590090NMqmMV','segment','parent','Resolved\x20folder\x20ID:\x20','Parent:\x20','segmentPath','Examples:','folderId','219224VxMGmN','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Segment\x20name:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveFolderId','1324rTMwZJ','length','name','279UfbJVH','kind','type','24505180uboMJf','rule','11085yBaTfh','createSegment','site','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segments','error','resolvePathToResource','1695552CWgVLD','✔\x20Created\x20segment\x20\x27','\x27...','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','resolveParentId','Create\x20child\x20segment\x20with\x20filtering\x20rules','includes','data','2083008YXyYPm','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Creating\x20segment\x20\x27','Target\x20path:\x20','4346715RgDkbm','noCountPopulation'];a24_0x58ca=function(){return _0x59aba9;};return a24_0x58ca();}export class SegmentCreateCommand extends BaseCommand{[a24_0x11f326(0x1f5)]=a24_0x11f326(0x1db);[a24_0x11f326(0x1e1)]=a24_0x11f326(0x1d7);async['execute'](_0x3f70da){const _0x3f7f13=a24_0x11f326,{options:_0x574a2d,args:_0x12a380,tdx:_0x431415}=_0x3f70da,_0x54dd68=_0x574a2d;if(_0x12a380[_0x3f7f13(0x1f4)]===0x0)return console[_0x3f7f13(0x204)](_0x3f7f13(0x1f1)),console['error'](_0x3f7f13(0x1ef)),console[_0x3f7f13(0x204)](_0x3f7f13(0x1ec)),console['error'](_0x3f7f13(0x1dc)),console[_0x3f7f13(0x204)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x3f7f13(0x202)),0x1;const _0x120a35=_0x12a380[0x0],_0x44687d=_0x574a2d[_0x3f7f13(0x1eb)];let _0x31144b=_0x120a35;_0x44687d&&!_0x120a35[_0x3f7f13(0x1d8)]('/')&&(_0x31144b=_0x44687d+'/'+_0x120a35,_0x54dd68[_0x3f7f13(0x201)]&&console[_0x3f7f13(0x204)](_0x3f7f13(0x1e5)+_0x31144b));const _0x262dee=parsePath(_0x31144b);if(_0x262dee[_0x3f7f13(0x203)][_0x3f7f13(0x1f4)]<0x2)return console[_0x3f7f13(0x204)](_0x3f7f13(0x200)),console[_0x3f7f13(0x204)](_0x3f7f13(0x1fe)),0x1;const _0x30dab3=_0x262dee[_0x3f7f13(0x203)][0x0],_0xa63857=getBaseName(_0x31144b),_0x35ca4e=getParentPath(_0x31144b);_0x54dd68[_0x3f7f13(0x201)]&&(console[_0x3f7f13(0x204)]('Site:\x20'+_0x54dd68[_0x3f7f13(0x1fd)]),console[_0x3f7f13(0x204)](_0x3f7f13(0x1de)+_0x31144b),console['error'](_0x3f7f13(0x1ea)+_0x30dab3),console[_0x3f7f13(0x204)](_0x3f7f13(0x1f0)+_0xa63857),console[_0x3f7f13(0x204)]('Parent\x20path:\x20'+_0x35ca4e));const _0x17a218=await withSpinner(_0x3f7f13(0x1d5)+_0x30dab3+_0x3f7f13(0x1d3),()=>_0x431415[_0x3f7f13(0x1e7)][_0x3f7f13(0x1d6)](_0x30dab3),{'verbose':_0x54dd68[_0x3f7f13(0x201)]}),_0xa38b7d=_0x17a218[_0x3f7f13(0x1d9)];let _0x2f56f9;if(_0x262dee['segments'][_0x3f7f13(0x1f4)]>0x2){const _0x5d5356=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x35ca4e+_0x3f7f13(0x1d3),()=>_0x431415[_0x3f7f13(0x1e7)][_0x3f7f13(0x205)](_0x35ca4e),{'verbose':_0x54dd68['verbose']}),_0x3ce7fa=_0x5d5356[_0x3f7f13(0x1d9)];if(_0x3ce7fa[_0x3f7f13(0x1f8)]!==_0x3f7f13(0x1ff)&&_0x3ce7fa[_0x3f7f13(0x1f8)]!==_0x3f7f13(0x1e8))return console[_0x3f7f13(0x204)](_0x3f7f13(0x1e4)),0x1;_0x2f56f9=_0x3ce7fa[_0x3f7f13(0x1ed)];}else{if(_0x54dd68[_0x3f7f13(0x1ff)]){const _0x1753ca=await withSpinner('Resolving\x20folder\x20\x27'+_0x54dd68[_0x3f7f13(0x1ff)]+_0x3f7f13(0x1d3),()=>_0x431415['segment'][_0x3f7f13(0x1f2)](_0xa38b7d,_0x54dd68[_0x3f7f13(0x1ff)]),{'verbose':_0x54dd68['verbose']});_0x2f56f9=_0x1753ca[_0x3f7f13(0x1d9)];}}_0x54dd68['verbose']&&_0x2f56f9&&console['error'](_0x3f7f13(0x1e9)+_0x2f56f9);const _0x2e17a0=await loadJSONFromOptions(_0x54dd68[_0x3f7f13(0x1fa)],_0x54dd68['ruleFile']),_0x2ec336={'name':_0xa63857,'description':_0x54dd68[_0x3f7f13(0x1e1)],'rule':_0x2e17a0,'kind':_0x54dd68[_0x3f7f13(0x1f7)]!==undefined?parseInt(_0x54dd68['kind'],0xa):undefined,'isVisible':_0x54dd68['invisible']?![]:undefined,'segmentFolderId':_0x2f56f9,'countPopulation':_0x54dd68[_0x3f7f13(0x1e0)]?![]:undefined},_0x21738b=await withSpinner(_0x3f7f13(0x1dd)+_0xa63857+_0x3f7f13(0x1d3),()=>_0x431415['segment'][_0x3f7f13(0x1fc)](_0xa38b7d,_0x2ec336),{'verbose':_0x54dd68[_0x3f7f13(0x201)]}),_0x2c9183=_0x21738b[_0x3f7f13(0x1d9)];return console[_0x3f7f13(0x204)](_0x3f7f13(0x1d2)+_0x2c9183[_0x3f7f13(0x1f5)]+_0x3f7f13(0x1d4)+_0x2c9183['id']),_0x31144b!==_0x120a35&&console[_0x3f7f13(0x204)](_0x3f7f13(0x1e2)+_0x31144b),await handleSDKOutput([_0x2c9183],_0x54dd68),0x0;}}
@@ -1 +1 @@
1
- const a24_0x51d6c0=a24_0x5a50;(function(_0x447692,_0x4fb1aa){const _0x1eba63=a24_0x5a50,_0x432114=_0x447692();while(!![]){try{const _0x4abf5c=parseInt(_0x1eba63(0x8f))/0x1*(parseInt(_0x1eba63(0x7f))/0x2)+-parseInt(_0x1eba63(0x7b))/0x3*(parseInt(_0x1eba63(0x90))/0x4)+-parseInt(_0x1eba63(0x83))/0x5+parseInt(_0x1eba63(0x7d))/0x6*(-parseInt(_0x1eba63(0x7e))/0x7)+-parseInt(_0x1eba63(0x8b))/0x8+-parseInt(_0x1eba63(0x7a))/0x9*(-parseInt(_0x1eba63(0x8e))/0xa)+-parseInt(_0x1eba63(0x88))/0xb*(-parseInt(_0x1eba63(0x84))/0xc);if(_0x4abf5c===_0x4fb1aa)break;else _0x432114['push'](_0x432114['shift']());}catch(_0x397377){_0x432114['push'](_0x432114['shift']());}}}(a24_0x1b8d,0x2ac25));function a24_0x5a50(_0x442f2c,_0x4a2e9a){const _0x1b8da6=a24_0x1b8d();return a24_0x5a50=function(_0x5a50a7,_0x128eeb){_0x5a50a7=_0x5a50a7-0x74;let _0x42eaa9=_0x1b8da6[_0x5a50a7];return _0x42eaa9;},a24_0x5a50(_0x442f2c,_0x4a2e9a);}function a24_0x1b8d(){const _0x4dcdb6=['segment:fields','275VIDHqA','\x27...','site','2654568UJoVHK','name','Parent\x20segment:\x20','39170WkZSYP','240721OiuBYG','112928gysVKK','description','segment','error','Site:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','verbose','Listing\x20fields\x20for\x20\x27','333DRGcgQ','12mIulXt','length','14568LUuxus','133YlRjcK','2qfKBVj','\x20field','listFields','execute','467015XMBudd','179412MRKwUl','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Found\x20'];a24_0x1b8d=function(){return _0x4dcdb6;};return a24_0x1b8d();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x51d6c0(0x8c)]=a24_0x51d6c0(0x87);[a24_0x51d6c0(0x91)]='List\x20available\x20fields\x20for\x20segmentation';async[a24_0x51d6c0(0x82)](_0x2221cc){const _0x1519de=a24_0x51d6c0,{options:_0x16c0ee,args:_0x35c433,tdx:_0x571edb}=_0x2221cc;if(_0x35c433[_0x1519de(0x7c)]===0x0)return console[_0x1519de(0x75)](_0x1519de(0x85)),console[_0x1519de(0x75)](_0x1519de(0x77)),0x1;const _0x34052b=_0x35c433[0x0];_0x16c0ee[_0x1519de(0x78)]&&(console['error'](_0x1519de(0x76)+_0x16c0ee[_0x1519de(0x8a)]),console['error'](_0x1519de(0x8d)+_0x34052b));const _0x54ebfc=await withSpinner(_0x1519de(0x79)+_0x34052b+_0x1519de(0x89),()=>_0x571edb[_0x1519de(0x74)][_0x1519de(0x81)](_0x34052b),{'verbose':_0x16c0ee[_0x1519de(0x78)]}),_0x1521a1=_0x54ebfc['data'];return console[_0x1519de(0x75)](_0x1519de(0x86)+_0x1521a1[_0x1519de(0x7c)]+_0x1519de(0x80)+(_0x1521a1[_0x1519de(0x7c)]!==0x1?'s':'')),await handleSDKOutput(_0x1521a1,_0x16c0ee),0x0;}}
1
+ function a25_0x497a(_0x5ef630,_0x4e57d6){const _0x5aad47=a25_0x5aad();return a25_0x497a=function(_0x497a09,_0x315e40){_0x497a09=_0x497a09-0x1d4;let _0x314eb3=_0x5aad47[_0x497a09];return _0x314eb3;},a25_0x497a(_0x5ef630,_0x4e57d6);}const a25_0xd1f998=a25_0x497a;(function(_0x40d86e,_0x51ba1d){const _0x333688=a25_0x497a,_0x152987=_0x40d86e();while(!![]){try{const _0x31e12a=parseInt(_0x333688(0x1d9))/0x1+parseInt(_0x333688(0x1d6))/0x2+parseInt(_0x333688(0x1e6))/0x3*(parseInt(_0x333688(0x1ec))/0x4)+-parseInt(_0x333688(0x1e5))/0x5*(parseInt(_0x333688(0x1d8))/0x6)+-parseInt(_0x333688(0x1dd))/0x7+parseInt(_0x333688(0x1dc))/0x8*(parseInt(_0x333688(0x1d4))/0x9)+parseInt(_0x333688(0x1e4))/0xa*(-parseInt(_0x333688(0x1e1))/0xb);if(_0x31e12a===_0x51ba1d)break;else _0x152987['push'](_0x152987['shift']());}catch(_0x4c2090){_0x152987['push'](_0x152987['shift']());}}}(a25_0x5aad,0xceb35));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x5aad(){const _0x21fc44=['Parent\x20segment:\x20','Site:\x20','50788BCyOUl','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Found\x20','verbose','9594vnPATZ','segment:fields','1801786saeNXY','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','36jYMylH','593656aMjcOb','\x27...','execute','304yEqUfY','3328871jaEzPL','segment','Listing\x20fields\x20for\x20\x27','error','118228HJReBu','length','List\x20available\x20fields\x20for\x20segmentation','500qZWoWV','311495nsqLdM','165ELnaKs','\x20field','listFields','site'];a25_0x5aad=function(){return _0x21fc44;};return a25_0x5aad();}export class SegmentFieldsCommand extends BaseCommand{['name']=a25_0xd1f998(0x1d5);['description']=a25_0xd1f998(0x1e3);async[a25_0xd1f998(0x1db)](_0x46993f){const _0x273ab6=a25_0xd1f998,{options:_0x52bf2f,args:_0x5e8b73,tdx:_0x1f7618}=_0x46993f;if(_0x5e8b73['length']===0x0)return console[_0x273ab6(0x1e0)](_0x273ab6(0x1ed)),console['error'](_0x273ab6(0x1d7)),0x1;const _0x54b588=_0x5e8b73[0x0];_0x52bf2f['verbose']&&(console['error'](_0x273ab6(0x1eb)+_0x52bf2f[_0x273ab6(0x1e9)]),console['error'](_0x273ab6(0x1ea)+_0x54b588));const _0x1b5e17=await withSpinner(_0x273ab6(0x1df)+_0x54b588+_0x273ab6(0x1da),()=>_0x1f7618[_0x273ab6(0x1de)][_0x273ab6(0x1e8)](_0x54b588),{'verbose':_0x52bf2f[_0x273ab6(0x1ef)]}),_0x120bba=_0x1b5e17['data'];return console[_0x273ab6(0x1e0)](_0x273ab6(0x1ee)+_0x120bba[_0x273ab6(0x1e2)]+_0x273ab6(0x1e7)+(_0x120bba[_0x273ab6(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x120bba,_0x52bf2f),0x0;}}
@@ -1 +1 @@
1
- const a25_0x1ca26f=a25_0x2b51;function a25_0x2b51(_0x2df5f7,_0x2efd0b){const _0xb91fe6=a25_0xb91f();return a25_0x2b51=function(_0x2b51c0,_0x560188){_0x2b51c0=_0x2b51c0-0x143;let _0x47e7d2=_0xb91fe6[_0x2b51c0];return _0x47e7d2;},a25_0x2b51(_0x2df5f7,_0x2efd0b);}(function(_0x3e67e3,_0x494a9f){const _0xa477d0=a25_0x2b51,_0x43d4ad=_0x3e67e3();while(!![]){try{const _0x1c60d8=-parseInt(_0xa477d0(0x149))/0x1+-parseInt(_0xa477d0(0x157))/0x2+-parseInt(_0xa477d0(0x154))/0x3*(parseInt(_0xa477d0(0x150))/0x4)+-parseInt(_0xa477d0(0x14a))/0x5*(-parseInt(_0xa477d0(0x14c))/0x6)+parseInt(_0xa477d0(0x147))/0x7*(parseInt(_0xa477d0(0x144))/0x8)+parseInt(_0xa477d0(0x155))/0x9*(-parseInt(_0xa477d0(0x14b))/0xa)+parseInt(_0xa477d0(0x152))/0xb*(parseInt(_0xa477d0(0x153))/0xc);if(_0x1c60d8===_0x494a9f)break;else _0x43d4ad['push'](_0x43d4ad['shift']());}catch(_0x33f305){_0x43d4ad['push'](_0x43d4ad['shift']());}}}(a25_0xb91f,0xcbdaa));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a25_0x1ca26f(0x143)]=a25_0x1ca26f(0x145);[a25_0x1ca26f(0x14d)]=a25_0x1ca26f(0x148);async['execute'](_0x3972b7){const _0x37b189=a25_0x1ca26f,{options:_0x4e7edc}=_0x3972b7;try{const _0x58ca3d=_0x4e7edc['segmentPath'];if(!_0x58ca3d)return _0x4e7edc[_0x37b189(0x159)]===_0x37b189(0x158)||_0x4e7edc[_0x37b189(0x159)]===_0x37b189(0x14e)?console[_0x37b189(0x15c)](JSON['stringify']({'path':'/','type':_0x37b189(0x15b)})):console[_0x37b189(0x15c)]('/'),0x0;if(_0x4e7edc[_0x37b189(0x159)]===_0x37b189(0x158)||_0x4e7edc['format']==='jsonl'){const _0x1eda87={'path':_0x58ca3d};console[_0x37b189(0x15c)](JSON[_0x37b189(0x156)](_0x1eda87));}else console[_0x37b189(0x15c)](_0x58ca3d),_0x4e7edc['verbose']&&(console[_0x37b189(0x15a)](''),console[_0x37b189(0x15a)]('Context\x20details:'),console[_0x37b189(0x15a)](_0x37b189(0x151)+_0x58ca3d),console[_0x37b189(0x15a)](''),console[_0x37b189(0x15a)](_0x37b189(0x14f)),console[_0x37b189(0x15a)](_0x37b189(0x146)));return 0x0;}catch(_0x15066a){throw _0x15066a;}}}function a25_0xb91f(){const _0x5bd924=['segment:pwd','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','42dYhqZO','Show\x20current\x20segment/folder\x20context','732652ICwaLe','2911430HMzBTp','4007770gYmrSg','12WcdmqU','description','jsonl','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2172WXHWsV','\x20\x20Path:\x20','297bOBjso','1236120kiVogn','7290AYuzIi','9qcCUId','stringify','2669654DvTHpN','json','format','error','root','log','name','902520TSFPDQ'];a25_0xb91f=function(){return _0x5bd924;};return a25_0xb91f();}
1
+ function a26_0x1ecf(_0xf07b1b,_0x44da16){const _0x4023d9=a26_0x4023();return a26_0x1ecf=function(_0x1ecfc3,_0x253e9a){_0x1ecfc3=_0x1ecfc3-0x78;let _0x38b5e6=_0x4023d9[_0x1ecfc3];return _0x38b5e6;},a26_0x1ecf(_0xf07b1b,_0x44da16);}const a26_0x823619=a26_0x1ecf;(function(_0xcebbba,_0x2f10fe){const _0x149b42=a26_0x1ecf,_0x3f7c0a=_0xcebbba();while(!![]){try{const _0x3eac96=parseInt(_0x149b42(0x82))/0x1*(-parseInt(_0x149b42(0x7a))/0x2)+parseInt(_0x149b42(0x8e))/0x3*(parseInt(_0x149b42(0x8b))/0x4)+parseInt(_0x149b42(0x7c))/0x5*(-parseInt(_0x149b42(0x91))/0x6)+-parseInt(_0x149b42(0x8c))/0x7*(parseInt(_0x149b42(0x93))/0x8)+-parseInt(_0x149b42(0x86))/0x9*(-parseInt(_0x149b42(0x84))/0xa)+-parseInt(_0x149b42(0x92))/0xb+-parseInt(_0x149b42(0x89))/0xc*(-parseInt(_0x149b42(0x88))/0xd);if(_0x3eac96===_0x2f10fe)break;else _0x3f7c0a['push'](_0x3f7c0a['shift']());}catch(_0x44000f){_0x3f7c0a['push'](_0x3f7c0a['shift']());}}}(a26_0x4023,0x95ad6));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{['name']=a26_0x823619(0x7f);[a26_0x823619(0x7b)]='Show\x20current\x20segment/folder\x20context';async[a26_0x823619(0x79)](_0x1dc332){const _0x2b8e1c=a26_0x823619,{options:_0x403e76}=_0x1dc332;try{const _0x330689=_0x403e76[_0x2b8e1c(0x85)];if(!_0x330689)return _0x403e76[_0x2b8e1c(0x7e)]==='json'||_0x403e76[_0x2b8e1c(0x7e)]===_0x2b8e1c(0x8a)?console['log'](JSON[_0x2b8e1c(0x8f)]({'path':'/','type':_0x2b8e1c(0x87)})):console[_0x2b8e1c(0x8d)]('/'),0x0;if(_0x403e76[_0x2b8e1c(0x7e)]===_0x2b8e1c(0x94)||_0x403e76[_0x2b8e1c(0x7e)]===_0x2b8e1c(0x8a)){const _0x476c38={'path':_0x330689};console[_0x2b8e1c(0x8d)](JSON['stringify'](_0x476c38));}else console['log'](_0x330689),_0x403e76[_0x2b8e1c(0x7d)]&&(console[_0x2b8e1c(0x78)](''),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x80)),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x83)+_0x330689),console[_0x2b8e1c(0x78)](''),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x81)),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x90)));return 0x0;}catch(_0x1b8280){throw _0x1b8280;}}}function a26_0x4023(){const _0x5e4aae=['61350IVanqm','segmentPath','909fDNaKe','root','1016587KPoBLM','204IyuEqD','jsonl','230196BUnEoP','26383GBEKJC','log','9jLKxPu','stringify','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','14724ZfAKjw','5549709FikWns','1096coQWsG','json','error','execute','2AZPMyC','description','850LJJClN','verbose','format','segment:pwd','Context\x20details:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','70535VzqfbU','\x20\x20Path:\x20'];a26_0x4023=function(){return _0x5e4aae;};return a26_0x4023();}
@@ -1 +1 @@
1
- const a26_0x112971=a26_0x4651;(function(_0x4d2e33,_0x2ce93a){const _0x460cdf=a26_0x4651,_0x240ea5=_0x4d2e33();while(!![]){try{const _0x54eba3=-parseInt(_0x460cdf(0x1b6))/0x1*(-parseInt(_0x460cdf(0x195))/0x2)+parseInt(_0x460cdf(0x19b))/0x3+parseInt(_0x460cdf(0x1a9))/0x4+parseInt(_0x460cdf(0x1aa))/0x5+parseInt(_0x460cdf(0x1a6))/0x6+-parseInt(_0x460cdf(0x1a8))/0x7+-parseInt(_0x460cdf(0x1b3))/0x8;if(_0x54eba3===_0x2ce93a)break;else _0x240ea5['push'](_0x240ea5['shift']());}catch(_0x58e73c){_0x240ea5['push'](_0x240ea5['shift']());}}}(a26_0x55ec,0xa0cdd));function a26_0x4651(_0x239dc6,_0x500465){const _0x55ecab=a26_0x55ec();return a26_0x4651=function(_0x4651d5,_0x3ee7ef){_0x4651d5=_0x4651d5-0x194;let _0x3ae61e=_0x55ecab[_0x4651d5];return _0x3ae61e;},a26_0x4651(_0x239dc6,_0x500465);}function a26_0x55ec(){const _0x133c35=['3816955YwGmeU','description','segmentId','Resolved\x20type:\x20','folder','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','INTERNAL','Examples:','15362720bXvIbJ','type','name','1KSQjyw','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','parentId','segmentName','error','includes','segment','Updating\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','317054YPXnuF','segment:update','Error:\x20Cannot\x20update\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','resolveFolderId','2699709xQopvs','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','✔\x20Updated\x20segment\x20\x27','\x27...','length','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','kind','execute','updateSegmentById','rule','5338692Eacvbt','Segment\x20ID:\x20','3666558SBWIhy','1564736xSnGRy'];a26_0x55ec=function(){return _0x133c35;};return a26_0x55ec();}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';export class SegmentUpdateCommand extends BaseCommand{[a26_0x112971(0x1b5)]=a26_0x112971(0x196);[a26_0x112971(0x1ab)]='Update\x20existing\x20child\x20segment';async[a26_0x112971(0x1a3)](_0x5f4830){const _0x54cc49=a26_0x112971,{options:_0x5d8555,args:_0x2a8578,tdx:_0x49992c}=_0x5f4830,_0x2d39af=_0x5d8555;if(_0x2a8578[_0x54cc49(0x19f)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x54cc49(0x1ba)](_0x54cc49(0x1b7)),console[_0x54cc49(0x1ba)](_0x54cc49(0x1b2)),console['error'](_0x54cc49(0x198)),console[_0x54cc49(0x1ba)](_0x54cc49(0x1a0)),0x1;const _0x117be4=_0x2a8578[0x0],_0x50a79f=_0x5d8555['segmentPath'];let _0x39618d=_0x117be4;_0x50a79f&&!_0x117be4[_0x54cc49(0x1bb)]('/')&&(_0x39618d=_0x50a79f+'/'+_0x117be4,_0x2d39af[_0x54cc49(0x199)]&&console[_0x54cc49(0x1ba)]('Resolved\x20relative\x20path\x20to:\x20'+_0x39618d));const _0x170b8f=await withSpinner('Resolving\x20path\x20\x27'+_0x39618d+'\x27...',()=>_0x49992c['segment']['resolvePathToResource'](_0x39618d),{'verbose':_0x2d39af[_0x54cc49(0x199)]}),_0x44ff94=_0x170b8f[_0x54cc49(0x1a1)];_0x2d39af[_0x54cc49(0x199)]&&console[_0x54cc49(0x1ba)](_0x54cc49(0x1ad)+_0x44ff94['type']);if(_0x44ff94[_0x54cc49(0x1b4)]!=='segment')return console[_0x54cc49(0x1ba)](_0x54cc49(0x197)+_0x44ff94['type']+_0x54cc49(0x19c)),console[_0x54cc49(0x1ba)](_0x54cc49(0x1b0)),0x1;if(!_0x44ff94[_0x54cc49(0x1ac)])throw new SDKError(ErrorCode[_0x54cc49(0x1b1)],_0x54cc49(0x1be));const _0x155684=_0x44ff94[_0x54cc49(0x1b8)],_0x47575b=_0x44ff94['segmentId'];_0x2d39af['verbose']&&(console['error'](_0x54cc49(0x194)+_0x155684),console[_0x54cc49(0x1ba)](_0x54cc49(0x1a7)+_0x47575b));let _0x254bfa;if(_0x2d39af[_0x54cc49(0x1ae)]){const _0x2544d8=_0x2d39af[_0x54cc49(0x1ae)],_0x55d64f=await withSpinner('Resolving\x20folder\x20\x27'+_0x2544d8+_0x54cc49(0x19e),()=>_0x49992c[_0x54cc49(0x1bc)][_0x54cc49(0x19a)](_0x155684,_0x2544d8),{'verbose':_0x2d39af[_0x54cc49(0x199)]});_0x254bfa=parseInt(_0x55d64f[_0x54cc49(0x1a1)],0xa),_0x2d39af[_0x54cc49(0x199)]&&console[_0x54cc49(0x1ba)](_0x54cc49(0x1af)+_0x254bfa);}const _0x12acf6=await loadJSONFromOptions(_0x2d39af[_0x54cc49(0x1a5)],_0x2d39af['ruleFile']),_0x2a931c={'name':_0x2d39af[_0x54cc49(0x1b5)],'description':_0x2d39af[_0x54cc49(0x1ab)],'rule':_0x12acf6,'kind':_0x2d39af[_0x54cc49(0x1a2)]!==undefined?parseInt(_0x2d39af[_0x54cc49(0x1a2)],0xa):undefined,'segmentFolderId':_0x254bfa},_0xd9f82b=await withSpinner(_0x54cc49(0x1bd)+_0x44ff94[_0x54cc49(0x1b9)]+_0x54cc49(0x19e),()=>_0x49992c['segment'][_0x54cc49(0x1a4)](_0x155684,_0x47575b,_0x2a931c),{'verbose':_0x2d39af[_0x54cc49(0x199)]}),_0x40fc95=_0xd9f82b['data'];return console[_0x54cc49(0x1ba)](_0x54cc49(0x19d)+_0x40fc95[_0x54cc49(0x1b5)]+'\x27'),_0x39618d!==_0x117be4&&console[_0x54cc49(0x1ba)]('\x20\x20\x20Path:\x20'+_0x39618d),await handleSDKOutput([_0x40fc95],_0x2d39af),0x0;}}
1
+ function a27_0x5703(_0x203df6,_0x3db6c){const _0x8e8391=a27_0x8e83();return a27_0x5703=function(_0x5703af,_0x1777ec){_0x5703af=_0x5703af-0x16f;let _0x44100c=_0x8e8391[_0x5703af];return _0x44100c;},a27_0x5703(_0x203df6,_0x3db6c);}const a27_0x1532e2=a27_0x5703;(function(_0x5747c0,_0xd821b2){const _0x4e3370=a27_0x5703,_0x9972ef=_0x5747c0();while(!![]){try{const _0x5bd051=-parseInt(_0x4e3370(0x194))/0x1+-parseInt(_0x4e3370(0x173))/0x2+-parseInt(_0x4e3370(0x171))/0x3*(parseInt(_0x4e3370(0x172))/0x4)+parseInt(_0x4e3370(0x187))/0x5+parseInt(_0x4e3370(0x180))/0x6*(-parseInt(_0x4e3370(0x193))/0x7)+parseInt(_0x4e3370(0x184))/0x8*(-parseInt(_0x4e3370(0x17e))/0x9)+parseInt(_0x4e3370(0x170))/0xa;if(_0x5bd051===_0xd821b2)break;else _0x9972ef['push'](_0x9972ef['shift']());}catch(_0x1bb6e4){_0x9972ef['push'](_0x9972ef['shift']());}}}(a27_0x8e83,0x27a6d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a27_0x8e83(){const _0x3c4d9c=['2239384UYOQEh','\x27...','kind','1330245zWSgMe','Update\x20existing\x20child\x20segment','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20update\x20','Segment\x20ID:\x20','error','resolveFolderId','verbose','rule','Parent\x20ID:\x20','length','Resolving\x20folder\x20\x27','119hXHnNK','62699xVJOIV','\x20\x20\x20Path:\x20','segment:update','execute','Resolving\x20path\x20\x27','Updating\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','parentId','7533370CbEliu','348JRoGAs','9780mdGIcZ','416446GhRGgu','resolvePathToResource','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentId','segmentName','data','type','segment','description','name','9iFQZSE','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','7944SiMhOs','Examples:','segmentPath','✔\x20Updated\x20segment\x20\x27'];a27_0x8e83=function(){return _0x3c4d9c;};return a27_0x8e83();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a27_0x1532e2(0x17d)]=a27_0x1532e2(0x196);['description']=a27_0x1532e2(0x188);async[a27_0x1532e2(0x197)](_0x417827){const _0x49cb8a=a27_0x1532e2,{options:_0xdaa1b7,args:_0x5d8446,tdx:_0x5df945}=_0x417827,_0x50db6a=_0xdaa1b7;if(_0x5d8446[_0x49cb8a(0x191)]===0x0)return console['error'](_0x49cb8a(0x176)),console[_0x49cb8a(0x18c)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x49cb8a(0x18c)](_0x49cb8a(0x181)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x49cb8a(0x18c)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2a5e42=_0x5d8446[0x0],_0x34b8db=_0xdaa1b7[_0x49cb8a(0x182)];let _0x4d7196=_0x2a5e42;_0x34b8db&&!_0x2a5e42['includes']('/')&&(_0x4d7196=_0x34b8db+'/'+_0x2a5e42,_0x50db6a[_0x49cb8a(0x18e)]&&console[_0x49cb8a(0x18c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4d7196));const _0x19c5d6=await withSpinner(_0x49cb8a(0x198)+_0x4d7196+'\x27...',()=>_0x5df945[_0x49cb8a(0x17b)][_0x49cb8a(0x174)](_0x4d7196),{'verbose':_0x50db6a[_0x49cb8a(0x18e)]}),_0x1db437=_0x19c5d6['data'];_0x50db6a[_0x49cb8a(0x18e)]&&console[_0x49cb8a(0x18c)]('Resolved\x20type:\x20'+_0x1db437['type']);if(_0x1db437[_0x49cb8a(0x17a)]!=='segment')return console[_0x49cb8a(0x18c)](_0x49cb8a(0x18a)+_0x1db437['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x49cb8a(0x18c)](_0x49cb8a(0x17f)),0x1;if(!_0x1db437[_0x49cb8a(0x177)])throw new SDKError(ErrorCode[_0x49cb8a(0x19b)],_0x49cb8a(0x19a));const _0x4ac118=_0x1db437[_0x49cb8a(0x16f)],_0x3ccd1c=_0x1db437[_0x49cb8a(0x177)];_0x50db6a[_0x49cb8a(0x18e)]&&(console[_0x49cb8a(0x18c)](_0x49cb8a(0x190)+_0x4ac118),console[_0x49cb8a(0x18c)](_0x49cb8a(0x18b)+_0x3ccd1c));let _0x40b853;if(_0x50db6a[_0x49cb8a(0x175)]){const _0x366305=_0x50db6a[_0x49cb8a(0x175)],_0x3bdde6=await withSpinner(_0x49cb8a(0x192)+_0x366305+'\x27...',()=>_0x5df945['segment'][_0x49cb8a(0x18d)](_0x4ac118,_0x366305),{'verbose':_0x50db6a['verbose']});_0x40b853=parseInt(_0x3bdde6[_0x49cb8a(0x179)],0xa),_0x50db6a['verbose']&&console[_0x49cb8a(0x18c)](_0x49cb8a(0x189)+_0x40b853);}const _0x4d2c30=await loadJSONFromOptions(_0x50db6a[_0x49cb8a(0x18f)],_0x50db6a['ruleFile']),_0x22c7ca={'name':_0x50db6a[_0x49cb8a(0x17d)],'description':_0x50db6a[_0x49cb8a(0x17c)],'rule':_0x4d2c30,'kind':_0x50db6a[_0x49cb8a(0x186)]!==undefined?parseInt(_0x50db6a[_0x49cb8a(0x186)],0xa):undefined,'segmentFolderId':_0x40b853},_0x2ce931=await withSpinner(_0x49cb8a(0x199)+_0x1db437[_0x49cb8a(0x178)]+_0x49cb8a(0x185),()=>_0x5df945['segment']['updateSegmentById'](_0x4ac118,_0x3ccd1c,_0x22c7ca),{'verbose':_0x50db6a[_0x49cb8a(0x18e)]}),_0xc57ce1=_0x2ce931[_0x49cb8a(0x179)];return console['error'](_0x49cb8a(0x183)+_0xc57ce1[_0x49cb8a(0x17d)]+'\x27'),_0x4d7196!==_0x2a5e42&&console[_0x49cb8a(0x18c)](_0x49cb8a(0x195)+_0x4d7196),await handleSDKOutput([_0xc57ce1],_0x50db6a),0x0;}}