@treasuredata/tdx 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.js +1 -1
  5. package/dist/client/llm-client.js +1 -1
  6. package/dist/client/rate-limiter.js +1 -1
  7. package/dist/client/td-client.js +1 -1
  8. package/dist/client/trino-client.js +1 -1
  9. package/dist/client/workflow-client.js +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/context-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/job-command.js +1 -1
  19. package/dist/commands/llm-command.js +1 -1
  20. package/dist/commands/llm-proxy.js +1 -1
  21. package/dist/commands/parent-segment-command.js +1 -1
  22. package/dist/commands/profiles-command.js +1 -1
  23. package/dist/commands/query-command.js +1 -1
  24. package/dist/commands/segment-command.js +1 -1
  25. package/dist/commands/segment-create-command.js +1 -1
  26. package/dist/commands/segment-fields-command.js +1 -1
  27. package/dist/commands/segment-pwd-command.js +1 -1
  28. package/dist/commands/segment-update-command.js +1 -1
  29. package/dist/commands/segment-use-command.js +1 -1
  30. package/dist/commands/segments.js +1 -1
  31. package/dist/commands/show.js +1 -1
  32. package/dist/commands/tables.js +1 -1
  33. package/dist/commands/use-command.js +1 -1
  34. package/dist/commands/workflow-command.js +1 -1
  35. package/dist/core/auth.js +1 -1
  36. package/dist/core/config.js +1 -1
  37. package/dist/core/global-context.js +1 -1
  38. package/dist/core/profile.js +1 -1
  39. package/dist/core/project-config.js +1 -1
  40. package/dist/core/session.js +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/proxy/anthropic-adapter.d.ts +27 -3
  43. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  44. package/dist/proxy/anthropic-adapter.js +1 -1
  45. package/dist/proxy/anthropic-adapter.js.map +1 -1
  46. package/dist/proxy/server.d.ts.map +1 -1
  47. package/dist/proxy/server.js +1 -1
  48. package/dist/proxy/server.js.map +1 -1
  49. package/dist/proxy/session-cache.js +1 -1
  50. package/dist/sdk/api.js +1 -1
  51. package/dist/sdk/database.js +1 -1
  52. package/dist/sdk/errors.js +1 -1
  53. package/dist/sdk/index.js +1 -1
  54. package/dist/sdk/job.js +1 -1
  55. package/dist/sdk/llm.js +1 -1
  56. package/dist/sdk/query.js +1 -1
  57. package/dist/sdk/segment.js +1 -1
  58. package/dist/sdk/table.js +1 -1
  59. package/dist/sdk/workflow.js +1 -1
  60. package/dist/types/endpoints.js +1 -1
  61. package/dist/types/index.js +1 -1
  62. package/dist/utils/agent-ref-parser.js +1 -1
  63. package/dist/utils/chat-cache.js +1 -1
  64. package/dist/utils/colors.js +1 -1
  65. package/dist/utils/command-output.js +1 -1
  66. package/dist/utils/constants.js +1 -1
  67. package/dist/utils/file-permissions.js +1 -1
  68. package/dist/utils/format-detector.js +1 -1
  69. package/dist/utils/formatters.js +1 -1
  70. package/dist/utils/json-loader.js +1 -1
  71. package/dist/utils/model-aliases.js +1 -1
  72. package/dist/utils/option-validation.js +1 -1
  73. package/dist/utils/port.js +1 -1
  74. package/dist/utils/process.js +1 -1
  75. package/dist/utils/prompt.js +1 -1
  76. package/dist/utils/segment-path-parser.js +1 -1
  77. package/dist/utils/segment-ref-parser.js +1 -1
  78. package/dist/utils/spinner.js +1 -1
  79. package/dist/utils/sql-parser.js +1 -1
  80. package/dist/utils/sse-parser.js +1 -1
  81. package/dist/utils/string-utils.js +1 -1
  82. package/dist/utils/table-ref-parser.js +1 -1
  83. package/dist/utils/tdx-logger.js +1 -1
  84. package/dist/utils/tree-formatter.js +1 -1
  85. package/dist/utils/version-check.js +1 -1
  86. package/dist/utils/workflow-utils.js +1 -1
  87. package/package.json +1 -1
