@treasuredata/tdx 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +0 -4
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli.js +1 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.d.ts +1 -1
  18. package/dist/commands/claude-command.d.ts.map +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-command.js.map +1 -1
  21. package/dist/commands/claude-statusline-command.d.ts +23 -0
  22. package/dist/commands/claude-statusline-command.d.ts.map +1 -0
  23. package/dist/commands/claude-statusline-command.js +1 -0
  24. package/dist/commands/claude-statusline-command.js.map +1 -0
  25. package/dist/commands/claude-usage-command.d.ts +22 -0
  26. package/dist/commands/claude-usage-command.d.ts.map +1 -0
  27. package/dist/commands/claude-usage-command.js +1 -0
  28. package/dist/commands/claude-usage-command.js.map +1 -0
  29. package/dist/commands/command.js +1 -1
  30. package/dist/commands/context-command.js +1 -1
  31. package/dist/commands/databases.js +1 -1
  32. package/dist/commands/describe.js +1 -1
  33. package/dist/commands/engage-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/llm-proxy.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pwd-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/use-command.js +1 -1
  50. package/dist/commands/workflow-command.js +1 -1
  51. package/dist/core/auth.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.d.ts +1 -0
  55. package/dist/core/global-context.d.ts.map +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/global-context.js.map +1 -1
  58. package/dist/core/keychain.js +1 -1
  59. package/dist/core/profile.js +1 -1
  60. package/dist/core/project-config.js +1 -1
  61. package/dist/core/session.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js +1 -1
  64. package/dist/proxy/server.d.ts.map +1 -1
  65. package/dist/proxy/server.js +1 -1
  66. package/dist/proxy/server.js.map +1 -1
  67. package/dist/proxy/session-cache.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/engage.js +1 -1
  70. package/dist/sdk/errors.js +1 -1
  71. package/dist/sdk/index.d.ts +10 -0
  72. package/dist/sdk/index.d.ts.map +1 -1
  73. package/dist/sdk/index.js +1 -1
  74. package/dist/sdk/index.js.map +1 -1
  75. package/dist/sdk/job.js +1 -1
  76. package/dist/sdk/llm.js +1 -1
  77. package/dist/sdk/query.js +1 -1
  78. package/dist/sdk/segment.js +1 -1
  79. package/dist/sdk/workflow.js +1 -1
  80. package/dist/types/endpoints.js +1 -1
  81. package/dist/types/index.js +1 -1
  82. package/dist/utils/agent-ref-parser.js +1 -1
  83. package/dist/utils/chat-cache.js +1 -1
  84. package/dist/utils/claude-usage-tracker.d.ts +124 -0
  85. package/dist/utils/claude-usage-tracker.d.ts.map +1 -0
  86. package/dist/utils/claude-usage-tracker.js +1 -0
  87. package/dist/utils/claude-usage-tracker.js.map +1 -0
  88. package/dist/utils/colors.js +1 -1
  89. package/dist/utils/command-output.js +1 -1
  90. package/dist/utils/constants.js +1 -1
  91. package/dist/utils/file-permissions.js +1 -1
  92. package/dist/utils/format-detector.js +1 -1
  93. package/dist/utils/formatters.js +1 -1
  94. package/dist/utils/json-loader.js +1 -1
  95. package/dist/utils/llm-backup-utils.js +1 -1
  96. package/dist/utils/model-aliases.js +1 -1
  97. package/dist/utils/model-factors.d.ts +52 -0
  98. package/dist/utils/model-factors.d.ts.map +1 -0
  99. package/dist/utils/model-factors.js +1 -0
  100. package/dist/utils/model-factors.js.map +1 -0
  101. package/dist/utils/option-validation.js +1 -1
  102. package/dist/utils/port.js +1 -1
  103. package/dist/utils/process.js +1 -1
  104. package/dist/utils/prompt.js +1 -1
  105. package/dist/utils/segment-path-parser.js +1 -1
  106. package/dist/utils/segment-ref-parser.js +1 -1
  107. package/dist/utils/spinner.js +1 -1
  108. package/dist/utils/sql-parser.js +1 -1
  109. package/dist/utils/sse-parser.js +1 -1
  110. package/dist/utils/string-utils.js +1 -1
  111. package/dist/utils/table-ref-parser.js +1 -1
  112. package/dist/utils/tdx-logger.js +1 -1
  113. package/dist/utils/tree-formatter.js +1 -1
  114. package/dist/utils/version-check.js +1 -1
  115. package/dist/utils/workflow-utils.js +1 -1
  116. package/package.json +1 -2
