@treasuredata/tdx 0.9.5 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +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.d.ts.map +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/connection-command.js.map +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.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/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.d.ts +6 -0
- package/dist/commands/segment-pull-command.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts.map +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/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.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.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/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-yaml.js +1 -1
- package/dist/sdk/api.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/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +113 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +2 -1
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.d.ts.map +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/journey-utils.js.map +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.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/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x243009=a27_0x4a2f;(function(_0x433332,_0x3b589a){const _0x3e4dbc=a27_0x4a2f,_0x49056a=_0x433332();while(!![]){try{const _0x1162ba=-parseInt(_0x3e4dbc(0x19a))/0x1*(-parseInt(_0x3e4dbc(0x1e3))/0x2)+-parseInt(_0x3e4dbc(0x1e0))/0x3+-parseInt(_0x3e4dbc(0x171))/0x4+-parseInt(_0x3e4dbc(0x1f2))/0x5*(-parseInt(_0x3e4dbc(0x1b5))/0x6)+parseInt(_0x3e4dbc(0x1b1))/0x7*(-parseInt(_0x3e4dbc(0x126))/0x8)+-parseInt(_0x3e4dbc(0x16c))/0x9+-parseInt(_0x3e4dbc(0x165))/0xa*(-parseInt(_0x3e4dbc(0x1e1))/0xb);if(_0x1162ba===_0x3b589a)break;else _0x49056a['push'](_0x49056a['shift']());}catch(_0x250f95){_0x49056a['push'](_0x49056a['shift']());}}}(a27_0x16bc,0x7b8e7));function a27_0x4a2f(_0x4a5ab4,_0x6f1f72){_0x4a5ab4=_0x4a5ab4-0x124;const _0x16bc46=a27_0x16bc();let _0x4a2fc1=_0x16bc46[_0x4a5ab4];return _0x4a2fc1;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';import*as a27_0x481419 from'node:fs';function handleSDKError(_0x48bd10,_0x281945){const _0x44e076=a27_0x4a2f;if(_0x48bd10 instanceof SDKError)console[_0x44e076(0x1ab)](_0x44e076(0x1be)+_0x48bd10['message']),_0x281945[_0x44e076(0x1ca)]&&(_0x48bd10[_0x44e076(0x1c4)]&&console[_0x44e076(0x1ab)]('\x20\x20Cause:\x20'+_0x48bd10[_0x44e076(0x1c4)]),_0x48bd10['stack']&&(console['error']('\x0aStack\x20trace:'),console[_0x44e076(0x1ab)](_0x48bd10[_0x44e076(0x15d)])));else throw _0x48bd10;}function formatChatHistoryEntry(_0x580717,_0xaf2bcf){const _0x1e7e33=a27_0x4a2f,_0x6f41c2=getChalk(_0xaf2bcf),_0x46096a=_0x6f41c2['dim'](_0x580717['at']);if(_0x1e7e33(0x174)in _0x580717){const _0x519022=_0x6f41c2['cyan']('[input]\x20\x20');return _0x46096a+'\x20'+_0x519022+':\x20'+_0x580717['input'];}if(_0x1e7e33(0x156)in _0x580717){const _0x2f4fa5=_0x6f41c2[_0x1e7e33(0x1a5)](_0x1e7e33(0x1c5));return _0x46096a+'\x20'+_0x2f4fa5+':\x20'+_0x580717[_0x1e7e33(0x156)];}if('tool_call'in _0x580717){const _0xfbaf21=_0x6f41c2['yellow']('[tool_call]'),{functionName:_0x4bf98d,functionArguments:_0x5b961b,targetFunction:_0x1d182e}=_0x580717[_0x1e7e33(0x1c8)];let _0x243842=_0x46096a+'\x20'+_0xfbaf21+':\x20'+_0x6f41c2[_0x1e7e33(0x18c)](_0x4bf98d);if(_0x5b961b&&Object[_0x1e7e33(0x163)](_0x5b961b)[_0x1e7e33(0x1e9)]>0x0){const _0x41f3f3=Object['entries'](_0x5b961b)['map'](([_0xc645af,_0x196429])=>_0xc645af+'='+JSON[_0x1e7e33(0x157)](_0x196429))[_0x1e7e33(0x189)](',\x20');_0x243842+='('+_0x41f3f3+')';}_0x1d182e&&(_0x243842+=_0x6f41c2[_0x1e7e33(0x181)]('\x20['+_0x1d182e+']'));let _0x5195df='';if(_0x580717['tool_call']['targetKnowledgeBase'])_0x5195df='\x20->\x20KB:'+_0x580717[_0x1e7e33(0x1c8)][_0x1e7e33(0x1d3)][_0x1e7e33(0x1af)];else{if(_0x580717[_0x1e7e33(0x1c8)][_0x1e7e33(0x1d0)])_0x5195df=_0x1e7e33(0x1c7)+_0x580717[_0x1e7e33(0x1c8)][_0x1e7e33(0x1d0)][_0x1e7e33(0x1af)];else{if(_0x580717[_0x1e7e33(0x1c8)]['targetWebSearchTool'])_0x5195df=_0x1e7e33(0x1a9)+_0x580717[_0x1e7e33(0x1c8)][_0x1e7e33(0x175)]['name'];else _0x580717[_0x1e7e33(0x1c8)][_0x1e7e33(0x188)]&&(_0x5195df=_0x1e7e33(0x162)+_0x580717[_0x1e7e33(0x1c8)][_0x1e7e33(0x188)][_0x1e7e33(0x1af)]);}}return _0x243842+_0x5195df;}if(_0x1e7e33(0x192)in _0x580717){const _0x471e42=_0x6f41c2[_0x1e7e33(0x1aa)](_0x1e7e33(0x154)),{functionName:_0x588a05,functionArguments:_0x379ab5,content:_0x3552df,newChat:_0x286c74}=_0x580717[_0x1e7e33(0x192)];let _0x2c37b0=_0x46096a+'\x20'+_0x471e42+':\x20'+_0x6f41c2[_0x1e7e33(0x18c)](_0x588a05);if(_0x379ab5){const _0x2cac1d=typeof _0x379ab5==='string'?_0x379ab5:JSON['stringify'](_0x379ab5);_0x2c37b0+='('+_0x2cac1d+')';}return _0x3552df&&(_0x2c37b0+='\x0a'+_0x6f41c2[_0x1e7e33(0x181)](_0x3552df)),_0x286c74&&(_0x2c37b0+=_0x6f41c2[_0x1e7e33(0x181)](_0x1e7e33(0x1ac)+_0x286c74['id'])),_0x2c37b0;}if(_0x1e7e33(0x143)in _0x580717){const _0x107df6=_0x6f41c2['blue']('[output]\x20');return _0x46096a+'\x20'+_0x107df6+':\x20'+_0x580717[_0x1e7e33(0x143)]['name']+'\x20('+_0x580717[_0x1e7e33(0x143)][_0x1e7e33(0x156)][_0x1e7e33(0x1e9)]+_0x1e7e33(0x12c);}if(_0x1e7e33(0x1e8)in _0x580717){const _0x150b33=_0x6f41c2[_0x1e7e33(0x1bc)](_0x1e7e33(0x12b)),{width:_0x2a8cfd,height:_0x3e3601,headerText:_0x50b8e9}=_0x580717['image'],_0x1fb080=_0x50b8e9?'\x20-\x20'+_0x50b8e9:'';return _0x46096a+'\x20'+_0x150b33+':\x20'+_0x2a8cfd+'x'+_0x3e3601+_0x1fb080;}if('error'in _0x580717){const _0xce2cfa=_0x6f41c2['red']('[error]\x20\x20');return _0x46096a+'\x20'+_0xce2cfa+':\x20'+_0x580717[_0x1e7e33(0x1ab)];}return _0x46096a+'\x20'+_0x6f41c2[_0x1e7e33(0x181)](_0x1e7e33(0x151))+':\x20'+JSON[_0x1e7e33(0x157)](_0x580717);}async function executeChatHistoryCommand(_0x1b98c7,_0xdd8527){const _0x56e786=a27_0x4a2f,{options:_0x4ccecc,args:_0x4788c5,tdx:_0x4d894d}=_0x1b98c7,_0x17fb37=_0x4788c5[0x0],_0x1696d4=_0x4ccecc,_0x1122bb=_0x1696d4[_0x56e786(0x17a)];try{if(_0x1122bb&&_0x17fb37)return console[_0x56e786(0x1ab)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x56e786(0x1ab)](_0x56e786(0x131)+_0xdd8527+_0x56e786(0x1f1)),0x1;if(!_0x17fb37&&!_0x1122bb&&_0x4ccecc['format']!==undefined){const _0x33494c=resolveLimit(_0x4ccecc['limit'],DEFAULT_LLM_LIMIT),_0x3f0efa=await withSpinner(_0x56e786(0x14c),()=>_0x4d894d[_0x56e786(0x13f)][_0x56e786(0x187)](_0x33494c),{'verbose':_0x4ccecc['verbose']});return await handleSDKOutput(_0x3f0efa[_0x56e786(0x1ce)],_0x4ccecc),0x0;}const _0x490d23=await getChatIdOrSelect(_0x4d894d,_0x4ccecc,_0x1122bb,_0x17fb37);if(!_0x490d23)return 0x0;return await displayChatHistory(_0x490d23,_0x4d894d,_0x4ccecc),0x0;}catch(_0x418052){return handleSDKError(_0x418052,_0x4ccecc),0x1;}}async function displayChatHistory(_0x5d9cf7,_0x569a8c,_0x3eb6ba){const _0x3247e5=a27_0x4a2f,_0x3b3cab=await withSpinner(_0x3247e5(0x130)+_0x5d9cf7+'\x27...',()=>_0x569a8c['llm'][_0x3247e5(0x1b3)](_0x5d9cf7),{'verbose':_0x3eb6ba['verbose']}),_0x162056=_0x3b3cab[_0x3247e5(0x1ce)][_0x3247e5(0x1ce)]??[];if(_0x162056[_0x3247e5(0x1e9)]===0x0){console[_0x3247e5(0x1a3)]('No\x20messages\x20found\x20in\x20chat\x20history.');return;}if(_0x3eb6ba[_0x3247e5(0x14f)]!==undefined)await handleSDKOutput(_0x162056,_0x3eb6ba);else{const _0x357a0e=_0x162056[_0x3247e5(0x136)](_0x2fa5f8=>formatChatHistoryEntry(_0x2fa5f8,_0x3eb6ba)),_0x277f0e=_0x357a0e[_0x3247e5(0x189)]('\x0a');await writeOutput(_0x277f0e,_0x3eb6ba[_0x3247e5(0x143)],_0x3247e5(0x1dc));}}async function getChatIdOrSelect(_0x3fa806,_0xc37201,_0x570fce,_0xba4396){const _0x59b203=a27_0x4a2f;if(_0xba4396)return _0xba4396;if(_0x570fce){const _0x25989d=await withSpinner(_0x59b203(0x15c),()=>_0x3fa806[_0x59b203(0x13f)][_0x59b203(0x187)](0x1),{'verbose':_0xc37201[_0x59b203(0x1ca)]});if(_0x25989d['data'][_0x59b203(0x1e9)]===0x0)return console[_0x59b203(0x1a3)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x25989d['data'][0x0]['id'];}const _0x11d974=await selectChatInteractively(_0x3fa806,_0xc37201);if(!_0x11d974)return console['log'](_0x59b203(0x17d)),undefined;return _0x11d974;}async function getProjectIdOrDefault(_0x1e70bc){const _0x41af7f=await getProjectWithName(_0x1e70bc);return _0x41af7f['id'];}async function getProjectWithName(_0x2d8105){const _0x243734=a27_0x4a2f,{tdx:_0x125bd2,options:_0x4b2121}=_0x2d8105,_0x1a0e42=_0x4b2121[_0x243734(0x1b2)];if(_0x1a0e42){const _0x2eced6=await withSpinner('Resolving\x20project\x20\x27'+_0x1a0e42+_0x243734(0x1c0),()=>_0x125bd2[_0x243734(0x13f)][_0x243734(0x164)](_0x1a0e42),{'verbose':_0x4b2121[_0x243734(0x1ca)]});return{'id':_0x2eced6[_0x243734(0x1ce)],'name':_0x1a0e42};}const _0x195ba5=_0x125bd2[_0x243734(0x13f)][_0x243734(0x12e)]();if(_0x195ba5){const _0x580232=await _0x125bd2['llm'][_0x243734(0x1a6)](),_0x5874cb=_0x580232[_0x243734(0x1f0)](_0x37cba1=>_0x37cba1['id']===_0x195ba5);return{'id':_0x195ba5,'name':_0x5874cb?.['attributes'][_0x243734(0x1af)]||_0x243734(0x1ee)};}const _0x510bdb=await withSpinner(_0x243734(0x177),()=>_0x125bd2['llm'][_0x243734(0x158)](),{'verbose':_0x4b2121[_0x243734(0x1ca)]});return{'id':_0x510bdb[_0x243734(0x1ce)]['id'],'name':_0x510bdb['data']['attributes']['name']};}function toLLMProjectInfo(_0x1d1a2b){const _0x4b4469=a27_0x4a2f;return{'name':_0x1d1a2b[_0x4b4469(0x1db)][_0x4b4469(0x1af)],'description':_0x1d1a2b[_0x4b4469(0x1db)][_0x4b4469(0x17f)],'createdAt':_0x1d1a2b[_0x4b4469(0x1db)][_0x4b4469(0x1ed)],'updatedAt':_0x1d1a2b['attributes'][_0x4b4469(0x1a8)]};}function toAgentInfo(_0x423f87){const _0xf44600=a27_0x4a2f;return{'name':_0x423f87[_0xf44600(0x1db)][_0xf44600(0x1af)],'description':_0x423f87['attributes'][_0xf44600(0x17f)],'prompt':truncatePrompt(_0x423f87[_0xf44600(0x1db)][_0xf44600(0x17e)]),'createdAt':_0x423f87[_0xf44600(0x1db)][_0xf44600(0x1ed)],'updatedAt':_0x423f87[_0xf44600(0x1db)]['updatedAt']};}function truncatePrompt(_0xc8a5d9){const _0x3ca9ec=a27_0x4a2f;if(!_0xc8a5d9)return undefined;const _0x1f5890=0x64;if(_0xc8a5d9[_0x3ca9ec(0x1e9)]<=_0x1f5890)return _0xc8a5d9;return _0xc8a5d9['slice'](0x0,_0x1f5890)+_0x3ca9ec(0x16a);}function a27_0x16bc(){const _0x1c54ef=['dryRun','803754uqzFFW','11tMSdPE','Usage:\x20tdx\x20llm\x20use\x20<project-name>','2TtHPVz','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Agent\x20updated:\x20','\x27\x20already\x20exists.\x20Overwrite?','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','image','length','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','yellow','rmSync','createdAt','Unknown','jsonl','find','\x20--last','90455cZFmhC','Deleting\x20project\x20\x27','Backing\x20up\x20project\x20\x27','Error:\x20Agent\x20name\x20is\x20required','maxToolIterations','\x20project(s)','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','existsSync','Resolving\x20agent\x20\x27','3683816hYgKcd','Updating\x20agent...','llm:project:delete','resolveAgentId','No\x20agents\x20found','[image]\x20\x20','\x20bytes)','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','getCurrentProject','projectName','Fetching\x20chat\x20history\x20for\x20\x27','Usage:\x20','Project\x20deleted:\x20','llm:project:backup','tsv','Project\x20context\x20set\x20to:\x20','map','localeCompare','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','tdx\x20chats','Creating\x20agent\x20\x27','agent','agents','tdx\x20llm\x20history','Checking\x20for\x20existing\x20projects...','llm','Project\x20created:\x20','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Agent\x20created:\x20','output','Deleting\x20agent...','integrations','llm:history','short','(no\x20agent)','getTime','Agent\x20deleted:\x20','exportedFrom','Fetching\x20chat\x20sessions...','⚒️\x20','\x20\x20Prompts:\x20','format','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[unknown]','web','llm:projects','[tool]\x20\x20\x20','execute','content','stringify','getOrCreateDefaultProject','site','claude-4.5-haiku','Backup\x20cancelled.','Fetching\x20most\x20recent\x20chat...','stack','createProject','sourceSite','m\x20ago','select','\x20->\x20ImageGen:','keys','resolveProjectId','14316530GnEzlw','llm:agent:update','includes','toLocaleDateString','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','...','slice','5179851lFiEUj','🤖\x20','llm:project:create','push','floor','3320076XPWGRj','Use\x20format:\x20project-name/agent-name','split','input','targetWebSearchTool','yes','Getting\x20default\x20project...','Creating\x20project\x20\x27','LLM_PROJECT_NOT_FOUND','last','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','\x0aCancelled','prompt','description','__load_more__','dim','Show\x20agent\x20details','json','Resolving\x20project\x20\x27','INVALID_ARGUMENT','knowledgeBases','chats','targetImageGenerator','join','Error:\x20Backup\x20folder\x20path\x20is\x20required','No\x20projects\x20found','bold','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','set','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','models','Validating\x20backup\x20from\x20\x27','tool','sort','getBackupMetadata','agentId','prompts','firstInputContent','llm:agents','Output\x20directory\x20\x27','918931QxkjuJ','deleteAgent','counts','Error:\x20Project\x20name\x20is\x20required','restoreProject','en-US','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','\x20\x20Integrations:\x20','toLowerCase','log','Fetching\x20available\x20models...','green','projects','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','updatedAt','\x20->\x20WebSearch:','magenta','error','\x20→\x20chat:\x20','Set\x20current\x20project\x20context','filter','name','model','7oEUDtf','llmProject','history','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','96EgBEvi','List\x20available\x20LLM\x20models','chatId','Project\x20backed\x20up\x20to:\x20','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','starterMessage','d\x20ago','blue','\x20\x20Knowledge\x20Bases:\x20','Error:\x20','\x20agent(s)','\x27...','lastConversationAt','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','Select\x20a\x20chat\x20session:','cause','[content]','Update\x20an\x20existing\x20agent','\x20->\x20Agent:','tool_call','llm:agent:delete','verbose','Invalid\x20path\x20syntax:\x20','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','deleteProject','data','\x20\x20Agents:\x20','targetAgent','Fetching\x20agents...','default','targetKnowledgeBase','llm:use','backupProject','Create\x20a\x20new\x20LLM\x20project','limit','Restoring\x20project\x20from\x20\x27','llm:agent:show','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','attributes','table','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','outputDir'];a27_0x16bc=function(){return _0x1c54ef;};return a27_0x16bc();}export class LLMModelsCommand extends BaseCommand{[a27_0x243009(0x1af)]='llm:models';[a27_0x243009(0x17f)]=a27_0x243009(0x1b6);async['execute'](_0x14d33b){const _0x150d13=a27_0x243009,{options:_0x160c67,tdx:_0x94b901}=_0x14d33b;try{const _0x18e123=await withSpinner(_0x150d13(0x1a4),()=>_0x94b901['llm'][_0x150d13(0x190)](),{'verbose':_0x160c67[_0x150d13(0x1ca)]});return await handleSDKOutput(_0x18e123['data'],_0x160c67),0x0;}catch(_0x4d934d){return handleSDKError(_0x4d934d,_0x160c67),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x153);[a27_0x243009(0x17f)]='List\x20all\x20LLM\x20projects';async[a27_0x243009(0x155)](_0x9db01a){const _0x2a9c9c=a27_0x243009,{options:_0x284cc0,args:_0x4c1609,tdx:_0x3bc464}=_0x9db01a,_0x129b0d=getChalk(_0x284cc0),_0xf95a7e=_0x284cc0[_0x2a9c9c(0x152)],_0x175066=_0x284cc0[_0x2a9c9c(0x159)];try{const _0xf8d2d7=_0x4c1609[0x0],_0x183586=resolveLimit(_0x284cc0['limit'],DEFAULT_LLM_LIMIT),_0xa09ea9=await withSpinner('Fetching\x20projects...',()=>_0x3bc464[_0x2a9c9c(0x13f)][_0x2a9c9c(0x1a6)](_0x183586),{'verbose':_0x284cc0[_0x2a9c9c(0x1ca)]});let _0x5225a1=_0xa09ea9['data'];_0xf8d2d7&&(_0x5225a1=_0xa09ea9['data'][_0x2a9c9c(0x1ae)](_0x9b65de=>matchGlobPattern(_0x9b65de[_0x2a9c9c(0x1db)][_0x2a9c9c(0x1af)],_0xf8d2d7)));const _0xb837c8=_0x284cc0[_0x2a9c9c(0x14f)]===_0x2a9c9c(0x183)||_0x284cc0[_0x2a9c9c(0x14f)]==='jsonl'||_0x284cc0[_0x2a9c9c(0x14f)]==='table'||_0x284cc0['format']===_0x2a9c9c(0x134);if(_0xb837c8){const _0xba3e05=_0x5225a1[_0x2a9c9c(0x136)](_0x3fcd85=>({...toLLMProjectInfo(_0x3fcd85),..._0xf95a7e?{'url':getLLMProjectUrl(_0x175066,_0x3fcd85['id'])}:{}}));await handleSDKOutput(_0xba3e05,_0x284cc0);}else{const _0xe925f1=[];if(_0x5225a1['length']===0x0)_0xe925f1[_0x2a9c9c(0x16f)](_0x129b0d[_0x2a9c9c(0x181)](_0x2a9c9c(0x18b)));else{const _0x91b0cf=[..._0x5225a1][_0x2a9c9c(0x193)]((_0x373acc,_0x416409)=>_0x373acc[_0x2a9c9c(0x1db)][_0x2a9c9c(0x1af)]['localeCompare'](_0x416409[_0x2a9c9c(0x1db)][_0x2a9c9c(0x1af)]));for(const _0x491601 of _0x91b0cf){if(_0xf95a7e){const _0x46fc21=getLLMProjectUrl(_0x175066,_0x491601['id']);_0xe925f1[_0x2a9c9c(0x16f)](_0x2a9c9c(0x14d)+_0x491601[_0x2a9c9c(0x1db)][_0x2a9c9c(0x1af)]+'\x20\x20'+_0x129b0d['dim'](_0x46fc21));}else _0xe925f1[_0x2a9c9c(0x16f)](_0x2a9c9c(0x14d)+_0x491601[_0x2a9c9c(0x1db)][_0x2a9c9c(0x1af)]);}_0xe925f1[_0x2a9c9c(0x16f)](_0x129b0d[_0x2a9c9c(0x181)](_0x5225a1[_0x2a9c9c(0x1e9)]+_0x2a9c9c(0x1f7)));}await writeOutput(_0xe925f1[_0x2a9c9c(0x189)]('\x0a'),_0x284cc0[_0x2a9c9c(0x143)],_0x2a9c9c(0x1dc));}return 0x0;}catch(_0x3e777b){return handleSDKError(_0x3e777b,_0x284cc0),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x198);['description']='List\x20agents\x20in\x20current\x20project';async[a27_0x243009(0x155)](_0x4ce5d6){const _0x30e9cf=a27_0x243009,{options:_0x5889e2,args:_0x12877d,tdx:_0x323354}=_0x4ce5d6,_0xfb72bd=getChalk(_0x5889e2),_0x2c87a4=_0x5889e2['web'],_0x2be186=_0x5889e2['site'];try{const _0x3e1e78=_0x12877d[0x0];let _0x264278=_0x3e1e78,_0x3fea29,_0x13d998;if(_0x3e1e78&&_0x3e1e78['includes']('/')){const _0x26d600=_0x3e1e78['split']('/');if(_0x26d600['length']===0x2){const [_0x375429,_0x1c11b8]=_0x26d600,_0x513910=await _0x323354[_0x30e9cf(0x13f)][_0x30e9cf(0x1a6)](),_0x185a6c=_0x513910['find'](_0x9d4c66=>_0x9d4c66[_0x30e9cf(0x1db)][_0x30e9cf(0x1af)]['toLowerCase']()===_0x375429[_0x30e9cf(0x1a2)]());if(!_0x185a6c)throw new SDKError(ErrorCode[_0x30e9cf(0x179)],'Project\x20not\x20found:\x20'+_0x375429,undefined,{'helpText':_0x30e9cf(0x150)});_0x3fea29=_0x185a6c['id'],_0x13d998=_0x185a6c['attributes'][_0x30e9cf(0x1af)],_0x264278=_0x1c11b8;}else throw new SDKError(ErrorCode[_0x30e9cf(0x185)],_0x30e9cf(0x1cb)+_0x3e1e78,undefined,{'helpText':_0x30e9cf(0x172)});}else{const _0x46a0a5=await getProjectWithName(_0x4ce5d6);_0x3fea29=_0x46a0a5['id'],_0x13d998=_0x46a0a5[_0x30e9cf(0x1af)];}const _0x228859=await withSpinner(_0x30e9cf(0x1d1),()=>_0x323354[_0x30e9cf(0x13f)][_0x30e9cf(0x13c)](_0x3fea29),{'verbose':_0x5889e2['verbose']});let _0x14b515=_0x228859[_0x30e9cf(0x1ce)];_0x264278&&(_0x14b515=_0x228859['data'][_0x30e9cf(0x1ae)](_0x13af6f=>matchGlobPattern(_0x13af6f['attributes'][_0x30e9cf(0x1af)],_0x264278)));const _0x33de68=_0x5889e2['format']===_0x30e9cf(0x183)||_0x5889e2['format']===_0x30e9cf(0x1ef)||_0x5889e2[_0x30e9cf(0x14f)]===_0x30e9cf(0x1dc)||_0x5889e2[_0x30e9cf(0x14f)]===_0x30e9cf(0x134);if(_0x33de68){const _0x3618f3=_0x14b515[_0x30e9cf(0x136)](_0x16887c=>({...toAgentInfo(_0x16887c),..._0x2c87a4?{'chatUrl':getLLMAgentChatUrl(_0x2be186,_0x3fea29,_0x16887c['id'])}:{}}));await handleSDKOutput(_0x3618f3,_0x5889e2);}else{const _0xa0fb61=[];_0xa0fb61['push'](_0xfb72bd[_0x30e9cf(0x181)]('['+_0x13d998+']'));if(_0x14b515[_0x30e9cf(0x1e9)]===0x0)_0xa0fb61[_0x30e9cf(0x16f)](_0xfb72bd[_0x30e9cf(0x181)](_0x30e9cf(0x12a)));else{const _0x117925=[..._0x14b515][_0x30e9cf(0x193)]((_0x262ae0,_0x3519d8)=>_0x262ae0[_0x30e9cf(0x1db)]['name'][_0x30e9cf(0x137)](_0x3519d8[_0x30e9cf(0x1db)]['name']));for(const _0x2f6b60 of _0x117925){if(_0x2c87a4){const _0x1100d7=getLLMAgentChatUrl(_0x2be186,_0x3fea29,_0x2f6b60['id']);_0xa0fb61[_0x30e9cf(0x16f)](_0x30e9cf(0x16d)+_0x2f6b60[_0x30e9cf(0x1db)][_0x30e9cf(0x1af)]+'\x20\x20'+_0xfb72bd[_0x30e9cf(0x181)](_0x1100d7));}else _0xa0fb61[_0x30e9cf(0x16f)]('🤖\x20'+_0x2f6b60['attributes']['name']);}_0xa0fb61['push'](_0xfb72bd[_0x30e9cf(0x181)](_0x14b515[_0x30e9cf(0x1e9)]+_0x30e9cf(0x1bf)));}await writeOutput(_0xa0fb61[_0x30e9cf(0x189)]('\x0a'),_0x5889e2['output'],_0x30e9cf(0x1dc));}return 0x0;}catch(_0x187987){return handleSDKError(_0x187987,_0x5889e2),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x1d9);[a27_0x243009(0x17f)]=a27_0x243009(0x182);async[a27_0x243009(0x155)](_0x9501fd){const _0x3612b5=a27_0x243009,{options:_0x2e2cc4,args:_0x4ab725,tdx:_0x331f80}=_0x9501fd;if(_0x4ab725[_0x3612b5(0x1e9)]===0x0)return console['error'](_0x3612b5(0x1f5)),console['error'](_0x3612b5(0x1e4)),0x1;const _0x5768cb=_0x4ab725[0x0];try{const _0x5422f5=await getProjectIdOrDefault(_0x9501fd),_0x587f1c=await withSpinner(_0x3612b5(0x125)+_0x5768cb+_0x3612b5(0x1c0),()=>_0x331f80['llm'][_0x3612b5(0x129)](_0x5768cb,_0x5422f5),{'verbose':_0x2e2cc4[_0x3612b5(0x1ca)]}),_0x1d85f4=await withSpinner('Fetching\x20agent...',()=>_0x331f80[_0x3612b5(0x13f)]['agent'](_0x587f1c[_0x3612b5(0x1ce)]),{'verbose':_0x2e2cc4[_0x3612b5(0x1ca)]});return await handleSDKOutput([_0x1d85f4[_0x3612b5(0x1ce)]],_0x2e2cc4),0x0;}catch(_0x505364){return handleSDKError(_0x505364,_0x2e2cc4),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a27_0x243009(0x1af)]='llm:agent:create';[a27_0x243009(0x17f)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async['execute'](_0x1078b7){const _0x35599d=a27_0x243009,{options:_0x25c0b2,args:_0x12f31d,tdx:_0x4ec23f}=_0x1078b7;if(_0x12f31d[_0x35599d(0x1e9)]===0x0)return console['error'](_0x35599d(0x1f5)),console[_0x35599d(0x1ab)](_0x35599d(0x1da)),console['error'](_0x35599d(0x1a7)),0x1;const _0x1f85a0=_0x12f31d[0x0],_0x59ba4d=_0x25c0b2,_0x1daa3b=_0x59ba4d['systemPrompt'],_0x4489c7=_0x59ba4d[_0x35599d(0x1b0)]||_0x35599d(0x15a),_0x29453e=_0x59ba4d[_0x35599d(0x1ba)],_0x387767=_0x59ba4d[_0x35599d(0x1f6)]?Number(_0x59ba4d[_0x35599d(0x1f6)]):undefined,_0x2ab57c=_0x59ba4d['temperature']?Number(_0x59ba4d['temperature']):undefined;try{let _0x57f87b,_0x41fdbf;if(_0x1f85a0[_0x35599d(0x167)]('/')){const _0x1a8beb=_0x1f85a0[_0x35599d(0x173)]('/');if(_0x1a8beb[_0x35599d(0x1e9)]===0x2){const [_0xf177f1,_0x954f25]=_0x1a8beb,_0x340743=await withSpinner(_0x35599d(0x184)+_0xf177f1+_0x35599d(0x1c0),()=>_0x4ec23f[_0x35599d(0x13f)][_0x35599d(0x164)](_0xf177f1),{'verbose':_0x25c0b2[_0x35599d(0x1ca)]});_0x57f87b=_0x340743[_0x35599d(0x1ce)],_0x41fdbf=_0x954f25;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x35599d(0x1cb)+_0x1f85a0,undefined,{'helpText':_0x35599d(0x172)});}else _0x57f87b=await getProjectIdOrDefault(_0x1078b7),_0x41fdbf=_0x1f85a0;const _0x3e3395=await withSpinner(_0x35599d(0x13a)+_0x41fdbf+'\x27...',()=>_0x4ec23f[_0x35599d(0x13f)]['createAgent']({'name':_0x41fdbf,'projectId':_0x57f87b,'modelType':_0x4489c7,'systemPrompt':_0x1daa3b,'starterMessage':_0x29453e,'maxToolIterations':_0x387767,'temperature':_0x2ab57c}),{'verbose':_0x25c0b2[_0x35599d(0x1ca)]});return console[_0x35599d(0x1a3)](_0x35599d(0x142)+_0x3e3395[_0x35599d(0x1ce)]['id']),await handleSDKOutput([_0x3e3395['data']],_0x25c0b2),0x0;}catch(_0x4158b7){return handleSDKError(_0x4158b7,_0x25c0b2),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x166);[a27_0x243009(0x17f)]=a27_0x243009(0x1c6);async['execute'](_0x595570){const _0x32d9f0=a27_0x243009,{options:_0x11ee0e,args:_0x52f2f9,tdx:_0x384e35}=_0x595570;if(_0x52f2f9[_0x32d9f0(0x1e9)]===0x0)return console['error'](_0x32d9f0(0x1f5)),console[_0x32d9f0(0x1ab)](_0x32d9f0(0x1dd)),0x1;const _0x55e4ce=_0x52f2f9[0x0],_0x49e521=_0x11ee0e,_0x3a6714=_0x49e521[_0x32d9f0(0x1af)],_0xa3e533=_0x49e521[_0x32d9f0(0x17e)],_0x125181=_0x49e521['description'],_0x8b5a53=_0x49e521[_0x32d9f0(0x1ba)];if(!_0x3a6714&&!_0xa3e533&&!_0x125181&&!_0x8b5a53)return console[_0x32d9f0(0x1ab)](_0x32d9f0(0x141)),console[_0x32d9f0(0x1ab)](_0x32d9f0(0x169)),0x1;try{const _0x2719ba=await getProjectIdOrDefault(_0x595570),_0xdb47e3=await withSpinner('Resolving\x20agent\x20\x27'+_0x55e4ce+_0x32d9f0(0x1c0),()=>_0x384e35[_0x32d9f0(0x13f)][_0x32d9f0(0x129)](_0x55e4ce,_0x2719ba),{'verbose':_0x11ee0e[_0x32d9f0(0x1ca)]}),_0x496fbb=_0xdb47e3[_0x32d9f0(0x1ce)],_0x49e73c=await withSpinner(_0x32d9f0(0x127),()=>_0x384e35['llm']['updateAgent'](_0x496fbb,{'name':_0x3a6714,'prompt':_0xa3e533,'description':_0x125181,'starterMessage':_0x8b5a53}),{'verbose':_0x11ee0e['verbose']});return console[_0x32d9f0(0x1a3)](_0x32d9f0(0x1e5)+_0x49e73c[_0x32d9f0(0x1ce)]['id']),await handleSDKOutput([_0x49e73c[_0x32d9f0(0x1ce)]],_0x11ee0e),0x0;}catch(_0x3b03d6){return handleSDKError(_0x3b03d6,_0x11ee0e),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x1c9);[a27_0x243009(0x17f)]='Delete\x20an\x20agent';async[a27_0x243009(0x155)](_0x3ea2a2){const _0x5e0709=a27_0x243009,{options:_0x1fbd30,args:_0x558963,tdx:_0x122295}=_0x3ea2a2;if(_0x558963[_0x5e0709(0x1e9)]===0x0)return console[_0x5e0709(0x1ab)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x5e0709(0x1ab)](_0x5e0709(0x138)),0x1;const _0x1cfd79=_0x558963[0x0];try{const _0x4a735a=await getProjectIdOrDefault(_0x3ea2a2),_0x127acc=await withSpinner(_0x5e0709(0x125)+_0x1cfd79+_0x5e0709(0x1c0),()=>_0x122295[_0x5e0709(0x13f)]['resolveAgentId'](_0x1cfd79,_0x4a735a),{'verbose':_0x1fbd30['verbose']}),_0x485ca5=_0x127acc[_0x5e0709(0x1ce)];return await withSpinner(_0x5e0709(0x144),()=>_0x122295['llm'][_0x5e0709(0x19b)](_0x485ca5),{'verbose':_0x1fbd30[_0x5e0709(0x1ca)]}),console[_0x5e0709(0x1a3)](_0x5e0709(0x14a)+_0x485ca5),0x0;}catch(_0x3d5e41){return handleSDKError(_0x3d5e41,_0x1fbd30),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x146);[a27_0x243009(0x17f)]=a27_0x243009(0x18f);async[a27_0x243009(0x155)](_0x310a31){const _0x13c45f=a27_0x243009;return executeChatHistoryCommand(_0x310a31,_0x13c45f(0x13d));}}export class LLMUseCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x1d4);[a27_0x243009(0x17f)]=a27_0x243009(0x1ad);async['execute'](_0x203087){const _0x65aaf6=a27_0x243009,{options:_0x283bd7,args:_0x4ea2ea,tdx:_0x49a605}=_0x203087;if(_0x4ea2ea[_0x65aaf6(0x1e9)]===0x0)return console['error'](_0x65aaf6(0x19d)),console[_0x65aaf6(0x1ab)](_0x65aaf6(0x1e2)),0x1;const _0x3e564b=_0x4ea2ea[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x3e564b+_0x65aaf6(0x1c0),()=>_0x49a605[_0x65aaf6(0x13f)]['setCurrentProject'](_0x3e564b),{'verbose':_0x283bd7[_0x65aaf6(0x1ca)]}),console[_0x65aaf6(0x1a3)](_0x65aaf6(0x135)+_0x3e564b),0x0;}catch(_0xc73f22){return handleSDKError(_0xc73f22,_0x283bd7),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x16e);[a27_0x243009(0x17f)]=a27_0x243009(0x1d6);async[a27_0x243009(0x155)](_0x14f910){const _0xfea4e1=a27_0x243009,{options:_0x3511cb,args:_0xb878e4,tdx:_0x23d5a2}=_0x14f910;if(_0xb878e4[_0xfea4e1(0x1e9)]===0x0)return console['error'](_0xfea4e1(0x19d)),console['error'](_0xfea4e1(0x12d)),0x1;const _0x719408=_0xb878e4[0x0],_0x43f438=_0x3511cb,_0x52c7d9=_0x43f438[_0xfea4e1(0x17f)];try{const _0x78c4e5=await withSpinner(_0xfea4e1(0x178)+_0x719408+_0xfea4e1(0x1c0),()=>_0x23d5a2['llm'][_0xfea4e1(0x15e)]({'name':_0x719408,'description':_0x52c7d9}),{'verbose':_0x3511cb['verbose']});console['log'](_0xfea4e1(0x140)+_0x78c4e5[_0xfea4e1(0x1ce)]['id']);const _0x39aeca=toLLMProjectInfo(_0x78c4e5['data']);return await handleSDKOutput([_0x39aeca],_0x3511cb),0x0;}catch(_0x201cc7){return handleSDKError(_0x201cc7,_0x3511cb),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x128);[a27_0x243009(0x17f)]='Delete\x20an\x20LLM\x20project';async['execute'](_0xbaa1b8){const _0x262e39=a27_0x243009,{options:_0xad668b,args:_0x564f43,tdx:_0x492323}=_0xbaa1b8;if(_0x564f43[_0x262e39(0x1e9)]===0x0)return console[_0x262e39(0x1ab)](_0x262e39(0x19d)),console[_0x262e39(0x1ab)](_0x262e39(0x1b9)),0x1;const _0x4df6a5=_0x564f43[0x0];try{return await withSpinner(_0x262e39(0x1f3)+_0x4df6a5+_0x262e39(0x1c0),()=>_0x492323[_0x262e39(0x13f)][_0x262e39(0x1cd)](_0x4df6a5),{'verbose':_0xad668b[_0x262e39(0x1ca)]}),console[_0x262e39(0x1a3)](_0x262e39(0x132)+_0x4df6a5),0x0;}catch(_0x2074d3){return handleSDKError(_0x2074d3,_0xad668b),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x133);[a27_0x243009(0x17f)]=a27_0x243009(0x1a0);async['execute'](_0x4dd2e3){const _0x1c3853=a27_0x243009,{options:_0x1be21e,args:_0x1a70df,tdx:_0x1f509c}=_0x4dd2e3,_0x3ce2e0=getChalk(_0x1be21e);console[_0x1c3853(0x1a3)](_0x3ce2e0[_0x1c3853(0x1eb)](_0x1c3853(0x17b))),console[_0x1c3853(0x1a3)](_0x3ce2e0[_0x1c3853(0x1eb)](_0x1c3853(0x1e7))),console[_0x1c3853(0x1a3)](_0x3ce2e0[_0x1c3853(0x181)]('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console['log']();if(_0x1a70df[_0x1c3853(0x1e9)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x1c3853(0x1ab)](_0x1c3853(0x1cc)),0x1;const _0x663614=_0x1a70df[0x0],_0x833522=_0x1be21e,_0x5d01a3=_0x833522[_0x1c3853(0x143)],_0xc0d35c=_0x833522['dryRun'];try{const _0x4d04fe=_0x5d01a3||_0x663614+'.llm';if(a27_0x481419[_0x1c3853(0x124)](_0x4d04fe)&&!_0xc0d35c){if(!_0x1be21e['yes']){const _0x44adce=await confirm(_0x1c3853(0x199)+_0x4d04fe+_0x1c3853(0x1e6));if(!_0x44adce)return console[_0x1c3853(0x1a3)](_0x1c3853(0x15b)),0x0;}a27_0x481419[_0x1c3853(0x1ec)](_0x4d04fe,{'recursive':!![]});}const _0xfd2b3b=await withSpinner(_0xc0d35c?'Analyzing\x20project\x20\x27'+_0x663614+_0x1c3853(0x1c0):_0x1c3853(0x1f4)+_0x663614+_0x1c3853(0x1c0),()=>_0x1f509c['llm'][_0x1c3853(0x1d5)](_0x663614,_0x5d01a3,{'dryRun':_0xc0d35c}),{'verbose':_0x1be21e[_0x1c3853(0x1ca)]}),_0xccd776=_0xfd2b3b['data'];return _0xc0d35c?console[_0x1c3853(0x1a3)]('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0xccd776[_0x1c3853(0x1de)]):console['log'](_0x1c3853(0x1b8)+_0xccd776[_0x1c3853(0x1de)]),console[_0x1c3853(0x1a3)](_0x1c3853(0x1cf)+_0xccd776[_0x1c3853(0x19c)][_0x1c3853(0x13c)]),console[_0x1c3853(0x1a3)](_0x1c3853(0x1bd)+_0xccd776[_0x1c3853(0x19c)][_0x1c3853(0x186)]),console[_0x1c3853(0x1a3)](_0x1c3853(0x14e)+_0xccd776[_0x1c3853(0x19c)]['prompts']),console[_0x1c3853(0x1a3)]('\x20\x20Integrations:\x20'+_0xccd776[_0x1c3853(0x19c)][_0x1c3853(0x145)]),(_0x1be21e['format']==='json'||_0x1be21e['format']===_0x1c3853(0x1ef))&&await handleSDKOutput([_0xccd776],_0x1be21e),0x0;}catch(_0x227b81){return handleSDKError(_0x227b81,_0x1be21e),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a27_0x243009(0x1af)]='llm:project:restore';['description']='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)';async[a27_0x243009(0x155)](_0x327f8d){const _0x449424=a27_0x243009,{options:_0x510e22,args:_0x530307,tdx:_0x58a9ef}=_0x327f8d,_0x28e1d9=getChalk(_0x510e22);console['log'](_0x28e1d9[_0x449424(0x1eb)](_0x449424(0x1f8))),console[_0x449424(0x1a3)](_0x28e1d9[_0x449424(0x1eb)]('\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.')),console[_0x449424(0x1a3)](_0x28e1d9[_0x449424(0x181)]('\x20\x20\x20Examples:')),console[_0x449424(0x1a3)](_0x28e1d9[_0x449424(0x181)](_0x449424(0x1ea))),console[_0x449424(0x1a3)](_0x28e1d9['dim'](_0x449424(0x1c2))),console[_0x449424(0x1a3)]();if(_0x530307[_0x449424(0x1e9)]===0x0)return console[_0x449424(0x1ab)](_0x449424(0x18a)),console[_0x449424(0x1ab)](_0x449424(0x18d)),0x1;const _0xf5f6d9=_0x530307[0x0],_0x2d1cdc=_0x510e22,_0x28f737=_0x2d1cdc[_0x449424(0x1af)],_0x20d608=_0x2d1cdc[_0x449424(0x1df)];try{if(!_0x20d608){const _0x1a4155=_0x58a9ef[_0x449424(0x13f)][_0x449424(0x194)](_0xf5f6d9),_0x36800f=_0x28f737||_0x1a4155[_0x449424(0x14b)][_0x449424(0x12f)],_0x5c212e=await withSpinner(_0x449424(0x13e),()=>_0x58a9ef['llm'][_0x449424(0x1a6)](),{'verbose':_0x510e22[_0x449424(0x1ca)]}),_0x3408ac=_0x5c212e[_0x449424(0x1ce)][_0x449424(0x1f0)](_0x2d0c26=>_0x2d0c26['attributes'][_0x449424(0x1af)]===_0x36800f);if(_0x3408ac&&!_0x510e22[_0x449424(0x176)]){const _0xc3c069=await confirm('A\x20project\x20named\x20\x27'+_0x36800f+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0xc3c069)return console[_0x449424(0x1a3)]('Restore\x20cancelled.'),0x0;}}const _0x394e5c=await withSpinner(_0x20d608?_0x449424(0x191)+_0xf5f6d9+'\x27...':_0x449424(0x1d8)+_0xf5f6d9+_0x449424(0x1c0),()=>_0x58a9ef[_0x449424(0x13f)][_0x449424(0x19e)](_0xf5f6d9,{'name':_0x28f737,'dryRun':_0x20d608}),{'verbose':_0x510e22['verbose']}),_0x2c26aa=_0x394e5c['data'];return _0x2c26aa[_0x449424(0x15f)]&&console['log'](_0x449424(0x1b4)+_0x2c26aa[_0x449424(0x15f)]+'\x27'),_0x20d608?console[_0x449424(0x1a3)]('[DRY\x20RUN]\x20Would\x20restore\x20project:\x20'+_0x2c26aa[_0x449424(0x12f)]):console[_0x449424(0x1a3)]('Project\x20restored:\x20'+_0x2c26aa[_0x449424(0x12f)]+'\x20('+_0x2c26aa['projectId']+')'),console[_0x449424(0x1a3)](_0x449424(0x1cf)+_0x2c26aa[_0x449424(0x19c)][_0x449424(0x13c)]),console[_0x449424(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2c26aa[_0x449424(0x19c)][_0x449424(0x186)]),console[_0x449424(0x1a3)]('\x20\x20Prompts:\x20'+_0x2c26aa[_0x449424(0x19c)][_0x449424(0x196)]),console[_0x449424(0x1a3)](_0x449424(0x1a1)+_0x2c26aa[_0x449424(0x19c)][_0x449424(0x145)]),(_0x510e22[_0x449424(0x14f)]===_0x449424(0x183)||_0x510e22['format']===_0x449424(0x1ef))&&await handleSDKOutput([_0x2c26aa],_0x510e22),0x0;}catch(_0x103e32){return handleSDKError(_0x103e32,_0x510e22),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x4fad28,_0xcc12fe){const _0x43ffdf=a27_0x243009,_0x8fd14=_0xcc12fe[_0x43ffdf(0x1d7)]||CHAT_SELECTOR_PAGE_SIZE;let _0x583625=0x0,_0x3352a0=[];const _0x1c2352=(await import('prompts'))[_0x43ffdf(0x1d2)],_0x12a2a9=getChalk(_0xcc12fe);while(!![]){const _0x23fbaa=await withSpinner(_0x43ffdf(0x14c),()=>_0x4fad28[_0x43ffdf(0x13f)][_0x43ffdf(0x187)](_0x8fd14+_0x583625),{'verbose':_0xcc12fe[_0x43ffdf(0x1ca)]});_0x3352a0=_0x23fbaa[_0x43ffdf(0x1ce)];const _0x4b299a=_0x3352a0[_0x43ffdf(0x16b)](_0x583625,_0x583625+_0x8fd14),_0x545b6d=_0x3352a0['length']>_0x583625+_0x8fd14,_0x3c7d08=[...new Set(_0x4b299a[_0x43ffdf(0x136)](_0xc1a8c2=>_0xc1a8c2['attributes'][_0x43ffdf(0x195)])[_0x43ffdf(0x1ae)](_0x46b4ca=>_0x46b4ca!==undefined))],_0x193056=new Map();await Promise['all'](_0x3c7d08[_0x43ffdf(0x136)](async _0x2eb4f2=>{const _0x3f167c=_0x43ffdf;try{const _0x54567f=await _0x4fad28[_0x3f167c(0x13f)][_0x3f167c(0x13b)](_0x2eb4f2);_0x193056['set'](_0x2eb4f2,_0x54567f[_0x3f167c(0x1db)]['name']);}catch{_0x193056[_0x3f167c(0x18e)](_0x2eb4f2,_0x2eb4f2);}}));const _0x451653=_0x4b299a[_0x43ffdf(0x136)](_0x2be538=>{const _0x58c48d=_0x43ffdf,_0x1ec1e2=_0x2be538['attributes'][_0x58c48d(0x197)]||'(no\x20message)',_0xe6cf45=_0x1ec1e2[_0x58c48d(0x173)]('\x0a')[0x0],_0x480f3d=_0xe6cf45[_0x58c48d(0x1e9)]>0x50?_0xe6cf45['substring'](0x0,0x4d)+_0x58c48d(0x16a):_0xe6cf45,_0x2a2827=_0x2be538[_0x58c48d(0x1db)][_0x58c48d(0x195)]?_0x193056['get'](_0x2be538[_0x58c48d(0x1db)][_0x58c48d(0x195)])||_0x2be538['attributes'][_0x58c48d(0x195)]:_0x58c48d(0x148),_0x38fde8=_0x2be538[_0x58c48d(0x1db)][_0x58c48d(0x1c1)]||_0x2be538[_0x58c48d(0x1db)]['updatedAt'],_0x961946=new Date(_0x38fde8),_0x353f34=new Date(),_0x51bc79=_0x353f34[_0x58c48d(0x149)]()-_0x961946['getTime'](),_0x166b0b=Math['floor'](_0x51bc79/0xea60),_0x25e18a=Math['floor'](_0x51bc79/0x36ee80),_0x1c8837=Math[_0x58c48d(0x170)](_0x51bc79/0x5265c00);let _0x26b246;if(_0x166b0b<0x1)_0x26b246='just\x20now';else{if(_0x166b0b<0x3c)_0x26b246=_0x166b0b+_0x58c48d(0x160);else{if(_0x25e18a<0x18)_0x26b246=_0x25e18a+'h\x20ago';else _0x1c8837<0x7?_0x26b246=_0x1c8837+_0x58c48d(0x1bb):_0x26b246=_0x961946[_0x58c48d(0x168)](_0x58c48d(0x19f),{'month':_0x58c48d(0x147),'day':'numeric'});}}return{'title':_0x480f3d+'\x20'+_0x12a2a9[_0x58c48d(0x181)]('['+_0x2a2827+']\x20'+_0x26b246),'value':_0x2be538['id']};});_0x545b6d&&_0x451653['push']({'title':_0x12a2a9['cyan']('Load\x20more...'),'value':_0x43ffdf(0x180)});const _0x44b03b=await _0x1c2352({'type':_0x43ffdf(0x161),'name':_0x43ffdf(0x1b7),'message':_0x43ffdf(0x1c3),'choices':_0x451653,'hint':_0x43ffdf(0x17c)});if(!_0x44b03b['chatId'])return undefined;if(_0x44b03b[_0x43ffdf(0x1b7)]===_0x43ffdf(0x180)){_0x583625+=_0x8fd14;continue;}return _0x44b03b[_0x43ffdf(0x1b7)];}}export class ChatsCommand extends BaseCommand{[a27_0x243009(0x1af)]=a27_0x243009(0x187);[a27_0x243009(0x17f)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a27_0x243009(0x155)](_0x24367d){const _0x329ff0=a27_0x243009;return executeChatHistoryCommand(_0x24367d,_0x329ff0(0x139));}}
|
|
1
|
+
const a27_0x4b2c03=a27_0x2011;(function(_0x5ef7fe,_0x34d26f){const _0x38b2b6=a27_0x2011,_0xfadd55=_0x5ef7fe();while(!![]){try{const _0x2ed333=parseInt(_0x38b2b6(0xe1))/0x1*(parseInt(_0x38b2b6(0x122))/0x2)+-parseInt(_0x38b2b6(0x165))/0x3+parseInt(_0x38b2b6(0x167))/0x4+parseInt(_0x38b2b6(0x143))/0x5*(-parseInt(_0x38b2b6(0x152))/0x6)+-parseInt(_0x38b2b6(0x183))/0x7*(parseInt(_0x38b2b6(0x10c))/0x8)+parseInt(_0x38b2b6(0x111))/0x9+-parseInt(_0x38b2b6(0x117))/0xa*(-parseInt(_0x38b2b6(0x19c))/0xb);if(_0x2ed333===_0x34d26f)break;else _0xfadd55['push'](_0xfadd55['shift']());}catch(_0x3463e0){_0xfadd55['push'](_0xfadd55['shift']());}}}(a27_0x15f9,0x833ce));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a27_0x2011(_0x2af7f6,_0x517f8d){_0x2af7f6=_0x2af7f6-0xd9;const _0x15f970=a27_0x15f9();let _0x201191=_0x15f970[_0x2af7f6];return _0x201191;}import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';import*as a27_0x4e5417 from'node:fs';function handleSDKError(_0x3a0965,_0x28efa3){const _0x5bccf7=a27_0x2011;if(_0x3a0965 instanceof SDKError)console[_0x5bccf7(0x166)](_0x5bccf7(0x174)+_0x3a0965[_0x5bccf7(0xfb)]),_0x28efa3['verbose']&&(_0x3a0965[_0x5bccf7(0x132)]&&console[_0x5bccf7(0x166)](_0x5bccf7(0x12c)+_0x3a0965['cause']),_0x3a0965['stack']&&(console[_0x5bccf7(0x166)](_0x5bccf7(0x106)),console[_0x5bccf7(0x166)](_0x3a0965['stack'])));else throw _0x3a0965;}function formatChatHistoryEntry(_0x570fbc,_0x5df2c0){const _0x174402=a27_0x2011,_0xf5facd=getChalk(_0x5df2c0),_0x5b44b3=_0xf5facd[_0x174402(0x162)](_0x570fbc['at']);if(_0x174402(0x170)in _0x570fbc){const _0x29b0ff=_0xf5facd[_0x174402(0x168)]('[input]\x20\x20');return _0x5b44b3+'\x20'+_0x29b0ff+':\x20'+_0x570fbc[_0x174402(0x170)];}if('content'in _0x570fbc){const _0x40e29f=_0xf5facd[_0x174402(0x10d)](_0x174402(0x189));return _0x5b44b3+'\x20'+_0x40e29f+':\x20'+_0x570fbc[_0x174402(0x159)];}if('tool_call'in _0x570fbc){const _0xe84dd8=_0xf5facd[_0x174402(0x190)](_0x174402(0xe7)),{functionName:_0x44bdc4,functionArguments:_0x1d317b,targetFunction:_0x400d37}=_0x570fbc[_0x174402(0xef)];let _0xbbed11=_0x5b44b3+'\x20'+_0xe84dd8+':\x20'+_0xf5facd[_0x174402(0x1a3)](_0x44bdc4);if(_0x1d317b&&Object[_0x174402(0x136)](_0x1d317b)[_0x174402(0x12d)]>0x0){const _0x3bdfcc=Object['entries'](_0x1d317b)[_0x174402(0x185)](([_0x7fd162,_0x62093d])=>_0x7fd162+'='+JSON[_0x174402(0x1a1)](_0x62093d))['join'](',\x20');_0xbbed11+='('+_0x3bdfcc+')';}_0x400d37&&(_0xbbed11+=_0xf5facd[_0x174402(0x162)]('\x20['+_0x400d37+']'));let _0x367665='';if(_0x570fbc['tool_call'][_0x174402(0x1a8)])_0x367665='\x20->\x20KB:'+_0x570fbc[_0x174402(0xef)]['targetKnowledgeBase'][_0x174402(0xd9)];else{if(_0x570fbc[_0x174402(0xef)][_0x174402(0x113)])_0x367665=_0x174402(0xea)+_0x570fbc['tool_call']['targetAgent'][_0x174402(0xd9)];else{if(_0x570fbc[_0x174402(0xef)][_0x174402(0xed)])_0x367665=_0x174402(0xde)+_0x570fbc[_0x174402(0xef)][_0x174402(0xed)][_0x174402(0xd9)];else _0x570fbc['tool_call'][_0x174402(0x141)]&&(_0x367665='\x20->\x20ImageGen:'+_0x570fbc['tool_call'][_0x174402(0x141)][_0x174402(0xd9)]);}}return _0xbbed11+_0x367665;}if(_0x174402(0x1ac)in _0x570fbc){const _0x5d7087=_0xf5facd[_0x174402(0x130)]('[tool]\x20\x20\x20'),{functionName:_0x4424f8,functionArguments:_0x1ffaf3,content:_0x4e4761,newChat:_0x490b27}=_0x570fbc[_0x174402(0x1ac)];let _0x4c5e4d=_0x5b44b3+'\x20'+_0x5d7087+':\x20'+_0xf5facd[_0x174402(0x1a3)](_0x4424f8);if(_0x1ffaf3){const _0x204a19=typeof _0x1ffaf3==='string'?_0x1ffaf3:JSON[_0x174402(0x1a1)](_0x1ffaf3);_0x4c5e4d+='('+_0x204a19+')';}return _0x4e4761&&(_0x4c5e4d+='\x0a'+_0xf5facd[_0x174402(0x162)](_0x4e4761)),_0x490b27&&(_0x4c5e4d+=_0xf5facd[_0x174402(0x162)](_0x174402(0x172)+_0x490b27['id'])),_0x4c5e4d;}if(_0x174402(0x15e)in _0x570fbc){const _0x2d5951=_0xf5facd[_0x174402(0xfd)](_0x174402(0x195));return _0x5b44b3+'\x20'+_0x2d5951+':\x20'+_0x570fbc[_0x174402(0x15e)]['name']+'\x20('+_0x570fbc['output'][_0x174402(0x159)]['length']+_0x174402(0x198);}if(_0x174402(0x191)in _0x570fbc){const _0x844543=_0xf5facd[_0x174402(0xfd)](_0x174402(0xe8)),{width:_0x270e9a,height:_0xb66279,headerText:_0x3dc1d4}=_0x570fbc['image'],_0x8fef16=_0x3dc1d4?_0x174402(0x1a4)+_0x3dc1d4:'';return _0x5b44b3+'\x20'+_0x844543+':\x20'+_0x270e9a+'x'+_0xb66279+_0x8fef16;}if('error'in _0x570fbc){const _0x34c692=_0xf5facd['red'](_0x174402(0x16c));return _0x5b44b3+'\x20'+_0x34c692+':\x20'+_0x570fbc['error'];}return _0x5b44b3+'\x20'+_0xf5facd[_0x174402(0x162)](_0x174402(0xfa))+':\x20'+JSON[_0x174402(0x1a1)](_0x570fbc);}async function executeChatHistoryCommand(_0x317eb1,_0x371f6b){const _0x1a0d00=a27_0x2011,{options:_0x1c394c,args:_0x1acf67,tdx:_0x47bb78}=_0x317eb1,_0xc05fd=_0x1acf67[0x0],_0x115cd0=_0x1c394c,_0x11e12b=_0x115cd0['last'];try{if(_0x11e12b&&_0xc05fd)return console[_0x1a0d00(0x166)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console['error']('Usage:\x20'+_0x371f6b+_0x1a0d00(0xe5)),0x1;if(!_0xc05fd&&!_0x11e12b&&_0x1c394c[_0x1a0d00(0x177)]!==undefined){const _0x57d193=resolveLimit(_0x1c394c[_0x1a0d00(0x15c)],DEFAULT_LLM_LIMIT),_0x5c93c1=await withSpinner(_0x1a0d00(0x10f),()=>_0x47bb78[_0x1a0d00(0x188)][_0x1a0d00(0xe4)](_0x57d193),{'verbose':_0x1c394c[_0x1a0d00(0xf3)]});return await handleSDKOutput(_0x5c93c1['data'],_0x1c394c),0x0;}const _0x177211=await getChatIdOrSelect(_0x47bb78,_0x1c394c,_0x11e12b,_0xc05fd);if(!_0x177211)return 0x0;return await displayChatHistory(_0x177211,_0x47bb78,_0x1c394c),0x0;}catch(_0x2cdfe7){return handleSDKError(_0x2cdfe7,_0x1c394c),0x1;}}async function displayChatHistory(_0x2d656b,_0x16c0c7,_0x142949){const _0x3b4ceb=a27_0x2011,_0x4773bf=await withSpinner(_0x3b4ceb(0xe3)+_0x2d656b+'\x27...',()=>_0x16c0c7['llm'][_0x3b4ceb(0x150)](_0x2d656b),{'verbose':_0x142949[_0x3b4ceb(0xf3)]}),_0x1baf43=_0x4773bf['data']['data']??[];if(_0x1baf43[_0x3b4ceb(0x12d)]===0x0){console['log']('No\x20messages\x20found\x20in\x20chat\x20history.');return;}if(_0x142949[_0x3b4ceb(0x177)]!==undefined)await handleSDKOutput(_0x1baf43,_0x142949);else{const _0x525ce6=_0x1baf43['map'](_0x2ed6e6=>formatChatHistoryEntry(_0x2ed6e6,_0x142949)),_0x3e08b7=_0x525ce6[_0x3b4ceb(0x154)]('\x0a');await writeOutput(_0x3e08b7,_0x142949[_0x3b4ceb(0x15e)],_0x3b4ceb(0x127));}}async function getChatIdOrSelect(_0x3faa71,_0x12df7f,_0x571b48,_0x35b2a5){const _0x394510=a27_0x2011;if(_0x35b2a5)return _0x35b2a5;if(_0x571b48){const _0x3b1798=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x3faa71[_0x394510(0x188)]['chats'](0x1),{'verbose':_0x12df7f[_0x394510(0xf3)]});if(_0x3b1798[_0x394510(0x196)][_0x394510(0x12d)]===0x0)return console['log'](_0x394510(0x14c)),undefined;return _0x3b1798[_0x394510(0x196)][0x0]['id'];}const _0x7105a2=await selectChatInteractively(_0x3faa71,_0x12df7f);if(!_0x7105a2)return console['log']('\x0aCancelled'),undefined;return _0x7105a2;}async function getProjectIdOrDefault(_0x1910c5){const _0x41f606=await getProjectWithName(_0x1910c5);return _0x41f606['id'];}function a27_0x15f9(){const _0x4f95f9=['llm:agents','floor','Select\x20a\x20chat\x20session:','projects','Restoring\x20project\x20from\x20\x27','knowledgeBases','973SGabtg','Fetching\x20agents...','map','starterMessage','\x20\x20Prompts:\x20','llm','[content]','Error:\x20Project\x20name\x20is\x20required','(no\x20message)','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','split','includes','yellow','image','List\x20available\x20LLM\x20models','push','Resolving\x20agent\x20\x27','[output]\x20','data','No\x20agents\x20found','\x20bytes)','Create\x20a\x20new\x20LLM\x20project','set','llm:models','44nvZeXA','substring','Analyzing\x20project\x20\x27','Invalid\x20path\x20syntax:\x20','llm:agent:delete','stringify','createProject','bold','\x20-\x20','Resolving\x20project\x20\x27','restoreProject','dryRun','targetKnowledgeBase','llm:use','execute','log','tool','maxToolIterations','\x20\x20Agents:\x20','default','agent','name','firstInputContent','deleteProject','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','createdAt','\x20->\x20WebSearch:','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','slice','1FCbKBe','Setting\x20project\x20context\x20to\x20\x27','Fetching\x20chat\x20history\x20for\x20\x27','chats','\x20--last','updatedAt','[tool_call]','[image]\x20\x20','exportedFrom','\x20->\x20Agent:','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','Agent\x20deleted:\x20','targetWebSearchTool','getCurrentProject','tool_call','outputDir','agents','site','verbose','Agent\x20updated:\x20','...','all','\x20\x20Knowledge\x20Bases:\x20','resolveAgentId','en-US','[unknown]','message','Backing\x20up\x20project\x20\x27','blue','llm:project:delete','llm:agent:show','getTime','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','.llm','existsSync','\x27\x20already\x20exists.\x20Overwrite?','projectId','\x0aStack\x20trace:','\x20agent(s)','llm:agent:update','\x20\x20Integrations:\x20','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','yes','56296cmjiMv','green','Project\x20not\x20found:\x20','Fetching\x20chat\x20sessions...','Delete\x20an\x20agent','2802447JUxvao','integrations','targetAgent','llm:agent:create','Backup\x20cancelled.','tdx\x20chats','2024680iMpStE','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','\x20\x20\x20Examples:','Unknown','prompts','prompt','m\x20ago','Validating\x20backup\x20from\x20\x27','Set\x20current\x20project\x20context','Error:\x20Agent\x20name\x20is\x20required','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','1009706CxyAAA','Project\x20created:\x20','web','setCurrentProject','Deleting\x20project\x20\x27','table','Creating\x20project\x20\x27','jsonl','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','List\x20agents\x20in\x20current\x20project','\x20\x20Cause:\x20','length','Checking\x20for\x20existing\x20projects...','rmSync','magenta','getBackupMetadata','cause','A\x20project\x20named\x20\x27','deleteAgent','just\x20now','keys','tsv','Deleting\x20agent...','find','Project\x20backed\x20up\x20to:\x20','models','⚒️\x20','toLowerCase','__load_more__','attributes','description','targetImageGenerator','\x27...','1209905dViHee','llm:projects','List\x20all\x20LLM\x20projects','sort','sourceSite','tdx\x20llm\x20history','Output\x20directory\x20\x27','json','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','No\x20chat\x20sessions\x20found.','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','projectName','No\x20projects\x20found','history','counts','6DRhcBC','Use\x20format:\x20project-name/agent-name','join','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Creating\x20agent\x20\x27','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','content','Update\x20an\x20existing\x20agent','localeCompare','limit','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','output','Project\x20restored:\x20','chatId','filter','dim','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','1562418ZmHFEj','error','2609488NjdHgo','cyan','getOrCreateDefaultProject','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','lastConversationAt','[error]\x20\x20','Agent\x20created:\x20','Error:\x20Backup\x20folder\x20path\x20is\x20required','🤖\x20','input','temperature','\x20→\x20chat:\x20','resolveProjectId','Error:\x20','Show\x20agent\x20details','claude-4.5-haiku','format','agentId','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','llm:project:backup','backupProject','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]'];a27_0x15f9=function(){return _0x4f95f9;};return a27_0x15f9();}async function getProjectWithName(_0x5d0f69){const _0xa191a4=a27_0x2011,{tdx:_0x504d0b,options:_0x56625a}=_0x5d0f69,_0xd30703=_0x56625a['llmProject'];if(_0xd30703){const _0x3d953a=await withSpinner(_0xa191a4(0x1a5)+_0xd30703+_0xa191a4(0x142),()=>_0x504d0b['llm'][_0xa191a4(0x173)](_0xd30703),{'verbose':_0x56625a[_0xa191a4(0xf3)]});return{'id':_0x3d953a[_0xa191a4(0x196)],'name':_0xd30703};}const _0x2e4d72=_0x504d0b[_0xa191a4(0x188)][_0xa191a4(0xee)]();if(_0x2e4d72){const _0x3555d0=await _0x504d0b[_0xa191a4(0x188)][_0xa191a4(0x180)](),_0x15322f=_0x3555d0[_0xa191a4(0x139)](_0x440a78=>_0x440a78['id']===_0x2e4d72);return{'id':_0x2e4d72,'name':_0x15322f?.[_0xa191a4(0x13f)][_0xa191a4(0xd9)]||_0xa191a4(0x11a)};}const _0x3510ab=await withSpinner('Getting\x20default\x20project...',()=>_0x504d0b[_0xa191a4(0x188)][_0xa191a4(0x169)](),{'verbose':_0x56625a['verbose']});return{'id':_0x3510ab[_0xa191a4(0x196)]['id'],'name':_0x3510ab[_0xa191a4(0x196)][_0xa191a4(0x13f)][_0xa191a4(0xd9)]};}function toLLMProjectInfo(_0x49d3f6){const _0x10ec3a=a27_0x2011;return{'name':_0x49d3f6[_0x10ec3a(0x13f)][_0x10ec3a(0xd9)],'description':_0x49d3f6[_0x10ec3a(0x13f)]['description'],'createdAt':_0x49d3f6['attributes'][_0x10ec3a(0xdd)],'updatedAt':_0x49d3f6[_0x10ec3a(0x13f)][_0x10ec3a(0xe6)]};}function toAgentInfo(_0x55b773){const _0x32fab6=a27_0x2011;return{'name':_0x55b773[_0x32fab6(0x13f)][_0x32fab6(0xd9)],'description':_0x55b773[_0x32fab6(0x13f)][_0x32fab6(0x140)],'prompt':truncatePrompt(_0x55b773[_0x32fab6(0x13f)][_0x32fab6(0x11c)]),'createdAt':_0x55b773[_0x32fab6(0x13f)][_0x32fab6(0xdd)],'updatedAt':_0x55b773[_0x32fab6(0x13f)][_0x32fab6(0xe6)]};}function truncatePrompt(_0x144d53){const _0x1a38d8=a27_0x2011;if(!_0x144d53)return undefined;const _0x2d301e=0x64;if(_0x144d53['length']<=_0x2d301e)return _0x144d53;return _0x144d53[_0x1a38d8(0xe0)](0x0,_0x2d301e)+_0x1a38d8(0xf5);}export class LLMModelsCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x19b);['description']=a27_0x4b2c03(0x192);async['execute'](_0x304bc1){const _0x3a7ce9=a27_0x4b2c03,{options:_0x5c6234,tdx:_0x578f66}=_0x304bc1;try{const _0x6b2ffe=await withSpinner('Fetching\x20available\x20models...',()=>_0x578f66[_0x3a7ce9(0x188)][_0x3a7ce9(0x13b)](),{'verbose':_0x5c6234[_0x3a7ce9(0xf3)]});return await handleSDKOutput(_0x6b2ffe['data'],_0x5c6234),0x0;}catch(_0x2bdfca){return handleSDKError(_0x2bdfca,_0x5c6234),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a27_0x4b2c03(0x144);[a27_0x4b2c03(0x140)]=a27_0x4b2c03(0x145);async[a27_0x4b2c03(0x1aa)](_0x455d21){const _0x59319d=a27_0x4b2c03,{options:_0x5b1cd5,args:_0x57b8ed,tdx:_0x4d9686}=_0x455d21,_0x51a0b8=getChalk(_0x5b1cd5),_0x585371=_0x5b1cd5[_0x59319d(0x124)],_0x305999=_0x5b1cd5[_0x59319d(0xf2)];try{const _0x67559d=_0x57b8ed[0x0],_0x10be1e=resolveLimit(_0x5b1cd5[_0x59319d(0x15c)],DEFAULT_LLM_LIMIT),_0x56c1c8=await withSpinner('Fetching\x20projects...',()=>_0x4d9686[_0x59319d(0x188)][_0x59319d(0x180)](_0x10be1e),{'verbose':_0x5b1cd5[_0x59319d(0xf3)]});let _0x147bf3=_0x56c1c8[_0x59319d(0x196)];_0x67559d&&(_0x147bf3=_0x56c1c8[_0x59319d(0x196)]['filter'](_0x56ae71=>matchGlobPattern(_0x56ae71[_0x59319d(0x13f)][_0x59319d(0xd9)],_0x67559d)));const _0x57d0e6=_0x5b1cd5['format']==='json'||_0x5b1cd5[_0x59319d(0x177)]===_0x59319d(0x129)||_0x5b1cd5[_0x59319d(0x177)]===_0x59319d(0x127)||_0x5b1cd5['format']==='tsv';if(_0x57d0e6){const _0x51a05b=_0x147bf3[_0x59319d(0x185)](_0x147eb1=>({...toLLMProjectInfo(_0x147eb1),..._0x585371?{'url':getLLMProjectUrl(_0x305999,_0x147eb1['id'])}:{}}));await handleSDKOutput(_0x51a05b,_0x5b1cd5);}else{const _0x53c9f9=[];if(_0x147bf3[_0x59319d(0x12d)]===0x0)_0x53c9f9['push'](_0x51a0b8['dim'](_0x59319d(0x14f)));else{const _0x137bdc=[..._0x147bf3][_0x59319d(0x146)]((_0x5cc0ab,_0x4765a3)=>_0x5cc0ab[_0x59319d(0x13f)][_0x59319d(0xd9)][_0x59319d(0x15b)](_0x4765a3[_0x59319d(0x13f)]['name']));for(const _0x2f581f of _0x137bdc){if(_0x585371){const _0x3e4ad7=getLLMProjectUrl(_0x305999,_0x2f581f['id']);_0x53c9f9[_0x59319d(0x193)](_0x59319d(0x13c)+_0x2f581f['attributes']['name']+'\x20\x20'+_0x51a0b8['dim'](_0x3e4ad7));}else _0x53c9f9['push'](_0x59319d(0x13c)+_0x2f581f[_0x59319d(0x13f)]['name']);}_0x53c9f9['push'](_0x51a0b8['dim'](_0x147bf3[_0x59319d(0x12d)]+'\x20project(s)'));}await writeOutput(_0x53c9f9[_0x59319d(0x154)]('\x0a'),_0x5b1cd5[_0x59319d(0x15e)],_0x59319d(0x127));}return 0x0;}catch(_0x544528){return handleSDKError(_0x544528,_0x5b1cd5),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x17d);[a27_0x4b2c03(0x140)]=a27_0x4b2c03(0x12b);async[a27_0x4b2c03(0x1aa)](_0x5da92c){const _0x9926c8=a27_0x4b2c03,{options:_0x13d7ab,args:_0x309b5a,tdx:_0xe6f170}=_0x5da92c,_0x154426=getChalk(_0x13d7ab),_0x5922cd=_0x13d7ab['web'],_0x55eec9=_0x13d7ab['site'];try{const _0x9f978a=_0x309b5a[0x0];let _0x568df3=_0x9f978a,_0x4090ee,_0x10a02c;if(_0x9f978a&&_0x9f978a[_0x9926c8(0x18f)]('/')){const _0x54f016=_0x9f978a[_0x9926c8(0x18e)]('/');if(_0x54f016[_0x9926c8(0x12d)]===0x2){const [_0x553844,_0xda7ba1]=_0x54f016,_0x26ca54=await _0xe6f170[_0x9926c8(0x188)]['projects'](),_0x45ed2b=_0x26ca54[_0x9926c8(0x139)](_0x48831d=>_0x48831d[_0x9926c8(0x13f)][_0x9926c8(0xd9)]['toLowerCase']()===_0x553844[_0x9926c8(0x13d)]());if(!_0x45ed2b)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x9926c8(0x10e)+_0x553844,undefined,{'helpText':_0x9926c8(0x18d)});_0x4090ee=_0x45ed2b['id'],_0x10a02c=_0x45ed2b[_0x9926c8(0x13f)][_0x9926c8(0xd9)],_0x568df3=_0xda7ba1;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x9926c8(0x19f)+_0x9f978a,undefined,{'helpText':_0x9926c8(0x153)});}else{const _0x3ae160=await getProjectWithName(_0x5da92c);_0x4090ee=_0x3ae160['id'],_0x10a02c=_0x3ae160[_0x9926c8(0xd9)];}const _0x1c025e=await withSpinner(_0x9926c8(0x184),()=>_0xe6f170['llm'][_0x9926c8(0xf1)](_0x4090ee),{'verbose':_0x13d7ab[_0x9926c8(0xf3)]});let _0x425310=_0x1c025e['data'];_0x568df3&&(_0x425310=_0x1c025e['data'][_0x9926c8(0x161)](_0x28eadc=>matchGlobPattern(_0x28eadc['attributes']['name'],_0x568df3)));const _0x4928de=_0x13d7ab[_0x9926c8(0x177)]===_0x9926c8(0x14a)||_0x13d7ab['format']===_0x9926c8(0x129)||_0x13d7ab[_0x9926c8(0x177)]===_0x9926c8(0x127)||_0x13d7ab[_0x9926c8(0x177)]===_0x9926c8(0x137);if(_0x4928de){const _0x35ca1a=_0x425310['map'](_0xd96e42=>({...toAgentInfo(_0xd96e42),..._0x5922cd?{'chatUrl':getLLMAgentChatUrl(_0x55eec9,_0x4090ee,_0xd96e42['id'])}:{}}));await handleSDKOutput(_0x35ca1a,_0x13d7ab);}else{const _0x59a3c0=[];_0x59a3c0['push'](_0x154426[_0x9926c8(0x162)]('['+_0x10a02c+']'));if(_0x425310[_0x9926c8(0x12d)]===0x0)_0x59a3c0['push'](_0x154426['dim'](_0x9926c8(0x197)));else{const _0x50f3f7=[..._0x425310][_0x9926c8(0x146)]((_0xd0cc72,_0xc59288)=>_0xd0cc72[_0x9926c8(0x13f)][_0x9926c8(0xd9)][_0x9926c8(0x15b)](_0xc59288['attributes'][_0x9926c8(0xd9)]));for(const _0x921eeb of _0x50f3f7){if(_0x5922cd){const _0x5f59d7=getLLMAgentChatUrl(_0x55eec9,_0x4090ee,_0x921eeb['id']);_0x59a3c0[_0x9926c8(0x193)](_0x9926c8(0x16f)+_0x921eeb['attributes'][_0x9926c8(0xd9)]+'\x20\x20'+_0x154426[_0x9926c8(0x162)](_0x5f59d7));}else _0x59a3c0[_0x9926c8(0x193)](_0x9926c8(0x16f)+_0x921eeb['attributes'][_0x9926c8(0xd9)]);}_0x59a3c0[_0x9926c8(0x193)](_0x154426[_0x9926c8(0x162)](_0x425310[_0x9926c8(0x12d)]+_0x9926c8(0x107)));}await writeOutput(_0x59a3c0[_0x9926c8(0x154)]('\x0a'),_0x13d7ab['output'],_0x9926c8(0x127));}return 0x0;}catch(_0x552faf){return handleSDKError(_0x552faf,_0x13d7ab),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0xff);[a27_0x4b2c03(0x140)]=a27_0x4b2c03(0x175);async[a27_0x4b2c03(0x1aa)](_0x40a0fb){const _0x14cf40=a27_0x4b2c03,{options:_0x2ab04a,args:_0x4dcfe1,tdx:_0xc576ab}=_0x40a0fb;if(_0x4dcfe1['length']===0x0)return console[_0x14cf40(0x166)](_0x14cf40(0x120)),console[_0x14cf40(0x166)](_0x14cf40(0x14b)),0x1;const _0x3ddd13=_0x4dcfe1[0x0];try{const _0x17c31c=await getProjectIdOrDefault(_0x40a0fb),_0xe1eeed=await withSpinner('Resolving\x20agent\x20\x27'+_0x3ddd13+_0x14cf40(0x142),()=>_0xc576ab[_0x14cf40(0x188)][_0x14cf40(0xf8)](_0x3ddd13,_0x17c31c),{'verbose':_0x2ab04a['verbose']}),_0x4f1387=await withSpinner('Fetching\x20agent...',()=>_0xc576ab[_0x14cf40(0x188)][_0x14cf40(0x1b0)](_0xe1eeed['data']),{'verbose':_0x2ab04a[_0x14cf40(0xf3)]});return await handleSDKOutput([_0x4f1387[_0x14cf40(0x196)]],_0x2ab04a),0x0;}catch(_0x5614d3){return handleSDKError(_0x5614d3,_0x2ab04a),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x114);[a27_0x4b2c03(0x140)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a27_0x4b2c03(0x1aa)](_0x495aa2){const _0x23762d=a27_0x4b2c03,{options:_0x554090,args:_0xb3998,tdx:_0x4b12fd}=_0x495aa2;if(_0xb3998[_0x23762d(0x12d)]===0x0)return console[_0x23762d(0x166)](_0x23762d(0x120)),console[_0x23762d(0x166)](_0x23762d(0x101)),console[_0x23762d(0x166)](_0x23762d(0x164)),0x1;const _0x11676f=_0xb3998[0x0],_0x87619d=_0x554090,_0x8bd811=_0x87619d['systemPrompt'],_0xbfdc50=_0x87619d['model']||_0x23762d(0x176),_0x255596=_0x87619d[_0x23762d(0x186)],_0x4eedb2=_0x87619d[_0x23762d(0x1ad)]?Number(_0x87619d[_0x23762d(0x1ad)]):undefined,_0x342eac=_0x87619d[_0x23762d(0x171)]?Number(_0x87619d[_0x23762d(0x171)]):undefined;try{let _0x255241,_0x149cb6;if(_0x11676f[_0x23762d(0x18f)]('/')){const _0x4c82da=_0x11676f['split']('/');if(_0x4c82da[_0x23762d(0x12d)]===0x2){const [_0x4ac4f4,_0x4f4498]=_0x4c82da,_0x2e7d33=await withSpinner(_0x23762d(0x1a5)+_0x4ac4f4+_0x23762d(0x142),()=>_0x4b12fd[_0x23762d(0x188)][_0x23762d(0x173)](_0x4ac4f4),{'verbose':_0x554090['verbose']});_0x255241=_0x2e7d33['data'],_0x149cb6=_0x4f4498;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23762d(0x19f)+_0x11676f,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x255241=await getProjectIdOrDefault(_0x495aa2),_0x149cb6=_0x11676f;const _0x588a50=await withSpinner(_0x23762d(0x156)+_0x149cb6+_0x23762d(0x142),()=>_0x4b12fd[_0x23762d(0x188)]['createAgent']({'name':_0x149cb6,'projectId':_0x255241,'modelType':_0xbfdc50,'systemPrompt':_0x8bd811,'starterMessage':_0x255596,'maxToolIterations':_0x4eedb2,'temperature':_0x342eac}),{'verbose':_0x554090['verbose']});return console[_0x23762d(0x1ab)](_0x23762d(0x16d)+_0x588a50[_0x23762d(0x196)]['id']),await handleSDKOutput([_0x588a50[_0x23762d(0x196)]],_0x554090),0x0;}catch(_0x442377){return handleSDKError(_0x442377,_0x554090),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x108);['description']=a27_0x4b2c03(0x15a);async[a27_0x4b2c03(0x1aa)](_0x3293fb){const _0xb402ca=a27_0x4b2c03,{options:_0x46d7bc,args:_0x362d7c,tdx:_0x2959a1}=_0x3293fb;if(_0x362d7c[_0xb402ca(0x12d)]===0x0)return console[_0xb402ca(0x166)](_0xb402ca(0x120)),console[_0xb402ca(0x166)](_0xb402ca(0x158)),0x1;const _0x4cc6b5=_0x362d7c[0x0],_0x5142eb=_0x46d7bc,_0x3ea985=_0x5142eb[_0xb402ca(0xd9)],_0x25d8a8=_0x5142eb[_0xb402ca(0x11c)],_0x354660=_0x5142eb[_0xb402ca(0x140)],_0x2f67c8=_0x5142eb['starterMessage'];if(!_0x3ea985&&!_0x25d8a8&&!_0x354660&&!_0x2f67c8)return console[_0xb402ca(0x166)]('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console[_0xb402ca(0x166)](_0xb402ca(0x12a)),0x1;try{const _0x235622=await getProjectIdOrDefault(_0x3293fb),_0xcf96c2=await withSpinner(_0xb402ca(0x194)+_0x4cc6b5+_0xb402ca(0x142),()=>_0x2959a1['llm']['resolveAgentId'](_0x4cc6b5,_0x235622),{'verbose':_0x46d7bc[_0xb402ca(0xf3)]}),_0xf7edee=_0xcf96c2['data'],_0x510f6c=await withSpinner('Updating\x20agent...',()=>_0x2959a1[_0xb402ca(0x188)]['updateAgent'](_0xf7edee,{'name':_0x3ea985,'prompt':_0x25d8a8,'description':_0x354660,'starterMessage':_0x2f67c8}),{'verbose':_0x46d7bc[_0xb402ca(0xf3)]});return console[_0xb402ca(0x1ab)](_0xb402ca(0xf4)+_0x510f6c[_0xb402ca(0x196)]['id']),await handleSDKOutput([_0x510f6c['data']],_0x46d7bc),0x0;}catch(_0x44912e){return handleSDKError(_0x44912e,_0x46d7bc),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x1a0);[a27_0x4b2c03(0x140)]=a27_0x4b2c03(0x110);async['execute'](_0x217996){const _0x1a1213=a27_0x4b2c03,{options:_0x3956ea,args:_0x346348,tdx:_0x165c58}=_0x217996;if(_0x346348['length']===0x0)return console[_0x1a1213(0x166)](_0x1a1213(0x120)),console[_0x1a1213(0x166)](_0x1a1213(0xeb)),0x1;const _0x5f045e=_0x346348[0x0];try{const _0x5c251d=await getProjectIdOrDefault(_0x217996),_0x59c870=await withSpinner('Resolving\x20agent\x20\x27'+_0x5f045e+_0x1a1213(0x142),()=>_0x165c58[_0x1a1213(0x188)][_0x1a1213(0xf8)](_0x5f045e,_0x5c251d),{'verbose':_0x3956ea[_0x1a1213(0xf3)]}),_0x1c1c96=_0x59c870[_0x1a1213(0x196)];return await withSpinner(_0x1a1213(0x138),()=>_0x165c58['llm'][_0x1a1213(0x134)](_0x1c1c96),{'verbose':_0x3956ea[_0x1a1213(0xf3)]}),console['log'](_0x1a1213(0xec)+_0x1c1c96),0x0;}catch(_0x480f62){return handleSDKError(_0x480f62,_0x3956ea),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]='llm:history';['description']=a27_0x4b2c03(0x155);async[a27_0x4b2c03(0x1aa)](_0x33165e){const _0x207b28=a27_0x4b2c03;return executeChatHistoryCommand(_0x33165e,_0x207b28(0x148));}}export class LLMUseCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x1a9);['description']=a27_0x4b2c03(0x11f);async['execute'](_0x4de96a){const _0x56b7bc=a27_0x4b2c03,{options:_0x4ef661,args:_0x20116c,tdx:_0x165526}=_0x4de96a;if(_0x20116c['length']===0x0)return console[_0x56b7bc(0x166)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x56b7bc(0x166)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x12c9ba=_0x20116c[0x0];try{return await withSpinner(_0x56b7bc(0xe2)+_0x12c9ba+_0x56b7bc(0x142),()=>_0x165526[_0x56b7bc(0x188)][_0x56b7bc(0x125)](_0x12c9ba),{'verbose':_0x4ef661['verbose']}),console['log']('Project\x20context\x20set\x20to:\x20'+_0x12c9ba),0x0;}catch(_0x3b9133){return handleSDKError(_0x3b9133,_0x4ef661),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']='llm:project:create';[a27_0x4b2c03(0x140)]=a27_0x4b2c03(0x199);async[a27_0x4b2c03(0x1aa)](_0x2726af){const _0x2fcdb6=a27_0x4b2c03,{options:_0x2ae5d0,args:_0x10c156,tdx:_0x180c63}=_0x2726af;if(_0x10c156[_0x2fcdb6(0x12d)]===0x0)return console[_0x2fcdb6(0x166)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x2fcdb6(0x166)](_0x2fcdb6(0x118)),0x1;const _0x46ae76=_0x10c156[0x0],_0x39bf33=_0x2ae5d0,_0x4b0a89=_0x39bf33[_0x2fcdb6(0x140)];try{const _0x186ce6=await withSpinner(_0x2fcdb6(0x128)+_0x46ae76+_0x2fcdb6(0x142),()=>_0x180c63[_0x2fcdb6(0x188)][_0x2fcdb6(0x1a2)]({'name':_0x46ae76,'description':_0x4b0a89}),{'verbose':_0x2ae5d0[_0x2fcdb6(0xf3)]});console[_0x2fcdb6(0x1ab)](_0x2fcdb6(0x123)+_0x186ce6[_0x2fcdb6(0x196)]['id']);const _0x15a5b8=toLLMProjectInfo(_0x186ce6[_0x2fcdb6(0x196)]);return await handleSDKOutput([_0x15a5b8],_0x2ae5d0),0x0;}catch(_0xd00233){return handleSDKError(_0xd00233,_0x2ae5d0),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0xfe);[a27_0x4b2c03(0x140)]='Delete\x20an\x20LLM\x20project';async['execute'](_0x29cc64){const _0x186010=a27_0x4b2c03,{options:_0x256c38,args:_0x22d238,tdx:_0x4f3478}=_0x29cc64;if(_0x22d238[_0x186010(0x12d)]===0x0)return console[_0x186010(0x166)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x186010(0x166)](_0x186010(0x179)),0x1;const _0xe9b8ec=_0x22d238[0x0];try{return await withSpinner(_0x186010(0x126)+_0xe9b8ec+'\x27...',()=>_0x4f3478[_0x186010(0x188)][_0x186010(0xdb)](_0xe9b8ec),{'verbose':_0x256c38['verbose']}),console[_0x186010(0x1ab)]('Project\x20deleted:\x20'+_0xe9b8ec),0x0;}catch(_0x19e6c3){return handleSDKError(_0x19e6c3,_0x256c38),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0x17a);['description']='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)';async[a27_0x4b2c03(0x1aa)](_0x1b76ee){const _0x25a206=a27_0x4b2c03,{options:_0x39baab,args:_0x3255d7,tdx:_0xcd45c0}=_0x1b76ee,_0x8cc44c=getChalk(_0x39baab);console[_0x25a206(0x1ab)](_0x8cc44c[_0x25a206(0x190)](_0x25a206(0x121))),console[_0x25a206(0x1ab)](_0x8cc44c['yellow']('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x25a206(0x1ab)](_0x8cc44c[_0x25a206(0x162)](_0x25a206(0xdf))),console[_0x25a206(0x1ab)]();if(_0x3255d7[_0x25a206(0x12d)]===0x0)return console[_0x25a206(0x166)](_0x25a206(0x18a)),console[_0x25a206(0x166)](_0x25a206(0x17c)),0x1;const _0xe4571e=_0x3255d7[0x0],_0x28858d=_0x39baab,_0x186447=_0x28858d['output'],_0x7fbe6b=_0x28858d[_0x25a206(0x1a7)];try{const _0x536a17=_0x186447||_0xe4571e+_0x25a206(0x102);if(a27_0x4e5417[_0x25a206(0x103)](_0x536a17)&&!_0x7fbe6b){if(!_0x39baab['yes']){const _0x26b4bf=await confirm(_0x25a206(0x149)+_0x536a17+_0x25a206(0x104));if(!_0x26b4bf)return console[_0x25a206(0x1ab)](_0x25a206(0x115)),0x0;}a27_0x4e5417[_0x25a206(0x12f)](_0x536a17,{'recursive':!![]});}const _0x24d3dc=await withSpinner(_0x7fbe6b?_0x25a206(0x19e)+_0xe4571e+_0x25a206(0x142):_0x25a206(0xfc)+_0xe4571e+_0x25a206(0x142),()=>_0xcd45c0['llm'][_0x25a206(0x17b)](_0xe4571e,_0x186447,{'dryRun':_0x7fbe6b}),{'verbose':_0x39baab['verbose']}),_0x1d29a3=_0x24d3dc[_0x25a206(0x196)];return _0x7fbe6b?console[_0x25a206(0x1ab)]('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0x1d29a3['outputDir']):console['log'](_0x25a206(0x13a)+_0x1d29a3[_0x25a206(0xf0)]),console[_0x25a206(0x1ab)](_0x25a206(0x1ae)+_0x1d29a3[_0x25a206(0x151)]['agents']),console['log'](_0x25a206(0xf7)+_0x1d29a3[_0x25a206(0x151)][_0x25a206(0x182)]),console[_0x25a206(0x1ab)](_0x25a206(0x187)+_0x1d29a3[_0x25a206(0x151)][_0x25a206(0x11b)]),console[_0x25a206(0x1ab)](_0x25a206(0x109)+_0x1d29a3['counts'][_0x25a206(0x112)]),(_0x39baab[_0x25a206(0x177)]==='json'||_0x39baab['format']===_0x25a206(0x129))&&await handleSDKOutput([_0x1d29a3],_0x39baab),0x0;}catch(_0x1371ce){return handleSDKError(_0x1371ce,_0x39baab),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]='llm:project:restore';[a27_0x4b2c03(0x140)]=a27_0x4b2c03(0x157);async[a27_0x4b2c03(0x1aa)](_0x5441da){const _0x4b1702=a27_0x4b2c03,{options:_0x201b97,args:_0x28e8e2,tdx:_0x5992cb}=_0x5441da,_0x397f32=getChalk(_0x201b97);console[_0x4b1702(0x1ab)](_0x397f32[_0x4b1702(0x190)](_0x4b1702(0x18c))),console[_0x4b1702(0x1ab)](_0x397f32[_0x4b1702(0x190)]('\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.')),console[_0x4b1702(0x1ab)](_0x397f32[_0x4b1702(0x162)](_0x4b1702(0x119))),console[_0x4b1702(0x1ab)](_0x397f32[_0x4b1702(0x162)](_0x4b1702(0x163))),console[_0x4b1702(0x1ab)](_0x397f32[_0x4b1702(0x162)](_0x4b1702(0x10a))),console[_0x4b1702(0x1ab)]();if(_0x28e8e2[_0x4b1702(0x12d)]===0x0)return console[_0x4b1702(0x166)](_0x4b1702(0x16e)),console['error']('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x3c60a9=_0x28e8e2[0x0],_0x35616a=_0x201b97,_0x580f45=_0x35616a[_0x4b1702(0xd9)],_0x331af3=_0x35616a[_0x4b1702(0x1a7)];try{if(!_0x331af3){const _0x5a42bb=_0x5992cb[_0x4b1702(0x188)][_0x4b1702(0x131)](_0x3c60a9),_0x3dabed=_0x580f45||_0x5a42bb[_0x4b1702(0xe9)][_0x4b1702(0x14e)],_0x5790b2=await withSpinner(_0x4b1702(0x12e),()=>_0x5992cb['llm']['projects'](),{'verbose':_0x201b97[_0x4b1702(0xf3)]}),_0x304028=_0x5790b2[_0x4b1702(0x196)]['find'](_0x4aa0f5=>_0x4aa0f5[_0x4b1702(0x13f)][_0x4b1702(0xd9)]===_0x3dabed);if(_0x304028&&!_0x201b97[_0x4b1702(0x10b)]){const _0x7a8d1c=await confirm(_0x4b1702(0x133)+_0x3dabed+_0x4b1702(0x15d));if(!_0x7a8d1c)return console[_0x4b1702(0x1ab)]('Restore\x20cancelled.'),0x0;}}const _0x1c20d7=await withSpinner(_0x331af3?_0x4b1702(0x11e)+_0x3c60a9+_0x4b1702(0x142):_0x4b1702(0x181)+_0x3c60a9+_0x4b1702(0x142),()=>_0x5992cb['llm'][_0x4b1702(0x1a6)](_0x3c60a9,{'name':_0x580f45,'dryRun':_0x331af3}),{'verbose':_0x201b97[_0x4b1702(0xf3)]}),_0x1b5075=_0x1c20d7['data'];return _0x1b5075[_0x4b1702(0x147)]&&console['log'](_0x4b1702(0xdc)+_0x1b5075[_0x4b1702(0x147)]+'\x27'),_0x331af3?console[_0x4b1702(0x1ab)](_0x4b1702(0x14d)+_0x1b5075[_0x4b1702(0x14e)]):console[_0x4b1702(0x1ab)](_0x4b1702(0x15f)+_0x1b5075[_0x4b1702(0x14e)]+'\x20('+_0x1b5075[_0x4b1702(0x105)]+')'),console[_0x4b1702(0x1ab)](_0x4b1702(0x1ae)+_0x1b5075[_0x4b1702(0x151)][_0x4b1702(0xf1)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x1b5075[_0x4b1702(0x151)][_0x4b1702(0x182)]),console[_0x4b1702(0x1ab)]('\x20\x20Prompts:\x20'+_0x1b5075[_0x4b1702(0x151)]['prompts']),console[_0x4b1702(0x1ab)](_0x4b1702(0x109)+_0x1b5075[_0x4b1702(0x151)]['integrations']),(_0x201b97['format']===_0x4b1702(0x14a)||_0x201b97[_0x4b1702(0x177)]===_0x4b1702(0x129))&&await handleSDKOutput([_0x1b5075],_0x201b97),0x0;}catch(_0x5b10a8){return handleSDKError(_0x5b10a8,_0x201b97),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x33b240,_0x3f2cdf){const _0x2a736f=a27_0x4b2c03,_0x51f9d7=_0x3f2cdf['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0x103c66=0x0,_0x1a6d8e=[];const _0x12ca0d=(await import(_0x2a736f(0x11b)))[_0x2a736f(0x1af)],_0x325e8=getChalk(_0x3f2cdf);while(!![]){const _0x17f0de=await withSpinner(_0x2a736f(0x10f),()=>_0x33b240['llm'][_0x2a736f(0xe4)](_0x51f9d7+_0x103c66),{'verbose':_0x3f2cdf[_0x2a736f(0xf3)]});_0x1a6d8e=_0x17f0de['data'];const _0x7d9423=_0x1a6d8e[_0x2a736f(0xe0)](_0x103c66,_0x103c66+_0x51f9d7),_0x474850=_0x1a6d8e[_0x2a736f(0x12d)]>_0x103c66+_0x51f9d7,_0x5eaa79=[...new Set(_0x7d9423[_0x2a736f(0x185)](_0x29823f=>_0x29823f[_0x2a736f(0x13f)]['agentId'])[_0x2a736f(0x161)](_0xeee15b=>_0xeee15b!==undefined))],_0x18bb1c=new Map();await Promise[_0x2a736f(0xf6)](_0x5eaa79['map'](async _0x113a3b=>{const _0x16260a=_0x2a736f;try{const _0x39fcd5=await _0x33b240[_0x16260a(0x188)][_0x16260a(0x1b0)](_0x113a3b);_0x18bb1c[_0x16260a(0x19a)](_0x113a3b,_0x39fcd5[_0x16260a(0x13f)][_0x16260a(0xd9)]);}catch{_0x18bb1c['set'](_0x113a3b,_0x113a3b);}}));const _0x32043e=_0x7d9423['map'](_0x1fafe7=>{const _0x54fa36=_0x2a736f,_0x3a98b1=_0x1fafe7[_0x54fa36(0x13f)][_0x54fa36(0xda)]||_0x54fa36(0x18b),_0x479b61=_0x3a98b1[_0x54fa36(0x18e)]('\x0a')[0x0],_0x2dcc27=_0x479b61['length']>0x50?_0x479b61[_0x54fa36(0x19d)](0x0,0x4d)+_0x54fa36(0xf5):_0x479b61,_0x540edb=_0x1fafe7['attributes'][_0x54fa36(0x178)]?_0x18bb1c['get'](_0x1fafe7[_0x54fa36(0x13f)]['agentId'])||_0x1fafe7[_0x54fa36(0x13f)]['agentId']:'(no\x20agent)',_0x18ac4d=_0x1fafe7['attributes'][_0x54fa36(0x16b)]||_0x1fafe7[_0x54fa36(0x13f)][_0x54fa36(0xe6)],_0x3ea9c8=new Date(_0x18ac4d),_0x101dc2=new Date(),_0x171c05=_0x101dc2[_0x54fa36(0x100)]()-_0x3ea9c8[_0x54fa36(0x100)](),_0x1a72e8=Math['floor'](_0x171c05/0xea60),_0x2ced3c=Math[_0x54fa36(0x17e)](_0x171c05/0x36ee80),_0x4b04aa=Math['floor'](_0x171c05/0x5265c00);let _0x2e0bf5;if(_0x1a72e8<0x1)_0x2e0bf5=_0x54fa36(0x135);else{if(_0x1a72e8<0x3c)_0x2e0bf5=_0x1a72e8+_0x54fa36(0x11d);else{if(_0x2ced3c<0x18)_0x2e0bf5=_0x2ced3c+'h\x20ago';else _0x4b04aa<0x7?_0x2e0bf5=_0x4b04aa+'d\x20ago':_0x2e0bf5=_0x3ea9c8['toLocaleDateString'](_0x54fa36(0xf9),{'month':'short','day':'numeric'});}}return{'title':_0x2dcc27+'\x20'+_0x325e8[_0x54fa36(0x162)]('['+_0x540edb+']\x20'+_0x2e0bf5),'value':_0x1fafe7['id']};});_0x474850&&_0x32043e[_0x2a736f(0x193)]({'title':_0x325e8[_0x2a736f(0x168)]('Load\x20more...'),'value':'__load_more__'});const _0x54b16b=await _0x12ca0d({'type':'select','name':_0x2a736f(0x160),'message':_0x2a736f(0x17f),'choices':_0x32043e,'hint':_0x2a736f(0x16a)});if(!_0x54b16b[_0x2a736f(0x160)])return undefined;if(_0x54b16b[_0x2a736f(0x160)]===_0x2a736f(0x13e)){_0x103c66+=_0x51f9d7;continue;}return _0x54b16b['chatId'];}}export class ChatsCommand extends BaseCommand{[a27_0x4b2c03(0xd9)]=a27_0x4b2c03(0xe4);[a27_0x4b2c03(0x140)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a27_0x4b2c03(0x1aa)](_0x12fc92){const _0x5506fe=a27_0x4b2c03;return executeChatHistoryCommand(_0x12fc92,_0x5506fe(0x116));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2e3f1b=a28_0x36a3;(function(_0x20655a,_0x5f1064){const _0x482291=a28_0x36a3,_0x3f18a2=_0x20655a();while(!![]){try{const _0x5d2a8d=parseInt(_0x482291(0xb7))/0x1+parseInt(_0x482291(0xe9))/0x2+parseInt(_0x482291(0xc3))/0x3*(-parseInt(_0x482291(0xda))/0x4)+-parseInt(_0x482291(0xea))/0x5+-parseInt(_0x482291(0xd4))/0x6*(-parseInt(_0x482291(0xc5))/0x7)+-parseInt(_0x482291(0xbb))/0x8*(-parseInt(_0x482291(0xcb))/0x9)+-parseInt(_0x482291(0xd9))/0xa*(-parseInt(_0x482291(0xb2))/0xb);if(_0x5d2a8d===_0x5f1064)break;else _0x3f18a2['push'](_0x3f18a2['shift']());}catch(_0x34dd07){_0x3f18a2['push'](_0x3f18a2['shift']());}}}(a28_0x27a7,0x4073b));import a28_0x58dfa3 from'chalk';function a28_0x36a3(_0x4a4afc,_0x1ebb21){_0x4a4afc=_0x4a4afc-0xb2;const _0x27a735=a28_0x27a7();let _0x36a35a=_0x27a735[_0x4a4afc];return _0x36a35a;}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(_0x10db98,_0x1f35ac){const _0x455ba1=a28_0x36a3,{tdx:_0x538338,options:_0x5c8233}=_0x10db98,_0x534e4c=_0x1f35ac||_0x5c8233[_0x455ba1(0xd3)];if(_0x534e4c){const _0x1665f3=await _0x538338[_0x455ba1(0xdf)][_0x455ba1(0xc0)](),_0x44a92b=_0x1665f3[_0x455ba1(0xc8)](_0x5426ee=>_0x5426ee['attributes'][_0x455ba1(0xcc)]===_0x534e4c);if(!_0x44a92b)throw new SDKError(ErrorCode['NOT_FOUND'],_0x455ba1(0xbc)+_0x534e4c+_0x455ba1(0xd7),undefined,{'helpText':_0x455ba1(0xc2)});return _0x44a92b['id'];}const _0x3c0c5f=await _0x538338[_0x455ba1(0xdf)][_0x455ba1(0xd8)]();return _0x3c0c5f['id'];}function a28_0x27a7(){const _0x1fd95f=['white','21HVzPkb','created\x20on-demand\x20per\x20model','server','find','Resolving\x20project...','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','1180782LsreuY','name','close','llm:proxy','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20is\x20unavailable,\x20using\x20port\x20','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20\x20\x20\x22env\x22:\x20{','llmProject','74838hoxQpC','SIGINT','cyan','\x27\x20not\x20found','getOrCreateDefaultProject','13190FmTNxr','164XlLvLA','site','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x20\x20\x20\x20}','llm','\x0aClaude\x20Code\x20Configuration:','\x20\x20Address:','log','attributes','http://0.0.0.0:','project','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','dim','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','265560yzXorj','1085805zhoWtT','exit','Starting\x20proxy\x20server...','execute','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','1078ssRwOw','\x0aTesting\x20with\x20Agent\x20SDK:','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20Agents:','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','433398oEoWuh','stop','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','bold','16axXOEv','Project\x20\x27','Server\x20Configuration:','\x20\x20Project:','logger','projects','yellow','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','37617lioZMN'];a28_0x27a7=function(){return _0x1fd95f;};return a28_0x27a7();}export class LLMProxyCommand extends BaseCommand{['name']=a28_0x2e3f1b(0xce);['description']=a28_0x2e3f1b(0xd1);[a28_0x2e3f1b(0xc7)];[a28_0x2e3f1b(0xbf)];async[a28_0x2e3f1b(0xed)](_0x4af7f4){const _0x499d61=a28_0x2e3f1b,{tdx:_0x2e700,options:_0x326816}=_0x4af7f4;try{const _0x5d04d5=_0x326816,_0x508f7e=_0x5d04d5['port']||0xfa0,_0x5dc95f=_0x5d04d5[_0x499d61(0xe5)],_0x473154=await findAvailablePort(_0x508f7e);console[_0x499d61(0xe2)](a28_0x58dfa3['dim'](_0x499d61(0xc9)));const _0x344331=await getProjectIdOrDefault(_0x4af7f4,_0x5dc95f),_0x523fda=await _0x2e700['llm'][_0x499d61(0xc0)](),_0x28e257=_0x523fda[_0x499d61(0xc8)](_0x34d2ea=>_0x34d2ea['id']===_0x344331);this['logger']=new TDXLogger(_0x326816['logLevel']),await this[_0x499d61(0xbf)]['init'](),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xec)));_0x473154!==_0x508f7e&&console['log'](a28_0x58dfa3[_0x499d61(0xc1)]('Port\x20'+_0x508f7e+_0x499d61(0xd0)+_0x473154));this['server']=new ProxyServer({'port':_0x473154,'projectId':_0x344331,'tdx':_0x2e700,'logger':this[_0x499d61(0xbf)],'site':_0x326816[_0x499d61(0xdb)]}),await this['server']['start'](),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc1)][_0x499d61(0xba)](_0x499d61(0xe6))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc1)](_0x499d61(0xdc))),console[_0x499d61(0xe2)](a28_0x58dfa3['yellow'](_0x499d61(0xdd))),console[_0x499d61(0xe2)](a28_0x58dfa3['green']['bold'](_0x499d61(0xee))),console[_0x499d61(0xe2)](a28_0x58dfa3['cyan'](_0x499d61(0xbd))),console['log'](a28_0x58dfa3['dim'](_0x499d61(0xe1)),a28_0x58dfa3[_0x499d61(0xc4)](_0x499d61(0xe4)+_0x473154)),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xbe)),a28_0x58dfa3['white'](_0x28e257?.[_0x499d61(0xe3)][_0x499d61(0xcc)]||_0x344331)),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xb5)),a28_0x58dfa3['white'](_0x499d61(0xc6))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)]('\x20\x20Site:'),a28_0x58dfa3['white'](_0x326816[_0x499d61(0xdb)])),console[_0x499d61(0xe2)](a28_0x58dfa3['cyan'](_0x499d61(0xe0))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xe8))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc4)]('\x20\x20{')),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc4)](_0x499d61(0xd2))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc4)](_0x499d61(0xb9)+_0x473154+'\x22,')),console[_0x499d61(0xe2)](a28_0x58dfa3['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,')),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc4)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22')),console[_0x499d61(0xe2)](a28_0x58dfa3['white'](_0x499d61(0xde))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xc4)]('\x20\x20}')),console['log'](a28_0x58dfa3[_0x499d61(0xd6)](_0x499d61(0xb3))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xca))),console[_0x499d61(0xe2)](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xb6))),console['log'](a28_0x58dfa3[_0x499d61(0xe7)](_0x499d61(0xb4))),console[_0x499d61(0xe2)](a28_0x58dfa3['yellow']('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x349cd9=async()=>{const _0x106955=_0x499d61;console[_0x106955(0xe2)](a28_0x58dfa3[_0x106955(0xe7)](_0x106955(0xcf))),this[_0x106955(0xc7)]&&await this[_0x106955(0xc7)][_0x106955(0xb8)](),this[_0x106955(0xbf)]&&await this['logger']['close'](),console[_0x106955(0xe2)](a28_0x58dfa3['green']('✓\x20Proxy\x20server\x20stopped')),process[_0x106955(0xeb)](0x0);};return process['on'](_0x499d61(0xd5),_0x349cd9),process['on']('SIGTERM',_0x349cd9),await new Promise(()=>{}),0x0;}catch(_0x4eca1a){this['server']&&await this[_0x499d61(0xc7)][_0x499d61(0xb8)]();this[_0x499d61(0xbf)]&&await this[_0x499d61(0xbf)][_0x499d61(0xcd)]();throw _0x4eca1a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x1bdc06=a29_0x2a31;(function(_0x4e8968,_0x32c464){const _0x507347=a29_0x2a31,_0x64a617=_0x4e8968();while(!![]){try{const _0xcc0486=-parseInt(_0x507347(0x1ab))/0x1*(parseInt(_0x507347(0x1e9))/0x2)+-parseInt(_0x507347(0x213))/0x3+-parseInt(_0x507347(0x22c))/0x4*(-parseInt(_0x507347(0x214))/0x5)+parseInt(_0x507347(0x25f))/0x6+-parseInt(_0x507347(0x2a1))/0x7+parseInt(_0x507347(0x1e5))/0x8*(parseInt(_0x507347(0x2a7))/0x9)+-parseInt(_0x507347(0x2b7))/0xa*(parseInt(_0x507347(0x1ad))/0xb);if(_0xcc0486===_0x32c464)break;else _0x64a617['push'](_0x64a617['shift']());}catch(_0x51779a){_0x64a617['push'](_0x64a617['shift']());}}}(a29_0x52bc,0xcfdc9));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0x583eca from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x2d2d64 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a29_0x1bdc06(0x1fe);function openBrowser(_0x5011b7){const _0x5c1777=a29_0x1bdc06,_0x33bc38=process['platform'],_0x18252e=_0x33bc38===_0x5c1777(0x1db)?_0x5c1777(0x1fd):_0x33bc38===_0x5c1777(0x2c3)?_0x5c1777(0x22b):_0x5c1777(0x1d6);spawn(_0x18252e,[_0x5011b7],{'detached':!![],'stdio':_0x5c1777(0x24b)})[_0x5c1777(0x2ae)]();}function migrateLegacyDirectory(){const _0x234f80=a29_0x1bdc06;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x21cf97=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x21cf97[_0x234f80(0x1aa)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a29_0x2d2d64[_0x234f80(0x251)](_0x234f80(0x1d5)+LEGACY_PARENT_SEGMENT_DIR+_0x234f80(0x1f0)+PARENT_SEGMENT_DIR+_0x234f80(0x25b))),console[_0x234f80(0x292)](a29_0x2d2d64['dim'](_0x234f80(0x21b)+LEGACY_PARENT_SEGMENT_DIR+_0x234f80(0x1d1))),![];console[_0x234f80(0x292)](a29_0x2d2d64['yellow']('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x2d2d64[_0x234f80(0x1b5)](_0x234f80(0x1b6)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x563977){const _0x5d94f9=_0x563977 instanceof Error?_0x563977[_0x234f80(0x1e0)]:String(_0x563977);return console[_0x234f80(0x292)](a29_0x2d2d64[_0x234f80(0x29b)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x5d94f9+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x1bdc06(0x20f)](_0xde9639){return migrateLegacyDirectory(),super['run'](_0xde9639);}}function resolveYamlFile(_0x322cdd){const _0xa6acb7=a29_0x1bdc06;if(_0x322cdd[_0xa6acb7(0x1bd)](_0xa6acb7(0x29c))||_0x322cdd[_0xa6acb7(0x1bd)](_0xa6acb7(0x272)))return _0x322cdd;return a29_0x583eca[_0xa6acb7(0x237)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x322cdd)+_0xa6acb7(0x29c));}function formatProgressMessage(_0x4ab595){const _0x2a22c3=a29_0x1bdc06,_0x249b91=_0x4ab595['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x249b91){const [,_0x13a33e,_0xe3e906,_0x1217c5='']=_0x249b91;return a29_0x2d2d64['dim'](_0x13a33e+':')+'\x20'+_0xe3e906+a29_0x2d2d64[_0x2a22c3(0x2a2)](_0x1217c5);}return a29_0x2d2d64[_0x2a22c3(0x2a2)](_0x4ab595);}function a29_0x52bc(){const _0x27b9da=['isDirectory','526514TYYGeF','elapsedTimeMillis','396979QacvSD','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','yes','\x20Configuration\x20is\x20valid','format','updateParent','green','✔\x20Renamed\x20directory\x20to\x20','all','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','foreignKey','segment','map','endsWith','pushParentYaml','Coverage:','FINISHED','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','segment:parent:create','segment:parent:preview','\x20No\x20changes\x20-\x20','Fetching\x20SQL\x20for\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','replace','addBehaviors','sampleData','scheduleType','behavior','\x20is\x20already\x20up\x20to\x20date','Fetching\x20parent\x20segment\x20\x27','length','Updating','information_schema','/\x20directory.\x0a','attributesFile','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','column','\x0a⚠️\x20\x20Both\x20','xdg-open','✔\x20Found\x20','log','Errors:','\x20Opening\x20','darwin','matchedCount','name','`\x20to\x20download\x20the\x20configuration\x20first','\x20--behavior\x20\x22<name>\x22','message','\x0aChanges\x20to\x20apply\x20to\x20\x27','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','repeat','cyan','8qyMkMW','toLocaleString','\x20parent\x20segment\x20\x27','Attempt:','2DfnUzn','Rows:','schemaValid','✔\x20Created\x20parent\x20segment\x20\x27','SQL\x20query:\x0a','customerGroup','Overwrite\x20\x27','/\x20and\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','text','label','\x20--behavior\x20\x22','\x20--enriched','\x0aChanges\x20to\x20\x27','Master\x20Table','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','resolveParentId','totalEvents','description','open','parent_segment','Error:\x20File\x20not\x20found:\x20','toFixed','audienceId','rowCount','Creating','addBehaviorsFile','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','Customers:','Validating\x20configuration...','jobId','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','segment:parent:list','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','run','\x20rows)','Updating\x20parent\x20segment\x20\x27','To\x20view\x20sample\x20data:','1248816MrRzeD','20GTqAOl','database','verbose','Name:\x20','\x27...','attributes','data','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Creating\x20parent\x20segment\x20\x27','\x20--attribute\x20\x22<name>\x22','\x0aNew\x20parent\x20segment\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','string','stats','/app/dw/parentSegments/','Error\x20reading\x20file:\x20','Pattern:\x20','/attempt/','Error:','Master\x20+\x20Attributes','To\x20cancel:','Error:\x20--behavior\x20requires\x20a\x20name\x0a','start','460436mBpvcO','displayValidateResults','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','utf-8','parentSegment','Error\x20parsing\x20YAML:\x20','getParentSQL','listFields','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Attributes','join','Attribute:','Create\x20parent\x20segment\x20\x27','attribute','apply','Listing\x20parent\x20segments...','displayBehaviorsStats','execute','/{name}.yml\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Events:','\x5c$&','tdx\x20segment\x20parent\x20preview\x20','👥\x20','segment:parent:fields','Available\x20attributes:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','columns','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','ignore','Output\x20file:\x20','segment:parent:validate','coveragePercent','Analyzing\x20changes...','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','yellow','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','displaySampleData','getParentFull','limit','interval','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','sort','json','scheduleOption','/\x20directories\x20exist.','output','\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','9027222byxUJP','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Preview:','Audience\x20ID:','runParent','\x20field','workflowSessionId','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','enriched','Master:','preview','Session:','population','segment:parent:run','double','Site:\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Created','.yaml','Error:\x20--database\x20and\x20--table\x20are\x20required','Fetching\x20sample\x20data...','processedRows','Parent\x20segment:\x20','Resolving\x20parent\x20segment\x20\x27','displayPreviewHints','✔\x20Updated\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','use','segment:parent:sql','Options\x20(one\x20required):\x0a','master','jsonl','Source:','setJobId','segment:parent:update','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Available\x20behaviors:','Error:\x20Parent\x20segment\x20name\x20is\x20required','schemaError','List\x20parent\x20segments','workflowAttemptId','addAttributesFile','\x20tdx\x20wf\x20attempt\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','site','allValid','/sessions/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','error','\x20=\x20','customersWithEvents','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','displayMasterInfo','dirname','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','displayPreviewResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','red','.yml','YAML\x20file:\x20','\x20rows\x20','customerPercent','test','7772639AVoSCf','dim','%)\x20','Options:\x0a','bold','\x20--attribute\x20\x22','12029130atPzmu','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Join:','keys','segment:parent:view','unref','web','-1d','\x0aNo\x20sample\x20data\x20available','Status:','displayAttributesStats','\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--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Executing\x20parent\x20segment\x20query...','110YecGgC','stop','Options:','Aborted.','errors','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Listing\x20fields\x20for\x20\x27','joinKey','previewParentYaml','\x20kill','Table:\x20','Enriched:','win32','segment:parent:pull','displaySummary','timezone','Apply\x20changes\x20to\x20\x27','customerGroupFile','behaviors','table','Behavior:','Behaviors','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Found\x20YAML\x20file:\x20'];a29_0x52bc=function(){return _0x27b9da;};return a29_0x52bc();}function showFileNotFoundError(_0x2b7e9b,_0x1a6d48){const _0x52ce34=a29_0x1bdc06;console[_0x52ce34(0x292)](a29_0x2d2d64['red'](_0x52ce34(0x1ff)+_0x2b7e9b+'\x0a')),console[_0x52ce34(0x292)](a29_0x2d2d64['cyan'](_0x52ce34(0x22e)+_0x1a6d48+_0x52ce34(0x1de)));}function showParentSegmentNotSetError(_0x9e6eaf){const _0x475608=a29_0x1bdc06;console[_0x475608(0x292)](a29_0x2d2d64[_0x475608(0x251)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x475608(0x292)](_0x9e6eaf);}export class ParentSegmentListCommand extends BaseCommand{['name']=a29_0x1bdc06(0x20d);[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x287);async[a29_0x1bdc06(0x23e)](_0x5e6482){const _0x45af32=a29_0x1bdc06,{options:_0x16d6b3,args:_0x4deafd,tdx:_0x590919}=_0x5e6482,_0x177692=_0x4deafd[0x0];_0x16d6b3[_0x45af32(0x216)]&&(console[_0x45af32(0x292)]('Site:\x20'+_0x16d6b3[_0x45af32(0x28c)]),_0x177692&&console[_0x45af32(0x292)](_0x45af32(0x225)+_0x177692));const _0x58d6c5=await withSpinner(_0x177692?_0x45af32(0x26f)+_0x177692+_0x45af32(0x218):_0x45af32(0x23c),()=>_0x590919[_0x45af32(0x1bb)]['listParents'](),{'verbose':_0x16d6b3[_0x45af32(0x216)]});let _0x5f19e1=_0x58d6c5[_0x45af32(0x21a)];if(_0x177692){const _0x4c411e=_0x177692['replace'](/[.+^${}()|[\]\\]/g,_0x45af32(0x242))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x425d46=new RegExp('^'+_0x4c411e+'$','i');_0x5f19e1=_0x5f19e1['filter'](_0x4a13c1=>_0x425d46[_0x45af32(0x2a0)](_0x4a13c1[_0x45af32(0x219)][_0x45af32(0x1dd)]));}_0x5f19e1[_0x45af32(0x258)]((_0x2f12f5,_0x1556a3)=>_0x2f12f5[_0x45af32(0x219)][_0x45af32(0x1dd)]['localeCompare'](_0x1556a3[_0x45af32(0x219)][_0x45af32(0x1dd)])),console[_0x45af32(0x292)](_0x45af32(0x1d7)+_0x5f19e1[_0x45af32(0x1ce)]+'\x20parent\x20segment'+(_0x5f19e1[_0x45af32(0x1ce)]!==0x1?'s':''));if(_0x16d6b3['format']===_0x45af32(0x259)||_0x16d6b3['format']===_0x45af32(0x27f))await handleSDKOutput(_0x5f19e1,_0x16d6b3);else{if(_0x5f19e1['length']===0x0)_0x177692?console[_0x45af32(0x1d8)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x177692):console[_0x45af32(0x1d8)]('No\x20parent\x20segments\x20found');else for(const _0xfa9692 of _0x5f19e1){const _0x28cbc4=_0xfa9692[_0x45af32(0x219)][_0x45af32(0x26b)]?a29_0x2d2d64[_0x45af32(0x2a2)]('\x20('+formatRows(_0xfa9692['attributes'][_0x45af32(0x26b)])+')'):'';console[_0x45af32(0x1d8)](_0x45af32(0x244)+_0xfa9692[_0x45af32(0x219)]['name']+_0x28cbc4);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x1bdc06(0x1dd)]=a29_0x1bdc06(0x1c2);['description']=a29_0x1bdc06(0x1c6);async[a29_0x1bdc06(0x23e)](_0x3aaf9c){const _0x4b42d7=a29_0x1bdc06,{options:_0x338783,args:_0x4c6aaa,tdx:_0x4412ce}=_0x3aaf9c;console[_0x4b42d7(0x292)](_0x4b42d7(0x240)+_0x4b42d7(0x207)+_0x4b42d7(0x1f8));const _0x3c2376=_0x338783;if(_0x4c6aaa[_0x4b42d7(0x1ce)]===0x0)return console[_0x4b42d7(0x292)](a29_0x2d2d64[_0x4b42d7(0x29b)](_0x4b42d7(0x285))),console[_0x4b42d7(0x292)](_0x4b42d7(0x24a)),0x1;const _0x3fb39e=_0x4c6aaa[0x0];if(!_0x3c2376[_0x4b42d7(0x215)]||!_0x3c2376[_0x4b42d7(0x1a5)])return console[_0x4b42d7(0x292)](_0x4b42d7(0x273)),console[_0x4b42d7(0x292)](_0x4b42d7(0x24a)),0x1;_0x3c2376['verbose']&&(console[_0x4b42d7(0x292)](_0x4b42d7(0x26e)+_0x3c2376[_0x4b42d7(0x28c)]),console[_0x4b42d7(0x292)](_0x4b42d7(0x217)+_0x3fb39e),console['error']('Database:\x20'+_0x3c2376[_0x4b42d7(0x215)]),console[_0x4b42d7(0x292)](_0x4b42d7(0x2c1)+_0x3c2376[_0x4b42d7(0x1a5)]));const _0x267976=await loadJSONFromOptions(_0x3c2376[_0x4b42d7(0x219)],_0x3c2376[_0x4b42d7(0x1d2)]),_0x1c3058=await loadJSONFromOptions(_0x3c2376[_0x4b42d7(0x1a4)],_0x3c2376['behaviorsFile']),_0x30f502=await loadJSONFromOptions(_0x3c2376['customerGroup'],_0x3c2376[_0x4b42d7(0x1a3)]),_0x20e324={'name':_0x3fb39e,'description':_0x3c2376['description'],'scheduleType':_0x3c2376['scheduleType'],'scheduleOption':_0x3c2376[_0x4b42d7(0x25a)],'timezone':_0x3c2376['timezone'],'master':{'parentDatabaseName':_0x3c2376['database'],'parentTableName':_0x3c2376['table']},'attributes':_0x267976,'behaviors':_0x1c3058,'customerGroup':_0x30f502},_0x3c4198=await withSpinner(_0x4b42d7(0x21c)+_0x3fb39e+_0x4b42d7(0x218),()=>_0x4412ce[_0x4b42d7(0x1bb)]['createParent'](_0x20e324),{'verbose':_0x338783[_0x4b42d7(0x216)]}),_0x5da1b7=_0x3c4198[_0x4b42d7(0x21a)];return console['error'](_0x4b42d7(0x1ec)+_0x5da1b7[_0x4b42d7(0x1dd)]+'\x27\x20with\x20ID:\x20'+_0x5da1b7['id']),await handleSDKOutput([_0x5da1b7],_0x338783),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x1bdc06(0x1dd)]=a29_0x1bdc06(0x282);[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x266);async['execute'](_0x19d9cf){const _0x4e0cf7=a29_0x1bdc06,{options:_0x37c281,args:_0x1b405f,tdx:_0x1c0d28}=_0x19d9cf;console[_0x4e0cf7(0x292)](_0x4e0cf7(0x260)+_0x4e0cf7(0x207)+_0x4e0cf7(0x1f8));const _0x329e0e=_0x37c281;if(_0x1b405f['length']===0x0)return console[_0x4e0cf7(0x292)](a29_0x2d2d64[_0x4e0cf7(0x29b)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x4e0cf7(0x292)](_0x4e0cf7(0x2a9)),0x1;const _0x6f4d44=_0x1b405f[0x0];_0x329e0e['verbose']&&(console[_0x4e0cf7(0x292)](_0x4e0cf7(0x26e)+_0x329e0e[_0x4e0cf7(0x28c)]),console[_0x4e0cf7(0x292)](_0x4e0cf7(0x276)+_0x6f4d44));const _0x23b4f1=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x6f4d44+_0x4e0cf7(0x218),()=>_0x1c0d28[_0x4e0cf7(0x1bb)][_0x4e0cf7(0x254)](_0x6f4d44),{'verbose':_0x329e0e[_0x4e0cf7(0x216)]}),_0x1a6492=_0x23b4f1['data'],_0x11a2d0=await loadJSONFromOptions(_0x329e0e['addAttributes'],_0x329e0e[_0x4e0cf7(0x289)]),_0x46beae=await loadJSONFromOptions(_0x329e0e[_0x4e0cf7(0x1c8)],_0x329e0e[_0x4e0cf7(0x204)]),_0x3a827b={'name':_0x1a6492['name'],'description':_0x329e0e[_0x4e0cf7(0x1fc)]!==undefined?_0x329e0e[_0x4e0cf7(0x1fc)]:_0x1a6492[_0x4e0cf7(0x1fc)],'scheduleType':_0x329e0e[_0x4e0cf7(0x1ca)]!==undefined?_0x329e0e[_0x4e0cf7(0x1ca)]:_0x1a6492[_0x4e0cf7(0x1ca)],'scheduleOption':_0x329e0e[_0x4e0cf7(0x25a)]!==undefined?_0x329e0e[_0x4e0cf7(0x25a)]:_0x1a6492['scheduleOption'],'timezone':_0x329e0e[_0x4e0cf7(0x2c6)]!==undefined?_0x329e0e[_0x4e0cf7(0x2c6)]:_0x1a6492['timezone'],'master':_0x1a6492[_0x4e0cf7(0x27e)],'attributes':_0x11a2d0?[..._0x1a6492[_0x4e0cf7(0x219)]||[],..._0x11a2d0]:_0x1a6492[_0x4e0cf7(0x219)],'behaviors':_0x46beae?[..._0x1a6492[_0x4e0cf7(0x1a4)]||[],..._0x46beae]:_0x1a6492[_0x4e0cf7(0x1a4)],'customerGroup':_0x1a6492[_0x4e0cf7(0x1ee)]},_0x1533da=await withSpinner(_0x4e0cf7(0x211)+_0x6f4d44+_0x4e0cf7(0x218),()=>_0x1c0d28[_0x4e0cf7(0x1bb)][_0x4e0cf7(0x1b4)](_0x6f4d44,_0x3a827b),{'verbose':_0x329e0e[_0x4e0cf7(0x216)]}),_0x2fdc84=_0x1533da[_0x4e0cf7(0x21a)];return console[_0x4e0cf7(0x292)](_0x4e0cf7(0x279)+_0x2fdc84[_0x4e0cf7(0x1dd)]+'\x27'),await handleSDKOutput([_0x2fdc84],_0x329e0e),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x1bdc06(0x1dd)]=a29_0x1bdc06(0x2c4);[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x298);async[a29_0x1bdc06(0x23e)](_0x21ba0b){const _0x4c1560=a29_0x1bdc06,{options:_0x4e5ffa,args:_0x3a0efc,tdx:_0x15c0d6}=_0x21ba0b,_0x8ca58f=_0x4e5ffa,_0x5bde5e=_0x3a0efc[0x0]||_0x4e5ffa['parentSegment'];if(!_0x5bde5e)return showParentSegmentNotSetError(_0x4c1560(0x250)+_0x4c1560(0x1af)),0x1;if(_0x8ca58f[_0x4c1560(0x27b)]&&_0x8ca58f['output'])return console[_0x4c1560(0x292)](a29_0x2d2d64[_0x4c1560(0x29b)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x4c1560(0x292)](a29_0x2d2d64[_0x4c1560(0x2a2)](_0x4c1560(0x1b0))),console[_0x4c1560(0x292)](a29_0x2d2d64[_0x4c1560(0x2a2)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4c1560(0x23f))),console[_0x4c1560(0x292)](a29_0x2d2d64[_0x4c1560(0x1e4)](_0x4c1560(0x252))),0x1;const _0xa1a564=_0x8ca58f[_0x4c1560(0x25c)]||a29_0x583eca[_0x4c1560(0x237)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5bde5e)+_0x4c1560(0x29c));_0x8ca58f[_0x4c1560(0x216)]&&(console[_0x4c1560(0x292)](_0x4c1560(0x26e)+_0x8ca58f['site']),console[_0x4c1560(0x292)]('Parent\x20segment:\x20'+_0x5bde5e),console[_0x4c1560(0x292)](_0x4c1560(0x24c)+_0xa1a564));const _0x2b7a87=await withSpinner(_0x4c1560(0x1cd)+_0x5bde5e+_0x4c1560(0x218),()=>_0x15c0d6[_0x4c1560(0x1bb)]['pullParentYaml'](_0x5bde5e),{'verbose':_0x8ca58f[_0x4c1560(0x216)]}),_0x27949a=_0x2b7a87[_0x4c1560(0x21a)];if(existsSync(_0xa1a564)){const _0x90ffde=readFileSync(_0xa1a564,_0x4c1560(0x230)),_0x17d71f=generateDiff(_0x90ffde,_0x27949a);if(!hasChanges(_0x17d71f))console[_0x4c1560(0x292)](a29_0x2d2d64[_0x4c1560(0x1b5)]('✔')+_0x4c1560(0x1c4)+a29_0x2d2d64[_0x4c1560(0x1e4)](_0xa1a564)+_0x4c1560(0x1cc));else{console[_0x4c1560(0x292)](_0x4c1560(0x1f6)+_0xa1a564+'\x27:'),console['error']('─'[_0x4c1560(0x1e3)](0x3c)),console['error'](formatDiffWithColors(_0x17d71f)),console[_0x4c1560(0x292)]('─'[_0x4c1560(0x1e3)](0x3c));if(!_0x8ca58f[_0x4c1560(0x1b1)]){const _0x11012b=await confirmKey(_0x4c1560(0x1ef)+_0xa1a564+'\x27?');if(!_0x11012b)return console[_0x4c1560(0x292)](_0x4c1560(0x2ba)),0x1;}writeFileSync(_0xa1a564,_0x27949a,'utf-8'),console['error'](a29_0x2d2d64[_0x4c1560(0x1b5)]('✔')+_0x4c1560(0x257)+a29_0x2d2d64[_0x4c1560(0x1e4)](_0xa1a564));}}else{const _0x25f682=a29_0x583eca[_0x4c1560(0x297)](_0xa1a564);!existsSync(_0x25f682)&&mkdirSync(_0x25f682,{'recursive':!![]}),writeFileSync(_0xa1a564,_0x27949a,_0x4c1560(0x230)),console[_0x4c1560(0x292)](a29_0x2d2d64['green']('✔')+_0x4c1560(0x257)+a29_0x2d2d64[_0x4c1560(0x1e4)](_0xa1a564));}return saveSessionContext({'parent_segment':_0x5bde5e},_0x8ca58f['session']),console[_0x4c1560(0x292)](a29_0x2d2d64[_0x4c1560(0x1b5)]('✔')+_0x4c1560(0x25d)+a29_0x2d2d64[_0x4c1560(0x2a2)](_0x4c1560(0x1fe))+_0x4c1560(0x293)+a29_0x2d2d64['cyan'](_0x5bde5e)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x1bdc06(0x1dd)]='segment:parent:push';[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x20e);async['execute'](_0x36b7fd){const _0x2e5e8b=a29_0x1bdc06,{options:_0x5486f0,args:_0x3ad309,tdx:_0x1c13b7}=_0x36b7fd,_0x2185cc=_0x5486f0,_0xa08233=_0x3ad309[0x0]||_0x5486f0['parentSegment'];if(!_0xa08233)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x2e5e8b(0x1b9)),0x1;const _0x315bc5=resolveYamlFile(_0xa08233);if(!existsSync(_0x315bc5))return showFileNotFoundError(_0x315bc5,_0xa08233),0x1;_0x2185cc[_0x2e5e8b(0x216)]&&(console[_0x2e5e8b(0x292)](_0x2e5e8b(0x26e)+_0x2185cc['site']),console[_0x2e5e8b(0x292)](_0x2e5e8b(0x29d)+_0x315bc5));let _0xbf2528;try{_0xbf2528=readFileSync(_0x315bc5,_0x2e5e8b(0x230));}catch(_0xbce452){const _0x2e161b=_0xbce452 instanceof Error?_0xbce452[_0x2e5e8b(0x1e0)]:String(_0xbce452);return console[_0x2e5e8b(0x292)](_0x2e5e8b(0x224)+_0x2e161b),0x1;}const _0x142148=await withSpinner(_0x2e5e8b(0x24f),()=>_0x1c13b7[_0x2e5e8b(0x1bb)][_0x2e5e8b(0x1be)](_0xbf2528),{'verbose':_0x2185cc[_0x2e5e8b(0x216)]}),_0x5e0f4e=_0x142148[_0x2e5e8b(0x21a)],{isNew:_0x2b899c,name:_0x1ff284,hasChanges:_0x1d21db,diffFormatted:_0x1adeca}=_0x5e0f4e;if(!_0x1d21db)return console[_0x2e5e8b(0x292)](_0x2e5e8b(0x1ae)+_0x1ff284+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x2b899c?console[_0x2e5e8b(0x292)](_0x2e5e8b(0x21e)+_0x1ff284+'\x27:'):console[_0x2e5e8b(0x292)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x1ff284+'\x27:');console[_0x2e5e8b(0x292)]('─'['repeat'](0x3c)),console[_0x2e5e8b(0x292)](_0x1adeca),console['error']('─'[_0x2e5e8b(0x1e3)](0x3c));const _0x2950b7=_0x2b899c?'Create\x20parent\x20segment\x20\x27'+_0x1ff284+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x1ff284+'\x27?';if(!_0x2185cc['yes']){const _0x3206de=await confirmKey(_0x2950b7);if(!_0x3206de)return console[_0x2e5e8b(0x292)](_0x2e5e8b(0x2ba)),0x1;}const _0x5e4bb1=_0x2b899c?_0x2e5e8b(0x203):_0x2e5e8b(0x1cf),_0xbb68f0=await withSpinner(_0x5e4bb1+_0x2e5e8b(0x1e7)+_0x1ff284+_0x2e5e8b(0x218),()=>_0x5e0f4e[_0x2e5e8b(0x23b)](),{'verbose':_0x2185cc[_0x2e5e8b(0x216)]}),_0x5cdf35=_0xbb68f0[_0x2e5e8b(0x21a)],_0x43c123=getConsoleNextUrl(_0x2185cc['site'],'/app/dw/parentSegments/'+_0x5cdf35['id']),_0x4bff13=_0x2b899c?_0x2e5e8b(0x271):'Updated';return console['error']('✔\x20'+_0x4bff13+'\x20parent\x20segment\x20\x27'+_0x5cdf35[_0x2e5e8b(0x1dd)]+'\x27'),console['error']('\x20\x20'+_0x43c123),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a29_0x1bdc06(0x24d);[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x28b);async[a29_0x1bdc06(0x23e)](_0x5fb112){const _0x2dcf10=a29_0x1bdc06,{options:_0x74136e,args:_0x282bc7,tdx:_0x54dd8e}=_0x5fb112,_0x1f0e48=_0x74136e,_0x2dbd0c=_0x282bc7[0x0]||_0x74136e[_0x2dcf10(0x231)];if(!_0x2dbd0c)return showParentSegmentNotSetError(_0x2dcf10(0x1e2)+_0x2dcf10(0x249)+_0x2dcf10(0x2a4)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x2dcf10(0x22f)+_0x2dcf10(0x295)),0x1;const _0x8282a6=resolveYamlFile(_0x2dbd0c);if(!existsSync(_0x8282a6))return showFileNotFoundError(_0x8282a6,_0x2dbd0c),0x1;_0x1f0e48[_0x2dcf10(0x216)]&&(console['error']('Site:\x20'+_0x1f0e48[_0x2dcf10(0x28c)]),console[_0x2dcf10(0x292)](_0x2dcf10(0x29d)+_0x8282a6));let _0x480b3c;try{_0x480b3c=readFileSync(_0x8282a6,_0x2dcf10(0x230));}catch(_0xef198e){const _0x3d31e9=_0xef198e instanceof Error?_0xef198e['message']:String(_0xef198e);return console[_0x2dcf10(0x292)](_0x2dcf10(0x224)+_0x3d31e9),0x1;}const _0x556870=createCommandSpinner(a29_0x2d2d64[_0x2dcf10(0x2a2)](_0x2dcf10(0x20a)),{'verbose':_0x1f0e48[_0x2dcf10(0x216)]});_0x556870[_0x2dcf10(0x22b)]();const _0x51f12f={'onProgress':_0x26eb0e=>{_0x556870['text']=formatProgressMessage(_0x26eb0e);}};if(_0x1f0e48[_0x2dcf10(0x27e)])_0x51f12f[_0x2dcf10(0x27e)]=!![];if(_0x1f0e48[_0x2dcf10(0x267)])_0x51f12f[_0x2dcf10(0x267)]=!![];_0x1f0e48[_0x2dcf10(0x23a)]&&(_0x51f12f[_0x2dcf10(0x23a)]=_0x1f0e48[_0x2dcf10(0x23a)]);_0x1f0e48[_0x2dcf10(0x1cb)]&&(_0x51f12f[_0x2dcf10(0x1cb)]=_0x1f0e48[_0x2dcf10(0x1cb)]);if(_0x1f0e48['interval'])_0x51f12f[_0x2dcf10(0x256)]=_0x1f0e48['interval'];let _0x28a144;try{_0x28a144=await _0x54dd8e[_0x2dcf10(0x1bb)]['validateParentYaml'](_0x480b3c,_0x51f12f),_0x556870['stop']();}catch(_0x5a9861){_0x556870['stop']();throw _0x5a9861;}const _0x1a89c8=_0x1f0e48[_0x2dcf10(0x256)]||'-1d';return this[_0x2dcf10(0x22d)](_0x28a144,_0x51f12f,_0x8282a6,_0x1a89c8),_0x28a144['allValid']?0x0:0x1;}[a29_0x1bdc06(0x22d)](_0x527932,_0x56be13,_0xe463ba,_0x407fc9){const _0x40468f=a29_0x1bdc06;console[_0x40468f(0x292)]('\x0a'+a29_0x2d2d64[_0x40468f(0x2a5)]('Validate:')+'\x20'+_0x527932[_0x40468f(0x1dd)]),console[_0x40468f(0x292)]('═'[_0x40468f(0x1e3)](0x3c)),this[_0x40468f(0x296)](_0x527932);if(typeof _0x56be13[_0x40468f(0x23a)]===_0x40468f(0x221)){this['displayAttributesStats'](_0x527932),this[_0x40468f(0x2c5)](_0x527932),this[_0x40468f(0x278)](_0xe463ba,_0x407fc9,_0x40468f(0x23a),_0x56be13['attribute']);return;}if(_0x56be13[_0x40468f(0x23a)]===!![]){this[_0x40468f(0x2b3)](_0x527932),this[_0x40468f(0x2c5)](_0x527932),this[_0x40468f(0x278)](_0xe463ba,_0x407fc9,'attributes');return;}if(typeof _0x56be13[_0x40468f(0x1cb)]===_0x40468f(0x221)){this['displayBehaviorsStats'](_0x527932,_0x407fc9),this[_0x40468f(0x2c5)](_0x527932),this[_0x40468f(0x278)](_0xe463ba,_0x407fc9,_0x40468f(0x1cb),_0x56be13['behavior']);return;}if(_0x56be13[_0x40468f(0x1cb)]===!![]){this[_0x40468f(0x23d)](_0x527932,_0x407fc9),this[_0x40468f(0x2c5)](_0x527932),this[_0x40468f(0x278)](_0xe463ba,_0x407fc9,_0x40468f(0x1a4));return;}this[_0x40468f(0x2b3)](_0x527932),this[_0x40468f(0x23d)](_0x527932,_0x407fc9),this['displaySummary'](_0x527932),this[_0x40468f(0x278)](_0xe463ba,_0x407fc9,_0x40468f(0x1b7));}['displayPreviewHints'](_0x29abbb,_0xeab634,_0x5186a4,_0x4a26af){const _0x54182d=a29_0x1bdc06;console[_0x54182d(0x292)]('\x0a'+a29_0x2d2d64['dim'](_0x54182d(0x212)));const _0x5e7126=_0xeab634!==_0x54182d(0x2b0)?'\x20--interval\x20'+_0xeab634:'';if(_0x5186a4===_0x54182d(0x23a)&&_0x4a26af)console['error']('\x20\x20'+a29_0x2d2d64[_0x54182d(0x2a2)](_0x54182d(0x243)+_0x29abbb+_0x54182d(0x2a6)+_0x4a26af+'\x22'+_0x5e7126));else{if(_0x5186a4===_0x54182d(0x1cb)&&_0x4a26af)console['error']('\x20\x20'+a29_0x2d2d64['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x29abbb+_0x54182d(0x1f4)+_0x4a26af+'\x22'+_0x5e7126));else(_0x5186a4==='attributes'||_0x5186a4===_0x54182d(0x1b7))&&console[_0x54182d(0x292)]('\x20\x20'+a29_0x2d2d64[_0x54182d(0x2a2)](_0x54182d(0x243)+_0x29abbb+_0x54182d(0x21d)+_0x5e7126));}(_0x5186a4==='behaviors'||_0x5186a4==='all')&&console['error']('\x20\x20'+a29_0x2d2d64[_0x54182d(0x2a2)]('tdx\x20segment\x20parent\x20preview\x20'+_0x29abbb+_0x54182d(0x1df)+_0x5e7126)),_0x5186a4===_0x54182d(0x1b7)&&console[_0x54182d(0x292)]('\x20\x20'+a29_0x2d2d64[_0x54182d(0x2a2)](_0x54182d(0x243)+_0x29abbb+_0x54182d(0x1f5)+_0x5e7126));}[a29_0x1bdc06(0x296)](_0x21d839){const _0x38a891=a29_0x1bdc06,{master:_0x496e0c}=_0x21d839,_0xa4188c=_0x496e0c['schemaValid']?a29_0x2d2d64[_0x38a891(0x1b5)]('✔'):a29_0x2d2d64[_0x38a891(0x29b)]('✘');console['error']('\x0a'+a29_0x2d2d64[_0x38a891(0x2a2)](_0x38a891(0x1f7))),console['error'](_0xa4188c+'\x20'+a29_0x2d2d64[_0x38a891(0x2a5)](_0x496e0c[_0x38a891(0x215)]+'.'+_0x496e0c['table'])),_0x496e0c[_0x38a891(0x1eb)]?_0x496e0c[_0x38a891(0x202)]!==undefined&&console[_0x38a891(0x292)]('\x20\x20'+a29_0x2d2d64[_0x38a891(0x2a2)](_0x38a891(0x1ea))+'\x20'+a29_0x2d2d64['cyan'](formatRows(_0x496e0c[_0x38a891(0x202)]))):console[_0x38a891(0x292)]('\x20\x20'+a29_0x2d2d64[_0x38a891(0x29b)](_0x38a891(0x227))+'\x20'+_0x496e0c[_0x38a891(0x286)]);}[a29_0x1bdc06(0x2b3)](_0x3aa7cb){const _0x3b159c=a29_0x1bdc06;if(_0x3aa7cb[_0x3b159c(0x219)][_0x3b159c(0x1ce)]===0x0)return;console['error']('\x0a'+a29_0x2d2d64['dim'](_0x3b159c(0x236)));for(const _0x530119 of _0x3aa7cb[_0x3b159c(0x219)]){const _0x3b7cdc=_0x530119['schemaValid']?a29_0x2d2d64['green']('✔'):a29_0x2d2d64['red']('✘');let _0x27ee3e='';if(_0x530119[_0x3b159c(0x1eb)]&&_0x530119['matchedCount']!==undefined&&_0x530119['coveragePercent']!==undefined){const _0x431b3b=_0x530119[_0x3b159c(0x24e)][_0x3b159c(0x200)](0x1),_0x5e5c3b=_0x530119['coveragePercent']>=0x50?a29_0x2d2d64['green']:_0x530119[_0x3b159c(0x24e)]>=0x32?a29_0x2d2d64[_0x3b159c(0x251)]:a29_0x2d2d64['red'];_0x27ee3e='\x20'+a29_0x2d2d64[_0x3b159c(0x2a2)](_0x3b159c(0x1bf))+'\x20'+_0x5e5c3b(_0x431b3b+'%')+'\x20('+formatRows(_0x530119[_0x3b159c(0x1dc)])+_0x3b159c(0x210);}console[_0x3b159c(0x292)](_0x3b7cdc+'\x20'+a29_0x2d2d64['bold'](_0x530119['name'])+_0x27ee3e),console['error']('\x20\x20'+a29_0x2d2d64[_0x3b159c(0x2a2)](_0x3b159c(0x280))+'\x20'+a29_0x2d2d64[_0x3b159c(0x2a5)](_0x530119[_0x3b159c(0x215)]+'.'+_0x530119[_0x3b159c(0x1a5)]));const _0x10ed0a=_0x530119[_0x3b159c(0x2be)]===_0x530119['foreignKey']?a29_0x2d2d64[_0x3b159c(0x2a2)]('Join\x20on:')+'\x20'+_0x530119['joinKey']:a29_0x2d2d64[_0x3b159c(0x2a2)](_0x3b159c(0x2ab))+'\x20'+_0x530119['joinKey']+'\x20=\x20'+_0x530119[_0x3b159c(0x1ba)];console['error']('\x20\x20'+_0x10ed0a),console[_0x3b159c(0x292)]('\x20\x20'+a29_0x2d2d64['dim']('Columns:')),this['displayColumns'](_0x530119[_0x3b159c(0x248)]),!_0x530119['schemaValid']&&console[_0x3b159c(0x292)]('\x20\x20'+a29_0x2d2d64[_0x3b159c(0x29b)](_0x3b159c(0x227))+'\x20'+_0x530119[_0x3b159c(0x286)]);}}[a29_0x1bdc06(0x23d)](_0x44aca0,_0x374462){const _0x33a338=a29_0x1bdc06;if(_0x44aca0[_0x33a338(0x1a4)][_0x33a338(0x1ce)]===0x0)return;console[_0x33a338(0x292)]('\x0a'+a29_0x2d2d64['dim'](_0x33a338(0x1a7))+'\x20'+a29_0x2d2d64[_0x33a338(0x2a2)]('('+_0x374462+')'));for(const _0x5c38eb of _0x44aca0[_0x33a338(0x1a4)]){const _0x4bb594=_0x5c38eb[_0x33a338(0x1eb)]?a29_0x2d2d64[_0x33a338(0x1b5)]('✔'):a29_0x2d2d64['red']('✘');let _0x6e6619='';if(_0x5c38eb[_0x33a338(0x1eb)]&&_0x5c38eb[_0x33a338(0x294)]!==undefined&&_0x5c38eb[_0x33a338(0x1fb)]!==undefined){const _0x2612b7=_0x5c38eb[_0x33a338(0x29f)]?.[_0x33a338(0x200)](0x1)||'?',_0x59a92a=(_0x5c38eb[_0x33a338(0x29f)]??0x0)>=0x32?a29_0x2d2d64[_0x33a338(0x1b5)]:(_0x5c38eb[_0x33a338(0x29f)]??0x0)>=0x14?a29_0x2d2d64[_0x33a338(0x251)]:a29_0x2d2d64[_0x33a338(0x29b)];_0x6e6619='\x20'+a29_0x2d2d64[_0x33a338(0x2a2)](_0x33a338(0x209))+'\x20'+_0x59a92a(formatRows(_0x5c38eb[_0x33a338(0x294)]))+'\x20('+_0x2612b7+_0x33a338(0x2a3)+a29_0x2d2d64[_0x33a338(0x2a2)](_0x33a338(0x241))+'\x20'+a29_0x2d2d64[_0x33a338(0x1e4)](formatRows(_0x5c38eb[_0x33a338(0x1fb)]));}console['error'](_0x4bb594+'\x20'+a29_0x2d2d64[_0x33a338(0x2a5)](_0x5c38eb['name'])+_0x6e6619),console[_0x33a338(0x292)]('\x20\x20'+a29_0x2d2d64[_0x33a338(0x2a2)]('Source:')+'\x20'+a29_0x2d2d64['bold'](_0x5c38eb[_0x33a338(0x215)]+'.'+_0x5c38eb[_0x33a338(0x1a5)]));const _0x4112b7=_0x5c38eb[_0x33a338(0x2be)]===_0x5c38eb[_0x33a338(0x1ba)]?a29_0x2d2d64[_0x33a338(0x2a2)]('Join\x20on:')+'\x20'+_0x5c38eb[_0x33a338(0x2be)]:a29_0x2d2d64[_0x33a338(0x2a2)](_0x33a338(0x2ab))+'\x20'+_0x5c38eb[_0x33a338(0x2be)]+_0x33a338(0x293)+_0x5c38eb['foreignKey'];console['error']('\x20\x20'+_0x4112b7),console[_0x33a338(0x292)]('\x20\x20'+a29_0x2d2d64[_0x33a338(0x2a2)]('Columns:')),this['displayColumns'](_0x5c38eb['columns']),!_0x5c38eb[_0x33a338(0x1eb)]&&console['error']('\x20\x20'+a29_0x2d2d64[_0x33a338(0x29b)](_0x33a338(0x227))+'\x20'+_0x5c38eb['schemaError']);}}['displayColumns'](_0x4aefc1){const _0x580e60=a29_0x1bdc06;for(const _0x48b962 of _0x4aefc1){_0x48b962[_0x580e60(0x1f3)]===_0x48b962[_0x580e60(0x1d4)]||_0x48b962[_0x580e60(0x1d4)]==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x48b962['label']):console[_0x580e60(0x292)]('\x20\x20\x20\x20-\x20'+_0x48b962['label']+'\x20'+a29_0x2d2d64['dim']('('+_0x48b962[_0x580e60(0x1d4)]+')'));}}[a29_0x1bdc06(0x2c5)](_0x4c1c29){const _0x3865d4=a29_0x1bdc06;console[_0x3865d4(0x292)]('─'[_0x3865d4(0x1e3)](0x3c));if(_0x4c1c29[_0x3865d4(0x2bb)][_0x3865d4(0x1ce)]>0x0){console['error']('\x0a'+a29_0x2d2d64['red'](_0x3865d4(0x1d9)));for(const _0x46f7e4 of _0x4c1c29[_0x3865d4(0x2bb)]){console[_0x3865d4(0x292)]('\x20\x20'+a29_0x2d2d64[_0x3865d4(0x29b)]('•')+'\x20'+_0x46f7e4);}}_0x4c1c29['allValid']&&console[_0x3865d4(0x292)]('\x0a'+a29_0x2d2d64['green']('✔')+_0x3865d4(0x1b2));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x1bdc06(0x1dd)]=a29_0x1bdc06(0x1c3);[a29_0x1bdc06(0x1fc)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a29_0x1bdc06(0x23e)](_0xd91291){const _0x350c30=a29_0x1bdc06,{options:_0x2fb35a,args:_0x264588,tdx:_0x3087a4}=_0xd91291,_0x16e0ab=_0x2fb35a,_0x5833ec=_0x264588[0x0]||_0x2fb35a[_0x350c30(0x231)];if(!_0x5833ec)return showParentSegmentNotSetError(_0x350c30(0x1f1)+_0x350c30(0x29a)+_0x350c30(0x27d)+_0x350c30(0x2b5)+_0x350c30(0x247)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x350c30(0x295)),0x1;if(!_0x16e0ab[_0x350c30(0x27e)]&&!_0x16e0ab[_0x350c30(0x23a)]&&!_0x16e0ab[_0x350c30(0x1cb)]&&!_0x16e0ab[_0x350c30(0x267)])return console['error'](a29_0x2d2d64[_0x350c30(0x29b)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x350c30(0x292)](_0x350c30(0x2bc)),console[_0x350c30(0x292)](_0x350c30(0x2b9)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0x350c30(0x235)),console[_0x350c30(0x292)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error']('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x949e6d=resolveYamlFile(_0x5833ec);if(!existsSync(_0x949e6d))return showFileNotFoundError(_0x949e6d,_0x5833ec),0x1;_0x16e0ab['verbose']&&(console[_0x350c30(0x292)](_0x350c30(0x26e)+_0x16e0ab['site']),console[_0x350c30(0x292)](_0x350c30(0x29d)+_0x949e6d));let _0x59d227;try{_0x59d227=readFileSync(_0x949e6d,'utf-8');}catch(_0x1ae3ca){const _0x17d0ff=_0x1ae3ca instanceof Error?_0x1ae3ca['message']:String(_0x1ae3ca);return console[_0x350c30(0x292)](_0x350c30(0x224)+_0x17d0ff),0x1;}let _0x5965a1;try{_0x5965a1=parseYamlString(_0x59d227);}catch(_0x17531e){const _0x1e37ce=_0x17531e instanceof Error?_0x17531e[_0x350c30(0x1e0)]:String(_0x17531e);return console[_0x350c30(0x292)](a29_0x2d2d64['red'](_0x350c30(0x232)+_0x1e37ce)),0x1;}if(_0x16e0ab['attribute']===!![]||_0x16e0ab[_0x350c30(0x23a)]===''){const _0x83fe6=_0x5965a1[_0x350c30(0x219)]?.['map'](_0x2b314d=>_0x2b314d[_0x350c30(0x1dd)])||[];if(_0x83fe6['length']===0x0)console[_0x350c30(0x292)](a29_0x2d2d64[_0x350c30(0x29b)](_0x350c30(0x2aa)));else{console[_0x350c30(0x292)](a29_0x2d2d64[_0x350c30(0x29b)](_0x350c30(0x290))),console['error'](_0x350c30(0x246));for(const _0xfa3bcc of _0x83fe6){console['error']('\x20\x20'+a29_0x2d2d64[_0x350c30(0x1e4)](_0xfa3bcc));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x5833ec+_0x350c30(0x2a6)+_0x83fe6[0x0]+'\x22');}return 0x1;}if(_0x16e0ab[_0x350c30(0x1cb)]===!![]||_0x16e0ab[_0x350c30(0x1cb)]===''){const _0x39f3b8=_0x5965a1[_0x350c30(0x1a4)]?.[_0x350c30(0x1bc)](_0x68141b=>_0x68141b[_0x350c30(0x1dd)])||[];if(_0x39f3b8['length']===0x0)console[_0x350c30(0x292)](a29_0x2d2d64[_0x350c30(0x29b)](_0x350c30(0x206)));else{console['error'](a29_0x2d2d64['red'](_0x350c30(0x22a))),console[_0x350c30(0x292)](_0x350c30(0x284));for(const _0x3d7c87 of _0x39f3b8){console['error']('\x20\x20'+a29_0x2d2d64[_0x350c30(0x1e4)](_0x3d7c87));}console[_0x350c30(0x292)](_0x350c30(0x291)+_0x5833ec+_0x350c30(0x1f4)+_0x39f3b8[0x0]+'\x22');}return 0x1;}const _0x39bfed=createCommandSpinner(a29_0x2d2d64[_0x350c30(0x2a2)](_0x350c30(0x274)),{'verbose':_0x16e0ab[_0x350c30(0x216)]});_0x39bfed[_0x350c30(0x22b)]();const _0xec8f2e={'onProgress':_0x2e3269=>{const _0x5b4e4d=_0x350c30;_0x39bfed[_0x5b4e4d(0x1f2)]=formatProgressMessage(_0x2e3269);}};if(_0x16e0ab['master'])_0xec8f2e['master']=!![];if(_0x16e0ab[_0x350c30(0x23a)]&&typeof _0x16e0ab[_0x350c30(0x23a)]===_0x350c30(0x221))_0xec8f2e[_0x350c30(0x23a)]=_0x16e0ab[_0x350c30(0x23a)];if(_0x16e0ab[_0x350c30(0x1cb)]&&typeof _0x16e0ab[_0x350c30(0x1cb)]===_0x350c30(0x221))_0xec8f2e[_0x350c30(0x1cb)]=_0x16e0ab[_0x350c30(0x1cb)];if(_0x16e0ab['enriched'])_0xec8f2e['enriched']=!![];if(_0x16e0ab[_0x350c30(0x256)])_0xec8f2e[_0x350c30(0x256)]=_0x16e0ab[_0x350c30(0x256)];let _0x501149;try{_0x501149=await _0x3087a4[_0x350c30(0x1bb)][_0x350c30(0x2bf)](_0x59d227,_0xec8f2e),_0x39bfed[_0x350c30(0x2b8)]();}catch(_0x189f80){_0x39bfed[_0x350c30(0x2b8)]();throw _0x189f80;}return await this[_0x350c30(0x299)](_0x501149,{'master':_0x16e0ab[_0x350c30(0x27e)],'attribute':typeof _0x16e0ab[_0x350c30(0x23a)]===_0x350c30(0x221)?_0x16e0ab[_0x350c30(0x23a)]:undefined,'behavior':typeof _0x16e0ab['behavior']===_0x350c30(0x221)?_0x16e0ab[_0x350c30(0x1cb)]:undefined,'enriched':_0x16e0ab[_0x350c30(0x267)]}),_0x501149[_0x350c30(0x28d)]?0x0:0x1;}async[a29_0x1bdc06(0x299)](_0x29be02,_0x37e617){const _0x208232=a29_0x1bdc06;console[_0x208232(0x292)]('\x0a'+a29_0x2d2d64[_0x208232(0x2a5)](_0x208232(0x261))+'\x20'+_0x29be02[_0x208232(0x1dd)]),console[_0x208232(0x292)]('═'['repeat'](0x3c));if(_0x37e617['master']&&_0x29be02[_0x208232(0x1c9)]){const _0x26b8a6=a29_0x2d2d64[_0x208232(0x2a2)](_0x208232(0x268))+'\x20'+a29_0x2d2d64['bold'](_0x29be02['master'][_0x208232(0x215)]+'.'+_0x29be02['master'][_0x208232(0x1a5)]);await this[_0x208232(0x253)](_0x26b8a6,_0x29be02[_0x208232(0x1c9)]);}else{if(_0x37e617['attribute']&&_0x29be02[_0x208232(0x1c9)]){const _0x3f6097=a29_0x2d2d64[_0x208232(0x2a2)](_0x208232(0x238))+'\x20'+a29_0x2d2d64[_0x208232(0x2a5)](_0x37e617['attribute']);await this['displaySampleData'](_0x3f6097,_0x29be02[_0x208232(0x1c9)]);}else{if(_0x37e617[_0x208232(0x1cb)]&&_0x29be02[_0x208232(0x1c9)]){const _0x185997=a29_0x2d2d64['dim'](_0x208232(0x1a6))+'\x20'+a29_0x2d2d64[_0x208232(0x2a5)](_0x37e617[_0x208232(0x1cb)]);await this[_0x208232(0x253)](_0x185997,_0x29be02['sampleData']);}else{if(_0x37e617[_0x208232(0x267)]&&_0x29be02[_0x208232(0x1c9)]){const _0x24d47d=a29_0x2d2d64[_0x208232(0x2a2)](_0x208232(0x2c2))+'\x20'+a29_0x2d2d64[_0x208232(0x2a5)](_0x208232(0x228));await this[_0x208232(0x253)](_0x24d47d,_0x29be02[_0x208232(0x1c9)]);}else!_0x29be02[_0x208232(0x1c9)]&&console['error'](_0x208232(0x2b1));}}}if(_0x29be02[_0x208232(0x2bb)][_0x208232(0x1ce)]>0x0){console[_0x208232(0x292)]('─'[_0x208232(0x1e3)](0x3c)),console[_0x208232(0x292)]('\x0a'+a29_0x2d2d64[_0x208232(0x29b)](_0x208232(0x1d9)));for(const _0x431187 of _0x29be02['errors']){console[_0x208232(0x292)]('\x20\x20'+a29_0x2d2d64[_0x208232(0x29b)]('•')+'\x20'+_0x431187);}}}async['displaySampleData'](_0x4b25d6,_0x5a277b){const _0x46a8aa=a29_0x1bdc06;if(_0x5a277b['length']===0x0){console[_0x46a8aa(0x292)]('\x0a'+_0x4b25d6),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x46a8aa(0x292)]('\x0a'+_0x4b25d6);const _0x4b895a=Object[_0x46a8aa(0x2ac)](_0x5a277b[0x0])[_0x46a8aa(0x1bc)](_0xf440bd=>({'name':_0xf440bd,'type':typeof _0x5a277b[0x0][_0xf440bd]==='number'?_0x46a8aa(0x26d):'varchar'})),_0x1839a8={'queryId':_0x46a8aa(0x269),'columns':_0x4b895a,'data':_0x5a277b,'stats':{'state':_0x46a8aa(0x1c0),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5a277b['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5574c4=formatAsTable(_0x1839a8,_0x5a277b['length'],!![]);await writeOutput(_0x5574c4,undefined,_0x46a8aa(0x1a5));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a29_0x1bdc06(0x26c);[a29_0x1bdc06(0x1fc)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a29_0x1bdc06(0x23e)](_0x18047d){const _0x2e0c98=a29_0x1bdc06,{options:_0x10c617,args:_0x29d12f,tdx:_0x2df8c2}=_0x18047d,_0x260262=_0x10c617,_0x2759f7=_0x29d12f[0x0]||_0x10c617['parentSegment'];if(!_0x2759f7)return showParentSegmentNotSetError(_0x2e0c98(0x1d3)+_0x2e0c98(0x28f)),0x1;const _0x4303a8=resolveYamlFile(_0x2759f7);if(existsSync(_0x4303a8)){_0x260262['verbose']&&console[_0x2e0c98(0x292)](_0x2e0c98(0x1a9)+_0x4303a8);let _0x4a42e9;try{_0x4a42e9=readFileSync(_0x4303a8,_0x2e0c98(0x230));}catch(_0x2298fb){const _0x5da219=_0x2298fb instanceof Error?_0x2298fb[_0x2e0c98(0x1e0)]:String(_0x2298fb);return console[_0x2e0c98(0x292)](_0x2e0c98(0x224)+_0x5da219),0x1;}const _0x4c4065=await withSpinner('Analyzing\x20changes...',()=>_0x2df8c2[_0x2e0c98(0x1bb)]['pushParentYaml'](_0x4a42e9),{'verbose':_0x260262[_0x2e0c98(0x216)]}),_0x49e470=_0x4c4065['data'],{isNew:_0x3b76fc,name:_0x5f593f,hasChanges:_0x22671f,diffFormatted:_0x3459c9}=_0x49e470;if(_0x22671f){_0x3b76fc?console[_0x2e0c98(0x292)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5f593f+'\x27:'):console['error'](_0x2e0c98(0x1e1)+_0x5f593f+'\x27:');console[_0x2e0c98(0x292)]('─'[_0x2e0c98(0x1e3)](0x3c)),console[_0x2e0c98(0x292)](_0x3459c9),console[_0x2e0c98(0x292)]('─'[_0x2e0c98(0x1e3)](0x3c));const _0x5868a8=_0x3b76fc?_0x2e0c98(0x239)+_0x5f593f+_0x2e0c98(0x1b8):_0x2e0c98(0x1a2)+_0x5f593f+_0x2e0c98(0x1b8);if(!_0x260262['yes']){const _0xbf8542=await confirmKey(_0x5868a8);if(!_0xbf8542)return console[_0x2e0c98(0x292)]('Aborted.'),0x1;}const _0x438ab1=_0x3b76fc?_0x2e0c98(0x203):'Updating';await withSpinner(_0x438ab1+_0x2e0c98(0x1e7)+_0x5f593f+_0x2e0c98(0x218),()=>_0x49e470[_0x2e0c98(0x23b)](),{'verbose':_0x260262[_0x2e0c98(0x216)]});const _0x3da91e=_0x3b76fc?'Created':'Updated';console[_0x2e0c98(0x292)]('✔\x20'+_0x3da91e+_0x2e0c98(0x1e7)+_0x5f593f+'\x27');}else console['error'](_0x2e0c98(0x1ae)+_0x5f593f+'\x27\x20is\x20up\x20to\x20date');}const _0x360f02=await withSpinner(_0x2e0c98(0x283)+_0x2759f7+_0x2e0c98(0x218),()=>_0x2df8c2[_0x2e0c98(0x1bb)][_0x2e0c98(0x263)](_0x2759f7),{'verbose':_0x260262[_0x2e0c98(0x216)]}),_0x4fd7a5=_0x360f02['data'],_0x332d86=getConsoleUrl(_0x260262['site'],'/app/workflows/'+_0x4fd7a5['workflowId']+_0x2e0c98(0x28e)+_0x4fd7a5['workflowSessionId']+_0x2e0c98(0x226)+_0x4fd7a5[_0x2e0c98(0x288)]);return console[_0x2e0c98(0x292)]('\x0a✔\x20Workflow\x20started'),console[_0x2e0c98(0x292)]('\x20\x20'+a29_0x2d2d64[_0x2e0c98(0x2a2)](_0x2e0c98(0x262))+'\x20'+_0x4fd7a5[_0x2e0c98(0x201)]),console[_0x2e0c98(0x292)]('\x20\x20'+a29_0x2d2d64[_0x2e0c98(0x2a2)](_0x2e0c98(0x2b2))+'\x20'+_0x4fd7a5['status']),console[_0x2e0c98(0x292)]('\x20\x20'+a29_0x2d2d64['dim'](_0x2e0c98(0x26a))+'\x20'+_0x4fd7a5[_0x2e0c98(0x265)]),console[_0x2e0c98(0x292)]('\x20\x20'+a29_0x2d2d64[_0x2e0c98(0x2a2)](_0x2e0c98(0x1e8))+'\x20'+_0x4fd7a5[_0x2e0c98(0x288)]),console[_0x2e0c98(0x292)]('\x20\x20'+_0x332d86),console[_0x2e0c98(0x292)]('\x0a'+a29_0x2d2d64[_0x2e0c98(0x2a2)](_0x2e0c98(0x229))+_0x2e0c98(0x28a)+_0x4fd7a5['workflowAttemptId']+_0x2e0c98(0x2c0)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x1bdc06(0x1dd)]=a29_0x1bdc06(0x245);[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x2a8);async['execute'](_0x273d4c){const _0x828aa0=a29_0x1bdc06,{options:_0x12d070,args:_0x2a8b4e,tdx:_0x39bec1}=_0x273d4c,_0x487f37=_0x2a8b4e[0x0]||_0x12d070['parentSegment'];if(!_0x487f37)return showParentSegmentNotSetError(_0x828aa0(0x1f9)+_0x828aa0(0x25e)),0x1;_0x12d070[_0x828aa0(0x216)]&&(console['error'](_0x828aa0(0x26e)+_0x12d070[_0x828aa0(0x28c)]),console[_0x828aa0(0x292)](_0x828aa0(0x276)+_0x487f37));const _0x145ab4=await withSpinner(_0x828aa0(0x2bd)+_0x487f37+'\x27...',()=>_0x39bec1['segment'][_0x828aa0(0x234)](_0x487f37),{'verbose':_0x12d070[_0x828aa0(0x216)]}),_0x31af5c=_0x145ab4['data'];console['error'](_0x828aa0(0x1d7)+_0x31af5c['length']+_0x828aa0(0x264)+(_0x31af5c[_0x828aa0(0x1ce)]!==0x1?'s':''));if(_0x12d070['json']||_0x12d070['jsonl'])return await handleSDKOutput(_0x31af5c,_0x12d070),0x0;return displayFieldsHumanReadable(_0x31af5c,_0x487f37),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a29_0x1bdc06(0x2ad);[a29_0x1bdc06(0x1fc)]='Show\x20parent\x20segment\x20details';async[a29_0x1bdc06(0x23e)](_0x426b40){const _0x25c46a=a29_0x1bdc06,{options:_0x519de0,args:_0x452b0f,tdx:_0x26f01c}=_0x426b40,_0x402b40=_0x519de0,_0x4f7e96=_0x452b0f[0x0]||_0x519de0[_0x25c46a(0x231)];if(!_0x4f7e96)return showParentSegmentNotSetError(_0x25c46a(0x20c)+'\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'+_0x25c46a(0x1c1)),0x1;_0x519de0[_0x25c46a(0x216)]&&(console[_0x25c46a(0x292)](_0x25c46a(0x26e)+_0x519de0['site']),console[_0x25c46a(0x292)]('Parent\x20segment:\x20'+_0x4f7e96));const _0x5945cd=await withSpinner(_0x25c46a(0x1cd)+_0x4f7e96+_0x25c46a(0x218),()=>_0x26f01c[_0x25c46a(0x1bb)][_0x25c46a(0x254)](_0x4f7e96),{'verbose':_0x519de0['verbose']}),_0x512f02=_0x5945cd['data'];if(_0x402b40[_0x25c46a(0x2af)]){const _0x48dfab=getConsoleNextUrl(_0x402b40[_0x25c46a(0x28c)],_0x25c46a(0x223)+_0x512f02['id']);return console['error'](a29_0x2d2d64[_0x25c46a(0x1b5)]('✔')+_0x25c46a(0x1da)+a29_0x2d2d64['cyan'](_0x48dfab)),openBrowser(_0x48dfab),0x0;}return await handleSingleObjectOutput(_0x512f02,_0x519de0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x1bdc06(0x1dd)]='segment:parent:desc';[a29_0x1bdc06(0x1fc)]=a29_0x1bdc06(0x27a);async[a29_0x1bdc06(0x23e)](_0x50fe5d){const _0x345603=a29_0x1bdc06,{options:_0x4a27e1,args:_0x2d626f,tdx:_0x36bc6d}=_0x50fe5d,_0x305817=_0x2d626f[0x0]||_0x4a27e1[_0x345603(0x231)];if(!_0x305817)return showParentSegmentNotSetError(_0x345603(0x205)+_0x345603(0x208)),0x1;_0x4a27e1[_0x345603(0x216)]&&(console['error'](_0x345603(0x26e)+_0x4a27e1[_0x345603(0x28c)]),console[_0x345603(0x292)](_0x345603(0x276)+_0x305817));const _0x18084b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x305817+_0x345603(0x218),()=>_0x36bc6d['segment']['resolveParentId'](_0x305817),{'verbose':_0x4a27e1[_0x345603(0x216)]}),_0x1b8649=_0x18084b['data'],_0x26c8c5=await withSpinner(_0x345603(0x1c5)+_0x305817+_0x345603(0x218),()=>_0x36bc6d['segment'][_0x345603(0x233)](_0x1b8649),{'verbose':_0x4a27e1[_0x345603(0x216)]}),_0x3f4efe=await executeSchemaQuery(_0x26c8c5['data'],_0x36bc6d,_0x4a27e1);return await handleQueryOutput(_0x3f4efe,_0x4a27e1),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x1bdc06(0x1dd)]=a29_0x1bdc06(0x27c);[a29_0x1bdc06(0x1fc)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async['execute'](_0x4d7a72){const _0x155b01=a29_0x1bdc06,{options:_0x53610b,args:_0xe67eef,tdx:_0x1d54d5}=_0x4d7a72,_0x36e272=_0xe67eef[0x0]||_0x53610b[_0x155b01(0x231)];if(!_0x36e272)return showParentSegmentNotSetError(_0x155b01(0x220)+'\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;_0x53610b[_0x155b01(0x216)]&&(console['error'](_0x155b01(0x26e)+_0x53610b[_0x155b01(0x28c)]),console[_0x155b01(0x292)](_0x155b01(0x276)+_0x36e272));const _0x367d0b=await withSpinner(_0x155b01(0x277)+_0x36e272+'\x27...',()=>_0x1d54d5[_0x155b01(0x1bb)][_0x155b01(0x1fa)](_0x36e272),{'verbose':_0x53610b['verbose']}),_0x2d265a=_0x367d0b['data'],_0x33e1a9=await withSpinner(_0x155b01(0x1c5)+_0x36e272+_0x155b01(0x218),()=>_0x1d54d5['segment'][_0x155b01(0x233)](_0x2d265a),{'verbose':_0x53610b[_0x155b01(0x216)]}),_0xdd1e13=_0x33e1a9['data'];return _0x53610b[_0x155b01(0x1b3)]===_0x155b01(0x259)||_0x53610b[_0x155b01(0x1b3)]===_0x155b01(0x27f)?await handleSDKOutput([{'sql':_0xdd1e13}],_0x53610b):console[_0x155b01(0x1d8)](_0xdd1e13),0x0;}}function a29_0x2a31(_0x21f2e1,_0x4bbcbc){_0x21f2e1=_0x21f2e1-0x1a2;const _0x52bc93=a29_0x52bc();let _0x2a3151=_0x52bc93[_0x21f2e1];return _0x2a3151;}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x1bdc06(0x1dd)]='segment:parent:show';['description']=a29_0x1bdc06(0x1a8);async[a29_0x1bdc06(0x23e)](_0x398510){const _0x21207c=a29_0x1bdc06,{options:_0x14581f,args:_0x321b01,tdx:_0x1139fd}=_0x398510,_0x22e597=_0x321b01[0x0]||_0x14581f[_0x21207c(0x231)];if(!_0x22e597)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x21207c(0x2b4)),0x1;_0x14581f[_0x21207c(0x216)]&&(console[_0x21207c(0x292)](_0x21207c(0x26e)+_0x14581f[_0x21207c(0x28c)]),console[_0x21207c(0x292)]('Parent\x20segment:\x20'+_0x22e597));const _0x4ee436=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x22e597+_0x21207c(0x218),()=>_0x1139fd[_0x21207c(0x1bb)]['resolveParentId'](_0x22e597),{'verbose':_0x14581f[_0x21207c(0x216)]}),_0x45ab62=_0x4ee436[_0x21207c(0x21a)],_0xbdeca=await withSpinner(_0x21207c(0x1c5)+_0x22e597+_0x21207c(0x218),()=>_0x1139fd[_0x21207c(0x1bb)][_0x21207c(0x233)](_0x45ab62),{'verbose':_0x14581f[_0x21207c(0x216)]});let _0x40cd1e=_0xbdeca['data'];const _0x544760=resolveLimit(_0x14581f[_0x21207c(0x255)],DEFAULT_DISPLAY_LIMIT),_0x3a97fe=/\bLIMIT\s+\d+/i[_0x21207c(0x2a0)](_0x40cd1e);!_0x3a97fe&&(_0x40cd1e=_0x40cd1e['trim']()[_0x21207c(0x1c7)](/;+$/,''),_0x40cd1e='SELECT\x20*\x20FROM\x20(\x0a'+_0x40cd1e+_0x21207c(0x270)+_0x544760);_0x14581f[_0x21207c(0x216)]&&console[_0x21207c(0x292)](_0x21207c(0x1ed)+_0x40cd1e);const _0x2f864f=await withQuerySpinner(_0x21207c(0x2b6),async _0x1b0f5f=>{const _0x381370=_0x21207c,_0x3a50ef=await _0x1139fd['query'][_0x381370(0x23e)](_0x40cd1e,{'catalog':'td','schema':_0x381370(0x1d0),'onJobId':_0xe9f9ec=>{const _0x25ae7b=_0x381370;_0x1b0f5f[_0x25ae7b(0x281)](_0xe9f9ec);}});return _0x3a50ef;},{'verbose':_0x14581f['verbose']}),_0x49e6f6=_0x2f864f[_0x21207c(0x21a)],_0x3f9768=_0x49e6f6[_0x21207c(0x20b)]?'\x20[Job\x20ID:\x20'+_0x49e6f6[_0x21207c(0x20b)]+']':'';return console['error'](_0x21207c(0x21f)+_0x49e6f6['stats'][_0x21207c(0x275)][_0x21207c(0x1e6)]()+_0x21207c(0x29e)+('in\x20'+formatElapsed(_0x49e6f6[_0x21207c(0x222)][_0x21207c(0x1ac)])+_0x3f9768)),await handleQueryOutput(_0x49e6f6,_0x14581f),0x0;}}
|
|
1
|
+
const a29_0x150261=a29_0x1973;(function(_0x37192a,_0x55397f){const _0x4366d1=a29_0x1973,_0x147f52=_0x37192a();while(!![]){try{const _0x1d646b=parseInt(_0x4366d1(0x251))/0x1*(-parseInt(_0x4366d1(0x242))/0x2)+parseInt(_0x4366d1(0x282))/0x3*(-parseInt(_0x4366d1(0x1d0))/0x4)+-parseInt(_0x4366d1(0x1a5))/0x5+-parseInt(_0x4366d1(0x1ce))/0x6*(-parseInt(_0x4366d1(0x203))/0x7)+-parseInt(_0x4366d1(0x238))/0x8*(-parseInt(_0x4366d1(0x219))/0x9)+-parseInt(_0x4366d1(0x23f))/0xa+parseInt(_0x4366d1(0x1dd))/0xb*(parseInt(_0x4366d1(0x1eb))/0xc);if(_0x1d646b===_0x55397f)break;else _0x147f52['push'](_0x147f52['shift']());}catch(_0x28edeb){_0x147f52['push'](_0x147f52['shift']());}}}(a29_0x3970,0x89ef7));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';function a29_0x3970(){const _0x22730c=['Options\x20(one\x20required):\x0a','attribute','\x27\x20is\x20up\x20to\x20date','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Resolving\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20tdx\x20wf\x20attempt\x20','Attempt:','displaySummary','number','customerGroup','segment:parent:fields','sampleData','\x20kill','message','segment:parent:show','run','Found\x20YAML\x20file:\x20','\x20--attribute\x20\x22<name>\x22','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Listing\x20parent\x20segments\x20matching\x20\x27','.yml','cyan','enriched','segment:parent:push','execute','Site:\x20','varchar','table','segment:parent:list','segment:parent:preview','✔\x20Found\x20','getParentFull','Aborted.','parentSegment','Analyzing\x20changes...','\x20No\x20changes\x20-\x20','start','Errors:','text','in\x20','Fetching\x20sample\x20data...','schemaError','dim','33249IvWFWn','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','ignore','\x20rows\x20','runParent','preview','Rows:','status','/attempt/','joinKey','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:pull','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Master:','/app/dw/parentSegments/','/\x20directory.\x0a','matchedCount','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','displayColumns','columns','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','pullParentYaml','\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\x20\x20\x20-\x20','interval','Updating','trim','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','segment:parent:update','Parent\x20segment:\x20','Options:\x0a','query','listFields','Fetching\x20SQL\x20for\x20\x27','localeCompare','\x20--behavior\x20\x22<name>\x22','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','-1d','SELECT\x20*\x20FROM\x20(\x0a','verbose','coveragePercent','log','\x0a✔\x20Workflow\x20started','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','No\x20parent\x20segments\x20found','join','session','format','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','`\x20to\x20download\x20the\x20configuration\x20first','tdx\x20segment\x20parent\x20preview\x20','Preview:','Master\x20Table','label','segment','segment:parent:desc','\x20rows)','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','yes','isDirectory','/\x20and\x20','addAttributesFile','parent_segments','repeat','jsonl','Creating','platform','Created','Status:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','unref','Listing\x20fields\x20for\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20Context\x20set:\x20','FINISHED','\x0aNew\x20parent\x20segment\x20\x27','bold','\x20--attribute\x20\x22','SQL\x20query:\x0a','previewParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','information_schema','2532115nmZUdv','parent_segment','output','\x27\x20is\x20already\x20up\x20to\x20date','Updated','endsWith','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','resolveParentId','displayPreviewHints','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','allValid','Fetching\x20parent\x20segment\x20\x27','Columns:','win32','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','behavior','behaviors','Error:\x20--behavior\x20requires\x20a\x20name\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','customerGroupFile','\x20=\x20','attributes','Create\x20parent\x20segment\x20\x27','To\x20view\x20sample\x20data:','Master\x20+\x20Attributes','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','string','sort','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','customerPercent','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','elapsedTimeMillis','displaySampleData','green','/{name}.yml\x0a','attributesFile','open','6cRFSyl','workflowSessionId','148KdFvHi','Join\x20on:','toLocaleString','Pattern:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','addBehaviors','stop','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','No\x20parent\x20segments\x20match\x20pattern:\x20','11675026hteXYx','\x0a⚠️\x20\x20Both\x20','xdg-open','workflowId','Options:','web','error','\x27...','Events:','\x0aNo\x20sample\x20data\x20available','darwin','replace','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','24QNqqKf','Join:','timezone','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Creating\x20parent\x20segment\x20\x27','segment:parent:sql','👥\x20','displayPreviewResults','toFixed','\x20Opening\x20','Audience\x20ID:','Error:\x20--database\x20and\x20--table\x20are\x20required','.yaml','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x0a⚠️\x20\x20Migrating:\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','foreignKey','jobId','scheduleOption','limit','displayBehaviorsStats','✔\x20Renamed\x20directory\x20to\x20','\x20field','1688659hsbdrE','yellow','audienceId','keys','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:create','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','errors','\x20Configuration\x20is\x20valid','validateParentYaml','behaviorsFile','name','createParent','data','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','rowCount','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Updated\x20parent\x20segment\x20\x27','red','\x20--interval\x20','9tqNLLa','%)\x20','segment:parent:run','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Error:\x20File\x20not\x20found:\x20','test','schemaValid','description','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Output\x20file:\x20','✔\x20No\x20changes\x20-\x20\x27','Error:','totalEvents','map','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','database','length','population','List\x20parent\x20segments','Available\x20behaviors:','displayAttributesStats','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','processedRows','column','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x5c$&','apply','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','site','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','listParents','2885192zDmSDe','Behavior:','/sessions/','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','all','setJobId','customersWithEvents','1894640vxzOBm','YAML\x20file:\x20','workflowAttemptId','34UuSXYY','Error\x20reading\x20file:\x20','scheduleType','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20--enriched','utf-8','\x20--behavior\x20\x22','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','json','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20No\x20sample\x20data\x20available','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20parent\x20segment\x20\x27','Source:','61981pNUbHy','master','List\x20available\x20fields\x20for\x20segmentation','segment:parent:validate','stats'];a29_0x3970=function(){return _0x22730c;};return a29_0x3970();}function a29_0x1973(_0x246fc5,_0x67c0d3){_0x246fc5=_0x246fc5-0x194;const _0x3970b1=a29_0x3970();let _0x1973ec=_0x3970b1[_0x246fc5];return _0x1973ec;}import{spawn}from'child_process';import a29_0x2a32a5 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x52c60f from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a29_0x150261(0x2c4),LEGACY_PARENT_SEGMENT_DIR=a29_0x150261(0x1a6);function openBrowser(_0x2e3638){const _0x3d5f67=a29_0x150261,_0x44a277=process[_0x3d5f67(0x195)],_0x2278a6=_0x44a277===_0x3d5f67(0x1e7)?_0x3d5f67(0x1cd):_0x44a277===_0x3d5f67(0x1b3)?_0x3d5f67(0x27b):_0x3d5f67(0x1df);spawn(_0x2278a6,[_0x2e3638],{'detached':!![],'stdio':_0x3d5f67(0x285)})[_0x3d5f67(0x199)]();}function migrateLegacyDirectory(){const _0xf2a17a=a29_0x150261;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x52e786=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x52e786[_0xf2a17a(0x2c1)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x204)](_0xf2a17a(0x1de)+LEGACY_PARENT_SEGMENT_DIR+_0xf2a17a(0x2c2)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x281)](_0xf2a17a(0x1f9)+LEGACY_PARENT_SEGMENT_DIR+_0xf2a17a(0x292))),![];console[_0xf2a17a(0x1e3)](a29_0x52c60f['yellow'](_0xf2a17a(0x1fa)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x52c60f['green'](_0xf2a17a(0x201)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4185c2){const _0x6a5d11=_0x4185c2 instanceof Error?_0x4185c2[_0xf2a17a(0x264)]:String(_0x4185c2);return console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x217)](_0xf2a17a(0x2b5)+_0x6a5d11+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x150261(0x266)](_0x43ac04){return migrateLegacyDirectory(),super['run'](_0x43ac04);}}function resolveYamlFile(_0x456d46){const _0xc9ea4=a29_0x150261;if(_0x456d46[_0xc9ea4(0x1aa)](_0xc9ea4(0x26b))||_0x456d46[_0xc9ea4(0x1aa)](_0xc9ea4(0x1f7)))return _0x456d46;return a29_0x2a32a5[_0xc9ea4(0x2b2)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x456d46)+_0xc9ea4(0x26b));}function formatProgressMessage(_0x5358c7){const _0x1ff317=a29_0x150261,_0x5c8af0=_0x5358c7['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5c8af0){const [,_0x2b9b55,_0x1d6216,_0x1fb01b='']=_0x5c8af0;return a29_0x52c60f['dim'](_0x2b9b55+':')+'\x20'+_0x1d6216+a29_0x52c60f[_0x1ff317(0x281)](_0x1fb01b);}return a29_0x52c60f[_0x1ff317(0x281)](_0x5358c7);}function showFileNotFoundError(_0xeb605d,_0x4f4893){const _0x164de9=a29_0x150261;console[_0x164de9(0x1e3)](a29_0x52c60f['red'](_0x164de9(0x21d)+_0xeb605d+'\x0a')),console[_0x164de9(0x1e3)](a29_0x52c60f[_0x164de9(0x26c)](_0x164de9(0x298)+_0x4f4893+_0x164de9(0x2b7)));}function showParentSegmentNotSetError(_0x23852c){const _0x20fdf0=a29_0x150261;console[_0x20fdf0(0x1e3)](a29_0x52c60f['yellow'](_0x20fdf0(0x1b8))),console['error'](_0x23852c);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x273);['description']=a29_0x150261(0x22b);async[a29_0x150261(0x26f)](_0x82a9f4){const _0x4104b3=a29_0x150261,{options:_0x3cf10c,args:_0x3d8462,tdx:_0x3ed425}=_0x82a9f4,_0x3da3c4=_0x3d8462[0x0];_0x3cf10c['verbose']&&(console[_0x4104b3(0x1e3)]('Site:\x20'+_0x3cf10c['site']),_0x3da3c4&&console[_0x4104b3(0x1e3)](_0x4104b3(0x1d3)+_0x3da3c4));const _0x4db5a3=await withSpinner(_0x3da3c4?_0x4104b3(0x26a)+_0x3da3c4+_0x4104b3(0x1e4):'Listing\x20parent\x20segments...',()=>_0x3ed425[_0x4104b3(0x2bc)][_0x4104b3(0x237)](),{'verbose':_0x3cf10c['verbose']});let _0xfa9e11=_0x4db5a3[_0x4104b3(0x210)];if(_0x3da3c4){const _0x3779c8=_0x3da3c4[_0x4104b3(0x1e8)](/[.+^${}()|[\]\\]/g,_0x4104b3(0x232))[_0x4104b3(0x1e8)](/\*/g,'.*')[_0x4104b3(0x1e8)](/\?/g,'.'),_0x43b58b=new RegExp('^'+_0x3779c8+'$','i');_0xfa9e11=_0xfa9e11['filter'](_0x41df55=>_0x43b58b[_0x4104b3(0x21e)](_0x41df55[_0x4104b3(0x1bc)][_0x4104b3(0x20e)]));}_0xfa9e11[_0x4104b3(0x1c3)]((_0xacce9f,_0x5bf1a6)=>_0xacce9f[_0x4104b3(0x1bc)][_0x4104b3(0x20e)][_0x4104b3(0x2a6)](_0x5bf1a6[_0x4104b3(0x1bc)][_0x4104b3(0x20e)])),console[_0x4104b3(0x1e3)](_0x4104b3(0x275)+_0xfa9e11[_0x4104b3(0x229)]+'\x20parent\x20segment'+(_0xfa9e11[_0x4104b3(0x229)]!==0x1?'s':''));if(_0x3cf10c[_0x4104b3(0x2b4)]===_0x4104b3(0x24a)||_0x3cf10c[_0x4104b3(0x2b4)]===_0x4104b3(0x2c6))await handleSDKOutput(_0xfa9e11,_0x3cf10c);else{if(_0xfa9e11['length']===0x0)_0x3da3c4?console[_0x4104b3(0x2ad)](_0x4104b3(0x1dc)+_0x3da3c4):console[_0x4104b3(0x2ad)](_0x4104b3(0x2b1));else for(const _0xc8b631 of _0xfa9e11){const _0x2ae177=_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x22a)]?a29_0x52c60f[_0x4104b3(0x281)]('\x20('+formatRows(_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x22a)])+')'):'';console[_0x4104b3(0x2ad)](_0x4104b3(0x1f1)+_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x20e)]+_0x2ae177);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x208);[a29_0x150261(0x220)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x150261(0x26f)](_0x26ef50){const _0x5df90d=a29_0x150261,{options:_0x477305,args:_0x458d0f,tdx:_0x1278cf}=_0x26ef50;console[_0x5df90d(0x1e3)](_0x5df90d(0x2b0)+_0x5df90d(0x22e)+_0x5df90d(0x283));const _0x5894e6=_0x477305;if(_0x458d0f[_0x5df90d(0x229)]===0x0)return console[_0x5df90d(0x1e3)](a29_0x52c60f[_0x5df90d(0x217)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x5df90d(0x1e3)](_0x5df90d(0x249)),0x1;const _0x1845b5=_0x458d0f[0x0];if(!_0x5894e6['database']||!_0x5894e6['table'])return console[_0x5df90d(0x1e3)](_0x5df90d(0x1f6)),console[_0x5df90d(0x1e3)](_0x5df90d(0x249)),0x1;_0x5894e6[_0x5df90d(0x2ab)]&&(console['error']('Site:\x20'+_0x5894e6[_0x5df90d(0x235)]),console[_0x5df90d(0x1e3)](_0x5df90d(0x1c0)+_0x1845b5),console[_0x5df90d(0x1e3)]('Database:\x20'+_0x5894e6[_0x5df90d(0x228)]),console[_0x5df90d(0x1e3)]('Table:\x20'+_0x5894e6[_0x5df90d(0x272)]));const _0x59e561=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x1bc)],_0x5894e6[_0x5df90d(0x1cc)]),_0x14aba1=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x1b6)],_0x5894e6[_0x5df90d(0x20d)]),_0x4506da=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x260)],_0x5894e6[_0x5df90d(0x1ba)]),_0x53fcd5={'name':_0x1845b5,'description':_0x5894e6['description'],'scheduleType':_0x5894e6[_0x5df90d(0x244)],'scheduleOption':_0x5894e6[_0x5df90d(0x1fe)],'timezone':_0x5894e6[_0x5df90d(0x1ed)],'master':{'parentDatabaseName':_0x5894e6[_0x5df90d(0x228)],'parentTableName':_0x5894e6['table']},'attributes':_0x59e561,'behaviors':_0x14aba1,'customerGroup':_0x4506da},_0x8391dc=await withSpinner(_0x5df90d(0x1ef)+_0x1845b5+_0x5df90d(0x1e4),()=>_0x1278cf[_0x5df90d(0x2bc)][_0x5df90d(0x20f)](_0x53fcd5),{'verbose':_0x477305[_0x5df90d(0x2ab)]}),_0x476bbf=_0x8391dc[_0x5df90d(0x210)];return console[_0x5df90d(0x1e3)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x476bbf[_0x5df90d(0x20e)]+'\x27\x20with\x20ID:\x20'+_0x476bbf['id']),await handleSDKOutput([_0x476bbf],_0x477305),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a29_0x150261(0x2a0);[a29_0x150261(0x220)]=a29_0x150261(0x1f8);async[a29_0x150261(0x26f)](_0x567e1e){const _0x57f714=a29_0x150261,{options:_0x14bfc4,args:_0x262723,tdx:_0x23d400}=_0x567e1e;console[_0x57f714(0x1e3)](_0x57f714(0x1d6)+_0x57f714(0x22e)+_0x57f714(0x283));const _0x12e8eb=_0x14bfc4;if(_0x262723['length']===0x0)return console[_0x57f714(0x1e3)](a29_0x52c60f[_0x57f714(0x217)](_0x57f714(0x215))),console[_0x57f714(0x1e3)](_0x57f714(0x1c1)),0x1;const _0x158e88=_0x262723[0x0];_0x12e8eb['verbose']&&(console[_0x57f714(0x1e3)](_0x57f714(0x270)+_0x12e8eb[_0x57f714(0x235)]),console['error'](_0x57f714(0x2a1)+_0x158e88));const _0x2d2a16=await withSpinner(_0x57f714(0x24b)+_0x158e88+'\x27...',()=>_0x23d400['segment'][_0x57f714(0x276)](_0x158e88),{'verbose':_0x12e8eb[_0x57f714(0x2ab)]}),_0x1b5014=_0x2d2a16[_0x57f714(0x210)],_0x4db47d=await loadJSONFromOptions(_0x12e8eb['addAttributes'],_0x12e8eb[_0x57f714(0x2c3)]),_0x5b3671=await loadJSONFromOptions(_0x12e8eb[_0x57f714(0x1d8)],_0x12e8eb['addBehaviorsFile']),_0x5a638b={'name':_0x1b5014[_0x57f714(0x20e)],'description':_0x12e8eb[_0x57f714(0x220)]!==undefined?_0x12e8eb[_0x57f714(0x220)]:_0x1b5014[_0x57f714(0x220)],'scheduleType':_0x12e8eb[_0x57f714(0x244)]!==undefined?_0x12e8eb[_0x57f714(0x244)]:_0x1b5014[_0x57f714(0x244)],'scheduleOption':_0x12e8eb['scheduleOption']!==undefined?_0x12e8eb[_0x57f714(0x1fe)]:_0x1b5014[_0x57f714(0x1fe)],'timezone':_0x12e8eb['timezone']!==undefined?_0x12e8eb[_0x57f714(0x1ed)]:_0x1b5014[_0x57f714(0x1ed)],'master':_0x1b5014[_0x57f714(0x252)],'attributes':_0x4db47d?[..._0x1b5014['attributes']||[],..._0x4db47d]:_0x1b5014[_0x57f714(0x1bc)],'behaviors':_0x5b3671?[..._0x1b5014[_0x57f714(0x1b6)]||[],..._0x5b3671]:_0x1b5014[_0x57f714(0x1b6)],'customerGroup':_0x1b5014[_0x57f714(0x260)]},_0x5e5d44=await withSpinner(_0x57f714(0x1ab)+_0x158e88+'\x27...',()=>_0x23d400[_0x57f714(0x2bc)]['updateParent'](_0x158e88,_0x5a638b),{'verbose':_0x12e8eb[_0x57f714(0x2ab)]}),_0x21a381=_0x5e5d44[_0x57f714(0x210)];return console[_0x57f714(0x1e3)](_0x57f714(0x216)+_0x21a381[_0x57f714(0x20e)]+'\x27'),await handleSDKOutput([_0x21a381],_0x12e8eb),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x28e);[a29_0x150261(0x220)]=a29_0x150261(0x23b);async['execute'](_0xb6a4a3){const _0x4b3d4e=a29_0x150261,{options:_0xf09f0f,args:_0x50760d,tdx:_0x3698f0}=_0xb6a4a3,_0x563811=_0xf09f0f,_0x23e2a5=_0x50760d[0x0]||_0xf09f0f[_0x4b3d4e(0x278)];if(!_0x23e2a5)return showParentSegmentNotSetError(_0x4b3d4e(0x209)+_0x4b3d4e(0x1c5)),0x1;if(_0x563811['use']&&_0x563811[_0x4b3d4e(0x1a7)])return console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x217)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x281)](_0x4b3d4e(0x221))),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x281)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4b3d4e(0x1cb))),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x26c)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x2b2565=_0x563811['output']||a29_0x2a32a5[_0x4b3d4e(0x2b2)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x23e2a5)+_0x4b3d4e(0x26b));_0x563811['verbose']&&(console[_0x4b3d4e(0x1e3)](_0x4b3d4e(0x270)+_0x563811[_0x4b3d4e(0x235)]),console[_0x4b3d4e(0x1e3)]('Parent\x20segment:\x20'+_0x23e2a5),console[_0x4b3d4e(0x1e3)](_0x4b3d4e(0x222)+_0x2b2565));const _0x464140=await withSpinner(_0x4b3d4e(0x1b1)+_0x23e2a5+_0x4b3d4e(0x1e4),()=>_0x3698f0[_0x4b3d4e(0x2bc)][_0x4b3d4e(0x299)](_0x23e2a5),{'verbose':_0x563811[_0x4b3d4e(0x2ab)]}),_0x11c077=_0x464140[_0x4b3d4e(0x210)];if(existsSync(_0x2b2565)){const _0x231662=readFileSync(_0x2b2565,'utf-8'),_0x2dcfd9=generateDiff(_0x231662,_0x11c077);if(!hasChanges(_0x2dcfd9))console[_0x4b3d4e(0x1e3)](a29_0x52c60f['green']('✔')+_0x4b3d4e(0x27a)+a29_0x52c60f['cyan'](_0x2b2565)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x4b3d4e(0x1e3)]('\x0aChanges\x20to\x20\x27'+_0x2b2565+'\x27:'),console['error']('─'[_0x4b3d4e(0x2c5)](0x3c)),console[_0x4b3d4e(0x1e3)](formatDiffWithColors(_0x2dcfd9)),console[_0x4b3d4e(0x1e3)]('─'[_0x4b3d4e(0x2c5)](0x3c));if(!_0x563811[_0x4b3d4e(0x2c0)]){const _0x3c9d05=await confirmKey('Overwrite\x20\x27'+_0x2b2565+'\x27?');if(!_0x3c9d05)return console[_0x4b3d4e(0x1e3)]('Aborted.'),0x1;}writeFileSync(_0x2b2565,_0x11c077,_0x4b3d4e(0x247)),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a29_0x52c60f[_0x4b3d4e(0x26c)](_0x2b2565));}}else{const _0x8c6968=a29_0x2a32a5['dirname'](_0x2b2565);!existsSync(_0x8c6968)&&mkdirSync(_0x8c6968,{'recursive':!![]}),writeFileSync(_0x2b2565,_0x11c077,_0x4b3d4e(0x247)),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+_0x4b3d4e(0x269)+a29_0x52c60f[_0x4b3d4e(0x26c)](_0x2b2565));}return saveSessionContext({'parent_segment':_0x23e2a5},_0x563811[_0x4b3d4e(0x2b3)]),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+_0x4b3d4e(0x19c)+a29_0x52c60f['dim'](_0x4b3d4e(0x1a6))+_0x4b3d4e(0x1bb)+a29_0x52c60f['cyan'](_0x23e2a5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x26e);[a29_0x150261(0x220)]=a29_0x150261(0x2af);async[a29_0x150261(0x26f)](_0x5ef96b){const _0xd2b4e7=a29_0x150261,{options:_0x218311,args:_0x4edaf8,tdx:_0x2c6794}=_0x5ef96b,_0x43c29b=_0x218311,_0xd17189=_0x4edaf8[0x0]||_0x218311['parentSegment'];if(!_0xd17189)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0xd2b4e7(0x245)),0x1;const _0x4dad05=resolveYamlFile(_0xd17189);if(!existsSync(_0x4dad05))return showFileNotFoundError(_0x4dad05,_0xd17189),0x1;_0x43c29b[_0xd2b4e7(0x2ab)]&&(console['error']('Site:\x20'+_0x43c29b['site']),console[_0xd2b4e7(0x1e3)]('YAML\x20file:\x20'+_0x4dad05));let _0x3dc53a;try{_0x3dc53a=readFileSync(_0x4dad05,_0xd2b4e7(0x247));}catch(_0x286856){const _0x5237bb=_0x286856 instanceof Error?_0x286856['message']:String(_0x286856);return console[_0xd2b4e7(0x1e3)]('Error\x20reading\x20file:\x20'+_0x5237bb),0x1;}const _0x4172d6=await withSpinner('Analyzing\x20changes...',()=>_0x2c6794['segment']['pushParentYaml'](_0x3dc53a),{'verbose':_0x43c29b[_0xd2b4e7(0x2ab)]}),_0x4f317b=_0x4172d6[_0xd2b4e7(0x210)],{isNew:_0x36d947,name:_0x2a2bf2,hasChanges:_0x30f7fd,diffFormatted:_0x1f6806}=_0x4f317b;if(!_0x30f7fd)return console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x223)+_0x2a2bf2+_0xd2b4e7(0x1a8)),0x0;_0x36d947?console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x19e)+_0x2a2bf2+'\x27:'):console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x1b9)+_0x2a2bf2+'\x27:');console[_0xd2b4e7(0x1e3)]('─'[_0xd2b4e7(0x2c5)](0x3c)),console[_0xd2b4e7(0x1e3)](_0x1f6806),console['error']('─'['repeat'](0x3c));const _0x3c4d40=_0x36d947?_0xd2b4e7(0x1bd)+_0x2a2bf2+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2a2bf2+'\x27?';if(!_0x43c29b[_0xd2b4e7(0x2c0)]){const _0x5e05dd=await confirmKey(_0x3c4d40);if(!_0x5e05dd)return console['error'](_0xd2b4e7(0x277)),0x1;}const _0x31c5b0=_0x36d947?_0xd2b4e7(0x194):_0xd2b4e7(0x29d),_0x55a083=await withSpinner(_0x31c5b0+'\x20parent\x20segment\x20\x27'+_0x2a2bf2+_0xd2b4e7(0x1e4),()=>_0x4f317b[_0xd2b4e7(0x233)](),{'verbose':_0x43c29b[_0xd2b4e7(0x2ab)]}),_0x3c720c=_0x55a083[_0xd2b4e7(0x210)],_0x4b7c33=getConsoleNextUrl(_0x43c29b[_0xd2b4e7(0x235)],_0xd2b4e7(0x291)+_0x3c720c['id']),_0x5c7401=_0x36d947?_0xd2b4e7(0x196):_0xd2b4e7(0x1a9);return console[_0xd2b4e7(0x1e3)]('✔\x20'+_0x5c7401+'\x20parent\x20segment\x20\x27'+_0x3c720c[_0xd2b4e7(0x20e)]+'\x27'),console[_0xd2b4e7(0x1e3)]('\x20\x20'+_0x4b7c33),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x254);[a29_0x150261(0x220)]=a29_0x150261(0x227);async['execute'](_0xf27a1d){const _0x165c79=a29_0x150261,{options:_0x53a807,args:_0x2acde1,tdx:_0x549d20}=_0xf27a1d,_0x41d309=_0x53a807,_0x4dda91=_0x2acde1[0x0]||_0x53a807[_0x165c79(0x278)];if(!_0x4dda91)return showParentSegmentNotSetError(_0x165c79(0x29f)+_0x165c79(0x24e)+'Options:\x0a'+_0x165c79(0x234)+_0x165c79(0x1b4)+_0x165c79(0x19b)),0x1;const _0xea4e66=resolveYamlFile(_0x4dda91);if(!existsSync(_0xea4e66))return showFileNotFoundError(_0xea4e66,_0x4dda91),0x1;_0x41d309[_0x165c79(0x2ab)]&&(console[_0x165c79(0x1e3)]('Site:\x20'+_0x41d309[_0x165c79(0x235)]),console[_0x165c79(0x1e3)]('YAML\x20file:\x20'+_0xea4e66));let _0x36b9ea;try{_0x36b9ea=readFileSync(_0xea4e66,_0x165c79(0x247));}catch(_0x1939c7){const _0x40ae07=_0x1939c7 instanceof Error?_0x1939c7[_0x165c79(0x264)]:String(_0x1939c7);return console[_0x165c79(0x1e3)](_0x165c79(0x243)+_0x40ae07),0x1;}const _0x258325=createCommandSpinner(a29_0x52c60f[_0x165c79(0x281)]('Validating\x20configuration...'),{'verbose':_0x41d309[_0x165c79(0x2ab)]});_0x258325[_0x165c79(0x27b)]();const _0x3033d5={'onProgress':_0xb544c=>{const _0x4d6c9e=_0x165c79;_0x258325[_0x4d6c9e(0x27d)]=formatProgressMessage(_0xb544c);}};if(_0x41d309[_0x165c79(0x252)])_0x3033d5[_0x165c79(0x252)]=!![];if(_0x41d309[_0x165c79(0x26d)])_0x3033d5['enriched']=!![];_0x41d309[_0x165c79(0x257)]&&(_0x3033d5[_0x165c79(0x257)]=_0x41d309[_0x165c79(0x257)]);_0x41d309[_0x165c79(0x1b5)]&&(_0x3033d5[_0x165c79(0x1b5)]=_0x41d309[_0x165c79(0x1b5)]);if(_0x41d309[_0x165c79(0x29c)])_0x3033d5[_0x165c79(0x29c)]=_0x41d309[_0x165c79(0x29c)];let _0x490373;try{_0x490373=await _0x549d20['segment'][_0x165c79(0x20c)](_0x36b9ea,_0x3033d5),_0x258325[_0x165c79(0x1d9)]();}catch(_0x1465f2){_0x258325[_0x165c79(0x1d9)]();throw _0x1465f2;}const _0x2aff3d=_0x41d309[_0x165c79(0x29c)]||_0x165c79(0x2a9);return this[_0x165c79(0x211)](_0x490373,_0x3033d5,_0xea4e66,_0x2aff3d),_0x490373[_0x165c79(0x1b0)]?0x0:0x1;}['displayValidateResults'](_0x4035aa,_0x348e84,_0x1d8759,_0xfdb20d){const _0x2812c4=a29_0x150261;console[_0x2812c4(0x1e3)]('\x0a'+a29_0x52c60f[_0x2812c4(0x19f)]('Validate:')+'\x20'+_0x4035aa[_0x2812c4(0x20e)]),console[_0x2812c4(0x1e3)]('═'[_0x2812c4(0x2c5)](0x3c)),this['displayMasterInfo'](_0x4035aa);if(typeof _0x348e84[_0x2812c4(0x257)]==='string'){this[_0x2812c4(0x22d)](_0x4035aa),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x257),_0x348e84[_0x2812c4(0x257)]);return;}if(_0x348e84[_0x2812c4(0x257)]===!![]){this[_0x2812c4(0x22d)](_0x4035aa),this['displaySummary'](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1bc));return;}if(typeof _0x348e84['behavior']===_0x2812c4(0x1c2)){this['displayBehaviorsStats'](_0x4035aa,_0xfdb20d),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1b5),_0x348e84[_0x2812c4(0x1b5)]);return;}if(_0x348e84[_0x2812c4(0x1b5)]===!![]){this[_0x2812c4(0x200)](_0x4035aa,_0xfdb20d),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1b6));return;}this[_0x2812c4(0x22d)](_0x4035aa),this[_0x2812c4(0x200)](_0x4035aa,_0xfdb20d),this['displaySummary'](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x23c));}[a29_0x150261(0x1ae)](_0x27637d,_0x2ab7cd,_0x4ef1e5,_0x4a137c){const _0x22e609=a29_0x150261;console[_0x22e609(0x1e3)]('\x0a'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x1be)));const _0x1c343f=_0x2ab7cd!==_0x22e609(0x2a9)?_0x22e609(0x218)+_0x2ab7cd:'';if(_0x4ef1e5==='attribute'&&_0x4a137c)console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x1a0)+_0x4a137c+'\x22'+_0x1c343f));else{if(_0x4ef1e5==='behavior'&&_0x4a137c)console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x248)+_0x4a137c+'\x22'+_0x1c343f));else(_0x4ef1e5===_0x22e609(0x1bc)||_0x4ef1e5==='all')&&console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x268)+_0x1c343f));}(_0x4ef1e5===_0x22e609(0x1b6)||_0x4ef1e5===_0x22e609(0x23c))&&console['error']('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x2a7)+_0x1c343f)),_0x4ef1e5===_0x22e609(0x23c)&&console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x246)+_0x1c343f));}['displayMasterInfo'](_0xe466e0){const _0x2f1f63=a29_0x150261,{master:_0x562001}=_0xe466e0,_0x39c8d8=_0x562001[_0x2f1f63(0x21f)]?a29_0x52c60f[_0x2f1f63(0x1ca)]('✔'):a29_0x52c60f[_0x2f1f63(0x217)]('✘');console['error']('\x0a'+a29_0x52c60f[_0x2f1f63(0x281)](_0x2f1f63(0x2ba))),console['error'](_0x39c8d8+'\x20'+a29_0x52c60f[_0x2f1f63(0x19f)](_0x562001['database']+'.'+_0x562001['table'])),_0x562001[_0x2f1f63(0x21f)]?_0x562001['rowCount']!==undefined&&console[_0x2f1f63(0x1e3)]('\x20\x20'+a29_0x52c60f['dim'](_0x2f1f63(0x289))+'\x20'+a29_0x52c60f[_0x2f1f63(0x26c)](formatRows(_0x562001[_0x2f1f63(0x213)]))):console[_0x2f1f63(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x2f1f63(0x217)](_0x2f1f63(0x224))+'\x20'+_0x562001[_0x2f1f63(0x280)]);}[a29_0x150261(0x22d)](_0x205015){const _0x47f8b3=a29_0x150261;if(_0x205015[_0x47f8b3(0x1bc)][_0x47f8b3(0x229)]===0x0)return;console[_0x47f8b3(0x1e3)]('\x0a'+a29_0x52c60f[_0x47f8b3(0x281)]('Attributes'));for(const _0x27d9b8 of _0x205015[_0x47f8b3(0x1bc)]){const _0xb2bf99=_0x27d9b8[_0x47f8b3(0x21f)]?a29_0x52c60f[_0x47f8b3(0x1ca)]('✔'):a29_0x52c60f[_0x47f8b3(0x217)]('✘');let _0x41c5e5='';if(_0x27d9b8[_0x47f8b3(0x21f)]&&_0x27d9b8[_0x47f8b3(0x293)]!==undefined&&_0x27d9b8[_0x47f8b3(0x2ac)]!==undefined){const _0x4727e4=_0x27d9b8[_0x47f8b3(0x2ac)][_0x47f8b3(0x1f3)](0x1),_0x5a3912=_0x27d9b8[_0x47f8b3(0x2ac)]>=0x50?a29_0x52c60f['green']:_0x27d9b8[_0x47f8b3(0x2ac)]>=0x32?a29_0x52c60f[_0x47f8b3(0x204)]:a29_0x52c60f['red'];_0x41c5e5='\x20'+a29_0x52c60f[_0x47f8b3(0x281)]('Coverage:')+'\x20'+_0x5a3912(_0x4727e4+'%')+'\x20('+formatRows(_0x27d9b8[_0x47f8b3(0x293)])+_0x47f8b3(0x2be);}console['error'](_0xb2bf99+'\x20'+a29_0x52c60f[_0x47f8b3(0x19f)](_0x27d9b8[_0x47f8b3(0x20e)])+_0x41c5e5),console[_0x47f8b3(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x250))+'\x20'+a29_0x52c60f[_0x47f8b3(0x19f)](_0x27d9b8['database']+'.'+_0x27d9b8['table']));const _0x24abd6=_0x27d9b8[_0x47f8b3(0x28c)]===_0x27d9b8[_0x47f8b3(0x1fc)]?a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1d1))+'\x20'+_0x27d9b8[_0x47f8b3(0x28c)]:a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1ec))+'\x20'+_0x27d9b8[_0x47f8b3(0x28c)]+_0x47f8b3(0x1bb)+_0x27d9b8['foreignKey'];console[_0x47f8b3(0x1e3)]('\x20\x20'+_0x24abd6),console['error']('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1b2))),this[_0x47f8b3(0x296)](_0x27d9b8[_0x47f8b3(0x297)]),!_0x27d9b8[_0x47f8b3(0x21f)]&&console[_0x47f8b3(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x217)](_0x47f8b3(0x224))+'\x20'+_0x27d9b8[_0x47f8b3(0x280)]);}}[a29_0x150261(0x200)](_0x593165,_0x47251b){const _0x3a9254=a29_0x150261;if(_0x593165[_0x3a9254(0x1b6)]['length']===0x0)return;console[_0x3a9254(0x1e3)]('\x0a'+a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x1e9))+'\x20'+a29_0x52c60f['dim']('('+_0x47251b+')'));for(const _0x265f00 of _0x593165['behaviors']){const _0x39ab25=_0x265f00[_0x3a9254(0x21f)]?a29_0x52c60f[_0x3a9254(0x1ca)]('✔'):a29_0x52c60f[_0x3a9254(0x217)]('✘');let _0x39b1ec='';if(_0x265f00[_0x3a9254(0x21f)]&&_0x265f00['customersWithEvents']!==undefined&&_0x265f00[_0x3a9254(0x225)]!==undefined){const _0xedd7da=_0x265f00['customerPercent']?.[_0x3a9254(0x1f3)](0x1)||'?',_0x301dcd=(_0x265f00[_0x3a9254(0x1c6)]??0x0)>=0x32?a29_0x52c60f[_0x3a9254(0x1ca)]:(_0x265f00['customerPercent']??0x0)>=0x14?a29_0x52c60f[_0x3a9254(0x204)]:a29_0x52c60f[_0x3a9254(0x217)];_0x39b1ec='\x20'+a29_0x52c60f[_0x3a9254(0x281)]('Customers:')+'\x20'+_0x301dcd(formatRows(_0x265f00[_0x3a9254(0x23e)]))+'\x20('+_0xedd7da+_0x3a9254(0x21a)+a29_0x52c60f['dim'](_0x3a9254(0x1e5))+'\x20'+a29_0x52c60f['cyan'](formatRows(_0x265f00[_0x3a9254(0x225)]));}console[_0x3a9254(0x1e3)](_0x39ab25+'\x20'+a29_0x52c60f[_0x3a9254(0x19f)](_0x265f00['name'])+_0x39b1ec),console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x250))+'\x20'+a29_0x52c60f[_0x3a9254(0x19f)](_0x265f00[_0x3a9254(0x228)]+'.'+_0x265f00[_0x3a9254(0x272)]));const _0x3258d8=_0x265f00[_0x3a9254(0x28c)]===_0x265f00[_0x3a9254(0x1fc)]?a29_0x52c60f['dim']('Join\x20on:')+'\x20'+_0x265f00[_0x3a9254(0x28c)]:a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x1ec))+'\x20'+_0x265f00[_0x3a9254(0x28c)]+_0x3a9254(0x1bb)+_0x265f00[_0x3a9254(0x1fc)];console[_0x3a9254(0x1e3)]('\x20\x20'+_0x3258d8),console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x281)]('Columns:')),this[_0x3a9254(0x296)](_0x265f00[_0x3a9254(0x297)]),!_0x265f00['schemaValid']&&console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x217)]('Error:')+'\x20'+_0x265f00[_0x3a9254(0x280)]);}}[a29_0x150261(0x296)](_0x109152){const _0x3d1bdd=a29_0x150261;for(const _0x2ddff6 of _0x109152){_0x2ddff6[_0x3d1bdd(0x2bb)]===_0x2ddff6[_0x3d1bdd(0x230)]||_0x2ddff6['column']==='*'?console[_0x3d1bdd(0x1e3)](_0x3d1bdd(0x29b)+_0x2ddff6[_0x3d1bdd(0x2bb)]):console['error'](_0x3d1bdd(0x29b)+_0x2ddff6['label']+'\x20'+a29_0x52c60f['dim']('('+_0x2ddff6[_0x3d1bdd(0x230)]+')'));}}['displaySummary'](_0x1edbde){const _0x53809b=a29_0x150261;console[_0x53809b(0x1e3)]('─'[_0x53809b(0x2c5)](0x3c));if(_0x1edbde[_0x53809b(0x20a)][_0x53809b(0x229)]>0x0){console['error']('\x0a'+a29_0x52c60f[_0x53809b(0x217)](_0x53809b(0x27c)));for(const _0x517759 of _0x1edbde['errors']){console[_0x53809b(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x53809b(0x217)]('•')+'\x20'+_0x517759);}}_0x1edbde[_0x53809b(0x1b0)]&&console[_0x53809b(0x1e3)]('\x0a'+a29_0x52c60f['green']('✔')+_0x53809b(0x20b));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x274);[a29_0x150261(0x220)]=a29_0x150261(0x207);async[a29_0x150261(0x26f)](_0x172888){const _0x1cdb90=a29_0x150261,{options:_0x347c99,args:_0x2f081e,tdx:_0xc5468}=_0x172888,_0x271137=_0x347c99,_0x558938=_0x2f081e[0x0]||_0x347c99[_0x1cdb90(0x278)];if(!_0x558938)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'+_0x1cdb90(0x212)+_0x1cdb90(0x256)+_0x1cdb90(0x1d4)+_0x1cdb90(0x198)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x1cdb90(0x1c4)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x271137[_0x1cdb90(0x252)]&&!_0x271137[_0x1cdb90(0x257)]&&!_0x271137[_0x1cdb90(0x1b5)]&&!_0x271137['enriched'])return console['error'](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x294))),console['error'](_0x1cdb90(0x28d)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1e1)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x2b6)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1a3)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x259)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1af)),0x1;const _0xe60df0=resolveYamlFile(_0x558938);if(!existsSync(_0xe60df0))return showFileNotFoundError(_0xe60df0,_0x558938),0x1;_0x271137[_0x1cdb90(0x2ab)]&&(console[_0x1cdb90(0x1e3)]('Site:\x20'+_0x271137[_0x1cdb90(0x235)]),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x240)+_0xe60df0));let _0x4363d2;try{_0x4363d2=readFileSync(_0xe60df0,'utf-8');}catch(_0xb76b26){const _0x5e45ef=_0xb76b26 instanceof Error?_0xb76b26['message']:String(_0xb76b26);return console[_0x1cdb90(0x1e3)](_0x1cdb90(0x243)+_0x5e45ef),0x1;}let _0x161794;try{_0x161794=parseYamlString(_0x4363d2);}catch(_0x3f4daf){const _0x51b59b=_0x3f4daf instanceof Error?_0x3f4daf[_0x1cdb90(0x264)]:String(_0x3f4daf);return console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)]('Error\x20parsing\x20YAML:\x20'+_0x51b59b)),0x1;}if(_0x271137[_0x1cdb90(0x257)]===!![]||_0x271137[_0x1cdb90(0x257)]===''){const _0x31bb7d=_0x161794[_0x1cdb90(0x1bc)]?.[_0x1cdb90(0x226)](_0x16cb33=>_0x16cb33['name'])||[];if(_0x31bb7d[_0x1cdb90(0x229)]===0x0)console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x236)));else{console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x214))),console[_0x1cdb90(0x1e3)]('Available\x20attributes:');for(const _0x1e6bfd of _0x31bb7d){console['error']('\x20\x20'+a29_0x52c60f[_0x1cdb90(0x26c)](_0x1e6bfd));}console['error'](_0x1cdb90(0x284)+_0x558938+'\x20--attribute\x20\x22'+_0x31bb7d[0x0]+'\x22');}return 0x1;}if(_0x271137[_0x1cdb90(0x1b5)]===!![]||_0x271137[_0x1cdb90(0x1b5)]===''){const _0x797410=_0x161794[_0x1cdb90(0x1b6)]?.[_0x1cdb90(0x226)](_0x62d260=>_0x62d260['name'])||[];if(_0x797410[_0x1cdb90(0x229)]===0x0)console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x2a8)));else{console['error'](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x1b7))),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x22c));for(const _0xa8460 of _0x797410){console[_0x1cdb90(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x1cdb90(0x26c)](_0xa8460));}console[_0x1cdb90(0x1e3)](_0x1cdb90(0x284)+_0x558938+_0x1cdb90(0x248)+_0x797410[0x0]+'\x22');}return 0x1;}const _0x351945=createCommandSpinner(a29_0x52c60f[_0x1cdb90(0x281)](_0x1cdb90(0x27f)),{'verbose':_0x271137['verbose']});_0x351945[_0x1cdb90(0x27b)]();const _0x164810={'onProgress':_0x1b2aa9=>{const _0x56ec26=_0x1cdb90;_0x351945[_0x56ec26(0x27d)]=formatProgressMessage(_0x1b2aa9);}};if(_0x271137[_0x1cdb90(0x252)])_0x164810[_0x1cdb90(0x252)]=!![];if(_0x271137['attribute']&&typeof _0x271137[_0x1cdb90(0x257)]===_0x1cdb90(0x1c2))_0x164810['attribute']=_0x271137[_0x1cdb90(0x257)];if(_0x271137[_0x1cdb90(0x1b5)]&&typeof _0x271137[_0x1cdb90(0x1b5)]===_0x1cdb90(0x1c2))_0x164810[_0x1cdb90(0x1b5)]=_0x271137[_0x1cdb90(0x1b5)];if(_0x271137[_0x1cdb90(0x26d)])_0x164810[_0x1cdb90(0x26d)]=!![];if(_0x271137[_0x1cdb90(0x29c)])_0x164810['interval']=_0x271137[_0x1cdb90(0x29c)];let _0x331579;try{_0x331579=await _0xc5468[_0x1cdb90(0x2bc)][_0x1cdb90(0x1a2)](_0x4363d2,_0x164810),_0x351945[_0x1cdb90(0x1d9)]();}catch(_0x3204ab){_0x351945[_0x1cdb90(0x1d9)]();throw _0x3204ab;}return await this['displayPreviewResults'](_0x331579,{'master':_0x271137[_0x1cdb90(0x252)],'attribute':typeof _0x271137[_0x1cdb90(0x257)]===_0x1cdb90(0x1c2)?_0x271137['attribute']:undefined,'behavior':typeof _0x271137[_0x1cdb90(0x1b5)]==='string'?_0x271137[_0x1cdb90(0x1b5)]:undefined,'enriched':_0x271137[_0x1cdb90(0x26d)]}),_0x331579[_0x1cdb90(0x1b0)]?0x0:0x1;}async[a29_0x150261(0x1f2)](_0x5ea2a2,_0x5ea779){const _0x3bf4f9=a29_0x150261;console['error']('\x0a'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x3bf4f9(0x2b9))+'\x20'+_0x5ea2a2[_0x3bf4f9(0x20e)]),console[_0x3bf4f9(0x1e3)]('═'[_0x3bf4f9(0x2c5)](0x3c));if(_0x5ea779[_0x3bf4f9(0x252)]&&_0x5ea2a2[_0x3bf4f9(0x262)]){const _0x5415bc=a29_0x52c60f['dim'](_0x3bf4f9(0x290))+'\x20'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x5ea2a2[_0x3bf4f9(0x252)][_0x3bf4f9(0x228)]+'.'+_0x5ea2a2[_0x3bf4f9(0x252)]['table']);await this[_0x3bf4f9(0x1c9)](_0x5415bc,_0x5ea2a2[_0x3bf4f9(0x262)]);}else{if(_0x5ea779[_0x3bf4f9(0x257)]&&_0x5ea2a2['sampleData']){const _0x374e6e=a29_0x52c60f['dim']('Attribute:')+'\x20'+a29_0x52c60f['bold'](_0x5ea779[_0x3bf4f9(0x257)]);await this[_0x3bf4f9(0x1c9)](_0x374e6e,_0x5ea2a2['sampleData']);}else{if(_0x5ea779[_0x3bf4f9(0x1b5)]&&_0x5ea2a2[_0x3bf4f9(0x262)]){const _0x3b3977=a29_0x52c60f[_0x3bf4f9(0x281)](_0x3bf4f9(0x239))+'\x20'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x5ea779['behavior']);await this[_0x3bf4f9(0x1c9)](_0x3b3977,_0x5ea2a2[_0x3bf4f9(0x262)]);}else{if(_0x5ea779[_0x3bf4f9(0x26d)]&&_0x5ea2a2['sampleData']){const _0x2199e3=a29_0x52c60f['dim']('Enriched:')+'\x20'+a29_0x52c60f['bold'](_0x3bf4f9(0x1bf));await this[_0x3bf4f9(0x1c9)](_0x2199e3,_0x5ea2a2[_0x3bf4f9(0x262)]);}else!_0x5ea2a2[_0x3bf4f9(0x262)]&&console['error'](_0x3bf4f9(0x1e6));}}}if(_0x5ea2a2[_0x3bf4f9(0x20a)][_0x3bf4f9(0x229)]>0x0){console[_0x3bf4f9(0x1e3)]('─'[_0x3bf4f9(0x2c5)](0x3c)),console[_0x3bf4f9(0x1e3)]('\x0a'+a29_0x52c60f['red'](_0x3bf4f9(0x27c)));for(const _0x576aa0 of _0x5ea2a2['errors']){console['error']('\x20\x20'+a29_0x52c60f[_0x3bf4f9(0x217)]('•')+'\x20'+_0x576aa0);}}}async[a29_0x150261(0x1c9)](_0x3e14df,_0x571b8f){const _0x5373fc=a29_0x150261;if(_0x571b8f[_0x5373fc(0x229)]===0x0){console[_0x5373fc(0x1e3)]('\x0a'+_0x3e14df),console[_0x5373fc(0x1e3)](_0x5373fc(0x24d));return;}console[_0x5373fc(0x1e3)]('\x0a'+_0x3e14df);const _0x57168c=Object[_0x5373fc(0x206)](_0x571b8f[0x0])['map'](_0x5c6e7d=>({'name':_0x5c6e7d,'type':typeof _0x571b8f[0x0][_0x5c6e7d]===_0x5373fc(0x25f)?_0x5373fc(0x1da):_0x5373fc(0x271)})),_0x1b7e2b={'queryId':_0x5373fc(0x288),'columns':_0x57168c,'data':_0x571b8f,'stats':{'state':_0x5373fc(0x19d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x571b8f[_0x5373fc(0x229)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2decf8=formatAsTable(_0x1b7e2b,_0x571b8f[_0x5373fc(0x229)],!![]);await writeOutput(_0x2decf8,undefined,_0x5373fc(0x272));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x21b);[a29_0x150261(0x220)]=a29_0x150261(0x295);async[a29_0x150261(0x26f)](_0x309859){const _0x3909d8=a29_0x150261,{options:_0x4c9793,args:_0x230c02,tdx:_0x2d6d0f}=_0x309859,_0x4efef9=_0x4c9793,_0x5f46d1=_0x230c02[0x0]||_0x4c9793[_0x3909d8(0x278)];if(!_0x5f46d1)return showParentSegmentNotSetError(_0x3909d8(0x1d5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1e1aff=resolveYamlFile(_0x5f46d1);if(existsSync(_0x1e1aff)){_0x4efef9[_0x3909d8(0x2ab)]&&console[_0x3909d8(0x1e3)](_0x3909d8(0x267)+_0x1e1aff);let _0x3557e;try{_0x3557e=readFileSync(_0x1e1aff,_0x3909d8(0x247));}catch(_0x359ddc){const _0x25d8cc=_0x359ddc instanceof Error?_0x359ddc['message']:String(_0x359ddc);return console[_0x3909d8(0x1e3)](_0x3909d8(0x243)+_0x25d8cc),0x1;}const _0x4f6c41=await withSpinner(_0x3909d8(0x279),()=>_0x2d6d0f[_0x3909d8(0x2bc)]['pushParentYaml'](_0x3557e),{'verbose':_0x4efef9['verbose']}),_0x1c8269=_0x4f6c41[_0x3909d8(0x210)],{isNew:_0x1f0599,name:_0x21ef94,hasChanges:_0x346068,diffFormatted:_0x535ee7}=_0x1c8269;if(_0x346068){_0x1f0599?console['error'](_0x3909d8(0x19e)+_0x21ef94+'\x27:'):console['error'](_0x3909d8(0x1b9)+_0x21ef94+'\x27:');console['error']('─'[_0x3909d8(0x2c5)](0x3c)),console[_0x3909d8(0x1e3)](_0x535ee7),console['error']('─'[_0x3909d8(0x2c5)](0x3c));const _0x4b9f9a=_0x1f0599?_0x3909d8(0x1bd)+_0x21ef94+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x21ef94+'\x27\x20and\x20run\x20workflow?';if(!_0x4efef9['yes']){const _0x38144e=await confirmKey(_0x4b9f9a);if(!_0x38144e)return console[_0x3909d8(0x1e3)]('Aborted.'),0x1;}const _0x2a3caa=_0x1f0599?_0x3909d8(0x194):'Updating';await withSpinner(_0x2a3caa+_0x3909d8(0x24f)+_0x21ef94+_0x3909d8(0x1e4),()=>_0x1c8269[_0x3909d8(0x233)](),{'verbose':_0x4efef9[_0x3909d8(0x2ab)]});const _0x498d9a=_0x1f0599?_0x3909d8(0x196):_0x3909d8(0x1a9);console[_0x3909d8(0x1e3)]('✔\x20'+_0x498d9a+_0x3909d8(0x24f)+_0x21ef94+'\x27');}else console[_0x3909d8(0x1e3)](_0x3909d8(0x223)+_0x21ef94+_0x3909d8(0x258));}const _0xf82416=await withSpinner(_0x3909d8(0x1fb)+_0x5f46d1+'\x27...',()=>_0x2d6d0f[_0x3909d8(0x2bc)][_0x3909d8(0x287)](_0x5f46d1),{'verbose':_0x4efef9[_0x3909d8(0x2ab)]}),_0x585df9=_0xf82416[_0x3909d8(0x210)],_0x2e17b8=getConsoleUrl(_0x4efef9[_0x3909d8(0x235)],'/app/workflows/'+_0x585df9[_0x3909d8(0x1e0)]+_0x3909d8(0x23a)+_0x585df9['workflowSessionId']+_0x3909d8(0x28b)+_0x585df9[_0x3909d8(0x241)]);return console['error'](_0x3909d8(0x2ae)),console['error']('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)](_0x3909d8(0x1f5))+'\x20'+_0x585df9[_0x3909d8(0x205)]),console[_0x3909d8(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)](_0x3909d8(0x197))+'\x20'+_0x585df9[_0x3909d8(0x28a)]),console[_0x3909d8(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)]('Session:')+'\x20'+_0x585df9[_0x3909d8(0x1cf)]),console['error']('\x20\x20'+a29_0x52c60f['dim'](_0x3909d8(0x25d))+'\x20'+_0x585df9['workflowAttemptId']),console['error']('\x20\x20'+_0x2e17b8),console[_0x3909d8(0x1e3)]('\x0a'+a29_0x52c60f[_0x3909d8(0x281)]('To\x20cancel:')+_0x3909d8(0x25c)+_0x585df9['workflowAttemptId']+_0x3909d8(0x263)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x261);[a29_0x150261(0x220)]=a29_0x150261(0x253);async[a29_0x150261(0x26f)](_0x17aacb){const _0x59fc87=a29_0x150261,{options:_0x59975c,args:_0x2bf33a,tdx:_0xc643bd}=_0x17aacb,_0x3d88a9=_0x2bf33a[0x0]||_0x59975c[_0x59fc87(0x278)];if(!_0x3d88a9)return showParentSegmentNotSetError(_0x59fc87(0x1ac)+_0x59fc87(0x29a)),0x1;_0x59975c['verbose']&&(console[_0x59fc87(0x1e3)](_0x59fc87(0x270)+_0x59975c['site']),console[_0x59fc87(0x1e3)](_0x59fc87(0x2a1)+_0x3d88a9));const _0x5645f2=await withSpinner(_0x59fc87(0x19a)+_0x3d88a9+'\x27...',()=>_0xc643bd['segment'][_0x59fc87(0x2a4)](_0x3d88a9),{'verbose':_0x59975c[_0x59fc87(0x2ab)]}),_0x186a57=_0x5645f2[_0x59fc87(0x210)];console[_0x59fc87(0x1e3)](_0x59fc87(0x275)+_0x186a57[_0x59fc87(0x229)]+_0x59fc87(0x202)+(_0x186a57[_0x59fc87(0x229)]!==0x1?'s':''));if(_0x59975c[_0x59fc87(0x24a)]||_0x59975c[_0x59fc87(0x2c6)])return await handleSDKOutput(_0x186a57,_0x59975c),0x0;return displayFieldsHumanReadable(_0x186a57,_0x3d88a9),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']='segment:parent:view';[a29_0x150261(0x220)]='Show\x20parent\x20segment\x20details';async[a29_0x150261(0x26f)](_0x2c09d0){const _0x359993=a29_0x150261,{options:_0x431d38,args:_0x5a90ae,tdx:_0x582302}=_0x2c09d0,_0x517da5=_0x431d38,_0x411d21=_0x5a90ae[0x0]||_0x431d38[_0x359993(0x278)];if(!_0x411d21)return showParentSegmentNotSetError(_0x359993(0x1ee)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x359993(0x2a2)+_0x359993(0x1c7)),0x1;_0x431d38[_0x359993(0x2ab)]&&(console[_0x359993(0x1e3)]('Site:\x20'+_0x431d38[_0x359993(0x235)]),console[_0x359993(0x1e3)]('Parent\x20segment:\x20'+_0x411d21));const _0x2ccb38=await withSpinner(_0x359993(0x1b1)+_0x411d21+'\x27...',()=>_0x582302['segment'][_0x359993(0x276)](_0x411d21),{'verbose':_0x431d38[_0x359993(0x2ab)]}),_0x53796a=_0x2ccb38[_0x359993(0x210)];if(_0x517da5[_0x359993(0x1e2)]){const _0x1fbec3=getConsoleNextUrl(_0x517da5[_0x359993(0x235)],_0x359993(0x291)+_0x53796a['id']);return console['error'](a29_0x52c60f[_0x359993(0x1ca)]('✔')+_0x359993(0x1f4)+a29_0x52c60f[_0x359993(0x26c)](_0x1fbec3)),openBrowser(_0x1fbec3),0x0;}return await handleSingleObjectOutput(_0x53796a,_0x431d38),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a29_0x150261(0x2bd);[a29_0x150261(0x220)]=a29_0x150261(0x25b);async['execute'](_0x70b310){const _0x8fc6b9=a29_0x150261,{options:_0x47bc42,args:_0x1993df,tdx:_0x32bc75}=_0x70b310,_0x373a46=_0x1993df[0x0]||_0x47bc42['parentSegment'];if(!_0x373a46)return showParentSegmentNotSetError(_0x8fc6b9(0x2bf)+_0x8fc6b9(0x1ea)),0x1;_0x47bc42[_0x8fc6b9(0x2ab)]&&(console[_0x8fc6b9(0x1e3)](_0x8fc6b9(0x270)+_0x47bc42[_0x8fc6b9(0x235)]),console['error'](_0x8fc6b9(0x2a1)+_0x373a46));const _0x2a6ccb=await withSpinner(_0x8fc6b9(0x25a)+_0x373a46+_0x8fc6b9(0x1e4),()=>_0x32bc75[_0x8fc6b9(0x2bc)][_0x8fc6b9(0x1ad)](_0x373a46),{'verbose':_0x47bc42[_0x8fc6b9(0x2ab)]}),_0x332a4b=_0x2a6ccb[_0x8fc6b9(0x210)],_0x22aa12=await withSpinner(_0x8fc6b9(0x2a5)+_0x373a46+_0x8fc6b9(0x1e4),()=>_0x32bc75[_0x8fc6b9(0x2bc)]['getParentSQL'](_0x332a4b),{'verbose':_0x47bc42[_0x8fc6b9(0x2ab)]}),_0x1fbe23=await executeSchemaQuery(_0x22aa12['data'],_0x32bc75,_0x47bc42);return await handleQueryOutput(_0x1fbe23,_0x47bc42),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x1f0);[a29_0x150261(0x220)]=a29_0x150261(0x1d7);async[a29_0x150261(0x26f)](_0x1500c4){const _0x21ed56=a29_0x150261,{options:_0x3b8d7c,args:_0x5b7b0f,tdx:_0x504a15}=_0x1500c4,_0x58a8a3=_0x5b7b0f[0x0]||_0x3b8d7c[_0x21ed56(0x278)];if(!_0x58a8a3)return showParentSegmentNotSetError(_0x21ed56(0x28f)+_0x21ed56(0x24c)),0x1;_0x3b8d7c[_0x21ed56(0x2ab)]&&(console[_0x21ed56(0x1e3)](_0x21ed56(0x270)+_0x3b8d7c[_0x21ed56(0x235)]),console['error'](_0x21ed56(0x2a1)+_0x58a8a3));const _0x5e9fb7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x58a8a3+_0x21ed56(0x1e4),()=>_0x504a15[_0x21ed56(0x2bc)]['resolveParentId'](_0x58a8a3),{'verbose':_0x3b8d7c[_0x21ed56(0x2ab)]}),_0xbcc481=_0x5e9fb7[_0x21ed56(0x210)],_0xb77947=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x58a8a3+_0x21ed56(0x1e4),()=>_0x504a15['segment']['getParentSQL'](_0xbcc481),{'verbose':_0x3b8d7c[_0x21ed56(0x2ab)]}),_0x1c07e1=_0xb77947['data'];return _0x3b8d7c[_0x21ed56(0x2b4)]==='json'||_0x3b8d7c[_0x21ed56(0x2b4)]===_0x21ed56(0x2c6)?await handleSDKOutput([{'sql':_0x1c07e1}],_0x3b8d7c):console[_0x21ed56(0x2ad)](_0x1c07e1),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x265);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x2463b7){const _0x58af4a=a29_0x150261,{options:_0x9db99d,args:_0x12b1f6,tdx:_0x338d0a}=_0x2463b7,_0x5194f3=_0x12b1f6[0x0]||_0x9db99d[_0x58af4a(0x278)];if(!_0x5194f3)return showParentSegmentNotSetError(_0x58af4a(0x21c)+_0x58af4a(0x1db)),0x1;_0x9db99d['verbose']&&(console[_0x58af4a(0x1e3)](_0x58af4a(0x270)+_0x9db99d[_0x58af4a(0x235)]),console[_0x58af4a(0x1e3)](_0x58af4a(0x2a1)+_0x5194f3));const _0xd6a439=await withSpinner(_0x58af4a(0x25a)+_0x5194f3+'\x27...',()=>_0x338d0a['segment'][_0x58af4a(0x1ad)](_0x5194f3),{'verbose':_0x9db99d[_0x58af4a(0x2ab)]}),_0x28b0ba=_0xd6a439[_0x58af4a(0x210)],_0x3dcf14=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5194f3+_0x58af4a(0x1e4),()=>_0x338d0a[_0x58af4a(0x2bc)]['getParentSQL'](_0x28b0ba),{'verbose':_0x9db99d[_0x58af4a(0x2ab)]});let _0x5658a3=_0x3dcf14['data'];const _0x3244b5=resolveLimit(_0x9db99d[_0x58af4a(0x1ff)],DEFAULT_DISPLAY_LIMIT),_0x1681c1=/\bLIMIT\s+\d+/i[_0x58af4a(0x21e)](_0x5658a3);!_0x1681c1&&(_0x5658a3=_0x5658a3[_0x58af4a(0x29e)]()[_0x58af4a(0x1e8)](/;+$/,''),_0x5658a3=_0x58af4a(0x2aa)+_0x5658a3+_0x58af4a(0x231)+_0x3244b5);_0x9db99d['verbose']&&console[_0x58af4a(0x1e3)](_0x58af4a(0x1a1)+_0x5658a3);const _0x39d255=await withQuerySpinner('Executing\x20parent\x20segment\x20query...',async _0x18a056=>{const _0x593c81=_0x58af4a,_0xee98e2=await _0x338d0a[_0x593c81(0x2a3)]['execute'](_0x5658a3,{'catalog':'td','schema':_0x593c81(0x1a4),'onJobId':_0x1c0bf7=>{const _0x167e2f=_0x593c81;_0x18a056[_0x167e2f(0x23d)](_0x1c0bf7);}});return _0xee98e2;},{'verbose':_0x9db99d[_0x58af4a(0x2ab)]}),_0x2ef5c2=_0x39d255[_0x58af4a(0x210)],_0x100b99=_0x2ef5c2[_0x58af4a(0x1fd)]?'\x20[Job\x20ID:\x20'+_0x2ef5c2[_0x58af4a(0x1fd)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x2ef5c2[_0x58af4a(0x255)][_0x58af4a(0x22f)][_0x58af4a(0x1d2)]()+_0x58af4a(0x286)+(_0x58af4a(0x27e)+formatElapsed(_0x2ef5c2[_0x58af4a(0x255)][_0x58af4a(0x1c8)])+_0x100b99)),await handleQueryOutput(_0x2ef5c2,_0x9db99d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0xb4cc3=a30_0x3119;(function(_0x458094,_0x2c6514){const _0x2bdbef=a30_0x3119,_0x107b61=_0x458094();while(!![]){try{const _0x17a791=parseInt(_0x2bdbef(0x83))/0x1+-parseInt(_0x2bdbef(0x80))/0x2*(-parseInt(_0x2bdbef(0x7d))/0x3)+-parseInt(_0x2bdbef(0x7f))/0x4+parseInt(_0x2bdbef(0x84))/0x5+-parseInt(_0x2bdbef(0x79))/0x6+parseInt(_0x2bdbef(0x78))/0x7*(parseInt(_0x2bdbef(0x7e))/0x8)+parseInt(_0x2bdbef(0x86))/0x9*(parseInt(_0x2bdbef(0x82))/0xa);if(_0x17a791===_0x2c6514)break;else _0x107b61['push'](_0x107b61['shift']());}catch(_0x4dfb42){_0x107b61['push'](_0x107b61['shift']());}}}(a30_0x146c,0xd12f3));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a30_0x3119(_0x5ba88e,_0x1e47ba){_0x5ba88e=_0x5ba88e-0x71;const _0x146c26=a30_0x146c();let _0x3119d4=_0x146c26[_0x5ba88e];return _0x3119d4;}function a30_0x146c(){const _0x419424=['error','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','config','length','7obFIFm','3908916aUqwYT','name','\x20\x20Global:\x20~/.config/tdx/tdx.json','execute','198hKhdFL','1401096qSISIm','4844236mXnoEM','12552GdnHcZ','map','1420VaJCuU','991026FYTbET','3785735SeegAt','scope','24201oBYlpr','description','profiles','Error:\x20','List\x20all\x20available\x20profiles','log','message'];a30_0x146c=function(){return _0x419424;};return a30_0x146c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0xb4cc3(0x7a)]=a30_0xb4cc3(0x88);[a30_0xb4cc3(0x87)]=a30_0xb4cc3(0x71);async[a30_0xb4cc3(0x7c)](_0x5ce911){const _0x2e63d5=a30_0xb4cc3,{options:_0x3bf9a5}=_0x5ce911;try{const _0x114e64=listProfiles(),_0x1b3be0=getActiveProfile();if(_0x114e64[_0x2e63d5(0x77)]===0x0)return console['log']('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x2e63d5(0x72)](_0x2e63d5(0x75)),console[_0x2e63d5(0x72)](_0x2e63d5(0x7b)),0x0;const _0x893313=_0x114e64[_0x2e63d5(0x81)](_0x5408b4=>{const _0x1d83e8=_0x2e63d5,_0x1f3bd6=_0x5408b4['name']===_0x1b3be0,_0xdbfd8c=getProfileParams(_0x5408b4[_0x1d83e8(0x76)]);return{'name':_0x5408b4[_0x1d83e8(0x7a)],'active':_0x1f3bd6,'scope':_0x5408b4[_0x1d83e8(0x85)],'description':_0x5408b4[_0x1d83e8(0x76)][_0x1d83e8(0x87)]||'','params':_0xdbfd8c};});return await handleSDKOutput(_0x893313,_0x3bf9a5),0x0;}catch(_0x83faa8){return _0x83faa8 instanceof Error&&console[_0x2e63d5(0x74)](_0x2e63d5(0x89)+_0x83faa8[_0x2e63d5(0x73)]),0x1;}}}
|