@treasuredata/tdx 0.10.0 → 0.11.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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +73 -3
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.d.ts +1 -1
- package/dist/core/command-output.d.ts.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +32 -4
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.d.ts +10 -6
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +5 -2
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/index.d.ts +74 -4
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x22f724=a20_0x3e00;(function(_0x1548aa,_0x110a77){const _0x482638=a20_0x3e00,_0x1c7d7d=_0x1548aa();while(!![]){try{const _0x455a9e=-parseInt(_0x482638(0x167))/0x1+-parseInt(_0x482638(0x12c))/0x2*(parseInt(_0x482638(0xa3))/0x3)+parseInt(_0x482638(0x174))/0x4+parseInt(_0x482638(0x13c))/0x5+parseInt(_0x482638(0x137))/0x6*(-parseInt(_0x482638(0xcc))/0x7)+-parseInt(_0x482638(0x157))/0x8+parseInt(_0x482638(0xc2))/0x9;if(_0x455a9e===_0x110a77)break;else _0x1c7d7d['push'](_0x1c7d7d['shift']());}catch(_0x4146da){_0x1c7d7d['push'](_0x1c7d7d['shift']());}}}(a20_0x45f0,0x47ded));function a20_0x45f0(){const _0x322907=['input','description','Output\x20directory\x20\x27','...','\x20->\x20ImageGen:','model','llm:project:create','keys','yellow','tsv','agents','execute','4521568XRKpCa','chatId','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','error','Error:\x20','floor','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','\x20\x20Cause:\x20','history','targetKnowledgeBase','includes','stack','Error:\x20Agent\x20name\x20is\x20required','tool_call','Creating\x20agent\x20\x27','systemPrompt','338835wZtZtX','integrations','exportedFrom','outputDir','format','llm:agents','Select\x20a\x20chat\x20session:','short','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','limit','data','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','deleteProject','1942000TOoJXh','toLowerCase','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Create\x20a\x20new\x20LLM\x20project','(no\x20message)','\x20--last','3TSowoq','temperature','slice','No\x20projects\x20found','last','output','Load\x20more...','string','models','llm:agent:create','llm:agent:show','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','targetImageGenerator','Set\x20current\x20project\x20context','List\x20agents\x20in\x20current\x20project','stringify','\x20project(s)','\x20agent(s)','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','agentId','Agent\x20created:\x20','projectName','starterMessage','No\x20messages\x20found\x20in\x20chat\x20history.','\x0aStack\x20trace:','prompts','d\x20ago','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','backupProject','getBackupMetadata','Delete\x20an\x20LLM\x20project','10555839HIvucr','jsonl','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','map','existsSync','bold','Update\x20an\x20existing\x20agent','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','[tool]\x20\x20\x20','numeric','35gHrBgt','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','verbose','Validating\x20backup\x20from\x20\x27','llmProject','llm:use','rmSync','llm','image','Getting\x20default\x20project...','targetAgent','getTime','default','sourceSite','llm:project:backup','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Integrations:\x20','\x20->\x20WebSearch:','Error:\x20Project\x20name\x20is\x20required','createdAt','getOrCreateDefaultProject','get','tdx\x20chats','\x27...','log','llm:project:restore','Deleting\x20agent...','yes','setCurrentProject','maxToolIterations','.llm','Restore\x20cancelled.','cyan','\x20\x20Agents:\x20','resolveProjectId','llm:projects','length','Error:\x20Backup\x20folder\x20path\x20is\x20required','List\x20all\x20LLM\x20projects','resolveAgentId','Deleting\x20project\x20\x27','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','updateAgent','\x20-\x20','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','deleteAgent','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','⚒️\x20','Backing\x20up\x20project\x20\x27','magenta','localeCompare','Fetching\x20chat\x20sessions...','Agent\x20updated:\x20','agent','push','\x20->\x20Agent:','firstInputContent','Resolving\x20agent\x20\x27','Delete\x20an\x20agent','split','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','web','content','[input]\x20\x20','set','Fetching\x20projects...','projectId','Checking\x20for\x20existing\x20projects...','chats','Unknown','Project\x20restored:\x20','Fetching\x20available\x20models...','select','Resolving\x20project\x20\x27','(no\x20agent)','[image]\x20\x20','updatedAt','find','toLocaleDateString','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Show\x20agent\x20details','h\x20ago','Fetching\x20agents...','tdx\x20llm\x20history','Fetching\x20most\x20recent\x20chat...','table','m\x20ago','join','\x20bytes)','INVALID_ARGUMENT','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','__load_more__','blue','A\x20project\x20named\x20\x27','Invalid\x20path\x20syntax:\x20','json','393944LLEsvB','filter','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','dryRun','[tool_call]','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Use\x20format:\x20project-name/agent-name','entries','createProject','🤖\x20','Fetching\x20agent...','376308pRFOwP','Setting\x20project\x20context\x20to\x20\x27','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','Usage:\x20','Usage:\x20tdx\x20llm\x20use\x20<project-name>','253015EWWKKo','[output]\x20','tool','llm:agent:delete','restoreProject','sort','knowledgeBases','dim','projects','attributes','name','substring','llm:agent:update','counts','Project\x20not\x20found:\x20'];a20_0x45f0=function(){return _0x322907;};return a20_0x45f0();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/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'../core/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import*as a20_0x8d73a7 from'node:fs';function handleSDKError(_0x19361c,_0x378aa7){const _0x276a9b=a20_0x3e00;if(_0x19361c instanceof SDKError)console['error'](_0x276a9b(0x15b)+_0x19361c['message']),_0x378aa7[_0x276a9b(0xce)]&&(_0x19361c['cause']&&console[_0x276a9b(0x15a)](_0x276a9b(0x15e)+_0x19361c['cause']),_0x19361c[_0x276a9b(0x162)]&&(console[_0x276a9b(0x15a)](_0x276a9b(0xbb)),console[_0x276a9b(0x15a)](_0x19361c[_0x276a9b(0x162)])));else throw _0x19361c;}function formatChatHistoryEntry(_0x440f08,_0x5a8613){const _0x2a86c3=a20_0x3e00,_0x409126=getChalk(_0x5a8613),_0x39ba9a=_0x409126[_0x2a86c3(0x143)](_0x440f08['at']);if(_0x2a86c3(0x14b)in _0x440f08){const _0x11f077=_0x409126[_0x2a86c3(0xec)](_0x2a86c3(0x10b));return _0x39ba9a+'\x20'+_0x11f077+':\x20'+_0x440f08[_0x2a86c3(0x14b)];}if(_0x2a86c3(0x10a)in _0x440f08){const _0x234a24=_0x409126['green']('[content]');return _0x39ba9a+'\x20'+_0x234a24+':\x20'+_0x440f08['content'];}if(_0x2a86c3(0x164)in _0x440f08){const _0x229a03=_0x409126['yellow'](_0x2a86c3(0x130)),{functionName:_0x2d647c,functionArguments:_0x1c7b42,targetFunction:_0x330543}=_0x440f08[_0x2a86c3(0x164)];let _0x45f6be=_0x39ba9a+'\x20'+_0x229a03+':\x20'+_0x409126[_0x2a86c3(0xc7)](_0x2d647c);if(_0x1c7b42&&Object[_0x2a86c3(0x152)](_0x1c7b42)[_0x2a86c3(0xf0)]>0x0){const _0x53ec80=Object[_0x2a86c3(0x133)](_0x1c7b42)[_0x2a86c3(0xc5)](([_0x5da7c5,_0x4a00de])=>_0x5da7c5+'='+JSON['stringify'](_0x4a00de))['join'](',\x20');_0x45f6be+='('+_0x53ec80+')';}_0x330543&&(_0x45f6be+=_0x409126[_0x2a86c3(0x143)]('\x20['+_0x330543+']'));let _0x3d41ad='';if(_0x440f08['tool_call'][_0x2a86c3(0x160)])_0x3d41ad='\x20->\x20KB:'+_0x440f08[_0x2a86c3(0x164)][_0x2a86c3(0x160)][_0x2a86c3(0x146)];else{if(_0x440f08['tool_call'][_0x2a86c3(0xd6)])_0x3d41ad=_0x2a86c3(0x103)+_0x440f08[_0x2a86c3(0x164)][_0x2a86c3(0xd6)][_0x2a86c3(0x146)];else{if(_0x440f08[_0x2a86c3(0x164)]['targetWebSearchTool'])_0x3d41ad=_0x2a86c3(0xdd)+_0x440f08[_0x2a86c3(0x164)]['targetWebSearchTool'][_0x2a86c3(0x146)];else _0x440f08[_0x2a86c3(0x164)][_0x2a86c3(0xaf)]&&(_0x3d41ad=_0x2a86c3(0x14f)+_0x440f08[_0x2a86c3(0x164)]['targetImageGenerator'][_0x2a86c3(0x146)]);}}return _0x45f6be+_0x3d41ad;}if('tool'in _0x440f08){const _0x57cb06=_0x409126[_0x2a86c3(0xfd)](_0x2a86c3(0xca)),{functionName:_0x5cfb44,functionArguments:_0x202039,content:_0x1e7c3c,newChat:_0x2e277d}=_0x440f08[_0x2a86c3(0x13e)];let _0x294226=_0x39ba9a+'\x20'+_0x57cb06+':\x20'+_0x409126[_0x2a86c3(0xc7)](_0x5cfb44);if(_0x202039){const _0x3edebb=typeof _0x202039===_0x2a86c3(0xaa)?_0x202039:JSON[_0x2a86c3(0xb2)](_0x202039);_0x294226+='('+_0x3edebb+')';}return _0x1e7c3c&&(_0x294226+='\x0a'+_0x409126['dim'](_0x1e7c3c)),_0x2e277d&&(_0x294226+=_0x409126[_0x2a86c3(0x143)]('\x20→\x20chat:\x20'+_0x2e277d['id'])),_0x294226;}if(_0x2a86c3(0xa8)in _0x440f08){const _0x192184=_0x409126[_0x2a86c3(0x128)](_0x2a86c3(0x13d));return _0x39ba9a+'\x20'+_0x192184+':\x20'+_0x440f08[_0x2a86c3(0xa8)][_0x2a86c3(0x146)]+'\x20('+_0x440f08[_0x2a86c3(0xa8)]['content']['length']+_0x2a86c3(0x124);}if('image'in _0x440f08){const _0x33c843=_0x409126[_0x2a86c3(0x128)](_0x2a86c3(0x117)),{width:_0x303a94,height:_0x5e1d97,headerText:_0x315a48}=_0x440f08[_0x2a86c3(0xd4)],_0x489474=_0x315a48?_0x2a86c3(0xf7)+_0x315a48:'';return _0x39ba9a+'\x20'+_0x33c843+':\x20'+_0x303a94+'x'+_0x5e1d97+_0x489474;}if(_0x2a86c3(0x15a)in _0x440f08){const _0x134048=_0x409126['red']('[error]\x20\x20');return _0x39ba9a+'\x20'+_0x134048+':\x20'+_0x440f08[_0x2a86c3(0x15a)];}return _0x39ba9a+'\x20'+_0x409126[_0x2a86c3(0x143)]('[unknown]')+':\x20'+JSON[_0x2a86c3(0xb2)](_0x440f08);}async function executeChatHistoryCommand(_0x4b717f,_0x1bcb36){const _0x3e2c18=a20_0x3e00,{options:_0x2f47bc,args:_0x2997ce,tdx:_0x5ea9a6}=_0x4b717f,_0x1a7614=_0x2997ce[0x0],_0x66461d=_0x2f47bc,_0x239314=_0x66461d[_0x3e2c18(0xa7)];try{if(_0x239314&&_0x1a7614)return console[_0x3e2c18(0x15a)](_0x3e2c18(0xae)),console[_0x3e2c18(0x15a)](_0x3e2c18(0x13a)+_0x1bcb36+_0x3e2c18(0xa2)),0x1;if(!_0x1a7614&&!_0x239314&&_0x2f47bc[_0x3e2c18(0x16b)]!==undefined){const _0x3bcb76=resolveLimit(_0x2f47bc[_0x3e2c18(0x170)],DEFAULT_LLM_LIMIT),_0xdada2c=await withSpinner(_0x3e2c18(0xff),()=>_0x5ea9a6[_0x3e2c18(0xd3)][_0x3e2c18(0x110)](_0x3bcb76),{'verbose':_0x2f47bc[_0x3e2c18(0xce)]});return await handleSDKOutput(_0xdada2c['data'],_0x2f47bc),0x0;}const _0x15a745=await getChatIdOrSelect(_0x5ea9a6,_0x2f47bc,_0x239314,_0x1a7614);if(!_0x15a745)return 0x0;return await displayChatHistory(_0x15a745,_0x5ea9a6,_0x2f47bc),0x0;}catch(_0x22cf7b){return handleSDKError(_0x22cf7b,_0x2f47bc),0x1;}}async function displayChatHistory(_0x128e45,_0x4851a5,_0x5eb595){const _0x575295=a20_0x3e00,_0x4dc621=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x128e45+'\x27...',()=>_0x4851a5['llm'][_0x575295(0x15f)](_0x128e45),{'verbose':_0x5eb595[_0x575295(0xce)]}),_0x54066a=_0x4dc621[_0x575295(0x171)]['data']??[];if(_0x54066a[_0x575295(0xf0)]===0x0){console[_0x575295(0xe4)](_0x575295(0xba));return;}if(_0x5eb595[_0x575295(0x16b)]!==undefined)await handleSDKOutput(_0x54066a,_0x5eb595);else{const _0x59aa84=_0x54066a['map'](_0x581531=>formatChatHistoryEntry(_0x581531,_0x5eb595)),_0x46b318=_0x59aa84[_0x575295(0x123)]('\x0a');await writeOutput(_0x46b318,_0x5eb595[_0x575295(0xa8)],_0x575295(0x121));}}async function getChatIdOrSelect(_0x3f3d73,_0x19a0b2,_0x58dcb4,_0xb1b264){const _0xb4a0c0=a20_0x3e00;if(_0xb1b264)return _0xb1b264;if(_0x58dcb4){const _0xf8e5f3=await withSpinner(_0xb4a0c0(0x120),()=>_0x3f3d73[_0xb4a0c0(0xd3)]['chats'](0x1),{'verbose':_0x19a0b2[_0xb4a0c0(0xce)]});if(_0xf8e5f3['data'][_0xb4a0c0(0xf0)]===0x0)return console[_0xb4a0c0(0xe4)]('No\x20chat\x20sessions\x20found.'),undefined;return _0xf8e5f3['data'][0x0]['id'];}const _0x3706bb=await selectChatInteractively(_0x3f3d73,_0x19a0b2);if(!_0x3706bb)return console[_0xb4a0c0(0xe4)]('\x0aCancelled'),undefined;return _0x3706bb;}async function getProjectIdOrDefault(_0x5073b4){const _0xfc3a8b=await getProjectWithName(_0x5073b4);return _0xfc3a8b['id'];}async function getProjectWithName(_0xab26fb){const _0x46473c=a20_0x3e00,{tdx:_0x254161,options:_0x285487}=_0xab26fb,_0x528a83=_0x285487[_0x46473c(0xd0)];if(_0x528a83){const _0x47854a=await withSpinner(_0x46473c(0x115)+_0x528a83+_0x46473c(0xe3),()=>_0x254161[_0x46473c(0xd3)][_0x46473c(0xee)](_0x528a83),{'verbose':_0x285487[_0x46473c(0xce)]});return{'id':_0x47854a[_0x46473c(0x171)],'name':_0x528a83};}const _0x592acf=_0x254161[_0x46473c(0xd3)]['getCurrentProject']();if(_0x592acf){const _0x356dc9=await _0x254161[_0x46473c(0xd3)]['projects'](),_0x8524fb=_0x356dc9[_0x46473c(0x119)](_0x3c1205=>_0x3c1205['id']===_0x592acf);return{'id':_0x592acf,'name':_0x8524fb?.[_0x46473c(0x145)]['name']||_0x46473c(0x111)};}const _0x1d1565=await withSpinner(_0x46473c(0xd5),()=>_0x254161['llm'][_0x46473c(0xe0)](),{'verbose':_0x285487[_0x46473c(0xce)]});return{'id':_0x1d1565[_0x46473c(0x171)]['id'],'name':_0x1d1565[_0x46473c(0x171)][_0x46473c(0x145)][_0x46473c(0x146)]};}function toLLMProjectInfo(_0x49a956){const _0x3a5b8a=a20_0x3e00;return{'name':_0x49a956['attributes'][_0x3a5b8a(0x146)],'description':_0x49a956[_0x3a5b8a(0x145)][_0x3a5b8a(0x14c)],'createdAt':_0x49a956[_0x3a5b8a(0x145)]['createdAt'],'updatedAt':_0x49a956[_0x3a5b8a(0x145)][_0x3a5b8a(0x118)]};}function toAgentInfo(_0x258f95){const _0x312406=a20_0x3e00;return{'name':_0x258f95[_0x312406(0x145)][_0x312406(0x146)],'description':_0x258f95['attributes'][_0x312406(0x14c)],'prompt':truncatePrompt(_0x258f95[_0x312406(0x145)]['prompt']),'createdAt':_0x258f95[_0x312406(0x145)][_0x312406(0xdf)],'updatedAt':_0x258f95[_0x312406(0x145)][_0x312406(0x118)]};}function truncatePrompt(_0x4f4d10){const _0x37fc29=a20_0x3e00;if(!_0x4f4d10)return undefined;const _0x4c43d0=0x64;if(_0x4f4d10[_0x37fc29(0xf0)]<=_0x4c43d0)return _0x4f4d10;return _0x4f4d10[_0x37fc29(0xa5)](0x0,_0x4c43d0)+_0x37fc29(0x14e);}export class LLMModelsCommand extends BaseCommand{[a20_0x22f724(0x146)]='llm:models';[a20_0x22f724(0x14c)]='List\x20available\x20LLM\x20models';async[a20_0x22f724(0x156)](_0x4a322e){const _0x42c6b5=a20_0x22f724,{options:_0x18cd26,tdx:_0x4b018c}=_0x4a322e;try{const _0xddb0f3=await withSpinner(_0x42c6b5(0x113),()=>_0x4b018c[_0x42c6b5(0xd3)][_0x42c6b5(0xab)](),{'verbose':_0x18cd26[_0x42c6b5(0xce)]});return await handleSDKOutput(_0xddb0f3['data'],_0x18cd26),0x0;}catch(_0x53e375){return handleSDKError(_0x53e375,_0x18cd26),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0xef);['description']=a20_0x22f724(0xf2);async[a20_0x22f724(0x156)](_0x57fbd5){const _0x12aacd=a20_0x22f724,{options:_0x86bd78,args:_0x15428f,tdx:_0x362cd9}=_0x57fbd5,_0x158f1f=getChalk(_0x86bd78),_0x5ec45c=_0x86bd78[_0x12aacd(0x109)],_0x5d805d=_0x86bd78['site'];try{const _0x238ee5=_0x15428f[0x0],_0x24c675=resolveLimit(_0x86bd78[_0x12aacd(0x170)],DEFAULT_LLM_LIMIT),_0x11b405=await withSpinner(_0x12aacd(0x10d),()=>_0x362cd9[_0x12aacd(0xd3)][_0x12aacd(0x144)](_0x24c675),{'verbose':_0x86bd78[_0x12aacd(0xce)]});let _0x2b2382=_0x11b405[_0x12aacd(0x171)];_0x238ee5&&(_0x2b2382=_0x11b405[_0x12aacd(0x171)][_0x12aacd(0x12d)](_0x9dd6ab=>matchGlobPattern(_0x9dd6ab[_0x12aacd(0x145)][_0x12aacd(0x146)],_0x238ee5)));const _0x29c99c=_0x86bd78[_0x12aacd(0x16b)]===_0x12aacd(0x12b)||_0x86bd78[_0x12aacd(0x16b)]===_0x12aacd(0xc3)||_0x86bd78['format']===_0x12aacd(0x121)||_0x86bd78[_0x12aacd(0x16b)]==='tsv';if(_0x29c99c){const _0x1511eb=_0x2b2382[_0x12aacd(0xc5)](_0x13efd1=>({...toLLMProjectInfo(_0x13efd1),..._0x5ec45c?{'url':getLLMProjectUrl(_0x5d805d,_0x13efd1['id'])}:{}}));await handleSDKOutput(_0x1511eb,_0x86bd78);}else{const _0xc4d65c=[];if(_0x2b2382[_0x12aacd(0xf0)]===0x0)_0xc4d65c[_0x12aacd(0x102)](_0x158f1f['dim'](_0x12aacd(0xa6)));else{const _0x28f91f=[..._0x2b2382][_0x12aacd(0x141)]((_0x93d04e,_0x37f1a8)=>_0x93d04e['attributes'][_0x12aacd(0x146)]['localeCompare'](_0x37f1a8['attributes'][_0x12aacd(0x146)]));for(const _0x363e1a of _0x28f91f){if(_0x5ec45c){const _0x17ae65=getLLMProjectUrl(_0x5d805d,_0x363e1a['id']);_0xc4d65c[_0x12aacd(0x102)](_0x12aacd(0xfb)+_0x363e1a[_0x12aacd(0x145)][_0x12aacd(0x146)]+'\x20\x20'+_0x158f1f[_0x12aacd(0x143)](_0x17ae65));}else _0xc4d65c[_0x12aacd(0x102)](_0x12aacd(0xfb)+_0x363e1a[_0x12aacd(0x145)][_0x12aacd(0x146)]);}_0xc4d65c['push'](_0x158f1f[_0x12aacd(0x143)](_0x2b2382[_0x12aacd(0xf0)]+_0x12aacd(0xb3)));}await writeOutput(_0xc4d65c[_0x12aacd(0x123)]('\x0a'),_0x86bd78[_0x12aacd(0xa8)],_0x12aacd(0x121));}return 0x0;}catch(_0x4af5f0){return handleSDKError(_0x4af5f0,_0x86bd78),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0x16c);['description']=a20_0x22f724(0xb1);async[a20_0x22f724(0x156)](_0x267af0){const _0x4dc72d=a20_0x22f724,{options:_0x1e0872,args:_0x3b6ba6,tdx:_0x227f6b}=_0x267af0,_0x305d9b=getChalk(_0x1e0872),_0x383aea=_0x1e0872[_0x4dc72d(0x109)],_0x7ce8ae=_0x1e0872['site'];try{const _0x12bf86=_0x3b6ba6[0x0];let _0x5da73a=_0x12bf86,_0x1290c5,_0x1726ae;if(_0x12bf86&&_0x12bf86['includes']('/')){const _0x519781=_0x12bf86[_0x4dc72d(0x107)]('/');if(_0x519781['length']===0x2){const [_0x486c93,_0x4c7b56]=_0x519781,_0x680621=await _0x227f6b['llm'][_0x4dc72d(0x144)](),_0x1d989e=_0x680621['find'](_0x176f82=>_0x176f82[_0x4dc72d(0x145)]['name'][_0x4dc72d(0x175)]()===_0x486c93[_0x4dc72d(0x175)]());if(!_0x1d989e)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x4dc72d(0x14a)+_0x486c93,undefined,{'helpText':_0x4dc72d(0xb5)});_0x1290c5=_0x1d989e['id'],_0x1726ae=_0x1d989e[_0x4dc72d(0x145)][_0x4dc72d(0x146)],_0x5da73a=_0x4c7b56;}else throw new SDKError(ErrorCode[_0x4dc72d(0x125)],_0x4dc72d(0x12a)+_0x12bf86,undefined,{'helpText':_0x4dc72d(0x132)});}else{const _0x226bc5=await getProjectWithName(_0x267af0);_0x1290c5=_0x226bc5['id'],_0x1726ae=_0x226bc5[_0x4dc72d(0x146)];}const _0x1957bd=await withSpinner(_0x4dc72d(0x11e),()=>_0x227f6b[_0x4dc72d(0xd3)][_0x4dc72d(0x155)](_0x1290c5),{'verbose':_0x1e0872[_0x4dc72d(0xce)]});let _0x5a99e3=_0x1957bd['data'];_0x5da73a&&(_0x5a99e3=_0x1957bd['data']['filter'](_0x550bcf=>matchGlobPattern(_0x550bcf[_0x4dc72d(0x145)][_0x4dc72d(0x146)],_0x5da73a)));const _0x4cd4d6=_0x1e0872[_0x4dc72d(0x16b)]===_0x4dc72d(0x12b)||_0x1e0872[_0x4dc72d(0x16b)]===_0x4dc72d(0xc3)||_0x1e0872[_0x4dc72d(0x16b)]==='table'||_0x1e0872[_0x4dc72d(0x16b)]===_0x4dc72d(0x154);if(_0x4cd4d6){const _0x4afc18=_0x5a99e3[_0x4dc72d(0xc5)](_0x52f192=>({...toAgentInfo(_0x52f192),..._0x383aea?{'chatUrl':getLLMAgentChatUrl(_0x7ce8ae,_0x1290c5,_0x52f192['id'])}:{}}));await handleSDKOutput(_0x4afc18,_0x1e0872);}else{const _0x1ba461=[];_0x1ba461[_0x4dc72d(0x102)](_0x305d9b[_0x4dc72d(0x143)]('['+_0x1726ae+']'));if(_0x5a99e3[_0x4dc72d(0xf0)]===0x0)_0x1ba461[_0x4dc72d(0x102)](_0x305d9b[_0x4dc72d(0x143)]('No\x20agents\x20found'));else{const _0x5e6037=[..._0x5a99e3]['sort']((_0x5b1110,_0x5de247)=>_0x5b1110[_0x4dc72d(0x145)][_0x4dc72d(0x146)][_0x4dc72d(0xfe)](_0x5de247[_0x4dc72d(0x145)][_0x4dc72d(0x146)]));for(const _0x25a7d2 of _0x5e6037){if(_0x383aea){const _0x3132c6=getLLMAgentChatUrl(_0x7ce8ae,_0x1290c5,_0x25a7d2['id']);_0x1ba461[_0x4dc72d(0x102)](_0x4dc72d(0x135)+_0x25a7d2[_0x4dc72d(0x145)][_0x4dc72d(0x146)]+'\x20\x20'+_0x305d9b[_0x4dc72d(0x143)](_0x3132c6));}else _0x1ba461[_0x4dc72d(0x102)](_0x4dc72d(0x135)+_0x25a7d2['attributes'][_0x4dc72d(0x146)]);}_0x1ba461[_0x4dc72d(0x102)](_0x305d9b[_0x4dc72d(0x143)](_0x5a99e3['length']+_0x4dc72d(0xb4)));}await writeOutput(_0x1ba461[_0x4dc72d(0x123)]('\x0a'),_0x1e0872['output'],_0x4dc72d(0x121));}return 0x0;}catch(_0x257625){return handleSDKError(_0x257625,_0x1e0872),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a20_0x22f724(0xad);[a20_0x22f724(0x14c)]=a20_0x22f724(0x11c);async['execute'](_0x1ff922){const _0x13ea70=a20_0x22f724,{options:_0x2d9035,args:_0x30bc94,tdx:_0x565779}=_0x1ff922;if(_0x30bc94['length']===0x0)return console[_0x13ea70(0x15a)](_0x13ea70(0x163)),console[_0x13ea70(0x15a)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x228ce2=_0x30bc94[0x0];try{const _0x41fb54=await getProjectIdOrDefault(_0x1ff922),_0x2c0af6=await withSpinner(_0x13ea70(0x105)+_0x228ce2+_0x13ea70(0xe3),()=>_0x565779[_0x13ea70(0xd3)][_0x13ea70(0xf3)](_0x228ce2,_0x41fb54),{'verbose':_0x2d9035[_0x13ea70(0xce)]}),_0x1ec9ce=await withSpinner(_0x13ea70(0x136),()=>_0x565779[_0x13ea70(0xd3)]['agent'](_0x2c0af6[_0x13ea70(0x171)]),{'verbose':_0x2d9035[_0x13ea70(0xce)]});return await handleSDKOutput([_0x1ec9ce[_0x13ea70(0x171)]],_0x2d9035),0x0;}catch(_0x5074bc){return handleSDKError(_0x5074bc,_0x2d9035),0x1;}}}function a20_0x3e00(_0x172c28,_0x18f948){_0x172c28=_0x172c28-0xa0;const _0x45f0d6=a20_0x45f0();let _0x3e00c1=_0x45f0d6[_0x172c28];return _0x3e00c1;}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0xac);[a20_0x22f724(0x14c)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a20_0x22f724(0x156)](_0xbdb8f0){const _0x1d3597=a20_0x22f724,{options:_0x3ea169,args:_0x3b8adb,tdx:_0x5b099e}=_0xbdb8f0;if(_0x3b8adb[_0x1d3597(0xf0)]===0x0)return console['error'](_0x1d3597(0x163)),console[_0x1d3597(0x15a)](_0x1d3597(0xc9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x3244af=_0x3b8adb[0x0],_0x14525f=_0x3ea169,_0x9310c8=_0x14525f[_0x1d3597(0x166)],_0x122bc3=_0x14525f[_0x1d3597(0x150)]||'claude-4.5-haiku',_0x3aafb0=_0x14525f[_0x1d3597(0xb9)],_0x57f978=_0x14525f[_0x1d3597(0xe9)]?Number(_0x14525f[_0x1d3597(0xe9)]):undefined,_0x59ff31=_0x14525f[_0x1d3597(0xa4)]?Number(_0x14525f[_0x1d3597(0xa4)]):undefined;try{let _0x295592,_0x1dafd0;if(_0x3244af[_0x1d3597(0x161)]('/')){const _0x45b0bb=_0x3244af['split']('/');if(_0x45b0bb[_0x1d3597(0xf0)]===0x2){const [_0x35b1cc,_0x14c323]=_0x45b0bb,_0x425893=await withSpinner(_0x1d3597(0x115)+_0x35b1cc+_0x1d3597(0xe3),()=>_0x5b099e[_0x1d3597(0xd3)][_0x1d3597(0xee)](_0x35b1cc),{'verbose':_0x3ea169[_0x1d3597(0xce)]});_0x295592=_0x425893['data'],_0x1dafd0=_0x14c323;}else throw new SDKError(ErrorCode[_0x1d3597(0x125)],_0x1d3597(0x12a)+_0x3244af,undefined,{'helpText':_0x1d3597(0x132)});}else _0x295592=await getProjectIdOrDefault(_0xbdb8f0),_0x1dafd0=_0x3244af;const _0x2eef00=await withSpinner(_0x1d3597(0x165)+_0x1dafd0+_0x1d3597(0xe3),()=>_0x5b099e[_0x1d3597(0xd3)]['createAgent']({'name':_0x1dafd0,'projectId':_0x295592,'modelType':_0x122bc3,'systemPrompt':_0x9310c8,'starterMessage':_0x3aafb0,'maxToolIterations':_0x57f978,'temperature':_0x59ff31}),{'verbose':_0x3ea169[_0x1d3597(0xce)]});return console['log'](_0x1d3597(0xb7)+_0x2eef00[_0x1d3597(0x171)]['id']),await handleSDKOutput([_0x2eef00[_0x1d3597(0x171)]],_0x3ea169),0x0;}catch(_0x58d84d){return handleSDKError(_0x58d84d,_0x3ea169),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0x148);[a20_0x22f724(0x14c)]=a20_0x22f724(0xc8);async['execute'](_0x53808){const _0x2c3ab4=a20_0x22f724,{options:_0x426135,args:_0x20e731,tdx:_0x2c3f41}=_0x53808;if(_0x20e731[_0x2c3ab4(0xf0)]===0x0)return console[_0x2c3ab4(0x15a)](_0x2c3ab4(0x163)),console['error'](_0x2c3ab4(0x176)),0x1;const _0x4ce281=_0x20e731[0x0],_0x4dc856=_0x426135,_0x470e6c=_0x4dc856[_0x2c3ab4(0x146)],_0xd870e=_0x4dc856['prompt'],_0xd81063=_0x4dc856[_0x2c3ab4(0x14c)],_0x940dc1=_0x4dc856[_0x2c3ab4(0xb9)];if(!_0x470e6c&&!_0xd870e&&!_0xd81063&&!_0x940dc1)return console['error']('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console['error']('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x268015=await getProjectIdOrDefault(_0x53808),_0x16c493=await withSpinner(_0x2c3ab4(0x105)+_0x4ce281+_0x2c3ab4(0xe3),()=>_0x2c3f41[_0x2c3ab4(0xd3)]['resolveAgentId'](_0x4ce281,_0x268015),{'verbose':_0x426135['verbose']}),_0x2dc9cf=_0x16c493['data'],_0x4748ae=await withSpinner('Updating\x20agent...',()=>_0x2c3f41[_0x2c3ab4(0xd3)][_0x2c3ab4(0xf6)](_0x2dc9cf,{'name':_0x470e6c,'prompt':_0xd870e,'description':_0xd81063,'starterMessage':_0x940dc1}),{'verbose':_0x426135['verbose']});return console[_0x2c3ab4(0xe4)](_0x2c3ab4(0x100)+_0x4748ae[_0x2c3ab4(0x171)]['id']),await handleSDKOutput([_0x4748ae['data']],_0x426135),0x0;}catch(_0x3d51bc){return handleSDKError(_0x3d51bc,_0x426135),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0x13f);[a20_0x22f724(0x14c)]=a20_0x22f724(0x106);async[a20_0x22f724(0x156)](_0x33b201){const _0x3ae1cf=a20_0x22f724,{options:_0xb5a707,args:_0x33b658,tdx:_0x124a2e}=_0x33b201;if(_0x33b658[_0x3ae1cf(0xf0)]===0x0)return console[_0x3ae1cf(0x15a)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x3ae1cf(0x15a)](_0x3ae1cf(0x16f)),0x1;const _0x47af06=_0x33b658[0x0];try{const _0x4e70a9=await getProjectIdOrDefault(_0x33b201),_0x310290=await withSpinner(_0x3ae1cf(0x105)+_0x47af06+_0x3ae1cf(0xe3),()=>_0x124a2e[_0x3ae1cf(0xd3)][_0x3ae1cf(0xf3)](_0x47af06,_0x4e70a9),{'verbose':_0xb5a707[_0x3ae1cf(0xce)]}),_0x5e7131=_0x310290[_0x3ae1cf(0x171)];return await withSpinner(_0x3ae1cf(0xe6),()=>_0x124a2e[_0x3ae1cf(0xd3)][_0x3ae1cf(0xf9)](_0x5e7131),{'verbose':_0xb5a707[_0x3ae1cf(0xce)]}),console[_0x3ae1cf(0xe4)]('Agent\x20deleted:\x20'+_0x5e7131),0x0;}catch(_0x57e9d6){return handleSDKError(_0x57e9d6,_0xb5a707),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']='llm:history';[a20_0x22f724(0x14c)]=a20_0x22f724(0x108);async[a20_0x22f724(0x156)](_0x33be15){const _0x48fcb6=a20_0x22f724;return executeChatHistoryCommand(_0x33be15,_0x48fcb6(0x11f));}}export class LLMUseCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0xd1);['description']=a20_0x22f724(0xb0);async[a20_0x22f724(0x156)](_0x44a9e1){const _0x236b63=a20_0x22f724,{options:_0x314233,args:_0x2bcd38,tdx:_0x5ceaaf}=_0x44a9e1;if(_0x2bcd38[_0x236b63(0xf0)]===0x0)return console[_0x236b63(0x15a)](_0x236b63(0xde)),console[_0x236b63(0x15a)](_0x236b63(0x13b)),0x1;const _0x23f8ba=_0x2bcd38[0x0];try{return await withSpinner(_0x236b63(0x138)+_0x23f8ba+_0x236b63(0xe3),()=>_0x5ceaaf[_0x236b63(0xd3)][_0x236b63(0xe8)](_0x23f8ba),{'verbose':_0x314233['verbose']}),console[_0x236b63(0xe4)]('Project\x20context\x20set\x20to:\x20'+_0x23f8ba),0x0;}catch(_0x261521){return handleSDKError(_0x261521,_0x314233),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a20_0x22f724(0x151);[a20_0x22f724(0x14c)]=a20_0x22f724(0xa0);async[a20_0x22f724(0x156)](_0x2312aa){const _0x56d706=a20_0x22f724,{options:_0x38cde8,args:_0x710c25,tdx:_0x3c8194}=_0x2312aa;if(_0x710c25[_0x56d706(0xf0)]===0x0)return console[_0x56d706(0x15a)](_0x56d706(0xde)),console[_0x56d706(0x15a)](_0x56d706(0x172)),0x1;const _0x1163a3=_0x710c25[0x0],_0x5826ed=_0x38cde8,_0x1fce88=_0x5826ed[_0x56d706(0x14c)];try{const _0x314d93=await withSpinner('Creating\x20project\x20\x27'+_0x1163a3+_0x56d706(0xe3),()=>_0x3c8194[_0x56d706(0xd3)][_0x56d706(0x134)]({'name':_0x1163a3,'description':_0x1fce88}),{'verbose':_0x38cde8[_0x56d706(0xce)]});console[_0x56d706(0xe4)]('Project\x20created:\x20'+_0x314d93[_0x56d706(0x171)]['id']);const _0x532e83=toLLMProjectInfo(_0x314d93[_0x56d706(0x171)]);return await handleSDKOutput([_0x532e83],_0x38cde8),0x0;}catch(_0x1d5270){return handleSDKError(_0x1d5270,_0x38cde8),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x22f724(0x146)]='llm:project:delete';[a20_0x22f724(0x14c)]=a20_0x22f724(0xc1);async[a20_0x22f724(0x156)](_0x15d9ed){const _0x5e078a=a20_0x22f724,{options:_0xdc13a,args:_0x277eb9,tdx:_0x58b869}=_0x15d9ed;if(_0x277eb9[_0x5e078a(0xf0)]===0x0)return console[_0x5e078a(0x15a)](_0x5e078a(0xde)),console[_0x5e078a(0x15a)](_0x5e078a(0x159)),0x1;const _0x4d6387=_0x277eb9[0x0];try{return await withSpinner(_0x5e078a(0xf4)+_0x4d6387+_0x5e078a(0xe3),()=>_0x58b869[_0x5e078a(0xd3)][_0x5e078a(0x173)](_0x4d6387),{'verbose':_0xdc13a[_0x5e078a(0xce)]}),console[_0x5e078a(0xe4)]('Project\x20deleted:\x20'+_0x4d6387),0x0;}catch(_0x2319d9){return handleSDKError(_0x2319d9,_0xdc13a),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0xda);['description']='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)';async['execute'](_0x4a125e){const _0x291447=a20_0x22f724,{options:_0x2ee7bd,args:_0x2bd310,tdx:_0x2f0117}=_0x4a125e,_0x3c225a=getChalk(_0x2ee7bd);console[_0x291447(0xe4)](_0x3c225a[_0x291447(0x153)](_0x291447(0xcd))),console[_0x291447(0xe4)](_0x3c225a[_0x291447(0x153)](_0x291447(0x12e))),console[_0x291447(0xe4)](_0x3c225a[_0x291447(0x143)](_0x291447(0x139))),console[_0x291447(0xe4)]();if(_0x2bd310[_0x291447(0xf0)]===0x0)return console[_0x291447(0x15a)](_0x291447(0xde)),console[_0x291447(0x15a)](_0x291447(0xbe)),0x1;const _0x4eaf15=_0x2bd310[0x0],_0x1a15ab=_0x2ee7bd,_0x2f5cc6=_0x1a15ab['output'],_0x1ff02b=_0x1a15ab[_0x291447(0x12f)];try{const _0x334d13=_0x2f5cc6||_0x4eaf15+_0x291447(0xea);if(a20_0x8d73a7[_0x291447(0xc6)](_0x334d13)&&!_0x1ff02b){if(!_0x2ee7bd[_0x291447(0xe7)]){const _0x4f0d6d=await confirm(_0x291447(0x14d)+_0x334d13+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x4f0d6d)return console[_0x291447(0xe4)]('Backup\x20cancelled.'),0x0;}a20_0x8d73a7[_0x291447(0xd2)](_0x334d13,{'recursive':!![]});}const _0x162ebc=await withSpinner(_0x1ff02b?'Analyzing\x20project\x20\x27'+_0x4eaf15+_0x291447(0xe3):_0x291447(0xfc)+_0x4eaf15+_0x291447(0xe3),()=>_0x2f0117['llm'][_0x291447(0xbf)](_0x4eaf15,_0x2f5cc6,{'dryRun':_0x1ff02b}),{'verbose':_0x2ee7bd[_0x291447(0xce)]}),_0x55f4b1=_0x162ebc[_0x291447(0x171)];return _0x1ff02b?console[_0x291447(0xe4)](_0x291447(0xfa)+_0x55f4b1[_0x291447(0x16a)]):console[_0x291447(0xe4)]('Project\x20backed\x20up\x20to:\x20'+_0x55f4b1[_0x291447(0x16a)]),console[_0x291447(0xe4)](_0x291447(0xed)+_0x55f4b1[_0x291447(0x149)][_0x291447(0x155)]),console[_0x291447(0xe4)]('\x20\x20Knowledge\x20Bases:\x20'+_0x55f4b1['counts']['knowledgeBases']),console[_0x291447(0xe4)]('\x20\x20Prompts:\x20'+_0x55f4b1[_0x291447(0x149)][_0x291447(0xbc)]),console['log']('\x20\x20Integrations:\x20'+_0x55f4b1[_0x291447(0x149)]['integrations']),(_0x2ee7bd[_0x291447(0x16b)]===_0x291447(0x12b)||_0x2ee7bd[_0x291447(0x16b)]===_0x291447(0xc3))&&await handleSDKOutput([_0x55f4b1],_0x2ee7bd),0x0;}catch(_0x3d7136){return handleSDKError(_0x3d7136,_0x2ee7bd),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x22f724(0x146)]=a20_0x22f724(0xe5);[a20_0x22f724(0x14c)]=a20_0x22f724(0x15d);async[a20_0x22f724(0x156)](_0x240134){const _0x3201b4=a20_0x22f724,{options:_0x580250,args:_0x52a41f,tdx:_0x3404d8}=_0x240134,_0x4ba5cb=getChalk(_0x580250);console[_0x3201b4(0xe4)](_0x4ba5cb[_0x3201b4(0x153)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.')),console[_0x3201b4(0xe4)](_0x4ba5cb[_0x3201b4(0x153)]('\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.')),console['log'](_0x4ba5cb[_0x3201b4(0x143)]('\x20\x20\x20Examples:')),console[_0x3201b4(0xe4)](_0x4ba5cb[_0x3201b4(0x143)](_0x3201b4(0x131))),console['log'](_0x4ba5cb[_0x3201b4(0x143)](_0x3201b4(0xf8))),console['log']();if(_0x52a41f[_0x3201b4(0xf0)]===0x0)return console[_0x3201b4(0x15a)](_0x3201b4(0xf1)),console[_0x3201b4(0x15a)]('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x4d1f28=_0x52a41f[0x0],_0x55bb2a=_0x580250,_0x382802=_0x55bb2a[_0x3201b4(0x146)],_0x35ab8a=_0x55bb2a['dryRun'];try{if(!_0x35ab8a){const _0x21d552=_0x3404d8[_0x3201b4(0xd3)][_0x3201b4(0xc0)](_0x4d1f28),_0x39596f=_0x382802||_0x21d552[_0x3201b4(0x169)][_0x3201b4(0xb8)],_0x10cc83=await withSpinner(_0x3201b4(0x10f),()=>_0x3404d8[_0x3201b4(0xd3)]['projects'](),{'verbose':_0x580250['verbose']}),_0x4045b5=_0x10cc83['data'][_0x3201b4(0x119)](_0x44a02a=>_0x44a02a['attributes']['name']===_0x39596f);if(_0x4045b5&&!_0x580250[_0x3201b4(0xe7)]){const _0x27b33e=await confirm(_0x3201b4(0x129)+_0x39596f+_0x3201b4(0x11b));if(!_0x27b33e)return console[_0x3201b4(0xe4)](_0x3201b4(0xeb)),0x0;}}const _0x89a9a9=await withSpinner(_0x35ab8a?_0x3201b4(0xcf)+_0x4d1f28+_0x3201b4(0xe3):'Restoring\x20project\x20from\x20\x27'+_0x4d1f28+_0x3201b4(0xe3),()=>_0x3404d8['llm'][_0x3201b4(0x140)](_0x4d1f28,{'name':_0x382802,'dryRun':_0x35ab8a}),{'verbose':_0x580250[_0x3201b4(0xce)]}),_0x5c3e71=_0x89a9a9[_0x3201b4(0x171)];return _0x5c3e71['sourceSite']&&console[_0x3201b4(0xe4)](_0x3201b4(0xc4)+_0x5c3e71[_0x3201b4(0xd9)]+'\x27'),_0x35ab8a?console[_0x3201b4(0xe4)](_0x3201b4(0x126)+_0x5c3e71[_0x3201b4(0xb8)]):console[_0x3201b4(0xe4)](_0x3201b4(0x112)+_0x5c3e71[_0x3201b4(0xb8)]+'\x20('+_0x5c3e71[_0x3201b4(0x10e)]+')'),console[_0x3201b4(0xe4)](_0x3201b4(0xed)+_0x5c3e71[_0x3201b4(0x149)]['agents']),console[_0x3201b4(0xe4)](_0x3201b4(0xdb)+_0x5c3e71[_0x3201b4(0x149)][_0x3201b4(0x142)]),console['log']('\x20\x20Prompts:\x20'+_0x5c3e71['counts'][_0x3201b4(0xbc)]),console[_0x3201b4(0xe4)](_0x3201b4(0xdc)+_0x5c3e71[_0x3201b4(0x149)][_0x3201b4(0x168)]),(_0x580250['format']==='json'||_0x580250[_0x3201b4(0x16b)]===_0x3201b4(0xc3))&&await handleSDKOutput([_0x5c3e71],_0x580250),0x0;}catch(_0x142898){return handleSDKError(_0x142898,_0x580250),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x35a710,_0x29fe9f){const _0x38a3ee=a20_0x22f724,_0x1f99bc=_0x29fe9f[_0x38a3ee(0x170)]||CHAT_SELECTOR_PAGE_SIZE;let _0x3bd8b8=0x0,_0x3036bf=[];const _0x41c4f8=(await import('prompts'))[_0x38a3ee(0xd8)],_0x357059=getChalk(_0x29fe9f);while(!![]){const _0x5ba62c=await withSpinner(_0x38a3ee(0xff),()=>_0x35a710['llm'][_0x38a3ee(0x110)](_0x1f99bc+_0x3bd8b8),{'verbose':_0x29fe9f[_0x38a3ee(0xce)]});_0x3036bf=_0x5ba62c[_0x38a3ee(0x171)];const _0x2dd388=_0x3036bf[_0x38a3ee(0xa5)](_0x3bd8b8,_0x3bd8b8+_0x1f99bc),_0x7e16c2=_0x3036bf['length']>_0x3bd8b8+_0x1f99bc,_0x1472be=[...new Set(_0x2dd388[_0x38a3ee(0xc5)](_0x2300d5=>_0x2300d5['attributes'][_0x38a3ee(0xb6)])[_0x38a3ee(0x12d)](_0x13d80e=>_0x13d80e!==undefined))],_0x35f5c6=new Map();await Promise['all'](_0x1472be[_0x38a3ee(0xc5)](async _0x3755db=>{const _0x3f7188=_0x38a3ee;try{const _0x5a6c2e=await _0x35a710[_0x3f7188(0xd3)][_0x3f7188(0x101)](_0x3755db);_0x35f5c6[_0x3f7188(0x10c)](_0x3755db,_0x5a6c2e['attributes'][_0x3f7188(0x146)]);}catch{_0x35f5c6[_0x3f7188(0x10c)](_0x3755db,_0x3755db);}}));const _0x2ccfa2=_0x2dd388[_0x38a3ee(0xc5)](_0x5859ab=>{const _0x234147=_0x38a3ee,_0x54e836=_0x5859ab['attributes'][_0x234147(0x104)]||_0x234147(0xa1),_0x2f563a=_0x54e836['split']('\x0a')[0x0],_0x4b9471=_0x2f563a[_0x234147(0xf0)]>0x50?_0x2f563a[_0x234147(0x147)](0x0,0x4d)+_0x234147(0x14e):_0x2f563a,_0x3ff412=_0x5859ab[_0x234147(0x145)]['agentId']?_0x35f5c6[_0x234147(0xe1)](_0x5859ab[_0x234147(0x145)][_0x234147(0xb6)])||_0x5859ab['attributes'][_0x234147(0xb6)]:_0x234147(0x116),_0x4b35a1=_0x5859ab[_0x234147(0x145)]['lastConversationAt']||_0x5859ab[_0x234147(0x145)][_0x234147(0x118)],_0x3587b0=new Date(_0x4b35a1),_0x494acb=new Date(),_0x34d282=_0x494acb[_0x234147(0xd7)]()-_0x3587b0[_0x234147(0xd7)](),_0x42df23=Math['floor'](_0x34d282/0xea60),_0x4046c6=Math['floor'](_0x34d282/0x36ee80),_0x1c7ad1=Math[_0x234147(0x15c)](_0x34d282/0x5265c00);let _0x1d2fff;if(_0x42df23<0x1)_0x1d2fff='just\x20now';else{if(_0x42df23<0x3c)_0x1d2fff=_0x42df23+_0x234147(0x122);else{if(_0x4046c6<0x18)_0x1d2fff=_0x4046c6+_0x234147(0x11d);else _0x1c7ad1<0x7?_0x1d2fff=_0x1c7ad1+_0x234147(0xbd):_0x1d2fff=_0x3587b0[_0x234147(0x11a)]('en-US',{'month':_0x234147(0x16e),'day':_0x234147(0xcb)});}}return{'title':_0x4b9471+'\x20'+_0x357059['dim']('['+_0x3ff412+']\x20'+_0x1d2fff),'value':_0x5859ab['id']};});_0x7e16c2&&_0x2ccfa2[_0x38a3ee(0x102)]({'title':_0x357059['cyan'](_0x38a3ee(0xa9)),'value':_0x38a3ee(0x127)});const _0x45b2b5=await _0x41c4f8({'type':_0x38a3ee(0x114),'name':'chatId','message':_0x38a3ee(0x16d),'choices':_0x2ccfa2,'hint':_0x38a3ee(0xf5)});if(!_0x45b2b5[_0x38a3ee(0x158)])return undefined;if(_0x45b2b5[_0x38a3ee(0x158)]===_0x38a3ee(0x127)){_0x3bd8b8+=_0x1f99bc;continue;}return _0x45b2b5[_0x38a3ee(0x158)];}}export class ChatsCommand extends BaseCommand{['name']=a20_0x22f724(0x110);[a20_0x22f724(0x14c)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a20_0x22f724(0x156)](_0x56b4ff){const _0x3d26b5=a20_0x22f724;return executeChatHistoryCommand(_0x56b4ff,_0x3d26b5(0xe2));}}
|
|
1
|
+
const a20_0x38cdde=a20_0x2d6f;(function(_0x3c9100,_0x5f0b11){const _0xc6e6a3=a20_0x2d6f,_0x186551=_0x3c9100();while(!![]){try{const _0x4146a2=-parseInt(_0xc6e6a3(0x117))/0x1+-parseInt(_0xc6e6a3(0x1a1))/0x2+-parseInt(_0xc6e6a3(0x1e9))/0x3+-parseInt(_0xc6e6a3(0x12f))/0x4*(-parseInt(_0xc6e6a3(0x12d))/0x5)+-parseInt(_0xc6e6a3(0x1e2))/0x6*(-parseInt(_0xc6e6a3(0x11b))/0x7)+parseInt(_0xc6e6a3(0x184))/0x8+-parseInt(_0xc6e6a3(0x18c))/0x9*(parseInt(_0xc6e6a3(0x17a))/0xa);if(_0x4146a2===_0x5f0b11)break;else _0x186551['push'](_0x186551['shift']());}catch(_0x547a16){_0x186551['push'](_0x186551['shift']());}}}(a20_0x216c,0x1b0b9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/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'../core/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import*as a20_0x170174 from'node:fs';function handleSDKError(_0x272312,_0xed63f5){const _0x760630=a20_0x2d6f;if(_0x272312 instanceof SDKError)console['error'](_0x760630(0x130)+_0x272312[_0x760630(0x157)]),_0xed63f5['verbose']&&(_0x272312[_0x760630(0x15f)]&&console[_0x760630(0x1cd)](_0x760630(0x113)+_0x272312[_0x760630(0x15f)]),_0x272312[_0x760630(0x15a)]&&(console['error'](_0x760630(0x13a)),console[_0x760630(0x1cd)](_0x272312[_0x760630(0x15a)])));else throw _0x272312;}function formatChatHistoryEntry(_0x1d6819,_0x5d487f){const _0x4332ce=a20_0x2d6f,_0x9f102e=getChalk(_0x5d487f),_0x4d90ab=_0x9f102e['dim'](_0x1d6819['at']);if(_0x4332ce(0x134)in _0x1d6819){const _0x6c2955=_0x9f102e[_0x4332ce(0x1cf)]('[input]\x20\x20');return _0x4d90ab+'\x20'+_0x6c2955+':\x20'+_0x1d6819[_0x4332ce(0x134)];}if(_0x4332ce(0x120)in _0x1d6819){const _0x1c0586=_0x9f102e[_0x4332ce(0x17d)](_0x4332ce(0x1c8));return _0x4d90ab+'\x20'+_0x1c0586+':\x20'+_0x1d6819['content'];}if('tool_call'in _0x1d6819){const _0x38e19c=_0x9f102e[_0x4332ce(0x1d0)](_0x4332ce(0x1c4)),{functionName:_0x23cae4,functionArguments:_0x5a1a83,targetFunction:_0x5b8edc}=_0x1d6819[_0x4332ce(0x166)];let _0x44e93e=_0x4d90ab+'\x20'+_0x38e19c+':\x20'+_0x9f102e[_0x4332ce(0x1db)](_0x23cae4);if(_0x5a1a83&&Object[_0x4332ce(0x1e1)](_0x5a1a83)[_0x4332ce(0x124)]>0x0){const _0x40b267=Object[_0x4332ce(0x152)](_0x5a1a83)[_0x4332ce(0x193)](([_0x334ac4,_0xf8c7f9])=>_0x334ac4+'='+JSON[_0x4332ce(0x170)](_0xf8c7f9))[_0x4332ce(0x1f1)](',\x20');_0x44e93e+='('+_0x40b267+')';}_0x5b8edc&&(_0x44e93e+=_0x9f102e[_0x4332ce(0x18d)]('\x20['+_0x5b8edc+']'));let _0x548f41='';if(_0x1d6819['tool_call'][_0x4332ce(0x178)])_0x548f41=_0x4332ce(0x10d)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x178)][_0x4332ce(0x121)];else{if(_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1c3)])_0x548f41=_0x4332ce(0x133)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1c3)]['name'];else{if(_0x1d6819['tool_call'][_0x4332ce(0x15e)])_0x548f41=_0x4332ce(0x1c1)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x15e)][_0x4332ce(0x121)];else _0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1ca)]&&(_0x548f41='\x20->\x20ImageGen:'+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1ca)][_0x4332ce(0x121)]);}}return _0x44e93e+_0x548f41;}if('tool'in _0x1d6819){const _0x2ef799=_0x9f102e[_0x4332ce(0x1ec)]('[tool]\x20\x20\x20'),{functionName:_0x40bcdd,functionArguments:_0x3bef2a,content:_0x40b89e,newChat:_0x13ed04}=_0x1d6819[_0x4332ce(0x1ac)];let _0xb954bc=_0x4d90ab+'\x20'+_0x2ef799+':\x20'+_0x9f102e['bold'](_0x40bcdd);if(_0x3bef2a){const _0x442809=typeof _0x3bef2a===_0x4332ce(0x1a7)?_0x3bef2a:JSON[_0x4332ce(0x170)](_0x3bef2a);_0xb954bc+='('+_0x442809+')';}return _0x40b89e&&(_0xb954bc+='\x0a'+_0x9f102e[_0x4332ce(0x18d)](_0x40b89e)),_0x13ed04&&(_0xb954bc+=_0x9f102e[_0x4332ce(0x18d)](_0x4332ce(0x146)+_0x13ed04['id'])),_0xb954bc;}if('output'in _0x1d6819){const _0x45c982=_0x9f102e['blue'](_0x4332ce(0x1e7));return _0x4d90ab+'\x20'+_0x45c982+':\x20'+_0x1d6819[_0x4332ce(0x185)][_0x4332ce(0x121)]+'\x20('+_0x1d6819['output']['content'][_0x4332ce(0x124)]+_0x4332ce(0x1e5);}if(_0x4332ce(0x128)in _0x1d6819){const _0x516506=_0x9f102e['blue'](_0x4332ce(0x141)),{width:_0x212f33,height:_0x5b2b63,headerText:_0xa50c14}=_0x1d6819[_0x4332ce(0x128)],_0x2b1aa9=_0xa50c14?_0x4332ce(0x1d4)+_0xa50c14:'';return _0x4d90ab+'\x20'+_0x516506+':\x20'+_0x212f33+'x'+_0x5b2b63+_0x2b1aa9;}if(_0x4332ce(0x1cd)in _0x1d6819){const _0x5cfc9f=_0x9f102e['red'](_0x4332ce(0x111));return _0x4d90ab+'\x20'+_0x5cfc9f+':\x20'+_0x1d6819[_0x4332ce(0x1cd)];}return _0x4d90ab+'\x20'+_0x9f102e['dim'](_0x4332ce(0x1d1))+':\x20'+JSON['stringify'](_0x1d6819);}async function executeChatHistoryCommand(_0x21baf5,_0x2112bd){const _0x5c45ec=a20_0x2d6f,{options:_0x365111,args:_0x2bfce1,tdx:_0x81a6e1}=_0x21baf5,_0x35e807=_0x2bfce1[0x0],_0x375428=_0x365111,_0x16b545=_0x375428[_0x5c45ec(0x140)];try{if(_0x16b545&&_0x35e807)return console[_0x5c45ec(0x1cd)](_0x5c45ec(0x17e)),console['error'](_0x5c45ec(0x136)+_0x2112bd+'\x20--last'),0x1;if(!_0x35e807&&!_0x16b545&&_0x365111[_0x5c45ec(0x144)]!==undefined){const _0xd359bd=resolveLimit(_0x365111[_0x5c45ec(0x187)],DEFAULT_LLM_LIMIT),_0x555d38=await withSpinner(_0x5c45ec(0x1e6),()=>_0x81a6e1[_0x5c45ec(0x131)][_0x5c45ec(0x165)](_0xd359bd),{'verbose':_0x365111[_0x5c45ec(0x1be)]});return await handleSDKOutput(_0x555d38[_0x5c45ec(0x112)],_0x365111),0x0;}const _0x5c5da4=await getChatIdOrSelect(_0x81a6e1,_0x365111,_0x16b545,_0x35e807);if(!_0x5c5da4)return 0x0;return await displayChatHistory(_0x5c5da4,_0x81a6e1,_0x365111),0x0;}catch(_0x57a9b4){return handleSDKError(_0x57a9b4,_0x365111),0x1;}}async function displayChatHistory(_0x3fa4a9,_0x1c202d,_0x517152){const _0x1eef14=a20_0x2d6f,_0x1f8056=await withSpinner(_0x1eef14(0x11f)+_0x3fa4a9+_0x1eef14(0x143),()=>_0x1c202d[_0x1eef14(0x131)][_0x1eef14(0x151)](_0x3fa4a9),{'verbose':_0x517152[_0x1eef14(0x1be)]}),_0x31be4c=_0x1f8056[_0x1eef14(0x112)][_0x1eef14(0x112)]??[];if(_0x31be4c[_0x1eef14(0x124)]===0x0){console['log'](_0x1eef14(0x1d3));return;}if(_0x517152['format']!==undefined)await handleSDKOutput(_0x31be4c,_0x517152);else{const _0x36a61b=_0x31be4c[_0x1eef14(0x193)](_0x5f20a1=>formatChatHistoryEntry(_0x5f20a1,_0x517152)),_0x5aa39b=_0x36a61b[_0x1eef14(0x1f1)]('\x0a');await writeOutput(_0x5aa39b,_0x517152['output'],_0x1eef14(0x1ed));}}async function getChatIdOrSelect(_0x2a501e,_0x457f69,_0x1d4bec,_0x42b7f7){const _0x50094b=a20_0x2d6f;if(_0x42b7f7)return _0x42b7f7;if(_0x1d4bec){const _0x449910=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x2a501e['llm'][_0x50094b(0x165)](0x1),{'verbose':_0x457f69[_0x50094b(0x1be)]});if(_0x449910['data'][_0x50094b(0x124)]===0x0)return console[_0x50094b(0x1cb)](_0x50094b(0x186)),undefined;return _0x449910[_0x50094b(0x112)][0x0]['id'];}const _0x438ee5=await selectChatInteractively(_0x2a501e,_0x457f69);if(!_0x438ee5)return console['log'](_0x50094b(0x1c5)),undefined;return _0x438ee5;}async function getProjectIdOrDefault(_0x312f69){const _0xc51223=await getProjectWithName(_0x312f69);return _0xc51223['id'];}async function getProjectWithName(_0x11263c){const _0x2d85ea=a20_0x2d6f,{tdx:_0x4cebe1,options:_0x4f266b}=_0x11263c,_0x1c761d=_0x4f266b['llmProject'];if(_0x1c761d){const _0x50543d=await withSpinner(_0x2d85ea(0x1a5)+_0x1c761d+'\x27...',()=>_0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x1a9)](_0x1c761d),{'verbose':_0x4f266b[_0x2d85ea(0x1be)]});return{'id':_0x50543d['data'],'name':_0x1c761d};}const _0x1c1b21=_0x4cebe1[_0x2d85ea(0x131)]['getCurrentProject']();if(_0x1c1b21){const _0x762bdc=await _0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x1f0)](),_0x87878e=_0x762bdc['find'](_0x429abe=>_0x429abe['id']===_0x1c1b21);return{'id':_0x1c1b21,'name':_0x87878e?.[_0x2d85ea(0x159)][_0x2d85ea(0x121)]||_0x2d85ea(0x119)};}const _0x46bf49=await withSpinner(_0x2d85ea(0x12c),()=>_0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x16d)](),{'verbose':_0x4f266b[_0x2d85ea(0x1be)]});return{'id':_0x46bf49[_0x2d85ea(0x112)]['id'],'name':_0x46bf49[_0x2d85ea(0x112)][_0x2d85ea(0x159)][_0x2d85ea(0x121)]};}function toLLMProjectInfo(_0x433cd2){const _0x15e353=a20_0x2d6f;return{'name':_0x433cd2[_0x15e353(0x159)][_0x15e353(0x121)],'description':_0x433cd2['attributes'][_0x15e353(0x14b)],'createdAt':_0x433cd2[_0x15e353(0x159)][_0x15e353(0x190)],'updatedAt':_0x433cd2[_0x15e353(0x159)]['updatedAt']};}function toAgentInfo(_0x46dedf){const _0x49e301=a20_0x2d6f;return{'name':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x121)],'description':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x14b)],'prompt':truncatePrompt(_0x46dedf[_0x49e301(0x159)][_0x49e301(0x17b)]),'createdAt':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x190)],'updatedAt':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x18f)]};}function truncatePrompt(_0x32fc26){const _0x456069=a20_0x2d6f;if(!_0x32fc26)return undefined;const _0x5ca43e=0x64;if(_0x32fc26[_0x456069(0x124)]<=_0x5ca43e)return _0x32fc26;return _0x32fc26[_0x456069(0x153)](0x0,_0x5ca43e)+_0x456069(0x1ce);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a20_0x38cdde(0x14b)]='List\x20available\x20LLM\x20models';async[a20_0x38cdde(0x13c)](_0x3c8658){const _0x22cb0e=a20_0x38cdde,{options:_0xe35f46,tdx:_0x2a593e}=_0x3c8658;try{const _0x5942db=await withSpinner(_0x22cb0e(0x177),()=>_0x2a593e[_0x22cb0e(0x131)][_0x22cb0e(0x149)](),{'verbose':_0xe35f46[_0x22cb0e(0x1be)]});return await handleSDKOutput(_0x5942db[_0x22cb0e(0x112)],_0xe35f46),0x0;}catch(_0x1d7cde){return handleSDKError(_0x1d7cde,_0xe35f46),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x171);[a20_0x38cdde(0x14b)]='List\x20all\x20LLM\x20projects';async[a20_0x38cdde(0x13c)](_0x4a6380){const _0x31e496=a20_0x38cdde,{options:_0x5c0b04,args:_0x13716b,tdx:_0x23fbe0}=_0x4a6380,_0x146209=getChalk(_0x5c0b04),_0x3bf5eb=_0x5c0b04['web'],_0x4e0cf9=_0x5c0b04[_0x31e496(0x16f)];try{const _0x225c70=_0x13716b[0x0],_0x571f7e=resolveLimit(_0x5c0b04[_0x31e496(0x187)],DEFAULT_LLM_LIMIT),_0x1bf0b1=await withSpinner(_0x31e496(0x160),()=>_0x23fbe0['llm'][_0x31e496(0x1f0)](_0x571f7e),{'verbose':_0x5c0b04[_0x31e496(0x1be)]});let _0xe1ad5b=_0x1bf0b1[_0x31e496(0x112)];_0x225c70&&(_0xe1ad5b=_0x1bf0b1[_0x31e496(0x112)][_0x31e496(0x1a2)](_0x44e98b=>matchGlobPattern(_0x44e98b[_0x31e496(0x159)][_0x31e496(0x121)],_0x225c70)));const _0x6b7f37=_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x1d9)||_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x14d)||_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x1ed)||_0x5c0b04['format']===_0x31e496(0x126);if(_0x6b7f37){const _0x4f3ead=_0xe1ad5b[_0x31e496(0x193)](_0x31bf3c=>({...toLLMProjectInfo(_0x31bf3c),..._0x3bf5eb?{'url':getLLMProjectUrl(_0x4e0cf9,_0x31bf3c['id'])}:{}}));await handleSDKOutput(_0x4f3ead,_0x5c0b04);}else{const _0x1e18d1=[];if(_0xe1ad5b['length']===0x0)_0x1e18d1[_0x31e496(0x168)](_0x146209[_0x31e496(0x18d)](_0x31e496(0x19f)));else{const _0x3911cf=[..._0xe1ad5b]['sort']((_0x379338,_0x3d96f2)=>_0x379338['attributes'][_0x31e496(0x121)]['localeCompare'](_0x3d96f2[_0x31e496(0x159)]['name']));for(const _0x37cda7 of _0x3911cf){if(_0x3bf5eb){const _0x33f354=getLLMProjectUrl(_0x4e0cf9,_0x37cda7['id']);_0x1e18d1[_0x31e496(0x168)](_0x31e496(0x189)+_0x37cda7[_0x31e496(0x159)]['name']+'\x20\x20'+_0x146209[_0x31e496(0x18d)](_0x33f354));}else _0x1e18d1['push']('⚒️\x20'+_0x37cda7[_0x31e496(0x159)]['name']);}_0x1e18d1[_0x31e496(0x168)](_0x146209['dim'](_0xe1ad5b[_0x31e496(0x124)]+'\x20project(s)'));}await writeOutput(_0x1e18d1['join']('\x0a'),_0x5c0b04['output'],'table');}return 0x0;}catch(_0x311a89){return handleSDKError(_0x311a89,_0x5c0b04),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1df);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x14c);async[a20_0x38cdde(0x13c)](_0x458ccd){const _0x2ed7a7=a20_0x38cdde,{options:_0x2bf9df,args:_0x5ecad4,tdx:_0x31444c}=_0x458ccd,_0x26b377=getChalk(_0x2bf9df),_0xd12e2a=_0x2bf9df[_0x2ed7a7(0x1b0)],_0x533466=_0x2bf9df[_0x2ed7a7(0x16f)];try{const _0x523358=_0x5ecad4[0x0];let _0x5f0f91=_0x523358,_0x38e353,_0x156738;if(_0x523358&&_0x523358[_0x2ed7a7(0x12e)]('/')){const _0x363b23=_0x523358['split']('/');if(_0x363b23[_0x2ed7a7(0x124)]===0x2){const [_0x380ef9,_0x5e272b]=_0x363b23,_0x293ef9=await _0x31444c[_0x2ed7a7(0x131)]['projects'](),_0xa1f05a=_0x293ef9['find'](_0x49f47=>_0x49f47[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)]['toLowerCase']()===_0x380ef9[_0x2ed7a7(0x1c0)]());if(!_0xa1f05a)throw new SDKError(ErrorCode[_0x2ed7a7(0x10a)],'Project\x20not\x20found:\x20'+_0x380ef9,undefined,{'helpText':_0x2ed7a7(0x1a6)});_0x38e353=_0xa1f05a['id'],_0x156738=_0xa1f05a[_0x2ed7a7(0x159)]['name'],_0x5f0f91=_0x5e272b;}else throw new SDKError(ErrorCode[_0x2ed7a7(0x1ef)],'Invalid\x20path\x20syntax:\x20'+_0x523358,undefined,{'helpText':_0x2ed7a7(0x1aa)});}else{const _0x34d650=await getProjectWithName(_0x458ccd);_0x38e353=_0x34d650['id'],_0x156738=_0x34d650[_0x2ed7a7(0x121)];}const _0x1e5ec2=await withSpinner(_0x2ed7a7(0x116),()=>_0x31444c[_0x2ed7a7(0x131)]['agents'](_0x38e353),{'verbose':_0x2bf9df[_0x2ed7a7(0x1be)]});let _0xe95fa0=_0x1e5ec2[_0x2ed7a7(0x112)];_0x5f0f91&&(_0xe95fa0=_0x1e5ec2[_0x2ed7a7(0x112)]['filter'](_0x35853a=>matchGlobPattern(_0x35853a[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)],_0x5f0f91)));const _0x224b9a=_0x2bf9df['format']===_0x2ed7a7(0x1d9)||_0x2bf9df[_0x2ed7a7(0x144)]===_0x2ed7a7(0x14d)||_0x2bf9df[_0x2ed7a7(0x144)]===_0x2ed7a7(0x1ed)||_0x2bf9df[_0x2ed7a7(0x144)]==='tsv';if(_0x224b9a){const _0x1f5de5=_0xe95fa0[_0x2ed7a7(0x193)](_0x5ddddc=>({...toAgentInfo(_0x5ddddc),..._0xd12e2a?{'chatUrl':getLLMAgentChatUrl(_0x533466,_0x38e353,_0x5ddddc['id'])}:{}}));await handleSDKOutput(_0x1f5de5,_0x2bf9df);}else{const _0x48fc37=[];_0x48fc37[_0x2ed7a7(0x168)](_0x26b377[_0x2ed7a7(0x18d)]('['+_0x156738+']'));if(_0xe95fa0[_0x2ed7a7(0x124)]===0x0)_0x48fc37['push'](_0x26b377[_0x2ed7a7(0x18d)](_0x2ed7a7(0x1bc)));else{const _0x4c4ae5=[..._0xe95fa0]['sort']((_0x251e04,_0x2e542c)=>_0x251e04[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)][_0x2ed7a7(0x1bb)](_0x2e542c[_0x2ed7a7(0x159)]['name']));for(const _0x54deba of _0x4c4ae5){if(_0xd12e2a){const _0x5a95cc=getLLMAgentChatUrl(_0x533466,_0x38e353,_0x54deba['id']);_0x48fc37[_0x2ed7a7(0x168)]('🤖\x20'+_0x54deba[_0x2ed7a7(0x159)]['name']+'\x20\x20'+_0x26b377[_0x2ed7a7(0x18d)](_0x5a95cc));}else _0x48fc37['push'](_0x2ed7a7(0x11a)+_0x54deba[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)]);}_0x48fc37['push'](_0x26b377[_0x2ed7a7(0x18d)](_0xe95fa0[_0x2ed7a7(0x124)]+_0x2ed7a7(0x1b5)));}await writeOutput(_0x48fc37[_0x2ed7a7(0x1f1)]('\x0a'),_0x2bf9df['output'],_0x2ed7a7(0x1ed));}return 0x0;}catch(_0x1feabd){return handleSDKError(_0x1feabd,_0x2bf9df),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1ab);['description']=a20_0x38cdde(0x1ee);async['execute'](_0x15fdb9){const _0x216d94=a20_0x38cdde,{options:_0x3af7f6,args:_0x2ab02c,tdx:_0x38b7ac}=_0x15fdb9;if(_0x2ab02c['length']===0x0)return console[_0x216d94(0x1cd)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x216d94(0x1cd)](_0x216d94(0x142)),0x1;const _0xb93afb=_0x2ab02c[0x0];try{const _0x4f9e70=await getProjectIdOrDefault(_0x15fdb9),_0x33652b=await withSpinner('Resolving\x20agent\x20\x27'+_0xb93afb+_0x216d94(0x143),()=>_0x38b7ac[_0x216d94(0x131)][_0x216d94(0x13b)](_0xb93afb,_0x4f9e70),{'verbose':_0x3af7f6['verbose']}),_0x1f9f14=await withSpinner('Fetching\x20agent...',()=>_0x38b7ac[_0x216d94(0x131)][_0x216d94(0x1da)](_0x33652b[_0x216d94(0x112)]),{'verbose':_0x3af7f6[_0x216d94(0x1be)]});return await handleSDKOutput([_0x1f9f14['data']],_0x3af7f6),0x0;}catch(_0x2a1ef1){return handleSDKError(_0x2a1ef1,_0x3af7f6),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x174);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x14a);async['execute'](_0x4917f6){const _0x1a130c=a20_0x38cdde,{options:_0x32f2cb,args:_0x23d39a,tdx:_0x2d9636}=_0x4917f6;if(_0x23d39a[_0x1a130c(0x124)]===0x0)return console[_0x1a130c(0x1cd)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x1a130c(0x1cd)](_0x1a130c(0x139)),console[_0x1a130c(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x58aafd=_0x23d39a[0x0],_0x5bcd4d=_0x32f2cb,_0x328043=_0x5bcd4d[_0x1a130c(0x10c)],_0x24c86b=_0x5bcd4d[_0x1a130c(0x13d)]||_0x1a130c(0x19e),_0x18a224=_0x5bcd4d[_0x1a130c(0x132)],_0x208065=_0x5bcd4d[_0x1a130c(0x16b)]?Number(_0x5bcd4d[_0x1a130c(0x16b)]):undefined,_0x2695d9=_0x5bcd4d[_0x1a130c(0x19c)]?Number(_0x5bcd4d[_0x1a130c(0x19c)]):undefined;try{let _0x49768e,_0x375691;if(_0x58aafd[_0x1a130c(0x12e)]('/')){const _0x3295c2=_0x58aafd['split']('/');if(_0x3295c2[_0x1a130c(0x124)]===0x2){const [_0x44ccf9,_0x1af514]=_0x3295c2,_0x38519e=await withSpinner(_0x1a130c(0x1a5)+_0x44ccf9+_0x1a130c(0x143),()=>_0x2d9636['llm'][_0x1a130c(0x1a9)](_0x44ccf9),{'verbose':_0x32f2cb['verbose']});_0x49768e=_0x38519e[_0x1a130c(0x112)],_0x375691=_0x1af514;}else throw new SDKError(ErrorCode[_0x1a130c(0x1ef)],_0x1a130c(0x16c)+_0x58aafd,undefined,{'helpText':_0x1a130c(0x1aa)});}else _0x49768e=await getProjectIdOrDefault(_0x4917f6),_0x375691=_0x58aafd;const _0x1bbf5d=await withSpinner(_0x1a130c(0x1b4)+_0x375691+_0x1a130c(0x143),()=>_0x2d9636[_0x1a130c(0x131)][_0x1a130c(0x158)]({'name':_0x375691,'projectId':_0x49768e,'modelType':_0x24c86b,'systemPrompt':_0x328043,'starterMessage':_0x18a224,'maxToolIterations':_0x208065,'temperature':_0x2695d9}),{'verbose':_0x32f2cb[_0x1a130c(0x1be)]});return console[_0x1a130c(0x1cb)](_0x1a130c(0x1d7)+_0x1bbf5d[_0x1a130c(0x112)]['id']),await handleSDKOutput([_0x1bbf5d[_0x1a130c(0x112)]],_0x32f2cb),0x0;}catch(_0x4b9cb3){return handleSDKError(_0x4b9cb3,_0x32f2cb),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a20_0x38cdde(0x19d);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x13f);async[a20_0x38cdde(0x13c)](_0x213fec){const _0x28e599=a20_0x38cdde,{options:_0x554224,args:_0x17ae56,tdx:_0x7ab540}=_0x213fec;if(_0x17ae56[_0x28e599(0x124)]===0x0)return console[_0x28e599(0x1cd)](_0x28e599(0x1b7)),console[_0x28e599(0x1cd)](_0x28e599(0x14e)),0x1;const _0x497ef6=_0x17ae56[0x0],_0x5ed436=_0x554224,_0x23f294=_0x5ed436[_0x28e599(0x121)],_0xc064c5=_0x5ed436[_0x28e599(0x17b)],_0x5e7c72=_0x5ed436['description'],_0x5ae8d6=_0x5ed436['starterMessage'];if(!_0x23f294&&!_0xc064c5&&!_0x5e7c72&&!_0x5ae8d6)return console[_0x28e599(0x1cd)](_0x28e599(0x1e8)),console[_0x28e599(0x1cd)](_0x28e599(0x1a0)),0x1;try{const _0x4763bc=await getProjectIdOrDefault(_0x213fec),_0x4d6b18=await withSpinner(_0x28e599(0x17c)+_0x497ef6+_0x28e599(0x143),()=>_0x7ab540[_0x28e599(0x131)]['resolveAgentId'](_0x497ef6,_0x4763bc),{'verbose':_0x554224[_0x28e599(0x1be)]}),_0x458947=_0x4d6b18[_0x28e599(0x112)],_0x32b109=await withSpinner(_0x28e599(0x129),()=>_0x7ab540[_0x28e599(0x131)]['updateAgent'](_0x458947,{'name':_0x23f294,'prompt':_0xc064c5,'description':_0x5e7c72,'starterMessage':_0x5ae8d6}),{'verbose':_0x554224[_0x28e599(0x1be)]});return console[_0x28e599(0x1cb)](_0x28e599(0x1cc)+_0x32b109[_0x28e599(0x112)]['id']),await handleSDKOutput([_0x32b109[_0x28e599(0x112)]],_0x554224),0x0;}catch(_0x2130b1){return handleSDKError(_0x2130b1,_0x554224),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']='llm:agent:delete';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x150);async[a20_0x38cdde(0x13c)](_0x28c005){const _0x2681f3=a20_0x38cdde,{options:_0x413542,args:_0xea832a,tdx:_0x3a1229}=_0x28c005;if(_0xea832a['length']===0x0)return console[_0x2681f3(0x1cd)](_0x2681f3(0x1b7)),console[_0x2681f3(0x1cd)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x1dfa80=_0xea832a[0x0];try{const _0x4b2c3a=await getProjectIdOrDefault(_0x28c005),_0x5b501e=await withSpinner(_0x2681f3(0x17c)+_0x1dfa80+_0x2681f3(0x143),()=>_0x3a1229['llm'][_0x2681f3(0x13b)](_0x1dfa80,_0x4b2c3a),{'verbose':_0x413542[_0x2681f3(0x1be)]}),_0xa26428=_0x5b501e[_0x2681f3(0x112)];return await withSpinner('Deleting\x20agent...',()=>_0x3a1229['llm'][_0x2681f3(0x10e)](_0xa26428),{'verbose':_0x413542[_0x2681f3(0x1be)]}),console[_0x2681f3(0x1cb)](_0x2681f3(0x118)+_0xa26428),0x0;}catch(_0x134423){return handleSDKError(_0x134423,_0x413542),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a20_0x38cdde(0x110);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x109);async[a20_0x38cdde(0x13c)](_0x3821e7){const _0x50b5d6=a20_0x38cdde;return executeChatHistoryCommand(_0x3821e7,_0x50b5d6(0x13e));}}export class LLMUseCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x15b);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1b6);async[a20_0x38cdde(0x13c)](_0x4b0df5){const _0x291bf7=a20_0x38cdde,{options:_0x2c264d,args:_0x4196a7,tdx:_0x4bd244}=_0x4b0df5;if(_0x4196a7[_0x291bf7(0x124)]===0x0)return console[_0x291bf7(0x1cd)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x291bf7(0x12a)),0x1;const _0x4e5caf=_0x4196a7[0x0];try{return await withSpinner(_0x291bf7(0x122)+_0x4e5caf+_0x291bf7(0x143),()=>_0x4bd244[_0x291bf7(0x131)][_0x291bf7(0x169)](_0x4e5caf),{'verbose':_0x2c264d['verbose']}),console[_0x291bf7(0x1cb)](_0x291bf7(0x1e0)+_0x4e5caf),0x0;}catch(_0x34548f){return handleSDKError(_0x34548f,_0x2c264d),0x1;}}}function a20_0x216c(){const _0x533810=['createdAt','A\x20project\x20named\x20\x27','.llm','map','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','__load_more__','Restore\x20cancelled.','tdx\x20chats','Delete\x20an\x20LLM\x20project','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','\x27\x20already\x20exists.\x20Overwrite?','temperature','llm:agent:update','claude-4.5-haiku','No\x20projects\x20found','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','48288CYupSm','filter','find','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','Resolving\x20project\x20\x27','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','string','set','resolveProjectId','Use\x20format:\x20project-name/agent-name','llm:agent:show','tool','Validating\x20backup\x20from\x20\x27','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','web','createProject','split','chatId','Creating\x20agent\x20\x27','\x20agent(s)','Set\x20current\x20project\x20context','Error:\x20Agent\x20name\x20is\x20required','prompts','integrations','Project\x20restored:\x20','localeCompare','No\x20agents\x20found','toLocaleDateString','verbose','llm:project:create','toLowerCase','\x20->\x20WebSearch:','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','targetAgent','[tool_call]','\x0aCancelled','Project\x20deleted:\x20','get','[content]','Restoring\x20project\x20from\x20\x27','targetImageGenerator','log','Agent\x20updated:\x20','error','...','cyan','yellow','[unknown]','agents','No\x20messages\x20found\x20in\x20chat\x20history.','\x20-\x20','Backing\x20up\x20project\x20\x27','rmSync','Agent\x20created:\x20','\x20\x20Integrations:\x20','json','agent','bold','getTime','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','counts','llm:agents','Project\x20context\x20set\x20to:\x20','keys','18BBAyjJ','outputDir','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','\x20bytes)','Fetching\x20chat\x20sessions...','[output]\x20','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','115887luOXZb','en-US','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','magenta','table','Show\x20agent\x20details','INVALID_ARGUMENT','projects','join','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','LLM_PROJECT_NOT_FOUND','\x20\x20Knowledge\x20Bases:\x20','systemPrompt','\x20->\x20KB:','deleteAgent','Analyzing\x20project\x20\x27','llm:history','[error]\x20\x20','data','\x20\x20Cause:\x20','Creating\x20project\x20\x27','d\x20ago','Fetching\x20agents...','193450OzRBrP','Agent\x20deleted:\x20','Unknown','🤖\x20','21245orOfig','Deleting\x20project\x20\x27','lastConversationAt','knowledgeBases','Fetching\x20chat\x20history\x20for\x20\x27','content','name','Setting\x20project\x20context\x20to\x20\x27','Checking\x20for\x20existing\x20projects...','length','all','tsv','\x20\x20Agents:\x20','image','Updating\x20agent...','Usage:\x20tdx\x20llm\x20use\x20<project-name>','deleteProject','Getting\x20default\x20project...','5zBtGTX','includes','633164EnfhHB','Error:\x20','llm','starterMessage','\x20->\x20Agent:','input','exportedFrom','Usage:\x20','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','sourceSite','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x0aStack\x20trace:','resolveAgentId','execute','model','tdx\x20llm\x20history','Update\x20an\x20existing\x20agent','last','[image]\x20\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x27...','format','default','\x20→\x20chat:\x20','Create\x20a\x20new\x20LLM\x20project','m\x20ago','models','Create\x20a\x20new\x20agent\x20in\x20current\x20project','description','List\x20agents\x20in\x20current\x20project','jsonl','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Delete\x20an\x20agent','history','entries','slice','h\x20ago','llm:project:restore','Project\x20created:\x20','message','createAgent','attributes','stack','llm:use','just\x20now','select','targetWebSearchTool','cause','Fetching\x20projects...','\x20\x20Prompts:\x20','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','(no\x20agent)','chats','tool_call','backupProject','push','setCurrentProject','Project\x20backed\x20up\x20to:\x20','maxToolIterations','Invalid\x20path\x20syntax:\x20','getOrCreateDefaultProject','substring','site','stringify','llm:projects','dryRun','(no\x20message)','llm:agent:create','restoreProject','floor','Fetching\x20available\x20models...','targetKnowledgeBase','Select\x20a\x20chat\x20session:','9910OjyoAg','prompt','Resolving\x20agent\x20\x27','green','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','projectName','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','getBackupMetadata','projectId','existsSync','1771248FWiywM','output','No\x20chat\x20sessions\x20found.','limit','Load\x20more...','⚒️\x20','Error:\x20Backup\x20folder\x20path\x20is\x20required','agentId','198sAbbkB','dim','\x20\x20\x20Examples:','updatedAt'];a20_0x216c=function(){return _0x533810;};return a20_0x216c();}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1bf);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x147);async[a20_0x38cdde(0x13c)](_0x54528e){const _0x3787c3=a20_0x38cdde,{options:_0x5c5d2d,args:_0xe9207b,tdx:_0x49b336}=_0x54528e;if(_0xe9207b[_0x3787c3(0x124)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x3787c3(0x1cd)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x555351=_0xe9207b[0x0],_0xbcc1f0=_0x5c5d2d,_0x50e4ba=_0xbcc1f0[_0x3787c3(0x14b)];try{const _0x506537=await withSpinner(_0x3787c3(0x114)+_0x555351+_0x3787c3(0x143),()=>_0x49b336[_0x3787c3(0x131)][_0x3787c3(0x1b1)]({'name':_0x555351,'description':_0x50e4ba}),{'verbose':_0x5c5d2d[_0x3787c3(0x1be)]});console[_0x3787c3(0x1cb)](_0x3787c3(0x156)+_0x506537[_0x3787c3(0x112)]['id']);const _0x4c3c40=toLLMProjectInfo(_0x506537[_0x3787c3(0x112)]);return await handleSDKOutput([_0x4c3c40],_0x5c5d2d),0x0;}catch(_0x3bd8a5){return handleSDKError(_0x3bd8a5,_0x5c5d2d),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x38cdde(0x121)]='llm:project:delete';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x198);async['execute'](_0xfe2a56){const _0x230e4e=a20_0x38cdde,{options:_0x50bb12,args:_0x227006,tdx:_0x51ebec}=_0xfe2a56;if(_0x227006[_0x230e4e(0x124)]===0x0)return console[_0x230e4e(0x1cd)](_0x230e4e(0x1ae)),console[_0x230e4e(0x1cd)](_0x230e4e(0x163)),0x1;const _0x2c013c=_0x227006[0x0];try{return await withSpinner(_0x230e4e(0x11c)+_0x2c013c+_0x230e4e(0x143),()=>_0x51ebec[_0x230e4e(0x131)][_0x230e4e(0x12b)](_0x2c013c),{'verbose':_0x50bb12[_0x230e4e(0x1be)]}),console[_0x230e4e(0x1cb)](_0x230e4e(0x1c6)+_0x2c013c),0x0;}catch(_0x32bb98){return handleSDKError(_0x32bb98,_0x50bb12),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x38cdde(0x121)]='llm:project:backup';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1a4);async[a20_0x38cdde(0x13c)](_0x29f9d7){const _0x4a869e=a20_0x38cdde,{options:_0x31a55a,args:_0x20a2c9,tdx:_0x2335cf}=_0x29f9d7,_0x46adf7=getChalk(_0x31a55a);console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x1d0)](_0x4a869e(0x180))),console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x1d0)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x18d)]('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console[_0x4a869e(0x1cb)]();if(_0x20a2c9[_0x4a869e(0x124)]===0x0)return console[_0x4a869e(0x1cd)](_0x4a869e(0x1ae)),console['error'](_0x4a869e(0x1af)),0x1;const _0x135326=_0x20a2c9[0x0],_0x4cf6a9=_0x31a55a,_0x1bf435=_0x4cf6a9[_0x4a869e(0x185)],_0x4af889=_0x4cf6a9['dryRun'];try{const _0x5596b0=_0x1bf435||_0x135326+_0x4a869e(0x192);if(a20_0x170174[_0x4a869e(0x183)](_0x5596b0)&&!_0x4af889){if(!_0x31a55a['yes']){const _0x51e760=await confirm('Output\x20directory\x20\x27'+_0x5596b0+_0x4a869e(0x19b));if(!_0x51e760)return console[_0x4a869e(0x1cb)]('Backup\x20cancelled.'),0x0;}a20_0x170174[_0x4a869e(0x1d6)](_0x5596b0,{'recursive':!![]});}const _0x3040b6=await withSpinner(_0x4af889?_0x4a869e(0x10f)+_0x135326+'\x27...':_0x4a869e(0x1d5)+_0x135326+_0x4a869e(0x143),()=>_0x2335cf[_0x4a869e(0x131)][_0x4a869e(0x167)](_0x135326,_0x1bf435,{'dryRun':_0x4af889}),{'verbose':_0x31a55a[_0x4a869e(0x1be)]}),_0x44fcd9=_0x3040b6[_0x4a869e(0x112)];return _0x4af889?console[_0x4a869e(0x1cb)](_0x4a869e(0x194)+_0x44fcd9['outputDir']):console[_0x4a869e(0x1cb)](_0x4a869e(0x16a)+_0x44fcd9[_0x4a869e(0x1e3)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x127)+_0x44fcd9['counts'][_0x4a869e(0x1d2)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x10b)+_0x44fcd9[_0x4a869e(0x1de)]['knowledgeBases']),console['log'](_0x4a869e(0x161)+_0x44fcd9['counts'][_0x4a869e(0x1b8)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x1d8)+_0x44fcd9[_0x4a869e(0x1de)][_0x4a869e(0x1b9)]),(_0x31a55a[_0x4a869e(0x144)]==='json'||_0x31a55a['format']===_0x4a869e(0x14d))&&await handleSDKOutput([_0x44fcd9],_0x31a55a),0x0;}catch(_0x1e4f02){return handleSDKError(_0x1e4f02,_0x31a55a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x155);['description']=a20_0x38cdde(0x137);async[a20_0x38cdde(0x13c)](_0x4ec218){const _0x217696=a20_0x38cdde,{options:_0x43bbc8,args:_0x580962,tdx:_0x4145bd}=_0x4ec218,_0x1ce71a=getChalk(_0x43bbc8);console[_0x217696(0x1cb)](_0x1ce71a['yellow'](_0x217696(0x19a))),console[_0x217696(0x1cb)](_0x1ce71a[_0x217696(0x1d0)](_0x217696(0x1dd))),console[_0x217696(0x1cb)](_0x1ce71a['dim'](_0x217696(0x18e))),console['log'](_0x1ce71a[_0x217696(0x18d)]('\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/')),console[_0x217696(0x1cb)](_0x1ce71a['dim'](_0x217696(0x1e4))),console[_0x217696(0x1cb)]();if(_0x580962['length']===0x0)return console['error'](_0x217696(0x18a)),console['error'](_0x217696(0x199)),0x1;const _0x1ec762=_0x580962[0x0],_0x23e317=_0x43bbc8,_0x59068c=_0x23e317[_0x217696(0x121)],_0x540631=_0x23e317[_0x217696(0x172)];try{if(!_0x540631){const _0x3d210f=_0x4145bd['llm'][_0x217696(0x181)](_0x1ec762),_0x38e2cc=_0x59068c||_0x3d210f[_0x217696(0x135)][_0x217696(0x17f)],_0x25c35e=await withSpinner(_0x217696(0x123),()=>_0x4145bd[_0x217696(0x131)][_0x217696(0x1f0)](),{'verbose':_0x43bbc8['verbose']}),_0xa4262a=_0x25c35e['data'][_0x217696(0x1a3)](_0x3e9112=>_0x3e9112['attributes'][_0x217696(0x121)]===_0x38e2cc);if(_0xa4262a&&!_0x43bbc8['yes']){const _0x24f141=await confirm(_0x217696(0x191)+_0x38e2cc+_0x217696(0x162));if(!_0x24f141)return console[_0x217696(0x1cb)](_0x217696(0x196)),0x0;}}const _0x3aed49=await withSpinner(_0x540631?_0x217696(0x1ad)+_0x1ec762+_0x217696(0x143):_0x217696(0x1c9)+_0x1ec762+'\x27...',()=>_0x4145bd[_0x217696(0x131)][_0x217696(0x175)](_0x1ec762,{'name':_0x59068c,'dryRun':_0x540631}),{'verbose':_0x43bbc8[_0x217696(0x1be)]}),_0x1e1600=_0x3aed49[_0x217696(0x112)];return _0x1e1600[_0x217696(0x138)]&&console[_0x217696(0x1cb)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x1e1600[_0x217696(0x138)]+'\x27'),_0x540631?console[_0x217696(0x1cb)](_0x217696(0x14f)+_0x1e1600[_0x217696(0x17f)]):console[_0x217696(0x1cb)](_0x217696(0x1ba)+_0x1e1600[_0x217696(0x17f)]+'\x20('+_0x1e1600[_0x217696(0x182)]+')'),console[_0x217696(0x1cb)](_0x217696(0x127)+_0x1e1600['counts'][_0x217696(0x1d2)]),console[_0x217696(0x1cb)](_0x217696(0x10b)+_0x1e1600[_0x217696(0x1de)][_0x217696(0x11e)]),console[_0x217696(0x1cb)](_0x217696(0x161)+_0x1e1600['counts']['prompts']),console[_0x217696(0x1cb)](_0x217696(0x1d8)+_0x1e1600[_0x217696(0x1de)]['integrations']),(_0x43bbc8['format']===_0x217696(0x1d9)||_0x43bbc8[_0x217696(0x144)]===_0x217696(0x14d))&&await handleSDKOutput([_0x1e1600],_0x43bbc8),0x0;}catch(_0x55b662){return handleSDKError(_0x55b662,_0x43bbc8),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x234115,_0x5bd5ea){const _0x647071=a20_0x38cdde,_0x3f1ce9=_0x5bd5ea[_0x647071(0x187)]||CHAT_SELECTOR_PAGE_SIZE;let _0x5a14f2=0x0,_0x25a2be=[];const _0x94be93=(await import(_0x647071(0x1b8)))[_0x647071(0x145)],_0x1b0a03=getChalk(_0x5bd5ea);while(!![]){const _0x4bade3=await withSpinner(_0x647071(0x1e6),()=>_0x234115[_0x647071(0x131)][_0x647071(0x165)](_0x3f1ce9+_0x5a14f2),{'verbose':_0x5bd5ea[_0x647071(0x1be)]});_0x25a2be=_0x4bade3['data'];const _0x30a81f=_0x25a2be[_0x647071(0x153)](_0x5a14f2,_0x5a14f2+_0x3f1ce9),_0x5980be=_0x25a2be[_0x647071(0x124)]>_0x5a14f2+_0x3f1ce9,_0xe5ea1f=[...new Set(_0x30a81f[_0x647071(0x193)](_0x4e765f=>_0x4e765f[_0x647071(0x159)][_0x647071(0x18b)])['filter'](_0x40b443=>_0x40b443!==undefined))],_0x107347=new Map();await Promise[_0x647071(0x125)](_0xe5ea1f['map'](async _0x4705ea=>{const _0x3bb1ac=_0x647071;try{const _0x28f9c4=await _0x234115[_0x3bb1ac(0x131)][_0x3bb1ac(0x1da)](_0x4705ea);_0x107347[_0x3bb1ac(0x1a8)](_0x4705ea,_0x28f9c4[_0x3bb1ac(0x159)][_0x3bb1ac(0x121)]);}catch{_0x107347['set'](_0x4705ea,_0x4705ea);}}));const _0x3bdf4a=_0x30a81f[_0x647071(0x193)](_0x1f6d06=>{const _0x1ebde0=_0x647071,_0x14053f=_0x1f6d06[_0x1ebde0(0x159)]['firstInputContent']||_0x1ebde0(0x173),_0x32b7b8=_0x14053f[_0x1ebde0(0x1b2)]('\x0a')[0x0],_0x372ef5=_0x32b7b8['length']>0x50?_0x32b7b8[_0x1ebde0(0x16e)](0x0,0x4d)+_0x1ebde0(0x1ce):_0x32b7b8,_0x2d8c79=_0x1f6d06['attributes'][_0x1ebde0(0x18b)]?_0x107347[_0x1ebde0(0x1c7)](_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18b)])||_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18b)]:_0x1ebde0(0x164),_0x415ac=_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x11d)]||_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18f)],_0xd6bee7=new Date(_0x415ac),_0x3fe778=new Date(),_0x36ae05=_0x3fe778[_0x1ebde0(0x1dc)]()-_0xd6bee7[_0x1ebde0(0x1dc)](),_0x8fae6d=Math[_0x1ebde0(0x176)](_0x36ae05/0xea60),_0x3a3d2f=Math[_0x1ebde0(0x176)](_0x36ae05/0x36ee80),_0x3ed301=Math[_0x1ebde0(0x176)](_0x36ae05/0x5265c00);let _0x2b60f1;if(_0x8fae6d<0x1)_0x2b60f1=_0x1ebde0(0x15c);else{if(_0x8fae6d<0x3c)_0x2b60f1=_0x8fae6d+_0x1ebde0(0x148);else{if(_0x3a3d2f<0x18)_0x2b60f1=_0x3a3d2f+_0x1ebde0(0x154);else _0x3ed301<0x7?_0x2b60f1=_0x3ed301+_0x1ebde0(0x115):_0x2b60f1=_0xd6bee7[_0x1ebde0(0x1bd)](_0x1ebde0(0x1ea),{'month':'short','day':'numeric'});}}return{'title':_0x372ef5+'\x20'+_0x1b0a03['dim']('['+_0x2d8c79+']\x20'+_0x2b60f1),'value':_0x1f6d06['id']};});_0x5980be&&_0x3bdf4a[_0x647071(0x168)]({'title':_0x1b0a03[_0x647071(0x1cf)](_0x647071(0x188)),'value':_0x647071(0x195)});const _0x5ec6c3=await _0x94be93({'type':_0x647071(0x15d),'name':_0x647071(0x1b3),'message':_0x647071(0x179),'choices':_0x3bdf4a,'hint':_0x647071(0x1c2)});if(!_0x5ec6c3[_0x647071(0x1b3)])return undefined;if(_0x5ec6c3[_0x647071(0x1b3)]===_0x647071(0x195)){_0x5a14f2+=_0x3f1ce9;continue;}return _0x5ec6c3[_0x647071(0x1b3)];}}function a20_0x2d6f(_0x162537,_0x32f3e5){_0x162537=_0x162537-0x109;const _0x216c5f=a20_0x216c();let _0x2d6f87=_0x216c5f[_0x162537];return _0x2d6f87;}export class ChatsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x165);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1eb);async[a20_0x38cdde(0x13c)](_0x21ac8a){const _0x5389e5=a20_0x38cdde;return executeChatHistoryCommand(_0x21ac8a,_0x5389e5(0x197));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x1df827=a21_0x276b;(function(_0x4d0383,_0x2014b9){const _0x4c662f=a21_0x276b,_0x1a647c=_0x4d0383();while(!![]){try{const _0x30b146=parseInt(_0x4c662f(0x1b2))/0x1*(-parseInt(_0x4c662f(0x1ae))/0x2)+-parseInt(_0x4c662f(0x199))/0x3+parseInt(_0x4c662f(0x195))/0x4+parseInt(_0x4c662f(0x1be))/0x5*(-parseInt(_0x4c662f(0x196))/0x6)+-parseInt(_0x4c662f(0x1b5))/0x7+-parseInt(_0x4c662f(0x189))/0x8*(-parseInt(_0x4c662f(0x1a1))/0x9)+parseInt(_0x4c662f(0x1c2))/0xa;if(_0x30b146===_0x2014b9)break;else _0x1a647c['push'](_0x1a647c['shift']());}catch(_0x2427f9){_0x1a647c['push'](_0x1a647c['shift']());}}}(a21_0x34b7,0x509b6));function a21_0x34b7(){const _0x51ec2d=['Port\x20','\x27\x20not\x20found','site','project','675qYjHer','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','Project\x20\x27','NOT_FOUND','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','bold','llm','http://0.0.0.0:','port','Server\x20Configuration:','Resolving\x20project...','\x20\x20\x20\x20}','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','430nRZCNB','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','\x20\x20}','\x20\x20Address:','958lebXyG','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','4161290XhefhU','\x0aTesting\x20with\x20Agent\x20SDK:','init','description','exit','SIGINT','Starting\x20proxy\x20server...','\x20\x20Site:','SIGTERM','1760YaliEd','cyan','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','16900900YhtQaZ','✓\x20Proxy\x20server\x20stopped','\x20\x20\x20\x20\x22env\x22:\x20{','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','server','attributes','\x20\x20{','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','39272RfamDE','yellow','llmProject','green','white','\x0aClaude\x20Code\x20Configuration:','\x20\x20Agents:','find','logger','close','name','start','10220WnBOOv','11244FAriWY','projects','dim','811698DcvRqO','stop','execute','log'];a21_0x34b7=function(){return _0x51ec2d;};return a21_0x34b7();}import a21_0x5a29a2 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 a21_0x276b(_0x4bf820,_0x2ea38b){_0x4bf820=_0x4bf820-0x188;const _0x34b73e=a21_0x34b7();let _0x276b47=_0x34b73e[_0x4bf820];return _0x276b47;}async function getProjectIdOrDefault(_0x3a8e5f,_0x107a94){const _0x230564=a21_0x276b,{tdx:_0x2fcfd3,options:_0xc0d45b}=_0x3a8e5f,_0x472766=_0x107a94||_0xc0d45b[_0x230564(0x18b)];if(_0x472766){const _0x35bb9b=await _0x2fcfd3[_0x230564(0x1a7)][_0x230564(0x197)](),_0x585544=_0x35bb9b[_0x230564(0x190)](_0x80db4e=>_0x80db4e[_0x230564(0x1c7)][_0x230564(0x193)]===_0x472766);if(!_0x585544)throw new SDKError(ErrorCode[_0x230564(0x1a4)],_0x230564(0x1a3)+_0x472766+_0x230564(0x19e),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x585544['id'];}const _0x35d39f=await _0x2fcfd3['llm']['getOrCreateDefaultProject']();return _0x35d39f['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x1df827(0x193)]='llm:proxy';[a21_0x1df827(0x1b8)]=a21_0x1df827(0x1a2);['server'];[a21_0x1df827(0x191)];async[a21_0x1df827(0x19b)](_0x5e8cc6){const _0x430078=a21_0x1df827,{tdx:_0x3fcc78,options:_0x31d28a}=_0x5e8cc6;try{const _0x15b9e8=_0x31d28a,_0x324e95=_0x15b9e8[_0x430078(0x1a9)]||0xfa0,_0x238cb3=_0x15b9e8[_0x430078(0x1a0)],_0x32d3f5=await findAvailablePort(_0x324e95);console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1ab)));const _0x7d1bd2=await getProjectIdOrDefault(_0x5e8cc6,_0x238cb3),_0x3789b6=await _0x3fcc78[_0x430078(0x1a7)]['projects'](),_0x568655=_0x3789b6['find'](_0x33f548=>_0x33f548['id']===_0x7d1bd2);this[_0x430078(0x191)]=new TDXLogger(_0x31d28a['logLevel']),await this[_0x430078(0x191)][_0x430078(0x1b7)](),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1bb)));_0x32d3f5!==_0x324e95&&console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)](_0x430078(0x19d)+_0x324e95+'\x20is\x20unavailable,\x20using\x20port\x20'+_0x32d3f5));this['server']=new ProxyServer({'port':_0x32d3f5,'projectId':_0x7d1bd2,'tdx':_0x3fcc78,'logger':this['logger'],'site':_0x31d28a['site']}),await this[_0x430078(0x1c6)][_0x430078(0x194)](),console['log'](a21_0x5a29a2[_0x430078(0x18a)][_0x430078(0x1a6)](_0x430078(0x188))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)](_0x430078(0x1c5))),console[_0x430078(0x19c)](a21_0x5a29a2['yellow'](_0x430078(0x1c0))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18c)][_0x430078(0x1a6)](_0x430078(0x1b4))),console['log'](a21_0x5a29a2[_0x430078(0x1bf)](_0x430078(0x1aa))),console['log'](a21_0x5a29a2['dim'](_0x430078(0x1b1)),a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1a8)+_0x32d3f5)),console[_0x430078(0x19c)](a21_0x5a29a2['dim']('\x20\x20Project:'),a21_0x5a29a2[_0x430078(0x18d)](_0x568655?.['attributes']['name']||_0x7d1bd2)),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x18f)),a21_0x5a29a2['white']('created\x20on-demand\x20per\x20model')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1bc)),a21_0x5a29a2[_0x430078(0x18d)](_0x31d28a[_0x430078(0x19f)])),console['log'](a21_0x5a29a2[_0x430078(0x1bf)](_0x430078(0x18e))),console[_0x430078(0x19c)](a21_0x5a29a2['dim'](_0x430078(0x1ad))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1c8))),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1c4))),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1a5)+_0x32d3f5+'\x22,')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22')),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1ac))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1b0))),console[_0x430078(0x19c)](a21_0x5a29a2['cyan'](_0x430078(0x1b6))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1b3))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1af))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x174dca=async()=>{const _0x1e6bae=_0x430078;console[_0x1e6bae(0x19c)](a21_0x5a29a2['dim'](_0x1e6bae(0x1c1))),this[_0x1e6bae(0x1c6)]&&await this[_0x1e6bae(0x1c6)]['stop'](),this[_0x1e6bae(0x191)]&&await this[_0x1e6bae(0x191)][_0x1e6bae(0x192)](),console['log'](a21_0x5a29a2[_0x1e6bae(0x18c)](_0x1e6bae(0x1c3))),process[_0x1e6bae(0x1b9)](0x0);};return process['on'](_0x430078(0x1ba),_0x174dca),process['on'](_0x430078(0x1bd),_0x174dca),await new Promise(()=>{}),0x0;}catch(_0x4f6a64){this[_0x430078(0x1c6)]&&await this['server'][_0x430078(0x19a)]();this[_0x430078(0x191)]&&await this['logger'][_0x430078(0x192)]();throw _0x4f6a64;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x296be5=a22_0x2631;(function(_0x15b5eb,_0x165c0a){const _0x473d3c=a22_0x2631,_0x575dda=_0x15b5eb();while(!![]){try{const _0x437c4b=-parseInt(_0x473d3c(0x109))/0x1+parseInt(_0x473d3c(0x1e1))/0x2+parseInt(_0x473d3c(0x11f))/0x3*(parseInt(_0x473d3c(0x125))/0x4)+-parseInt(_0x473d3c(0x142))/0x5+-parseInt(_0x473d3c(0x1c2))/0x6*(-parseInt(_0x473d3c(0x14e))/0x7)+-parseInt(_0x473d3c(0x146))/0x8*(-parseInt(_0x473d3c(0xdc))/0x9)+parseInt(_0x473d3c(0xd6))/0xa;if(_0x437c4b===_0x165c0a)break;else _0x575dda['push'](_0x575dda['shift']());}catch(_0x4a1388){_0x575dda['push'](_0x575dda['shift']());}}}(a22_0x51e9,0xbfe3f));function a22_0x2631(_0x5d214e,_0x5d38ca){_0x5d214e=_0x5d214e-0xc6;const _0x51e92b=a22_0x51e9();let _0x26316c=_0x51e92b[_0x5d214e];return _0x26316c;}import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x20a34d from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x23b2b0 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x296be5(0x130),LEGACY_PARENT_SEGMENT_DIR=a22_0x296be5(0x129);function openBrowser(_0x26c007){const _0x51e179=a22_0x296be5,_0x414db8=process[_0x51e179(0xf0)],_0xde490e=_0x414db8===_0x51e179(0x10d)?_0x51e179(0x14d):_0x414db8==='win32'?_0x51e179(0x145):_0x51e179(0x111);spawn(_0xde490e,[_0x26c007],{'detached':!![],'stdio':_0x51e179(0x16f)})[_0x51e179(0x1b9)]();}function migrateLegacyDirectory(){const _0x4291e6=a22_0x296be5;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1aab5a=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1aab5a[_0x4291e6(0x115)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x4291e6(0x11d)](a22_0x23b2b0[_0x4291e6(0x1a2)](_0x4291e6(0x1cd)+LEGACY_PARENT_SEGMENT_DIR+_0x4291e6(0xfb)+PARENT_SEGMENT_DIR+_0x4291e6(0x1b0))),console[_0x4291e6(0x11d)](a22_0x23b2b0[_0x4291e6(0xca)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x4291e6(0x1af))),![];console[_0x4291e6(0x11d)](a22_0x23b2b0['yellow']('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x4291e6(0x101)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x4291e6(0x11d)](a22_0x23b2b0[_0x4291e6(0x1a4)](_0x4291e6(0x194)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1acf49){const _0xf10dd2=_0x1acf49 instanceof Error?_0x1acf49[_0x4291e6(0x1c5)]:String(_0x1acf49);return console['error'](a22_0x23b2b0[_0x4291e6(0x16c)](_0x4291e6(0x18a)+_0xf10dd2+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x296be5(0xe0)](_0x127c3c){const _0x148d63=a22_0x296be5;return migrateLegacyDirectory(),super[_0x148d63(0xe0)](_0x127c3c);}}function resolveYamlFile(_0x4a1116){const _0x47e6b9=a22_0x296be5;if(_0x4a1116[_0x47e6b9(0x1bf)]('.yml')||_0x4a1116[_0x47e6b9(0x1bf)]('.yaml'))return _0x4a1116;return a22_0x20a34d[_0x47e6b9(0x1e3)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4a1116)+'.yml');}function formatProgressMessage(_0x4ac6bc){const _0x64c80c=a22_0x296be5,_0x165ef0=_0x4ac6bc[_0x64c80c(0x197)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x165ef0){const [,_0x1811ab,_0xfb225f,_0x34b21d='']=_0x165ef0;return a22_0x23b2b0[_0x64c80c(0xca)](_0x1811ab+':')+'\x20'+_0xfb225f+a22_0x23b2b0[_0x64c80c(0xca)](_0x34b21d);}return a22_0x23b2b0['dim'](_0x4ac6bc);}function showFileNotFoundError(_0x8a0668,_0x39239e){const _0x844f31=a22_0x296be5;console[_0x844f31(0x11d)](a22_0x23b2b0['red'](_0x844f31(0x17c)+_0x8a0668+'\x0a')),console[_0x844f31(0x11d)](a22_0x23b2b0['cyan'](_0x844f31(0x160)+_0x39239e+_0x844f31(0xfa)));}function showParentSegmentNotSetError(_0x13ada1){const _0xf82f7a=a22_0x296be5;console[_0xf82f7a(0x11d)](a22_0x23b2b0['yellow'](_0xf82f7a(0x195))),console['error'](_0x13ada1);}export class ParentSegmentListCommand extends BaseCommand{['name']=a22_0x296be5(0x116);[a22_0x296be5(0xea)]=a22_0x296be5(0x114);async[a22_0x296be5(0x110)](_0x2ce6a5){const _0x167ae7=a22_0x296be5,{options:_0x165a23,args:_0x1947d8,tdx:_0x477112}=_0x2ce6a5,_0x3efc5e=_0x1947d8[0x0];_0x165a23['verbose']&&(console[_0x167ae7(0x11d)]('Site:\x20'+_0x165a23[_0x167ae7(0x135)]),_0x3efc5e&&console[_0x167ae7(0x11d)]('Pattern:\x20'+_0x3efc5e));const _0x8c9a27=await withSpinner(_0x3efc5e?_0x167ae7(0xcd)+_0x3efc5e+_0x167ae7(0xdd):_0x167ae7(0xe5),()=>_0x477112[_0x167ae7(0x19d)]['listParents'](),{'verbose':_0x165a23[_0x167ae7(0x198)]});let _0x2f54fc=_0x8c9a27['data'];if(_0x3efc5e){const _0x3806b3=_0x3efc5e[_0x167ae7(0x161)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x167ae7(0x161)](/\*/g,'.*')[_0x167ae7(0x161)](/\?/g,'.'),_0x3241ef=new RegExp('^'+_0x3806b3+'$','i');_0x2f54fc=_0x2f54fc[_0x167ae7(0xef)](_0x506145=>_0x3241ef['test'](_0x506145[_0x167ae7(0x1d4)][_0x167ae7(0x171)]));}_0x2f54fc['sort']((_0x56f1b5,_0x251760)=>_0x56f1b5[_0x167ae7(0x1d4)]['name'][_0x167ae7(0x1b3)](_0x251760[_0x167ae7(0x1d4)][_0x167ae7(0x171)])),console[_0x167ae7(0x11d)](_0x167ae7(0x1c4)+_0x2f54fc['length']+'\x20parent\x20segment'+(_0x2f54fc[_0x167ae7(0x16b)]!==0x1?'s':''));if(_0x165a23['format']===_0x167ae7(0x18b)||_0x165a23[_0x167ae7(0xe7)]===_0x167ae7(0xd9))await handleSDKOutput(_0x2f54fc,_0x165a23);else{if(_0x2f54fc['length']===0x0)_0x3efc5e?console[_0x167ae7(0x196)](_0x167ae7(0x1e2)+_0x3efc5e):console[_0x167ae7(0x196)]('No\x20parent\x20segments\x20found');else for(const _0x4d672a of _0x2f54fc){const _0x53cfe5=_0x4d672a[_0x167ae7(0x1d4)][_0x167ae7(0x1ba)]?a22_0x23b2b0[_0x167ae7(0xca)]('\x20('+formatRows(_0x4d672a['attributes'][_0x167ae7(0x1ba)])+')'):'';console['log']('👥\x20'+_0x4d672a['attributes'][_0x167ae7(0x171)]+_0x53cfe5);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0x165);[a22_0x296be5(0xea)]=a22_0x296be5(0x1d1);async[a22_0x296be5(0x110)](_0x5cff5b){const _0x23b881=a22_0x296be5,{options:_0x1e7537,args:_0x243331,tdx:_0x390bbf}=_0x5cff5b;console[_0x23b881(0x11d)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2a8530=_0x1e7537;if(_0x243331[_0x23b881(0x16b)]===0x0)return console[_0x23b881(0x11d)](a22_0x23b2b0['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x23b881(0x11d)](_0x23b881(0x10b)),0x1;const _0x1fa4f6=_0x243331[0x0];if(!_0x2a8530[_0x23b881(0x1d5)]||!_0x2a8530[_0x23b881(0x1a1)])return console[_0x23b881(0x11d)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x23b881(0x11d)](_0x23b881(0x10b)),0x1;_0x2a8530[_0x23b881(0x198)]&&(console[_0x23b881(0x11d)](_0x23b881(0x1d0)+_0x2a8530['site']),console['error'](_0x23b881(0x1c3)+_0x1fa4f6),console[_0x23b881(0x11d)](_0x23b881(0x180)+_0x2a8530[_0x23b881(0x1d5)]),console[_0x23b881(0x11d)]('Table:\x20'+_0x2a8530[_0x23b881(0x1a1)]));const _0x46852c=await loadJSONFromOptions(_0x2a8530[_0x23b881(0x1d4)],_0x2a8530['attributesFile']),_0x1696c3=await loadJSONFromOptions(_0x2a8530[_0x23b881(0xed)],_0x2a8530[_0x23b881(0xe9)]),_0x21353e=await loadJSONFromOptions(_0x2a8530[_0x23b881(0x14a)],_0x2a8530[_0x23b881(0xe4)]),_0x5bff47={'name':_0x1fa4f6,'description':_0x2a8530[_0x23b881(0xea)],'scheduleType':_0x2a8530[_0x23b881(0x186)],'scheduleOption':_0x2a8530[_0x23b881(0x166)],'timezone':_0x2a8530[_0x23b881(0x156)],'master':{'parentDatabaseName':_0x2a8530[_0x23b881(0x1d5)],'parentTableName':_0x2a8530['table']},'attributes':_0x46852c,'behaviors':_0x1696c3,'customerGroup':_0x21353e},_0x4c73c2=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1fa4f6+_0x23b881(0xdd),()=>_0x390bbf['segment'][_0x23b881(0x15f)](_0x5bff47),{'verbose':_0x1e7537[_0x23b881(0x198)]}),_0x53dcb8=_0x4c73c2[_0x23b881(0x1e9)];return console[_0x23b881(0x11d)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x53dcb8[_0x23b881(0x171)]+_0x23b881(0x143)+_0x53dcb8['id']),await handleSDKOutput([_0x53dcb8],_0x1e7537),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0x1ca);[a22_0x296be5(0xea)]=a22_0x296be5(0x1a8);async[a22_0x296be5(0x110)](_0x4dfc84){const _0x5d409c=a22_0x296be5,{options:_0x17af83,args:_0x1f3dc9,tdx:_0x596051}=_0x4dfc84;console['error'](_0x5d409c(0x148)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x5d409c(0x13f));const _0x44e081=_0x17af83;if(_0x1f3dc9[_0x5d409c(0x16b)]===0x0)return console['error'](a22_0x23b2b0['red'](_0x5d409c(0xe2))),console[_0x5d409c(0x11d)](_0x5d409c(0xd0)),0x1;const _0x183538=_0x1f3dc9[0x0];_0x44e081[_0x5d409c(0x198)]&&(console[_0x5d409c(0x11d)](_0x5d409c(0x1d0)+_0x44e081[_0x5d409c(0x135)]),console[_0x5d409c(0x11d)](_0x5d409c(0x1bc)+_0x183538));const _0x42b0a4=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x183538+_0x5d409c(0xdd),()=>_0x596051[_0x5d409c(0x19d)][_0x5d409c(0x1d8)](_0x183538),{'verbose':_0x44e081[_0x5d409c(0x198)]}),_0x32a5e1=_0x42b0a4[_0x5d409c(0x1e9)],_0x458e1b=await loadJSONFromOptions(_0x44e081[_0x5d409c(0x147)],_0x44e081[_0x5d409c(0x144)]),_0x383169=await loadJSONFromOptions(_0x44e081[_0x5d409c(0xde)],_0x44e081['addBehaviorsFile']),_0x51bb39={'name':_0x32a5e1[_0x5d409c(0x171)],'description':_0x44e081[_0x5d409c(0xea)]!==undefined?_0x44e081[_0x5d409c(0xea)]:_0x32a5e1[_0x5d409c(0xea)],'scheduleType':_0x44e081[_0x5d409c(0x186)]!==undefined?_0x44e081[_0x5d409c(0x186)]:_0x32a5e1[_0x5d409c(0x186)],'scheduleOption':_0x44e081['scheduleOption']!==undefined?_0x44e081[_0x5d409c(0x166)]:_0x32a5e1[_0x5d409c(0x166)],'timezone':_0x44e081[_0x5d409c(0x156)]!==undefined?_0x44e081[_0x5d409c(0x156)]:_0x32a5e1[_0x5d409c(0x156)],'master':_0x32a5e1[_0x5d409c(0xf5)],'attributes':_0x458e1b?[..._0x32a5e1[_0x5d409c(0x1d4)]||[],..._0x458e1b]:_0x32a5e1[_0x5d409c(0x1d4)],'behaviors':_0x383169?[..._0x32a5e1[_0x5d409c(0xed)]||[],..._0x383169]:_0x32a5e1[_0x5d409c(0xed)],'customerGroup':_0x32a5e1[_0x5d409c(0x14a)]},_0x240f24=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x183538+'\x27...',()=>_0x596051[_0x5d409c(0x19d)][_0x5d409c(0xeb)](_0x183538,_0x51bb39),{'verbose':_0x44e081['verbose']}),_0x3a7434=_0x240f24[_0x5d409c(0x1e9)];return console[_0x5d409c(0x11d)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x3a7434[_0x5d409c(0x171)]+'\x27'),await handleSDKOutput([_0x3a7434],_0x44e081),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x296be5(0x171)]='segment:parent:pull';[a22_0x296be5(0xea)]=a22_0x296be5(0x10e);async['execute'](_0x147c83){const _0x576999=a22_0x296be5,{options:_0x2c0e8a,args:_0x4f9537,tdx:_0x2c45e5}=_0x147c83,_0x2b4330=_0x2c0e8a,_0x218f35=_0x4f9537[0x0]||_0x2c0e8a[_0x576999(0x1db)];if(!_0x218f35)return showParentSegmentNotSetError(_0x576999(0xf7)+_0x576999(0x1bd)),0x1;if(_0x2b4330[_0x576999(0xce)]&&_0x2b4330[_0x576999(0x1e6)])return console[_0x576999(0x11d)](a22_0x23b2b0[_0x576999(0x16c)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a22_0x23b2b0[_0x576999(0xca)](_0x576999(0x18d))),console['error'](a22_0x23b2b0[_0x576999(0xca)](_0x576999(0xdb)+PARENT_SEGMENT_DIR+_0x576999(0x1dd))),console[_0x576999(0x11d)](a22_0x23b2b0[_0x576999(0x1b4)](_0x576999(0x1c8))),0x1;const _0x1765f1=_0x2b4330[_0x576999(0x1e6)]||a22_0x20a34d[_0x576999(0x1e3)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x218f35)+'.yml');_0x2b4330[_0x576999(0x198)]&&(console[_0x576999(0x11d)](_0x576999(0x1d0)+_0x2b4330['site']),console[_0x576999(0x11d)](_0x576999(0x1bc)+_0x218f35),console[_0x576999(0x11d)]('Output\x20file:\x20'+_0x1765f1));const _0x10c5a1=await withSpinner(_0x576999(0x12c)+_0x218f35+_0x576999(0xdd),()=>_0x2c45e5['segment'][_0x576999(0xf3)](_0x218f35),{'verbose':_0x2b4330['verbose']}),_0x4e8b34=_0x10c5a1[_0x576999(0x1e9)];if(existsSync(_0x1765f1)){const _0x30896e=readFileSync(_0x1765f1,'utf-8'),_0x57d483=generateDiff(_0x30896e,_0x4e8b34);if(!hasChanges(_0x57d483))console['error'](a22_0x23b2b0[_0x576999(0x1a4)]('✔')+_0x576999(0x1d2)+a22_0x23b2b0[_0x576999(0x1b4)](_0x1765f1)+_0x576999(0x159));else{console['error']('\x0aChanges\x20to\x20\x27'+_0x1765f1+'\x27:'),console[_0x576999(0x11d)]('─'[_0x576999(0x13a)](0x3c)),console[_0x576999(0x11d)](formatDiffWithColors(_0x57d483)),console[_0x576999(0x11d)]('─'['repeat'](0x3c));if(!_0x2b4330['yes']){const _0x5afa04=await confirmKey('Overwrite\x20\x27'+_0x1765f1+'\x27?');if(!_0x5afa04)return console['error'](_0x576999(0x1ac)),0x1;}writeFileSync(_0x1765f1,_0x4e8b34,'utf-8'),console[_0x576999(0x11d)](a22_0x23b2b0[_0x576999(0x1a4)]('✔')+_0x576999(0x163)+a22_0x23b2b0[_0x576999(0x1b4)](_0x1765f1));}}else{const _0x5b72a7=a22_0x20a34d[_0x576999(0x1b6)](_0x1765f1);!existsSync(_0x5b72a7)&&mkdirSync(_0x5b72a7,{'recursive':!![]}),writeFileSync(_0x1765f1,_0x4e8b34,'utf-8'),console[_0x576999(0x11d)](a22_0x23b2b0['green']('✔')+_0x576999(0x163)+a22_0x23b2b0[_0x576999(0x1b4)](_0x1765f1));}return saveSessionContext({'parent_segment':_0x218f35},_0x2b4330['session']),console[_0x576999(0x11d)](a22_0x23b2b0[_0x576999(0x1a4)]('✔')+_0x576999(0x155)+a22_0x23b2b0['dim']('parent_segment')+_0x576999(0x189)+a22_0x23b2b0[_0x576999(0x1b4)](_0x218f35)),0x0;}}function a22_0x51e9(){const _0x5321a0=['Creating','green','/attempt/','displayMasterInfo','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Found\x20YAML\x20file:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Aborted.','getParentSQL','\x20parent\x20segment\x20\x27','/\x20directory.\x0a','/\x20directories\x20exist.','Validating\x20configuration...','displayPreviewHints','localeCompare','cyan','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','dirname','\x27\x20is\x20up\x20to\x20date','Analyzing\x20changes...','unref','population','Updated','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','endsWith','SQL\x20query:\x0a','Events:','6492978DghTzQ','Name:\x20','✔\x20Found\x20','message','\x20--behavior\x20\x22<name>\x22','schemaError','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','string','segment:parent:update','YAML\x20file:\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x0a⚠️\x20\x20Both\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','segment:parent:fields','Site:\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20No\x20changes\x20-\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','attributes','database','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','displayAttributesStats','getParentFull','Resolving\x20parent\x20segment\x20\x27','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','parentSegment','-1d','/{name}.yml\x0a','stats','Master:','runParent','838910krIlRJ','No\x20parent\x20segments\x20match\x20pattern:\x20','join','Error\x20parsing\x20YAML:\x20','\x20kill','output','Errors:','Customers:','data','To\x20view\x20sample\x20data:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','behavior','Options:\x0a','Behaviors','Behavior:','dim','\x0aUsage:\x20tdx\x20ps\x20preview\x20','interval','Listing\x20parent\x20segments\x20matching\x20\x27','use','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:sql','Attempt:','text','Fetching\x20SQL\x20for\x20\x27','pushParentYaml','13262020fSkpwv','sampleData','joinKey','jsonl','toLocaleString','using\x20the\x20default\x20path:\x20','279ifziug','\x27...','addBehaviors','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','run','toFixed','Error:\x20Parent\x20segment\x20name\x20is\x20required','elapsedTimeMillis','customerGroupFile','Listing\x20parent\x20segments...','coveragePercent','format','schemaValid','behaviorsFile','description','updateParent','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','behaviors','segment:parent:validate','filter','platform','Created','\x20--enriched','pullParentYaml','Error\x20reading\x20file:\x20','master','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20--interval\x20','`\x20to\x20download\x20the\x20configuration\x20first','/\x20and\x20','preview','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20rows\x20','errors','displayValidateResults','/\x20→\x20','Show\x20parent\x20segment\x20details','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','segment:parent:preview','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','enriched','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Master\x20Table','1133891oyxQaV','Attributes','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:\x20--behavior\x20requires\x20a\x20name\x0a','darwin','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','execute','xdg-open','Join:','displaySummary','List\x20parent\x20segments','isDirectory','segment:parent:list','\x0aNew\x20parent\x20segment\x20\x27','totalEvents','segment:parent:show','Fetching\x20sample\x20data...','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','error','yes','760008fipeNv','FINISHED','information_schema','Enriched:','Join\x20on:','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','8KKkErA','Executing\x20parent\x20segment\x20query...','\x20tdx\x20wf\x20attempt\x20','\x20field','parent_segment','\x20--attribute\x20\x22<name>\x22','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20parent\x20segment\x20\x27','Rows:','Apply\x20changes\x20to\x20\x27','/sessions/','parent_segments','foreignKey','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','displayColumns','site','web','apply','displayPreviewResults','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','displaySampleData','varchar','test','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x27\x20and\x20run\x20workflow?','\x20\x20No\x20sample\x20data\x20available','7660540xLjOfl','\x27\x20with\x20ID:\x20','addAttributesFile','start','30320osKVVr','addAttributes','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','To\x20cancel:','customerGroup','columns','audienceId','open','7GwnuQC','Listing\x20fields\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x20--attribute\x20\x22','validateParentYaml','Create\x20parent\x20segment\x20\x27','/app/dw/parentSegments/','\x20Context\x20set:\x20','timezone','limit','Source:','\x20is\x20already\x20up\x20to\x20date','workflowId','Get\x20SQL\x20query\x20for\x20parent\x20segment','Columns:','segment:parent:push','%)\x20','createParent','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','replace','bold','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x0aNo\x20sample\x20data\x20available','segment:parent:create','scheduleOption','displayBehaviorsStats','tdx\x20segment\x20parent\x20preview\x20','double','in\x20','length','red','keys','query','ignore','trim','name','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','attribute','label','map','Options:','Available\x20behaviors:','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','previewParentYaml','Error:\x20File\x20not\x20found:\x20','column','workflowAttemptId','\x20--behavior\x20\x22','Database:\x20','customersWithEvents','all','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20[Job\x20ID:\x20','customerPercent','scheduleType','stop','jobId','\x20=\x20','✘\x20Failed\x20to\x20rename\x20directory:\x20','json','\x0aChanges\x20to\x20apply\x20to\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','allValid','Error:','/app/workflows/','List\x20available\x20fields\x20for\x20segmentation','status','number','✔\x20Renamed\x20directory\x20to\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','log','match','verbose','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','rowCount','\x20rows)','✔\x20No\x20changes\x20-\x20\x27','segment','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','utf-8','Updating','table','yellow'];a22_0x51e9=function(){return _0x5321a0;};return a22_0x51e9();}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0x15d);[a22_0x296be5(0xea)]=a22_0x296be5(0x1da);async[a22_0x296be5(0x110)](_0x1c1a99){const _0x525a3=a22_0x296be5,{options:_0x344649,args:_0x7a81d7,tdx:_0x50ea6f}=_0x1c1a99,_0x1bca33=_0x344649,_0xb2b587=_0x7a81d7[0x0]||_0x344649['parentSegment'];if(!_0xb2b587)return showParentSegmentNotSetError(_0x525a3(0x103)+_0x525a3(0x1a9)),0x1;const _0x368e73=resolveYamlFile(_0xb2b587);if(!existsSync(_0x368e73))return showFileNotFoundError(_0x368e73,_0xb2b587),0x1;_0x1bca33[_0x525a3(0x198)]&&(console[_0x525a3(0x11d)](_0x525a3(0x1d0)+_0x1bca33[_0x525a3(0x135)]),console[_0x525a3(0x11d)](_0x525a3(0x1cb)+_0x368e73));let _0x1e2d0d;try{_0x1e2d0d=readFileSync(_0x368e73,_0x525a3(0x19f));}catch(_0x369b28){const _0x2f0d9c=_0x369b28 instanceof Error?_0x369b28[_0x525a3(0x1c5)]:String(_0x369b28);return console[_0x525a3(0x11d)](_0x525a3(0xf4)+_0x2f0d9c),0x1;}const _0x571281=await withSpinner(_0x525a3(0x1b8),()=>_0x50ea6f[_0x525a3(0x19d)][_0x525a3(0xd5)](_0x1e2d0d),{'verbose':_0x1bca33['verbose']}),_0x5399a1=_0x571281[_0x525a3(0x1e9)],{isNew:_0x530be9,name:_0x292c1f,hasChanges:_0x4a6836,diffFormatted:_0x53acf1}=_0x5399a1;if(!_0x4a6836)return console['error'](_0x525a3(0x19c)+_0x292c1f+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x530be9?console[_0x525a3(0x11d)](_0x525a3(0x117)+_0x292c1f+'\x27:'):console['error'](_0x525a3(0x18c)+_0x292c1f+'\x27:');console[_0x525a3(0x11d)]('─'[_0x525a3(0x13a)](0x3c)),console[_0x525a3(0x11d)](_0x53acf1),console[_0x525a3(0x11d)]('─'['repeat'](0x3c));const _0x3095b1=_0x530be9?_0x525a3(0x153)+_0x292c1f+'\x27?':_0x525a3(0x12e)+_0x292c1f+'\x27?';if(!_0x1bca33['yes']){const _0x17f3c3=await confirmKey(_0x3095b1);if(!_0x17f3c3)return console[_0x525a3(0x11d)]('Aborted.'),0x1;}const _0x115b11=_0x530be9?_0x525a3(0x1a3):_0x525a3(0x1a0),_0x568734=await withSpinner(_0x115b11+_0x525a3(0x1ae)+_0x292c1f+_0x525a3(0xdd),()=>_0x5399a1[_0x525a3(0x137)](),{'verbose':_0x1bca33['verbose']}),_0x28dadc=_0x568734['data'],_0x2223b8=getConsoleNextUrl(_0x1bca33[_0x525a3(0x135)],_0x525a3(0x154)+_0x28dadc['id']),_0x4d4408=_0x530be9?_0x525a3(0xf1):_0x525a3(0x1bb);return console[_0x525a3(0x11d)]('✔\x20'+_0x4d4408+_0x525a3(0x1ae)+_0x28dadc[_0x525a3(0x171)]+'\x27'),console['error']('\x20\x20'+_0x2223b8),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0xee);[a22_0x296be5(0xea)]=a22_0x296be5(0x10f);async[a22_0x296be5(0x110)](_0x4875f9){const _0x21930f=a22_0x296be5,{options:_0xe1e970,args:_0x57dbbe,tdx:_0x5b378f}=_0x4875f9,_0x3cb0d6=_0xe1e970,_0x24560a=_0x57dbbe[0x0]||_0xe1e970['parentSegment'];if(!_0x24560a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x21930f(0x17a)+'Options:\x0a'+_0x21930f(0x1be)+_0x21930f(0x124)+_0x21930f(0x107)),0x1;const _0x30c097=resolveYamlFile(_0x24560a);if(!existsSync(_0x30c097))return showFileNotFoundError(_0x30c097,_0x24560a),0x1;_0x3cb0d6[_0x21930f(0x198)]&&(console['error']('Site:\x20'+_0x3cb0d6['site']),console[_0x21930f(0x11d)](_0x21930f(0x1cb)+_0x30c097));let _0x2dfdf0;try{_0x2dfdf0=readFileSync(_0x30c097,'utf-8');}catch(_0x4b9626){const _0x353983=_0x4b9626 instanceof Error?_0x4b9626['message']:String(_0x4b9626);return console[_0x21930f(0x11d)](_0x21930f(0xf4)+_0x353983),0x1;}const _0x32beae=createCommandSpinner(a22_0x23b2b0[_0x21930f(0xca)](_0x21930f(0x1b1)),{'verbose':_0x3cb0d6[_0x21930f(0x198)]});_0x32beae[_0x21930f(0x145)]();const _0x1cc08c={'onProgress':_0x578047=>{const _0x562b6d=_0x21930f;_0x32beae[_0x562b6d(0xd3)]=formatProgressMessage(_0x578047);}};if(_0x3cb0d6['master'])_0x1cc08c[_0x21930f(0xf5)]=!![];if(_0x3cb0d6[_0x21930f(0x106)])_0x1cc08c['enriched']=!![];_0x3cb0d6[_0x21930f(0x174)]&&(_0x1cc08c[_0x21930f(0x174)]=_0x3cb0d6[_0x21930f(0x174)]);_0x3cb0d6[_0x21930f(0xc6)]&&(_0x1cc08c[_0x21930f(0xc6)]=_0x3cb0d6[_0x21930f(0xc6)]);if(_0x3cb0d6[_0x21930f(0xcc)])_0x1cc08c['interval']=_0x3cb0d6['interval'];let _0x57638d;try{_0x57638d=await _0x5b378f[_0x21930f(0x19d)][_0x21930f(0x152)](_0x2dfdf0,_0x1cc08c),_0x32beae[_0x21930f(0x187)]();}catch(_0x28ba4c){_0x32beae['stop']();throw _0x28ba4c;}const _0x43e316=_0x3cb0d6[_0x21930f(0xcc)]||'-1d';return this[_0x21930f(0x100)](_0x57638d,_0x1cc08c,_0x30c097,_0x43e316),_0x57638d[_0x21930f(0x18e)]?0x0:0x1;}[a22_0x296be5(0x100)](_0x43ed82,_0x159400,_0x35a747,_0x8a4896){const _0x496afc=a22_0x296be5;console['error']('\x0a'+a22_0x23b2b0[_0x496afc(0x162)]('Validate:')+'\x20'+_0x43ed82[_0x496afc(0x171)]),console['error']('═'[_0x496afc(0x13a)](0x3c)),this['displayMasterInfo'](_0x43ed82);if(typeof _0x159400[_0x496afc(0x174)]===_0x496afc(0x1c9)){this[_0x496afc(0x1d7)](_0x43ed82),this[_0x496afc(0x113)](_0x43ed82),this[_0x496afc(0x1b2)](_0x35a747,_0x8a4896,_0x496afc(0x174),_0x159400['attribute']);return;}if(_0x159400[_0x496afc(0x174)]===!![]){this['displayAttributesStats'](_0x43ed82),this[_0x496afc(0x113)](_0x43ed82),this[_0x496afc(0x1b2)](_0x35a747,_0x8a4896,_0x496afc(0x1d4));return;}if(typeof _0x159400[_0x496afc(0xc6)]==='string'){this[_0x496afc(0x167)](_0x43ed82,_0x8a4896),this['displaySummary'](_0x43ed82),this[_0x496afc(0x1b2)](_0x35a747,_0x8a4896,_0x496afc(0xc6),_0x159400[_0x496afc(0xc6)]);return;}if(_0x159400['behavior']===!![]){this[_0x496afc(0x167)](_0x43ed82,_0x8a4896),this[_0x496afc(0x113)](_0x43ed82),this[_0x496afc(0x1b2)](_0x35a747,_0x8a4896,_0x496afc(0xed));return;}this[_0x496afc(0x1d7)](_0x43ed82),this[_0x496afc(0x167)](_0x43ed82,_0x8a4896),this[_0x496afc(0x113)](_0x43ed82),this[_0x496afc(0x1b2)](_0x35a747,_0x8a4896,_0x496afc(0x182));}[a22_0x296be5(0x1b2)](_0x21a62f,_0x3e089a,_0x4bab66,_0x7acbde){const _0x13fe81=a22_0x296be5;console['error']('\x0a'+a22_0x23b2b0[_0x13fe81(0xca)](_0x13fe81(0x1ea)));const _0x147051=_0x3e089a!==_0x13fe81(0x1dc)?_0x13fe81(0xf9)+_0x3e089a:'';if(_0x4bab66===_0x13fe81(0x174)&&_0x7acbde)console[_0x13fe81(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x13fe81(0xca)]('tdx\x20segment\x20parent\x20preview\x20'+_0x21a62f+'\x20--attribute\x20\x22'+_0x7acbde+'\x22'+_0x147051));else{if(_0x4bab66==='behavior'&&_0x7acbde)console[_0x13fe81(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x13fe81(0xca)]('tdx\x20segment\x20parent\x20preview\x20'+_0x21a62f+_0x13fe81(0x17f)+_0x7acbde+'\x22'+_0x147051));else(_0x4bab66===_0x13fe81(0x1d4)||_0x4bab66===_0x13fe81(0x182))&&console[_0x13fe81(0x11d)]('\x20\x20'+a22_0x23b2b0['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x21a62f+_0x13fe81(0x12a)+_0x147051));}(_0x4bab66==='behaviors'||_0x4bab66===_0x13fe81(0x182))&&console[_0x13fe81(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x13fe81(0xca)](_0x13fe81(0x168)+_0x21a62f+_0x13fe81(0x1c6)+_0x147051)),_0x4bab66===_0x13fe81(0x182)&&console[_0x13fe81(0x11d)]('\x20\x20'+a22_0x23b2b0['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x21a62f+_0x13fe81(0xf2)+_0x147051));}[a22_0x296be5(0x1a6)](_0x2ae8c1){const _0x35bcd8=a22_0x296be5,{master:_0x286420}=_0x2ae8c1,_0x4ce75f=_0x286420[_0x35bcd8(0xe8)]?a22_0x23b2b0['green']('✔'):a22_0x23b2b0['red']('✘');console['error']('\x0a'+a22_0x23b2b0['dim'](_0x35bcd8(0x108))),console['error'](_0x4ce75f+'\x20'+a22_0x23b2b0[_0x35bcd8(0x162)](_0x286420[_0x35bcd8(0x1d5)]+'.'+_0x286420[_0x35bcd8(0x1a1)])),_0x286420[_0x35bcd8(0xe8)]?_0x286420[_0x35bcd8(0x19a)]!==undefined&&console[_0x35bcd8(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x35bcd8(0xca)](_0x35bcd8(0x12d))+'\x20'+a22_0x23b2b0[_0x35bcd8(0x1b4)](formatRows(_0x286420[_0x35bcd8(0x19a)]))):console[_0x35bcd8(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x35bcd8(0x16c)](_0x35bcd8(0x18f))+'\x20'+_0x286420[_0x35bcd8(0x1c7)]);}[a22_0x296be5(0x1d7)](_0x232179){const _0x5bace2=a22_0x296be5;if(_0x232179['attributes'][_0x5bace2(0x16b)]===0x0)return;console['error']('\x0a'+a22_0x23b2b0['dim'](_0x5bace2(0x10a)));for(const _0x54b34d of _0x232179['attributes']){const _0x2b7659=_0x54b34d[_0x5bace2(0xe8)]?a22_0x23b2b0[_0x5bace2(0x1a4)]('✔'):a22_0x23b2b0[_0x5bace2(0x16c)]('✘');let _0x30846b='';if(_0x54b34d[_0x5bace2(0xe8)]&&_0x54b34d['matchedCount']!==undefined&&_0x54b34d[_0x5bace2(0xe6)]!==undefined){const _0x2e34eb=_0x54b34d[_0x5bace2(0xe6)][_0x5bace2(0xe1)](0x1),_0x3d7865=_0x54b34d[_0x5bace2(0xe6)]>=0x50?a22_0x23b2b0[_0x5bace2(0x1a4)]:_0x54b34d[_0x5bace2(0xe6)]>=0x32?a22_0x23b2b0[_0x5bace2(0x1a2)]:a22_0x23b2b0[_0x5bace2(0x16c)];_0x30846b='\x20'+a22_0x23b2b0[_0x5bace2(0xca)]('Coverage:')+'\x20'+_0x3d7865(_0x2e34eb+'%')+'\x20('+formatRows(_0x54b34d['matchedCount'])+_0x5bace2(0x19b);}console[_0x5bace2(0x11d)](_0x2b7659+'\x20'+a22_0x23b2b0['bold'](_0x54b34d[_0x5bace2(0x171)])+_0x30846b),console[_0x5bace2(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x5bace2(0xca)](_0x5bace2(0x158))+'\x20'+a22_0x23b2b0[_0x5bace2(0x162)](_0x54b34d[_0x5bace2(0x1d5)]+'.'+_0x54b34d[_0x5bace2(0x1a1)]));const _0x59c346=_0x54b34d[_0x5bace2(0xd8)]===_0x54b34d[_0x5bace2(0x131)]?a22_0x23b2b0[_0x5bace2(0xca)](_0x5bace2(0x123))+'\x20'+_0x54b34d[_0x5bace2(0xd8)]:a22_0x23b2b0[_0x5bace2(0xca)](_0x5bace2(0x112))+'\x20'+_0x54b34d[_0x5bace2(0xd8)]+_0x5bace2(0x189)+_0x54b34d['foreignKey'];console[_0x5bace2(0x11d)]('\x20\x20'+_0x59c346),console['error']('\x20\x20'+a22_0x23b2b0['dim'](_0x5bace2(0x15c))),this[_0x5bace2(0x134)](_0x54b34d[_0x5bace2(0x14b)]),!_0x54b34d[_0x5bace2(0xe8)]&&console['error']('\x20\x20'+a22_0x23b2b0[_0x5bace2(0x16c)](_0x5bace2(0x18f))+'\x20'+_0x54b34d['schemaError']);}}['displayBehaviorsStats'](_0x1b1d7f,_0x26efa1){const _0x39e055=a22_0x296be5;if(_0x1b1d7f[_0x39e055(0xed)]['length']===0x0)return;console[_0x39e055(0x11d)]('\x0a'+a22_0x23b2b0[_0x39e055(0xca)](_0x39e055(0xc8))+'\x20'+a22_0x23b2b0[_0x39e055(0xca)]('('+_0x26efa1+')'));for(const _0x319079 of _0x1b1d7f['behaviors']){const _0x53b339=_0x319079[_0x39e055(0xe8)]?a22_0x23b2b0['green']('✔'):a22_0x23b2b0['red']('✘');let _0xe52ada='';if(_0x319079[_0x39e055(0xe8)]&&_0x319079[_0x39e055(0x181)]!==undefined&&_0x319079[_0x39e055(0x118)]!==undefined){const _0x5f5da7=_0x319079[_0x39e055(0x185)]?.[_0x39e055(0xe1)](0x1)||'?',_0x3c678d=(_0x319079[_0x39e055(0x185)]??0x0)>=0x32?a22_0x23b2b0[_0x39e055(0x1a4)]:(_0x319079[_0x39e055(0x185)]??0x0)>=0x14?a22_0x23b2b0[_0x39e055(0x1a2)]:a22_0x23b2b0['red'];_0xe52ada='\x20'+a22_0x23b2b0[_0x39e055(0xca)](_0x39e055(0x1e8))+'\x20'+_0x3c678d(formatRows(_0x319079[_0x39e055(0x181)]))+'\x20('+_0x5f5da7+_0x39e055(0x15e)+a22_0x23b2b0[_0x39e055(0xca)](_0x39e055(0x1c1))+'\x20'+a22_0x23b2b0[_0x39e055(0x1b4)](formatRows(_0x319079[_0x39e055(0x118)]));}console[_0x39e055(0x11d)](_0x53b339+'\x20'+a22_0x23b2b0[_0x39e055(0x162)](_0x319079[_0x39e055(0x171)])+_0xe52ada),console['error']('\x20\x20'+a22_0x23b2b0[_0x39e055(0xca)](_0x39e055(0x158))+'\x20'+a22_0x23b2b0['bold'](_0x319079[_0x39e055(0x1d5)]+'.'+_0x319079[_0x39e055(0x1a1)]));const _0x2a788f=_0x319079[_0x39e055(0xd8)]===_0x319079[_0x39e055(0x131)]?a22_0x23b2b0['dim'](_0x39e055(0x123))+'\x20'+_0x319079[_0x39e055(0xd8)]:a22_0x23b2b0[_0x39e055(0xca)](_0x39e055(0x112))+'\x20'+_0x319079[_0x39e055(0xd8)]+'\x20=\x20'+_0x319079[_0x39e055(0x131)];console['error']('\x20\x20'+_0x2a788f),console[_0x39e055(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x39e055(0xca)](_0x39e055(0x15c))),this[_0x39e055(0x134)](_0x319079[_0x39e055(0x14b)]),!_0x319079['schemaValid']&&console[_0x39e055(0x11d)]('\x20\x20'+a22_0x23b2b0['red'](_0x39e055(0x18f))+'\x20'+_0x319079[_0x39e055(0x1c7)]);}}[a22_0x296be5(0x134)](_0x2e71c3){const _0x41f037=a22_0x296be5;for(const _0x5e8ece of _0x2e71c3){_0x5e8ece['label']===_0x5e8ece[_0x41f037(0x17d)]||_0x5e8ece['column']==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x5e8ece['label']):console[_0x41f037(0x11d)](_0x41f037(0xcf)+_0x5e8ece[_0x41f037(0x175)]+'\x20'+a22_0x23b2b0['dim']('('+_0x5e8ece[_0x41f037(0x17d)]+')'));}}[a22_0x296be5(0x113)](_0x37790d){const _0x38c528=a22_0x296be5;console[_0x38c528(0x11d)]('─'[_0x38c528(0x13a)](0x3c));if(_0x37790d[_0x38c528(0xff)][_0x38c528(0x16b)]>0x0){console[_0x38c528(0x11d)]('\x0a'+a22_0x23b2b0[_0x38c528(0x16c)](_0x38c528(0x1e7)));for(const _0x262ff5 of _0x37790d[_0x38c528(0xff)]){console[_0x38c528(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x38c528(0x16c)]('•')+'\x20'+_0x262ff5);}}_0x37790d[_0x38c528(0x18e)]&&console[_0x38c528(0x11d)]('\x0a'+a22_0x23b2b0['green']('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x296be5(0x104);[a22_0x296be5(0xea)]=a22_0x296be5(0x105);async[a22_0x296be5(0x110)](_0x487fdf){const _0x4ad769=a22_0x296be5,{options:_0x7c4265,args:_0x104285,tdx:_0x3acd10}=_0x487fdf,_0x1eb1b8=_0x7c4265,_0x498290=_0x104285[0x0]||_0x7c4265[_0x4ad769(0x1db)];if(!_0x498290)return showParentSegmentNotSetError(_0x4ad769(0x183)+_0x4ad769(0x150)+'Options\x20(one\x20required):\x0a'+_0x4ad769(0x1ce)+_0x4ad769(0x1b5)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x4ad769(0x1ab)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x1eb1b8[_0x4ad769(0xf5)]&&!_0x1eb1b8['attribute']&&!_0x1eb1b8['behavior']&&!_0x1eb1b8[_0x4ad769(0x106)])return console['error'](a22_0x23b2b0[_0x4ad769(0x16c)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x4ad769(0x11d)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x4ad769(0x11d)](_0x4ad769(0x177)),console[_0x4ad769(0x11d)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x4ad769(0x11d)](_0x4ad769(0x133)),console[_0x4ad769(0x11d)](_0x4ad769(0x1d6)),0x1;const _0x367728=resolveYamlFile(_0x498290);if(!existsSync(_0x367728))return showFileNotFoundError(_0x367728,_0x498290),0x1;_0x1eb1b8[_0x4ad769(0x198)]&&(console[_0x4ad769(0x11d)]('Site:\x20'+_0x1eb1b8[_0x4ad769(0x135)]),console['error'](_0x4ad769(0x1cb)+_0x367728));let _0x27a74e;try{_0x27a74e=readFileSync(_0x367728,_0x4ad769(0x19f));}catch(_0x561e41){const _0x4dbf20=_0x561e41 instanceof Error?_0x561e41[_0x4ad769(0x1c5)]:String(_0x561e41);return console['error'](_0x4ad769(0xf4)+_0x4dbf20),0x1;}let _0x2b217e;try{_0x2b217e=parseDef(_0x27a74e);}catch(_0xf864c5){const _0xf7d7a7=_0xf864c5 instanceof Error?_0xf864c5[_0x4ad769(0x1c5)]:String(_0xf864c5);return console['error'](a22_0x23b2b0[_0x4ad769(0x16c)](_0x4ad769(0x1e4)+_0xf7d7a7)),0x1;}if(_0x1eb1b8['attribute']===!![]||_0x1eb1b8[_0x4ad769(0x174)]===''){const _0x4142e2=_0x2b217e[_0x4ad769(0x1d4)]?.[_0x4ad769(0x176)](_0x438b1c=>_0x438b1c['name'])||[];if(_0x4142e2[_0x4ad769(0x16b)]===0x0)console[_0x4ad769(0x11d)](a22_0x23b2b0['red'](_0x4ad769(0xf6)));else{console[_0x4ad769(0x11d)](a22_0x23b2b0[_0x4ad769(0x16c)](_0x4ad769(0x132))),console[_0x4ad769(0x11d)]('Available\x20attributes:');for(const _0x236fa5 of _0x4142e2){console[_0x4ad769(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x4ad769(0x1b4)](_0x236fa5));}console[_0x4ad769(0x11d)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x498290+_0x4ad769(0x151)+_0x4142e2[0x0]+'\x22');}return 0x1;}if(_0x1eb1b8[_0x4ad769(0xc6)]===!![]||_0x1eb1b8[_0x4ad769(0xc6)]===''){const _0x4a2535=_0x2b217e[_0x4ad769(0xed)]?.[_0x4ad769(0x176)](_0x4c9d7c=>_0x4c9d7c['name'])||[];if(_0x4a2535[_0x4ad769(0x16b)]===0x0)console['error'](a22_0x23b2b0[_0x4ad769(0x16c)](_0x4ad769(0x173)));else{console[_0x4ad769(0x11d)](a22_0x23b2b0[_0x4ad769(0x16c)](_0x4ad769(0x10c))),console[_0x4ad769(0x11d)](_0x4ad769(0x178));for(const _0x46f2fe of _0x4a2535){console[_0x4ad769(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x4ad769(0x1b4)](_0x46f2fe));}console[_0x4ad769(0x11d)](_0x4ad769(0xcb)+_0x498290+_0x4ad769(0x17f)+_0x4a2535[0x0]+'\x22');}return 0x1;}const _0x5e745b=createCommandSpinner(a22_0x23b2b0[_0x4ad769(0xca)](_0x4ad769(0x11a)),{'verbose':_0x1eb1b8[_0x4ad769(0x198)]});_0x5e745b[_0x4ad769(0x145)]();const _0x55325a={'onProgress':_0x110f68=>{const _0x592afa=_0x4ad769;_0x5e745b[_0x592afa(0xd3)]=formatProgressMessage(_0x110f68);}};if(_0x1eb1b8[_0x4ad769(0xf5)])_0x55325a[_0x4ad769(0xf5)]=!![];if(_0x1eb1b8[_0x4ad769(0x174)]&&typeof _0x1eb1b8[_0x4ad769(0x174)]===_0x4ad769(0x1c9))_0x55325a[_0x4ad769(0x174)]=_0x1eb1b8[_0x4ad769(0x174)];if(_0x1eb1b8[_0x4ad769(0xc6)]&&typeof _0x1eb1b8['behavior']==='string')_0x55325a[_0x4ad769(0xc6)]=_0x1eb1b8[_0x4ad769(0xc6)];if(_0x1eb1b8[_0x4ad769(0x106)])_0x55325a[_0x4ad769(0x106)]=!![];if(_0x1eb1b8[_0x4ad769(0xcc)])_0x55325a[_0x4ad769(0xcc)]=_0x1eb1b8['interval'];let _0x5c0991;try{_0x5c0991=await _0x3acd10[_0x4ad769(0x19d)][_0x4ad769(0x17b)](_0x27a74e,_0x55325a),_0x5e745b[_0x4ad769(0x187)]();}catch(_0x36a1ab){_0x5e745b[_0x4ad769(0x187)]();throw _0x36a1ab;}return await this[_0x4ad769(0x138)](_0x5c0991,{'master':_0x1eb1b8['master'],'attribute':typeof _0x1eb1b8[_0x4ad769(0x174)]===_0x4ad769(0x1c9)?_0x1eb1b8[_0x4ad769(0x174)]:undefined,'behavior':typeof _0x1eb1b8[_0x4ad769(0xc6)]===_0x4ad769(0x1c9)?_0x1eb1b8[_0x4ad769(0xc6)]:undefined,'enriched':_0x1eb1b8[_0x4ad769(0x106)]}),_0x5c0991[_0x4ad769(0x18e)]?0x0:0x1;}async[a22_0x296be5(0x138)](_0x4d2f83,_0x1afaf9){const _0x494af3=a22_0x296be5;console[_0x494af3(0x11d)]('\x0a'+a22_0x23b2b0[_0x494af3(0x162)]('Preview:')+'\x20'+_0x4d2f83[_0x494af3(0x171)]),console[_0x494af3(0x11d)]('═'[_0x494af3(0x13a)](0x3c));if(_0x1afaf9[_0x494af3(0xf5)]&&_0x4d2f83['sampleData']){const _0x281e4b=a22_0x23b2b0[_0x494af3(0xca)](_0x494af3(0x1df))+'\x20'+a22_0x23b2b0[_0x494af3(0x162)](_0x4d2f83[_0x494af3(0xf5)]['database']+'.'+_0x4d2f83[_0x494af3(0xf5)]['table']);await this['displaySampleData'](_0x281e4b,_0x4d2f83[_0x494af3(0xd7)]);}else{if(_0x1afaf9['attribute']&&_0x4d2f83[_0x494af3(0xd7)]){const _0x579f46=a22_0x23b2b0[_0x494af3(0xca)]('Attribute:')+'\x20'+a22_0x23b2b0[_0x494af3(0x162)](_0x1afaf9[_0x494af3(0x174)]);await this[_0x494af3(0x13c)](_0x579f46,_0x4d2f83[_0x494af3(0xd7)]);}else{if(_0x1afaf9[_0x494af3(0xc6)]&&_0x4d2f83['sampleData']){const _0x2c1bf1=a22_0x23b2b0[_0x494af3(0xca)](_0x494af3(0xc9))+'\x20'+a22_0x23b2b0['bold'](_0x1afaf9[_0x494af3(0xc6)]);await this[_0x494af3(0x13c)](_0x2c1bf1,_0x4d2f83['sampleData']);}else{if(_0x1afaf9[_0x494af3(0x106)]&&_0x4d2f83[_0x494af3(0xd7)]){const _0x4885f0=a22_0x23b2b0[_0x494af3(0xca)](_0x494af3(0x122))+'\x20'+a22_0x23b2b0['bold']('Master\x20+\x20Attributes');await this[_0x494af3(0x13c)](_0x4885f0,_0x4d2f83[_0x494af3(0xd7)]);}else!_0x4d2f83[_0x494af3(0xd7)]&&console[_0x494af3(0x11d)](_0x494af3(0x164));}}}if(_0x4d2f83[_0x494af3(0xff)]['length']>0x0){console[_0x494af3(0x11d)]('─'['repeat'](0x3c)),console['error']('\x0a'+a22_0x23b2b0[_0x494af3(0x16c)]('Errors:'));for(const _0x5b5b13 of _0x4d2f83[_0x494af3(0xff)]){console['error']('\x20\x20'+a22_0x23b2b0['red']('•')+'\x20'+_0x5b5b13);}}}async['displaySampleData'](_0x1b86cc,_0x509833){const _0x27e627=a22_0x296be5;if(_0x509833[_0x27e627(0x16b)]===0x0){console[_0x27e627(0x11d)]('\x0a'+_0x1b86cc),console['error'](_0x27e627(0x141));return;}console[_0x27e627(0x11d)]('\x0a'+_0x1b86cc);const _0x5e1cf4=Object[_0x27e627(0x16d)](_0x509833[0x0])[_0x27e627(0x176)](_0x2ed541=>({'name':_0x2ed541,'type':typeof _0x509833[0x0][_0x2ed541]===_0x27e627(0x193)?_0x27e627(0x169):_0x27e627(0x13d)})),_0x221520={'queryId':_0x27e627(0xfc),'columns':_0x5e1cf4,'data':_0x509833,'stats':{'state':_0x27e627(0x120),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x509833[_0x27e627(0x16b)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4c667e=formatAsTable(_0x221520,_0x509833[_0x27e627(0x16b)],!![]);await writeOutput(_0x4c667e,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x296be5(0x171)]='segment:parent:run';['description']=a22_0x296be5(0x1cc);async[a22_0x296be5(0x110)](_0x2bc911){const _0x57b511=a22_0x296be5,{options:_0x3d9b00,args:_0x1002a9,tdx:_0x4903d6}=_0x2bc911,_0x575cab=_0x3d9b00,_0x163b6d=_0x1002a9[0x0]||_0x3d9b00[_0x57b511(0x1db)];if(!_0x163b6d)return showParentSegmentNotSetError(_0x57b511(0x172)+_0x57b511(0x1d3)),0x1;const _0x853fc5=resolveYamlFile(_0x163b6d);if(existsSync(_0x853fc5)){_0x575cab[_0x57b511(0x198)]&&console[_0x57b511(0x11d)](_0x57b511(0x1aa)+_0x853fc5);let _0x5544ee;try{_0x5544ee=readFileSync(_0x853fc5,_0x57b511(0x19f));}catch(_0x506056){const _0x15978d=_0x506056 instanceof Error?_0x506056['message']:String(_0x506056);return console[_0x57b511(0x11d)](_0x57b511(0xf4)+_0x15978d),0x1;}const _0xbd081e=await withSpinner(_0x57b511(0x1b8),()=>_0x4903d6[_0x57b511(0x19d)][_0x57b511(0xd5)](_0x5544ee),{'verbose':_0x575cab[_0x57b511(0x198)]}),_0x3d791f=_0xbd081e['data'],{isNew:_0x54ee6c,name:_0x22b599,hasChanges:_0x1b3828,diffFormatted:_0x2821a7}=_0x3d791f;if(_0x1b3828){_0x54ee6c?console[_0x57b511(0x11d)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x22b599+'\x27:'):console[_0x57b511(0x11d)](_0x57b511(0x18c)+_0x22b599+'\x27:');console[_0x57b511(0x11d)]('─'[_0x57b511(0x13a)](0x3c)),console[_0x57b511(0x11d)](_0x2821a7),console[_0x57b511(0x11d)]('─'[_0x57b511(0x13a)](0x3c));const _0x5aa4c9=_0x54ee6c?'Create\x20parent\x20segment\x20\x27'+_0x22b599+_0x57b511(0x140):_0x57b511(0x12e)+_0x22b599+_0x57b511(0x140);if(!_0x575cab[_0x57b511(0x11e)]){const _0x413682=await confirmKey(_0x5aa4c9);if(!_0x413682)return console['error'](_0x57b511(0x1ac)),0x1;}const _0x288f26=_0x54ee6c?_0x57b511(0x1a3):_0x57b511(0x1a0);await withSpinner(_0x288f26+_0x57b511(0x1ae)+_0x22b599+'\x27...',()=>_0x3d791f[_0x57b511(0x137)](),{'verbose':_0x575cab[_0x57b511(0x198)]});const _0x559574=_0x54ee6c?_0x57b511(0xf1):_0x57b511(0x1bb);console[_0x57b511(0x11d)]('✔\x20'+_0x559574+_0x57b511(0x1ae)+_0x22b599+'\x27');}else console[_0x57b511(0x11d)](_0x57b511(0x19c)+_0x22b599+_0x57b511(0x1b7));}const _0x2da0b1=await withSpinner(_0x57b511(0x1a7)+_0x163b6d+'\x27...',()=>_0x4903d6[_0x57b511(0x19d)][_0x57b511(0x1e0)](_0x163b6d),{'verbose':_0x575cab[_0x57b511(0x198)]}),_0x11b8cc=_0x2da0b1[_0x57b511(0x1e9)],_0x3355f6=getConsoleUrl(_0x575cab[_0x57b511(0x135)],_0x57b511(0x190)+_0x11b8cc[_0x57b511(0x15a)]+_0x57b511(0x12f)+_0x11b8cc['workflowSessionId']+_0x57b511(0x1a5)+_0x11b8cc[_0x57b511(0x17e)]);return console[_0x57b511(0x11d)]('\x0a✔\x20Workflow\x20started'),console[_0x57b511(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x57b511(0xca)]('Audience\x20ID:')+'\x20'+_0x11b8cc[_0x57b511(0x14c)]),console[_0x57b511(0x11d)]('\x20\x20'+a22_0x23b2b0['dim']('Status:')+'\x20'+_0x11b8cc[_0x57b511(0x192)]),console[_0x57b511(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x57b511(0xca)]('Session:')+'\x20'+_0x11b8cc['workflowSessionId']),console[_0x57b511(0x11d)]('\x20\x20'+a22_0x23b2b0[_0x57b511(0xca)](_0x57b511(0xd2))+'\x20'+_0x11b8cc['workflowAttemptId']),console[_0x57b511(0x11d)]('\x20\x20'+_0x3355f6),console[_0x57b511(0x11d)]('\x0a'+a22_0x23b2b0['dim'](_0x57b511(0x149))+_0x57b511(0x127)+_0x11b8cc[_0x57b511(0x17e)]+_0x57b511(0x1e5)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0x1cf);[a22_0x296be5(0xea)]=a22_0x296be5(0x191);async[a22_0x296be5(0x110)](_0x4887a7){const _0x5bc7f4=a22_0x296be5,{options:_0x7e4ec1,args:_0x5f16bb,tdx:_0x28eaa4}=_0x4887a7,_0x4156c2=_0x5f16bb[0x0]||_0x7e4ec1[_0x5bc7f4(0x1db)];if(!_0x4156c2)return showParentSegmentNotSetError(_0x5bc7f4(0x199)+_0x5bc7f4(0xec)),0x1;_0x7e4ec1[_0x5bc7f4(0x198)]&&(console[_0x5bc7f4(0x11d)](_0x5bc7f4(0x1d0)+_0x7e4ec1[_0x5bc7f4(0x135)]),console[_0x5bc7f4(0x11d)](_0x5bc7f4(0x1bc)+_0x4156c2));const _0x34f794=await withSpinner(_0x5bc7f4(0x14f)+_0x4156c2+_0x5bc7f4(0xdd),()=>_0x28eaa4[_0x5bc7f4(0x19d)]['listFields'](_0x4156c2),{'verbose':_0x7e4ec1[_0x5bc7f4(0x198)]}),_0x173758=_0x34f794['data'];console['error'](_0x5bc7f4(0x1c4)+_0x173758[_0x5bc7f4(0x16b)]+_0x5bc7f4(0x128)+(_0x173758['length']!==0x1?'s':''));if(_0x7e4ec1[_0x5bc7f4(0x18b)]||_0x7e4ec1[_0x5bc7f4(0xd9)])return await handleSDKOutput(_0x173758,_0x7e4ec1),0x0;return displayFieldsHumanReadable(_0x173758,_0x4156c2),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x296be5(0x171)]='segment:parent:view';[a22_0x296be5(0xea)]=a22_0x296be5(0x102);async['execute'](_0x4a0601){const _0x144cd1=a22_0x296be5,{options:_0x38c647,args:_0x1775c3,tdx:_0x49618f}=_0x4a0601,_0x525403=_0x38c647,_0x26c27a=_0x1775c3[0x0]||_0x38c647[_0x144cd1(0x1db)];if(!_0x26c27a)return showParentSegmentNotSetError(_0x144cd1(0xfd)+_0x144cd1(0x1eb)+_0x144cd1(0xc7)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x38c647[_0x144cd1(0x198)]&&(console[_0x144cd1(0x11d)]('Site:\x20'+_0x38c647['site']),console[_0x144cd1(0x11d)](_0x144cd1(0x1bc)+_0x26c27a));const _0x35f138=await withSpinner(_0x144cd1(0x12c)+_0x26c27a+_0x144cd1(0xdd),()=>_0x49618f[_0x144cd1(0x19d)][_0x144cd1(0x1d8)](_0x26c27a),{'verbose':_0x38c647[_0x144cd1(0x198)]}),_0x426575=_0x35f138['data'];if(_0x525403[_0x144cd1(0x136)]){const _0x4d2cf9=getConsoleNextUrl(_0x525403['site'],_0x144cd1(0x154)+_0x426575['id']);return console[_0x144cd1(0x11d)](a22_0x23b2b0[_0x144cd1(0x1a4)]('✔')+'\x20Opening\x20'+a22_0x23b2b0['cyan'](_0x4d2cf9)),openBrowser(_0x4d2cf9),0x0;}return await handleSingleObjectOutput(_0x426575,_0x38c647),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x296be5(0x171)]='segment:parent:desc';['description']=a22_0x296be5(0xf8);async[a22_0x296be5(0x110)](_0xb57ca2){const _0x2aec24=a22_0x296be5,{options:_0x513189,args:_0x2a4b57,tdx:_0x1e64e4}=_0xb57ca2,_0x3ad5aa=_0x2a4b57[0x0]||_0x513189[_0x2aec24(0x1db)];if(!_0x3ad5aa)return showParentSegmentNotSetError(_0x2aec24(0x139)+_0x2aec24(0x13b)),0x1;_0x513189[_0x2aec24(0x198)]&&(console[_0x2aec24(0x11d)](_0x2aec24(0x1d0)+_0x513189[_0x2aec24(0x135)]),console[_0x2aec24(0x11d)](_0x2aec24(0x1bc)+_0x3ad5aa));const _0x2c5019=await withSpinner(_0x2aec24(0x1d9)+_0x3ad5aa+_0x2aec24(0xdd),()=>_0x1e64e4[_0x2aec24(0x19d)]['resolveParentId'](_0x3ad5aa),{'verbose':_0x513189[_0x2aec24(0x198)]}),_0x276b6b=_0x2c5019[_0x2aec24(0x1e9)],_0x2f5553=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3ad5aa+_0x2aec24(0xdd),()=>_0x1e64e4['segment']['getParentSQL'](_0x276b6b),{'verbose':_0x513189[_0x2aec24(0x198)]}),_0x37ebe2=await executeSchemaQuery(_0x2f5553[_0x2aec24(0x1e9)],_0x1e64e4,_0x513189);return await handleQueryOutput(_0x37ebe2,_0x513189),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0xd1);[a22_0x296be5(0xea)]=a22_0x296be5(0x15b);async[a22_0x296be5(0x110)](_0x1f251c){const _0x38609f=a22_0x296be5,{options:_0x29e6c5,args:_0xe27143,tdx:_0x24f6db}=_0x1f251c,_0x4dc96e=_0xe27143[0x0]||_0x29e6c5[_0x38609f(0x1db)];if(!_0x4dc96e)return showParentSegmentNotSetError(_0x38609f(0xdf)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x29e6c5[_0x38609f(0x198)]&&(console['error'](_0x38609f(0x1d0)+_0x29e6c5[_0x38609f(0x135)]),console[_0x38609f(0x11d)](_0x38609f(0x1bc)+_0x4dc96e));const _0x500b1a=await withSpinner(_0x38609f(0x1d9)+_0x4dc96e+_0x38609f(0xdd),()=>_0x24f6db[_0x38609f(0x19d)][_0x38609f(0x179)](_0x4dc96e),{'verbose':_0x29e6c5[_0x38609f(0x198)]}),_0x2186ed=_0x500b1a[_0x38609f(0x1e9)],_0x55ef02=await withSpinner(_0x38609f(0xd4)+_0x4dc96e+_0x38609f(0xdd),()=>_0x24f6db[_0x38609f(0x19d)][_0x38609f(0x1ad)](_0x2186ed),{'verbose':_0x29e6c5['verbose']}),_0x3564d9=_0x55ef02[_0x38609f(0x1e9)];return _0x29e6c5[_0x38609f(0xe7)]===_0x38609f(0x18b)||_0x29e6c5[_0x38609f(0xe7)]===_0x38609f(0xd9)?await handleSDKOutput([{'sql':_0x3564d9}],_0x29e6c5):console[_0x38609f(0x196)](_0x3564d9),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x296be5(0x171)]=a22_0x296be5(0x119);[a22_0x296be5(0xea)]=a22_0x296be5(0x11b);async[a22_0x296be5(0x110)](_0x544b2c){const _0x429b59=a22_0x296be5,{options:_0x18490c,args:_0x5b48d7,tdx:_0x17e927}=_0x544b2c,_0x1ad420=_0x5b48d7[0x0]||_0x18490c[_0x429b59(0x1db)];if(!_0x1ad420)return showParentSegmentNotSetError(_0x429b59(0x19e)+_0x429b59(0x11c)),0x1;_0x18490c[_0x429b59(0x198)]&&(console[_0x429b59(0x11d)]('Site:\x20'+_0x18490c[_0x429b59(0x135)]),console[_0x429b59(0x11d)](_0x429b59(0x1bc)+_0x1ad420));const _0x267abe=await withSpinner(_0x429b59(0x1d9)+_0x1ad420+_0x429b59(0xdd),()=>_0x17e927[_0x429b59(0x19d)][_0x429b59(0x179)](_0x1ad420),{'verbose':_0x18490c['verbose']}),_0x390f11=_0x267abe[_0x429b59(0x1e9)],_0x5ea11d=await withSpinner(_0x429b59(0xd4)+_0x1ad420+_0x429b59(0xdd),()=>_0x17e927[_0x429b59(0x19d)][_0x429b59(0x1ad)](_0x390f11),{'verbose':_0x18490c['verbose']});let _0x224381=_0x5ea11d[_0x429b59(0x1e9)];const _0x3c9b9a=resolveLimit(_0x18490c[_0x429b59(0x157)],DEFAULT_DISPLAY_LIMIT),_0x59abb8=/\bLIMIT\s+\d+/i[_0x429b59(0x13e)](_0x224381);!_0x59abb8&&(_0x224381=_0x224381[_0x429b59(0x170)]()['replace'](/;+$/,''),_0x224381='SELECT\x20*\x20FROM\x20(\x0a'+_0x224381+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3c9b9a);_0x18490c[_0x429b59(0x198)]&&console['error'](_0x429b59(0x1c0)+_0x224381);const _0x4f8d1f=await withProgressSpinner(_0x429b59(0x126),async _0x1e7962=>{const _0x452977=_0x429b59,_0x5f023a=await _0x17e927[_0x452977(0x16e)][_0x452977(0x110)](_0x224381,{'catalog':'td','schema':_0x452977(0x121),'onJobId':_0x4699a4=>{_0x1e7962['setJobId'](_0x4699a4);}});return _0x5f023a;},{'verbose':_0x18490c[_0x429b59(0x198)]}),_0x1c20c3=_0x4f8d1f[_0x429b59(0x1e9)],_0x1339cf=_0x1c20c3[_0x429b59(0x188)]?_0x429b59(0x184)+_0x1c20c3['jobId']+']':'';return console[_0x429b59(0x11d)](_0x429b59(0x12b)+_0x1c20c3[_0x429b59(0x1de)]['processedRows'][_0x429b59(0xda)]()+_0x429b59(0xfe)+(_0x429b59(0x16a)+formatElapsed(_0x1c20c3['stats'][_0x429b59(0xe3)])+_0x1339cf)),await handleQueryOutput(_0x1c20c3,_0x18490c),0x0;}}
|
|
1
|
+
const a22_0x22549a=a22_0x4ac6;(function(_0x1ccf30,_0x2fb6ad){const _0x31df45=a22_0x4ac6,_0x5a1209=_0x1ccf30();while(!![]){try{const _0x4c91e2=parseInt(_0x31df45(0x260))/0x1*(-parseInt(_0x31df45(0x216))/0x2)+parseInt(_0x31df45(0x286))/0x3+parseInt(_0x31df45(0x177))/0x4+parseInt(_0x31df45(0x28d))/0x5*(parseInt(_0x31df45(0x17f))/0x6)+parseInt(_0x31df45(0x19c))/0x7*(-parseInt(_0x31df45(0x22a))/0x8)+-parseInt(_0x31df45(0x244))/0x9+-parseInt(_0x31df45(0x1d5))/0xa*(-parseInt(_0x31df45(0x1b9))/0xb);if(_0x4c91e2===_0x2fb6ad)break;else _0x5a1209['push'](_0x5a1209['shift']());}catch(_0x66fc84){_0x5a1209['push'](_0x5a1209['shift']());}}}(a22_0x1a89,0x49c7b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x39ae17 from'path';function a22_0x4ac6(_0x2d6db6,_0x5c412c){_0x2d6db6=_0x2d6db6-0x16d;const _0x1a89f1=a22_0x1a89();let _0x4ac6a0=_0x1a89f1[_0x2d6db6];return _0x4ac6a0;}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a22_0x1a89(){const _0x1452f=['Fetching\x20parent\x20segment\x20\x27','coveragePercent','Options\x20(one\x20required):\x0a','\x5c$&','\x20\x20No\x20sample\x20data\x20available','allValid','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','label','Updating','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20parent\x20segment\x20\x27','Master\x20+\x20Attributes','rowCount','cyan','\x20Opening\x20','Events:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','apply','Validating\x20configuration...','schemaError','segment:parent:run','red','.yml','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','13332tjEVgn','unref','customerPercent','information_schema','table','\x20parent\x20segment','\x0a⚠️\x20\x20Both\x20','name','Created','\x20--enriched','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Output\x20file:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','parent_segment','Fetching\x20current\x20configuration\x20for\x20\x27','filter','\x20Configuration\x20is\x20valid','start','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Available\x20attributes:','interval','length','Apply\x20changes\x20to\x20\x27','\x20--behavior\x20\x22<name>\x22','780njoUet','customerGroup','SELECT\x20*\x20FROM\x20(\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Fetching\x20SQL\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','log','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','message','Create\x20parent\x20segment\x20\x27','ignore','preview','Join:','attributesFile','output','enriched','segment:parent:push','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','timezone','description','Error\x20reading\x20file:\x20','/\x20and\x20','Preview:','Enriched:','workflowId','green','Master\x20Table','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','test','verbose','string','bold','behaviorsFile','scheduleType','match','errors','\x20rows\x20','attribute','getParentFull','stop','/\x20directories\x20exist.','\x20--behavior\x20\x22','totalEvents','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Renamed\x20directory\x20to\x20','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','✔\x20Updated\x20parent\x20segment\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','database','Listing\x20parent\x20segments...','Analyzing\x20changes...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerGroupFile','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','addBehaviors','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:validate','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SQL\x20query:\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','keys','parentSegment','displaySampleData','236AGouDd','status','trim','Creating','Rows:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','segment:parent:view','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:','No\x20parent\x20segments\x20match\x20pattern:\x20','Resolving\x20parent\x20segment\x20\x27','scheduleOption','json','Found\x20YAML\x20file:\x20','Show\x20parent\x20segment\x20details','Attributes','\x0a⚠️\x20\x20Migrating:\x20','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','format','customersWithEvents','32QDUbfl','error','\x20is\x20already\x20up\x20to\x20date','schemaValid','master','win32','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','createParent','\x0a✔\x20Workflow\x20started','site','localeCompare','displayPreviewHints','query','To\x20cancel:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','👥\x20','Executing\x20parent\x20segment\x20query...','/sessions/','Updated','getParentSQL','replace','toFixed','\x0aNo\x20sample\x20data\x20available','run','setJobId','YAML\x20file:\x20','4781853Vglxaq','pushParentYaml','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','.yaml','runParent','platform','join','Source:','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Columns:','Master:','using\x20the\x20default\x20path:\x20','Parent\x20segment:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Options:\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','workflowAttemptId','\x20=\x20','Fetching\x20sample\x20data...','Table:\x20','\x27...','Site:\x20','matchedCount','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','1986QUJPnk','utf-8','joinKey','endsWith','\x20--attribute\x20\x22<name>\x22','workflowSessionId','Error:\x20File\x20not\x20found:\x20','Creating\x20parent\x20segment\x20\x27','pullParentYaml','segment','Options:','tdx\x20segment\x20parent\x20preview\x20','yes','List\x20parent\x20segments','execute','-1d','columns','elapsedTimeMillis','displayBehaviorsStats','✘\x20Failed\x20to\x20rename\x20directory:\x20','displayPreviewResults','Errors:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','use','Error:\x20--database\x20and\x20--table\x20are\x20required','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','text','\x20[Job\x20ID:\x20','repeat','addAttributesFile','segment:parent:pull','\x20\x20\x20\x20-\x20','✔\x20Created\x20parent\x20segment\x20\x27','Audience\x20ID:','number','open','No\x20parent\x20segments\x20found','640557nfSNdk','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Overwrite\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','population','validateParentYaml','stats','5KJKegc','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','segment:parent:preview','segment:parent:fields','displayColumns','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','displayValidateResults','displaySummary','all','\x20--attribute\x20\x22','segment:parent:sql','jobId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Join\x20on:','foreignKey','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','2026116tvZkbu','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','updateParent','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','behaviors','attributes','addBehaviorsFile','3098688Tifydk','map','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','jsonl','parent_segments','Aborted.','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:show','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','column','\x0aNew\x20parent\x20segment\x20\x27','in\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','data','Attempt:','resolveParentId','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Attribute:','yellow','FINISHED','behavior','displayAttributesStats','Error\x20parsing\x20YAML:\x20','isDirectory','addAttributes','✔\x20Found\x20','Updating\x20parent\x20segment\x20\x27','460537CbVVHh','/app/dw/parentSegments/','processedRows'];a22_0x1a89=function(){return _0x1452f;};return a22_0x1a89();}import a22_0x36549d from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x22549a(0x183),LEGACY_PARENT_SEGMENT_DIR=a22_0x22549a(0x1c9);function openBrowser(_0x5e351e){const _0x2284d7=a22_0x22549a,_0x57b985=process[_0x2284d7(0x249)],_0x33d1b9=_0x57b985==='darwin'?_0x2284d7(0x284):_0x57b985===_0x2284d7(0x22f)?_0x2284d7(0x1cd):'xdg-open';spawn(_0x33d1b9,[_0x5e351e],{'detached':!![],'stdio':_0x2284d7(0x1df)})[_0x2284d7(0x1ba)]();}function migrateLegacyDirectory(){const _0x5b7820=a22_0x22549a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2f0b07=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2f0b07[_0x5b7820(0x198)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5b7820(0x22b)](a22_0x36549d['yellow'](_0x5b7820(0x1bf)+LEGACY_PARENT_SEGMENT_DIR+_0x5b7820(0x1ea)+PARENT_SEGMENT_DIR+_0x5b7820(0x1fe))),console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x1a8)](_0x5b7820(0x1b8)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x193)](_0x5b7820(0x226)+LEGACY_PARENT_SEGMENT_DIR+_0x5b7820(0x204)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5b7820(0x22b)](a22_0x36549d['green'](_0x5b7820(0x202)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1ad60e){const _0x152ff0=_0x1ad60e instanceof Error?_0x1ad60e['message']:String(_0x1ad60e);return console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x1b5)](_0x5b7820(0x273)+_0x152ff0+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x22549a(0x241)](_0xf77b9b){const _0x1f71be=a22_0x22549a;return migrateLegacyDirectory(),super[_0x1f71be(0x241)](_0xf77b9b);}}function resolveYamlFile(_0x12d1a7){const _0x51f48a=a22_0x22549a;if(_0x12d1a7[_0x51f48a(0x263)]('.yml')||_0x12d1a7['endsWith'](_0x51f48a(0x247)))return _0x12d1a7;return a22_0x39ae17['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x12d1a7)+'.yml');}function formatProgressMessage(_0x2e73b2){const _0x1fafb=a22_0x22549a,_0x3a9f37=_0x2e73b2[_0x1fafb(0x1f8)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3a9f37){const [,_0x541a48,_0x5efb52,_0x2caeb2='']=_0x3a9f37;return a22_0x36549d[_0x1fafb(0x1a8)](_0x541a48+':')+'\x20'+_0x5efb52+a22_0x36549d[_0x1fafb(0x1a8)](_0x2caeb2);}return a22_0x36549d['dim'](_0x2e73b2);}function showFileNotFoundError(_0x10ae29,_0x408bcf){const _0x5574f7=a22_0x22549a;console[_0x5574f7(0x22b)](a22_0x36549d[_0x5574f7(0x1b5)](_0x5574f7(0x266)+_0x10ae29+'\x0a')),console[_0x5574f7(0x22b)](a22_0x36549d[_0x5574f7(0x1ad)](_0x5574f7(0x191)+_0x408bcf+_0x5574f7(0x206)));}function showParentSegmentNotSetError(_0x32ef1a){const _0x4008b2=a22_0x22549a;console[_0x4008b2(0x22b)](a22_0x36549d[_0x4008b2(0x193)](_0x4008b2(0x212))),console[_0x4008b2(0x22b)](_0x32ef1a);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:list';[a22_0x22549a(0x1e8)]=a22_0x22549a(0x26d);async[a22_0x22549a(0x26e)](_0x42dbc6){const _0x3cefaf=a22_0x22549a,{options:_0x509e27,args:_0x17e5db,tdx:_0x5525e9}=_0x42dbc6,_0x484d2e=_0x17e5db[0x0];_0x509e27[_0x3cefaf(0x1f3)]&&(console[_0x3cefaf(0x22b)](_0x3cefaf(0x25d)+_0x509e27['site']),_0x484d2e&&console[_0x3cefaf(0x22b)]('Pattern:\x20'+_0x484d2e));const _0x38481e=await withSpinner(_0x484d2e?_0x3cefaf(0x1c6)+_0x484d2e+_0x3cefaf(0x25c):_0x3cefaf(0x208),()=>_0x5525e9['segment']['listParents'](),{'verbose':_0x509e27[_0x3cefaf(0x1f3)]});let _0x57213e=_0x38481e[_0x3cefaf(0x18e)];if(_0x484d2e){const _0x4cb69f=_0x484d2e[_0x3cefaf(0x23e)](/[.+^${}()|[\]\\]/g,_0x3cefaf(0x1a2))[_0x3cefaf(0x23e)](/\*/g,'.*')[_0x3cefaf(0x23e)](/\?/g,'.'),_0x16e08a=new RegExp('^'+_0x4cb69f+'$','i');_0x57213e=_0x57213e[_0x3cefaf(0x1cb)](_0x9afcb5=>_0x16e08a[_0x3cefaf(0x1f2)](_0x9afcb5[_0x3cefaf(0x17d)]['name']));}_0x57213e['sort']((_0x5be93e,_0x1870f7)=>_0x5be93e[_0x3cefaf(0x17d)]['name'][_0x3cefaf(0x234)](_0x1870f7[_0x3cefaf(0x17d)][_0x3cefaf(0x1c0)])),console[_0x3cefaf(0x22b)]('✔\x20Found\x20'+_0x57213e['length']+_0x3cefaf(0x1be)+(_0x57213e['length']!==0x1?'s':''));if(_0x509e27[_0x3cefaf(0x228)]===_0x3cefaf(0x222)||_0x509e27['format']===_0x3cefaf(0x182))await handleSDKOutput(_0x57213e,_0x509e27);else{if(_0x57213e[_0x3cefaf(0x1d2)]===0x0)_0x484d2e?console[_0x3cefaf(0x1db)](_0x3cefaf(0x21f)+_0x484d2e):console[_0x3cefaf(0x1db)](_0x3cefaf(0x285));else for(const _0x4a5af8 of _0x57213e){const _0x441eb2=_0x4a5af8['attributes'][_0x3cefaf(0x28a)]?a22_0x36549d[_0x3cefaf(0x1a8)]('\x20('+formatRows(_0x4a5af8[_0x3cefaf(0x17d)]['population'])+')'):'';console[_0x3cefaf(0x1db)](_0x3cefaf(0x239)+_0x4a5af8[_0x3cefaf(0x17d)][_0x3cefaf(0x1c0)]+_0x441eb2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:create';[a22_0x22549a(0x1e8)]=a22_0x22549a(0x246);async[a22_0x22549a(0x26e)](_0xa51246){const _0x1eaaf1=a22_0x22549a,{options:_0x1aa350,args:_0x3d3e8b,tdx:_0x2a7d17}=_0xa51246;console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x1c3)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x1eaaf1(0x188));const _0xbb1c15=_0x1aa350;if(_0x3d3e8b[_0x1eaaf1(0x1d2)]===0x0)return console[_0x1eaaf1(0x22b)](a22_0x36549d[_0x1eaaf1(0x1b5)](_0x1eaaf1(0x21d))),console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x289)),0x1;const _0x317063=_0x3d3e8b[0x0];if(!_0xbb1c15['database']||!_0xbb1c15['table'])return console['error'](_0x1eaaf1(0x278)),console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x289)),0x1;_0xbb1c15[_0x1eaaf1(0x1f3)]&&(console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x25d)+_0xbb1c15['site']),console[_0x1eaaf1(0x22b)]('Name:\x20'+_0x317063),console[_0x1eaaf1(0x22b)]('Database:\x20'+_0xbb1c15[_0x1eaaf1(0x207)]),console['error'](_0x1eaaf1(0x25b)+_0xbb1c15['table']));const _0x7d1a2=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x17d)],_0xbb1c15[_0x1eaaf1(0x1e2)]),_0x2c5447=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x17c)],_0xbb1c15[_0x1eaaf1(0x1f6)]),_0x2ad375=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x1d6)],_0xbb1c15[_0x1eaaf1(0x20b)]),_0x33b0e4={'name':_0x317063,'description':_0xbb1c15['description'],'scheduleType':_0xbb1c15[_0x1eaaf1(0x1f7)],'scheduleOption':_0xbb1c15[_0x1eaaf1(0x221)],'timezone':_0xbb1c15[_0x1eaaf1(0x1e7)],'master':{'parentDatabaseName':_0xbb1c15[_0x1eaaf1(0x207)],'parentTableName':_0xbb1c15[_0x1eaaf1(0x1bd)]},'attributes':_0x7d1a2,'behaviors':_0x2c5447,'customerGroup':_0x2ad375},_0x325a8b=await withSpinner(_0x1eaaf1(0x267)+_0x317063+_0x1eaaf1(0x25c),()=>_0x2a7d17[_0x1eaaf1(0x269)][_0x1eaaf1(0x231)](_0x33b0e4),{'verbose':_0x1aa350[_0x1eaaf1(0x1f3)]}),_0x5003eb=_0x325a8b[_0x1eaaf1(0x18e)];return console['error'](_0x1eaaf1(0x281)+_0x5003eb[_0x1eaaf1(0x1c0)]+'\x27\x20with\x20ID:\x20'+_0x5003eb['id']),await handleSDKOutput([_0x5003eb],_0x1aa350),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x22549a(0x26e)](_0x19bc40){const _0x56620e=a22_0x22549a,{options:_0x157914,args:_0xd8eaa2,tdx:_0x1ebfeb}=_0x19bc40;console['error'](_0x56620e(0x173)+_0x56620e(0x18d)+_0x56620e(0x188));const _0x3d141c=_0x157914;if(_0xd8eaa2[_0x56620e(0x1d2)]===0x0)return console[_0x56620e(0x22b)](a22_0x36549d[_0x56620e(0x1b5)](_0x56620e(0x21d))),console[_0x56620e(0x22b)](_0x56620e(0x20e)),0x1;const _0x185e26=_0xd8eaa2[0x0];_0x3d141c[_0x56620e(0x1f3)]&&(console['error'](_0x56620e(0x25d)+_0x3d141c[_0x56620e(0x233)]),console[_0x56620e(0x22b)]('Parent\x20segment:\x20'+_0x185e26));const _0x27e14b=await withSpinner(_0x56620e(0x1ca)+_0x185e26+_0x56620e(0x25c),()=>_0x1ebfeb[_0x56620e(0x269)][_0x56620e(0x1fc)](_0x185e26),{'verbose':_0x3d141c[_0x56620e(0x1f3)]}),_0x35302=_0x27e14b['data'],_0xf2eda6=await loadJSONFromOptions(_0x3d141c[_0x56620e(0x199)],_0x3d141c[_0x56620e(0x27e)]),_0x3a5981=await loadJSONFromOptions(_0x3d141c[_0x56620e(0x20d)],_0x3d141c[_0x56620e(0x17e)]),_0xc42f2c={'name':_0x35302[_0x56620e(0x1c0)],'description':_0x3d141c[_0x56620e(0x1e8)]!==undefined?_0x3d141c['description']:_0x35302[_0x56620e(0x1e8)],'scheduleType':_0x3d141c[_0x56620e(0x1f7)]!==undefined?_0x3d141c['scheduleType']:_0x35302['scheduleType'],'scheduleOption':_0x3d141c[_0x56620e(0x221)]!==undefined?_0x3d141c[_0x56620e(0x221)]:_0x35302['scheduleOption'],'timezone':_0x3d141c['timezone']!==undefined?_0x3d141c[_0x56620e(0x1e7)]:_0x35302[_0x56620e(0x1e7)],'master':_0x35302[_0x56620e(0x22e)],'attributes':_0xf2eda6?[..._0x35302[_0x56620e(0x17d)]||[],..._0xf2eda6]:_0x35302['attributes'],'behaviors':_0x3a5981?[..._0x35302['behaviors']||[],..._0x3a5981]:_0x35302[_0x56620e(0x17c)],'customerGroup':_0x35302[_0x56620e(0x1d6)]},_0xcf0157=await withSpinner(_0x56620e(0x19b)+_0x185e26+_0x56620e(0x25c),()=>_0x1ebfeb[_0x56620e(0x269)][_0x56620e(0x179)](_0x185e26,_0xc42f2c),{'verbose':_0x3d141c[_0x56620e(0x1f3)]}),_0x559faf=_0xcf0157[_0x56620e(0x18e)];return console[_0x56620e(0x22b)](_0x56620e(0x205)+_0x559faf[_0x56620e(0x1c0)]+'\x27'),await handleSDKOutput([_0x559faf],_0x3d141c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x27f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x20c);async[a22_0x22549a(0x26e)](_0x2a99ce){const _0x1dbc1d=a22_0x22549a,{options:_0x427a04,args:_0x216d88,tdx:_0xea5192}=_0x2a99ce,_0x370fbf=_0x427a04,_0x8100d5=_0x216d88[0x0]||_0x427a04[_0x1dbc1d(0x214)];if(!_0x8100d5)return showParentSegmentNotSetError(_0x1dbc1d(0x17b)+_0x1dbc1d(0x257)),0x1;if(_0x370fbf[_0x1dbc1d(0x277)]&&_0x370fbf[_0x1dbc1d(0x1e3)])return console['error'](a22_0x36549d[_0x1dbc1d(0x1b5)](_0x1dbc1d(0x185))),console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x1b0))),console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x24f)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x1dbc1d(0x22b)](a22_0x36549d['cyan'](_0x1dbc1d(0x18c))),0x1;const _0x27a676=_0x370fbf[_0x1dbc1d(0x1e3)]||a22_0x39ae17[_0x1dbc1d(0x24a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x8100d5)+_0x1dbc1d(0x1b6));_0x370fbf[_0x1dbc1d(0x1f3)]&&(console[_0x1dbc1d(0x22b)](_0x1dbc1d(0x25d)+_0x370fbf[_0x1dbc1d(0x233)]),console[_0x1dbc1d(0x22b)]('Parent\x20segment:\x20'+_0x8100d5),console['error'](_0x1dbc1d(0x1c4)+_0x27a676));const _0x5e7e28=await withSpinner(_0x1dbc1d(0x19f)+_0x8100d5+_0x1dbc1d(0x25c),()=>_0xea5192[_0x1dbc1d(0x269)][_0x1dbc1d(0x268)](_0x8100d5),{'verbose':_0x370fbf['verbose']}),_0x10743e=_0x5e7e28[_0x1dbc1d(0x18e)];if(existsSync(_0x27a676)){const _0x172a2a=readFileSync(_0x27a676,_0x1dbc1d(0x261)),_0x4e4a74=generateDiff(_0x172a2a,_0x10743e);if(!hasChanges(_0x4e4a74))console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1ee)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676)+_0x1dbc1d(0x22c));else{console[_0x1dbc1d(0x22b)]('\x0aChanges\x20to\x20\x27'+_0x27a676+'\x27:'),console[_0x1dbc1d(0x22b)]('─'[_0x1dbc1d(0x27d)](0x3c)),console['error'](formatDiffWithColors(_0x4e4a74)),console[_0x1dbc1d(0x22b)]('─'[_0x1dbc1d(0x27d)](0x3c));if(!_0x370fbf[_0x1dbc1d(0x26c)]){const _0x410cfb=await confirmKey(_0x1dbc1d(0x288)+_0x27a676+'\x27?');if(!_0x410cfb)return console[_0x1dbc1d(0x22b)]('Aborted.'),0x1;}writeFileSync(_0x27a676,_0x10743e,_0x1dbc1d(0x261)),console[_0x1dbc1d(0x22b)](a22_0x36549d['green']('✔')+_0x1dbc1d(0x276)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676));}}else{const _0x568d70=a22_0x39ae17['dirname'](_0x27a676);!existsSync(_0x568d70)&&mkdirSync(_0x568d70,{'recursive':!![]}),writeFileSync(_0x27a676,_0x10743e,_0x1dbc1d(0x261)),console['error'](a22_0x36549d[_0x1dbc1d(0x1ee)]('✔')+_0x1dbc1d(0x276)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676));}return saveSessionContext({'parent_segment':_0x8100d5},_0x370fbf['session']),console[_0x1dbc1d(0x22b)](a22_0x36549d['green']('✔')+'\x20Context\x20set:\x20'+a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x1c9))+_0x1dbc1d(0x259)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x8100d5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x1e5);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x21b);async[a22_0x22549a(0x26e)](_0x21d620){const _0x4b0244=a22_0x22549a,{options:_0xc32da2,args:_0x19505f,tdx:_0x5c220b}=_0x21d620,_0x304754=_0xc32da2,_0x323c6f=_0x19505f[0x0]||_0xc32da2[_0x4b0244(0x214)];if(!_0x323c6f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0xaff11b=resolveYamlFile(_0x323c6f);if(!existsSync(_0xaff11b))return showFileNotFoundError(_0xaff11b,_0x323c6f),0x1;_0x304754[_0x4b0244(0x1f3)]&&(console[_0x4b0244(0x22b)](_0x4b0244(0x25d)+_0x304754[_0x4b0244(0x233)]),console[_0x4b0244(0x22b)](_0x4b0244(0x243)+_0xaff11b));let _0x125a97;try{_0x125a97=readFileSync(_0xaff11b,_0x4b0244(0x261));}catch(_0x51b0ff){const _0x5b5da7=_0x51b0ff instanceof Error?_0x51b0ff['message']:String(_0x51b0ff);return console[_0x4b0244(0x22b)](_0x4b0244(0x1e9)+_0x5b5da7),0x1;}const _0xae7ab1=await withSpinner(_0x4b0244(0x209),()=>_0x5c220b['segment']['pushParentYaml'](_0x125a97),{'verbose':_0x304754['verbose']}),_0x5bd03d=_0xae7ab1[_0x4b0244(0x18e)],{isNew:_0x121833,name:_0x362f8e,hasChanges:_0x5bf0d0,diffFormatted:_0x2673a1}=_0x5bd03d;if(!_0x5bf0d0)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x362f8e+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x121833?console[_0x4b0244(0x22b)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x362f8e+'\x27:'):console['error'](_0x4b0244(0x1f1)+_0x362f8e+'\x27:');console[_0x4b0244(0x22b)]('─'[_0x4b0244(0x27d)](0x3c)),console['error'](_0x2673a1),console[_0x4b0244(0x22b)]('─'['repeat'](0x3c));const _0x37a2cf=_0x121833?_0x4b0244(0x1de)+_0x362f8e+'\x27?':_0x4b0244(0x1d3)+_0x362f8e+'\x27?';if(!_0x304754[_0x4b0244(0x26c)]){const _0x1ae600=await confirmKey(_0x37a2cf);if(!_0x1ae600)return console['error'](_0x4b0244(0x184)),0x1;}const _0x1c6056=_0x121833?_0x4b0244(0x219):_0x4b0244(0x1a7),_0x3880b2=await withSpinner(_0x1c6056+_0x4b0244(0x1aa)+_0x362f8e+_0x4b0244(0x25c),()=>_0x5bd03d[_0x4b0244(0x1b1)](),{'verbose':_0x304754[_0x4b0244(0x1f3)]}),_0x3f3721=_0x3880b2[_0x4b0244(0x18e)],_0x3f0840=getConsoleNextUrl(_0x304754[_0x4b0244(0x233)],_0x4b0244(0x19d)+_0x3f3721['id']),_0x5e6717=_0x121833?_0x4b0244(0x1c1):_0x4b0244(0x23c);return console[_0x4b0244(0x22b)]('✔\x20'+_0x5e6717+_0x4b0244(0x1aa)+_0x3f3721[_0x4b0244(0x1c0)]+'\x27'),console['error']('\x20\x20'+_0x3f0840),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x20f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x178);async['execute'](_0x38a5ec){const _0x33079a=a22_0x22549a,{options:_0xff182f,args:_0x13c778,tdx:_0x336610}=_0x38a5ec,_0x3bde6c=_0xff182f,_0x37d794=_0x13c778[0x0]||_0xff182f[_0x33079a(0x214)];if(!_0x37d794)return showParentSegmentNotSetError(_0x33079a(0x255)+_0x33079a(0x1a9)+'Options:\x0a'+_0x33079a(0x287)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x33079a(0x17a)),0x1;const _0x1bedc1=resolveYamlFile(_0x37d794);if(!existsSync(_0x1bedc1))return showFileNotFoundError(_0x1bedc1,_0x37d794),0x1;_0x3bde6c['verbose']&&(console[_0x33079a(0x22b)](_0x33079a(0x25d)+_0x3bde6c[_0x33079a(0x233)]),console[_0x33079a(0x22b)](_0x33079a(0x243)+_0x1bedc1));let _0x5f56cc;try{_0x5f56cc=readFileSync(_0x1bedc1,_0x33079a(0x261));}catch(_0x228200){const _0x54d769=_0x228200 instanceof Error?_0x228200[_0x33079a(0x1dd)]:String(_0x228200);return console[_0x33079a(0x22b)](_0x33079a(0x1e9)+_0x54d769),0x1;}const _0x4a3eaa=createCommandSpinner(a22_0x36549d[_0x33079a(0x1a8)](_0x33079a(0x1b2)),{'verbose':_0x3bde6c[_0x33079a(0x1f3)]});_0x4a3eaa[_0x33079a(0x1cd)]();const _0x40cbe0={'onProgress':_0x35e6d1=>{const _0x359ed8=_0x33079a;_0x4a3eaa[_0x359ed8(0x27b)]=formatProgressMessage(_0x35e6d1);}};if(_0x3bde6c[_0x33079a(0x22e)])_0x40cbe0[_0x33079a(0x22e)]=!![];if(_0x3bde6c[_0x33079a(0x1e4)])_0x40cbe0[_0x33079a(0x1e4)]=!![];_0x3bde6c[_0x33079a(0x1fb)]&&(_0x40cbe0[_0x33079a(0x1fb)]=_0x3bde6c[_0x33079a(0x1fb)]);_0x3bde6c[_0x33079a(0x195)]&&(_0x40cbe0['behavior']=_0x3bde6c[_0x33079a(0x195)]);if(_0x3bde6c[_0x33079a(0x1d1)])_0x40cbe0[_0x33079a(0x1d1)]=_0x3bde6c['interval'];let _0x86e829;try{_0x86e829=await _0x336610[_0x33079a(0x269)][_0x33079a(0x28b)](_0x5f56cc,_0x40cbe0),_0x4a3eaa[_0x33079a(0x1fd)]();}catch(_0x46d833){_0x4a3eaa[_0x33079a(0x1fd)]();throw _0x46d833;}const _0x2eba83=_0x3bde6c[_0x33079a(0x1d1)]||_0x33079a(0x26f);return this['displayValidateResults'](_0x86e829,_0x40cbe0,_0x1bedc1,_0x2eba83),_0x86e829[_0x33079a(0x1a4)]?0x0:0x1;}[a22_0x22549a(0x16d)](_0x1ab728,_0x2abda4,_0xae0bae,_0x2a04cf){const _0x44853c=a22_0x22549a;console['error']('\x0a'+a22_0x36549d[_0x44853c(0x1f5)]('Validate:')+'\x20'+_0x1ab728['name']),console[_0x44853c(0x22b)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x1ab728);if(typeof _0x2abda4[_0x44853c(0x1fb)]===_0x44853c(0x1f4)){this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x1fb),_0x2abda4[_0x44853c(0x1fb)]);return;}if(_0x2abda4['attribute']===!![]){this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,'attributes');return;}if(typeof _0x2abda4['behavior']===_0x44853c(0x1f4)){this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this['displaySummary'](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,'behavior',_0x2abda4[_0x44853c(0x195)]);return;}if(_0x2abda4['behavior']===!![]){this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x17c));return;}this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x16f));}[a22_0x22549a(0x235)](_0x329a78,_0x43a725,_0x512bba,_0x5037a2){const _0x43fcbd=a22_0x22549a;console[_0x43fcbd(0x22b)]('\x0a'+a22_0x36549d[_0x43fcbd(0x1a8)]('To\x20view\x20sample\x20data:'));const _0x1d1b6a=_0x43a725!=='-1d'?'\x20--interval\x20'+_0x43a725:'';if(_0x512bba==='attribute'&&_0x5037a2)console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d['dim'](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x170)+_0x5037a2+'\x22'+_0x1d1b6a));else{if(_0x512bba==='behavior'&&_0x5037a2)console['error']('\x20\x20'+a22_0x36549d['dim'](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x1ff)+_0x5037a2+'\x22'+_0x1d1b6a));else(_0x512bba===_0x43fcbd(0x17d)||_0x512bba===_0x43fcbd(0x16f))&&console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x264)+_0x1d1b6a));}(_0x512bba===_0x43fcbd(0x17c)||_0x512bba===_0x43fcbd(0x16f))&&console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)]('tdx\x20segment\x20parent\x20preview\x20'+_0x329a78+_0x43fcbd(0x1d4)+_0x1d1b6a)),_0x512bba===_0x43fcbd(0x16f)&&console['error']('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)]('tdx\x20segment\x20parent\x20preview\x20'+_0x329a78+_0x43fcbd(0x1c2)+_0x1d1b6a));}['displayMasterInfo'](_0x755bb2){const _0xda9fe6=a22_0x22549a,{master:_0x51c4ce}=_0x755bb2,_0x199bfe=_0x51c4ce[_0xda9fe6(0x22d)]?a22_0x36549d[_0xda9fe6(0x1ee)]('✔'):a22_0x36549d[_0xda9fe6(0x1b5)]('✘');console['error']('\x0a'+a22_0x36549d[_0xda9fe6(0x1a8)](_0xda9fe6(0x1ef))),console[_0xda9fe6(0x22b)](_0x199bfe+'\x20'+a22_0x36549d[_0xda9fe6(0x1f5)](_0x51c4ce[_0xda9fe6(0x207)]+'.'+_0x51c4ce['table'])),_0x51c4ce['schemaValid']?_0x51c4ce[_0xda9fe6(0x1ac)]!==undefined&&console[_0xda9fe6(0x22b)]('\x20\x20'+a22_0x36549d[_0xda9fe6(0x1a8)](_0xda9fe6(0x21a))+'\x20'+a22_0x36549d[_0xda9fe6(0x1ad)](formatRows(_0x51c4ce[_0xda9fe6(0x1ac)]))):console[_0xda9fe6(0x22b)]('\x20\x20'+a22_0x36549d[_0xda9fe6(0x1b5)](_0xda9fe6(0x21e))+'\x20'+_0x51c4ce[_0xda9fe6(0x1b3)]);}[a22_0x22549a(0x196)](_0x152dcc){const _0x5372e1=a22_0x22549a;if(_0x152dcc['attributes'][_0x5372e1(0x1d2)]===0x0)return;console['error']('\x0a'+a22_0x36549d['dim'](_0x5372e1(0x225)));for(const _0x29586f of _0x152dcc[_0x5372e1(0x17d)]){const _0x5e3892=_0x29586f['schemaValid']?a22_0x36549d['green']('✔'):a22_0x36549d['red']('✘');let _0x5853ef='';if(_0x29586f['schemaValid']&&_0x29586f['matchedCount']!==undefined&&_0x29586f[_0x5372e1(0x1a0)]!==undefined){const _0x19eaf3=_0x29586f[_0x5372e1(0x1a0)][_0x5372e1(0x23f)](0x1),_0x23fe4c=_0x29586f[_0x5372e1(0x1a0)]>=0x50?a22_0x36549d['green']:_0x29586f[_0x5372e1(0x1a0)]>=0x32?a22_0x36549d[_0x5372e1(0x193)]:a22_0x36549d['red'];_0x5853ef='\x20'+a22_0x36549d[_0x5372e1(0x1a8)]('Coverage:')+'\x20'+_0x23fe4c(_0x19eaf3+'%')+'\x20('+formatRows(_0x29586f[_0x5372e1(0x25e)])+'\x20rows)';}console['error'](_0x5e3892+'\x20'+a22_0x36549d[_0x5372e1(0x1f5)](_0x29586f[_0x5372e1(0x1c0)])+_0x5853ef),console[_0x5372e1(0x22b)]('\x20\x20'+a22_0x36549d[_0x5372e1(0x1a8)]('Source:')+'\x20'+a22_0x36549d[_0x5372e1(0x1f5)](_0x29586f[_0x5372e1(0x207)]+'.'+_0x29586f['table']));const _0x45f4f6=_0x29586f['joinKey']===_0x29586f[_0x5372e1(0x175)]?a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x174))+'\x20'+_0x29586f[_0x5372e1(0x262)]:a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x1e1))+'\x20'+_0x29586f['joinKey']+_0x5372e1(0x259)+_0x29586f[_0x5372e1(0x175)];console['error']('\x20\x20'+_0x45f4f6),console[_0x5372e1(0x22b)]('\x20\x20'+a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x24d))),this['displayColumns'](_0x29586f[_0x5372e1(0x270)]),!_0x29586f[_0x5372e1(0x22d)]&&console['error']('\x20\x20'+a22_0x36549d[_0x5372e1(0x1b5)](_0x5372e1(0x21e))+'\x20'+_0x29586f['schemaError']);}}[a22_0x22549a(0x272)](_0x4b9ebc,_0x2a3f21){const _0x5cd7f0=a22_0x22549a;if(_0x4b9ebc['behaviors'][_0x5cd7f0(0x1d2)]===0x0)return;console[_0x5cd7f0(0x22b)]('\x0a'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x256))+'\x20'+a22_0x36549d['dim']('('+_0x2a3f21+')'));for(const _0x3c0938 of _0x4b9ebc[_0x5cd7f0(0x17c)]){const _0x4ef817=_0x3c0938[_0x5cd7f0(0x22d)]?a22_0x36549d['green']('✔'):a22_0x36549d[_0x5cd7f0(0x1b5)]('✘');let _0x27ee7b='';if(_0x3c0938['schemaValid']&&_0x3c0938[_0x5cd7f0(0x229)]!==undefined&&_0x3c0938[_0x5cd7f0(0x200)]!==undefined){const _0x42ceaa=_0x3c0938[_0x5cd7f0(0x1bb)]?.[_0x5cd7f0(0x23f)](0x1)||'?',_0x593fe3=(_0x3c0938[_0x5cd7f0(0x1bb)]??0x0)>=0x32?a22_0x36549d['green']:(_0x3c0938['customerPercent']??0x0)>=0x14?a22_0x36549d[_0x5cd7f0(0x193)]:a22_0x36549d['red'];_0x27ee7b='\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)]('Customers:')+'\x20'+_0x593fe3(formatRows(_0x3c0938[_0x5cd7f0(0x229)]))+'\x20('+_0x42ceaa+'%)\x20'+a22_0x36549d['dim'](_0x5cd7f0(0x1af))+'\x20'+a22_0x36549d['cyan'](formatRows(_0x3c0938[_0x5cd7f0(0x200)]));}console[_0x5cd7f0(0x22b)](_0x4ef817+'\x20'+a22_0x36549d[_0x5cd7f0(0x1f5)](_0x3c0938[_0x5cd7f0(0x1c0)])+_0x27ee7b),console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x24b))+'\x20'+a22_0x36549d[_0x5cd7f0(0x1f5)](_0x3c0938['database']+'.'+_0x3c0938[_0x5cd7f0(0x1bd)]));const _0x5765d7=_0x3c0938[_0x5cd7f0(0x262)]===_0x3c0938[_0x5cd7f0(0x175)]?a22_0x36549d['dim']('Join\x20on:')+'\x20'+_0x3c0938[_0x5cd7f0(0x262)]:a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x1e1))+'\x20'+_0x3c0938['joinKey']+_0x5cd7f0(0x259)+_0x3c0938['foreignKey'];console[_0x5cd7f0(0x22b)]('\x20\x20'+_0x5765d7),console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x24d))),this[_0x5cd7f0(0x291)](_0x3c0938[_0x5cd7f0(0x270)]),!_0x3c0938[_0x5cd7f0(0x22d)]&&console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d['red'](_0x5cd7f0(0x21e))+'\x20'+_0x3c0938[_0x5cd7f0(0x1b3)]);}}['displayColumns'](_0x3270f4){const _0x7e99d0=a22_0x22549a;for(const _0x4f24eb of _0x3270f4){_0x4f24eb[_0x7e99d0(0x1a6)]===_0x4f24eb[_0x7e99d0(0x189)]||_0x4f24eb[_0x7e99d0(0x189)]==='*'?console[_0x7e99d0(0x22b)](_0x7e99d0(0x280)+_0x4f24eb['label']):console['error'](_0x7e99d0(0x280)+_0x4f24eb[_0x7e99d0(0x1a6)]+'\x20'+a22_0x36549d['dim']('('+_0x4f24eb['column']+')'));}}[a22_0x22549a(0x16e)](_0x5e71bc){const _0x437301=a22_0x22549a;console['error']('─'[_0x437301(0x27d)](0x3c));if(_0x5e71bc[_0x437301(0x1f9)][_0x437301(0x1d2)]>0x0){console['error']('\x0a'+a22_0x36549d[_0x437301(0x1b5)](_0x437301(0x275)));for(const _0x369bcf of _0x5e71bc[_0x437301(0x1f9)]){console[_0x437301(0x22b)]('\x20\x20'+a22_0x36549d[_0x437301(0x1b5)]('•')+'\x20'+_0x369bcf);}}_0x5e71bc[_0x437301(0x1a4)]&&console[_0x437301(0x22b)]('\x0a'+a22_0x36549d[_0x437301(0x1ee)]('✔')+_0x437301(0x1cc));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x28f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x201);async['execute'](_0x418709){const _0x2beb3f=a22_0x22549a,{options:_0x24ee03,args:_0x3196cc,tdx:_0x275b71}=_0x418709,_0x303e12=_0x24ee03,_0xed1d=_0x3196cc[0x0]||_0x24ee03['parentSegment'];if(!_0xed1d)return showParentSegmentNotSetError(_0x2beb3f(0x254)+_0x2beb3f(0x1cf)+_0x2beb3f(0x1a1)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x2beb3f(0x252)+_0x2beb3f(0x1da)+_0x2beb3f(0x251)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x303e12['master']&&!_0x303e12[_0x2beb3f(0x1fb)]&&!_0x303e12[_0x2beb3f(0x195)]&&!_0x303e12[_0x2beb3f(0x1e4)])return console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x210))),console[_0x2beb3f(0x22b)](_0x2beb3f(0x24c)),console['error'](_0x2beb3f(0x26a)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x1a5)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x176)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x20a)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x181)),0x1;const _0x5345db=resolveYamlFile(_0xed1d);if(!existsSync(_0x5345db))return showFileNotFoundError(_0x5345db,_0xed1d),0x1;_0x303e12['verbose']&&(console[_0x2beb3f(0x22b)](_0x2beb3f(0x25d)+_0x303e12[_0x2beb3f(0x233)]),console[_0x2beb3f(0x22b)](_0x2beb3f(0x243)+_0x5345db));let _0x53c47c;try{_0x53c47c=readFileSync(_0x5345db,_0x2beb3f(0x261));}catch(_0x4e6824){const _0x4956fc=_0x4e6824 instanceof Error?_0x4e6824[_0x2beb3f(0x1dd)]:String(_0x4e6824);return console[_0x2beb3f(0x22b)](_0x2beb3f(0x1e9)+_0x4956fc),0x1;}let _0x34b01f;try{_0x34b01f=parseDef(_0x53c47c);}catch(_0x2ca39d){const _0x3ccbc7=_0x2ca39d instanceof Error?_0x2ca39d[_0x2beb3f(0x1dd)]:String(_0x2ca39d);return console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x197)+_0x3ccbc7)),0x1;}if(_0x303e12[_0x2beb3f(0x1fb)]===!![]||_0x303e12[_0x2beb3f(0x1fb)]===''){const _0x358418=_0x34b01f['attributes']?.[_0x2beb3f(0x180)](_0x573b79=>_0x573b79[_0x2beb3f(0x1c0)])||[];if(_0x358418[_0x2beb3f(0x1d2)]===0x0)console[_0x2beb3f(0x22b)](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x1c8)));else{console[_0x2beb3f(0x22b)](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x238))),console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d0));for(const _0x10055e of _0x358418){console['error']('\x20\x20'+a22_0x36549d[_0x2beb3f(0x1ad)](_0x10055e));}console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d8)+_0xed1d+_0x2beb3f(0x170)+_0x358418[0x0]+'\x22');}return 0x1;}if(_0x303e12[_0x2beb3f(0x195)]===!![]||_0x303e12[_0x2beb3f(0x195)]===''){const _0x238726=_0x34b01f[_0x2beb3f(0x17c)]?.[_0x2beb3f(0x180)](_0x2fa245=>_0x2fa245[_0x2beb3f(0x1c0)])||[];if(_0x238726[_0x2beb3f(0x1d2)]===0x0)console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x186)));else{console[_0x2beb3f(0x22b)](a22_0x36549d['red']('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x2beb3f(0x22b)]('Available\x20behaviors:');for(const _0x41b6fe of _0x238726){console[_0x2beb3f(0x22b)]('\x20\x20'+a22_0x36549d[_0x2beb3f(0x1ad)](_0x41b6fe));}console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d8)+_0xed1d+_0x2beb3f(0x1ff)+_0x238726[0x0]+'\x22');}return 0x1;}const _0x265664=createCommandSpinner(a22_0x36549d[_0x2beb3f(0x1a8)](_0x2beb3f(0x25a)),{'verbose':_0x303e12[_0x2beb3f(0x1f3)]});_0x265664[_0x2beb3f(0x1cd)]();const _0x459c80={'onProgress':_0x44f70b=>{const _0x4e93d2=_0x2beb3f;_0x265664[_0x4e93d2(0x27b)]=formatProgressMessage(_0x44f70b);}};if(_0x303e12[_0x2beb3f(0x22e)])_0x459c80[_0x2beb3f(0x22e)]=!![];if(_0x303e12['attribute']&&typeof _0x303e12[_0x2beb3f(0x1fb)]===_0x2beb3f(0x1f4))_0x459c80[_0x2beb3f(0x1fb)]=_0x303e12['attribute'];if(_0x303e12[_0x2beb3f(0x195)]&&typeof _0x303e12[_0x2beb3f(0x195)]===_0x2beb3f(0x1f4))_0x459c80[_0x2beb3f(0x195)]=_0x303e12[_0x2beb3f(0x195)];if(_0x303e12['enriched'])_0x459c80[_0x2beb3f(0x1e4)]=!![];if(_0x303e12['interval'])_0x459c80[_0x2beb3f(0x1d1)]=_0x303e12[_0x2beb3f(0x1d1)];let _0x1129f8;try{_0x1129f8=await _0x275b71[_0x2beb3f(0x269)]['previewParentYaml'](_0x53c47c,_0x459c80),_0x265664['stop']();}catch(_0x117b2a){_0x265664[_0x2beb3f(0x1fd)]();throw _0x117b2a;}return await this[_0x2beb3f(0x274)](_0x1129f8,{'master':_0x303e12[_0x2beb3f(0x22e)],'attribute':typeof _0x303e12['attribute']===_0x2beb3f(0x1f4)?_0x303e12[_0x2beb3f(0x1fb)]:undefined,'behavior':typeof _0x303e12[_0x2beb3f(0x195)]===_0x2beb3f(0x1f4)?_0x303e12['behavior']:undefined,'enriched':_0x303e12[_0x2beb3f(0x1e4)]}),_0x1129f8[_0x2beb3f(0x1a4)]?0x0:0x1;}async[a22_0x22549a(0x274)](_0x20ecab,_0x25c951){const _0x33d778=a22_0x22549a;console[_0x33d778(0x22b)]('\x0a'+a22_0x36549d[_0x33d778(0x1f5)](_0x33d778(0x1eb))+'\x20'+_0x20ecab[_0x33d778(0x1c0)]),console['error']('═'['repeat'](0x3c));if(_0x25c951[_0x33d778(0x22e)]&&_0x20ecab['sampleData']){const _0xbb4265=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x24e))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x20ecab['master'][_0x33d778(0x207)]+'.'+_0x20ecab[_0x33d778(0x22e)]['table']);await this[_0x33d778(0x215)](_0xbb4265,_0x20ecab[_0x33d778(0x1ce)]);}else{if(_0x25c951['attribute']&&_0x20ecab[_0x33d778(0x1ce)]){const _0x592f13=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x192))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x25c951['attribute']);await this['displaySampleData'](_0x592f13,_0x20ecab[_0x33d778(0x1ce)]);}else{if(_0x25c951['behavior']&&_0x20ecab[_0x33d778(0x1ce)]){const _0x4eff90=a22_0x36549d[_0x33d778(0x1a8)]('Behavior:')+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x25c951[_0x33d778(0x195)]);await this['displaySampleData'](_0x4eff90,_0x20ecab['sampleData']);}else{if(_0x25c951[_0x33d778(0x1e4)]&&_0x20ecab[_0x33d778(0x1ce)]){const _0x230572=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x1ec))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x33d778(0x1ab));await this[_0x33d778(0x215)](_0x230572,_0x20ecab['sampleData']);}else!_0x20ecab[_0x33d778(0x1ce)]&&console[_0x33d778(0x22b)](_0x33d778(0x240));}}}if(_0x20ecab[_0x33d778(0x1f9)][_0x33d778(0x1d2)]>0x0){console['error']('─'[_0x33d778(0x27d)](0x3c)),console[_0x33d778(0x22b)]('\x0a'+a22_0x36549d[_0x33d778(0x1b5)](_0x33d778(0x275)));for(const _0x3c52ef of _0x20ecab[_0x33d778(0x1f9)]){console[_0x33d778(0x22b)]('\x20\x20'+a22_0x36549d['red']('•')+'\x20'+_0x3c52ef);}}}async[a22_0x22549a(0x215)](_0x48ed8e,_0x326604){const _0x243639=a22_0x22549a;if(_0x326604[_0x243639(0x1d2)]===0x0){console['error']('\x0a'+_0x48ed8e),console[_0x243639(0x22b)](_0x243639(0x1a3));return;}console[_0x243639(0x22b)]('\x0a'+_0x48ed8e);const _0x397fb4=Object[_0x243639(0x213)](_0x326604[0x0])[_0x243639(0x180)](_0x1f0134=>({'name':_0x1f0134,'type':typeof _0x326604[0x0][_0x1f0134]===_0x243639(0x283)?'double':'varchar'})),_0xf385ea={'queryId':_0x243639(0x1e0),'columns':_0x397fb4,'data':_0x326604,'stats':{'state':_0x243639(0x194),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x326604[_0x243639(0x1d2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xffaa09=formatAsTable(_0xf385ea,_0x326604[_0x243639(0x1d2)],!![]);await writeOutput(_0xffaa09,undefined,_0x243639(0x1bd));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x1b4);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x230);async[a22_0x22549a(0x26e)](_0x2afa5f){const _0x187b7d=a22_0x22549a,{options:_0x5d77c0,args:_0x198a1e,tdx:_0x679a8b}=_0x2afa5f,_0x3b65f2=_0x5d77c0,_0x2014e6=_0x198a1e[0x0]||_0x5d77c0['parentSegment'];if(!_0x2014e6)return showParentSegmentNotSetError(_0x187b7d(0x28e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1f0f86=resolveYamlFile(_0x2014e6);if(existsSync(_0x1f0f86)){_0x3b65f2['verbose']&&console[_0x187b7d(0x22b)](_0x187b7d(0x223)+_0x1f0f86);let _0x26c2df;try{_0x26c2df=readFileSync(_0x1f0f86,_0x187b7d(0x261));}catch(_0x207217){const _0x11ec70=_0x207217 instanceof Error?_0x207217[_0x187b7d(0x1dd)]:String(_0x207217);return console[_0x187b7d(0x22b)](_0x187b7d(0x1e9)+_0x11ec70),0x1;}const _0x5f3271=await withSpinner(_0x187b7d(0x209),()=>_0x679a8b[_0x187b7d(0x269)][_0x187b7d(0x245)](_0x26c2df),{'verbose':_0x3b65f2[_0x187b7d(0x1f3)]}),_0x5cd73d=_0x5f3271[_0x187b7d(0x18e)],{isNew:_0x400115,name:_0x1cf6bf,hasChanges:_0x35158b,diffFormatted:_0x835fe9}=_0x5cd73d;if(_0x35158b){_0x400115?console[_0x187b7d(0x22b)](_0x187b7d(0x18a)+_0x1cf6bf+'\x27:'):console[_0x187b7d(0x22b)](_0x187b7d(0x1f1)+_0x1cf6bf+'\x27:');console[_0x187b7d(0x22b)]('─'[_0x187b7d(0x27d)](0x3c)),console[_0x187b7d(0x22b)](_0x835fe9),console[_0x187b7d(0x22b)]('─'[_0x187b7d(0x27d)](0x3c));const _0x572b5c=_0x400115?_0x187b7d(0x1de)+_0x1cf6bf+_0x187b7d(0x279):_0x187b7d(0x1d3)+_0x1cf6bf+'\x27\x20and\x20run\x20workflow?';if(!_0x3b65f2['yes']){const _0xb3efb4=await confirmKey(_0x572b5c);if(!_0xb3efb4)return console[_0x187b7d(0x22b)](_0x187b7d(0x184)),0x1;}const _0x22161b=_0x400115?_0x187b7d(0x219):_0x187b7d(0x1a7);await withSpinner(_0x22161b+'\x20parent\x20segment\x20\x27'+_0x1cf6bf+_0x187b7d(0x25c),()=>_0x5cd73d[_0x187b7d(0x1b1)](),{'verbose':_0x3b65f2['verbose']});const _0x2c2c28=_0x400115?_0x187b7d(0x1c1):'Updated';console[_0x187b7d(0x22b)]('✔\x20'+_0x2c2c28+_0x187b7d(0x1aa)+_0x1cf6bf+'\x27');}else console[_0x187b7d(0x22b)]('✔\x20No\x20changes\x20-\x20\x27'+_0x1cf6bf+_0x187b7d(0x203));}const _0x3388dd=await withSpinner(_0x187b7d(0x1e6)+_0x2014e6+_0x187b7d(0x25c),()=>_0x679a8b[_0x187b7d(0x269)][_0x187b7d(0x248)](_0x2014e6),{'verbose':_0x3b65f2[_0x187b7d(0x1f3)]}),_0x5bf543=_0x3388dd[_0x187b7d(0x18e)],_0x3142a8=getConsoleUrl(_0x3b65f2['site'],'/app/workflows/'+_0x5bf543[_0x187b7d(0x1ed)]+_0x187b7d(0x23b)+_0x5bf543[_0x187b7d(0x265)]+'/attempt/'+_0x5bf543[_0x187b7d(0x258)]);return console[_0x187b7d(0x22b)](_0x187b7d(0x232)),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x282))+'\x20'+_0x5bf543['audienceId']),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)]('Status:')+'\x20'+_0x5bf543[_0x187b7d(0x217)]),console['error']('\x20\x20'+a22_0x36549d['dim']('Session:')+'\x20'+_0x5bf543['workflowSessionId']),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x18f))+'\x20'+_0x5bf543[_0x187b7d(0x258)]),console[_0x187b7d(0x22b)]('\x20\x20'+_0x3142a8),console['error']('\x0a'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x237))+'\x20tdx\x20wf\x20attempt\x20'+_0x5bf543[_0x187b7d(0x258)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a22_0x22549a(0x290);[a22_0x22549a(0x1e8)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3153b1){const _0x1aa66c=a22_0x22549a,{options:_0x595b71,args:_0x21bc30,tdx:_0x54a2c7}=_0x3153b1,_0x238696=_0x21bc30[0x0]||_0x595b71[_0x1aa66c(0x214)];if(!_0x238696)return showParentSegmentNotSetError(_0x1aa66c(0x1dc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x595b71[_0x1aa66c(0x1f3)]&&(console[_0x1aa66c(0x22b)](_0x1aa66c(0x25d)+_0x595b71[_0x1aa66c(0x233)]),console[_0x1aa66c(0x22b)](_0x1aa66c(0x250)+_0x238696));const _0x5ad826=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x238696+_0x1aa66c(0x25c),()=>_0x54a2c7['segment']['listFields'](_0x238696),{'verbose':_0x595b71[_0x1aa66c(0x1f3)]}),_0x44329d=_0x5ad826[_0x1aa66c(0x18e)];console['error'](_0x1aa66c(0x19a)+_0x44329d['length']+'\x20field'+(_0x44329d[_0x1aa66c(0x1d2)]!==0x1?'s':''));if(_0x595b71['json']||_0x595b71[_0x1aa66c(0x182)])return await handleSDKOutput(_0x44329d,_0x595b71),0x0;return displayFieldsHumanReadable(_0x44329d,_0x238696),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x21c);['description']=a22_0x22549a(0x224);async['execute'](_0xb88716){const _0x54b143=a22_0x22549a,{options:_0x55ca45,args:_0x7c16c2,tdx:_0x319255}=_0xb88716,_0x2badc6=_0x55ca45,_0x2833ab=_0x7c16c2[0x0]||_0x55ca45['parentSegment'];if(!_0x2833ab)return showParentSegmentNotSetError(_0x54b143(0x1b7)+_0x54b143(0x292)+_0x54b143(0x253)+_0x54b143(0x1c7)),0x1;_0x55ca45['verbose']&&(console[_0x54b143(0x22b)](_0x54b143(0x25d)+_0x55ca45[_0x54b143(0x233)]),console[_0x54b143(0x22b)]('Parent\x20segment:\x20'+_0x2833ab));const _0x5063df=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2833ab+'\x27...',()=>_0x319255[_0x54b143(0x269)][_0x54b143(0x1fc)](_0x2833ab),{'verbose':_0x55ca45[_0x54b143(0x1f3)]}),_0x4135d0=_0x5063df['data'];if(_0x2badc6['web']){const _0xb167d8=getConsoleNextUrl(_0x2badc6[_0x54b143(0x233)],_0x54b143(0x19d)+_0x4135d0['id']);return console[_0x54b143(0x22b)](a22_0x36549d[_0x54b143(0x1ee)]('✔')+_0x54b143(0x1ae)+a22_0x36549d[_0x54b143(0x1ad)](_0xb167d8)),openBrowser(_0xb167d8),0x0;}return await handleSingleObjectOutput(_0x4135d0,_0x55ca45),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:desc';['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a22_0x22549a(0x26e)](_0x13a383){const _0x24f498=a22_0x22549a,{options:_0x2eee80,args:_0x1aeef9,tdx:_0x4d63f4}=_0x13a383,_0x918e7f=_0x1aeef9[0x0]||_0x2eee80[_0x24f498(0x214)];if(!_0x918e7f)return showParentSegmentNotSetError(_0x24f498(0x227)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x2eee80[_0x24f498(0x1f3)]&&(console[_0x24f498(0x22b)]('Site:\x20'+_0x2eee80[_0x24f498(0x233)]),console[_0x24f498(0x22b)]('Parent\x20segment:\x20'+_0x918e7f));const _0x3062ba=await withSpinner(_0x24f498(0x220)+_0x918e7f+_0x24f498(0x25c),()=>_0x4d63f4[_0x24f498(0x269)][_0x24f498(0x190)](_0x918e7f),{'verbose':_0x2eee80[_0x24f498(0x1f3)]}),_0x39df5e=_0x3062ba[_0x24f498(0x18e)],_0x536983=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x918e7f+'\x27...',()=>_0x4d63f4[_0x24f498(0x269)][_0x24f498(0x23d)](_0x39df5e),{'verbose':_0x2eee80[_0x24f498(0x1f3)]}),_0x43793b=await executeSchemaQuery(_0x536983[_0x24f498(0x18e)],_0x4d63f4,_0x2eee80);return await handleQueryOutput(_0x43793b,_0x2eee80),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a22_0x22549a(0x171);[a22_0x22549a(0x1e8)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a22_0x22549a(0x26e)](_0x3e45a3){const _0xe40650=a22_0x22549a,{options:_0x5056ab,args:_0x26f8d4,tdx:_0x9f3e2d}=_0x3e45a3,_0x6a5fa1=_0x26f8d4[0x0]||_0x5056ab['parentSegment'];if(!_0x6a5fa1)return showParentSegmentNotSetError(_0xe40650(0x1f0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x5056ab[_0xe40650(0x1f3)]&&(console[_0xe40650(0x22b)](_0xe40650(0x25d)+_0x5056ab[_0xe40650(0x233)]),console[_0xe40650(0x22b)](_0xe40650(0x250)+_0x6a5fa1));const _0x35f904=await withSpinner(_0xe40650(0x220)+_0x6a5fa1+'\x27...',()=>_0x9f3e2d[_0xe40650(0x269)][_0xe40650(0x190)](_0x6a5fa1),{'verbose':_0x5056ab[_0xe40650(0x1f3)]}),_0x4c8b8d=_0x35f904[_0xe40650(0x18e)],_0x1b4042=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x6a5fa1+_0xe40650(0x25c),()=>_0x9f3e2d[_0xe40650(0x269)][_0xe40650(0x23d)](_0x4c8b8d),{'verbose':_0x5056ab[_0xe40650(0x1f3)]}),_0x458808=_0x1b4042[_0xe40650(0x18e)];return _0x5056ab[_0xe40650(0x228)]===_0xe40650(0x222)||_0x5056ab['format']==='jsonl'?await handleSDKOutput([{'sql':_0x458808}],_0x5056ab):console[_0xe40650(0x1db)](_0x458808),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x187);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x25f);async[a22_0x22549a(0x26e)](_0x5a6b8c){const _0x418de3=a22_0x22549a,{options:_0x3459d1,args:_0x1eab48,tdx:_0x1dfa97}=_0x5a6b8c,_0x51da89=_0x1eab48[0x0]||_0x3459d1[_0x418de3(0x214)];if(!_0x51da89)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x418de3(0x27a)),0x1;_0x3459d1['verbose']&&(console[_0x418de3(0x22b)](_0x418de3(0x25d)+_0x3459d1[_0x418de3(0x233)]),console[_0x418de3(0x22b)](_0x418de3(0x250)+_0x51da89));const _0x83b2c7=await withSpinner(_0x418de3(0x220)+_0x51da89+_0x418de3(0x25c),()=>_0x1dfa97['segment'][_0x418de3(0x190)](_0x51da89),{'verbose':_0x3459d1[_0x418de3(0x1f3)]}),_0x54e999=_0x83b2c7[_0x418de3(0x18e)],_0x32a167=await withSpinner(_0x418de3(0x1d9)+_0x51da89+'\x27...',()=>_0x1dfa97[_0x418de3(0x269)][_0x418de3(0x23d)](_0x54e999),{'verbose':_0x3459d1[_0x418de3(0x1f3)]});let _0x3e4b57=_0x32a167[_0x418de3(0x18e)];const _0x37ef81=resolveLimit(_0x3459d1['limit'],DEFAULT_DISPLAY_LIMIT),_0x246b80=/\bLIMIT\s+\d+/i[_0x418de3(0x1f2)](_0x3e4b57);!_0x246b80&&(_0x3e4b57=_0x3e4b57[_0x418de3(0x218)]()[_0x418de3(0x23e)](/;+$/,''),_0x3e4b57=_0x418de3(0x1d7)+_0x3e4b57+_0x418de3(0x1c5)+_0x37ef81);_0x3459d1[_0x418de3(0x1f3)]&&console[_0x418de3(0x22b)](_0x418de3(0x211)+_0x3e4b57);const _0x5a4225=await withProgressSpinner(_0x418de3(0x23a),async _0x10e377=>{const _0x4c3ac4=_0x418de3,_0x4f9d5c=await _0x1dfa97[_0x4c3ac4(0x236)]['execute'](_0x3e4b57,{'catalog':'td','schema':_0x4c3ac4(0x1bc),'onJobId':_0xff6b33=>{const _0x3f5e48=_0x4c3ac4;_0x10e377[_0x3f5e48(0x242)](_0xff6b33);}});return _0x4f9d5c;},{'verbose':_0x3459d1[_0x418de3(0x1f3)]}),_0x3c3f9d=_0x5a4225[_0x418de3(0x18e)],_0x875054=_0x3c3f9d[_0x418de3(0x172)]?_0x418de3(0x27c)+_0x3c3f9d[_0x418de3(0x172)]+']':'';return console[_0x418de3(0x22b)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x3c3f9d[_0x418de3(0x28c)][_0x418de3(0x19e)]['toLocaleString']()+_0x418de3(0x1fa)+(_0x418de3(0x18b)+formatElapsed(_0x3c3f9d[_0x418de3(0x28c)][_0x418de3(0x271)])+_0x875054)),await handleQueryOutput(_0x3c3f9d,_0x3459d1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x507c66=a23_0x2616;function a23_0x2616(_0x53332f,_0x4b565e){_0x53332f=_0x53332f-0x1ac;const _0x2f450a=a23_0x2f45();let _0x261624=_0x2f450a[_0x53332f];return _0x261624;}(function(_0x432276,_0x67227){const _0x43a9df=a23_0x2616,_0x5a0cb4=_0x432276();while(!![]){try{const _0xcdf947=parseInt(_0x43a9df(0x1b0))/0x1+-parseInt(_0x43a9df(0x1bb))/0x2*(parseInt(_0x43a9df(0x1b3))/0x3)+-parseInt(_0x43a9df(0x1b5))/0x4+-parseInt(_0x43a9df(0x1b4))/0x5*(-parseInt(_0x43a9df(0x1ba))/0x6)+-parseInt(_0x43a9df(0x1af))/0x7+parseInt(_0x43a9df(0x1c0))/0x8+parseInt(_0x43a9df(0x1c1))/0x9*(parseInt(_0x43a9df(0x1bc))/0xa);if(_0xcdf947===_0x67227)break;else _0x5a0cb4['push'](_0x5a0cb4['shift']());}catch(_0x3a7c5d){_0x5a0cb4['push'](_0x5a0cb4['shift']());}}}(a23_0x2f45,0xcad87));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a23_0x2f45(){const _0xeac447=['334770eeSMkG','description','length','log','2659488UOLBOp','279KoRTgW','Error:\x20','config','profiles','map','scope','184156LTdUdo','638890OpLGCV','name','execute','1668XSlYbe','5MaqFYi','2281948ueHnzn','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message','\x20\x20Global:\x20~/.config/tdx/tdx.json','List\x20all\x20available\x20profiles','681222tublYD','2500MXsKDX'];a23_0x2f45=function(){return _0xeac447;};return a23_0x2f45();}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x507c66(0x1b1)]=a23_0x507c66(0x1ac);[a23_0x507c66(0x1bd)]=a23_0x507c66(0x1b9);async[a23_0x507c66(0x1b2)](_0x5271ed){const _0x5c1bd5=a23_0x507c66,{options:_0x3d156a}=_0x5271ed;try{const _0x100c5e=listProfiles(),_0x2a3ad5=getActiveProfile();if(_0x100c5e[_0x5c1bd5(0x1be)]===0x0)return console[_0x5c1bd5(0x1bf)](_0x5c1bd5(0x1b6)),console[_0x5c1bd5(0x1bf)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5c1bd5(0x1bf)](_0x5c1bd5(0x1b8)),0x0;const _0x4ba941=_0x100c5e[_0x5c1bd5(0x1ad)](_0x3e2220=>{const _0x3b708c=_0x5c1bd5,_0x270c5c=_0x3e2220[_0x3b708c(0x1b1)]===_0x2a3ad5,_0x129a18=getProfileParams(_0x3e2220[_0x3b708c(0x1c3)]);return{'name':_0x3e2220['name'],'active':_0x270c5c,'scope':_0x3e2220[_0x3b708c(0x1ae)],'description':_0x3e2220['config'][_0x3b708c(0x1bd)]||'','params':_0x129a18};});return await handleSDKOutput(_0x4ba941,_0x3d156a),0x0;}catch(_0x3906c9){return _0x3906c9 instanceof Error&&console['error'](_0x5c1bd5(0x1c2)+_0x3906c9[_0x5c1bd5(0x1b7)]),0x1;}}}
|