@treasuredata/tdx 0.13.1 → 0.14.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 +3 -3
- 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/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.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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/profile-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-push-command.js.map +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 +37 -0
- 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.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.js +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.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.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.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +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.d.ts +19 -3
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.js +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.d.ts.map +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/pull-workflow.js.map +1 -1
- package/dist/sdk/segment/push-workflow.js +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/index.js +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/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +1 -1
- 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/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +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 a19_0x562c89=a19_0xecb9;(function(_0x3692b6,_0x5b2cef){const _0x3e922b=a19_0xecb9,_0xc38e1a=_0x3692b6();while(!![]){try{const _0x824906=-parseInt(_0x3e922b(0x1fc))/0x1+-parseInt(_0x3e922b(0x1de))/0x2+parseInt(_0x3e922b(0x1d3))/0x3*(-parseInt(_0x3e922b(0x199))/0x4)+parseInt(_0x3e922b(0x20e))/0x5*(parseInt(_0x3e922b(0x1ad))/0x6)+-parseInt(_0x3e922b(0x13a))/0x7*(-parseInt(_0x3e922b(0x192))/0x8)+parseInt(_0x3e922b(0x1b3))/0x9*(-parseInt(_0x3e922b(0x191))/0xa)+parseInt(_0x3e922b(0x1a1))/0xb;if(_0x824906===_0x5b2cef)break;else _0xc38e1a['push'](_0xc38e1a['shift']());}catch(_0x3277a6){_0xc38e1a['push'](_0xc38e1a['shift']());}}}(a19_0x1688,0xe9c64));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{hyperlink}from'../sdk/util/formatters.js';import*as a19_0x2520aa from'node:fs';function handleSDKError(_0x479121,_0x595665){const _0x16ed2e=a19_0xecb9;if(_0x479121 instanceof SDKError)console[_0x16ed2e(0x177)](_0x16ed2e(0x17b)+_0x479121[_0x16ed2e(0x189)]),_0x595665[_0x16ed2e(0x1d9)]&&(_0x479121['cause']&&console[_0x16ed2e(0x177)](_0x16ed2e(0x1f9)+_0x479121[_0x16ed2e(0x164)]),_0x479121[_0x16ed2e(0x207)]&&(console[_0x16ed2e(0x177)](_0x16ed2e(0x1b1)),console[_0x16ed2e(0x177)](_0x479121[_0x16ed2e(0x207)])));else throw _0x479121;}function formatChatHistoryEntry(_0x584828,_0x4b8e87){const _0x1873e4=a19_0xecb9,_0x313c56=getChalk(_0x4b8e87),_0x5890c1=_0x313c56[_0x1873e4(0x147)](_0x584828['at']);if(_0x1873e4(0x20a)in _0x584828){const _0x1d6ded=_0x313c56[_0x1873e4(0x183)](_0x1873e4(0x17d));return _0x5890c1+'\x20'+_0x1d6ded+':\x20'+_0x584828[_0x1873e4(0x20a)];}if(_0x1873e4(0x175)in _0x584828){const _0x1d8644=_0x313c56[_0x1873e4(0x1e3)]('[content]');return _0x5890c1+'\x20'+_0x1d8644+':\x20'+_0x584828[_0x1873e4(0x175)];}if(_0x1873e4(0x1bb)in _0x584828){const _0x43b141=_0x313c56[_0x1873e4(0x182)](_0x1873e4(0x1ff)),{functionName:_0x2ea96c,functionArguments:_0x58ebeb,targetFunction:_0x227ce1}=_0x584828['tool_call'];let _0x3adeac=_0x5890c1+'\x20'+_0x43b141+':\x20'+_0x313c56[_0x1873e4(0x1f4)](_0x2ea96c);if(_0x58ebeb&&Object[_0x1873e4(0x209)](_0x58ebeb)[_0x1873e4(0x15e)]>0x0){const _0x48a4bd=Object[_0x1873e4(0x1bd)](_0x58ebeb)['map'](([_0xc7423,_0xbbed57])=>_0xc7423+'='+JSON[_0x1873e4(0x15c)](_0xbbed57))[_0x1873e4(0x186)](',\x20');_0x3adeac+='('+_0x48a4bd+')';}_0x227ce1&&(_0x3adeac+=_0x313c56[_0x1873e4(0x147)]('\x20['+_0x227ce1+']'));let _0x4c7393='';if(_0x584828[_0x1873e4(0x1bb)]['targetKnowledgeBase'])_0x4c7393=_0x1873e4(0x1e7)+_0x584828[_0x1873e4(0x1bb)][_0x1873e4(0x14b)][_0x1873e4(0x1c1)];else{if(_0x584828[_0x1873e4(0x1bb)][_0x1873e4(0x1bf)])_0x4c7393=_0x1873e4(0x18c)+_0x584828['tool_call']['targetAgent']['name'];else{if(_0x584828[_0x1873e4(0x1bb)][_0x1873e4(0x1c0)])_0x4c7393=_0x1873e4(0x16a)+_0x584828[_0x1873e4(0x1bb)][_0x1873e4(0x1c0)]['name'];else _0x584828[_0x1873e4(0x1bb)]['targetImageGenerator']&&(_0x4c7393=_0x1873e4(0x136)+_0x584828[_0x1873e4(0x1bb)][_0x1873e4(0x1b4)][_0x1873e4(0x1c1)]);}}return _0x3adeac+_0x4c7393;}if(_0x1873e4(0x206)in _0x584828){const _0x3e1e3c=_0x313c56[_0x1873e4(0x13f)](_0x1873e4(0x1f0)),{functionName:_0x51c2e7,functionArguments:_0x502dda,content:_0x4644c2,newChat:_0x1b48f0}=_0x584828['tool'];let _0x1467c2=_0x5890c1+'\x20'+_0x3e1e3c+':\x20'+_0x313c56[_0x1873e4(0x1f4)](_0x51c2e7);if(_0x502dda){const _0x40fff5=typeof _0x502dda==='string'?_0x502dda:JSON[_0x1873e4(0x15c)](_0x502dda);_0x1467c2+='('+_0x40fff5+')';}return _0x4644c2&&(_0x1467c2+='\x0a'+_0x313c56[_0x1873e4(0x147)](_0x4644c2)),_0x1b48f0&&(_0x1467c2+=_0x313c56[_0x1873e4(0x147)](_0x1873e4(0x197)+_0x1b48f0['id'])),_0x1467c2;}if(_0x1873e4(0x1a9)in _0x584828){const _0x52ae2c=_0x313c56[_0x1873e4(0x166)](_0x1873e4(0x1c4));return _0x5890c1+'\x20'+_0x52ae2c+':\x20'+_0x584828[_0x1873e4(0x1a9)][_0x1873e4(0x1c1)]+'\x20('+_0x584828[_0x1873e4(0x1a9)][_0x1873e4(0x175)][_0x1873e4(0x15e)]+_0x1873e4(0x142);}if('image'in _0x584828){const _0x293f77=_0x313c56[_0x1873e4(0x166)](_0x1873e4(0x1a4)),{width:_0x2c532f,height:_0x2c44a9,headerText:_0x1999d0}=_0x584828['image'],_0x5b223f=_0x1999d0?'\x20-\x20'+_0x1999d0:'';return _0x5890c1+'\x20'+_0x293f77+':\x20'+_0x2c532f+'x'+_0x2c44a9+_0x5b223f;}if(_0x1873e4(0x177)in _0x584828){const _0x431b1f=_0x313c56[_0x1873e4(0x1fd)](_0x1873e4(0x176));return _0x5890c1+'\x20'+_0x431b1f+':\x20'+_0x584828['error'];}return _0x5890c1+'\x20'+_0x313c56['dim'](_0x1873e4(0x181))+':\x20'+JSON[_0x1873e4(0x15c)](_0x584828);}async function executeChatHistoryCommand(_0x3e62b9,_0x6a3b92){const _0x32bf63=a19_0xecb9,{options:_0x28f4e4,args:_0x5a773d,tdx:_0x2a18c3}=_0x3e62b9,_0x451ae1=_0x5a773d[0x0],_0x24a15f=_0x28f4e4,_0x448f29=_0x24a15f[_0x32bf63(0x187)];try{if(_0x448f29&&_0x451ae1)return console[_0x32bf63(0x177)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x32bf63(0x177)](_0x32bf63(0x178)+_0x6a3b92+'\x20--last'),0x1;if(!_0x451ae1&&!_0x448f29&&_0x28f4e4[_0x32bf63(0x1a6)]!==undefined){const _0x45eb1c=resolveLimit(_0x28f4e4[_0x32bf63(0x18a)],DEFAULT_LLM_LIMIT),_0x577119=await withSpinner(_0x32bf63(0x1af),()=>_0x2a18c3['llm'][_0x32bf63(0x196)](_0x45eb1c),{'verbose':_0x28f4e4['verbose']});return await handleSDKOutput(_0x577119[_0x32bf63(0x1f8)],_0x28f4e4),0x0;}const _0x363a4b=await getChatIdOrSelect(_0x2a18c3,_0x28f4e4,_0x448f29,_0x451ae1);if(!_0x363a4b)return 0x0;return await displayChatHistory(_0x363a4b,_0x2a18c3,_0x28f4e4),0x0;}catch(_0x21d21e){return handleSDKError(_0x21d21e,_0x28f4e4),0x1;}}async function displayChatHistory(_0x34f577,_0xa1c4e3,_0x16aed4){const _0x373b37=a19_0xecb9,_0x512822=await withSpinner(_0x373b37(0x1dc)+_0x34f577+_0x373b37(0x1e8),()=>_0xa1c4e3[_0x373b37(0x1e2)][_0x373b37(0x1e6)](_0x34f577),{'verbose':_0x16aed4['verbose']}),_0x3a011c=_0x512822['data'][_0x373b37(0x1f8)]??[];if(_0x3a011c['length']===0x0){console[_0x373b37(0x19f)](_0x373b37(0x1ec));return;}if(_0x16aed4[_0x373b37(0x1a6)]!==undefined)await handleSDKOutput(_0x3a011c,_0x16aed4);else{const _0x5acb97=_0x3a011c[_0x373b37(0x1db)](_0x3ac7ef=>formatChatHistoryEntry(_0x3ac7ef,_0x16aed4)),_0xafcb4d=_0x5acb97[_0x373b37(0x186)]('\x0a');await writeOutput(_0xafcb4d,_0x16aed4[_0x373b37(0x1a9)],'table');}}async function getChatIdOrSelect(_0x2eb62d,_0x14a22f,_0x14d0ff,_0x1bfc3a){const _0x446ffb=a19_0xecb9;if(_0x1bfc3a)return _0x1bfc3a;if(_0x14d0ff){const _0x133a79=await withSpinner(_0x446ffb(0x1a7),()=>_0x2eb62d['llm'][_0x446ffb(0x196)](0x1),{'verbose':_0x14a22f[_0x446ffb(0x1d9)]});if(_0x133a79[_0x446ffb(0x1f8)]['length']===0x0)return console['log']('No\x20chat\x20sessions\x20found.'),undefined;return _0x133a79[_0x446ffb(0x1f8)][0x0]['id'];}const _0x153ed5=await selectChatInteractively(_0x2eb62d,_0x14a22f);if(!_0x153ed5)return console[_0x446ffb(0x19f)](_0x446ffb(0x19c)),undefined;return _0x153ed5;}async function getProjectIdOrDefault(_0xc4aaba){const _0x331d93=await getProjectWithName(_0xc4aaba);return _0x331d93['id'];}async function getProjectWithName(_0x1762d9){const _0x36a673=a19_0xecb9,{tdx:_0x31b2c,options:_0x5caab4}=_0x1762d9,_0x501c77=_0x5caab4['llmProject'];if(_0x501c77){const _0x380283=await withSpinner('Resolving\x20project\x20\x27'+_0x501c77+_0x36a673(0x1e8),()=>_0x31b2c[_0x36a673(0x1e2)][_0x36a673(0x190)](_0x501c77),{'verbose':_0x5caab4[_0x36a673(0x1d9)]});return{'id':_0x380283[_0x36a673(0x1f8)],'name':_0x501c77};}const _0x51e5b0=_0x31b2c[_0x36a673(0x1e2)]['getCurrentProject']();if(_0x51e5b0){const _0x29d4ab=await _0x31b2c[_0x36a673(0x1e2)][_0x36a673(0x201)](),_0xc80bea=_0x29d4ab['find'](_0x219685=>_0x219685['id']===_0x51e5b0);return{'id':_0x51e5b0,'name':_0xc80bea?.[_0x36a673(0x184)][_0x36a673(0x1c1)]||_0x36a673(0x18b)};}const _0xb97e40=await withSpinner(_0x36a673(0x145),()=>_0x31b2c['llm'][_0x36a673(0x1dd)](),{'verbose':_0x5caab4[_0x36a673(0x1d9)]});return{'id':_0xb97e40[_0x36a673(0x1f8)]['id'],'name':_0xb97e40[_0x36a673(0x1f8)][_0x36a673(0x184)][_0x36a673(0x1c1)]};}function toLLMProjectInfo(_0xa0d65c){const _0x3d22d6=a19_0xecb9;return{'name':_0xa0d65c[_0x3d22d6(0x184)]['name'],'description':_0xa0d65c['attributes'][_0x3d22d6(0x20c)],'createdAt':_0xa0d65c[_0x3d22d6(0x184)][_0x3d22d6(0x1c5)],'updatedAt':_0xa0d65c[_0x3d22d6(0x184)]['updatedAt']};}function a19_0x1688(){const _0x81a1ea=['Deleting\x20project\x20\x27','data','\x20\x20Cause:\x20','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','\x20\x20Knowledge\x20Bases:\x20','1345552xPicqX','red','Creating\x20project\x20\x27','[tool_call]','Project\x20created:\x20','projects','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','\x20\x20Agents:\x20','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','LLM_PROJECT_NOT_FOUND','tool','stack','backupProject','keys','input','get','description','llm:use','4535245bQwMXH','lastConversationAt','⚒️\x20','\x20\x20Integrations:\x20','toLowerCase','existsSync','tdx\x20chats','No\x20agents\x20found','agent','site','llm:agent:update','starterMessage','llm:projects','llm:project:restore','\x20->\x20ImageGen:','(no\x20agent)','split','Project\x20context\x20set\x20to:\x20','7LnfJPz','Creating\x20agent\x20\x27','llm:agents','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','No\x20projects\x20found','magenta','knowledgeBases','(no\x20message)','\x20bytes)','.llm','integrations','Getting\x20default\x20project...','json','dim','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Updating\x20agent...','restoreProject','targetKnowledgeBase','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','slice','floor','agents','chatId','llm:agent:delete','\x20project(s)','Load\x20more...','Resolving\x20project\x20\x27','Create\x20a\x20new\x20agent\x20in\x20current\x20project','Project\x20restored:\x20','models','getTime','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','h\x20ago','prompts','stringify','Error:\x20Project\x20name\x20is\x20required','length','Resolving\x20agent\x20\x27','Fetching\x20projects...','llm:agent:show','Agent\x20created:\x20','Show\x20agent\x20details','cause','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','blue','\x20\x20Prompts:\x20','sourceSite','Update\x20an\x20existing\x20agent','\x20->\x20WebSearch:','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','projectName','llm:models','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','model','Create\x20a\x20new\x20LLM\x20project','Error:\x20Agent\x20name\x20is\x20required','counts','Deleting\x20agent...','content','[error]\x20\x20','error','Usage:\x20','__load_more__','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','Error:\x20','rmSync','[input]\x20\x20','Invalid\x20path\x20syntax:\x20','tdx\x20llm\x20history','getBackupMetadata','[unknown]','yellow','cyan','attributes','firstInputContent','join','last','llm:history','message','limit','Unknown','\x20->\x20Agent:','prompt','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','yes','resolveProjectId','660tGBedF','15109624dAtNel','includes','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','chats','\x20→\x20chat:\x20','updateAgent','211616IWrWGJ','List\x20all\x20LLM\x20projects','select','\x0aCancelled','Delete\x20an\x20agent','filter','log','execute','28024073RfKjPV','Error:\x20Backup\x20folder\x20path\x20is\x20required','m\x20ago','[image]\x20\x20','Agent\x20updated:\x20','format','Fetching\x20most\x20recent\x20chat...','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','output','Use\x20format:\x20project-name/agent-name','find','deleteAgent','12GoYfnr','Setting\x20project\x20context\x20to\x20\x27','Fetching\x20chat\x20sessions...','Select\x20a\x20chat\x20session:','\x0aStack\x20trace:','Delete\x20an\x20LLM\x20project','247743eYfSrF','targetImageGenerator','Fetching\x20agent...','deleteProject','INVALID_ARGUMENT','temperature','numeric','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','tool_call','en-US','entries','exportedFrom','targetAgent','targetWebSearchTool','name','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','jsonl','[output]\x20','createdAt','🤖\x20','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','resolveAgentId','Backup\x20cancelled.','tsv','Fetching\x20available\x20models...','just\x20now','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','set','Validating\x20backup\x20from\x20\x27','maxToolIterations','Output\x20directory\x20\x27','setCurrentProject','102WtkdPG','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','A\x20project\x20named\x20\x27','push','agentId','Project\x20deleted:\x20','verbose','Checking\x20for\x20existing\x20projects...','map','Fetching\x20chat\x20history\x20for\x20\x27','getOrCreateDefaultProject','663668DUncID','...','List\x20available\x20LLM\x20models','Restoring\x20project\x20from\x20\x27','llm','green','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','Project\x20not\x20found:\x20','history','\x20->\x20KB:','\x27...','llm:project:backup','toLocaleDateString','dryRun','No\x20messages\x20found\x20in\x20chat\x20history.','\x20\x20\x20Examples:','\x27\x20already\x20exists.\x20Overwrite?','llm:project:create','[tool]\x20\x20\x20','llm:project:delete','sort','table','bold','default','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.'];a19_0x1688=function(){return _0x81a1ea;};return a19_0x1688();}function toAgentInfo(_0x46f47b){const _0x256250=a19_0xecb9;return{'name':_0x46f47b[_0x256250(0x184)][_0x256250(0x1c1)],'description':_0x46f47b[_0x256250(0x184)][_0x256250(0x20c)],'prompt':truncatePrompt(_0x46f47b[_0x256250(0x184)]['prompt']),'createdAt':_0x46f47b[_0x256250(0x184)][_0x256250(0x1c5)],'updatedAt':_0x46f47b['attributes']['updatedAt']};}function truncatePrompt(_0x5da2a5){const _0x560c55=a19_0xecb9;if(!_0x5da2a5)return undefined;const _0x43e037=0x64;if(_0x5da2a5[_0x560c55(0x15e)]<=_0x43e037)return _0x5da2a5;return _0x5da2a5['slice'](0x0,_0x43e037)+_0x560c55(0x1df);}export class LLMModelsCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x16e);[a19_0x562c89(0x20c)]=a19_0x562c89(0x1e0);async[a19_0x562c89(0x1a0)](_0x298aec){const _0x3e166e=a19_0x562c89,{options:_0x2985e9,tdx:_0x3c5026}=_0x298aec;try{const _0x579135=await withSpinner(_0x3e166e(0x1cb),()=>_0x3c5026['llm'][_0x3e166e(0x157)](),{'verbose':_0x2985e9['verbose']});return await handleSDKOutput(_0x579135[_0x3e166e(0x1f8)],_0x2985e9),0x0;}catch(_0xf926ad){return handleSDKError(_0xf926ad,_0x2985e9),0x1;}}}function a19_0xecb9(_0x579249,_0xd11c5e){_0x579249=_0x579249-0x133;const _0x1688ff=a19_0x1688();let _0xecb943=_0x1688ff[_0x579249];return _0xecb943;}export class LLMProjectsCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x134);[a19_0x562c89(0x20c)]=a19_0x562c89(0x19a);async['execute'](_0xa00e4d){const _0xbf85a9=a19_0x562c89,{options:_0x11dcf2,args:_0x411826,tdx:_0x162378}=_0xa00e4d,_0x45dbcc=getChalk(_0x11dcf2),_0x14195d=_0x11dcf2[_0xbf85a9(0x217)];try{const _0x12aa48=_0x411826[0x0],_0x5665c8=resolveLimit(_0x11dcf2[_0xbf85a9(0x18a)],DEFAULT_LLM_LIMIT),_0x23c511=await withSpinner(_0xbf85a9(0x160),()=>_0x162378['llm'][_0xbf85a9(0x201)](_0x5665c8),{'verbose':_0x11dcf2[_0xbf85a9(0x1d9)]});let _0x2719f6=_0x23c511[_0xbf85a9(0x1f8)];_0x12aa48&&(_0x2719f6=_0x23c511[_0xbf85a9(0x1f8)]['filter'](_0x34bd5f=>matchGlobPattern(_0x34bd5f[_0xbf85a9(0x184)][_0xbf85a9(0x1c1)],_0x12aa48)));const _0x2a1b09=_0x11dcf2[_0xbf85a9(0x1a6)]===_0xbf85a9(0x146)||_0x11dcf2['format']===_0xbf85a9(0x1c3)||_0x11dcf2['format']===_0xbf85a9(0x1f3)||_0x11dcf2[_0xbf85a9(0x1a6)]===_0xbf85a9(0x1ca);if(_0x2a1b09){const _0x218235=_0x2719f6[_0xbf85a9(0x1db)](_0xa0b707=>({...toLLMProjectInfo(_0xa0b707),'url':getLLMProjectUrl(_0x14195d,_0xa0b707['id'])}));await handleSDKOutput(_0x218235,_0x11dcf2);}else{const _0x19a3c4=[];if(_0x2719f6[_0xbf85a9(0x15e)]===0x0)_0x19a3c4[_0xbf85a9(0x1d6)](_0x45dbcc['dim'](_0xbf85a9(0x13e)));else{const _0x4eae1f=[..._0x2719f6][_0xbf85a9(0x1f2)]((_0x114edc,_0x303728)=>_0x114edc[_0xbf85a9(0x184)][_0xbf85a9(0x1c1)]['localeCompare'](_0x303728[_0xbf85a9(0x184)][_0xbf85a9(0x1c1)]));for(const _0x5434bb of _0x4eae1f){const _0x4be4e8=getLLMProjectUrl(_0x14195d,_0x5434bb['id']),_0x4add2a=hyperlink(_0x5434bb[_0xbf85a9(0x184)][_0xbf85a9(0x1c1)],_0x4be4e8);_0x19a3c4[_0xbf85a9(0x1d6)](_0xbf85a9(0x210)+_0x4add2a);}_0x19a3c4[_0xbf85a9(0x1d6)](_0x45dbcc[_0xbf85a9(0x147)](_0x2719f6[_0xbf85a9(0x15e)]+_0xbf85a9(0x152)));}await writeOutput(_0x19a3c4['join']('\x0a'),_0x11dcf2[_0xbf85a9(0x1a9)],_0xbf85a9(0x1f3));}return 0x0;}catch(_0x113c4b){return handleSDKError(_0x113c4b,_0x11dcf2),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x13c);['description']='List\x20agents\x20in\x20current\x20project';async[a19_0x562c89(0x1a0)](_0x2a9200){const _0x4be65e=a19_0x562c89,{options:_0x210015,args:_0x2cb44d,tdx:_0x219cba}=_0x2a9200,_0x8e8780=getChalk(_0x210015),_0x1defba=_0x210015[_0x4be65e(0x217)];try{const _0x22ad68=_0x2cb44d[0x0];let _0x5f3e64=_0x22ad68,_0x2ef399,_0x3ac1e9;if(_0x22ad68&&_0x22ad68[_0x4be65e(0x193)]('/')){const _0x472ce3=_0x22ad68[_0x4be65e(0x138)]('/');if(_0x472ce3[_0x4be65e(0x15e)]===0x2){const [_0x169941,_0x581ef8]=_0x472ce3,_0x4e4862=await _0x219cba['llm'][_0x4be65e(0x201)](),_0x256614=_0x4e4862[_0x4be65e(0x1ab)](_0x226354=>_0x226354['attributes'][_0x4be65e(0x1c1)][_0x4be65e(0x212)]()===_0x169941['toLowerCase']());if(!_0x256614)throw new SDKError(ErrorCode[_0x4be65e(0x205)],_0x4be65e(0x1e5)+_0x169941,undefined,{'helpText':_0x4be65e(0x194)});_0x2ef399=_0x256614['id'],_0x3ac1e9=_0x256614[_0x4be65e(0x184)][_0x4be65e(0x1c1)],_0x5f3e64=_0x581ef8;}else throw new SDKError(ErrorCode[_0x4be65e(0x1b7)],'Invalid\x20path\x20syntax:\x20'+_0x22ad68,undefined,{'helpText':_0x4be65e(0x1aa)});}else{const _0x541cdc=await getProjectWithName(_0x2a9200);_0x2ef399=_0x541cdc['id'],_0x3ac1e9=_0x541cdc[_0x4be65e(0x1c1)];}const _0x3912de=await withSpinner('Fetching\x20agents...',()=>_0x219cba[_0x4be65e(0x1e2)][_0x4be65e(0x14f)](_0x2ef399),{'verbose':_0x210015[_0x4be65e(0x1d9)]});let _0x310947=_0x3912de[_0x4be65e(0x1f8)];_0x5f3e64&&(_0x310947=_0x3912de['data']['filter'](_0xfa7414=>matchGlobPattern(_0xfa7414[_0x4be65e(0x184)]['name'],_0x5f3e64)));const _0x3574cb=_0x210015[_0x4be65e(0x1a6)]===_0x4be65e(0x146)||_0x210015[_0x4be65e(0x1a6)]===_0x4be65e(0x1c3)||_0x210015[_0x4be65e(0x1a6)]===_0x4be65e(0x1f3)||_0x210015['format']===_0x4be65e(0x1ca);if(_0x3574cb){const _0x407ab4=_0x310947['map'](_0x46009f=>({...toAgentInfo(_0x46009f),'chatUrl':getLLMAgentChatUrl(_0x1defba,_0x2ef399,_0x46009f['id'])}));await handleSDKOutput(_0x407ab4,_0x210015);}else{const _0x779133=[];_0x779133[_0x4be65e(0x1d6)](_0x8e8780['dim']('['+_0x3ac1e9+']'));if(_0x310947['length']===0x0)_0x779133['push'](_0x8e8780[_0x4be65e(0x147)](_0x4be65e(0x215)));else{const _0x50858e=[..._0x310947][_0x4be65e(0x1f2)]((_0x310cf0,_0xd6985a)=>_0x310cf0[_0x4be65e(0x184)][_0x4be65e(0x1c1)]['localeCompare'](_0xd6985a[_0x4be65e(0x184)]['name']));for(const _0x13067c of _0x50858e){const _0x1ca296=getLLMAgentChatUrl(_0x1defba,_0x2ef399,_0x13067c['id']),_0x4610a8=hyperlink(_0x13067c[_0x4be65e(0x184)][_0x4be65e(0x1c1)],_0x1ca296);_0x779133['push'](_0x4be65e(0x1c6)+_0x4610a8);}_0x779133['push'](_0x8e8780[_0x4be65e(0x147)](_0x310947[_0x4be65e(0x15e)]+'\x20agent(s)'));}await writeOutput(_0x779133['join']('\x0a'),_0x210015[_0x4be65e(0x1a9)],'table');}return 0x0;}catch(_0x37ccb5){return handleSDKError(_0x37ccb5,_0x210015),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a19_0x562c89(0x161);[a19_0x562c89(0x20c)]=a19_0x562c89(0x163);async['execute'](_0x5add9a){const _0x17e504=a19_0x562c89,{options:_0xc60bc1,args:_0x1c1d01,tdx:_0x48d000}=_0x5add9a;if(_0x1c1d01[_0x17e504(0x15e)]===0x0)return console[_0x17e504(0x177)](_0x17e504(0x172)),console[_0x17e504(0x177)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x2bc884=_0x1c1d01[0x0];try{const _0x32378d=await getProjectIdOrDefault(_0x5add9a),_0x50db76=await withSpinner(_0x17e504(0x15f)+_0x2bc884+_0x17e504(0x1e8),()=>_0x48d000[_0x17e504(0x1e2)][_0x17e504(0x1c8)](_0x2bc884,_0x32378d),{'verbose':_0xc60bc1[_0x17e504(0x1d9)]}),_0x51a760=await withSpinner(_0x17e504(0x1b5),()=>_0x48d000[_0x17e504(0x1e2)]['agent'](_0x50db76[_0x17e504(0x1f8)]),{'verbose':_0xc60bc1[_0x17e504(0x1d9)]});return await handleSDKOutput([_0x51a760[_0x17e504(0x1f8)]],_0xc60bc1),0x0;}catch(_0x56213){return handleSDKError(_0x56213,_0xc60bc1),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a19_0x562c89(0x1c1)]='llm:agent:create';[a19_0x562c89(0x20c)]=a19_0x562c89(0x155);async[a19_0x562c89(0x1a0)](_0x8bbe69){const _0x43eb09=a19_0x562c89,{options:_0x4e39cc,args:_0x4fe041,tdx:_0x42c4e4}=_0x8bbe69;if(_0x4fe041['length']===0x0)return console[_0x43eb09(0x177)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x43eb09(0x177)](_0x43eb09(0x16f)),console['error'](_0x43eb09(0x1cd)),0x1;const _0x8b0645=_0x4fe041[0x0],_0x166a10=_0x4e39cc,_0x4040e4=_0x166a10['systemPrompt'],_0x4e8887=_0x166a10[_0x43eb09(0x170)]||'claude-4.5-haiku',_0x4d3441=_0x166a10['starterMessage'],_0x1a3762=_0x166a10['maxToolIterations']?Number(_0x166a10[_0x43eb09(0x1d0)]):undefined,_0x2a9c53=_0x166a10['temperature']?Number(_0x166a10[_0x43eb09(0x1b8)]):undefined;try{let _0x459616,_0x4fee65;if(_0x8b0645[_0x43eb09(0x193)]('/')){const _0x15da6c=_0x8b0645[_0x43eb09(0x138)]('/');if(_0x15da6c[_0x43eb09(0x15e)]===0x2){const [_0x567153,_0x27fd9f]=_0x15da6c,_0x63a03e=await withSpinner(_0x43eb09(0x154)+_0x567153+_0x43eb09(0x1e8),()=>_0x42c4e4[_0x43eb09(0x1e2)][_0x43eb09(0x190)](_0x567153),{'verbose':_0x4e39cc[_0x43eb09(0x1d9)]});_0x459616=_0x63a03e[_0x43eb09(0x1f8)],_0x4fee65=_0x27fd9f;}else throw new SDKError(ErrorCode[_0x43eb09(0x1b7)],_0x43eb09(0x17e)+_0x8b0645,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x459616=await getProjectIdOrDefault(_0x8bbe69),_0x4fee65=_0x8b0645;const _0x368378=await withSpinner(_0x43eb09(0x13b)+_0x4fee65+'\x27...',()=>_0x42c4e4[_0x43eb09(0x1e2)]['createAgent']({'name':_0x4fee65,'projectId':_0x459616,'modelType':_0x4e8887,'systemPrompt':_0x4040e4,'starterMessage':_0x4d3441,'maxToolIterations':_0x1a3762,'temperature':_0x2a9c53}),{'verbose':_0x4e39cc[_0x43eb09(0x1d9)]});return console[_0x43eb09(0x19f)](_0x43eb09(0x162)+_0x368378[_0x43eb09(0x1f8)]['id']),await handleSDKOutput([_0x368378['data']],_0x4e39cc),0x0;}catch(_0x1a6fff){return handleSDKError(_0x1a6fff,_0x4e39cc),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x218);[a19_0x562c89(0x20c)]=a19_0x562c89(0x169);async[a19_0x562c89(0x1a0)](_0x4cca20){const _0x1738f5=a19_0x562c89,{options:_0x2f19cf,args:_0x57c713,tdx:_0x3fd21c}=_0x4cca20;if(_0x57c713['length']===0x0)return console[_0x1738f5(0x177)](_0x1738f5(0x172)),console[_0x1738f5(0x177)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x41bd6a=_0x57c713[0x0],_0x4dc6c0=_0x2f19cf,_0x47bf5f=_0x4dc6c0[_0x1738f5(0x1c1)],_0x489796=_0x4dc6c0[_0x1738f5(0x18d)],_0x4387e5=_0x4dc6c0[_0x1738f5(0x20c)],_0x19fc16=_0x4dc6c0[_0x1738f5(0x133)];if(!_0x47bf5f&&!_0x489796&&!_0x4387e5&&!_0x19fc16)return console[_0x1738f5(0x177)](_0x1738f5(0x13d)),console['error']('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x4fe193=await getProjectIdOrDefault(_0x4cca20),_0x150e18=await withSpinner('Resolving\x20agent\x20\x27'+_0x41bd6a+'\x27...',()=>_0x3fd21c[_0x1738f5(0x1e2)][_0x1738f5(0x1c8)](_0x41bd6a,_0x4fe193),{'verbose':_0x2f19cf[_0x1738f5(0x1d9)]}),_0xce4619=_0x150e18[_0x1738f5(0x1f8)],_0x5717b5=await withSpinner(_0x1738f5(0x149),()=>_0x3fd21c[_0x1738f5(0x1e2)][_0x1738f5(0x198)](_0xce4619,{'name':_0x47bf5f,'prompt':_0x489796,'description':_0x4387e5,'starterMessage':_0x19fc16}),{'verbose':_0x2f19cf['verbose']});return console[_0x1738f5(0x19f)](_0x1738f5(0x1a5)+_0x5717b5[_0x1738f5(0x1f8)]['id']),await handleSDKOutput([_0x5717b5[_0x1738f5(0x1f8)]],_0x2f19cf),0x0;}catch(_0x2d487b){return handleSDKError(_0x2d487b,_0x2f19cf),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x151);[a19_0x562c89(0x20c)]=a19_0x562c89(0x19d);async['execute'](_0xc7abbb){const _0x5ed896=a19_0x562c89,{options:_0x40dac6,args:_0x22bac1,tdx:_0x3036b2}=_0xc7abbb;if(_0x22bac1[_0x5ed896(0x15e)]===0x0)return console[_0x5ed896(0x177)](_0x5ed896(0x172)),console[_0x5ed896(0x177)](_0x5ed896(0x14c)),0x1;const _0x1c56b7=_0x22bac1[0x0];try{const _0x4315db=await getProjectIdOrDefault(_0xc7abbb),_0x184812=await withSpinner(_0x5ed896(0x15f)+_0x1c56b7+_0x5ed896(0x1e8),()=>_0x3036b2[_0x5ed896(0x1e2)][_0x5ed896(0x1c8)](_0x1c56b7,_0x4315db),{'verbose':_0x40dac6[_0x5ed896(0x1d9)]}),_0x56098f=_0x184812['data'];return await withSpinner(_0x5ed896(0x174),()=>_0x3036b2[_0x5ed896(0x1e2)][_0x5ed896(0x1ac)](_0x56098f),{'verbose':_0x40dac6[_0x5ed896(0x1d9)]}),console['log']('Agent\x20deleted:\x20'+_0x56098f),0x0;}catch(_0x3b93fd){return handleSDKError(_0x3b93fd,_0x40dac6),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x188);[a19_0x562c89(0x20c)]=a19_0x562c89(0x1d4);async['execute'](_0xc849dd){const _0x2f3149=a19_0x562c89;return executeChatHistoryCommand(_0xc849dd,_0x2f3149(0x17f));}}export class LLMUseCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x20d);['description']='Set\x20current\x20project\x20context';async[a19_0x562c89(0x1a0)](_0x1ea169){const _0x360610=a19_0x562c89,{options:_0x580406,args:_0xd097cf,tdx:_0x57ec18}=_0x1ea169;if(_0xd097cf[_0x360610(0x15e)]===0x0)return console['error'](_0x360610(0x15d)),console[_0x360610(0x177)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x2dcf15=_0xd097cf[0x0];try{return await withSpinner(_0x360610(0x1ae)+_0x2dcf15+_0x360610(0x1e8),()=>_0x57ec18['llm'][_0x360610(0x1d2)](_0x2dcf15),{'verbose':_0x580406[_0x360610(0x1d9)]}),console['log'](_0x360610(0x139)+_0x2dcf15),0x0;}catch(_0x52ab5a){return handleSDKError(_0x52ab5a,_0x580406),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x1ef);[a19_0x562c89(0x20c)]=a19_0x562c89(0x171);async['execute'](_0x451352){const _0x20b743=a19_0x562c89,{options:_0x67849d,args:_0x50cf5b,tdx:_0xcf0467}=_0x451352;if(_0x50cf5b[_0x20b743(0x15e)]===0x0)return console['error'](_0x20b743(0x15d)),console['error']('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x413161=_0x50cf5b[0x0],_0xa4bf24=_0x67849d,_0x402830=_0xa4bf24[_0x20b743(0x20c)];try{const _0x3ce4be=await withSpinner(_0x20b743(0x1fe)+_0x413161+'\x27...',()=>_0xcf0467[_0x20b743(0x1e2)]['createProject']({'name':_0x413161,'description':_0x402830}),{'verbose':_0x67849d[_0x20b743(0x1d9)]});console[_0x20b743(0x19f)](_0x20b743(0x200)+_0x3ce4be[_0x20b743(0x1f8)]['id']);const _0x4a77a4=toLLMProjectInfo(_0x3ce4be[_0x20b743(0x1f8)]);return await handleSDKOutput([_0x4a77a4],_0x67849d),0x0;}catch(_0x4b0f7b){return handleSDKError(_0x4b0f7b,_0x67849d),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x1f1);[a19_0x562c89(0x20c)]=a19_0x562c89(0x1b2);async[a19_0x562c89(0x1a0)](_0x4dbf77){const _0x39543a=a19_0x562c89,{options:_0x1b80aa,args:_0x55cf1c,tdx:_0xd3e90e}=_0x4dbf77;if(_0x55cf1c[_0x39543a(0x15e)]===0x0)return console[_0x39543a(0x177)](_0x39543a(0x15d)),console[_0x39543a(0x177)](_0x39543a(0x159)),0x1;const _0x33e33e=_0x55cf1c[0x0];try{return await withSpinner(_0x39543a(0x1f7)+_0x33e33e+_0x39543a(0x1e8),()=>_0xd3e90e[_0x39543a(0x1e2)][_0x39543a(0x1b6)](_0x33e33e),{'verbose':_0x1b80aa['verbose']}),console['log'](_0x39543a(0x1d8)+_0x33e33e),0x0;}catch(_0x42ea24){return handleSDKError(_0x42ea24,_0x1b80aa),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x1e9);[a19_0x562c89(0x20c)]=a19_0x562c89(0x1c7);async['execute'](_0x5730fa){const _0x2aa070=a19_0x562c89,{options:_0x2cb4d4,args:_0x10f7df,tdx:_0x22ddbe}=_0x5730fa,_0x380e43=getChalk(_0x2cb4d4);console[_0x2aa070(0x19f)](_0x380e43[_0x2aa070(0x182)](_0x2aa070(0x1fa))),console[_0x2aa070(0x19f)](_0x380e43['yellow'](_0x2aa070(0x1c2))),console[_0x2aa070(0x19f)](_0x380e43['dim'](_0x2aa070(0x204))),console[_0x2aa070(0x19f)]();if(_0x10f7df[_0x2aa070(0x15e)]===0x0)return console[_0x2aa070(0x177)](_0x2aa070(0x15d)),console['error'](_0x2aa070(0x17a)),0x1;const _0x964f9f=_0x10f7df[0x0],_0x57e7d8=_0x2cb4d4,_0x5ef3e7=_0x57e7d8[_0x2aa070(0x1a9)],_0x57c344=_0x57e7d8[_0x2aa070(0x1eb)];try{const _0xb6b9f0=_0x5ef3e7||_0x964f9f+_0x2aa070(0x143);if(a19_0x2520aa[_0x2aa070(0x213)](_0xb6b9f0)&&!_0x57c344){if(!_0x2cb4d4['yes']){const _0x5af148=await confirm(_0x2aa070(0x1d1)+_0xb6b9f0+_0x2aa070(0x1ee));if(!_0x5af148)return console[_0x2aa070(0x19f)](_0x2aa070(0x1c9)),0x0;}a19_0x2520aa[_0x2aa070(0x17c)](_0xb6b9f0,{'recursive':!![]});}const _0xfa5d2f=await withSpinner(_0x57c344?'Analyzing\x20project\x20\x27'+_0x964f9f+_0x2aa070(0x1e8):'Backing\x20up\x20project\x20\x27'+_0x964f9f+_0x2aa070(0x1e8),()=>_0x22ddbe[_0x2aa070(0x1e2)][_0x2aa070(0x208)](_0x964f9f,_0x5ef3e7,{'dryRun':_0x57c344}),{'verbose':_0x2cb4d4[_0x2aa070(0x1d9)]}),_0x34322c=_0xfa5d2f['data'];return _0x57c344?console[_0x2aa070(0x19f)](_0x2aa070(0x18e)+_0x34322c['outputDir']):console['log']('Project\x20backed\x20up\x20to:\x20'+_0x34322c['outputDir']),console[_0x2aa070(0x19f)](_0x2aa070(0x203)+_0x34322c[_0x2aa070(0x173)][_0x2aa070(0x14f)]),console['log'](_0x2aa070(0x1fb)+_0x34322c[_0x2aa070(0x173)][_0x2aa070(0x140)]),console['log'](_0x2aa070(0x167)+_0x34322c[_0x2aa070(0x173)][_0x2aa070(0x15b)]),console['log'](_0x2aa070(0x211)+_0x34322c['counts'][_0x2aa070(0x144)]),(_0x2cb4d4[_0x2aa070(0x1a6)]==='json'||_0x2cb4d4[_0x2aa070(0x1a6)]===_0x2aa070(0x1c3))&&await handleSDKOutput([_0x34322c],_0x2cb4d4),0x0;}catch(_0xe6977b){return handleSDKError(_0xe6977b,_0x2cb4d4),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x135);[a19_0x562c89(0x20c)]=a19_0x562c89(0x165);async[a19_0x562c89(0x1a0)](_0x909174){const _0x5a94c9=a19_0x562c89,{options:_0x1d58d7,args:_0x528777,tdx:_0x445ff8}=_0x909174,_0x212ffd=getChalk(_0x1d58d7);console[_0x5a94c9(0x19f)](_0x212ffd['yellow'](_0x5a94c9(0x202))),console[_0x5a94c9(0x19f)](_0x212ffd[_0x5a94c9(0x182)](_0x5a94c9(0x1f6))),console[_0x5a94c9(0x19f)](_0x212ffd['dim'](_0x5a94c9(0x1ed))),console[_0x5a94c9(0x19f)](_0x212ffd[_0x5a94c9(0x147)](_0x5a94c9(0x1a8))),console['log'](_0x212ffd[_0x5a94c9(0x147)](_0x5a94c9(0x1e4))),console[_0x5a94c9(0x19f)]();if(_0x528777[_0x5a94c9(0x15e)]===0x0)return console[_0x5a94c9(0x177)](_0x5a94c9(0x1a2)),console['error'](_0x5a94c9(0x148)),0x1;const _0x5921fd=_0x528777[0x0],_0x101ec6=_0x1d58d7,_0x1b6338=_0x101ec6[_0x5a94c9(0x1c1)],_0x30da22=_0x101ec6[_0x5a94c9(0x1eb)];try{if(!_0x30da22){const _0x549efd=_0x445ff8[_0x5a94c9(0x1e2)][_0x5a94c9(0x180)](_0x5921fd),_0x3d9152=_0x1b6338||_0x549efd[_0x5a94c9(0x1be)][_0x5a94c9(0x16d)],_0x3ea683=await withSpinner(_0x5a94c9(0x1da),()=>_0x445ff8['llm']['projects'](),{'verbose':_0x1d58d7[_0x5a94c9(0x1d9)]}),_0x1077cc=_0x3ea683[_0x5a94c9(0x1f8)][_0x5a94c9(0x1ab)](_0x48c92e=>_0x48c92e['attributes']['name']===_0x3d9152);if(_0x1077cc&&!_0x1d58d7[_0x5a94c9(0x18f)]){const _0x4d94a5=await confirm(_0x5a94c9(0x1d5)+_0x3d9152+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x4d94a5)return console[_0x5a94c9(0x19f)]('Restore\x20cancelled.'),0x0;}}const _0x1448fb=await withSpinner(_0x30da22?_0x5a94c9(0x1cf)+_0x5921fd+'\x27...':_0x5a94c9(0x1e1)+_0x5921fd+_0x5a94c9(0x1e8),()=>_0x445ff8[_0x5a94c9(0x1e2)][_0x5a94c9(0x14a)](_0x5921fd,{'name':_0x1b6338,'dryRun':_0x30da22}),{'verbose':_0x1d58d7[_0x5a94c9(0x1d9)]}),_0x5a98a2=_0x1448fb[_0x5a94c9(0x1f8)];return _0x5a98a2[_0x5a94c9(0x168)]&&console['log'](_0x5a94c9(0x16c)+_0x5a98a2[_0x5a94c9(0x168)]+'\x27'),_0x30da22?console[_0x5a94c9(0x19f)](_0x5a94c9(0x195)+_0x5a98a2[_0x5a94c9(0x16d)]):console['log'](_0x5a94c9(0x156)+_0x5a98a2[_0x5a94c9(0x16d)]+'\x20('+_0x5a98a2['projectId']+')'),console[_0x5a94c9(0x19f)]('\x20\x20Agents:\x20'+_0x5a98a2[_0x5a94c9(0x173)][_0x5a94c9(0x14f)]),console[_0x5a94c9(0x19f)](_0x5a94c9(0x1fb)+_0x5a98a2[_0x5a94c9(0x173)]['knowledgeBases']),console[_0x5a94c9(0x19f)](_0x5a94c9(0x167)+_0x5a98a2['counts'][_0x5a94c9(0x15b)]),console[_0x5a94c9(0x19f)]('\x20\x20Integrations:\x20'+_0x5a98a2['counts'][_0x5a94c9(0x144)]),(_0x1d58d7[_0x5a94c9(0x1a6)]===_0x5a94c9(0x146)||_0x1d58d7[_0x5a94c9(0x1a6)]==='jsonl')&&await handleSDKOutput([_0x5a98a2],_0x1d58d7),0x0;}catch(_0x106c08){return handleSDKError(_0x106c08,_0x1d58d7),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x11d81c,_0x2a3acd){const _0x1f228a=a19_0x562c89,_0x3af24e=_0x2a3acd[_0x1f228a(0x18a)]||CHAT_SELECTOR_PAGE_SIZE;let _0x645217=0x0,_0x572765=[];const _0xd6821a=(await import(_0x1f228a(0x15b)))[_0x1f228a(0x1f5)],_0x127913=getChalk(_0x2a3acd);while(!![]){const _0x5f395c=await withSpinner(_0x1f228a(0x1af),()=>_0x11d81c[_0x1f228a(0x1e2)][_0x1f228a(0x196)](_0x3af24e+_0x645217),{'verbose':_0x2a3acd[_0x1f228a(0x1d9)]});_0x572765=_0x5f395c[_0x1f228a(0x1f8)];const _0x397757=_0x572765[_0x1f228a(0x14d)](_0x645217,_0x645217+_0x3af24e),_0x318ab6=_0x572765['length']>_0x645217+_0x3af24e,_0x88a747=[...new Set(_0x397757[_0x1f228a(0x1db)](_0x23bc1f=>_0x23bc1f[_0x1f228a(0x184)][_0x1f228a(0x1d7)])[_0x1f228a(0x19e)](_0x55b315=>_0x55b315!==undefined))],_0x444571=new Map();await Promise['all'](_0x88a747[_0x1f228a(0x1db)](async _0x286b40=>{const _0x3d68c5=_0x1f228a;try{const _0x163d80=await _0x11d81c['llm'][_0x3d68c5(0x216)](_0x286b40);_0x444571[_0x3d68c5(0x1ce)](_0x286b40,_0x163d80['attributes'][_0x3d68c5(0x1c1)]);}catch{_0x444571[_0x3d68c5(0x1ce)](_0x286b40,_0x286b40);}}));const _0x1618a9=_0x397757[_0x1f228a(0x1db)](_0x47e114=>{const _0x23c779=_0x1f228a,_0x200b86=_0x47e114[_0x23c779(0x184)][_0x23c779(0x185)]||_0x23c779(0x141),_0x2dafd2=_0x200b86[_0x23c779(0x138)]('\x0a')[0x0],_0x2a134f=_0x2dafd2['length']>0x50?_0x2dafd2['substring'](0x0,0x4d)+_0x23c779(0x1df):_0x2dafd2,_0x28b823=_0x47e114[_0x23c779(0x184)][_0x23c779(0x1d7)]?_0x444571[_0x23c779(0x20b)](_0x47e114['attributes']['agentId'])||_0x47e114['attributes'][_0x23c779(0x1d7)]:_0x23c779(0x137),_0x193f15=_0x47e114[_0x23c779(0x184)][_0x23c779(0x20f)]||_0x47e114[_0x23c779(0x184)]['updatedAt'],_0x273cc2=new Date(_0x193f15),_0x62a688=new Date(),_0x45db9c=_0x62a688[_0x23c779(0x158)]()-_0x273cc2['getTime'](),_0x46d378=Math[_0x23c779(0x14e)](_0x45db9c/0xea60),_0x21af7c=Math['floor'](_0x45db9c/0x36ee80),_0x224dd7=Math[_0x23c779(0x14e)](_0x45db9c/0x5265c00);let _0x5a33ae;if(_0x46d378<0x1)_0x5a33ae=_0x23c779(0x1cc);else{if(_0x46d378<0x3c)_0x5a33ae=_0x46d378+_0x23c779(0x1a3);else{if(_0x21af7c<0x18)_0x5a33ae=_0x21af7c+_0x23c779(0x15a);else _0x224dd7<0x7?_0x5a33ae=_0x224dd7+'d\x20ago':_0x5a33ae=_0x273cc2[_0x23c779(0x1ea)](_0x23c779(0x1bc),{'month':'short','day':_0x23c779(0x1b9)});}}return{'title':_0x2a134f+'\x20'+_0x127913[_0x23c779(0x147)]('['+_0x28b823+']\x20'+_0x5a33ae),'value':_0x47e114['id']};});_0x318ab6&&_0x1618a9[_0x1f228a(0x1d6)]({'title':_0x127913[_0x1f228a(0x183)](_0x1f228a(0x153)),'value':'__load_more__'});const _0x4b1054=await _0xd6821a({'type':_0x1f228a(0x19b),'name':_0x1f228a(0x150),'message':_0x1f228a(0x1b0),'choices':_0x1618a9,'hint':_0x1f228a(0x16b)});if(!_0x4b1054[_0x1f228a(0x150)])return undefined;if(_0x4b1054[_0x1f228a(0x150)]===_0x1f228a(0x179)){_0x645217+=_0x3af24e;continue;}return _0x4b1054[_0x1f228a(0x150)];}}export class ChatsCommand extends BaseCommand{[a19_0x562c89(0x1c1)]=a19_0x562c89(0x196);[a19_0x562c89(0x20c)]=a19_0x562c89(0x1ba);async[a19_0x562c89(0x1a0)](_0x1ae73a){const _0x2cbd46=a19_0x562c89;return executeChatHistoryCommand(_0x1ae73a,_0x2cbd46(0x214));}}
|
|
1
|
+
const a19_0x4d8195=a19_0x4ab2;(function(_0x19ab54,_0x535305){const _0x103885=a19_0x4ab2,_0x28222d=_0x19ab54();while(!![]){try{const _0x55896d=-parseInt(_0x103885(0x13e))/0x1+-parseInt(_0x103885(0x10e))/0x2*(parseInt(_0x103885(0x124))/0x3)+parseInt(_0x103885(0x167))/0x4*(-parseInt(_0x103885(0x190))/0x5)+parseInt(_0x103885(0x11d))/0x6*(-parseInt(_0x103885(0x168))/0x7)+-parseInt(_0x103885(0x17e))/0x8*(-parseInt(_0x103885(0x117))/0x9)+parseInt(_0x103885(0x143))/0xa+parseInt(_0x103885(0xe3))/0xb;if(_0x55896d===_0x535305)break;else _0x28222d['push'](_0x28222d['shift']());}catch(_0x26ef3e){_0x28222d['push'](_0x28222d['shift']());}}}(a19_0x4bd4,0x94788));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{hyperlink}from'../sdk/util/formatters.js';import*as a19_0xcb9814 from'node:fs';function handleSDKError(_0x5ea0c5,_0x3256e7){const _0x2aed03=a19_0x4ab2;if(_0x5ea0c5 instanceof SDKError)console[_0x2aed03(0xeb)](_0x2aed03(0x11e)+_0x5ea0c5[_0x2aed03(0x165)]),_0x3256e7[_0x2aed03(0x14f)]&&(_0x5ea0c5[_0x2aed03(0x189)]&&console['error'](_0x2aed03(0x174)+_0x5ea0c5[_0x2aed03(0x189)]),_0x5ea0c5['stack']&&(console['error'](_0x2aed03(0x183)),console[_0x2aed03(0xeb)](_0x5ea0c5['stack'])));else throw _0x5ea0c5;}function formatChatHistoryEntry(_0x5a3635,_0xc3424b){const _0x4f1eb4=a19_0x4ab2,_0x1c53e9=getChalk(_0xc3424b),_0x3b98cc=_0x1c53e9[_0x4f1eb4(0x18f)](_0x5a3635['at']);if('input'in _0x5a3635){const _0x95d780=_0x1c53e9[_0x4f1eb4(0xee)](_0x4f1eb4(0x16e));return _0x3b98cc+'\x20'+_0x95d780+':\x20'+_0x5a3635[_0x4f1eb4(0x181)];}if(_0x4f1eb4(0xe6)in _0x5a3635){const _0x4156ca=_0x1c53e9[_0x4f1eb4(0x123)](_0x4f1eb4(0x18e));return _0x3b98cc+'\x20'+_0x4156ca+':\x20'+_0x5a3635[_0x4f1eb4(0xe6)];}if(_0x4f1eb4(0x109)in _0x5a3635){const _0x155189=_0x1c53e9[_0x4f1eb4(0x14a)](_0x4f1eb4(0xda)),{functionName:_0x20c97e,functionArguments:_0x22bba4,targetFunction:_0x84064d}=_0x5a3635['tool_call'];let _0x4ea03c=_0x3b98cc+'\x20'+_0x155189+':\x20'+_0x1c53e9[_0x4f1eb4(0x180)](_0x20c97e);if(_0x22bba4&&Object['keys'](_0x22bba4)[_0x4f1eb4(0x15e)]>0x0){const _0x52bfde=Object['entries'](_0x22bba4)['map'](([_0x56d9b4,_0x4a0e9f])=>_0x56d9b4+'='+JSON[_0x4f1eb4(0xfa)](_0x4a0e9f))['join'](',\x20');_0x4ea03c+='('+_0x52bfde+')';}_0x84064d&&(_0x4ea03c+=_0x1c53e9['dim']('\x20['+_0x84064d+']'));let _0x4de32f='';if(_0x5a3635[_0x4f1eb4(0x109)][_0x4f1eb4(0x161)])_0x4de32f=_0x4f1eb4(0x102)+_0x5a3635['tool_call'][_0x4f1eb4(0x161)][_0x4f1eb4(0xe7)];else{if(_0x5a3635['tool_call']['targetAgent'])_0x4de32f='\x20->\x20Agent:'+_0x5a3635[_0x4f1eb4(0x109)]['targetAgent'][_0x4f1eb4(0xe7)];else{if(_0x5a3635[_0x4f1eb4(0x109)][_0x4f1eb4(0x199)])_0x4de32f=_0x4f1eb4(0x154)+_0x5a3635[_0x4f1eb4(0x109)]['targetWebSearchTool'][_0x4f1eb4(0xe7)];else _0x5a3635[_0x4f1eb4(0x109)]['targetImageGenerator']&&(_0x4de32f=_0x4f1eb4(0x16f)+_0x5a3635[_0x4f1eb4(0x109)][_0x4f1eb4(0xd3)]['name']);}}return _0x4ea03c+_0x4de32f;}if(_0x4f1eb4(0x17b)in _0x5a3635){const _0x17f256=_0x1c53e9[_0x4f1eb4(0x156)]('[tool]\x20\x20\x20'),{functionName:_0x4c3214,functionArguments:_0x888a23,content:_0x1709f,newChat:_0xb93493}=_0x5a3635[_0x4f1eb4(0x17b)];let _0x292361=_0x3b98cc+'\x20'+_0x17f256+':\x20'+_0x1c53e9[_0x4f1eb4(0x180)](_0x4c3214);if(_0x888a23){const _0x21bfb1=typeof _0x888a23===_0x4f1eb4(0x12e)?_0x888a23:JSON[_0x4f1eb4(0xfa)](_0x888a23);_0x292361+='('+_0x21bfb1+')';}return _0x1709f&&(_0x292361+='\x0a'+_0x1c53e9[_0x4f1eb4(0x18f)](_0x1709f)),_0xb93493&&(_0x292361+=_0x1c53e9[_0x4f1eb4(0x18f)](_0x4f1eb4(0x1a1)+_0xb93493['id'])),_0x292361;}if(_0x4f1eb4(0x114)in _0x5a3635){const _0x1367a6=_0x1c53e9['blue']('[output]\x20');return _0x3b98cc+'\x20'+_0x1367a6+':\x20'+_0x5a3635[_0x4f1eb4(0x114)][_0x4f1eb4(0xe7)]+'\x20('+_0x5a3635['output']['content']['length']+_0x4f1eb4(0x187);}if(_0x4f1eb4(0xf0)in _0x5a3635){const _0x2c73a3=_0x1c53e9[_0x4f1eb4(0x182)](_0x4f1eb4(0x140)),{width:_0x354314,height:_0xfd977,headerText:_0x192c25}=_0x5a3635[_0x4f1eb4(0xf0)],_0x35967f=_0x192c25?_0x4f1eb4(0x15b)+_0x192c25:'';return _0x3b98cc+'\x20'+_0x2c73a3+':\x20'+_0x354314+'x'+_0xfd977+_0x35967f;}if('error'in _0x5a3635){const _0x179d9b=_0x1c53e9['red'](_0x4f1eb4(0x166));return _0x3b98cc+'\x20'+_0x179d9b+':\x20'+_0x5a3635['error'];}return _0x3b98cc+'\x20'+_0x1c53e9[_0x4f1eb4(0x18f)](_0x4f1eb4(0x149))+':\x20'+JSON['stringify'](_0x5a3635);}async function executeChatHistoryCommand(_0x521318,_0xa7f0c5){const _0x1d8c78=a19_0x4ab2,{options:_0x300fcc,args:_0x4bb348,tdx:_0x66dfe4}=_0x521318,_0x90d0db=_0x4bb348[0x0],_0xe7516c=_0x300fcc,_0x2a3945=_0xe7516c[_0x1d8c78(0xd9)];try{if(_0x2a3945&&_0x90d0db)return console[_0x1d8c78(0xeb)](_0x1d8c78(0xce)),console['error']('Usage:\x20'+_0xa7f0c5+'\x20--last'),0x1;if(!_0x90d0db&&!_0x2a3945&&_0x300fcc[_0x1d8c78(0x119)]!==undefined){const _0xd3c711=resolveLimit(_0x300fcc[_0x1d8c78(0x185)],DEFAULT_LLM_LIMIT),_0x30dec5=await withSpinner(_0x1d8c78(0x11c),()=>_0x66dfe4['llm']['chats'](_0xd3c711),{'verbose':_0x300fcc[_0x1d8c78(0x14f)]});return await handleSDKOutput(_0x30dec5[_0x1d8c78(0x11f)],_0x300fcc),0x0;}const _0x100d29=await getChatIdOrSelect(_0x66dfe4,_0x300fcc,_0x2a3945,_0x90d0db);if(!_0x100d29)return 0x0;return await displayChatHistory(_0x100d29,_0x66dfe4,_0x300fcc),0x0;}catch(_0x2cb3a5){return handleSDKError(_0x2cb3a5,_0x300fcc),0x1;}}async function displayChatHistory(_0xe2873a,_0x10e65c,_0x2b72c8){const _0x819e7=a19_0x4ab2,_0x26ee29=await withSpinner(_0x819e7(0xfd)+_0xe2873a+'\x27...',()=>_0x10e65c[_0x819e7(0xfe)]['history'](_0xe2873a),{'verbose':_0x2b72c8[_0x819e7(0x14f)]}),_0x2ef371=_0x26ee29['data'][_0x819e7(0x11f)]??[];if(_0x2ef371['length']===0x0){console['log'](_0x819e7(0x138));return;}if(_0x2b72c8[_0x819e7(0x119)]!==undefined)await handleSDKOutput(_0x2ef371,_0x2b72c8);else{const _0x140b6a=_0x2ef371[_0x819e7(0x19f)](_0x17ed6f=>formatChatHistoryEntry(_0x17ed6f,_0x2b72c8)),_0x3712a7=_0x140b6a[_0x819e7(0xc9)]('\x0a');await writeOutput(_0x3712a7,_0x2b72c8[_0x819e7(0x114)],'table');}}async function getChatIdOrSelect(_0x4b2c0e,_0x287b4a,_0x2ea0cc,_0xcab468){const _0x26ba3c=a19_0x4ab2;if(_0xcab468)return _0xcab468;if(_0x2ea0cc){const _0x38b065=await withSpinner(_0x26ba3c(0xd6),()=>_0x4b2c0e[_0x26ba3c(0xfe)][_0x26ba3c(0x14c)](0x1),{'verbose':_0x287b4a['verbose']});if(_0x38b065[_0x26ba3c(0x11f)]['length']===0x0)return console[_0x26ba3c(0x169)](_0x26ba3c(0x126)),undefined;return _0x38b065[_0x26ba3c(0x11f)][0x0]['id'];}const _0x5be8c1=await selectChatInteractively(_0x4b2c0e,_0x287b4a);if(!_0x5be8c1)return console[_0x26ba3c(0x169)](_0x26ba3c(0x15c)),undefined;return _0x5be8c1;}async function getProjectIdOrDefault(_0x1ac6f3){const _0x3fe37e=await getProjectWithName(_0x1ac6f3);return _0x3fe37e['id'];}async function getProjectWithName(_0x3a817f){const _0xcb20cb=a19_0x4ab2,{tdx:_0x7ef3d0,options:_0x55ebf8}=_0x3a817f,_0x437c6b=_0x55ebf8[_0xcb20cb(0x155)];if(_0x437c6b){const _0x3f3d09=await withSpinner(_0xcb20cb(0x175)+_0x437c6b+'\x27...',()=>_0x7ef3d0[_0xcb20cb(0xfe)]['resolveProjectId'](_0x437c6b),{'verbose':_0x55ebf8[_0xcb20cb(0x14f)]});return{'id':_0x3f3d09[_0xcb20cb(0x11f)],'name':_0x437c6b};}const _0x101073=_0x7ef3d0['llm']['getCurrentProject']();if(_0x101073){const _0xdbbdf4=await _0x7ef3d0[_0xcb20cb(0xfe)]['projects'](),_0x525970=_0xdbbdf4['find'](_0x26d18d=>_0x26d18d['id']===_0x101073);return{'id':_0x101073,'name':_0x525970?.[_0xcb20cb(0xfc)][_0xcb20cb(0xe7)]||_0xcb20cb(0x107)};}const _0x11b3df=await withSpinner(_0xcb20cb(0x184),()=>_0x7ef3d0[_0xcb20cb(0xfe)]['getOrCreateDefaultProject'](),{'verbose':_0x55ebf8['verbose']});return{'id':_0x11b3df[_0xcb20cb(0x11f)]['id'],'name':_0x11b3df['data'][_0xcb20cb(0xfc)][_0xcb20cb(0xe7)]};}function toLLMProjectInfo(_0x3e57f9){const _0x1c2b1f=a19_0x4ab2;return{'name':_0x3e57f9[_0x1c2b1f(0xfc)][_0x1c2b1f(0xe7)],'description':_0x3e57f9[_0x1c2b1f(0xfc)][_0x1c2b1f(0x116)],'createdAt':_0x3e57f9['attributes'][_0x1c2b1f(0x121)],'updatedAt':_0x3e57f9[_0x1c2b1f(0xfc)][_0x1c2b1f(0xf7)]};}function toAgentInfo(_0x49df8c){const _0x3fc315=a19_0x4ab2;return{'name':_0x49df8c[_0x3fc315(0xfc)][_0x3fc315(0xe7)],'description':_0x49df8c[_0x3fc315(0xfc)][_0x3fc315(0x116)],'prompt':truncatePrompt(_0x49df8c[_0x3fc315(0xfc)]['prompt']),'createdAt':_0x49df8c[_0x3fc315(0xfc)][_0x3fc315(0x121)],'updatedAt':_0x49df8c['attributes'][_0x3fc315(0xf7)]};}function truncatePrompt(_0x5043a5){const _0xd8009e=a19_0x4ab2;if(!_0x5043a5)return undefined;const _0x14d5fc=0x64;if(_0x5043a5[_0xd8009e(0x15e)]<=_0x14d5fc)return _0x5043a5;return _0x5043a5[_0xd8009e(0xcf)](0x0,_0x14d5fc)+'...';}export class LLMModelsCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0xfb);['description']=a19_0x4d8195(0x12f);async[a19_0x4d8195(0xd8)](_0x5e2373){const _0x241732=a19_0x4d8195,{options:_0x262360,tdx:_0xad5fca}=_0x5e2373;try{const _0x1e24ef=await withSpinner(_0x241732(0x19c),()=>_0xad5fca[_0x241732(0xfe)][_0x241732(0x19b)](),{'verbose':_0x262360[_0x241732(0x14f)]});return await handleSDKOutput(_0x1e24ef[_0x241732(0x11f)],_0x262360),0x0;}catch(_0x97b44f){return handleSDKError(_0x97b44f,_0x262360),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a19_0x4d8195(0x17a);['description']=a19_0x4d8195(0xe0);async['execute'](_0x4741f2){const _0x172486=a19_0x4d8195,{options:_0x35fb03,args:_0x1f16b0,tdx:_0x2a22f9}=_0x4741f2,_0x12d93a=getChalk(_0x35fb03),_0x588767=_0x35fb03[_0x172486(0xf4)];try{const _0x131a33=_0x1f16b0[0x0],_0x3fb698=resolveLimit(_0x35fb03[_0x172486(0x185)],DEFAULT_LLM_LIMIT),_0x18a568=await withSpinner(_0x172486(0xd5),()=>_0x2a22f9[_0x172486(0xfe)][_0x172486(0xc6)](_0x3fb698),{'verbose':_0x35fb03['verbose']});let _0x276924=_0x18a568[_0x172486(0x11f)];_0x131a33&&(_0x276924=_0x18a568[_0x172486(0x11f)][_0x172486(0x15f)](_0x33c36d=>matchGlobPattern(_0x33c36d[_0x172486(0xfc)][_0x172486(0xe7)],_0x131a33)));const _0x52c6c1=_0x35fb03[_0x172486(0x119)]===_0x172486(0x13c)||_0x35fb03[_0x172486(0x119)]===_0x172486(0x13d)||_0x35fb03[_0x172486(0x119)]===_0x172486(0x133)||_0x35fb03[_0x172486(0x119)]===_0x172486(0x172);if(_0x52c6c1){const _0x404d5f=_0x276924['map'](_0x3b898d=>({...toLLMProjectInfo(_0x3b898d),'url':getLLMProjectUrl(_0x588767,_0x3b898d['id'])}));await handleSDKOutput(_0x404d5f,_0x35fb03);}else{const _0x37cf64=[];if(_0x276924[_0x172486(0x15e)]===0x0)_0x37cf64[_0x172486(0x135)](_0x12d93a['dim'](_0x172486(0x10c)));else{const _0x47bbde=[..._0x276924][_0x172486(0x115)]((_0x5a7493,_0x490a9c)=>_0x5a7493[_0x172486(0xfc)]['name'][_0x172486(0x17f)](_0x490a9c['attributes'][_0x172486(0xe7)]));for(const _0x241c8d of _0x47bbde){const _0x20a612=getLLMProjectUrl(_0x588767,_0x241c8d['id']),_0x17f352=hyperlink(_0x241c8d[_0x172486(0xfc)][_0x172486(0xe7)],_0x20a612);_0x37cf64[_0x172486(0x135)](_0x172486(0x101)+_0x17f352);}_0x37cf64[_0x172486(0x135)](_0x12d93a[_0x172486(0x18f)](_0x276924[_0x172486(0x15e)]+'\x20project(s)'));}await writeOutput(_0x37cf64[_0x172486(0xc9)]('\x0a'),_0x35fb03[_0x172486(0x114)],_0x172486(0x133));}return 0x0;}catch(_0x463853){return handleSDKError(_0x463853,_0x35fb03),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x12b);[a19_0x4d8195(0x116)]=a19_0x4d8195(0x171);async[a19_0x4d8195(0xd8)](_0x1e1154){const _0x2c57e5=a19_0x4d8195,{options:_0x1eda17,args:_0x4d3d78,tdx:_0x5b1c04}=_0x1e1154,_0x26834b=getChalk(_0x1eda17),_0x21a22f=_0x1eda17['site'];try{const _0x569ea9=_0x4d3d78[0x0];let _0x2ab746=_0x569ea9,_0x51c911,_0x2b4a88;if(_0x569ea9&&_0x569ea9[_0x2c57e5(0x179)]('/')){const _0x5a519e=_0x569ea9[_0x2c57e5(0x18b)]('/');if(_0x5a519e[_0x2c57e5(0x15e)]===0x2){const [_0x29e493,_0x3673b1]=_0x5a519e,_0x1ad55c=await _0x5b1c04[_0x2c57e5(0xfe)][_0x2c57e5(0xc6)](),_0x3bc636=_0x1ad55c[_0x2c57e5(0x153)](_0x2d2ac7=>_0x2d2ac7[_0x2c57e5(0xfc)][_0x2c57e5(0xe7)][_0x2c57e5(0x108)]()===_0x29e493[_0x2c57e5(0x108)]());if(!_0x3bc636)throw new SDKError(ErrorCode[_0x2c57e5(0xd1)],'Project\x20not\x20found:\x20'+_0x29e493,undefined,{'helpText':_0x2c57e5(0x197)});_0x51c911=_0x3bc636['id'],_0x2b4a88=_0x3bc636[_0x2c57e5(0xfc)]['name'],_0x2ab746=_0x3673b1;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20path\x20syntax:\x20'+_0x569ea9,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x44f652=await getProjectWithName(_0x1e1154);_0x51c911=_0x44f652['id'],_0x2b4a88=_0x44f652[_0x2c57e5(0xe7)];}const _0x96e954=await withSpinner(_0x2c57e5(0xd4),()=>_0x5b1c04[_0x2c57e5(0xfe)]['agents'](_0x51c911),{'verbose':_0x1eda17[_0x2c57e5(0x14f)]});let _0x47f491=_0x96e954[_0x2c57e5(0x11f)];_0x2ab746&&(_0x47f491=_0x96e954['data']['filter'](_0x431b85=>matchGlobPattern(_0x431b85[_0x2c57e5(0xfc)][_0x2c57e5(0xe7)],_0x2ab746)));const _0x1b579e=_0x1eda17[_0x2c57e5(0x119)]===_0x2c57e5(0x13c)||_0x1eda17['format']===_0x2c57e5(0x13d)||_0x1eda17[_0x2c57e5(0x119)]===_0x2c57e5(0x133)||_0x1eda17[_0x2c57e5(0x119)]==='tsv';if(_0x1b579e){const _0x3f22e5=_0x47f491[_0x2c57e5(0x19f)](_0x2134e6=>({...toAgentInfo(_0x2134e6),'chatUrl':getLLMAgentChatUrl(_0x21a22f,_0x51c911,_0x2134e6['id'])}));await handleSDKOutput(_0x3f22e5,_0x1eda17);}else{const _0x1f1b6d=[];_0x1f1b6d[_0x2c57e5(0x135)](_0x26834b[_0x2c57e5(0x18f)]('['+_0x2b4a88+']'));if(_0x47f491[_0x2c57e5(0x15e)]===0x0)_0x1f1b6d['push'](_0x26834b[_0x2c57e5(0x18f)]('No\x20agents\x20found'));else{const _0x3f8665=[..._0x47f491][_0x2c57e5(0x115)]((_0x53f084,_0x435d55)=>_0x53f084[_0x2c57e5(0xfc)]['name']['localeCompare'](_0x435d55[_0x2c57e5(0xfc)][_0x2c57e5(0xe7)]));for(const _0x3031bb of _0x3f8665){const _0x158482=getLLMAgentChatUrl(_0x21a22f,_0x51c911,_0x3031bb['id']),_0x2e5e8d=hyperlink(_0x3031bb[_0x2c57e5(0xfc)]['name'],_0x158482);_0x1f1b6d[_0x2c57e5(0x135)](_0x2c57e5(0x19e)+_0x2e5e8d);}_0x1f1b6d[_0x2c57e5(0x135)](_0x26834b['dim'](_0x47f491[_0x2c57e5(0x15e)]+_0x2c57e5(0xf9)));}await writeOutput(_0x1f1b6d[_0x2c57e5(0xc9)]('\x0a'),_0x1eda17[_0x2c57e5(0x114)],_0x2c57e5(0x133));}return 0x0;}catch(_0x1e6c03){return handleSDKError(_0x1e6c03,_0x1eda17),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a19_0x4d8195(0xe7)]='llm:agent:show';['description']='Show\x20agent\x20details';async[a19_0x4d8195(0xd8)](_0x4d80d7){const _0xdce669=a19_0x4d8195,{options:_0x4f03c1,args:_0x177ac6,tdx:_0x21ad83}=_0x4d80d7;if(_0x177ac6[_0xdce669(0x15e)]===0x0)return console[_0xdce669(0xeb)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0xdce669(0xeb)](_0xdce669(0x10f)),0x1;const _0x4b1f7f=_0x177ac6[0x0];try{const _0x21e8c0=await getProjectIdOrDefault(_0x4d80d7),_0x3174c6=await withSpinner(_0xdce669(0x141)+_0x4b1f7f+'\x27...',()=>_0x21ad83[_0xdce669(0xfe)][_0xdce669(0xdf)](_0x4b1f7f,_0x21e8c0),{'verbose':_0x4f03c1[_0xdce669(0x14f)]}),_0x14f1ba=await withSpinner(_0xdce669(0x11a),()=>_0x21ad83['llm'][_0xdce669(0x173)](_0x3174c6['data']),{'verbose':_0x4f03c1[_0xdce669(0x14f)]});return await handleSDKOutput([_0x14f1ba['data']],_0x4f03c1),0x0;}catch(_0x25ba5b){return handleSDKError(_0x25ba5b,_0x4f03c1),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x15d);[a19_0x4d8195(0x116)]=a19_0x4d8195(0xe2);async[a19_0x4d8195(0xd8)](_0x595d10){const _0x14a985=a19_0x4d8195,{options:_0x228864,args:_0x24d534,tdx:_0x9a49c1}=_0x595d10;if(_0x24d534[_0x14a985(0x15e)]===0x0)return console[_0x14a985(0xeb)](_0x14a985(0xdd)),console['error'](_0x14a985(0x145)),console['error'](_0x14a985(0xff)),0x1;const _0xde862e=_0x24d534[0x0],_0x2e070e=_0x228864,_0x13c5e8=_0x2e070e[_0x14a985(0x194)],_0x16bd44=_0x2e070e[_0x14a985(0x142)]||_0x14a985(0x134),_0x2b3741=_0x2e070e['starterMessage'],_0x212e2e=_0x2e070e[_0x14a985(0x16b)]?Number(_0x2e070e[_0x14a985(0x16b)]):undefined,_0x4998ba=_0x2e070e[_0x14a985(0x10d)]?Number(_0x2e070e['temperature']):undefined;try{let _0x460af5,_0x555f5f;if(_0xde862e['includes']('/')){const _0x3242d4=_0xde862e['split']('/');if(_0x3242d4['length']===0x2){const [_0x973f27,_0x448f2e]=_0x3242d4,_0x195cff=await withSpinner(_0x14a985(0x175)+_0x973f27+_0x14a985(0x150),()=>_0x9a49c1[_0x14a985(0xfe)][_0x14a985(0x14b)](_0x973f27),{'verbose':_0x228864['verbose']});_0x460af5=_0x195cff[_0x14a985(0x11f)],_0x555f5f=_0x448f2e;}else throw new SDKError(ErrorCode[_0x14a985(0x176)],'Invalid\x20path\x20syntax:\x20'+_0xde862e,undefined,{'helpText':_0x14a985(0x139)});}else _0x460af5=await getProjectIdOrDefault(_0x595d10),_0x555f5f=_0xde862e;const _0xe2a114=await withSpinner(_0x14a985(0x159)+_0x555f5f+_0x14a985(0x150),()=>_0x9a49c1[_0x14a985(0xfe)]['createAgent']({'name':_0x555f5f,'projectId':_0x460af5,'modelType':_0x16bd44,'systemPrompt':_0x13c5e8,'starterMessage':_0x2b3741,'maxToolIterations':_0x212e2e,'temperature':_0x4998ba}),{'verbose':_0x228864['verbose']});return console['log'](_0x14a985(0x105)+_0xe2a114[_0x14a985(0x11f)]['id']),await handleSDKOutput([_0xe2a114['data']],_0x228864),0x0;}catch(_0x153b9b){return handleSDKError(_0x153b9b,_0x228864),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x158);[a19_0x4d8195(0x116)]=a19_0x4d8195(0x170);async['execute'](_0x1125d7){const _0xe33163=a19_0x4d8195,{options:_0x22f037,args:_0x4afb1b,tdx:_0x55b0ad}=_0x1125d7;if(_0x4afb1b[_0xe33163(0x15e)]===0x0)return console[_0xe33163(0xeb)](_0xe33163(0xdd)),console[_0xe33163(0xeb)](_0xe33163(0xec)),0x1;const _0x20d9bc=_0x4afb1b[0x0],_0x3504f5=_0x22f037,_0x1cfd59=_0x3504f5[_0xe33163(0xe7)],_0x1f2d2b=_0x3504f5[_0xe33163(0x137)],_0x17cf58=_0x3504f5['description'],_0x4b0c5e=_0x3504f5[_0xe33163(0xdb)];if(!_0x1cfd59&&!_0x1f2d2b&&!_0x17cf58&&!_0x4b0c5e)return console[_0xe33163(0xeb)](_0xe33163(0xd0)),console['error'](_0xe33163(0x18c)),0x1;try{const _0x4921fc=await getProjectIdOrDefault(_0x1125d7),_0x8ea125=await withSpinner('Resolving\x20agent\x20\x27'+_0x20d9bc+_0xe33163(0x150),()=>_0x55b0ad[_0xe33163(0xfe)][_0xe33163(0xdf)](_0x20d9bc,_0x4921fc),{'verbose':_0x22f037[_0xe33163(0x14f)]}),_0x28bc2a=_0x8ea125[_0xe33163(0x11f)],_0x22385d=await withSpinner(_0xe33163(0x17c),()=>_0x55b0ad[_0xe33163(0xfe)]['updateAgent'](_0x28bc2a,{'name':_0x1cfd59,'prompt':_0x1f2d2b,'description':_0x17cf58,'starterMessage':_0x4b0c5e}),{'verbose':_0x22f037[_0xe33163(0x14f)]});return console['log']('Agent\x20updated:\x20'+_0x22385d[_0xe33163(0x11f)]['id']),await handleSDKOutput([_0x22385d[_0xe33163(0x11f)]],_0x22f037),0x0;}catch(_0x3c6c82){return handleSDKError(_0x3c6c82,_0x22f037),0x1;}}}function a19_0x4bd4(){const _0x4ef41a=['llm:agent:create','length','filter','d\x20ago','targetKnowledgeBase','agents','Create\x20a\x20new\x20LLM\x20project','Delete\x20an\x20agent','message','[error]\x20\x20','79384RNWCpm','8462083zQeOJb','log','rmSync','maxToolIterations','deleteAgent','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','[input]\x20\x20','\x20->\x20ImageGen:','Update\x20an\x20existing\x20agent','List\x20agents\x20in\x20current\x20project','tsv','agent','\x20\x20Cause:\x20','Resolving\x20project\x20\x27','INVALID_ARGUMENT','Project\x20deleted:\x20','llm:project:create','includes','llm:projects','tool','Updating\x20agent...','llm:agent:delete','1059992nyMNwY','localeCompare','bold','input','blue','\x0aStack\x20trace:','Getting\x20default\x20project...','limit','select','\x20bytes)','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','cause','deleteProject','split','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','firstInputContent','[content]','dim','220dLEPOH','set','floor','getTime','systemPrompt','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','chatId','targetWebSearchTool','Project\x20created:\x20','models','Fetching\x20available\x20models...','Restoring\x20project\x20from\x20\x27','🤖\x20','map','substring','\x20→\x20chat:\x20','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Error:\x20Project\x20name\x20is\x20required','prompts','.llm','projects','tdx\x20chats','Project\x20backed\x20up\x20to:\x20','join','knowledgeBases','createProject','get','\x20\x20Prompts:\x20','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','slice','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','LLM_PROJECT_NOT_FOUND','Restore\x20cancelled.','targetImageGenerator','Fetching\x20agents...','Fetching\x20projects...','Fetching\x20most\x20recent\x20chat...','counts','execute','last','[tool_call]','starterMessage','setCurrentProject','Error:\x20Agent\x20name\x20is\x20required','\x20\x20Integrations:\x20','resolveAgentId','List\x20all\x20LLM\x20projects','lastConversationAt','Create\x20a\x20new\x20agent\x20in\x20current\x20project','29140716vsrGOD','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','Deleting\x20agent...','content','name','llm:use','Project\x20restored:\x20','Output\x20directory\x20\x27','error','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','cyan','Analyzing\x20project\x20\x27','image','agentId','Load\x20more...','Backing\x20up\x20project\x20\x27','site','A\x20project\x20named\x20\x27','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','updatedAt','(no\x20agent)','\x20agent(s)','stringify','llm:models','attributes','Fetching\x20chat\x20history\x20for\x20\x27','llm','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Deleting\x20project\x20\x27','⚒️\x20','\x20->\x20KB:','Set\x20current\x20project\x20context','restoreProject','Agent\x20created:\x20','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','Unknown','toLowerCase','tool_call','tdx\x20llm\x20history','__load_more__','No\x20projects\x20found','temperature','10NsnQwq','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x20\x20Agents:\x20','projectName','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','existsSync','output','sort','description','9eovHCa','Agent\x20deleted:\x20','format','Fetching\x20agent...','short','Fetching\x20chat\x20sessions...','6psJwci','Error:\x20','data','yes','createdAt','\x20\x20Knowledge\x20Bases:\x20','green','503187CXTsKu','default','No\x20chat\x20sessions\x20found.','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','dryRun','integrations','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','llm:agents','en-US','Delete\x20an\x20LLM\x20project','string','List\x20available\x20LLM\x20models','Project\x20context\x20set\x20to:\x20','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','table','claude-4.5-haiku','push','toLocaleDateString','prompt','No\x20messages\x20found\x20in\x20chat\x20history.','Use\x20format:\x20project-name/agent-name','Error:\x20Backup\x20folder\x20path\x20is\x20required','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','json','jsonl','51573cbiqHf','projectId','[image]\x20\x20','Resolving\x20agent\x20\x27','model','7987920KbpbDG','Setting\x20project\x20context\x20to\x20\x27','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','exportedFrom','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','[unknown]','yellow','resolveProjectId','chats','llm:project:restore','all','verbose','\x27...','outputDir','just\x20now','find','\x20->\x20WebSearch:','llmProject','magenta','getBackupMetadata','llm:agent:update','Creating\x20agent\x20\x27','llm:project:backup','\x20-\x20','\x0aCancelled'];a19_0x4bd4=function(){return _0x4ef41a;};return a19_0x4bd4();}export class LLMAgentDeleteCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x17d);[a19_0x4d8195(0x116)]=a19_0x4d8195(0x164);async['execute'](_0x7ba6cf){const _0x3312cf=a19_0x4d8195,{options:_0x3e5b96,args:_0x5512bf,tdx:_0x3aa832}=_0x7ba6cf;if(_0x5512bf[_0x3312cf(0x15e)]===0x0)return console[_0x3312cf(0xeb)](_0x3312cf(0xdd)),console[_0x3312cf(0xeb)](_0x3312cf(0xe4)),0x1;const _0x51b918=_0x5512bf[0x0];try{const _0x5045cc=await getProjectIdOrDefault(_0x7ba6cf),_0x54e228=await withSpinner(_0x3312cf(0x141)+_0x51b918+_0x3312cf(0x150),()=>_0x3aa832[_0x3312cf(0xfe)][_0x3312cf(0xdf)](_0x51b918,_0x5045cc),{'verbose':_0x3e5b96[_0x3312cf(0x14f)]}),_0x3d9920=_0x54e228['data'];return await withSpinner(_0x3312cf(0xe5),()=>_0x3aa832[_0x3312cf(0xfe)][_0x3312cf(0x16c)](_0x3d9920),{'verbose':_0x3e5b96[_0x3312cf(0x14f)]}),console['log'](_0x3312cf(0x118)+_0x3d9920),0x0;}catch(_0x524c44){return handleSDKError(_0x524c44,_0x3e5b96),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a19_0x4d8195(0xe7)]='llm:history';['description']='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async['execute'](_0x15dedf){const _0x1263a9=a19_0x4d8195;return executeChatHistoryCommand(_0x15dedf,_0x1263a9(0x10a));}}export class LLMUseCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0xe8);[a19_0x4d8195(0x116)]=a19_0x4d8195(0x103);async[a19_0x4d8195(0xd8)](_0x3b2788){const _0x30deda=a19_0x4d8195,{options:_0x519330,args:_0x13f727,tdx:_0x3b9b2f}=_0x3b2788;if(_0x13f727[_0x30deda(0x15e)]===0x0)return console['error'](_0x30deda(0x1a3)),console[_0x30deda(0xeb)](_0x30deda(0x1a2)),0x1;const _0x303357=_0x13f727[0x0];try{return await withSpinner(_0x30deda(0x144)+_0x303357+'\x27...',()=>_0x3b9b2f[_0x30deda(0xfe)][_0x30deda(0xdc)](_0x303357),{'verbose':_0x519330['verbose']}),console[_0x30deda(0x169)](_0x30deda(0x130)+_0x303357),0x0;}catch(_0x4deded){return handleSDKError(_0x4deded,_0x519330),0x1;}}}function a19_0x4ab2(_0x3faa6c,_0x590229){_0x3faa6c=_0x3faa6c-0xc4;const _0x4bd4b3=a19_0x4bd4();let _0x4ab236=_0x4bd4b3[_0x3faa6c];return _0x4ab236;}export class LLMProjectCreateCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x178);[a19_0x4d8195(0x116)]=a19_0x4d8195(0x163);async[a19_0x4d8195(0xd8)](_0x1dc661){const _0x10812c=a19_0x4d8195,{options:_0x526055,args:_0x256e83,tdx:_0x1ed2a6}=_0x1dc661;if(_0x256e83[_0x10812c(0x15e)]===0x0)return console[_0x10812c(0xeb)](_0x10812c(0x1a3)),console['error']('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x47f831=_0x256e83[0x0],_0xf2491f=_0x526055,_0x1acb17=_0xf2491f[_0x10812c(0x116)];try{const _0x4b2090=await withSpinner('Creating\x20project\x20\x27'+_0x47f831+'\x27...',()=>_0x1ed2a6[_0x10812c(0xfe)][_0x10812c(0xcb)]({'name':_0x47f831,'description':_0x1acb17}),{'verbose':_0x526055[_0x10812c(0x14f)]});console[_0x10812c(0x169)](_0x10812c(0x19a)+_0x4b2090[_0x10812c(0x11f)]['id']);const _0x3095bb=toLLMProjectInfo(_0x4b2090['data']);return await handleSDKOutput([_0x3095bb],_0x526055),0x0;}catch(_0x5c7d1f){return handleSDKError(_0x5c7d1f,_0x526055),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']='llm:project:delete';['description']=a19_0x4d8195(0x12d);async['execute'](_0x37a405){const _0x4e0182=a19_0x4d8195,{options:_0x4d5bac,args:_0x1eeded,tdx:_0x5b2df6}=_0x37a405;if(_0x1eeded[_0x4e0182(0x15e)]===0x0)return console[_0x4e0182(0xeb)](_0x4e0182(0x1a3)),console[_0x4e0182(0xeb)](_0x4e0182(0x132)),0x1;const _0x5b5757=_0x1eeded[0x0];try{return await withSpinner(_0x4e0182(0x100)+_0x5b5757+_0x4e0182(0x150),()=>_0x5b2df6[_0x4e0182(0xfe)][_0x4e0182(0x18a)](_0x5b5757),{'verbose':_0x4d5bac[_0x4e0182(0x14f)]}),console[_0x4e0182(0x169)](_0x4e0182(0x177)+_0x5b5757),0x0;}catch(_0x4026f8){return handleSDKError(_0x4026f8,_0x4d5bac),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a19_0x4d8195(0x15a);[a19_0x4d8195(0x116)]='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)';async[a19_0x4d8195(0xd8)](_0xef08b1){const _0x3a353f=a19_0x4d8195,{options:_0x433e1e,args:_0x204484,tdx:_0x34d089}=_0xef08b1,_0x3a2c94=getChalk(_0x433e1e);console[_0x3a353f(0x169)](_0x3a2c94['yellow'](_0x3a353f(0x148))),console['log'](_0x3a2c94[_0x3a353f(0x14a)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x3a353f(0x169)](_0x3a2c94[_0x3a353f(0x18f)]('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console[_0x3a353f(0x169)]();if(_0x204484[_0x3a353f(0x15e)]===0x0)return console[_0x3a353f(0xeb)](_0x3a353f(0x1a3)),console[_0x3a353f(0xeb)](_0x3a353f(0x106)),0x1;const _0x3f8f5b=_0x204484[0x0],_0x40f8bb=_0x433e1e,_0x55333a=_0x40f8bb[_0x3a353f(0x114)],_0x302bc8=_0x40f8bb[_0x3a353f(0x128)];try{const _0x6136a5=_0x55333a||_0x3f8f5b+_0x3a353f(0xc5);if(a19_0xcb9814[_0x3a353f(0x113)](_0x6136a5)&&!_0x302bc8){if(!_0x433e1e[_0x3a353f(0x120)]){const _0x494934=await confirm(_0x3a353f(0xea)+_0x6136a5+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x494934)return console[_0x3a353f(0x169)]('Backup\x20cancelled.'),0x0;}a19_0xcb9814[_0x3a353f(0x16a)](_0x6136a5,{'recursive':!![]});}const _0x36e740=await withSpinner(_0x302bc8?_0x3a353f(0xef)+_0x3f8f5b+_0x3a353f(0x150):_0x3a353f(0xf3)+_0x3f8f5b+_0x3a353f(0x150),()=>_0x34d089['llm']['backupProject'](_0x3f8f5b,_0x55333a,{'dryRun':_0x302bc8}),{'verbose':_0x433e1e[_0x3a353f(0x14f)]}),_0x4445e0=_0x36e740['data'];return _0x302bc8?console[_0x3a353f(0x169)](_0x3a353f(0xed)+_0x4445e0['outputDir']):console[_0x3a353f(0x169)](_0x3a353f(0xc8)+_0x4445e0[_0x3a353f(0x151)]),console[_0x3a353f(0x169)](_0x3a353f(0x110)+_0x4445e0[_0x3a353f(0xd7)][_0x3a353f(0x162)]),console[_0x3a353f(0x169)](_0x3a353f(0x122)+_0x4445e0[_0x3a353f(0xd7)]['knowledgeBases']),console['log'](_0x3a353f(0xcd)+_0x4445e0[_0x3a353f(0xd7)]['prompts']),console[_0x3a353f(0x169)]('\x20\x20Integrations:\x20'+_0x4445e0[_0x3a353f(0xd7)][_0x3a353f(0x129)]),(_0x433e1e[_0x3a353f(0x119)]===_0x3a353f(0x13c)||_0x433e1e['format']===_0x3a353f(0x13d))&&await handleSDKOutput([_0x4445e0],_0x433e1e),0x0;}catch(_0x1d7ecb){return handleSDKError(_0x1d7ecb,_0x433e1e),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x14d);['description']=a19_0x4d8195(0x16d);async[a19_0x4d8195(0xd8)](_0x2a5b87){const _0x419d7b=a19_0x4d8195,{options:_0x30c72d,args:_0x28ed6c,tdx:_0x4401c3}=_0x2a5b87,_0x417cb7=getChalk(_0x30c72d);console[_0x419d7b(0x169)](_0x417cb7[_0x419d7b(0x14a)](_0x419d7b(0x188))),console['log'](_0x417cb7[_0x419d7b(0x14a)](_0x419d7b(0x195))),console['log'](_0x417cb7[_0x419d7b(0x18f)]('\x20\x20\x20Examples:')),console[_0x419d7b(0x169)](_0x417cb7[_0x419d7b(0x18f)](_0x419d7b(0x196))),console[_0x419d7b(0x169)](_0x417cb7[_0x419d7b(0x18f)](_0x419d7b(0x12a))),console[_0x419d7b(0x169)]();if(_0x28ed6c['length']===0x0)return console['error'](_0x419d7b(0x13a)),console['error'](_0x419d7b(0x147)),0x1;const _0xb18c46=_0x28ed6c[0x0],_0x2a2e84=_0x30c72d,_0x3b0429=_0x2a2e84[_0x419d7b(0xe7)],_0x2a9579=_0x2a2e84[_0x419d7b(0x128)];try{if(!_0x2a9579){const _0x3a828d=_0x4401c3[_0x419d7b(0xfe)][_0x419d7b(0x157)](_0xb18c46),_0x28ceff=_0x3b0429||_0x3a828d[_0x419d7b(0x146)]['projectName'],_0x55b1e2=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x4401c3[_0x419d7b(0xfe)][_0x419d7b(0xc6)](),{'verbose':_0x30c72d['verbose']}),_0x501380=_0x55b1e2[_0x419d7b(0x11f)][_0x419d7b(0x153)](_0x16d865=>_0x16d865[_0x419d7b(0xfc)][_0x419d7b(0xe7)]===_0x28ceff);if(_0x501380&&!_0x30c72d[_0x419d7b(0x120)]){const _0x16a096=await confirm(_0x419d7b(0xf5)+_0x28ceff+_0x419d7b(0x13b));if(!_0x16a096)return console[_0x419d7b(0x169)](_0x419d7b(0xd2)),0x0;}}const _0x51cdbd=await withSpinner(_0x2a9579?'Validating\x20backup\x20from\x20\x27'+_0xb18c46+_0x419d7b(0x150):_0x419d7b(0x19d)+_0xb18c46+_0x419d7b(0x150),()=>_0x4401c3[_0x419d7b(0xfe)][_0x419d7b(0x104)](_0xb18c46,{'name':_0x3b0429,'dryRun':_0x2a9579}),{'verbose':_0x30c72d['verbose']}),_0x570edc=_0x51cdbd[_0x419d7b(0x11f)];return _0x570edc['sourceSite']&&console[_0x419d7b(0x169)](_0x419d7b(0xf6)+_0x570edc['sourceSite']+'\x27'),_0x2a9579?console['log'](_0x419d7b(0x127)+_0x570edc[_0x419d7b(0x111)]):console[_0x419d7b(0x169)](_0x419d7b(0xe9)+_0x570edc[_0x419d7b(0x111)]+'\x20('+_0x570edc[_0x419d7b(0x13f)]+')'),console[_0x419d7b(0x169)](_0x419d7b(0x110)+_0x570edc[_0x419d7b(0xd7)][_0x419d7b(0x162)]),console[_0x419d7b(0x169)](_0x419d7b(0x122)+_0x570edc[_0x419d7b(0xd7)][_0x419d7b(0xca)]),console[_0x419d7b(0x169)](_0x419d7b(0xcd)+_0x570edc[_0x419d7b(0xd7)]['prompts']),console[_0x419d7b(0x169)](_0x419d7b(0xde)+_0x570edc[_0x419d7b(0xd7)][_0x419d7b(0x129)]),(_0x30c72d['format']===_0x419d7b(0x13c)||_0x30c72d[_0x419d7b(0x119)]===_0x419d7b(0x13d))&&await handleSDKOutput([_0x570edc],_0x30c72d),0x0;}catch(_0x88bda5){return handleSDKError(_0x88bda5,_0x30c72d),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x221a2a,_0x4ee3eb){const _0x51e601=a19_0x4d8195,_0x497b54=_0x4ee3eb[_0x51e601(0x185)]||CHAT_SELECTOR_PAGE_SIZE;let _0x3c1ef9=0x0,_0x22eadd=[];const _0x1e17ec=(await import(_0x51e601(0xc4)))[_0x51e601(0x125)],_0x382792=getChalk(_0x4ee3eb);while(!![]){const _0x5493ec=await withSpinner(_0x51e601(0x11c),()=>_0x221a2a[_0x51e601(0xfe)][_0x51e601(0x14c)](_0x497b54+_0x3c1ef9),{'verbose':_0x4ee3eb[_0x51e601(0x14f)]});_0x22eadd=_0x5493ec[_0x51e601(0x11f)];const _0x3e532c=_0x22eadd[_0x51e601(0xcf)](_0x3c1ef9,_0x3c1ef9+_0x497b54),_0x32063e=_0x22eadd[_0x51e601(0x15e)]>_0x3c1ef9+_0x497b54,_0x4fe74a=[...new Set(_0x3e532c['map'](_0x1169bc=>_0x1169bc[_0x51e601(0xfc)]['agentId'])[_0x51e601(0x15f)](_0x1c1112=>_0x1c1112!==undefined))],_0x5b4ef5=new Map();await Promise[_0x51e601(0x14e)](_0x4fe74a[_0x51e601(0x19f)](async _0x100dbb=>{const _0x44934a=_0x51e601;try{const _0x289ab5=await _0x221a2a[_0x44934a(0xfe)][_0x44934a(0x173)](_0x100dbb);_0x5b4ef5[_0x44934a(0x191)](_0x100dbb,_0x289ab5[_0x44934a(0xfc)][_0x44934a(0xe7)]);}catch{_0x5b4ef5[_0x44934a(0x191)](_0x100dbb,_0x100dbb);}}));const _0x1d2b51=_0x3e532c['map'](_0x24160e=>{const _0x55a91c=_0x51e601,_0x196a8d=_0x24160e[_0x55a91c(0xfc)][_0x55a91c(0x18d)]||'(no\x20message)',_0x331974=_0x196a8d['split']('\x0a')[0x0],_0x5f389c=_0x331974[_0x55a91c(0x15e)]>0x50?_0x331974[_0x55a91c(0x1a0)](0x0,0x4d)+'...':_0x331974,_0x3f7b6c=_0x24160e[_0x55a91c(0xfc)]['agentId']?_0x5b4ef5[_0x55a91c(0xcc)](_0x24160e[_0x55a91c(0xfc)][_0x55a91c(0xf1)])||_0x24160e[_0x55a91c(0xfc)][_0x55a91c(0xf1)]:_0x55a91c(0xf8),_0xa82d5=_0x24160e[_0x55a91c(0xfc)][_0x55a91c(0xe1)]||_0x24160e[_0x55a91c(0xfc)][_0x55a91c(0xf7)],_0x111a31=new Date(_0xa82d5),_0x1dda88=new Date(),_0x511cc2=_0x1dda88[_0x55a91c(0x193)]()-_0x111a31[_0x55a91c(0x193)](),_0x1e5be2=Math['floor'](_0x511cc2/0xea60),_0x2ec5e4=Math[_0x55a91c(0x192)](_0x511cc2/0x36ee80),_0x423a3b=Math[_0x55a91c(0x192)](_0x511cc2/0x5265c00);let _0x4c5048;if(_0x1e5be2<0x1)_0x4c5048=_0x55a91c(0x152);else{if(_0x1e5be2<0x3c)_0x4c5048=_0x1e5be2+'m\x20ago';else{if(_0x2ec5e4<0x18)_0x4c5048=_0x2ec5e4+'h\x20ago';else _0x423a3b<0x7?_0x4c5048=_0x423a3b+_0x55a91c(0x160):_0x4c5048=_0x111a31[_0x55a91c(0x136)](_0x55a91c(0x12c),{'month':_0x55a91c(0x11b),'day':'numeric'});}}return{'title':_0x5f389c+'\x20'+_0x382792[_0x55a91c(0x18f)]('['+_0x3f7b6c+']\x20'+_0x4c5048),'value':_0x24160e['id']};});_0x32063e&&_0x1d2b51[_0x51e601(0x135)]({'title':_0x382792[_0x51e601(0xee)](_0x51e601(0xf2)),'value':'__load_more__'});const _0x15c0e2=await _0x1e17ec({'type':_0x51e601(0x186),'name':'chatId','message':'Select\x20a\x20chat\x20session:','choices':_0x1d2b51,'hint':_0x51e601(0x131)});if(!_0x15c0e2[_0x51e601(0x198)])return undefined;if(_0x15c0e2[_0x51e601(0x198)]===_0x51e601(0x10b)){_0x3c1ef9+=_0x497b54;continue;}return _0x15c0e2[_0x51e601(0x198)];}}export class ChatsCommand extends BaseCommand{[a19_0x4d8195(0xe7)]=a19_0x4d8195(0x14c);[a19_0x4d8195(0x116)]=a19_0x4d8195(0x112);async[a19_0x4d8195(0xd8)](_0x5d2932){const _0x1e8479=a19_0x4d8195;return executeChatHistoryCommand(_0x5d2932,_0x1e8479(0xc7));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x26131a=a20_0x1c05;function a20_0x1c05(_0xefa699,_0xd67c42){_0xefa699=_0xefa699-0x1be;const _0xce4e6b=a20_0xce4e();let _0x1c0520=_0xce4e6b[_0xefa699];return _0x1c0520;}function a20_0xce4e(){const _0x4f0c5f=['\x20\x20{','site','Resolving\x20project...','828196kmvtlK','llmProject','1652094CWUjXs','close','llm','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20Project:','\x20\x20}','stop','\x20\x20Address:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,','dim','projects','llm:proxy','log','yellow','\x0a\x0aShutting\x20down\x20proxy\x20server...','Server\x20Configuration:','execute','35240FwkGfi','project','created\x20on-demand\x20per\x20model','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','green','server','\x20is\x20unavailable,\x20using\x20port\x20','45gDMsdW','✓\x20Proxy\x20server\x20stopped','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','getOrCreateDefaultProject','\x0aTesting\x20with\x20Agent\x20SDK:','1568648OoWHpv','49qsJppw','white','description','\x27\x20not\x20found','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','logger','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','start','Port\x20','\x0aClaude\x20Code\x20Configuration:','logLevel','4127949chEVaq','10638cwBSKF','attributes','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x20\x20Site:','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','init','cyan','find','http://0.0.0.0:','145lAbSlP','4466ZQSTMN','name','SIGTERM','port','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','209936jgXSSI'];a20_0xce4e=function(){return _0x4f0c5f;};return a20_0xce4e();}(function(_0x19100c,_0x2ddb69){const _0x24e38a=a20_0x1c05,_0x5f32db=_0x19100c();while(!![]){try{const _0x2e4626=-parseInt(_0x24e38a(0x1c5))/0x1+parseInt(_0x24e38a(0x1f1))/0x2*(-parseInt(_0x24e38a(0x1df))/0x3)+-parseInt(_0x24e38a(0x1c1))/0x4*(-parseInt(_0x24e38a(0x1fa))/0x5)+-parseInt(_0x24e38a(0x1c7))/0x6+-parseInt(_0x24e38a(0x1e5))/0x7*(parseInt(_0x24e38a(0x1e4))/0x8)+parseInt(_0x24e38a(0x1f0))/0x9+parseInt(_0x24e38a(0x1d8))/0xa*(parseInt(_0x24e38a(0x1fb))/0xb);if(_0x2e4626===_0x2ddb69)break;else _0x5f32db['push'](_0x5f32db['shift']());}catch(_0x5c0a69){_0x5f32db['push'](_0x5f32db['shift']());}}}(a20_0xce4e,0xd0df8));import a20_0x5d2b09 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x4381c4,_0x2f6968){const _0x4f7864=a20_0x1c05,{tdx:_0x4af599,options:_0x1720dd}=_0x4381c4,_0xcc7291=_0x2f6968||_0x1720dd[_0x4f7864(0x1c6)];if(_0xcc7291){const _0x509964=await _0x4af599['llm'][_0x4f7864(0x1d1)](),_0x5ec000=_0x509964[_0x4f7864(0x1f8)](_0x2e6d15=>_0x2e6d15[_0x4f7864(0x1f2)][_0x4f7864(0x1fc)]===_0xcc7291);if(!_0x5ec000)throw new SDKError(ErrorCode['NOT_FOUND'],'Project\x20\x27'+_0xcc7291+_0x4f7864(0x1e8),undefined,{'helpText':_0x4f7864(0x1ca)});return _0x5ec000['id'];}const _0x3c85fd=await _0x4af599[_0x4f7864(0x1c9)][_0x4f7864(0x1e2)]();return _0x3c85fd['id'];}export class LLMProxyCommand extends BaseCommand{[a20_0x26131a(0x1fc)]=a20_0x26131a(0x1d2);[a20_0x26131a(0x1e7)]=a20_0x26131a(0x1eb);['server'];['logger'];async[a20_0x26131a(0x1d7)](_0x1132e3){const _0xa4bdbf=a20_0x26131a,{tdx:_0x21c6a2,options:_0x3cee9d}=_0x1132e3;try{const _0x82530=_0x3cee9d,_0x21a82e=_0x82530[_0xa4bdbf(0x1bf)]||0xfa0,_0x2262b7=_0x82530[_0xa4bdbf(0x1d9)],_0x2fb6f1=await findAvailablePort(_0x21a82e);console['log'](a20_0x5d2b09['dim'](_0xa4bdbf(0x1c4)));const _0x4a8bf1=await getProjectIdOrDefault(_0x1132e3,_0x2262b7),_0x5ab54d=await _0x21c6a2[_0xa4bdbf(0x1c9)][_0xa4bdbf(0x1d1)](),_0x1c374e=_0x5ab54d['find'](_0x3fcd74=>_0x3fcd74['id']===_0x4a8bf1);this['logger']=new TDXLogger(_0x3cee9d[_0xa4bdbf(0x1ef)]),await this[_0xa4bdbf(0x1ea)][_0xa4bdbf(0x1f6)](),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09['dim']('Starting\x20proxy\x20server...'));_0x2fb6f1!==_0x21a82e&&console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d4)](_0xa4bdbf(0x1ed)+_0x21a82e+_0xa4bdbf(0x1de)+_0x2fb6f1));this['server']=new ProxyServer({'port':_0x2fb6f1,'projectId':_0x4a8bf1,'tdx':_0x21c6a2,'logger':this[_0xa4bdbf(0x1ea)],'site':_0x3cee9d[_0xa4bdbf(0x1c3)]}),await this[_0xa4bdbf(0x1dd)][_0xa4bdbf(0x1ec)](),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d4)]['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d4)](_0xa4bdbf(0x1f5))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09['yellow']('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1dc)]['bold'](_0xa4bdbf(0x1f3))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1f7)](_0xa4bdbf(0x1d6))),console['log'](a20_0x5d2b09['dim'](_0xa4bdbf(0x1ce)),a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0xa4bdbf(0x1f9)+_0x2fb6f1)),console['log'](a20_0x5d2b09[_0xa4bdbf(0x1d0)](_0xa4bdbf(0x1cb)),a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0x1c374e?.['attributes'][_0xa4bdbf(0x1fc)]||_0x4a8bf1)),console['log'](a20_0x5d2b09[_0xa4bdbf(0x1d0)]('\x20\x20Agents:'),a20_0x5d2b09['white'](_0xa4bdbf(0x1da))),console['log'](a20_0x5d2b09[_0xa4bdbf(0x1d0)](_0xa4bdbf(0x1f4)),a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0x3cee9d['site'])),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1f7)](_0xa4bdbf(0x1ee))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d0)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0xa4bdbf(0x1c2))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09['white']('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0xa4bdbf(0x1e9)+_0x2fb6f1+'\x22,')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0xa4bdbf(0x1cf))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09['white'](_0xa4bdbf(0x1db))),console['log'](a20_0x5d2b09[_0xa4bdbf(0x1e6)]('\x20\x20\x20\x20}')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1e6)](_0xa4bdbf(0x1cc))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1f7)](_0xa4bdbf(0x1e3))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d0)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d0)](_0xa4bdbf(0x1c0))),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09[_0xa4bdbf(0x1d0)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0xa4bdbf(0x1d3)](a20_0x5d2b09['yellow'](_0xa4bdbf(0x1e1)));const _0x1e2041=async()=>{const _0x3e88d9=_0xa4bdbf;console[_0x3e88d9(0x1d3)](a20_0x5d2b09[_0x3e88d9(0x1d0)](_0x3e88d9(0x1d5))),this[_0x3e88d9(0x1dd)]&&await this['server']['stop'](),this[_0x3e88d9(0x1ea)]&&await this[_0x3e88d9(0x1ea)][_0x3e88d9(0x1c8)](),console[_0x3e88d9(0x1d3)](a20_0x5d2b09[_0x3e88d9(0x1dc)](_0x3e88d9(0x1e0))),process['exit'](0x0);};return process['on']('SIGINT',_0x1e2041),process['on'](_0xa4bdbf(0x1be),_0x1e2041),await new Promise(()=>{}),0x0;}catch(_0x5716d0){this['server']&&await this[_0xa4bdbf(0x1dd)][_0xa4bdbf(0x1cd)]();this[_0xa4bdbf(0x1ea)]&&await this['logger'][_0xa4bdbf(0x1c8)]();throw _0x5716d0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x32d180=a21_0x5513;(function(_0x2f617f,_0x3a591b){const _0x4d9aab=a21_0x5513,_0x11d76e=_0x2f617f();while(!![]){try{const _0x1c5c35=parseInt(_0x4d9aab(0x1a0))/0x1+-parseInt(_0x4d9aab(0x19e))/0x2+parseInt(_0x4d9aab(0x173))/0x3*(parseInt(_0x4d9aab(0x1a5))/0x4)+parseInt(_0x4d9aab(0x17c))/0x5*(-parseInt(_0x4d9aab(0x15c))/0x6)+-parseInt(_0x4d9aab(0x1d4))/0x7+parseInt(_0x4d9aab(0x1e0))/0x8*(parseInt(_0x4d9aab(0x1f3))/0x9)+-parseInt(_0x4d9aab(0x257))/0xa;if(_0x1c5c35===_0x3a591b)break;else _0x11d76e['push'](_0x11d76e['shift']());}catch(_0x748cca){_0x11d76e['push'](_0x11d76e['shift']());}}}(a21_0x4dd2,0xcc855));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x1a1201 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,hyperlink}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 a21_0x210f78 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=a21_0x32d180(0x22a),LEGACY_PARENT_SEGMENT_DIR=a21_0x32d180(0x189);function openBrowser(_0x75a0d2){const _0x52417b=a21_0x32d180,_0xafc285=process['platform'],_0x2b85dc=_0xafc285===_0x52417b(0x1f4)?_0x52417b(0x158):_0xafc285==='win32'?_0x52417b(0x16b):_0x52417b(0x15b);spawn(_0x2b85dc,[_0x75a0d2],{'detached':!![],'stdio':_0x52417b(0x190)})[_0x52417b(0x182)]();}function a21_0x4dd2(){const _0x4ee7d8=['xdg-open','5927106XKjAMJ','\x20\x20No\x20sample\x20data\x20available','Join:','format','timezone','\x20--attribute\x20\x22<name>\x22','customersWithEvents','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','%)\x20','customerPercent','\x20--interval\x20','yellow','joinKey','output','validateParentYaml','start','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20parent\x20segment','Validating\x20configuration...','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','database','Columns:','parentSegment','1806117jFZrJY','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','join','\x20rows\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','elapsedTimeMillis','previewParentYaml','\x20Configuration\x20is\x20valid','5EietxP','addAttributes','Master\x20Table','displayValidateResults','segment:parent:preview','To\x20view\x20sample\x20data:','unref','Database:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Updating','segment:parent:sql','localeCompare','parent_segment','addAttributesFile','replace','master','To\x20cancel:','column','keys','ignore','Overwrite\x20\x27','Creating\x20parent\x20segment\x20\x27','displayAttributesStats','\x0a✔\x20Workflow\x20started','Site:\x20','\x27...','label','\x20No\x20changes\x20-\x20','\x0a⚠️\x20\x20Both\x20','listParents','Show\x20parent\x20segment\x20details','pushParentYaml','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','2948664RetpNr','getParentFull','1558339YjqgNS','displayBehaviorsStats','Errors:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','✔\x20Found\x20','4MjvpaP','displayMasterInfo','pullParentYaml','cyan','utf-8','sort','Validate:','Analyzing\x20changes...','YAML\x20file:\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','rowCount','.yaml','Fetching\x20SQL\x20for\x20\x27','Error\x20reading\x20file:\x20','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','allValid','Master:','interval','web','Listing\x20parent\x20segments\x20matching\x20\x27','runParent','\x0aNo\x20sample\x20data\x20available','addBehaviors','schemaValid','Audience\x20ID:','.yml','toLocaleString','✔\x20Updated\x20parent\x20segment\x20\x27','message','displayPreviewHints','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','description','Join\x20on:','attributes','segment:parent:run','👥\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Error\x20parsing\x20YAML:\x20','/\x20directory.\x0a','workflowAttemptId','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','using\x20the\x20default\x20path:\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','FINISHED','496636yiPqCS','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20Opening\x20','workflowSessionId','data','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','stop','Created','sampleData','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Session:','10897688wfChpM','behavior','attributesFile','\x20--attribute\x20\x22','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','/app/workflows/','repeat','getParentSQL','scheduleType','segment:parent:push','jobId','setJobId','\x20=\x20','text','segment:parent:list','schemaError','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','addBehaviorsFile','trim','9oyPuHl','darwin','Executing\x20parent\x20segment\x20query...','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','green','apply','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20rows)','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','/\x20→\x20','\x27\x20and\x20run\x20workflow?','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Options:\x0a','dim','errors','segment:parent:show','bold','Output\x20file:\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','displaySummary','/{name}.yml\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','workflowId','run','table','\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[Job\x20ID:\x20','Status:','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','number','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','json','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','execute','/app/dw/parentSegments/','scheduleOption','displayPreviewResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20--enriched','length','matchedCount','displaySampleData','segment:parent:update','Options\x20(one\x20required):\x0a','columns','Parent\x20segment:\x20','jsonl','Error:\x20File\x20not\x20found:\x20','map','Updating\x20parent\x20segment\x20\x27','customerGroup','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Found\x20YAML\x20file:\x20','Aborted.','parent_segments','totalEvents','\x20field','\x20tdx\x20wf\x20attempt\x20','\x20--behavior\x20\x22<name>\x22','limit','SQL\x20query:\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','segment:parent:pull','all','/\x20and\x20','Coverage:','✘\x20Failed\x20to\x20rename\x20directory:\x20','in\x20','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20-\x20','Create\x20parent\x20segment\x20\x27','listFields','Resolving\x20parent\x20segment\x20\x27','-1d','Fetching\x20parent\x20segment\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Attribute:','\x27\x20is\x20already\x20up\x20to\x20date','Source:','segment:parent:validate','match','\x20kill','error','verbose','resolveParentId','Creating','test','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Enriched:','\x20parent\x20segment\x20\x27','stats','behaviors','Error:','Behavior:','Listing\x20parent\x20segments...','enriched','Error:\x20Parent\x20segment\x20name\x20is\x20required','population','Fetching\x20sample\x20data...','1517410CmIGGx','segment:parent:view','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','string','filter','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','SELECT\x20*\x20FROM\x20(\x0a','Preview:','endsWith','Attempt:','✔\x20Query\x20completed:\x20Processed\x20','attribute','yes','\x0aChanges\x20to\x20apply\x20to\x20\x27','red','log','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Apply\x20changes\x20to\x20\x27','No\x20parent\x20segments\x20found','Get\x20SQL\x20query\x20for\x20parent\x20segment','Behaviors','segment:parent:fields','query','coveragePercent','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','displayColumns','tdx\x20segment\x20parent\x20preview\x20','Pattern:\x20','\x27\x20is\x20up\x20to\x20date','status','\x20--behavior\x20\x22','Table:\x20','\x27\x20with\x20ID:\x20','Events:','\x20Context\x20set:\x20','audienceId','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Rows:','updateParent','`\x20to\x20download\x20the\x20configuration\x20first','name','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Updated','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Customers:','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','List\x20available\x20fields\x20for\x20segmentation','foreignKey','open','toFixed','/\x20directories\x20exist.'];a21_0x4dd2=function(){return _0x4ee7d8;};return a21_0x4dd2();}function migrateLegacyDirectory(){const _0x2f9e16=a21_0x32d180;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x343e4d=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x343e4d['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x2f9e16(0x246)](a21_0x210f78[_0x2f9e16(0x167)](_0x2f9e16(0x199)+LEGACY_PARENT_SEGMENT_DIR+_0x2f9e16(0x234)+PARENT_SEGMENT_DIR+_0x2f9e16(0x15a))),console[_0x2f9e16(0x246)](a21_0x210f78['dim'](_0x2f9e16(0x1d2)+LEGACY_PARENT_SEGMENT_DIR+_0x2f9e16(0x1cd))),![];console[_0x2f9e16(0x246)](a21_0x210f78[_0x2f9e16(0x167)](_0x2f9e16(0x1b5)+LEGACY_PARENT_SEGMENT_DIR+_0x2f9e16(0x1fc)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x2f9e16(0x246)](a21_0x210f78[_0x2f9e16(0x1f7)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2a9fb9){const _0x1284f3=_0x2a9fb9 instanceof Error?_0x2a9fb9['message']:String(_0x2a9fb9);return console[_0x2f9e16(0x246)](a21_0x210f78[_0x2f9e16(0x265)](_0x2f9e16(0x236)+_0x1284f3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x32d180(0x20a)](_0x16e9de){const _0x43d5bc=a21_0x32d180;return migrateLegacyDirectory(),super[_0x43d5bc(0x20a)](_0x16e9de);}}function resolveYamlFile(_0x3217b2){const _0xc01f77=a21_0x32d180;if(_0x3217b2[_0xc01f77(0x25f)](_0xc01f77(0x1c0))||_0x3217b2[_0xc01f77(0x25f)](_0xc01f77(0x1b0)))return _0x3217b2;return a21_0x1a1201['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3217b2)+'.yml');}function formatProgressMessage(_0x5ccc65){const _0x3fa276=a21_0x32d180,_0x18a702=_0x5ccc65[_0x3fa276(0x244)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x18a702){const [,_0x315deb,_0x49f162,_0x1be384='']=_0x18a702;return a21_0x210f78['dim'](_0x315deb+':')+'\x20'+_0x49f162+a21_0x210f78[_0x3fa276(0x200)](_0x1be384);}return a21_0x210f78[_0x3fa276(0x200)](_0x5ccc65);}function showFileNotFoundError(_0x3675a4,_0x5c4d17){const _0x31ccf8=a21_0x32d180;console[_0x31ccf8(0x246)](a21_0x210f78[_0x31ccf8(0x265)](_0x31ccf8(0x222)+_0x3675a4+'\x0a')),console[_0x31ccf8(0x246)](a21_0x210f78[_0x31ccf8(0x1a8)](_0x31ccf8(0x16c)+_0x5c4d17+_0x31ccf8(0x280)));}function showParentSegmentNotSetError(_0x467896){const _0x5b8c26=a21_0x32d180;console[_0x5b8c26(0x246)](a21_0x210f78['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x467896);}export class ParentSegmentListCommand extends BaseCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x1ee);[a21_0x32d180(0x1c6)]='List\x20parent\x20segments';async[a21_0x32d180(0x214)](_0x4829fd){const _0x248152=a21_0x32d180,{options:_0x4afd5e,args:_0x104865,tdx:_0x324b82}=_0x4829fd,_0x11c38f=_0x104865[0x0];_0x4afd5e[_0x248152(0x247)]&&(console[_0x248152(0x246)]('Site:\x20'+_0x4afd5e['site']),_0x11c38f&&console[_0x248152(0x246)](_0x248152(0x273)+_0x11c38f));const _0x379a87=await withSpinner(_0x11c38f?_0x248152(0x1ba)+_0x11c38f+_0x248152(0x196):_0x248152(0x252),()=>_0x324b82[_0x248152(0x1b3)][_0x248152(0x19a)](),{'verbose':_0x4afd5e[_0x248152(0x247)]});let _0x18e205=_0x379a87[_0x248152(0x1d8)];if(_0x11c38f){const _0x5b7468=_0x11c38f[_0x248152(0x18b)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x248152(0x18b)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3b7ce5=new RegExp('^'+_0x5b7468+'$','i');_0x18e205=_0x18e205[_0x248152(0x25b)](_0x326141=>_0x3b7ce5[_0x248152(0x24a)](_0x326141[_0x248152(0x1c8)][_0x248152(0x14f)]));}_0x18e205[_0x248152(0x1aa)]((_0x417956,_0x599e6f)=>_0x417956[_0x248152(0x1c8)][_0x248152(0x14f)][_0x248152(0x188)](_0x599e6f[_0x248152(0x1c8)][_0x248152(0x14f)])),console[_0x248152(0x246)](_0x248152(0x1a4)+_0x18e205['length']+_0x248152(0x16d)+(_0x18e205[_0x248152(0x21a)]!==0x1?'s':''));const _0x39e3b0=_0x14c8c5=>{const _0x2a5eb3=_0x248152;return getConsoleNextUrl(_0x4afd5e[_0x2a5eb3(0x150)],'/app/dw/parentSegments/'+_0x14c8c5);};if(_0x4afd5e[_0x248152(0x15f)]==='json'||_0x4afd5e[_0x248152(0x15f)]===_0x248152(0x221)){const _0x1c5a27=_0x18e205['map'](_0x32c0fc=>({..._0x32c0fc,'url':_0x39e3b0(_0x32c0fc['id'])}));await handleSDKOutput(_0x1c5a27,_0x4afd5e);}else{if(_0x18e205[_0x248152(0x21a)]===0x0)_0x11c38f?console[_0x248152(0x266)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x11c38f):console['log'](_0x248152(0x26a));else for(const _0x343ec6 of _0x18e205){const _0x16e758=_0x343ec6['attributes']['population']?a21_0x210f78[_0x248152(0x200)]('\x20('+formatRows(_0x343ec6['attributes'][_0x248152(0x255)])+')'):'',_0x3b101d=hyperlink(_0x343ec6[_0x248152(0x1c8)][_0x248152(0x14f)],_0x39e3b0(_0x343ec6['id']));console[_0x248152(0x266)](_0x248152(0x1ca)+_0x3b101d+_0x16e758);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x32d180(0x14f)]='segment:parent:create';[a21_0x32d180(0x1c6)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x3ffb3b){const _0x209c41=a21_0x32d180,{options:_0x29124d,args:_0x2ce222,tdx:_0x42aa9f}=_0x3ffb3b;console[_0x209c41(0x246)](_0x209c41(0x213)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x209c41(0x19d));const _0x54b925=_0x29124d;if(_0x2ce222['length']===0x0)return console[_0x209c41(0x246)](a21_0x210f78[_0x209c41(0x265)](_0x209c41(0x254))),console[_0x209c41(0x246)](_0x209c41(0x1da)),0x1;const _0x3434fa=_0x2ce222[0x0];if(!_0x54b925[_0x209c41(0x170)]||!_0x54b925[_0x209c41(0x20b)])return console[_0x209c41(0x246)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x209c41(0x246)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x54b925[_0x209c41(0x247)]&&(console['error']('Site:\x20'+_0x54b925[_0x209c41(0x150)]),console[_0x209c41(0x246)](_0x209c41(0x1d9)+_0x3434fa),console[_0x209c41(0x246)](_0x209c41(0x183)+_0x54b925[_0x209c41(0x170)]),console['error'](_0x209c41(0x277)+_0x54b925[_0x209c41(0x20b)]));const _0x378f42=await loadJSONFromOptions(_0x54b925[_0x209c41(0x1c8)],_0x54b925[_0x209c41(0x1e2)]),_0xc79a01=await loadJSONFromOptions(_0x54b925[_0x209c41(0x24f)],_0x54b925['behaviorsFile']),_0x5047eb=await loadJSONFromOptions(_0x54b925['customerGroup'],_0x54b925['customerGroupFile']),_0x4509e0={'name':_0x3434fa,'description':_0x54b925[_0x209c41(0x1c6)],'scheduleType':_0x54b925[_0x209c41(0x1e8)],'scheduleOption':_0x54b925[_0x209c41(0x216)],'timezone':_0x54b925[_0x209c41(0x160)],'master':{'parentDatabaseName':_0x54b925[_0x209c41(0x170)],'parentTableName':_0x54b925['table']},'attributes':_0x378f42,'behaviors':_0xc79a01,'customerGroup':_0x5047eb},_0x50d6c9=await withSpinner(_0x209c41(0x192)+_0x3434fa+_0x209c41(0x196),()=>_0x42aa9f['segment']['createParent'](_0x4509e0),{'verbose':_0x29124d[_0x209c41(0x247)]}),_0x220a75=_0x50d6c9[_0x209c41(0x1d8)];return console[_0x209c41(0x246)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x220a75[_0x209c41(0x14f)]+_0x209c41(0x278)+_0x220a75['id']),await handleSDKOutput([_0x220a75],_0x29124d),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x21d);[a21_0x32d180(0x1c6)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a21_0x32d180(0x214)](_0x3e241b){const _0x5edf24=a21_0x32d180,{options:_0x424ba3,args:_0x224e4f,tdx:_0x45709f}=_0x3e241b;console[_0x5edf24(0x246)](_0x5edf24(0x1f9)+_0x5edf24(0x153)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x385eee=_0x424ba3;if(_0x224e4f[_0x5edf24(0x21a)]===0x0)return console['error'](a21_0x210f78[_0x5edf24(0x265)](_0x5edf24(0x254))),console[_0x5edf24(0x246)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x3ab31c=_0x224e4f[0x0];_0x385eee[_0x5edf24(0x247)]&&(console[_0x5edf24(0x246)](_0x5edf24(0x195)+_0x385eee[_0x5edf24(0x150)]),console[_0x5edf24(0x246)](_0x5edf24(0x220)+_0x3ab31c));const _0x5bfae7=await withSpinner(_0x5edf24(0x238)+_0x3ab31c+_0x5edf24(0x196),()=>_0x45709f[_0x5edf24(0x1b3)][_0x5edf24(0x19f)](_0x3ab31c),{'verbose':_0x385eee[_0x5edf24(0x247)]}),_0x6c36cd=_0x5bfae7[_0x5edf24(0x1d8)],_0x5472cf=await loadJSONFromOptions(_0x385eee[_0x5edf24(0x17d)],_0x385eee[_0x5edf24(0x18a)]),_0x366011=await loadJSONFromOptions(_0x385eee[_0x5edf24(0x1bd)],_0x385eee[_0x5edf24(0x1f1)]),_0x49a825={'name':_0x6c36cd[_0x5edf24(0x14f)],'description':_0x385eee[_0x5edf24(0x1c6)]!==undefined?_0x385eee[_0x5edf24(0x1c6)]:_0x6c36cd[_0x5edf24(0x1c6)],'scheduleType':_0x385eee[_0x5edf24(0x1e8)]!==undefined?_0x385eee[_0x5edf24(0x1e8)]:_0x6c36cd[_0x5edf24(0x1e8)],'scheduleOption':_0x385eee[_0x5edf24(0x216)]!==undefined?_0x385eee['scheduleOption']:_0x6c36cd['scheduleOption'],'timezone':_0x385eee[_0x5edf24(0x160)]!==undefined?_0x385eee[_0x5edf24(0x160)]:_0x6c36cd['timezone'],'master':_0x6c36cd['master'],'attributes':_0x5472cf?[..._0x6c36cd[_0x5edf24(0x1c8)]||[],..._0x5472cf]:_0x6c36cd[_0x5edf24(0x1c8)],'behaviors':_0x366011?[..._0x6c36cd[_0x5edf24(0x24f)]||[],..._0x366011]:_0x6c36cd[_0x5edf24(0x24f)],'customerGroup':_0x6c36cd[_0x5edf24(0x225)]},_0x241ac0=await withSpinner(_0x5edf24(0x224)+_0x3ab31c+_0x5edf24(0x196),()=>_0x45709f[_0x5edf24(0x1b3)][_0x5edf24(0x27f)](_0x3ab31c,_0x49a825),{'verbose':_0x385eee['verbose']}),_0x4ec383=_0x241ac0['data'];return console['error'](_0x5edf24(0x1c2)+_0x4ec383[_0x5edf24(0x14f)]+'\x27'),await handleSDKOutput([_0x4ec383],_0x385eee),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x232);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x1a3);async[a21_0x32d180(0x214)](_0xf41879){const _0x1dea20=a21_0x32d180,{options:_0x51f428,args:_0x1ee90b,tdx:_0x2253ee}=_0xf41879,_0x5b06be=_0x51f428,_0x2231a2=_0x1ee90b[0x0]||_0x51f428[_0x1dea20(0x172)];if(!_0x2231a2)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x5b06be['use']&&_0x5b06be[_0x1dea20(0x169)])return console[_0x1dea20(0x246)](a21_0x210f78['red'](_0x1dea20(0x208))),console[_0x1dea20(0x246)](a21_0x210f78['dim'](_0x1dea20(0x1fb))),console['error'](a21_0x210f78['dim'](_0x1dea20(0x1d1)+PARENT_SEGMENT_DIR+_0x1dea20(0x207))),console[_0x1dea20(0x246)](a21_0x210f78[_0x1dea20(0x1a8)](_0x1dea20(0x259))),0x1;const _0x14af75=_0x5b06be['output']||a21_0x1a1201[_0x1dea20(0x176)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2231a2)+_0x1dea20(0x1c0));_0x5b06be[_0x1dea20(0x247)]&&(console[_0x1dea20(0x246)]('Site:\x20'+_0x5b06be[_0x1dea20(0x150)]),console[_0x1dea20(0x246)](_0x1dea20(0x220)+_0x2231a2),console['error'](_0x1dea20(0x204)+_0x14af75));const _0x57dd4f=await withSpinner(_0x1dea20(0x23e)+_0x2231a2+_0x1dea20(0x196),()=>_0x2253ee[_0x1dea20(0x1b3)][_0x1dea20(0x1a7)](_0x2231a2),{'verbose':_0x5b06be[_0x1dea20(0x247)]}),_0x24271d=_0x57dd4f[_0x1dea20(0x1d8)];if(existsSync(_0x14af75)){const _0x37b4f5=readFileSync(_0x14af75,'utf-8'),_0x56cb2c=generateDiff(_0x37b4f5,_0x24271d);if(!hasChanges(_0x56cb2c))console[_0x1dea20(0x246)](a21_0x210f78[_0x1dea20(0x1f7)]('✔')+_0x1dea20(0x198)+a21_0x210f78[_0x1dea20(0x1a8)](_0x14af75)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x1dea20(0x246)]('\x0aChanges\x20to\x20\x27'+_0x14af75+'\x27:'),console[_0x1dea20(0x246)]('─'[_0x1dea20(0x1e6)](0x3c)),console['error'](formatDiffWithColors(_0x56cb2c)),console[_0x1dea20(0x246)]('─'['repeat'](0x3c));if(!_0x5b06be[_0x1dea20(0x263)]){const _0x58c714=await confirmKey(_0x1dea20(0x191)+_0x14af75+'\x27?');if(!_0x58c714)return console[_0x1dea20(0x246)](_0x1dea20(0x229)),0x1;}writeFileSync(_0x14af75,_0x24271d,_0x1dea20(0x1a9)),console[_0x1dea20(0x246)](a21_0x210f78[_0x1dea20(0x1f7)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a21_0x210f78[_0x1dea20(0x1a8)](_0x14af75));}}else{const _0x55dcfa=a21_0x1a1201['dirname'](_0x14af75);!existsSync(_0x55dcfa)&&mkdirSync(_0x55dcfa,{'recursive':!![]}),writeFileSync(_0x14af75,_0x24271d,'utf-8'),console['error'](a21_0x210f78[_0x1dea20(0x1f7)]('✔')+_0x1dea20(0x1f0)+a21_0x210f78[_0x1dea20(0x1a8)](_0x14af75));}return saveSessionContext({'parent_segment':_0x2231a2},_0x5b06be['session']),console[_0x1dea20(0x246)](a21_0x210f78[_0x1dea20(0x1f7)]('✔')+_0x1dea20(0x27a)+a21_0x210f78[_0x1dea20(0x200)]('parent_segment')+_0x1dea20(0x1ec)+a21_0x210f78['cyan'](_0x2231a2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x1e9);['description']='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a21_0x32d180(0x214)](_0x5c9e9f){const _0x42ee47=a21_0x32d180,{options:_0x248f9f,args:_0x475ed4,tdx:_0x478f48}=_0x5c9e9f,_0x1cc2bb=_0x248f9f,_0x5a41a9=_0x475ed4[0x0]||_0x248f9f[_0x42ee47(0x172)];if(!_0x5a41a9)return showParentSegmentNotSetError(_0x42ee47(0x1e4)+_0x42ee47(0x178)),0x1;const _0x2b9664=resolveYamlFile(_0x5a41a9);if(!existsSync(_0x2b9664))return showFileNotFoundError(_0x2b9664,_0x5a41a9),0x1;_0x1cc2bb[_0x42ee47(0x247)]&&(console[_0x42ee47(0x246)](_0x42ee47(0x195)+_0x1cc2bb[_0x42ee47(0x150)]),console[_0x42ee47(0x246)](_0x42ee47(0x1ad)+_0x2b9664));let _0x2fe919;try{_0x2fe919=readFileSync(_0x2b9664,_0x42ee47(0x1a9));}catch(_0x28bf2d){const _0x26e8a4=_0x28bf2d instanceof Error?_0x28bf2d['message']:String(_0x28bf2d);return console['error'](_0x42ee47(0x1b2)+_0x26e8a4),0x1;}const _0x572b40=await withSpinner('Analyzing\x20changes...',()=>_0x478f48[_0x42ee47(0x1b3)]['pushParentYaml'](_0x2fe919),{'verbose':_0x1cc2bb[_0x42ee47(0x247)]}),_0x1da42d=_0x572b40[_0x42ee47(0x1d8)],{isNew:_0xb71652,name:_0x345246,hasChanges:_0xda5088,diffFormatted:_0x31053b}=_0x1da42d;if(!_0xda5088)return console[_0x42ee47(0x246)]('✔\x20No\x20changes\x20-\x20\x27'+_0x345246+_0x42ee47(0x241)),0x0;_0xb71652?console[_0x42ee47(0x246)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x345246+'\x27:'):console[_0x42ee47(0x246)](_0x42ee47(0x264)+_0x345246+'\x27:');console['error']('─'[_0x42ee47(0x1e6)](0x3c)),console['error'](_0x31053b),console[_0x42ee47(0x246)]('─'['repeat'](0x3c));const _0x50d5e=_0xb71652?_0x42ee47(0x23a)+_0x345246+'\x27?':_0x42ee47(0x269)+_0x345246+'\x27?';if(!_0x1cc2bb[_0x42ee47(0x263)]){const _0x15eebe=await confirmKey(_0x50d5e);if(!_0x15eebe)return console[_0x42ee47(0x246)](_0x42ee47(0x229)),0x1;}const _0x2e6e86=_0xb71652?'Creating':_0x42ee47(0x186),_0x2522f4=await withSpinner(_0x2e6e86+_0x42ee47(0x24d)+_0x345246+_0x42ee47(0x196),()=>_0x1da42d[_0x42ee47(0x1f8)](),{'verbose':_0x1cc2bb[_0x42ee47(0x247)]}),_0x40fb9b=_0x2522f4[_0x42ee47(0x1d8)],_0x514137=getConsoleNextUrl(_0x1cc2bb[_0x42ee47(0x150)],_0x42ee47(0x215)+_0x40fb9b['id']),_0x5ac9eb=_0xb71652?_0x42ee47(0x1dc):_0x42ee47(0x152);return console[_0x42ee47(0x246)]('✔\x20'+_0x5ac9eb+'\x20parent\x20segment\x20\x27'+_0x40fb9b[_0x42ee47(0x14f)]+'\x27'),console[_0x42ee47(0x246)]('\x20\x20'+_0x514137),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x243);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x270);async[a21_0x32d180(0x214)](_0x333238){const _0x5b3681=a21_0x32d180,{options:_0xb3ef54,args:_0x3900bc,tdx:_0x38b68}=_0x333238,_0x3f4bed=_0xb3ef54,_0x5b7a9c=_0x3900bc[0x0]||_0xb3ef54[_0x5b3681(0x172)];if(!_0x5b7a9c)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x5b3681(0x174)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x5b3681(0x1d0)),0x1;const _0x5bc0d4=resolveYamlFile(_0x5b7a9c);if(!existsSync(_0x5bc0d4))return showFileNotFoundError(_0x5bc0d4,_0x5b7a9c),0x1;_0x3f4bed[_0x5b3681(0x247)]&&(console[_0x5b3681(0x246)](_0x5b3681(0x195)+_0x3f4bed[_0x5b3681(0x150)]),console[_0x5b3681(0x246)](_0x5b3681(0x1ad)+_0x5bc0d4));let _0x129b93;try{_0x129b93=readFileSync(_0x5bc0d4,'utf-8');}catch(_0x4ccc95){const _0x14b2c9=_0x4ccc95 instanceof Error?_0x4ccc95[_0x5b3681(0x1c3)]:String(_0x4ccc95);return console['error'](_0x5b3681(0x1b2)+_0x14b2c9),0x1;}const _0x185ec5=createCommandSpinner(a21_0x210f78['dim'](_0x5b3681(0x16e)),{'verbose':_0x3f4bed[_0x5b3681(0x247)]});_0x185ec5[_0x5b3681(0x16b)]();const _0xdf07a1={'onProgress':_0x24ac5f=>{const _0x4cd73c=_0x5b3681;_0x185ec5[_0x4cd73c(0x1ed)]=formatProgressMessage(_0x24ac5f);}};if(_0x3f4bed[_0x5b3681(0x18c)])_0xdf07a1['master']=!![];if(_0x3f4bed['enriched'])_0xdf07a1[_0x5b3681(0x253)]=!![];_0x3f4bed[_0x5b3681(0x262)]&&(_0xdf07a1[_0x5b3681(0x262)]=_0x3f4bed[_0x5b3681(0x262)]);_0x3f4bed[_0x5b3681(0x1e1)]&&(_0xdf07a1[_0x5b3681(0x1e1)]=_0x3f4bed['behavior']);if(_0x3f4bed[_0x5b3681(0x1b8)])_0xdf07a1[_0x5b3681(0x1b8)]=_0x3f4bed[_0x5b3681(0x1b8)];let _0x334682;try{_0x334682=await _0x38b68[_0x5b3681(0x1b3)][_0x5b3681(0x16a)](_0x129b93,_0xdf07a1),_0x185ec5[_0x5b3681(0x1db)]();}catch(_0x1f7c3d){_0x185ec5['stop']();throw _0x1f7c3d;}const _0x35ea6b=_0x3f4bed[_0x5b3681(0x1b8)]||_0x5b3681(0x23d);return this[_0x5b3681(0x17f)](_0x334682,_0xdf07a1,_0x5bc0d4,_0x35ea6b),_0x334682[_0x5b3681(0x1b6)]?0x0:0x1;}['displayValidateResults'](_0x98e0f1,_0x441d09,_0x207c48,_0x328a68){const _0x4322d0=a21_0x32d180;console[_0x4322d0(0x246)]('\x0a'+a21_0x210f78['bold'](_0x4322d0(0x1ab))+'\x20'+_0x98e0f1[_0x4322d0(0x14f)]),console[_0x4322d0(0x246)]('═'[_0x4322d0(0x1e6)](0x3c)),this[_0x4322d0(0x1a6)](_0x98e0f1);if(typeof _0x441d09['attribute']===_0x4322d0(0x25a)){this[_0x4322d0(0x193)](_0x98e0f1),this['displaySummary'](_0x98e0f1),this[_0x4322d0(0x1c4)](_0x207c48,_0x328a68,_0x4322d0(0x262),_0x441d09[_0x4322d0(0x262)]);return;}if(_0x441d09[_0x4322d0(0x262)]===!![]){this[_0x4322d0(0x193)](_0x98e0f1),this[_0x4322d0(0x206)](_0x98e0f1),this[_0x4322d0(0x1c4)](_0x207c48,_0x328a68,_0x4322d0(0x1c8));return;}if(typeof _0x441d09[_0x4322d0(0x1e1)]==='string'){this[_0x4322d0(0x1a1)](_0x98e0f1,_0x328a68),this[_0x4322d0(0x206)](_0x98e0f1),this[_0x4322d0(0x1c4)](_0x207c48,_0x328a68,_0x4322d0(0x1e1),_0x441d09['behavior']);return;}if(_0x441d09[_0x4322d0(0x1e1)]===!![]){this[_0x4322d0(0x1a1)](_0x98e0f1,_0x328a68),this[_0x4322d0(0x206)](_0x98e0f1),this[_0x4322d0(0x1c4)](_0x207c48,_0x328a68,_0x4322d0(0x24f));return;}this[_0x4322d0(0x193)](_0x98e0f1),this[_0x4322d0(0x1a1)](_0x98e0f1,_0x328a68),this['displaySummary'](_0x98e0f1),this[_0x4322d0(0x1c4)](_0x207c48,_0x328a68,'all');}[a21_0x32d180(0x1c4)](_0x40c9c2,_0x3edf65,_0x5013e1,_0x1e93a9){const _0x5ee44a=a21_0x32d180;console[_0x5ee44a(0x246)]('\x0a'+a21_0x210f78[_0x5ee44a(0x200)](_0x5ee44a(0x181)));const _0x578bed=_0x3edf65!==_0x5ee44a(0x23d)?_0x5ee44a(0x166)+_0x3edf65:'';if(_0x5013e1===_0x5ee44a(0x262)&&_0x1e93a9)console['error']('\x20\x20'+a21_0x210f78[_0x5ee44a(0x200)]('tdx\x20segment\x20parent\x20preview\x20'+_0x40c9c2+_0x5ee44a(0x1e3)+_0x1e93a9+'\x22'+_0x578bed));else{if(_0x5013e1==='behavior'&&_0x1e93a9)console[_0x5ee44a(0x246)]('\x20\x20'+a21_0x210f78[_0x5ee44a(0x200)](_0x5ee44a(0x272)+_0x40c9c2+'\x20--behavior\x20\x22'+_0x1e93a9+'\x22'+_0x578bed));else(_0x5013e1===_0x5ee44a(0x1c8)||_0x5013e1===_0x5ee44a(0x233))&&console[_0x5ee44a(0x246)]('\x20\x20'+a21_0x210f78['dim'](_0x5ee44a(0x272)+_0x40c9c2+_0x5ee44a(0x161)+_0x578bed));}(_0x5013e1==='behaviors'||_0x5013e1===_0x5ee44a(0x233))&&console['error']('\x20\x20'+a21_0x210f78[_0x5ee44a(0x200)](_0x5ee44a(0x272)+_0x40c9c2+_0x5ee44a(0x22e)+_0x578bed)),_0x5013e1==='all'&&console['error']('\x20\x20'+a21_0x210f78[_0x5ee44a(0x200)](_0x5ee44a(0x272)+_0x40c9c2+_0x5ee44a(0x219)+_0x578bed));}[a21_0x32d180(0x1a6)](_0x2f13b7){const _0x111991=a21_0x32d180,{master:_0xaa0e8d}=_0x2f13b7,_0x138d4a=_0xaa0e8d['schemaValid']?a21_0x210f78[_0x111991(0x1f7)]('✔'):a21_0x210f78[_0x111991(0x265)]('✘');console['error']('\x0a'+a21_0x210f78[_0x111991(0x200)](_0x111991(0x17e))),console[_0x111991(0x246)](_0x138d4a+'\x20'+a21_0x210f78[_0x111991(0x203)](_0xaa0e8d[_0x111991(0x170)]+'.'+_0xaa0e8d['table'])),_0xaa0e8d['schemaValid']?_0xaa0e8d[_0x111991(0x1af)]!==undefined&&console[_0x111991(0x246)]('\x20\x20'+a21_0x210f78[_0x111991(0x200)](_0x111991(0x27e))+'\x20'+a21_0x210f78['cyan'](formatRows(_0xaa0e8d[_0x111991(0x1af)]))):console['error']('\x20\x20'+a21_0x210f78['red']('Error:')+'\x20'+_0xaa0e8d[_0x111991(0x1ef)]);}['displayAttributesStats'](_0x5a466e){const _0x1a5cb4=a21_0x32d180;if(_0x5a466e[_0x1a5cb4(0x1c8)]['length']===0x0)return;console['error']('\x0a'+a21_0x210f78['dim']('Attributes'));for(const _0x130d79 of _0x5a466e[_0x1a5cb4(0x1c8)]){const _0x23f59d=_0x130d79[_0x1a5cb4(0x1be)]?a21_0x210f78[_0x1a5cb4(0x1f7)]('✔'):a21_0x210f78[_0x1a5cb4(0x265)]('✘');let _0x167a93='';if(_0x130d79['schemaValid']&&_0x130d79['matchedCount']!==undefined&&_0x130d79['coveragePercent']!==undefined){const _0x377e40=_0x130d79[_0x1a5cb4(0x26f)][_0x1a5cb4(0x159)](0x1),_0x42ae33=_0x130d79[_0x1a5cb4(0x26f)]>=0x50?a21_0x210f78[_0x1a5cb4(0x1f7)]:_0x130d79[_0x1a5cb4(0x26f)]>=0x32?a21_0x210f78[_0x1a5cb4(0x167)]:a21_0x210f78[_0x1a5cb4(0x265)];_0x167a93='\x20'+a21_0x210f78[_0x1a5cb4(0x200)](_0x1a5cb4(0x235))+'\x20'+_0x42ae33(_0x377e40+'%')+'\x20('+formatRows(_0x130d79[_0x1a5cb4(0x21b)])+_0x1a5cb4(0x1fa);}console[_0x1a5cb4(0x246)](_0x23f59d+'\x20'+a21_0x210f78['bold'](_0x130d79[_0x1a5cb4(0x14f)])+_0x167a93),console[_0x1a5cb4(0x246)]('\x20\x20'+a21_0x210f78['dim'](_0x1a5cb4(0x242))+'\x20'+a21_0x210f78['bold'](_0x130d79[_0x1a5cb4(0x170)]+'.'+_0x130d79['table']));const _0x352ff5=_0x130d79[_0x1a5cb4(0x168)]===_0x130d79[_0x1a5cb4(0x157)]?a21_0x210f78[_0x1a5cb4(0x200)]('Join\x20on:')+'\x20'+_0x130d79[_0x1a5cb4(0x168)]:a21_0x210f78[_0x1a5cb4(0x200)](_0x1a5cb4(0x15e))+'\x20'+_0x130d79['joinKey']+_0x1a5cb4(0x1ec)+_0x130d79['foreignKey'];console[_0x1a5cb4(0x246)]('\x20\x20'+_0x352ff5),console['error']('\x20\x20'+a21_0x210f78[_0x1a5cb4(0x200)](_0x1a5cb4(0x171))),this[_0x1a5cb4(0x271)](_0x130d79[_0x1a5cb4(0x21f)]),!_0x130d79[_0x1a5cb4(0x1be)]&&console[_0x1a5cb4(0x246)]('\x20\x20'+a21_0x210f78[_0x1a5cb4(0x265)](_0x1a5cb4(0x250))+'\x20'+_0x130d79['schemaError']);}}['displayBehaviorsStats'](_0x302ead,_0x205d9e){const _0x1776d8=a21_0x32d180;if(_0x302ead[_0x1776d8(0x24f)]['length']===0x0)return;console['error']('\x0a'+a21_0x210f78[_0x1776d8(0x200)](_0x1776d8(0x26c))+'\x20'+a21_0x210f78['dim']('('+_0x205d9e+')'));for(const _0x299455 of _0x302ead[_0x1776d8(0x24f)]){const _0x370526=_0x299455['schemaValid']?a21_0x210f78[_0x1776d8(0x1f7)]('✔'):a21_0x210f78['red']('✘');let _0x591d9d='';if(_0x299455['schemaValid']&&_0x299455[_0x1776d8(0x162)]!==undefined&&_0x299455['totalEvents']!==undefined){const _0xa14a54=_0x299455[_0x1776d8(0x165)]?.['toFixed'](0x1)||'?',_0x567fca=(_0x299455[_0x1776d8(0x165)]??0x0)>=0x32?a21_0x210f78[_0x1776d8(0x1f7)]:(_0x299455[_0x1776d8(0x165)]??0x0)>=0x14?a21_0x210f78[_0x1776d8(0x167)]:a21_0x210f78[_0x1776d8(0x265)];_0x591d9d='\x20'+a21_0x210f78[_0x1776d8(0x200)](_0x1776d8(0x154))+'\x20'+_0x567fca(formatRows(_0x299455['customersWithEvents']))+'\x20('+_0xa14a54+_0x1776d8(0x164)+a21_0x210f78[_0x1776d8(0x200)](_0x1776d8(0x279))+'\x20'+a21_0x210f78[_0x1776d8(0x1a8)](formatRows(_0x299455[_0x1776d8(0x22b)]));}console[_0x1776d8(0x246)](_0x370526+'\x20'+a21_0x210f78['bold'](_0x299455['name'])+_0x591d9d),console[_0x1776d8(0x246)]('\x20\x20'+a21_0x210f78['dim']('Source:')+'\x20'+a21_0x210f78['bold'](_0x299455[_0x1776d8(0x170)]+'.'+_0x299455[_0x1776d8(0x20b)]));const _0x2bfc53=_0x299455[_0x1776d8(0x168)]===_0x299455['foreignKey']?a21_0x210f78[_0x1776d8(0x200)](_0x1776d8(0x1c7))+'\x20'+_0x299455[_0x1776d8(0x168)]:a21_0x210f78[_0x1776d8(0x200)](_0x1776d8(0x15e))+'\x20'+_0x299455['joinKey']+_0x1776d8(0x1ec)+_0x299455['foreignKey'];console[_0x1776d8(0x246)]('\x20\x20'+_0x2bfc53),console['error']('\x20\x20'+a21_0x210f78[_0x1776d8(0x200)](_0x1776d8(0x171))),this[_0x1776d8(0x271)](_0x299455[_0x1776d8(0x21f)]),!_0x299455[_0x1776d8(0x1be)]&&console[_0x1776d8(0x246)]('\x20\x20'+a21_0x210f78['red']('Error:')+'\x20'+_0x299455[_0x1776d8(0x1ef)]);}}[a21_0x32d180(0x271)](_0x5240e1){const _0x208986=a21_0x32d180;for(const _0x1262fe of _0x5240e1){_0x1262fe[_0x208986(0x197)]===_0x1262fe[_0x208986(0x18e)]||_0x1262fe['column']==='*'?console['error'](_0x208986(0x239)+_0x1262fe[_0x208986(0x197)]):console['error'](_0x208986(0x239)+_0x1262fe[_0x208986(0x197)]+'\x20'+a21_0x210f78['dim']('('+_0x1262fe['column']+')'));}}['displaySummary'](_0x3ef31f){const _0x46ea43=a21_0x32d180;console['error']('─'[_0x46ea43(0x1e6)](0x3c));if(_0x3ef31f[_0x46ea43(0x201)][_0x46ea43(0x21a)]>0x0){console[_0x46ea43(0x246)]('\x0a'+a21_0x210f78[_0x46ea43(0x265)](_0x46ea43(0x1a2)));for(const _0xdc529a of _0x3ef31f['errors']){console[_0x46ea43(0x246)]('\x20\x20'+a21_0x210f78[_0x46ea43(0x265)]('•')+'\x20'+_0xdc529a);}}_0x3ef31f[_0x46ea43(0x1b6)]&&console[_0x46ea43(0x246)]('\x0a'+a21_0x210f78[_0x46ea43(0x1f7)]('✔')+_0x46ea43(0x17b));}}function a21_0x5513(_0x229721,_0x22e398){_0x229721=_0x229721-0x14f;const _0x4dd24e=a21_0x4dd2();let _0x55136a=_0x4dd24e[_0x229721];return _0x55136a;}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x180);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x1f6);async['execute'](_0x4f2979){const _0x11a7f8=a21_0x32d180,{options:_0x427af4,args:_0x544fc0,tdx:_0x18ee1f}=_0x4f2979,_0x38a194=_0x427af4,_0x1dc361=_0x544fc0[0x0]||_0x427af4['parentSegment'];if(!_0x1dc361)return showParentSegmentNotSetError(_0x11a7f8(0x205)+_0x11a7f8(0x20c)+_0x11a7f8(0x21e)+_0x11a7f8(0x226)+_0x11a7f8(0x268)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x11a7f8(0x23f)+_0x11a7f8(0x1d0)),0x1;if(!_0x38a194[_0x11a7f8(0x18c)]&&!_0x38a194['attribute']&&!_0x38a194['behavior']&&!_0x38a194[_0x11a7f8(0x253)])return console['error'](a21_0x210f78[_0x11a7f8(0x265)](_0x11a7f8(0x175))),console[_0x11a7f8(0x246)](_0x11a7f8(0x227)),console[_0x11a7f8(0x246)]('Options:'),console[_0x11a7f8(0x246)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x11a7f8(0x246)](_0x11a7f8(0x1cf)),console['error'](_0x11a7f8(0x163)),console[_0x11a7f8(0x246)](_0x11a7f8(0x24b)),0x1;const _0x18c0ec=resolveYamlFile(_0x1dc361);if(!existsSync(_0x18c0ec))return showFileNotFoundError(_0x18c0ec,_0x1dc361),0x1;_0x38a194['verbose']&&(console['error']('Site:\x20'+_0x38a194[_0x11a7f8(0x150)]),console['error'](_0x11a7f8(0x1ad)+_0x18c0ec));let _0x4520be;try{_0x4520be=readFileSync(_0x18c0ec,_0x11a7f8(0x1a9));}catch(_0x4efc20){const _0x141597=_0x4efc20 instanceof Error?_0x4efc20[_0x11a7f8(0x1c3)]:String(_0x4efc20);return console[_0x11a7f8(0x246)]('Error\x20reading\x20file:\x20'+_0x141597),0x1;}let _0x45e0aa;try{_0x45e0aa=parseDef(_0x4520be);}catch(_0xcf74de){const _0x142328=_0xcf74de instanceof Error?_0xcf74de[_0x11a7f8(0x1c3)]:String(_0xcf74de);return console[_0x11a7f8(0x246)](a21_0x210f78[_0x11a7f8(0x265)](_0x11a7f8(0x1cc)+_0x142328)),0x1;}if(_0x38a194['attribute']===!![]||_0x38a194['attribute']===''){const _0x85d16=_0x45e0aa['attributes']?.[_0x11a7f8(0x223)](_0x4beff4=>_0x4beff4['name'])||[];if(_0x85d16[_0x11a7f8(0x21a)]===0x0)console[_0x11a7f8(0x246)](a21_0x210f78[_0x11a7f8(0x265)](_0x11a7f8(0x27c)));else{console[_0x11a7f8(0x246)](a21_0x210f78[_0x11a7f8(0x265)](_0x11a7f8(0x1ae))),console[_0x11a7f8(0x246)]('Available\x20attributes:');for(const _0x2a3437 of _0x85d16){console[_0x11a7f8(0x246)]('\x20\x20'+a21_0x210f78[_0x11a7f8(0x1a8)](_0x2a3437));}console[_0x11a7f8(0x246)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x1dc361+_0x11a7f8(0x1e3)+_0x85d16[0x0]+'\x22');}return 0x1;}if(_0x38a194[_0x11a7f8(0x1e1)]===!![]||_0x38a194['behavior']===''){const _0x4488ec=_0x45e0aa['behaviors']?.[_0x11a7f8(0x223)](_0x312e0e=>_0x312e0e[_0x11a7f8(0x14f)])||[];if(_0x4488ec['length']===0x0)console[_0x11a7f8(0x246)](a21_0x210f78['red'](_0x11a7f8(0x25c)));else{console[_0x11a7f8(0x246)](a21_0x210f78[_0x11a7f8(0x265)](_0x11a7f8(0x27d))),console[_0x11a7f8(0x246)]('Available\x20behaviors:');for(const _0xffa44f of _0x4488ec){console['error']('\x20\x20'+a21_0x210f78[_0x11a7f8(0x1a8)](_0xffa44f));}console[_0x11a7f8(0x246)](_0x11a7f8(0x1cb)+_0x1dc361+_0x11a7f8(0x276)+_0x4488ec[0x0]+'\x22');}return 0x1;}const _0x175c0f=createCommandSpinner(a21_0x210f78[_0x11a7f8(0x200)](_0x11a7f8(0x256)),{'verbose':_0x38a194[_0x11a7f8(0x247)]});_0x175c0f[_0x11a7f8(0x16b)]();const _0x4a7cf4={'onProgress':_0x7d1f0b=>{const _0x174421=_0x11a7f8;_0x175c0f[_0x174421(0x1ed)]=formatProgressMessage(_0x7d1f0b);}};if(_0x38a194[_0x11a7f8(0x18c)])_0x4a7cf4['master']=!![];if(_0x38a194[_0x11a7f8(0x262)]&&typeof _0x38a194[_0x11a7f8(0x262)]===_0x11a7f8(0x25a))_0x4a7cf4[_0x11a7f8(0x262)]=_0x38a194[_0x11a7f8(0x262)];if(_0x38a194['behavior']&&typeof _0x38a194[_0x11a7f8(0x1e1)]===_0x11a7f8(0x25a))_0x4a7cf4[_0x11a7f8(0x1e1)]=_0x38a194[_0x11a7f8(0x1e1)];if(_0x38a194[_0x11a7f8(0x253)])_0x4a7cf4['enriched']=!![];if(_0x38a194[_0x11a7f8(0x1b8)])_0x4a7cf4[_0x11a7f8(0x1b8)]=_0x38a194[_0x11a7f8(0x1b8)];let _0x260fef;try{_0x260fef=await _0x18ee1f['segment'][_0x11a7f8(0x17a)](_0x4520be,_0x4a7cf4),_0x175c0f['stop']();}catch(_0x12fe7a){_0x175c0f[_0x11a7f8(0x1db)]();throw _0x12fe7a;}return await this['displayPreviewResults'](_0x260fef,{'master':_0x38a194[_0x11a7f8(0x18c)],'attribute':typeof _0x38a194[_0x11a7f8(0x262)]===_0x11a7f8(0x25a)?_0x38a194[_0x11a7f8(0x262)]:undefined,'behavior':typeof _0x38a194[_0x11a7f8(0x1e1)]===_0x11a7f8(0x25a)?_0x38a194['behavior']:undefined,'enriched':_0x38a194[_0x11a7f8(0x253)]}),_0x260fef[_0x11a7f8(0x1b6)]?0x0:0x1;}async[a21_0x32d180(0x217)](_0x34ea26,_0x74c2c0){const _0x2411ff=a21_0x32d180;console[_0x2411ff(0x246)]('\x0a'+a21_0x210f78['bold'](_0x2411ff(0x25e))+'\x20'+_0x34ea26[_0x2411ff(0x14f)]),console['error']('═'[_0x2411ff(0x1e6)](0x3c));if(_0x74c2c0['master']&&_0x34ea26[_0x2411ff(0x1dd)]){const _0x5a245b=a21_0x210f78[_0x2411ff(0x200)](_0x2411ff(0x1b7))+'\x20'+a21_0x210f78[_0x2411ff(0x203)](_0x34ea26[_0x2411ff(0x18c)]['database']+'.'+_0x34ea26[_0x2411ff(0x18c)][_0x2411ff(0x20b)]);await this[_0x2411ff(0x21c)](_0x5a245b,_0x34ea26['sampleData']);}else{if(_0x74c2c0[_0x2411ff(0x262)]&&_0x34ea26['sampleData']){const _0x1ebbbe=a21_0x210f78[_0x2411ff(0x200)](_0x2411ff(0x240))+'\x20'+a21_0x210f78[_0x2411ff(0x203)](_0x74c2c0[_0x2411ff(0x262)]);await this[_0x2411ff(0x21c)](_0x1ebbbe,_0x34ea26['sampleData']);}else{if(_0x74c2c0[_0x2411ff(0x1e1)]&&_0x34ea26[_0x2411ff(0x1dd)]){const _0xbf4047=a21_0x210f78[_0x2411ff(0x200)](_0x2411ff(0x251))+'\x20'+a21_0x210f78[_0x2411ff(0x203)](_0x74c2c0['behavior']);await this[_0x2411ff(0x21c)](_0xbf4047,_0x34ea26[_0x2411ff(0x1dd)]);}else{if(_0x74c2c0[_0x2411ff(0x253)]&&_0x34ea26[_0x2411ff(0x1dd)]){const _0x3f40d0=a21_0x210f78[_0x2411ff(0x200)](_0x2411ff(0x24c))+'\x20'+a21_0x210f78[_0x2411ff(0x203)]('Master\x20+\x20Attributes');await this[_0x2411ff(0x21c)](_0x3f40d0,_0x34ea26[_0x2411ff(0x1dd)]);}else!_0x34ea26[_0x2411ff(0x1dd)]&&console[_0x2411ff(0x246)](_0x2411ff(0x1bc));}}}if(_0x34ea26['errors'][_0x2411ff(0x21a)]>0x0){console['error']('─'[_0x2411ff(0x1e6)](0x3c)),console[_0x2411ff(0x246)]('\x0a'+a21_0x210f78[_0x2411ff(0x265)](_0x2411ff(0x1a2)));for(const _0x228401 of _0x34ea26[_0x2411ff(0x201)]){console[_0x2411ff(0x246)]('\x20\x20'+a21_0x210f78[_0x2411ff(0x265)]('•')+'\x20'+_0x228401);}}}async['displaySampleData'](_0x7c0c96,_0x3f6649){const _0x3779e5=a21_0x32d180;if(_0x3f6649[_0x3779e5(0x21a)]===0x0){console[_0x3779e5(0x246)]('\x0a'+_0x7c0c96),console[_0x3779e5(0x246)](_0x3779e5(0x15d));return;}console[_0x3779e5(0x246)]('\x0a'+_0x7c0c96);const _0x1ff4d1=Object[_0x3779e5(0x18f)](_0x3f6649[0x0])['map'](_0x1ead42=>({'name':_0x1ead42,'type':typeof _0x3f6649[0x0][_0x1ead42]===_0x3779e5(0x210)?'double':'varchar'})),_0x2db632={'queryId':'preview','columns':_0x1ff4d1,'data':_0x3f6649,'stats':{'state':_0x3779e5(0x1d3),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3f6649[_0x3779e5(0x21a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x28a915=formatAsTable(_0x2db632,_0x3f6649[_0x3779e5(0x21a)],!![]);await writeOutput(_0x28a915,undefined,_0x3779e5(0x20b));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a21_0x32d180(0x1c9);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x1fe);async[a21_0x32d180(0x214)](_0x452afa){const _0x1e4206=a21_0x32d180,{options:_0x584411,args:_0x13bc5c,tdx:_0xe1360}=_0x452afa,_0x4e1306=_0x584411,_0x4ebb86=_0x13bc5c[0x0]||_0x584411['parentSegment'];if(!_0x4ebb86)return showParentSegmentNotSetError(_0x1e4206(0x20f)+_0x1e4206(0x151)),0x1;const _0x21e09e=resolveYamlFile(_0x4ebb86);if(existsSync(_0x21e09e)){_0x4e1306[_0x1e4206(0x247)]&&console[_0x1e4206(0x246)](_0x1e4206(0x228)+_0x21e09e);let _0x516590;try{_0x516590=readFileSync(_0x21e09e,_0x1e4206(0x1a9));}catch(_0x251acb){const _0x479ba6=_0x251acb instanceof Error?_0x251acb[_0x1e4206(0x1c3)]:String(_0x251acb);return console['error'](_0x1e4206(0x1b2)+_0x479ba6),0x1;}const _0x3a4dc7=await withSpinner(_0x1e4206(0x1ac),()=>_0xe1360[_0x1e4206(0x1b3)][_0x1e4206(0x19c)](_0x516590),{'verbose':_0x4e1306['verbose']}),_0x5702c9=_0x3a4dc7['data'],{isNew:_0x2e26b3,name:_0x183e1e,hasChanges:_0x507177,diffFormatted:_0x22028a}=_0x5702c9;if(_0x507177){_0x2e26b3?console['error']('\x0aNew\x20parent\x20segment\x20\x27'+_0x183e1e+'\x27:'):console[_0x1e4206(0x246)](_0x1e4206(0x264)+_0x183e1e+'\x27:');console[_0x1e4206(0x246)]('─'[_0x1e4206(0x1e6)](0x3c)),console[_0x1e4206(0x246)](_0x22028a),console[_0x1e4206(0x246)]('─'[_0x1e4206(0x1e6)](0x3c));const _0x23d83b=_0x2e26b3?_0x1e4206(0x23a)+_0x183e1e+_0x1e4206(0x1fd):_0x1e4206(0x269)+_0x183e1e+_0x1e4206(0x1fd);if(!_0x4e1306['yes']){const _0x2a3b82=await confirmKey(_0x23d83b);if(!_0x2a3b82)return console['error']('Aborted.'),0x1;}const _0x3d8fe9=_0x2e26b3?_0x1e4206(0x249):'Updating';await withSpinner(_0x3d8fe9+_0x1e4206(0x24d)+_0x183e1e+_0x1e4206(0x196),()=>_0x5702c9[_0x1e4206(0x1f8)](),{'verbose':_0x4e1306['verbose']});const _0x192a89=_0x2e26b3?_0x1e4206(0x1dc):_0x1e4206(0x152);console[_0x1e4206(0x246)]('✔\x20'+_0x192a89+_0x1e4206(0x24d)+_0x183e1e+'\x27');}else console[_0x1e4206(0x246)]('✔\x20No\x20changes\x20-\x20\x27'+_0x183e1e+_0x1e4206(0x274));}const _0x37c815=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x4ebb86+_0x1e4206(0x196),()=>_0xe1360[_0x1e4206(0x1b3)][_0x1e4206(0x1bb)](_0x4ebb86),{'verbose':_0x4e1306[_0x1e4206(0x247)]}),_0x4efd2e=_0x37c815[_0x1e4206(0x1d8)],_0x2a1322=getConsoleUrl(_0x4e1306[_0x1e4206(0x150)],_0x1e4206(0x1e5)+_0x4efd2e[_0x1e4206(0x209)]+'/sessions/'+_0x4efd2e['workflowSessionId']+'/attempt/'+_0x4efd2e['workflowAttemptId']);return console[_0x1e4206(0x246)](_0x1e4206(0x194)),console[_0x1e4206(0x246)]('\x20\x20'+a21_0x210f78[_0x1e4206(0x200)](_0x1e4206(0x1bf))+'\x20'+_0x4efd2e[_0x1e4206(0x27b)]),console[_0x1e4206(0x246)]('\x20\x20'+a21_0x210f78[_0x1e4206(0x200)](_0x1e4206(0x20e))+'\x20'+_0x4efd2e[_0x1e4206(0x275)]),console[_0x1e4206(0x246)]('\x20\x20'+a21_0x210f78[_0x1e4206(0x200)](_0x1e4206(0x1df))+'\x20'+_0x4efd2e[_0x1e4206(0x1d7)]),console[_0x1e4206(0x246)]('\x20\x20'+a21_0x210f78[_0x1e4206(0x200)](_0x1e4206(0x260))+'\x20'+_0x4efd2e[_0x1e4206(0x1ce)]),console[_0x1e4206(0x246)]('\x20\x20'+_0x2a1322),console[_0x1e4206(0x246)]('\x0a'+a21_0x210f78[_0x1e4206(0x200)](_0x1e4206(0x18d))+_0x1e4206(0x22d)+_0x4efd2e['workflowAttemptId']+_0x1e4206(0x245)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x26d);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x156);async[a21_0x32d180(0x214)](_0x3560d1){const _0x1ec073=a21_0x32d180,{options:_0x328244,args:_0x261e94,tdx:_0x43db13}=_0x3560d1,_0x4cd951=_0x261e94[0x0]||_0x328244['parentSegment'];if(!_0x4cd951)return showParentSegmentNotSetError(_0x1ec073(0x155)+_0x1ec073(0x211)),0x1;_0x328244[_0x1ec073(0x247)]&&(console[_0x1ec073(0x246)](_0x1ec073(0x195)+_0x328244[_0x1ec073(0x150)]),console['error'](_0x1ec073(0x220)+_0x4cd951));const _0x558f58=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4cd951+'\x27...',()=>_0x43db13[_0x1ec073(0x1b3)][_0x1ec073(0x23b)](_0x4cd951),{'verbose':_0x328244[_0x1ec073(0x247)]}),_0x3d2071=_0x558f58[_0x1ec073(0x1d8)];console[_0x1ec073(0x246)](_0x1ec073(0x1a4)+_0x3d2071[_0x1ec073(0x21a)]+_0x1ec073(0x22c)+(_0x3d2071['length']!==0x1?'s':''));if(_0x328244[_0x1ec073(0x212)]||_0x328244[_0x1ec073(0x221)])return await handleSDKOutput(_0x3d2071,_0x328244),0x0;return displayFieldsHumanReadable(_0x3d2071,_0x4cd951),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x258);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x19b);async[a21_0x32d180(0x214)](_0xb14a95){const _0x5e44cd=a21_0x32d180,{options:_0xcb6534,args:_0x1fcb41,tdx:_0x5613e7}=_0xb14a95,_0x2af8ad=_0xcb6534,_0x947f3c=_0x1fcb41[0x0]||_0xcb6534[_0x5e44cd(0x172)];if(!_0x947f3c)return showParentSegmentNotSetError(_0x5e44cd(0x1de)+_0x5e44cd(0x184)+_0x5e44cd(0x1ff)+_0x5e44cd(0x231)),0x1;_0xcb6534[_0x5e44cd(0x247)]&&(console[_0x5e44cd(0x246)](_0x5e44cd(0x195)+_0xcb6534['site']),console['error']('Parent\x20segment:\x20'+_0x947f3c));const _0x43b3aa=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x947f3c+_0x5e44cd(0x196),()=>_0x5613e7['segment']['getParentFull'](_0x947f3c),{'verbose':_0xcb6534[_0x5e44cd(0x247)]}),_0x5aee6b=_0x43b3aa[_0x5e44cd(0x1d8)];if(_0x2af8ad[_0x5e44cd(0x1b9)]){const _0x5c66b9=getConsoleNextUrl(_0x2af8ad[_0x5e44cd(0x150)],_0x5e44cd(0x215)+_0x5aee6b['id']);return console['error'](a21_0x210f78['green']('✔')+_0x5e44cd(0x1d6)+a21_0x210f78['cyan'](_0x5c66b9)),openBrowser(_0x5c66b9),0x0;}return await handleSingleObjectOutput(_0x5aee6b,_0xcb6534),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0x32d180(0x14f)]='segment:parent:desc';[a21_0x32d180(0x1c6)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a21_0x32d180(0x214)](_0x4174a6){const _0xd156d3=a21_0x32d180,{options:_0x532035,args:_0x104a0d,tdx:_0x574f4e}=_0x4174a6,_0x596014=_0x104a0d[0x0]||_0x532035[_0xd156d3(0x172)];if(!_0x596014)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0xd156d3(0x218)),0x1;_0x532035[_0xd156d3(0x247)]&&(console['error'](_0xd156d3(0x195)+_0x532035[_0xd156d3(0x150)]),console['error']('Parent\x20segment:\x20'+_0x596014));const _0xb9b175=await withSpinner(_0xd156d3(0x23c)+_0x596014+_0xd156d3(0x196),()=>_0x574f4e['segment']['resolveParentId'](_0x596014),{'verbose':_0x532035[_0xd156d3(0x247)]}),_0x5255e2=_0xb9b175['data'],_0x28e1ba=await withSpinner(_0xd156d3(0x1b1)+_0x596014+_0xd156d3(0x196),()=>_0x574f4e['segment'][_0xd156d3(0x1e7)](_0x5255e2),{'verbose':_0x532035[_0xd156d3(0x247)]}),_0x2dadab=await executeSchemaQuery(_0x28e1ba[_0xd156d3(0x1d8)],_0x574f4e,_0x532035);return await handleQueryOutput(_0x2dadab,_0x532035),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a21_0x32d180(0x14f)]=a21_0x32d180(0x187);[a21_0x32d180(0x1c6)]=a21_0x32d180(0x26b);async[a21_0x32d180(0x214)](_0x5b7914){const _0x529f1e=a21_0x32d180,{options:_0x584037,args:_0x3c9b47,tdx:_0x32071d}=_0x5b7914,_0x2f5b15=_0x3c9b47[0x0]||_0x584037['parentSegment'];if(!_0x2f5b15)return showParentSegmentNotSetError(_0x529f1e(0x16f)+_0x529f1e(0x1b4)),0x1;_0x584037[_0x529f1e(0x247)]&&(console[_0x529f1e(0x246)]('Site:\x20'+_0x584037[_0x529f1e(0x150)]),console['error'](_0x529f1e(0x220)+_0x2f5b15));const _0x367ce6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2f5b15+_0x529f1e(0x196),()=>_0x32071d['segment'][_0x529f1e(0x248)](_0x2f5b15),{'verbose':_0x584037['verbose']}),_0x69f14f=_0x367ce6[_0x529f1e(0x1d8)],_0x433eac=await withSpinner(_0x529f1e(0x1b1)+_0x2f5b15+'\x27...',()=>_0x32071d[_0x529f1e(0x1b3)][_0x529f1e(0x1e7)](_0x69f14f),{'verbose':_0x584037[_0x529f1e(0x247)]}),_0xa97a5c=_0x433eac[_0x529f1e(0x1d8)];return _0x584037['format']==='json'||_0x584037['format']==='jsonl'?await handleSDKOutput([{'sql':_0xa97a5c}],_0x584037):console[_0x529f1e(0x266)](_0xa97a5c),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a21_0x32d180(0x202);['description']=a21_0x32d180(0x267);async[a21_0x32d180(0x214)](_0x3f869a){const _0x56aed9=a21_0x32d180,{options:_0x47f98c,args:_0xf0386d,tdx:_0x55628b}=_0x3f869a,_0x4beaae=_0xf0386d[0x0]||_0x47f98c['parentSegment'];if(!_0x4beaae)return showParentSegmentNotSetError(_0x56aed9(0x1c5)+_0x56aed9(0x185)),0x1;_0x47f98c[_0x56aed9(0x247)]&&(console[_0x56aed9(0x246)]('Site:\x20'+_0x47f98c[_0x56aed9(0x150)]),console[_0x56aed9(0x246)](_0x56aed9(0x220)+_0x4beaae));const _0x5e4a77=await withSpinner(_0x56aed9(0x23c)+_0x4beaae+_0x56aed9(0x196),()=>_0x55628b[_0x56aed9(0x1b3)][_0x56aed9(0x248)](_0x4beaae),{'verbose':_0x47f98c[_0x56aed9(0x247)]}),_0x290efe=_0x5e4a77['data'],_0xc5d247=await withSpinner(_0x56aed9(0x1b1)+_0x4beaae+_0x56aed9(0x196),()=>_0x55628b[_0x56aed9(0x1b3)][_0x56aed9(0x1e7)](_0x290efe),{'verbose':_0x47f98c['verbose']});let _0x34eacc=_0xc5d247[_0x56aed9(0x1d8)];const _0x431df7=resolveLimit(_0x47f98c[_0x56aed9(0x22f)],DEFAULT_DISPLAY_LIMIT),_0x4dcfa7=/\bLIMIT\s+\d+/i[_0x56aed9(0x24a)](_0x34eacc);!_0x4dcfa7&&(_0x34eacc=_0x34eacc[_0x56aed9(0x1f2)]()[_0x56aed9(0x18b)](/;+$/,''),_0x34eacc=_0x56aed9(0x25d)+_0x34eacc+_0x56aed9(0x1d5)+_0x431df7);_0x47f98c[_0x56aed9(0x247)]&&console[_0x56aed9(0x246)](_0x56aed9(0x230)+_0x34eacc);const _0x5df071=await withProgressSpinner(_0x56aed9(0x1f5),async _0x3fe0ba=>{const _0xe78b6f=_0x56aed9,_0x1ba86f=await _0x55628b[_0xe78b6f(0x26e)][_0xe78b6f(0x214)](_0x34eacc,{'catalog':'td','schema':'information_schema','onJobId':_0x23894b=>{const _0x26d9ad=_0xe78b6f;_0x3fe0ba[_0x26d9ad(0x1eb)](_0x23894b);}});return _0x1ba86f;},{'verbose':_0x47f98c[_0x56aed9(0x247)]}),_0x330439=_0x5df071[_0x56aed9(0x1d8)],_0x3c5237=_0x330439[_0x56aed9(0x1ea)]?_0x56aed9(0x20d)+_0x330439['jobId']+']':'';return console[_0x56aed9(0x246)](_0x56aed9(0x261)+_0x330439['stats']['processedRows'][_0x56aed9(0x1c1)]()+_0x56aed9(0x177)+(_0x56aed9(0x237)+formatElapsed(_0x330439[_0x56aed9(0x24e)][_0x56aed9(0x179)])+_0x3c5237)),await handleQueryOutput(_0x330439,_0x47f98c),0x0;}}
|
|
1
|
+
const a21_0x106a0d=a21_0x1807;(function(_0x24c54a,_0xc1c49c){const _0x5c2d02=a21_0x1807,_0x5f203f=_0x24c54a();while(!![]){try{const _0x55d9fb=parseInt(_0x5c2d02(0x242))/0x1+-parseInt(_0x5c2d02(0x214))/0x2*(parseInt(_0x5c2d02(0x2d2))/0x3)+parseInt(_0x5c2d02(0x2cf))/0x4+-parseInt(_0x5c2d02(0x202))/0x5+-parseInt(_0x5c2d02(0x2e2))/0x6*(parseInt(_0x5c2d02(0x2bf))/0x7)+parseInt(_0x5c2d02(0x227))/0x8+parseInt(_0x5c2d02(0x274))/0x9;if(_0x55d9fb===_0xc1c49c)break;else _0x5f203f['push'](_0x5f203f['shift']());}catch(_0x4f18f9){_0x5f203f['push'](_0x5f203f['shift']());}}}(a21_0x46e0,0x616cb));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0xa509c0 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,hyperlink}from'../sdk/util/formatters.js';function a21_0x46e0(){const _0x1766f6=['Listing\x20parent\x20segments\x20matching\x20\x27','parent_segments','Listing\x20fields\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','resolveParentId','✔\x20Updated\x20parent\x20segment\x20\x27','darwin','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Validating\x20configuration...','yellow','displaySummary','dirname','parent_segment','addAttributes','setJobId','replace','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20kill','Error:','updateParent','varchar','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','/sessions/','validateParentYaml','\x20parent\x20segment\x20\x27','\x20is\x20already\x20up\x20to\x20date','parentSegment','%)\x20','output','/\x20→\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','joinKey','Error\x20parsing\x20YAML:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Show\x20parent\x20segment\x20schema\x20(column\x20types)','isDirectory','length','segment:parent:sql','/app/dw/parentSegments/','workflowSessionId','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','customerGroupFile','Customers:','toFixed','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:show','trim','3573720IaLSpp','Error:\x20File\x20not\x20found:\x20','Creating','Errors:','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Site:\x20','Validate:','string','match','columns','\x20Opening\x20','open','getParentSQL','\x5c$&','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20=\x20','1040186sssWvf','label','customerPercent','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--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Behaviors','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','elapsedTimeMillis','all','coveragePercent','stop','addAttributesFile','json','Fetching\x20sample\x20data...','jobId','Error:\x20--database\x20and\x20--table\x20are\x20required','/\x20directory.\x0a','errors','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','3802864Rjstro','✔\x20Found\x20','✔\x20No\x20changes\x20-\x20\x27','behaviors','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error\x20reading\x20file:\x20','matchedCount','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Fetching\x20parent\x20segment\x20\x27','audienceId','text','\x20field','scheduleType','information_schema','utf-8','in\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','attribute','To\x20cancel:','Updated','-1d','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Resolving\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','/attempt/','run','551957IhAgur','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','schemaValid','column','Found\x20YAML\x20file:\x20','.yaml','web','Available\x20attributes:','Show\x20parent\x20segment\x20details','site','map','population','error','listParents','displayColumns','jsonl','repeat','Join\x20on:','\x27\x20is\x20already\x20up\x20to\x20date','\x20rows)','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Join:','localeCompare','/app/workflows/','pushParentYaml','preview','Analyzing\x20changes...','Available\x20behaviors:','Master\x20+\x20Attributes','join','segment','yes','Attempt:','👥\x20','\x20No\x20changes\x20-\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','Behavior:','Session:','/\x20and\x20','previewParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20--behavior\x20\x22<name>\x22','apply','displayMasterInfo','\x0aUsage:\x20tdx\x20ps\x20preview\x20','workflowId','List\x20parent\x20segments','segment:parent:validate','segment:parent:pull','endsWith','4202667JEtOcc','Enriched:','enriched','Rows:','processedRows','sort','getParentFull','\x0aNo\x20sample\x20data\x20available','To\x20view\x20sample\x20data:','master','customerGroup','bold','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','double','cyan','Fetching\x20SQL\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Preview:','data','toLocaleString','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','✔\x20Created\x20parent\x20segment\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Aborted.','segment:parent:create','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','using\x20the\x20default\x20path:\x20','\x27...','use','workflowAttemptId','Fetching\x20current\x20configuration\x20for\x20\x27','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','behaviorsFile','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','log','rowCount','/{name}.yml\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','tdx\x20segment\x20parent\x20preview\x20','\x0a⚠️\x20\x20Migrating:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Coverage:','totalEvents','Apply\x20changes\x20to\x20\x27','number','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','schemaError','Create\x20parent\x20segment\x20\x27','\x20\x20\x20\x20-\x20','.yml','displayPreviewHints','segment:parent:update','test','verbose','green','\x20--attribute\x20\x22<name>\x22','✔\x20Query\x20completed:\x20Processed\x20','segment:parent:push','displaySampleData','createParent','platform','Parent\x20segment:\x20','Listing\x20parent\x20segments...','format','timezone','Error:\x20--behavior\x20requires\x20a\x20name\x0a','723506CwVAQb','/\x20directories\x20exist.','unref','displayAttributesStats','\x0aChanges\x20to\x20\x27','dim','\x20Context\x20set:\x20','Audience\x20ID:','segment:parent:list','interval','listFields','\x27\x20is\x20up\x20to\x20date','runParent','foreignKey','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','xdg-open','971872NqlOgu','keys','\x27\x20and\x20run\x20workflow?','3bXEWPS','red','table','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','execute','\x20Configuration\x20is\x20valid','attributesFile','SELECT\x20*\x20FROM\x20(\x0a','name','pullParentYaml','Source:','\x0a⚠️\x20\x20Both\x20','query','database','displayPreviewResults','6PWRGhw','Status:','displayBehaviorsStats','✘\x20Failed\x20to\x20rename\x20directory:\x20','description','message','start','behavior','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Executing\x20parent\x20segment\x20query...','addBehaviors','displayValidateResults','\x20tdx\x20wf\x20attempt\x20','scheduleOption','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Overwrite\x20\x27','YAML\x20file:\x20','attributes','segment:parent:view','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20--attribute\x20\x22','\x20parent\x20segment','Events:','Options:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','filter','allValid','Updating','stats'];a21_0x46e0=function(){return _0x1766f6;};return a21_0x46e0();}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 a21_0x301366 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=a21_0x106a0d(0x301),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x5ab562){const _0x5d4bdf=a21_0x106a0d,_0x224b29=process[_0x5d4bdf(0x2b9)],_0x16e2cd=_0x224b29===_0x5d4bdf(0x306)?_0x5d4bdf(0x20e):_0x224b29==='win32'?_0x5d4bdf(0x2e8):_0x5d4bdf(0x2ce);spawn(_0x16e2cd,[_0x5ab562],{'detached':!![],'stdio':'ignore'})[_0x5d4bdf(0x2c1)]();}function migrateLegacyDirectory(){const _0xc3b8e0=a21_0x106a0d;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x26ea83=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x26ea83[_0xc3b8e0(0x1f5)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a21_0x301366[_0xc3b8e0(0x309)](_0xc3b8e0(0x2de)+LEGACY_PARENT_SEGMENT_DIR+_0xc3b8e0(0x268)+PARENT_SEGMENT_DIR+_0xc3b8e0(0x2c0))),console[_0xc3b8e0(0x24e)](a21_0x301366[_0xc3b8e0(0x2c4)](_0xc3b8e0(0x207)+LEGACY_PARENT_SEGMENT_DIR+_0xc3b8e0(0x224))),![];console['error'](a21_0x301366[_0xc3b8e0(0x309)](_0xc3b8e0(0x2a0)+LEGACY_PARENT_SEGMENT_DIR+_0xc3b8e0(0x1ef)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xc3b8e0(0x24e)](a21_0x301366[_0xc3b8e0(0x2b3)](_0xc3b8e0(0x206)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x785301){const _0x2f62b3=_0x785301 instanceof Error?_0x785301[_0xc3b8e0(0x2e7)]:String(_0x785301);return console[_0xc3b8e0(0x24e)](a21_0x301366[_0xc3b8e0(0x2d3)](_0xc3b8e0(0x2e5)+_0x2f62b3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x106a0d(0x241)](_0x391207){const _0x4b8f2a=a21_0x106a0d;return migrateLegacyDirectory(),super[_0x4b8f2a(0x241)](_0x391207);}}function resolveYamlFile(_0x4f7804){const _0x496f81=a21_0x106a0d;if(_0x4f7804[_0x496f81(0x273)](_0x496f81(0x2ae))||_0x4f7804[_0x496f81(0x273)](_0x496f81(0x247)))return _0x4f7804;return a21_0xa509c0[_0x496f81(0x25f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4f7804)+_0x496f81(0x2ae));}function formatProgressMessage(_0x3a7429){const _0x1c4ccd=a21_0x106a0d,_0x62a55a=_0x3a7429[_0x1c4ccd(0x20b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x62a55a){const [,_0x113c6b,_0x4682cd,_0x15ee96='']=_0x62a55a;return a21_0x301366[_0x1c4ccd(0x2c4)](_0x113c6b+':')+'\x20'+_0x4682cd+a21_0x301366[_0x1c4ccd(0x2c4)](_0x15ee96);}return a21_0x301366[_0x1c4ccd(0x2c4)](_0x3a7429);}function showFileNotFoundError(_0x1c436e,_0x10db46){const _0x2e6709=a21_0x106a0d;console[_0x2e6709(0x24e)](a21_0x301366[_0x2e6709(0x2d3)](_0x2e6709(0x203)+_0x1c436e+'\x0a')),console[_0x2e6709(0x24e)](a21_0x301366[_0x2e6709(0x282)](_0x2e6709(0x1f0)+_0x10db46+_0x2e6709(0x2a9)));}function showParentSegmentNotSetError(_0x589214){const _0x6a4751=a21_0x106a0d;console['error'](a21_0x301366[_0x6a4751(0x309)](_0x6a4751(0x303))),console[_0x6a4751(0x24e)](_0x589214);}function a21_0x1807(_0x3fda62,_0x29be53){_0x3fda62=_0x3fda62-0x1de;const _0x46e0e5=a21_0x46e0();let _0x180771=_0x46e0e5[_0x3fda62];return _0x180771;}export class ParentSegmentListCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2c7);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x270);async[a21_0x106a0d(0x2d7)](_0x532968){const _0x21837d=a21_0x106a0d,{options:_0x1fdb06,args:_0x1a7cae,tdx:_0x536a6a}=_0x532968,_0x4f6aa8=_0x1a7cae[0x0];_0x1fdb06[_0x21837d(0x2b2)]&&(console[_0x21837d(0x24e)]('Site:\x20'+_0x1fdb06['site']),_0x4f6aa8&&console[_0x21837d(0x24e)]('Pattern:\x20'+_0x4f6aa8));const _0x4860d0=await withSpinner(_0x4f6aa8?_0x21837d(0x300)+_0x4f6aa8+_0x21837d(0x293):_0x21837d(0x2bb),()=>_0x536a6a[_0x21837d(0x260)][_0x21837d(0x24f)](),{'verbose':_0x1fdb06[_0x21837d(0x2b2)]});let _0x38ec47=_0x4860d0[_0x21837d(0x287)];if(_0x4f6aa8){const _0x282c7f=_0x4f6aa8[_0x21837d(0x1e1)](/[.+^${}()|[\]\\]/g,_0x21837d(0x210))[_0x21837d(0x1e1)](/\*/g,'.*')[_0x21837d(0x1e1)](/\?/g,'.'),_0x6e2ff=new RegExp('^'+_0x282c7f+'$','i');_0x38ec47=_0x38ec47[_0x21837d(0x2fc)](_0xe77ef0=>_0x6e2ff[_0x21837d(0x2b1)](_0xe77ef0[_0x21837d(0x2f3)]['name']));}_0x38ec47[_0x21837d(0x279)]((_0x46a078,_0x69a8c0)=>_0x46a078[_0x21837d(0x2f3)]['name'][_0x21837d(0x258)](_0x69a8c0['attributes'][_0x21837d(0x2db)])),console[_0x21837d(0x24e)]('✔\x20Found\x20'+_0x38ec47[_0x21837d(0x1f6)]+_0x21837d(0x2f7)+(_0x38ec47[_0x21837d(0x1f6)]!==0x1?'s':''));const _0x4eeb1e=_0x230f87=>{const _0x3507bc=_0x21837d;return getConsoleNextUrl(_0x1fdb06[_0x3507bc(0x24b)],_0x3507bc(0x1f8)+_0x230f87);};if(_0x1fdb06[_0x21837d(0x2bc)]==='json'||_0x1fdb06[_0x21837d(0x2bc)]===_0x21837d(0x251)){const _0x208eb=_0x38ec47['map'](_0x5c349c=>({..._0x5c349c,'url':_0x4eeb1e(_0x5c349c['id'])}));await handleSDKOutput(_0x208eb,_0x1fdb06);}else{if(_0x38ec47[_0x21837d(0x1f6)]===0x0)_0x4f6aa8?console[_0x21837d(0x29b)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4f6aa8):console[_0x21837d(0x29b)]('No\x20parent\x20segments\x20found');else for(const _0x2dc71e of _0x38ec47){const _0x41b993=_0x2dc71e[_0x21837d(0x2f3)][_0x21837d(0x24d)]?a21_0x301366[_0x21837d(0x2c4)]('\x20('+formatRows(_0x2dc71e[_0x21837d(0x2f3)][_0x21837d(0x24d)])+')'):'',_0x2006a0=hyperlink(_0x2dc71e[_0x21837d(0x2f3)][_0x21837d(0x2db)],_0x4eeb1e(_0x2dc71e['id']));console[_0x21837d(0x29b)](_0x21837d(0x263)+_0x2006a0+_0x41b993);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x28f);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x29a);async[a21_0x106a0d(0x2d7)](_0x35b00d){const _0x31634b=a21_0x106a0d,{options:_0x51f33a,args:_0x56b9a4,tdx:_0x16bf95}=_0x35b00d;console[_0x31634b(0x24e)](_0x31634b(0x307)+'\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 _0x5848ad=_0x51f33a;if(_0x56b9a4['length']===0x0)return console[_0x31634b(0x24e)](a21_0x301366[_0x31634b(0x2d3)](_0x31634b(0x29e))),console[_0x31634b(0x24e)](_0x31634b(0x285)),0x1;const _0x1922e0=_0x56b9a4[0x0];if(!_0x5848ad['database']||!_0x5848ad[_0x31634b(0x2d4)])return console[_0x31634b(0x24e)](_0x31634b(0x223)),console[_0x31634b(0x24e)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x5848ad[_0x31634b(0x2b2)]&&(console[_0x31634b(0x24e)](_0x31634b(0x208)+_0x5848ad['site']),console['error']('Name:\x20'+_0x1922e0),console['error']('Database:\x20'+_0x5848ad[_0x31634b(0x2e0)]),console[_0x31634b(0x24e)]('Table:\x20'+_0x5848ad[_0x31634b(0x2d4)]));const _0x3ebbdc=await loadJSONFromOptions(_0x5848ad[_0x31634b(0x2f3)],_0x5848ad[_0x31634b(0x2d9)]),_0x591b83=await loadJSONFromOptions(_0x5848ad[_0x31634b(0x22a)],_0x5848ad[_0x31634b(0x299)]),_0x5d1a02=await loadJSONFromOptions(_0x5848ad[_0x31634b(0x27e)],_0x5848ad[_0x31634b(0x1fc)]),_0x4f44bf={'name':_0x1922e0,'description':_0x5848ad['description'],'scheduleType':_0x5848ad[_0x31634b(0x233)],'scheduleOption':_0x5848ad[_0x31634b(0x2ef)],'timezone':_0x5848ad[_0x31634b(0x2bd)],'master':{'parentDatabaseName':_0x5848ad[_0x31634b(0x2e0)],'parentTableName':_0x5848ad[_0x31634b(0x2d4)]},'attributes':_0x3ebbdc,'behaviors':_0x591b83,'customerGroup':_0x5d1a02},_0xd31e36=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1922e0+_0x31634b(0x293),()=>_0x16bf95[_0x31634b(0x260)][_0x31634b(0x2b8)](_0x4f44bf),{'verbose':_0x51f33a['verbose']}),_0x9a01fc=_0xd31e36[_0x31634b(0x287)];return console[_0x31634b(0x24e)](_0x31634b(0x28c)+_0x9a01fc[_0x31634b(0x2db)]+'\x27\x20with\x20ID:\x20'+_0x9a01fc['id']),await handleSDKOutput([_0x9a01fc],_0x51f33a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2b0);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x1f3);async[a21_0x106a0d(0x2d7)](_0x4afa12){const _0x502ddb=a21_0x106a0d,{options:_0x380607,args:_0x34c06c,tdx:_0x4a07db}=_0x4afa12;console[_0x502ddb(0x24e)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x502ddb(0x2cd));const _0x542581=_0x380607;if(_0x34c06c[_0x502ddb(0x1f6)]===0x0)return console['error'](a21_0x301366[_0x502ddb(0x2d3)](_0x502ddb(0x29e))),console[_0x502ddb(0x24e)](_0x502ddb(0x2fa)),0x1;const _0x4b9201=_0x34c06c[0x0];_0x542581[_0x502ddb(0x2b2)]&&(console['error'](_0x502ddb(0x208)+_0x542581[_0x502ddb(0x24b)]),console[_0x502ddb(0x24e)](_0x502ddb(0x2ba)+_0x4b9201));const _0x4c207b=await withSpinner(_0x502ddb(0x296)+_0x4b9201+'\x27...',()=>_0x4a07db[_0x502ddb(0x260)][_0x502ddb(0x27a)](_0x4b9201),{'verbose':_0x542581[_0x502ddb(0x2b2)]}),_0x262ee3=_0x4c207b['data'],_0xa1ea67=await loadJSONFromOptions(_0x542581[_0x502ddb(0x1df)],_0x542581[_0x502ddb(0x21f)]),_0x3ce206=await loadJSONFromOptions(_0x542581[_0x502ddb(0x2ec)],_0x542581['addBehaviorsFile']),_0x4f3d9f={'name':_0x262ee3[_0x502ddb(0x2db)],'description':_0x542581[_0x502ddb(0x2e6)]!==undefined?_0x542581[_0x502ddb(0x2e6)]:_0x262ee3[_0x502ddb(0x2e6)],'scheduleType':_0x542581[_0x502ddb(0x233)]!==undefined?_0x542581['scheduleType']:_0x262ee3[_0x502ddb(0x233)],'scheduleOption':_0x542581[_0x502ddb(0x2ef)]!==undefined?_0x542581[_0x502ddb(0x2ef)]:_0x262ee3[_0x502ddb(0x2ef)],'timezone':_0x542581['timezone']!==undefined?_0x542581[_0x502ddb(0x2bd)]:_0x262ee3['timezone'],'master':_0x262ee3['master'],'attributes':_0xa1ea67?[..._0x262ee3['attributes']||[],..._0xa1ea67]:_0x262ee3[_0x502ddb(0x2f3)],'behaviors':_0x3ce206?[..._0x262ee3[_0x502ddb(0x22a)]||[],..._0x3ce206]:_0x262ee3[_0x502ddb(0x22a)],'customerGroup':_0x262ee3[_0x502ddb(0x27e)]},_0x32d210=await withSpinner(_0x502ddb(0x297)+_0x4b9201+_0x502ddb(0x293),()=>_0x4a07db[_0x502ddb(0x260)][_0x502ddb(0x1e5)](_0x4b9201,_0x4f3d9f),{'verbose':_0x542581[_0x502ddb(0x2b2)]}),_0x3d238a=_0x32d210['data'];return console[_0x502ddb(0x24e)](_0x502ddb(0x305)+_0x3d238a['name']+'\x27'),await handleSDKOutput([_0x3d238a],_0x542581),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x272);[a21_0x106a0d(0x2e6)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a21_0x106a0d(0x2d7)](_0x5ae186){const _0x483360=a21_0x106a0d,{options:_0x567aac,args:_0x296cbd,tdx:_0x1dfaf6}=_0x5ae186,_0x57dba7=_0x567aac,_0x2656cf=_0x296cbd[0x0]||_0x567aac[_0x483360(0x1ec)];if(!_0x2656cf)return showParentSegmentNotSetError(_0x483360(0x23d)+_0x483360(0x2a2)),0x1;if(_0x57dba7[_0x483360(0x294)]&&_0x57dba7[_0x483360(0x1ee)])return console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2d3)](_0x483360(0x2ea))),console[_0x483360(0x24e)](a21_0x301366['dim'](_0x483360(0x290))),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2c4)](_0x483360(0x292)+PARENT_SEGMENT_DIR+_0x483360(0x29d))),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x282)](_0x483360(0x238))),0x1;const _0x51e412=_0x57dba7[_0x483360(0x1ee)]||a21_0xa509c0[_0x483360(0x25f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2656cf)+'.yml');_0x57dba7[_0x483360(0x2b2)]&&(console[_0x483360(0x24e)]('Site:\x20'+_0x57dba7[_0x483360(0x24b)]),console[_0x483360(0x24e)]('Parent\x20segment:\x20'+_0x2656cf),console[_0x483360(0x24e)]('Output\x20file:\x20'+_0x51e412));const _0x803ab6=await withSpinner(_0x483360(0x22f)+_0x2656cf+'\x27...',()=>_0x1dfaf6[_0x483360(0x260)][_0x483360(0x2dc)](_0x2656cf),{'verbose':_0x57dba7['verbose']}),_0x3df178=_0x803ab6[_0x483360(0x287)];if(existsSync(_0x51e412)){const _0x47aac8=readFileSync(_0x51e412,_0x483360(0x235)),_0x4405e3=generateDiff(_0x47aac8,_0x3df178);if(!hasChanges(_0x4405e3))console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x264)+a21_0x301366['cyan'](_0x51e412)+_0x483360(0x1eb));else{console[_0x483360(0x24e)](_0x483360(0x2c3)+_0x51e412+'\x27:'),console[_0x483360(0x24e)]('─'[_0x483360(0x252)](0x3c)),console[_0x483360(0x24e)](formatDiffWithColors(_0x4405e3)),console['error']('─'[_0x483360(0x252)](0x3c));if(!_0x57dba7[_0x483360(0x261)]){const _0x4a7a90=await confirmKey(_0x483360(0x2f1)+_0x51e412+'\x27?');if(!_0x4a7a90)return console['error'](_0x483360(0x28e)),0x1;}writeFileSync(_0x51e412,_0x3df178,_0x483360(0x235)),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x2d6)+a21_0x301366[_0x483360(0x282)](_0x51e412));}}else{const _0x1c3299=a21_0xa509c0[_0x483360(0x30b)](_0x51e412);!existsSync(_0x1c3299)&&mkdirSync(_0x1c3299,{'recursive':!![]}),writeFileSync(_0x51e412,_0x3df178,_0x483360(0x235)),console['error'](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x2d6)+a21_0x301366[_0x483360(0x282)](_0x51e412));}return saveSessionContext({'parent_segment':_0x2656cf},_0x57dba7['session']),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x2c5)+a21_0x301366[_0x483360(0x2c4)](_0x483360(0x1de))+_0x483360(0x213)+a21_0x301366[_0x483360(0x282)](_0x2656cf)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2b6);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x280);async[a21_0x106a0d(0x2d7)](_0x494f0a){const _0x1a4b30=a21_0x106a0d,{options:_0x4443ee,args:_0x3f6266,tdx:_0x2afbae}=_0x494f0a,_0x155e4e=_0x4443ee,_0x57fe7b=_0x3f6266[0x0]||_0x4443ee[_0x1a4b30(0x1ec)];if(!_0x57fe7b)return showParentSegmentNotSetError(_0x1a4b30(0x217)+_0x1a4b30(0x1fb)),0x1;const _0x312e2c=resolveYamlFile(_0x57fe7b);if(!existsSync(_0x312e2c))return showFileNotFoundError(_0x312e2c,_0x57fe7b),0x1;_0x155e4e['verbose']&&(console['error'](_0x1a4b30(0x208)+_0x155e4e[_0x1a4b30(0x24b)]),console[_0x1a4b30(0x24e)]('YAML\x20file:\x20'+_0x312e2c));let _0x53bd39;try{_0x53bd39=readFileSync(_0x312e2c,_0x1a4b30(0x235));}catch(_0x4c4112){const _0x41e2a3=_0x4c4112 instanceof Error?_0x4c4112[_0x1a4b30(0x2e7)]:String(_0x4c4112);return console[_0x1a4b30(0x24e)](_0x1a4b30(0x22c)+_0x41e2a3),0x1;}const _0x98f45c=await withSpinner(_0x1a4b30(0x25c),()=>_0x2afbae[_0x1a4b30(0x260)]['pushParentYaml'](_0x53bd39),{'verbose':_0x155e4e[_0x1a4b30(0x2b2)]}),_0x1a8739=_0x98f45c[_0x1a4b30(0x287)],{isNew:_0x34bee1,name:_0x7b966e,hasChanges:_0x2d4b1b,diffFormatted:_0x391470}=_0x1a8739;if(!_0x2d4b1b)return console['error'](_0x1a4b30(0x229)+_0x7b966e+_0x1a4b30(0x254)),0x0;_0x34bee1?console[_0x1a4b30(0x24e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x7b966e+'\x27:'):console[_0x1a4b30(0x24e)](_0x1a4b30(0x289)+_0x7b966e+'\x27:');console['error']('─'[_0x1a4b30(0x252)](0x3c)),console['error'](_0x391470),console['error']('─'[_0x1a4b30(0x252)](0x3c));const _0x42a1ec=_0x34bee1?_0x1a4b30(0x2ac)+_0x7b966e+'\x27?':_0x1a4b30(0x2a7)+_0x7b966e+'\x27?';if(!_0x155e4e['yes']){const _0x3229af=await confirmKey(_0x42a1ec);if(!_0x3229af)return console['error'](_0x1a4b30(0x28e)),0x1;}const _0x461e6b=_0x34bee1?_0x1a4b30(0x204):'Updating',_0x545a3e=await withSpinner(_0x461e6b+_0x1a4b30(0x1ea)+_0x7b966e+'\x27...',()=>_0x1a8739['apply'](),{'verbose':_0x155e4e[_0x1a4b30(0x2b2)]}),_0x5492f4=_0x545a3e[_0x1a4b30(0x287)],_0x1e2e10=getConsoleNextUrl(_0x155e4e[_0x1a4b30(0x24b)],_0x1a4b30(0x1f8)+_0x5492f4['id']),_0x14ad1b=_0x34bee1?'Created':_0x1a4b30(0x23b);return console[_0x1a4b30(0x24e)]('✔\x20'+_0x14ad1b+'\x20parent\x20segment\x20\x27'+_0x5492f4['name']+'\x27'),console[_0x1a4b30(0x24e)]('\x20\x20'+_0x1e2e10),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x271);[a21_0x106a0d(0x2e6)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async['execute'](_0x279610){const _0x5b3de8=a21_0x106a0d,{options:_0x376d81,args:_0x529451,tdx:_0x1a9921}=_0x279610,_0x674d7e=_0x376d81,_0x1b1965=_0x529451[0x0]||_0x376d81['parentSegment'];if(!_0x1b1965)return showParentSegmentNotSetError(_0x5b3de8(0x28b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x5b3de8(0x23f)+_0x5b3de8(0x212)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x353e51=resolveYamlFile(_0x1b1965);if(!existsSync(_0x353e51))return showFileNotFoundError(_0x353e51,_0x1b1965),0x1;_0x674d7e['verbose']&&(console[_0x5b3de8(0x24e)](_0x5b3de8(0x208)+_0x674d7e[_0x5b3de8(0x24b)]),console['error'](_0x5b3de8(0x2f2)+_0x353e51));let _0x3d8982;try{_0x3d8982=readFileSync(_0x353e51,'utf-8');}catch(_0x19e36d){const _0x50231c=_0x19e36d instanceof Error?_0x19e36d[_0x5b3de8(0x2e7)]:String(_0x19e36d);return console[_0x5b3de8(0x24e)]('Error\x20reading\x20file:\x20'+_0x50231c),0x1;}const _0x38cb4e=createCommandSpinner(a21_0x301366['dim'](_0x5b3de8(0x308)),{'verbose':_0x674d7e[_0x5b3de8(0x2b2)]});_0x38cb4e[_0x5b3de8(0x2e8)]();const _0x29e7b6={'onProgress':_0x39199b=>{const _0x3add7b=_0x5b3de8;_0x38cb4e[_0x3add7b(0x231)]=formatProgressMessage(_0x39199b);}};if(_0x674d7e[_0x5b3de8(0x27d)])_0x29e7b6['master']=!![];if(_0x674d7e['enriched'])_0x29e7b6[_0x5b3de8(0x276)]=!![];_0x674d7e[_0x5b3de8(0x239)]&&(_0x29e7b6[_0x5b3de8(0x239)]=_0x674d7e['attribute']);_0x674d7e[_0x5b3de8(0x2e9)]&&(_0x29e7b6['behavior']=_0x674d7e['behavior']);if(_0x674d7e[_0x5b3de8(0x2c8)])_0x29e7b6['interval']=_0x674d7e[_0x5b3de8(0x2c8)];let _0x1dc8da;try{_0x1dc8da=await _0x1a9921[_0x5b3de8(0x260)][_0x5b3de8(0x1e9)](_0x3d8982,_0x29e7b6),_0x38cb4e[_0x5b3de8(0x21e)]();}catch(_0x5bf744){_0x38cb4e['stop']();throw _0x5bf744;}const _0x1b6878=_0x674d7e[_0x5b3de8(0x2c8)]||_0x5b3de8(0x23c);return this[_0x5b3de8(0x2ed)](_0x1dc8da,_0x29e7b6,_0x353e51,_0x1b6878),_0x1dc8da[_0x5b3de8(0x2fd)]?0x0:0x1;}[a21_0x106a0d(0x2ed)](_0x3e066c,_0x4023e8,_0x491146,_0x2a9f1f){const _0x6380b9=a21_0x106a0d;console[_0x6380b9(0x24e)]('\x0a'+a21_0x301366['bold'](_0x6380b9(0x209))+'\x20'+_0x3e066c[_0x6380b9(0x2db)]),console[_0x6380b9(0x24e)]('═'['repeat'](0x3c)),this[_0x6380b9(0x26d)](_0x3e066c);if(typeof _0x4023e8[_0x6380b9(0x239)]===_0x6380b9(0x20a)){this['displayAttributesStats'](_0x3e066c),this[_0x6380b9(0x30a)](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,_0x6380b9(0x239),_0x4023e8[_0x6380b9(0x239)]);return;}if(_0x4023e8['attribute']===!![]){this[_0x6380b9(0x2c2)](_0x3e066c),this['displaySummary'](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,_0x6380b9(0x2f3));return;}if(typeof _0x4023e8['behavior']===_0x6380b9(0x20a)){this[_0x6380b9(0x2e4)](_0x3e066c,_0x2a9f1f),this[_0x6380b9(0x30a)](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,_0x6380b9(0x2e9),_0x4023e8['behavior']);return;}if(_0x4023e8[_0x6380b9(0x2e9)]===!![]){this[_0x6380b9(0x2e4)](_0x3e066c,_0x2a9f1f),this[_0x6380b9(0x30a)](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,'behaviors');return;}this[_0x6380b9(0x2c2)](_0x3e066c),this[_0x6380b9(0x2e4)](_0x3e066c,_0x2a9f1f),this[_0x6380b9(0x30a)](_0x3e066c),this['displayPreviewHints'](_0x491146,_0x2a9f1f,_0x6380b9(0x21c));}[a21_0x106a0d(0x2af)](_0x1b5079,_0x354d8b,_0x1db451,_0xcc30ef){const _0xbb0ae1=a21_0x106a0d;console[_0xbb0ae1(0x24e)]('\x0a'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x27c)));const _0x3f4c10=_0x354d8b!==_0xbb0ae1(0x23c)?'\x20--interval\x20'+_0x354d8b:'';if(_0x1db451===_0xbb0ae1(0x239)&&_0xcc30ef)console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x29f)+_0x1b5079+_0xbb0ae1(0x2f6)+_0xcc30ef+'\x22'+_0x3f4c10));else{if(_0x1db451===_0xbb0ae1(0x2e9)&&_0xcc30ef)console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x29f)+_0x1b5079+'\x20--behavior\x20\x22'+_0xcc30ef+'\x22'+_0x3f4c10));else(_0x1db451==='attributes'||_0x1db451===_0xbb0ae1(0x21c))&&console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366['dim'](_0xbb0ae1(0x29f)+_0x1b5079+_0xbb0ae1(0x2b4)+_0x3f4c10));}(_0x1db451===_0xbb0ae1(0x22a)||_0x1db451===_0xbb0ae1(0x21c))&&console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x29f)+_0x1b5079+_0xbb0ae1(0x26b)+_0x3f4c10)),_0x1db451===_0xbb0ae1(0x21c)&&console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)]('tdx\x20segment\x20parent\x20preview\x20'+_0x1b5079+'\x20--enriched'+_0x3f4c10));}['displayMasterInfo'](_0x331c91){const _0x252fad=a21_0x106a0d,{master:_0x136c94}=_0x331c91,_0x4f2c2e=_0x136c94[_0x252fad(0x244)]?a21_0x301366[_0x252fad(0x2b3)]('✔'):a21_0x301366['red']('✘');console[_0x252fad(0x24e)]('\x0a'+a21_0x301366[_0x252fad(0x2c4)]('Master\x20Table')),console['error'](_0x4f2c2e+'\x20'+a21_0x301366['bold'](_0x136c94['database']+'.'+_0x136c94['table'])),_0x136c94[_0x252fad(0x244)]?_0x136c94[_0x252fad(0x29c)]!==undefined&&console['error']('\x20\x20'+a21_0x301366[_0x252fad(0x2c4)](_0x252fad(0x277))+'\x20'+a21_0x301366[_0x252fad(0x282)](formatRows(_0x136c94[_0x252fad(0x29c)]))):console[_0x252fad(0x24e)]('\x20\x20'+a21_0x301366[_0x252fad(0x2d3)]('Error:')+'\x20'+_0x136c94[_0x252fad(0x2ab)]);}[a21_0x106a0d(0x2c2)](_0x3e008b){const _0x17efc4=a21_0x106a0d;if(_0x3e008b[_0x17efc4(0x2f3)][_0x17efc4(0x1f6)]===0x0)return;console[_0x17efc4(0x24e)]('\x0a'+a21_0x301366[_0x17efc4(0x2c4)]('Attributes'));for(const _0x31cd0a of _0x3e008b['attributes']){const _0xffb3bf=_0x31cd0a['schemaValid']?a21_0x301366[_0x17efc4(0x2b3)]('✔'):a21_0x301366[_0x17efc4(0x2d3)]('✘');let _0x3ad7fa='';if(_0x31cd0a[_0x17efc4(0x244)]&&_0x31cd0a[_0x17efc4(0x22d)]!==undefined&&_0x31cd0a['coveragePercent']!==undefined){const _0xc2df83=_0x31cd0a[_0x17efc4(0x21d)][_0x17efc4(0x1fe)](0x1),_0xd49b95=_0x31cd0a['coveragePercent']>=0x50?a21_0x301366[_0x17efc4(0x2b3)]:_0x31cd0a['coveragePercent']>=0x32?a21_0x301366[_0x17efc4(0x309)]:a21_0x301366[_0x17efc4(0x2d3)];_0x3ad7fa='\x20'+a21_0x301366[_0x17efc4(0x2c4)](_0x17efc4(0x2a5))+'\x20'+_0xd49b95(_0xc2df83+'%')+'\x20('+formatRows(_0x31cd0a[_0x17efc4(0x22d)])+_0x17efc4(0x255);}console[_0x17efc4(0x24e)](_0xffb3bf+'\x20'+a21_0x301366[_0x17efc4(0x27f)](_0x31cd0a[_0x17efc4(0x2db)])+_0x3ad7fa),console[_0x17efc4(0x24e)]('\x20\x20'+a21_0x301366[_0x17efc4(0x2c4)](_0x17efc4(0x2dd))+'\x20'+a21_0x301366[_0x17efc4(0x27f)](_0x31cd0a[_0x17efc4(0x2e0)]+'.'+_0x31cd0a[_0x17efc4(0x2d4)]));const _0x557c0b=_0x31cd0a[_0x17efc4(0x1f1)]===_0x31cd0a['foreignKey']?a21_0x301366[_0x17efc4(0x2c4)](_0x17efc4(0x253))+'\x20'+_0x31cd0a[_0x17efc4(0x1f1)]:a21_0x301366['dim'](_0x17efc4(0x257))+'\x20'+_0x31cd0a['joinKey']+_0x17efc4(0x213)+_0x31cd0a[_0x17efc4(0x2cc)];console[_0x17efc4(0x24e)]('\x20\x20'+_0x557c0b),console['error']('\x20\x20'+a21_0x301366[_0x17efc4(0x2c4)]('Columns:')),this[_0x17efc4(0x250)](_0x31cd0a[_0x17efc4(0x20c)]),!_0x31cd0a[_0x17efc4(0x244)]&&console[_0x17efc4(0x24e)]('\x20\x20'+a21_0x301366[_0x17efc4(0x2d3)]('Error:')+'\x20'+_0x31cd0a[_0x17efc4(0x2ab)]);}}[a21_0x106a0d(0x2e4)](_0x51a81f,_0x2e85d9){const _0x1cda81=a21_0x106a0d;if(_0x51a81f[_0x1cda81(0x22a)][_0x1cda81(0x1f6)]===0x0)return;console[_0x1cda81(0x24e)]('\x0a'+a21_0x301366['dim'](_0x1cda81(0x219))+'\x20'+a21_0x301366['dim']('('+_0x2e85d9+')'));for(const _0x4ea462 of _0x51a81f[_0x1cda81(0x22a)]){const _0x42c7ad=_0x4ea462[_0x1cda81(0x244)]?a21_0x301366[_0x1cda81(0x2b3)]('✔'):a21_0x301366['red']('✘');let _0x22a213='';if(_0x4ea462[_0x1cda81(0x244)]&&_0x4ea462['customersWithEvents']!==undefined&&_0x4ea462[_0x1cda81(0x2a6)]!==undefined){const _0x9d328c=_0x4ea462['customerPercent']?.[_0x1cda81(0x1fe)](0x1)||'?',_0x2032e6=(_0x4ea462[_0x1cda81(0x216)]??0x0)>=0x32?a21_0x301366[_0x1cda81(0x2b3)]:(_0x4ea462[_0x1cda81(0x216)]??0x0)>=0x14?a21_0x301366[_0x1cda81(0x309)]:a21_0x301366[_0x1cda81(0x2d3)];_0x22a213='\x20'+a21_0x301366['dim'](_0x1cda81(0x1fd))+'\x20'+_0x2032e6(formatRows(_0x4ea462['customersWithEvents']))+'\x20('+_0x9d328c+_0x1cda81(0x1ed)+a21_0x301366[_0x1cda81(0x2c4)](_0x1cda81(0x2f8))+'\x20'+a21_0x301366['cyan'](formatRows(_0x4ea462[_0x1cda81(0x2a6)]));}console['error'](_0x42c7ad+'\x20'+a21_0x301366['bold'](_0x4ea462[_0x1cda81(0x2db)])+_0x22a213),console[_0x1cda81(0x24e)]('\x20\x20'+a21_0x301366[_0x1cda81(0x2c4)](_0x1cda81(0x2dd))+'\x20'+a21_0x301366[_0x1cda81(0x27f)](_0x4ea462[_0x1cda81(0x2e0)]+'.'+_0x4ea462['table']));const _0x1d92d9=_0x4ea462['joinKey']===_0x4ea462[_0x1cda81(0x2cc)]?a21_0x301366[_0x1cda81(0x2c4)]('Join\x20on:')+'\x20'+_0x4ea462[_0x1cda81(0x1f1)]:a21_0x301366[_0x1cda81(0x2c4)](_0x1cda81(0x257))+'\x20'+_0x4ea462[_0x1cda81(0x1f1)]+'\x20=\x20'+_0x4ea462[_0x1cda81(0x2cc)];console[_0x1cda81(0x24e)]('\x20\x20'+_0x1d92d9),console[_0x1cda81(0x24e)]('\x20\x20'+a21_0x301366[_0x1cda81(0x2c4)]('Columns:')),this['displayColumns'](_0x4ea462['columns']),!_0x4ea462[_0x1cda81(0x244)]&&console[_0x1cda81(0x24e)]('\x20\x20'+a21_0x301366[_0x1cda81(0x2d3)](_0x1cda81(0x1e4))+'\x20'+_0x4ea462[_0x1cda81(0x2ab)]);}}[a21_0x106a0d(0x250)](_0x27d941){const _0x435127=a21_0x106a0d;for(const _0x1777d5 of _0x27d941){_0x1777d5['label']===_0x1777d5[_0x435127(0x245)]||_0x1777d5[_0x435127(0x245)]==='*'?console['error'](_0x435127(0x2ad)+_0x1777d5['label']):console[_0x435127(0x24e)](_0x435127(0x2ad)+_0x1777d5[_0x435127(0x215)]+'\x20'+a21_0x301366[_0x435127(0x2c4)]('('+_0x1777d5[_0x435127(0x245)]+')'));}}[a21_0x106a0d(0x30a)](_0xaf5409){const _0x358e8b=a21_0x106a0d;console[_0x358e8b(0x24e)]('─'['repeat'](0x3c));if(_0xaf5409[_0x358e8b(0x225)]['length']>0x0){console[_0x358e8b(0x24e)]('\x0a'+a21_0x301366['red'](_0x358e8b(0x205)));for(const _0x5d3de5 of _0xaf5409[_0x358e8b(0x225)]){console[_0x358e8b(0x24e)]('\x20\x20'+a21_0x301366[_0x358e8b(0x2d3)]('•')+'\x20'+_0x5d3de5);}}_0xaf5409['allValid']&&console[_0x358e8b(0x24e)]('\x0a'+a21_0x301366[_0x358e8b(0x2b3)]('✔')+_0x358e8b(0x2d8));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x22e);async['execute'](_0x5d4dea){const _0x4728e3=a21_0x106a0d,{options:_0x7753d3,args:_0x32e4d5,tdx:_0x496524}=_0x5d4dea,_0x3c0f2b=_0x7753d3,_0x595f29=_0x32e4d5[0x0]||_0x7753d3[_0x4728e3(0x1ec)];if(!_0x595f29)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x4728e3(0x2f0)+'Options\x20(one\x20required):\x0a'+_0x4728e3(0x2aa)+_0x4728e3(0x26a)+_0x4728e3(0x1e2)+_0x4728e3(0x256)+_0x4728e3(0x2a3)),0x1;if(!_0x3c0f2b[_0x4728e3(0x27d)]&&!_0x3c0f2b[_0x4728e3(0x239)]&&!_0x3c0f2b['behavior']&&!_0x3c0f2b[_0x4728e3(0x276)])return console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x1ff))),console[_0x4728e3(0x24e)](_0x4728e3(0x237)),console[_0x4728e3(0x24e)](_0x4728e3(0x2f9)),console[_0x4728e3(0x24e)](_0x4728e3(0x218)),console[_0x4728e3(0x24e)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x4728e3(0x24e)](_0x4728e3(0x243)),console['error'](_0x4728e3(0x1e7)),0x1;const _0x34ed5c=resolveYamlFile(_0x595f29);if(!existsSync(_0x34ed5c))return showFileNotFoundError(_0x34ed5c,_0x595f29),0x1;_0x3c0f2b[_0x4728e3(0x2b2)]&&(console[_0x4728e3(0x24e)](_0x4728e3(0x208)+_0x3c0f2b[_0x4728e3(0x24b)]),console[_0x4728e3(0x24e)](_0x4728e3(0x2f2)+_0x34ed5c));let _0x188cc3;try{_0x188cc3=readFileSync(_0x34ed5c,_0x4728e3(0x235));}catch(_0x347ebb){const _0x21b5fd=_0x347ebb instanceof Error?_0x347ebb[_0x4728e3(0x2e7)]:String(_0x347ebb);return console[_0x4728e3(0x24e)](_0x4728e3(0x22c)+_0x21b5fd),0x1;}let _0x5bf0f6;try{_0x5bf0f6=parseDef(_0x188cc3);}catch(_0x95b62b){const _0x14bc0c=_0x95b62b instanceof Error?_0x95b62b[_0x4728e3(0x2e7)]:String(_0x95b62b);return console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x1f2)+_0x14bc0c)),0x1;}if(_0x3c0f2b[_0x4728e3(0x239)]===!![]||_0x3c0f2b['attribute']===''){const _0x21f14c=_0x5bf0f6['attributes']?.['map'](_0x267d4f=>_0x267d4f[_0x4728e3(0x2db)])||[];if(_0x21f14c[_0x4728e3(0x1f6)]===0x0)console['error'](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x21a)));else{console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x4728e3(0x24e)](_0x4728e3(0x249));for(const _0x3cc9e7 of _0x21f14c){console[_0x4728e3(0x24e)]('\x20\x20'+a21_0x301366[_0x4728e3(0x282)](_0x3cc9e7));}console[_0x4728e3(0x24e)](_0x4728e3(0x26e)+_0x595f29+'\x20--attribute\x20\x22'+_0x21f14c[0x0]+'\x22');}return 0x1;}if(_0x3c0f2b[_0x4728e3(0x2e9)]===!![]||_0x3c0f2b[_0x4728e3(0x2e9)]===''){const _0x160263=_0x5bf0f6['behaviors']?.[_0x4728e3(0x24c)](_0x53ea13=>_0x53ea13[_0x4728e3(0x2db)])||[];if(_0x160263[_0x4728e3(0x1f6)]===0x0)console['error'](a21_0x301366['red'](_0x4728e3(0x2a4)));else{console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x2be))),console[_0x4728e3(0x24e)](_0x4728e3(0x25d));for(const _0x8ecb2c of _0x160263){console[_0x4728e3(0x24e)]('\x20\x20'+a21_0x301366['cyan'](_0x8ecb2c));}console[_0x4728e3(0x24e)](_0x4728e3(0x26e)+_0x595f29+'\x20--behavior\x20\x22'+_0x160263[0x0]+'\x22');}return 0x1;}const _0x4c569a=createCommandSpinner(a21_0x301366[_0x4728e3(0x2c4)](_0x4728e3(0x221)),{'verbose':_0x3c0f2b[_0x4728e3(0x2b2)]});_0x4c569a['start']();const _0x195cb0={'onProgress':_0x3cbb57=>{const _0x39dff1=_0x4728e3;_0x4c569a[_0x39dff1(0x231)]=formatProgressMessage(_0x3cbb57);}};if(_0x3c0f2b[_0x4728e3(0x27d)])_0x195cb0[_0x4728e3(0x27d)]=!![];if(_0x3c0f2b['attribute']&&typeof _0x3c0f2b[_0x4728e3(0x239)]==='string')_0x195cb0[_0x4728e3(0x239)]=_0x3c0f2b[_0x4728e3(0x239)];if(_0x3c0f2b[_0x4728e3(0x2e9)]&&typeof _0x3c0f2b[_0x4728e3(0x2e9)]===_0x4728e3(0x20a))_0x195cb0[_0x4728e3(0x2e9)]=_0x3c0f2b[_0x4728e3(0x2e9)];if(_0x3c0f2b['enriched'])_0x195cb0[_0x4728e3(0x276)]=!![];if(_0x3c0f2b[_0x4728e3(0x2c8)])_0x195cb0['interval']=_0x3c0f2b[_0x4728e3(0x2c8)];let _0x1646a4;try{_0x1646a4=await _0x496524[_0x4728e3(0x260)][_0x4728e3(0x269)](_0x188cc3,_0x195cb0),_0x4c569a['stop']();}catch(_0x3694ea){_0x4c569a['stop']();throw _0x3694ea;}return await this[_0x4728e3(0x2e1)](_0x1646a4,{'master':_0x3c0f2b[_0x4728e3(0x27d)],'attribute':typeof _0x3c0f2b[_0x4728e3(0x239)]===_0x4728e3(0x20a)?_0x3c0f2b['attribute']:undefined,'behavior':typeof _0x3c0f2b[_0x4728e3(0x2e9)]===_0x4728e3(0x20a)?_0x3c0f2b[_0x4728e3(0x2e9)]:undefined,'enriched':_0x3c0f2b[_0x4728e3(0x276)]}),_0x1646a4['allValid']?0x0:0x1;}async[a21_0x106a0d(0x2e1)](_0x4474e9,_0x55e9d3){const _0x1916b0=a21_0x106a0d;console['error']('\x0a'+a21_0x301366['bold'](_0x1916b0(0x286))+'\x20'+_0x4474e9[_0x1916b0(0x2db)]),console['error']('═'[_0x1916b0(0x252)](0x3c));if(_0x55e9d3['master']&&_0x4474e9[_0x1916b0(0x1fa)]){const _0x4d93a4=a21_0x301366[_0x1916b0(0x2c4)]('Master:')+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x4474e9[_0x1916b0(0x27d)]['database']+'.'+_0x4474e9[_0x1916b0(0x27d)][_0x1916b0(0x2d4)]);await this['displaySampleData'](_0x4d93a4,_0x4474e9['sampleData']);}else{if(_0x55e9d3[_0x1916b0(0x239)]&&_0x4474e9['sampleData']){const _0x31bc9b=a21_0x301366[_0x1916b0(0x2c4)]('Attribute:')+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x55e9d3[_0x1916b0(0x239)]);await this[_0x1916b0(0x2b7)](_0x31bc9b,_0x4474e9[_0x1916b0(0x1fa)]);}else{if(_0x55e9d3[_0x1916b0(0x2e9)]&&_0x4474e9[_0x1916b0(0x1fa)]){const _0x2cf569=a21_0x301366[_0x1916b0(0x2c4)](_0x1916b0(0x266))+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x55e9d3[_0x1916b0(0x2e9)]);await this[_0x1916b0(0x2b7)](_0x2cf569,_0x4474e9[_0x1916b0(0x1fa)]);}else{if(_0x55e9d3[_0x1916b0(0x276)]&&_0x4474e9[_0x1916b0(0x1fa)]){const _0x1f126a=a21_0x301366[_0x1916b0(0x2c4)](_0x1916b0(0x275))+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x1916b0(0x25e));await this[_0x1916b0(0x2b7)](_0x1f126a,_0x4474e9[_0x1916b0(0x1fa)]);}else!_0x4474e9[_0x1916b0(0x1fa)]&&console['error'](_0x1916b0(0x27b));}}}if(_0x4474e9['errors'][_0x1916b0(0x1f6)]>0x0){console['error']('─'[_0x1916b0(0x252)](0x3c)),console['error']('\x0a'+a21_0x301366[_0x1916b0(0x2d3)](_0x1916b0(0x205)));for(const _0x5d1cf1 of _0x4474e9[_0x1916b0(0x225)]){console[_0x1916b0(0x24e)]('\x20\x20'+a21_0x301366[_0x1916b0(0x2d3)]('•')+'\x20'+_0x5d1cf1);}}}async[a21_0x106a0d(0x2b7)](_0x49358f,_0x2e266f){const _0x225864=a21_0x106a0d;if(_0x2e266f[_0x225864(0x1f6)]===0x0){console[_0x225864(0x24e)]('\x0a'+_0x49358f),console[_0x225864(0x24e)]('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x49358f);const _0x35a23b=Object[_0x225864(0x2d0)](_0x2e266f[0x0])[_0x225864(0x24c)](_0x244eff=>({'name':_0x244eff,'type':typeof _0x2e266f[0x0][_0x244eff]===_0x225864(0x2a8)?_0x225864(0x281):_0x225864(0x1e6)})),_0x15aecc={'queryId':_0x225864(0x25b),'columns':_0x35a23b,'data':_0x2e266f,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2e266f[_0x225864(0x1f6)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3344b0=formatAsTable(_0x15aecc,_0x2e266f[_0x225864(0x1f6)],!![]);await writeOutput(_0x3344b0,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']='segment:parent:run';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x291);async[a21_0x106a0d(0x2d7)](_0x130a21){const _0x12f332=a21_0x106a0d,{options:_0x576825,args:_0x8bbabe,tdx:_0x40e662}=_0x130a21,_0x127faf=_0x576825,_0x26b08f=_0x8bbabe[0x0]||_0x576825[_0x12f332(0x1ec)];if(!_0x26b08f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x4d49d0=resolveYamlFile(_0x26b08f);if(existsSync(_0x4d49d0)){_0x127faf[_0x12f332(0x2b2)]&&console[_0x12f332(0x24e)](_0x12f332(0x246)+_0x4d49d0);let _0xdca6cf;try{_0xdca6cf=readFileSync(_0x4d49d0,_0x12f332(0x235));}catch(_0x592aa6){const _0x325f3d=_0x592aa6 instanceof Error?_0x592aa6[_0x12f332(0x2e7)]:String(_0x592aa6);return console[_0x12f332(0x24e)](_0x12f332(0x22c)+_0x325f3d),0x1;}const _0x460e4e=await withSpinner('Analyzing\x20changes...',()=>_0x40e662[_0x12f332(0x260)][_0x12f332(0x25a)](_0xdca6cf),{'verbose':_0x127faf[_0x12f332(0x2b2)]}),_0x479cc9=_0x460e4e[_0x12f332(0x287)],{isNew:_0x4a44e2,name:_0xb760f7,hasChanges:_0x14f8f9,diffFormatted:_0x39b284}=_0x479cc9;if(_0x14f8f9){_0x4a44e2?console[_0x12f332(0x24e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0xb760f7+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xb760f7+'\x27:');console['error']('─'[_0x12f332(0x252)](0x3c)),console['error'](_0x39b284),console[_0x12f332(0x24e)]('─'[_0x12f332(0x252)](0x3c));const _0x433e81=_0x4a44e2?'Create\x20parent\x20segment\x20\x27'+_0xb760f7+_0x12f332(0x2d1):'Apply\x20changes\x20to\x20\x27'+_0xb760f7+'\x27\x20and\x20run\x20workflow?';if(!_0x127faf['yes']){const _0xcf3ed7=await confirmKey(_0x433e81);if(!_0xcf3ed7)return console['error']('Aborted.'),0x1;}const _0x2607ea=_0x4a44e2?_0x12f332(0x204):_0x12f332(0x2fe);await withSpinner(_0x2607ea+_0x12f332(0x1ea)+_0xb760f7+_0x12f332(0x293),()=>_0x479cc9[_0x12f332(0x26c)](),{'verbose':_0x127faf['verbose']});const _0x3f36=_0x4a44e2?'Created':_0x12f332(0x23b);console['error']('✔\x20'+_0x3f36+_0x12f332(0x1ea)+_0xb760f7+'\x27');}else console[_0x12f332(0x24e)](_0x12f332(0x229)+_0xb760f7+_0x12f332(0x2ca));}const _0x1090fa=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x26b08f+_0x12f332(0x293),()=>_0x40e662[_0x12f332(0x260)][_0x12f332(0x2cb)](_0x26b08f),{'verbose':_0x127faf[_0x12f332(0x2b2)]}),_0x2d0d81=_0x1090fa['data'],_0x45343c=getConsoleUrl(_0x127faf[_0x12f332(0x24b)],_0x12f332(0x259)+_0x2d0d81[_0x12f332(0x26f)]+_0x12f332(0x1e8)+_0x2d0d81[_0x12f332(0x1f9)]+_0x12f332(0x240)+_0x2d0d81['workflowAttemptId']);return console[_0x12f332(0x24e)]('\x0a✔\x20Workflow\x20started'),console[_0x12f332(0x24e)]('\x20\x20'+a21_0x301366[_0x12f332(0x2c4)](_0x12f332(0x2c6))+'\x20'+_0x2d0d81[_0x12f332(0x230)]),console['error']('\x20\x20'+a21_0x301366['dim'](_0x12f332(0x2e3))+'\x20'+_0x2d0d81['status']),console[_0x12f332(0x24e)]('\x20\x20'+a21_0x301366['dim'](_0x12f332(0x267))+'\x20'+_0x2d0d81[_0x12f332(0x1f9)]),console[_0x12f332(0x24e)]('\x20\x20'+a21_0x301366[_0x12f332(0x2c4)](_0x12f332(0x262))+'\x20'+_0x2d0d81[_0x12f332(0x295)]),console['error']('\x20\x20'+_0x45343c),console[_0x12f332(0x24e)]('\x0a'+a21_0x301366[_0x12f332(0x2c4)](_0x12f332(0x23a))+_0x12f332(0x2ee)+_0x2d0d81[_0x12f332(0x295)]+_0x12f332(0x1e3)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x284);async['execute'](_0x2603b1){const _0x204bfc=a21_0x106a0d,{options:_0x1d3435,args:_0x271c84,tdx:_0x22787a}=_0x2603b1,_0x82a00a=_0x271c84[0x0]||_0x1d3435['parentSegment'];if(!_0x82a00a)return showParentSegmentNotSetError(_0x204bfc(0x298)+_0x204bfc(0x2f5)),0x1;_0x1d3435[_0x204bfc(0x2b2)]&&(console['error'](_0x204bfc(0x208)+_0x1d3435[_0x204bfc(0x24b)]),console[_0x204bfc(0x24e)](_0x204bfc(0x2ba)+_0x82a00a));const _0x57baad=await withSpinner(_0x204bfc(0x302)+_0x82a00a+_0x204bfc(0x293),()=>_0x22787a[_0x204bfc(0x260)][_0x204bfc(0x2c9)](_0x82a00a),{'verbose':_0x1d3435[_0x204bfc(0x2b2)]}),_0x1d4d9e=_0x57baad['data'];console['error'](_0x204bfc(0x228)+_0x1d4d9e[_0x204bfc(0x1f6)]+_0x204bfc(0x232)+(_0x1d4d9e[_0x204bfc(0x1f6)]!==0x1?'s':''));if(_0x1d3435['json']||_0x1d3435['jsonl'])return await handleSDKOutput(_0x1d4d9e,_0x1d3435),0x0;return displayFieldsHumanReadable(_0x1d4d9e,_0x82a00a),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2f4);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x24a);async[a21_0x106a0d(0x2d7)](_0xbb5eac){const _0x391a3f=a21_0x106a0d,{options:_0x262333,args:_0x27db31,tdx:_0x546287}=_0xbb5eac,_0x29688b=_0x262333,_0x18d9e7=_0x27db31[0x0]||_0x262333[_0x391a3f(0x1ec)];if(!_0x18d9e7)return showParentSegmentNotSetError(_0x391a3f(0x226)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x391a3f(0x2d5)),0x1;_0x262333['verbose']&&(console['error'](_0x391a3f(0x208)+_0x262333[_0x391a3f(0x24b)]),console[_0x391a3f(0x24e)](_0x391a3f(0x2ba)+_0x18d9e7));const _0x1c910f=await withSpinner(_0x391a3f(0x22f)+_0x18d9e7+_0x391a3f(0x293),()=>_0x546287['segment'][_0x391a3f(0x27a)](_0x18d9e7),{'verbose':_0x262333[_0x391a3f(0x2b2)]}),_0x4c0c95=_0x1c910f['data'];if(_0x29688b[_0x391a3f(0x248)]){const _0x17e16=getConsoleNextUrl(_0x29688b[_0x391a3f(0x24b)],_0x391a3f(0x1f8)+_0x4c0c95['id']);return console[_0x391a3f(0x24e)](a21_0x301366[_0x391a3f(0x2b3)]('✔')+_0x391a3f(0x20d)+a21_0x301366['cyan'](_0x17e16)),openBrowser(_0x17e16),0x0;}return await handleSingleObjectOutput(_0x4c0c95,_0x262333),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0x106a0d(0x2db)]='segment:parent:desc';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x1f4);async[a21_0x106a0d(0x2d7)](_0x4cf585){const _0x13feb5=a21_0x106a0d,{options:_0x5bf1ea,args:_0xa9d68a,tdx:_0x3b327f}=_0x4cf585,_0xc24a54=_0xa9d68a[0x0]||_0x5bf1ea[_0x13feb5(0x1ec)];if(!_0xc24a54)return showParentSegmentNotSetError(_0x13feb5(0x2fb)+_0x13feb5(0x28a)),0x1;_0x5bf1ea['verbose']&&(console['error'](_0x13feb5(0x208)+_0x5bf1ea['site']),console[_0x13feb5(0x24e)](_0x13feb5(0x2ba)+_0xc24a54));const _0x26604e=await withSpinner(_0x13feb5(0x23e)+_0xc24a54+_0x13feb5(0x293),()=>_0x3b327f['segment'][_0x13feb5(0x304)](_0xc24a54),{'verbose':_0x5bf1ea[_0x13feb5(0x2b2)]}),_0xc9eb1d=_0x26604e[_0x13feb5(0x287)],_0x40a2fb=await withSpinner(_0x13feb5(0x283)+_0xc24a54+'\x27...',()=>_0x3b327f[_0x13feb5(0x260)][_0x13feb5(0x20f)](_0xc9eb1d),{'verbose':_0x5bf1ea[_0x13feb5(0x2b2)]}),_0x1dae19=await executeSchemaQuery(_0x40a2fb[_0x13feb5(0x287)],_0x3b327f,_0x5bf1ea);return await handleQueryOutput(_0x1dae19,_0x5bf1ea),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a21_0x106a0d(0x1f7);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x265);async['execute'](_0x5ef070){const _0x59d871=a21_0x106a0d,{options:_0x3f2b99,args:_0x661b3a,tdx:_0x2a08fb}=_0x5ef070,_0x5513bb=_0x661b3a[0x0]||_0x3f2b99[_0x59d871(0x1ec)];if(!_0x5513bb)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+'\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;_0x3f2b99[_0x59d871(0x2b2)]&&(console[_0x59d871(0x24e)]('Site:\x20'+_0x3f2b99[_0x59d871(0x24b)]),console['error'](_0x59d871(0x2ba)+_0x5513bb));const _0x19af36=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5513bb+_0x59d871(0x293),()=>_0x2a08fb['segment'][_0x59d871(0x304)](_0x5513bb),{'verbose':_0x3f2b99[_0x59d871(0x2b2)]}),_0x56d7df=_0x19af36[_0x59d871(0x287)],_0x276d0a=await withSpinner(_0x59d871(0x283)+_0x5513bb+'\x27...',()=>_0x2a08fb[_0x59d871(0x260)]['getParentSQL'](_0x56d7df),{'verbose':_0x3f2b99[_0x59d871(0x2b2)]}),_0xd7ee5c=_0x276d0a[_0x59d871(0x287)];return _0x3f2b99['format']===_0x59d871(0x220)||_0x3f2b99[_0x59d871(0x2bc)]==='jsonl'?await handleSDKOutput([{'sql':_0xd7ee5c}],_0x3f2b99):console[_0x59d871(0x29b)](_0xd7ee5c),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x200);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x22b);async[a21_0x106a0d(0x2d7)](_0x49a2b7){const _0x379f32=a21_0x106a0d,{options:_0x6e7e5c,args:_0x230bca,tdx:_0x5e322e}=_0x49a2b7,_0xa1f8ac=_0x230bca[0x0]||_0x6e7e5c[_0x379f32(0x1ec)];if(!_0xa1f8ac)return showParentSegmentNotSetError(_0x379f32(0x211)+_0x379f32(0x2a1)),0x1;_0x6e7e5c[_0x379f32(0x2b2)]&&(console[_0x379f32(0x24e)](_0x379f32(0x208)+_0x6e7e5c[_0x379f32(0x24b)]),console[_0x379f32(0x24e)](_0x379f32(0x2ba)+_0xa1f8ac));const _0x4665f3=await withSpinner(_0x379f32(0x23e)+_0xa1f8ac+_0x379f32(0x293),()=>_0x5e322e[_0x379f32(0x260)][_0x379f32(0x304)](_0xa1f8ac),{'verbose':_0x6e7e5c[_0x379f32(0x2b2)]}),_0x50d871=_0x4665f3['data'],_0x467259=await withSpinner(_0x379f32(0x283)+_0xa1f8ac+_0x379f32(0x293),()=>_0x5e322e['segment'][_0x379f32(0x20f)](_0x50d871),{'verbose':_0x6e7e5c[_0x379f32(0x2b2)]});let _0x37f7b9=_0x467259[_0x379f32(0x287)];const _0x854f68=resolveLimit(_0x6e7e5c['limit'],DEFAULT_DISPLAY_LIMIT),_0x1673fc=/\bLIMIT\s+\d+/i[_0x379f32(0x2b1)](_0x37f7b9);!_0x1673fc&&(_0x37f7b9=_0x37f7b9[_0x379f32(0x201)]()[_0x379f32(0x1e1)](/;+$/,''),_0x37f7b9=_0x379f32(0x2da)+_0x37f7b9+_0x379f32(0x28d)+_0x854f68);_0x6e7e5c[_0x379f32(0x2b2)]&&console[_0x379f32(0x24e)]('SQL\x20query:\x0a'+_0x37f7b9);const _0x1c9fa7=await withProgressSpinner(_0x379f32(0x2eb),async _0x22c6f8=>{const _0x5d29af=_0x379f32,_0x3d590d=await _0x5e322e[_0x5d29af(0x2df)][_0x5d29af(0x2d7)](_0x37f7b9,{'catalog':'td','schema':_0x5d29af(0x234),'onJobId':_0x552033=>{const _0x542a02=_0x5d29af;_0x22c6f8[_0x542a02(0x1e0)](_0x552033);}});return _0x3d590d;},{'verbose':_0x6e7e5c['verbose']}),_0x42f040=_0x1c9fa7[_0x379f32(0x287)],_0x58bbaf=_0x42f040[_0x379f32(0x222)]?'\x20[Job\x20ID:\x20'+_0x42f040['jobId']+']':'';return console[_0x379f32(0x24e)](_0x379f32(0x2b5)+_0x42f040['stats'][_0x379f32(0x278)][_0x379f32(0x288)]()+'\x20rows\x20'+(_0x379f32(0x236)+formatElapsed(_0x42f040[_0x379f32(0x2ff)][_0x379f32(0x21b)])+_0x58bbaf)),await handleQueryOutput(_0x42f040,_0x6e7e5c),0x0;}}
|