@treasuredata/tdx 0.9.5 → 0.9.7
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 +18 -12
- 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 +30 -0
- 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_0xb5a092=a27_0x350d;(function(_0x2e8188,_0x2eb6dd){const _0x5bfb1c=a27_0x350d,_0x53052d=_0x2e8188();while(!![]){try{const _0x5a2ae=-parseInt(_0x5bfb1c(0x24a))/0x1*(parseInt(_0x5bfb1c(0x240))/0x2)+-parseInt(_0x5bfb1c(0x1ae))/0x3+-parseInt(_0x5bfb1c(0x230))/0x4*(-parseInt(_0x5bfb1c(0x1df))/0x5)+-parseInt(_0x5bfb1c(0x218))/0x6+parseInt(_0x5bfb1c(0x26c))/0x7+-parseInt(_0x5bfb1c(0x269))/0x8*(-parseInt(_0x5bfb1c(0x248))/0x9)+parseInt(_0x5bfb1c(0x265))/0xa*(parseInt(_0x5bfb1c(0x1aa))/0xb);if(_0x5a2ae===_0x2eb6dd)break;else _0x53052d['push'](_0x53052d['shift']());}catch(_0x1eb12c){_0x53052d['push'](_0x53052d['shift']());}}}(a27_0x3cbf,0xa91d3));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_0x459d21 from'node:fs';function handleSDKError(_0x10b4f3,_0x2c998e){const _0x28d2dd=a27_0x350d;if(_0x10b4f3 instanceof SDKError)console['error'](_0x28d2dd(0x221)+_0x10b4f3[_0x28d2dd(0x1f7)]),_0x2c998e[_0x28d2dd(0x256)]&&(_0x10b4f3[_0x28d2dd(0x1ab)]&&console[_0x28d2dd(0x231)](_0x28d2dd(0x1f8)+_0x10b4f3[_0x28d2dd(0x1ab)]),_0x10b4f3[_0x28d2dd(0x1d9)]&&(console[_0x28d2dd(0x231)](_0x28d2dd(0x226)),console['error'](_0x10b4f3['stack'])));else throw _0x10b4f3;}function a27_0x3cbf(){const _0x2115fb=['resolveProjectId','⚒️\x20','verbose','yellow','.llm','sourceSite','Resolving\x20agent\x20\x27','Create\x20a\x20new\x20LLM\x20project','Backup\x20cancelled.','Load\x20more...','filter','floor','Error:\x20Agent\x20name\x20is\x20required','Backing\x20up\x20project\x20\x27','targetKnowledgeBase','(no\x20message)','slice','910edVhLZ','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Analyzing\x20project\x20\x27','setCurrentProject','1498616MREfYE','Fetching\x20chat\x20sessions...','prompts','8501528QZbVmB','createdAt','llm:agent:delete','[tool_call]','updatedAt','knowledgeBases','\x20→\x20chat:\x20','projectName','\x0aCancelled','counts','Update\x20an\x20existing\x20agent','\x20--last','cyan','integrations','Unknown','\x20->\x20ImageGen:','\x20\x20\x20Examples:','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','getCurrentProject','keys','\x20->\x20Agent:','List\x20available\x20LLM\x20models','Creating\x20agent\x20\x27','29381cWItsk','cause','A\x20project\x20named\x20\x27','agentId','2216187ncyFjz','lastConversationAt','List\x20agents\x20in\x20current\x20project','prompt','red','Create\x20a\x20new\x20agent\x20in\x20current\x20project','No\x20chat\x20sessions\x20found.','sort','\x27\x20already\x20exists.\x20Overwrite?','Creating\x20project\x20\x27','tsv','targetImageGenerator','execute','chats','claude-4.5-haiku','\x20project(s)','Validating\x20backup\x20from\x20\x27','limit','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','Invalid\x20path\x20syntax:\x20','Agent\x20created:\x20','Fetching\x20projects...','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','yes','\x20\x20Prompts:\x20','targetWebSearchTool','chatId','Select\x20a\x20chat\x20session:','output','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','length','dim','llm:project:backup','green','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','Updating\x20agent...','bold','includes','json','Set\x20current\x20project\x20context','dryRun','site','split','stack','projects','Error:\x20Project\x20name\x20is\x20required','exportedFrom','Delete\x20an\x20agent','log','168095DHQxXr','llm:projects','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','resolveAgentId','createProject','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','llm:project:delete','attributes','Agent\x20updated:\x20','history','join','Restore\x20cancelled.','magenta','select','llm:models','just\x20now','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','updateAgent','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','INVALID_ARGUMENT','tool','push','tdx\x20chats','systemPrompt','message','\x20\x20Cause:\x20','m\x20ago','model','[output]\x20','firstInputContent','toLowerCase','tool_call','default','Project\x20restored:\x20','Deleting\x20project\x20\x27','image','[unknown]','maxToolIterations','agents','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','\x20\x20Knowledge\x20Bases:\x20','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','web','🤖\x20','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','blue','[image]\x20\x20','Fetching\x20available\x20models...','map','llm','No\x20agents\x20found','llm:agent:create','LLM_PROJECT_NOT_FOUND','projectId','agent','get','getTime','4614888glzkoH','short','Show\x20agent\x20details','description','format','name','tdx\x20llm\x20history','Deleting\x20agent...','[input]\x20\x20','Error:\x20','set','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','targetAgent','llm:history','\x0aStack\x20trace:','Usage:\x20','table','\x20->\x20WebSearch:','\x20agent(s)','deleteProject','all','llm:use','llm:project:restore','\x20\x20Agents:\x20','48RukCxW','error','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','\x20\x20Integrations:\x20','__load_more__','llm:project:create','content','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','Project\x20created:\x20','localeCompare','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','numeric','data','jsonl','No\x20projects\x20found','\x27...','2CVyLqW','Getting\x20default\x20project...','Fetching\x20chat\x20history\x20for\x20\x27','models','Project\x20backed\x20up\x20to:\x20','stringify','h\x20ago','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','36iHhRdt','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','409733ZsEiZo','Resolving\x20project\x20\x27','[error]\x20\x20','outputDir','Fetching\x20agents...','find','starterMessage','input','Fetching\x20most\x20recent\x20chat...','...'];a27_0x3cbf=function(){return _0x2115fb;};return a27_0x3cbf();}function formatChatHistoryEntry(_0x3c44fa,_0x141996){const _0x2e642e=a27_0x350d,_0x2778a5=getChalk(_0x141996),_0x5da657=_0x2778a5[_0x2e642e(0x1cd)](_0x3c44fa['at']);if(_0x2e642e(0x251)in _0x3c44fa){const _0x5be77c=_0x2778a5[_0x2e642e(0x278)](_0x2e642e(0x220));return _0x5da657+'\x20'+_0x5be77c+':\x20'+_0x3c44fa[_0x2e642e(0x251)];}if(_0x2e642e(0x236)in _0x3c44fa){const _0x5b683a=_0x2778a5[_0x2e642e(0x1cf)]('[content]');return _0x5da657+'\x20'+_0x5b683a+':\x20'+_0x3c44fa['content'];}if(_0x2e642e(0x1fe)in _0x3c44fa){const _0x2983fd=_0x2778a5[_0x2e642e(0x257)](_0x2e642e(0x26f)),{functionName:_0x2f7aa3,functionArguments:_0x555b89,targetFunction:_0x2b0108}=_0x3c44fa[_0x2e642e(0x1fe)];let _0x4baa7a=_0x5da657+'\x20'+_0x2983fd+':\x20'+_0x2778a5[_0x2e642e(0x1d2)](_0x2f7aa3);if(_0x555b89&&Object[_0x2e642e(0x27f)](_0x555b89)[_0x2e642e(0x1cc)]>0x0){const _0x1c1c5c=Object['entries'](_0x555b89)['map'](([_0x59ac02,_0x1e9525])=>_0x59ac02+'='+JSON[_0x2e642e(0x245)](_0x1e9525))[_0x2e642e(0x1e9)](',\x20');_0x4baa7a+='('+_0x1c1c5c+')';}_0x2b0108&&(_0x4baa7a+=_0x2778a5['dim']('\x20['+_0x2b0108+']'));let _0x56b107='';if(_0x3c44fa[_0x2e642e(0x1fe)][_0x2e642e(0x262)])_0x56b107='\x20->\x20KB:'+_0x3c44fa[_0x2e642e(0x1fe)][_0x2e642e(0x262)][_0x2e642e(0x21d)];else{if(_0x3c44fa[_0x2e642e(0x1fe)][_0x2e642e(0x224)])_0x56b107=_0x2e642e(0x1a7)+_0x3c44fa['tool_call'][_0x2e642e(0x224)][_0x2e642e(0x21d)];else{if(_0x3c44fa[_0x2e642e(0x1fe)][_0x2e642e(0x1c7)])_0x56b107=_0x2e642e(0x229)+_0x3c44fa['tool_call'][_0x2e642e(0x1c7)][_0x2e642e(0x21d)];else _0x3c44fa[_0x2e642e(0x1fe)]['targetImageGenerator']&&(_0x56b107=_0x2e642e(0x27b)+_0x3c44fa[_0x2e642e(0x1fe)][_0x2e642e(0x1b9)][_0x2e642e(0x21d)]);}}return _0x4baa7a+_0x56b107;}if(_0x2e642e(0x1f3)in _0x3c44fa){const _0x24973e=_0x2778a5[_0x2e642e(0x1eb)]('[tool]\x20\x20\x20'),{functionName:_0x426be1,functionArguments:_0x2f9518,content:_0x29ae85,newChat:_0x15810f}=_0x3c44fa[_0x2e642e(0x1f3)];let _0x21931d=_0x5da657+'\x20'+_0x24973e+':\x20'+_0x2778a5[_0x2e642e(0x1d2)](_0x426be1);if(_0x2f9518){const _0xadeaed=typeof _0x2f9518==='string'?_0x2f9518:JSON['stringify'](_0x2f9518);_0x21931d+='('+_0xadeaed+')';}return _0x29ae85&&(_0x21931d+='\x0a'+_0x2778a5[_0x2e642e(0x1cd)](_0x29ae85)),_0x15810f&&(_0x21931d+=_0x2778a5[_0x2e642e(0x1cd)](_0x2e642e(0x272)+_0x15810f['id'])),_0x21931d;}if(_0x2e642e(0x1ca)in _0x3c44fa){const _0x2bdce0=_0x2778a5[_0x2e642e(0x20c)](_0x2e642e(0x1fb));return _0x5da657+'\x20'+_0x2bdce0+':\x20'+_0x3c44fa[_0x2e642e(0x1ca)]['name']+'\x20('+_0x3c44fa[_0x2e642e(0x1ca)][_0x2e642e(0x236)][_0x2e642e(0x1cc)]+'\x20bytes)';}if('image'in _0x3c44fa){const _0x53c0c0=_0x2778a5[_0x2e642e(0x20c)](_0x2e642e(0x20d)),{width:_0x15bf13,height:_0xc51dc3,headerText:_0x1bdd1e}=_0x3c44fa[_0x2e642e(0x202)],_0x3509aa=_0x1bdd1e?'\x20-\x20'+_0x1bdd1e:'';return _0x5da657+'\x20'+_0x53c0c0+':\x20'+_0x15bf13+'x'+_0xc51dc3+_0x3509aa;}if(_0x2e642e(0x231)in _0x3c44fa){const _0x37d54f=_0x2778a5[_0x2e642e(0x1b2)](_0x2e642e(0x24c));return _0x5da657+'\x20'+_0x37d54f+':\x20'+_0x3c44fa[_0x2e642e(0x231)];}return _0x5da657+'\x20'+_0x2778a5['dim'](_0x2e642e(0x203))+':\x20'+JSON[_0x2e642e(0x245)](_0x3c44fa);}async function executeChatHistoryCommand(_0x4d60ff,_0x15854f){const _0xeeabe2=a27_0x350d,{options:_0x22d88f,args:_0x27fba8,tdx:_0x25f2ef}=_0x4d60ff,_0x4303fa=_0x27fba8[0x0],_0xde043f=_0x22d88f,_0x2b3d3f=_0xde043f['last'];try{if(_0x2b3d3f&&_0x4303fa)return console[_0xeeabe2(0x231)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0xeeabe2(0x231)](_0xeeabe2(0x227)+_0x15854f+_0xeeabe2(0x277)),0x1;if(!_0x4303fa&&!_0x2b3d3f&&_0x22d88f[_0xeeabe2(0x21c)]!==undefined){const _0x347f86=resolveLimit(_0x22d88f[_0xeeabe2(0x1bf)],DEFAULT_LLM_LIMIT),_0x242edb=await withSpinner(_0xeeabe2(0x26a),()=>_0x25f2ef[_0xeeabe2(0x210)][_0xeeabe2(0x1bb)](_0x347f86),{'verbose':_0x22d88f[_0xeeabe2(0x256)]});return await handleSDKOutput(_0x242edb['data'],_0x22d88f),0x0;}const _0x4bed67=await getChatIdOrSelect(_0x25f2ef,_0x22d88f,_0x2b3d3f,_0x4303fa);if(!_0x4bed67)return 0x0;return await displayChatHistory(_0x4bed67,_0x25f2ef,_0x22d88f),0x0;}catch(_0xc0bb0b){return handleSDKError(_0xc0bb0b,_0x22d88f),0x1;}}async function displayChatHistory(_0x3791a0,_0xe6bcd9,_0x6f86eb){const _0xbee79f=a27_0x350d,_0x40d310=await withSpinner(_0xbee79f(0x242)+_0x3791a0+_0xbee79f(0x23f),()=>_0xe6bcd9[_0xbee79f(0x210)][_0xbee79f(0x1e8)](_0x3791a0),{'verbose':_0x6f86eb[_0xbee79f(0x256)]}),_0x2780b6=_0x40d310[_0xbee79f(0x23c)][_0xbee79f(0x23c)]??[];if(_0x2780b6['length']===0x0){console[_0xbee79f(0x1de)]('No\x20messages\x20found\x20in\x20chat\x20history.');return;}if(_0x6f86eb['format']!==undefined)await handleSDKOutput(_0x2780b6,_0x6f86eb);else{const _0x4b96d6=_0x2780b6[_0xbee79f(0x20f)](_0x27a1c4=>formatChatHistoryEntry(_0x27a1c4,_0x6f86eb)),_0x1fadd1=_0x4b96d6[_0xbee79f(0x1e9)]('\x0a');await writeOutput(_0x1fadd1,_0x6f86eb[_0xbee79f(0x1ca)],_0xbee79f(0x228));}}async function getChatIdOrSelect(_0x3e4714,_0x107896,_0x28b77b,_0x53e475){const _0x5891dc=a27_0x350d;if(_0x53e475)return _0x53e475;if(_0x28b77b){const _0x4b01d3=await withSpinner(_0x5891dc(0x252),()=>_0x3e4714[_0x5891dc(0x210)][_0x5891dc(0x1bb)](0x1),{'verbose':_0x107896[_0x5891dc(0x256)]});if(_0x4b01d3[_0x5891dc(0x23c)][_0x5891dc(0x1cc)]===0x0)return console['log'](_0x5891dc(0x1b4)),undefined;return _0x4b01d3['data'][0x0]['id'];}const _0x6e0768=await selectChatInteractively(_0x3e4714,_0x107896);if(!_0x6e0768)return console[_0x5891dc(0x1de)](_0x5891dc(0x274)),undefined;return _0x6e0768;}async function getProjectIdOrDefault(_0x478d39){const _0x104738=await getProjectWithName(_0x478d39);return _0x104738['id'];}async function getProjectWithName(_0x2ef5ff){const _0x87b2be=a27_0x350d,{tdx:_0x16a3b0,options:_0x183204}=_0x2ef5ff,_0x37b4da=_0x183204['llmProject'];if(_0x37b4da){const _0x4ecc0d=await withSpinner(_0x87b2be(0x24b)+_0x37b4da+'\x27...',()=>_0x16a3b0['llm'][_0x87b2be(0x254)](_0x37b4da),{'verbose':_0x183204['verbose']});return{'id':_0x4ecc0d['data'],'name':_0x37b4da};}const _0x16fb93=_0x16a3b0[_0x87b2be(0x210)][_0x87b2be(0x27e)]();if(_0x16fb93){const _0x1e3bdf=await _0x16a3b0[_0x87b2be(0x210)]['projects'](),_0x1c86bb=_0x1e3bdf[_0x87b2be(0x24f)](_0xd7fb59=>_0xd7fb59['id']===_0x16fb93);return{'id':_0x16fb93,'name':_0x1c86bb?.[_0x87b2be(0x1e6)][_0x87b2be(0x21d)]||_0x87b2be(0x27a)};}const _0x32ea9b=await withSpinner(_0x87b2be(0x241),()=>_0x16a3b0[_0x87b2be(0x210)]['getOrCreateDefaultProject'](),{'verbose':_0x183204['verbose']});return{'id':_0x32ea9b[_0x87b2be(0x23c)]['id'],'name':_0x32ea9b['data'][_0x87b2be(0x1e6)][_0x87b2be(0x21d)]};}function toLLMProjectInfo(_0x5d4c46){const _0x3cd45e=a27_0x350d;return{'name':_0x5d4c46[_0x3cd45e(0x1e6)][_0x3cd45e(0x21d)],'description':_0x5d4c46[_0x3cd45e(0x1e6)]['description'],'createdAt':_0x5d4c46[_0x3cd45e(0x1e6)][_0x3cd45e(0x26d)],'updatedAt':_0x5d4c46['attributes'][_0x3cd45e(0x270)]};}function a27_0x350d(_0x248797,_0x3c0329){_0x248797=_0x248797-0x1a7;const _0x3cbf03=a27_0x3cbf();let _0x350d52=_0x3cbf03[_0x248797];return _0x350d52;}function toAgentInfo(_0x35f0b2){const _0x22fc21=a27_0x350d;return{'name':_0x35f0b2['attributes'][_0x22fc21(0x21d)],'description':_0x35f0b2['attributes'][_0x22fc21(0x21b)],'prompt':truncatePrompt(_0x35f0b2[_0x22fc21(0x1e6)][_0x22fc21(0x1b1)]),'createdAt':_0x35f0b2[_0x22fc21(0x1e6)][_0x22fc21(0x26d)],'updatedAt':_0x35f0b2['attributes'][_0x22fc21(0x270)]};}function truncatePrompt(_0x3d8296){const _0x5ea9b7=a27_0x350d;if(!_0x3d8296)return undefined;const _0x483b9c=0x64;if(_0x3d8296[_0x5ea9b7(0x1cc)]<=_0x483b9c)return _0x3d8296;return _0x3d8296['slice'](0x0,_0x483b9c)+_0x5ea9b7(0x253);}export class LLMModelsCommand extends BaseCommand{['name']=a27_0xb5a092(0x1ed);[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1a8);async[a27_0xb5a092(0x1ba)](_0x428bbf){const _0x529b39=a27_0xb5a092,{options:_0x394fea,tdx:_0x587798}=_0x428bbf;try{const _0x16489c=await withSpinner(_0x529b39(0x20e),()=>_0x587798['llm'][_0x529b39(0x243)](),{'verbose':_0x394fea['verbose']});return await handleSDKOutput(_0x16489c[_0x529b39(0x23c)],_0x394fea),0x0;}catch(_0x98f70d){return handleSDKError(_0x98f70d,_0x394fea),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a27_0xb5a092(0x1e0);['description']='List\x20all\x20LLM\x20projects';async[a27_0xb5a092(0x1ba)](_0x177d60){const _0x1ad558=a27_0xb5a092,{options:_0x271bd0,args:_0xadc21c,tdx:_0xf66cd5}=_0x177d60,_0x56baaa=getChalk(_0x271bd0),_0x1720ba=_0x271bd0['web'],_0x54fe5f=_0x271bd0[_0x1ad558(0x1d7)];try{const _0x1d0dd1=_0xadc21c[0x0],_0xe33ae5=resolveLimit(_0x271bd0[_0x1ad558(0x1bf)],DEFAULT_LLM_LIMIT),_0x545b31=await withSpinner(_0x1ad558(0x1c3),()=>_0xf66cd5[_0x1ad558(0x210)]['projects'](_0xe33ae5),{'verbose':_0x271bd0[_0x1ad558(0x256)]});let _0x79ffe4=_0x545b31['data'];_0x1d0dd1&&(_0x79ffe4=_0x545b31[_0x1ad558(0x23c)][_0x1ad558(0x25e)](_0x2c80db=>matchGlobPattern(_0x2c80db['attributes'][_0x1ad558(0x21d)],_0x1d0dd1)));const _0x29d836=_0x271bd0['format']===_0x1ad558(0x1d4)||_0x271bd0[_0x1ad558(0x21c)]==='jsonl'||_0x271bd0['format']===_0x1ad558(0x228)||_0x271bd0[_0x1ad558(0x21c)]===_0x1ad558(0x1b8);if(_0x29d836){const _0x5302b8=_0x79ffe4['map'](_0x29350b=>({...toLLMProjectInfo(_0x29350b),..._0x1720ba?{'url':getLLMProjectUrl(_0x54fe5f,_0x29350b['id'])}:{}}));await handleSDKOutput(_0x5302b8,_0x271bd0);}else{const _0xe116b6=[];if(_0x79ffe4[_0x1ad558(0x1cc)]===0x0)_0xe116b6['push'](_0x56baaa[_0x1ad558(0x1cd)](_0x1ad558(0x23e)));else{const _0x3b9f70=[..._0x79ffe4][_0x1ad558(0x1b5)]((_0x54aacb,_0x2d58f5)=>_0x54aacb['attributes']['name'][_0x1ad558(0x239)](_0x2d58f5[_0x1ad558(0x1e6)][_0x1ad558(0x21d)]));for(const _0xf37082 of _0x3b9f70){if(_0x1720ba){const _0x1c6d2f=getLLMProjectUrl(_0x54fe5f,_0xf37082['id']);_0xe116b6[_0x1ad558(0x1f4)](_0x1ad558(0x255)+_0xf37082[_0x1ad558(0x1e6)][_0x1ad558(0x21d)]+'\x20\x20'+_0x56baaa[_0x1ad558(0x1cd)](_0x1c6d2f));}else _0xe116b6['push'](_0x1ad558(0x255)+_0xf37082[_0x1ad558(0x1e6)][_0x1ad558(0x21d)]);}_0xe116b6[_0x1ad558(0x1f4)](_0x56baaa[_0x1ad558(0x1cd)](_0x79ffe4['length']+_0x1ad558(0x1bd)));}await writeOutput(_0xe116b6[_0x1ad558(0x1e9)]('\x0a'),_0x271bd0[_0x1ad558(0x1ca)],_0x1ad558(0x228));}return 0x0;}catch(_0x134467){return handleSDKError(_0x134467,_0x271bd0),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a27_0xb5a092(0x21d)]='llm:agents';[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1b0);async[a27_0xb5a092(0x1ba)](_0x26eea7){const _0x293bb8=a27_0xb5a092,{options:_0x43b437,args:_0x1a5d01,tdx:_0x12a69d}=_0x26eea7,_0x3a3164=getChalk(_0x43b437),_0x1cc3ac=_0x43b437[_0x293bb8(0x209)],_0x2cd43d=_0x43b437['site'];try{const _0x3591ca=_0x1a5d01[0x0];let _0x34dc08=_0x3591ca,_0x26506f,_0x278ba8;if(_0x3591ca&&_0x3591ca[_0x293bb8(0x1d3)]('/')){const _0x5d48f9=_0x3591ca[_0x293bb8(0x1d8)]('/');if(_0x5d48f9[_0x293bb8(0x1cc)]===0x2){const [_0xd9805e,_0x523f02]=_0x5d48f9,_0x324c72=await _0x12a69d[_0x293bb8(0x210)][_0x293bb8(0x1da)](),_0x2035fb=_0x324c72[_0x293bb8(0x24f)](_0x477104=>_0x477104[_0x293bb8(0x1e6)][_0x293bb8(0x21d)][_0x293bb8(0x1fd)]()===_0xd9805e[_0x293bb8(0x1fd)]());if(!_0x2035fb)throw new SDKError(ErrorCode[_0x293bb8(0x213)],'Project\x20not\x20found:\x20'+_0xd9805e,undefined,{'helpText':_0x293bb8(0x232)});_0x26506f=_0x2035fb['id'],_0x278ba8=_0x2035fb[_0x293bb8(0x1e6)][_0x293bb8(0x21d)],_0x34dc08=_0x523f02;}else throw new SDKError(ErrorCode[_0x293bb8(0x1f2)],_0x293bb8(0x1c1)+_0x3591ca,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x2a6c88=await getProjectWithName(_0x26eea7);_0x26506f=_0x2a6c88['id'],_0x278ba8=_0x2a6c88[_0x293bb8(0x21d)];}const _0x5859a6=await withSpinner(_0x293bb8(0x24e),()=>_0x12a69d[_0x293bb8(0x210)][_0x293bb8(0x205)](_0x26506f),{'verbose':_0x43b437[_0x293bb8(0x256)]});let _0x3206c7=_0x5859a6[_0x293bb8(0x23c)];_0x34dc08&&(_0x3206c7=_0x5859a6['data']['filter'](_0x320988=>matchGlobPattern(_0x320988[_0x293bb8(0x1e6)][_0x293bb8(0x21d)],_0x34dc08)));const _0x3bebe7=_0x43b437[_0x293bb8(0x21c)]===_0x293bb8(0x1d4)||_0x43b437['format']===_0x293bb8(0x23d)||_0x43b437['format']==='table'||_0x43b437[_0x293bb8(0x21c)]===_0x293bb8(0x1b8);if(_0x3bebe7){const _0x2f9b23=_0x3206c7[_0x293bb8(0x20f)](_0x2b6145=>({...toAgentInfo(_0x2b6145),..._0x1cc3ac?{'chatUrl':getLLMAgentChatUrl(_0x2cd43d,_0x26506f,_0x2b6145['id'])}:{}}));await handleSDKOutput(_0x2f9b23,_0x43b437);}else{const _0x1fbaa6=[];_0x1fbaa6['push'](_0x3a3164[_0x293bb8(0x1cd)]('['+_0x278ba8+']'));if(_0x3206c7[_0x293bb8(0x1cc)]===0x0)_0x1fbaa6[_0x293bb8(0x1f4)](_0x3a3164['dim'](_0x293bb8(0x211)));else{const _0x3c1b68=[..._0x3206c7][_0x293bb8(0x1b5)]((_0x18b29e,_0x71efe1)=>_0x18b29e[_0x293bb8(0x1e6)][_0x293bb8(0x21d)][_0x293bb8(0x239)](_0x71efe1[_0x293bb8(0x1e6)][_0x293bb8(0x21d)]));for(const _0x2a9ce7 of _0x3c1b68){if(_0x1cc3ac){const _0x411d98=getLLMAgentChatUrl(_0x2cd43d,_0x26506f,_0x2a9ce7['id']);_0x1fbaa6[_0x293bb8(0x1f4)](_0x293bb8(0x20a)+_0x2a9ce7['attributes'][_0x293bb8(0x21d)]+'\x20\x20'+_0x3a3164['dim'](_0x411d98));}else _0x1fbaa6[_0x293bb8(0x1f4)](_0x293bb8(0x20a)+_0x2a9ce7['attributes'][_0x293bb8(0x21d)]);}_0x1fbaa6['push'](_0x3a3164['dim'](_0x3206c7[_0x293bb8(0x1cc)]+_0x293bb8(0x22a)));}await writeOutput(_0x1fbaa6[_0x293bb8(0x1e9)]('\x0a'),_0x43b437[_0x293bb8(0x1ca)],_0x293bb8(0x228));}return 0x0;}catch(_0x59157b){return handleSDKError(_0x59157b,_0x43b437),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a27_0xb5a092(0x21d)]='llm:agent:show';[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x21a);async[a27_0xb5a092(0x1ba)](_0x29a25b){const _0xf52621=a27_0xb5a092,{options:_0x4547cc,args:_0x2ffff7,tdx:_0x53e0fc}=_0x29a25b;if(_0x2ffff7['length']===0x0)return console[_0xf52621(0x231)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0xf52621(0x231)](_0xf52621(0x1e1)),0x1;const _0x1bcbd7=_0x2ffff7[0x0];try{const _0x4f1910=await getProjectIdOrDefault(_0x29a25b),_0x81bdf7=await withSpinner(_0xf52621(0x25a)+_0x1bcbd7+_0xf52621(0x23f),()=>_0x53e0fc['llm'][_0xf52621(0x1e2)](_0x1bcbd7,_0x4f1910),{'verbose':_0x4547cc[_0xf52621(0x256)]}),_0x4a3a34=await withSpinner('Fetching\x20agent...',()=>_0x53e0fc[_0xf52621(0x210)][_0xf52621(0x215)](_0x81bdf7['data']),{'verbose':_0x4547cc['verbose']});return await handleSDKOutput([_0x4a3a34['data']],_0x4547cc),0x0;}catch(_0xad0ce7){return handleSDKError(_0xad0ce7,_0x4547cc),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x212);[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1b3);async[a27_0xb5a092(0x1ba)](_0x10c1ed){const _0x5dbd07=a27_0xb5a092,{options:_0x595748,args:_0x8ff47,tdx:_0x2af26c}=_0x10c1ed;if(_0x8ff47[_0x5dbd07(0x1cc)]===0x0)return console['error'](_0x5dbd07(0x260)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x1f7b57=_0x8ff47[0x0],_0x296bd4=_0x595748,_0x31be92=_0x296bd4[_0x5dbd07(0x1f6)],_0x5a4464=_0x296bd4[_0x5dbd07(0x1fa)]||_0x5dbd07(0x1bc),_0x9df268=_0x296bd4[_0x5dbd07(0x250)],_0x1fd221=_0x296bd4[_0x5dbd07(0x204)]?Number(_0x296bd4['maxToolIterations']):undefined,_0x5e567e=_0x296bd4['temperature']?Number(_0x296bd4['temperature']):undefined;try{let _0x515880,_0x4d058f;if(_0x1f7b57['includes']('/')){const _0x5db43e=_0x1f7b57['split']('/');if(_0x5db43e[_0x5dbd07(0x1cc)]===0x2){const [_0x26f0b8,_0x2095e2]=_0x5db43e,_0x3ed675=await withSpinner('Resolving\x20project\x20\x27'+_0x26f0b8+'\x27...',()=>_0x2af26c[_0x5dbd07(0x210)][_0x5dbd07(0x254)](_0x26f0b8),{'verbose':_0x595748['verbose']});_0x515880=_0x3ed675[_0x5dbd07(0x23c)],_0x4d058f=_0x2095e2;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5dbd07(0x1c1)+_0x1f7b57,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x515880=await getProjectIdOrDefault(_0x10c1ed),_0x4d058f=_0x1f7b57;const _0x4d676a=await withSpinner(_0x5dbd07(0x1a9)+_0x4d058f+_0x5dbd07(0x23f),()=>_0x2af26c[_0x5dbd07(0x210)]['createAgent']({'name':_0x4d058f,'projectId':_0x515880,'modelType':_0x5a4464,'systemPrompt':_0x31be92,'starterMessage':_0x9df268,'maxToolIterations':_0x1fd221,'temperature':_0x5e567e}),{'verbose':_0x595748[_0x5dbd07(0x256)]});return console[_0x5dbd07(0x1de)](_0x5dbd07(0x1c2)+_0x4d676a[_0x5dbd07(0x23c)]['id']),await handleSDKOutput([_0x4d676a[_0x5dbd07(0x23c)]],_0x595748),0x0;}catch(_0x237d80){return handleSDKError(_0x237d80,_0x595748),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a27_0xb5a092(0x21d)]='llm:agent:update';[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x276);async[a27_0xb5a092(0x1ba)](_0x5c3e16){const _0x1f1844=a27_0xb5a092,{options:_0x3d5bf7,args:_0x43f469,tdx:_0x1c11fd}=_0x5c3e16;if(_0x43f469[_0x1f1844(0x1cc)]===0x0)return console['error'](_0x1f1844(0x260)),console[_0x1f1844(0x231)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x5b540f=_0x43f469[0x0],_0x42e680=_0x3d5bf7,_0x3c66a5=_0x42e680[_0x1f1844(0x21d)],_0x41d17d=_0x42e680[_0x1f1844(0x1b1)],_0x2af90f=_0x42e680[_0x1f1844(0x21b)],_0x36fc63=_0x42e680[_0x1f1844(0x250)];if(!_0x3c66a5&&!_0x41d17d&&!_0x2af90f&&!_0x36fc63)return console['error'](_0x1f1844(0x23a)),console[_0x1f1844(0x231)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x49aaf7=await getProjectIdOrDefault(_0x5c3e16),_0x303e64=await withSpinner('Resolving\x20agent\x20\x27'+_0x5b540f+_0x1f1844(0x23f),()=>_0x1c11fd[_0x1f1844(0x210)][_0x1f1844(0x1e2)](_0x5b540f,_0x49aaf7),{'verbose':_0x3d5bf7[_0x1f1844(0x256)]}),_0x2c406b=_0x303e64[_0x1f1844(0x23c)],_0x45afa9=await withSpinner(_0x1f1844(0x1d1),()=>_0x1c11fd['llm'][_0x1f1844(0x1f0)](_0x2c406b,{'name':_0x3c66a5,'prompt':_0x41d17d,'description':_0x2af90f,'starterMessage':_0x36fc63}),{'verbose':_0x3d5bf7[_0x1f1844(0x256)]});return console[_0x1f1844(0x1de)](_0x1f1844(0x1e7)+_0x45afa9[_0x1f1844(0x23c)]['id']),await handleSDKOutput([_0x45afa9[_0x1f1844(0x23c)]],_0x3d5bf7),0x0;}catch(_0x1caf6a){return handleSDKError(_0x1caf6a,_0x3d5bf7),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a27_0xb5a092(0x26e);[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1dd);async['execute'](_0x37a5b6){const _0x6fe29d=a27_0xb5a092,{options:_0xf34396,args:_0x47ea1a,tdx:_0x5cfcd0}=_0x37a5b6;if(_0x47ea1a[_0x6fe29d(0x1cc)]===0x0)return console[_0x6fe29d(0x231)](_0x6fe29d(0x260)),console[_0x6fe29d(0x231)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x15564c=_0x47ea1a[0x0];try{const _0xaa039f=await getProjectIdOrDefault(_0x37a5b6),_0x32d913=await withSpinner(_0x6fe29d(0x25a)+_0x15564c+_0x6fe29d(0x23f),()=>_0x5cfcd0['llm'][_0x6fe29d(0x1e2)](_0x15564c,_0xaa039f),{'verbose':_0xf34396[_0x6fe29d(0x256)]}),_0x584238=_0x32d913[_0x6fe29d(0x23c)];return await withSpinner(_0x6fe29d(0x21f),()=>_0x5cfcd0[_0x6fe29d(0x210)]['deleteAgent'](_0x584238),{'verbose':_0xf34396[_0x6fe29d(0x256)]}),console['log']('Agent\x20deleted:\x20'+_0x584238),0x0;}catch(_0x5b9cbf){return handleSDKError(_0x5b9cbf,_0xf34396),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x225);[a27_0xb5a092(0x21b)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async[a27_0xb5a092(0x1ba)](_0x4d14dc){const _0x1c4ddb=a27_0xb5a092;return executeChatHistoryCommand(_0x4d14dc,_0x1c4ddb(0x21e));}}export class LLMUseCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x22d);[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1d5);async[a27_0xb5a092(0x1ba)](_0x448924){const _0x2ace6a=a27_0xb5a092,{options:_0x3676a4,args:_0x4ce4c8,tdx:_0x102cd6}=_0x448924;if(_0x4ce4c8[_0x2ace6a(0x1cc)]===0x0)return console[_0x2ace6a(0x231)](_0x2ace6a(0x1db)),console['error']('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x585d7b=_0x4ce4c8[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x585d7b+'\x27...',()=>_0x102cd6['llm'][_0x2ace6a(0x268)](_0x585d7b),{'verbose':_0x3676a4[_0x2ace6a(0x256)]}),console['log']('Project\x20context\x20set\x20to:\x20'+_0x585d7b),0x0;}catch(_0x150d6f){return handleSDKError(_0x150d6f,_0x3676a4),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x235);['description']=a27_0xb5a092(0x25b);async[a27_0xb5a092(0x1ba)](_0x4f69d8){const _0x15434e=a27_0xb5a092,{options:_0x2d2fdf,args:_0x1bb4d3,tdx:_0x4b8223}=_0x4f69d8;if(_0x1bb4d3[_0x15434e(0x1cc)]===0x0)return console[_0x15434e(0x231)](_0x15434e(0x1db)),console[_0x15434e(0x231)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x429f28=_0x1bb4d3[0x0],_0x5c6e86=_0x2d2fdf,_0x46b7c4=_0x5c6e86[_0x15434e(0x21b)];try{const _0x15c2ea=await withSpinner(_0x15434e(0x1b7)+_0x429f28+_0x15434e(0x23f),()=>_0x4b8223['llm'][_0x15434e(0x1e3)]({'name':_0x429f28,'description':_0x46b7c4}),{'verbose':_0x2d2fdf[_0x15434e(0x256)]});console[_0x15434e(0x1de)](_0x15434e(0x238)+_0x15c2ea[_0x15434e(0x23c)]['id']);const _0x3a67da=toLLMProjectInfo(_0x15c2ea['data']);return await handleSDKOutput([_0x3a67da],_0x2d2fdf),0x0;}catch(_0x45818a){return handleSDKError(_0x45818a,_0x2d2fdf),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x1e5);[a27_0xb5a092(0x21b)]='Delete\x20an\x20LLM\x20project';async[a27_0xb5a092(0x1ba)](_0xc895d1){const _0x5cad0a=a27_0xb5a092,{options:_0x39e934,args:_0x467795,tdx:_0x20a7b7}=_0xc895d1;if(_0x467795['length']===0x0)return console[_0x5cad0a(0x231)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5cad0a(0x231)](_0x5cad0a(0x27d)),0x1;const _0x4856e0=_0x467795[0x0];try{return await withSpinner(_0x5cad0a(0x201)+_0x4856e0+'\x27...',()=>_0x20a7b7[_0x5cad0a(0x210)][_0x5cad0a(0x22b)](_0x4856e0),{'verbose':_0x39e934[_0x5cad0a(0x256)]}),console[_0x5cad0a(0x1de)]('Project\x20deleted:\x20'+_0x4856e0),0x0;}catch(_0x29e887){return handleSDKError(_0x29e887,_0x39e934),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x1ce);['description']=a27_0xb5a092(0x20b);async[a27_0xb5a092(0x1ba)](_0x4de479){const _0xa96917=a27_0xb5a092,{options:_0x24277e,args:_0x3e9424,tdx:_0x27a2ae}=_0x4de479,_0x443e67=getChalk(_0x24277e);console[_0xa96917(0x1de)](_0x443e67['yellow'](_0xa96917(0x1ef))),console[_0xa96917(0x1de)](_0x443e67[_0xa96917(0x257)](_0xa96917(0x237))),console[_0xa96917(0x1de)](_0x443e67['dim'](_0xa96917(0x1c4))),console[_0xa96917(0x1de)]();if(_0x3e9424[_0xa96917(0x1cc)]===0x0)return console[_0xa96917(0x231)](_0xa96917(0x1db)),console['error'](_0xa96917(0x1d0)),0x1;const _0x1b9042=_0x3e9424[0x0],_0x5562b2=_0x24277e,_0x2521af=_0x5562b2[_0xa96917(0x1ca)],_0x2e86cc=_0x5562b2[_0xa96917(0x1d6)];try{const _0x1a54bf=_0x2521af||_0x1b9042+_0xa96917(0x258);if(a27_0x459d21['existsSync'](_0x1a54bf)&&!_0x2e86cc){if(!_0x24277e[_0xa96917(0x1c5)]){const _0x5dd895=await confirm('Output\x20directory\x20\x27'+_0x1a54bf+_0xa96917(0x1b6));if(!_0x5dd895)return console[_0xa96917(0x1de)](_0xa96917(0x25c)),0x0;}a27_0x459d21['rmSync'](_0x1a54bf,{'recursive':!![]});}const _0x104d79=await withSpinner(_0x2e86cc?_0xa96917(0x267)+_0x1b9042+_0xa96917(0x23f):_0xa96917(0x261)+_0x1b9042+_0xa96917(0x23f),()=>_0x27a2ae[_0xa96917(0x210)]['backupProject'](_0x1b9042,_0x2521af,{'dryRun':_0x2e86cc}),{'verbose':_0x24277e['verbose']}),_0x37ce9c=_0x104d79['data'];return _0x2e86cc?console[_0xa96917(0x1de)](_0xa96917(0x247)+_0x37ce9c[_0xa96917(0x24d)]):console[_0xa96917(0x1de)](_0xa96917(0x244)+_0x37ce9c[_0xa96917(0x24d)]),console[_0xa96917(0x1de)](_0xa96917(0x22f)+_0x37ce9c[_0xa96917(0x275)][_0xa96917(0x205)]),console[_0xa96917(0x1de)](_0xa96917(0x207)+_0x37ce9c[_0xa96917(0x275)][_0xa96917(0x271)]),console[_0xa96917(0x1de)](_0xa96917(0x1c6)+_0x37ce9c[_0xa96917(0x275)]['prompts']),console[_0xa96917(0x1de)](_0xa96917(0x233)+_0x37ce9c[_0xa96917(0x275)][_0xa96917(0x279)]),(_0x24277e['format']===_0xa96917(0x1d4)||_0x24277e[_0xa96917(0x21c)]===_0xa96917(0x23d))&&await handleSDKOutput([_0x37ce9c],_0x24277e),0x0;}catch(_0x1d2b73){return handleSDKError(_0x1d2b73,_0x24277e),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a27_0xb5a092(0x21d)]=a27_0xb5a092(0x22e);[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1f1);async[a27_0xb5a092(0x1ba)](_0x12bbf7){const _0x47b169=a27_0xb5a092,{options:_0x74decc,args:_0x585205,tdx:_0x2c55de}=_0x12bbf7,_0x1c6955=getChalk(_0x74decc);console[_0x47b169(0x1de)](_0x1c6955['yellow'](_0x47b169(0x223))),console[_0x47b169(0x1de)](_0x1c6955[_0x47b169(0x257)](_0x47b169(0x1c0))),console[_0x47b169(0x1de)](_0x1c6955[_0x47b169(0x1cd)](_0x47b169(0x27c))),console['log'](_0x1c6955[_0x47b169(0x1cd)](_0x47b169(0x266))),console[_0x47b169(0x1de)](_0x1c6955[_0x47b169(0x1cd)]('\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22')),console[_0x47b169(0x1de)]();if(_0x585205[_0x47b169(0x1cc)]===0x0)return console['error']('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x47b169(0x231)](_0x47b169(0x249)),0x1;const _0x427c66=_0x585205[0x0],_0x2571e1=_0x74decc,_0x454ce5=_0x2571e1[_0x47b169(0x21d)],_0x445d5f=_0x2571e1[_0x47b169(0x1d6)];try{if(!_0x445d5f){const _0x419f53=_0x2c55de['llm']['getBackupMetadata'](_0x427c66),_0x2fe54c=_0x454ce5||_0x419f53[_0x47b169(0x1dc)][_0x47b169(0x273)],_0x67c993=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x2c55de[_0x47b169(0x210)]['projects'](),{'verbose':_0x74decc[_0x47b169(0x256)]}),_0x2d3d42=_0x67c993[_0x47b169(0x23c)][_0x47b169(0x24f)](_0x5b8a38=>_0x5b8a38[_0x47b169(0x1e6)][_0x47b169(0x21d)]===_0x2fe54c);if(_0x2d3d42&&!_0x74decc['yes']){const _0xf49d1c=await confirm(_0x47b169(0x1ac)+_0x2fe54c+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0xf49d1c)return console[_0x47b169(0x1de)](_0x47b169(0x1ea)),0x0;}}const _0x589b48=await withSpinner(_0x445d5f?_0x47b169(0x1be)+_0x427c66+_0x47b169(0x23f):'Restoring\x20project\x20from\x20\x27'+_0x427c66+_0x47b169(0x23f),()=>_0x2c55de[_0x47b169(0x210)]['restoreProject'](_0x427c66,{'name':_0x454ce5,'dryRun':_0x445d5f}),{'verbose':_0x74decc['verbose']}),_0x372682=_0x589b48[_0x47b169(0x23c)];return _0x372682['sourceSite']&&console['log'](_0x47b169(0x1cb)+_0x372682[_0x47b169(0x259)]+'\x27'),_0x445d5f?console[_0x47b169(0x1de)](_0x47b169(0x208)+_0x372682[_0x47b169(0x273)]):console[_0x47b169(0x1de)](_0x47b169(0x200)+_0x372682[_0x47b169(0x273)]+'\x20('+_0x372682[_0x47b169(0x214)]+')'),console[_0x47b169(0x1de)]('\x20\x20Agents:\x20'+_0x372682['counts'][_0x47b169(0x205)]),console[_0x47b169(0x1de)](_0x47b169(0x207)+_0x372682[_0x47b169(0x275)]['knowledgeBases']),console[_0x47b169(0x1de)]('\x20\x20Prompts:\x20'+_0x372682[_0x47b169(0x275)][_0x47b169(0x26b)]),console['log']('\x20\x20Integrations:\x20'+_0x372682[_0x47b169(0x275)][_0x47b169(0x279)]),(_0x74decc[_0x47b169(0x21c)]===_0x47b169(0x1d4)||_0x74decc[_0x47b169(0x21c)]===_0x47b169(0x23d))&&await handleSDKOutput([_0x372682],_0x74decc),0x0;}catch(_0x4f6501){return handleSDKError(_0x4f6501,_0x74decc),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x3d9316,_0x3d5026){const _0x3dccb1=a27_0xb5a092,_0x1446fc=_0x3d5026[_0x3dccb1(0x1bf)]||CHAT_SELECTOR_PAGE_SIZE;let _0xd4ce06=0x0,_0x1cc819=[];const _0x186552=(await import(_0x3dccb1(0x26b)))[_0x3dccb1(0x1ff)],_0x4592c0=getChalk(_0x3d5026);while(!![]){const _0x492047=await withSpinner(_0x3dccb1(0x26a),()=>_0x3d9316['llm'][_0x3dccb1(0x1bb)](_0x1446fc+_0xd4ce06),{'verbose':_0x3d5026['verbose']});_0x1cc819=_0x492047['data'];const _0x452a18=_0x1cc819[_0x3dccb1(0x264)](_0xd4ce06,_0xd4ce06+_0x1446fc),_0x1d4495=_0x1cc819[_0x3dccb1(0x1cc)]>_0xd4ce06+_0x1446fc,_0x87f664=[...new Set(_0x452a18[_0x3dccb1(0x20f)](_0x352c06=>_0x352c06['attributes'][_0x3dccb1(0x1ad)])[_0x3dccb1(0x25e)](_0x26a3cc=>_0x26a3cc!==undefined))],_0x50e87d=new Map();await Promise[_0x3dccb1(0x22c)](_0x87f664['map'](async _0x3e865b=>{const _0x55d652=_0x3dccb1;try{const _0x1e67d9=await _0x3d9316['llm'][_0x55d652(0x215)](_0x3e865b);_0x50e87d[_0x55d652(0x222)](_0x3e865b,_0x1e67d9['attributes'][_0x55d652(0x21d)]);}catch{_0x50e87d[_0x55d652(0x222)](_0x3e865b,_0x3e865b);}}));const _0x345f32=_0x452a18['map'](_0x41342e=>{const _0xf3a126=_0x3dccb1,_0x271262=_0x41342e[_0xf3a126(0x1e6)][_0xf3a126(0x1fc)]||_0xf3a126(0x263),_0x1de291=_0x271262['split']('\x0a')[0x0],_0x201fab=_0x1de291[_0xf3a126(0x1cc)]>0x50?_0x1de291['substring'](0x0,0x4d)+_0xf3a126(0x253):_0x1de291,_0x3bbf36=_0x41342e['attributes'][_0xf3a126(0x1ad)]?_0x50e87d[_0xf3a126(0x216)](_0x41342e[_0xf3a126(0x1e6)][_0xf3a126(0x1ad)])||_0x41342e['attributes'][_0xf3a126(0x1ad)]:'(no\x20agent)',_0x287aa7=_0x41342e[_0xf3a126(0x1e6)][_0xf3a126(0x1af)]||_0x41342e[_0xf3a126(0x1e6)][_0xf3a126(0x270)],_0x496045=new Date(_0x287aa7),_0x1a81c2=new Date(),_0x8ce229=_0x1a81c2[_0xf3a126(0x217)]()-_0x496045[_0xf3a126(0x217)](),_0x4e0642=Math[_0xf3a126(0x25f)](_0x8ce229/0xea60),_0x1c451f=Math[_0xf3a126(0x25f)](_0x8ce229/0x36ee80),_0x141ece=Math[_0xf3a126(0x25f)](_0x8ce229/0x5265c00);let _0xcdd71a;if(_0x4e0642<0x1)_0xcdd71a=_0xf3a126(0x1ee);else{if(_0x4e0642<0x3c)_0xcdd71a=_0x4e0642+_0xf3a126(0x1f9);else{if(_0x1c451f<0x18)_0xcdd71a=_0x1c451f+_0xf3a126(0x246);else _0x141ece<0x7?_0xcdd71a=_0x141ece+'d\x20ago':_0xcdd71a=_0x496045['toLocaleDateString']('en-US',{'month':_0xf3a126(0x219),'day':_0xf3a126(0x23b)});}}return{'title':_0x201fab+'\x20'+_0x4592c0[_0xf3a126(0x1cd)]('['+_0x3bbf36+']\x20'+_0xcdd71a),'value':_0x41342e['id']};});_0x1d4495&&_0x345f32['push']({'title':_0x4592c0[_0x3dccb1(0x278)](_0x3dccb1(0x25d)),'value':_0x3dccb1(0x234)});const _0x110005=await _0x186552({'type':_0x3dccb1(0x1ec),'name':'chatId','message':_0x3dccb1(0x1c9),'choices':_0x345f32,'hint':_0x3dccb1(0x206)});if(!_0x110005[_0x3dccb1(0x1c8)])return undefined;if(_0x110005['chatId']==='__load_more__'){_0xd4ce06+=_0x1446fc;continue;}return _0x110005['chatId'];}}export class ChatsCommand extends BaseCommand{['name']=a27_0xb5a092(0x1bb);[a27_0xb5a092(0x21b)]=a27_0xb5a092(0x1e4);async['execute'](_0x571167){const _0x3a1b2f=a27_0xb5a092;return executeChatHistoryCommand(_0x571167,_0x3a1b2f(0x1f5));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x1a57(){const _0x26646c=['\x0a\x0aShutting\x20down\x20proxy\x20server...','port','llm','projects','✓\x20Proxy\x20server\x20stopped','created\x20on-demand\x20per\x20model','\x0aTesting\x20with\x20Agent\x20SDK:','yellow','dim','6329224hQhGtZ','NOT_FOUND','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','stop','687416wWmobz','136815uJWnPf','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','attributes','\x20\x20}','site','close','\x20\x20Project:','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','18mLbCAZ','Port\x20','logLevel','1377427kRYJtM','white','2667UuXBMN','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','Resolving\x20project...','\x20\x20Address:','getOrCreateDefaultProject','server','Starting\x20proxy\x20server...','\x20\x20{','\x20is\x20unavailable,\x20using\x20port\x20','1058770KpFcnD','project','\x20\x20Agents:','6ncZwuX','start','cyan','\x20\x20Site:','\x20\x20\x20\x20\x22env\x22:\x20{','http://0.0.0.0:','bold','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','green','description','Project\x20\x27','logger','name','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','20838DftCOf','log','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','exit','find','64768210JNoBcv'];a28_0x1a57=function(){return _0x26646c;};return a28_0x1a57();}const a28_0x2a02c7=a28_0xc635;(function(_0x3bd6b9,_0x34df7e){const _0x49a8c7=a28_0xc635,_0x27068b=_0x3bd6b9();while(!![]){try{const _0x402396=-parseInt(_0x49a8c7(0x181))/0x1+parseInt(_0x49a8c7(0x190))/0x2*(-parseInt(_0x49a8c7(0x193))/0x3)+-parseInt(_0x49a8c7(0x170))/0x4+parseInt(_0x49a8c7(0x175))/0x5+-parseInt(_0x49a8c7(0x161))/0x6*(parseInt(_0x49a8c7(0x183))/0x7)+parseInt(_0x49a8c7(0x174))/0x8*(-parseInt(_0x49a8c7(0x17e))/0x9)+parseInt(_0x49a8c7(0x166))/0xa;if(_0x402396===_0x34df7e)break;else _0x27068b['push'](_0x27068b['shift']());}catch(_0x2007bd){_0x27068b['push'](_0x27068b['shift']());}}}(a28_0x1a57,0xf1d96));import a28_0x26554d from'chalk';function a28_0xc635(_0x313ed4,_0xf49a43){_0x313ed4=_0x313ed4-0x15c;const _0x1a5768=a28_0x1a57();let _0xc635c7=_0x1a5768[_0x313ed4];return _0xc635c7;}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(_0x3c8441,_0x12f596){const _0x3e29dc=a28_0xc635,{tdx:_0x49b82d,options:_0x1b6fe1}=_0x3c8441,_0x1c87ab=_0x12f596||_0x1b6fe1['llmProject'];if(_0x1c87ab){const _0x515218=await _0x49b82d[_0x3e29dc(0x169)][_0x3e29dc(0x16a)](),_0x30574b=_0x515218[_0x3e29dc(0x165)](_0x592f98=>_0x592f98[_0x3e29dc(0x178)]['name']===_0x1c87ab);if(!_0x30574b)throw new SDKError(ErrorCode[_0x3e29dc(0x171)],_0x3e29dc(0x15d)+_0x1c87ab+'\x27\x20not\x20found',undefined,{'helpText':_0x3e29dc(0x177)});return _0x30574b['id'];}const _0x4e0e9e=await _0x49b82d[_0x3e29dc(0x169)][_0x3e29dc(0x18b)]();return _0x4e0e9e['id'];}export class LLMProxyCommand extends BaseCommand{[a28_0x2a02c7(0x15f)]='llm:proxy';[a28_0x2a02c7(0x15c)]=a28_0x2a02c7(0x187);[a28_0x2a02c7(0x18c)];['logger'];async['execute'](_0x2e2088){const _0x2e0440=a28_0x2a02c7,{tdx:_0x44be68,options:_0x54d65c}=_0x2e2088;try{const _0x4a6938=_0x54d65c,_0x1d9bc8=_0x4a6938[_0x2e0440(0x168)]||0xfa0,_0x2fd01d=_0x4a6938[_0x2e0440(0x191)],_0x26a847=await findAvailablePort(_0x1d9bc8);console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16f)](_0x2e0440(0x189)));const _0x3c8987=await getProjectIdOrDefault(_0x2e2088,_0x2fd01d),_0x26ca77=await _0x44be68[_0x2e0440(0x169)][_0x2e0440(0x16a)](),_0x53fbd8=_0x26ca77[_0x2e0440(0x165)](_0x5f4e37=>_0x5f4e37['id']===_0x3c8987);this[_0x2e0440(0x15e)]=new TDXLogger(_0x54d65c[_0x2e0440(0x180)]),await this[_0x2e0440(0x15e)]['init'](),console['log'](a28_0x26554d['dim'](_0x2e0440(0x18d)));_0x26a847!==_0x1d9bc8&&console[_0x2e0440(0x162)](a28_0x26554d['yellow'](_0x2e0440(0x17f)+_0x1d9bc8+_0x2e0440(0x18f)+_0x26a847));this[_0x2e0440(0x18c)]=new ProxyServer({'port':_0x26a847,'projectId':_0x3c8987,'tdx':_0x44be68,'logger':this['logger'],'site':_0x54d65c[_0x2e0440(0x17a)]}),await this[_0x2e0440(0x18c)][_0x2e0440(0x194)](),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16e)][_0x2e0440(0x199)](_0x2e0440(0x17d))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16e)](_0x2e0440(0x163))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16e)]('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x19b)][_0x2e0440(0x199)](_0x2e0440(0x184))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x195)]('Server\x20Configuration:')),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16f)](_0x2e0440(0x18a)),a28_0x26554d['white'](_0x2e0440(0x198)+_0x26a847)),console['log'](a28_0x26554d[_0x2e0440(0x16f)](_0x2e0440(0x17c)),a28_0x26554d[_0x2e0440(0x182)](_0x53fbd8?.['attributes'][_0x2e0440(0x15f)]||_0x3c8987)),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16f)](_0x2e0440(0x192)),a28_0x26554d[_0x2e0440(0x182)](_0x2e0440(0x16c))),console[_0x2e0440(0x162)](a28_0x26554d['dim'](_0x2e0440(0x196)),a28_0x26554d[_0x2e0440(0x182)](_0x54d65c[_0x2e0440(0x17a)])),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x195)]('\x0aClaude\x20Code\x20Configuration:')),console[_0x2e0440(0x162)](a28_0x26554d['dim'](_0x2e0440(0x160))),console['log'](a28_0x26554d[_0x2e0440(0x182)](_0x2e0440(0x18e))),console[_0x2e0440(0x162)](a28_0x26554d['white'](_0x2e0440(0x197))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x182)](_0x2e0440(0x188)+_0x26a847+'\x22,')),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x182)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,')),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x182)](_0x2e0440(0x172))),console[_0x2e0440(0x162)](a28_0x26554d['white']('\x20\x20\x20\x20}')),console[_0x2e0440(0x162)](a28_0x26554d['white'](_0x2e0440(0x179))),console['log'](a28_0x26554d[_0x2e0440(0x195)](_0x2e0440(0x16d))),console['log'](a28_0x26554d['dim'](_0x2e0440(0x186))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16f)](_0x2e0440(0x176))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16f)](_0x2e0440(0x185))),console[_0x2e0440(0x162)](a28_0x26554d[_0x2e0440(0x16e)](_0x2e0440(0x19a)));const _0x533e58=async()=>{const _0x44d43f=_0x2e0440;console[_0x44d43f(0x162)](a28_0x26554d[_0x44d43f(0x16f)](_0x44d43f(0x167))),this[_0x44d43f(0x18c)]&&await this[_0x44d43f(0x18c)][_0x44d43f(0x173)](),this[_0x44d43f(0x15e)]&&await this[_0x44d43f(0x15e)][_0x44d43f(0x17b)](),console[_0x44d43f(0x162)](a28_0x26554d[_0x44d43f(0x19b)](_0x44d43f(0x16b))),process[_0x44d43f(0x164)](0x0);};return process['on']('SIGINT',_0x533e58),process['on']('SIGTERM',_0x533e58),await new Promise(()=>{}),0x0;}catch(_0x5312db){this[_0x2e0440(0x18c)]&&await this['server']['stop']();this['logger']&&await this[_0x2e0440(0x15e)][_0x2e0440(0x17b)]();throw _0x5312db;}}}
|
|
@@ -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_0x40f8eb=a29_0x50ab;(function(_0xed943d,_0x6dd519){const _0x1b2c84=a29_0x50ab,_0x38eae3=_0xed943d();while(!![]){try{const _0x34e60e=parseInt(_0x1b2c84(0x18c))/0x1+-parseInt(_0x1b2c84(0x14f))/0x2+-parseInt(_0x1b2c84(0x1e8))/0x3+-parseInt(_0x1b2c84(0x100))/0x4+parseInt(_0x1b2c84(0x1b0))/0x5+parseInt(_0x1b2c84(0x1c3))/0x6*(-parseInt(_0x1b2c84(0x117))/0x7)+-parseInt(_0x1b2c84(0x15b))/0x8*(-parseInt(_0x1b2c84(0xfb))/0x9);if(_0x34e60e===_0x6dd519)break;else _0x38eae3['push'](_0x38eae3['shift']());}catch(_0x3740dd){_0x38eae3['push'](_0x38eae3['shift']());}}}(a29_0x2ecd,0x663a6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0x472bdf 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';function a29_0x50ab(_0x4cabf5,_0x20ebf7){_0x4cabf5=_0x4cabf5-0xc8;const _0x2ecd1=a29_0x2ecd();let _0x50abbb=_0x2ecd1[_0x4cabf5];return _0x50abbb;}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_0x41d2e6 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_0x40f8eb(0xec),LEGACY_PARENT_SEGMENT_DIR=a29_0x40f8eb(0x1b9);function openBrowser(_0x297555){const _0x145855=a29_0x40f8eb,_0x254dcb=process['platform'],_0x12f9a9=_0x254dcb===_0x145855(0x177)?'open':_0x254dcb===_0x145855(0x104)?'start':_0x145855(0xd2);spawn(_0x12f9a9,[_0x297555],{'detached':!![],'stdio':'ignore'})['unref']();}function migrateLegacyDirectory(){const _0xdb72cb=a29_0x40f8eb;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x568103=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x568103['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a29_0x41d2e6[_0xdb72cb(0x1af)](_0xdb72cb(0x105)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0xdb72cb(0x15d))),console[_0xdb72cb(0x150)](a29_0x41d2e6[_0xdb72cb(0x186)](_0xdb72cb(0x164)+LEGACY_PARENT_SEGMENT_DIR+_0xdb72cb(0x119))),![];console['error'](a29_0x41d2e6[_0xdb72cb(0x1af)]('\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[_0xdb72cb(0x150)](a29_0x41d2e6[_0xdb72cb(0x10e)](_0xdb72cb(0x109)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2d0786){const _0x542f0b=_0x2d0786 instanceof Error?_0x2d0786['message']:String(_0x2d0786);return console[_0xdb72cb(0x150)](a29_0x41d2e6['red'](_0xdb72cb(0x17c)+_0x542f0b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x40f8eb(0x16e)](_0x396a4e){return migrateLegacyDirectory(),super['run'](_0x396a4e);}}function resolveYamlFile(_0x525bc3){const _0x511f8d=a29_0x40f8eb;if(_0x525bc3[_0x511f8d(0x1ce)](_0x511f8d(0xe9))||_0x525bc3['endsWith'](_0x511f8d(0x162)))return _0x525bc3;return a29_0x472bdf[_0x511f8d(0x1b1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x525bc3)+'.yml');}function formatProgressMessage(_0x3d2e91){const _0x4e29a4=a29_0x40f8eb,_0x3c1505=_0x3d2e91[_0x4e29a4(0xe1)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3c1505){const [,_0x4acbc0,_0x160344,_0x42194c='']=_0x3c1505;return a29_0x41d2e6['dim'](_0x4acbc0+':')+'\x20'+_0x160344+a29_0x41d2e6[_0x4e29a4(0x186)](_0x42194c);}return a29_0x41d2e6['dim'](_0x3d2e91);}function showFileNotFoundError(_0x4ac263,_0x5e16c4){const _0x48b024=a29_0x40f8eb;console[_0x48b024(0x150)](a29_0x41d2e6[_0x48b024(0xf4)]('Error:\x20File\x20not\x20found:\x20'+_0x4ac263+'\x0a')),console[_0x48b024(0x150)](a29_0x41d2e6[_0x48b024(0x18b)](_0x48b024(0x1ab)+_0x5e16c4+_0x48b024(0x120)));}function showParentSegmentNotSetError(_0x4d65d1){const _0x5cc931=a29_0x40f8eb;console[_0x5cc931(0x150)](a29_0x41d2e6[_0x5cc931(0x1af)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x5cc931(0x150)](_0x4d65d1);}function a29_0x2ecd(){const _0x448cd5=['trim','Options:\x0a','sampleData','Master\x20+\x20Attributes','addAttributesFile','double','8KfXZOy','varchar','/\x20directories\x20exist.','\x0aChanges\x20to\x20apply\x20to\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Created','\x20\x20\x20\x20-\x20','.yaml','Options:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','totalEvents','displayValidateResults','\x27\x20with\x20ID:\x20','\x20parent\x20segment\x20\x27','session','segment','errors','\x20Configuration\x20is\x20valid','execute','run','allValid','Attributes','\x20rows\x20','Preview:','displayColumns','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Fetching\x20SQL\x20for\x20\x27','yes','darwin','\x20\x20No\x20sample\x20data\x20available','format','tdx\x20segment\x20parent\x20preview\x20','Options\x20(one\x20required):\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20[Job\x20ID:\x20','Source:','interval','columns','displaySampleData','timezone','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','/app/dw/parentSegments/','dim','Overwrite\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','parentSegment','attributes','cyan','621614NdiWVn','start','To\x20cancel:','Output\x20file:\x20','label','addAttributes','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','getParentSQL','rowCount','segment:parent:pull','dirname','pullParentYaml','coveragePercent','behavior','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','addBehaviorsFile','segment:parent:update','foreignKey','using\x20the\x20default\x20path:\x20','segment:parent:run','Session:','Database:\x20','getParentFull','output','Updated','Listing\x20fields\x20for\x20\x27','displayPreviewResults','segment:parent:push','population','\x20Opening\x20','column','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','validateParentYaml','status','displayPreviewHints','yellow','3736420iMCmeG','join','Show\x20parent\x20segment\x20details','enriched','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','segment:parent:view','bold','\x20--attribute\x20\x22','filter','parent_segment','\x20--behavior\x20\x22<name>\x22','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','apply','segment:parent:show','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','workflowId','data','joinKey','1899462wjTfVo','Resolving\x20parent\x20segment\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','/app/workflows/','To\x20view\x20sample\x20data:','segment:parent:validate','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Analyzing\x20changes...','repeat','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20--behavior\x20\x22','endsWith','table','behaviors','localeCompare','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','workflowSessionId','Fetching\x20sample\x20data...','Join:','Enriched:','site','keys','scheduleOption','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','No\x20parent\x20segments\x20found','stop','sort','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displaySummary','addBehaviors','segment:parent:desc','✔\x20Found\x20','👥\x20','matchedCount','Validating\x20configuration...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','1022337pOIFBH','Parent\x20segment:\x20','✔\x20No\x20changes\x20-\x20\x27','Status:','name','jobId','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20--attribute\x20\x22<name>\x22','Listing\x20parent\x20segments...','\x0aChanges\x20to\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','verbose','web','xdg-open','FINISHED','information_schema','Master\x20Table','\x27...','Create\x20parent\x20segment\x20\x27','Rows:','Attempt:','customerGroupFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','displayMasterInfo','attribute','\x20rows)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','toLocaleString','match','scheduleType','workflowAttemptId','pushParentYaml','\x20=\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Join\x20on:','displayBehaviorsStats','.yml','createParent','\x27\x20and\x20run\x20workflow?','parent_segments','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x0aNo\x20sample\x20data\x20available','Site:\x20','use','all','setJobId','-1d','red','updateParent','✔\x20Created\x20parent\x20segment\x20\x27','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Columns:','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','3427983tqDufw','customersWithEvents','Error:','Fetching\x20parent\x20segment\x20\x27','text','936924BbcOgG','\x20kill','map','Executing\x20parent\x20segment\x20query...','win32','\x0a⚠️\x20\x20Both\x20','Table:\x20','preview','elapsedTimeMillis','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','SELECT\x20*\x20FROM\x20(\x0a','Available\x20attributes:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','green','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Validate:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','in\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','toFixed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','14fzMdMw','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','/\x20directory.\x0a','schemaValid','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','\x20Context\x20set:\x20','jsonl','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','`\x20to\x20download\x20the\x20configuration\x20first','message','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Updating','json','master','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','customerPercent','number','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','schemaError','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Errors:','Audience\x20ID:','\x27\x20is\x20already\x20up\x20to\x20date','Attribute:','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20--database\x20and\x20--table\x20are\x20required','database','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','length','\x5c$&','Error\x20parsing\x20YAML:\x20','Behavior:','customerGroup','/attempt/','Creating','string','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Name:\x20','Error\x20reading\x20file:\x20','resolveParentId','\x20tdx\x20wf\x20attempt\x20','segment:parent:create','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20field','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','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','replace','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','YAML\x20file:\x20','245790hrsbOQ','error','Aborted.','segment:parent:sql','utf-8','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'];a29_0x2ecd=function(){return _0x448cd5;};return a29_0x2ecd();}export class ParentSegmentListCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]='segment:parent:list';[a29_0x40f8eb(0x13f)]='List\x20parent\x20segments';async['execute'](_0x1132df){const _0x301d7e=a29_0x40f8eb,{options:_0x3caca1,args:_0x3f120a,tdx:_0x15e29e}=_0x1132df,_0x1239bc=_0x3f120a[0x0];_0x3caca1['verbose']&&(console['error'](_0x301d7e(0xef)+_0x3caca1[_0x301d7e(0x1d8)]),_0x1239bc&&console[_0x301d7e(0x150)]('Pattern:\x20'+_0x1239bc));const _0x411a92=await withSpinner(_0x1239bc?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x1239bc+_0x301d7e(0xd6):_0x301d7e(0xcd),()=>_0x15e29e[_0x301d7e(0x16a)]['listParents'](),{'verbose':_0x3caca1['verbose']});let _0x538f4f=_0x411a92[_0x301d7e(0x1c1)];if(_0x1239bc){const _0xba3478=_0x1239bc[_0x301d7e(0x14c)](/[.+^${}()|[\]\\]/g,_0x301d7e(0x138))[_0x301d7e(0x14c)](/\*/g,'.*')[_0x301d7e(0x14c)](/\?/g,'.'),_0x2a5316=new RegExp('^'+_0xba3478+'$','i');_0x538f4f=_0x538f4f[_0x301d7e(0x1b8)](_0x2af384=>_0x2a5316['test'](_0x2af384[_0x301d7e(0x18a)][_0x301d7e(0xc9)]));}_0x538f4f[_0x301d7e(0x1de)]((_0x3360f3,_0x4ca1a4)=>_0x3360f3['attributes'][_0x301d7e(0xc9)][_0x301d7e(0x1d1)](_0x4ca1a4[_0x301d7e(0x18a)][_0x301d7e(0xc9)])),console[_0x301d7e(0x150)](_0x301d7e(0x1e3)+_0x538f4f[_0x301d7e(0x137)]+'\x20parent\x20segment'+(_0x538f4f[_0x301d7e(0x137)]!==0x1?'s':''));if(_0x3caca1[_0x301d7e(0x179)]===_0x301d7e(0x124)||_0x3caca1[_0x301d7e(0x179)]===_0x301d7e(0x11d))await handleSDKOutput(_0x538f4f,_0x3caca1);else{if(_0x538f4f[_0x301d7e(0x137)]===0x0)_0x1239bc?console[_0x301d7e(0x132)](_0x301d7e(0xcf)+_0x1239bc):console['log'](_0x301d7e(0x1dc));else for(const _0x44b2b3 of _0x538f4f){const _0x524f11=_0x44b2b3[_0x301d7e(0x18a)][_0x301d7e(0x1a8)]?a29_0x41d2e6[_0x301d7e(0x186)]('\x20('+formatRows(_0x44b2b3[_0x301d7e(0x18a)]['population'])+')'):'';console['log'](_0x301d7e(0x1e4)+_0x44b2b3[_0x301d7e(0x18a)][_0x301d7e(0xc9)]+_0x524f11);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x145);[a29_0x40f8eb(0x13f)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x40f8eb(0x16d)](_0x2e59ee){const _0x4a5f83=a29_0x40f8eb,{options:_0x4a0df4,args:_0x4a2c3f,tdx:_0x409151}=_0x2e59ee;console['error'](_0x4a5f83(0x1b4)+_0x4a5f83(0x11f)+_0x4a5f83(0x10a));const _0x1675ef=_0x4a0df4;if(_0x4a2c3f[_0x4a5f83(0x137)]===0x0)return console[_0x4a5f83(0x150)](a29_0x41d2e6[_0x4a5f83(0xf4)](_0x4a5f83(0xdb))),console[_0x4a5f83(0x150)](_0x4a5f83(0xf8)),0x1;const _0x2c3893=_0x4a2c3f[0x0];if(!_0x1675ef[_0x4a5f83(0x135)]||!_0x1675ef['table'])return console[_0x4a5f83(0x150)](_0x4a5f83(0x134)),console[_0x4a5f83(0x150)](_0x4a5f83(0xf8)),0x1;_0x1675ef[_0x4a5f83(0xd0)]&&(console['error'](_0x4a5f83(0xef)+_0x1675ef[_0x4a5f83(0x1d8)]),console[_0x4a5f83(0x150)](_0x4a5f83(0x141)+_0x2c3893),console[_0x4a5f83(0x150)](_0x4a5f83(0x1a1)+_0x1675ef[_0x4a5f83(0x135)]),console[_0x4a5f83(0x150)](_0x4a5f83(0x106)+_0x1675ef[_0x4a5f83(0x1cf)]));const _0x4fce96=await loadJSONFromOptions(_0x1675ef[_0x4a5f83(0x18a)],_0x1675ef[_0x4a5f83(0xf7)]),_0x492fa2=await loadJSONFromOptions(_0x1675ef['behaviors'],_0x1675ef['behaviorsFile']),_0x56ab63=await loadJSONFromOptions(_0x1675ef['customerGroup'],_0x1675ef[_0x4a5f83(0xda)]),_0x273d9b={'name':_0x2c3893,'description':_0x1675ef[_0x4a5f83(0x13f)],'scheduleType':_0x1675ef[_0x4a5f83(0xe2)],'scheduleOption':_0x1675ef[_0x4a5f83(0x1da)],'timezone':_0x1675ef['timezone'],'master':{'parentDatabaseName':_0x1675ef['database'],'parentTableName':_0x1675ef[_0x4a5f83(0x1cf)]},'attributes':_0x4fce96,'behaviors':_0x492fa2,'customerGroup':_0x56ab63},_0x269b25=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2c3893+_0x4a5f83(0xd6),()=>_0x409151[_0x4a5f83(0x16a)][_0x4a5f83(0xea)](_0x273d9b),{'verbose':_0x4a0df4[_0x4a5f83(0xd0)]}),_0xbce3ff=_0x269b25[_0x4a5f83(0x1c1)];return console[_0x4a5f83(0x150)](_0x4a5f83(0xf6)+_0xbce3ff[_0x4a5f83(0xc9)]+_0x4a5f83(0x167)+_0xbce3ff['id']),await handleSDKOutput([_0xbce3ff],_0x4a0df4),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x19c);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x40f8eb(0x16d)](_0x298316){const _0x4b278d=a29_0x40f8eb,{options:_0x17023b,args:_0x211bb3,tdx:_0x28afdc}=_0x298316;console[_0x4b278d(0x150)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x4b278d(0x10a));const _0x239e8d=_0x17023b;if(_0x211bb3[_0x4b278d(0x137)]===0x0)return console[_0x4b278d(0x150)](a29_0x41d2e6[_0x4b278d(0xf4)](_0x4b278d(0xdb))),console[_0x4b278d(0x150)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x24ce1c=_0x211bb3[0x0];_0x239e8d[_0x4b278d(0xd0)]&&(console[_0x4b278d(0x150)](_0x4b278d(0xef)+_0x239e8d[_0x4b278d(0x1d8)]),console[_0x4b278d(0x150)]('Parent\x20segment:\x20'+_0x24ce1c));const _0x1992cd=await withSpinner(_0x4b278d(0x183)+_0x24ce1c+_0x4b278d(0xd6),()=>_0x28afdc[_0x4b278d(0x16a)][_0x4b278d(0x1a2)](_0x24ce1c),{'verbose':_0x239e8d['verbose']}),_0x3989d3=_0x1992cd[_0x4b278d(0x1c1)],_0x220a33=await loadJSONFromOptions(_0x239e8d[_0x4b278d(0x191)],_0x239e8d[_0x4b278d(0x159)]),_0x9dfcb7=await loadJSONFromOptions(_0x239e8d[_0x4b278d(0x1e1)],_0x239e8d[_0x4b278d(0x19b)]),_0x431b86={'name':_0x3989d3['name'],'description':_0x239e8d[_0x4b278d(0x13f)]!==undefined?_0x239e8d[_0x4b278d(0x13f)]:_0x3989d3['description'],'scheduleType':_0x239e8d['scheduleType']!==undefined?_0x239e8d['scheduleType']:_0x3989d3[_0x4b278d(0xe2)],'scheduleOption':_0x239e8d[_0x4b278d(0x1da)]!==undefined?_0x239e8d['scheduleOption']:_0x3989d3[_0x4b278d(0x1da)],'timezone':_0x239e8d[_0x4b278d(0x182)]!==undefined?_0x239e8d[_0x4b278d(0x182)]:_0x3989d3[_0x4b278d(0x182)],'master':_0x3989d3[_0x4b278d(0x125)],'attributes':_0x220a33?[..._0x3989d3['attributes']||[],..._0x220a33]:_0x3989d3[_0x4b278d(0x18a)],'behaviors':_0x9dfcb7?[..._0x3989d3['behaviors']||[],..._0x9dfcb7]:_0x3989d3['behaviors'],'customerGroup':_0x3989d3[_0x4b278d(0x13b)]},_0x2cfac9=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x24ce1c+_0x4b278d(0xd6),()=>_0x28afdc[_0x4b278d(0x16a)][_0x4b278d(0xf5)](_0x24ce1c,_0x431b86),{'verbose':_0x239e8d[_0x4b278d(0xd0)]}),_0x361586=_0x2cfac9[_0x4b278d(0x1c1)];return console[_0x4b278d(0x150)](_0x4b278d(0x11e)+_0x361586[_0x4b278d(0xc9)]+'\x27'),await handleSDKOutput([_0x361586],_0x239e8d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a29_0x40f8eb(0x195);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x113);async[a29_0x40f8eb(0x16d)](_0x4536b8){const _0x284086=a29_0x40f8eb,{options:_0x1caaea,args:_0x1a373d,tdx:_0x44b604}=_0x4536b8,_0x500b5c=_0x1caaea,_0x3b0866=_0x1a373d[0x0]||_0x1caaea[_0x284086(0x189)];if(!_0x3b0866)return showParentSegmentNotSetError(_0x284086(0x19a)+_0x284086(0x133)),0x1;if(_0x500b5c[_0x284086(0xf0)]&&_0x500b5c[_0x284086(0x1a3)])return console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0xf4)](_0x284086(0x12a))),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x1db))),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x19e)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console['error'](a29_0x41d2e6[_0x284086(0x18b)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x20b4c5=_0x500b5c['output']||a29_0x472bdf[_0x284086(0x1b1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3b0866)+_0x284086(0xe9));_0x500b5c['verbose']&&(console[_0x284086(0x150)](_0x284086(0xef)+_0x500b5c['site']),console[_0x284086(0x150)](_0x284086(0x1e9)+_0x3b0866),console['error'](_0x284086(0x18f)+_0x20b4c5));const _0x4b79ae=await withSpinner(_0x284086(0xfe)+_0x3b0866+_0x284086(0xd6),()=>_0x44b604[_0x284086(0x16a)][_0x284086(0x197)](_0x3b0866),{'verbose':_0x500b5c[_0x284086(0xd0)]}),_0x5c4acc=_0x4b79ae[_0x284086(0x1c1)];if(existsSync(_0x20b4c5)){const _0xd507f=readFileSync(_0x20b4c5,_0x284086(0x153)),_0x47e1c6=generateDiff(_0xd507f,_0x5c4acc);if(!hasChanges(_0x47e1c6))console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x10e)]('✔')+'\x20No\x20changes\x20-\x20'+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x284086(0x150)](_0x284086(0xce)+_0x20b4c5+'\x27:'),console['error']('─'[_0x284086(0x1cb)](0x3c)),console[_0x284086(0x150)](formatDiffWithColors(_0x47e1c6)),console[_0x284086(0x150)]('─'[_0x284086(0x1cb)](0x3c));if(!_0x500b5c[_0x284086(0x176)]){const _0x186bbd=await confirmKey(_0x284086(0x187)+_0x20b4c5+'\x27?');if(!_0x186bbd)return console['error'](_0x284086(0x151)),0x1;}writeFileSync(_0x20b4c5,_0x5c4acc,_0x284086(0x153)),console['error'](a29_0x41d2e6['green']('✔')+_0x284086(0x154)+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5));}}else{const _0x752fcd=a29_0x472bdf[_0x284086(0x196)](_0x20b4c5);!existsSync(_0x752fcd)&&mkdirSync(_0x752fcd,{'recursive':!![]}),writeFileSync(_0x20b4c5,_0x5c4acc,'utf-8'),console[_0x284086(0x150)](a29_0x41d2e6['green']('✔')+_0x284086(0x154)+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5));}return saveSessionContext({'parent_segment':_0x3b0866},_0x500b5c[_0x284086(0x169)]),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x10e)]('✔')+_0x284086(0x11c)+a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x1b9))+_0x284086(0xe5)+a29_0x41d2e6[_0x284086(0x18b)](_0x3b0866)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1a7);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x122);async[a29_0x40f8eb(0x16d)](_0x5d35a1){const _0x539592=a29_0x40f8eb,{options:_0x1d2ac8,args:_0x28e1f9,tdx:_0x433630}=_0x5d35a1,_0x3667a3=_0x1d2ac8,_0x4ee828=_0x28e1f9[0x0]||_0x1d2ac8[_0x539592(0x189)];if(!_0x4ee828)return showParentSegmentNotSetError(_0x539592(0x12d)+_0x539592(0x140)),0x1;const _0x18cab9=resolveYamlFile(_0x4ee828);if(!existsSync(_0x18cab9))return showFileNotFoundError(_0x18cab9,_0x4ee828),0x1;_0x3667a3[_0x539592(0xd0)]&&(console[_0x539592(0x150)]('Site:\x20'+_0x3667a3[_0x539592(0x1d8)]),console[_0x539592(0x150)]('YAML\x20file:\x20'+_0x18cab9));let _0x248a5e;try{_0x248a5e=readFileSync(_0x18cab9,_0x539592(0x153));}catch(_0x309abc){const _0x3a1b04=_0x309abc instanceof Error?_0x309abc['message']:String(_0x309abc);return console['error'](_0x539592(0x142)+_0x3a1b04),0x1;}const _0x34927b=await withSpinner(_0x539592(0x1ca),()=>_0x433630[_0x539592(0x16a)][_0x539592(0xe4)](_0x248a5e),{'verbose':_0x3667a3[_0x539592(0xd0)]}),_0x165eb9=_0x34927b[_0x539592(0x1c1)],{isNew:_0x4c33fa,name:_0x16e00b,hasChanges:_0x3591dc,diffFormatted:_0x13a5e5}=_0x165eb9;if(!_0x3591dc)return console[_0x539592(0x150)](_0x539592(0x1ea)+_0x16e00b+_0x539592(0x130)),0x0;_0x4c33fa?console[_0x539592(0x150)](_0x539592(0x12c)+_0x16e00b+'\x27:'):console[_0x539592(0x150)](_0x539592(0x15e)+_0x16e00b+'\x27:');console[_0x539592(0x150)]('─'['repeat'](0x3c)),console[_0x539592(0x150)](_0x13a5e5),console[_0x539592(0x150)]('─'[_0x539592(0x1cb)](0x3c));const _0x2045c6=_0x4c33fa?_0x539592(0xd7)+_0x16e00b+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x16e00b+'\x27?';if(!_0x3667a3['yes']){const _0x1a1a65=await confirmKey(_0x2045c6);if(!_0x1a1a65)return console[_0x539592(0x150)](_0x539592(0x151)),0x1;}const _0x239b43=_0x4c33fa?_0x539592(0x13d):_0x539592(0x123),_0x54dd5e=await withSpinner(_0x239b43+_0x539592(0x168)+_0x16e00b+_0x539592(0xd6),()=>_0x165eb9[_0x539592(0x1bd)](),{'verbose':_0x3667a3['verbose']}),_0x558eb8=_0x54dd5e['data'],_0x420450=getConsoleNextUrl(_0x3667a3[_0x539592(0x1d8)],_0x539592(0x185)+_0x558eb8['id']),_0x5c3013=_0x4c33fa?_0x539592(0x160):_0x539592(0x1a4);return console[_0x539592(0x150)]('✔\x20'+_0x5c3013+'\x20parent\x20segment\x20\x27'+_0x558eb8['name']+'\x27'),console[_0x539592(0x150)]('\x20\x20'+_0x420450),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1c8);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x14b);async['execute'](_0x51d84a){const _0x1dadcc=a29_0x40f8eb,{options:_0x316207,args:_0x493362,tdx:_0x421eab}=_0x51d84a,_0x4ff92b=_0x316207,_0x348844=_0x493362[0x0]||_0x316207['parentSegment'];if(!_0x348844)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x1dadcc(0x115)+_0x1dadcc(0x156)+_0x1dadcc(0x111)+_0x1dadcc(0x1d2)+_0x1dadcc(0x146)),0x1;const _0x54ebef=resolveYamlFile(_0x348844);if(!existsSync(_0x54ebef))return showFileNotFoundError(_0x54ebef,_0x348844),0x1;_0x4ff92b[_0x1dadcc(0xd0)]&&(console[_0x1dadcc(0x150)](_0x1dadcc(0xef)+_0x4ff92b[_0x1dadcc(0x1d8)]),console[_0x1dadcc(0x150)]('YAML\x20file:\x20'+_0x54ebef));let _0x279df6;try{_0x279df6=readFileSync(_0x54ebef,_0x1dadcc(0x153));}catch(_0x17a6d6){const _0x57264c=_0x17a6d6 instanceof Error?_0x17a6d6[_0x1dadcc(0x121)]:String(_0x17a6d6);return console['error'](_0x1dadcc(0x142)+_0x57264c),0x1;}const _0x106f65=createCommandSpinner(a29_0x41d2e6[_0x1dadcc(0x186)](_0x1dadcc(0x1e6)),{'verbose':_0x4ff92b[_0x1dadcc(0xd0)]});_0x106f65[_0x1dadcc(0x18d)]();const _0x435aa0={'onProgress':_0xae780f=>{_0x106f65['text']=formatProgressMessage(_0xae780f);}};if(_0x4ff92b[_0x1dadcc(0x125)])_0x435aa0['master']=!![];if(_0x4ff92b[_0x1dadcc(0x1b3)])_0x435aa0['enriched']=!![];_0x4ff92b['attribute']&&(_0x435aa0['attribute']=_0x4ff92b[_0x1dadcc(0xdd)]);_0x4ff92b[_0x1dadcc(0x199)]&&(_0x435aa0[_0x1dadcc(0x199)]=_0x4ff92b[_0x1dadcc(0x199)]);if(_0x4ff92b['interval'])_0x435aa0[_0x1dadcc(0x17f)]=_0x4ff92b[_0x1dadcc(0x17f)];let _0x26f5af;try{_0x26f5af=await _0x421eab[_0x1dadcc(0x16a)][_0x1dadcc(0x1ac)](_0x279df6,_0x435aa0),_0x106f65[_0x1dadcc(0x1dd)]();}catch(_0x2a91ec){_0x106f65['stop']();throw _0x2a91ec;}const _0x316c27=_0x4ff92b[_0x1dadcc(0x17f)]||_0x1dadcc(0xf3);return this[_0x1dadcc(0x166)](_0x26f5af,_0x435aa0,_0x54ebef,_0x316c27),_0x26f5af[_0x1dadcc(0x16f)]?0x0:0x1;}[a29_0x40f8eb(0x166)](_0x114fdf,_0x1f281a,_0x1c3cd9,_0x33516c){const _0x24694b=a29_0x40f8eb;console['error']('\x0a'+a29_0x41d2e6[_0x24694b(0x1b6)](_0x24694b(0x110))+'\x20'+_0x114fdf[_0x24694b(0xc9)]),console[_0x24694b(0x150)]('═'[_0x24694b(0x1cb)](0x3c)),this[_0x24694b(0xdc)](_0x114fdf);if(typeof _0x1f281a['attribute']===_0x24694b(0x13e)){this[_0x24694b(0x149)](_0x114fdf),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'attribute',_0x1f281a[_0x24694b(0xdd)]);return;}if(_0x1f281a[_0x24694b(0xdd)]===!![]){this['displayAttributesStats'](_0x114fdf),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'attributes');return;}if(typeof _0x1f281a['behavior']==='string'){this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'behavior',_0x1f281a[_0x24694b(0x199)]);return;}if(_0x1f281a['behavior']===!![]){this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this['displaySummary'](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,_0x24694b(0x1d0));return;}this[_0x24694b(0x149)](_0x114fdf),this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this['displaySummary'](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,_0x24694b(0xf1));}['displayPreviewHints'](_0x2b0c01,_0x1ae73b,_0x3f2ad3,_0x5ca8e6){const _0x496380=a29_0x40f8eb;console[_0x496380(0x150)]('\x0a'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x1c7)));const _0x1276b4=_0x1ae73b!==_0x496380(0xf3)?'\x20--interval\x20'+_0x1ae73b:'';if(_0x3f2ad3===_0x496380(0xdd)&&_0x5ca8e6)console['error']('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1b7)+_0x5ca8e6+'\x22'+_0x1276b4));else{if(_0x3f2ad3==='behavior'&&_0x5ca8e6)console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1cd)+_0x5ca8e6+'\x22'+_0x1276b4));else(_0x3f2ad3===_0x496380(0x18a)||_0x3f2ad3==='all')&&console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0xcc)+_0x1276b4));}(_0x3f2ad3===_0x496380(0x1d0)||_0x3f2ad3==='all')&&console['error']('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1ba)+_0x1276b4)),_0x3f2ad3==='all'&&console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+'\x20--enriched'+_0x1276b4));}['displayMasterInfo'](_0x43c874){const _0x55d245=a29_0x40f8eb,{master:_0x3a2ec8}=_0x43c874,_0x4a986a=_0x3a2ec8['schemaValid']?a29_0x41d2e6[_0x55d245(0x10e)]('✔'):a29_0x41d2e6['red']('✘');console[_0x55d245(0x150)]('\x0a'+a29_0x41d2e6[_0x55d245(0x186)](_0x55d245(0xd5))),console[_0x55d245(0x150)](_0x4a986a+'\x20'+a29_0x41d2e6[_0x55d245(0x1b6)](_0x3a2ec8['database']+'.'+_0x3a2ec8[_0x55d245(0x1cf)])),_0x3a2ec8[_0x55d245(0x11a)]?_0x3a2ec8[_0x55d245(0x194)]!==undefined&&console[_0x55d245(0x150)]('\x20\x20'+a29_0x41d2e6[_0x55d245(0x186)](_0x55d245(0xd8))+'\x20'+a29_0x41d2e6[_0x55d245(0x18b)](formatRows(_0x3a2ec8['rowCount']))):console['error']('\x20\x20'+a29_0x41d2e6[_0x55d245(0xf4)]('Error:')+'\x20'+_0x3a2ec8[_0x55d245(0x12b)]);}[a29_0x40f8eb(0x149)](_0x288cca){const _0xd4c3eb=a29_0x40f8eb;if(_0x288cca[_0xd4c3eb(0x18a)]['length']===0x0)return;console[_0xd4c3eb(0x150)]('\x0a'+a29_0x41d2e6['dim'](_0xd4c3eb(0x170)));for(const _0x38e72a of _0x288cca[_0xd4c3eb(0x18a)]){const _0x2f5ea0=_0x38e72a[_0xd4c3eb(0x11a)]?a29_0x41d2e6[_0xd4c3eb(0x10e)]('✔'):a29_0x41d2e6[_0xd4c3eb(0xf4)]('✘');let _0x3d7004='';if(_0x38e72a[_0xd4c3eb(0x11a)]&&_0x38e72a[_0xd4c3eb(0x1e5)]!==undefined&&_0x38e72a['coveragePercent']!==undefined){const _0x4ec3cf=_0x38e72a[_0xd4c3eb(0x198)][_0xd4c3eb(0x114)](0x1),_0x1135b7=_0x38e72a[_0xd4c3eb(0x198)]>=0x50?a29_0x41d2e6[_0xd4c3eb(0x10e)]:_0x38e72a['coveragePercent']>=0x32?a29_0x41d2e6[_0xd4c3eb(0x1af)]:a29_0x41d2e6[_0xd4c3eb(0xf4)];_0x3d7004='\x20'+a29_0x41d2e6['dim']('Coverage:')+'\x20'+_0x1135b7(_0x4ec3cf+'%')+'\x20('+formatRows(_0x38e72a[_0xd4c3eb(0x1e5)])+_0xd4c3eb(0xde);}console['error'](_0x2f5ea0+'\x20'+a29_0x41d2e6['bold'](_0x38e72a[_0xd4c3eb(0xc9)])+_0x3d7004),console[_0xd4c3eb(0x150)]('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0x186)](_0xd4c3eb(0x17e))+'\x20'+a29_0x41d2e6[_0xd4c3eb(0x1b6)](_0x38e72a[_0xd4c3eb(0x135)]+'.'+_0x38e72a[_0xd4c3eb(0x1cf)]));const _0x3acd82=_0x38e72a[_0xd4c3eb(0x1c2)]===_0x38e72a[_0xd4c3eb(0x19d)]?a29_0x41d2e6[_0xd4c3eb(0x186)](_0xd4c3eb(0xe7))+'\x20'+_0x38e72a[_0xd4c3eb(0x1c2)]:a29_0x41d2e6['dim'](_0xd4c3eb(0x1d6))+'\x20'+_0x38e72a[_0xd4c3eb(0x1c2)]+_0xd4c3eb(0xe5)+_0x38e72a[_0xd4c3eb(0x19d)];console['error']('\x20\x20'+_0x3acd82),console[_0xd4c3eb(0x150)]('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0x186)]('Columns:')),this[_0xd4c3eb(0x173)](_0x38e72a[_0xd4c3eb(0x180)]),!_0x38e72a['schemaValid']&&console['error']('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0xf4)](_0xd4c3eb(0xfd))+'\x20'+_0x38e72a[_0xd4c3eb(0x12b)]);}}[a29_0x40f8eb(0xe8)](_0x21a423,_0x4b2fc3){const _0x29a054=a29_0x40f8eb;if(_0x21a423[_0x29a054(0x1d0)][_0x29a054(0x137)]===0x0)return;console[_0x29a054(0x150)]('\x0a'+a29_0x41d2e6[_0x29a054(0x186)]('Behaviors')+'\x20'+a29_0x41d2e6['dim']('('+_0x4b2fc3+')'));for(const _0x459e71 of _0x21a423[_0x29a054(0x1d0)]){const _0x5664c0=_0x459e71[_0x29a054(0x11a)]?a29_0x41d2e6[_0x29a054(0x10e)]('✔'):a29_0x41d2e6[_0x29a054(0xf4)]('✘');let _0x5398da='';if(_0x459e71['schemaValid']&&_0x459e71['customersWithEvents']!==undefined&&_0x459e71[_0x29a054(0x165)]!==undefined){const _0x43a2df=_0x459e71['customerPercent']?.[_0x29a054(0x114)](0x1)||'?',_0x114923=(_0x459e71[_0x29a054(0x127)]??0x0)>=0x32?a29_0x41d2e6[_0x29a054(0x10e)]:(_0x459e71[_0x29a054(0x127)]??0x0)>=0x14?a29_0x41d2e6[_0x29a054(0x1af)]:a29_0x41d2e6[_0x29a054(0xf4)];_0x5398da='\x20'+a29_0x41d2e6[_0x29a054(0x186)]('Customers:')+'\x20'+_0x114923(formatRows(_0x459e71[_0x29a054(0xfc)]))+'\x20('+_0x43a2df+'%)\x20'+a29_0x41d2e6[_0x29a054(0x186)]('Events:')+'\x20'+a29_0x41d2e6[_0x29a054(0x18b)](formatRows(_0x459e71[_0x29a054(0x165)]));}console[_0x29a054(0x150)](_0x5664c0+'\x20'+a29_0x41d2e6['bold'](_0x459e71[_0x29a054(0xc9)])+_0x5398da),console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6[_0x29a054(0x186)](_0x29a054(0x17e))+'\x20'+a29_0x41d2e6[_0x29a054(0x1b6)](_0x459e71[_0x29a054(0x135)]+'.'+_0x459e71[_0x29a054(0x1cf)]));const _0x1c4ce6=_0x459e71['joinKey']===_0x459e71[_0x29a054(0x19d)]?a29_0x41d2e6[_0x29a054(0x186)](_0x29a054(0xe7))+'\x20'+_0x459e71[_0x29a054(0x1c2)]:a29_0x41d2e6[_0x29a054(0x186)]('Join:')+'\x20'+_0x459e71[_0x29a054(0x1c2)]+_0x29a054(0xe5)+_0x459e71[_0x29a054(0x19d)];console[_0x29a054(0x150)]('\x20\x20'+_0x1c4ce6),console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x29a054(0xf9))),this[_0x29a054(0x173)](_0x459e71[_0x29a054(0x180)]),!_0x459e71[_0x29a054(0x11a)]&&console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6[_0x29a054(0xf4)](_0x29a054(0xfd))+'\x20'+_0x459e71[_0x29a054(0x12b)]);}}[a29_0x40f8eb(0x173)](_0x545e74){const _0x4fa933=a29_0x40f8eb;for(const _0x233475 of _0x545e74){_0x233475[_0x4fa933(0x190)]===_0x233475[_0x4fa933(0x1aa)]||_0x233475[_0x4fa933(0x1aa)]==='*'?console[_0x4fa933(0x150)](_0x4fa933(0x161)+_0x233475[_0x4fa933(0x190)]):console[_0x4fa933(0x150)](_0x4fa933(0x161)+_0x233475['label']+'\x20'+a29_0x41d2e6[_0x4fa933(0x186)]('('+_0x233475['column']+')'));}}[a29_0x40f8eb(0x1e0)](_0x3b4b4f){const _0x34223e=a29_0x40f8eb;console[_0x34223e(0x150)]('─'['repeat'](0x3c));if(_0x3b4b4f[_0x34223e(0x16b)][_0x34223e(0x137)]>0x0){console[_0x34223e(0x150)]('\x0a'+a29_0x41d2e6[_0x34223e(0xf4)](_0x34223e(0x12e)));for(const _0x340a24 of _0x3b4b4f[_0x34223e(0x16b)]){console[_0x34223e(0x150)]('\x20\x20'+a29_0x41d2e6[_0x34223e(0xf4)]('•')+'\x20'+_0x340a24);}}_0x3b4b4f[_0x34223e(0x16f)]&&console[_0x34223e(0x150)]('\x0a'+a29_0x41d2e6['green']('✔')+_0x34223e(0x16c));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]='segment:parent:preview';[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x1cc);async[a29_0x40f8eb(0x16d)](_0x2c2ae1){const _0x4eccba=a29_0x40f8eb,{options:_0x1911fc,args:_0x469143,tdx:_0x4cb438}=_0x2c2ae1,_0x58d2f6=_0x1911fc,_0x4aea51=_0x469143[0x0]||_0x1911fc['parentSegment'];if(!_0x4aea51)return showParentSegmentNotSetError(_0x4eccba(0x1d3)+_0x4eccba(0x1df)+_0x4eccba(0x17b)+_0x4eccba(0x136)+_0x4eccba(0x1bc)+_0x4eccba(0x1e7)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x58d2f6[_0x4eccba(0x125)]&&!_0x58d2f6[_0x4eccba(0xdd)]&&!_0x58d2f6['behavior']&&!_0x58d2f6[_0x4eccba(0x1b3)])return console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x118))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x4eccba(0x150)](_0x4eccba(0x163)),console['error'](_0x4eccba(0x1c9)),console[_0x4eccba(0x150)](_0x4eccba(0x126)),console['error'](_0x4eccba(0x1bf)),console[_0x4eccba(0x150)](_0x4eccba(0x1bb)),0x1;const _0x30c199=resolveYamlFile(_0x4aea51);if(!existsSync(_0x30c199))return showFileNotFoundError(_0x30c199,_0x4aea51),0x1;_0x58d2f6[_0x4eccba(0xd0)]&&(console[_0x4eccba(0x150)](_0x4eccba(0xef)+_0x58d2f6['site']),console[_0x4eccba(0x150)](_0x4eccba(0x14e)+_0x30c199));let _0x426dd6;try{_0x426dd6=readFileSync(_0x30c199,'utf-8');}catch(_0x3395be){const _0x1c89b1=_0x3395be instanceof Error?_0x3395be[_0x4eccba(0x121)]:String(_0x3395be);return console[_0x4eccba(0x150)](_0x4eccba(0x142)+_0x1c89b1),0x1;}let _0x6f0a6a;try{_0x6f0a6a=parseYamlString(_0x426dd6);}catch(_0x51b447){const _0x12ee5b=_0x51b447 instanceof Error?_0x51b447['message']:String(_0x51b447);return console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x139)+_0x12ee5b)),0x1;}if(_0x58d2f6[_0x4eccba(0xdd)]===!![]||_0x58d2f6[_0x4eccba(0xdd)]===''){const _0x4af48f=_0x6f0a6a[_0x4eccba(0x18a)]?.[_0x4eccba(0x102)](_0x1ea509=>_0x1ea509[_0x4eccba(0xc9)])||[];if(_0x4af48f[_0x4eccba(0x137)]===0x0)console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x116))),console[_0x4eccba(0x150)](_0x4eccba(0x10c));for(const _0x238a35 of _0x4af48f){console[_0x4eccba(0x150)]('\x20\x20'+a29_0x41d2e6[_0x4eccba(0x18b)](_0x238a35));}console[_0x4eccba(0x150)](_0x4eccba(0x129)+_0x4aea51+_0x4eccba(0x1b7)+_0x4af48f[0x0]+'\x22');}return 0x1;}if(_0x58d2f6[_0x4eccba(0x199)]===!![]||_0x58d2f6[_0x4eccba(0x199)]===''){const _0x58c80b=_0x6f0a6a[_0x4eccba(0x1d0)]?.['map'](_0x53ff49=>_0x53ff49[_0x4eccba(0xc9)])||[];if(_0x58c80b[_0x4eccba(0x137)]===0x0)console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x14d)));else{console['error'](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x1c5))),console[_0x4eccba(0x150)]('Available\x20behaviors:');for(const _0x77bd1c of _0x58c80b){console[_0x4eccba(0x150)]('\x20\x20'+a29_0x41d2e6['cyan'](_0x77bd1c));}console['error'](_0x4eccba(0x129)+_0x4aea51+'\x20--behavior\x20\x22'+_0x58c80b[0x0]+'\x22');}return 0x1;}const _0x10567b=createCommandSpinner(a29_0x41d2e6[_0x4eccba(0x186)](_0x4eccba(0x1d5)),{'verbose':_0x58d2f6[_0x4eccba(0xd0)]});_0x10567b[_0x4eccba(0x18d)]();const _0x499fe7={'onProgress':_0x3b3214=>{const _0x5414f=_0x4eccba;_0x10567b[_0x5414f(0xff)]=formatProgressMessage(_0x3b3214);}};if(_0x58d2f6['master'])_0x499fe7[_0x4eccba(0x125)]=!![];if(_0x58d2f6[_0x4eccba(0xdd)]&&typeof _0x58d2f6['attribute']===_0x4eccba(0x13e))_0x499fe7[_0x4eccba(0xdd)]=_0x58d2f6[_0x4eccba(0xdd)];if(_0x58d2f6['behavior']&&typeof _0x58d2f6['behavior']==='string')_0x499fe7[_0x4eccba(0x199)]=_0x58d2f6[_0x4eccba(0x199)];if(_0x58d2f6[_0x4eccba(0x1b3)])_0x499fe7[_0x4eccba(0x1b3)]=!![];if(_0x58d2f6[_0x4eccba(0x17f)])_0x499fe7[_0x4eccba(0x17f)]=_0x58d2f6['interval'];let _0x1d6b1d;try{_0x1d6b1d=await _0x4cb438[_0x4eccba(0x16a)]['previewParentYaml'](_0x426dd6,_0x499fe7),_0x10567b['stop']();}catch(_0x3c13f){_0x10567b['stop']();throw _0x3c13f;}return await this[_0x4eccba(0x1a6)](_0x1d6b1d,{'master':_0x58d2f6[_0x4eccba(0x125)],'attribute':typeof _0x58d2f6[_0x4eccba(0xdd)]===_0x4eccba(0x13e)?_0x58d2f6[_0x4eccba(0xdd)]:undefined,'behavior':typeof _0x58d2f6[_0x4eccba(0x199)]===_0x4eccba(0x13e)?_0x58d2f6['behavior']:undefined,'enriched':_0x58d2f6[_0x4eccba(0x1b3)]}),_0x1d6b1d['allValid']?0x0:0x1;}async[a29_0x40f8eb(0x1a6)](_0x4771d1,_0x4faf21){const _0x3ef47e=a29_0x40f8eb;console[_0x3ef47e(0x150)]('\x0a'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x3ef47e(0x172))+'\x20'+_0x4771d1['name']),console['error']('═'['repeat'](0x3c));if(_0x4faf21[_0x3ef47e(0x125)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x1e8b86=a29_0x41d2e6[_0x3ef47e(0x186)]('Master:')+'\x20'+a29_0x41d2e6['bold'](_0x4771d1[_0x3ef47e(0x125)][_0x3ef47e(0x135)]+'.'+_0x4771d1['master']['table']);await this[_0x3ef47e(0x181)](_0x1e8b86,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21[_0x3ef47e(0xdd)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x18e5ef=a29_0x41d2e6[_0x3ef47e(0x186)](_0x3ef47e(0x131))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x4faf21[_0x3ef47e(0xdd)]);await this[_0x3ef47e(0x181)](_0x18e5ef,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21[_0x3ef47e(0x199)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x4ec2f1=a29_0x41d2e6['dim'](_0x3ef47e(0x13a))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x4faf21['behavior']);await this[_0x3ef47e(0x181)](_0x4ec2f1,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21['enriched']&&_0x4771d1[_0x3ef47e(0x157)]){const _0x29020d=a29_0x41d2e6[_0x3ef47e(0x186)](_0x3ef47e(0x1d7))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x3ef47e(0x158));await this[_0x3ef47e(0x181)](_0x29020d,_0x4771d1[_0x3ef47e(0x157)]);}else!_0x4771d1['sampleData']&&console[_0x3ef47e(0x150)](_0x3ef47e(0xee));}}}if(_0x4771d1[_0x3ef47e(0x16b)][_0x3ef47e(0x137)]>0x0){console['error']('─'[_0x3ef47e(0x1cb)](0x3c)),console[_0x3ef47e(0x150)]('\x0a'+a29_0x41d2e6[_0x3ef47e(0xf4)](_0x3ef47e(0x12e)));for(const _0x1a6cef of _0x4771d1[_0x3ef47e(0x16b)]){console[_0x3ef47e(0x150)]('\x20\x20'+a29_0x41d2e6[_0x3ef47e(0xf4)]('•')+'\x20'+_0x1a6cef);}}}async[a29_0x40f8eb(0x181)](_0x2aae97,_0x1dc80f){const _0x36f6f9=a29_0x40f8eb;if(_0x1dc80f['length']===0x0){console[_0x36f6f9(0x150)]('\x0a'+_0x2aae97),console['error'](_0x36f6f9(0x178));return;}console[_0x36f6f9(0x150)]('\x0a'+_0x2aae97);const _0x44d5dd=Object[_0x36f6f9(0x1d9)](_0x1dc80f[0x0])['map'](_0xa10959=>({'name':_0xa10959,'type':typeof _0x1dc80f[0x0][_0xa10959]===_0x36f6f9(0x128)?_0x36f6f9(0x15a):_0x36f6f9(0x15c)})),_0x116e7b={'queryId':_0x36f6f9(0x107),'columns':_0x44d5dd,'data':_0x1dc80f,'stats':{'state':_0x36f6f9(0xd3),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1dc80f[_0x36f6f9(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x41ac44=formatAsTable(_0x116e7b,_0x1dc80f[_0x36f6f9(0x137)],!![]);await writeOutput(_0x41ac44,undefined,_0x36f6f9(0x1cf));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x19f);[a29_0x40f8eb(0x13f)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a29_0x40f8eb(0x16d)](_0x44c385){const _0x3e5739=a29_0x40f8eb,{options:_0x7f0e4f,args:_0x4faa3f,tdx:_0x5a68b0}=_0x44c385,_0x266fc2=_0x7f0e4f,_0x266798=_0x4faa3f[0x0]||_0x7f0e4f[_0x3e5739(0x189)];if(!_0x266798)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x3e5739(0xdf)),0x1;const _0x2e7496=resolveYamlFile(_0x266798);if(existsSync(_0x2e7496)){_0x266fc2[_0x3e5739(0xd0)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x2e7496);let _0x1d3b25;try{_0x1d3b25=readFileSync(_0x2e7496,_0x3e5739(0x153));}catch(_0x41b2d9){const _0x2d8e2f=_0x41b2d9 instanceof Error?_0x41b2d9[_0x3e5739(0x121)]:String(_0x41b2d9);return console[_0x3e5739(0x150)](_0x3e5739(0x142)+_0x2d8e2f),0x1;}const _0x2b3410=await withSpinner(_0x3e5739(0x1ca),()=>_0x5a68b0[_0x3e5739(0x16a)]['pushParentYaml'](_0x1d3b25),{'verbose':_0x266fc2[_0x3e5739(0xd0)]}),_0x280227=_0x2b3410[_0x3e5739(0x1c1)],{isNew:_0x3b27d6,name:_0x7680a7,hasChanges:_0x32e952,diffFormatted:_0x37737e}=_0x280227;if(_0x32e952){_0x3b27d6?console['error'](_0x3e5739(0x12c)+_0x7680a7+'\x27:'):console[_0x3e5739(0x150)](_0x3e5739(0x15e)+_0x7680a7+'\x27:');console['error']('─'[_0x3e5739(0x1cb)](0x3c)),console[_0x3e5739(0x150)](_0x37737e),console['error']('─'['repeat'](0x3c));const _0x4e44d2=_0x3b27d6?_0x3e5739(0xd7)+_0x7680a7+_0x3e5739(0xeb):'Apply\x20changes\x20to\x20\x27'+_0x7680a7+'\x27\x20and\x20run\x20workflow?';if(!_0x266fc2[_0x3e5739(0x176)]){const _0x4d8a75=await confirmKey(_0x4e44d2);if(!_0x4d8a75)return console[_0x3e5739(0x150)](_0x3e5739(0x151)),0x1;}const _0x41605f=_0x3b27d6?_0x3e5739(0x13d):_0x3e5739(0x123);await withSpinner(_0x41605f+'\x20parent\x20segment\x20\x27'+_0x7680a7+_0x3e5739(0xd6),()=>_0x280227[_0x3e5739(0x1bd)](),{'verbose':_0x266fc2[_0x3e5739(0xd0)]});const _0xba39f6=_0x3b27d6?_0x3e5739(0x160):_0x3e5739(0x1a4);console[_0x3e5739(0x150)]('✔\x20'+_0xba39f6+_0x3e5739(0x168)+_0x7680a7+'\x27');}else console[_0x3e5739(0x150)](_0x3e5739(0x1ea)+_0x7680a7+'\x27\x20is\x20up\x20to\x20date');}const _0x15f8f0=await withSpinner(_0x3e5739(0xfa)+_0x266798+'\x27...',()=>_0x5a68b0['segment']['runParent'](_0x266798),{'verbose':_0x266fc2['verbose']}),_0x5b572e=_0x15f8f0['data'],_0x403570=getConsoleUrl(_0x266fc2[_0x3e5739(0x1d8)],_0x3e5739(0x1c6)+_0x5b572e[_0x3e5739(0x1c0)]+'/sessions/'+_0x5b572e[_0x3e5739(0x1d4)]+_0x3e5739(0x13c)+_0x5b572e[_0x3e5739(0xe3)]);return console[_0x3e5739(0x150)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x12f))+'\x20'+_0x5b572e['audienceId']),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x3e5739(0xc8))+'\x20'+_0x5b572e[_0x3e5739(0x1ad)]),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x1a0))+'\x20'+_0x5b572e[_0x3e5739(0x1d4)]),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x3e5739(0xd9))+'\x20'+_0x5b572e['workflowAttemptId']),console[_0x3e5739(0x150)]('\x20\x20'+_0x403570),console['error']('\x0a'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x18e))+_0x3e5739(0x144)+_0x5b572e[_0x3e5739(0xe3)]+_0x3e5739(0x101)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x15f);async['execute'](_0x4f55db){const _0x48b4ff=a29_0x40f8eb,{options:_0x358f51,args:_0x458ea4,tdx:_0x54c37e}=_0x4f55db,_0xd2d729=_0x458ea4[0x0]||_0x358f51[_0x48b4ff(0x189)];if(!_0xd2d729)return showParentSegmentNotSetError(_0x48b4ff(0xe6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x358f51[_0x48b4ff(0xd0)]&&(console[_0x48b4ff(0x150)](_0x48b4ff(0xef)+_0x358f51['site']),console[_0x48b4ff(0x150)](_0x48b4ff(0x1e9)+_0xd2d729));const _0xd5f563=await withSpinner(_0x48b4ff(0x1a5)+_0xd2d729+_0x48b4ff(0xd6),()=>_0x54c37e['segment']['listFields'](_0xd2d729),{'verbose':_0x358f51['verbose']}),_0x29a818=_0xd5f563[_0x48b4ff(0x1c1)];console[_0x48b4ff(0x150)](_0x48b4ff(0x1e3)+_0x29a818[_0x48b4ff(0x137)]+_0x48b4ff(0x148)+(_0x29a818[_0x48b4ff(0x137)]!==0x1?'s':''));if(_0x358f51[_0x48b4ff(0x124)]||_0x358f51[_0x48b4ff(0x11d)])return await handleSDKOutput(_0x29a818,_0x358f51),0x0;return displayFieldsHumanReadable(_0x29a818,_0xd2d729),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1b5);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x1b2);async[a29_0x40f8eb(0x16d)](_0x100e1a){const _0x2f0d0f=a29_0x40f8eb,{options:_0x590afe,args:_0xf1830a,tdx:_0x10f113}=_0x100e1a,_0x43376e=_0x590afe,_0x471c00=_0xf1830a[0x0]||_0x590afe['parentSegment'];if(!_0x471c00)return showParentSegmentNotSetError(_0x2f0d0f(0x174)+_0x2f0d0f(0x188)+_0x2f0d0f(0x156)+_0x2f0d0f(0xed)),0x1;_0x590afe[_0x2f0d0f(0xd0)]&&(console[_0x2f0d0f(0x150)](_0x2f0d0f(0xef)+_0x590afe[_0x2f0d0f(0x1d8)]),console[_0x2f0d0f(0x150)]('Parent\x20segment:\x20'+_0x471c00));const _0xb0d279=await withSpinner(_0x2f0d0f(0xfe)+_0x471c00+_0x2f0d0f(0xd6),()=>_0x10f113['segment']['getParentFull'](_0x471c00),{'verbose':_0x590afe['verbose']}),_0x2f27a7=_0xb0d279[_0x2f0d0f(0x1c1)];if(_0x43376e[_0x2f0d0f(0xd1)]){const _0x18f041=getConsoleNextUrl(_0x43376e[_0x2f0d0f(0x1d8)],_0x2f0d0f(0x185)+_0x2f27a7['id']);return console[_0x2f0d0f(0x150)](a29_0x41d2e6['green']('✔')+_0x2f0d0f(0x1a9)+a29_0x41d2e6[_0x2f0d0f(0x18b)](_0x18f041)),openBrowser(_0x18f041),0x0;}return await handleSingleObjectOutput(_0x2f27a7,_0x590afe),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1e2);[a29_0x40f8eb(0x13f)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a29_0x40f8eb(0x16d)](_0x5f1941){const _0x1fd189=a29_0x40f8eb,{options:_0xe61666,args:_0x14bde8,tdx:_0x11f654}=_0x5f1941,_0x514f42=_0x14bde8[0x0]||_0xe61666[_0x1fd189(0x189)];if(!_0x514f42)return showParentSegmentNotSetError(_0x1fd189(0x11b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0xe61666[_0x1fd189(0xd0)]&&(console[_0x1fd189(0x150)](_0x1fd189(0xef)+_0xe61666['site']),console[_0x1fd189(0x150)](_0x1fd189(0x1e9)+_0x514f42));const _0x70b853=await withSpinner(_0x1fd189(0x1c4)+_0x514f42+_0x1fd189(0xd6),()=>_0x11f654['segment'][_0x1fd189(0x143)](_0x514f42),{'verbose':_0xe61666[_0x1fd189(0xd0)]}),_0x1d6e9a=_0x70b853[_0x1fd189(0x1c1)],_0x15b9e4=await withSpinner(_0x1fd189(0x175)+_0x514f42+_0x1fd189(0xd6),()=>_0x11f654['segment']['getParentSQL'](_0x1d6e9a),{'verbose':_0xe61666[_0x1fd189(0xd0)]}),_0x1dde82=await executeSchemaQuery(_0x15b9e4[_0x1fd189(0x1c1)],_0x11f654,_0xe61666);return await handleQueryOutput(_0x1dde82,_0xe61666),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a29_0x40f8eb(0x152);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x147);async[a29_0x40f8eb(0x16d)](_0x3b0a65){const _0x3ca9b6=a29_0x40f8eb,{options:_0x339dda,args:_0x26f6e8,tdx:_0x4132a1}=_0x3b0a65,_0x2d7557=_0x26f6e8[0x0]||_0x339dda[_0x3ca9b6(0x189)];if(!_0x2d7557)return showParentSegmentNotSetError(_0x3ca9b6(0xcb)+_0x3ca9b6(0x184)),0x1;_0x339dda[_0x3ca9b6(0xd0)]&&(console[_0x3ca9b6(0x150)](_0x3ca9b6(0xef)+_0x339dda[_0x3ca9b6(0x1d8)]),console[_0x3ca9b6(0x150)](_0x3ca9b6(0x1e9)+_0x2d7557));const _0x3f454b=await withSpinner(_0x3ca9b6(0x1c4)+_0x2d7557+'\x27...',()=>_0x4132a1[_0x3ca9b6(0x16a)]['resolveParentId'](_0x2d7557),{'verbose':_0x339dda[_0x3ca9b6(0xd0)]}),_0x6554de=_0x3f454b[_0x3ca9b6(0x1c1)],_0x4176c3=await withSpinner(_0x3ca9b6(0x175)+_0x2d7557+_0x3ca9b6(0xd6),()=>_0x4132a1[_0x3ca9b6(0x16a)]['getParentSQL'](_0x6554de),{'verbose':_0x339dda[_0x3ca9b6(0xd0)]}),_0x8b436f=_0x4176c3[_0x3ca9b6(0x1c1)];return _0x339dda[_0x3ca9b6(0x179)]===_0x3ca9b6(0x124)||_0x339dda[_0x3ca9b6(0x179)]===_0x3ca9b6(0x11d)?await handleSDKOutput([{'sql':_0x8b436f}],_0x339dda):console[_0x3ca9b6(0x132)](_0x8b436f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a29_0x40f8eb(0x1be);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x10d);async[a29_0x40f8eb(0x16d)](_0x214782){const _0xa18f52=a29_0x40f8eb,{options:_0x37390d,args:_0x1166ad,tdx:_0x20c0a6}=_0x214782,_0x2354b8=_0x1166ad[0x0]||_0x37390d[_0xa18f52(0x189)];if(!_0x2354b8)return showParentSegmentNotSetError(_0xa18f52(0x192)+_0xa18f52(0x14a)),0x1;_0x37390d[_0xa18f52(0xd0)]&&(console[_0xa18f52(0x150)]('Site:\x20'+_0x37390d[_0xa18f52(0x1d8)]),console[_0xa18f52(0x150)](_0xa18f52(0x1e9)+_0x2354b8));const _0x484071=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2354b8+_0xa18f52(0xd6),()=>_0x20c0a6[_0xa18f52(0x16a)][_0xa18f52(0x143)](_0x2354b8),{'verbose':_0x37390d[_0xa18f52(0xd0)]}),_0x27513f=_0x484071['data'],_0x3ac2f3=await withSpinner(_0xa18f52(0x175)+_0x2354b8+'\x27...',()=>_0x20c0a6[_0xa18f52(0x16a)][_0xa18f52(0x193)](_0x27513f),{'verbose':_0x37390d['verbose']});let _0x3d2955=_0x3ac2f3[_0xa18f52(0x1c1)];const _0x42d53c=resolveLimit(_0x37390d['limit'],DEFAULT_DISPLAY_LIMIT),_0x399803=/\bLIMIT\s+\d+/i['test'](_0x3d2955);!_0x399803&&(_0x3d2955=_0x3d2955[_0xa18f52(0x155)]()['replace'](/;+$/,''),_0x3d2955=_0xa18f52(0x10b)+_0x3d2955+_0xa18f52(0x10f)+_0x42d53c);_0x37390d['verbose']&&console[_0xa18f52(0x150)]('SQL\x20query:\x0a'+_0x3d2955);const _0x449475=await withQuerySpinner(_0xa18f52(0x103),async _0x3a7346=>{const _0xcac343=_0xa18f52,_0x44539f=await _0x20c0a6['query'][_0xcac343(0x16d)](_0x3d2955,{'catalog':'td','schema':_0xcac343(0xd4),'onJobId':_0x5c6e18=>{const _0x546c56=_0xcac343;_0x3a7346[_0x546c56(0xf2)](_0x5c6e18);}});return _0x44539f;},{'verbose':_0x37390d['verbose']}),_0x48d9cd=_0x449475[_0xa18f52(0x1c1)],_0x28d752=_0x48d9cd['jobId']?_0xa18f52(0x17d)+_0x48d9cd[_0xa18f52(0xca)]+']':'';return console[_0xa18f52(0x150)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x48d9cd['stats']['processedRows'][_0xa18f52(0xe0)]()+_0xa18f52(0x171)+(_0xa18f52(0x112)+formatElapsed(_0x48d9cd['stats'][_0xa18f52(0x108)])+_0x28d752)),await handleQueryOutput(_0x48d9cd,_0x37390d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x11d6eb=a30_0x2519;function a30_0x2519(_0x42473f,_0x4a1943){_0x42473f=_0x42473f-0x175;const _0x24cd29=a30_0x24cd();let _0x251973=_0x24cd29[_0x42473f];return _0x251973;}(function(_0x4a1bc3,_0x49a1b9){const _0x4bbc78=a30_0x2519,_0x14ae66=_0x4a1bc3();while(!![]){try{const _0x1b2b4f=parseInt(_0x4bbc78(0x180))/0x1*(parseInt(_0x4bbc78(0x18a))/0x2)+parseInt(_0x4bbc78(0x183))/0x3*(-parseInt(_0x4bbc78(0x17c))/0x4)+parseInt(_0x4bbc78(0x182))/0x5+-parseInt(_0x4bbc78(0x18c))/0x6*(parseInt(_0x4bbc78(0x176))/0x7)+parseInt(_0x4bbc78(0x18d))/0x8*(-parseInt(_0x4bbc78(0x17e))/0x9)+-parseInt(_0x4bbc78(0x175))/0xa+parseInt(_0x4bbc78(0x188))/0xb*(parseInt(_0x4bbc78(0x184))/0xc);if(_0x1b2b4f===_0x49a1b9)break;else _0x14ae66['push'](_0x14ae66['shift']());}catch(_0x530ac0){_0x14ae66['push'](_0x14ae66['shift']());}}}(a30_0x24cd,0xe7262));function a30_0x24cd(){const _0x37ed10=['3UunkLQ','15901296MSeOsU','execute','log','List\x20all\x20available\x20profiles','22dkRMjW','error','58IynkEP','length','12UCXJth','941776kbpmno','8950140JCsgrS','2734074BejBmQ','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','message','\x20\x20Global:\x20~/.config/tdx/tdx.json','6039084FFoixl','config','27IyMUCK','name','8927VIcilc','Error:\x20','7884010RLHseC'];a30_0x24cd=function(){return _0x37ed10;};return a30_0x24cd();}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0x11d6eb(0x17f)]=a30_0x11d6eb(0x177);['description']=a30_0x11d6eb(0x187);async[a30_0x11d6eb(0x185)](_0x422c61){const _0x4ea1c8=a30_0x11d6eb,{options:_0x1e0332}=_0x422c61;try{const _0x5db41e=listProfiles(),_0x12aaba=getActiveProfile();if(_0x5db41e[_0x4ea1c8(0x18b)]===0x0)return console[_0x4ea1c8(0x186)](_0x4ea1c8(0x178)),console[_0x4ea1c8(0x186)](_0x4ea1c8(0x179)),console[_0x4ea1c8(0x186)](_0x4ea1c8(0x17b)),0x0;const _0x3c9510=_0x5db41e['map'](_0x155a62=>{const _0x4e8b3f=_0x4ea1c8,_0x2b9744=_0x155a62[_0x4e8b3f(0x17f)]===_0x12aaba,_0x195fc3=getProfileParams(_0x155a62[_0x4e8b3f(0x17d)]);return{'name':_0x155a62[_0x4e8b3f(0x17f)],'active':_0x2b9744,'scope':_0x155a62['scope'],'description':_0x155a62[_0x4e8b3f(0x17d)]['description']||'','params':_0x195fc3};});return await handleSDKOutput(_0x3c9510,_0x1e0332),0x0;}catch(_0x10c979){return _0x10c979 instanceof Error&&console[_0x4ea1c8(0x189)](_0x4ea1c8(0x181)+_0x10c979[_0x4ea1c8(0x17a)]),0x1;}}}
|