@@ -1 +1 @@
1
- const a17_0xd73251=a17_0x1245;(function(_0x46f638,_0x5d5f25){const _0x133c09=a17_0x1245,_0x3f4d63=_0x46f638();while(!![]){try{const _0x705142=parseInt(_0x133c09(0x13c))/0x1*(-parseInt(_0x133c09(0xec))/0x2)+parseInt(_0x133c09(0x126))/0x3+parseInt(_0x133c09(0x127))/0x4+parseInt(_0x133c09(0x114))/0x5*(-parseInt(_0x133c09(0x136))/0x6)+parseInt(_0x133c09(0x134))/0x7+parseInt(_0x133c09(0xfe))/0x8+-parseInt(_0x133c09(0xfd))/0x9;if(_0x705142===_0x5d5f25)break;else _0x3f4d63['push'](_0x3f4d63['shift']());}catch(_0x3d4dd0){_0x3f4d63['push'](_0x3f4d63['shift']());}}}(a17_0x2b9b,0x90632));function a17_0x1245(_0x32627f,_0x5b7fd5){const _0x2b9bf0=a17_0x2b9b();return a17_0x1245=function(_0x1245b1,_0x5da392){_0x1245b1=_0x1245b1-0xbe;let _0x27dc68=_0x2b9bf0[_0x1245b1];return _0x27dc68;},a17_0x1245(_0x32627f,_0x5b7fd5);}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(_0x45620b,_0x25d4ef){const _0x1b2310=a17_0x1245;if(_0x45620b instanceof SDKError)console['error'](_0x1b2310(0x14c)+_0x45620b[_0x1b2310(0xf1)]),_0x25d4ef[_0x1b2310(0xf3)]&&(_0x45620b[_0x1b2310(0xea)]&&console[_0x1b2310(0x14e)]('\x20\x20Cause:\x20'+_0x45620b[_0x1b2310(0xea)]),_0x45620b[_0x1b2310(0x111)]&&(console[_0x1b2310(0x14e)](_0x1b2310(0x137)),console[_0x1b2310(0x14e)](_0x45620b[_0x1b2310(0x111)])));else throw _0x45620b;}function formatChatHistoryEntry(_0x109795,_0x808a1d){const _0x3b24b2=a17_0x1245,_0x575846=getChalk(_0x808a1d),_0x41fb20=_0x575846[_0x3b24b2(0x140)](_0x109795['at']);if(_0x3b24b2(0x12c)in _0x109795){const _0x342d3e=_0x575846[_0x3b24b2(0x10c)](_0x3b24b2(0x146));return _0x41fb20+'\x20'+_0x342d3e+':\x20'+_0x109795[_0x3b24b2(0x12c)];}if(_0x3b24b2(0xdf)in _0x109795){const _0x2e0b54=_0x575846[_0x3b24b2(0xdd)](_0x3b24b2(0xcd));return _0x41fb20+'\x20'+_0x2e0b54+':\x20'+_0x109795[_0x3b24b2(0xdf)];}if('tool_call'in _0x109795){const _0x3fa7aa=_0x575846[_0x3b24b2(0x104)]('[tool_call]'),{functionName:_0x552507,functionArguments:_0x3cf373,targetFunction:_0xffc6b0}=_0x109795[_0x3b24b2(0xfa)];let _0x145b77=_0x41fb20+'\x20'+_0x3fa7aa+':\x20'+_0x575846[_0x3b24b2(0x106)](_0x552507);if(_0x3cf373&&Object[_0x3b24b2(0x144)](_0x3cf373)[_0x3b24b2(0xfb)]>0x0){const _0x4660dc=Object['entries'](_0x3cf373)[_0x3b24b2(0x10e)](([_0x441364,_0x3272bd])=>_0x441364+'='+JSON[_0x3b24b2(0x116)](_0x3272bd))[_0x3b24b2(0xc4)](',\x20');_0x145b77+='('+_0x4660dc+')';}_0xffc6b0&&(_0x145b77+=_0x575846[_0x3b24b2(0x140)]('\x20['+_0xffc6b0+']'));let _0x11c81b='';if(_0x109795['tool_call'][_0x3b24b2(0xd7)])_0x11c81b=_0x3b24b2(0xd5)+_0x109795[_0x3b24b2(0xfa)][_0x3b24b2(0xd7)][_0x3b24b2(0x11b)];else{if(_0x109795[_0x3b24b2(0xfa)][_0x3b24b2(0x141)])_0x11c81b=_0x3b24b2(0x12b)+_0x109795[_0x3b24b2(0xfa)][_0x3b24b2(0x141)][_0x3b24b2(0x11b)];else{if(_0x109795[_0x3b24b2(0xfa)]['targetWebSearchTool'])_0x11c81b=_0x3b24b2(0x132)+_0x109795[_0x3b24b2(0xfa)]['targetWebSearchTool'][_0x3b24b2(0x11b)];else _0x109795[_0x3b24b2(0xfa)][_0x3b24b2(0x12f)]&&(_0x11c81b=_0x3b24b2(0xca)+_0x109795[_0x3b24b2(0xfa)]['targetImageGenerator'][_0x3b24b2(0x11b)]);}}return _0x145b77+_0x11c81b;}if(_0x3b24b2(0x105)in _0x109795){const _0xcd06fe=_0x575846[_0x3b24b2(0xe6)](_0x3b24b2(0xe7)),{functionName:_0x4d1c8f,functionArguments:_0x31fab2,content:_0x121c84,newChat:_0x513029}=_0x109795[_0x3b24b2(0x105)];let _0x447aed=_0x41fb20+'\x20'+_0xcd06fe+':\x20'+_0x575846['bold'](_0x4d1c8f);if(_0x31fab2){const _0x8869bf=typeof _0x31fab2===_0x3b24b2(0xf6)?_0x31fab2:JSON[_0x3b24b2(0x116)](_0x31fab2);_0x447aed+='('+_0x8869bf+')';}return _0x121c84&&(_0x447aed+='\x0a'+_0x575846['dim'](_0x121c84)),_0x513029&&(_0x447aed+=_0x575846[_0x3b24b2(0x140)]('\x20→\x20chat:\x20'+_0x513029['id'])),_0x447aed;}if(_0x3b24b2(0xe9)in _0x109795){const _0x2c3e78=_0x575846[_0x3b24b2(0xf2)](_0x3b24b2(0x107));return _0x41fb20+'\x20'+_0x2c3e78+':\x20'+_0x109795[_0x3b24b2(0xe9)][_0x3b24b2(0x11b)]+'\x20('+_0x109795['output'][_0x3b24b2(0xdf)][_0x3b24b2(0xfb)]+_0x3b24b2(0x118);}if(_0x3b24b2(0x11e)in _0x109795){const _0x1a183b=_0x575846[_0x3b24b2(0xf2)]('[image]\x20\x20'),{width:_0x29371c,height:_0x4d2981,headerText:_0x3f836f}=_0x109795[_0x3b24b2(0x11e)],_0x153017=_0x3f836f?_0x3b24b2(0xd8)+_0x3f836f:'';return _0x41fb20+'\x20'+_0x1a183b+':\x20'+_0x29371c+'x'+_0x4d2981+_0x153017;}if(_0x3b24b2(0x14e)in _0x109795){const _0x4b0b92=_0x575846[_0x3b24b2(0xe3)](_0x3b24b2(0x13b));return _0x41fb20+'\x20'+_0x4b0b92+':\x20'+_0x109795[_0x3b24b2(0x14e)];}return _0x41fb20+'\x20'+_0x575846[_0x3b24b2(0x140)](_0x3b24b2(0xcf))+':\x20'+JSON['stringify'](_0x109795);}async function getProjectIdOrDefault(_0x5cbe90){const _0x1434d4=a17_0x1245,{tdx:_0xa3d3e0,options:_0x45731f}=_0x5cbe90,_0x48659b=_0x45731f['llmProject'];if(_0x48659b){const _0x33c652=await withSpinner(_0x1434d4(0xd0)+_0x48659b+_0x1434d4(0x101),()=>_0xa3d3e0[_0x1434d4(0xf7)][_0x1434d4(0xd4)](_0x48659b),{'verbose':_0x45731f['verbose']});return _0x33c652[_0x1434d4(0x12e)];}let _0x1c80de=_0xa3d3e0[_0x1434d4(0xf7)]['getCurrentProject']();if(_0x1c80de)return _0x1c80de;const _0xb07684=await withSpinner(_0x1434d4(0xf4),()=>_0xa3d3e0['llm'][_0x1434d4(0xbe)](),{'verbose':_0x45731f[_0x1434d4(0xf3)]});return _0xb07684[_0x1434d4(0x12e)]['id'];}function toLLMProjectInfo(_0xd09ba3){const _0x722ead=a17_0x1245;return{'name':_0xd09ba3['attributes'][_0x722ead(0x11b)],'description':_0xd09ba3['attributes'][_0x722ead(0xe1)],'createdAt':_0xd09ba3[_0x722ead(0xd9)][_0x722ead(0x10d)],'updatedAt':_0xd09ba3[_0x722ead(0xd9)]['updatedAt']};}function toAgentInfo(_0x4a1ab){const _0x412074=a17_0x1245;return{'name':_0x4a1ab[_0x412074(0xd9)][_0x412074(0x11b)],'description':_0x4a1ab[_0x412074(0xd9)][_0x412074(0xe1)],'prompt':truncatePrompt(_0x4a1ab[_0x412074(0xd9)][_0x412074(0x14f)]),'createdAt':_0x4a1ab[_0x412074(0xd9)][_0x412074(0x10d)],'updatedAt':_0x4a1ab[_0x412074(0xd9)][_0x412074(0xdc)]};}function truncatePrompt(_0x38f59d){const _0x2302f1=a17_0x1245;if(!_0x38f59d)return undefined;const _0x8a1bc=0x64;if(_0x38f59d['length']<=_0x8a1bc)return _0x38f59d;return _0x38f59d[_0x2302f1(0x142)](0x0,_0x8a1bc)+_0x2302f1(0xff);}export class LLMModelsCommand extends BaseCommand{[a17_0xd73251(0x11b)]=a17_0xd73251(0x110);[a17_0xd73251(0xe1)]=a17_0xd73251(0xf5);async['execute'](_0x419afc){const _0xa582a0=a17_0xd73251,{options:_0x3c53b9,tdx:_0x3f549d}=_0x419afc;try{const _0x18e0b0=await withSpinner(_0xa582a0(0x13a),()=>_0x3f549d[_0xa582a0(0xf7)][_0xa582a0(0x14d)](),{'verbose':_0x3c53b9[_0xa582a0(0xf3)]});return await handleSDKOutput(_0x18e0b0['data'],_0x3c53b9),0x0;}catch(_0x479834){return handleSDKError(_0x479834,_0x3c53b9),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0xd73251(0x11b)]=a17_0xd73251(0x122);['description']=a17_0xd73251(0xe4);async['execute'](_0x341653){const _0x367b14=a17_0xd73251,{options:_0x516efa,args:_0x138c01,tdx:_0x228f9a}=_0x341653;try{const _0x3b9451=_0x138c01[0x0],_0x372d99=resolveLimit(_0x516efa['limit'],DEFAULT_LLM_LIMIT),_0x342103=await withSpinner(_0x367b14(0x123),()=>_0x228f9a[_0x367b14(0xf7)][_0x367b14(0xed)](_0x372d99),{'verbose':_0x516efa['verbose']});let _0x181197=_0x342103['data'];_0x3b9451&&(_0x181197=_0x342103[_0x367b14(0x12e)][_0x367b14(0xc7)](_0x5cb6c6=>matchGlobPattern(_0x5cb6c6[_0x367b14(0xd9)]['name'],_0x3b9451)));const _0x345210=_0x181197[_0x367b14(0x10e)](toLLMProjectInfo);return await handleSDKOutput(_0x345210,_0x516efa),0x0;}catch(_0x458251){return handleSDKError(_0x458251,_0x516efa),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0xd73251(0x11b)]='llm:agents';[a17_0xd73251(0xe1)]=a17_0xd73251(0x100);async[a17_0xd73251(0xc5)](_0x5d54b4){const _0x529dfd=a17_0xd73251,{options:_0x2f770d,args:_0x3fa5a1,tdx:_0x43bcf0}=_0x5d54b4;try{const _0x9a7d2c=_0x3fa5a1[0x0];let _0x551c21,_0x5d55eb=_0x9a7d2c;if(_0x9a7d2c&&_0x9a7d2c[_0x529dfd(0x139)]('/')){const _0x5bb271=_0x9a7d2c[_0x529dfd(0x11d)]('/');if(_0x5bb271['length']===0x2){const [_0x49dc06,_0x143746]=_0x5bb271,_0x44d068=await _0x43bcf0['llm']['projects'](),_0x58d8fc=_0x44d068[_0x529dfd(0x13d)](_0x17b7c3=>_0x17b7c3[_0x529dfd(0xd9)][_0x529dfd(0x11b)][_0x529dfd(0x148)]()===_0x49dc06[_0x529dfd(0x148)]());if(!_0x58d8fc)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x529dfd(0x113)+_0x49dc06,undefined,{'helpText':_0x529dfd(0xbf)});_0x551c21=_0x58d8fc['id'],_0x5d55eb=_0x143746;}else throw new SDKError(ErrorCode[_0x529dfd(0x125)],'Invalid\x20path\x20syntax:\x20'+_0x9a7d2c,undefined,{'helpText':_0x529dfd(0x145)});}else _0x551c21=await getProjectIdOrDefault(_0x5d54b4);const _0x1e1b56=await withSpinner('Fetching\x20agents...',()=>_0x43bcf0['llm']['agents'](_0x551c21),{'verbose':_0x2f770d['verbose']});let _0x2dad0d=_0x1e1b56['data'];_0x5d55eb&&(_0x2dad0d=_0x1e1b56['data'][_0x529dfd(0xc7)](_0xf4cfdd=>matchGlobPattern(_0xf4cfdd[_0x529dfd(0xd9)][_0x529dfd(0x11b)],_0x5d55eb)));const _0x13eb50=_0x2dad0d['map'](toAgentInfo);return await handleSDKOutput(_0x13eb50,_0x2f770d),0x0;}catch(_0x200024){return handleSDKError(_0x200024,_0x2f770d),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a17_0xd73251(0x11b)]=a17_0xd73251(0x102);[a17_0xd73251(0xe1)]=a17_0xd73251(0x11f);async[a17_0xd73251(0xc5)](_0x4d2843){const _0x1d4611=a17_0xd73251,{options:_0x1dbd1d,args:_0x3ed625,tdx:_0x1b324c}=_0x4d2843;if(_0x3ed625['length']===0x0)return console[_0x1d4611(0x14e)](_0x1d4611(0x103)),console[_0x1d4611(0x14e)](_0x1d4611(0x117)),0x1;const _0x1b0bf6=_0x3ed625[0x0];try{const _0x16e163=await getProjectIdOrDefault(_0x4d2843),_0x2123ae=await withSpinner(_0x1d4611(0xc6)+_0x1b0bf6+_0x1d4611(0x101),()=>_0x1b324c['llm'][_0x1d4611(0x11a)](_0x1b0bf6,_0x16e163),{'verbose':_0x1dbd1d['verbose']}),_0x1b531f=await withSpinner(_0x1d4611(0x112),()=>_0x1b324c[_0x1d4611(0xf7)][_0x1d4611(0x130)](_0x2123ae['data']),{'verbose':_0x1dbd1d[_0x1d4611(0xf3)]});return await handleSDKOutput([_0x1b531f[_0x1d4611(0x12e)]],_0x1dbd1d),0x0;}catch(_0x43ad18){return handleSDKError(_0x43ad18,_0x1dbd1d),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a17_0xd73251(0x149);[a17_0xd73251(0xe1)]=a17_0xd73251(0xe0);async[a17_0xd73251(0xc5)](_0x3cd4af){const _0x1efefc=a17_0xd73251,{options:_0x131db7,args:_0x53d3b6,tdx:_0xbf81c6}=_0x3cd4af;if(_0x53d3b6[_0x1efefc(0xfb)]===0x0)return console[_0x1efefc(0x14e)](_0x1efefc(0x103)),console[_0x1efefc(0x14e)](_0x1efefc(0x119)),console[_0x1efefc(0x14e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0xcb3092=_0x53d3b6[0x0],_0x16b752=_0x131db7,_0x5b33b0=_0x16b752[_0x1efefc(0x13f)],_0x3954cb=_0x16b752[_0x1efefc(0xef)]||'claude-4.5-haiku',_0x48d1cc=_0x16b752[_0x1efefc(0xf9)],_0x155961=_0x16b752[_0x1efefc(0x12d)]?Number(_0x16b752[_0x1efefc(0x12d)]):undefined,_0x3e5712=_0x16b752['temperature']?Number(_0x16b752[_0x1efefc(0x10a)]):undefined;try{let _0x223e4b,_0x2c9a97;if(_0xcb3092[_0x1efefc(0x139)]('/')){const _0x351d47=_0xcb3092[_0x1efefc(0x11d)]('/');if(_0x351d47[_0x1efefc(0xfb)]===0x2){const [_0x2a5ada,_0xc80f4e]=_0x351d47,_0x24f090=await withSpinner(_0x1efefc(0xd0)+_0x2a5ada+_0x1efefc(0x101),()=>_0xbf81c6[_0x1efefc(0xf7)]['resolveProjectId'](_0x2a5ada),{'verbose':_0x131db7[_0x1efefc(0xf3)]});_0x223e4b=_0x24f090['data'],_0x2c9a97=_0xc80f4e;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1efefc(0x138)+_0xcb3092,undefined,{'helpText':_0x1efefc(0x145)});}else _0x223e4b=await getProjectIdOrDefault(_0x3cd4af),_0x2c9a97=_0xcb3092;const _0x2386ac=await withSpinner(_0x1efefc(0xc3)+_0x2c9a97+_0x1efefc(0x101),()=>_0xbf81c6[_0x1efefc(0xf7)][_0x1efefc(0xee)]({'name':_0x2c9a97,'projectId':_0x223e4b,'modelType':_0x3954cb,'systemPrompt':_0x5b33b0,'starterMessage':_0x48d1cc,'maxToolIterations':_0x155961,'temperature':_0x3e5712}),{'verbose':_0x131db7['verbose']});return console[_0x1efefc(0xeb)](_0x1efefc(0xcb)+_0x2386ac[_0x1efefc(0x12e)]['id']),await handleSDKOutput([_0x2386ac['data']],_0x131db7),0x0;}catch(_0x1dea5a){return handleSDKError(_0x1dea5a,_0x131db7),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a17_0xd73251(0xcc);[a17_0xd73251(0xe1)]=a17_0xd73251(0xdb);async[a17_0xd73251(0xc5)](_0xc27c85){const _0xeb4be0=a17_0xd73251,{options:_0x474ba7,args:_0x3b39fe,tdx:_0x24c894}=_0xc27c85;if(_0x3b39fe['length']===0x0)return console[_0xeb4be0(0x14e)](_0xeb4be0(0x103)),console[_0xeb4be0(0x14e)](_0xeb4be0(0xde)),0x1;const _0x3bfa86=_0x3b39fe[0x0],_0x18fce7=_0x474ba7,_0x4f14a8=_0x18fce7[_0xeb4be0(0x11b)],_0x1b42a7=_0x18fce7[_0xeb4be0(0x14f)],_0x490db6=_0x18fce7[_0xeb4be0(0xe1)],_0x2df6f1=_0x18fce7['starterMessage'];if(!_0x4f14a8&&!_0x1b42a7&&!_0x490db6&&!_0x2df6f1)return console[_0xeb4be0(0x14e)](_0xeb4be0(0xc8)),console[_0xeb4be0(0x14e)](_0xeb4be0(0xe8)),0x1;try{const _0x4d34a6=await getProjectIdOrDefault(_0xc27c85),_0xd4d686=await withSpinner('Resolving\x20agent\x20\x27'+_0x3bfa86+_0xeb4be0(0x101),()=>_0x24c894['llm'][_0xeb4be0(0x11a)](_0x3bfa86,_0x4d34a6),{'verbose':_0x474ba7['verbose']}),_0x570747=_0xd4d686['data'],_0x4c11d5=await withSpinner(_0xeb4be0(0x109),()=>_0x24c894[_0xeb4be0(0xf7)]['updateAgent'](_0x570747,{'name':_0x4f14a8,'prompt':_0x1b42a7,'description':_0x490db6,'starterMessage':_0x2df6f1}),{'verbose':_0x474ba7[_0xeb4be0(0xf3)]});return console['log'](_0xeb4be0(0x129)+_0x4c11d5[_0xeb4be0(0x12e)]['id']),await handleSDKOutput([_0x4c11d5[_0xeb4be0(0x12e)]],_0x474ba7),0x0;}catch(_0x520c29){return handleSDKError(_0x520c29,_0x474ba7),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a17_0xd73251(0x11b)]=a17_0xd73251(0xda);[a17_0xd73251(0xe1)]='Delete\x20an\x20agent';async['execute'](_0x42f048){const _0x26559c=a17_0xd73251,{options:_0x86d7c8,args:_0xfe178d,tdx:_0x1f1e47}=_0x42f048;if(_0xfe178d[_0x26559c(0xfb)]===0x0)return console[_0x26559c(0x14e)](_0x26559c(0x103)),console[_0x26559c(0x14e)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0xc171cb=_0xfe178d[0x0];try{const _0x5cda2a=await getProjectIdOrDefault(_0x42f048),_0x2b1fbf=await withSpinner(_0x26559c(0xc6)+_0xc171cb+_0x26559c(0x101),()=>_0x1f1e47[_0x26559c(0xf7)][_0x26559c(0x11a)](_0xc171cb,_0x5cda2a),{'verbose':_0x86d7c8['verbose']}),_0x111771=_0x2b1fbf[_0x26559c(0x12e)];return await withSpinner('Deleting\x20agent...',()=>_0x1f1e47['llm'][_0x26559c(0x124)](_0x111771),{'verbose':_0x86d7c8[_0x26559c(0xf3)]}),console[_0x26559c(0xeb)](_0x26559c(0x143)+_0x111771),0x0;}catch(_0x3dfb21){return handleSDKError(_0x3dfb21,_0x86d7c8),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0xd73251(0x11b)]='llm:history';[a17_0xd73251(0xe1)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async[a17_0xd73251(0xc5)](_0x1210e7){const _0x2b8d37=a17_0xd73251,{options:_0x4b1a28,args:_0x476c3e,tdx:_0x49e50b}=_0x1210e7;let _0x561e3a=_0x476c3e[0x0];const _0xe5e498=_0x4b1a28,_0x48d206=_0xe5e498[_0x2b8d37(0x133)];try{if(_0x48d206){if(_0x561e3a)return console[_0x2b8d37(0x14e)](_0x2b8d37(0xc2)),console[_0x2b8d37(0x14e)](_0x2b8d37(0xc9)),0x1;const _0x2b9d2f=await withSpinner(_0x2b8d37(0xd1),()=>_0x49e50b[_0x2b8d37(0xf7)]['chats'](0x1),{'verbose':_0x4b1a28[_0x2b8d37(0xf3)]});if(_0x2b9d2f[_0x2b8d37(0x12e)][_0x2b8d37(0xfb)]===0x0)return console[_0x2b8d37(0xeb)](_0x2b8d37(0xce)),0x0;_0x561e3a=_0x2b9d2f['data'][0x0]['id'];}if(!_0x561e3a){const _0x5568e8=resolveLimit(_0x4b1a28['limit'],DEFAULT_LLM_LIMIT),_0x57dbaf=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x49e50b[_0x2b8d37(0xf7)]['chats'](_0x5568e8),{'verbose':_0x4b1a28[_0x2b8d37(0xf3)]});if(_0x4b1a28[_0x2b8d37(0x131)]===_0x2b8d37(0xfc)||_0x4b1a28[_0x2b8d37(0x131)]===_0x2b8d37(0xe2))await handleSDKOutput(_0x57dbaf[_0x2b8d37(0x12e)],_0x4b1a28);else{const _0x27a054=_0x57dbaf[_0x2b8d37(0x12e)][_0x2b8d37(0x10e)](_0x50d170=>({'created_at':_0x50d170[_0x2b8d37(0xd9)][_0x2b8d37(0x10d)],'chat_id':_0x50d170['id'],'first_input':_0x50d170['attributes'][_0x2b8d37(0x10b)]||_0x2b8d37(0xc1)}));await handleSDKOutput(_0x27a054,_0x4b1a28);}return 0x0;}else{const _0xaf88bc=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x561e3a+'\x27...',()=>_0x49e50b[_0x2b8d37(0xf7)]['history'](_0x561e3a),{'verbose':_0x4b1a28[_0x2b8d37(0xf3)]}),_0x5624ee=_0xaf88bc[_0x2b8d37(0x12e)][_0x2b8d37(0x12e)]??[];if(_0x5624ee[_0x2b8d37(0xfb)]===0x0)return console['log'](_0x2b8d37(0xd6)),0x0;if(_0x4b1a28[_0x2b8d37(0x131)]===_0x2b8d37(0xfc)||_0x4b1a28['format']===_0x2b8d37(0xe2)||_0x4b1a28['format']===_0x2b8d37(0x120)||_0x4b1a28['format']===_0x2b8d37(0x135))await handleSDKOutput(_0x5624ee,_0x4b1a28);else for(const _0x131fd1 of _0x5624ee){console[_0x2b8d37(0xeb)](formatChatHistoryEntry(_0x131fd1,_0x4b1a28));}return 0x0;}}catch(_0x4234cd){return handleSDKError(_0x4234cd,_0x4b1a28),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0xd73251(0x11b)]=a17_0xd73251(0x14b);[a17_0xd73251(0xe1)]=a17_0xd73251(0xf0);async['execute'](_0xb53517){const _0x4e65fa=a17_0xd73251,{options:_0x3bcae5,args:_0x4882a4,tdx:_0x236fd3}=_0xb53517;if(_0x4882a4['length']===0x0)return console[_0x4e65fa(0x14e)](_0x4e65fa(0x14a)),console['error'](_0x4e65fa(0xd2)),0x1;const _0x40a6e5=_0x4882a4[0x0];try{return await withSpinner(_0x4e65fa(0xf8)+_0x40a6e5+_0x4e65fa(0x101),()=>_0x236fd3[_0x4e65fa(0xf7)][_0x4e65fa(0xc0)](_0x40a6e5),{'verbose':_0x3bcae5['verbose']}),console[_0x4e65fa(0xeb)](_0x4e65fa(0x128)+_0x40a6e5),0x0;}catch(_0x1a6e34){return handleSDKError(_0x1a6e34,_0x3bcae5),0x1;}}}function a17_0x2b9b(){const _0x23fc3f=['split','image','Show\x20agent\x20details','table','Delete\x20an\x20LLM\x20project','llm:projects','Fetching\x20projects...','deleteAgent','INVALID_ARGUMENT','1150239IzCzWE','1286704vmvayX','Project\x20context\x20set\x20to:\x20','Agent\x20updated:\x20','Project\x20created:\x20','\x20->\x20Agent:','input','maxToolIterations','data','targetImageGenerator','agent','format','\x20->\x20WebSearch:','last','5842550AAIWZk','tsv','186fyIpYO','\x0aStack\x20trace:','Invalid\x20path\x20syntax:\x20','includes','Fetching\x20available\x20models...','[error]\x20\x20','1051499YMLkuH','find','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','systemPrompt','dim','targetAgent','slice','Agent\x20deleted:\x20','keys','Use\x20format:\x20project-name/agent-name','[input]\x20\x20','Project\x20deleted:\x20','toLowerCase','llm:agent:create','Error:\x20Project\x20name\x20is\x20required','llm:use','Error:\x20','models','error','prompt','getOrCreateDefaultProject','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','setCurrentProject','(no\x20message)','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Creating\x20agent\x20\x27','join','execute','Resolving\x20agent\x20\x27','filter','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Usage:\x20tdx\x20llm\x20history\x20--last','\x20->\x20ImageGen:','Agent\x20created:\x20','llm:agent:update','[content]','No\x20chat\x20sessions\x20found.','[unknown]','Resolving\x20project\x20\x27','Fetching\x20most\x20recent\x20chat...','Usage:\x20tdx\x20llm\x20use\x20<project-name>','createProject','resolveProjectId','\x20->\x20KB:','No\x20messages\x20found\x20in\x20chat\x20history.','targetKnowledgeBase','\x20-\x20','attributes','llm:agent:delete','Update\x20an\x20existing\x20agent','updatedAt','green','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','content','Create\x20a\x20new\x20agent\x20in\x20current\x20project','description','jsonl','red','List\x20all\x20LLM\x20projects','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','magenta','[tool]\x20\x20\x20','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','output','cause','log','2pychMW','projects','createAgent','model','Set\x20current\x20project\x20context','message','blue','verbose','Getting\x20default\x20project...','List\x20available\x20LLM\x20models','string','llm','Setting\x20project\x20context\x20to\x20\x27','starterMessage','tool_call','length','json','572724hhNxqh','5383544sQIhyi','...','List\x20agents\x20in\x20current\x20project','\x27...','llm:agent:show','Error:\x20Agent\x20name\x20is\x20required','yellow','tool','bold','[output]\x20','deleteProject','Updating\x20agent...','temperature','firstInputContent','cyan','createdAt','map','llm:project:delete','llm:models','stack','Fetching\x20agent...','Project\x20not\x20found:\x20','81635vcdMCH','Creating\x20project\x20\x27','stringify','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x20bytes)','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','resolveAgentId','name','Deleting\x20project\x20\x27'];a17_0x2b9b=function(){return _0x23fc3f;};return a17_0x2b9b();}export class LLMProjectCreateCommand extends BaseCommand{[a17_0xd73251(0x11b)]='llm:project:create';['description']='Create\x20a\x20new\x20LLM\x20project';async[a17_0xd73251(0xc5)](_0x4f2f9){const _0x1cc8e2=a17_0xd73251,{options:_0x26f962,args:_0x5b5841,tdx:_0x5c5fd8}=_0x4f2f9;if(_0x5b5841['length']===0x0)return console[_0x1cc8e2(0x14e)](_0x1cc8e2(0x14a)),console['error'](_0x1cc8e2(0x13e)),0x1;const _0x1b482f=_0x5b5841[0x0],_0x342cee=_0x26f962,_0x4283d1=_0x342cee[_0x1cc8e2(0xe1)];try{const _0x1fb992=await withSpinner(_0x1cc8e2(0x115)+_0x1b482f+_0x1cc8e2(0x101),()=>_0x5c5fd8[_0x1cc8e2(0xf7)][_0x1cc8e2(0xd3)]({'name':_0x1b482f,'description':_0x4283d1}),{'verbose':_0x26f962[_0x1cc8e2(0xf3)]});console[_0x1cc8e2(0xeb)](_0x1cc8e2(0x12a)+_0x1fb992['data']['id']);const _0x524ab2=toLLMProjectInfo(_0x1fb992[_0x1cc8e2(0x12e)]);return await handleSDKOutput([_0x524ab2],_0x26f962),0x0;}catch(_0x372f20){return handleSDKError(_0x372f20,_0x26f962),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a17_0xd73251(0x10f);[a17_0xd73251(0xe1)]=a17_0xd73251(0x121);async[a17_0xd73251(0xc5)](_0x4ac923){const _0x1a5929=a17_0xd73251,{options:_0x786a58,args:_0x7cfae0,tdx:_0x59e2ea}=_0x4ac923;if(_0x7cfae0[_0x1a5929(0xfb)]===0x0)return console[_0x1a5929(0x14e)](_0x1a5929(0x14a)),console['error'](_0x1a5929(0xe5)),0x1;const _0x22f89c=_0x7cfae0[0x0];try{return await withSpinner(_0x1a5929(0x11c)+_0x22f89c+_0x1a5929(0x101),()=>_0x59e2ea[_0x1a5929(0xf7)][_0x1a5929(0x108)](_0x22f89c),{'verbose':_0x786a58[_0x1a5929(0xf3)]}),console[_0x1a5929(0xeb)](_0x1a5929(0x147)+_0x22f89c),0x0;}catch(_0x146f50){return handleSDKError(_0x146f50,_0x786a58),0x1;}}}
1
+ const a17_0x230884=a17_0x131c;(function(_0x3669a4,_0x38c46e){const _0x2e6a1e=a17_0x131c,_0x3492d0=_0x3669a4();while(!![]){try{const _0x38e0bc=parseInt(_0x2e6a1e(0x170))/0x1*(parseInt(_0x2e6a1e(0x183))/0x2)+-parseInt(_0x2e6a1e(0x17e))/0x3+-parseInt(_0x2e6a1e(0x1c9))/0x4+-parseInt(_0x2e6a1e(0x159))/0x5+parseInt(_0x2e6a1e(0x1b0))/0x6+parseInt(_0x2e6a1e(0x167))/0x7+parseInt(_0x2e6a1e(0x193))/0x8;if(_0x38e0bc===_0x38c46e)break;else _0x3492d0['push'](_0x3492d0['shift']());}catch(_0x4b5001){_0x3492d0['push'](_0x3492d0['shift']());}}}(a17_0x464d,0x2db09));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 a17_0x464d(){const _0x41b7e2=['[tool_call]','llm:agent:update','prompt','targetImageGenerator','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','\x20->\x20Agent:','llm:agent:delete','name','chats','llmProject','cyan','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','tsv','Delete\x20an\x20LLM\x20project','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Fetching\x20available\x20models...','json','Creating\x20project\x20\x27','model','Use\x20format:\x20project-name/agent-name','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','tool_call','921710gRfutd','(no\x20message)','resolveProjectId','...','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','[input]\x20\x20','keys','claude-4.5-haiku','systemPrompt','Deleting\x20agent...','toLowerCase','entries','\x20->\x20WebSearch:','[tool]\x20\x20\x20','698474BgVkek','image','llm:agent:create','verbose','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','join','magenta','llm:history','Fetching\x20most\x20recent\x20chat...','5534yshQoe','List\x20agents\x20in\x20current\x20project','slice','input','limit','\x20->\x20KB:','INVALID_ARGUMENT','jsonl','Show\x20agent\x20details','Fetching\x20agent...','llm:agent:show','Usage:\x20tdx\x20llm\x20use\x20<project-name>','[error]\x20\x20','stringify','249660Nmjhbb','llm:agents','deleteAgent','llm:projects','Project\x20created:\x20','66zvwmLk','\x20bytes)','targetKnowledgeBase','temperature','starterMessage','Resolving\x20agent\x20\x27','models','message','map','agents','[image]\x20\x20','data','targetAgent','Invalid\x20path\x20syntax:\x20','bold','\x27...','901248VyGafx','\x20→\x20chat:\x20','attributes','getCurrentProject','createdAt','Fetching\x20agents...','createProject','targetWebSearchTool','Resolving\x20project\x20\x27','filter','setCurrentProject','Updating\x20agent...','llm:project:delete','Error:\x20Agent\x20name\x20is\x20required','\x0aStack\x20trace:','Fetching\x20projects...','agent','blue','dim','description','LLM_PROJECT_NOT_FOUND','List\x20available\x20LLM\x20models','Create\x20a\x20new\x20agent\x20in\x20current\x20project','execute','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','Usage:\x20tdx\x20llm\x20history\x20--last','cause','Fetching\x20chat\x20history\x20for\x20\x27','1710006pKOghu','Error:\x20','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','firstInputContent','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Project\x20deleted:\x20','string','includes','[unknown]','deleteProject','Fetching\x20chat\x20sessions...','find','last','content','Setting\x20project\x20context\x20to\x20\x27','Project\x20not\x20found:\x20','log','error','tool','split','List\x20all\x20LLM\x20projects','maxToolIterations','length','llm','llm:project:create','901416reeSws','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','output','Agent\x20updated:\x20','Agent\x20deleted:\x20','Agent\x20created:\x20','Create\x20a\x20new\x20LLM\x20project','format','projects','resolveAgentId'];a17_0x464d=function(){return _0x41b7e2;};return a17_0x464d();}import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function a17_0x131c(_0x1d7e60,_0x46af87){const _0x464da0=a17_0x464d();return a17_0x131c=function(_0x131c3e,_0x39480d){_0x131c3e=_0x131c3e-0x14f;let _0x2726d1=_0x464da0[_0x131c3e];return _0x2726d1;},a17_0x131c(_0x1d7e60,_0x46af87);}function handleSDKError(_0x40d482,_0x28ee6a){const _0xa77732=a17_0x131c;if(_0x40d482 instanceof SDKError)console[_0xa77732(0x1c1)](_0xa77732(0x1b1)+_0x40d482[_0xa77732(0x18a)]),_0x28ee6a[_0xa77732(0x16a)]&&(_0x40d482[_0xa77732(0x1ae)]&&console[_0xa77732(0x1c1)]('\x20\x20Cause:\x20'+_0x40d482[_0xa77732(0x1ae)]),_0x40d482['stack']&&(console['error'](_0xa77732(0x1a1)),console[_0xa77732(0x1c1)](_0x40d482['stack'])));else throw _0x40d482;}function formatChatHistoryEntry(_0x385136,_0x2a92c9){const _0x3b32a0=a17_0x131c,_0x5200f4=getChalk(_0x2a92c9),_0x330218=_0x5200f4[_0x3b32a0(0x1a5)](_0x385136['at']);if(_0x3b32a0(0x173)in _0x385136){const _0x1f4d55=_0x5200f4[_0x3b32a0(0x1dd)](_0x3b32a0(0x15e));return _0x330218+'\x20'+_0x1f4d55+':\x20'+_0x385136[_0x3b32a0(0x173)];}if(_0x3b32a0(0x1bd)in _0x385136){const _0x5cf9c=_0x5200f4['green']('[content]');return _0x330218+'\x20'+_0x5cf9c+':\x20'+_0x385136[_0x3b32a0(0x1bd)];}if(_0x3b32a0(0x158)in _0x385136){const _0x178af8=_0x5200f4['yellow'](_0x3b32a0(0x1d3)),{functionName:_0x5b8a5b,functionArguments:_0x59d283,targetFunction:_0x3a0f4b}=_0x385136[_0x3b32a0(0x158)];let _0x560eac=_0x330218+'\x20'+_0x178af8+':\x20'+_0x5200f4['bold'](_0x5b8a5b);if(_0x59d283&&Object[_0x3b32a0(0x15f)](_0x59d283)[_0x3b32a0(0x1c6)]>0x0){const _0x237095=Object[_0x3b32a0(0x164)](_0x59d283)[_0x3b32a0(0x18b)](([_0x13185c,_0x545588])=>_0x13185c+'='+JSON[_0x3b32a0(0x17d)](_0x545588))[_0x3b32a0(0x16c)](',\x20');_0x560eac+='('+_0x237095+')';}_0x3a0f4b&&(_0x560eac+=_0x5200f4[_0x3b32a0(0x1a5)]('\x20['+_0x3a0f4b+']'));let _0x39c195='';if(_0x385136['tool_call'][_0x3b32a0(0x185)])_0x39c195=_0x3b32a0(0x175)+_0x385136[_0x3b32a0(0x158)]['targetKnowledgeBase'][_0x3b32a0(0x1da)];else{if(_0x385136[_0x3b32a0(0x158)][_0x3b32a0(0x18f)])_0x39c195=_0x3b32a0(0x1d8)+_0x385136[_0x3b32a0(0x158)][_0x3b32a0(0x18f)][_0x3b32a0(0x1da)];else{if(_0x385136['tool_call'][_0x3b32a0(0x19a)])_0x39c195=_0x3b32a0(0x165)+_0x385136[_0x3b32a0(0x158)][_0x3b32a0(0x19a)][_0x3b32a0(0x1da)];else _0x385136['tool_call'][_0x3b32a0(0x1d6)]&&(_0x39c195='\x20->\x20ImageGen:'+_0x385136[_0x3b32a0(0x158)]['targetImageGenerator'][_0x3b32a0(0x1da)]);}}return _0x560eac+_0x39c195;}if(_0x3b32a0(0x1c2)in _0x385136){const _0x599499=_0x5200f4[_0x3b32a0(0x16d)](_0x3b32a0(0x166)),{functionName:_0x540b22,functionArguments:_0x5e1caa,content:_0x1c391e,newChat:_0x52c1d1}=_0x385136[_0x3b32a0(0x1c2)];let _0x5f1fa9=_0x330218+'\x20'+_0x599499+':\x20'+_0x5200f4[_0x3b32a0(0x191)](_0x540b22);if(_0x5e1caa){const _0x2d12fb=typeof _0x5e1caa===_0x3b32a0(0x1b6)?_0x5e1caa:JSON[_0x3b32a0(0x17d)](_0x5e1caa);_0x5f1fa9+='('+_0x2d12fb+')';}return _0x1c391e&&(_0x5f1fa9+='\x0a'+_0x5200f4[_0x3b32a0(0x1a5)](_0x1c391e)),_0x52c1d1&&(_0x5f1fa9+=_0x5200f4[_0x3b32a0(0x1a5)](_0x3b32a0(0x194)+_0x52c1d1['id'])),_0x5f1fa9;}if(_0x3b32a0(0x1cb)in _0x385136){const _0x13c30a=_0x5200f4[_0x3b32a0(0x1a4)]('[output]\x20');return _0x330218+'\x20'+_0x13c30a+':\x20'+_0x385136[_0x3b32a0(0x1cb)][_0x3b32a0(0x1da)]+'\x20('+_0x385136['output']['content']['length']+_0x3b32a0(0x184);}if(_0x3b32a0(0x168)in _0x385136){const _0x5522a8=_0x5200f4['blue'](_0x3b32a0(0x18d)),{width:_0x34a144,height:_0x5c78d3,headerText:_0x1639ad}=_0x385136['image'],_0x1e45db=_0x1639ad?'\x20-\x20'+_0x1639ad:'';return _0x330218+'\x20'+_0x5522a8+':\x20'+_0x34a144+'x'+_0x5c78d3+_0x1e45db;}if('error'in _0x385136){const _0x32d848=_0x5200f4['red'](_0x3b32a0(0x17c));return _0x330218+'\x20'+_0x32d848+':\x20'+_0x385136[_0x3b32a0(0x1c1)];}return _0x330218+'\x20'+_0x5200f4['dim'](_0x3b32a0(0x1b8))+':\x20'+JSON['stringify'](_0x385136);}async function getProjectIdOrDefault(_0x3c60cd){const _0x1854a3=a17_0x131c,{tdx:_0x3ec92e,options:_0x144259}=_0x3c60cd,_0x44ac3d=_0x144259[_0x1854a3(0x1dc)];if(_0x44ac3d){const _0x8abe0=await withSpinner(_0x1854a3(0x19b)+_0x44ac3d+'\x27...',()=>_0x3ec92e[_0x1854a3(0x1c7)][_0x1854a3(0x15b)](_0x44ac3d),{'verbose':_0x144259[_0x1854a3(0x16a)]});return _0x8abe0[_0x1854a3(0x18e)];}let _0x2a6770=_0x3ec92e['llm'][_0x1854a3(0x196)]();if(_0x2a6770)return _0x2a6770;const _0x1f1536=await withSpinner('Getting\x20default\x20project...',()=>_0x3ec92e[_0x1854a3(0x1c7)]['getOrCreateDefaultProject'](),{'verbose':_0x144259['verbose']});return _0x1f1536[_0x1854a3(0x18e)]['id'];}function toLLMProjectInfo(_0x2bddda){const _0x59f4ef=a17_0x131c;return{'name':_0x2bddda[_0x59f4ef(0x195)]['name'],'description':_0x2bddda['attributes'][_0x59f4ef(0x1a6)],'createdAt':_0x2bddda['attributes'][_0x59f4ef(0x197)],'updatedAt':_0x2bddda[_0x59f4ef(0x195)]['updatedAt']};}function toAgentInfo(_0x162556){const _0x29e57d=a17_0x131c;return{'name':_0x162556[_0x29e57d(0x195)][_0x29e57d(0x1da)],'description':_0x162556[_0x29e57d(0x195)][_0x29e57d(0x1a6)],'prompt':truncatePrompt(_0x162556[_0x29e57d(0x195)][_0x29e57d(0x1d5)]),'createdAt':_0x162556[_0x29e57d(0x195)][_0x29e57d(0x197)],'updatedAt':_0x162556[_0x29e57d(0x195)]['updatedAt']};}function truncatePrompt(_0x2483ed){const _0x506672=a17_0x131c;if(!_0x2483ed)return undefined;const _0x231561=0x64;if(_0x2483ed[_0x506672(0x1c6)]<=_0x231561)return _0x2483ed;return _0x2483ed[_0x506672(0x172)](0x0,_0x231561)+_0x506672(0x15c);}export class LLMModelsCommand extends BaseCommand{[a17_0x230884(0x1da)]='llm:models';[a17_0x230884(0x1a6)]=a17_0x230884(0x1a8);async[a17_0x230884(0x1aa)](_0x3af1e0){const _0x53d202=a17_0x230884,{options:_0x2efe03,tdx:_0x3e4d25}=_0x3af1e0;try{const _0x21d36b=await withSpinner(_0x53d202(0x152),()=>_0x3e4d25['llm'][_0x53d202(0x189)](),{'verbose':_0x2efe03[_0x53d202(0x16a)]});return await handleSDKOutput(_0x21d36b[_0x53d202(0x18e)],_0x2efe03),0x0;}catch(_0x130506){return handleSDKError(_0x130506,_0x2efe03),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0x230884(0x1da)]=a17_0x230884(0x181);[a17_0x230884(0x1a6)]=a17_0x230884(0x1c4);async[a17_0x230884(0x1aa)](_0x4cc557){const _0xaf114d=a17_0x230884,{options:_0x1d7495,args:_0xf0d211,tdx:_0x54761e}=_0x4cc557;try{const _0x5bee27=_0xf0d211[0x0],_0x2a7c92=resolveLimit(_0x1d7495['limit'],DEFAULT_LLM_LIMIT),_0x246c5c=await withSpinner(_0xaf114d(0x1a2),()=>_0x54761e[_0xaf114d(0x1c7)][_0xaf114d(0x1d1)](_0x2a7c92),{'verbose':_0x1d7495[_0xaf114d(0x16a)]});let _0xeae541=_0x246c5c['data'];_0x5bee27&&(_0xeae541=_0x246c5c[_0xaf114d(0x18e)]['filter'](_0x443ba3=>matchGlobPattern(_0x443ba3['attributes'][_0xaf114d(0x1da)],_0x5bee27)));const _0x4a0567=_0xeae541[_0xaf114d(0x18b)](toLLMProjectInfo);return await handleSDKOutput(_0x4a0567,_0x1d7495),0x0;}catch(_0xd93a2d){return handleSDKError(_0xd93a2d,_0x1d7495),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a17_0x230884(0x17f);[a17_0x230884(0x1a6)]=a17_0x230884(0x171);async[a17_0x230884(0x1aa)](_0x4d16b9){const _0x6455f8=a17_0x230884,{options:_0x1894b6,args:_0x2f82e2,tdx:_0x1c781a}=_0x4d16b9;try{const _0x26bc3d=_0x2f82e2[0x0];let _0x5c1d0e,_0x7ee026=_0x26bc3d;if(_0x26bc3d&&_0x26bc3d[_0x6455f8(0x1b7)]('/')){const _0x5f4681=_0x26bc3d[_0x6455f8(0x1c3)]('/');if(_0x5f4681[_0x6455f8(0x1c6)]===0x2){const [_0x5d4d50,_0xbfb38d]=_0x5f4681,_0x4d3d45=await _0x1c781a[_0x6455f8(0x1c7)]['projects'](),_0xd93b6f=_0x4d3d45[_0x6455f8(0x1bb)](_0x2a6dd3=>_0x2a6dd3['attributes']['name'][_0x6455f8(0x163)]()===_0x5d4d50[_0x6455f8(0x163)]());if(!_0xd93b6f)throw new SDKError(ErrorCode[_0x6455f8(0x1a7)],_0x6455f8(0x1bf)+_0x5d4d50,undefined,{'helpText':_0x6455f8(0x1de)});_0x5c1d0e=_0xd93b6f['id'],_0x7ee026=_0xbfb38d;}else throw new SDKError(ErrorCode[_0x6455f8(0x176)],_0x6455f8(0x190)+_0x26bc3d,undefined,{'helpText':_0x6455f8(0x156)});}else _0x5c1d0e=await getProjectIdOrDefault(_0x4d16b9);const _0x3e31bc=await withSpinner(_0x6455f8(0x198),()=>_0x1c781a[_0x6455f8(0x1c7)][_0x6455f8(0x18c)](_0x5c1d0e),{'verbose':_0x1894b6[_0x6455f8(0x16a)]});let _0x4c6365=_0x3e31bc[_0x6455f8(0x18e)];_0x7ee026&&(_0x4c6365=_0x3e31bc[_0x6455f8(0x18e)][_0x6455f8(0x19c)](_0x6ea849=>matchGlobPattern(_0x6ea849[_0x6455f8(0x195)][_0x6455f8(0x1da)],_0x7ee026)));const _0x45dc5a=_0x4c6365[_0x6455f8(0x18b)](toAgentInfo);return await handleSDKOutput(_0x45dc5a,_0x1894b6),0x0;}catch(_0xe896aa){return handleSDKError(_0xe896aa,_0x1894b6),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a17_0x230884(0x1da)]=a17_0x230884(0x17a);[a17_0x230884(0x1a6)]=a17_0x230884(0x178);async[a17_0x230884(0x1aa)](_0x98972e){const _0x19d3d5=a17_0x230884,{options:_0x13a580,args:_0x4aedfe,tdx:_0x29ae49}=_0x98972e;if(_0x4aedfe[_0x19d3d5(0x1c6)]===0x0)return console[_0x19d3d5(0x1c1)](_0x19d3d5(0x1a0)),console[_0x19d3d5(0x1c1)](_0x19d3d5(0x16b)),0x1;const _0x188315=_0x4aedfe[0x0];try{const _0x5402e0=await getProjectIdOrDefault(_0x98972e),_0x3937fc=await withSpinner(_0x19d3d5(0x188)+_0x188315+'\x27...',()=>_0x29ae49[_0x19d3d5(0x1c7)][_0x19d3d5(0x1d2)](_0x188315,_0x5402e0),{'verbose':_0x13a580[_0x19d3d5(0x16a)]}),_0x3dd017=await withSpinner(_0x19d3d5(0x179),()=>_0x29ae49[_0x19d3d5(0x1c7)][_0x19d3d5(0x1a3)](_0x3937fc[_0x19d3d5(0x18e)]),{'verbose':_0x13a580['verbose']});return await handleSDKOutput([_0x3dd017[_0x19d3d5(0x18e)]],_0x13a580),0x0;}catch(_0x48a07e){return handleSDKError(_0x48a07e,_0x13a580),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a17_0x230884(0x1da)]=a17_0x230884(0x169);['description']=a17_0x230884(0x1a9);async['execute'](_0x503256){const _0x38af2a=a17_0x230884,{options:_0x262bd5,args:_0x1d83fd,tdx:_0x5d980e}=_0x503256;if(_0x1d83fd['length']===0x0)return console[_0x38af2a(0x1c1)](_0x38af2a(0x1a0)),console[_0x38af2a(0x1c1)](_0x38af2a(0x1b2)),console[_0x38af2a(0x1c1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x11a380=_0x1d83fd[0x0],_0x3db70b=_0x262bd5,_0x498b33=_0x3db70b[_0x38af2a(0x161)],_0x37b157=_0x3db70b[_0x38af2a(0x155)]||_0x38af2a(0x160),_0x29bae7=_0x3db70b[_0x38af2a(0x187)],_0x12634e=_0x3db70b[_0x38af2a(0x1c5)]?Number(_0x3db70b['maxToolIterations']):undefined,_0x2e0004=_0x3db70b[_0x38af2a(0x186)]?Number(_0x3db70b['temperature']):undefined;try{let _0x3ef1b7,_0x3ebd4f;if(_0x11a380[_0x38af2a(0x1b7)]('/')){const _0xa8d58e=_0x11a380[_0x38af2a(0x1c3)]('/');if(_0xa8d58e[_0x38af2a(0x1c6)]===0x2){const [_0x34494b,_0x368417]=_0xa8d58e,_0x864198=await withSpinner(_0x38af2a(0x19b)+_0x34494b+_0x38af2a(0x192),()=>_0x5d980e['llm'][_0x38af2a(0x15b)](_0x34494b),{'verbose':_0x262bd5[_0x38af2a(0x16a)]});_0x3ef1b7=_0x864198['data'],_0x3ebd4f=_0x368417;}else throw new SDKError(ErrorCode[_0x38af2a(0x176)],'Invalid\x20path\x20syntax:\x20'+_0x11a380,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x3ef1b7=await getProjectIdOrDefault(_0x503256),_0x3ebd4f=_0x11a380;const _0x1e58ca=await withSpinner('Creating\x20agent\x20\x27'+_0x3ebd4f+'\x27...',()=>_0x5d980e['llm']['createAgent']({'name':_0x3ebd4f,'projectId':_0x3ef1b7,'modelType':_0x37b157,'systemPrompt':_0x498b33,'starterMessage':_0x29bae7,'maxToolIterations':_0x12634e,'temperature':_0x2e0004}),{'verbose':_0x262bd5[_0x38af2a(0x16a)]});return console['log'](_0x38af2a(0x1ce)+_0x1e58ca[_0x38af2a(0x18e)]['id']),await handleSDKOutput([_0x1e58ca[_0x38af2a(0x18e)]],_0x262bd5),0x0;}catch(_0x40bfff){return handleSDKError(_0x40bfff,_0x262bd5),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x230884(0x1da)]=a17_0x230884(0x1d4);[a17_0x230884(0x1a6)]='Update\x20an\x20existing\x20agent';async[a17_0x230884(0x1aa)](_0x2f8457){const _0x33b492=a17_0x230884,{options:_0x4ecb2a,args:_0x2ba38a,tdx:_0x17ae29}=_0x2f8457;if(_0x2ba38a[_0x33b492(0x1c6)]===0x0)return console[_0x33b492(0x1c1)](_0x33b492(0x1a0)),console[_0x33b492(0x1c1)](_0x33b492(0x151)),0x1;const _0x3bb245=_0x2ba38a[0x0],_0x1ca3f6=_0x4ecb2a,_0x1a9ddd=_0x1ca3f6[_0x33b492(0x1da)],_0x5ad241=_0x1ca3f6[_0x33b492(0x1d5)],_0x37032d=_0x1ca3f6[_0x33b492(0x1a6)],_0xf3244=_0x1ca3f6[_0x33b492(0x187)];if(!_0x1a9ddd&&!_0x5ad241&&!_0x37032d&&!_0xf3244)return console[_0x33b492(0x1c1)](_0x33b492(0x1d7)),console['error'](_0x33b492(0x157)),0x1;try{const _0x1411fc=await getProjectIdOrDefault(_0x2f8457),_0x5b4d87=await withSpinner(_0x33b492(0x188)+_0x3bb245+_0x33b492(0x192),()=>_0x17ae29['llm']['resolveAgentId'](_0x3bb245,_0x1411fc),{'verbose':_0x4ecb2a[_0x33b492(0x16a)]}),_0x1cd35f=_0x5b4d87[_0x33b492(0x18e)],_0x5de071=await withSpinner(_0x33b492(0x19e),()=>_0x17ae29[_0x33b492(0x1c7)]['updateAgent'](_0x1cd35f,{'name':_0x1a9ddd,'prompt':_0x5ad241,'description':_0x37032d,'starterMessage':_0xf3244}),{'verbose':_0x4ecb2a[_0x33b492(0x16a)]});return console[_0x33b492(0x1c0)](_0x33b492(0x1cc)+_0x5de071[_0x33b492(0x18e)]['id']),await handleSDKOutput([_0x5de071[_0x33b492(0x18e)]],_0x4ecb2a),0x0;}catch(_0x343798){return handleSDKError(_0x343798,_0x4ecb2a),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a17_0x230884(0x1d9);['description']='Delete\x20an\x20agent';async[a17_0x230884(0x1aa)](_0x1a197c){const _0x556954=a17_0x230884,{options:_0x2329b3,args:_0x518f4a,tdx:_0x2c4da4}=_0x1a197c;if(_0x518f4a[_0x556954(0x1c6)]===0x0)return console[_0x556954(0x1c1)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x556954(0x1c1)](_0x556954(0x1ac)),0x1;const _0x1fa6f1=_0x518f4a[0x0];try{const _0x551626=await getProjectIdOrDefault(_0x1a197c),_0x493c1d=await withSpinner('Resolving\x20agent\x20\x27'+_0x1fa6f1+'\x27...',()=>_0x2c4da4['llm'][_0x556954(0x1d2)](_0x1fa6f1,_0x551626),{'verbose':_0x2329b3[_0x556954(0x16a)]}),_0xcb3574=_0x493c1d[_0x556954(0x18e)];return await withSpinner(_0x556954(0x162),()=>_0x2c4da4[_0x556954(0x1c7)][_0x556954(0x180)](_0xcb3574),{'verbose':_0x2329b3['verbose']}),console[_0x556954(0x1c0)](_0x556954(0x1cd)+_0xcb3574),0x0;}catch(_0x1d49dc){return handleSDKError(_0x1d49dc,_0x2329b3),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x230884(0x1da)]=a17_0x230884(0x16e);[a17_0x230884(0x1a6)]=a17_0x230884(0x1b4);async[a17_0x230884(0x1aa)](_0x40c225){const _0x556a52=a17_0x230884,{options:_0x16e6c2,args:_0x384a07,tdx:_0x382c95}=_0x40c225;let _0x5173ef=_0x384a07[0x0];const _0x168f7f=_0x16e6c2,_0x20ab4c=_0x168f7f[_0x556a52(0x1bc)];try{if(_0x20ab4c){if(_0x5173ef)return console['error'](_0x556a52(0x15d)),console[_0x556a52(0x1c1)](_0x556a52(0x1ad)),0x1;const _0x4c898c=await withSpinner(_0x556a52(0x16f),()=>_0x382c95[_0x556a52(0x1c7)][_0x556a52(0x1db)](0x1),{'verbose':_0x16e6c2['verbose']});if(_0x4c898c[_0x556a52(0x18e)][_0x556a52(0x1c6)]===0x0)return console[_0x556a52(0x1c0)]('No\x20chat\x20sessions\x20found.'),0x0;_0x5173ef=_0x4c898c[_0x556a52(0x18e)][0x0]['id'];}if(!_0x5173ef){const _0x341a51=resolveLimit(_0x16e6c2[_0x556a52(0x174)],DEFAULT_LLM_LIMIT),_0x16ee90=await withSpinner(_0x556a52(0x1ba),()=>_0x382c95['llm']['chats'](_0x341a51),{'verbose':_0x16e6c2[_0x556a52(0x16a)]});if(_0x16e6c2[_0x556a52(0x1d0)]==='json'||_0x16e6c2[_0x556a52(0x1d0)]===_0x556a52(0x177))await handleSDKOutput(_0x16ee90['data'],_0x16e6c2);else{const _0x12a869=_0x16ee90[_0x556a52(0x18e)][_0x556a52(0x18b)](_0x485e71=>({'created_at':_0x485e71[_0x556a52(0x195)][_0x556a52(0x197)],'chat_id':_0x485e71['id'],'first_input':_0x485e71[_0x556a52(0x195)][_0x556a52(0x1b3)]||_0x556a52(0x15a)}));await handleSDKOutput(_0x12a869,_0x16e6c2);}return 0x0;}else{const _0x578fa1=await withSpinner(_0x556a52(0x1af)+_0x5173ef+'\x27...',()=>_0x382c95[_0x556a52(0x1c7)]['history'](_0x5173ef),{'verbose':_0x16e6c2[_0x556a52(0x16a)]}),_0x14edd2=_0x578fa1['data']['data']??[];if(_0x14edd2[_0x556a52(0x1c6)]===0x0)return console[_0x556a52(0x1c0)]('No\x20messages\x20found\x20in\x20chat\x20history.'),0x0;if(_0x16e6c2[_0x556a52(0x1d0)]===_0x556a52(0x153)||_0x16e6c2[_0x556a52(0x1d0)]==='jsonl'||_0x16e6c2[_0x556a52(0x1d0)]==='table'||_0x16e6c2[_0x556a52(0x1d0)]===_0x556a52(0x14f))await handleSDKOutput(_0x14edd2,_0x16e6c2);else for(const _0x2f0714 of _0x14edd2){console[_0x556a52(0x1c0)](formatChatHistoryEntry(_0x2f0714,_0x16e6c2));}return 0x0;}}catch(_0x1b9b8b){return handleSDKError(_0x1b9b8b,_0x16e6c2),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x230884(0x1da)]='llm:use';['description']='Set\x20current\x20project\x20context';async[a17_0x230884(0x1aa)](_0x460889){const _0x2c2fdb=a17_0x230884,{options:_0xa44b09,args:_0x10a704,tdx:_0xd2dec5}=_0x460889;if(_0x10a704['length']===0x0)return console[_0x2c2fdb(0x1c1)](_0x2c2fdb(0x1ab)),console[_0x2c2fdb(0x1c1)](_0x2c2fdb(0x17b)),0x1;const _0x239c85=_0x10a704[0x0];try{return await withSpinner(_0x2c2fdb(0x1be)+_0x239c85+_0x2c2fdb(0x192),()=>_0xd2dec5[_0x2c2fdb(0x1c7)][_0x2c2fdb(0x19d)](_0x239c85),{'verbose':_0xa44b09[_0x2c2fdb(0x16a)]}),console[_0x2c2fdb(0x1c0)]('Project\x20context\x20set\x20to:\x20'+_0x239c85),0x0;}catch(_0xa97b6b){return handleSDKError(_0xa97b6b,_0xa44b09),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a17_0x230884(0x1da)]=a17_0x230884(0x1c8);[a17_0x230884(0x1a6)]=a17_0x230884(0x1cf);async[a17_0x230884(0x1aa)](_0x2a0fdd){const _0x131a16=a17_0x230884,{options:_0x3c3b57,args:_0x48a572,tdx:_0x49d9c2}=_0x2a0fdd;if(_0x48a572[_0x131a16(0x1c6)]===0x0)return console[_0x131a16(0x1c1)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x131a16(0x1ca)),0x1;const _0x3cfd53=_0x48a572[0x0],_0x5ee9d2=_0x3c3b57,_0x3a0505=_0x5ee9d2[_0x131a16(0x1a6)];try{const _0x50cc1f=await withSpinner(_0x131a16(0x154)+_0x3cfd53+'\x27...',()=>_0x49d9c2[_0x131a16(0x1c7)][_0x131a16(0x199)]({'name':_0x3cfd53,'description':_0x3a0505}),{'verbose':_0x3c3b57['verbose']});console[_0x131a16(0x1c0)](_0x131a16(0x182)+_0x50cc1f[_0x131a16(0x18e)]['id']);const _0x205034=toLLMProjectInfo(_0x50cc1f[_0x131a16(0x18e)]);return await handleSDKOutput([_0x205034],_0x3c3b57),0x0;}catch(_0xd092f9){return handleSDKError(_0xd092f9,_0x3c3b57),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a17_0x230884(0x19f);[a17_0x230884(0x1a6)]=a17_0x230884(0x150);async[a17_0x230884(0x1aa)](_0x29857d){const _0x8a887e=a17_0x230884,{options:_0x5cd1c7,args:_0x4627c3,tdx:_0x4b139b}=_0x29857d;if(_0x4627c3['length']===0x0)return console[_0x8a887e(0x1c1)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x8a887e(0x1c1)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x5048c6=_0x4627c3[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x5048c6+_0x8a887e(0x192),()=>_0x4b139b['llm'][_0x8a887e(0x1b9)](_0x5048c6),{'verbose':_0x5cd1c7[_0x8a887e(0x16a)]}),console[_0x8a887e(0x1c0)](_0x8a887e(0x1b5)+_0x5048c6),0x0;}catch(_0x109bde){return handleSDKError(_0x109bde,_0x5cd1c7),0x1;}}}
@@ -1 +1 @@
1
- function a18_0x30ac(_0x4b7739,_0x4a47a3){const _0x1dca9a=a18_0x1dca();return a18_0x30ac=function(_0x30acb2,_0x28018d){_0x30acb2=_0x30acb2-0x176;let _0xc85d28=_0x1dca9a[_0x30acb2];return _0xc85d28;},a18_0x30ac(_0x4b7739,_0x4a47a3);}const a18_0x1e86af=a18_0x30ac;(function(_0xce5d79,_0x793a33){const _0x496763=a18_0x30ac,_0x1c33e2=_0xce5d79();while(!![]){try{const _0x26b2cf=parseInt(_0x496763(0x1b4))/0x1+parseInt(_0x496763(0x1aa))/0x2*(-parseInt(_0x496763(0x1a8))/0x3)+parseInt(_0x496763(0x179))/0x4+parseInt(_0x496763(0x1a5))/0x5*(parseInt(_0x496763(0x193))/0x6)+parseInt(_0x496763(0x18d))/0x7*(-parseInt(_0x496763(0x195))/0x8)+parseInt(_0x496763(0x1a1))/0x9*(parseInt(_0x496763(0x197))/0xa)+parseInt(_0x496763(0x1b0))/0xb*(-parseInt(_0x496763(0x18a))/0xc);if(_0x26b2cf===_0x793a33)break;else _0x1c33e2['push'](_0x1c33e2['shift']());}catch(_0x31b106){_0x1c33e2['push'](_0x1c33e2['shift']());}}}(a18_0x1dca,0x699d6));import a18_0x2575cb from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x32cd11,_0x66792){const _0x2cc906=a18_0x30ac,{tdx:_0x378276,options:_0x886572}=_0x32cd11,_0x504c90=_0x66792||_0x886572[_0x2cc906(0x19b)];if(_0x504c90){const _0x14307f=await _0x378276[_0x2cc906(0x1b1)][_0x2cc906(0x1a4)](),_0x5a9dec=_0x14307f[_0x2cc906(0x1b2)](_0x47988f=>_0x47988f[_0x2cc906(0x1a9)][_0x2cc906(0x1a6)]===_0x504c90);if(!_0x5a9dec)throw new SDKError(ErrorCode['NOT_FOUND'],_0x2cc906(0x198)+_0x504c90+_0x2cc906(0x17f),undefined,{'helpText':_0x2cc906(0x1b5)});return _0x5a9dec['id'];}const _0x14a1ff=await _0x378276[_0x2cc906(0x1b1)]['getOrCreateDefaultProject']();return _0x14a1ff['id'];}function a18_0x1dca(){const _0x403166=['16rVFPUg','dim','5112220oBNDka','Project\x20\x27','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','Starting\x20proxy\x20server...','llmProject','\x20\x20Site:','Resolving\x20project...','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','port','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','9EKJPWl','logger','\x20\x20\x20\x20\x22env\x22:\x20{','projects','5MtpxhP','name','✓\x20Proxy\x20server\x20stopped','3LVaUMb','attributes','407152IjgbYM','\x20\x20Address:','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','start','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','790746yNsoIh','llm','find','exit','618307imPKCm','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','http://0.0.0.0:','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','project','\x20\x20}','416060kKfwSN','\x20\x20\x20\x20}','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','bold','SIGINT','description','\x27\x20not\x20found','server','green','created\x20on-demand\x20per\x20model','logLevel','white','\x20\x20{','stop','site','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','cyan','132jNVAQb','close','yellow','913724NiFjXs','llm:proxy','SIGTERM','Server\x20Configuration:','init','\x20is\x20unavailable,\x20using\x20port\x20','2726640OdYqLl','log'];a18_0x1dca=function(){return _0x403166;};return a18_0x1dca();}export class LLMProxyCommand extends BaseCommand{[a18_0x1e86af(0x1a6)]=a18_0x1e86af(0x18e);[a18_0x1e86af(0x17e)]=a18_0x1e86af(0x199);[a18_0x1e86af(0x180)];[a18_0x1e86af(0x1a2)];async['execute'](_0x2e37f6){const _0x44ebf0=a18_0x1e86af,{tdx:_0x4be36d,options:_0x5ec006}=_0x2e37f6;try{const _0x550cc3=_0x5ec006,_0x36b555=_0x550cc3[_0x44ebf0(0x19f)]||0xfa0,_0x4757d1=_0x550cc3[_0x44ebf0(0x177)],_0x17de66=await findAvailablePort(_0x36b555);console['log'](a18_0x2575cb['dim'](_0x44ebf0(0x19d)));const _0x1d7507=await getProjectIdOrDefault(_0x2e37f6,_0x4757d1),_0x47b984=await _0x4be36d[_0x44ebf0(0x1b1)][_0x44ebf0(0x1a4)](),_0x31c512=_0x47b984[_0x44ebf0(0x1b2)](_0x4025ff=>_0x4025ff['id']===_0x1d7507);this['logger']=new TDXLogger(_0x5ec006[_0x44ebf0(0x183)]),await this['logger'][_0x44ebf0(0x191)](),console[_0x44ebf0(0x194)](a18_0x2575cb['dim'](_0x44ebf0(0x19a)));_0x17de66!==_0x36b555&&console['log'](a18_0x2575cb[_0x44ebf0(0x18c)]('Port\x20'+_0x36b555+_0x44ebf0(0x192)+_0x17de66));this[_0x44ebf0(0x180)]=new ProxyServer({'port':_0x17de66,'projectId':_0x1d7507,'tdx':_0x4be36d,'logger':this[_0x44ebf0(0x1a2)]}),await this[_0x44ebf0(0x180)][_0x44ebf0(0x1ad)](),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x18c)]['bold'](_0x44ebf0(0x19e))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x18c)](_0x44ebf0(0x1a0))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x18c)](_0x44ebf0(0x1ac))),console[_0x44ebf0(0x194)](a18_0x2575cb['green'][_0x44ebf0(0x17c)](_0x44ebf0(0x176))),console['log'](a18_0x2575cb['cyan'](_0x44ebf0(0x190))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x196)](_0x44ebf0(0x1ab)),a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x1b6)+_0x17de66)),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x196)]('\x20\x20Project:'),a18_0x2575cb[_0x44ebf0(0x184)](_0x31c512?.[_0x44ebf0(0x1a9)]['name']||_0x1d7507)),console['log'](a18_0x2575cb[_0x44ebf0(0x196)]('\x20\x20Agents:'),a18_0x2575cb['white'](_0x44ebf0(0x182))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x196)](_0x44ebf0(0x19c)),a18_0x2575cb[_0x44ebf0(0x184)](_0x5ec006[_0x44ebf0(0x187)])),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x189)]('\x0aClaude\x20Code\x20Configuration:')),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x196)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x185))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x1a3))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x1ae)+_0x17de66+'\x22,')),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x188))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x17a))),console['log'](a18_0x2575cb[_0x44ebf0(0x184)](_0x44ebf0(0x178))),console['log'](a18_0x2575cb[_0x44ebf0(0x189)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x196)](_0x44ebf0(0x17b))),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x196)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console['log'](a18_0x2575cb[_0x44ebf0(0x196)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x44ebf0(0x194)](a18_0x2575cb[_0x44ebf0(0x18c)](_0x44ebf0(0x1af)));const _0x19d673=async()=>{const _0x109076=_0x44ebf0;console[_0x109076(0x194)](a18_0x2575cb[_0x109076(0x196)]('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x109076(0x180)]&&await this[_0x109076(0x180)][_0x109076(0x186)](),this[_0x109076(0x1a2)]&&await this['logger'][_0x109076(0x18b)](),console[_0x109076(0x194)](a18_0x2575cb[_0x109076(0x181)](_0x109076(0x1a7))),process[_0x109076(0x1b3)](0x0);};return process['on'](_0x44ebf0(0x17d),_0x19d673),process['on'](_0x44ebf0(0x18f),_0x19d673),await new Promise(()=>{}),0x0;}catch(_0x16d1a1){this[_0x44ebf0(0x180)]&&await this[_0x44ebf0(0x180)]['stop']();this[_0x44ebf0(0x1a2)]&&await this['logger'][_0x44ebf0(0x18b)]();throw _0x16d1a1;}}}
1
+ const a18_0x4a3b31=a18_0x28f9;(function(_0x4cd4ba,_0x5edcba){const _0x341935=a18_0x28f9,_0x3dce9b=_0x4cd4ba();while(!![]){try{const _0x3caff6=-parseInt(_0x341935(0xda))/0x1*(parseInt(_0x341935(0xb4))/0x2)+parseInt(_0x341935(0xd1))/0x3+-parseInt(_0x341935(0xcc))/0x4*(-parseInt(_0x341935(0xcb))/0x5)+-parseInt(_0x341935(0xa8))/0x6+-parseInt(_0x341935(0xb3))/0x7+-parseInt(_0x341935(0xd0))/0x8+parseInt(_0x341935(0xc3))/0x9;if(_0x3caff6===_0x5edcba)break;else _0x3dce9b['push'](_0x3dce9b['shift']());}catch(_0x21393c){_0x3dce9b['push'](_0x3dce9b['shift']());}}}(a18_0x3d27,0xbd360));import a18_0x6218f9 from'chalk';import{BaseCommand}from'./command.js';function a18_0x28f9(_0x48880c,_0x4e8aac){const _0x3d27f2=a18_0x3d27();return a18_0x28f9=function(_0x28f90,_0xe597a4){_0x28f90=_0x28f90-0xa2;let _0x168c93=_0x3d27f2[_0x28f90];return _0x168c93;},a18_0x28f9(_0x48880c,_0x4e8aac);}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(_0x3e3f38,_0x1d54e0){const _0x4c1765=a18_0x28f9,{tdx:_0xc472ca,options:_0x4b0550}=_0x3e3f38,_0x1178f6=_0x1d54e0||_0x4b0550['llmProject'];if(_0x1178f6){const _0x57f6df=await _0xc472ca['llm']['projects'](),_0x98ab99=_0x57f6df[_0x4c1765(0xba)](_0x4c9477=>_0x4c9477[_0x4c1765(0xca)][_0x4c1765(0xce)]===_0x1178f6);if(!_0x98ab99)throw new SDKError(ErrorCode[_0x4c1765(0xc5)],_0x4c1765(0xae)+_0x1178f6+'\x27\x20not\x20found',undefined,{'helpText':_0x4c1765(0xc7)});return _0x98ab99['id'];}const _0x1b541a=await _0xc472ca[_0x4c1765(0xbd)][_0x4c1765(0xa9)]();return _0x1b541a['id'];}export class LLMProxyCommand extends BaseCommand{['name']='llm:proxy';[a18_0x4a3b31(0xb7)]=a18_0x4a3b31(0xab);[a18_0x4a3b31(0xad)];[a18_0x4a3b31(0xb5)];async['execute'](_0x868d27){const _0x59e72d=a18_0x4a3b31,{tdx:_0x14a90f,options:_0x5498b4}=_0x868d27;try{const _0x2adf7e=_0x5498b4,_0xf2aa41=_0x2adf7e[_0x59e72d(0xcd)]||0xfa0,_0x13b82c=_0x2adf7e[_0x59e72d(0xd2)],_0x57e0ed=await findAvailablePort(_0xf2aa41);console[_0x59e72d(0xc9)](a18_0x6218f9['dim']('Resolving\x20project...'));const _0x5dba5d=await getProjectIdOrDefault(_0x868d27,_0x13b82c),_0xf90be=await _0x14a90f[_0x59e72d(0xbd)][_0x59e72d(0xa2)](),_0x14ee3c=_0xf90be[_0x59e72d(0xba)](_0x2ad7d6=>_0x2ad7d6['id']===_0x5dba5d);this[_0x59e72d(0xb5)]=new TDXLogger(_0x5498b4[_0x59e72d(0xd8)]),await this[_0x59e72d(0xb5)]['init'](),console[_0x59e72d(0xc9)](a18_0x6218f9['dim'](_0x59e72d(0xcf)));_0x57e0ed!==_0xf2aa41&&console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xb0)]('Port\x20'+_0xf2aa41+_0x59e72d(0xd3)+_0x57e0ed));this[_0x59e72d(0xad)]=new ProxyServer({'port':_0x57e0ed,'projectId':_0x5dba5d,'tdx':_0x14a90f,'logger':this[_0x59e72d(0xb5)]}),await this[_0x59e72d(0xad)][_0x59e72d(0xb8)](),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xb0)][_0x59e72d(0xc8)](_0x59e72d(0xc6))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xb0)](_0x59e72d(0xd7))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xb0)](_0x59e72d(0xdb))),console[_0x59e72d(0xc9)](a18_0x6218f9['green']['bold']('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0x59e72d(0xc9)](a18_0x6218f9['cyan']('Server\x20Configuration:')),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)]('\x20\x20Address:'),a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xa6)+_0x57e0ed)),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)]('\x20\x20Project:'),a18_0x6218f9[_0x59e72d(0xc4)](_0x14ee3c?.['attributes'][_0x59e72d(0xce)]||_0x5dba5d)),console['log'](a18_0x6218f9[_0x59e72d(0xaf)](_0x59e72d(0xc1)),a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xd9))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)](_0x59e72d(0xb6)),a18_0x6218f9[_0x59e72d(0xc4)](_0x5498b4[_0x59e72d(0xc0)])),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xbb)]('\x0aClaude\x20Code\x20Configuration:')),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0x59e72d(0xc9)](a18_0x6218f9['white']('\x20\x20{')),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xbe))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xa5)+_0x57e0ed+'\x22,')),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xb9))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xa3))),console['log'](a18_0x6218f9[_0x59e72d(0xc4)](_0x59e72d(0xb2))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xbb)](_0x59e72d(0xd5))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)](_0x59e72d(0xd6))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xaf)](_0x59e72d(0xa4))),console[_0x59e72d(0xc9)](a18_0x6218f9[_0x59e72d(0xb0)](_0x59e72d(0xa7)));const _0x330315=async()=>{const _0x19e186=_0x59e72d;console['log'](a18_0x6218f9[_0x19e186(0xaf)](_0x19e186(0xbc))),this['server']&&await this[_0x19e186(0xad)][_0x19e186(0xbf)](),this['logger']&&await this[_0x19e186(0xb5)][_0x19e186(0xaa)](),console[_0x19e186(0xc9)](a18_0x6218f9[_0x19e186(0xd4)](_0x19e186(0xb1))),process[_0x19e186(0xac)](0x0);};return process['on']('SIGINT',_0x330315),process['on'](_0x59e72d(0xc2),_0x330315),await new Promise(()=>{}),0x0;}catch(_0x4553c3){this[_0x59e72d(0xad)]&&await this[_0x59e72d(0xad)]['stop']();this[_0x59e72d(0xb5)]&&await this[_0x59e72d(0xb5)][_0x59e72d(0xaa)]();throw _0x4553c3;}}}function a18_0x3d27(){const _0x333d90=['\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','http://0.0.0.0:','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','3913884PEBJXA','getOrCreateDefaultProject','close','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','exit','server','Project\x20\x27','dim','yellow','✓\x20Proxy\x20server\x20stopped','\x20\x20}','1772176tJVZGa','1520306QVrKMH','logger','\x20\x20Site:','description','start','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','find','cyan','\x0a\x0aShutting\x20down\x20proxy\x20server...','llm','\x20\x20\x20\x20\x22env\x22:\x20{','stop','site','\x20\x20Agents:','SIGTERM','15775893FklqbZ','white','NOT_FOUND','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','bold','log','attributes','60365RIoxhv','276OSJCQv','port','name','Starting\x20proxy\x20server...','7109528BTFFUh','2230260odwPTM','project','\x20is\x20unavailable,\x20using\x20port\x20','green','\x0aTesting\x20with\x20Agent\x20SDK:','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','logLevel','created\x20on-demand\x20per\x20model','1kppkKh','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','projects','\x20\x20\x20\x20}'];a18_0x3d27=function(){return _0x333d90;};return a18_0x3d27();}
@@ -1 +1 @@
1
- const a19_0x5b178c=a19_0x8ae5;(function(_0x2a7573,_0x453290){const _0x431024=a19_0x8ae5,_0x33fa90=_0x2a7573();while(!![]){try{const _0x1800e6=parseInt(_0x431024(0x135))/0x1+-parseInt(_0x431024(0x133))/0x2+-parseInt(_0x431024(0x138))/0x3+-parseInt(_0x431024(0x13f))/0x4*(parseInt(_0x431024(0x14e))/0x5)+parseInt(_0x431024(0x12e))/0x6+-parseInt(_0x431024(0x147))/0x7*(-parseInt(_0x431024(0x126))/0x8)+parseInt(_0x431024(0x124))/0x9;if(_0x1800e6===_0x453290)break;else _0x33fa90['push'](_0x33fa90['shift']());}catch(_0x153ab6){_0x33fa90['push'](_0x33fa90['shift']());}}}(a19_0x59cd,0xcff74));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a19_0x59cd(){const _0x5bf286=['getParentFull','data','3316908zHpIbh','segment:parent:create','Name:\x20','behaviorsFile','name','scheduleType','Database:\x20','5inObpI','Site:\x20','execute','updateParent','4738374BGMllY','customerGroup','24ELYucj','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment','addAttributesFile','timezone','addAttributes','behaviors','master','3139044nPCUTg','description','\x27...','addBehaviors','scheduleOption','834486mJXyfr','length','706873ZGWztV','error','database','3730689cEjJTD','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','createParent','Create\x20new\x20parent\x20segment\x20(audience)','segment:parent:update','Updating\x20parent\x20segment\x20\x27','table','2661724ikeVcW','verbose','addBehaviorsFile','attributes','site','Error:\x20--database\x20and\x20--table\x20are\x20required'];a19_0x59cd=function(){return _0x5bf286;};return a19_0x59cd();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a19_0x8ae5(_0x44b242,_0x3a14f2){const _0x59cd66=a19_0x59cd();return a19_0x8ae5=function(_0x8ae5c2,_0x31f703){_0x8ae5c2=_0x8ae5c2-0x121;let _0x250c95=_0x59cd66[_0x8ae5c2];return _0x250c95;},a19_0x8ae5(_0x44b242,_0x3a14f2);}export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x5b178c(0x14b)]=a19_0x5b178c(0x148);[a19_0x5b178c(0x12f)]=a19_0x5b178c(0x13b);async[a19_0x5b178c(0x122)](_0x537419){const _0x434ec3=a19_0x5b178c,{options:_0x31c518,args:_0x21fa49,tdx:_0x239fc7}=_0x537419,_0x1fd1e3=_0x31c518;if(_0x21fa49[_0x434ec3(0x134)]===0x0)return console['error'](_0x434ec3(0x127)),console[_0x434ec3(0x136)](_0x434ec3(0x139)),0x1;const _0x25bbc5=_0x21fa49[0x0];if(!_0x1fd1e3['database']||!_0x1fd1e3['table'])return console[_0x434ec3(0x136)](_0x434ec3(0x144)),console[_0x434ec3(0x136)](_0x434ec3(0x139)),0x1;_0x1fd1e3['verbose']&&(console[_0x434ec3(0x136)](_0x434ec3(0x121)+_0x1fd1e3[_0x434ec3(0x143)]),console[_0x434ec3(0x136)](_0x434ec3(0x149)+_0x25bbc5),console[_0x434ec3(0x136)](_0x434ec3(0x14d)+_0x1fd1e3[_0x434ec3(0x137)]),console[_0x434ec3(0x136)]('Table:\x20'+_0x1fd1e3[_0x434ec3(0x13e)]));const _0x3e889e=await loadJSONFromOptions(_0x1fd1e3[_0x434ec3(0x142)],_0x1fd1e3['attributesFile']),_0x4dba07=await loadJSONFromOptions(_0x1fd1e3[_0x434ec3(0x12c)],_0x1fd1e3[_0x434ec3(0x14a)]),_0x1e11e0=await loadJSONFromOptions(_0x1fd1e3[_0x434ec3(0x125)],_0x1fd1e3['customerGroupFile']),_0x14def1={'name':_0x25bbc5,'description':_0x1fd1e3[_0x434ec3(0x12f)],'scheduleType':_0x1fd1e3['scheduleType'],'scheduleOption':_0x1fd1e3[_0x434ec3(0x132)],'timezone':_0x1fd1e3['timezone'],'master':{'parentDatabaseName':_0x1fd1e3['database'],'parentTableName':_0x1fd1e3[_0x434ec3(0x13e)]},'attributes':_0x3e889e,'behaviors':_0x4dba07,'customerGroup':_0x1e11e0},_0x27505e=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x25bbc5+_0x434ec3(0x130),()=>_0x239fc7[_0x434ec3(0x128)][_0x434ec3(0x13a)](_0x14def1),{'verbose':_0x31c518[_0x434ec3(0x140)]}),_0x4f9be3=_0x27505e['data'];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x4f9be3[_0x434ec3(0x14b)]+'\x27\x20with\x20ID:\x20'+_0x4f9be3['id']),await handleSDKOutput([_0x4f9be3],_0x31c518),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x5b178c(0x14b)]=a19_0x5b178c(0x13c);[a19_0x5b178c(0x12f)]='Update\x20existing\x20parent\x20segment\x20(audience)';async[a19_0x5b178c(0x122)](_0x853289){const _0xbeaa99=a19_0x5b178c,{options:_0x4e3807,args:_0x213e65,tdx:_0x153090}=_0x853289,_0x5aacea=_0x4e3807;if(_0x213e65['length']===0x0)return console[_0xbeaa99(0x136)](_0xbeaa99(0x127)),console['error']('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x32c8d1=_0x213e65[0x0];_0x5aacea['verbose']&&(console[_0xbeaa99(0x136)](_0xbeaa99(0x121)+_0x5aacea[_0xbeaa99(0x143)]),console[_0xbeaa99(0x136)]('Parent\x20segment:\x20'+_0x32c8d1));const _0x41f68c=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x32c8d1+'\x27...',()=>_0x153090[_0xbeaa99(0x128)][_0xbeaa99(0x145)](_0x32c8d1),{'verbose':_0x5aacea['verbose']}),_0x25fcd4=_0x41f68c[_0xbeaa99(0x146)],_0x2625ee=await loadJSONFromOptions(_0x5aacea[_0xbeaa99(0x12b)],_0x5aacea[_0xbeaa99(0x129)]),_0x509234=await loadJSONFromOptions(_0x5aacea[_0xbeaa99(0x131)],_0x5aacea[_0xbeaa99(0x141)]),_0x115b59={'name':_0x25fcd4['name'],'description':_0x5aacea['description']!==undefined?_0x5aacea[_0xbeaa99(0x12f)]:_0x25fcd4[_0xbeaa99(0x12f)],'scheduleType':_0x5aacea['scheduleType']!==undefined?_0x5aacea['scheduleType']:_0x25fcd4[_0xbeaa99(0x14c)],'scheduleOption':_0x5aacea['scheduleOption']!==undefined?_0x5aacea[_0xbeaa99(0x132)]:_0x25fcd4[_0xbeaa99(0x132)],'timezone':_0x5aacea['timezone']!==undefined?_0x5aacea[_0xbeaa99(0x12a)]:_0x25fcd4['timezone'],'master':_0x25fcd4[_0xbeaa99(0x12d)],'attributes':_0x2625ee?[..._0x25fcd4[_0xbeaa99(0x142)]||[],..._0x2625ee]:_0x25fcd4[_0xbeaa99(0x142)],'behaviors':_0x509234?[..._0x25fcd4[_0xbeaa99(0x12c)]||[],..._0x509234]:_0x25fcd4[_0xbeaa99(0x12c)],'customerGroup':_0x25fcd4[_0xbeaa99(0x125)]},_0x395953=await withSpinner(_0xbeaa99(0x13d)+_0x32c8d1+_0xbeaa99(0x130),()=>_0x153090[_0xbeaa99(0x128)][_0xbeaa99(0x123)](_0x32c8d1,_0x115b59),{'verbose':_0x5aacea[_0xbeaa99(0x140)]}),_0x4b8630=_0x395953['data'];return console[_0xbeaa99(0x136)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x4b8630[_0xbeaa99(0x14b)]+'\x27'),await handleSDKOutput([_0x4b8630],_0x5aacea),0x0;}}
1
+ const a19_0x1d93c3=a19_0x69f6;function a19_0x69f6(_0x3b8715,_0xa50dd7){const _0x418a77=a19_0x418a();return a19_0x69f6=function(_0x69f6e9,_0xaa5d4){_0x69f6e9=_0x69f6e9-0x103;let _0x575e19=_0x418a77[_0x69f6e9];return _0x575e19;},a19_0x69f6(_0x3b8715,_0xa50dd7);}(function(_0x589c0e,_0x368f34){const _0x680e73=a19_0x69f6,_0x357ffc=_0x589c0e();while(!![]){try{const _0x3449d7=-parseInt(_0x680e73(0x107))/0x1*(parseInt(_0x680e73(0x116))/0x2)+-parseInt(_0x680e73(0x10c))/0x3*(parseInt(_0x680e73(0x12b))/0x4)+parseInt(_0x680e73(0x133))/0x5+parseInt(_0x680e73(0x129))/0x6*(-parseInt(_0x680e73(0x11f))/0x7)+-parseInt(_0x680e73(0x12c))/0x8+parseInt(_0x680e73(0x126))/0x9*(parseInt(_0x680e73(0x105))/0xa)+parseInt(_0x680e73(0x11b))/0xb;if(_0x3449d7===_0x368f34)break;else _0x357ffc['push'](_0x357ffc['shift']());}catch(_0x2af6eb){_0x357ffc['push'](_0x357ffc['shift']());}}}(a19_0x418a,0x80221));function a19_0x418a(){const _0x32b164=['✔\x20Updated\x20parent\x20segment\x20\x27','\x27\x20with\x20ID:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','error','scheduleType','✔\x20Created\x20parent\x20segment\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27','verbose','attributesFile','8kyvRTy','addBehaviorsFile','segment:parent:update','master','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','11354959LcSzTn','addAttributesFile','addAttributes','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','30254xRTKfA','customerGroupFile','Table:\x20','segment:parent:create','length','Creating\x20parent\x20segment\x20\x27','Updating\x20parent\x20segment\x20\x27','112446GMnoCZ','table','execute','138szWyWl','Error:\x20Parent\x20segment\x20name\x20is\x20required','2424124UZYXcN','1500504UKpLwY','database','description','getParentFull','site','attributes','updateParent','1882080mTNEIP','Database:\x20','customerGroup','Name:\x20','name','Update\x20existing\x20parent\x20segment\x20(audience)','timezone','data','behaviors','140CNcKyh','\x27...','41442mzuFAv','segment','Create\x20new\x20parent\x20segment\x20(audience)','scheduleOption','Site:\x20','3ShYLKv'];a19_0x418a=function(){return _0x32b164;};return a19_0x418a();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{['name']=a19_0x1d93c3(0x122);[a19_0x1d93c3(0x12e)]=a19_0x1d93c3(0x109);async[a19_0x1d93c3(0x128)](_0x2ea125){const _0xcb693e=a19_0x1d93c3,{options:_0x3f4006,args:_0x434c6d,tdx:_0x1e27c3}=_0x2ea125,_0xee792e=_0x3f4006;if(_0x434c6d[_0xcb693e(0x123)]===0x0)return console[_0xcb693e(0x110)](_0xcb693e(0x12a)),console[_0xcb693e(0x110)](_0xcb693e(0x11e)),0x1;const _0x4b4a83=_0x434c6d[0x0];if(!_0xee792e['database']||!_0xee792e[_0xcb693e(0x127)])return console[_0xcb693e(0x110)](_0xcb693e(0x10f)),console[_0xcb693e(0x110)](_0xcb693e(0x11e)),0x1;_0xee792e[_0xcb693e(0x114)]&&(console[_0xcb693e(0x110)]('Site:\x20'+_0xee792e[_0xcb693e(0x130)]),console[_0xcb693e(0x110)](_0xcb693e(0x136)+_0x4b4a83),console[_0xcb693e(0x110)](_0xcb693e(0x134)+_0xee792e[_0xcb693e(0x12d)]),console[_0xcb693e(0x110)](_0xcb693e(0x121)+_0xee792e[_0xcb693e(0x127)]));const _0x337963=await loadJSONFromOptions(_0xee792e['attributes'],_0xee792e[_0xcb693e(0x115)]),_0x18bf44=await loadJSONFromOptions(_0xee792e[_0xcb693e(0x104)],_0xee792e['behaviorsFile']),_0x465d7e=await loadJSONFromOptions(_0xee792e[_0xcb693e(0x135)],_0xee792e[_0xcb693e(0x120)]),_0x41628f={'name':_0x4b4a83,'description':_0xee792e[_0xcb693e(0x12e)],'scheduleType':_0xee792e['scheduleType'],'scheduleOption':_0xee792e[_0xcb693e(0x10a)],'timezone':_0xee792e['timezone'],'master':{'parentDatabaseName':_0xee792e[_0xcb693e(0x12d)],'parentTableName':_0xee792e[_0xcb693e(0x127)]},'attributes':_0x337963,'behaviors':_0x18bf44,'customerGroup':_0x465d7e},_0x10abdd=await withSpinner(_0xcb693e(0x124)+_0x4b4a83+_0xcb693e(0x106),()=>_0x1e27c3['segment']['createParent'](_0x41628f),{'verbose':_0x3f4006[_0xcb693e(0x114)]}),_0x3a9ac=_0x10abdd[_0xcb693e(0x103)];return console[_0xcb693e(0x110)](_0xcb693e(0x112)+_0x3a9ac[_0xcb693e(0x137)]+_0xcb693e(0x10e)+_0x3a9ac['id']),await handleSDKOutput([_0x3a9ac],_0x3f4006),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x1d93c3(0x118);[a19_0x1d93c3(0x12e)]=a19_0x1d93c3(0x138);async['execute'](_0x3b2d40){const _0x330bb9=a19_0x1d93c3,{options:_0x214b75,args:_0x1989b6,tdx:_0x4b30c1}=_0x3b2d40,_0x584993=_0x214b75;if(_0x1989b6[_0x330bb9(0x123)]===0x0)return console[_0x330bb9(0x110)](_0x330bb9(0x12a)),console[_0x330bb9(0x110)](_0x330bb9(0x11a)),0x1;const _0x2cc949=_0x1989b6[0x0];_0x584993['verbose']&&(console[_0x330bb9(0x110)](_0x330bb9(0x10b)+_0x584993[_0x330bb9(0x130)]),console[_0x330bb9(0x110)]('Parent\x20segment:\x20'+_0x2cc949));const _0x5cbe21=await withSpinner(_0x330bb9(0x113)+_0x2cc949+_0x330bb9(0x106),()=>_0x4b30c1[_0x330bb9(0x108)][_0x330bb9(0x12f)](_0x2cc949),{'verbose':_0x584993[_0x330bb9(0x114)]}),_0x24896e=_0x5cbe21[_0x330bb9(0x103)],_0x8cc51e=await loadJSONFromOptions(_0x584993[_0x330bb9(0x11d)],_0x584993[_0x330bb9(0x11c)]),_0x1e7c37=await loadJSONFromOptions(_0x584993['addBehaviors'],_0x584993[_0x330bb9(0x117)]),_0x1ac2fb={'name':_0x24896e[_0x330bb9(0x137)],'description':_0x584993[_0x330bb9(0x12e)]!==undefined?_0x584993[_0x330bb9(0x12e)]:_0x24896e[_0x330bb9(0x12e)],'scheduleType':_0x584993[_0x330bb9(0x111)]!==undefined?_0x584993[_0x330bb9(0x111)]:_0x24896e[_0x330bb9(0x111)],'scheduleOption':_0x584993[_0x330bb9(0x10a)]!==undefined?_0x584993['scheduleOption']:_0x24896e[_0x330bb9(0x10a)],'timezone':_0x584993[_0x330bb9(0x139)]!==undefined?_0x584993[_0x330bb9(0x139)]:_0x24896e[_0x330bb9(0x139)],'master':_0x24896e[_0x330bb9(0x119)],'attributes':_0x8cc51e?[..._0x24896e[_0x330bb9(0x131)]||[],..._0x8cc51e]:_0x24896e[_0x330bb9(0x131)],'behaviors':_0x1e7c37?[..._0x24896e[_0x330bb9(0x104)]||[],..._0x1e7c37]:_0x24896e['behaviors'],'customerGroup':_0x24896e[_0x330bb9(0x135)]},_0x2b8eb8=await withSpinner(_0x330bb9(0x125)+_0x2cc949+'\x27...',()=>_0x4b30c1[_0x330bb9(0x108)][_0x330bb9(0x132)](_0x2cc949,_0x1ac2fb),{'verbose':_0x584993[_0x330bb9(0x114)]}),_0xda6963=_0x2b8eb8[_0x330bb9(0x103)];return console['error'](_0x330bb9(0x10d)+_0xda6963['name']+'\x27'),await handleSDKOutput([_0xda6963],_0x584993),0x0;}}
@@ -1 +1 @@
1
- const a20_0x4aa9c0=a20_0xb20c;function a20_0xb20c(_0x184380,_0x1ee2e6){const _0x2b541e=a20_0x2b54();return a20_0xb20c=function(_0xb20ce5,_0x32d66e){_0xb20ce5=_0xb20ce5-0xba;let _0x3f7d46=_0x2b541e[_0xb20ce5];return _0x3f7d46;},a20_0xb20c(_0x184380,_0x1ee2e6);}(function(_0x2dc868,_0x15645b){const _0x47da01=a20_0xb20c,_0x267f8b=_0x2dc868();while(!![]){try{const _0x466f34=-parseInt(_0x47da01(0xc4))/0x1+-parseInt(_0x47da01(0xbf))/0x2+parseInt(_0x47da01(0xc2))/0x3*(parseInt(_0x47da01(0xc1))/0x4)+-parseInt(_0x47da01(0xc8))/0x5*(-parseInt(_0x47da01(0xc5))/0x6)+parseInt(_0x47da01(0xc6))/0x7*(-parseInt(_0x47da01(0xd0))/0x8)+-parseInt(_0x47da01(0xc0))/0x9+-parseInt(_0x47da01(0xbe))/0xa*(-parseInt(_0x47da01(0xca))/0xb);if(_0x466f34===_0x15645b)break;else _0x267f8b['push'](_0x267f8b['shift']());}catch(_0x5abc6d){_0x267f8b['push'](_0x267f8b['shift']());}}}(a20_0x2b54,0xe3b1e));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x4aa9c0(0xba)]=a20_0x4aa9c0(0xc3);['description']=a20_0x4aa9c0(0xce);async[a20_0x4aa9c0(0xbc)](_0x52cdb8){const _0x414194=a20_0x4aa9c0,{options:_0x4c2d92}=_0x52cdb8;try{const _0xa17be2=listProfiles(),_0x3a2d68=getActiveProfile();if(_0xa17be2[_0x414194(0xc9)]===0x0)return console[_0x414194(0xcd)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console['log'](_0x414194(0xcc)),console[_0x414194(0xcd)](_0x414194(0xc7)),0x0;const _0x5d7d68=_0xa17be2['map'](_0x4ec68a=>{const _0x56b924=_0x414194,_0x436ba3=_0x4ec68a[_0x56b924(0xba)]===_0x3a2d68,_0x1c5a9f=getProfileParams(_0x4ec68a['config']);return{'name':_0x4ec68a['name'],'active':_0x436ba3,'scope':_0x4ec68a[_0x56b924(0xbb)],'description':_0x4ec68a['config'][_0x56b924(0xcb)]||'','params':_0x1c5a9f};});return await handleSDKOutput(_0x5d7d68,_0x4c2d92),0x0;}catch(_0x2dcbc0){return _0x2dcbc0 instanceof Error&&console[_0x414194(0xbd)]('Error:\x20'+_0x2dcbc0[_0x414194(0xcf)]),0x1;}}}function a20_0x2b54(){const _0x21056e=['error','10jEGzwT','1852676PZuAUm','15091083XBJdls','2326604bEeKHk','3XrrVYN','profiles','996705rhEsFx','264582bOSeyI','35ZetdyD','\x20\x20Global:\x20~/.config/tdx/tdx.json','120SyAIBN','length','32905444VjikQr','description','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','log','List\x20all\x20available\x20profiles','message','158264VhNXeB','name','scope','execute'];a20_0x2b54=function(){return _0x21056e;};return a20_0x2b54();}
1
+ const a20_0x5aa1a9=a20_0x49e1;function a20_0x4569(){const _0x1a552c=['No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','log','error','length','3551272PsTabW','name','profiles','6286224EiXStg','execute','message','map','19307232PMYxqB','description','scope','83qxkgQA','config','4645340ZaEkUO','31922crzmoe','310405ARKrsz','\x20\x20Global:\x20~/.config/tdx/tdx.json','3OPyQVh','List\x20all\x20available\x20profiles','3347742OqEixH'];a20_0x4569=function(){return _0x1a552c;};return a20_0x4569();}(function(_0x29bcb7,_0x1cc7f6){const _0x16fa36=a20_0x49e1,_0x347057=_0x29bcb7();while(!![]){try{const _0x27e590=-parseInt(_0x16fa36(0x79))/0x1*(parseInt(_0x16fa36(0x7c))/0x2)+parseInt(_0x16fa36(0x7f))/0x3*(-parseInt(_0x16fa36(0x7b))/0x4)+parseInt(_0x16fa36(0x7d))/0x5+parseInt(_0x16fa36(0x81))/0x6+parseInt(_0x16fa36(0x89))/0x7+-parseInt(_0x16fa36(0x86))/0x8+parseInt(_0x16fa36(0x8d))/0x9;if(_0x27e590===_0x1cc7f6)break;else _0x347057['push'](_0x347057['shift']());}catch(_0x2f3751){_0x347057['push'](_0x347057['shift']());}}}(a20_0x4569,0xb307f));import{BaseCommand}from'./command.js';function a20_0x49e1(_0x415826,_0x5a4451){const _0x4569aa=a20_0x4569();return a20_0x49e1=function(_0x49e141,_0x4564c2){_0x49e141=_0x49e141-0x78;let _0x546426=_0x4569aa[_0x49e141];return _0x546426;},a20_0x49e1(_0x415826,_0x5a4451);}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x5aa1a9(0x87)]=a20_0x5aa1a9(0x88);[a20_0x5aa1a9(0x8e)]=a20_0x5aa1a9(0x80);async[a20_0x5aa1a9(0x8a)](_0x41b2b2){const _0x44c8b9=a20_0x5aa1a9,{options:_0x1c658e}=_0x41b2b2;try{const _0x5cbf2b=listProfiles(),_0x27babe=getActiveProfile();if(_0x5cbf2b[_0x44c8b9(0x85)]===0x0)return console[_0x44c8b9(0x83)](_0x44c8b9(0x82)),console[_0x44c8b9(0x83)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x44c8b9(0x83)](_0x44c8b9(0x7e)),0x0;const _0x42a732=_0x5cbf2b[_0x44c8b9(0x8c)](_0x1e3b9b=>{const _0x2372e3=_0x44c8b9,_0x29b8b5=_0x1e3b9b[_0x2372e3(0x87)]===_0x27babe,_0xe10405=getProfileParams(_0x1e3b9b[_0x2372e3(0x7a)]);return{'name':_0x1e3b9b[_0x2372e3(0x87)],'active':_0x29b8b5,'scope':_0x1e3b9b[_0x2372e3(0x78)],'description':_0x1e3b9b[_0x2372e3(0x7a)][_0x2372e3(0x8e)]||'','params':_0xe10405};});return await handleSDKOutput(_0x42a732,_0x1c658e),0x0;}catch(_0x16609c){return _0x16609c instanceof Error&&console[_0x44c8b9(0x84)]('Error:\x20'+_0x16609c[_0x44c8b9(0x8b)]),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x53b9ea=a21_0x1528;(function(_0x39ef62,_0x431ca9){const _0x52347a=a21_0x1528,_0x1fa9d5=_0x39ef62();while(!![]){try{const _0x37757a=parseInt(_0x52347a(0x94))/0x1*(parseInt(_0x52347a(0x8a))/0x2)+parseInt(_0x52347a(0x8e))/0x3*(parseInt(_0x52347a(0x99))/0x4)+-parseInt(_0x52347a(0x79))/0x5*(-parseInt(_0x52347a(0x7b))/0x6)+parseInt(_0x52347a(0x98))/0x7+-parseInt(_0x52347a(0xa4))/0x8+-parseInt(_0x52347a(0x82))/0x9*(-parseInt(_0x52347a(0xa8))/0xa)+parseInt(_0x52347a(0x91))/0xb*(-parseInt(_0x52347a(0x84))/0xc);if(_0x37757a===_0x431ca9)break;else _0x1fa9d5['push'](_0x1fa9d5['shift']());}catch(_0x1424c0){_0x1fa9d5['push'](_0x1fa9d5['shift']());}}}(a21_0x2d10,0xa943a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a21_0x2d10(){const _0x41849e=['options','\x20[Job\x20ID:\x20','914416wYfZaV','message','...','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','1100sezgIf','Query\x20completed:\x20Processed\x20','Catalog:\x20','completedSplits','Executing\x20query\x20[','Run\x20Trino\x20queries\x20(streaming)','4744975aQuyJb','output','6hJlfxZ','query','stats','args','SQL:\x20','database','totalSplits','43317lqLGSR','verbose','12AgRZHs','\x20rows\x20','site','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','validate','Statement\x20','39464nkXOqc','setPhase','file','\x0aAll\x20results\x20saved\x20to\x20','3kwdNuC','processedRows','setJobId','21259117bvKeCc','Error:\x20','\x20-\x20','27HxCjbW','execute','Site:\x20','state','4926803foyJzQ','100948akxEsd','jobId','description','Executing\x20statement\x20','originalMessage','in\x20','\x20splits','length','error'];a21_0x2d10=function(){return _0x41849e;};return a21_0x2d10();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';function a21_0x1528(_0x425a02,_0x18d963){const _0x2d1042=a21_0x2d10();return a21_0x1528=function(_0x1528e1,_0x524f26){_0x1528e1=_0x1528e1-0x77;let _0x358e3d=_0x2d1042[_0x1528e1];return _0x358e3d;},a21_0x1528(_0x425a02,_0x18d963);}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']='query';[a21_0x53b9ea(0x9b)]=a21_0x53b9ea(0x78);async[a21_0x53b9ea(0x95)](_0x158651){const _0x1984a0=a21_0x53b9ea,{options:_0x53e112,args:_0x1c3821,tdx:_0x4d653a}=_0x158651,_0x14170b=_0x1c3821[0x0],_0x11d154=_0x53e112[_0x1984a0(0x8c)];let _0x570a67;if(_0x11d154)try{_0x570a67=readSqlStatementsFromFile(_0x11d154);}catch(_0x85c50f){return console['error'](_0x1984a0(0x92)+_0x85c50f[_0x1984a0(0xa5)]),0x1;}else try{_0x570a67=splitSqlStatements(_0x14170b);}catch(_0x386a8d){return console[_0x1984a0(0xa1)](_0x1984a0(0x92)+_0x386a8d[_0x1984a0(0xa5)]),0x1;}const _0x502010=_0x53e112[_0x1984a0(0x80)]||'information_schema',_0xac8c19=_0x53e112['catalog'];try{const _0x8b026b=[],_0xf996ff=!!_0x53e112[_0x1984a0(0x7a)];for(let _0x3edc93=0x0;_0x3edc93<_0x570a67[_0x1984a0(0xa0)];_0x3edc93++){const _0x19f48b=_0x570a67[_0x3edc93],_0x6d70c8=_0x3edc93+0x1,_0x5f58d0=_0x570a67[_0x1984a0(0xa0)],_0x5b2718=_0x5f58d0>0x1;_0x53e112[_0x1984a0(0x83)]&&(console['error']('\x0a'+(_0x5b2718?_0x1984a0(0x89)+_0x6d70c8+'/'+_0x5f58d0+':':'')),console[_0x1984a0(0xa1)](_0x1984a0(0x96)+_0x53e112[_0x1984a0(0x86)]),console['error'](_0x1984a0(0xaa)+(_0xac8c19||'td')),console['error']('Schema:\x20'+_0x502010),console['error'](_0x1984a0(0x7f)+_0x19f48b));const _0x1a5284=_0x5b2718?_0x1984a0(0x9c)+_0x6d70c8+'/'+_0x5f58d0+_0x1984a0(0xa6):'Executing\x20query...';try{const _0x2534b9=await withQuerySpinner(_0x1a5284,async _0x44f3ef=>{const _0x2fc1fe=_0x1984a0,_0x4fac91=await _0x4d653a[_0x2fc1fe(0x7c)](_0x19f48b,{'catalog':_0xac8c19,'schema':_0x502010,'onJobId':_0x185046=>{const _0x5e4a73=_0x2fc1fe;_0x44f3ef[_0x5e4a73(0x90)](_0x185046);},'onProgress':_0x488d90=>{const _0x39fd15=_0x2fc1fe;_0x44f3ef[_0x39fd15(0x8b)](_0x39fd15(0x77)+_0x488d90[_0x39fd15(0x97)]+']'),_0x44f3ef['setExtra'](formatRows(_0x488d90[_0x39fd15(0x8f)])+'\x20rows\x20'+_0x488d90[_0x39fd15(0xab)]+'/'+_0x488d90[_0x39fd15(0x81)]+_0x39fd15(0x9f));}});return _0x4fac91;},{'verbose':_0x53e112[_0x1984a0(0x83)]}),_0x298b00=_0x2534b9['data'],_0x44e5fc=_0x298b00[_0x1984a0(0x9a)]?_0x1984a0(0xa3)+_0x298b00[_0x1984a0(0x9a)]+']':'',_0x57c0f3=_0x5b2718?_0x1984a0(0x89)+_0x6d70c8+'/'+_0x5f58d0+_0x1984a0(0x93):'';console[_0x1984a0(0xa1)]('✔\x20'+_0x57c0f3+_0x1984a0(0xa9)+formatRows(_0x298b00[_0x1984a0(0x7d)][_0x1984a0(0x8f)])+_0x1984a0(0x85)+(_0x1984a0(0x9e)+formatElapsed(_0x298b00[_0x1984a0(0x7d)]['elapsedTimeMillis'])+_0x44e5fc));if(_0x5b2718&&_0xf996ff){const _0x458f75=resolveOutputOptions(_0x53e112),_0x13e014=await formatQueryOutput(_0x298b00,_0x458f75);_0x8b026b['push'](_0x13e014);}else await handleQueryOutput(_0x298b00,_0x53e112);}catch(_0xb5fd0e){const _0x263b8b=_0x5b2718?_0x1984a0(0x89)+_0x6d70c8+'/'+_0x5f58d0+':\x0a':'',_0x1ae1e2=_0xb5fd0e instanceof SDKError?_0xb5fd0e[_0x1984a0(0x9d)]:_0xb5fd0e[_0x1984a0(0xa5)];return console[_0x1984a0(0xa1)](''+_0x263b8b+_0x1ae1e2),0x1;}}if(_0x570a67[_0x1984a0(0xa0)]>0x1&&_0xf996ff&&_0x8b026b['length']>0x0){const _0xc0afba=_0x8b026b['join']('\x0a');writeFileSync(_0x53e112['output'],_0xc0afba),console[_0x1984a0(0xa1)](_0x1984a0(0x8d)+_0x53e112['output']);}return 0x0;}catch(_0x2f12c2){throw _0x2f12c2;}}[a21_0x53b9ea(0x88)](_0xa32d0e){const _0x599080=a21_0x53b9ea,_0x148615=_0xa32d0e[_0x599080(0x7e)][0x0],_0x50e85b=_0xa32d0e[_0x599080(0xa2)][_0x599080(0x8c)];if(!_0x148615&&!_0x50e85b)return _0x599080(0x87);if(_0x148615&&_0x50e85b)return _0x599080(0xa7);return undefined;}}
1
+ function a21_0xd69c(_0x31f7b4,_0x2a1b65){const _0xd89f72=a21_0xd89f();return a21_0xd69c=function(_0xd69c7f,_0x286ad5){_0xd69c7f=_0xd69c7f-0x1c1;let _0x4133af=_0xd89f72[_0xd69c7f];return _0x4133af;},a21_0xd69c(_0x31f7b4,_0x2a1b65);}function a21_0xd89f(){const _0x318fff=['Run\x20Trino\x20queries\x20(streaming)','2419115FXJUIT','Error:\x20','catalog','SQL:\x20','totalSplits','error','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','3566136oImzNC','processedRows','Query\x20completed:\x20Processed\x20','674394vGohkr','setExtra','message','description','setJobId','state','output','1476900NNogTq','2128992uWGFlk','160rQVSCI','Executing\x20query...','query','24dUsOLT','args','...','verbose','402319cJjTCO','stats','Schema:\x20','Executing\x20query\x20[','Statement\x20','site','Site:\x20','options','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','121275FdPSbj','elapsedTimeMillis','length','originalMessage','jobId','\x0aAll\x20results\x20saved\x20to\x20','\x20rows\x20','push','2vwtIoX','file','Executing\x20statement\x20','\x20[Job\x20ID:\x20','database'];a21_0xd89f=function(){return _0x318fff;};return a21_0xd89f();}const a21_0x464c32=a21_0xd69c;(function(_0x234c6e,_0x57ccc1){const _0x18dac2=a21_0xd69c,_0x40810e=_0x234c6e();while(!![]){try{const _0x448be5=parseInt(_0x18dac2(0x1c4))/0x1*(-parseInt(_0x18dac2(0x1d5))/0x2)+parseInt(_0x18dac2(0x1ed))/0x3+parseInt(_0x18dac2(0x1e2))/0x4+-parseInt(_0x18dac2(0x1db))/0x5+parseInt(_0x18dac2(0x1ec))/0x6+-parseInt(_0x18dac2(0x1e5))/0x7*(parseInt(_0x18dac2(0x1f1))/0x8)+parseInt(_0x18dac2(0x1cd))/0x9*(-parseInt(_0x18dac2(0x1ee))/0xa);if(_0x448be5===_0x57ccc1)break;else _0x40810e['push'](_0x40810e['shift']());}catch(_0x56e455){_0x40810e['push'](_0x40810e['shift']());}}}(a21_0xd89f,0x6f784));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a21_0x464c32(0x1f0);[a21_0x464c32(0x1e8)]=a21_0x464c32(0x1da);async['execute'](_0xbad780){const _0x364930=a21_0x464c32,{options:_0x4e8013,args:_0x8482a0,tdx:_0x366f08}=_0xbad780,_0x5d826=_0x8482a0[0x0],_0x2c806e=_0x4e8013[_0x364930(0x1d6)];let _0x1c04f3;if(_0x2c806e)try{_0x1c04f3=readSqlStatementsFromFile(_0x2c806e);}catch(_0x446ebd){return console[_0x364930(0x1e0)](_0x364930(0x1dc)+_0x446ebd[_0x364930(0x1e7)]),0x1;}else try{_0x1c04f3=splitSqlStatements(_0x5d826);}catch(_0x33cae3){return console['error'](_0x364930(0x1dc)+_0x33cae3[_0x364930(0x1e7)]),0x1;}const _0x5c991f=_0x4e8013[_0x364930(0x1d9)]||'information_schema',_0x5c9154=_0x4e8013[_0x364930(0x1dd)];try{const _0x4b537d=[],_0x52e9d8=!!_0x4e8013[_0x364930(0x1eb)];for(let _0xf797b5=0x0;_0xf797b5<_0x1c04f3['length'];_0xf797b5++){const _0x451858=_0x1c04f3[_0xf797b5],_0x1290e3=_0xf797b5+0x1,_0x5ca2a8=_0x1c04f3['length'],_0x454afc=_0x5ca2a8>0x1;_0x4e8013[_0x364930(0x1c3)]&&(console['error']('\x0a'+(_0x454afc?_0x364930(0x1c8)+_0x1290e3+'/'+_0x5ca2a8+':':'')),console[_0x364930(0x1e0)](_0x364930(0x1ca)+_0x4e8013[_0x364930(0x1c9)]),console[_0x364930(0x1e0)]('Catalog:\x20'+(_0x5c9154||'td')),console[_0x364930(0x1e0)](_0x364930(0x1c6)+_0x5c991f),console[_0x364930(0x1e0)](_0x364930(0x1de)+_0x451858));const _0x1a8e51=_0x454afc?_0x364930(0x1d7)+_0x1290e3+'/'+_0x5ca2a8+_0x364930(0x1c2):_0x364930(0x1ef);try{const _0x589031=await withQuerySpinner(_0x1a8e51,async _0x4c9210=>{const _0x9ab749=_0x364930,_0x596d74=await _0x366f08[_0x9ab749(0x1f0)](_0x451858,{'catalog':_0x5c9154,'schema':_0x5c991f,'onJobId':_0x45fc5a=>{const _0xdff1dd=_0x9ab749;_0x4c9210[_0xdff1dd(0x1e9)](_0x45fc5a);},'onProgress':_0x3d7754=>{const _0x12149f=_0x9ab749;_0x4c9210['setPhase'](_0x12149f(0x1c7)+_0x3d7754[_0x12149f(0x1ea)]+']'),_0x4c9210[_0x12149f(0x1e6)](formatRows(_0x3d7754[_0x12149f(0x1e3)])+_0x12149f(0x1d3)+_0x3d7754['completedSplits']+'/'+_0x3d7754[_0x12149f(0x1df)]+'\x20splits');}});return _0x596d74;},{'verbose':_0x4e8013[_0x364930(0x1c3)]}),_0x46af56=_0x589031['data'],_0xcaa5ce=_0x46af56['jobId']?_0x364930(0x1d8)+_0x46af56[_0x364930(0x1d1)]+']':'',_0x5f3597=_0x454afc?_0x364930(0x1c8)+_0x1290e3+'/'+_0x5ca2a8+'\x20-\x20':'';console[_0x364930(0x1e0)]('✔\x20'+_0x5f3597+_0x364930(0x1e4)+formatRows(_0x46af56[_0x364930(0x1c5)][_0x364930(0x1e3)])+_0x364930(0x1d3)+('in\x20'+formatElapsed(_0x46af56['stats'][_0x364930(0x1ce)])+_0xcaa5ce));if(_0x454afc&&_0x52e9d8){const _0x257d85=resolveOutputOptions(_0x4e8013),_0xbec41a=await formatQueryOutput(_0x46af56,_0x257d85);_0x4b537d[_0x364930(0x1d4)](_0xbec41a);}else await handleQueryOutput(_0x46af56,_0x4e8013);}catch(_0xe5892a){const _0x2fad72=_0x454afc?_0x364930(0x1c8)+_0x1290e3+'/'+_0x5ca2a8+':\x0a':'',_0x1da4ae=_0xe5892a instanceof SDKError?_0xe5892a[_0x364930(0x1d0)]:_0xe5892a['message'];return console[_0x364930(0x1e0)](''+_0x2fad72+_0x1da4ae),0x1;}}if(_0x1c04f3[_0x364930(0x1cf)]>0x1&&_0x52e9d8&&_0x4b537d[_0x364930(0x1cf)]>0x0){const _0x26a45e=_0x4b537d['join']('\x0a');writeFileSync(_0x4e8013[_0x364930(0x1eb)],_0x26a45e),console['error'](_0x364930(0x1d2)+_0x4e8013[_0x364930(0x1eb)]);}return 0x0;}catch(_0x30047f){throw _0x30047f;}}['validate'](_0x1f8245){const _0xe8ac88=a21_0x464c32,_0x55bc4f=_0x1f8245[_0xe8ac88(0x1c1)][0x0],_0x3f009b=_0x1f8245[_0xe8ac88(0x1cb)][_0xe8ac88(0x1d6)];if(!_0x55bc4f&&!_0x3f009b)return _0xe8ac88(0x1cc);if(_0x55bc4f&&_0x3f009b)return _0xe8ac88(0x1e1);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x43690e=a22_0x536c;(function(_0x334f53,_0x1bd105){const _0x1a049b=a22_0x536c,_0x41df11=_0x334f53();while(!![]){try{const _0x4189a4=-parseInt(_0x1a049b(0x1ff))/0x1+-parseInt(_0x1a049b(0x1f6))/0x2+-parseInt(_0x1a049b(0x1c2))/0x3+-parseInt(_0x1a049b(0x1c8))/0x4*(parseInt(_0x1a049b(0x1aa))/0x5)+parseInt(_0x1a049b(0x1e7))/0x6+-parseInt(_0x1a049b(0x1a9))/0x7*(parseInt(_0x1a049b(0x215))/0x8)+-parseInt(_0x1a049b(0x1f8))/0x9*(-parseInt(_0x1a049b(0x1f5))/0xa);if(_0x4189a4===_0x1bd105)break;else _0x41df11['push'](_0x41df11['shift']());}catch(_0x2d8117){_0x41df11['push'](_0x41df11['shift']());}}}(a22_0x1ad9,0x71ac7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';function a22_0x1ad9(){const _0x3163e7=['error','Error:\x20','Parent\x20name:\x20','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','site','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','folderId','segmentId','toLocaleString','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','type','4912QlBIwz','Create\x20segment\x20folder\x20for\x20organization','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Folder\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','description','cause','resolveParentId','3815xsQaUL','323915zaxLKV','\x20[Job\x20ID:\x20','execute','segment:folder:show','test','setJobId','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','json','Fetching\x20folder\x20details...','Fetching\x20SQL\x20for\x20segment...','segment:show','Resolved\x20type:\x20','Resolving\x20parent\x20segment\x20\x27','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','SQL\x20query:\x0a','information_schema','message','Fetching\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Segment\x20ID:\x20','code','2140398dnsJjy','INTERNAL','folder','Resolving\x20path\x20\x27','✖\x20Query\x20failed\x20[','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','8QBabir','Examples:','data','✔\x20Query\x20completed:\x20Processed\x20','parent','Site:\x20','Folder\x20ID:\x20','Show\x20segment\x20folder\x20details','segmentPath','getSegment','Fetching\x20SQL\x20for\x20parent\x20segment...','resolvePathToResource','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegmentSQL','getParent','Creating\x20folder\x20\x27','Parent\x20segment:\x20','format','Show\x20segment\x20or\x20folder\x20details','elapsedTimeMillis','jobId','includes','Usage:\x20tdx\x20segment\x20show\x20<path>','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','trim','✔\x20Found\x20','getParentSQL','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:describe','4112058GMbdcF','in\x20','stats','Usage:\x20tdx\x20segment\x20sql\x20<path>','Usage:\x20tdx\x20segment\x20describe\x20<path>','verbose','name','length','parentFolder','\x27\x20with\x20ID:\x20','limit','Error:\x20Path\x20or\x20name\x20is\x20required','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','107390gZPvJD','1478420tBBezj','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','2115pynHiF','Resolved\x20parent\x20ID:\x20','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Folder\x20name:\x20','listFolders','getFolder','826529jOTYDS','jsonl','query','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Executing\x20segment\x20query...','\x20rows\x20','Parent\x20ID:\x20','segment','segment:folder:create','log'];a22_0x1ad9=function(){return _0x3163e7;};return a22_0x1ad9();}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x43690e(0x1ed)]=a22_0x43690e(0x1e6);[a22_0x43690e(0x1a6)]=a22_0x43690e(0x1db);async[a22_0x43690e(0x1ac)](_0x5aa9e6){const _0x1b3902=a22_0x43690e,{options:_0x58edc0,args:_0x17fde8,tdx:_0x54d312}=_0x5aa9e6;if(_0x17fde8[_0x1b3902(0x1ee)]===0x0)return console[_0x1b3902(0x209)](_0x1b3902(0x1f2)),console[_0x1b3902(0x209)](_0x1b3902(0x1eb)),console[_0x1b3902(0x209)](_0x1b3902(0x1c9)),console[_0x1b3902(0x209)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x1b3902(0x209)](_0x1b3902(0x218)),0x1;try{const _0x1be5b8=_0x17fde8[0x0],_0xcdd277=_0x58edc0['segmentPath'];let _0x31ecb5=_0x1be5b8;_0xcdd277&&!_0x1be5b8[_0x1b3902(0x1de)]('/')&&(_0x31ecb5=_0xcdd277+'/'+_0x1be5b8,_0x58edc0[_0x1b3902(0x1ec)]&&console[_0x1b3902(0x209)](_0x1b3902(0x1be)+_0x31ecb5));const _0x3649af=await withSpinner('Resolving\x20path\x20\x27'+_0x31ecb5+_0x1b3902(0x1f3),()=>_0x54d312[_0x1b3902(0x206)][_0x1b3902(0x1d3)](_0x31ecb5),{'verbose':_0x58edc0['verbose']}),_0x338046=_0x3649af[_0x1b3902(0x1ca)];_0x58edc0[_0x1b3902(0x1ec)]&&(console[_0x1b3902(0x209)](_0x1b3902(0x1b7)+_0x338046['type']),console[_0x1b3902(0x209)](_0x1b3902(0x205)+_0x338046['parentId']),_0x338046[_0x1b3902(0x210)]&&console[_0x1b3902(0x209)](_0x1b3902(0x1ce)+_0x338046[_0x1b3902(0x210)]),_0x338046[_0x1b3902(0x211)]&&console['error'](_0x1b3902(0x1c0)+_0x338046[_0x1b3902(0x211)]));if(_0x338046['type']===_0x1b3902(0x1cc)){const _0x33ac78=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x54d312[_0x1b3902(0x206)][_0x1b3902(0x1d7)](_0x338046[_0x1b3902(0x217)]),{'verbose':_0x58edc0[_0x1b3902(0x1ec)]});await handleSDKOutput([_0x33ac78['data']],_0x58edc0);}else{if(_0x338046[_0x1b3902(0x214)]===_0x1b3902(0x1c4)){if(!_0x338046[_0x1b3902(0x210)])throw new SDKError(ErrorCode[_0x1b3902(0x1c3)],_0x1b3902(0x1a4));const _0x3331a3=await withSpinner(_0x1b3902(0x1b4),()=>_0x54d312[_0x1b3902(0x206)][_0x1b3902(0x1fe)](_0x338046[_0x1b3902(0x210)]),{'verbose':_0x58edc0[_0x1b3902(0x1ec)]});await handleSDKOutput([_0x3331a3[_0x1b3902(0x1ca)]],_0x58edc0);}else{if(_0x338046[_0x1b3902(0x214)]==='segment'){if(!_0x338046[_0x1b3902(0x211)])throw new SDKError(ErrorCode[_0x1b3902(0x1c3)],_0x1b3902(0x1b2));const _0xa2f1c=await withSpinner('Fetching\x20segment\x20details...',()=>_0x54d312[_0x1b3902(0x206)][_0x1b3902(0x1d1)](_0x338046['parentId'],_0x338046[_0x1b3902(0x211)]),{'verbose':_0x58edc0[_0x1b3902(0x1ec)]});await handleSDKOutput([_0xa2f1c[_0x1b3902(0x1ca)]],_0x58edc0);}}}return 0x0;}catch(_0x20d0e9){if(_0x20d0e9 instanceof SDKError)return console[_0x1b3902(0x209)](_0x1b3902(0x20a)+_0x20d0e9[_0x1b3902(0x1bc)]),_0x20d0e9['cause']&&console[_0x1b3902(0x209)]('\x20\x20Cause:\x20'+_0x20d0e9[_0x1b3902(0x1a7)]),0x1;throw _0x20d0e9;}}}function a22_0x536c(_0x2d0a4c,_0x305671){const _0x1ad921=a22_0x1ad9();return a22_0x536c=function(_0x536c1f,_0x5de351){_0x536c1f=_0x536c1f-0x1a1;let _0x5d621c=_0x1ad921[_0x536c1f];return _0x5d621c;},a22_0x536c(_0x2d0a4c,_0x305671);}export class SegmentShowCommand extends BaseCommand{[a22_0x43690e(0x1ed)]=a22_0x43690e(0x1b6);['description']=a22_0x43690e(0x1a1);async['execute'](_0x972e23){const _0x55cbe2=a22_0x43690e,{options:_0xc1e775,args:_0x2ca1f9,tdx:_0x33a001}=_0x972e23;if(_0x2ca1f9[_0x55cbe2(0x1ee)]===0x0)return console['error'](_0x55cbe2(0x1f4)),console[_0x55cbe2(0x209)](_0x55cbe2(0x1df)),console['error'](_0x55cbe2(0x1c9)),console[_0x55cbe2(0x209)](_0x55cbe2(0x1d4)),console[_0x55cbe2(0x209)](_0x55cbe2(0x1e5)),console['error'](_0x55cbe2(0x20f)),0x1;try{const _0x2d3fc4=_0x2ca1f9[0x0],_0x1f1f0f=_0xc1e775[_0x55cbe2(0x1d0)];let _0x125a80=_0x2d3fc4;_0x1f1f0f&&!_0x2d3fc4['includes']('/')&&(_0x125a80=_0x1f1f0f+'/'+_0x2d3fc4,_0xc1e775[_0x55cbe2(0x1ec)]&&console['error'](_0x55cbe2(0x1be)+_0x125a80));const _0x3647ae=await withSpinner(_0x55cbe2(0x1c5)+_0x125a80+_0x55cbe2(0x1f3),()=>_0x33a001[_0x55cbe2(0x206)][_0x55cbe2(0x1d3)](_0x125a80),{'verbose':_0xc1e775['verbose']}),_0x459e86=_0x3647ae[_0x55cbe2(0x1ca)];_0xc1e775[_0x55cbe2(0x1ec)]&&(console[_0x55cbe2(0x209)](_0x55cbe2(0x1b7)+_0x459e86[_0x55cbe2(0x214)]),console[_0x55cbe2(0x209)](_0x55cbe2(0x205)+_0x459e86[_0x55cbe2(0x217)]));if(_0x459e86[_0x55cbe2(0x214)]===_0x55cbe2(0x1c4))return console[_0x55cbe2(0x209)](_0x55cbe2(0x213)),console[_0x55cbe2(0x209)](_0x55cbe2(0x1b9)),0x1;let _0x2cdde1;if(_0x459e86[_0x55cbe2(0x214)]==='parent'){const _0x27d0f1=await withSpinner(_0x55cbe2(0x1d2),()=>_0x33a001['segment'][_0x55cbe2(0x1e4)](_0x459e86[_0x55cbe2(0x217)]),{'verbose':_0xc1e775[_0x55cbe2(0x1ec)]});_0x2cdde1=_0x27d0f1[_0x55cbe2(0x1ca)];}else{if(!_0x459e86['segmentId'])throw new SDKError(ErrorCode[_0x55cbe2(0x1c3)],_0x55cbe2(0x1b2));const _0xd4ad30=await withSpinner(_0x55cbe2(0x1b5),()=>_0x33a001[_0x55cbe2(0x206)][_0x55cbe2(0x1d6)](_0x459e86[_0x55cbe2(0x217)],_0x459e86['segmentId']),{'verbose':_0xc1e775[_0x55cbe2(0x1ec)]});_0x2cdde1=_0xd4ad30['data'];}const _0xf1007a=resolveLimit(_0xc1e775[_0x55cbe2(0x1f1)],DEFAULT_DISPLAY_LIMIT),_0x46bd00=/\bLIMIT\s+\d+/i[_0x55cbe2(0x1ae)](_0x2cdde1);!_0x46bd00&&(_0x2cdde1=_0x2cdde1[_0x55cbe2(0x1e2)]()['replace'](/;+$/,''),_0x2cdde1=_0x55cbe2(0x1e0)+_0x2cdde1+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xf1007a);_0xc1e775[_0x55cbe2(0x1ec)]&&console['error'](_0x55cbe2(0x1ba)+_0x2cdde1);const _0x272b20=await withQuerySpinner(_0x55cbe2(0x203),async _0x8335e3=>{const _0x22a0c9=_0x55cbe2,_0x471447=await _0x33a001[_0x22a0c9(0x201)](_0x2cdde1,{'catalog':'td','schema':_0x22a0c9(0x1bb),'onJobId':_0x246ec8=>{const _0x276f0e=_0x22a0c9;_0x8335e3[_0x276f0e(0x1af)](_0x246ec8);}});return _0x471447;},{'verbose':_0xc1e775['verbose']}),_0x1612fa=_0x272b20[_0x55cbe2(0x1ca)],_0x38f719=_0x1612fa[_0x55cbe2(0x1dd)]?_0x55cbe2(0x1ab)+_0x1612fa[_0x55cbe2(0x1dd)]+']':'';return console[_0x55cbe2(0x209)](_0x55cbe2(0x1cb)+_0x1612fa[_0x55cbe2(0x1e9)]['processedRows'][_0x55cbe2(0x212)]()+_0x55cbe2(0x204)+(_0x55cbe2(0x1e8)+formatElapsed(_0x1612fa[_0x55cbe2(0x1e9)][_0x55cbe2(0x1dc)])+_0x38f719)),await handleQueryOutput(_0x1612fa,_0xc1e775),0x0;}catch(_0x49a237){if(_0x49a237 instanceof SDKError)return console[_0x55cbe2(0x209)](_0x55cbe2(0x1c6)+_0x49a237[_0x55cbe2(0x1c1)]+']'),console['error']('\x0a'+_0x49a237[_0x55cbe2(0x1bc)]),0x1;throw _0x49a237;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a22_0x43690e(0x1fa);['description']=a22_0x43690e(0x1bf);async[a22_0x43690e(0x1ac)](_0x4c85e3){const _0x249797=a22_0x43690e,{options:_0x1a7cd7,args:_0x4e8753,tdx:_0x2d8226}=_0x4c85e3;if(_0x4e8753[_0x249797(0x1ee)]===0x0)return console[_0x249797(0x209)](_0x249797(0x1d5)),console['error'](_0x249797(0x1fb)),0x1;const _0x3f20f2=_0x4e8753[0x0];try{_0x1a7cd7[_0x249797(0x1ec)]&&(console[_0x249797(0x209)](_0x249797(0x1cd)+_0x1a7cd7[_0x249797(0x20e)]),console[_0x249797(0x209)](_0x249797(0x20b)+_0x3f20f2));const _0x37e6d2=await withSpinner(_0x249797(0x1b8)+_0x3f20f2+_0x249797(0x1f3),()=>_0x2d8226[_0x249797(0x206)][_0x249797(0x1a8)](_0x3f20f2),{'verbose':_0x1a7cd7[_0x249797(0x1ec)]}),_0xc60fbb=_0x37e6d2['data'];_0x1a7cd7[_0x249797(0x1ec)]&&console[_0x249797(0x209)](_0x249797(0x1f9)+_0xc60fbb);const _0x4cfcba=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x3f20f2+_0x249797(0x1f3),()=>_0x2d8226[_0x249797(0x206)][_0x249797(0x1fd)](_0xc60fbb),{'verbose':_0x1a7cd7[_0x249797(0x1ec)]}),_0x1e45dc=_0x4cfcba[_0x249797(0x1ca)];return console[_0x249797(0x209)](_0x249797(0x1e3)+_0x1e45dc[_0x249797(0x1ee)]+'\x20folder'+(_0x1e45dc['length']!==0x1?'s':'')),await handleSDKOutput(_0x1e45dc,_0x1a7cd7),0x0;}catch(_0x30eefd){if(_0x30eefd instanceof SDKError)return console[_0x249797(0x209)](_0x249797(0x20a)+_0x30eefd[_0x249797(0x1bc)]),_0x30eefd[_0x249797(0x1a7)]&&console[_0x249797(0x209)](_0x249797(0x20c)+_0x30eefd[_0x249797(0x1a7)]),0x1;throw _0x30eefd;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x43690e(0x1ad);[a22_0x43690e(0x1a6)]=a22_0x43690e(0x1cf);async['execute'](_0x13b415){const _0x39afdb=a22_0x43690e,{options:_0x1fac48,args:_0x42027a,tdx:_0x5369df}=_0x13b415;if(_0x42027a[_0x39afdb(0x1ee)]===0x0)return console[_0x39afdb(0x209)](_0x39afdb(0x1a2)),console[_0x39afdb(0x209)](_0x39afdb(0x202)),0x1;try{const {parentId:_0x2b47ed,childId:_0xa06e37}=parseSegmentRef(_0x42027a[0x0]);_0x1fac48['verbose']&&(console[_0x39afdb(0x209)](_0x39afdb(0x1cd)+_0x1fac48[_0x39afdb(0x20e)]),console[_0x39afdb(0x209)](_0x39afdb(0x20b)+_0x2b47ed),_0xa06e37&&console[_0x39afdb(0x209)]('Folder\x20name:\x20'+_0xa06e37));if(!_0xa06e37)return console['error'](_0x39afdb(0x1e1)),0x1;const _0x429787=await withSpinner(_0x39afdb(0x1b8)+_0x2b47ed+'\x27...',()=>_0x5369df[_0x39afdb(0x206)]['resolveParentId'](_0x2b47ed),{'verbose':_0x1fac48[_0x39afdb(0x1ec)]}),_0x1d8ab9=_0x429787[_0x39afdb(0x1ca)];_0x1fac48[_0x39afdb(0x1ec)]&&console['error'](_0x39afdb(0x1f9)+_0x1d8ab9);const _0x5d114c=await withSpinner('Resolving\x20folder\x20\x27'+_0xa06e37+_0x39afdb(0x1f3),()=>_0x5369df[_0x39afdb(0x206)][_0x39afdb(0x1a5)](_0x1d8ab9,_0xa06e37),{'verbose':_0x1fac48['verbose']}),_0x103372=_0x5d114c[_0x39afdb(0x1ca)];_0x1fac48[_0x39afdb(0x1ec)]&&console[_0x39afdb(0x209)](_0x39afdb(0x1b0)+_0x103372);const _0x5db1b8=await withSpinner(_0x39afdb(0x1bd)+_0xa06e37+_0x39afdb(0x1f3),()=>_0x5369df[_0x39afdb(0x206)]['getFolder'](_0x103372),{'verbose':_0x1fac48[_0x39afdb(0x1ec)]});return await handleSDKOutput([_0x5db1b8[_0x39afdb(0x1ca)]],_0x1fac48),0x0;}catch(_0x24ef35){if(_0x24ef35 instanceof SDKError)return console[_0x39afdb(0x209)]('Error:\x20'+_0x24ef35['message']),_0x24ef35['cause']&&console[_0x39afdb(0x209)](_0x39afdb(0x20c)+_0x24ef35[_0x39afdb(0x1a7)]),0x1;throw _0x24ef35;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x43690e(0x1ed)]='segment:sql';[a22_0x43690e(0x1a6)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async[a22_0x43690e(0x1ac)](_0x3d8750){const _0x58a706=a22_0x43690e,{options:_0x197ba3,args:_0xf2c2bc,tdx:_0x57ff15}=_0x3d8750;if(_0xf2c2bc[_0x58a706(0x1ee)]===0x0)return console[_0x58a706(0x209)](_0x58a706(0x1f4)),console[_0x58a706(0x209)](_0x58a706(0x1ea)),console[_0x58a706(0x209)](_0x58a706(0x1c9)),console[_0x58a706(0x209)](_0x58a706(0x1a3)),console[_0x58a706(0x209)](_0x58a706(0x1f7)),console[_0x58a706(0x209)](_0x58a706(0x1c7)),0x1;try{const _0x5d75b7=_0xf2c2bc[0x0],_0xa81b2a=_0x197ba3['segmentPath'];let _0x11f2b7=_0x5d75b7;_0xa81b2a&&!_0x5d75b7[_0x58a706(0x1de)]('/')&&(_0x11f2b7=_0xa81b2a+'/'+_0x5d75b7,_0x197ba3[_0x58a706(0x1ec)]&&console[_0x58a706(0x209)](_0x58a706(0x1be)+_0x11f2b7));const _0x3386e3=await withSpinner(_0x58a706(0x1c5)+_0x11f2b7+'\x27...',()=>_0x57ff15['segment'][_0x58a706(0x1d3)](_0x11f2b7),{'verbose':_0x197ba3[_0x58a706(0x1ec)]}),_0x3fe0c4=_0x3386e3[_0x58a706(0x1ca)];_0x197ba3[_0x58a706(0x1ec)]&&(console['error'](_0x58a706(0x1b7)+_0x3fe0c4[_0x58a706(0x214)]),console[_0x58a706(0x209)]('Parent\x20ID:\x20'+_0x3fe0c4[_0x58a706(0x217)]));if(_0x3fe0c4[_0x58a706(0x214)]===_0x58a706(0x1c4))return console[_0x58a706(0x209)](_0x58a706(0x1b1)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x13b1ba;if(_0x3fe0c4[_0x58a706(0x214)]===_0x58a706(0x1cc)){const _0x6ec530=await withSpinner(_0x58a706(0x1d2),()=>_0x57ff15[_0x58a706(0x206)][_0x58a706(0x1e4)](_0x3fe0c4[_0x58a706(0x217)]),{'verbose':_0x197ba3[_0x58a706(0x1ec)]});_0x13b1ba=_0x6ec530[_0x58a706(0x1ca)];}else{if(!_0x3fe0c4[_0x58a706(0x211)])throw new SDKError(ErrorCode[_0x58a706(0x1c3)],_0x58a706(0x1b2));const _0x3e4b99=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x57ff15[_0x58a706(0x206)][_0x58a706(0x1d6)](_0x3fe0c4[_0x58a706(0x217)],_0x3fe0c4[_0x58a706(0x211)]),{'verbose':_0x197ba3[_0x58a706(0x1ec)]});_0x13b1ba=_0x3e4b99['data'];}return _0x197ba3[_0x58a706(0x1da)]===_0x58a706(0x1b3)||_0x197ba3[_0x58a706(0x1da)]===_0x58a706(0x200)?await handleSDKOutput([{'sql':_0x13b1ba}],_0x197ba3):console[_0x58a706(0x208)](_0x13b1ba),0x0;}catch(_0x1ccd26){if(_0x1ccd26 instanceof SDKError)return console[_0x58a706(0x209)]('Error:\x20'+_0x1ccd26[_0x58a706(0x1bc)]),_0x1ccd26['cause']&&console[_0x58a706(0x209)](_0x58a706(0x20c)+_0x1ccd26[_0x58a706(0x1a7)]),0x1;throw _0x1ccd26;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x43690e(0x1ed)]=a22_0x43690e(0x207);[a22_0x43690e(0x1a6)]=a22_0x43690e(0x216);async[a22_0x43690e(0x1ac)](_0xd0e46b){const _0x1a05d8=a22_0x43690e,{options:_0x5da764,args:_0x1bc841,tdx:_0x44b02b}=_0xd0e46b,_0x15dfa2=_0x5da764;if(_0x1bc841[_0x1a05d8(0x1ee)]<0x2)return console[_0x1a05d8(0x209)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x1a05d8(0x20d)),0x1;const _0x5afb94=_0x1bc841[0x0],_0x50c3fa=_0x1bc841[0x1];_0x15dfa2[_0x1a05d8(0x1ec)]&&(console[_0x1a05d8(0x209)](_0x1a05d8(0x1cd)+_0x15dfa2['site']),console[_0x1a05d8(0x209)](_0x1a05d8(0x1d9)+_0x5afb94),console['error'](_0x1a05d8(0x1fc)+_0x50c3fa));let _0x35bd02;if(_0x15dfa2[_0x1a05d8(0x1ef)]){const _0x319acd=_0x15dfa2[_0x1a05d8(0x1ef)],_0x46f8f2=await withSpinner(_0x1a05d8(0x1b8)+_0x5afb94+_0x1a05d8(0x1f3),()=>_0x44b02b[_0x1a05d8(0x206)]['resolveParentId'](_0x5afb94),{'verbose':_0x15dfa2[_0x1a05d8(0x1ec)]}),_0x414172=_0x46f8f2[_0x1a05d8(0x1ca)],_0x3f29bf=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x319acd+_0x1a05d8(0x1f3),()=>_0x44b02b[_0x1a05d8(0x206)][_0x1a05d8(0x1a5)](_0x414172,_0x319acd),{'verbose':_0x15dfa2[_0x1a05d8(0x1ec)]});_0x35bd02=_0x3f29bf[_0x1a05d8(0x1ca)],_0x15dfa2[_0x1a05d8(0x1ec)]&&console['error']('Resolved\x20parent\x20folder\x20ID:\x20'+_0x35bd02);}const _0x34701e={'name':_0x50c3fa,'description':_0x15dfa2[_0x1a05d8(0x1a6)],'parentFolderId':_0x35bd02},_0x1183d5=await withSpinner(_0x1a05d8(0x1d8)+_0x50c3fa+_0x1a05d8(0x1f3),()=>_0x44b02b[_0x1a05d8(0x206)]['createFolder'](_0x5afb94,_0x34701e),{'verbose':_0x15dfa2[_0x1a05d8(0x1ec)]}),_0x353d6c=_0x1183d5['data'];return console[_0x1a05d8(0x209)]('✔\x20Created\x20folder\x20\x27'+_0x353d6c[_0x1a05d8(0x1ed)]+_0x1a05d8(0x1f0)+_0x353d6c['id']),await handleSDKOutput([_0x353d6c],_0x15dfa2),0x0;}}
1
+ function a22_0x5074(){const _0x30be04=['Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Parent\x20segment:\x20','information_schema','Resolving\x20parent\x20folder\x20\x27','verbose','code','Parent\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','message','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','test','SQL\x20query:\x0a','716804ZoSeqL','Resolved\x20parent\x20ID:\x20','resolveParentId','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20folder\x20ID:\x20','folderId','jsonl','Fetching\x20SQL\x20for\x20segment...','3pYcOtx','segment:describe','site','processedRows','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','createFolder','\x27\x20with\x20ID:\x20','Parent\x20name:\x20','760606SqPIiA','parent','Show\x20segment\x20or\x20folder\x20details','INTERNAL','9PrMmjF','Fetching\x20parent\x20segment\x20details...','getParentSQL','✔\x20Found\x20','in\x20','Resolved\x20type:\x20','getFolder','log','folder','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','replace','\x20[Job\x20ID:\x20','2206039CvaUqb','2395110jivJld','\x27...','\x20\x20Cause:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID:\x20','type','Examples:','format','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','setJobId','segmentPath','toLocaleString','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','parentFolder','segment:folder:list','Fetching\x20segment\x20details...','description','resolvePathToResource','Folder\x20name:\x20','Fetching\x20folder\x20details...','execute','limit','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','trim','Creating\x20folder\x20\x27','jobId','getParent','elapsedTimeMillis','8jCovxY','cause','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Site:\x20','Executing\x20segment\x20query...','272695JvwlDZ','segment:folder:create','parentId','length','resolveFolderId','Show\x20segment\x20folder\x20details','segment','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','error','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Segment\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','query','Resolving\x20parent\x20segment\x20\x27','Error:\x20','name','Resolving\x20path\x20\x27','Fetching\x20folder\x20\x27','segment:folder:show','Fetching\x20SQL\x20for\x20parent\x20segment...','json','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','6cAvSfv','listFolders','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','includes','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','207hqnGzb','segmentId','stats','data','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','1267264SEmjZW','✔\x20Created\x20folder\x20\x27','getSegment','segment:sql','\x20folder'];a22_0x5074=function(){return _0x30be04;};return a22_0x5074();}const a22_0xaa74ad=a22_0x417f;(function(_0x48d917,_0x3cbc78){const _0x40a586=a22_0x417f,_0x1d832b=_0x48d917();while(!![]){try{const _0x2444dd=-parseInt(_0x40a586(0x1ed))/0x1*(-parseInt(_0x40a586(0x1cd))/0x2)+parseInt(_0x40a586(0x195))/0x3*(parseInt(_0x40a586(0x203))/0x4)+-parseInt(_0x40a586(0x1d2))/0x5*(parseInt(_0x40a586(0x1e8))/0x6)+-parseInt(_0x40a586(0x19d))/0x7+parseInt(_0x40a586(0x1f2))/0x8*(parseInt(_0x40a586(0x1a1))/0x9)+-parseInt(_0x40a586(0x1af))/0xa+parseInt(_0x40a586(0x1ae))/0xb;if(_0x2444dd===_0x3cbc78)break;else _0x1d832b['push'](_0x1d832b['shift']());}catch(_0x5a5e21){_0x1d832b['push'](_0x1d832b['shift']());}}}(a22_0x5074,0x21456));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{['name']=a22_0xaa74ad(0x196);[a22_0xaa74ad(0x1c1)]=a22_0xaa74ad(0x19f);async[a22_0xaa74ad(0x1c5)](_0x293c04){const _0x4f3f9c=a22_0xaa74ad,{options:_0x4007d9,args:_0x507b1c,tdx:_0x106e9a}=_0x293c04;if(_0x507b1c['length']===0x0)return console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1ab)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1b6)),console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1b9)),console['error'](_0x4f3f9c(0x1f1)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x17982e=_0x507b1c[0x0],_0x254994=_0x4007d9[_0x4f3f9c(0x1bb)];let _0x3fca84=_0x17982e;_0x254994&&!_0x17982e['includes']('/')&&(_0x3fca84=_0x254994+'/'+_0x17982e,_0x4007d9['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x3fca84));const _0x3c18ad=await withSpinner(_0x4f3f9c(0x1e2)+_0x3fca84+_0x4f3f9c(0x1b0),()=>_0x106e9a[_0x4f3f9c(0x1d8)][_0x4f3f9c(0x1c2)](_0x3fca84),{'verbose':_0x4007d9[_0x4f3f9c(0x1fb)]}),_0x2eb395=_0x3c18ad[_0x4f3f9c(0x1f0)];_0x4007d9[_0x4f3f9c(0x1fb)]&&(console['error'](_0x4f3f9c(0x1a6)+_0x2eb395['type']),console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1fd)+_0x2eb395[_0x4f3f9c(0x1d4)]),_0x2eb395[_0x4f3f9c(0x208)]&&console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1b4)+_0x2eb395['folderId']),_0x2eb395[_0x4f3f9c(0x1ee)]&&console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1dc)+_0x2eb395[_0x4f3f9c(0x1ee)]));if(_0x2eb395['type']===_0x4f3f9c(0x19e)){const _0x4cf45f=await withSpinner(_0x4f3f9c(0x1a2),()=>_0x106e9a[_0x4f3f9c(0x1d8)][_0x4f3f9c(0x1cb)](_0x2eb395[_0x4f3f9c(0x1d4)]),{'verbose':_0x4007d9['verbose']});await handleSDKOutput([_0x4cf45f['data']],_0x4007d9);}else{if(_0x2eb395[_0x4f3f9c(0x1b5)]===_0x4f3f9c(0x1a9)){if(!_0x2eb395[_0x4f3f9c(0x208)])throw new SDKError(ErrorCode[_0x4f3f9c(0x1a0)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x40a448=await withSpinner(_0x4f3f9c(0x1c4),()=>_0x106e9a[_0x4f3f9c(0x1d8)][_0x4f3f9c(0x1a7)](_0x2eb395[_0x4f3f9c(0x208)]),{'verbose':_0x4007d9[_0x4f3f9c(0x1fb)]});await handleSDKOutput([_0x40a448['data']],_0x4007d9);}else{if(_0x2eb395['type']==='segment'){if(!_0x2eb395[_0x4f3f9c(0x1ee)])throw new SDKError(ErrorCode[_0x4f3f9c(0x1a0)],_0x4f3f9c(0x1b2));const _0x2773cf=await withSpinner(_0x4f3f9c(0x1c0),()=>_0x106e9a[_0x4f3f9c(0x1d8)][_0x4f3f9c(0x1f4)](_0x2eb395[_0x4f3f9c(0x1d4)],_0x2eb395[_0x4f3f9c(0x1ee)]),{'verbose':_0x4007d9[_0x4f3f9c(0x1fb)]});await handleSDKOutput([_0x2773cf[_0x4f3f9c(0x1f0)]],_0x4007d9);}}}return 0x0;}catch(_0x11f211){if(_0x11f211 instanceof SDKError)return console[_0x4f3f9c(0x1da)]('Error:\x20'+_0x11f211['message']),_0x11f211[_0x4f3f9c(0x1ce)]&&console[_0x4f3f9c(0x1da)](_0x4f3f9c(0x1b1)+_0x11f211[_0x4f3f9c(0x1ce)]),0x1;throw _0x11f211;}}}function a22_0x417f(_0x105288,_0x43b2b6){const _0x5074dc=a22_0x5074();return a22_0x417f=function(_0x417f89,_0x593416){_0x417f89=_0x417f89-0x193;let _0x5da472=_0x5074dc[_0x417f89];return _0x5da472;},a22_0x417f(_0x105288,_0x43b2b6);}export class SegmentShowCommand extends BaseCommand{[a22_0xaa74ad(0x1e1)]='segment:show';['description']='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a22_0xaa74ad(0x1c5)](_0xe5eaa){const _0x538a2e=a22_0xaa74ad,{options:_0x2be5d3,args:_0x3aebdb,tdx:_0x55d29f}=_0xe5eaa;if(_0x3aebdb[_0x538a2e(0x1d5)]===0x0)return console[_0x538a2e(0x1da)](_0x538a2e(0x1e7)),console[_0x538a2e(0x1da)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x538a2e(0x1da)]('Examples:'),console[_0x538a2e(0x1da)](_0x538a2e(0x1ea)),console[_0x538a2e(0x1da)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x321649=_0x3aebdb[0x0],_0x4d6c53=_0x2be5d3[_0x538a2e(0x1bb)];let _0x1a10d4=_0x321649;_0x4d6c53&&!_0x321649[_0x538a2e(0x1eb)]('/')&&(_0x1a10d4=_0x4d6c53+'/'+_0x321649,_0x2be5d3['verbose']&&console[_0x538a2e(0x1da)](_0x538a2e(0x1aa)+_0x1a10d4));const _0x5b61ca=await withSpinner(_0x538a2e(0x1e2)+_0x1a10d4+_0x538a2e(0x1b0),()=>_0x55d29f[_0x538a2e(0x1d8)][_0x538a2e(0x1c2)](_0x1a10d4),{'verbose':_0x2be5d3[_0x538a2e(0x1fb)]}),_0xa0e07a=_0x5b61ca[_0x538a2e(0x1f0)];_0x2be5d3['verbose']&&(console['error'](_0x538a2e(0x1a6)+_0xa0e07a['type']),console[_0x538a2e(0x1da)]('Parent\x20ID:\x20'+_0xa0e07a[_0x538a2e(0x1d4)]));if(_0xa0e07a[_0x538a2e(0x1b5)]==='folder')return console[_0x538a2e(0x1da)](_0x538a2e(0x199)),console[_0x538a2e(0x1da)](_0x538a2e(0x1f7)),0x1;let _0xbe699e;if(_0xa0e07a[_0x538a2e(0x1b5)]==='parent'){const _0x58e34d=await withSpinner(_0x538a2e(0x1e5),()=>_0x55d29f[_0x538a2e(0x1d8)][_0x538a2e(0x1a3)](_0xa0e07a[_0x538a2e(0x1d4)]),{'verbose':_0x2be5d3['verbose']});_0xbe699e=_0x58e34d[_0x538a2e(0x1f0)];}else{if(!_0xa0e07a[_0x538a2e(0x1ee)])throw new SDKError(ErrorCode[_0x538a2e(0x1a0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x36d9=await withSpinner(_0x538a2e(0x194),()=>_0x55d29f['segment'][_0x538a2e(0x1b8)](_0xa0e07a['parentId'],_0xa0e07a[_0x538a2e(0x1ee)]),{'verbose':_0x2be5d3[_0x538a2e(0x1fb)]});_0xbe699e=_0x36d9['data'];}const _0x37053a=resolveLimit(_0x2be5d3[_0x538a2e(0x1c6)],DEFAULT_DISPLAY_LIMIT),_0x445912=/\bLIMIT\s+\d+/i[_0x538a2e(0x201)](_0xbe699e);!_0x445912&&(_0xbe699e=_0xbe699e[_0x538a2e(0x1c8)]()[_0x538a2e(0x1ac)](/;+$/,''),_0xbe699e=_0x538a2e(0x1fe)+_0xbe699e+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x37053a);_0x2be5d3['verbose']&&console[_0x538a2e(0x1da)](_0x538a2e(0x202)+_0xbe699e);const _0x4c9ec3=await withQuerySpinner(_0x538a2e(0x1d1),async _0x4eec68=>{const _0x426043=_0x538a2e,_0x3c48fe=await _0x55d29f[_0x426043(0x1de)](_0xbe699e,{'catalog':'td','schema':_0x426043(0x1f9),'onJobId':_0x253b16=>{const _0x75391d=_0x426043;_0x4eec68[_0x75391d(0x1ba)](_0x253b16);}});return _0x3c48fe;},{'verbose':_0x2be5d3[_0x538a2e(0x1fb)]}),_0xfffd81=_0x4c9ec3['data'],_0x58bdc1=_0xfffd81[_0x538a2e(0x1ca)]?_0x538a2e(0x1ad)+_0xfffd81['jobId']+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0xfffd81['stats'][_0x538a2e(0x198)][_0x538a2e(0x1bc)]()+'\x20rows\x20'+(_0x538a2e(0x1a5)+formatElapsed(_0xfffd81[_0x538a2e(0x1ef)][_0x538a2e(0x1cc)])+_0x58bdc1)),await handleQueryOutput(_0xfffd81,_0x2be5d3),0x0;}catch(_0x1b1c34){if(_0x1b1c34 instanceof SDKError)return console[_0x538a2e(0x1da)]('✖\x20Query\x20failed\x20['+_0x1b1c34[_0x538a2e(0x1fc)]+']'),console[_0x538a2e(0x1da)]('\x0a'+_0x1b1c34[_0x538a2e(0x1ff)]),0x1;throw _0x1b1c34;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a22_0xaa74ad(0x1bf);[a22_0xaa74ad(0x1c1)]=a22_0xaa74ad(0x1c7);async['execute'](_0x1a8165){const _0x3c3fa5=a22_0xaa74ad,{options:_0x140339,args:_0x35b4fe,tdx:_0x4699d0}=_0x1a8165;if(_0x35b4fe['length']===0x0)return console[_0x3c3fa5(0x1da)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3c3fa5(0x1da)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x28d44c=_0x35b4fe[0x0];try{_0x140339[_0x3c3fa5(0x1fb)]&&(console[_0x3c3fa5(0x1da)](_0x3c3fa5(0x1d0)+_0x140339[_0x3c3fa5(0x197)]),console['error']('Parent\x20name:\x20'+_0x28d44c));const _0x960977=await withSpinner(_0x3c3fa5(0x1df)+_0x28d44c+_0x3c3fa5(0x1b0),()=>_0x4699d0['segment']['resolveParentId'](_0x28d44c),{'verbose':_0x140339[_0x3c3fa5(0x1fb)]}),_0x2b6c87=_0x960977[_0x3c3fa5(0x1f0)];_0x140339[_0x3c3fa5(0x1fb)]&&console[_0x3c3fa5(0x1da)](_0x3c3fa5(0x204)+_0x2b6c87);const _0x2394f8=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x28d44c+_0x3c3fa5(0x1b0),()=>_0x4699d0[_0x3c3fa5(0x1d8)][_0x3c3fa5(0x1e9)](_0x2b6c87),{'verbose':_0x140339[_0x3c3fa5(0x1fb)]}),_0xb1b80e=_0x2394f8['data'];return console[_0x3c3fa5(0x1da)](_0x3c3fa5(0x1a4)+_0xb1b80e['length']+_0x3c3fa5(0x1f6)+(_0xb1b80e[_0x3c3fa5(0x1d5)]!==0x1?'s':'')),await handleSDKOutput(_0xb1b80e,_0x140339),0x0;}catch(_0x31ef26){if(_0x31ef26 instanceof SDKError)return console[_0x3c3fa5(0x1da)](_0x3c3fa5(0x1e0)+_0x31ef26[_0x3c3fa5(0x1ff)]),_0x31ef26[_0x3c3fa5(0x1ce)]&&console['error']('\x20\x20Cause:\x20'+_0x31ef26[_0x3c3fa5(0x1ce)]),0x1;throw _0x31ef26;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0xaa74ad(0x1e1)]=a22_0xaa74ad(0x1e4);[a22_0xaa74ad(0x1c1)]=a22_0xaa74ad(0x1d7);async['execute'](_0x7bd119){const _0x4dc9a7=a22_0xaa74ad,{options:_0x45099d,args:_0x816e7d,tdx:_0x51fcc9}=_0x7bd119;if(_0x816e7d[_0x4dc9a7(0x1d5)]===0x0)return console['error'](_0x4dc9a7(0x206)),console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x1bd)),0x1;try{const {parentId:_0xd7dd6f,childId:_0x527012}=parseSegmentRef(_0x816e7d[0x0]);_0x45099d[_0x4dc9a7(0x1fb)]&&(console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x1d0)+_0x45099d[_0x4dc9a7(0x197)]),console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x19c)+_0xd7dd6f),_0x527012&&console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x1c3)+_0x527012));if(!_0x527012)return console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x1db)),0x1;const _0x348384=await withSpinner(_0x4dc9a7(0x1df)+_0xd7dd6f+'\x27...',()=>_0x51fcc9[_0x4dc9a7(0x1d8)][_0x4dc9a7(0x205)](_0xd7dd6f),{'verbose':_0x45099d[_0x4dc9a7(0x1fb)]}),_0x3c9fad=_0x348384[_0x4dc9a7(0x1f0)];_0x45099d[_0x4dc9a7(0x1fb)]&&console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x204)+_0x3c9fad);const _0x546338=await withSpinner('Resolving\x20folder\x20\x27'+_0x527012+_0x4dc9a7(0x1b0),()=>_0x51fcc9[_0x4dc9a7(0x1d8)][_0x4dc9a7(0x1d6)](_0x3c9fad,_0x527012),{'verbose':_0x45099d[_0x4dc9a7(0x1fb)]}),_0x531148=_0x546338['data'];_0x45099d[_0x4dc9a7(0x1fb)]&&console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x207)+_0x531148);const _0x375882=await withSpinner(_0x4dc9a7(0x1e3)+_0x527012+_0x4dc9a7(0x1b0),()=>_0x51fcc9[_0x4dc9a7(0x1d8)][_0x4dc9a7(0x1a7)](_0x531148),{'verbose':_0x45099d[_0x4dc9a7(0x1fb)]});return await handleSDKOutput([_0x375882[_0x4dc9a7(0x1f0)]],_0x45099d),0x0;}catch(_0xafc436){if(_0xafc436 instanceof SDKError)return console[_0x4dc9a7(0x1da)](_0x4dc9a7(0x1e0)+_0xafc436[_0x4dc9a7(0x1ff)]),_0xafc436['cause']&&console['error'](_0x4dc9a7(0x1b1)+_0xafc436[_0x4dc9a7(0x1ce)]),0x1;throw _0xafc436;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0xaa74ad(0x1e1)]=a22_0xaa74ad(0x1f5);[a22_0xaa74ad(0x1c1)]=a22_0xaa74ad(0x1d9);async[a22_0xaa74ad(0x1c5)](_0x146d6c){const _0x3d6ea1=a22_0xaa74ad,{options:_0x39b89b,args:_0x2ac97b,tdx:_0x4ec52b}=_0x146d6c;if(_0x2ac97b[_0x3d6ea1(0x1d5)]===0x0)return console[_0x3d6ea1(0x1da)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x3d6ea1(0x1da)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x3d6ea1(0x1da)](_0x3d6ea1(0x1b6)),console[_0x3d6ea1(0x1da)](_0x3d6ea1(0x200)),console[_0x3d6ea1(0x1da)](_0x3d6ea1(0x1dd)),console['error'](_0x3d6ea1(0x1b3)),0x1;try{const _0x38b9ba=_0x2ac97b[0x0],_0x2578e9=_0x39b89b[_0x3d6ea1(0x1bb)];let _0x24216c=_0x38b9ba;_0x2578e9&&!_0x38b9ba[_0x3d6ea1(0x1eb)]('/')&&(_0x24216c=_0x2578e9+'/'+_0x38b9ba,_0x39b89b[_0x3d6ea1(0x1fb)]&&console[_0x3d6ea1(0x1da)]('Resolved\x20relative\x20path\x20to:\x20'+_0x24216c));const _0x5e5529=await withSpinner(_0x3d6ea1(0x1e2)+_0x24216c+_0x3d6ea1(0x1b0),()=>_0x4ec52b[_0x3d6ea1(0x1d8)][_0x3d6ea1(0x1c2)](_0x24216c),{'verbose':_0x39b89b[_0x3d6ea1(0x1fb)]}),_0x55b989=_0x5e5529[_0x3d6ea1(0x1f0)];_0x39b89b['verbose']&&(console[_0x3d6ea1(0x1da)](_0x3d6ea1(0x1a6)+_0x55b989['type']),console[_0x3d6ea1(0x1da)](_0x3d6ea1(0x1fd)+_0x55b989[_0x3d6ea1(0x1d4)]));if(_0x55b989[_0x3d6ea1(0x1b5)]===_0x3d6ea1(0x1a9))return console['error'](_0x3d6ea1(0x1ec)),console[_0x3d6ea1(0x1da)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x21803e;if(_0x55b989[_0x3d6ea1(0x1b5)]==='parent'){const _0x38df67=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x4ec52b['segment'][_0x3d6ea1(0x1a3)](_0x55b989[_0x3d6ea1(0x1d4)]),{'verbose':_0x39b89b[_0x3d6ea1(0x1fb)]});_0x21803e=_0x38df67[_0x3d6ea1(0x1f0)];}else{if(!_0x55b989['segmentId'])throw new SDKError(ErrorCode[_0x3d6ea1(0x1a0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4fea76=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4ec52b['segment']['getSegmentSQL'](_0x55b989[_0x3d6ea1(0x1d4)],_0x55b989[_0x3d6ea1(0x1ee)]),{'verbose':_0x39b89b[_0x3d6ea1(0x1fb)]});_0x21803e=_0x4fea76['data'];}return _0x39b89b[_0x3d6ea1(0x1b7)]===_0x3d6ea1(0x1e6)||_0x39b89b[_0x3d6ea1(0x1b7)]===_0x3d6ea1(0x193)?await handleSDKOutput([{'sql':_0x21803e}],_0x39b89b):console[_0x3d6ea1(0x1a8)](_0x21803e),0x0;}catch(_0x4d2975){if(_0x4d2975 instanceof SDKError)return console[_0x3d6ea1(0x1da)](_0x3d6ea1(0x1e0)+_0x4d2975[_0x3d6ea1(0x1ff)]),_0x4d2975[_0x3d6ea1(0x1ce)]&&console['error'](_0x3d6ea1(0x1b1)+_0x4d2975['cause']),0x1;throw _0x4d2975;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a22_0xaa74ad(0x1d3);[a22_0xaa74ad(0x1c1)]='Create\x20segment\x20folder\x20for\x20organization';async[a22_0xaa74ad(0x1c5)](_0x470ddf){const _0x358602=a22_0xaa74ad,{options:_0x185fbc,args:_0x6d778e,tdx:_0x3c5010}=_0x470ddf,_0x532d29=_0x185fbc;if(_0x6d778e[_0x358602(0x1d5)]<0x2)return console[_0x358602(0x1da)](_0x358602(0x1cf)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x394aa4=_0x6d778e[0x0],_0x220c69=_0x6d778e[0x1];_0x532d29['verbose']&&(console[_0x358602(0x1da)](_0x358602(0x1d0)+_0x532d29['site']),console[_0x358602(0x1da)](_0x358602(0x1f8)+_0x394aa4),console[_0x358602(0x1da)](_0x358602(0x1c3)+_0x220c69));let _0x3e7e0a;if(_0x532d29['parentFolder']){const _0x217b9f=_0x532d29[_0x358602(0x1be)],_0x2eac41=await withSpinner(_0x358602(0x1df)+_0x394aa4+'\x27...',()=>_0x3c5010[_0x358602(0x1d8)]['resolveParentId'](_0x394aa4),{'verbose':_0x532d29[_0x358602(0x1fb)]}),_0x9e3b70=_0x2eac41[_0x358602(0x1f0)],_0x765ab1=await withSpinner(_0x358602(0x1fa)+_0x217b9f+_0x358602(0x1b0),()=>_0x3c5010['segment'][_0x358602(0x1d6)](_0x9e3b70,_0x217b9f),{'verbose':_0x532d29[_0x358602(0x1fb)]});_0x3e7e0a=_0x765ab1[_0x358602(0x1f0)],_0x532d29[_0x358602(0x1fb)]&&console[_0x358602(0x1da)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x3e7e0a);}const _0xf24be2={'name':_0x220c69,'description':_0x532d29[_0x358602(0x1c1)],'parentFolderId':_0x3e7e0a},_0x4e20f6=await withSpinner(_0x358602(0x1c9)+_0x220c69+_0x358602(0x1b0),()=>_0x3c5010['segment'][_0x358602(0x19a)](_0x394aa4,_0xf24be2),{'verbose':_0x532d29[_0x358602(0x1fb)]}),_0x86a344=_0x4e20f6['data'];return console['error'](_0x358602(0x1f3)+_0x86a344[_0x358602(0x1e1)]+_0x358602(0x19b)+_0x86a344['id']),await handleSDKOutput([_0x86a344],_0x532d29),0x0;}}
@@ -1 +1 @@
1
- const a23_0x29bf44=a23_0x15c8;(function(_0x2e5554,_0x1f48a5){const _0x330a73=a23_0x15c8,_0x18c800=_0x2e5554();while(!![]){try{const _0x374901=-parseInt(_0x330a73(0x10e))/0x1+-parseInt(_0x330a73(0x111))/0x2*(-parseInt(_0x330a73(0x11d))/0x3)+parseInt(_0x330a73(0xfe))/0x4*(parseInt(_0x330a73(0x117))/0x5)+parseInt(_0x330a73(0xf2))/0x6+-parseInt(_0x330a73(0xed))/0x7*(parseInt(_0x330a73(0x10a))/0x8)+-parseInt(_0x330a73(0xfc))/0x9*(-parseInt(_0x330a73(0xf5))/0xa)+-parseInt(_0x330a73(0xf0))/0xb;if(_0x374901===_0x1f48a5)break;else _0x18c800['push'](_0x18c800['shift']());}catch(_0x5ab34c){_0x18c800['push'](_0x18c800['shift']());}}}(a23_0x5474,0x20dd3));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';export class SegmentCreateCommand extends BaseCommand{[a23_0x29bf44(0x11c)]=a23_0x29bf44(0xfa);['description']=a23_0x29bf44(0x105);async[a23_0x29bf44(0x10b)](_0x1a65ff){const _0x400bc6=a23_0x29bf44,{options:_0x3e517d,args:_0x46101c,tdx:_0x2bfd95}=_0x1a65ff,_0x47eac9=_0x3e517d;if(_0x46101c[_0x400bc6(0x11a)]===0x0)return console[_0x400bc6(0x112)](_0x400bc6(0x107)),console[_0x400bc6(0x112)](_0x400bc6(0xf4)),console['error']('Examples:'),console[_0x400bc6(0x112)](_0x400bc6(0xf1)),console[_0x400bc6(0x112)](_0x400bc6(0xf3)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x469ee8=_0x46101c[0x0],_0x4ccc6b=_0x3e517d['segmentPath'];let _0x61ca1a=_0x469ee8;_0x4ccc6b&&!_0x469ee8['includes']('/')&&(_0x61ca1a=_0x4ccc6b+'/'+_0x469ee8,_0x47eac9[_0x400bc6(0x118)]&&console[_0x400bc6(0x112)]('Resolved\x20relative\x20path\x20to:\x20'+_0x61ca1a));const _0x251ed7=parsePath(_0x61ca1a);if(_0x251ed7['segments'][_0x400bc6(0x11a)]<0x2)return console[_0x400bc6(0x112)](_0x400bc6(0xf9)),console[_0x400bc6(0x112)](_0x400bc6(0x104)),0x1;const _0x2e54d5=_0x251ed7[_0x400bc6(0xfd)][0x0],_0x49308b=getBaseName(_0x61ca1a),_0x59dd01=getParentPath(_0x61ca1a);_0x47eac9[_0x400bc6(0x118)]&&(console[_0x400bc6(0x112)](_0x400bc6(0x101)+_0x47eac9[_0x400bc6(0x11e)]),console[_0x400bc6(0x112)](_0x400bc6(0x106)+_0x61ca1a),console[_0x400bc6(0x112)](_0x400bc6(0xff)+_0x2e54d5),console[_0x400bc6(0x112)]('Segment\x20name:\x20'+_0x49308b),console[_0x400bc6(0x112)](_0x400bc6(0x100)+_0x59dd01));const _0x228e0e=await withSpinner(_0x400bc6(0x10f)+_0x2e54d5+'\x27...',()=>_0x2bfd95[_0x400bc6(0x116)]['resolveParentId'](_0x2e54d5),{'verbose':_0x47eac9[_0x400bc6(0x118)]}),_0x3f6bae=_0x228e0e[_0x400bc6(0xef)];let _0x178a21;if(_0x251ed7[_0x400bc6(0xfd)][_0x400bc6(0x11a)]>0x2){const _0x2bf9f7=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x59dd01+_0x400bc6(0x114),()=>_0x2bfd95[_0x400bc6(0x116)][_0x400bc6(0x102)](_0x59dd01),{'verbose':_0x47eac9['verbose']}),_0x31b6f7=_0x2bf9f7['data'];if(_0x31b6f7[_0x400bc6(0xec)]!==_0x400bc6(0xf7)&&_0x31b6f7[_0x400bc6(0xec)]!==_0x400bc6(0xf8))return console[_0x400bc6(0x112)](_0x400bc6(0x109)),0x1;_0x178a21=_0x31b6f7[_0x400bc6(0x113)];}else{if(_0x47eac9[_0x400bc6(0xf7)]){const _0x27fbe1=await withSpinner('Resolving\x20folder\x20\x27'+_0x47eac9[_0x400bc6(0xf7)]+_0x400bc6(0x114),()=>_0x2bfd95[_0x400bc6(0x116)][_0x400bc6(0xf6)](_0x3f6bae,_0x47eac9['folder']),{'verbose':_0x47eac9[_0x400bc6(0x118)]});_0x178a21=_0x27fbe1[_0x400bc6(0xef)];}}_0x47eac9[_0x400bc6(0x118)]&&_0x178a21&&console[_0x400bc6(0x112)](_0x400bc6(0xee)+_0x178a21);const _0x5ee9ec=await loadJSONFromOptions(_0x47eac9[_0x400bc6(0x10c)],_0x47eac9[_0x400bc6(0x110)]),_0x1d8998={'name':_0x49308b,'description':_0x47eac9[_0x400bc6(0xfb)],'rule':_0x5ee9ec,'kind':_0x47eac9[_0x400bc6(0x103)]!==undefined?parseInt(_0x47eac9[_0x400bc6(0x103)],0xa):undefined,'isVisible':_0x47eac9['invisible']?![]:undefined,'segmentFolderId':_0x178a21,'countPopulation':_0x47eac9[_0x400bc6(0x115)]?![]:undefined},_0x25d37a=await withSpinner(_0x400bc6(0x119)+_0x49308b+_0x400bc6(0x114),()=>_0x2bfd95['segment'][_0x400bc6(0x11b)](_0x3f6bae,_0x1d8998),{'verbose':_0x47eac9[_0x400bc6(0x118)]}),_0x43101c=_0x25d37a[_0x400bc6(0xef)];return console[_0x400bc6(0x112)](_0x400bc6(0x10d)+_0x43101c[_0x400bc6(0x11c)]+'\x27\x20with\x20ID:\x20'+_0x43101c['id']),_0x61ca1a!==_0x469ee8&&console['error'](_0x400bc6(0x108)+_0x61ca1a),await handleSDKOutput([_0x43101c],_0x47eac9),0x0;}}function a23_0x15c8(_0x5291f7,_0x170695){const _0x547453=a23_0x5474();return a23_0x15c8=function(_0x15c8d9,_0x311886){_0x15c8d9=_0x15c8d9-0xec;let _0xe4b84f=_0x547453[_0x15c8d9];return _0xe4b84f;},a23_0x15c8(_0x5291f7,_0x170695);}function a23_0x5474(){const _0x596879=['\x20\x20\x20Path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','1192kFIbxM','execute','rule','✔\x20Created\x20segment\x20\x27','8098CHALiS','Resolving\x20parent\x20segment\x20\x27','ruleFile','8pGrDCF','error','folderId','\x27...','noCountPopulation','segment','10KuNfaS','verbose','Creating\x20segment\x20\x27','length','createSegment','name','188709cMhWou','site','type','2947WtajVG','Resolved\x20folder\x20ID:\x20','data','6011577kzMfnd','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','658512SwZaXa','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','29950VpkzKF','resolveFolderId','folder','parent','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segment:create','description','801hJjeTE','segments','248052wLJzpx','Parent:\x20','Parent\x20path:\x20','Site:\x20','resolvePathToResource','kind','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Create\x20child\x20segment\x20with\x20filtering\x20rules','Target\x20path:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a23_0x5474=function(){return _0x596879;};return a23_0x5474();}
1
+ function a23_0x27b9(_0x417bb8,_0x504b3a){const _0x458c37=a23_0x458c();return a23_0x27b9=function(_0x27b98f,_0xcb4a10){_0x27b98f=_0x27b98f-0x125;let _0x11cfeb=_0x458c37[_0x27b98f];return _0x11cfeb;},a23_0x27b9(_0x417bb8,_0x504b3a);}const a23_0x529f96=a23_0x27b9;(function(_0x3fe4bc,_0x5e8647){const _0x322be5=a23_0x27b9,_0x2e1bc8=_0x3fe4bc();while(!![]){try{const _0x1d2125=parseInt(_0x322be5(0x132))/0x1+parseInt(_0x322be5(0x149))/0x2*(parseInt(_0x322be5(0x12f))/0x3)+-parseInt(_0x322be5(0x14b))/0x4*(parseInt(_0x322be5(0x126))/0x5)+-parseInt(_0x322be5(0x129))/0x6+-parseInt(_0x322be5(0x13d))/0x7+-parseInt(_0x322be5(0x13c))/0x8+parseInt(_0x322be5(0x13f))/0x9;if(_0x1d2125===_0x5e8647)break;else _0x2e1bc8['push'](_0x2e1bc8['shift']());}catch(_0x4844ff){_0x2e1bc8['push'](_0x2e1bc8['shift']());}}}(a23_0x458c,0xbc4a5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a23_0x458c(){const _0x199ce6=['8OrIkmm','Resolved\x20folder\x20ID:\x20','Examples:','verbose','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x27...','kind','site','invisible','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20folder\x20path\x20\x27','Segment\x20name:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','828735OXQqci','segment:create','\x20\x20\x20Path:\x20','7174104jHlCEX','✔\x20Created\x20segment\x20\x27','name','segmentPath','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','folder','303jNnbYK','resolveParentId','rule','688040SXRcHX','description','Parent\x20path:\x20','length','Target\x20path:\x20','Site:\x20','Creating\x20segment\x20\x27','data','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','8467920udlOSK','5641139nQUKOy','Resolved\x20relative\x20path\x20to:\x20','29944629UIPJsf','parent','ruleFile','error','execute','segment','segments','Parent:\x20','Resolving\x20folder\x20\x27','type','2922cMprVd','resolveFolderId'];a23_0x458c=function(){return _0x199ce6;};return a23_0x458c();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x529f96(0x12b)]=a23_0x529f96(0x127);[a23_0x529f96(0x133)]=a23_0x529f96(0x125);async[a23_0x529f96(0x143)](_0x5ec4e7){const _0x9f1d4c=a23_0x529f96,{options:_0x1fd3b7,args:_0x42ab02,tdx:_0x3b0835}=_0x5ec4e7,_0xf06143=_0x1fd3b7;if(_0x42ab02[_0x9f1d4c(0x135)]===0x0)return console[_0x9f1d4c(0x142)](_0x9f1d4c(0x155)),console[_0x9f1d4c(0x142)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x9f1d4c(0x142)](_0x9f1d4c(0x14d)),console[_0x9f1d4c(0x142)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x9f1d4c(0x142)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x9f1d4c(0x150)),0x1;const _0xb31d67=_0x42ab02[0x0],_0x23009b=_0x1fd3b7[_0x9f1d4c(0x12c)];let _0x3d77a0=_0xb31d67;_0x23009b&&!_0xb31d67['includes']('/')&&(_0x3d77a0=_0x23009b+'/'+_0xb31d67,_0xf06143[_0x9f1d4c(0x14e)]&&console[_0x9f1d4c(0x142)](_0x9f1d4c(0x13e)+_0x3d77a0));const _0x257174=parsePath(_0x3d77a0);if(_0x257174[_0x9f1d4c(0x145)][_0x9f1d4c(0x135)]<0x2)return console['error'](_0x9f1d4c(0x12d)),console[_0x9f1d4c(0x142)](_0x9f1d4c(0x14f)),0x1;const _0x4a302e=_0x257174[_0x9f1d4c(0x145)][0x0],_0x2b5655=getBaseName(_0x3d77a0),_0x4acd6f=getParentPath(_0x3d77a0);_0xf06143[_0x9f1d4c(0x14e)]&&(console[_0x9f1d4c(0x142)](_0x9f1d4c(0x137)+_0xf06143[_0x9f1d4c(0x153)]),console[_0x9f1d4c(0x142)](_0x9f1d4c(0x136)+_0x3d77a0),console[_0x9f1d4c(0x142)](_0x9f1d4c(0x146)+_0x4a302e),console[_0x9f1d4c(0x142)](_0x9f1d4c(0x157)+_0x2b5655),console[_0x9f1d4c(0x142)](_0x9f1d4c(0x134)+_0x4acd6f));const _0x43e00b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4a302e+_0x9f1d4c(0x151),()=>_0x3b0835[_0x9f1d4c(0x144)][_0x9f1d4c(0x130)](_0x4a302e),{'verbose':_0xf06143[_0x9f1d4c(0x14e)]}),_0x1a52c8=_0x43e00b[_0x9f1d4c(0x139)];let _0x1916ae;if(_0x257174[_0x9f1d4c(0x145)]['length']>0x2){const _0x56b88f=await withSpinner(_0x9f1d4c(0x156)+_0x4acd6f+'\x27...',()=>_0x3b0835[_0x9f1d4c(0x144)]['resolvePathToResource'](_0x4acd6f),{'verbose':_0xf06143[_0x9f1d4c(0x14e)]}),_0x47c4ad=_0x56b88f['data'];if(_0x47c4ad[_0x9f1d4c(0x148)]!=='folder'&&_0x47c4ad[_0x9f1d4c(0x148)]!==_0x9f1d4c(0x140))return console[_0x9f1d4c(0x142)](_0x9f1d4c(0x13b)),0x1;_0x1916ae=_0x47c4ad['folderId'];}else{if(_0xf06143[_0x9f1d4c(0x12e)]){const _0x30e9da=await withSpinner(_0x9f1d4c(0x147)+_0xf06143[_0x9f1d4c(0x12e)]+_0x9f1d4c(0x151),()=>_0x3b0835['segment'][_0x9f1d4c(0x14a)](_0x1a52c8,_0xf06143[_0x9f1d4c(0x12e)]),{'verbose':_0xf06143[_0x9f1d4c(0x14e)]});_0x1916ae=_0x30e9da[_0x9f1d4c(0x139)];}}_0xf06143[_0x9f1d4c(0x14e)]&&_0x1916ae&&console[_0x9f1d4c(0x142)](_0x9f1d4c(0x14c)+_0x1916ae);const _0x2f6bdb=await loadJSONFromOptions(_0xf06143[_0x9f1d4c(0x131)],_0xf06143[_0x9f1d4c(0x141)]),_0x1287d9={'name':_0x2b5655,'description':_0xf06143['description'],'rule':_0x2f6bdb,'kind':_0xf06143[_0x9f1d4c(0x152)]!==undefined?parseInt(_0xf06143['kind'],0xa):undefined,'isVisible':_0xf06143[_0x9f1d4c(0x154)]?![]:undefined,'segmentFolderId':_0x1916ae,'countPopulation':_0xf06143['noCountPopulation']?![]:undefined},_0x2e753a=await withSpinner(_0x9f1d4c(0x138)+_0x2b5655+_0x9f1d4c(0x151),()=>_0x3b0835[_0x9f1d4c(0x144)]['createSegment'](_0x1a52c8,_0x1287d9),{'verbose':_0xf06143[_0x9f1d4c(0x14e)]}),_0x3353b9=_0x2e753a[_0x9f1d4c(0x139)];return console[_0x9f1d4c(0x142)](_0x9f1d4c(0x12a)+_0x3353b9[_0x9f1d4c(0x12b)]+_0x9f1d4c(0x13a)+_0x3353b9['id']),_0x3d77a0!==_0xb31d67&&console['error'](_0x9f1d4c(0x128)+_0x3d77a0),await handleSDKOutput([_0x3353b9],_0xf06143),0x0;}}
@@ -1 +1 @@
1
- const a24_0x3562ff=a24_0x1106;(function(_0x51e5cf,_0x3f0a64){const _0x3a7df8=a24_0x1106,_0x4ccd44=_0x51e5cf();while(!![]){try{const _0x194bfc=-parseInt(_0x3a7df8(0x178))/0x1+parseInt(_0x3a7df8(0x182))/0x2*(parseInt(_0x3a7df8(0x17b))/0x3)+parseInt(_0x3a7df8(0x186))/0x4+-parseInt(_0x3a7df8(0x173))/0x5*(-parseInt(_0x3a7df8(0x174))/0x6)+parseInt(_0x3a7df8(0x16d))/0x7*(parseInt(_0x3a7df8(0x179))/0x8)+parseInt(_0x3a7df8(0x170))/0x9+parseInt(_0x3a7df8(0x172))/0xa*(-parseInt(_0x3a7df8(0x171))/0xb);if(_0x194bfc===_0x3f0a64)break;else _0x4ccd44['push'](_0x4ccd44['shift']());}catch(_0xa214b1){_0x4ccd44['push'](_0x4ccd44['shift']());}}}(a24_0x7186,0xded4a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a24_0x1106(_0x26c80c,_0x4065e4){const _0x7186e7=a24_0x7186();return a24_0x1106=function(_0x110607,_0x12991f){_0x110607=_0x110607-0x16b;let _0x44c6fa=_0x7186e7[_0x110607];return _0x44c6fa;},a24_0x1106(_0x26c80c,_0x4065e4);}function a24_0x7186(){const _0x2218ec=['14119200qZESLK','44102300FbjkHU','10TLlSAR','9070wBFbbl','5028WecVPi','listFields','name','site','1247468SSqQWf','1167824RAEdTd','Listing\x20fields\x20for\x20\x27','531iRaChg','\x27...','List\x20available\x20fields\x20for\x20segmentation','error','segment','execute','Site:\x20','19768goHakr','verbose','✔\x20Found\x20','length','2404768aiYOFp','segment:fields','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','35EfYZuf','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Parent\x20segment:\x20'];a24_0x7186=function(){return _0x2218ec;};return a24_0x7186();}export class SegmentFieldsCommand extends BaseCommand{[a24_0x3562ff(0x176)]=a24_0x3562ff(0x187);[a24_0x3562ff(0x16c)]=a24_0x3562ff(0x17d);async[a24_0x3562ff(0x180)](_0x23b35c){const _0xa5c2c8=a24_0x3562ff,{options:_0x26ffd0,args:_0x32faef,tdx:_0x173456}=_0x23b35c;if(_0x32faef[_0xa5c2c8(0x185)]===0x0)return console[_0xa5c2c8(0x17e)](_0xa5c2c8(0x16b)),console['error'](_0xa5c2c8(0x16e)),0x1;const _0x1d3ff5=_0x32faef[0x0];_0x26ffd0[_0xa5c2c8(0x183)]&&(console[_0xa5c2c8(0x17e)](_0xa5c2c8(0x181)+_0x26ffd0[_0xa5c2c8(0x177)]),console[_0xa5c2c8(0x17e)](_0xa5c2c8(0x16f)+_0x1d3ff5));const _0x25e85b=await withSpinner(_0xa5c2c8(0x17a)+_0x1d3ff5+_0xa5c2c8(0x17c),()=>_0x173456[_0xa5c2c8(0x17f)][_0xa5c2c8(0x175)](_0x1d3ff5),{'verbose':_0x26ffd0[_0xa5c2c8(0x183)]}),_0x52b371=_0x25e85b['data'];return console[_0xa5c2c8(0x17e)](_0xa5c2c8(0x184)+_0x52b371[_0xa5c2c8(0x185)]+'\x20field'+(_0x52b371['length']!==0x1?'s':'')),await handleSDKOutput(_0x52b371,_0x26ffd0),0x0;}}
1
+ const a24_0x59278b=a24_0x212c;function a24_0x212c(_0x1b6b64,_0x15fd89){const _0x1a4568=a24_0x1a45();return a24_0x212c=function(_0x212c40,_0x2c0eb4){_0x212c40=_0x212c40-0x126;let _0x37a7ad=_0x1a4568[_0x212c40];return _0x37a7ad;},a24_0x212c(_0x1b6b64,_0x15fd89);}(function(_0x34849d,_0x1589c8){const _0x228f4d=a24_0x212c,_0x39be41=_0x34849d();while(!![]){try{const _0x112ac8=parseInt(_0x228f4d(0x12f))/0x1+parseInt(_0x228f4d(0x136))/0x2*(-parseInt(_0x228f4d(0x134))/0x3)+-parseInt(_0x228f4d(0x12a))/0x4+parseInt(_0x228f4d(0x127))/0x5*(parseInt(_0x228f4d(0x12c))/0x6)+parseInt(_0x228f4d(0x132))/0x7*(-parseInt(_0x228f4d(0x13a))/0x8)+-parseInt(_0x228f4d(0x138))/0x9*(-parseInt(_0x228f4d(0x133))/0xa)+parseInt(_0x228f4d(0x13d))/0xb;if(_0x112ac8===_0x1589c8)break;else _0x39be41['push'](_0x39be41['shift']());}catch(_0x5bf944){_0x39be41['push'](_0x39be41['shift']());}}}(a24_0x1a45,0xbdac1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a24_0x1a45(){const _0x420330=['segment','List\x20available\x20fields\x20for\x20segmentation','14MAwuKp','555110vfrKnw','3zUyQeO','Listing\x20fields\x20for\x20\x27','1145954WMeleV','description','153wnPJRj','Parent\x20segment:\x20','4744888bHYTnX','site','Error:\x20Parent\x20segment\x20name\x20is\x20required','9688525NDyXnB','\x27...','segment:fields','length','verbose','execute','26770DGBNRZ','\x20field','error','1578152BBKbBL','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','996GdoGxb','Site:\x20','listFields','217408lVSgFE'];a24_0x1a45=function(){return _0x420330;};return a24_0x1a45();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a24_0x59278b(0x13f);[a24_0x59278b(0x137)]=a24_0x59278b(0x131);async[a24_0x59278b(0x126)](_0x38b5ba){const _0x2aeb38=a24_0x59278b,{options:_0x54613d,args:_0x3cdd8e,tdx:_0x62e787}=_0x38b5ba;if(_0x3cdd8e['length']===0x0)return console[_0x2aeb38(0x129)](_0x2aeb38(0x13c)),console[_0x2aeb38(0x129)](_0x2aeb38(0x12b)),0x1;const _0x379e3d=_0x3cdd8e[0x0];_0x54613d[_0x2aeb38(0x141)]&&(console[_0x2aeb38(0x129)](_0x2aeb38(0x12d)+_0x54613d[_0x2aeb38(0x13b)]),console[_0x2aeb38(0x129)](_0x2aeb38(0x139)+_0x379e3d));const _0x3b4059=await withSpinner(_0x2aeb38(0x135)+_0x379e3d+_0x2aeb38(0x13e),()=>_0x62e787[_0x2aeb38(0x130)][_0x2aeb38(0x12e)](_0x379e3d),{'verbose':_0x54613d[_0x2aeb38(0x141)]}),_0xeba8f3=_0x3b4059['data'];return console[_0x2aeb38(0x129)]('✔\x20Found\x20'+_0xeba8f3[_0x2aeb38(0x140)]+_0x2aeb38(0x128)+(_0xeba8f3[_0x2aeb38(0x140)]!==0x1?'s':'')),await handleSDKOutput(_0xeba8f3,_0x54613d),0x0;}}
@@ -1 +1 @@
1
- const a25_0x4efbef=a25_0x5451;(function(_0x3832e9,_0x42f8a9){const _0x5d29ec=a25_0x5451,_0x570b3b=_0x3832e9();while(!![]){try{const _0x3218b1=-parseInt(_0x5d29ec(0x1fc))/0x1+-parseInt(_0x5d29ec(0x203))/0x2*(-parseInt(_0x5d29ec(0x1f8))/0x3)+-parseInt(_0x5d29ec(0x1fb))/0x4+-parseInt(_0x5d29ec(0x1fa))/0x5+parseInt(_0x5d29ec(0x1f2))/0x6*(-parseInt(_0x5d29ec(0x201))/0x7)+-parseInt(_0x5d29ec(0x1f9))/0x8*(parseInt(_0x5d29ec(0x204))/0x9)+parseInt(_0x5d29ec(0x1f1))/0xa;if(_0x3218b1===_0x42f8a9)break;else _0x570b3b['push'](_0x570b3b['shift']());}catch(_0x48d888){_0x570b3b['push'](_0x570b3b['shift']());}}}(a25_0x1e94,0xa353f));function a25_0x5451(_0x49db0d,_0x4d30f1){const _0x1e9496=a25_0x1e94();return a25_0x5451=function(_0x5451e1,_0x8a71f7){_0x5451e1=_0x5451e1-0x1f0;let _0x2fea81=_0x1e9496[_0x5451e1];return _0x2fea81;},a25_0x5451(_0x49db0d,_0x4d30f1);}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a25_0x4efbef(0x1f7)]=a25_0x4efbef(0x202);[a25_0x4efbef(0x1f3)]=a25_0x4efbef(0x207);async[a25_0x4efbef(0x1fd)](_0x5e9c0b){const _0x3d2d81=a25_0x4efbef,{options:_0x3a27d0}=_0x5e9c0b;try{const _0x384ff0=_0x3a27d0[_0x3d2d81(0x1fe)];if(!_0x384ff0)return _0x3a27d0[_0x3d2d81(0x1ff)]==='json'||_0x3a27d0[_0x3d2d81(0x1ff)]===_0x3d2d81(0x1f0)?console['log'](JSON[_0x3d2d81(0x1f4)]({'path':'/','type':_0x3d2d81(0x206)})):console[_0x3d2d81(0x200)]('/'),0x0;if(_0x3a27d0[_0x3d2d81(0x1ff)]==='json'||_0x3a27d0[_0x3d2d81(0x1ff)]===_0x3d2d81(0x1f0)){const _0x1531bb={'path':_0x384ff0};console['log'](JSON['stringify'](_0x1531bb));}else console[_0x3d2d81(0x200)](_0x384ff0),_0x3a27d0[_0x3d2d81(0x1f6)]&&(console[_0x3d2d81(0x205)](''),console[_0x3d2d81(0x205)](_0x3d2d81(0x208)),console['error']('\x20\x20Path:\x20'+_0x384ff0),console[_0x3d2d81(0x205)](''),console['error']('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x3d2d81(0x205)](_0x3d2d81(0x1f5)));return 0x0;}catch(_0x496e32){throw _0x496e32;}}}function a25_0x1e94(){const _0x35ee6e=['segment:pwd','91572BseLEw','9CJOfuz','error','root','Show\x20current\x20segment/folder\x20context','Context\x20details:','jsonl','26786610wwqUMl','6LfZyAh','description','stringify','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','verbose','name','18aHSkRH','5364728CsXxJr','449820sYXRiX','3616600ZOMhRP','227288hFaLnC','execute','segmentPath','format','log','2746751goOXIf'];a25_0x1e94=function(){return _0x35ee6e;};return a25_0x1e94();}
1
+ const a25_0x4f1a23=a25_0x221b;function a25_0x221b(_0x304dd4,_0x279bca){const _0xa23261=a25_0xa232();return a25_0x221b=function(_0x221b55,_0x555578){_0x221b55=_0x221b55-0x14b;let _0xde022c=_0xa23261[_0x221b55];return _0xde022c;},a25_0x221b(_0x304dd4,_0x279bca);}function a25_0xa232(){const _0x20a343=['40ydLzoR','verbose','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','execute','44KfBQzS','2DQOaVX','4714234yZBdoO','64VTYUuN','Show\x20current\x20segment/folder\x20context','\x20\x20Path:\x20','log','stringify','36996wgfsoV','format','494XMqnfH','root','351113YfmRdb','segmentPath','203180twVJEZ','json','error','6dOdZRq','description','jsonl','segment:pwd','name','824706iFXBEG','1297941QmBXmc','87820xKeJzK'];a25_0xa232=function(){return _0x20a343;};return a25_0xa232();}(function(_0xd7ccd,_0x5a4466){const _0x1e598b=a25_0x221b,_0x5e192f=_0xd7ccd();while(!![]){try{const _0x4c3d11=parseInt(_0x1e598b(0x156))/0x1*(parseInt(_0x1e598b(0x14b))/0x2)+-parseInt(_0x1e598b(0x161))/0x3+parseInt(_0x1e598b(0x14d))/0x4*(parseInt(_0x1e598b(0x162))/0x5)+parseInt(_0x1e598b(0x15b))/0x6*(parseInt(_0x1e598b(0x14c))/0x7)+parseInt(_0x1e598b(0x163))/0x8*(-parseInt(_0x1e598b(0x160))/0x9)+parseInt(_0x1e598b(0x158))/0xa*(parseInt(_0x1e598b(0x167))/0xb)+parseInt(_0x1e598b(0x152))/0xc*(-parseInt(_0x1e598b(0x154))/0xd);if(_0x4c3d11===_0x5a4466)break;else _0x5e192f['push'](_0x5e192f['shift']());}catch(_0x38a307){_0x5e192f['push'](_0x5e192f['shift']());}}}(a25_0xa232,0x5c814));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a25_0x4f1a23(0x15f)]=a25_0x4f1a23(0x15e);[a25_0x4f1a23(0x15c)]=a25_0x4f1a23(0x14e);async[a25_0x4f1a23(0x166)](_0x352286){const _0x228213=a25_0x4f1a23,{options:_0x4f56d9}=_0x352286;try{const _0x4a24e4=_0x4f56d9[_0x228213(0x157)];if(!_0x4a24e4)return _0x4f56d9['format']===_0x228213(0x159)||_0x4f56d9[_0x228213(0x153)]===_0x228213(0x15d)?console[_0x228213(0x150)](JSON[_0x228213(0x151)]({'path':'/','type':_0x228213(0x155)})):console[_0x228213(0x150)]('/'),0x0;if(_0x4f56d9[_0x228213(0x153)]===_0x228213(0x159)||_0x4f56d9[_0x228213(0x153)]===_0x228213(0x15d)){const _0x246c93={'path':_0x4a24e4};console['log'](JSON[_0x228213(0x151)](_0x246c93));}else console['log'](_0x4a24e4),_0x4f56d9[_0x228213(0x164)]&&(console[_0x228213(0x15a)](''),console[_0x228213(0x15a)]('Context\x20details:'),console[_0x228213(0x15a)](_0x228213(0x14f)+_0x4a24e4),console[_0x228213(0x15a)](''),console[_0x228213(0x15a)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console['error'](_0x228213(0x165)));return 0x0;}catch(_0x52b1dd){throw _0x52b1dd;}}}
@@ -1 +1 @@
1
- function a26_0x17b6(_0x3b0326,_0x12e7f4){const _0x14f751=a26_0x14f7();return a26_0x17b6=function(_0x17b6a2,_0x2a8f2a){_0x17b6a2=_0x17b6a2-0x1cb;let _0x4c2941=_0x14f751[_0x17b6a2];return _0x4c2941;},a26_0x17b6(_0x3b0326,_0x12e7f4);}const a26_0x10782f=a26_0x17b6;(function(_0x309739,_0x556913){const _0x3e6ba7=a26_0x17b6,_0x50f2ea=_0x309739();while(!![]){try{const _0x963cd5=parseInt(_0x3e6ba7(0x1e0))/0x1+parseInt(_0x3e6ba7(0x1ce))/0x2*(parseInt(_0x3e6ba7(0x1ec))/0x3)+-parseInt(_0x3e6ba7(0x1e1))/0x4+-parseInt(_0x3e6ba7(0x1ef))/0x5+parseInt(_0x3e6ba7(0x1d1))/0x6+-parseInt(_0x3e6ba7(0x1d2))/0x7+parseInt(_0x3e6ba7(0x1ee))/0x8;if(_0x963cd5===_0x556913)break;else _0x50f2ea['push'](_0x50f2ea['shift']());}catch(_0x62b900){_0x50f2ea['push'](_0x50f2ea['shift']());}}}(a26_0x14f7,0xa7b48));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x14f7(){const _0x3756b6=['resolveFolderId','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','✔\x20Updated\x20segment\x20\x27','Parent\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','error','Segment\x20ID:\x20','segmentId','3JgTLXY','type','5960944kOseyI','2036220VHuKFf','Examples:','execute','\x27...','resolvePathToResource','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','\x20\x20\x20Path:\x20','kind','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1166518yBXpTe','Resolving\x20path\x20\x27','name','7761018hJUcfJ','6778702zlzYGE','INTERNAL','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','folder','verbose','rule','ruleFile','Resolved\x20relative\x20path\x20to:\x20','Updating\x20segment\x20\x27','data','segment:update','description','Resolving\x20folder\x20\x27','includes','434675ukqAey','3976020eYODaV','Resolved\x20folder\x20ID:\x20','segmentName'];a26_0x14f7=function(){return _0x3756b6;};return a26_0x14f7();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a26_0x10782f(0x1dc);['description']='Update\x20existing\x20child\x20segment';async[a26_0x10782f(0x1f1)](_0x4cd25c){const _0x1efb6f=a26_0x10782f,{options:_0x3057f6,args:_0x504632,tdx:_0x16a06a}=_0x4cd25c,_0x4618b1=_0x3057f6;if(_0x504632['length']===0x0)return console['error'](_0x1efb6f(0x1e8)),console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1e5)),console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1f0)),console['error'](_0x1efb6f(0x1f6)),console['error'](_0x1efb6f(0x1f5)),0x1;const _0x2b69e6=_0x504632[0x0],_0x231353=_0x3057f6['segmentPath'];let _0x152e65=_0x2b69e6;_0x231353&&!_0x2b69e6[_0x1efb6f(0x1df)]('/')&&(_0x152e65=_0x231353+'/'+_0x2b69e6,_0x4618b1[_0x1efb6f(0x1d6)]&&console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1d9)+_0x152e65));const _0x2b2542=await withSpinner(_0x1efb6f(0x1cf)+_0x152e65+'\x27...',()=>_0x16a06a['segment'][_0x1efb6f(0x1f3)](_0x152e65),{'verbose':_0x4618b1[_0x1efb6f(0x1d6)]}),_0x30da9c=_0x2b2542['data'];_0x4618b1[_0x1efb6f(0x1d6)]&&console[_0x1efb6f(0x1e9)]('Resolved\x20type:\x20'+_0x30da9c[_0x1efb6f(0x1ed)]);if(_0x30da9c[_0x1efb6f(0x1ed)]!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0x30da9c[_0x1efb6f(0x1ed)]+_0x1efb6f(0x1d4)),console[_0x1efb6f(0x1e9)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x30da9c[_0x1efb6f(0x1eb)])throw new SDKError(ErrorCode[_0x1efb6f(0x1d3)],_0x1efb6f(0x1cd));const _0x37cc32=_0x30da9c['parentId'],_0x1fa3e8=_0x30da9c[_0x1efb6f(0x1eb)];_0x4618b1[_0x1efb6f(0x1d6)]&&(console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1e7)+_0x37cc32),console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1ea)+_0x1fa3e8));let _0x28665b;if(_0x4618b1[_0x1efb6f(0x1d5)]){const _0x5af7de=_0x4618b1[_0x1efb6f(0x1d5)],_0x4b456b=await withSpinner(_0x1efb6f(0x1de)+_0x5af7de+_0x1efb6f(0x1f2),()=>_0x16a06a[_0x1efb6f(0x1f4)][_0x1efb6f(0x1e4)](_0x37cc32,_0x5af7de),{'verbose':_0x4618b1[_0x1efb6f(0x1d6)]});_0x28665b=parseInt(_0x4b456b[_0x1efb6f(0x1db)],0xa),_0x4618b1[_0x1efb6f(0x1d6)]&&console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1e2)+_0x28665b);}const _0x275701=await loadJSONFromOptions(_0x4618b1[_0x1efb6f(0x1d7)],_0x4618b1[_0x1efb6f(0x1d8)]),_0x4be3fe={'name':_0x4618b1[_0x1efb6f(0x1d0)],'description':_0x4618b1[_0x1efb6f(0x1dd)],'rule':_0x275701,'kind':_0x4618b1[_0x1efb6f(0x1cc)]!==undefined?parseInt(_0x4618b1[_0x1efb6f(0x1cc)],0xa):undefined,'segmentFolderId':_0x28665b},_0x2ab075=await withSpinner(_0x1efb6f(0x1da)+_0x30da9c[_0x1efb6f(0x1e3)]+'\x27...',()=>_0x16a06a['segment']['updateSegmentById'](_0x37cc32,_0x1fa3e8,_0x4be3fe),{'verbose':_0x4618b1['verbose']}),_0x1d90f2=_0x2ab075[_0x1efb6f(0x1db)];return console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1e6)+_0x1d90f2[_0x1efb6f(0x1d0)]+'\x27'),_0x152e65!==_0x2b69e6&&console[_0x1efb6f(0x1e9)](_0x1efb6f(0x1cb)+_0x152e65),await handleSDKOutput([_0x1d90f2],_0x4618b1),0x0;}}
1
+ const a26_0x4180ee=a26_0x5777;(function(_0x25c2a1,_0x2a14c6){const _0x15ca45=a26_0x5777,_0x40c2d1=_0x25c2a1();while(!![]){try{const _0x137b42=-parseInt(_0x15ca45(0x9d))/0x1*(parseInt(_0x15ca45(0x75))/0x2)+-parseInt(_0x15ca45(0xa0))/0x3*(-parseInt(_0x15ca45(0x99))/0x4)+-parseInt(_0x15ca45(0x76))/0x5+-parseInt(_0x15ca45(0x83))/0x6*(-parseInt(_0x15ca45(0x97))/0x7)+parseInt(_0x15ca45(0x88))/0x8+parseInt(_0x15ca45(0x9a))/0x9*(parseInt(_0x15ca45(0x8b))/0xa)+-parseInt(_0x15ca45(0x7d))/0xb;if(_0x137b42===_0x2a14c6)break;else _0x40c2d1['push'](_0x40c2d1['shift']());}catch(_0xf3552d){_0x40c2d1['push'](_0x40c2d1['shift']());}}}(a26_0x2ee2,0x89389));function a26_0x5777(_0x159049,_0x5c7dc9){const _0x2ee24f=a26_0x2ee2();return a26_0x5777=function(_0x5777eb,_0x3fced5){_0x5777eb=_0x5777eb-0x71;let _0x3f152b=_0x2ee24f[_0x5777eb];return _0x3f152b;},a26_0x5777(_0x159049,_0x5c7dc9);}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 a26_0x2ee2(){const _0xc57eaf=['Examples:','rule','3227qEPFok','Error:\x20Cannot\x20update\x20','17624PfJsNF','171ziJgGK','Updating\x20segment\x20\x27','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','199DwUhgA','type','segmentName','561sVKBni','Update\x20existing\x20child\x20segment','ruleFile','Segment\x20ID:\x20','INTERNAL','2954nOiGBN','2321485PuRWbs','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','data','segment','includes','resolvePathToResource','13583977HHDFDC','Resolved\x20folder\x20ID:\x20','name','segmentId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','verbose','9558RlhlAG','length','resolveFolderId','error','execute','283000Qzxwwm','segmentPath','\x27...','506060LvtfJJ','Resolving\x20path\x20\x27','description','✔\x20Updated\x20segment\x20\x27','kind','folder','Resolved\x20type:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment:update','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a26_0x2ee2=function(){return _0xc57eaf;};return a26_0x2ee2();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x4180ee(0x7f)]=a26_0x4180ee(0x93);['description']=a26_0x4180ee(0x71);async[a26_0x4180ee(0x87)](_0x2c1baa){const _0x5160ff=a26_0x4180ee,{options:_0x2c9631,args:_0x382798,tdx:_0x28fbbc}=_0x2c1baa,_0xfae721=_0x2c9631;if(_0x382798[_0x5160ff(0x84)]===0x0)return console[_0x5160ff(0x86)](_0x5160ff(0x81)),console[_0x5160ff(0x86)](_0x5160ff(0x92)),console[_0x5160ff(0x86)](_0x5160ff(0x95)),console[_0x5160ff(0x86)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0xc32dc1=_0x382798[0x0],_0x1808d8=_0x2c9631[_0x5160ff(0x89)];let _0x55dcea=_0xc32dc1;_0x1808d8&&!_0xc32dc1[_0x5160ff(0x7b)]('/')&&(_0x55dcea=_0x1808d8+'/'+_0xc32dc1,_0xfae721[_0x5160ff(0x82)]&&console[_0x5160ff(0x86)]('Resolved\x20relative\x20path\x20to:\x20'+_0x55dcea));const _0x58f3b0=await withSpinner(_0x5160ff(0x8c)+_0x55dcea+_0x5160ff(0x8a),()=>_0x28fbbc[_0x5160ff(0x7a)][_0x5160ff(0x7c)](_0x55dcea),{'verbose':_0xfae721[_0x5160ff(0x82)]}),_0x4a28d3=_0x58f3b0[_0x5160ff(0x79)];_0xfae721[_0x5160ff(0x82)]&&console[_0x5160ff(0x86)](_0x5160ff(0x91)+_0x4a28d3[_0x5160ff(0x9e)]);if(_0x4a28d3[_0x5160ff(0x9e)]!==_0x5160ff(0x7a))return console['error'](_0x5160ff(0x98)+_0x4a28d3[_0x5160ff(0x9e)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x5160ff(0x86)](_0x5160ff(0x9c)),0x1;if(!_0x4a28d3[_0x5160ff(0x80)])throw new SDKError(ErrorCode[_0x5160ff(0x74)],_0x5160ff(0x94));const _0x10e03a=_0x4a28d3['parentId'],_0x98699=_0x4a28d3[_0x5160ff(0x80)];_0xfae721[_0x5160ff(0x82)]&&(console[_0x5160ff(0x86)]('Parent\x20ID:\x20'+_0x10e03a),console['error'](_0x5160ff(0x73)+_0x98699));let _0x49c3a6;if(_0xfae721['folder']){const _0x545ae4=_0xfae721[_0x5160ff(0x90)],_0x4a2f0e=await withSpinner(_0x5160ff(0x78)+_0x545ae4+_0x5160ff(0x8a),()=>_0x28fbbc[_0x5160ff(0x7a)][_0x5160ff(0x85)](_0x10e03a,_0x545ae4),{'verbose':_0xfae721[_0x5160ff(0x82)]});_0x49c3a6=parseInt(_0x4a2f0e[_0x5160ff(0x79)],0xa),_0xfae721[_0x5160ff(0x82)]&&console[_0x5160ff(0x86)](_0x5160ff(0x7e)+_0x49c3a6);}const _0x6681e6=await loadJSONFromOptions(_0xfae721[_0x5160ff(0x96)],_0xfae721[_0x5160ff(0x72)]),_0x4b935c={'name':_0xfae721[_0x5160ff(0x7f)],'description':_0xfae721[_0x5160ff(0x8d)],'rule':_0x6681e6,'kind':_0xfae721[_0x5160ff(0x8f)]!==undefined?parseInt(_0xfae721[_0x5160ff(0x8f)],0xa):undefined,'segmentFolderId':_0x49c3a6},_0x2294af=await withSpinner(_0x5160ff(0x9b)+_0x4a28d3[_0x5160ff(0x9f)]+_0x5160ff(0x8a),()=>_0x28fbbc[_0x5160ff(0x7a)]['updateSegmentById'](_0x10e03a,_0x98699,_0x4b935c),{'verbose':_0xfae721['verbose']}),_0x15b514=_0x2294af[_0x5160ff(0x79)];return console[_0x5160ff(0x86)](_0x5160ff(0x8e)+_0x15b514[_0x5160ff(0x7f)]+'\x27'),_0x55dcea!==_0xc32dc1&&console['error'](_0x5160ff(0x77)+_0x55dcea),await handleSDKOutput([_0x15b514],_0xfae721),0x0;}}