@@ -1 +1 @@
1
- const a20_0x349f6e=a20_0xcf30;(function(_0x252075,_0x3e4098){const _0xf3582=a20_0xcf30,_0x396cd4=_0x252075();while(!![]){try{const _0x523c1d=-parseInt(_0xf3582(0x217))/0x1*(parseInt(_0xf3582(0x25c))/0x2)+-parseInt(_0xf3582(0x250))/0x3*(parseInt(_0xf3582(0x1de))/0x4)+parseInt(_0xf3582(0x255))/0x5*(parseInt(_0xf3582(0x254))/0x6)+parseInt(_0xf3582(0x1e2))/0x7+parseInt(_0xf3582(0x1e1))/0x8+parseInt(_0xf3582(0x25d))/0x9+-parseInt(_0xf3582(0x1fd))/0xa;if(_0x523c1d===_0x3e4098)break;else _0x396cd4['push'](_0x396cd4['shift']());}catch(_0x549c17){_0x396cd4['push'](_0x396cd4['shift']());}}}(a20_0x8642,0xc6cd0));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a20_0x8642(){const _0x2a0ee1=['error','llm:project:delete','attributes','Usage:\x20tdx\x20llm\x20history\x20--last','name','Fetching\x20chat\x20history\x20for\x20\x27','getOrCreateDefaultProject','Error:\x20','counts','claude-4.5-haiku','Agent\x20deleted:\x20','Project\x20backed\x20up\x20to:\x20','Backup\x20cancelled.','Invalid\x20path\x20syntax:\x20','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Fetching\x20agent...','No\x20messages\x20found\x20in\x20chat\x20history.','execute','targetKnowledgeBase','outputDir','resolveAgentId','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','3154980IAlFlC','entries','toLowerCase','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','content','[image]\x20\x20','[input]\x20\x20','filter','json','llm:agent:create','Project\x20created:\x20','Restore\x20cancelled.','tsv','existsSync','description','backupProject','jsonl','\x20->\x20KB:','red','green','agent','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','[error]\x20\x20','Setting\x20project\x20context\x20to\x20\x27','Error:\x20Project\x20name\x20is\x20required','[unknown]','1175iGNWMW','yes','Getting\x20default\x20project...','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','llm:project:backup','bold','log','knowledgeBases','List\x20available\x20LLM\x20models','Delete\x20an\x20LLM\x20project','Creating\x20project\x20\x27','Show\x20agent\x20details','createdAt','targetWebSearchTool','Project\x20context\x20set\x20to:\x20','LLM_PROJECT_NOT_FOUND','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Fetching\x20projects...','projects','cyan','projectId','Updating\x20agent...','[tool]\x20\x20\x20','.llm','\x20->\x20WebSearch:','llm:project:restore','history','\x20bytes)','slice','prompt','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','chats','dim','verbose','targetAgent','temperature','[content]','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','\x20\x20Agents:\x20','Create\x20a\x20new\x20agent\x20in\x20current\x20project','stack','...','Backing\x20up\x20project\x20\x27','Validating\x20backup\x20from\x20\x27','integrations','Deleting\x20agent...','Resolving\x20project\x20\x27','format','map','No\x20chat\x20sessions\x20found.','updatedAt','Fetching\x20most\x20recent\x20chat...','output','tool_call','limit','blue','76821xpqbkl','Fetching\x20chat\x20sessions...','llm:project:create','input','6EbceFW','7695505jzQKED','Use\x20format:\x20project-name/agent-name','Create\x20a\x20new\x20LLM\x20project','restoreProject','agents','tool','\x20→\x20chat:\x20','460dLEBHh','3876930YlPRzs','starterMessage','\x20\x20Cause:\x20','Usage:\x20tdx\x20llm\x20use\x20<project-name>','stringify','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','createProject','Error:\x20Backup\x20folder\x20path\x20is\x20required','\x20-\x20','llm:agent:show','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','Creating\x20agent\x20\x27','Resolving\x20agent\x20\x27','cause','includes','llm:use','INVALID_ARGUMENT','keys','Set\x20current\x20project\x20context','targetImageGenerator','llm','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','[tool_call]','\x20->\x20Agent:','last','\x20\x20Knowledge\x20Bases:\x20','dryRun','llm:projects','\x20\x20Prompts:\x20','resolveProjectId','Project\x20restored:\x20','message','length','data','firstInputContent','exportedFrom','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','image','magenta','split','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Fetching\x20available\x20models...','Fetching\x20agents...','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','models','Delete\x20an\x20agent','232cSfaFm','\x20\x20Integrations:\x20','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','6039968wWcLSf','1122625jeKrvz','\x27...','projectName','List\x20all\x20LLM\x20projects','Output\x20directory\x20\x27'];a20_0x8642=function(){return _0x2a0ee1;};return a20_0x8642();}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';import{confirm}from'../utils/prompt.js';import*as a20_0x2b576a from'node:fs';function handleSDKError(_0x5dc8b1,_0x24d991){const _0x5a52c7=a20_0xcf30;if(_0x5dc8b1 instanceof SDKError)console[_0x5a52c7(0x1e7)](_0x5a52c7(0x1ee)+_0x5dc8b1[_0x5a52c7(0x27c)]),_0x24d991[_0x5a52c7(0x239)]&&(_0x5dc8b1[_0x5a52c7(0x26a)]&&console['error'](_0x5a52c7(0x25f)+_0x5dc8b1[_0x5a52c7(0x26a)]),_0x5dc8b1[_0x5a52c7(0x240)]&&(console[_0x5a52c7(0x1e7)]('\x0aStack\x20trace:'),console[_0x5a52c7(0x1e7)](_0x5dc8b1[_0x5a52c7(0x240)])));else throw _0x5dc8b1;}function formatChatHistoryEntry(_0x5b2b54,_0x363de5){const _0x2767bd=a20_0xcf30,_0x35873a=getChalk(_0x363de5),_0x25b9f3=_0x35873a['dim'](_0x5b2b54['at']);if(_0x2767bd(0x253)in _0x5b2b54){const _0x268a4c=_0x35873a[_0x2767bd(0x22a)](_0x2767bd(0x203));return _0x25b9f3+'\x20'+_0x268a4c+':\x20'+_0x5b2b54[_0x2767bd(0x253)];}if(_0x2767bd(0x201)in _0x5b2b54){const _0x3800c9=_0x35873a[_0x2767bd(0x210)](_0x2767bd(0x23c));return _0x25b9f3+'\x20'+_0x3800c9+':\x20'+_0x5b2b54[_0x2767bd(0x201)];}if('tool_call'in _0x5b2b54){const _0x35e9ea=_0x35873a['yellow'](_0x2767bd(0x273)),{functionName:_0x34391e,functionArguments:_0x3949e4,targetFunction:_0x11e613}=_0x5b2b54[_0x2767bd(0x24d)];let _0x3ec6b1=_0x25b9f3+'\x20'+_0x35e9ea+':\x20'+_0x35873a['bold'](_0x34391e);if(_0x3949e4&&Object[_0x2767bd(0x26e)](_0x3949e4)['length']>0x0){const _0x53dd37=Object[_0x2767bd(0x1fe)](_0x3949e4)[_0x2767bd(0x248)](([_0x5481af,_0x10cf36])=>_0x5481af+'='+JSON['stringify'](_0x10cf36))['join'](',\x20');_0x3ec6b1+='('+_0x53dd37+')';}_0x11e613&&(_0x3ec6b1+=_0x35873a[_0x2767bd(0x238)]('\x20['+_0x11e613+']'));let _0x3f303e='';if(_0x5b2b54['tool_call'][_0x2767bd(0x1f9)])_0x3f303e=_0x2767bd(0x20e)+_0x5b2b54[_0x2767bd(0x24d)][_0x2767bd(0x1f9)][_0x2767bd(0x1eb)];else{if(_0x5b2b54[_0x2767bd(0x24d)][_0x2767bd(0x23a)])_0x3f303e=_0x2767bd(0x274)+_0x5b2b54['tool_call']['targetAgent']['name'];else{if(_0x5b2b54[_0x2767bd(0x24d)]['targetWebSearchTool'])_0x3f303e=_0x2767bd(0x22f)+_0x5b2b54[_0x2767bd(0x24d)][_0x2767bd(0x224)]['name'];else _0x5b2b54[_0x2767bd(0x24d)]['targetImageGenerator']&&(_0x3f303e='\x20->\x20ImageGen:'+_0x5b2b54[_0x2767bd(0x24d)][_0x2767bd(0x270)][_0x2767bd(0x1eb)]);}}return _0x3ec6b1+_0x3f303e;}if(_0x2767bd(0x25a)in _0x5b2b54){const _0x3703ab=_0x35873a[_0x2767bd(0x1d6)](_0x2767bd(0x22d)),{functionName:_0xbd8763,functionArguments:_0x26f9d8,content:_0x11a0f4,newChat:_0x4975b0}=_0x5b2b54[_0x2767bd(0x25a)];let _0xc80a25=_0x25b9f3+'\x20'+_0x3703ab+':\x20'+_0x35873a[_0x2767bd(0x21c)](_0xbd8763);if(_0x26f9d8){const _0x5b1052=typeof _0x26f9d8==='string'?_0x26f9d8:JSON[_0x2767bd(0x261)](_0x26f9d8);_0xc80a25+='('+_0x5b1052+')';}return _0x11a0f4&&(_0xc80a25+='\x0a'+_0x35873a['dim'](_0x11a0f4)),_0x4975b0&&(_0xc80a25+=_0x35873a[_0x2767bd(0x238)](_0x2767bd(0x25b)+_0x4975b0['id'])),_0xc80a25;}if(_0x2767bd(0x24c)in _0x5b2b54){const _0x20e050=_0x35873a[_0x2767bd(0x24f)]('[output]\x20');return _0x25b9f3+'\x20'+_0x20e050+':\x20'+_0x5b2b54['output'][_0x2767bd(0x1eb)]+'\x20('+_0x5b2b54['output'][_0x2767bd(0x201)]['length']+_0x2767bd(0x232);}if(_0x2767bd(0x1d5)in _0x5b2b54){const _0x11a406=_0x35873a['blue'](_0x2767bd(0x202)),{width:_0x16af97,height:_0x1a25de,headerText:_0x101edd}=_0x5b2b54['image'],_0x22e00e=_0x101edd?_0x2767bd(0x265)+_0x101edd:'';return _0x25b9f3+'\x20'+_0x11a406+':\x20'+_0x16af97+'x'+_0x1a25de+_0x22e00e;}if(_0x2767bd(0x1e7)in _0x5b2b54){const _0x2f5eaf=_0x35873a[_0x2767bd(0x20f)](_0x2767bd(0x213));return _0x25b9f3+'\x20'+_0x2f5eaf+':\x20'+_0x5b2b54[_0x2767bd(0x1e7)];}return _0x25b9f3+'\x20'+_0x35873a[_0x2767bd(0x238)](_0x2767bd(0x216))+':\x20'+JSON['stringify'](_0x5b2b54);}async function getProjectIdOrDefault(_0x5bc704){const _0x24d667=a20_0xcf30,{tdx:_0x5d709a,options:_0x20beab}=_0x5bc704,_0x31cca0=_0x20beab['llmProject'];if(_0x31cca0){const _0x1ca88f=await withSpinner(_0x24d667(0x246)+_0x31cca0+_0x24d667(0x1e3),()=>_0x5d709a['llm'][_0x24d667(0x27a)](_0x31cca0),{'verbose':_0x20beab[_0x24d667(0x239)]});return _0x1ca88f[_0x24d667(0x27e)];}let _0x461427=_0x5d709a[_0x24d667(0x271)]['getCurrentProject']();if(_0x461427)return _0x461427;const _0x35563a=await withSpinner(_0x24d667(0x219),()=>_0x5d709a[_0x24d667(0x271)][_0x24d667(0x1ed)](),{'verbose':_0x20beab[_0x24d667(0x239)]});return _0x35563a[_0x24d667(0x27e)]['id'];}function toLLMProjectInfo(_0x1d4065){const _0x38787e=a20_0xcf30;return{'name':_0x1d4065[_0x38787e(0x1e9)][_0x38787e(0x1eb)],'description':_0x1d4065[_0x38787e(0x1e9)][_0x38787e(0x20b)],'createdAt':_0x1d4065['attributes']['createdAt'],'updatedAt':_0x1d4065['attributes'][_0x38787e(0x24a)]};}function toAgentInfo(_0x19f840){const _0x3e0cb9=a20_0xcf30;return{'name':_0x19f840[_0x3e0cb9(0x1e9)]['name'],'description':_0x19f840['attributes'][_0x3e0cb9(0x20b)],'prompt':truncatePrompt(_0x19f840[_0x3e0cb9(0x1e9)][_0x3e0cb9(0x234)]),'createdAt':_0x19f840[_0x3e0cb9(0x1e9)][_0x3e0cb9(0x223)],'updatedAt':_0x19f840[_0x3e0cb9(0x1e9)]['updatedAt']};}function truncatePrompt(_0x5bee32){const _0x3d234f=a20_0xcf30;if(!_0x5bee32)return undefined;const _0x4190fa=0x64;if(_0x5bee32[_0x3d234f(0x27d)]<=_0x4190fa)return _0x5bee32;return _0x5bee32[_0x3d234f(0x233)](0x0,_0x4190fa)+_0x3d234f(0x241);}export class LLMModelsCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]='llm:models';[a20_0x349f6e(0x20b)]=a20_0x349f6e(0x21f);async['execute'](_0x401afb){const _0x2f1ea1=a20_0x349f6e,{options:_0x22e66f,tdx:_0x55910a}=_0x401afb;try{const _0x5a7075=await withSpinner(_0x2f1ea1(0x1d9),()=>_0x55910a['llm'][_0x2f1ea1(0x1dc)](),{'verbose':_0x22e66f['verbose']});return await handleSDKOutput(_0x5a7075[_0x2f1ea1(0x27e)],_0x22e66f),0x0;}catch(_0x964454){return handleSDKError(_0x964454,_0x22e66f),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a20_0x349f6e(0x278);[a20_0x349f6e(0x20b)]=a20_0x349f6e(0x1e5);async[a20_0x349f6e(0x1f8)](_0x3a5199){const _0x5531ca=a20_0x349f6e,{options:_0x4e3f28,args:_0x263b28,tdx:_0xdf75db}=_0x3a5199;try{const _0x297fc6=_0x263b28[0x0],_0x4eeb05=resolveLimit(_0x4e3f28[_0x5531ca(0x24e)],DEFAULT_LLM_LIMIT),_0x1a9385=await withSpinner(_0x5531ca(0x228),()=>_0xdf75db[_0x5531ca(0x271)]['projects'](_0x4eeb05),{'verbose':_0x4e3f28['verbose']});let _0x2f57fa=_0x1a9385[_0x5531ca(0x27e)];_0x297fc6&&(_0x2f57fa=_0x1a9385[_0x5531ca(0x27e)]['filter'](_0x848641=>matchGlobPattern(_0x848641[_0x5531ca(0x1e9)][_0x5531ca(0x1eb)],_0x297fc6)));const _0x395344=_0x2f57fa[_0x5531ca(0x248)](toLLMProjectInfo);return await handleSDKOutput(_0x395344,_0x4e3f28),0x0;}catch(_0x2b99cf){return handleSDKError(_0x2b99cf,_0x4e3f28),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]='llm:agents';[a20_0x349f6e(0x20b)]='List\x20agents\x20in\x20current\x20project';async['execute'](_0x1bf03f){const _0x4895c6=a20_0x349f6e,{options:_0x50e706,args:_0x14422a,tdx:_0x2b3728}=_0x1bf03f;try{const _0x5dc507=_0x14422a[0x0];let _0x57c0bd,_0x2f0fb3=_0x5dc507;if(_0x5dc507&&_0x5dc507[_0x4895c6(0x26b)]('/')){const _0x2cde19=_0x5dc507[_0x4895c6(0x1d7)]('/');if(_0x2cde19[_0x4895c6(0x27d)]===0x2){const [_0x4c6434,_0x41d8b1]=_0x2cde19,_0x58c617=await _0x2b3728[_0x4895c6(0x271)][_0x4895c6(0x229)](),_0x5cd820=_0x58c617['find'](_0x144726=>_0x144726[_0x4895c6(0x1e9)]['name'][_0x4895c6(0x1ff)]()===_0x4c6434[_0x4895c6(0x1ff)]());if(!_0x5cd820)throw new SDKError(ErrorCode[_0x4895c6(0x226)],'Project\x20not\x20found:\x20'+_0x4c6434,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0x57c0bd=_0x5cd820['id'],_0x2f0fb3=_0x41d8b1;}else throw new SDKError(ErrorCode[_0x4895c6(0x26d)],_0x4895c6(0x1f4)+_0x5dc507,undefined,{'helpText':_0x4895c6(0x256)});}else _0x57c0bd=await getProjectIdOrDefault(_0x1bf03f);const _0x41c5f4=await withSpinner(_0x4895c6(0x1da),()=>_0x2b3728[_0x4895c6(0x271)][_0x4895c6(0x259)](_0x57c0bd),{'verbose':_0x50e706[_0x4895c6(0x239)]});let _0x5d6816=_0x41c5f4[_0x4895c6(0x27e)];_0x2f0fb3&&(_0x5d6816=_0x41c5f4[_0x4895c6(0x27e)][_0x4895c6(0x204)](_0x30d76b=>matchGlobPattern(_0x30d76b[_0x4895c6(0x1e9)][_0x4895c6(0x1eb)],_0x2f0fb3)));const _0x1f5141=_0x5d6816[_0x4895c6(0x248)](toAgentInfo);return await handleSDKOutput(_0x1f5141,_0x50e706),0x0;}catch(_0x328a46){return handleSDKError(_0x328a46,_0x50e706),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]=a20_0x349f6e(0x266);['description']=a20_0x349f6e(0x222);async[a20_0x349f6e(0x1f8)](_0x22eb65){const _0x452b5e=a20_0x349f6e,{options:_0x18b511,args:_0x39b33e,tdx:_0x5574f4}=_0x22eb65;if(_0x39b33e['length']===0x0)return console[_0x452b5e(0x1e7)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x452b5e(0x1fc)),0x1;const _0x289895=_0x39b33e[0x0];try{const _0x52e65a=await getProjectIdOrDefault(_0x22eb65),_0x39339b=await withSpinner(_0x452b5e(0x269)+_0x289895+_0x452b5e(0x1e3),()=>_0x5574f4[_0x452b5e(0x271)][_0x452b5e(0x1fb)](_0x289895,_0x52e65a),{'verbose':_0x18b511[_0x452b5e(0x239)]}),_0x1f8ffa=await withSpinner(_0x452b5e(0x1f6),()=>_0x5574f4[_0x452b5e(0x271)][_0x452b5e(0x211)](_0x39339b[_0x452b5e(0x27e)]),{'verbose':_0x18b511[_0x452b5e(0x239)]});return await handleSDKOutput([_0x1f8ffa['data']],_0x18b511),0x0;}catch(_0x5bff19){return handleSDKError(_0x5bff19,_0x18b511),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]=a20_0x349f6e(0x206);[a20_0x349f6e(0x20b)]=a20_0x349f6e(0x23f);async[a20_0x349f6e(0x1f8)](_0x3185e4){const _0x339fb4=a20_0x349f6e,{options:_0x58c44e,args:_0x460483,tdx:_0x4fd89e}=_0x3185e4;if(_0x460483['length']===0x0)return console[_0x339fb4(0x1e7)]('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x339fb4(0x1db)),console[_0x339fb4(0x1e7)](_0x339fb4(0x235)),0x1;const _0x21c5a6=_0x460483[0x0],_0x220956=_0x58c44e,_0x7e9429=_0x220956['systemPrompt'],_0x57b44f=_0x220956['model']||_0x339fb4(0x1f0),_0x7e1438=_0x220956[_0x339fb4(0x25e)],_0x2f9c4b=_0x220956['maxToolIterations']?Number(_0x220956['maxToolIterations']):undefined,_0x5318b2=_0x220956['temperature']?Number(_0x220956[_0x339fb4(0x23b)]):undefined;try{let _0x2f880f,_0x5100ef;if(_0x21c5a6[_0x339fb4(0x26b)]('/')){const _0x234aa4=_0x21c5a6['split']('/');if(_0x234aa4[_0x339fb4(0x27d)]===0x2){const [_0xa4ec66,_0x8d570]=_0x234aa4,_0x571ec9=await withSpinner('Resolving\x20project\x20\x27'+_0xa4ec66+'\x27...',()=>_0x4fd89e[_0x339fb4(0x271)]['resolveProjectId'](_0xa4ec66),{'verbose':_0x58c44e['verbose']});_0x2f880f=_0x571ec9[_0x339fb4(0x27e)],_0x5100ef=_0x8d570;}else throw new SDKError(ErrorCode[_0x339fb4(0x26d)],_0x339fb4(0x1f4)+_0x21c5a6,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x2f880f=await getProjectIdOrDefault(_0x3185e4),_0x5100ef=_0x21c5a6;const _0x2de410=await withSpinner(_0x339fb4(0x268)+_0x5100ef+_0x339fb4(0x1e3),()=>_0x4fd89e[_0x339fb4(0x271)]['createAgent']({'name':_0x5100ef,'projectId':_0x2f880f,'modelType':_0x57b44f,'systemPrompt':_0x7e9429,'starterMessage':_0x7e1438,'maxToolIterations':_0x2f9c4b,'temperature':_0x5318b2}),{'verbose':_0x58c44e[_0x339fb4(0x239)]});return console[_0x339fb4(0x21d)]('Agent\x20created:\x20'+_0x2de410[_0x339fb4(0x27e)]['id']),await handleSDKOutput([_0x2de410['data']],_0x58c44e),0x0;}catch(_0x38ded2){return handleSDKError(_0x38ded2,_0x58c44e),0x1;}}}function a20_0xcf30(_0x33251c,_0x5c8e73){const _0x86425=a20_0x8642();return a20_0xcf30=function(_0xcf3068,_0x1d655a){_0xcf3068=_0xcf3068-0x1d2;let _0x5e7474=_0x86425[_0xcf3068];return _0x5e7474;},a20_0xcf30(_0x33251c,_0x5c8e73);}export class LLMAgentUpdateCommand extends BaseCommand{['name']='llm:agent:update';[a20_0x349f6e(0x20b)]='Update\x20an\x20existing\x20agent';async[a20_0x349f6e(0x1f8)](_0x1d7688){const _0x5482ae=a20_0x349f6e,{options:_0x368d19,args:_0x287a33,tdx:_0xaaef24}=_0x1d7688;if(_0x287a33[_0x5482ae(0x27d)]===0x0)return console[_0x5482ae(0x1e7)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x5482ae(0x1e7)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x2e62ce=_0x287a33[0x0],_0x5483e1=_0x368d19,_0x1f6e1b=_0x5483e1['name'],_0x5b1c16=_0x5483e1['prompt'],_0x13c8b9=_0x5483e1[_0x5482ae(0x20b)],_0x26492d=_0x5483e1['starterMessage'];if(!_0x1f6e1b&&!_0x5b1c16&&!_0x13c8b9&&!_0x26492d)return console[_0x5482ae(0x1e7)](_0x5482ae(0x23d)),console[_0x5482ae(0x1e7)](_0x5482ae(0x200)),0x1;try{const _0x3384dd=await getProjectIdOrDefault(_0x1d7688),_0x2f16b4=await withSpinner('Resolving\x20agent\x20\x27'+_0x2e62ce+_0x5482ae(0x1e3),()=>_0xaaef24['llm'][_0x5482ae(0x1fb)](_0x2e62ce,_0x3384dd),{'verbose':_0x368d19[_0x5482ae(0x239)]}),_0x3de0f2=_0x2f16b4[_0x5482ae(0x27e)],_0x52e356=await withSpinner(_0x5482ae(0x22c),()=>_0xaaef24['llm']['updateAgent'](_0x3de0f2,{'name':_0x1f6e1b,'prompt':_0x5b1c16,'description':_0x13c8b9,'starterMessage':_0x26492d}),{'verbose':_0x368d19[_0x5482ae(0x239)]});return console['log']('Agent\x20updated:\x20'+_0x52e356[_0x5482ae(0x27e)]['id']),await handleSDKOutput([_0x52e356[_0x5482ae(0x27e)]],_0x368d19),0x0;}catch(_0x4ba186){return handleSDKError(_0x4ba186,_0x368d19),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]='llm:agent:delete';['description']=a20_0x349f6e(0x1dd);async[a20_0x349f6e(0x1f8)](_0x2e7c96){const _0x451a0d=a20_0x349f6e,{options:_0x46ec8e,args:_0x29ee9c,tdx:_0xac05a8}=_0x2e7c96;if(_0x29ee9c['length']===0x0)return console[_0x451a0d(0x1e7)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x451a0d(0x1e7)](_0x451a0d(0x212)),0x1;const _0x4a74fe=_0x29ee9c[0x0];try{const _0x2ce1af=await getProjectIdOrDefault(_0x2e7c96),_0x4c09de=await withSpinner(_0x451a0d(0x269)+_0x4a74fe+'\x27...',()=>_0xac05a8[_0x451a0d(0x271)][_0x451a0d(0x1fb)](_0x4a74fe,_0x2ce1af),{'verbose':_0x46ec8e[_0x451a0d(0x239)]}),_0x3d80b7=_0x4c09de[_0x451a0d(0x27e)];return await withSpinner(_0x451a0d(0x245),()=>_0xac05a8[_0x451a0d(0x271)]['deleteAgent'](_0x3d80b7),{'verbose':_0x46ec8e[_0x451a0d(0x239)]}),console['log'](_0x451a0d(0x1f1)+_0x3d80b7),0x0;}catch(_0x45bf9b){return handleSDKError(_0x45bf9b,_0x46ec8e),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]='llm:history';[a20_0x349f6e(0x20b)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async[a20_0x349f6e(0x1f8)](_0x5cec14){const _0x5f3e7e=a20_0x349f6e,{options:_0x528414,args:_0x125e3b,tdx:_0xf0ad81}=_0x5cec14;let _0x387783=_0x125e3b[0x0];const _0x226c74=_0x528414,_0x4d6efa=_0x226c74[_0x5f3e7e(0x275)];try{if(_0x4d6efa){if(_0x387783)return console[_0x5f3e7e(0x1e7)](_0x5f3e7e(0x1f5)),console[_0x5f3e7e(0x1e7)](_0x5f3e7e(0x1ea)),0x1;const _0xe8dc6e=await withSpinner(_0x5f3e7e(0x24b),()=>_0xf0ad81['llm']['chats'](0x1),{'verbose':_0x528414[_0x5f3e7e(0x239)]});if(_0xe8dc6e['data']['length']===0x0)return console[_0x5f3e7e(0x21d)](_0x5f3e7e(0x249)),0x0;_0x387783=_0xe8dc6e[_0x5f3e7e(0x27e)][0x0]['id'];}if(!_0x387783){const _0x2de90f=resolveLimit(_0x528414[_0x5f3e7e(0x24e)],DEFAULT_LLM_LIMIT),_0xbba1e6=await withSpinner(_0x5f3e7e(0x251),()=>_0xf0ad81['llm'][_0x5f3e7e(0x237)](_0x2de90f),{'verbose':_0x528414[_0x5f3e7e(0x239)]});if(_0x528414[_0x5f3e7e(0x247)]===_0x5f3e7e(0x205)||_0x528414['format']==='jsonl')await handleSDKOutput(_0xbba1e6['data'],_0x528414);else{const _0x16cf99=_0xbba1e6[_0x5f3e7e(0x27e)][_0x5f3e7e(0x248)](_0x3814e9=>({'created_at':_0x3814e9['attributes'][_0x5f3e7e(0x223)],'chat_id':_0x3814e9['id'],'first_input':_0x3814e9[_0x5f3e7e(0x1e9)][_0x5f3e7e(0x1d2)]||'(no\x20message)'}));await handleSDKOutput(_0x16cf99,_0x528414);}return 0x0;}else{const _0x3050f6=await withSpinner(_0x5f3e7e(0x1ec)+_0x387783+_0x5f3e7e(0x1e3),()=>_0xf0ad81[_0x5f3e7e(0x271)][_0x5f3e7e(0x231)](_0x387783),{'verbose':_0x528414['verbose']}),_0x2562bf=_0x3050f6[_0x5f3e7e(0x27e)]['data']??[];if(_0x2562bf[_0x5f3e7e(0x27d)]===0x0)return console[_0x5f3e7e(0x21d)](_0x5f3e7e(0x1f7)),0x0;if(_0x528414[_0x5f3e7e(0x247)]===_0x5f3e7e(0x205)||_0x528414[_0x5f3e7e(0x247)]===_0x5f3e7e(0x20d)||_0x528414[_0x5f3e7e(0x247)]==='table'||_0x528414[_0x5f3e7e(0x247)]===_0x5f3e7e(0x209))await handleSDKOutput(_0x2562bf,_0x528414);else for(const _0x410d0c of _0x2562bf){console['log'](formatChatHistoryEntry(_0x410d0c,_0x528414));}return 0x0;}}catch(_0xf3791b){return handleSDKError(_0xf3791b,_0x528414),0x1;}}}export class LLMUseCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]=a20_0x349f6e(0x26c);['description']=a20_0x349f6e(0x26f);async[a20_0x349f6e(0x1f8)](_0xa8ee6d){const _0xd8ea7b=a20_0x349f6e,{options:_0x10f9d4,args:_0x2add66,tdx:_0x6f8aeb}=_0xa8ee6d;if(_0x2add66[_0xd8ea7b(0x27d)]===0x0)return console['error'](_0xd8ea7b(0x215)),console[_0xd8ea7b(0x1e7)](_0xd8ea7b(0x260)),0x1;const _0x566c40=_0x2add66[0x0];try{return await withSpinner(_0xd8ea7b(0x214)+_0x566c40+_0xd8ea7b(0x1e3),()=>_0x6f8aeb['llm']['setCurrentProject'](_0x566c40),{'verbose':_0x10f9d4[_0xd8ea7b(0x239)]}),console[_0xd8ea7b(0x21d)](_0xd8ea7b(0x225)+_0x566c40),0x0;}catch(_0x3ba90a){return handleSDKError(_0x3ba90a,_0x10f9d4),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a20_0x349f6e(0x252);[a20_0x349f6e(0x20b)]=a20_0x349f6e(0x257);async[a20_0x349f6e(0x1f8)](_0x5a602f){const _0x54d374=a20_0x349f6e,{options:_0x1b9f67,args:_0x3c89b4,tdx:_0x1100be}=_0x5a602f;if(_0x3c89b4[_0x54d374(0x27d)]===0x0)return console[_0x54d374(0x1e7)](_0x54d374(0x215)),console[_0x54d374(0x1e7)](_0x54d374(0x1d8)),0x1;const _0x49271b=_0x3c89b4[0x0],_0x113b87=_0x1b9f67,_0xc7329a=_0x113b87[_0x54d374(0x20b)];try{const _0x5cbb15=await withSpinner(_0x54d374(0x221)+_0x49271b+_0x54d374(0x1e3),()=>_0x1100be['llm'][_0x54d374(0x263)]({'name':_0x49271b,'description':_0xc7329a}),{'verbose':_0x1b9f67['verbose']});console[_0x54d374(0x21d)](_0x54d374(0x207)+_0x5cbb15[_0x54d374(0x27e)]['id']);const _0x2479b1=toLLMProjectInfo(_0x5cbb15[_0x54d374(0x27e)]);return await handleSDKOutput([_0x2479b1],_0x1b9f67),0x0;}catch(_0x44ecd5){return handleSDKError(_0x44ecd5,_0x1b9f67),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]=a20_0x349f6e(0x1e8);['description']=a20_0x349f6e(0x220);async['execute'](_0x228455){const _0x123b57=a20_0x349f6e,{options:_0x62614a,args:_0x28cf6e,tdx:_0x1af486}=_0x228455;if(_0x28cf6e['length']===0x0)return console[_0x123b57(0x1e7)](_0x123b57(0x215)),console[_0x123b57(0x1e7)](_0x123b57(0x21a)),0x1;const _0x4b38a1=_0x28cf6e[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x4b38a1+'\x27...',()=>_0x1af486[_0x123b57(0x271)]['deleteProject'](_0x4b38a1),{'verbose':_0x62614a[_0x123b57(0x239)]}),console['log']('Project\x20deleted:\x20'+_0x4b38a1),0x0;}catch(_0x562282){return handleSDKError(_0x562282,_0x62614a),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]=a20_0x349f6e(0x21b);['description']=a20_0x349f6e(0x1e0);async[a20_0x349f6e(0x1f8)](_0x3c0f7e){const _0x4e6fa8=a20_0x349f6e,{options:_0x45b790,args:_0x4b08cc,tdx:_0x38d3bb}=_0x3c0f7e;if(_0x4b08cc[_0x4e6fa8(0x27d)]===0x0)return console[_0x4e6fa8(0x1e7)](_0x4e6fa8(0x215)),console[_0x4e6fa8(0x1e7)](_0x4e6fa8(0x1d4)),0x1;const _0x2a47e3=_0x4b08cc[0x0],_0x4cf843=_0x45b790,_0x57b5f9=_0x4cf843[_0x4e6fa8(0x24c)],_0x13c64e=_0x4cf843[_0x4e6fa8(0x277)];try{const _0x5115d9=_0x57b5f9||_0x2a47e3+_0x4e6fa8(0x22e);if(a20_0x2b576a[_0x4e6fa8(0x20a)](_0x5115d9)&&!_0x13c64e){if(!_0x45b790[_0x4e6fa8(0x218)]){const _0x28ffa7=await confirm(_0x4e6fa8(0x1e6)+_0x5115d9+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x28ffa7)return console[_0x4e6fa8(0x21d)](_0x4e6fa8(0x1f3)),0x0;}a20_0x2b576a['rmSync'](_0x5115d9,{'recursive':!![]});}const _0x28418a=await withSpinner(_0x13c64e?'Analyzing\x20project\x20\x27'+_0x2a47e3+'\x27...':_0x4e6fa8(0x242)+_0x2a47e3+_0x4e6fa8(0x1e3),()=>_0x38d3bb[_0x4e6fa8(0x271)][_0x4e6fa8(0x20c)](_0x2a47e3,_0x57b5f9,{'dryRun':_0x13c64e}),{'verbose':_0x45b790[_0x4e6fa8(0x239)]}),_0x4534f5=_0x28418a[_0x4e6fa8(0x27e)];return _0x13c64e?console['log'](_0x4e6fa8(0x272)+_0x4534f5[_0x4e6fa8(0x1fa)]):console[_0x4e6fa8(0x21d)](_0x4e6fa8(0x1f2)+_0x4534f5[_0x4e6fa8(0x1fa)]),console[_0x4e6fa8(0x21d)](_0x4e6fa8(0x23e)+_0x4534f5[_0x4e6fa8(0x1ef)][_0x4e6fa8(0x259)]),console['log'](_0x4e6fa8(0x276)+_0x4534f5['counts'][_0x4e6fa8(0x21e)]),console[_0x4e6fa8(0x21d)](_0x4e6fa8(0x279)+_0x4534f5[_0x4e6fa8(0x1ef)]['prompts']),console[_0x4e6fa8(0x21d)](_0x4e6fa8(0x1df)+_0x4534f5['counts'][_0x4e6fa8(0x244)]),(_0x45b790[_0x4e6fa8(0x247)]===_0x4e6fa8(0x205)||_0x45b790[_0x4e6fa8(0x247)]===_0x4e6fa8(0x20d))&&await handleSDKOutput([_0x4534f5],_0x45b790),0x0;}catch(_0x512cfe){return handleSDKError(_0x512cfe,_0x45b790),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x349f6e(0x1eb)]=a20_0x349f6e(0x230);[a20_0x349f6e(0x20b)]=a20_0x349f6e(0x267);async[a20_0x349f6e(0x1f8)](_0x46d236){const _0x5106e9=a20_0x349f6e,{options:_0x2bda6b,args:_0x3ce348,tdx:_0x278f7b}=_0x46d236;if(_0x3ce348[_0x5106e9(0x27d)]===0x0)return console[_0x5106e9(0x1e7)](_0x5106e9(0x264)),console[_0x5106e9(0x1e7)](_0x5106e9(0x227)),0x1;const _0x1916ed=_0x3ce348[0x0],_0x5e5865=_0x2bda6b,_0x2bc43e=_0x5e5865['name'],_0x1f0c96=_0x5e5865[_0x5106e9(0x277)];try{if(!_0x1f0c96){const _0xf202d9=_0x278f7b[_0x5106e9(0x271)]['getBackupMetadata'](_0x1916ed),_0x169d76=_0x2bc43e||_0xf202d9[_0x5106e9(0x1d3)][_0x5106e9(0x1e4)],_0x4314bf=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x278f7b[_0x5106e9(0x271)][_0x5106e9(0x229)](),{'verbose':_0x2bda6b[_0x5106e9(0x239)]}),_0x2be652=_0x4314bf[_0x5106e9(0x27e)]['find'](_0x3af779=>_0x3af779[_0x5106e9(0x1e9)][_0x5106e9(0x1eb)]===_0x169d76);if(_0x2be652&&!_0x2bda6b['yes']){const _0x193d24=await confirm('A\x20project\x20named\x20\x27'+_0x169d76+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x193d24)return console[_0x5106e9(0x21d)](_0x5106e9(0x208)),0x0;}}const _0xa9ce68=await withSpinner(_0x1f0c96?_0x5106e9(0x243)+_0x1916ed+_0x5106e9(0x1e3):'Restoring\x20project\x20from\x20\x27'+_0x1916ed+_0x5106e9(0x1e3),()=>_0x278f7b[_0x5106e9(0x271)][_0x5106e9(0x258)](_0x1916ed,{'name':_0x2bc43e,'dryRun':_0x1f0c96}),{'verbose':_0x2bda6b['verbose']}),_0x3820c0=_0xa9ce68[_0x5106e9(0x27e)];return _0x3820c0['sourceSite']&&console[_0x5106e9(0x21d)](_0x5106e9(0x262)+_0x3820c0['sourceSite']+'\x27'),_0x1f0c96?console['log'](_0x5106e9(0x236)+_0x3820c0['projectName']):console[_0x5106e9(0x21d)](_0x5106e9(0x27b)+_0x3820c0[_0x5106e9(0x1e4)]+'\x20('+_0x3820c0[_0x5106e9(0x22b)]+')'),console['log']('\x20\x20Agents:\x20'+_0x3820c0[_0x5106e9(0x1ef)][_0x5106e9(0x259)]),console[_0x5106e9(0x21d)](_0x5106e9(0x276)+_0x3820c0[_0x5106e9(0x1ef)][_0x5106e9(0x21e)]),console['log'](_0x5106e9(0x279)+_0x3820c0[_0x5106e9(0x1ef)]['prompts']),console['log'](_0x5106e9(0x1df)+_0x3820c0[_0x5106e9(0x1ef)]['integrations']),(_0x2bda6b['format']===_0x5106e9(0x205)||_0x2bda6b[_0x5106e9(0x247)]===_0x5106e9(0x20d))&&await handleSDKOutput([_0x3820c0],_0x2bda6b),0x0;}catch(_0x18e155){return handleSDKError(_0x18e155,_0x2bda6b),0x1;}}}
1
+ const a22_0x160052=a22_0x113d;(function(_0x223563,_0x2d6e4b){const _0x2453dc=a22_0x113d,_0x544226=_0x223563();while(!![]){try{const _0x3244bf=parseInt(_0x2453dc(0x1ea))/0x1+parseInt(_0x2453dc(0x254))/0x2+parseInt(_0x2453dc(0x216))/0x3+-parseInt(_0x2453dc(0x1c4))/0x4+parseInt(_0x2453dc(0x1e0))/0x5*(-parseInt(_0x2453dc(0x1d5))/0x6)+parseInt(_0x2453dc(0x1c6))/0x7+parseInt(_0x2453dc(0x202))/0x8*(parseInt(_0x2453dc(0x1b7))/0x9);if(_0x3244bf===_0x2d6e4b)break;else _0x544226['push'](_0x544226['shift']());}catch(_0xf25e6f){_0x544226['push'](_0x544226['shift']());}}}(a22_0xeb31,0xc370f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a22_0x113d(_0x9ef743,_0x236bf9){const _0xeb3199=a22_0xeb31();return a22_0x113d=function(_0x113dd9,_0x4bf981){_0x113dd9=_0x113dd9-0x1af;let _0x253c18=_0xeb3199[_0x113dd9];return _0x253c18;},a22_0x113d(_0x9ef743,_0x236bf9);}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';import{confirm}from'../utils/prompt.js';import*as a22_0x42121b from'node:fs';function handleSDKError(_0x4623c0,_0x1d26d8){const _0x4fb243=a22_0x113d;if(_0x4623c0 instanceof SDKError)console[_0x4fb243(0x205)](_0x4fb243(0x1b6)+_0x4623c0[_0x4fb243(0x220)]),_0x1d26d8['verbose']&&(_0x4623c0['cause']&&console[_0x4fb243(0x205)](_0x4fb243(0x209)+_0x4623c0[_0x4fb243(0x1cb)]),_0x4623c0['stack']&&(console[_0x4fb243(0x205)](_0x4fb243(0x24b)),console[_0x4fb243(0x205)](_0x4623c0[_0x4fb243(0x227)])));else throw _0x4623c0;}function formatChatHistoryEntry(_0x443a6f,_0x49dc08){const _0x4fec5d=a22_0x113d,_0x344465=getChalk(_0x49dc08),_0x10a495=_0x344465[_0x4fec5d(0x1be)](_0x443a6f['at']);if(_0x4fec5d(0x213)in _0x443a6f){const _0x26ca2c=_0x344465[_0x4fec5d(0x252)](_0x4fec5d(0x1ba));return _0x10a495+'\x20'+_0x26ca2c+':\x20'+_0x443a6f['input'];}if('content'in _0x443a6f){const _0x4f6c05=_0x344465['green'](_0x4fec5d(0x223));return _0x10a495+'\x20'+_0x4f6c05+':\x20'+_0x443a6f[_0x4fec5d(0x257)];}if(_0x4fec5d(0x21a)in _0x443a6f){const _0x26d668=_0x344465[_0x4fec5d(0x1bf)](_0x4fec5d(0x1f0)),{functionName:_0x71cd40,functionArguments:_0x32f3a9,targetFunction:_0xe33a18}=_0x443a6f[_0x4fec5d(0x21a)];let _0x5cf4c6=_0x10a495+'\x20'+_0x26d668+':\x20'+_0x344465[_0x4fec5d(0x1af)](_0x71cd40);if(_0x32f3a9&&Object[_0x4fec5d(0x1e4)](_0x32f3a9)['length']>0x0){const _0x59ba1b=Object[_0x4fec5d(0x1b3)](_0x32f3a9)['map'](([_0x431a00,_0x5be14d])=>_0x431a00+'='+JSON[_0x4fec5d(0x256)](_0x5be14d))[_0x4fec5d(0x219)](',\x20');_0x5cf4c6+='('+_0x59ba1b+')';}_0xe33a18&&(_0x5cf4c6+=_0x344465[_0x4fec5d(0x1be)]('\x20['+_0xe33a18+']'));let _0x3a2d20='';if(_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x1ed)])_0x3a2d20=_0x4fec5d(0x245)+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x1ed)]['name'];else{if(_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x215)])_0x3a2d20='\x20->\x20Agent:'+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x215)][_0x4fec5d(0x1cc)];else{if(_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x228)])_0x3a2d20=_0x4fec5d(0x249)+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x228)][_0x4fec5d(0x1cc)];else _0x443a6f[_0x4fec5d(0x21a)]['targetImageGenerator']&&(_0x3a2d20=_0x4fec5d(0x25d)+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x211)]['name']);}}return _0x5cf4c6+_0x3a2d20;}if(_0x4fec5d(0x1f7)in _0x443a6f){const _0x18a80=_0x344465[_0x4fec5d(0x1c3)](_0x4fec5d(0x208)),{functionName:_0x5c0795,functionArguments:_0x1089d3,content:_0x30b158,newChat:_0x10d575}=_0x443a6f[_0x4fec5d(0x1f7)];let _0x4f8404=_0x10a495+'\x20'+_0x18a80+':\x20'+_0x344465[_0x4fec5d(0x1af)](_0x5c0795);if(_0x1089d3){const _0x2f25b5=typeof _0x1089d3==='string'?_0x1089d3:JSON[_0x4fec5d(0x256)](_0x1089d3);_0x4f8404+='('+_0x2f25b5+')';}return _0x30b158&&(_0x4f8404+='\x0a'+_0x344465[_0x4fec5d(0x1be)](_0x30b158)),_0x10d575&&(_0x4f8404+=_0x344465[_0x4fec5d(0x1be)](_0x4fec5d(0x1db)+_0x10d575['id'])),_0x4f8404;}if(_0x4fec5d(0x206)in _0x443a6f){const _0x53e88f=_0x344465[_0x4fec5d(0x1ef)](_0x4fec5d(0x237));return _0x10a495+'\x20'+_0x53e88f+':\x20'+_0x443a6f[_0x4fec5d(0x206)][_0x4fec5d(0x1cc)]+'\x20('+_0x443a6f[_0x4fec5d(0x206)][_0x4fec5d(0x257)][_0x4fec5d(0x1c9)]+'\x20bytes)';}if(_0x4fec5d(0x203)in _0x443a6f){const _0x4f5b74=_0x344465[_0x4fec5d(0x1ef)](_0x4fec5d(0x1fe)),{width:_0x199fe6,height:_0x58c399,headerText:_0x5e2587}=_0x443a6f[_0x4fec5d(0x203)],_0xd22932=_0x5e2587?_0x4fec5d(0x232)+_0x5e2587:'';return _0x10a495+'\x20'+_0x4f5b74+':\x20'+_0x199fe6+'x'+_0x58c399+_0xd22932;}if(_0x4fec5d(0x205)in _0x443a6f){const _0x19626a=_0x344465[_0x4fec5d(0x1d6)](_0x4fec5d(0x20e));return _0x10a495+'\x20'+_0x19626a+':\x20'+_0x443a6f[_0x4fec5d(0x205)];}return _0x10a495+'\x20'+_0x344465[_0x4fec5d(0x1be)](_0x4fec5d(0x1ff))+':\x20'+JSON[_0x4fec5d(0x256)](_0x443a6f);}async function getProjectIdOrDefault(_0x9a0134){const _0x312dac=a22_0x113d,{tdx:_0x4e848f,options:_0x11b6de}=_0x9a0134,_0x22437a=_0x11b6de[_0x312dac(0x24a)];if(_0x22437a){const _0x12e91a=await withSpinner(_0x312dac(0x226)+_0x22437a+'\x27...',()=>_0x4e848f[_0x312dac(0x238)]['resolveProjectId'](_0x22437a),{'verbose':_0x11b6de['verbose']});return _0x12e91a[_0x312dac(0x20f)];}let _0x2760b8=_0x4e848f[_0x312dac(0x238)][_0x312dac(0x1d2)]();if(_0x2760b8)return _0x2760b8;const _0x19ab21=await withSpinner(_0x312dac(0x25a),()=>_0x4e848f[_0x312dac(0x238)][_0x312dac(0x224)](),{'verbose':_0x11b6de[_0x312dac(0x1bc)]});return _0x19ab21['data']['id'];}function toLLMProjectInfo(_0x3fac8e){const _0x10ae9c=a22_0x113d;return{'name':_0x3fac8e[_0x10ae9c(0x21d)][_0x10ae9c(0x1cc)],'description':_0x3fac8e[_0x10ae9c(0x21d)][_0x10ae9c(0x1c0)],'createdAt':_0x3fac8e[_0x10ae9c(0x21d)]['createdAt'],'updatedAt':_0x3fac8e['attributes'][_0x10ae9c(0x20d)]};}function toAgentInfo(_0x46b3b8){const _0x258f03=a22_0x113d;return{'name':_0x46b3b8[_0x258f03(0x21d)][_0x258f03(0x1cc)],'description':_0x46b3b8[_0x258f03(0x21d)]['description'],'prompt':truncatePrompt(_0x46b3b8[_0x258f03(0x21d)][_0x258f03(0x1e8)]),'createdAt':_0x46b3b8['attributes'][_0x258f03(0x22c)],'updatedAt':_0x46b3b8[_0x258f03(0x21d)]['updatedAt']};}function truncatePrompt(_0x42419d){const _0x55ac25=a22_0x113d;if(!_0x42419d)return undefined;const _0x2f0073=0x64;if(_0x42419d['length']<=_0x2f0073)return _0x42419d;return _0x42419d['slice'](0x0,_0x2f0073)+_0x55ac25(0x22e);}function a22_0xeb31(){const _0x361545=['Delete\x20an\x20LLM\x20project','json','965514qvyRtZ','red','Validating\x20backup\x20from\x20\x27','Use\x20format:\x20project-name/agent-name','integrations','prompts','\x20→\x20chat:\x20','Update\x20an\x20existing\x20agent','llm:projects','Create\x20a\x20new\x20agent\x20in\x20current\x20project','table','35QSoEyT','deleteProject','Invalid\x20path\x20syntax:\x20','llm:agents','keys','List\x20all\x20LLM\x20projects','sourceSite','log','prompt','createAgent','164134ocMGAV','llm:history','outputDir','targetKnowledgeBase','dryRun','blue','[tool_call]','Backup\x20cancelled.','llm:agent:create','Agent\x20created:\x20','Error:\x20Agent\x20name\x20is\x20required','split','projectName','tool','\x27\x20already\x20exists.\x20Overwrite?','Usage:\x20tdx\x20llm\x20history\x20--last','Agent\x20deleted:\x20','llm:project:create','last','Agent\x20updated:\x20','[image]\x20\x20','[unknown]','agents','Project\x20restored:\x20','69912AHTiuX','image','Output\x20directory\x20\x27','error','output','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','[tool]\x20\x20\x20','\x20\x20Cause:\x20','Resolving\x20agent\x20\x27','\x27...','history','updatedAt','[error]\x20\x20','data','model','targetImageGenerator','restoreProject','input','resolveAgentId','targetAgent','3543180yNowoV','Project\x20created:\x20','Project\x20context\x20set\x20to:\x20','join','tool_call','jsonl','Fetching\x20available\x20models...','attributes','\x20\x20Integrations:\x20','Backing\x20up\x20project\x20\x27','message','projects','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','[content]','getOrCreateDefaultProject','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Resolving\x20project\x20\x27','stack','targetWebSearchTool','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','\x20\x20Prompts:\x20','limit','createdAt','claude-4.5-haiku','...','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','updateAgent','Creating\x20agent\x20\x27','\x20-\x20','map','setCurrentProject','Show\x20agent\x20details','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[output]\x20','llm','maxToolIterations','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Restore\x20cancelled.','yes','deleteAgent','Error:\x20Backup\x20folder\x20path\x20is\x20required','Project\x20not\x20found:\x20','\x20\x20Knowledge\x20Bases:\x20','backupProject','\x20\x20Agents:\x20','getBackupMetadata','\x20->\x20KB:','List\x20agents\x20in\x20current\x20project','Error:\x20Project\x20name\x20is\x20required','temperature','\x20->\x20WebSearch:','llmProject','\x0aStack\x20trace:','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','execute','Fetching\x20projects...','knowledgeBases','counts','llm:project:backup','cyan','exportedFrom','192058zLKVin','.llm','stringify','content','Analyzing\x20project\x20\x27','existsSync','Getting\x20default\x20project...','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','\x20->\x20ImageGen:','bold','toLowerCase','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','entries','Deleting\x20agent...','llm:models','Error:\x20','1161xdJIhH','llm:agent:update','systemPrompt','[input]\x20\x20','format','verbose','chats','dim','yellow','description','Updating\x20agent...','models','magenta','6184040nJGFVW','find','6330912kdGXlE','List\x20available\x20LLM\x20models','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','length','INVALID_ARGUMENT','cause','name','Fetching\x20agent...','llm:agent:show','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','filter','getCurrentProject'];a22_0xeb31=function(){return _0x361545;};return a22_0xeb31();}export class LLMModelsCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1b5);[a22_0x160052(0x1c0)]=a22_0x160052(0x1c7);async[a22_0x160052(0x24d)](_0x2f6603){const _0x45d597=a22_0x160052,{options:_0x4cf79a,tdx:_0x31e838}=_0x2f6603;try{const _0x3d0b3f=await withSpinner(_0x45d597(0x21c),()=>_0x31e838['llm'][_0x45d597(0x1c2)](),{'verbose':_0x4cf79a[_0x45d597(0x1bc)]});return await handleSDKOutput(_0x3d0b3f['data'],_0x4cf79a),0x0;}catch(_0x329900){return handleSDKError(_0x329900,_0x4cf79a),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a22_0x160052(0x1dd);[a22_0x160052(0x1c0)]=a22_0x160052(0x1e5);async[a22_0x160052(0x24d)](_0x5a395d){const _0x496be5=a22_0x160052,{options:_0x5a79c6,args:_0x4b2e2f,tdx:_0x5b777a}=_0x5a395d;try{const _0x1f863e=_0x4b2e2f[0x0],_0x36f561=resolveLimit(_0x5a79c6[_0x496be5(0x22b)],DEFAULT_LLM_LIMIT),_0x1e71e8=await withSpinner(_0x496be5(0x24e),()=>_0x5b777a['llm'][_0x496be5(0x221)](_0x36f561),{'verbose':_0x5a79c6[_0x496be5(0x1bc)]});let _0x54c77e=_0x1e71e8[_0x496be5(0x20f)];_0x1f863e&&(_0x54c77e=_0x1e71e8[_0x496be5(0x20f)][_0x496be5(0x1d1)](_0x53067e=>matchGlobPattern(_0x53067e[_0x496be5(0x21d)]['name'],_0x1f863e)));const _0x3740fd=_0x54c77e[_0x496be5(0x233)](toLLMProjectInfo);return await handleSDKOutput(_0x3740fd,_0x5a79c6),0x0;}catch(_0x2c5778){return handleSDKError(_0x2c5778,_0x5a79c6),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1e3);[a22_0x160052(0x1c0)]=a22_0x160052(0x246);async[a22_0x160052(0x24d)](_0x45e83f){const _0x1c25e2=a22_0x160052,{options:_0x1e03f5,args:_0x454ef9,tdx:_0x5b39c7}=_0x45e83f;try{const _0x47dda0=_0x454ef9[0x0];let _0x41a4c0,_0x2ee8f4=_0x47dda0;if(_0x47dda0&&_0x47dda0['includes']('/')){const _0x4fb1c2=_0x47dda0[_0x1c25e2(0x1f5)]('/');if(_0x4fb1c2[_0x1c25e2(0x1c9)]===0x2){const [_0x5818f3,_0x4cd9e7]=_0x4fb1c2,_0x52c678=await _0x5b39c7[_0x1c25e2(0x238)][_0x1c25e2(0x221)](),_0x248ded=_0x52c678[_0x1c25e2(0x1c5)](_0x220296=>_0x220296[_0x1c25e2(0x21d)][_0x1c25e2(0x1cc)][_0x1c25e2(0x1b0)]()===_0x5818f3[_0x1c25e2(0x1b0)]());if(!_0x248ded)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x1c25e2(0x240)+_0x5818f3,undefined,{'helpText':_0x1c25e2(0x236)});_0x41a4c0=_0x248ded['id'],_0x2ee8f4=_0x4cd9e7;}else throw new SDKError(ErrorCode[_0x1c25e2(0x1ca)],_0x1c25e2(0x1e2)+_0x47dda0,undefined,{'helpText':_0x1c25e2(0x1d8)});}else _0x41a4c0=await getProjectIdOrDefault(_0x45e83f);const _0x30864a=await withSpinner('Fetching\x20agents...',()=>_0x5b39c7['llm'][_0x1c25e2(0x200)](_0x41a4c0),{'verbose':_0x1e03f5['verbose']});let _0x576cfa=_0x30864a['data'];_0x2ee8f4&&(_0x576cfa=_0x30864a['data']['filter'](_0x250a5f=>matchGlobPattern(_0x250a5f['attributes'][_0x1c25e2(0x1cc)],_0x2ee8f4)));const _0x5985a6=_0x576cfa['map'](toAgentInfo);return await handleSDKOutput(_0x5985a6,_0x1e03f5),0x0;}catch(_0x4e98c6){return handleSDKError(_0x4e98c6,_0x1e03f5),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a22_0x160052(0x1ce);['description']=a22_0x160052(0x235);async[a22_0x160052(0x24d)](_0x3eab36){const _0x486852=a22_0x160052,{options:_0x58a1c7,args:_0xea099,tdx:_0x5eaf21}=_0x3eab36;if(_0xea099[_0x486852(0x1c9)]===0x0)return console['error'](_0x486852(0x1f4)),console[_0x486852(0x205)](_0x486852(0x22f)),0x1;const _0x10dcc7=_0xea099[0x0];try{const _0x375d35=await getProjectIdOrDefault(_0x3eab36),_0x3065e6=await withSpinner(_0x486852(0x20a)+_0x10dcc7+_0x486852(0x20b),()=>_0x5eaf21['llm'][_0x486852(0x214)](_0x10dcc7,_0x375d35),{'verbose':_0x58a1c7['verbose']}),_0x507190=await withSpinner(_0x486852(0x1cd),()=>_0x5eaf21[_0x486852(0x238)]['agent'](_0x3065e6[_0x486852(0x20f)]),{'verbose':_0x58a1c7['verbose']});return await handleSDKOutput([_0x507190['data']],_0x58a1c7),0x0;}catch(_0x2d7f7d){return handleSDKError(_0x2d7f7d,_0x58a1c7),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1f2);[a22_0x160052(0x1c0)]=a22_0x160052(0x1de);async[a22_0x160052(0x24d)](_0x1daf59){const _0x26ee35=a22_0x160052,{options:_0x386563,args:_0x2c8ac4,tdx:_0x287441}=_0x1daf59;if(_0x2c8ac4[_0x26ee35(0x1c9)]===0x0)return console[_0x26ee35(0x205)](_0x26ee35(0x1f4)),console[_0x26ee35(0x205)](_0x26ee35(0x23a)),console[_0x26ee35(0x205)](_0x26ee35(0x23b)),0x1;const _0x1bd52d=_0x2c8ac4[0x0],_0x3a4fac=_0x386563,_0x4a7400=_0x3a4fac[_0x26ee35(0x1b9)],_0x7da790=_0x3a4fac[_0x26ee35(0x210)]||_0x26ee35(0x22d),_0x83de3d=_0x3a4fac['starterMessage'],_0x5460c7=_0x3a4fac[_0x26ee35(0x239)]?Number(_0x3a4fac[_0x26ee35(0x239)]):undefined,_0x237785=_0x3a4fac['temperature']?Number(_0x3a4fac[_0x26ee35(0x248)]):undefined;try{let _0x1c67f9,_0x83da7c;if(_0x1bd52d['includes']('/')){const _0x4ef95e=_0x1bd52d[_0x26ee35(0x1f5)]('/');if(_0x4ef95e['length']===0x2){const [_0x265df6,_0x258e8e]=_0x4ef95e,_0x29c98c=await withSpinner(_0x26ee35(0x226)+_0x265df6+_0x26ee35(0x20b),()=>_0x287441[_0x26ee35(0x238)]['resolveProjectId'](_0x265df6),{'verbose':_0x386563[_0x26ee35(0x1bc)]});_0x1c67f9=_0x29c98c[_0x26ee35(0x20f)],_0x83da7c=_0x258e8e;}else throw new SDKError(ErrorCode[_0x26ee35(0x1ca)],_0x26ee35(0x1e2)+_0x1bd52d,undefined,{'helpText':_0x26ee35(0x1d8)});}else _0x1c67f9=await getProjectIdOrDefault(_0x1daf59),_0x83da7c=_0x1bd52d;const _0x2021a5=await withSpinner(_0x26ee35(0x231)+_0x83da7c+'\x27...',()=>_0x287441[_0x26ee35(0x238)][_0x26ee35(0x1e9)]({'name':_0x83da7c,'projectId':_0x1c67f9,'modelType':_0x7da790,'systemPrompt':_0x4a7400,'starterMessage':_0x83de3d,'maxToolIterations':_0x5460c7,'temperature':_0x237785}),{'verbose':_0x386563['verbose']});return console[_0x26ee35(0x1e7)](_0x26ee35(0x1f3)+_0x2021a5[_0x26ee35(0x20f)]['id']),await handleSDKOutput([_0x2021a5[_0x26ee35(0x20f)]],_0x386563),0x0;}catch(_0x549cc8){return handleSDKError(_0x549cc8,_0x386563),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1b8);[a22_0x160052(0x1c0)]=a22_0x160052(0x1dc);async[a22_0x160052(0x24d)](_0x42b087){const _0x2451ea=a22_0x160052,{options:_0x4fb840,args:_0x2916ef,tdx:_0x2baf22}=_0x42b087;if(_0x2916ef[_0x2451ea(0x1c9)]===0x0)return console[_0x2451ea(0x205)](_0x2451ea(0x1f4)),console[_0x2451ea(0x205)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x4330d2=_0x2916ef[0x0],_0x25c71d=_0x4fb840,_0x1718e4=_0x25c71d['name'],_0x10ccea=_0x25c71d['prompt'],_0x3bcae8=_0x25c71d[_0x2451ea(0x1c0)],_0x535071=_0x25c71d['starterMessage'];if(!_0x1718e4&&!_0x10ccea&&!_0x3bcae8&&!_0x535071)return console[_0x2451ea(0x205)](_0x2451ea(0x207)),console['error'](_0x2451ea(0x222)),0x1;try{const _0x4d46d7=await getProjectIdOrDefault(_0x42b087),_0x4f4d5c=await withSpinner(_0x2451ea(0x20a)+_0x4330d2+_0x2451ea(0x20b),()=>_0x2baf22[_0x2451ea(0x238)][_0x2451ea(0x214)](_0x4330d2,_0x4d46d7),{'verbose':_0x4fb840['verbose']}),_0x5d07be=_0x4f4d5c['data'],_0x655c29=await withSpinner(_0x2451ea(0x1c1),()=>_0x2baf22[_0x2451ea(0x238)][_0x2451ea(0x230)](_0x5d07be,{'name':_0x1718e4,'prompt':_0x10ccea,'description':_0x3bcae8,'starterMessage':_0x535071}),{'verbose':_0x4fb840[_0x2451ea(0x1bc)]});return console[_0x2451ea(0x1e7)](_0x2451ea(0x1fd)+_0x655c29[_0x2451ea(0x20f)]['id']),await handleSDKOutput([_0x655c29[_0x2451ea(0x20f)]],_0x4fb840),0x0;}catch(_0x1d0372){return handleSDKError(_0x1d0372,_0x4fb840),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a22_0x160052(0x1cc)]='llm:agent:delete';['description']='Delete\x20an\x20agent';async[a22_0x160052(0x24d)](_0x2cc693){const _0x5c3fcc=a22_0x160052,{options:_0x59e265,args:_0x174834,tdx:_0x110661}=_0x2cc693;if(_0x174834['length']===0x0)return console['error'](_0x5c3fcc(0x1f4)),console[_0x5c3fcc(0x205)](_0x5c3fcc(0x1b2)),0x1;const _0x4bec17=_0x174834[0x0];try{const _0x5b97f5=await getProjectIdOrDefault(_0x2cc693),_0x3d2289=await withSpinner(_0x5c3fcc(0x20a)+_0x4bec17+_0x5c3fcc(0x20b),()=>_0x110661[_0x5c3fcc(0x238)][_0x5c3fcc(0x214)](_0x4bec17,_0x5b97f5),{'verbose':_0x59e265[_0x5c3fcc(0x1bc)]}),_0x26ef85=_0x3d2289[_0x5c3fcc(0x20f)];return await withSpinner(_0x5c3fcc(0x1b4),()=>_0x110661[_0x5c3fcc(0x238)][_0x5c3fcc(0x23e)](_0x26ef85),{'verbose':_0x59e265[_0x5c3fcc(0x1bc)]}),console[_0x5c3fcc(0x1e7)](_0x5c3fcc(0x1fa)+_0x26ef85),0x0;}catch(_0x175d99){return handleSDKError(_0x175d99,_0x59e265),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1eb);[a22_0x160052(0x1c0)]=a22_0x160052(0x225);async[a22_0x160052(0x24d)](_0x5dd9ec){const _0x1a11da=a22_0x160052,{options:_0x58bb05,args:_0x4cb847,tdx:_0xa5e8}=_0x5dd9ec;let _0x287486=_0x4cb847[0x0];const _0x4a860c=_0x58bb05,_0x131739=_0x4a860c[_0x1a11da(0x1fc)];try{if(_0x131739){if(_0x287486)return console[_0x1a11da(0x205)](_0x1a11da(0x1b1)),console[_0x1a11da(0x205)](_0x1a11da(0x1f9)),0x1;const _0x4bc7c9=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0xa5e8[_0x1a11da(0x238)][_0x1a11da(0x1bd)](0x1),{'verbose':_0x58bb05['verbose']});if(_0x4bc7c9[_0x1a11da(0x20f)][_0x1a11da(0x1c9)]===0x0)return console[_0x1a11da(0x1e7)]('No\x20chat\x20sessions\x20found.'),0x0;_0x287486=_0x4bc7c9['data'][0x0]['id'];}if(!_0x287486){const _0x545388=resolveLimit(_0x58bb05[_0x1a11da(0x22b)],DEFAULT_LLM_LIMIT),_0x3b918a=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0xa5e8[_0x1a11da(0x238)][_0x1a11da(0x1bd)](_0x545388),{'verbose':_0x58bb05[_0x1a11da(0x1bc)]});if(_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x1d4)||_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x21b))await handleSDKOutput(_0x3b918a[_0x1a11da(0x20f)],_0x58bb05);else{const _0xa7e919=_0x3b918a[_0x1a11da(0x20f)][_0x1a11da(0x233)](_0xdfab9f=>({'created_at':_0xdfab9f[_0x1a11da(0x21d)][_0x1a11da(0x22c)],'chat_id':_0xdfab9f['id'],'first_input':_0xdfab9f[_0x1a11da(0x21d)]['firstInputContent']||'(no\x20message)'}));await handleSDKOutput(_0xa7e919,_0x58bb05);}return 0x0;}else{const _0x29d1c4=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x287486+_0x1a11da(0x20b),()=>_0xa5e8['llm'][_0x1a11da(0x20c)](_0x287486),{'verbose':_0x58bb05[_0x1a11da(0x1bc)]}),_0xbcbbb7=_0x29d1c4['data'][_0x1a11da(0x20f)]??[];if(_0xbcbbb7['length']===0x0)return console['log']('No\x20messages\x20found\x20in\x20chat\x20history.'),0x0;if(_0x58bb05['format']==='json'||_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x21b)||_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x1df)||_0x58bb05[_0x1a11da(0x1bb)]==='tsv')await handleSDKOutput(_0xbcbbb7,_0x58bb05);else for(const _0x4c71dd of _0xbcbbb7){console['log'](formatChatHistoryEntry(_0x4c71dd,_0x58bb05));}return 0x0;}}catch(_0x46a7d7){return handleSDKError(_0x46a7d7,_0x58bb05),0x1;}}}export class LLMUseCommand extends BaseCommand{['name']='llm:use';[a22_0x160052(0x1c0)]='Set\x20current\x20project\x20context';async[a22_0x160052(0x24d)](_0x4791fc){const _0xbfc1=a22_0x160052,{options:_0x56fb22,args:_0xe86be4,tdx:_0x5d0816}=_0x4791fc;if(_0xe86be4[_0xbfc1(0x1c9)]===0x0)return console[_0xbfc1(0x205)](_0xbfc1(0x247)),console[_0xbfc1(0x205)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x4cec80=_0xe86be4[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x4cec80+'\x27...',()=>_0x5d0816[_0xbfc1(0x238)][_0xbfc1(0x234)](_0x4cec80),{'verbose':_0x56fb22[_0xbfc1(0x1bc)]}),console['log'](_0xbfc1(0x218)+_0x4cec80),0x0;}catch(_0x4a5ea1){return handleSDKError(_0x4a5ea1,_0x56fb22),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1fb);[a22_0x160052(0x1c0)]='Create\x20a\x20new\x20LLM\x20project';async['execute'](_0x3b8816){const _0x5ad9c2=a22_0x160052,{options:_0x49f311,args:_0x35cf61,tdx:_0x3548f5}=_0x3b8816;if(_0x35cf61[_0x5ad9c2(0x1c9)]===0x0)return console[_0x5ad9c2(0x205)](_0x5ad9c2(0x247)),console[_0x5ad9c2(0x205)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x50c5a1=_0x35cf61[0x0],_0x15878c=_0x49f311,_0x1daccf=_0x15878c['description'];try{const _0x3cbbe8=await withSpinner('Creating\x20project\x20\x27'+_0x50c5a1+'\x27...',()=>_0x3548f5[_0x5ad9c2(0x238)]['createProject']({'name':_0x50c5a1,'description':_0x1daccf}),{'verbose':_0x49f311[_0x5ad9c2(0x1bc)]});console[_0x5ad9c2(0x1e7)](_0x5ad9c2(0x217)+_0x3cbbe8[_0x5ad9c2(0x20f)]['id']);const _0x640296=toLLMProjectInfo(_0x3cbbe8[_0x5ad9c2(0x20f)]);return await handleSDKOutput([_0x640296],_0x49f311),0x0;}catch(_0x99554f){return handleSDKError(_0x99554f,_0x49f311),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a22_0x160052(0x1cc)]='llm:project:delete';[a22_0x160052(0x1c0)]=a22_0x160052(0x1d3);async['execute'](_0x405626){const _0x87800b=a22_0x160052,{options:_0x410da2,args:_0x2f67c2,tdx:_0x6af593}=_0x405626;if(_0x2f67c2[_0x87800b(0x1c9)]===0x0)return console[_0x87800b(0x205)](_0x87800b(0x247)),console['error'](_0x87800b(0x1cf)),0x1;const _0x4e1662=_0x2f67c2[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x4e1662+_0x87800b(0x20b),()=>_0x6af593[_0x87800b(0x238)][_0x87800b(0x1e1)](_0x4e1662),{'verbose':_0x410da2[_0x87800b(0x1bc)]}),console[_0x87800b(0x1e7)]('Project\x20deleted:\x20'+_0x4e1662),0x0;}catch(_0x3850cd){return handleSDKError(_0x3850cd,_0x410da2),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x251);[a22_0x160052(0x1c0)]='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder';async[a22_0x160052(0x24d)](_0x5ca85f){const _0x39981f=a22_0x160052,{options:_0x18e504,args:_0x5e5808,tdx:_0x150cac}=_0x5ca85f;if(_0x5e5808[_0x39981f(0x1c9)]===0x0)return console[_0x39981f(0x205)](_0x39981f(0x247)),console[_0x39981f(0x205)](_0x39981f(0x25c)),0x1;const _0x150bc7=_0x5e5808[0x0],_0x1185d0=_0x18e504,_0x32e5da=_0x1185d0[_0x39981f(0x206)],_0x2420a0=_0x1185d0[_0x39981f(0x1ee)];try{const _0x2bfbf7=_0x32e5da||_0x150bc7+_0x39981f(0x255);if(a22_0x42121b[_0x39981f(0x259)](_0x2bfbf7)&&!_0x2420a0){if(!_0x18e504['yes']){const _0x259a5e=await confirm(_0x39981f(0x204)+_0x2bfbf7+_0x39981f(0x1f8));if(!_0x259a5e)return console[_0x39981f(0x1e7)](_0x39981f(0x1f1)),0x0;}a22_0x42121b['rmSync'](_0x2bfbf7,{'recursive':!![]});}const _0x1a9495=await withSpinner(_0x2420a0?_0x39981f(0x258)+_0x150bc7+'\x27...':_0x39981f(0x21f)+_0x150bc7+_0x39981f(0x20b),()=>_0x150cac[_0x39981f(0x238)][_0x39981f(0x242)](_0x150bc7,_0x32e5da,{'dryRun':_0x2420a0}),{'verbose':_0x18e504[_0x39981f(0x1bc)]}),_0x403dd7=_0x1a9495[_0x39981f(0x20f)];return _0x2420a0?console[_0x39981f(0x1e7)](_0x39981f(0x229)+_0x403dd7[_0x39981f(0x1ec)]):console[_0x39981f(0x1e7)]('Project\x20backed\x20up\x20to:\x20'+_0x403dd7[_0x39981f(0x1ec)]),console['log'](_0x39981f(0x243)+_0x403dd7[_0x39981f(0x250)][_0x39981f(0x200)]),console['log'](_0x39981f(0x241)+_0x403dd7['counts'][_0x39981f(0x24f)]),console[_0x39981f(0x1e7)](_0x39981f(0x22a)+_0x403dd7[_0x39981f(0x250)][_0x39981f(0x1da)]),console[_0x39981f(0x1e7)](_0x39981f(0x21e)+_0x403dd7['counts'][_0x39981f(0x1d9)]),(_0x18e504[_0x39981f(0x1bb)]===_0x39981f(0x1d4)||_0x18e504[_0x39981f(0x1bb)]===_0x39981f(0x21b))&&await handleSDKOutput([_0x403dd7],_0x18e504),0x0;}catch(_0x3a2e49){return handleSDKError(_0x3a2e49,_0x18e504),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a22_0x160052(0x1cc)]='llm:project:restore';['description']=a22_0x160052(0x1d0);async[a22_0x160052(0x24d)](_0x1b085f){const _0x4cf0ee=a22_0x160052,{options:_0x1ece68,args:_0x53713a,tdx:_0xa4b60c}=_0x1b085f;if(_0x53713a['length']===0x0)return console[_0x4cf0ee(0x205)](_0x4cf0ee(0x23f)),console[_0x4cf0ee(0x205)]('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x10d6d7=_0x53713a[0x0],_0x677242=_0x1ece68,_0x4d679f=_0x677242[_0x4cf0ee(0x1cc)],_0x5c8bfa=_0x677242[_0x4cf0ee(0x1ee)];try{if(!_0x5c8bfa){const _0x6c4c65=_0xa4b60c[_0x4cf0ee(0x238)][_0x4cf0ee(0x244)](_0x10d6d7),_0x382ace=_0x4d679f||_0x6c4c65[_0x4cf0ee(0x253)][_0x4cf0ee(0x1f6)],_0x2401fe=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0xa4b60c[_0x4cf0ee(0x238)]['projects'](),{'verbose':_0x1ece68[_0x4cf0ee(0x1bc)]}),_0x2e9670=_0x2401fe['data'][_0x4cf0ee(0x1c5)](_0x1763a3=>_0x1763a3['attributes']['name']===_0x382ace);if(_0x2e9670&&!_0x1ece68[_0x4cf0ee(0x23d)]){const _0x2cadc8=await confirm('A\x20project\x20named\x20\x27'+_0x382ace+_0x4cf0ee(0x25b));if(!_0x2cadc8)return console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x23c)),0x0;}}const _0x5995ed=await withSpinner(_0x5c8bfa?_0x4cf0ee(0x1d7)+_0x10d6d7+_0x4cf0ee(0x20b):'Restoring\x20project\x20from\x20\x27'+_0x10d6d7+_0x4cf0ee(0x20b),()=>_0xa4b60c[_0x4cf0ee(0x238)][_0x4cf0ee(0x212)](_0x10d6d7,{'name':_0x4d679f,'dryRun':_0x5c8bfa}),{'verbose':_0x1ece68[_0x4cf0ee(0x1bc)]}),_0x3348ff=_0x5995ed[_0x4cf0ee(0x20f)];return _0x3348ff[_0x4cf0ee(0x1e6)]&&console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x1c8)+_0x3348ff[_0x4cf0ee(0x1e6)]+'\x27'),_0x5c8bfa?console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x24c)+_0x3348ff[_0x4cf0ee(0x1f6)]):console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x201)+_0x3348ff[_0x4cf0ee(0x1f6)]+'\x20('+_0x3348ff['projectId']+')'),console['log']('\x20\x20Agents:\x20'+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x200)]),console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x241)+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x24f)]),console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x22a)+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x1da)]),console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x21e)+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x1d9)]),(_0x1ece68['format']==='json'||_0x1ece68['format']===_0x4cf0ee(0x21b))&&await handleSDKOutput([_0x3348ff],_0x1ece68),0x0;}catch(_0x56fc7b){return handleSDKError(_0x56fc7b,_0x1ece68),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x58f308=a21_0x5977;(function(_0x5c7216,_0x51f90c){const _0x1858a7=a21_0x5977,_0x50cac2=_0x5c7216();while(!![]){try{const _0x42447f=parseInt(_0x1858a7(0x117))/0x1+-parseInt(_0x1858a7(0x10e))/0x2*(parseInt(_0x1858a7(0x100))/0x3)+parseInt(_0x1858a7(0xe8))/0x4+-parseInt(_0x1858a7(0xf9))/0x5*(parseInt(_0x1858a7(0x11f))/0x6)+-parseInt(_0x1858a7(0xf1))/0x7+parseInt(_0x1858a7(0x11a))/0x8+parseInt(_0x1858a7(0x121))/0x9;if(_0x42447f===_0x51f90c)break;else _0x50cac2['push'](_0x50cac2['shift']());}catch(_0x77d90b){_0x50cac2['push'](_0x50cac2['shift']());}}}(a21_0x3a62,0x959e2));import a21_0x47cbae from'chalk';function a21_0x3a62(){const _0x24f387=['log','Server\x20Configuration:','\x20\x20Project:','1486412HlSRFt','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','logger','http://0.0.0.0:','yellow','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20\x20\x20}','site','4201260YzruhW','dim','✓\x20Proxy\x20server\x20stopped','\x27\x20not\x20found','find','projects','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','NOT_FOUND','4145suOpgp','name','Resolving\x20project...','\x20\x20Site:','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0aClaude\x20Code\x20Configuration:','llm','9bQbmPV','close','getOrCreateDefaultProject','port','description','exit','server','llm:proxy','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','white','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','green','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','cyan','526412csVAjS','start','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x20\x20{','created\x20on-demand\x20per\x20model','Starting\x20proxy\x20server...','stop','bold','\x0aTesting\x20with\x20Agent\x20SDK:','446234qZeotX','project','init','7256512cdGHSB','Port\x20','\x20\x20Address:','SIGTERM','attributes','30JLohJx','execute','2536884uyIxlm','Project\x20\x27','\x20\x20}'];a21_0x3a62=function(){return _0x24f387;};return a21_0x3a62();}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';function a21_0x5977(_0x3a1491,_0x576f0e){const _0x3a623f=a21_0x3a62();return a21_0x5977=function(_0x59774f,_0x197063){_0x59774f=_0x59774f-0xe6;let _0x220a60=_0x3a623f[_0x59774f];return _0x220a60;},a21_0x5977(_0x3a1491,_0x576f0e);}import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x193ea1,_0x13653d){const _0x5f1317=a21_0x5977,{tdx:_0x4c9a3a,options:_0x205e8a}=_0x193ea1,_0x393010=_0x13653d||_0x205e8a['llmProject'];if(_0x393010){const _0x3a2daa=await _0x4c9a3a[_0x5f1317(0xff)][_0x5f1317(0xf6)](),_0x566320=_0x3a2daa[_0x5f1317(0xf5)](_0x5c7ed5=>_0x5c7ed5[_0x5f1317(0x11e)][_0x5f1317(0xfa)]===_0x393010);if(!_0x566320)throw new SDKError(ErrorCode[_0x5f1317(0xf8)],_0x5f1317(0x122)+_0x393010+_0x5f1317(0xf4),undefined,{'helpText':_0x5f1317(0x10a)});return _0x566320['id'];}const _0x230893=await _0x4c9a3a[_0x5f1317(0xff)][_0x5f1317(0x102)]();return _0x230893['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x58f308(0xfa)]=a21_0x58f308(0x107);[a21_0x58f308(0x104)]=a21_0x58f308(0x108);[a21_0x58f308(0x106)];[a21_0x58f308(0xea)];async[a21_0x58f308(0x120)](_0x13ef79){const _0x28e468=a21_0x58f308,{tdx:_0x47d7d6,options:_0x26e183}=_0x13ef79;try{const _0x5e35b3=_0x26e183,_0x213b08=_0x5e35b3[_0x28e468(0x103)]||0xfa0,_0x1093d0=_0x5e35b3[_0x28e468(0x118)],_0xccba5c=await findAvailablePort(_0x213b08);console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)](_0x28e468(0xfb)));const _0x410fc7=await getProjectIdOrDefault(_0x13ef79,_0x1093d0),_0x1d3e6e=await _0x47d7d6[_0x28e468(0xff)][_0x28e468(0xf6)](),_0x5ed590=_0x1d3e6e['find'](_0xac705=>_0xac705['id']===_0x410fc7);this[_0x28e468(0xea)]=new TDXLogger(_0x26e183['logLevel']),await this['logger'][_0x28e468(0x119)](),console['log'](a21_0x47cbae[_0x28e468(0xf2)](_0x28e468(0x113)));_0xccba5c!==_0x213b08&&console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xec)](_0x28e468(0x11b)+_0x213b08+'\x20is\x20unavailable,\x20using\x20port\x20'+_0xccba5c));this[_0x28e468(0x106)]=new ProxyServer({'port':_0xccba5c,'projectId':_0x410fc7,'tdx':_0x47d7d6,'logger':this[_0x28e468(0xea)],'site':_0x26e183[_0x28e468(0xf0)]}),await this[_0x28e468(0x106)][_0x28e468(0x10f)](),console['log'](a21_0x47cbae[_0x28e468(0xec)][_0x28e468(0x115)](_0x28e468(0x10c))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xec)](_0x28e468(0x110))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xec)](_0x28e468(0xfd))),console['log'](a21_0x47cbae[_0x28e468(0x10b)]['bold']('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console['log'](a21_0x47cbae['cyan'](_0x28e468(0xe6))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)](_0x28e468(0x11c)),a21_0x47cbae[_0x28e468(0x109)](_0x28e468(0xeb)+_0xccba5c)),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)](_0x28e468(0xe7)),a21_0x47cbae[_0x28e468(0x109)](_0x5ed590?.[_0x28e468(0x11e)][_0x28e468(0xfa)]||_0x410fc7)),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)]('\x20\x20Agents:'),a21_0x47cbae['white'](_0x28e468(0x112))),console['log'](a21_0x47cbae['dim'](_0x28e468(0xfc)),a21_0x47cbae[_0x28e468(0x109)](_0x26e183[_0x28e468(0xf0)])),console['log'](a21_0x47cbae['cyan'](_0x28e468(0xfe))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0x109)](_0x28e468(0x111))),console['log'](a21_0x47cbae[_0x28e468(0x109)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0x109)](_0x28e468(0xe9)+_0xccba5c+'\x22,')),console['log'](a21_0x47cbae[_0x28e468(0x109)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0x109)](_0x28e468(0xef))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0x109)](_0x28e468(0x123))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0x10d)](_0x28e468(0x116))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console['log'](a21_0x47cbae[_0x28e468(0xf2)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xf2)](_0x28e468(0xed))),console[_0x28e468(0x124)](a21_0x47cbae[_0x28e468(0xec)](_0x28e468(0xf7)));const _0x30b715=async()=>{const _0x545da1=_0x28e468;console['log'](a21_0x47cbae[_0x545da1(0xf2)](_0x545da1(0xee))),this[_0x545da1(0x106)]&&await this['server'][_0x545da1(0x114)](),this[_0x545da1(0xea)]&&await this[_0x545da1(0xea)][_0x545da1(0x101)](),console[_0x545da1(0x124)](a21_0x47cbae[_0x545da1(0x10b)](_0x545da1(0xf3))),process[_0x545da1(0x105)](0x0);};return process['on']('SIGINT',_0x30b715),process['on'](_0x28e468(0x11d),_0x30b715),await new Promise(()=>{}),0x0;}catch(_0x38b96b){this[_0x28e468(0x106)]&&await this[_0x28e468(0x106)][_0x28e468(0x114)]();this['logger']&&await this['logger'][_0x28e468(0x101)]();throw _0x38b96b;}}}
1
+ const a23_0x5dd1bc=a23_0x2db2;function a23_0x2db2(_0x144082,_0x2f67cc){const _0x14e65c=a23_0x14e6();return a23_0x2db2=function(_0x2db2e1,_0x55f27b){_0x2db2e1=_0x2db2e1-0x1f4;let _0x12ff16=_0x14e65c[_0x2db2e1];return _0x12ff16;},a23_0x2db2(_0x144082,_0x2f67cc);}(function(_0x57441d,_0x126d1e){const _0x2f4184=a23_0x2db2,_0x28974b=_0x57441d();while(!![]){try{const _0x90947e=parseInt(_0x2f4184(0x205))/0x1*(parseInt(_0x2f4184(0x225))/0x2)+parseInt(_0x2f4184(0x200))/0x3+parseInt(_0x2f4184(0x20b))/0x4*(parseInt(_0x2f4184(0x22e))/0x5)+parseInt(_0x2f4184(0x21f))/0x6+-parseInt(_0x2f4184(0x211))/0x7*(-parseInt(_0x2f4184(0x215))/0x8)+-parseInt(_0x2f4184(0x212))/0x9+parseInt(_0x2f4184(0x1f9))/0xa*(-parseInt(_0x2f4184(0x219))/0xb);if(_0x90947e===_0x126d1e)break;else _0x28974b['push'](_0x28974b['shift']());}catch(_0x4b4dd1){_0x28974b['push'](_0x28974b['shift']());}}}(a23_0x14e6,0x7e912));import a23_0x44b794 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';function a23_0x14e6(){const _0x1633f4=['1gbSNBY','Project\x20\x27','init','llm:proxy','\x20\x20Project:','Server\x20Configuration:','4GsFQaM','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20Agents:','find','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x20\x20\x20\x20}','70DZsuHE','2950947xrVPXy','\x20\x20\x20\x20\x22env\x22:\x20{','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','648840mhmMYg','getOrCreateDefaultProject','white','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','16064873zndkeS','log','yellow','http://0.0.0.0:','start','created\x20on-demand\x20per\x20model','3662682PcJQyX','llmProject','\x20\x20Site:','name','stop','dim','2003224CiRjOt','close','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x20\x20Address:','attributes','\x20is\x20unavailable,\x20using\x20port\x20','green','llm','bold','4704730bBFEcd','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20{','site','Starting\x20proxy\x20server...','logLevel','description','logger','project','server','20qNTqvf','cyan','exit','\x27\x20not\x20found','projects','\x20\x20}','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','1209396XLjtsS','SIGINT','Port\x20','\x0a\x0aShutting\x20down\x20proxy\x20server...','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a'];a23_0x14e6=function(){return _0x1633f4;};return a23_0x14e6();}async function getProjectIdOrDefault(_0x554a42,_0x7fc68f){const _0x40f62c=a23_0x2db2,{tdx:_0x598868,options:_0x360ce5}=_0x554a42,_0x101e45=_0x7fc68f||_0x360ce5[_0x40f62c(0x220)];if(_0x101e45){const _0x55c421=await _0x598868[_0x40f62c(0x22c)][_0x40f62c(0x1fd)](),_0x5b64c3=_0x55c421[_0x40f62c(0x20e)](_0x56f927=>_0x56f927['attributes'][_0x40f62c(0x222)]===_0x101e45);if(!_0x5b64c3)throw new SDKError(ErrorCode['NOT_FOUND'],_0x40f62c(0x206)+_0x101e45+_0x40f62c(0x1fc),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x5b64c3['id'];}const _0x19ae67=await _0x598868[_0x40f62c(0x22c)][_0x40f62c(0x216)]();return _0x19ae67['id'];}export class LLMProxyCommand extends BaseCommand{[a23_0x5dd1bc(0x222)]=a23_0x5dd1bc(0x208);[a23_0x5dd1bc(0x1f5)]=a23_0x5dd1bc(0x20c);[a23_0x5dd1bc(0x1f8)];[a23_0x5dd1bc(0x1f6)];async['execute'](_0x1aa6a2){const _0x2c41d5=a23_0x5dd1bc,{tdx:_0x1dcaf2,options:_0x1d2e09}=_0x1aa6a2;try{const _0x1c98b6=_0x1d2e09,_0x5eae81=_0x1c98b6['port']||0xfa0,_0x3e1d31=_0x1c98b6[_0x2c41d5(0x1f7)],_0x49b9c8=await findAvailablePort(_0x5eae81);console['log'](a23_0x44b794['dim']('Resolving\x20project...'));const _0x47cf55=await getProjectIdOrDefault(_0x1aa6a2,_0x3e1d31),_0x37dcd5=await _0x1dcaf2[_0x2c41d5(0x22c)]['projects'](),_0x38c48f=_0x37dcd5[_0x2c41d5(0x20e)](_0x169419=>_0x169419['id']===_0x47cf55);this[_0x2c41d5(0x1f6)]=new TDXLogger(_0x1d2e09[_0x2c41d5(0x1f4)]),await this['logger'][_0x2c41d5(0x207)](),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x232)));_0x49b9c8!==_0x5eae81&&console['log'](a23_0x44b794['yellow'](_0x2c41d5(0x202)+_0x5eae81+_0x2c41d5(0x22a)+_0x49b9c8));this[_0x2c41d5(0x1f8)]=new ProxyServer({'port':_0x49b9c8,'projectId':_0x47cf55,'tdx':_0x1dcaf2,'logger':this[_0x2c41d5(0x1f6)],'site':_0x1d2e09[_0x2c41d5(0x231)]}),await this[_0x2c41d5(0x1f8)][_0x2c41d5(0x21d)](),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x21b)][_0x2c41d5(0x22d)](_0x2c41d5(0x214))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x21b)](_0x2c41d5(0x218))),console['log'](a23_0x44b794[_0x2c41d5(0x21b)](_0x2c41d5(0x227))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x22b)][_0x2c41d5(0x22d)](_0x2c41d5(0x204))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x1fa)](_0x2c41d5(0x20a))),console['log'](a23_0x44b794['dim'](_0x2c41d5(0x228)),a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x21c)+_0x49b9c8)),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x209)),a23_0x44b794[_0x2c41d5(0x217)](_0x38c48f?.[_0x2c41d5(0x229)][_0x2c41d5(0x222)]||_0x47cf55)),console['log'](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x20d)),a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x21e))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x221)),a23_0x44b794[_0x2c41d5(0x217)](_0x1d2e09[_0x2c41d5(0x231)])),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x1fa)]('\x0aClaude\x20Code\x20Configuration:')),console['log'](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x20f))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x230))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x213))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x49b9c8+'\x22,')),console[_0x2c41d5(0x21a)](a23_0x44b794['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x210))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x1fe))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x1fa)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console['log'](a23_0x44b794['dim']('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x1ff))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x22f))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x21b)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x174c7a=async()=>{const _0x323e1a=_0x2c41d5;console[_0x323e1a(0x21a)](a23_0x44b794[_0x323e1a(0x224)](_0x323e1a(0x203))),this[_0x323e1a(0x1f8)]&&await this['server'][_0x323e1a(0x223)](),this[_0x323e1a(0x1f6)]&&await this[_0x323e1a(0x1f6)]['close'](),console[_0x323e1a(0x21a)](a23_0x44b794['green']('✓\x20Proxy\x20server\x20stopped')),process[_0x323e1a(0x1fb)](0x0);};return process['on'](_0x2c41d5(0x201),_0x174c7a),process['on']('SIGTERM',_0x174c7a),await new Promise(()=>{}),0x0;}catch(_0xa62614){this[_0x2c41d5(0x1f8)]&&await this['server'][_0x2c41d5(0x223)]();this[_0x2c41d5(0x1f6)]&&await this[_0x2c41d5(0x1f6)][_0x2c41d5(0x226)]();throw _0xa62614;}}}
@@ -1 +1 @@
1
- const a22_0x12ccdc=a22_0x5923;(function(_0xc92f5a,_0x463b05){const _0x50294a=a22_0x5923,_0x309fcb=_0xc92f5a();while(!![]){try{const _0x43d191=-parseInt(_0x50294a(0x1b7))/0x1*(parseInt(_0x50294a(0x196))/0x2)+parseInt(_0x50294a(0x199))/0x3+parseInt(_0x50294a(0x1b3))/0x4+parseInt(_0x50294a(0x1b6))/0x5+parseInt(_0x50294a(0x1b5))/0x6*(-parseInt(_0x50294a(0x19a))/0x7)+parseInt(_0x50294a(0x1ad))/0x8*(parseInt(_0x50294a(0x1c0))/0x9)+-parseInt(_0x50294a(0x1a0))/0xa;if(_0x43d191===_0x463b05)break;else _0x309fcb['push'](_0x309fcb['shift']());}catch(_0x74eeb1){_0x309fcb['push'](_0x309fcb['shift']());}}}(a22_0x31cc,0xd8c92));function a22_0x5923(_0x58d15c,_0x16c2e0){const _0x31ccab=a22_0x31cc();return a22_0x5923=function(_0x592336,_0x5532c3){_0x592336=_0x592336-0x191;let _0xeed090=_0x31ccab[_0x592336];return _0xeed090;},a22_0x5923(_0x58d15c,_0x16c2e0);}function a22_0x31cc(){const _0x213587=['8767620NnKjfL','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Site:\x20','description','data','scheduleOption','segment','Fetching\x20current\x20configuration\x20for\x20\x27','behaviorsFile','execute','\x27...','customerGroupFile','site','3931920axCDzH','✔\x20Updated\x20parent\x20segment\x20\x27','timezone','database','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','length','1423564gxagId','Parent\x20segment:\x20','6eYirBS','4956925YIIjoI','450lqAjfa','error','behaviors','verbose','createParent','addBehaviors','✔\x20Created\x20parent\x20segment\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','name','9JMqKFv','Database:\x20','addAttributesFile','segment:parent:create','Create\x20new\x20parent\x20segment\x20(audience)','customerGroup','Update\x20existing\x20parent\x20segment\x20(audience)','table','attributes','4358oxVSCP','addAttributes','Creating\x20parent\x20segment\x20\x27','3160665VhDdBq','1029385yhVUhm','scheduleType','attributesFile','addBehaviorsFile','Updating\x20parent\x20segment\x20\x27','master'];a22_0x31cc=function(){return _0x213587;};return a22_0x31cc();}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']=a22_0x12ccdc(0x1c3);[a22_0x12ccdc(0x1a3)]=a22_0x12ccdc(0x191);async[a22_0x12ccdc(0x1a9)](_0x345661){const _0x165804=a22_0x12ccdc,{options:_0x49c8d6,args:_0x2b098,tdx:_0x375d50}=_0x345661,_0x19ed2c=_0x49c8d6;if(_0x2b098[_0x165804(0x1b2)]===0x0)return console[_0x165804(0x1b8)](_0x165804(0x1be)),console['error'](_0x165804(0x1a1)),0x1;const _0x26db2f=_0x2b098[0x0];if(!_0x19ed2c[_0x165804(0x1b0)]||!_0x19ed2c['table'])return console[_0x165804(0x1b8)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x165804(0x1b8)](_0x165804(0x1a1)),0x1;_0x19ed2c[_0x165804(0x1ba)]&&(console[_0x165804(0x1b8)](_0x165804(0x1a2)+_0x19ed2c[_0x165804(0x1ac)]),console[_0x165804(0x1b8)]('Name:\x20'+_0x26db2f),console[_0x165804(0x1b8)](_0x165804(0x1c1)+_0x19ed2c['database']),console[_0x165804(0x1b8)]('Table:\x20'+_0x19ed2c[_0x165804(0x194)]));const _0x12d713=await loadJSONFromOptions(_0x19ed2c[_0x165804(0x195)],_0x19ed2c[_0x165804(0x19c)]),_0xcbed50=await loadJSONFromOptions(_0x19ed2c[_0x165804(0x1b9)],_0x19ed2c[_0x165804(0x1a8)]),_0x136f7=await loadJSONFromOptions(_0x19ed2c[_0x165804(0x192)],_0x19ed2c[_0x165804(0x1ab)]),_0x3bb3b2={'name':_0x26db2f,'description':_0x19ed2c[_0x165804(0x1a3)],'scheduleType':_0x19ed2c[_0x165804(0x19b)],'scheduleOption':_0x19ed2c[_0x165804(0x1a5)],'timezone':_0x19ed2c[_0x165804(0x1af)],'master':{'parentDatabaseName':_0x19ed2c[_0x165804(0x1b0)],'parentTableName':_0x19ed2c[_0x165804(0x194)]},'attributes':_0x12d713,'behaviors':_0xcbed50,'customerGroup':_0x136f7},_0x326e24=await withSpinner(_0x165804(0x198)+_0x26db2f+'\x27...',()=>_0x375d50[_0x165804(0x1a6)][_0x165804(0x1bb)](_0x3bb3b2),{'verbose':_0x49c8d6[_0x165804(0x1ba)]}),_0x226caf=_0x326e24[_0x165804(0x1a4)];return console['error'](_0x165804(0x1bd)+_0x226caf[_0x165804(0x1bf)]+'\x27\x20with\x20ID:\x20'+_0x226caf['id']),await handleSDKOutput([_0x226caf],_0x49c8d6),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x12ccdc(0x1bf)]='segment:parent:update';[a22_0x12ccdc(0x1a3)]=a22_0x12ccdc(0x193);async[a22_0x12ccdc(0x1a9)](_0x64e871){const _0x4253cd=a22_0x12ccdc,{options:_0x1afa17,args:_0x4de8ed,tdx:_0x5ea16d}=_0x64e871,_0x5f5456=_0x1afa17;if(_0x4de8ed[_0x4253cd(0x1b2)]===0x0)return console['error'](_0x4253cd(0x1be)),console[_0x4253cd(0x1b8)](_0x4253cd(0x1b1)),0x1;const _0x1af36c=_0x4de8ed[0x0];_0x5f5456[_0x4253cd(0x1ba)]&&(console[_0x4253cd(0x1b8)](_0x4253cd(0x1a2)+_0x5f5456[_0x4253cd(0x1ac)]),console[_0x4253cd(0x1b8)](_0x4253cd(0x1b4)+_0x1af36c));const _0x29cec8=await withSpinner(_0x4253cd(0x1a7)+_0x1af36c+_0x4253cd(0x1aa),()=>_0x5ea16d[_0x4253cd(0x1a6)]['getParentFull'](_0x1af36c),{'verbose':_0x5f5456['verbose']}),_0x5ae4f4=_0x29cec8[_0x4253cd(0x1a4)],_0x189da9=await loadJSONFromOptions(_0x5f5456[_0x4253cd(0x197)],_0x5f5456[_0x4253cd(0x1c2)]),_0x238e17=await loadJSONFromOptions(_0x5f5456[_0x4253cd(0x1bc)],_0x5f5456[_0x4253cd(0x19d)]),_0x51cb6f={'name':_0x5ae4f4[_0x4253cd(0x1bf)],'description':_0x5f5456[_0x4253cd(0x1a3)]!==undefined?_0x5f5456[_0x4253cd(0x1a3)]:_0x5ae4f4[_0x4253cd(0x1a3)],'scheduleType':_0x5f5456[_0x4253cd(0x19b)]!==undefined?_0x5f5456[_0x4253cd(0x19b)]:_0x5ae4f4[_0x4253cd(0x19b)],'scheduleOption':_0x5f5456['scheduleOption']!==undefined?_0x5f5456[_0x4253cd(0x1a5)]:_0x5ae4f4['scheduleOption'],'timezone':_0x5f5456[_0x4253cd(0x1af)]!==undefined?_0x5f5456['timezone']:_0x5ae4f4[_0x4253cd(0x1af)],'master':_0x5ae4f4[_0x4253cd(0x19f)],'attributes':_0x189da9?[..._0x5ae4f4[_0x4253cd(0x195)]||[],..._0x189da9]:_0x5ae4f4[_0x4253cd(0x195)],'behaviors':_0x238e17?[..._0x5ae4f4[_0x4253cd(0x1b9)]||[],..._0x238e17]:_0x5ae4f4[_0x4253cd(0x1b9)],'customerGroup':_0x5ae4f4['customerGroup']},_0x275139=await withSpinner(_0x4253cd(0x19e)+_0x1af36c+_0x4253cd(0x1aa),()=>_0x5ea16d['segment']['updateParent'](_0x1af36c,_0x51cb6f),{'verbose':_0x5f5456['verbose']}),_0x21df39=_0x275139[_0x4253cd(0x1a4)];return console[_0x4253cd(0x1b8)](_0x4253cd(0x1ae)+_0x21df39[_0x4253cd(0x1bf)]+'\x27'),await handleSDKOutput([_0x21df39],_0x5f5456),0x0;}}
1
+ const a24_0x501e75=a24_0x27ed;(function(_0x59b023,_0x2c87b0){const _0x23df4a=a24_0x27ed,_0x103df1=_0x59b023();while(!![]){try{const _0x477489=-parseInt(_0x23df4a(0x1fd))/0x1+parseInt(_0x23df4a(0x207))/0x2+parseInt(_0x23df4a(0x210))/0x3*(-parseInt(_0x23df4a(0x201))/0x4)+-parseInt(_0x23df4a(0x1f0))/0x5*(-parseInt(_0x23df4a(0x1e7))/0x6)+-parseInt(_0x23df4a(0x208))/0x7*(parseInt(_0x23df4a(0x1fb))/0x8)+parseInt(_0x23df4a(0x1f5))/0x9*(parseInt(_0x23df4a(0x1f6))/0xa)+parseInt(_0x23df4a(0x215))/0xb;if(_0x477489===_0x2c87b0)break;else _0x103df1['push'](_0x103df1['shift']());}catch(_0x419c87){_0x103df1['push'](_0x103df1['shift']());}}}(a24_0x4624,0x2b8ea));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{[a24_0x501e75(0x1ed)]=a24_0x501e75(0x1e1);[a24_0x501e75(0x1e6)]=a24_0x501e75(0x1f7);async[a24_0x501e75(0x20c)](_0x4d449b){const _0x13fc5d=a24_0x501e75,{options:_0x22004f,args:_0x37c63e,tdx:_0x2363d2}=_0x4d449b,_0x5e2d3b=_0x22004f;if(_0x37c63e[_0x13fc5d(0x205)]===0x0)return console[_0x13fc5d(0x1e2)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x20f)),0x1;const _0x308112=_0x37c63e[0x0];if(!_0x5e2d3b['database']||!_0x5e2d3b[_0x13fc5d(0x1f1)])return console[_0x13fc5d(0x1e2)](_0x13fc5d(0x1ec)),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x20f)),0x1;_0x5e2d3b[_0x13fc5d(0x20a)]&&(console['error'](_0x13fc5d(0x1f2)+_0x5e2d3b[_0x13fc5d(0x20d)]),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x206)+_0x308112),console['error']('Database:\x20'+_0x5e2d3b[_0x13fc5d(0x1e0)]),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x1f3)+_0x5e2d3b[_0x13fc5d(0x1f1)]));const _0x52ad58=await loadJSONFromOptions(_0x5e2d3b['attributes'],_0x5e2d3b[_0x13fc5d(0x1f8)]),_0x357ba4=await loadJSONFromOptions(_0x5e2d3b[_0x13fc5d(0x1ff)],_0x5e2d3b[_0x13fc5d(0x20b)]),_0x37c220=await loadJSONFromOptions(_0x5e2d3b[_0x13fc5d(0x204)],_0x5e2d3b[_0x13fc5d(0x1f4)]),_0x5a501a={'name':_0x308112,'description':_0x5e2d3b[_0x13fc5d(0x1e6)],'scheduleType':_0x5e2d3b[_0x13fc5d(0x214)],'scheduleOption':_0x5e2d3b[_0x13fc5d(0x20e)],'timezone':_0x5e2d3b['timezone'],'master':{'parentDatabaseName':_0x5e2d3b[_0x13fc5d(0x1e0)],'parentTableName':_0x5e2d3b[_0x13fc5d(0x1f1)]},'attributes':_0x52ad58,'behaviors':_0x357ba4,'customerGroup':_0x37c220},_0x4587f1=await withSpinner(_0x13fc5d(0x202)+_0x308112+'\x27...',()=>_0x2363d2['segment'][_0x13fc5d(0x1e3)](_0x5a501a),{'verbose':_0x22004f[_0x13fc5d(0x20a)]}),_0x3ef004=_0x4587f1[_0x13fc5d(0x1e8)];return console[_0x13fc5d(0x1e2)](_0x13fc5d(0x212)+_0x3ef004['name']+'\x27\x20with\x20ID:\x20'+_0x3ef004['id']),await handleSDKOutput([_0x3ef004],_0x22004f),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a24_0x501e75(0x1ed)]=a24_0x501e75(0x1eb);[a24_0x501e75(0x1e6)]=a24_0x501e75(0x211);async['execute'](_0xd41d6a){const _0xbdd198=a24_0x501e75,{options:_0x6884d6,args:_0x4d0748,tdx:_0x4496f8}=_0xd41d6a,_0x1ea6cc=_0x6884d6;if(_0x4d0748['length']===0x0)return console[_0xbdd198(0x1e2)](_0xbdd198(0x203)),console['error'](_0xbdd198(0x1fe)),0x1;const _0xbd55ea=_0x4d0748[0x0];_0x1ea6cc['verbose']&&(console[_0xbdd198(0x1e2)]('Site:\x20'+_0x1ea6cc[_0xbdd198(0x20d)]),console[_0xbdd198(0x1e2)](_0xbdd198(0x1f9)+_0xbd55ea));const _0x351f1f=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0xbd55ea+_0xbdd198(0x1fa),()=>_0x4496f8[_0xbdd198(0x213)][_0xbdd198(0x1e4)](_0xbd55ea),{'verbose':_0x1ea6cc[_0xbdd198(0x20a)]}),_0xfcba98=_0x351f1f[_0xbdd198(0x1e8)],_0x16790b=await loadJSONFromOptions(_0x1ea6cc[_0xbdd198(0x209)],_0x1ea6cc[_0xbdd198(0x200)]),_0x139fe8=await loadJSONFromOptions(_0x1ea6cc[_0xbdd198(0x1ea)],_0x1ea6cc[_0xbdd198(0x1ef)]),_0x96caa0={'name':_0xfcba98[_0xbdd198(0x1ed)],'description':_0x1ea6cc[_0xbdd198(0x1e6)]!==undefined?_0x1ea6cc[_0xbdd198(0x1e6)]:_0xfcba98['description'],'scheduleType':_0x1ea6cc[_0xbdd198(0x214)]!==undefined?_0x1ea6cc[_0xbdd198(0x214)]:_0xfcba98[_0xbdd198(0x214)],'scheduleOption':_0x1ea6cc[_0xbdd198(0x20e)]!==undefined?_0x1ea6cc[_0xbdd198(0x20e)]:_0xfcba98[_0xbdd198(0x20e)],'timezone':_0x1ea6cc[_0xbdd198(0x1ee)]!==undefined?_0x1ea6cc[_0xbdd198(0x1ee)]:_0xfcba98[_0xbdd198(0x1ee)],'master':_0xfcba98[_0xbdd198(0x1e5)],'attributes':_0x16790b?[..._0xfcba98[_0xbdd198(0x1fc)]||[],..._0x16790b]:_0xfcba98[_0xbdd198(0x1fc)],'behaviors':_0x139fe8?[..._0xfcba98[_0xbdd198(0x1ff)]||[],..._0x139fe8]:_0xfcba98[_0xbdd198(0x1ff)],'customerGroup':_0xfcba98[_0xbdd198(0x204)]},_0x2884e5=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0xbd55ea+_0xbdd198(0x1fa),()=>_0x4496f8[_0xbdd198(0x213)]['updateParent'](_0xbd55ea,_0x96caa0),{'verbose':_0x1ea6cc['verbose']}),_0x11fe0e=_0x2884e5['data'];return console[_0xbdd198(0x1e2)](_0xbdd198(0x1e9)+_0x11fe0e[_0xbdd198(0x1ed)]+'\x27'),await handleSDKOutput([_0x11fe0e],_0x1ea6cc),0x0;}}function a24_0x27ed(_0x421141,_0x2e1a1a){const _0x46248c=a24_0x4624();return a24_0x27ed=function(_0x27ed34,_0x43ca03){_0x27ed34=_0x27ed34-0x1e0;let _0x2f6f46=_0x46248c[_0x27ed34];return _0x2f6f46;},a24_0x27ed(_0x421141,_0x2e1a1a);}function a24_0x4624(){const _0x188ee1=['80veLUjA','Create\x20new\x20parent\x20segment\x20(audience)','attributesFile','Parent\x20segment:\x20','\x27...','56xCtqJM','attributes','191244ePVaZz','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','behaviors','addAttributesFile','20XIfpfs','Creating\x20parent\x20segment\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','customerGroup','length','Name:\x20','280404hXuRbH','3017wpfagR','addAttributes','verbose','behaviorsFile','execute','site','scheduleOption','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','150933iIwJZv','Update\x20existing\x20parent\x20segment\x20(audience)','✔\x20Created\x20parent\x20segment\x20\x27','segment','scheduleType','150579eqTpyg','database','segment:parent:create','error','createParent','getParentFull','master','description','6HrHGuh','data','✔\x20Updated\x20parent\x20segment\x20\x27','addBehaviors','segment:parent:update','Error:\x20--database\x20and\x20--table\x20are\x20required','name','timezone','addBehaviorsFile','647275nTvblp','table','Site:\x20','Table:\x20','customerGroupFile','383490QyrVmj'];a24_0x4624=function(){return _0x188ee1;};return a24_0x4624();}
@@ -1 +1 @@
1
- const a23_0x2d6f8f=a23_0x6c6b;function a23_0x5df6(){const _0xccc886=['58852442XdRNkW','length','10876134XmQvCo','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','1697668CBulcZ','10sPelgT','5730513QfJxFH','917384stTAim','7NBpgZJ','1zOVoJe','config','13833801eAjGUt','1641800fWOidr','name','5qpEfKr','\x20\x20Global:\x20~/.config/tdx/tdx.json','List\x20all\x20available\x20profiles','log','profiles','description','message','scope','12ihQtuq'];a23_0x5df6=function(){return _0xccc886;};return a23_0x5df6();}function a23_0x6c6b(_0x522efe,_0x423c8c){const _0x5df689=a23_0x5df6();return a23_0x6c6b=function(_0x6c6bb5,_0x53a7ba){_0x6c6bb5=_0x6c6bb5-0x6e;let _0x43a7d5=_0x5df689[_0x6c6bb5];return _0x43a7d5;},a23_0x6c6b(_0x522efe,_0x423c8c);}(function(_0xc539f,_0x1d502b){const _0x287931=a23_0x6c6b,_0x3f8b03=_0xc539f();while(!![]){try{const _0xad7772=parseInt(_0x287931(0x7a))/0x1*(parseInt(_0x287931(0x78))/0x2)+parseInt(_0x287931(0x77))/0x3+parseInt(_0x287931(0x75))/0x4*(parseInt(_0x287931(0x7f))/0x5)+parseInt(_0x287931(0x73))/0x6*(parseInt(_0x287931(0x79))/0x7)+parseInt(_0x287931(0x7d))/0x8+-parseInt(_0x287931(0x7c))/0x9*(-parseInt(_0x287931(0x76))/0xa)+-parseInt(_0x287931(0x71))/0xb*(parseInt(_0x287931(0x70))/0xc);if(_0xad7772===_0x1d502b)break;else _0x3f8b03['push'](_0x3f8b03['shift']());}catch(_0x2b77e0){_0x3f8b03['push'](_0x3f8b03['shift']());}}}(a23_0x5df6,0xf3aad));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{[a23_0x2d6f8f(0x7e)]=a23_0x2d6f8f(0x83);['description']=a23_0x2d6f8f(0x81);async['execute'](_0x52235c){const _0x2dd73a=a23_0x2d6f8f,{options:_0xc83717}=_0x52235c;try{const _0x2cd4cf=listProfiles(),_0x40f5cf=getActiveProfile();if(_0x2cd4cf[_0x2dd73a(0x72)]===0x0)return console[_0x2dd73a(0x82)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x2dd73a(0x82)](_0x2dd73a(0x74)),console['log'](_0x2dd73a(0x80)),0x0;const _0x2ebe6f=_0x2cd4cf['map'](_0x2ec0c3=>{const _0x555cf0=_0x2dd73a,_0x24d212=_0x2ec0c3[_0x555cf0(0x7e)]===_0x40f5cf,_0x2505cd=getProfileParams(_0x2ec0c3[_0x555cf0(0x7b)]);return{'name':_0x2ec0c3[_0x555cf0(0x7e)],'active':_0x24d212,'scope':_0x2ec0c3[_0x555cf0(0x6f)],'description':_0x2ec0c3[_0x555cf0(0x7b)][_0x555cf0(0x84)]||'','params':_0x2505cd};});return await handleSDKOutput(_0x2ebe6f,_0xc83717),0x0;}catch(_0x5e1b3f){return _0x5e1b3f instanceof Error&&console['error']('Error:\x20'+_0x5e1b3f[_0x2dd73a(0x6e)]),0x1;}}}
1
+ const a25_0x3cec3f=a25_0x4816;(function(_0x233c98,_0x17833e){const _0x525ff1=a25_0x4816,_0x7dfdf5=_0x233c98();while(!![]){try{const _0x51fd56=-parseInt(_0x525ff1(0x9d))/0x1*(parseInt(_0x525ff1(0xb0))/0x2)+parseInt(_0x525ff1(0xa1))/0x3+parseInt(_0x525ff1(0xa0))/0x4+parseInt(_0x525ff1(0xa2))/0x5+parseInt(_0x525ff1(0x9f))/0x6*(-parseInt(_0x525ff1(0xb3))/0x7)+parseInt(_0x525ff1(0xa6))/0x8+-parseInt(_0x525ff1(0xaa))/0x9;if(_0x51fd56===_0x17833e)break;else _0x7dfdf5['push'](_0x7dfdf5['shift']());}catch(_0x100f97){_0x7dfdf5['push'](_0x7dfdf5['shift']());}}}(a25_0xd2c3,0xdb46d));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a25_0xd2c3(){const _0x155979=['5608280MCaUGK','4840644XAcIjI','8845335nsbqPv','profiles','error','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','3071736ntOzWZ','Error:\x20','\x20\x20Global:\x20~/.config/tdx/tdx.json','message','15722073yrhwTH','scope','List\x20all\x20available\x20profiles','log','config','description','704Ddahlx','length','execute','154rFQOhZ','map','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2848bGEZya','name','414846artfqC'];a25_0xd2c3=function(){return _0x155979;};return a25_0xd2c3();}function a25_0x4816(_0x52e974,_0x120b4b){const _0xd2c399=a25_0xd2c3();return a25_0x4816=function(_0x48160f,_0x4cea03){_0x48160f=_0x48160f-0x9c;let _0x2f98bd=_0xd2c399[_0x48160f];return _0x2f98bd;},a25_0x4816(_0x52e974,_0x120b4b);}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a25_0x3cec3f(0x9e)]=a25_0x3cec3f(0xa3);['description']=a25_0x3cec3f(0xac);async[a25_0x3cec3f(0xb2)](_0x3fed9e){const _0x133b68=a25_0x3cec3f,{options:_0x50452c}=_0x3fed9e;try{const _0x1e718e=listProfiles(),_0x3d7ce9=getActiveProfile();if(_0x1e718e[_0x133b68(0xb1)]===0x0)return console[_0x133b68(0xad)](_0x133b68(0xa5)),console[_0x133b68(0xad)](_0x133b68(0x9c)),console[_0x133b68(0xad)](_0x133b68(0xa8)),0x0;const _0x2eebbb=_0x1e718e[_0x133b68(0xb4)](_0x4aed93=>{const _0xa41f4=_0x133b68,_0x3675b5=_0x4aed93['name']===_0x3d7ce9,_0xa3bbfe=getProfileParams(_0x4aed93[_0xa41f4(0xae)]);return{'name':_0x4aed93[_0xa41f4(0x9e)],'active':_0x3675b5,'scope':_0x4aed93[_0xa41f4(0xab)],'description':_0x4aed93[_0xa41f4(0xae)][_0xa41f4(0xaf)]||'','params':_0xa3bbfe};});return await handleSDKOutput(_0x2eebbb,_0x50452c),0x0;}catch(_0x43162f){return _0x43162f instanceof Error&&console[_0x133b68(0xa4)](_0x133b68(0xa7)+_0x43162f[_0x133b68(0xa9)]),0x1;}}}
@@ -1 +1 @@
1
- const a24_0x365ce1=a24_0xdac9;function a24_0x5028(){const _0xd837dd=['in\x20','18554LXimLt','...','name','data','error','jobId','224150QriRiN','information_schema','47652xWWUpx','elapsedTimeMillis','Executing\x20statement\x20','options','database','Executing\x20query\x20[','message','SQL:\x20','Error:\x20','1195348djFLQo','setPhase','output','args','\x20rows\x20','length','verbose','file','20kOBkaz','Site:\x20','processedRows','9BJmyVX','completedSplits','site','Statement\x20','query','stats','\x20splits','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','3118866YDlezt','state','735664mcFxgU','originalMessage','Run\x20Trino\x20queries\x20(streaming)','setExtra','\x20[Job\x20ID:\x20','47176wGiXcr','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','totalSplits','push','Schema:\x20','execute','catalog','253JkSJSv','177rLxJRv'];a24_0x5028=function(){return _0xd837dd;};return a24_0x5028();}(function(_0x3f7c81,_0x5afcce){const _0x1f474b=a24_0xdac9,_0x132530=_0x3f7c81();while(!![]){try{const _0x493e95=parseInt(_0x1f474b(0xea))/0x1+-parseInt(_0x1f474b(0xe2))/0x2*(parseInt(_0x1f474b(0xe0))/0x3)+-parseInt(_0x1f474b(0x10d))/0x4*(-parseInt(_0x1f474b(0xfb))/0x5)+parseInt(_0x1f474b(0x106))/0x6+-parseInt(_0x1f474b(0xf3))/0x7+parseInt(_0x1f474b(0x108))/0x8*(-parseInt(_0x1f474b(0xfe))/0x9)+-parseInt(_0x1f474b(0xe8))/0xa*(-parseInt(_0x1f474b(0xdf))/0xb);if(_0x493e95===_0x5afcce)break;else _0x132530['push'](_0x132530['shift']());}catch(_0x2ee7a1){_0x132530['push'](_0x132530['shift']());}}}(a24_0x5028,0x4e277));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a24_0xdac9(_0x4b5489,_0x5f2ece){const _0x502890=a24_0x5028();return a24_0xdac9=function(_0xdac9dd,_0x85b661){_0xdac9dd=_0xdac9dd-0xdd;let _0x59d2cd=_0x502890[_0xdac9dd];return _0x59d2cd;},a24_0xdac9(_0x4b5489,_0x5f2ece);}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{[a24_0x365ce1(0xe4)]=a24_0x365ce1(0x102);['description']=a24_0x365ce1(0x10a);async[a24_0x365ce1(0xdd)](_0x3e65a2){const _0x47abc1=a24_0x365ce1,{options:_0x1bb65d,args:_0x148db1,tdx:_0x321889}=_0x3e65a2,_0x31b686=_0x148db1[0x0],_0x297cf9=_0x1bb65d[_0x47abc1(0xfa)];let _0x10add6;if(_0x297cf9)try{_0x10add6=readSqlStatementsFromFile(_0x297cf9);}catch(_0x1c058c){return console[_0x47abc1(0xe6)]('Error:\x20'+_0x1c058c['message']),0x1;}else try{_0x10add6=splitSqlStatements(_0x31b686);}catch(_0x53d4d2){return console[_0x47abc1(0xe6)](_0x47abc1(0xf2)+_0x53d4d2[_0x47abc1(0xf0)]),0x1;}const _0x4cad19=_0x1bb65d[_0x47abc1(0xee)]||_0x47abc1(0xe9),_0x49dd6c=_0x1bb65d[_0x47abc1(0xde)];try{const _0x53d1b6=[],_0x320bbb=!!_0x1bb65d['output'];for(let _0x186f86=0x0;_0x186f86<_0x10add6[_0x47abc1(0xf8)];_0x186f86++){const _0x5397cf=_0x10add6[_0x186f86],_0xd9d50c=_0x186f86+0x1,_0x42a969=_0x10add6['length'],_0x2dcced=_0x42a969>0x1;_0x1bb65d[_0x47abc1(0xf9)]&&(console['error']('\x0a'+(_0x2dcced?_0x47abc1(0x101)+_0xd9d50c+'/'+_0x42a969+':':'')),console[_0x47abc1(0xe6)](_0x47abc1(0xfc)+_0x1bb65d[_0x47abc1(0x100)]),console[_0x47abc1(0xe6)]('Catalog:\x20'+(_0x49dd6c||'td')),console[_0x47abc1(0xe6)](_0x47abc1(0x111)+_0x4cad19),console['error'](_0x47abc1(0xf1)+_0x5397cf));const _0x4ca589=_0x2dcced?_0x47abc1(0xec)+_0xd9d50c+'/'+_0x42a969+_0x47abc1(0xe3):'Executing\x20query...';try{const _0x2e7d21=await withQuerySpinner(_0x4ca589,async _0xd30094=>{const _0x13a28d=_0x47abc1,_0x140eed=await _0x321889[_0x13a28d(0x102)][_0x13a28d(0xdd)](_0x5397cf,{'catalog':_0x49dd6c,'schema':_0x4cad19,'onJobId':_0x75b85=>{_0xd30094['setJobId'](_0x75b85);},'onProgress':_0xd5f7c4=>{const _0x12c1d7=_0x13a28d;_0xd30094[_0x12c1d7(0xf4)](_0x12c1d7(0xef)+_0xd5f7c4[_0x12c1d7(0x107)]+']'),_0xd30094[_0x12c1d7(0x10b)](formatRows(_0xd5f7c4[_0x12c1d7(0xfd)])+_0x12c1d7(0xf7)+_0xd5f7c4[_0x12c1d7(0xff)]+'/'+_0xd5f7c4[_0x12c1d7(0x10f)]+_0x12c1d7(0x104));}});return _0x140eed;},{'verbose':_0x1bb65d[_0x47abc1(0xf9)]}),_0xad5912=_0x2e7d21[_0x47abc1(0xe5)],_0x227078=_0xad5912['jobId']?_0x47abc1(0x10c)+_0xad5912[_0x47abc1(0xe7)]+']':'',_0x1b8e9e=_0x2dcced?_0x47abc1(0x101)+_0xd9d50c+'/'+_0x42a969+'\x20-\x20':'';console[_0x47abc1(0xe6)]('✔\x20'+_0x1b8e9e+'Query\x20completed:\x20Processed\x20'+formatRows(_0xad5912[_0x47abc1(0x103)][_0x47abc1(0xfd)])+_0x47abc1(0xf7)+(_0x47abc1(0xe1)+formatElapsed(_0xad5912[_0x47abc1(0x103)][_0x47abc1(0xeb)])+_0x227078));if(_0x2dcced&&_0x320bbb){const _0x1a3b03=resolveOutputOptions(_0x1bb65d),_0x25cd51=await formatQueryOutput(_0xad5912,_0x1a3b03);_0x53d1b6[_0x47abc1(0x110)](_0x25cd51);}else await handleQueryOutput(_0xad5912,_0x1bb65d);}catch(_0x7a2cc){const _0x11382a=_0x2dcced?_0x47abc1(0x101)+_0xd9d50c+'/'+_0x42a969+':\x0a':'',_0x321dc0=_0x7a2cc instanceof SDKError?_0x7a2cc[_0x47abc1(0x109)]:_0x7a2cc[_0x47abc1(0xf0)];return console[_0x47abc1(0xe6)](''+_0x11382a+_0x321dc0),0x1;}}if(_0x10add6[_0x47abc1(0xf8)]>0x1&&_0x320bbb&&_0x53d1b6['length']>0x0){const _0x3cc1da=_0x53d1b6['join']('\x0a');writeFileSync(_0x1bb65d[_0x47abc1(0xf5)],_0x3cc1da),console[_0x47abc1(0xe6)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x1bb65d[_0x47abc1(0xf5)]);}return 0x0;}catch(_0x111321){throw _0x111321;}}['validate'](_0x554f67){const _0x65bfb9=a24_0x365ce1,_0x36eee7=_0x554f67[_0x65bfb9(0xf6)][0x0],_0x148ac9=_0x554f67[_0x65bfb9(0xed)]['file'];if(!_0x36eee7&&!_0x148ac9)return _0x65bfb9(0x105);if(_0x36eee7&&_0x148ac9)return _0x65bfb9(0x10e);return undefined;}}
1
+ const a26_0x135fcb=a26_0x22ff;(function(_0x448500,_0x1104d7){const _0x3c12a5=a26_0x22ff,_0x5c1abe=_0x448500();while(!![]){try{const _0x3d8681=parseInt(_0x3c12a5(0x186))/0x1*(-parseInt(_0x3c12a5(0x179))/0x2)+parseInt(_0x3c12a5(0x181))/0x3*(parseInt(_0x3c12a5(0x192))/0x4)+-parseInt(_0x3c12a5(0x182))/0x5+-parseInt(_0x3c12a5(0x17f))/0x6*(-parseInt(_0x3c12a5(0x1a3))/0x7)+-parseInt(_0x3c12a5(0x194))/0x8*(-parseInt(_0x3c12a5(0x17c))/0x9)+-parseInt(_0x3c12a5(0x175))/0xa+parseInt(_0x3c12a5(0x196))/0xb*(parseInt(_0x3c12a5(0x18c))/0xc);if(_0x3d8681===_0x1104d7)break;else _0x5c1abe['push'](_0x5c1abe['shift']());}catch(_0x4b347f){_0x5c1abe['push'](_0x5c1abe['shift']());}}}(a26_0x388e,0x43674));function a26_0x22ff(_0x37d171,_0x5fe25d){const _0x388ee2=a26_0x388e();return a26_0x22ff=function(_0x22ff05,_0x12f609){_0x22ff05=_0x22ff05-0x174;let _0x23245b=_0x388ee2[_0x22ff05];return _0x23245b;},a26_0x22ff(_0x37d171,_0x5fe25d);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a26_0x388e(){const _0x36b9d9=['completedSplits','27154wbqRDb','\x20rows\x20','\x20[Job\x20ID:\x20','423rAcpvV','\x0aAll\x20results\x20saved\x20to\x20','catalog','1178946ENCGeO','query','52629KAFFlk','1723825vmMQEw','stats','SQL:\x20','file','35ZSEiob','Error:\x20','totalSplits','Catalog:\x20','information_schema','validate','7626756QBeyQI','\x20-\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','in\x20','Executing\x20statement\x20','elapsedTimeMillis','4txwbGx','database','38728lZkOQx','length','11vUyAbr','\x20splits','verbose','data','...','args','error','Schema:\x20','originalMessage','Query\x20completed:\x20Processed\x20','description','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','execute','14dUtnJF','output','push','jobId','Statement\x20','1775710WYOEqt','site','message'];a26_0x388e=function(){return _0x36b9d9;};return a26_0x388e();}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']=a26_0x135fcb(0x180);[a26_0x135fcb(0x1a0)]='Run\x20Trino\x20queries\x20(streaming)';async[a26_0x135fcb(0x1a2)](_0x47f72f){const _0x4475fc=a26_0x135fcb,{options:_0x54ec02,args:_0x37eea4,tdx:_0x35f00c}=_0x47f72f,_0x223ee6=_0x37eea4[0x0],_0xfb50aa=_0x54ec02[_0x4475fc(0x185)];let _0x5480cf;if(_0xfb50aa)try{_0x5480cf=readSqlStatementsFromFile(_0xfb50aa);}catch(_0x48f831){return console[_0x4475fc(0x19c)](_0x4475fc(0x187)+_0x48f831[_0x4475fc(0x177)]),0x1;}else try{_0x5480cf=splitSqlStatements(_0x223ee6);}catch(_0x446240){return console[_0x4475fc(0x19c)](_0x4475fc(0x187)+_0x446240[_0x4475fc(0x177)]),0x1;}const _0x5385a6=_0x54ec02[_0x4475fc(0x193)]||_0x4475fc(0x18a),_0x4b3e33=_0x54ec02[_0x4475fc(0x17e)];try{const _0x46d82b=[],_0x4f8011=!!_0x54ec02[_0x4475fc(0x1a4)];for(let _0x6e81f0=0x0;_0x6e81f0<_0x5480cf['length'];_0x6e81f0++){const _0x3ec90e=_0x5480cf[_0x6e81f0],_0x2cfa4f=_0x6e81f0+0x1,_0x55e8f9=_0x5480cf[_0x4475fc(0x195)],_0x2fe0d2=_0x55e8f9>0x1;_0x54ec02[_0x4475fc(0x198)]&&(console[_0x4475fc(0x19c)]('\x0a'+(_0x2fe0d2?'Statement\x20'+_0x2cfa4f+'/'+_0x55e8f9+':':'')),console[_0x4475fc(0x19c)]('Site:\x20'+_0x54ec02[_0x4475fc(0x176)]),console[_0x4475fc(0x19c)](_0x4475fc(0x189)+(_0x4b3e33||'td')),console['error'](_0x4475fc(0x19d)+_0x5385a6),console[_0x4475fc(0x19c)](_0x4475fc(0x184)+_0x3ec90e));const _0x3358ee=_0x2fe0d2?_0x4475fc(0x190)+_0x2cfa4f+'/'+_0x55e8f9+_0x4475fc(0x19a):'Executing\x20query...';try{const _0x1078c4=await withQuerySpinner(_0x3358ee,async _0x15e32b=>{const _0x3584db=_0x4475fc,_0xe482ce=await _0x35f00c[_0x3584db(0x180)]['execute'](_0x3ec90e,{'catalog':_0x4b3e33,'schema':_0x5385a6,'onJobId':_0x359740=>{_0x15e32b['setJobId'](_0x359740);},'onProgress':_0x1f49b9=>{const _0x280036=_0x3584db;_0x15e32b['setPhase']('Executing\x20query\x20['+_0x1f49b9['state']+']'),_0x15e32b['setExtra'](formatRows(_0x1f49b9['processedRows'])+_0x280036(0x17a)+_0x1f49b9[_0x280036(0x178)]+'/'+_0x1f49b9[_0x280036(0x188)]+_0x280036(0x197));}});return _0xe482ce;},{'verbose':_0x54ec02[_0x4475fc(0x198)]}),_0x1b24cd=_0x1078c4[_0x4475fc(0x199)],_0x1b0416=_0x1b24cd[_0x4475fc(0x1a6)]?_0x4475fc(0x17b)+_0x1b24cd[_0x4475fc(0x1a6)]+']':'',_0x2e79ec=_0x2fe0d2?_0x4475fc(0x174)+_0x2cfa4f+'/'+_0x55e8f9+_0x4475fc(0x18d):'';console[_0x4475fc(0x19c)]('✔\x20'+_0x2e79ec+_0x4475fc(0x19f)+formatRows(_0x1b24cd[_0x4475fc(0x183)]['processedRows'])+_0x4475fc(0x17a)+(_0x4475fc(0x18f)+formatElapsed(_0x1b24cd['stats'][_0x4475fc(0x191)])+_0x1b0416));if(_0x2fe0d2&&_0x4f8011){const _0x2db1c6=resolveOutputOptions(_0x54ec02),_0x410865=await formatQueryOutput(_0x1b24cd,_0x2db1c6);_0x46d82b[_0x4475fc(0x1a5)](_0x410865);}else await handleQueryOutput(_0x1b24cd,_0x54ec02);}catch(_0x38165e){const _0x1eb405=_0x2fe0d2?'Statement\x20'+_0x2cfa4f+'/'+_0x55e8f9+':\x0a':'',_0x3cc769=_0x38165e instanceof SDKError?_0x38165e[_0x4475fc(0x19e)]:_0x38165e[_0x4475fc(0x177)];return console[_0x4475fc(0x19c)](''+_0x1eb405+_0x3cc769),0x1;}}if(_0x5480cf[_0x4475fc(0x195)]>0x1&&_0x4f8011&&_0x46d82b[_0x4475fc(0x195)]>0x0){const _0x2bcd89=_0x46d82b['join']('\x0a');writeFileSync(_0x54ec02[_0x4475fc(0x1a4)],_0x2bcd89),console[_0x4475fc(0x19c)](_0x4475fc(0x17d)+_0x54ec02[_0x4475fc(0x1a4)]);}return 0x0;}catch(_0x4e0a5d){throw _0x4e0a5d;}}[a26_0x135fcb(0x18b)](_0x311e52){const _0x2325b5=a26_0x135fcb,_0x4ef26c=_0x311e52[_0x2325b5(0x19b)][0x0],_0xd9d065=_0x311e52['options'][_0x2325b5(0x185)];if(!_0x4ef26c&&!_0xd9d065)return _0x2325b5(0x1a1);if(_0x4ef26c&&_0xd9d065)return _0x2325b5(0x18e);return undefined;}}
@@ -1 +1 @@
1
- const a25_0x1b0f17=a25_0x37b6;(function(_0x5c2395,_0x4f1bc3){const _0xcd0356=a25_0x37b6,_0x48ac3e=_0x5c2395();while(!![]){try{const _0x255244=-parseInt(_0xcd0356(0x1f5))/0x1*(parseInt(_0xcd0356(0x1fe))/0x2)+parseInt(_0xcd0356(0x216))/0x3*(-parseInt(_0xcd0356(0x1fc))/0x4)+parseInt(_0xcd0356(0x1d6))/0x5+-parseInt(_0xcd0356(0x21d))/0x6*(parseInt(_0xcd0356(0x1c2))/0x7)+-parseInt(_0xcd0356(0x20f))/0x8*(-parseInt(_0xcd0356(0x1fb))/0x9)+-parseInt(_0xcd0356(0x1be))/0xa*(-parseInt(_0xcd0356(0x1ed))/0xb)+parseInt(_0xcd0356(0x1ea))/0xc;if(_0x255244===_0x4f1bc3)break;else _0x48ac3e['push'](_0x48ac3e['shift']());}catch(_0x48889a){_0x48ac3e['push'](_0x48ac3e['shift']());}}}(a25_0xe305,0x8cc74));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a25_0x37b6(_0x4ef331,_0x59df51){const _0xe30599=a25_0xe305();return a25_0x37b6=function(_0x37b604,_0x245eb5){_0x37b604=_0x37b604-0x1b7;let _0x16f59e=_0xe30599[_0x37b604];return _0x16f59e;},a25_0x37b6(_0x4ef331,_0x59df51);}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a25_0x1b0f17(0x1ce)]='segment:describe';[a25_0x1b0f17(0x1f0)]='Show\x20segment\x20or\x20folder\x20details';async[a25_0x1b0f17(0x20d)](_0x55844b){const _0x99d294=a25_0x1b0f17,{options:_0x56210a,args:_0x11d6c9,tdx:_0x4acf09}=_0x55844b,_0x2f5dc2=_0x11d6c9[0x0],_0x53e4d4=!_0x2f5dc2&&!!_0x56210a[_0x99d294(0x1d5)],_0x239ce9=_0x2f5dc2||_0x56210a['parentSegment'];if(!_0x239ce9)return console[_0x99d294(0x1d8)](_0x99d294(0x22a)),console['error'](_0x99d294(0x1bb)),console[_0x99d294(0x1d8)](_0x99d294(0x222)),console[_0x99d294(0x1d8)](_0x99d294(0x20e)),console['error'](_0x99d294(0x20b)),console[_0x99d294(0x1d8)](_0x99d294(0x1d7)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x49c597=_0x56210a[_0x99d294(0x209)];let _0x24a2b0=_0x239ce9;!_0x53e4d4&&_0x49c597&&!_0x239ce9[_0x99d294(0x21c)]('/')&&(_0x24a2b0=_0x49c597+'/'+_0x239ce9,_0x56210a[_0x99d294(0x1f4)]&&console[_0x99d294(0x1d8)](_0x99d294(0x1b9)+_0x24a2b0));const _0x4a9170=await withSpinner(_0x99d294(0x228)+_0x24a2b0+_0x99d294(0x1f3),()=>_0x4acf09[_0x99d294(0x1e7)][_0x99d294(0x217)](_0x24a2b0),{'verbose':_0x56210a[_0x99d294(0x1f4)]}),_0x408c8e=_0x4a9170[_0x99d294(0x1bd)];_0x56210a[_0x99d294(0x1f4)]&&(console[_0x99d294(0x1d8)](_0x99d294(0x1cd)+_0x408c8e[_0x99d294(0x201)]),console[_0x99d294(0x1d8)](_0x99d294(0x1ba)+_0x408c8e[_0x99d294(0x1c9)]),_0x408c8e[_0x99d294(0x1fa)]&&console[_0x99d294(0x1d8)](_0x99d294(0x1c7)+_0x408c8e[_0x99d294(0x1fa)]),_0x408c8e['segmentId']&&console[_0x99d294(0x1d8)](_0x99d294(0x1d0)+_0x408c8e[_0x99d294(0x1de)]));if(_0x408c8e[_0x99d294(0x201)]===_0x99d294(0x1eb)){const _0x311572=await withSpinner(_0x99d294(0x1ef),()=>_0x4acf09[_0x99d294(0x1e7)][_0x99d294(0x1c4)](_0x408c8e['parentId']),{'verbose':_0x56210a[_0x99d294(0x1f4)]});await handleSingleObjectOutput(_0x311572[_0x99d294(0x1bd)],_0x56210a);}else{if(_0x408c8e[_0x99d294(0x201)]===_0x99d294(0x1f7)){if(!_0x408c8e[_0x99d294(0x1fa)])throw new SDKError(ErrorCode[_0x99d294(0x21a)],_0x99d294(0x226));const _0x4bed17=await withSpinner(_0x99d294(0x1da),()=>_0x4acf09[_0x99d294(0x1e7)][_0x99d294(0x1f6)](_0x408c8e['folderId']),{'verbose':_0x56210a[_0x99d294(0x1f4)]});await handleSingleObjectOutput(_0x4bed17[_0x99d294(0x1bd)],_0x56210a);}else{if(_0x408c8e[_0x99d294(0x201)]===_0x99d294(0x1e7)){if(!_0x408c8e['segmentId'])throw new SDKError(ErrorCode[_0x99d294(0x21a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ec586=await withSpinner(_0x99d294(0x214),()=>_0x4acf09[_0x99d294(0x1e7)][_0x99d294(0x200)](_0x408c8e['parentId'],_0x408c8e[_0x99d294(0x1de)]),{'verbose':_0x56210a['verbose']});await handleSingleObjectOutput(_0x5ec586[_0x99d294(0x1bd)],_0x56210a);}}}return 0x0;}catch(_0x34b0ba){if(_0x34b0ba instanceof SDKError)return console[_0x99d294(0x1d8)](_0x99d294(0x1c1)+_0x34b0ba[_0x99d294(0x21e)]),_0x34b0ba['cause']&&console['error'](_0x99d294(0x22d)+_0x34b0ba[_0x99d294(0x1e2)]),0x1;throw _0x34b0ba;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1b0f17(0x1ce)]='segment:show';['description']='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x1b0f17(0x20d)](_0x1e6275){const _0xede804=a25_0x1b0f17,{options:_0x5e1eb5,args:_0xb36816,tdx:_0x14ac8b}=_0x1e6275,_0x31dc93=_0xb36816[0x0],_0x2d0b68=!_0x31dc93&&!!_0x5e1eb5[_0xede804(0x1d5)],_0x44c0b6=_0x31dc93||_0x5e1eb5[_0xede804(0x1d5)];if(!_0x44c0b6)return console[_0xede804(0x1d8)](_0xede804(0x1cb)),console[_0xede804(0x1d8)](_0xede804(0x1e3)),console[_0xede804(0x1d8)]('Examples:'),console[_0xede804(0x1d8)](_0xede804(0x1e4)),console[_0xede804(0x1d8)](_0xede804(0x1c6)),console[_0xede804(0x1d8)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0xede804(0x1d8)](_0xede804(0x1cc)),0x1;try{const _0xab8c99=_0x5e1eb5['segmentPath'];let _0x183e4c=_0x44c0b6;!_0x2d0b68&&_0xab8c99&&!_0x44c0b6[_0xede804(0x21c)]('/')&&(_0x183e4c=_0xab8c99+'/'+_0x44c0b6,_0x5e1eb5[_0xede804(0x1f4)]&&console['error'](_0xede804(0x1b9)+_0x183e4c));const _0x231d5f=await withSpinner(_0xede804(0x228)+_0x183e4c+_0xede804(0x1f3),()=>_0x14ac8b[_0xede804(0x1e7)][_0xede804(0x217)](_0x183e4c),{'verbose':_0x5e1eb5['verbose']}),_0xf3b081=_0x231d5f[_0xede804(0x1bd)];_0x5e1eb5[_0xede804(0x1f4)]&&(console[_0xede804(0x1d8)]('Resolved\x20type:\x20'+_0xf3b081[_0xede804(0x201)]),console[_0xede804(0x1d8)](_0xede804(0x1ba)+_0xf3b081[_0xede804(0x1c9)]));if(_0xf3b081[_0xede804(0x201)]===_0xede804(0x1f7))return console['error'](_0xede804(0x1c8)),console[_0xede804(0x1d8)](_0xede804(0x210)),0x1;let _0x18ba74;if(_0xf3b081[_0xede804(0x201)]===_0xede804(0x1eb)){const _0x1d7174=await withSpinner(_0xede804(0x1ec),()=>_0x14ac8b['segment']['getParentSQL'](_0xf3b081[_0xede804(0x1c9)]),{'verbose':_0x5e1eb5[_0xede804(0x1f4)]});_0x18ba74=_0x1d7174[_0xede804(0x1bd)];}else{if(!_0xf3b081[_0xede804(0x1de)])throw new SDKError(ErrorCode[_0xede804(0x21a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x302d5c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x14ac8b['segment']['getSegmentSQL'](_0xf3b081[_0xede804(0x1c9)],_0xf3b081[_0xede804(0x1de)]),{'verbose':_0x5e1eb5[_0xede804(0x1f4)]});_0x18ba74=_0x302d5c['data'];}const _0x4d9ba3=resolveLimit(_0x5e1eb5[_0xede804(0x21f)],DEFAULT_DISPLAY_LIMIT),_0x39d193=/\bLIMIT\s+\d+/i['test'](_0x18ba74);!_0x39d193&&(_0x18ba74=_0x18ba74[_0xede804(0x1e0)]()[_0xede804(0x1c3)](/;+$/,''),_0x18ba74='SELECT\x20*\x20FROM\x20(\x0a'+_0x18ba74+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4d9ba3);_0x5e1eb5[_0xede804(0x1f4)]&&console[_0xede804(0x1d8)](_0xede804(0x229)+_0x18ba74);const _0x4995f9=await withQuerySpinner(_0xede804(0x219),async _0x1963db=>{const _0x2d2371=_0xede804,_0x38241d=await _0x14ac8b[_0x2d2371(0x221)][_0x2d2371(0x20d)](_0x18ba74,{'catalog':'td','schema':_0x2d2371(0x21b),'onJobId':_0x426d93=>{_0x1963db['setJobId'](_0x426d93);}});return _0x38241d;},{'verbose':_0x5e1eb5['verbose']}),_0x5a3843=_0x4995f9[_0xede804(0x1bd)],_0x2ec146=_0x5a3843['jobId']?_0xede804(0x1d4)+_0x5a3843[_0xede804(0x215)]+']':'';return console['error'](_0xede804(0x225)+_0x5a3843['stats'][_0xede804(0x204)][_0xede804(0x20c)]()+_0xede804(0x227)+('in\x20'+formatElapsed(_0x5a3843[_0xede804(0x1f1)]['elapsedTimeMillis'])+_0x2ec146)),await handleQueryOutput(_0x5a3843,_0x5e1eb5),0x0;}catch(_0x58154a){if(_0x58154a instanceof SDKError)return console[_0xede804(0x1d8)](_0xede804(0x202)+_0x58154a[_0xede804(0x1bf)]+']'),console[_0xede804(0x1d8)]('\x0a'+_0x58154a['message']),0x1;throw _0x58154a;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x1b0f17(0x212);['description']=a25_0x1b0f17(0x1b8);async[a25_0x1b0f17(0x20d)](_0x384e35){const _0x3a790a=a25_0x1b0f17,{options:_0x43f92a,args:_0x422a11,tdx:_0x503511}=_0x384e35;if(_0x422a11[_0x3a790a(0x218)]===0x0)return console['error'](_0x3a790a(0x1d2)),console['error'](_0x3a790a(0x1b7)),0x1;const _0x402c6f=_0x422a11[0x0];try{_0x43f92a[_0x3a790a(0x1f4)]&&(console['error']('Site:\x20'+_0x43f92a[_0x3a790a(0x1f8)]),console[_0x3a790a(0x1d8)](_0x3a790a(0x205)+_0x402c6f));const _0x87cfc4=await withSpinner(_0x3a790a(0x1e6)+_0x402c6f+_0x3a790a(0x1f3),()=>_0x503511['segment'][_0x3a790a(0x1c5)](_0x402c6f),{'verbose':_0x43f92a['verbose']}),_0x4873e9=_0x87cfc4[_0x3a790a(0x1bd)];_0x43f92a[_0x3a790a(0x1f4)]&&console['error'](_0x3a790a(0x1df)+_0x4873e9);const _0x5104b8=await withSpinner(_0x3a790a(0x20a)+_0x402c6f+'\x27...',()=>_0x503511[_0x3a790a(0x1e7)][_0x3a790a(0x22b)](_0x4873e9),{'verbose':_0x43f92a['verbose']}),_0x3b4155=_0x5104b8[_0x3a790a(0x1bd)];return console[_0x3a790a(0x1d8)](_0x3a790a(0x1dd)+_0x3b4155['length']+_0x3a790a(0x1c0)+(_0x3b4155[_0x3a790a(0x218)]!==0x1?'s':'')),await handleSDKOutput(_0x3b4155,_0x43f92a),0x0;}catch(_0x41818f){if(_0x41818f instanceof SDKError)return console['error'](_0x3a790a(0x1c1)+_0x41818f[_0x3a790a(0x21e)]),_0x41818f[_0x3a790a(0x1e2)]&&console[_0x3a790a(0x1d8)](_0x3a790a(0x22d)+_0x41818f['cause']),0x1;throw _0x41818f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x1b0f17(0x1ce)]=a25_0x1b0f17(0x220);[a25_0x1b0f17(0x1f0)]=a25_0x1b0f17(0x1fd);async[a25_0x1b0f17(0x20d)](_0x526d97){const _0x5998d5=a25_0x1b0f17,{options:_0x432624,args:_0x2ead07,tdx:_0x22f56d}=_0x526d97;if(_0x2ead07[_0x5998d5(0x218)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x5998d5(0x1d8)](_0x5998d5(0x213)),0x1;try{const {parentId:_0x4bca9b,childId:_0x5c1e47}=parseSegmentRef(_0x2ead07[0x0]);_0x432624[_0x5998d5(0x1f4)]&&(console['error'](_0x5998d5(0x1e1)+_0x432624[_0x5998d5(0x1f8)]),console['error']('Parent\x20name:\x20'+_0x4bca9b),_0x5c1e47&&console[_0x5998d5(0x1d8)]('Folder\x20name:\x20'+_0x5c1e47));if(!_0x5c1e47)return console['error'](_0x5998d5(0x211)),0x1;const _0x534075=await withSpinner(_0x5998d5(0x1e6)+_0x4bca9b+_0x5998d5(0x1f3),()=>_0x22f56d[_0x5998d5(0x1e7)][_0x5998d5(0x1c5)](_0x4bca9b),{'verbose':_0x432624[_0x5998d5(0x1f4)]}),_0x21182b=_0x534075[_0x5998d5(0x1bd)];_0x432624['verbose']&&console['error'](_0x5998d5(0x1df)+_0x21182b);const _0xe9f565=await withSpinner(_0x5998d5(0x1db)+_0x5c1e47+_0x5998d5(0x1f3),()=>_0x22f56d['segment'][_0x5998d5(0x1ca)](_0x21182b,_0x5c1e47),{'verbose':_0x432624[_0x5998d5(0x1f4)]}),_0x1b7074=_0xe9f565['data'];_0x432624[_0x5998d5(0x1f4)]&&console['error'](_0x5998d5(0x1ff)+_0x1b7074);const _0x506548=await withSpinner('Fetching\x20folder\x20\x27'+_0x5c1e47+'\x27...',()=>_0x22f56d['segment']['getFolder'](_0x1b7074),{'verbose':_0x432624[_0x5998d5(0x1f4)]});return await handleSDKOutput([_0x506548[_0x5998d5(0x1bd)]],_0x432624),0x0;}catch(_0x20d040){if(_0x20d040 instanceof SDKError)return console[_0x5998d5(0x1d8)]('Error:\x20'+_0x20d040[_0x5998d5(0x21e)]),_0x20d040[_0x5998d5(0x1e2)]&&console[_0x5998d5(0x1d8)](_0x5998d5(0x22d)+_0x20d040[_0x5998d5(0x1e2)]),0x1;throw _0x20d040;}}}function a25_0xe305(){const _0x4a5cd9=['\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','Resolving\x20parent\x20segment\x20\x27','segment','Creating\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','8156088dhVXuP','parent','Fetching\x20SQL\x20for\x20parent\x20segment...','224642aYcTDx','log','Fetching\x20parent\x20segment\x20details...','description','stats','Folder\x20name:\x20','\x27...','verbose','92520kcuSle','getFolder','folder','site','\x27\x20with\x20ID:\x20','folderId','9806301DjAroA','4448FsmKnL','Show\x20segment\x20folder\x20details','2HRpwlV','Resolved\x20folder\x20ID:\x20','getSegment','type','✖\x20Query\x20failed\x20[','format','processedRows','Parent\x20name:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20sql\x20<path>','json','segmentPath','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','toLocaleString','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','8QVgDZb','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Fetching\x20segment\x20details...','jobId','2469Wyjmwm','resolvePathToResource','length','Executing\x20segment\x20query...','INTERNAL','information_schema','includes','258864PKlKxI','message','limit','segment:folder:show','query','Examples:','Parent\x20segment:\x20','parentFolder','✔\x20Query\x20completed:\x20Processed\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20rows\x20','Resolving\x20path\x20\x27','SQL\x20query:\x0a','Error:\x20Path\x20or\x20name\x20is\x20required','listFolders','segment:sql','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved\x20relative\x20path\x20to:\x20','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','getSegmentSQL','data','220eZdMzX','code','\x20folder','Error:\x20','140pysEpP','replace','getParent','resolveParentId','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20ID:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','parentId','resolveFolderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolved\x20type:\x20','name','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Segment\x20ID:\x20','createFolder','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20[Job\x20ID:\x20','parentSegment','1143285VLkozo','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','error','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20folder\x20details...','Resolving\x20folder\x20\x27','segment:folder:create','✔\x20Found\x20','segmentId','Resolved\x20parent\x20ID:\x20','trim','Site:\x20','cause','Usage:\x20tdx\x20segment\x20show\x20<path>'];a25_0xe305=function(){return _0x4a5cd9;};return a25_0xe305();}export class SegmentSQLCommand extends BaseCommand{['name']=a25_0x1b0f17(0x22c);[a25_0x1b0f17(0x1f0)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async['execute'](_0x17d2db){const _0x5f504d=a25_0x1b0f17,{options:_0x1981f3,args:_0x147b09,tdx:_0x3919a8}=_0x17d2db,_0x3dc8ac=_0x147b09[0x0],_0x2a6240=!_0x3dc8ac&&!!_0x1981f3[_0x5f504d(0x1d5)],_0x4a9ad7=_0x3dc8ac||_0x1981f3[_0x5f504d(0x1d5)];if(!_0x4a9ad7)return console[_0x5f504d(0x1d8)](_0x5f504d(0x1cb)),console[_0x5f504d(0x1d8)](_0x5f504d(0x207)),console[_0x5f504d(0x1d8)](_0x5f504d(0x222)),console[_0x5f504d(0x1d8)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x5f504d(0x1d8)](_0x5f504d(0x1d3)),console[_0x5f504d(0x1d8)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x5f504d(0x1d8)](_0x5f504d(0x1cc)),0x1;try{const _0x37f8d3=_0x1981f3[_0x5f504d(0x209)];let _0x144d03=_0x4a9ad7;!_0x2a6240&&_0x37f8d3&&!_0x4a9ad7[_0x5f504d(0x21c)]('/')&&(_0x144d03=_0x37f8d3+'/'+_0x4a9ad7,_0x1981f3[_0x5f504d(0x1f4)]&&console['error'](_0x5f504d(0x1b9)+_0x144d03));const _0x554c5d=await withSpinner('Resolving\x20path\x20\x27'+_0x144d03+_0x5f504d(0x1f3),()=>_0x3919a8[_0x5f504d(0x1e7)][_0x5f504d(0x217)](_0x144d03),{'verbose':_0x1981f3['verbose']}),_0x54a4dd=_0x554c5d[_0x5f504d(0x1bd)];_0x1981f3[_0x5f504d(0x1f4)]&&(console[_0x5f504d(0x1d8)](_0x5f504d(0x1cd)+_0x54a4dd[_0x5f504d(0x201)]),console['error']('Parent\x20ID:\x20'+_0x54a4dd['parentId']));if(_0x54a4dd['type']===_0x5f504d(0x1f7))return console['error'](_0x5f504d(0x206)),console[_0x5f504d(0x1d8)](_0x5f504d(0x1cf)),0x1;let _0x2afb69;if(_0x54a4dd[_0x5f504d(0x201)]==='parent'){const _0x1698f0=await withSpinner(_0x5f504d(0x1ec),()=>_0x3919a8[_0x5f504d(0x1e7)]['getParentSQL'](_0x54a4dd[_0x5f504d(0x1c9)]),{'verbose':_0x1981f3[_0x5f504d(0x1f4)]});_0x2afb69=_0x1698f0['data'];}else{if(!_0x54a4dd['segmentId'])throw new SDKError(ErrorCode[_0x5f504d(0x21a)],_0x5f504d(0x1e9));const _0x25f36c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3919a8[_0x5f504d(0x1e7)][_0x5f504d(0x1bc)](_0x54a4dd[_0x5f504d(0x1c9)],_0x54a4dd['segmentId']),{'verbose':_0x1981f3['verbose']});_0x2afb69=_0x25f36c[_0x5f504d(0x1bd)];}return _0x1981f3[_0x5f504d(0x203)]===_0x5f504d(0x208)||_0x1981f3['format']==='jsonl'?await handleSDKOutput([{'sql':_0x2afb69}],_0x1981f3):console[_0x5f504d(0x1ee)](_0x2afb69),0x0;}catch(_0x50a941){if(_0x50a941 instanceof SDKError)return console[_0x5f504d(0x1d8)](_0x5f504d(0x1c1)+_0x50a941[_0x5f504d(0x21e)]),_0x50a941[_0x5f504d(0x1e2)]&&console[_0x5f504d(0x1d8)]('\x20\x20Cause:\x20'+_0x50a941[_0x5f504d(0x1e2)]),0x1;throw _0x50a941;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x1b0f17(0x1ce)]=a25_0x1b0f17(0x1dc);[a25_0x1b0f17(0x1f0)]=a25_0x1b0f17(0x1e5);async[a25_0x1b0f17(0x20d)](_0x3aa82d){const _0x225e55=a25_0x1b0f17,{options:_0x392d90,args:_0x1e4b27,tdx:_0x3726ef}=_0x3aa82d,_0x557434=_0x392d90;if(_0x1e4b27[_0x225e55(0x218)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x299027=_0x1e4b27[0x0],_0x2fa1e9=_0x1e4b27[0x1];_0x557434['verbose']&&(console[_0x225e55(0x1d8)]('Site:\x20'+_0x557434[_0x225e55(0x1f8)]),console['error'](_0x225e55(0x223)+_0x299027),console[_0x225e55(0x1d8)](_0x225e55(0x1f2)+_0x2fa1e9));let _0x52b75e;if(_0x557434[_0x225e55(0x224)]){const _0x518e29=_0x557434[_0x225e55(0x224)],_0x2861c3=await withSpinner(_0x225e55(0x1e6)+_0x299027+_0x225e55(0x1f3),()=>_0x3726ef[_0x225e55(0x1e7)][_0x225e55(0x1c5)](_0x299027),{'verbose':_0x557434[_0x225e55(0x1f4)]}),_0x32e73a=_0x2861c3[_0x225e55(0x1bd)],_0x596f2b=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x518e29+_0x225e55(0x1f3),()=>_0x3726ef[_0x225e55(0x1e7)]['resolveFolderId'](_0x32e73a,_0x518e29),{'verbose':_0x557434[_0x225e55(0x1f4)]});_0x52b75e=_0x596f2b['data'],_0x557434[_0x225e55(0x1f4)]&&console[_0x225e55(0x1d8)](_0x225e55(0x1d9)+_0x52b75e);}const _0x1043ff={'name':_0x2fa1e9,'description':_0x557434[_0x225e55(0x1f0)],'parentFolderId':_0x52b75e},_0xc906b9=await withSpinner(_0x225e55(0x1e8)+_0x2fa1e9+_0x225e55(0x1f3),()=>_0x3726ef[_0x225e55(0x1e7)][_0x225e55(0x1d1)](_0x299027,_0x1043ff),{'verbose':_0x557434[_0x225e55(0x1f4)]}),_0xaa0cf9=_0xc906b9['data'];return console['error']('✔\x20Created\x20folder\x20\x27'+_0xaa0cf9[_0x225e55(0x1ce)]+_0x225e55(0x1f9)+_0xaa0cf9['id']),await handleSDKOutput([_0xaa0cf9],_0x557434),0x0;}}
1
+ const a27_0x1b95de=a27_0x2789;(function(_0x15cb5f,_0x117af4){const _0x2b3b57=a27_0x2789,_0x303c66=_0x15cb5f();while(!![]){try{const _0x2e391f=-parseInt(_0x2b3b57(0x1ea))/0x1*(parseInt(_0x2b3b57(0x1e4))/0x2)+-parseInt(_0x2b3b57(0x1d1))/0x3+-parseInt(_0x2b3b57(0x1a0))/0x4*(parseInt(_0x2b3b57(0x1ae))/0x5)+-parseInt(_0x2b3b57(0x1cd))/0x6+-parseInt(_0x2b3b57(0x1ec))/0x7+parseInt(_0x2b3b57(0x1e6))/0x8+parseInt(_0x2b3b57(0x1a1))/0x9;if(_0x2e391f===_0x117af4)break;else _0x303c66['push'](_0x303c66['shift']());}catch(_0x494531){_0x303c66['push'](_0x303c66['shift']());}}}(a27_0x294b,0x5f318));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a27_0x2789(_0x1edf1a,_0x3bb117){const _0x294bad=a27_0x294b();return a27_0x2789=function(_0x278933,_0x3dba43){_0x278933=_0x278933-0x196;let _0x321290=_0x294bad[_0x278933];return _0x321290;},a27_0x2789(_0x1edf1a,_0x3bb117);}export class SegmentDescribeCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1b8);[a27_0x1b95de(0x1b6)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x1b95de(0x1b4)](_0x5a75af){const _0x55b987=a27_0x1b95de,{options:_0x5e59d1,args:_0xe0e1ea,tdx:_0x2440ba}=_0x5a75af,_0x1a8320=_0xe0e1ea[0x0],_0xe438f6=!_0x1a8320&&!!_0x5e59d1[_0x55b987(0x1d6)],_0x2cdf1b=_0x1a8320||_0x5e59d1[_0x55b987(0x1d6)];if(!_0x2cdf1b)return console[_0x55b987(0x1e2)](_0x55b987(0x1a3)),console[_0x55b987(0x1e2)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x55b987(0x1e2)](_0x55b987(0x1fc)),console[_0x55b987(0x1e2)](_0x55b987(0x1ee)),console[_0x55b987(0x1e2)](_0x55b987(0x1e0)),console[_0x55b987(0x1e2)](_0x55b987(0x1c3)),console[_0x55b987(0x1e2)](_0x55b987(0x208)),0x1;try{const _0x1e2cdd=_0x5e59d1['segmentPath'];let _0x53675e=_0x2cdf1b;!_0xe438f6&&_0x1e2cdd&&!_0x2cdf1b[_0x55b987(0x1a9)]('/')&&(_0x53675e=_0x1e2cdd+'/'+_0x2cdf1b,_0x5e59d1[_0x55b987(0x1dc)]&&console['error'](_0x55b987(0x1c4)+_0x53675e));const _0x4f9317=await withSpinner(_0x55b987(0x207)+_0x53675e+_0x55b987(0x1c8),()=>_0x2440ba['segment'][_0x55b987(0x1da)](_0x53675e),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]}),_0x32df5e=_0x4f9317['data'];_0x5e59d1[_0x55b987(0x1dc)]&&(console[_0x55b987(0x1e2)]('Resolved\x20type:\x20'+_0x32df5e['type']),console['error'](_0x55b987(0x1bb)+_0x32df5e[_0x55b987(0x1c2)]),_0x32df5e['folderId']&&console['error'](_0x55b987(0x1f5)+_0x32df5e['folderId']),_0x32df5e[_0x55b987(0x1c7)]&&console[_0x55b987(0x1e2)](_0x55b987(0x1e5)+_0x32df5e['segmentId']));if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x1af)){const _0x596dca=await withSpinner(_0x55b987(0x1d4),()=>_0x2440ba[_0x55b987(0x1e3)]['getParent'](_0x32df5e[_0x55b987(0x1c2)]),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]});await handleSingleObjectOutput(_0x596dca[_0x55b987(0x1a6)],_0x5e59d1);}else{if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x206)){if(!_0x32df5e[_0x55b987(0x209)])throw new SDKError(ErrorCode[_0x55b987(0x1f4)],_0x55b987(0x1e7));const _0x453875=await withSpinner(_0x55b987(0x1c9),()=>_0x2440ba[_0x55b987(0x1e3)][_0x55b987(0x1aa)](_0x32df5e['folderId']),{'verbose':_0x5e59d1['verbose']});await handleSingleObjectOutput(_0x453875[_0x55b987(0x1a6)],_0x5e59d1);}else{if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x1e3)){if(!_0x32df5e[_0x55b987(0x1c7)])throw new SDKError(ErrorCode[_0x55b987(0x1f4)],_0x55b987(0x201));const _0x4afe6d=await withSpinner(_0x55b987(0x1f7),()=>_0x2440ba[_0x55b987(0x1e3)]['getSegment'](_0x32df5e[_0x55b987(0x1c2)],_0x32df5e[_0x55b987(0x1c7)]),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]});await handleSingleObjectOutput(_0x4afe6d[_0x55b987(0x1a6)],_0x5e59d1);}}}return 0x0;}catch(_0x5d7e71){if(_0x5d7e71 instanceof SDKError)return console['error'](_0x55b987(0x1de)+_0x5d7e71[_0x55b987(0x19a)]),_0x5d7e71[_0x55b987(0x1e8)]&&console[_0x55b987(0x1e2)](_0x55b987(0x1e1)+_0x5d7e71[_0x55b987(0x1e8)]),0x1;throw _0x5d7e71;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1b2);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x1f0);async[a27_0x1b95de(0x1b4)](_0xbf8ccb){const _0x354a6f=a27_0x1b95de,{options:_0x1178e4,args:_0x4d4c44,tdx:_0x5d9b27}=_0xbf8ccb,_0x170c93=_0x4d4c44[0x0],_0x52d927=!_0x170c93&&!!_0x1178e4[_0x354a6f(0x1d6)],_0x96e230=_0x170c93||_0x1178e4[_0x354a6f(0x1d6)];if(!_0x96e230)return console['error'](_0x354a6f(0x1c5)),console[_0x354a6f(0x1e2)](_0x354a6f(0x1c0)),console['error'](_0x354a6f(0x1fc)),console[_0x354a6f(0x1e2)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x354a6f(0x1e2)](_0x354a6f(0x1a7)),console['error'](_0x354a6f(0x1ac)),console[_0x354a6f(0x1e2)](_0x354a6f(0x208)),0x1;try{const _0xc18811=_0x1178e4['segmentPath'];let _0x48d653=_0x96e230;!_0x52d927&&_0xc18811&&!_0x96e230[_0x354a6f(0x1a9)]('/')&&(_0x48d653=_0xc18811+'/'+_0x96e230,_0x1178e4[_0x354a6f(0x1dc)]&&console['error'](_0x354a6f(0x1c4)+_0x48d653));const _0x26ed36=await withSpinner(_0x354a6f(0x207)+_0x48d653+_0x354a6f(0x1c8),()=>_0x5d9b27['segment']['resolvePathToResource'](_0x48d653),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]}),_0x5cddab=_0x26ed36[_0x354a6f(0x1a6)];_0x1178e4[_0x354a6f(0x1dc)]&&(console[_0x354a6f(0x1e2)](_0x354a6f(0x1b5)+_0x5cddab[_0x354a6f(0x1eb)]),console['error'](_0x354a6f(0x1bb)+_0x5cddab[_0x354a6f(0x1c2)]));if(_0x5cddab[_0x354a6f(0x1eb)]===_0x354a6f(0x206))return console[_0x354a6f(0x1e2)](_0x354a6f(0x19f)),console[_0x354a6f(0x1e2)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x42033d;if(_0x5cddab[_0x354a6f(0x1eb)]==='parent'){const _0x46aaf8=await withSpinner(_0x354a6f(0x199),()=>_0x5d9b27[_0x354a6f(0x1e3)][_0x354a6f(0x1b1)](_0x5cddab[_0x354a6f(0x1c2)]),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]});_0x42033d=_0x46aaf8[_0x354a6f(0x1a6)];}else{if(!_0x5cddab[_0x354a6f(0x1c7)])throw new SDKError(ErrorCode[_0x354a6f(0x1f4)],_0x354a6f(0x201));const _0xc5263=await withSpinner(_0x354a6f(0x1cb),()=>_0x5d9b27[_0x354a6f(0x1e3)]['getSegmentSQL'](_0x5cddab[_0x354a6f(0x1c2)],_0x5cddab['segmentId']),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]});_0x42033d=_0xc5263[_0x354a6f(0x1a6)];}const _0x54e3d6=resolveLimit(_0x1178e4[_0x354a6f(0x1a4)],DEFAULT_DISPLAY_LIMIT),_0x1c0439=/\bLIMIT\s+\d+/i[_0x354a6f(0x1d3)](_0x42033d);!_0x1c0439&&(_0x42033d=_0x42033d['trim']()['replace'](/;+$/,''),_0x42033d=_0x354a6f(0x19d)+_0x42033d+_0x354a6f(0x1d9)+_0x54e3d6);_0x1178e4['verbose']&&console[_0x354a6f(0x1e2)](_0x354a6f(0x1cf)+_0x42033d);const _0x4daaa2=await withQuerySpinner(_0x354a6f(0x1ef),async _0x5774bb=>{const _0x5529d7=_0x354a6f,_0x586337=await _0x5d9b27[_0x5529d7(0x1c6)][_0x5529d7(0x1b4)](_0x42033d,{'catalog':'td','schema':_0x5529d7(0x202),'onJobId':_0x5cb5c4=>{_0x5774bb['setJobId'](_0x5cb5c4);}});return _0x586337;},{'verbose':_0x1178e4['verbose']}),_0x2b9c44=_0x4daaa2[_0x354a6f(0x1a6)],_0x67bf85=_0x2b9c44[_0x354a6f(0x1cc)]?_0x354a6f(0x198)+_0x2b9c44['jobId']+']':'';return console[_0x354a6f(0x1e2)](_0x354a6f(0x19e)+_0x2b9c44[_0x354a6f(0x20a)]['processedRows']['toLocaleString']()+'\x20rows\x20'+(_0x354a6f(0x1d7)+formatElapsed(_0x2b9c44[_0x354a6f(0x20a)][_0x354a6f(0x1a5)])+_0x67bf85)),await handleQueryOutput(_0x2b9c44,_0x1178e4),0x0;}catch(_0x407cad){if(_0x407cad instanceof SDKError)return console['error'](_0x354a6f(0x1ba)+_0x407cad[_0x354a6f(0x1b7)]+']'),console['error']('\x0a'+_0x407cad['message']),0x1;throw _0x407cad;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x1b95de(0x1c1);[a27_0x1b95de(0x1b6)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x1b95de(0x1b4)](_0x26d6f5){const _0x4cb6ff=a27_0x1b95de,{options:_0x4d7362,args:_0x57bb22,tdx:_0x53f584}=_0x26d6f5;if(_0x57bb22[_0x4cb6ff(0x1b9)]===0x0)return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1a8)),console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x20b)),0x1;const _0x34e336=_0x57bb22[0x0];try{_0x4d7362['verbose']&&(console['error'](_0x4cb6ff(0x1be)+_0x4d7362['site']),console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1b0)+_0x34e336));const _0x2e4abc=await withSpinner(_0x4cb6ff(0x1dd)+_0x34e336+'\x27...',()=>_0x53f584['segment']['resolveParentId'](_0x34e336),{'verbose':_0x4d7362[_0x4cb6ff(0x1dc)]}),_0x466f7d=_0x2e4abc[_0x4cb6ff(0x1a6)];_0x4d7362[_0x4cb6ff(0x1dc)]&&console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1f6)+_0x466f7d);const _0x5a2da8=await withSpinner(_0x4cb6ff(0x1d2)+_0x34e336+_0x4cb6ff(0x1c8),()=>_0x53f584['segment']['listFolders'](_0x466f7d),{'verbose':_0x4d7362[_0x4cb6ff(0x1dc)]}),_0x5eecb1=_0x5a2da8[_0x4cb6ff(0x1a6)];return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1ab)+_0x5eecb1[_0x4cb6ff(0x1b9)]+_0x4cb6ff(0x1fb)+(_0x5eecb1['length']!==0x1?'s':'')),await handleSDKOutput(_0x5eecb1,_0x4d7362),0x0;}catch(_0x23a65c){if(_0x23a65c instanceof SDKError)return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1de)+_0x23a65c['message']),_0x23a65c[_0x4cb6ff(0x1e8)]&&console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1e1)+_0x23a65c[_0x4cb6ff(0x1e8)]),0x1;throw _0x23a65c;}}}function a27_0x294b(){const _0x206e86=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Cause:\x20','error','segment','361748Jrqbxp','Segment\x20ID:\x20','148200SCqpjC','Folder\x20ID\x20missing\x20from\x20resolved\x20path','cause','name','2NYYWUb','type','3887744zDJXQR','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Executing\x20segment\x20query...','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved\x20parent\x20folder\x20ID:\x20','resolveParentId','log','INTERNAL','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Fetching\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Parent\x20segment:\x20','\x20folder','Examples:','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:folder:create','Segment\x20ID\x20missing\x20from\x20resolved\x20path','information_schema','format','Creating\x20folder\x20\x27','resolveFolderId','folder','Resolving\x20path\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folderId','stats','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20segment\x20folder\x20details','✔\x20Created\x20folder\x20\x27','\x20[Job\x20ID:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','message','Usage:\x20tdx\x20segment\x20sql\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','4BtCsLP','22925925WCKYBC','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Path\x20or\x20name\x20is\x20required','limit','elapsedTimeMillis','data','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','includes','getFolder','✔\x20Found\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20parent\x20folder\x20\x27','2125915kSFVIS','parent','Parent\x20name:\x20','getParentSQL','segment:show','site','execute','Resolved\x20type:\x20','description','code','segment:describe','length','✖\x20Query\x20failed\x20[','Parent\x20ID:\x20','segmentPath','Resolved\x20folder\x20ID:\x20','Site:\x20','json','Usage:\x20tdx\x20segment\x20show\x20<path>','segment:folder:list','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','query','segmentId','\x27...','Fetching\x20folder\x20details...','Folder\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','jobId','3041946xipwWp','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','SQL\x20query:\x0a','segment:sql','979872aUqXzw','Listing\x20folders\x20for\x20parent\x20\x27','test','Fetching\x20parent\x20segment\x20details...','Create\x20segment\x20folder\x20for\x20organization','parentSegment','in\x20','segment:folder:show','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','resolvePathToResource','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','verbose','Resolving\x20parent\x20segment\x20\x27','Error:\x20','\x27\x20with\x20ID:\x20'];a27_0x294b=function(){return _0x206e86;};return a27_0x294b();}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1d8);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x196);async[a27_0x1b95de(0x1b4)](_0x126955){const _0xf944af=a27_0x1b95de,{options:_0x107348,args:_0x194d73,tdx:_0x415b7a}=_0x126955;if(_0x194d73[_0xf944af(0x1b9)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xf944af(0x1e2)](_0xf944af(0x1f8)),0x1;try{const {parentId:_0x3b7d36,childId:_0x366265}=parseSegmentRef(_0x194d73[0x0]);_0x107348[_0xf944af(0x1dc)]&&(console[_0xf944af(0x1e2)]('Site:\x20'+_0x107348[_0xf944af(0x1b3)]),console[_0xf944af(0x1e2)]('Parent\x20name:\x20'+_0x3b7d36),_0x366265&&console[_0xf944af(0x1e2)]('Folder\x20name:\x20'+_0x366265));if(!_0x366265)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x13e282=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b7d36+_0xf944af(0x1c8),()=>_0x415b7a[_0xf944af(0x1e3)][_0xf944af(0x1f2)](_0x3b7d36),{'verbose':_0x107348['verbose']}),_0x18198a=_0x13e282[_0xf944af(0x1a6)];_0x107348[_0xf944af(0x1dc)]&&console[_0xf944af(0x1e2)]('Resolved\x20parent\x20ID:\x20'+_0x18198a);const _0x4e8fd3=await withSpinner(_0xf944af(0x1fd)+_0x366265+'\x27...',()=>_0x415b7a['segment'][_0xf944af(0x205)](_0x18198a,_0x366265),{'verbose':_0x107348[_0xf944af(0x1dc)]}),_0x4359e4=_0x4e8fd3[_0xf944af(0x1a6)];_0x107348['verbose']&&console['error'](_0xf944af(0x1bd)+_0x4359e4);const _0x3ffd9a=await withSpinner('Fetching\x20folder\x20\x27'+_0x366265+_0xf944af(0x1c8),()=>_0x415b7a[_0xf944af(0x1e3)][_0xf944af(0x1aa)](_0x4359e4),{'verbose':_0x107348['verbose']});return await handleSDKOutput([_0x3ffd9a[_0xf944af(0x1a6)]],_0x107348),0x0;}catch(_0x51ad5e){if(_0x51ad5e instanceof SDKError)return console[_0xf944af(0x1e2)]('Error:\x20'+_0x51ad5e[_0xf944af(0x19a)]),_0x51ad5e['cause']&&console[_0xf944af(0x1e2)]('\x20\x20Cause:\x20'+_0x51ad5e[_0xf944af(0x1e8)]),0x1;throw _0x51ad5e;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x1b95de(0x1d0);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x1ce);async[a27_0x1b95de(0x1b4)](_0x34b898){const _0x39bba6=a27_0x1b95de,{options:_0x5ddc86,args:_0x29a07e,tdx:_0xd66bf7}=_0x34b898,_0xa224b=_0x29a07e[0x0],_0x3bccfc=!_0xa224b&&!!_0x5ddc86[_0x39bba6(0x1d6)],_0x7bfaaa=_0xa224b||_0x5ddc86['parentSegment'];if(!_0x7bfaaa)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x39bba6(0x19b)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1fc)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1db)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1a2)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1fe)),console[_0x39bba6(0x1e2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x28effc=_0x5ddc86[_0x39bba6(0x1bc)];let _0x1537df=_0x7bfaaa;!_0x3bccfc&&_0x28effc&&!_0x7bfaaa[_0x39bba6(0x1a9)]('/')&&(_0x1537df=_0x28effc+'/'+_0x7bfaaa,_0x5ddc86['verbose']&&console['error'](_0x39bba6(0x1c4)+_0x1537df));const _0x273f1c=await withSpinner(_0x39bba6(0x207)+_0x1537df+_0x39bba6(0x1c8),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1da)](_0x1537df),{'verbose':_0x5ddc86[_0x39bba6(0x1dc)]}),_0x4f7a36=_0x273f1c[_0x39bba6(0x1a6)];_0x5ddc86[_0x39bba6(0x1dc)]&&(console[_0x39bba6(0x1e2)](_0x39bba6(0x1b5)+_0x4f7a36[_0x39bba6(0x1eb)]),console['error']('Parent\x20ID:\x20'+_0x4f7a36[_0x39bba6(0x1c2)]));if(_0x4f7a36[_0x39bba6(0x1eb)]===_0x39bba6(0x206))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x39bba6(0x1e2)](_0x39bba6(0x1ff)),0x1;let _0x377513;if(_0x4f7a36['type']==='parent'){const _0x48dbff=await withSpinner(_0x39bba6(0x199),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1b1)](_0x4f7a36['parentId']),{'verbose':_0x5ddc86[_0x39bba6(0x1dc)]});_0x377513=_0x48dbff['data'];}else{if(!_0x4f7a36[_0x39bba6(0x1c7)])throw new SDKError(ErrorCode[_0x39bba6(0x1f4)],_0x39bba6(0x201));const _0x42d6c8=await withSpinner(_0x39bba6(0x1cb),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1ed)](_0x4f7a36[_0x39bba6(0x1c2)],_0x4f7a36['segmentId']),{'verbose':_0x5ddc86['verbose']});_0x377513=_0x42d6c8[_0x39bba6(0x1a6)];}return _0x5ddc86[_0x39bba6(0x203)]===_0x39bba6(0x1bf)||_0x5ddc86[_0x39bba6(0x203)]==='jsonl'?await handleSDKOutput([{'sql':_0x377513}],_0x5ddc86):console[_0x39bba6(0x1f3)](_0x377513),0x0;}catch(_0x2d6124){if(_0x2d6124 instanceof SDKError)return console[_0x39bba6(0x1e2)](_0x39bba6(0x1de)+_0x2d6124[_0x39bba6(0x19a)]),_0x2d6124[_0x39bba6(0x1e8)]&&console[_0x39bba6(0x1e2)](_0x39bba6(0x1e1)+_0x2d6124['cause']),0x1;throw _0x2d6124;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x200);['description']=a27_0x1b95de(0x1d5);async[a27_0x1b95de(0x1b4)](_0xfa1b4c){const _0x3d5492=a27_0x1b95de,{options:_0x28e156,args:_0x285118,tdx:_0x4d5676}=_0xfa1b4c,_0x233c48=_0x28e156;if(_0x285118[_0x3d5492(0x1b9)]<0x2)return console[_0x3d5492(0x1e2)](_0x3d5492(0x1f9)),console[_0x3d5492(0x1e2)](_0x3d5492(0x19c)),0x1;const _0x20a8c5=_0x285118[0x0],_0x23f18c=_0x285118[0x1];_0x233c48[_0x3d5492(0x1dc)]&&(console['error'](_0x3d5492(0x1be)+_0x233c48[_0x3d5492(0x1b3)]),console[_0x3d5492(0x1e2)](_0x3d5492(0x1fa)+_0x20a8c5),console[_0x3d5492(0x1e2)](_0x3d5492(0x1ca)+_0x23f18c));let _0x49eaa5;if(_0x233c48['parentFolder']){const _0x47d96c=_0x233c48['parentFolder'],_0x3dc76d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x20a8c5+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)]['resolveParentId'](_0x20a8c5),{'verbose':_0x233c48[_0x3d5492(0x1dc)]}),_0x11990c=_0x3dc76d['data'],_0x57d2be=await withSpinner(_0x3d5492(0x1ad)+_0x47d96c+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)][_0x3d5492(0x205)](_0x11990c,_0x47d96c),{'verbose':_0x233c48['verbose']});_0x49eaa5=_0x57d2be[_0x3d5492(0x1a6)],_0x233c48['verbose']&&console['error'](_0x3d5492(0x1f1)+_0x49eaa5);}const _0x40ed29={'name':_0x23f18c,'description':_0x233c48['description'],'parentFolderId':_0x49eaa5},_0x526ac4=await withSpinner(_0x3d5492(0x204)+_0x23f18c+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)]['createFolder'](_0x20a8c5,_0x40ed29),{'verbose':_0x233c48[_0x3d5492(0x1dc)]}),_0x2691e1=_0x526ac4[_0x3d5492(0x1a6)];return console[_0x3d5492(0x1e2)](_0x3d5492(0x197)+_0x2691e1[_0x3d5492(0x1e9)]+_0x3d5492(0x1df)+_0x2691e1['id']),await handleSDKOutput([_0x2691e1],_0x233c48),0x0;}}
@@ -1 +1 @@
1
- function a26_0x4d40(_0x2ff981,_0x4ccc82){const _0x373882=a26_0x3738();return a26_0x4d40=function(_0x4d4095,_0x4eb633){_0x4d4095=_0x4d4095-0xf0;let _0x352260=_0x373882[_0x4d4095];return _0x352260;},a26_0x4d40(_0x2ff981,_0x4ccc82);}const a26_0xeb3d08=a26_0x4d40;(function(_0x6e5b8,_0x381ea6){const _0x15c448=a26_0x4d40,_0x34feac=_0x6e5b8();while(!![]){try{const _0x503f19=-parseInt(_0x15c448(0x115))/0x1+-parseInt(_0x15c448(0x106))/0x2+parseInt(_0x15c448(0xf7))/0x3+parseInt(_0x15c448(0x122))/0x4*(-parseInt(_0x15c448(0x121))/0x5)+-parseInt(_0x15c448(0x11d))/0x6*(parseInt(_0x15c448(0x11b))/0x7)+-parseInt(_0x15c448(0x114))/0x8*(-parseInt(_0x15c448(0x116))/0x9)+-parseInt(_0x15c448(0xfc))/0xa*(-parseInt(_0x15c448(0xfb))/0xb);if(_0x503f19===_0x381ea6)break;else _0x34feac['push'](_0x34feac['shift']());}catch(_0x128227){_0x34feac['push'](_0x34feac['shift']());}}}(a26_0x3738,0x494b5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a26_0x3738(){const _0x5dfb63=['Resolved\x20relative\x20path\x20to:\x20','kind','resolveFolderId','3419997ubeXrL','Parent:\x20','6dRPArH','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','245mNcqVz','30144fJDOUi','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Parent\x20path:\x20','rule','parent','noCountPopulation','type','createSegment','error','ruleFile','data','1309638tYKstV','verbose','folderId','Creating\x20segment\x20\x27','392194cpksdZ','190VbAaSR','\x20\x20\x20Path:\x20','site','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','name','segment:create','includes','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','702992eoMime','Site:\x20','segment','\x27...','✔\x20Created\x20segment\x20\x27','resolvePathToResource','invisible','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','folder','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','description','length','Create\x20child\x20segment\x20with\x20filtering\x20rules','segments','4428272lXToWl','157962GYQhZW','9pBDvNt','Resolving\x20folder\x20\x27'];a26_0x3738=function(){return _0x5dfb63;};return a26_0x3738();}export class SegmentCreateCommand extends BaseCommand{[a26_0xeb3d08(0x100)]=a26_0xeb3d08(0x101);['description']=a26_0xeb3d08(0x112);async[a26_0xeb3d08(0x105)](_0x29a6d4){const _0x53a78b=a26_0xeb3d08,{options:_0x14cc45,args:_0x47689e,tdx:_0x5bf94b}=_0x29a6d4,_0x2c9382=_0x14cc45;if(_0x47689e[_0x53a78b(0x111)]===0x0)return console[_0x53a78b(0xf4)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x53a78b(0x11e)),console[_0x53a78b(0xf4)]('Examples:'),console[_0x53a78b(0xf4)](_0x53a78b(0xff)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x53a78b(0xf4)](_0x53a78b(0x104)),0x1;const _0x18659c=_0x47689e[0x0],_0x29f1ab=_0x14cc45[_0x53a78b(0x103)];let _0x56f0a3=_0x18659c;_0x29f1ab&&!_0x18659c[_0x53a78b(0x102)]('/')&&(_0x56f0a3=_0x29f1ab+'/'+_0x18659c,_0x2c9382['verbose']&&console['error'](_0x53a78b(0x118)+_0x56f0a3));const _0x48495d=parsePath(_0x56f0a3);if(_0x48495d[_0x53a78b(0x113)][_0x53a78b(0x111)]<0x2)return console['error'](_0x53a78b(0x10d)),console[_0x53a78b(0xf4)](_0x53a78b(0x124)),0x1;const _0x15d473=_0x48495d[_0x53a78b(0x113)][0x0],_0x24b3a3=getBaseName(_0x56f0a3),_0x3e9d1b=getParentPath(_0x56f0a3);_0x2c9382[_0x53a78b(0xf8)]&&(console[_0x53a78b(0xf4)](_0x53a78b(0x107)+_0x2c9382[_0x53a78b(0xfe)]),console['error'](_0x53a78b(0x123)+_0x56f0a3),console[_0x53a78b(0xf4)](_0x53a78b(0x11c)+_0x15d473),console[_0x53a78b(0xf4)]('Segment\x20name:\x20'+_0x24b3a3),console[_0x53a78b(0xf4)](_0x53a78b(0x125)+_0x3e9d1b));const _0x2bd0eb=await withSpinner(_0x53a78b(0x11f)+_0x15d473+_0x53a78b(0x109),()=>_0x5bf94b['segment']['resolveParentId'](_0x15d473),{'verbose':_0x2c9382[_0x53a78b(0xf8)]}),_0x3f9e70=_0x2bd0eb[_0x53a78b(0xf6)];let _0x241ccc;if(_0x48495d[_0x53a78b(0x113)][_0x53a78b(0x111)]>0x2){const _0x143af6=await withSpinner(_0x53a78b(0x120)+_0x3e9d1b+_0x53a78b(0x109),()=>_0x5bf94b[_0x53a78b(0x108)][_0x53a78b(0x10b)](_0x3e9d1b),{'verbose':_0x2c9382['verbose']}),_0x4e7ac8=_0x143af6[_0x53a78b(0xf6)];if(_0x4e7ac8[_0x53a78b(0xf2)]!==_0x53a78b(0x10e)&&_0x4e7ac8[_0x53a78b(0xf2)]!==_0x53a78b(0xf0))return console[_0x53a78b(0xf4)](_0x53a78b(0x10f)),0x1;_0x241ccc=_0x4e7ac8[_0x53a78b(0xf9)];}else{if(_0x2c9382[_0x53a78b(0x10e)]){const _0x35e7d0=await withSpinner(_0x53a78b(0x117)+_0x2c9382[_0x53a78b(0x10e)]+_0x53a78b(0x109),()=>_0x5bf94b[_0x53a78b(0x108)][_0x53a78b(0x11a)](_0x3f9e70,_0x2c9382[_0x53a78b(0x10e)]),{'verbose':_0x2c9382[_0x53a78b(0xf8)]});_0x241ccc=_0x35e7d0['data'];}}_0x2c9382[_0x53a78b(0xf8)]&&_0x241ccc&&console[_0x53a78b(0xf4)]('Resolved\x20folder\x20ID:\x20'+_0x241ccc);const _0x201b39=await loadJSONFromOptions(_0x2c9382[_0x53a78b(0x126)],_0x2c9382[_0x53a78b(0xf5)]),_0x540f10={'name':_0x24b3a3,'description':_0x2c9382[_0x53a78b(0x110)],'rule':_0x201b39,'kind':_0x2c9382[_0x53a78b(0x119)]!==undefined?parseInt(_0x2c9382[_0x53a78b(0x119)],0xa):undefined,'isVisible':_0x2c9382[_0x53a78b(0x10c)]?![]:undefined,'segmentFolderId':_0x241ccc,'countPopulation':_0x2c9382[_0x53a78b(0xf1)]?![]:undefined},_0x465db8=await withSpinner(_0x53a78b(0xfa)+_0x24b3a3+_0x53a78b(0x109),()=>_0x5bf94b[_0x53a78b(0x108)][_0x53a78b(0xf3)](_0x3f9e70,_0x540f10),{'verbose':_0x2c9382['verbose']}),_0x41c69c=_0x465db8[_0x53a78b(0xf6)];return console['error'](_0x53a78b(0x10a)+_0x41c69c[_0x53a78b(0x100)]+'\x27\x20with\x20ID:\x20'+_0x41c69c['id']),_0x56f0a3!==_0x18659c&&console['error'](_0x53a78b(0xfd)+_0x56f0a3),await handleSDKOutput([_0x41c69c],_0x2c9382),0x0;}}
1
+ const a28_0x590336=a28_0xceb6;function a28_0x104b(){const _0x485f3b=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveParentId','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','1tzgoIQ','Creating\x20segment\x20\x27','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1093560esjJFD','4642740kEVyQL','ruleFile','verbose','createSegment','resolveFolderId','execute','data','Examples:','355ItVBUu','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','Segment\x20name:\x20','10820oAlrZy','segments','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','2064755zljvQp','15qorRcx','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','length','invisible','segment:create','parent','Resolving\x20folder\x20\x27','segment','24FGzRhS','includes','\x27...','resolvePathToResource','name','kind','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','noCountPopulation','965570brYETQ','folder','Parent:\x20','Target\x20path:\x20','8426GaVPnd','error','250552UosoJk','23982uTSQCp','folderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27\x20with\x20ID:\x20','\x20\x20\x20Path:\x20','rule','8Jwsuva','type','site','Resolved\x20relative\x20path\x20to:\x20','segmentPath'];a28_0x104b=function(){return _0x485f3b;};return a28_0x104b();}(function(_0x1582a5,_0x653196){const _0x4e7c84=a28_0xceb6,_0x1f1ba1=_0x1582a5();while(!![]){try{const _0x5e4dd9=parseInt(_0x4e7c84(0x122))/0x1*(parseInt(_0x4e7c84(0x10d))/0x2)+-parseInt(_0x4e7c84(0x139))/0x3*(-parseInt(_0x4e7c84(0x113))/0x4)+-parseInt(_0x4e7c84(0x12f))/0x5*(parseInt(_0x4e7c84(0x114))/0x6)+parseInt(_0x4e7c84(0x138))/0x7+-parseInt(_0x4e7c84(0x11a))/0x8*(-parseInt(_0x4e7c84(0x127))/0x9)+-parseInt(_0x4e7c84(0x133))/0xa*(parseInt(_0x4e7c84(0x111))/0xb)+-parseInt(_0x4e7c84(0x104))/0xc*(-parseInt(_0x4e7c84(0x126))/0xd);if(_0x5e4dd9===_0x653196)break;else _0x1f1ba1['push'](_0x1f1ba1['shift']());}catch(_0x115591){_0x1f1ba1['push'](_0x1f1ba1['shift']());}}}(a28_0x104b,0xa1ba9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0xceb6(_0x46c348,_0x11b968){const _0x104b64=a28_0x104b();return a28_0xceb6=function(_0xceb6a0,_0x4f019c){_0xceb6a0=_0xceb6a0-0xfd;let _0x550338=_0x104b64[_0xceb6a0];return _0x550338;},a28_0xceb6(_0x46c348,_0x11b968);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x590336(0x100);[a28_0x590336(0x124)]=a28_0x590336(0x130);async[a28_0x590336(0x12c)](_0x291282){const _0x147e8c=a28_0x590336,{options:_0x4809aa,args:_0x128da6,tdx:_0x4dce54}=_0x291282,_0x2681d9=_0x4809aa;if(_0x128da6[_0x147e8c(0xfe)]===0x0)return console[_0x147e8c(0x112)](_0x147e8c(0x10b)),console[_0x147e8c(0x112)](_0x147e8c(0x10a)),console[_0x147e8c(0x112)](_0x147e8c(0x12e)),console[_0x147e8c(0x112)](_0x147e8c(0x13a)),console[_0x147e8c(0x112)](_0x147e8c(0x11f)),console[_0x147e8c(0x112)](_0x147e8c(0x125)),0x1;const _0x544c0b=_0x128da6[0x0],_0xc66312=_0x4809aa[_0x147e8c(0x11e)];let _0x18663f=_0x544c0b;_0xc66312&&!_0x544c0b[_0x147e8c(0x105)]('/')&&(_0x18663f=_0xc66312+'/'+_0x544c0b,_0x2681d9['verbose']&&console[_0x147e8c(0x112)](_0x147e8c(0x11d)+_0x18663f));const _0x286e5e=parsePath(_0x18663f);if(_0x286e5e[_0x147e8c(0x134)][_0x147e8c(0xfe)]<0x2)return console[_0x147e8c(0x112)](_0x147e8c(0x137)),console[_0x147e8c(0x112)](_0x147e8c(0x121)),0x1;const _0x3637fc=_0x286e5e['segments'][0x0],_0x48f861=getBaseName(_0x18663f),_0x37f58a=getParentPath(_0x18663f);_0x2681d9[_0x147e8c(0x129)]&&(console['error']('Site:\x20'+_0x2681d9[_0x147e8c(0x11c)]),console[_0x147e8c(0x112)](_0x147e8c(0x110)+_0x18663f),console[_0x147e8c(0x112)](_0x147e8c(0x10f)+_0x3637fc),console[_0x147e8c(0x112)](_0x147e8c(0x132)+_0x48f861),console[_0x147e8c(0x112)](_0x147e8c(0xfd)+_0x37f58a));const _0x583350=await withSpinner(_0x147e8c(0x135)+_0x3637fc+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x120)](_0x3637fc),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x3e76ba=_0x583350[_0x147e8c(0x12d)];let _0xb1667b;if(_0x286e5e['segments'][_0x147e8c(0xfe)]>0x2){const _0x4c14dd=await withSpinner(_0x147e8c(0x136)+_0x37f58a+_0x147e8c(0x106),()=>_0x4dce54['segment'][_0x147e8c(0x107)](_0x37f58a),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x48e5e7=_0x4c14dd[_0x147e8c(0x12d)];if(_0x48e5e7[_0x147e8c(0x11b)]!==_0x147e8c(0x10e)&&_0x48e5e7[_0x147e8c(0x11b)]!==_0x147e8c(0x101))return console[_0x147e8c(0x112)](_0x147e8c(0x116)),0x1;_0xb1667b=_0x48e5e7[_0x147e8c(0x115)];}else{if(_0x2681d9[_0x147e8c(0x10e)]){const _0x8c5024=await withSpinner(_0x147e8c(0x102)+_0x2681d9['folder']+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x12b)](_0x3e76ba,_0x2681d9[_0x147e8c(0x10e)]),{'verbose':_0x2681d9[_0x147e8c(0x129)]});_0xb1667b=_0x8c5024[_0x147e8c(0x12d)];}}_0x2681d9[_0x147e8c(0x129)]&&_0xb1667b&&console['error'](_0x147e8c(0x131)+_0xb1667b);const _0xc7867b=await loadJSONFromOptions(_0x2681d9[_0x147e8c(0x119)],_0x2681d9[_0x147e8c(0x128)]),_0xcfcbd9={'name':_0x48f861,'description':_0x2681d9['description'],'rule':_0xc7867b,'kind':_0x2681d9[_0x147e8c(0x109)]!==undefined?parseInt(_0x2681d9[_0x147e8c(0x109)],0xa):undefined,'isVisible':_0x2681d9[_0x147e8c(0xff)]?![]:undefined,'segmentFolderId':_0xb1667b,'countPopulation':_0x2681d9[_0x147e8c(0x10c)]?![]:undefined},_0x507fb3=await withSpinner(_0x147e8c(0x123)+_0x48f861+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x12a)](_0x3e76ba,_0xcfcbd9),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x33bcb5=_0x507fb3['data'];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x33bcb5[_0x147e8c(0x108)]+_0x147e8c(0x117)+_0x33bcb5['id']),_0x18663f!==_0x544c0b&&console[_0x147e8c(0x112)](_0x147e8c(0x118)+_0x18663f),await handleSDKOutput([_0x33bcb5],_0x2681d9),0x0;}}
@@ -1 +1 @@
1
- function a27_0x52b8(){const _0x42104f=['\x20field','parentSegment','1IjGNQm','8133160smIstk','19812089KLVxEJ','4950zYirfQ','Parent\x20segment:\x20','listFields','List\x20available\x20fields\x20for\x20segmentation','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','length','40216cUQUkV','name','segment:fields','4164SQgsRa','error','\x27...','643517xpRTHX','segment','16BZgTZG','7705107PJOBMh','site','600774OEynuB','264uzhZoP','Site:\x20','data','✔\x20Found\x20'];a27_0x52b8=function(){return _0x42104f;};return a27_0x52b8();}const a27_0x15235e=a27_0x19e0;(function(_0x1bbdd7,_0x193f92){const _0x59233a=a27_0x19e0,_0x4c44bf=_0x1bbdd7();while(!![]){try{const _0x56029c=-parseInt(_0x59233a(0x163))/0x1*(-parseInt(_0x59233a(0x15c))/0x2)+-parseInt(_0x59233a(0x15d))/0x3*(-parseInt(_0x59233a(0x151))/0x4)+-parseInt(_0x59233a(0x14a))/0x5*(parseInt(_0x59233a(0x154))/0x6)+parseInt(_0x59233a(0x157))/0x7*(parseInt(_0x59233a(0x159))/0x8)+parseInt(_0x59233a(0x15a))/0x9+parseInt(_0x59233a(0x164))/0xa+-parseInt(_0x59233a(0x149))/0xb;if(_0x56029c===_0x193f92)break;else _0x4c44bf['push'](_0x4c44bf['shift']());}catch(_0x10631d){_0x4c44bf['push'](_0x4c44bf['shift']());}}}(a27_0x52b8,0x86589));import{BaseCommand}from'./command.js';function a27_0x19e0(_0x1b4e27,_0x277b78){const _0x52b818=a27_0x52b8();return a27_0x19e0=function(_0x19e0f6,_0x4bd0b1){_0x19e0f6=_0x19e0f6-0x149;let _0x5281e5=_0x52b818[_0x19e0f6];return _0x5281e5;},a27_0x19e0(_0x1b4e27,_0x277b78);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x15235e(0x152)]=a27_0x15235e(0x153);['description']=a27_0x15235e(0x14d);async['execute'](_0x40160a){const _0x52b268=a27_0x15235e,{options:_0xac331b,args:_0x1280a4,tdx:_0x16d6dd}=_0x40160a,_0x440db2=_0x1280a4[0x0]||_0xac331b[_0x52b268(0x162)];if(!_0x440db2)return console[_0x52b268(0x155)](_0x52b268(0x14f)),console[_0x52b268(0x155)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x52b268(0x155)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0xac331b[_0x52b268(0x14e)]&&(console[_0x52b268(0x155)](_0x52b268(0x15e)+_0xac331b[_0x52b268(0x15b)]),console[_0x52b268(0x155)](_0x52b268(0x14b)+_0x440db2));const _0x19fa47=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x440db2+_0x52b268(0x156),()=>_0x16d6dd[_0x52b268(0x158)][_0x52b268(0x14c)](_0x440db2),{'verbose':_0xac331b[_0x52b268(0x14e)]}),_0x4cdac9=_0x19fa47[_0x52b268(0x15f)];return console['error'](_0x52b268(0x160)+_0x4cdac9[_0x52b268(0x150)]+_0x52b268(0x161)+(_0x4cdac9[_0x52b268(0x150)]!==0x1?'s':'')),await handleSDKOutput(_0x4cdac9,_0xac331b),0x0;}}
1
+ const a29_0x2ef354=a29_0x2c55;(function(_0x1f06c0,_0x3b6a2b){const _0x1455be=a29_0x2c55,_0x4cb512=_0x1f06c0();while(!![]){try{const _0x199362=parseInt(_0x1455be(0x1eb))/0x1+-parseInt(_0x1455be(0x1e2))/0x2+-parseInt(_0x1455be(0x1e4))/0x3+parseInt(_0x1455be(0x1e5))/0x4+-parseInt(_0x1455be(0x1e8))/0x5+-parseInt(_0x1455be(0x1ed))/0x6+-parseInt(_0x1455be(0x1f5))/0x7*(-parseInt(_0x1455be(0x1f3))/0x8);if(_0x199362===_0x3b6a2b)break;else _0x4cb512['push'](_0x4cb512['shift']());}catch(_0x5f2c94){_0x4cb512['push'](_0x4cb512['shift']());}}}(a29_0x2898,0xca9f2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x2c55(_0x26918d,_0x494602){const _0x28987f=a29_0x2898();return a29_0x2c55=function(_0x2c55f0,_0x2e3211){_0x2c55f0=_0x2c55f0-0x1df;let _0x20eb02=_0x28987f[_0x2c55f0];return _0x20eb02;},a29_0x2c55(_0x26918d,_0x494602);}export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x2ef354(0x1f0);[a29_0x2ef354(0x1ee)]=a29_0x2ef354(0x1f1);async['execute'](_0x147a0f){const _0x4fc79c=a29_0x2ef354,{options:_0x3b0d04,args:_0x21490c,tdx:_0x547b8e}=_0x147a0f,_0x13ab18=_0x21490c[0x0]||_0x3b0d04[_0x4fc79c(0x1e6)];if(!_0x13ab18)return console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e9)),console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1f4)),console['error'](_0x4fc79c(0x1f2)),0x1;_0x3b0d04['verbose']&&(console['error'](_0x4fc79c(0x1f6)+_0x3b0d04['site']),console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e1)+_0x13ab18));const _0x5d6e4a=await withSpinner(_0x4fc79c(0x1e7)+_0x13ab18+_0x4fc79c(0x1ec),()=>_0x547b8e[_0x4fc79c(0x1df)]['listFields'](_0x13ab18),{'verbose':_0x3b0d04[_0x4fc79c(0x1ea)]}),_0x4cd566=_0x5d6e4a['data'];return console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e3)+_0x4cd566[_0x4fc79c(0x1e0)]+'\x20field'+(_0x4cd566['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cd566,_0x3b0d04),0x0;}}function a29_0x2898(){const _0x4559ba=['1612286cbrNZO','✔\x20Found\x20','2102694KfPNlV','6173144rOtlih','parentSegment','Listing\x20fields\x20for\x20\x27','1514630TeHwKx','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','731453eRCVmB','\x27...','9483276pGonpA','description','error','segment:fields','List\x20available\x20fields\x20for\x20segmentation','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','15565696fRGdzs','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','7fCfNeP','Site:\x20','segment','length','Parent\x20segment:\x20'];a29_0x2898=function(){return _0x4559ba;};return a29_0x2898();}
@@ -1 +1 @@
1
- function a28_0x2979(_0x303c42,_0x1a529c){const _0x52b8ee=a28_0x52b8();return a28_0x2979=function(_0x2979a7,_0x17c11){_0x2979a7=_0x2979a7-0x114;let _0x733daf=_0x52b8ee[_0x2979a7];return _0x733daf;},a28_0x2979(_0x303c42,_0x1a529c);}const a28_0xa6d3a6=a28_0x2979;(function(_0xa9ee0d,_0x15a985){const _0x331624=a28_0x2979,_0x24a354=_0xa9ee0d();while(!![]){try{const _0x4d6f3d=-parseInt(_0x331624(0x128))/0x1*(parseInt(_0x331624(0x118))/0x2)+parseInt(_0x331624(0x11c))/0x3+parseInt(_0x331624(0x114))/0x4+parseInt(_0x331624(0x125))/0x5+-parseInt(_0x331624(0x122))/0x6*(parseInt(_0x331624(0x117))/0x7)+parseInt(_0x331624(0x11b))/0x8+parseInt(_0x331624(0x116))/0x9;if(_0x4d6f3d===_0x15a985)break;else _0x24a354['push'](_0x24a354['shift']());}catch(_0x32cb88){_0x24a354['push'](_0x24a354['shift']());}}}(a28_0x52b8,0x2d5da));import{BaseCommand}from'./command.js';function a28_0x52b8(){const _0x2b4127=['segmentPath','stringify','name','Show\x20current\x20segment/folder\x20context','16956elSKrM','error','2492982XasUzc','334369Xzteax','1414AryZTn','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','verbose','337840VEmnsS','65202cCJTWY','log','json','execute','root','Context\x20details:','18ocZKEh','format','jsonl','615985eRWRdp','segment:pwd','\x20\x20Path:\x20','197DzWzZy'];a28_0x52b8=function(){return _0x2b4127;};return a28_0x52b8();}export class SegmentPwdCommand extends BaseCommand{[a28_0xa6d3a6(0x12b)]=a28_0xa6d3a6(0x126);['description']=a28_0xa6d3a6(0x12c);async[a28_0xa6d3a6(0x11f)](_0x4ff85b){const _0x113a8a=a28_0xa6d3a6,{options:_0x23d409}=_0x4ff85b;try{const _0x59ee20=_0x23d409[_0x113a8a(0x129)];if(!_0x59ee20)return _0x23d409[_0x113a8a(0x123)]===_0x113a8a(0x11e)||_0x23d409[_0x113a8a(0x123)]===_0x113a8a(0x124)?console[_0x113a8a(0x11d)](JSON[_0x113a8a(0x12a)]({'path':'/','type':_0x113a8a(0x120)})):console[_0x113a8a(0x11d)]('/'),0x0;if(_0x23d409[_0x113a8a(0x123)]===_0x113a8a(0x11e)||_0x23d409[_0x113a8a(0x123)]===_0x113a8a(0x124)){const _0x5d9dd0={'path':_0x59ee20};console[_0x113a8a(0x11d)](JSON[_0x113a8a(0x12a)](_0x5d9dd0));}else console['log'](_0x59ee20),_0x23d409[_0x113a8a(0x11a)]&&(console[_0x113a8a(0x115)](''),console[_0x113a8a(0x115)](_0x113a8a(0x121)),console[_0x113a8a(0x115)](_0x113a8a(0x127)+_0x59ee20),console['error'](''),console[_0x113a8a(0x115)](_0x113a8a(0x119)),console[_0x113a8a(0x115)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x1afe1f){throw _0x1afe1f;}}}
1
+ function a30_0x405b(_0x17116d,_0x298ba5){const _0x291375=a30_0x2913();return a30_0x405b=function(_0x405b50,_0x3960ed){_0x405b50=_0x405b50-0x1b5;let _0x32958f=_0x291375[_0x405b50];return _0x32958f;},a30_0x405b(_0x17116d,_0x298ba5);}function a30_0x2913(){const _0x3dfa12=['9GYctBn','4ysmCJl','1166bRAZLk','description','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','449896UEAubQ','1566020gjGTFM','Context\x20details:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','error','34671hJtlYI','526530TtKWcL','root','name','210uOBZIO','segment:pwd','format','jsonl','1652KeGnkc','log','\x20\x20Path:\x20','368072ClYnQh','segmentPath','json','Show\x20current\x20segment/folder\x20context','36jjoWKm','73428UoAlIn'];a30_0x2913=function(){return _0x3dfa12;};return a30_0x2913();}const a30_0x8a1c12=a30_0x405b;(function(_0x3594ec,_0x2c1c6e){const _0x5ef3d6=a30_0x405b,_0x3b1b53=_0x3594ec();while(!![]){try{const _0xb02987=-parseInt(_0x5ef3d6(0x1cc))/0x1+parseInt(_0x5ef3d6(0x1be))/0x2*(-parseInt(_0x5ef3d6(0x1c7))/0x3)+parseInt(_0x5ef3d6(0x1c8))/0x4*(-parseInt(_0x5ef3d6(0x1b7))/0x5)+-parseInt(_0x5ef3d6(0x1ba))/0x6*(parseInt(_0x5ef3d6(0x1b6))/0x7)+-parseInt(_0x5ef3d6(0x1c1))/0x8*(-parseInt(_0x5ef3d6(0x1c5))/0x9)+parseInt(_0x5ef3d6(0x1cd))/0xa+-parseInt(_0x5ef3d6(0x1c9))/0xb*(-parseInt(_0x5ef3d6(0x1c6))/0xc);if(_0xb02987===_0x2c1c6e)break;else _0x3b1b53['push'](_0x3b1b53['shift']());}catch(_0x4a796f){_0x3b1b53['push'](_0x3b1b53['shift']());}}}(a30_0x2913,0x3f0a9));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a30_0x8a1c12(0x1b9)]=a30_0x8a1c12(0x1bb);[a30_0x8a1c12(0x1ca)]=a30_0x8a1c12(0x1c4);async['execute'](_0x5bf1d8){const _0x33e072=a30_0x8a1c12,{options:_0x50a8b9}=_0x5bf1d8;try{const _0x412c59=_0x50a8b9[_0x33e072(0x1c2)];if(!_0x412c59)return _0x50a8b9['format']===_0x33e072(0x1c3)||_0x50a8b9[_0x33e072(0x1bc)]===_0x33e072(0x1bd)?console['log'](JSON['stringify']({'path':'/','type':_0x33e072(0x1b8)})):console[_0x33e072(0x1bf)]('/'),0x0;if(_0x50a8b9[_0x33e072(0x1bc)]==='json'||_0x50a8b9[_0x33e072(0x1bc)]===_0x33e072(0x1bd)){const _0x4e1454={'path':_0x412c59};console[_0x33e072(0x1bf)](JSON['stringify'](_0x4e1454));}else console[_0x33e072(0x1bf)](_0x412c59),_0x50a8b9['verbose']&&(console[_0x33e072(0x1b5)](''),console[_0x33e072(0x1b5)](_0x33e072(0x1ce)),console[_0x33e072(0x1b5)](_0x33e072(0x1c0)+_0x412c59),console[_0x33e072(0x1b5)](''),console[_0x33e072(0x1b5)](_0x33e072(0x1cf)),console['error'](_0x33e072(0x1cb)));return 0x0;}catch(_0x25257a){throw _0x25257a;}}}