@treasuredata/tdx 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +73 -3
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.d.ts +1 -1
- package/dist/core/command-output.d.ts.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +32 -4
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.d.ts +10 -6
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/index.d.ts +74 -4
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x3cae84=a20_0x1c35;(function(_0x420f3a,_0x58977a){const _0x313877=a20_0x1c35,_0x2d1434=_0x420f3a();while(!![]){try{const _0x4305d4=parseInt(_0x313877(0x1e6))/0x1*(parseInt(_0x313877(0x147))/0x2)+parseInt(_0x313877(0x1b9))/0x3*(-parseInt(_0x313877(0x157))/0x4)+-parseInt(_0x313877(0x173))/0x5*(parseInt(_0x313877(0x16a))/0x6)+parseInt(_0x313877(0x16b))/0x7*(parseInt(_0x313877(0x1c6))/0x8)+-parseInt(_0x313877(0x1a2))/0x9*(parseInt(_0x313877(0x16c))/0xa)+-parseInt(_0x313877(0x17e))/0xb*(-parseInt(_0x313877(0x15c))/0xc)+-parseInt(_0x313877(0x1b1))/0xd*(-parseInt(_0x313877(0x180))/0xe);if(_0x4305d4===_0x58977a)break;else _0x2d1434['push'](_0x2d1434['shift']());}catch(_0x536930){_0x2d1434['push'](_0x2d1434['shift']());}}}(a20_0x2c78,0xb09a0));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import*as a20_0x52a7cc from'node:fs';function handleSDKError(_0x10f62f,_0x23e3d7){const _0x396c85=a20_0x1c35;if(_0x10f62f instanceof SDKError)console[_0x396c85(0x168)](_0x396c85(0x137)+_0x10f62f[_0x396c85(0x184)]),_0x23e3d7['verbose']&&(_0x10f62f['cause']&&console['error'](_0x396c85(0x189)+_0x10f62f[_0x396c85(0x1ec)]),_0x10f62f[_0x396c85(0x163)]&&(console[_0x396c85(0x168)](_0x396c85(0x188)),console[_0x396c85(0x168)](_0x10f62f[_0x396c85(0x163)])));else throw _0x10f62f;}function formatChatHistoryEntry(_0x4c69dc,_0x278e3d){const _0x32380d=a20_0x1c35,_0x245d0c=getChalk(_0x278e3d),_0x1937b1=_0x245d0c['dim'](_0x4c69dc['at']);if(_0x32380d(0x11b)in _0x4c69dc){const _0x4c9aa1=_0x245d0c[_0x32380d(0x15f)](_0x32380d(0x127));return _0x1937b1+'\x20'+_0x4c9aa1+':\x20'+_0x4c69dc[_0x32380d(0x11b)];}if(_0x32380d(0x154)in _0x4c69dc){const _0x3459a1=_0x245d0c[_0x32380d(0x12d)](_0x32380d(0x164));return _0x1937b1+'\x20'+_0x3459a1+':\x20'+_0x4c69dc[_0x32380d(0x154)];}if(_0x32380d(0x122)in _0x4c69dc){const _0x533009=_0x245d0c['yellow']('[tool_call]'),{functionName:_0x64c343,functionArguments:_0xc1d0e1,targetFunction:_0x3c8c6c}=_0x4c69dc[_0x32380d(0x122)];let _0x39bdd5=_0x1937b1+'\x20'+_0x533009+':\x20'+_0x245d0c[_0x32380d(0x1a6)](_0x64c343);if(_0xc1d0e1&&Object[_0x32380d(0x1da)](_0xc1d0e1)[_0x32380d(0x143)]>0x0){const _0x4542d2=Object[_0x32380d(0x1a3)](_0xc1d0e1)[_0x32380d(0x178)](([_0x3bfca1,_0x224574])=>_0x3bfca1+'='+JSON[_0x32380d(0x1e5)](_0x224574))['join'](',\x20');_0x39bdd5+='('+_0x4542d2+')';}_0x3c8c6c&&(_0x39bdd5+=_0x245d0c[_0x32380d(0x1ac)]('\x20['+_0x3c8c6c+']'));let _0xf250a6='';if(_0x4c69dc[_0x32380d(0x122)][_0x32380d(0x1b7)])_0xf250a6=_0x32380d(0x193)+_0x4c69dc[_0x32380d(0x122)][_0x32380d(0x1b7)]['name'];else{if(_0x4c69dc['tool_call'][_0x32380d(0x1be)])_0xf250a6='\x20->\x20Agent:'+_0x4c69dc[_0x32380d(0x122)]['targetAgent'][_0x32380d(0x1cb)];else{if(_0x4c69dc[_0x32380d(0x122)][_0x32380d(0x12c)])_0xf250a6=_0x32380d(0x1aa)+_0x4c69dc['tool_call'][_0x32380d(0x12c)][_0x32380d(0x1cb)];else _0x4c69dc[_0x32380d(0x122)]['targetImageGenerator']&&(_0xf250a6='\x20->\x20ImageGen:'+_0x4c69dc['tool_call'][_0x32380d(0x1af)][_0x32380d(0x1cb)]);}}return _0x39bdd5+_0xf250a6;}if(_0x32380d(0x1a1)in _0x4c69dc){const _0x58f5b1=_0x245d0c[_0x32380d(0x179)]('[tool]\x20\x20\x20'),{functionName:_0xb60b93,functionArguments:_0x57190a,content:_0x178110,newChat:_0x21d770}=_0x4c69dc[_0x32380d(0x1a1)];let _0x455b9f=_0x1937b1+'\x20'+_0x58f5b1+':\x20'+_0x245d0c[_0x32380d(0x1a6)](_0xb60b93);if(_0x57190a){const _0x59da1f=typeof _0x57190a===_0x32380d(0x1c1)?_0x57190a:JSON[_0x32380d(0x1e5)](_0x57190a);_0x455b9f+='('+_0x59da1f+')';}return _0x178110&&(_0x455b9f+='\x0a'+_0x245d0c[_0x32380d(0x1ac)](_0x178110)),_0x21d770&&(_0x455b9f+=_0x245d0c[_0x32380d(0x1ac)](_0x32380d(0x151)+_0x21d770['id'])),_0x455b9f;}if(_0x32380d(0x118)in _0x4c69dc){const _0x2e8d64=_0x245d0c[_0x32380d(0x14c)](_0x32380d(0x1a4));return _0x1937b1+'\x20'+_0x2e8d64+':\x20'+_0x4c69dc[_0x32380d(0x118)]['name']+'\x20('+_0x4c69dc[_0x32380d(0x118)][_0x32380d(0x154)][_0x32380d(0x143)]+'\x20bytes)';}if('image'in _0x4c69dc){const _0x446daf=_0x245d0c[_0x32380d(0x14c)](_0x32380d(0x197)),{width:_0x3c875c,height:_0x5e386b,headerText:_0x4db3b0}=_0x4c69dc['image'],_0x46fce0=_0x4db3b0?_0x32380d(0x1a5)+_0x4db3b0:'';return _0x1937b1+'\x20'+_0x446daf+':\x20'+_0x3c875c+'x'+_0x5e386b+_0x46fce0;}if('error'in _0x4c69dc){const _0x51ba26=_0x245d0c['red']('[error]\x20\x20');return _0x1937b1+'\x20'+_0x51ba26+':\x20'+_0x4c69dc[_0x32380d(0x168)];}return _0x1937b1+'\x20'+_0x245d0c[_0x32380d(0x1ac)]('[unknown]')+':\x20'+JSON[_0x32380d(0x1e5)](_0x4c69dc);}async function executeChatHistoryCommand(_0x2ea0db,_0x609625){const _0x204b77=a20_0x1c35,{options:_0xf1ac91,args:_0x39aa6f,tdx:_0x310ec9}=_0x2ea0db,_0x304601=_0x39aa6f[0x0],_0x1b3835=_0xf1ac91,_0x6e0bdf=_0x1b3835['last'];try{if(_0x6e0bdf&&_0x304601)return console['error'](_0x204b77(0x115)),console[_0x204b77(0x168)]('Usage:\x20'+_0x609625+'\x20--last'),0x1;if(!_0x304601&&!_0x6e0bdf&&_0xf1ac91[_0x204b77(0x1e2)]!==undefined){const _0x631466=resolveLimit(_0xf1ac91[_0x204b77(0x1cc)],DEFAULT_LLM_LIMIT),_0xe93198=await withSpinner(_0x204b77(0x125),()=>_0x310ec9['llm'][_0x204b77(0x13f)](_0x631466),{'verbose':_0xf1ac91[_0x204b77(0x1d7)]});return await handleSDKOutput(_0xe93198[_0x204b77(0x14e)],_0xf1ac91),0x0;}const _0x4ba109=await getChatIdOrSelect(_0x310ec9,_0xf1ac91,_0x6e0bdf,_0x304601);if(!_0x4ba109)return 0x0;return await displayChatHistory(_0x4ba109,_0x310ec9,_0xf1ac91),0x0;}catch(_0x3f9bd2){return handleSDKError(_0x3f9bd2,_0xf1ac91),0x1;}}async function displayChatHistory(_0x4aeb78,_0x6bf4f1,_0x33b46d){const _0x459727=a20_0x1c35,_0x370275=await withSpinner(_0x459727(0x1df)+_0x4aeb78+_0x459727(0x13b),()=>_0x6bf4f1[_0x459727(0x11c)]['history'](_0x4aeb78),{'verbose':_0x33b46d[_0x459727(0x1d7)]}),_0x2b22bf=_0x370275[_0x459727(0x14e)][_0x459727(0x14e)]??[];if(_0x2b22bf['length']===0x0){console[_0x459727(0x129)](_0x459727(0x19b));return;}if(_0x33b46d[_0x459727(0x1e2)]!==undefined)await handleSDKOutput(_0x2b22bf,_0x33b46d);else{const _0x20642d=_0x2b22bf[_0x459727(0x178)](_0x2b52a6=>formatChatHistoryEntry(_0x2b52a6,_0x33b46d)),_0x20b9e2=_0x20642d[_0x459727(0x17d)]('\x0a');await writeOutput(_0x20b9e2,_0x33b46d[_0x459727(0x118)],_0x459727(0x14a));}}async function getChatIdOrSelect(_0x2acce2,_0x1c909d,_0x4afb41,_0x4832e5){const _0x352f0d=a20_0x1c35;if(_0x4832e5)return _0x4832e5;if(_0x4afb41){const _0x51f2ca=await withSpinner(_0x352f0d(0x158),()=>_0x2acce2[_0x352f0d(0x11c)]['chats'](0x1),{'verbose':_0x1c909d['verbose']});if(_0x51f2ca[_0x352f0d(0x14e)][_0x352f0d(0x143)]===0x0)return console[_0x352f0d(0x129)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x51f2ca[_0x352f0d(0x14e)][0x0]['id'];}const _0x322def=await selectChatInteractively(_0x2acce2,_0x1c909d);if(!_0x322def)return console[_0x352f0d(0x129)](_0x352f0d(0x135)),undefined;return _0x322def;}async function getProjectIdOrDefault(_0x442547){const _0x1d4a54=await getProjectWithName(_0x442547);return _0x1d4a54['id'];}async function getProjectWithName(_0x3b43bb){const _0x4c5a7d=a20_0x1c35,{tdx:_0x2d39fe,options:_0x47479}=_0x3b43bb,_0x328ce5=_0x47479['llmProject'];if(_0x328ce5){const _0x1813fe=await withSpinner(_0x4c5a7d(0x130)+_0x328ce5+'\x27...',()=>_0x2d39fe[_0x4c5a7d(0x11c)][_0x4c5a7d(0x191)](_0x328ce5),{'verbose':_0x47479[_0x4c5a7d(0x1d7)]});return{'id':_0x1813fe[_0x4c5a7d(0x14e)],'name':_0x328ce5};}const _0x5d9deb=_0x2d39fe[_0x4c5a7d(0x11c)][_0x4c5a7d(0x1c9)]();if(_0x5d9deb){const _0x11aa40=await _0x2d39fe['llm'][_0x4c5a7d(0x146)](),_0x3ee68d=_0x11aa40[_0x4c5a7d(0x136)](_0xc42cac=>_0xc42cac['id']===_0x5d9deb);return{'id':_0x5d9deb,'name':_0x3ee68d?.[_0x4c5a7d(0x1bd)][_0x4c5a7d(0x1cb)]||'Unknown'};}const _0x3e3f39=await withSpinner('Getting\x20default\x20project...',()=>_0x2d39fe['llm'][_0x4c5a7d(0x1c0)](),{'verbose':_0x47479[_0x4c5a7d(0x1d7)]});return{'id':_0x3e3f39[_0x4c5a7d(0x14e)]['id'],'name':_0x3e3f39[_0x4c5a7d(0x14e)][_0x4c5a7d(0x1bd)][_0x4c5a7d(0x1cb)]};}function toLLMProjectInfo(_0x1f15fd){const _0x4cfa96=a20_0x1c35;return{'name':_0x1f15fd[_0x4cfa96(0x1bd)][_0x4cfa96(0x1cb)],'description':_0x1f15fd[_0x4cfa96(0x1bd)][_0x4cfa96(0x172)],'createdAt':_0x1f15fd[_0x4cfa96(0x1bd)][_0x4cfa96(0x14b)],'updatedAt':_0x1f15fd[_0x4cfa96(0x1bd)][_0x4cfa96(0x1ee)]};}function toAgentInfo(_0x57fdc1){const _0x227e6d=a20_0x1c35;return{'name':_0x57fdc1[_0x227e6d(0x1bd)][_0x227e6d(0x1cb)],'description':_0x57fdc1['attributes']['description'],'prompt':truncatePrompt(_0x57fdc1[_0x227e6d(0x1bd)][_0x227e6d(0x19a)]),'createdAt':_0x57fdc1['attributes'][_0x227e6d(0x14b)],'updatedAt':_0x57fdc1[_0x227e6d(0x1bd)][_0x227e6d(0x1ee)]};}function truncatePrompt(_0x12194a){const _0x136d5e=a20_0x1c35;if(!_0x12194a)return undefined;const _0x55a0c9=0x64;if(_0x12194a[_0x136d5e(0x143)]<=_0x55a0c9)return _0x12194a;return _0x12194a[_0x136d5e(0x1d5)](0x0,_0x55a0c9)+'...';}export class LLMModelsCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x1c2);['description']='List\x20available\x20LLM\x20models';async[a20_0x3cae84(0x152)](_0x317515){const _0x148dc6=a20_0x3cae84,{options:_0x3d13e1,tdx:_0x49b676}=_0x317515;try{const _0x4d5bdc=await withSpinner('Fetching\x20available\x20models...',()=>_0x49b676[_0x148dc6(0x11c)][_0x148dc6(0x149)](),{'verbose':_0x3d13e1['verbose']});return await handleSDKOutput(_0x4d5bdc[_0x148dc6(0x14e)],_0x3d13e1),0x0;}catch(_0x626b9b){return handleSDKError(_0x626b9b,_0x3d13e1),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x1a8);[a20_0x3cae84(0x172)]='List\x20all\x20LLM\x20projects';async[a20_0x3cae84(0x152)](_0x1b1249){const _0x38ce89=a20_0x3cae84,{options:_0x238851,args:_0xb58bdc,tdx:_0x25ac7e}=_0x1b1249,_0x56edad=getChalk(_0x238851),_0x55823e=_0x238851[_0x38ce89(0x19d)],_0x5efbc1=_0x238851[_0x38ce89(0x1c5)];try{const _0x14515c=_0xb58bdc[0x0],_0x14ee81=resolveLimit(_0x238851[_0x38ce89(0x1cc)],DEFAULT_LLM_LIMIT),_0xedc12d=await withSpinner('Fetching\x20projects...',()=>_0x25ac7e['llm'][_0x38ce89(0x146)](_0x14ee81),{'verbose':_0x238851[_0x38ce89(0x1d7)]});let _0xe1ec3=_0xedc12d[_0x38ce89(0x14e)];_0x14515c&&(_0xe1ec3=_0xedc12d[_0x38ce89(0x14e)][_0x38ce89(0x1ce)](_0x340ded=>matchGlobPattern(_0x340ded[_0x38ce89(0x1bd)]['name'],_0x14515c)));const _0x3f76de=_0x238851[_0x38ce89(0x1e2)]===_0x38ce89(0x126)||_0x238851[_0x38ce89(0x1e2)]===_0x38ce89(0x1d8)||_0x238851[_0x38ce89(0x1e2)]===_0x38ce89(0x14a)||_0x238851[_0x38ce89(0x1e2)]===_0x38ce89(0x177);if(_0x3f76de){const _0x4c5419=_0xe1ec3['map'](_0x467edb=>({...toLLMProjectInfo(_0x467edb),..._0x55823e?{'url':getLLMProjectUrl(_0x5efbc1,_0x467edb['id'])}:{}}));await handleSDKOutput(_0x4c5419,_0x238851);}else{const _0x51e76a=[];if(_0xe1ec3[_0x38ce89(0x143)]===0x0)_0x51e76a['push'](_0x56edad[_0x38ce89(0x1ac)](_0x38ce89(0x181)));else{const _0x3c5b64=[..._0xe1ec3]['sort']((_0x16a0a7,_0x3f350d)=>_0x16a0a7[_0x38ce89(0x1bd)][_0x38ce89(0x1cb)]['localeCompare'](_0x3f350d[_0x38ce89(0x1bd)][_0x38ce89(0x1cb)]));for(const _0xed9f4d of _0x3c5b64){if(_0x55823e){const _0x5918f7=getLLMProjectUrl(_0x5efbc1,_0xed9f4d['id']);_0x51e76a['push'](_0x38ce89(0x142)+_0xed9f4d[_0x38ce89(0x1bd)][_0x38ce89(0x1cb)]+'\x20\x20'+_0x56edad[_0x38ce89(0x1ac)](_0x5918f7));}else _0x51e76a[_0x38ce89(0x124)](_0x38ce89(0x142)+_0xed9f4d[_0x38ce89(0x1bd)]['name']);}_0x51e76a[_0x38ce89(0x124)](_0x56edad[_0x38ce89(0x1ac)](_0xe1ec3[_0x38ce89(0x143)]+_0x38ce89(0x1ba)));}await writeOutput(_0x51e76a[_0x38ce89(0x17d)]('\x0a'),_0x238851['output'],_0x38ce89(0x14a));}return 0x0;}catch(_0x230617){return handleSDKError(_0x230617,_0x238851),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a20_0x3cae84(0x148);[a20_0x3cae84(0x172)]='List\x20agents\x20in\x20current\x20project';async[a20_0x3cae84(0x152)](_0x3c6139){const _0x584c19=a20_0x3cae84,{options:_0x22d800,args:_0x209c12,tdx:_0x3893ad}=_0x3c6139,_0x399d2f=getChalk(_0x22d800),_0x5b908d=_0x22d800['web'],_0x325769=_0x22d800['site'];try{const _0x1222de=_0x209c12[0x0];let _0x1689bd=_0x1222de,_0x3e4868,_0x39fbc4;if(_0x1222de&&_0x1222de['includes']('/')){const _0x461128=_0x1222de[_0x584c19(0x159)]('/');if(_0x461128[_0x584c19(0x143)]===0x2){const [_0x2022ea,_0x20d539]=_0x461128,_0x4ccba9=await _0x3893ad[_0x584c19(0x11c)][_0x584c19(0x146)](),_0x1664d4=_0x4ccba9['find'](_0x5c5fd=>_0x5c5fd[_0x584c19(0x1bd)][_0x584c19(0x1cb)][_0x584c19(0x1e4)]()===_0x2022ea[_0x584c19(0x1e4)]());if(!_0x1664d4)throw new SDKError(ErrorCode[_0x584c19(0x199)],'Project\x20not\x20found:\x20'+_0x2022ea,undefined,{'helpText':_0x584c19(0x1bb)});_0x3e4868=_0x1664d4['id'],_0x39fbc4=_0x1664d4[_0x584c19(0x1bd)][_0x584c19(0x1cb)],_0x1689bd=_0x20d539;}else throw new SDKError(ErrorCode[_0x584c19(0x140)],_0x584c19(0x161)+_0x1222de,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x23057d=await getProjectWithName(_0x3c6139);_0x3e4868=_0x23057d['id'],_0x39fbc4=_0x23057d[_0x584c19(0x1cb)];}const _0x5eb33a=await withSpinner(_0x584c19(0x1e9),()=>_0x3893ad[_0x584c19(0x11c)][_0x584c19(0x17a)](_0x3e4868),{'verbose':_0x22d800[_0x584c19(0x1d7)]});let _0x15aebb=_0x5eb33a[_0x584c19(0x14e)];_0x1689bd&&(_0x15aebb=_0x5eb33a[_0x584c19(0x14e)][_0x584c19(0x1ce)](_0x2bcd3b=>matchGlobPattern(_0x2bcd3b[_0x584c19(0x1bd)][_0x584c19(0x1cb)],_0x1689bd)));const _0x7351b1=_0x22d800[_0x584c19(0x1e2)]===_0x584c19(0x126)||_0x22d800[_0x584c19(0x1e2)]===_0x584c19(0x1d8)||_0x22d800[_0x584c19(0x1e2)]==='table'||_0x22d800[_0x584c19(0x1e2)]===_0x584c19(0x177);if(_0x7351b1){const _0x575fd0=_0x15aebb[_0x584c19(0x178)](_0x158f4e=>({...toAgentInfo(_0x158f4e),..._0x5b908d?{'chatUrl':getLLMAgentChatUrl(_0x325769,_0x3e4868,_0x158f4e['id'])}:{}}));await handleSDKOutput(_0x575fd0,_0x22d800);}else{const _0x2daef5=[];_0x2daef5['push'](_0x399d2f[_0x584c19(0x1ac)]('['+_0x39fbc4+']'));if(_0x15aebb[_0x584c19(0x143)]===0x0)_0x2daef5[_0x584c19(0x124)](_0x399d2f[_0x584c19(0x1ac)](_0x584c19(0x1eb)));else{const _0xb1d090=[..._0x15aebb][_0x584c19(0x119)]((_0x2186be,_0x1f06c9)=>_0x2186be[_0x584c19(0x1bd)][_0x584c19(0x1cb)][_0x584c19(0x1b4)](_0x1f06c9[_0x584c19(0x1bd)][_0x584c19(0x1cb)]));for(const _0xc321ce of _0xb1d090){if(_0x5b908d){const _0x243900=getLLMAgentChatUrl(_0x325769,_0x3e4868,_0xc321ce['id']);_0x2daef5[_0x584c19(0x124)](_0x584c19(0x1d4)+_0xc321ce['attributes'][_0x584c19(0x1cb)]+'\x20\x20'+_0x399d2f[_0x584c19(0x1ac)](_0x243900));}else _0x2daef5['push']('🤖\x20'+_0xc321ce[_0x584c19(0x1bd)][_0x584c19(0x1cb)]);}_0x2daef5[_0x584c19(0x124)](_0x399d2f[_0x584c19(0x1ac)](_0x15aebb[_0x584c19(0x143)]+_0x584c19(0x1dd)));}await writeOutput(_0x2daef5['join']('\x0a'),_0x22d800[_0x584c19(0x118)],_0x584c19(0x14a));}return 0x0;}catch(_0x5f0b2e){return handleSDKError(_0x5f0b2e,_0x22d800),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]='llm:agent:show';[a20_0x3cae84(0x172)]=a20_0x3cae84(0x17b);async['execute'](_0x236fc0){const _0x575b96=a20_0x3cae84,{options:_0x28d462,args:_0x19a8a5,tdx:_0x229fa0}=_0x236fc0;if(_0x19a8a5[_0x575b96(0x143)]===0x0)return console[_0x575b96(0x168)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x575b96(0x168)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x32218f=_0x19a8a5[0x0];try{const _0x13911f=await getProjectIdOrDefault(_0x236fc0),_0x1dfed0=await withSpinner(_0x575b96(0x186)+_0x32218f+_0x575b96(0x13b),()=>_0x229fa0[_0x575b96(0x11c)]['resolveAgentId'](_0x32218f,_0x13911f),{'verbose':_0x28d462['verbose']}),_0x32b859=await withSpinner('Fetching\x20agent...',()=>_0x229fa0['llm'][_0x575b96(0x116)](_0x1dfed0[_0x575b96(0x14e)]),{'verbose':_0x28d462['verbose']});return await handleSDKOutput([_0x32b859['data']],_0x28d462),0x0;}catch(_0x1039e6){return handleSDKError(_0x1039e6,_0x28d462),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]='llm:agent:create';['description']=a20_0x3cae84(0x1ca);async[a20_0x3cae84(0x152)](_0x203a0d){const _0xd459b3=a20_0x3cae84,{options:_0x460527,args:_0x245239,tdx:_0x3c105c}=_0x203a0d;if(_0x245239['length']===0x0)return console[_0xd459b3(0x168)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0xd459b3(0x168)](_0xd459b3(0x18f)),console[_0xd459b3(0x168)](_0xd459b3(0x1ea)),0x1;const _0x2c73e2=_0x245239[0x0],_0x35a62b=_0x460527,_0x149d28=_0x35a62b[_0xd459b3(0x16f)],_0x2c53bd=_0x35a62b[_0xd459b3(0x1db)]||'claude-4.5-haiku',_0x38abed=_0x35a62b[_0xd459b3(0x174)],_0x28353f=_0x35a62b['maxToolIterations']?Number(_0x35a62b[_0xd459b3(0x12a)]):undefined,_0x2c925d=_0x35a62b['temperature']?Number(_0x35a62b[_0xd459b3(0x121)]):undefined;try{let _0x149040,_0x3835fd;if(_0x2c73e2[_0xd459b3(0x117)]('/')){const _0x298e51=_0x2c73e2[_0xd459b3(0x159)]('/');if(_0x298e51[_0xd459b3(0x143)]===0x2){const [_0x3f4826,_0x2485cc]=_0x298e51,_0x4a020a=await withSpinner('Resolving\x20project\x20\x27'+_0x3f4826+_0xd459b3(0x13b),()=>_0x3c105c[_0xd459b3(0x11c)]['resolveProjectId'](_0x3f4826),{'verbose':_0x460527[_0xd459b3(0x1d7)]});_0x149040=_0x4a020a[_0xd459b3(0x14e)],_0x3835fd=_0x2485cc;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20path\x20syntax:\x20'+_0x2c73e2,undefined,{'helpText':_0xd459b3(0x19e)});}else _0x149040=await getProjectIdOrDefault(_0x203a0d),_0x3835fd=_0x2c73e2;const _0x1d683a=await withSpinner(_0xd459b3(0x1ed)+_0x3835fd+'\x27...',()=>_0x3c105c[_0xd459b3(0x11c)][_0xd459b3(0x1e8)]({'name':_0x3835fd,'projectId':_0x149040,'modelType':_0x2c53bd,'systemPrompt':_0x149d28,'starterMessage':_0x38abed,'maxToolIterations':_0x28353f,'temperature':_0x2c925d}),{'verbose':_0x460527[_0xd459b3(0x1d7)]});return console[_0xd459b3(0x129)]('Agent\x20created:\x20'+_0x1d683a['data']['id']),await handleSDKOutput([_0x1d683a[_0xd459b3(0x14e)]],_0x460527),0x0;}catch(_0x3db4c9){return handleSDKError(_0x3db4c9,_0x460527),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x13e);[a20_0x3cae84(0x172)]=a20_0x3cae84(0x1e1);async[a20_0x3cae84(0x152)](_0x376b37){const _0x2a3b3a=a20_0x3cae84,{options:_0x11afc9,args:_0x39fae3,tdx:_0x3dbbf1}=_0x376b37;if(_0x39fae3['length']===0x0)return console[_0x2a3b3a(0x168)](_0x2a3b3a(0x11a)),console[_0x2a3b3a(0x168)](_0x2a3b3a(0x1d2)),0x1;const _0xa8cca9=_0x39fae3[0x0],_0x507eeb=_0x11afc9,_0xc17933=_0x507eeb[_0x2a3b3a(0x1cb)],_0x836e61=_0x507eeb[_0x2a3b3a(0x19a)],_0xcaa8a4=_0x507eeb[_0x2a3b3a(0x172)],_0x530f2b=_0x507eeb[_0x2a3b3a(0x174)];if(!_0xc17933&&!_0x836e61&&!_0xcaa8a4&&!_0x530f2b)return console['error'](_0x2a3b3a(0x1cf)),console[_0x2a3b3a(0x168)](_0x2a3b3a(0x1ae)),0x1;try{const _0xb1be40=await getProjectIdOrDefault(_0x376b37),_0x2c8308=await withSpinner(_0x2a3b3a(0x186)+_0xa8cca9+_0x2a3b3a(0x13b),()=>_0x3dbbf1[_0x2a3b3a(0x11c)][_0x2a3b3a(0x1c8)](_0xa8cca9,_0xb1be40),{'verbose':_0x11afc9[_0x2a3b3a(0x1d7)]}),_0x5eefba=_0x2c8308[_0x2a3b3a(0x14e)],_0x5f3a65=await withSpinner('Updating\x20agent...',()=>_0x3dbbf1[_0x2a3b3a(0x11c)][_0x2a3b3a(0x15e)](_0x5eefba,{'name':_0xc17933,'prompt':_0x836e61,'description':_0xcaa8a4,'starterMessage':_0x530f2b}),{'verbose':_0x11afc9[_0x2a3b3a(0x1d7)]});return console[_0x2a3b3a(0x129)](_0x2a3b3a(0x12b)+_0x5f3a65[_0x2a3b3a(0x14e)]['id']),await handleSDKOutput([_0x5f3a65['data']],_0x11afc9),0x0;}catch(_0x3dd192){return handleSDKError(_0x3dd192,_0x11afc9),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]='llm:agent:delete';['description']=a20_0x3cae84(0x1a0);async[a20_0x3cae84(0x152)](_0x55a6cf){const _0x11edec=a20_0x3cae84,{options:_0x356f8b,args:_0x3f321a,tdx:_0x5a1861}=_0x55a6cf;if(_0x3f321a[_0x11edec(0x143)]===0x0)return console['error'](_0x11edec(0x11a)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0xead1f8=_0x3f321a[0x0];try{const _0x171cb3=await getProjectIdOrDefault(_0x55a6cf),_0x49a51a=await withSpinner(_0x11edec(0x186)+_0xead1f8+_0x11edec(0x13b),()=>_0x5a1861[_0x11edec(0x11c)]['resolveAgentId'](_0xead1f8,_0x171cb3),{'verbose':_0x356f8b['verbose']}),_0x5b4a75=_0x49a51a[_0x11edec(0x14e)];return await withSpinner(_0x11edec(0x128),()=>_0x5a1861[_0x11edec(0x11c)]['deleteAgent'](_0x5b4a75),{'verbose':_0x356f8b[_0x11edec(0x1d7)]}),console[_0x11edec(0x129)](_0x11edec(0x1ad)+_0x5b4a75),0x0;}catch(_0x51a5e6){return handleSDKError(_0x51a5e6,_0x356f8b),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a20_0x3cae84(0x15a);[a20_0x3cae84(0x172)]=a20_0x3cae84(0x14f);async['execute'](_0x452525){const _0x492cd6=a20_0x3cae84;return executeChatHistoryCommand(_0x452525,_0x492cd6(0x18b));}}function a20_0x1c35(_0x55f046,_0x3daae1){_0x55f046=_0x55f046-0x115;const _0x2c78bb=a20_0x2c78();let _0x1c35df=_0x2c78bb[_0x55f046];return _0x1c35df;}export class LLMUseCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]='llm:use';[a20_0x3cae84(0x172)]=a20_0x3cae84(0x141);async[a20_0x3cae84(0x152)](_0x5b4a34){const _0x3a023f=a20_0x3cae84,{options:_0x19206b,args:_0x35ea52,tdx:_0x438c71}=_0x5b4a34;if(_0x35ea52[_0x3a023f(0x143)]===0x0)return console[_0x3a023f(0x168)](_0x3a023f(0x17f)),console[_0x3a023f(0x168)](_0x3a023f(0x120)),0x1;const _0x4e8c02=_0x35ea52[0x0];try{return await withSpinner(_0x3a023f(0x153)+_0x4e8c02+'\x27...',()=>_0x438c71['llm'][_0x3a023f(0x150)](_0x4e8c02),{'verbose':_0x19206b[_0x3a023f(0x1d7)]}),console[_0x3a023f(0x129)](_0x3a023f(0x1d6)+_0x4e8c02),0x0;}catch(_0x1ec4b2){return handleSDKError(_0x1ec4b2,_0x19206b),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']='llm:project:create';[a20_0x3cae84(0x172)]='Create\x20a\x20new\x20LLM\x20project';async['execute'](_0x567328){const _0x187bb0=a20_0x3cae84,{options:_0x2e1590,args:_0x2b18ea,tdx:_0x612fb}=_0x567328;if(_0x2b18ea['length']===0x0)return console['error'](_0x187bb0(0x17f)),console['error'](_0x187bb0(0x192)),0x1;const _0x4178a0=_0x2b18ea[0x0],_0x10aafe=_0x2e1590,_0x30fd33=_0x10aafe['description'];try{const _0x29910e=await withSpinner(_0x187bb0(0x1d3)+_0x4178a0+_0x187bb0(0x13b),()=>_0x612fb[_0x187bb0(0x11c)]['createProject']({'name':_0x4178a0,'description':_0x30fd33}),{'verbose':_0x2e1590['verbose']});console[_0x187bb0(0x129)]('Project\x20created:\x20'+_0x29910e[_0x187bb0(0x14e)]['id']);const _0x2675cc=toLLMProjectInfo(_0x29910e[_0x187bb0(0x14e)]);return await handleSDKOutput([_0x2675cc],_0x2e1590),0x0;}catch(_0x31469b){return handleSDKError(_0x31469b,_0x2e1590),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x19f);['description']=a20_0x3cae84(0x1b2);async[a20_0x3cae84(0x152)](_0x1b3807){const _0x5b5b4a=a20_0x3cae84,{options:_0x2e060c,args:_0x1e06b4,tdx:_0x251885}=_0x1b3807;if(_0x1e06b4[_0x5b5b4a(0x143)]===0x0)return console['error'](_0x5b5b4a(0x17f)),console[_0x5b5b4a(0x168)](_0x5b5b4a(0x18e)),0x1;const _0x42741c=_0x1e06b4[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x42741c+_0x5b5b4a(0x13b),()=>_0x251885['llm'][_0x5b5b4a(0x144)](_0x42741c),{'verbose':_0x2e060c[_0x5b5b4a(0x1d7)]}),console[_0x5b5b4a(0x129)](_0x5b5b4a(0x11e)+_0x42741c),0x0;}catch(_0x22cee2){return handleSDKError(_0x22cee2,_0x2e060c),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x171);[a20_0x3cae84(0x172)]=a20_0x3cae84(0x13c);async[a20_0x3cae84(0x152)](_0x3560e1){const _0x5f48e0=a20_0x3cae84,{options:_0x26c5ec,args:_0xd28865,tdx:_0x1e4cb8}=_0x3560e1,_0x1b546f=getChalk(_0x26c5ec);console[_0x5f48e0(0x129)](_0x1b546f[_0x5f48e0(0x1cd)](_0x5f48e0(0x1c7))),console[_0x5f48e0(0x129)](_0x1b546f[_0x5f48e0(0x1cd)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x5f48e0(0x129)](_0x1b546f[_0x5f48e0(0x1ac)](_0x5f48e0(0x182))),console[_0x5f48e0(0x129)]();if(_0xd28865[_0x5f48e0(0x143)]===0x0)return console[_0x5f48e0(0x168)](_0x5f48e0(0x17f)),console['error'](_0x5f48e0(0x170)),0x1;const _0x26d837=_0xd28865[0x0],_0xce2cfc=_0x26c5ec,_0x5e78d7=_0xce2cfc[_0x5f48e0(0x118)],_0x14abf0=_0xce2cfc[_0x5f48e0(0x145)];try{const _0x366c81=_0x5e78d7||_0x26d837+_0x5f48e0(0x1d0);if(a20_0x52a7cc[_0x5f48e0(0x1e0)](_0x366c81)&&!_0x14abf0){if(!_0x26c5ec[_0x5f48e0(0x18c)]){const _0x567710=await confirm('Output\x20directory\x20\x27'+_0x366c81+_0x5f48e0(0x190));if(!_0x567710)return console[_0x5f48e0(0x129)]('Backup\x20cancelled.'),0x0;}a20_0x52a7cc[_0x5f48e0(0x194)](_0x366c81,{'recursive':!![]});}const _0x14fecf=await withSpinner(_0x14abf0?_0x5f48e0(0x134)+_0x26d837+'\x27...':_0x5f48e0(0x165)+_0x26d837+_0x5f48e0(0x13b),()=>_0x1e4cb8[_0x5f48e0(0x11c)]['backupProject'](_0x26d837,_0x5e78d7,{'dryRun':_0x14abf0}),{'verbose':_0x26c5ec[_0x5f48e0(0x1d7)]}),_0x321a97=_0x14fecf[_0x5f48e0(0x14e)];return _0x14abf0?console['log'](_0x5f48e0(0x132)+_0x321a97[_0x5f48e0(0x155)]):console['log'](_0x5f48e0(0x1b8)+_0x321a97['outputDir']),console['log'](_0x5f48e0(0x11d)+_0x321a97[_0x5f48e0(0x16d)][_0x5f48e0(0x17a)]),console[_0x5f48e0(0x129)](_0x5f48e0(0x156)+_0x321a97['counts'][_0x5f48e0(0x1a7)]),console['log'](_0x5f48e0(0x15b)+_0x321a97[_0x5f48e0(0x16d)][_0x5f48e0(0x187)]),console[_0x5f48e0(0x129)]('\x20\x20Integrations:\x20'+_0x321a97[_0x5f48e0(0x16d)][_0x5f48e0(0x1b5)]),(_0x26c5ec[_0x5f48e0(0x1e2)]===_0x5f48e0(0x126)||_0x26c5ec['format']===_0x5f48e0(0x1d8))&&await handleSDKOutput([_0x321a97],_0x26c5ec),0x0;}catch(_0x5bd91b){return handleSDKError(_0x5bd91b,_0x26c5ec),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x133);[a20_0x3cae84(0x172)]=a20_0x3cae84(0x160);async[a20_0x3cae84(0x152)](_0x3c0515){const _0x250b49=a20_0x3cae84,{options:_0x70c073,args:_0x51b667,tdx:_0x4d2a63}=_0x3c0515,_0x5a0201=getChalk(_0x70c073);console['log'](_0x5a0201[_0x250b49(0x1cd)](_0x250b49(0x1de))),console[_0x250b49(0x129)](_0x5a0201[_0x250b49(0x1cd)](_0x250b49(0x123))),console[_0x250b49(0x129)](_0x5a0201['dim'](_0x250b49(0x11f))),console[_0x250b49(0x129)](_0x5a0201[_0x250b49(0x1ac)](_0x250b49(0x1bf))),console['log'](_0x5a0201[_0x250b49(0x1ac)](_0x250b49(0x1d1))),console[_0x250b49(0x129)]();if(_0x51b667['length']===0x0)return console[_0x250b49(0x168)](_0x250b49(0x1a9)),console[_0x250b49(0x168)](_0x250b49(0x19c)),0x1;const _0x4f3ba3=_0x51b667[0x0],_0x266c1c=_0x70c073,_0x4c01fe=_0x266c1c[_0x250b49(0x1cb)],_0x576a8b=_0x266c1c['dryRun'];try{if(!_0x576a8b){const _0x231f2f=_0x4d2a63[_0x250b49(0x11c)][_0x250b49(0x16e)](_0x4f3ba3),_0x141f72=_0x4c01fe||_0x231f2f['exportedFrom'][_0x250b49(0x12f)],_0x5cd547=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x4d2a63[_0x250b49(0x11c)][_0x250b49(0x146)](),{'verbose':_0x70c073[_0x250b49(0x1d7)]}),_0x107589=_0x5cd547[_0x250b49(0x14e)][_0x250b49(0x136)](_0x1c6c35=>_0x1c6c35[_0x250b49(0x1bd)][_0x250b49(0x1cb)]===_0x141f72);if(_0x107589&&!_0x70c073[_0x250b49(0x18c)]){const _0xced64e=await confirm('A\x20project\x20named\x20\x27'+_0x141f72+_0x250b49(0x17c));if(!_0xced64e)return console[_0x250b49(0x129)]('Restore\x20cancelled.'),0x0;}}const _0x1a7b17=await withSpinner(_0x576a8b?_0x250b49(0x1e7)+_0x4f3ba3+_0x250b49(0x13b):_0x250b49(0x162)+_0x4f3ba3+_0x250b49(0x13b),()=>_0x4d2a63[_0x250b49(0x11c)]['restoreProject'](_0x4f3ba3,{'name':_0x4c01fe,'dryRun':_0x576a8b}),{'verbose':_0x70c073['verbose']}),_0x10342e=_0x1a7b17[_0x250b49(0x14e)];return _0x10342e[_0x250b49(0x1c4)]&&console[_0x250b49(0x129)](_0x250b49(0x1dc)+_0x10342e[_0x250b49(0x1c4)]+'\x27'),_0x576a8b?console[_0x250b49(0x129)]('[DRY\x20RUN]\x20Would\x20restore\x20project:\x20'+_0x10342e['projectName']):console[_0x250b49(0x129)](_0x250b49(0x176)+_0x10342e[_0x250b49(0x12f)]+'\x20('+_0x10342e[_0x250b49(0x13d)]+')'),console['log'](_0x250b49(0x11d)+_0x10342e['counts'][_0x250b49(0x17a)]),console[_0x250b49(0x129)](_0x250b49(0x156)+_0x10342e['counts'][_0x250b49(0x1a7)]),console['log']('\x20\x20Prompts:\x20'+_0x10342e[_0x250b49(0x16d)][_0x250b49(0x187)]),console[_0x250b49(0x129)](_0x250b49(0x14d)+_0x10342e['counts'][_0x250b49(0x1b5)]),(_0x70c073[_0x250b49(0x1e2)]==='json'||_0x70c073[_0x250b49(0x1e2)]===_0x250b49(0x1d8))&&await handleSDKOutput([_0x10342e],_0x70c073),0x0;}catch(_0x41cd6d){return handleSDKError(_0x41cd6d,_0x70c073),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x6f70b1,_0x4057f6){const _0x568142=a20_0x3cae84,_0x46f11e=_0x4057f6[_0x568142(0x1cc)]||CHAT_SELECTOR_PAGE_SIZE;let _0x50ee0a=0x0,_0x39b92f=[];const _0x16183a=(await import(_0x568142(0x187)))[_0x568142(0x169)],_0x3cd681=getChalk(_0x4057f6);while(!![]){const _0x2d5e34=await withSpinner(_0x568142(0x125),()=>_0x6f70b1[_0x568142(0x11c)][_0x568142(0x13f)](_0x46f11e+_0x50ee0a),{'verbose':_0x4057f6[_0x568142(0x1d7)]});_0x39b92f=_0x2d5e34[_0x568142(0x14e)];const _0x575412=_0x39b92f[_0x568142(0x1d5)](_0x50ee0a,_0x50ee0a+_0x46f11e),_0x160975=_0x39b92f[_0x568142(0x143)]>_0x50ee0a+_0x46f11e,_0x3e2ec5=[...new Set(_0x575412[_0x568142(0x178)](_0x43e851=>_0x43e851[_0x568142(0x1bd)][_0x568142(0x167)])[_0x568142(0x1ce)](_0x19bcda=>_0x19bcda!==undefined))],_0x2e4229=new Map();await Promise[_0x568142(0x1b3)](_0x3e2ec5['map'](async _0x2e6e8d=>{const _0x470b7a=_0x568142;try{const _0x4c215a=await _0x6f70b1['llm'][_0x470b7a(0x116)](_0x2e6e8d);_0x2e4229[_0x470b7a(0x166)](_0x2e6e8d,_0x4c215a[_0x470b7a(0x1bd)][_0x470b7a(0x1cb)]);}catch{_0x2e4229[_0x470b7a(0x166)](_0x2e6e8d,_0x2e6e8d);}}));const _0x96c8a8=_0x575412[_0x568142(0x178)](_0x6c436d=>{const _0x610d04=_0x568142,_0x519b82=_0x6c436d['attributes'][_0x610d04(0x1e3)]||_0x610d04(0x1b0),_0x284dd9=_0x519b82[_0x610d04(0x159)]('\x0a')[0x0],_0x1268c2=_0x284dd9[_0x610d04(0x143)]>0x50?_0x284dd9[_0x610d04(0x196)](0x0,0x4d)+_0x610d04(0x1ef):_0x284dd9,_0x100065=_0x6c436d[_0x610d04(0x1bd)]['agentId']?_0x2e4229[_0x610d04(0x139)](_0x6c436d[_0x610d04(0x1bd)][_0x610d04(0x167)])||_0x6c436d[_0x610d04(0x1bd)][_0x610d04(0x167)]:_0x610d04(0x18a),_0x797978=_0x6c436d[_0x610d04(0x1bd)][_0x610d04(0x15d)]||_0x6c436d[_0x610d04(0x1bd)]['updatedAt'],_0xde31a8=new Date(_0x797978),_0x5260d1=new Date(),_0x32bd64=_0x5260d1[_0x610d04(0x1bc)]()-_0xde31a8[_0x610d04(0x1bc)](),_0x2eba99=Math[_0x610d04(0x138)](_0x32bd64/0xea60),_0x2ccbd0=Math['floor'](_0x32bd64/0x36ee80),_0x234ff7=Math[_0x610d04(0x138)](_0x32bd64/0x5265c00);let _0x357cf9;if(_0x2eba99<0x1)_0x357cf9=_0x610d04(0x1c3);else{if(_0x2eba99<0x3c)_0x357cf9=_0x2eba99+'m\x20ago';else{if(_0x2ccbd0<0x18)_0x357cf9=_0x2ccbd0+_0x610d04(0x1ab);else _0x234ff7<0x7?_0x357cf9=_0x234ff7+_0x610d04(0x18d):_0x357cf9=_0xde31a8[_0x610d04(0x13a)](_0x610d04(0x198),{'month':_0x610d04(0x1d9),'day':_0x610d04(0x1b6)});}}return{'title':_0x1268c2+'\x20'+_0x3cd681[_0x610d04(0x1ac)]('['+_0x100065+']\x20'+_0x357cf9),'value':_0x6c436d['id']};});_0x160975&&_0x96c8a8['push']({'title':_0x3cd681[_0x568142(0x15f)](_0x568142(0x183)),'value':_0x568142(0x185)});const _0x48bcd6=await _0x16183a({'type':_0x568142(0x12e),'name':_0x568142(0x131),'message':_0x568142(0x175),'choices':_0x96c8a8,'hint':'Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel'});if(!_0x48bcd6['chatId'])return undefined;if(_0x48bcd6[_0x568142(0x131)]===_0x568142(0x185)){_0x50ee0a+=_0x46f11e;continue;}return _0x48bcd6['chatId'];}}function a20_0x2c78(){const _0x1aab88=['Validating\x20backup\x20from\x20\x27','createAgent','Fetching\x20agents...','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','No\x20agents\x20found','cause','Creating\x20agent\x20\x27','updatedAt','...','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','agent','includes','output','sort','Error:\x20Agent\x20name\x20is\x20required','input','llm','\x20\x20Agents:\x20','Project\x20deleted:\x20','\x20\x20\x20Examples:','Usage:\x20tdx\x20llm\x20use\x20<project-name>','temperature','tool_call','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','push','Fetching\x20chat\x20sessions...','json','[input]\x20\x20','Deleting\x20agent...','log','maxToolIterations','Agent\x20updated:\x20','targetWebSearchTool','green','select','projectName','Resolving\x20project\x20\x27','chatId','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','llm:project:restore','Analyzing\x20project\x20\x27','\x0aCancelled','find','Error:\x20','floor','get','toLocaleDateString','\x27...','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','projectId','llm:agent:update','chats','INVALID_ARGUMENT','Set\x20current\x20project\x20context','⚒️\x20','length','deleteProject','dryRun','projects','52bRskRi','llm:agents','models','table','createdAt','blue','\x20\x20Integrations:\x20','data','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','setCurrentProject','\x20→\x20chat:\x20','execute','Setting\x20project\x20context\x20to\x20\x27','content','outputDir','\x20\x20Knowledge\x20Bases:\x20','5157388MJNjwh','Fetching\x20most\x20recent\x20chat...','split','llm:history','\x20\x20Prompts:\x20','827460yzbVxc','lastConversationAt','updateAgent','cyan','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','Invalid\x20path\x20syntax:\x20','Restoring\x20project\x20from\x20\x27','stack','[content]','Backing\x20up\x20project\x20\x27','set','agentId','error','default','18OHXpQt','1162zwLWlW','2468050OXwheM','counts','getBackupMetadata','systemPrompt','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','llm:project:backup','description','825830xFtIrq','starterMessage','Select\x20a\x20chat\x20session:','Project\x20restored:\x20','tsv','map','magenta','agents','Show\x20agent\x20details','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','join','22OqbCjR','Error:\x20Project\x20name\x20is\x20required','812IPTtMH','No\x20projects\x20found','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','Load\x20more...','message','__load_more__','Resolving\x20agent\x20\x27','prompts','\x0aStack\x20trace:','\x20\x20Cause:\x20','(no\x20agent)','tdx\x20llm\x20history','yes','d\x20ago','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x27\x20already\x20exists.\x20Overwrite?','resolveProjectId','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','\x20->\x20KB:','rmSync','tdx\x20chats','substring','[image]\x20\x20','en-US','LLM_PROJECT_NOT_FOUND','prompt','No\x20messages\x20found\x20in\x20chat\x20history.','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','web','Use\x20format:\x20project-name/agent-name','llm:project:delete','Delete\x20an\x20agent','tool','27IFVWso','entries','[output]\x20','\x20-\x20','bold','knowledgeBases','llm:projects','Error:\x20Backup\x20folder\x20path\x20is\x20required','\x20->\x20WebSearch:','h\x20ago','dim','Agent\x20deleted:\x20','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','targetImageGenerator','(no\x20message)','643903rZOtMK','Delete\x20an\x20LLM\x20project','all','localeCompare','integrations','numeric','targetKnowledgeBase','Project\x20backed\x20up\x20to:\x20','3QJeTUE','\x20project(s)','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','getTime','attributes','targetAgent','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','getOrCreateDefaultProject','string','llm:models','just\x20now','sourceSite','site','10160LrPuAz','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','resolveAgentId','getCurrentProject','Create\x20a\x20new\x20agent\x20in\x20current\x20project','name','limit','yellow','filter','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','.llm','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Creating\x20project\x20\x27','🤖\x20','slice','Project\x20context\x20set\x20to:\x20','verbose','jsonl','short','keys','model','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','\x20agent(s)','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','Fetching\x20chat\x20history\x20for\x20\x27','existsSync','Update\x20an\x20existing\x20agent','format','firstInputContent','toLowerCase','stringify','1042CLYRiA'];a20_0x2c78=function(){return _0x1aab88;};return a20_0x2c78();}export class ChatsCommand extends BaseCommand{[a20_0x3cae84(0x1cb)]=a20_0x3cae84(0x13f);[a20_0x3cae84(0x172)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a20_0x3cae84(0x152)](_0x479dcf){const _0x30f6f9=a20_0x3cae84;return executeChatHistoryCommand(_0x479dcf,_0x30f6f9(0x195));}}
|
|
1
|
+
const a20_0x38cdde=a20_0x2d6f;(function(_0x3c9100,_0x5f0b11){const _0xc6e6a3=a20_0x2d6f,_0x186551=_0x3c9100();while(!![]){try{const _0x4146a2=-parseInt(_0xc6e6a3(0x117))/0x1+-parseInt(_0xc6e6a3(0x1a1))/0x2+-parseInt(_0xc6e6a3(0x1e9))/0x3+-parseInt(_0xc6e6a3(0x12f))/0x4*(-parseInt(_0xc6e6a3(0x12d))/0x5)+-parseInt(_0xc6e6a3(0x1e2))/0x6*(-parseInt(_0xc6e6a3(0x11b))/0x7)+parseInt(_0xc6e6a3(0x184))/0x8+-parseInt(_0xc6e6a3(0x18c))/0x9*(parseInt(_0xc6e6a3(0x17a))/0xa);if(_0x4146a2===_0x5f0b11)break;else _0x186551['push'](_0x186551['shift']());}catch(_0x547a16){_0x186551['push'](_0x186551['shift']());}}}(a20_0x216c,0x1b0b9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import*as a20_0x170174 from'node:fs';function handleSDKError(_0x272312,_0xed63f5){const _0x760630=a20_0x2d6f;if(_0x272312 instanceof SDKError)console['error'](_0x760630(0x130)+_0x272312[_0x760630(0x157)]),_0xed63f5['verbose']&&(_0x272312[_0x760630(0x15f)]&&console[_0x760630(0x1cd)](_0x760630(0x113)+_0x272312[_0x760630(0x15f)]),_0x272312[_0x760630(0x15a)]&&(console['error'](_0x760630(0x13a)),console[_0x760630(0x1cd)](_0x272312[_0x760630(0x15a)])));else throw _0x272312;}function formatChatHistoryEntry(_0x1d6819,_0x5d487f){const _0x4332ce=a20_0x2d6f,_0x9f102e=getChalk(_0x5d487f),_0x4d90ab=_0x9f102e['dim'](_0x1d6819['at']);if(_0x4332ce(0x134)in _0x1d6819){const _0x6c2955=_0x9f102e[_0x4332ce(0x1cf)]('[input]\x20\x20');return _0x4d90ab+'\x20'+_0x6c2955+':\x20'+_0x1d6819[_0x4332ce(0x134)];}if(_0x4332ce(0x120)in _0x1d6819){const _0x1c0586=_0x9f102e[_0x4332ce(0x17d)](_0x4332ce(0x1c8));return _0x4d90ab+'\x20'+_0x1c0586+':\x20'+_0x1d6819['content'];}if('tool_call'in _0x1d6819){const _0x38e19c=_0x9f102e[_0x4332ce(0x1d0)](_0x4332ce(0x1c4)),{functionName:_0x23cae4,functionArguments:_0x5a1a83,targetFunction:_0x5b8edc}=_0x1d6819[_0x4332ce(0x166)];let _0x44e93e=_0x4d90ab+'\x20'+_0x38e19c+':\x20'+_0x9f102e[_0x4332ce(0x1db)](_0x23cae4);if(_0x5a1a83&&Object[_0x4332ce(0x1e1)](_0x5a1a83)[_0x4332ce(0x124)]>0x0){const _0x40b267=Object[_0x4332ce(0x152)](_0x5a1a83)[_0x4332ce(0x193)](([_0x334ac4,_0xf8c7f9])=>_0x334ac4+'='+JSON[_0x4332ce(0x170)](_0xf8c7f9))[_0x4332ce(0x1f1)](',\x20');_0x44e93e+='('+_0x40b267+')';}_0x5b8edc&&(_0x44e93e+=_0x9f102e[_0x4332ce(0x18d)]('\x20['+_0x5b8edc+']'));let _0x548f41='';if(_0x1d6819['tool_call'][_0x4332ce(0x178)])_0x548f41=_0x4332ce(0x10d)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x178)][_0x4332ce(0x121)];else{if(_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1c3)])_0x548f41=_0x4332ce(0x133)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1c3)]['name'];else{if(_0x1d6819['tool_call'][_0x4332ce(0x15e)])_0x548f41=_0x4332ce(0x1c1)+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x15e)][_0x4332ce(0x121)];else _0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1ca)]&&(_0x548f41='\x20->\x20ImageGen:'+_0x1d6819[_0x4332ce(0x166)][_0x4332ce(0x1ca)][_0x4332ce(0x121)]);}}return _0x44e93e+_0x548f41;}if('tool'in _0x1d6819){const _0x2ef799=_0x9f102e[_0x4332ce(0x1ec)]('[tool]\x20\x20\x20'),{functionName:_0x40bcdd,functionArguments:_0x3bef2a,content:_0x40b89e,newChat:_0x13ed04}=_0x1d6819[_0x4332ce(0x1ac)];let _0xb954bc=_0x4d90ab+'\x20'+_0x2ef799+':\x20'+_0x9f102e['bold'](_0x40bcdd);if(_0x3bef2a){const _0x442809=typeof _0x3bef2a===_0x4332ce(0x1a7)?_0x3bef2a:JSON[_0x4332ce(0x170)](_0x3bef2a);_0xb954bc+='('+_0x442809+')';}return _0x40b89e&&(_0xb954bc+='\x0a'+_0x9f102e[_0x4332ce(0x18d)](_0x40b89e)),_0x13ed04&&(_0xb954bc+=_0x9f102e[_0x4332ce(0x18d)](_0x4332ce(0x146)+_0x13ed04['id'])),_0xb954bc;}if('output'in _0x1d6819){const _0x45c982=_0x9f102e['blue'](_0x4332ce(0x1e7));return _0x4d90ab+'\x20'+_0x45c982+':\x20'+_0x1d6819[_0x4332ce(0x185)][_0x4332ce(0x121)]+'\x20('+_0x1d6819['output']['content'][_0x4332ce(0x124)]+_0x4332ce(0x1e5);}if(_0x4332ce(0x128)in _0x1d6819){const _0x516506=_0x9f102e['blue'](_0x4332ce(0x141)),{width:_0x212f33,height:_0x5b2b63,headerText:_0xa50c14}=_0x1d6819[_0x4332ce(0x128)],_0x2b1aa9=_0xa50c14?_0x4332ce(0x1d4)+_0xa50c14:'';return _0x4d90ab+'\x20'+_0x516506+':\x20'+_0x212f33+'x'+_0x5b2b63+_0x2b1aa9;}if(_0x4332ce(0x1cd)in _0x1d6819){const _0x5cfc9f=_0x9f102e['red'](_0x4332ce(0x111));return _0x4d90ab+'\x20'+_0x5cfc9f+':\x20'+_0x1d6819[_0x4332ce(0x1cd)];}return _0x4d90ab+'\x20'+_0x9f102e['dim'](_0x4332ce(0x1d1))+':\x20'+JSON['stringify'](_0x1d6819);}async function executeChatHistoryCommand(_0x21baf5,_0x2112bd){const _0x5c45ec=a20_0x2d6f,{options:_0x365111,args:_0x2bfce1,tdx:_0x81a6e1}=_0x21baf5,_0x35e807=_0x2bfce1[0x0],_0x375428=_0x365111,_0x16b545=_0x375428[_0x5c45ec(0x140)];try{if(_0x16b545&&_0x35e807)return console[_0x5c45ec(0x1cd)](_0x5c45ec(0x17e)),console['error'](_0x5c45ec(0x136)+_0x2112bd+'\x20--last'),0x1;if(!_0x35e807&&!_0x16b545&&_0x365111[_0x5c45ec(0x144)]!==undefined){const _0xd359bd=resolveLimit(_0x365111[_0x5c45ec(0x187)],DEFAULT_LLM_LIMIT),_0x555d38=await withSpinner(_0x5c45ec(0x1e6),()=>_0x81a6e1[_0x5c45ec(0x131)][_0x5c45ec(0x165)](_0xd359bd),{'verbose':_0x365111[_0x5c45ec(0x1be)]});return await handleSDKOutput(_0x555d38[_0x5c45ec(0x112)],_0x365111),0x0;}const _0x5c5da4=await getChatIdOrSelect(_0x81a6e1,_0x365111,_0x16b545,_0x35e807);if(!_0x5c5da4)return 0x0;return await displayChatHistory(_0x5c5da4,_0x81a6e1,_0x365111),0x0;}catch(_0x57a9b4){return handleSDKError(_0x57a9b4,_0x365111),0x1;}}async function displayChatHistory(_0x3fa4a9,_0x1c202d,_0x517152){const _0x1eef14=a20_0x2d6f,_0x1f8056=await withSpinner(_0x1eef14(0x11f)+_0x3fa4a9+_0x1eef14(0x143),()=>_0x1c202d[_0x1eef14(0x131)][_0x1eef14(0x151)](_0x3fa4a9),{'verbose':_0x517152[_0x1eef14(0x1be)]}),_0x31be4c=_0x1f8056[_0x1eef14(0x112)][_0x1eef14(0x112)]??[];if(_0x31be4c[_0x1eef14(0x124)]===0x0){console['log'](_0x1eef14(0x1d3));return;}if(_0x517152['format']!==undefined)await handleSDKOutput(_0x31be4c,_0x517152);else{const _0x36a61b=_0x31be4c[_0x1eef14(0x193)](_0x5f20a1=>formatChatHistoryEntry(_0x5f20a1,_0x517152)),_0x5aa39b=_0x36a61b[_0x1eef14(0x1f1)]('\x0a');await writeOutput(_0x5aa39b,_0x517152['output'],_0x1eef14(0x1ed));}}async function getChatIdOrSelect(_0x2a501e,_0x457f69,_0x1d4bec,_0x42b7f7){const _0x50094b=a20_0x2d6f;if(_0x42b7f7)return _0x42b7f7;if(_0x1d4bec){const _0x449910=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x2a501e['llm'][_0x50094b(0x165)](0x1),{'verbose':_0x457f69[_0x50094b(0x1be)]});if(_0x449910['data'][_0x50094b(0x124)]===0x0)return console[_0x50094b(0x1cb)](_0x50094b(0x186)),undefined;return _0x449910[_0x50094b(0x112)][0x0]['id'];}const _0x438ee5=await selectChatInteractively(_0x2a501e,_0x457f69);if(!_0x438ee5)return console['log'](_0x50094b(0x1c5)),undefined;return _0x438ee5;}async function getProjectIdOrDefault(_0x312f69){const _0xc51223=await getProjectWithName(_0x312f69);return _0xc51223['id'];}async function getProjectWithName(_0x11263c){const _0x2d85ea=a20_0x2d6f,{tdx:_0x4cebe1,options:_0x4f266b}=_0x11263c,_0x1c761d=_0x4f266b['llmProject'];if(_0x1c761d){const _0x50543d=await withSpinner(_0x2d85ea(0x1a5)+_0x1c761d+'\x27...',()=>_0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x1a9)](_0x1c761d),{'verbose':_0x4f266b[_0x2d85ea(0x1be)]});return{'id':_0x50543d['data'],'name':_0x1c761d};}const _0x1c1b21=_0x4cebe1[_0x2d85ea(0x131)]['getCurrentProject']();if(_0x1c1b21){const _0x762bdc=await _0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x1f0)](),_0x87878e=_0x762bdc['find'](_0x429abe=>_0x429abe['id']===_0x1c1b21);return{'id':_0x1c1b21,'name':_0x87878e?.[_0x2d85ea(0x159)][_0x2d85ea(0x121)]||_0x2d85ea(0x119)};}const _0x46bf49=await withSpinner(_0x2d85ea(0x12c),()=>_0x4cebe1[_0x2d85ea(0x131)][_0x2d85ea(0x16d)](),{'verbose':_0x4f266b[_0x2d85ea(0x1be)]});return{'id':_0x46bf49[_0x2d85ea(0x112)]['id'],'name':_0x46bf49[_0x2d85ea(0x112)][_0x2d85ea(0x159)][_0x2d85ea(0x121)]};}function toLLMProjectInfo(_0x433cd2){const _0x15e353=a20_0x2d6f;return{'name':_0x433cd2[_0x15e353(0x159)][_0x15e353(0x121)],'description':_0x433cd2['attributes'][_0x15e353(0x14b)],'createdAt':_0x433cd2[_0x15e353(0x159)][_0x15e353(0x190)],'updatedAt':_0x433cd2[_0x15e353(0x159)]['updatedAt']};}function toAgentInfo(_0x46dedf){const _0x49e301=a20_0x2d6f;return{'name':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x121)],'description':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x14b)],'prompt':truncatePrompt(_0x46dedf[_0x49e301(0x159)][_0x49e301(0x17b)]),'createdAt':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x190)],'updatedAt':_0x46dedf[_0x49e301(0x159)][_0x49e301(0x18f)]};}function truncatePrompt(_0x32fc26){const _0x456069=a20_0x2d6f;if(!_0x32fc26)return undefined;const _0x5ca43e=0x64;if(_0x32fc26[_0x456069(0x124)]<=_0x5ca43e)return _0x32fc26;return _0x32fc26[_0x456069(0x153)](0x0,_0x5ca43e)+_0x456069(0x1ce);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a20_0x38cdde(0x14b)]='List\x20available\x20LLM\x20models';async[a20_0x38cdde(0x13c)](_0x3c8658){const _0x22cb0e=a20_0x38cdde,{options:_0xe35f46,tdx:_0x2a593e}=_0x3c8658;try{const _0x5942db=await withSpinner(_0x22cb0e(0x177),()=>_0x2a593e[_0x22cb0e(0x131)][_0x22cb0e(0x149)](),{'verbose':_0xe35f46[_0x22cb0e(0x1be)]});return await handleSDKOutput(_0x5942db[_0x22cb0e(0x112)],_0xe35f46),0x0;}catch(_0x1d7cde){return handleSDKError(_0x1d7cde,_0xe35f46),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x171);[a20_0x38cdde(0x14b)]='List\x20all\x20LLM\x20projects';async[a20_0x38cdde(0x13c)](_0x4a6380){const _0x31e496=a20_0x38cdde,{options:_0x5c0b04,args:_0x13716b,tdx:_0x23fbe0}=_0x4a6380,_0x146209=getChalk(_0x5c0b04),_0x3bf5eb=_0x5c0b04['web'],_0x4e0cf9=_0x5c0b04[_0x31e496(0x16f)];try{const _0x225c70=_0x13716b[0x0],_0x571f7e=resolveLimit(_0x5c0b04[_0x31e496(0x187)],DEFAULT_LLM_LIMIT),_0x1bf0b1=await withSpinner(_0x31e496(0x160),()=>_0x23fbe0['llm'][_0x31e496(0x1f0)](_0x571f7e),{'verbose':_0x5c0b04[_0x31e496(0x1be)]});let _0xe1ad5b=_0x1bf0b1[_0x31e496(0x112)];_0x225c70&&(_0xe1ad5b=_0x1bf0b1[_0x31e496(0x112)][_0x31e496(0x1a2)](_0x44e98b=>matchGlobPattern(_0x44e98b[_0x31e496(0x159)][_0x31e496(0x121)],_0x225c70)));const _0x6b7f37=_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x1d9)||_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x14d)||_0x5c0b04[_0x31e496(0x144)]===_0x31e496(0x1ed)||_0x5c0b04['format']===_0x31e496(0x126);if(_0x6b7f37){const _0x4f3ead=_0xe1ad5b[_0x31e496(0x193)](_0x31bf3c=>({...toLLMProjectInfo(_0x31bf3c),..._0x3bf5eb?{'url':getLLMProjectUrl(_0x4e0cf9,_0x31bf3c['id'])}:{}}));await handleSDKOutput(_0x4f3ead,_0x5c0b04);}else{const _0x1e18d1=[];if(_0xe1ad5b['length']===0x0)_0x1e18d1[_0x31e496(0x168)](_0x146209[_0x31e496(0x18d)](_0x31e496(0x19f)));else{const _0x3911cf=[..._0xe1ad5b]['sort']((_0x379338,_0x3d96f2)=>_0x379338['attributes'][_0x31e496(0x121)]['localeCompare'](_0x3d96f2[_0x31e496(0x159)]['name']));for(const _0x37cda7 of _0x3911cf){if(_0x3bf5eb){const _0x33f354=getLLMProjectUrl(_0x4e0cf9,_0x37cda7['id']);_0x1e18d1[_0x31e496(0x168)](_0x31e496(0x189)+_0x37cda7[_0x31e496(0x159)]['name']+'\x20\x20'+_0x146209[_0x31e496(0x18d)](_0x33f354));}else _0x1e18d1['push']('⚒️\x20'+_0x37cda7[_0x31e496(0x159)]['name']);}_0x1e18d1[_0x31e496(0x168)](_0x146209['dim'](_0xe1ad5b[_0x31e496(0x124)]+'\x20project(s)'));}await writeOutput(_0x1e18d1['join']('\x0a'),_0x5c0b04['output'],'table');}return 0x0;}catch(_0x311a89){return handleSDKError(_0x311a89,_0x5c0b04),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1df);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x14c);async[a20_0x38cdde(0x13c)](_0x458ccd){const _0x2ed7a7=a20_0x38cdde,{options:_0x2bf9df,args:_0x5ecad4,tdx:_0x31444c}=_0x458ccd,_0x26b377=getChalk(_0x2bf9df),_0xd12e2a=_0x2bf9df[_0x2ed7a7(0x1b0)],_0x533466=_0x2bf9df[_0x2ed7a7(0x16f)];try{const _0x523358=_0x5ecad4[0x0];let _0x5f0f91=_0x523358,_0x38e353,_0x156738;if(_0x523358&&_0x523358[_0x2ed7a7(0x12e)]('/')){const _0x363b23=_0x523358['split']('/');if(_0x363b23[_0x2ed7a7(0x124)]===0x2){const [_0x380ef9,_0x5e272b]=_0x363b23,_0x293ef9=await _0x31444c[_0x2ed7a7(0x131)]['projects'](),_0xa1f05a=_0x293ef9['find'](_0x49f47=>_0x49f47[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)]['toLowerCase']()===_0x380ef9[_0x2ed7a7(0x1c0)]());if(!_0xa1f05a)throw new SDKError(ErrorCode[_0x2ed7a7(0x10a)],'Project\x20not\x20found:\x20'+_0x380ef9,undefined,{'helpText':_0x2ed7a7(0x1a6)});_0x38e353=_0xa1f05a['id'],_0x156738=_0xa1f05a[_0x2ed7a7(0x159)]['name'],_0x5f0f91=_0x5e272b;}else throw new SDKError(ErrorCode[_0x2ed7a7(0x1ef)],'Invalid\x20path\x20syntax:\x20'+_0x523358,undefined,{'helpText':_0x2ed7a7(0x1aa)});}else{const _0x34d650=await getProjectWithName(_0x458ccd);_0x38e353=_0x34d650['id'],_0x156738=_0x34d650[_0x2ed7a7(0x121)];}const _0x1e5ec2=await withSpinner(_0x2ed7a7(0x116),()=>_0x31444c[_0x2ed7a7(0x131)]['agents'](_0x38e353),{'verbose':_0x2bf9df[_0x2ed7a7(0x1be)]});let _0xe95fa0=_0x1e5ec2[_0x2ed7a7(0x112)];_0x5f0f91&&(_0xe95fa0=_0x1e5ec2[_0x2ed7a7(0x112)]['filter'](_0x35853a=>matchGlobPattern(_0x35853a[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)],_0x5f0f91)));const _0x224b9a=_0x2bf9df['format']===_0x2ed7a7(0x1d9)||_0x2bf9df[_0x2ed7a7(0x144)]===_0x2ed7a7(0x14d)||_0x2bf9df[_0x2ed7a7(0x144)]===_0x2ed7a7(0x1ed)||_0x2bf9df[_0x2ed7a7(0x144)]==='tsv';if(_0x224b9a){const _0x1f5de5=_0xe95fa0[_0x2ed7a7(0x193)](_0x5ddddc=>({...toAgentInfo(_0x5ddddc),..._0xd12e2a?{'chatUrl':getLLMAgentChatUrl(_0x533466,_0x38e353,_0x5ddddc['id'])}:{}}));await handleSDKOutput(_0x1f5de5,_0x2bf9df);}else{const _0x48fc37=[];_0x48fc37[_0x2ed7a7(0x168)](_0x26b377[_0x2ed7a7(0x18d)]('['+_0x156738+']'));if(_0xe95fa0[_0x2ed7a7(0x124)]===0x0)_0x48fc37['push'](_0x26b377[_0x2ed7a7(0x18d)](_0x2ed7a7(0x1bc)));else{const _0x4c4ae5=[..._0xe95fa0]['sort']((_0x251e04,_0x2e542c)=>_0x251e04[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)][_0x2ed7a7(0x1bb)](_0x2e542c[_0x2ed7a7(0x159)]['name']));for(const _0x54deba of _0x4c4ae5){if(_0xd12e2a){const _0x5a95cc=getLLMAgentChatUrl(_0x533466,_0x38e353,_0x54deba['id']);_0x48fc37[_0x2ed7a7(0x168)]('🤖\x20'+_0x54deba[_0x2ed7a7(0x159)]['name']+'\x20\x20'+_0x26b377[_0x2ed7a7(0x18d)](_0x5a95cc));}else _0x48fc37['push'](_0x2ed7a7(0x11a)+_0x54deba[_0x2ed7a7(0x159)][_0x2ed7a7(0x121)]);}_0x48fc37['push'](_0x26b377[_0x2ed7a7(0x18d)](_0xe95fa0[_0x2ed7a7(0x124)]+_0x2ed7a7(0x1b5)));}await writeOutput(_0x48fc37[_0x2ed7a7(0x1f1)]('\x0a'),_0x2bf9df['output'],_0x2ed7a7(0x1ed));}return 0x0;}catch(_0x1feabd){return handleSDKError(_0x1feabd,_0x2bf9df),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1ab);['description']=a20_0x38cdde(0x1ee);async['execute'](_0x15fdb9){const _0x216d94=a20_0x38cdde,{options:_0x3af7f6,args:_0x2ab02c,tdx:_0x38b7ac}=_0x15fdb9;if(_0x2ab02c['length']===0x0)return console[_0x216d94(0x1cd)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x216d94(0x1cd)](_0x216d94(0x142)),0x1;const _0xb93afb=_0x2ab02c[0x0];try{const _0x4f9e70=await getProjectIdOrDefault(_0x15fdb9),_0x33652b=await withSpinner('Resolving\x20agent\x20\x27'+_0xb93afb+_0x216d94(0x143),()=>_0x38b7ac[_0x216d94(0x131)][_0x216d94(0x13b)](_0xb93afb,_0x4f9e70),{'verbose':_0x3af7f6['verbose']}),_0x1f9f14=await withSpinner('Fetching\x20agent...',()=>_0x38b7ac[_0x216d94(0x131)][_0x216d94(0x1da)](_0x33652b[_0x216d94(0x112)]),{'verbose':_0x3af7f6[_0x216d94(0x1be)]});return await handleSDKOutput([_0x1f9f14['data']],_0x3af7f6),0x0;}catch(_0x2a1ef1){return handleSDKError(_0x2a1ef1,_0x3af7f6),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x174);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x14a);async['execute'](_0x4917f6){const _0x1a130c=a20_0x38cdde,{options:_0x32f2cb,args:_0x23d39a,tdx:_0x2d9636}=_0x4917f6;if(_0x23d39a[_0x1a130c(0x124)]===0x0)return console[_0x1a130c(0x1cd)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x1a130c(0x1cd)](_0x1a130c(0x139)),console[_0x1a130c(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x58aafd=_0x23d39a[0x0],_0x5bcd4d=_0x32f2cb,_0x328043=_0x5bcd4d[_0x1a130c(0x10c)],_0x24c86b=_0x5bcd4d[_0x1a130c(0x13d)]||_0x1a130c(0x19e),_0x18a224=_0x5bcd4d[_0x1a130c(0x132)],_0x208065=_0x5bcd4d[_0x1a130c(0x16b)]?Number(_0x5bcd4d[_0x1a130c(0x16b)]):undefined,_0x2695d9=_0x5bcd4d[_0x1a130c(0x19c)]?Number(_0x5bcd4d[_0x1a130c(0x19c)]):undefined;try{let _0x49768e,_0x375691;if(_0x58aafd[_0x1a130c(0x12e)]('/')){const _0x3295c2=_0x58aafd['split']('/');if(_0x3295c2[_0x1a130c(0x124)]===0x2){const [_0x44ccf9,_0x1af514]=_0x3295c2,_0x38519e=await withSpinner(_0x1a130c(0x1a5)+_0x44ccf9+_0x1a130c(0x143),()=>_0x2d9636['llm'][_0x1a130c(0x1a9)](_0x44ccf9),{'verbose':_0x32f2cb['verbose']});_0x49768e=_0x38519e[_0x1a130c(0x112)],_0x375691=_0x1af514;}else throw new SDKError(ErrorCode[_0x1a130c(0x1ef)],_0x1a130c(0x16c)+_0x58aafd,undefined,{'helpText':_0x1a130c(0x1aa)});}else _0x49768e=await getProjectIdOrDefault(_0x4917f6),_0x375691=_0x58aafd;const _0x1bbf5d=await withSpinner(_0x1a130c(0x1b4)+_0x375691+_0x1a130c(0x143),()=>_0x2d9636[_0x1a130c(0x131)][_0x1a130c(0x158)]({'name':_0x375691,'projectId':_0x49768e,'modelType':_0x24c86b,'systemPrompt':_0x328043,'starterMessage':_0x18a224,'maxToolIterations':_0x208065,'temperature':_0x2695d9}),{'verbose':_0x32f2cb[_0x1a130c(0x1be)]});return console[_0x1a130c(0x1cb)](_0x1a130c(0x1d7)+_0x1bbf5d[_0x1a130c(0x112)]['id']),await handleSDKOutput([_0x1bbf5d[_0x1a130c(0x112)]],_0x32f2cb),0x0;}catch(_0x4b9cb3){return handleSDKError(_0x4b9cb3,_0x32f2cb),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a20_0x38cdde(0x19d);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x13f);async[a20_0x38cdde(0x13c)](_0x213fec){const _0x28e599=a20_0x38cdde,{options:_0x554224,args:_0x17ae56,tdx:_0x7ab540}=_0x213fec;if(_0x17ae56[_0x28e599(0x124)]===0x0)return console[_0x28e599(0x1cd)](_0x28e599(0x1b7)),console[_0x28e599(0x1cd)](_0x28e599(0x14e)),0x1;const _0x497ef6=_0x17ae56[0x0],_0x5ed436=_0x554224,_0x23f294=_0x5ed436[_0x28e599(0x121)],_0xc064c5=_0x5ed436[_0x28e599(0x17b)],_0x5e7c72=_0x5ed436['description'],_0x5ae8d6=_0x5ed436['starterMessage'];if(!_0x23f294&&!_0xc064c5&&!_0x5e7c72&&!_0x5ae8d6)return console[_0x28e599(0x1cd)](_0x28e599(0x1e8)),console[_0x28e599(0x1cd)](_0x28e599(0x1a0)),0x1;try{const _0x4763bc=await getProjectIdOrDefault(_0x213fec),_0x4d6b18=await withSpinner(_0x28e599(0x17c)+_0x497ef6+_0x28e599(0x143),()=>_0x7ab540[_0x28e599(0x131)]['resolveAgentId'](_0x497ef6,_0x4763bc),{'verbose':_0x554224[_0x28e599(0x1be)]}),_0x458947=_0x4d6b18[_0x28e599(0x112)],_0x32b109=await withSpinner(_0x28e599(0x129),()=>_0x7ab540[_0x28e599(0x131)]['updateAgent'](_0x458947,{'name':_0x23f294,'prompt':_0xc064c5,'description':_0x5e7c72,'starterMessage':_0x5ae8d6}),{'verbose':_0x554224[_0x28e599(0x1be)]});return console[_0x28e599(0x1cb)](_0x28e599(0x1cc)+_0x32b109[_0x28e599(0x112)]['id']),await handleSDKOutput([_0x32b109[_0x28e599(0x112)]],_0x554224),0x0;}catch(_0x2130b1){return handleSDKError(_0x2130b1,_0x554224),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']='llm:agent:delete';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x150);async[a20_0x38cdde(0x13c)](_0x28c005){const _0x2681f3=a20_0x38cdde,{options:_0x413542,args:_0xea832a,tdx:_0x3a1229}=_0x28c005;if(_0xea832a['length']===0x0)return console[_0x2681f3(0x1cd)](_0x2681f3(0x1b7)),console[_0x2681f3(0x1cd)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x1dfa80=_0xea832a[0x0];try{const _0x4b2c3a=await getProjectIdOrDefault(_0x28c005),_0x5b501e=await withSpinner(_0x2681f3(0x17c)+_0x1dfa80+_0x2681f3(0x143),()=>_0x3a1229['llm'][_0x2681f3(0x13b)](_0x1dfa80,_0x4b2c3a),{'verbose':_0x413542[_0x2681f3(0x1be)]}),_0xa26428=_0x5b501e[_0x2681f3(0x112)];return await withSpinner('Deleting\x20agent...',()=>_0x3a1229['llm'][_0x2681f3(0x10e)](_0xa26428),{'verbose':_0x413542[_0x2681f3(0x1be)]}),console[_0x2681f3(0x1cb)](_0x2681f3(0x118)+_0xa26428),0x0;}catch(_0x134423){return handleSDKError(_0x134423,_0x413542),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a20_0x38cdde(0x110);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x109);async[a20_0x38cdde(0x13c)](_0x3821e7){const _0x50b5d6=a20_0x38cdde;return executeChatHistoryCommand(_0x3821e7,_0x50b5d6(0x13e));}}export class LLMUseCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x15b);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1b6);async[a20_0x38cdde(0x13c)](_0x4b0df5){const _0x291bf7=a20_0x38cdde,{options:_0x2c264d,args:_0x4196a7,tdx:_0x4bd244}=_0x4b0df5;if(_0x4196a7[_0x291bf7(0x124)]===0x0)return console[_0x291bf7(0x1cd)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x291bf7(0x12a)),0x1;const _0x4e5caf=_0x4196a7[0x0];try{return await withSpinner(_0x291bf7(0x122)+_0x4e5caf+_0x291bf7(0x143),()=>_0x4bd244[_0x291bf7(0x131)][_0x291bf7(0x169)](_0x4e5caf),{'verbose':_0x2c264d['verbose']}),console[_0x291bf7(0x1cb)](_0x291bf7(0x1e0)+_0x4e5caf),0x0;}catch(_0x34548f){return handleSDKError(_0x34548f,_0x2c264d),0x1;}}}function a20_0x216c(){const _0x533810=['createdAt','A\x20project\x20named\x20\x27','.llm','map','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','__load_more__','Restore\x20cancelled.','tdx\x20chats','Delete\x20an\x20LLM\x20project','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','\x27\x20already\x20exists.\x20Overwrite?','temperature','llm:agent:update','claude-4.5-haiku','No\x20projects\x20found','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','48288CYupSm','filter','find','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','Resolving\x20project\x20\x27','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','string','set','resolveProjectId','Use\x20format:\x20project-name/agent-name','llm:agent:show','tool','Validating\x20backup\x20from\x20\x27','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','web','createProject','split','chatId','Creating\x20agent\x20\x27','\x20agent(s)','Set\x20current\x20project\x20context','Error:\x20Agent\x20name\x20is\x20required','prompts','integrations','Project\x20restored:\x20','localeCompare','No\x20agents\x20found','toLocaleDateString','verbose','llm:project:create','toLowerCase','\x20->\x20WebSearch:','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','targetAgent','[tool_call]','\x0aCancelled','Project\x20deleted:\x20','get','[content]','Restoring\x20project\x20from\x20\x27','targetImageGenerator','log','Agent\x20updated:\x20','error','...','cyan','yellow','[unknown]','agents','No\x20messages\x20found\x20in\x20chat\x20history.','\x20-\x20','Backing\x20up\x20project\x20\x27','rmSync','Agent\x20created:\x20','\x20\x20Integrations:\x20','json','agent','bold','getTime','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','counts','llm:agents','Project\x20context\x20set\x20to:\x20','keys','18BBAyjJ','outputDir','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','\x20bytes)','Fetching\x20chat\x20sessions...','[output]\x20','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','115887luOXZb','en-US','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','magenta','table','Show\x20agent\x20details','INVALID_ARGUMENT','projects','join','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','LLM_PROJECT_NOT_FOUND','\x20\x20Knowledge\x20Bases:\x20','systemPrompt','\x20->\x20KB:','deleteAgent','Analyzing\x20project\x20\x27','llm:history','[error]\x20\x20','data','\x20\x20Cause:\x20','Creating\x20project\x20\x27','d\x20ago','Fetching\x20agents...','193450OzRBrP','Agent\x20deleted:\x20','Unknown','🤖\x20','21245orOfig','Deleting\x20project\x20\x27','lastConversationAt','knowledgeBases','Fetching\x20chat\x20history\x20for\x20\x27','content','name','Setting\x20project\x20context\x20to\x20\x27','Checking\x20for\x20existing\x20projects...','length','all','tsv','\x20\x20Agents:\x20','image','Updating\x20agent...','Usage:\x20tdx\x20llm\x20use\x20<project-name>','deleteProject','Getting\x20default\x20project...','5zBtGTX','includes','633164EnfhHB','Error:\x20','llm','starterMessage','\x20->\x20Agent:','input','exportedFrom','Usage:\x20','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','sourceSite','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x0aStack\x20trace:','resolveAgentId','execute','model','tdx\x20llm\x20history','Update\x20an\x20existing\x20agent','last','[image]\x20\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x27...','format','default','\x20→\x20chat:\x20','Create\x20a\x20new\x20LLM\x20project','m\x20ago','models','Create\x20a\x20new\x20agent\x20in\x20current\x20project','description','List\x20agents\x20in\x20current\x20project','jsonl','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Delete\x20an\x20agent','history','entries','slice','h\x20ago','llm:project:restore','Project\x20created:\x20','message','createAgent','attributes','stack','llm:use','just\x20now','select','targetWebSearchTool','cause','Fetching\x20projects...','\x20\x20Prompts:\x20','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','(no\x20agent)','chats','tool_call','backupProject','push','setCurrentProject','Project\x20backed\x20up\x20to:\x20','maxToolIterations','Invalid\x20path\x20syntax:\x20','getOrCreateDefaultProject','substring','site','stringify','llm:projects','dryRun','(no\x20message)','llm:agent:create','restoreProject','floor','Fetching\x20available\x20models...','targetKnowledgeBase','Select\x20a\x20chat\x20session:','9910OjyoAg','prompt','Resolving\x20agent\x20\x27','green','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','projectName','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','getBackupMetadata','projectId','existsSync','1771248FWiywM','output','No\x20chat\x20sessions\x20found.','limit','Load\x20more...','⚒️\x20','Error:\x20Backup\x20folder\x20path\x20is\x20required','agentId','198sAbbkB','dim','\x20\x20\x20Examples:','updatedAt'];a20_0x216c=function(){return _0x533810;};return a20_0x216c();}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x1bf);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x147);async[a20_0x38cdde(0x13c)](_0x54528e){const _0x3787c3=a20_0x38cdde,{options:_0x5c5d2d,args:_0xe9207b,tdx:_0x49b336}=_0x54528e;if(_0xe9207b[_0x3787c3(0x124)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x3787c3(0x1cd)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x555351=_0xe9207b[0x0],_0xbcc1f0=_0x5c5d2d,_0x50e4ba=_0xbcc1f0[_0x3787c3(0x14b)];try{const _0x506537=await withSpinner(_0x3787c3(0x114)+_0x555351+_0x3787c3(0x143),()=>_0x49b336[_0x3787c3(0x131)][_0x3787c3(0x1b1)]({'name':_0x555351,'description':_0x50e4ba}),{'verbose':_0x5c5d2d[_0x3787c3(0x1be)]});console[_0x3787c3(0x1cb)](_0x3787c3(0x156)+_0x506537[_0x3787c3(0x112)]['id']);const _0x4c3c40=toLLMProjectInfo(_0x506537[_0x3787c3(0x112)]);return await handleSDKOutput([_0x4c3c40],_0x5c5d2d),0x0;}catch(_0x3bd8a5){return handleSDKError(_0x3bd8a5,_0x5c5d2d),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x38cdde(0x121)]='llm:project:delete';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x198);async['execute'](_0xfe2a56){const _0x230e4e=a20_0x38cdde,{options:_0x50bb12,args:_0x227006,tdx:_0x51ebec}=_0xfe2a56;if(_0x227006[_0x230e4e(0x124)]===0x0)return console[_0x230e4e(0x1cd)](_0x230e4e(0x1ae)),console[_0x230e4e(0x1cd)](_0x230e4e(0x163)),0x1;const _0x2c013c=_0x227006[0x0];try{return await withSpinner(_0x230e4e(0x11c)+_0x2c013c+_0x230e4e(0x143),()=>_0x51ebec[_0x230e4e(0x131)][_0x230e4e(0x12b)](_0x2c013c),{'verbose':_0x50bb12[_0x230e4e(0x1be)]}),console[_0x230e4e(0x1cb)](_0x230e4e(0x1c6)+_0x2c013c),0x0;}catch(_0x32bb98){return handleSDKError(_0x32bb98,_0x50bb12),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x38cdde(0x121)]='llm:project:backup';[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1a4);async[a20_0x38cdde(0x13c)](_0x29f9d7){const _0x4a869e=a20_0x38cdde,{options:_0x31a55a,args:_0x20a2c9,tdx:_0x2335cf}=_0x29f9d7,_0x46adf7=getChalk(_0x31a55a);console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x1d0)](_0x4a869e(0x180))),console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x1d0)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x4a869e(0x1cb)](_0x46adf7[_0x4a869e(0x18d)]('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console[_0x4a869e(0x1cb)]();if(_0x20a2c9[_0x4a869e(0x124)]===0x0)return console[_0x4a869e(0x1cd)](_0x4a869e(0x1ae)),console['error'](_0x4a869e(0x1af)),0x1;const _0x135326=_0x20a2c9[0x0],_0x4cf6a9=_0x31a55a,_0x1bf435=_0x4cf6a9[_0x4a869e(0x185)],_0x4af889=_0x4cf6a9['dryRun'];try{const _0x5596b0=_0x1bf435||_0x135326+_0x4a869e(0x192);if(a20_0x170174[_0x4a869e(0x183)](_0x5596b0)&&!_0x4af889){if(!_0x31a55a['yes']){const _0x51e760=await confirm('Output\x20directory\x20\x27'+_0x5596b0+_0x4a869e(0x19b));if(!_0x51e760)return console[_0x4a869e(0x1cb)]('Backup\x20cancelled.'),0x0;}a20_0x170174[_0x4a869e(0x1d6)](_0x5596b0,{'recursive':!![]});}const _0x3040b6=await withSpinner(_0x4af889?_0x4a869e(0x10f)+_0x135326+'\x27...':_0x4a869e(0x1d5)+_0x135326+_0x4a869e(0x143),()=>_0x2335cf[_0x4a869e(0x131)][_0x4a869e(0x167)](_0x135326,_0x1bf435,{'dryRun':_0x4af889}),{'verbose':_0x31a55a[_0x4a869e(0x1be)]}),_0x44fcd9=_0x3040b6[_0x4a869e(0x112)];return _0x4af889?console[_0x4a869e(0x1cb)](_0x4a869e(0x194)+_0x44fcd9['outputDir']):console[_0x4a869e(0x1cb)](_0x4a869e(0x16a)+_0x44fcd9[_0x4a869e(0x1e3)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x127)+_0x44fcd9['counts'][_0x4a869e(0x1d2)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x10b)+_0x44fcd9[_0x4a869e(0x1de)]['knowledgeBases']),console['log'](_0x4a869e(0x161)+_0x44fcd9['counts'][_0x4a869e(0x1b8)]),console[_0x4a869e(0x1cb)](_0x4a869e(0x1d8)+_0x44fcd9[_0x4a869e(0x1de)][_0x4a869e(0x1b9)]),(_0x31a55a[_0x4a869e(0x144)]==='json'||_0x31a55a['format']===_0x4a869e(0x14d))&&await handleSDKOutput([_0x44fcd9],_0x31a55a),0x0;}catch(_0x1e4f02){return handleSDKError(_0x1e4f02,_0x31a55a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x155);['description']=a20_0x38cdde(0x137);async[a20_0x38cdde(0x13c)](_0x4ec218){const _0x217696=a20_0x38cdde,{options:_0x43bbc8,args:_0x580962,tdx:_0x4145bd}=_0x4ec218,_0x1ce71a=getChalk(_0x43bbc8);console[_0x217696(0x1cb)](_0x1ce71a['yellow'](_0x217696(0x19a))),console[_0x217696(0x1cb)](_0x1ce71a[_0x217696(0x1d0)](_0x217696(0x1dd))),console[_0x217696(0x1cb)](_0x1ce71a['dim'](_0x217696(0x18e))),console['log'](_0x1ce71a[_0x217696(0x18d)]('\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/')),console[_0x217696(0x1cb)](_0x1ce71a['dim'](_0x217696(0x1e4))),console[_0x217696(0x1cb)]();if(_0x580962['length']===0x0)return console['error'](_0x217696(0x18a)),console['error'](_0x217696(0x199)),0x1;const _0x1ec762=_0x580962[0x0],_0x23e317=_0x43bbc8,_0x59068c=_0x23e317[_0x217696(0x121)],_0x540631=_0x23e317[_0x217696(0x172)];try{if(!_0x540631){const _0x3d210f=_0x4145bd['llm'][_0x217696(0x181)](_0x1ec762),_0x38e2cc=_0x59068c||_0x3d210f[_0x217696(0x135)][_0x217696(0x17f)],_0x25c35e=await withSpinner(_0x217696(0x123),()=>_0x4145bd[_0x217696(0x131)][_0x217696(0x1f0)](),{'verbose':_0x43bbc8['verbose']}),_0xa4262a=_0x25c35e['data'][_0x217696(0x1a3)](_0x3e9112=>_0x3e9112['attributes'][_0x217696(0x121)]===_0x38e2cc);if(_0xa4262a&&!_0x43bbc8['yes']){const _0x24f141=await confirm(_0x217696(0x191)+_0x38e2cc+_0x217696(0x162));if(!_0x24f141)return console[_0x217696(0x1cb)](_0x217696(0x196)),0x0;}}const _0x3aed49=await withSpinner(_0x540631?_0x217696(0x1ad)+_0x1ec762+_0x217696(0x143):_0x217696(0x1c9)+_0x1ec762+'\x27...',()=>_0x4145bd[_0x217696(0x131)][_0x217696(0x175)](_0x1ec762,{'name':_0x59068c,'dryRun':_0x540631}),{'verbose':_0x43bbc8[_0x217696(0x1be)]}),_0x1e1600=_0x3aed49[_0x217696(0x112)];return _0x1e1600[_0x217696(0x138)]&&console[_0x217696(0x1cb)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x1e1600[_0x217696(0x138)]+'\x27'),_0x540631?console[_0x217696(0x1cb)](_0x217696(0x14f)+_0x1e1600[_0x217696(0x17f)]):console[_0x217696(0x1cb)](_0x217696(0x1ba)+_0x1e1600[_0x217696(0x17f)]+'\x20('+_0x1e1600[_0x217696(0x182)]+')'),console[_0x217696(0x1cb)](_0x217696(0x127)+_0x1e1600['counts'][_0x217696(0x1d2)]),console[_0x217696(0x1cb)](_0x217696(0x10b)+_0x1e1600[_0x217696(0x1de)][_0x217696(0x11e)]),console[_0x217696(0x1cb)](_0x217696(0x161)+_0x1e1600['counts']['prompts']),console[_0x217696(0x1cb)](_0x217696(0x1d8)+_0x1e1600[_0x217696(0x1de)]['integrations']),(_0x43bbc8['format']===_0x217696(0x1d9)||_0x43bbc8[_0x217696(0x144)]===_0x217696(0x14d))&&await handleSDKOutput([_0x1e1600],_0x43bbc8),0x0;}catch(_0x55b662){return handleSDKError(_0x55b662,_0x43bbc8),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x234115,_0x5bd5ea){const _0x647071=a20_0x38cdde,_0x3f1ce9=_0x5bd5ea[_0x647071(0x187)]||CHAT_SELECTOR_PAGE_SIZE;let _0x5a14f2=0x0,_0x25a2be=[];const _0x94be93=(await import(_0x647071(0x1b8)))[_0x647071(0x145)],_0x1b0a03=getChalk(_0x5bd5ea);while(!![]){const _0x4bade3=await withSpinner(_0x647071(0x1e6),()=>_0x234115[_0x647071(0x131)][_0x647071(0x165)](_0x3f1ce9+_0x5a14f2),{'verbose':_0x5bd5ea[_0x647071(0x1be)]});_0x25a2be=_0x4bade3['data'];const _0x30a81f=_0x25a2be[_0x647071(0x153)](_0x5a14f2,_0x5a14f2+_0x3f1ce9),_0x5980be=_0x25a2be[_0x647071(0x124)]>_0x5a14f2+_0x3f1ce9,_0xe5ea1f=[...new Set(_0x30a81f[_0x647071(0x193)](_0x4e765f=>_0x4e765f[_0x647071(0x159)][_0x647071(0x18b)])['filter'](_0x40b443=>_0x40b443!==undefined))],_0x107347=new Map();await Promise[_0x647071(0x125)](_0xe5ea1f['map'](async _0x4705ea=>{const _0x3bb1ac=_0x647071;try{const _0x28f9c4=await _0x234115[_0x3bb1ac(0x131)][_0x3bb1ac(0x1da)](_0x4705ea);_0x107347[_0x3bb1ac(0x1a8)](_0x4705ea,_0x28f9c4[_0x3bb1ac(0x159)][_0x3bb1ac(0x121)]);}catch{_0x107347['set'](_0x4705ea,_0x4705ea);}}));const _0x3bdf4a=_0x30a81f[_0x647071(0x193)](_0x1f6d06=>{const _0x1ebde0=_0x647071,_0x14053f=_0x1f6d06[_0x1ebde0(0x159)]['firstInputContent']||_0x1ebde0(0x173),_0x32b7b8=_0x14053f[_0x1ebde0(0x1b2)]('\x0a')[0x0],_0x372ef5=_0x32b7b8['length']>0x50?_0x32b7b8[_0x1ebde0(0x16e)](0x0,0x4d)+_0x1ebde0(0x1ce):_0x32b7b8,_0x2d8c79=_0x1f6d06['attributes'][_0x1ebde0(0x18b)]?_0x107347[_0x1ebde0(0x1c7)](_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18b)])||_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18b)]:_0x1ebde0(0x164),_0x415ac=_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x11d)]||_0x1f6d06[_0x1ebde0(0x159)][_0x1ebde0(0x18f)],_0xd6bee7=new Date(_0x415ac),_0x3fe778=new Date(),_0x36ae05=_0x3fe778[_0x1ebde0(0x1dc)]()-_0xd6bee7[_0x1ebde0(0x1dc)](),_0x8fae6d=Math[_0x1ebde0(0x176)](_0x36ae05/0xea60),_0x3a3d2f=Math[_0x1ebde0(0x176)](_0x36ae05/0x36ee80),_0x3ed301=Math[_0x1ebde0(0x176)](_0x36ae05/0x5265c00);let _0x2b60f1;if(_0x8fae6d<0x1)_0x2b60f1=_0x1ebde0(0x15c);else{if(_0x8fae6d<0x3c)_0x2b60f1=_0x8fae6d+_0x1ebde0(0x148);else{if(_0x3a3d2f<0x18)_0x2b60f1=_0x3a3d2f+_0x1ebde0(0x154);else _0x3ed301<0x7?_0x2b60f1=_0x3ed301+_0x1ebde0(0x115):_0x2b60f1=_0xd6bee7[_0x1ebde0(0x1bd)](_0x1ebde0(0x1ea),{'month':'short','day':'numeric'});}}return{'title':_0x372ef5+'\x20'+_0x1b0a03['dim']('['+_0x2d8c79+']\x20'+_0x2b60f1),'value':_0x1f6d06['id']};});_0x5980be&&_0x3bdf4a[_0x647071(0x168)]({'title':_0x1b0a03[_0x647071(0x1cf)](_0x647071(0x188)),'value':_0x647071(0x195)});const _0x5ec6c3=await _0x94be93({'type':_0x647071(0x15d),'name':_0x647071(0x1b3),'message':_0x647071(0x179),'choices':_0x3bdf4a,'hint':_0x647071(0x1c2)});if(!_0x5ec6c3[_0x647071(0x1b3)])return undefined;if(_0x5ec6c3[_0x647071(0x1b3)]===_0x647071(0x195)){_0x5a14f2+=_0x3f1ce9;continue;}return _0x5ec6c3[_0x647071(0x1b3)];}}function a20_0x2d6f(_0x162537,_0x32f3e5){_0x162537=_0x162537-0x109;const _0x216c5f=a20_0x216c();let _0x2d6f87=_0x216c5f[_0x162537];return _0x2d6f87;}export class ChatsCommand extends BaseCommand{[a20_0x38cdde(0x121)]=a20_0x38cdde(0x165);[a20_0x38cdde(0x14b)]=a20_0x38cdde(0x1eb);async[a20_0x38cdde(0x13c)](_0x21ac8a){const _0x5389e5=a20_0x38cdde;return executeChatHistoryCommand(_0x21ac8a,_0x5389e5(0x197));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x1df827=a21_0x276b;(function(_0x4d0383,_0x2014b9){const _0x4c662f=a21_0x276b,_0x1a647c=_0x4d0383();while(!![]){try{const _0x30b146=parseInt(_0x4c662f(0x1b2))/0x1*(-parseInt(_0x4c662f(0x1ae))/0x2)+-parseInt(_0x4c662f(0x199))/0x3+parseInt(_0x4c662f(0x195))/0x4+parseInt(_0x4c662f(0x1be))/0x5*(-parseInt(_0x4c662f(0x196))/0x6)+-parseInt(_0x4c662f(0x1b5))/0x7+-parseInt(_0x4c662f(0x189))/0x8*(-parseInt(_0x4c662f(0x1a1))/0x9)+parseInt(_0x4c662f(0x1c2))/0xa;if(_0x30b146===_0x2014b9)break;else _0x1a647c['push'](_0x1a647c['shift']());}catch(_0x2427f9){_0x1a647c['push'](_0x1a647c['shift']());}}}(a21_0x34b7,0x509b6));function a21_0x34b7(){const _0x51ec2d=['Port\x20','\x27\x20not\x20found','site','project','675qYjHer','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','Project\x20\x27','NOT_FOUND','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','bold','llm','http://0.0.0.0:','port','Server\x20Configuration:','Resolving\x20project...','\x20\x20\x20\x20}','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','430nRZCNB','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','\x20\x20}','\x20\x20Address:','958lebXyG','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','4161290XhefhU','\x0aTesting\x20with\x20Agent\x20SDK:','init','description','exit','SIGINT','Starting\x20proxy\x20server...','\x20\x20Site:','SIGTERM','1760YaliEd','cyan','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','16900900YhtQaZ','✓\x20Proxy\x20server\x20stopped','\x20\x20\x20\x20\x22env\x22:\x20{','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','server','attributes','\x20\x20{','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','39272RfamDE','yellow','llmProject','green','white','\x0aClaude\x20Code\x20Configuration:','\x20\x20Agents:','find','logger','close','name','start','10220WnBOOv','11244FAriWY','projects','dim','811698DcvRqO','stop','execute','log'];a21_0x34b7=function(){return _0x51ec2d;};return a21_0x34b7();}import a21_0x5a29a2 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';function a21_0x276b(_0x4bf820,_0x2ea38b){_0x4bf820=_0x4bf820-0x188;const _0x34b73e=a21_0x34b7();let _0x276b47=_0x34b73e[_0x4bf820];return _0x276b47;}async function getProjectIdOrDefault(_0x3a8e5f,_0x107a94){const _0x230564=a21_0x276b,{tdx:_0x2fcfd3,options:_0xc0d45b}=_0x3a8e5f,_0x472766=_0x107a94||_0xc0d45b[_0x230564(0x18b)];if(_0x472766){const _0x35bb9b=await _0x2fcfd3[_0x230564(0x1a7)][_0x230564(0x197)](),_0x585544=_0x35bb9b[_0x230564(0x190)](_0x80db4e=>_0x80db4e[_0x230564(0x1c7)][_0x230564(0x193)]===_0x472766);if(!_0x585544)throw new SDKError(ErrorCode[_0x230564(0x1a4)],_0x230564(0x1a3)+_0x472766+_0x230564(0x19e),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x585544['id'];}const _0x35d39f=await _0x2fcfd3['llm']['getOrCreateDefaultProject']();return _0x35d39f['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x1df827(0x193)]='llm:proxy';[a21_0x1df827(0x1b8)]=a21_0x1df827(0x1a2);['server'];[a21_0x1df827(0x191)];async[a21_0x1df827(0x19b)](_0x5e8cc6){const _0x430078=a21_0x1df827,{tdx:_0x3fcc78,options:_0x31d28a}=_0x5e8cc6;try{const _0x15b9e8=_0x31d28a,_0x324e95=_0x15b9e8[_0x430078(0x1a9)]||0xfa0,_0x238cb3=_0x15b9e8[_0x430078(0x1a0)],_0x32d3f5=await findAvailablePort(_0x324e95);console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1ab)));const _0x7d1bd2=await getProjectIdOrDefault(_0x5e8cc6,_0x238cb3),_0x3789b6=await _0x3fcc78[_0x430078(0x1a7)]['projects'](),_0x568655=_0x3789b6['find'](_0x33f548=>_0x33f548['id']===_0x7d1bd2);this[_0x430078(0x191)]=new TDXLogger(_0x31d28a['logLevel']),await this[_0x430078(0x191)][_0x430078(0x1b7)](),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1bb)));_0x32d3f5!==_0x324e95&&console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)](_0x430078(0x19d)+_0x324e95+'\x20is\x20unavailable,\x20using\x20port\x20'+_0x32d3f5));this['server']=new ProxyServer({'port':_0x32d3f5,'projectId':_0x7d1bd2,'tdx':_0x3fcc78,'logger':this['logger'],'site':_0x31d28a['site']}),await this[_0x430078(0x1c6)][_0x430078(0x194)](),console['log'](a21_0x5a29a2[_0x430078(0x18a)][_0x430078(0x1a6)](_0x430078(0x188))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)](_0x430078(0x1c5))),console[_0x430078(0x19c)](a21_0x5a29a2['yellow'](_0x430078(0x1c0))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18c)][_0x430078(0x1a6)](_0x430078(0x1b4))),console['log'](a21_0x5a29a2[_0x430078(0x1bf)](_0x430078(0x1aa))),console['log'](a21_0x5a29a2['dim'](_0x430078(0x1b1)),a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1a8)+_0x32d3f5)),console[_0x430078(0x19c)](a21_0x5a29a2['dim']('\x20\x20Project:'),a21_0x5a29a2[_0x430078(0x18d)](_0x568655?.['attributes']['name']||_0x7d1bd2)),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x18f)),a21_0x5a29a2['white']('created\x20on-demand\x20per\x20model')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1bc)),a21_0x5a29a2[_0x430078(0x18d)](_0x31d28a[_0x430078(0x19f)])),console['log'](a21_0x5a29a2[_0x430078(0x1bf)](_0x430078(0x18e))),console[_0x430078(0x19c)](a21_0x5a29a2['dim'](_0x430078(0x1ad))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1c8))),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1c4))),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1a5)+_0x32d3f5+'\x22,')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22')),console['log'](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1ac))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18d)](_0x430078(0x1b0))),console[_0x430078(0x19c)](a21_0x5a29a2['cyan'](_0x430078(0x1b6))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1b3))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)](_0x430078(0x1af))),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x198)]('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console[_0x430078(0x19c)](a21_0x5a29a2[_0x430078(0x18a)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x174dca=async()=>{const _0x1e6bae=_0x430078;console[_0x1e6bae(0x19c)](a21_0x5a29a2['dim'](_0x1e6bae(0x1c1))),this[_0x1e6bae(0x1c6)]&&await this[_0x1e6bae(0x1c6)]['stop'](),this[_0x1e6bae(0x191)]&&await this[_0x1e6bae(0x191)][_0x1e6bae(0x192)](),console['log'](a21_0x5a29a2[_0x1e6bae(0x18c)](_0x1e6bae(0x1c3))),process[_0x1e6bae(0x1b9)](0x0);};return process['on'](_0x430078(0x1ba),_0x174dca),process['on'](_0x430078(0x1bd),_0x174dca),await new Promise(()=>{}),0x0;}catch(_0x4f6a64){this[_0x430078(0x1c6)]&&await this['server'][_0x430078(0x19a)]();this[_0x430078(0x191)]&&await this['logger'][_0x430078(0x192)]();throw _0x4f6a64;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x31c158=a22_0x1b47;(function(_0x52812e,_0x173a8d){const _0x27e758=a22_0x1b47,_0x39acc3=_0x52812e();while(!![]){try{const _0x317c28=parseInt(_0x27e758(0x1b3))/0x1+-parseInt(_0x27e758(0x27f))/0x2*(-parseInt(_0x27e758(0x247))/0x3)+parseInt(_0x27e758(0x18e))/0x4*(-parseInt(_0x27e758(0x1a2))/0x5)+-parseInt(_0x27e758(0x21e))/0x6+-parseInt(_0x27e758(0x1ca))/0x7*(-parseInt(_0x27e758(0x1bb))/0x8)+-parseInt(_0x27e758(0x1c2))/0x9+parseInt(_0x27e758(0x1e8))/0xa*(parseInt(_0x27e758(0x22d))/0xb);if(_0x317c28===_0x173a8d)break;else _0x39acc3['push'](_0x39acc3['shift']());}catch(_0x58beef){_0x39acc3['push'](_0x39acc3['shift']());}}}(a22_0x43be,0x35a33));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x178d01 from'path';function a22_0x1b47(_0x28d228,_0x4fa295){_0x28d228=_0x28d228-0x150;const _0x43be83=a22_0x43be();let _0x1b476a=_0x43be83[_0x28d228];return _0x1b476a;}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';function a22_0x43be(){const _0x128e6b=['\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','1875843NeGJTO','resolveParentId','-1d','segment:parent:update','segment:parent:create','Get\x20SQL\x20query\x20for\x20parent\x20segment','Executing\x20parent\x20segment\x20query...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','7IFNUUw','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','segment:parent:push','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Apply\x20changes\x20to\x20\x27','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','behaviors','segment','timezone','Resolving\x20parent\x20segment\x20\x27','errors','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Source:','unref','population','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Preview:','workflowAttemptId','To\x20view\x20sample\x20data:','Master:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','utf-8','customersWithEvents','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x0a⚠️\x20\x20Both\x20','getParentSQL','Error:\x20--behavior\x20requires\x20a\x20name\x0a','20HQIAOM','Listing\x20fields\x20for\x20\x27','session','Creating','platform','customerGroupFile','segment:parent:list','toLocaleString','\x20--attribute\x20\x22','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','pushParentYaml','Updating','coveragePercent','length','/attempt/','Listing\x20parent\x20segments...','/app/workflows/','segment:parent:show','segment:parent:desc','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','error','segment:parent:fields','run','\x0aChanges\x20to\x20\x27','displaySummary','Fetching\x20current\x20configuration\x20for\x20\x27','Create\x20parent\x20segment\x20\x27','Rows:','Status:','✔\x20Created\x20parent\x20segment\x20\x27','Created','localeCompare','\x20[Job\x20ID:\x20','addBehaviorsFile','%)\x20','schemaValid','message','master','\x20parent\x20segment\x20\x27','\x0aNew\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','matchedCount','repeat','runParent','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Creating\x20parent\x20segment\x20\x27','segment:parent:pull','description','workflowSessionId','all','double','yellow','2557968AgjiHj','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displayAttributesStats','\x20=\x20','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','name','behavior','test','\x20tdx\x20wf\x20attempt\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Query\x20completed:\x20Processed\x20','json','3181321XTiRYY','win32','Columns:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','cyan','scheduleType','Site:\x20','sampleData','replace','\x27\x20and\x20run\x20workflow?','Error\x20parsing\x20YAML:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Validate:','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Attributes','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','`\x20to\x20download\x20the\x20configuration\x20first','createParent','table','allValid','interval','✔\x20No\x20changes\x20-\x20\x27','foreignKey','\x20Opening\x20','execute','606741DagplP','Enriched:','\x27...','jsonl','Master\x20Table','tdx\x20segment\x20parent\x20preview\x20','\x20--behavior\x20\x22','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','elapsedTimeMillis','join','enriched','updateParent','\x20--interval\x20','Analyzing\x20changes...','Error:','yes','joinKey','Output\x20file:\x20','.yml','Events:','No\x20parent\x20segments\x20found','Session:','displayColumns','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','/{name}.yml\x0a','Options:','limit','displaySampleData','attributes','previewParentYaml','open','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','columns','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Join\x20on:','stats','attributesFile','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','pullParentYaml','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','👥\x20','/\x20directory.\x0a','toFixed','Fetching\x20parent\x20segment\x20\x27','database','Updated','trim','Coverage:','segment:parent:run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','bold','dim','customerGroup','stop','2KGxrzU','\x20\x20\x20\x20-\x20','.yaml','Options\x20(one\x20required):\x0a','red','darwin','site','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Error\x20reading\x20file:\x20','Available\x20behaviors:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Fetching\x20sample\x20data...','label','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','parent_segment','format','audienceId','sort','xdg-open','status','totalEvents','scheduleOption','column','isDirectory','customerPercent','\x20No\x20changes\x20-\x20','List\x20available\x20fields\x20for\x20segmentation','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','varchar','green','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','setJobId','segment:parent:sql','List\x20parent\x20segments','displayMasterInfo','listParents','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20Context\x20set:\x20','schemaError','map','\x27\x20is\x20up\x20to\x20date','Available\x20attributes:','Aborted.','Error:\x20--database\x20and\x20--table\x20are\x20required','processedRows','/\x20→\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','data','endsWith','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Customers:','Validating\x20configuration...','query','ignore','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','output','addAttributes','displayPreviewResults','jobId','attribute','in\x20','using\x20the\x20default\x20path:\x20','segment:parent:preview','verbose','keys','956320tBJQEe','\x20kill','use','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Join:','Attempt:','\x20rows)','number','dirname','\x0aChanges\x20to\x20apply\x20to\x20\x27','string','Attribute:','/sessions/','Audience\x20ID:','Listing\x20parent\x20segments\x20matching\x20\x27','start','✔\x20Found\x20','Parent\x20segment:\x20','5umXkZr','Errors:','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','YAML\x20file:\x20','log','\x20is\x20already\x20up\x20to\x20date','displayPreviewHints','SQL\x20query:\x0a','\x0a✔\x20Workflow\x20started','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','To\x20cancel:','getParentFull','/\x20directories\x20exist.','Name:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','displayBehaviorsStats','127019SQzOsr','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','/app/dw/parentSegments/','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x27\x20is\x20already\x20up\x20to\x20date','Show\x20parent\x20segment\x20details','Table:\x20','1486768YBbtBk','text','Options:\x0a','apply','Fetching\x20SQL\x20for\x20\x27','displayValidateResults'];a22_0x43be=function(){return _0x128e6b;};return a22_0x43be();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x46c484 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x90b589){const _0x1eac77=a22_0x1b47,_0x221ae3=process[_0x1eac77(0x1ec)],_0x72578a=_0x221ae3===_0x1eac77(0x152)?_0x1eac77(0x265):_0x221ae3===_0x1eac77(0x22e)?'start':_0x1eac77(0x15f);spawn(_0x72578a,[_0x90b589],{'detached':!![],'stdio':_0x1eac77(0x182)})[_0x1eac77(0x1d9)]();}function migrateLegacyDirectory(){const _0x740725=a22_0x1b47;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x5a69e0=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x5a69e0[_0x740725(0x164)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a22_0x46c484['yellow'](_0x740725(0x1e5)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x740725(0x1ae))),console[_0x740725(0x1fc)](a22_0x46c484['dim'](_0x740725(0x26c)+LEGACY_PARENT_SEGMENT_DIR+_0x740725(0x272))),![];console[_0x740725(0x1fc)](a22_0x46c484[_0x740725(0x21d)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x740725(0x17a)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a22_0x46c484[_0x740725(0x16a)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x554131){const _0x387041=_0x554131 instanceof Error?_0x554131['message']:String(_0x554131);return console[_0x740725(0x1fc)](a22_0x46c484[_0x740725(0x151)](_0x740725(0x26f)+_0x387041+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x31c158(0x1fe)](_0x1ab5f2){const _0x157bdf=a22_0x31c158;return migrateLegacyDirectory(),super[_0x157bdf(0x1fe)](_0x1ab5f2);}}function resolveYamlFile(_0x575da7){const _0x2db92c=a22_0x31c158;if(_0x575da7['endsWith']('.yml')||_0x575da7[_0x2db92c(0x17d)](_0x2db92c(0x281)))return _0x575da7;return a22_0x178d01[_0x2db92c(0x250)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x575da7)+_0x2db92c(0x259));}function formatProgressMessage(_0x323ba0){const _0x4b9f07=a22_0x31c158,_0x2d51e4=_0x323ba0['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2d51e4){const [,_0x1f1e3f,_0x59b78d,_0x485bcf='']=_0x2d51e4;return a22_0x46c484['dim'](_0x1f1e3f+':')+'\x20'+_0x59b78d+a22_0x46c484[_0x4b9f07(0x27c)](_0x485bcf);}return a22_0x46c484['dim'](_0x323ba0);}function showFileNotFoundError(_0x517506,_0x453648){const _0x1e2bbf=a22_0x31c158;console[_0x1e2bbf(0x1fc)](a22_0x46c484[_0x1e2bbf(0x151)]('Error:\x20File\x20not\x20found:\x20'+_0x517506+'\x0a')),console[_0x1e2bbf(0x1fc)](a22_0x46c484['cyan'](_0x1e2bbf(0x1d7)+_0x453648+_0x1e2bbf(0x23e)));}function showParentSegmentNotSetError(_0x52404a){const _0x2a6099=a22_0x31c158;console[_0x2a6099(0x1fc)](a22_0x46c484[_0x2a6099(0x21d)](_0x2a6099(0x154))),console[_0x2a6099(0x1fc)](_0x52404a);}export class ParentSegmentListCommand extends BaseCommand{['name']=a22_0x31c158(0x1ee);[a22_0x31c158(0x219)]=a22_0x31c158(0x16e);async[a22_0x31c158(0x246)](_0x16b9db){const _0x2e8cfb=a22_0x31c158,{options:_0xb44dba,args:_0x140add,tdx:_0x3d9b72}=_0x16b9db,_0x55e608=_0x140add[0x0];_0xb44dba[_0x2e8cfb(0x18c)]&&(console[_0x2e8cfb(0x1fc)](_0x2e8cfb(0x233)+_0xb44dba[_0x2e8cfb(0x153)]),_0x55e608&&console[_0x2e8cfb(0x1fc)]('Pattern:\x20'+_0x55e608));const _0xd500fe=await withSpinner(_0x55e608?_0x2e8cfb(0x19e)+_0x55e608+_0x2e8cfb(0x249):_0x2e8cfb(0x1f7),()=>_0x3d9b72[_0x2e8cfb(0x1d3)][_0x2e8cfb(0x170)](),{'verbose':_0xb44dba[_0x2e8cfb(0x18c)]});let _0x56bb13=_0xd500fe[_0x2e8cfb(0x17c)];if(_0x55e608){const _0x2b3d70=_0x55e608[_0x2e8cfb(0x235)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x2e8cfb(0x235)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x22283a=new RegExp('^'+_0x2b3d70+'$','i');_0x56bb13=_0x56bb13['filter'](_0x5b8ffc=>_0x22283a[_0x2e8cfb(0x228)](_0x5b8ffc[_0x2e8cfb(0x263)][_0x2e8cfb(0x226)]));}_0x56bb13[_0x2e8cfb(0x15e)]((_0x2300dc,_0x4c9e05)=>_0x2300dc[_0x2e8cfb(0x263)][_0x2e8cfb(0x226)][_0x2e8cfb(0x207)](_0x4c9e05[_0x2e8cfb(0x263)][_0x2e8cfb(0x226)])),console[_0x2e8cfb(0x1fc)](_0x2e8cfb(0x1a0)+_0x56bb13['length']+'\x20parent\x20segment'+(_0x56bb13[_0x2e8cfb(0x1f5)]!==0x1?'s':''));if(_0xb44dba[_0x2e8cfb(0x15c)]==='json'||_0xb44dba['format']==='jsonl')await handleSDKOutput(_0x56bb13,_0xb44dba);else{if(_0x56bb13[_0x2e8cfb(0x1f5)]===0x0)_0x55e608?console[_0x2e8cfb(0x1a6)](_0x2e8cfb(0x191)+_0x55e608):console[_0x2e8cfb(0x1a6)](_0x2e8cfb(0x25b));else for(const _0x40fcb6 of _0x56bb13){const _0x241606=_0x40fcb6['attributes'][_0x2e8cfb(0x1da)]?a22_0x46c484[_0x2e8cfb(0x27c)]('\x20('+formatRows(_0x40fcb6[_0x2e8cfb(0x263)]['population'])+')'):'';console['log'](_0x2e8cfb(0x271)+_0x40fcb6[_0x2e8cfb(0x263)]['name']+_0x241606);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x1c6);[a22_0x31c158(0x219)]=a22_0x31c158(0x25e);async['execute'](_0x4b85e1){const _0x270bce=a22_0x31c158,{options:_0xb1cc8b,args:_0x1a630e,tdx:_0xe52273}=_0x4b85e1;console[_0x270bce(0x1fc)](_0x270bce(0x1e0)+_0x270bce(0x1c1)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x17dd89=_0xb1cc8b;if(_0x1a630e['length']===0x0)return console['error'](a22_0x46c484[_0x270bce(0x151)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error'](_0x270bce(0x16b)),0x1;const _0x4c37c8=_0x1a630e[0x0];if(!_0x17dd89[_0x270bce(0x275)]||!_0x17dd89[_0x270bce(0x240)])return console[_0x270bce(0x1fc)](_0x270bce(0x178)),console['error'](_0x270bce(0x16b)),0x1;_0x17dd89[_0x270bce(0x18c)]&&(console[_0x270bce(0x1fc)](_0x270bce(0x233)+_0x17dd89[_0x270bce(0x153)]),console[_0x270bce(0x1fc)](_0x270bce(0x1af)+_0x4c37c8),console[_0x270bce(0x1fc)]('Database:\x20'+_0x17dd89[_0x270bce(0x275)]),console['error'](_0x270bce(0x1ba)+_0x17dd89[_0x270bce(0x240)]));const _0xcbe80=await loadJSONFromOptions(_0x17dd89[_0x270bce(0x263)],_0x17dd89[_0x270bce(0x26b)]),_0x940ed0=await loadJSONFromOptions(_0x17dd89['behaviors'],_0x17dd89['behaviorsFile']),_0x2b9f34=await loadJSONFromOptions(_0x17dd89['customerGroup'],_0x17dd89[_0x270bce(0x1ed)]),_0x243f6b={'name':_0x4c37c8,'description':_0x17dd89['description'],'scheduleType':_0x17dd89[_0x270bce(0x232)],'scheduleOption':_0x17dd89[_0x270bce(0x162)],'timezone':_0x17dd89[_0x270bce(0x1d4)],'master':{'parentDatabaseName':_0x17dd89[_0x270bce(0x275)],'parentTableName':_0x17dd89[_0x270bce(0x240)]},'attributes':_0xcbe80,'behaviors':_0x940ed0,'customerGroup':_0x2b9f34},_0x33b20f=await withSpinner(_0x270bce(0x217)+_0x4c37c8+_0x270bce(0x249),()=>_0xe52273[_0x270bce(0x1d3)][_0x270bce(0x23f)](_0x243f6b),{'verbose':_0xb1cc8b[_0x270bce(0x18c)]}),_0x3ab254=_0x33b20f[_0x270bce(0x17c)];return console[_0x270bce(0x1fc)](_0x270bce(0x205)+_0x3ab254['name']+_0x270bce(0x215)+_0x3ab254['id']),await handleSDKOutput([_0x3ab254],_0xb1cc8b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x1c5);[a22_0x31c158(0x219)]=a22_0x31c158(0x1cb);async[a22_0x31c158(0x246)](_0x54520d){const _0x35c4e4=a22_0x31c158,{options:_0x4dbb24,args:_0x40d03f,tdx:_0x579d40}=_0x54520d;console[_0x35c4e4(0x1fc)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x35c4e4(0x1c1)+_0x35c4e4(0x225));const _0x17874f=_0x4dbb24;if(_0x40d03f[_0x35c4e4(0x1f5)]===0x0)return console[_0x35c4e4(0x1fc)](a22_0x46c484[_0x35c4e4(0x151)](_0x35c4e4(0x22a))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x4a274b=_0x40d03f[0x0];_0x17874f[_0x35c4e4(0x18c)]&&(console['error'](_0x35c4e4(0x233)+_0x17874f['site']),console[_0x35c4e4(0x1fc)](_0x35c4e4(0x1a1)+_0x4a274b));const _0x554fc4=await withSpinner(_0x35c4e4(0x201)+_0x4a274b+_0x35c4e4(0x249),()=>_0x579d40[_0x35c4e4(0x1d3)][_0x35c4e4(0x1ad)](_0x4a274b),{'verbose':_0x17874f[_0x35c4e4(0x18c)]}),_0x5b8dea=_0x554fc4[_0x35c4e4(0x17c)],_0x5501e1=await loadJSONFromOptions(_0x17874f[_0x35c4e4(0x185)],_0x17874f['addAttributesFile']),_0x4b056d=await loadJSONFromOptions(_0x17874f['addBehaviors'],_0x17874f[_0x35c4e4(0x209)]),_0x5789ad={'name':_0x5b8dea[_0x35c4e4(0x226)],'description':_0x17874f[_0x35c4e4(0x219)]!==undefined?_0x17874f[_0x35c4e4(0x219)]:_0x5b8dea['description'],'scheduleType':_0x17874f[_0x35c4e4(0x232)]!==undefined?_0x17874f[_0x35c4e4(0x232)]:_0x5b8dea[_0x35c4e4(0x232)],'scheduleOption':_0x17874f[_0x35c4e4(0x162)]!==undefined?_0x17874f[_0x35c4e4(0x162)]:_0x5b8dea[_0x35c4e4(0x162)],'timezone':_0x17874f[_0x35c4e4(0x1d4)]!==undefined?_0x17874f[_0x35c4e4(0x1d4)]:_0x5b8dea[_0x35c4e4(0x1d4)],'master':_0x5b8dea[_0x35c4e4(0x20d)],'attributes':_0x5501e1?[..._0x5b8dea[_0x35c4e4(0x263)]||[],..._0x5501e1]:_0x5b8dea[_0x35c4e4(0x263)],'behaviors':_0x4b056d?[..._0x5b8dea['behaviors']||[],..._0x4b056d]:_0x5b8dea['behaviors'],'customerGroup':_0x5b8dea[_0x35c4e4(0x27d)]},_0x573025=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x4a274b+_0x35c4e4(0x249),()=>_0x579d40['segment'][_0x35c4e4(0x252)](_0x4a274b,_0x5789ad),{'verbose':_0x17874f['verbose']}),_0x586f3f=_0x573025[_0x35c4e4(0x17c)];return console['error'](_0x35c4e4(0x1b0)+_0x586f3f[_0x35c4e4(0x226)]+'\x27'),await handleSDKOutput([_0x586f3f],_0x17874f),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x218);[a22_0x31c158(0x219)]=a22_0x31c158(0x24e);async[a22_0x31c158(0x246)](_0x576f05){const _0x159a7f=a22_0x31c158,{options:_0x48812d,args:_0x5e0ec7,tdx:_0x581301}=_0x576f05,_0x2005fc=_0x48812d,_0x335161=_0x5e0ec7[0x0]||_0x48812d[_0x159a7f(0x222)];if(!_0x335161)return showParentSegmentNotSetError(_0x159a7f(0x216)+_0x159a7f(0x223)),0x1;if(_0x2005fc[_0x159a7f(0x190)]&&_0x2005fc[_0x159a7f(0x184)])return console['error'](a22_0x46c484['red']('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x159a7f(0x1fc)](a22_0x46c484[_0x159a7f(0x27c)](_0x159a7f(0x1f1))),console['error'](a22_0x46c484[_0x159a7f(0x27c)](_0x159a7f(0x18a)+PARENT_SEGMENT_DIR+_0x159a7f(0x25f))),console[_0x159a7f(0x1fc)](a22_0x46c484[_0x159a7f(0x231)](_0x159a7f(0x230))),0x1;const _0x5f4dc3=_0x2005fc[_0x159a7f(0x184)]||a22_0x178d01['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x335161)+_0x159a7f(0x259));_0x2005fc[_0x159a7f(0x18c)]&&(console['error'](_0x159a7f(0x233)+_0x2005fc[_0x159a7f(0x153)]),console[_0x159a7f(0x1fc)](_0x159a7f(0x1a1)+_0x335161),console[_0x159a7f(0x1fc)](_0x159a7f(0x258)+_0x5f4dc3));const _0x37891e=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x335161+_0x159a7f(0x249),()=>_0x581301[_0x159a7f(0x1d3)][_0x159a7f(0x26e)](_0x335161),{'verbose':_0x2005fc[_0x159a7f(0x18c)]}),_0x5b85d7=_0x37891e[_0x159a7f(0x17c)];if(existsSync(_0x5f4dc3)){const _0x219257=readFileSync(_0x5f4dc3,_0x159a7f(0x1e2)),_0x26fa12=generateDiff(_0x219257,_0x5b85d7);if(!hasChanges(_0x26fa12))console['error'](a22_0x46c484[_0x159a7f(0x16a)]('✔')+_0x159a7f(0x166)+a22_0x46c484['cyan'](_0x5f4dc3)+_0x159a7f(0x1a7));else{console[_0x159a7f(0x1fc)](_0x159a7f(0x1ff)+_0x5f4dc3+'\x27:'),console['error']('─'[_0x159a7f(0x213)](0x3c)),console[_0x159a7f(0x1fc)](formatDiffWithColors(_0x26fa12)),console[_0x159a7f(0x1fc)]('─'['repeat'](0x3c));if(!_0x2005fc[_0x159a7f(0x256)]){const _0x34ba96=await confirmKey('Overwrite\x20\x27'+_0x5f4dc3+'\x27?');if(!_0x34ba96)return console['error']('Aborted.'),0x1;}writeFileSync(_0x5f4dc3,_0x5b85d7,_0x159a7f(0x1e2)),console[_0x159a7f(0x1fc)](a22_0x46c484[_0x159a7f(0x16a)]('✔')+_0x159a7f(0x270)+a22_0x46c484['cyan'](_0x5f4dc3));}}else{const _0x227d3d=a22_0x178d01[_0x159a7f(0x198)](_0x5f4dc3);!existsSync(_0x227d3d)&&mkdirSync(_0x227d3d,{'recursive':!![]}),writeFileSync(_0x5f4dc3,_0x5b85d7,_0x159a7f(0x1e2)),console[_0x159a7f(0x1fc)](a22_0x46c484[_0x159a7f(0x16a)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x46c484[_0x159a7f(0x231)](_0x5f4dc3));}return saveSessionContext({'parent_segment':_0x335161},_0x2005fc[_0x159a7f(0x1ea)]),console[_0x159a7f(0x1fc)](a22_0x46c484[_0x159a7f(0x16a)]('✔')+_0x159a7f(0x172)+a22_0x46c484['dim'](_0x159a7f(0x15b))+_0x159a7f(0x221)+a22_0x46c484[_0x159a7f(0x231)](_0x335161)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a22_0x31c158(0x1cc);[a22_0x31c158(0x219)]=a22_0x31c158(0x1b1);async['execute'](_0x3721f2){const _0x45607d=a22_0x31c158,{options:_0x3abab0,args:_0x2ae4d8,tdx:_0x4aef8f}=_0x3721f2,_0x5ecb9d=_0x3abab0,_0x297a99=_0x2ae4d8[0x0]||_0x3abab0[_0x45607d(0x222)];if(!_0x297a99)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'+_0x45607d(0x224)),0x1;const _0x3ac6d9=resolveYamlFile(_0x297a99);if(!existsSync(_0x3ac6d9))return showFileNotFoundError(_0x3ac6d9,_0x297a99),0x1;_0x5ecb9d['verbose']&&(console['error'](_0x45607d(0x233)+_0x5ecb9d[_0x45607d(0x153)]),console['error'](_0x45607d(0x1a5)+_0x3ac6d9));let _0x37ae9c;try{_0x37ae9c=readFileSync(_0x3ac6d9,'utf-8');}catch(_0x12268c){const _0x4f3ce2=_0x12268c instanceof Error?_0x12268c[_0x45607d(0x20c)]:String(_0x12268c);return console['error'](_0x45607d(0x155)+_0x4f3ce2),0x1;}const _0x5e9350=await withSpinner('Analyzing\x20changes...',()=>_0x4aef8f[_0x45607d(0x1d3)][_0x45607d(0x1f2)](_0x37ae9c),{'verbose':_0x5ecb9d['verbose']}),_0x1fa4f7=_0x5e9350[_0x45607d(0x17c)],{isNew:_0x54fe1f,name:_0x12f247,hasChanges:_0x47196f,diffFormatted:_0x1322c6}=_0x1fa4f7;if(!_0x47196f)return console['error'](_0x45607d(0x243)+_0x12f247+_0x45607d(0x1b8)),0x0;_0x54fe1f?console[_0x45607d(0x1fc)](_0x45607d(0x20f)+_0x12f247+'\x27:'):console[_0x45607d(0x1fc)](_0x45607d(0x199)+_0x12f247+'\x27:');console[_0x45607d(0x1fc)]('─'[_0x45607d(0x213)](0x3c)),console[_0x45607d(0x1fc)](_0x1322c6),console[_0x45607d(0x1fc)]('─'[_0x45607d(0x213)](0x3c));const _0x2ffcdb=_0x54fe1f?_0x45607d(0x202)+_0x12f247+'\x27?':_0x45607d(0x1cf)+_0x12f247+'\x27?';if(!_0x5ecb9d[_0x45607d(0x256)]){const _0x5e791b=await confirmKey(_0x2ffcdb);if(!_0x5e791b)return console['error'](_0x45607d(0x177)),0x1;}const _0x142bfa=_0x54fe1f?_0x45607d(0x1eb):_0x45607d(0x1f3),_0x43503d=await withSpinner(_0x142bfa+_0x45607d(0x20e)+_0x12f247+'\x27...',()=>_0x1fa4f7[_0x45607d(0x1be)](),{'verbose':_0x5ecb9d[_0x45607d(0x18c)]}),_0x560214=_0x43503d['data'],_0x3defdb=getConsoleNextUrl(_0x5ecb9d[_0x45607d(0x153)],_0x45607d(0x1b5)+_0x560214['id']),_0xc86683=_0x54fe1f?_0x45607d(0x206):_0x45607d(0x276);return console[_0x45607d(0x1fc)]('✔\x20'+_0xc86683+_0x45607d(0x20e)+_0x560214['name']+'\x27'),console[_0x45607d(0x1fc)]('\x20\x20'+_0x3defdb),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x31c158(0x226)]='segment:parent:validate';[a22_0x31c158(0x219)]=a22_0x31c158(0x1cd);async[a22_0x31c158(0x246)](_0x1c0a68){const _0x1271dc=a22_0x31c158,{options:_0x5dec93,args:_0x4d7220,tdx:_0x4b5e3a}=_0x1c0a68,_0x23c334=_0x5dec93,_0x31ea9c=_0x4d7220[0x0]||_0x5dec93[_0x1271dc(0x222)];if(!_0x31ea9c)return showParentSegmentNotSetError(_0x1271dc(0x23d)+_0x1271dc(0x168)+_0x1271dc(0x1bd)+_0x1271dc(0x1b6)+_0x1271dc(0x17b)+_0x1271dc(0x211)),0x1;const _0x15a74c=resolveYamlFile(_0x31ea9c);if(!existsSync(_0x15a74c))return showFileNotFoundError(_0x15a74c,_0x31ea9c),0x1;_0x23c334[_0x1271dc(0x18c)]&&(console['error'](_0x1271dc(0x233)+_0x23c334[_0x1271dc(0x153)]),console[_0x1271dc(0x1fc)](_0x1271dc(0x1a5)+_0x15a74c));let _0x374985;try{_0x374985=readFileSync(_0x15a74c,'utf-8');}catch(_0x4d363a){const _0x551aee=_0x4d363a instanceof Error?_0x4d363a[_0x1271dc(0x20c)]:String(_0x4d363a);return console[_0x1271dc(0x1fc)](_0x1271dc(0x155)+_0x551aee),0x1;}const _0x1ca807=createCommandSpinner(a22_0x46c484['dim'](_0x1271dc(0x180)),{'verbose':_0x23c334[_0x1271dc(0x18c)]});_0x1ca807[_0x1271dc(0x19f)]();const _0x1f39a9={'onProgress':_0x4d5325=>{const _0x4957b4=_0x1271dc;_0x1ca807[_0x4957b4(0x1bc)]=formatProgressMessage(_0x4d5325);}};if(_0x23c334['master'])_0x1f39a9['master']=!![];if(_0x23c334[_0x1271dc(0x251)])_0x1f39a9['enriched']=!![];_0x23c334[_0x1271dc(0x188)]&&(_0x1f39a9[_0x1271dc(0x188)]=_0x23c334[_0x1271dc(0x188)]);_0x23c334[_0x1271dc(0x227)]&&(_0x1f39a9[_0x1271dc(0x227)]=_0x23c334[_0x1271dc(0x227)]);if(_0x23c334[_0x1271dc(0x242)])_0x1f39a9[_0x1271dc(0x242)]=_0x23c334[_0x1271dc(0x242)];let _0x5db820;try{_0x5db820=await _0x4b5e3a['segment']['validateParentYaml'](_0x374985,_0x1f39a9),_0x1ca807[_0x1271dc(0x27e)]();}catch(_0x271206){_0x1ca807[_0x1271dc(0x27e)]();throw _0x271206;}const _0x365fef=_0x23c334[_0x1271dc(0x242)]||_0x1271dc(0x1c4);return this[_0x1271dc(0x1c0)](_0x5db820,_0x1f39a9,_0x15a74c,_0x365fef),_0x5db820[_0x1271dc(0x241)]?0x0:0x1;}[a22_0x31c158(0x1c0)](_0xa22fdc,_0x325515,_0x54717b,_0x161499){const _0x42751f=a22_0x31c158;console[_0x42751f(0x1fc)]('\x0a'+a22_0x46c484['bold'](_0x42751f(0x23a))+'\x20'+_0xa22fdc[_0x42751f(0x226)]),console[_0x42751f(0x1fc)]('═'['repeat'](0x3c)),this[_0x42751f(0x16f)](_0xa22fdc);if(typeof _0x325515[_0x42751f(0x188)]===_0x42751f(0x19a)){this[_0x42751f(0x220)](_0xa22fdc),this[_0x42751f(0x200)](_0xa22fdc),this[_0x42751f(0x1a8)](_0x54717b,_0x161499,_0x42751f(0x188),_0x325515[_0x42751f(0x188)]);return;}if(_0x325515['attribute']===!![]){this[_0x42751f(0x220)](_0xa22fdc),this[_0x42751f(0x200)](_0xa22fdc),this['displayPreviewHints'](_0x54717b,_0x161499,_0x42751f(0x263));return;}if(typeof _0x325515['behavior']===_0x42751f(0x19a)){this[_0x42751f(0x1b2)](_0xa22fdc,_0x161499),this[_0x42751f(0x200)](_0xa22fdc),this[_0x42751f(0x1a8)](_0x54717b,_0x161499,_0x42751f(0x227),_0x325515['behavior']);return;}if(_0x325515['behavior']===!![]){this['displayBehaviorsStats'](_0xa22fdc,_0x161499),this['displaySummary'](_0xa22fdc),this[_0x42751f(0x1a8)](_0x54717b,_0x161499,_0x42751f(0x1d2));return;}this[_0x42751f(0x220)](_0xa22fdc),this[_0x42751f(0x1b2)](_0xa22fdc,_0x161499),this[_0x42751f(0x200)](_0xa22fdc),this['displayPreviewHints'](_0x54717b,_0x161499,_0x42751f(0x21b));}[a22_0x31c158(0x1a8)](_0x3a2692,_0x21bc55,_0x624a12,_0x48e3da){const _0x316b07=a22_0x31c158;console[_0x316b07(0x1fc)]('\x0a'+a22_0x46c484[_0x316b07(0x27c)](_0x316b07(0x1de)));const _0x53aca3=_0x21bc55!=='-1d'?_0x316b07(0x253)+_0x21bc55:'';if(_0x624a12==='attribute'&&_0x48e3da)console[_0x316b07(0x1fc)]('\x20\x20'+a22_0x46c484[_0x316b07(0x27c)](_0x316b07(0x24c)+_0x3a2692+'\x20--attribute\x20\x22'+_0x48e3da+'\x22'+_0x53aca3));else{if(_0x624a12===_0x316b07(0x227)&&_0x48e3da)console[_0x316b07(0x1fc)]('\x20\x20'+a22_0x46c484[_0x316b07(0x27c)]('tdx\x20segment\x20parent\x20preview\x20'+_0x3a2692+_0x316b07(0x24d)+_0x48e3da+'\x22'+_0x53aca3));else(_0x624a12===_0x316b07(0x263)||_0x624a12===_0x316b07(0x21b))&&console[_0x316b07(0x1fc)]('\x20\x20'+a22_0x46c484['dim'](_0x316b07(0x24c)+_0x3a2692+'\x20--attribute\x20\x22<name>\x22'+_0x53aca3));}(_0x624a12===_0x316b07(0x1d2)||_0x624a12==='all')&&console[_0x316b07(0x1fc)]('\x20\x20'+a22_0x46c484[_0x316b07(0x27c)]('tdx\x20segment\x20parent\x20preview\x20'+_0x3a2692+'\x20--behavior\x20\x22<name>\x22'+_0x53aca3)),_0x624a12===_0x316b07(0x21b)&&console['error']('\x20\x20'+a22_0x46c484['dim'](_0x316b07(0x24c)+_0x3a2692+'\x20--enriched'+_0x53aca3));}[a22_0x31c158(0x16f)](_0xdd8d4f){const _0x281be2=a22_0x31c158,{master:_0x41e39e}=_0xdd8d4f,_0x41e48e=_0x41e39e[_0x281be2(0x20b)]?a22_0x46c484['green']('✔'):a22_0x46c484['red']('✘');console[_0x281be2(0x1fc)]('\x0a'+a22_0x46c484[_0x281be2(0x27c)](_0x281be2(0x24b))),console[_0x281be2(0x1fc)](_0x41e48e+'\x20'+a22_0x46c484[_0x281be2(0x27b)](_0x41e39e['database']+'.'+_0x41e39e[_0x281be2(0x240)])),_0x41e39e[_0x281be2(0x20b)]?_0x41e39e['rowCount']!==undefined&&console[_0x281be2(0x1fc)]('\x20\x20'+a22_0x46c484[_0x281be2(0x27c)](_0x281be2(0x203))+'\x20'+a22_0x46c484[_0x281be2(0x231)](formatRows(_0x41e39e['rowCount']))):console['error']('\x20\x20'+a22_0x46c484[_0x281be2(0x151)](_0x281be2(0x255))+'\x20'+_0x41e39e[_0x281be2(0x173)]);}[a22_0x31c158(0x220)](_0x147da6){const _0x11e977=a22_0x31c158;if(_0x147da6[_0x11e977(0x263)][_0x11e977(0x1f5)]===0x0)return;console[_0x11e977(0x1fc)]('\x0a'+a22_0x46c484[_0x11e977(0x27c)](_0x11e977(0x23c)));for(const _0x42478f of _0x147da6[_0x11e977(0x263)]){const _0x839f9d=_0x42478f[_0x11e977(0x20b)]?a22_0x46c484[_0x11e977(0x16a)]('✔'):a22_0x46c484[_0x11e977(0x151)]('✘');let _0x350bbc='';if(_0x42478f[_0x11e977(0x20b)]&&_0x42478f[_0x11e977(0x212)]!==undefined&&_0x42478f[_0x11e977(0x1f4)]!==undefined){const _0x5da784=_0x42478f['coveragePercent']['toFixed'](0x1),_0x542df3=_0x42478f[_0x11e977(0x1f4)]>=0x50?a22_0x46c484[_0x11e977(0x16a)]:_0x42478f[_0x11e977(0x1f4)]>=0x32?a22_0x46c484[_0x11e977(0x21d)]:a22_0x46c484[_0x11e977(0x151)];_0x350bbc='\x20'+a22_0x46c484['dim'](_0x11e977(0x278))+'\x20'+_0x542df3(_0x5da784+'%')+'\x20('+formatRows(_0x42478f[_0x11e977(0x212)])+_0x11e977(0x196);}console[_0x11e977(0x1fc)](_0x839f9d+'\x20'+a22_0x46c484[_0x11e977(0x27b)](_0x42478f[_0x11e977(0x226)])+_0x350bbc),console[_0x11e977(0x1fc)]('\x20\x20'+a22_0x46c484[_0x11e977(0x27c)](_0x11e977(0x1d8))+'\x20'+a22_0x46c484['bold'](_0x42478f['database']+'.'+_0x42478f[_0x11e977(0x240)]));const _0x1d8439=_0x42478f['joinKey']===_0x42478f[_0x11e977(0x244)]?a22_0x46c484[_0x11e977(0x27c)](_0x11e977(0x269))+'\x20'+_0x42478f['joinKey']:a22_0x46c484[_0x11e977(0x27c)](_0x11e977(0x194))+'\x20'+_0x42478f[_0x11e977(0x257)]+_0x11e977(0x221)+_0x42478f[_0x11e977(0x244)];console[_0x11e977(0x1fc)]('\x20\x20'+_0x1d8439),console['error']('\x20\x20'+a22_0x46c484[_0x11e977(0x27c)](_0x11e977(0x22f))),this['displayColumns'](_0x42478f[_0x11e977(0x267)]),!_0x42478f['schemaValid']&&console[_0x11e977(0x1fc)]('\x20\x20'+a22_0x46c484[_0x11e977(0x151)](_0x11e977(0x255))+'\x20'+_0x42478f[_0x11e977(0x173)]);}}[a22_0x31c158(0x1b2)](_0x59c4e0,_0x5555a0){const _0x52d903=a22_0x31c158;if(_0x59c4e0[_0x52d903(0x1d2)][_0x52d903(0x1f5)]===0x0)return;console['error']('\x0a'+a22_0x46c484['dim']('Behaviors')+'\x20'+a22_0x46c484[_0x52d903(0x27c)]('('+_0x5555a0+')'));for(const _0x7d70b of _0x59c4e0[_0x52d903(0x1d2)]){const _0x100e2a=_0x7d70b[_0x52d903(0x20b)]?a22_0x46c484['green']('✔'):a22_0x46c484['red']('✘');let _0x85562c='';if(_0x7d70b[_0x52d903(0x20b)]&&_0x7d70b[_0x52d903(0x1e3)]!==undefined&&_0x7d70b[_0x52d903(0x161)]!==undefined){const _0x30872c=_0x7d70b[_0x52d903(0x165)]?.[_0x52d903(0x273)](0x1)||'?',_0x438d62=(_0x7d70b[_0x52d903(0x165)]??0x0)>=0x32?a22_0x46c484[_0x52d903(0x16a)]:(_0x7d70b[_0x52d903(0x165)]??0x0)>=0x14?a22_0x46c484['yellow']:a22_0x46c484[_0x52d903(0x151)];_0x85562c='\x20'+a22_0x46c484['dim'](_0x52d903(0x17f))+'\x20'+_0x438d62(formatRows(_0x7d70b[_0x52d903(0x1e3)]))+'\x20('+_0x30872c+_0x52d903(0x20a)+a22_0x46c484[_0x52d903(0x27c)](_0x52d903(0x25a))+'\x20'+a22_0x46c484[_0x52d903(0x231)](formatRows(_0x7d70b[_0x52d903(0x161)]));}console[_0x52d903(0x1fc)](_0x100e2a+'\x20'+a22_0x46c484[_0x52d903(0x27b)](_0x7d70b[_0x52d903(0x226)])+_0x85562c),console['error']('\x20\x20'+a22_0x46c484['dim'](_0x52d903(0x1d8))+'\x20'+a22_0x46c484[_0x52d903(0x27b)](_0x7d70b[_0x52d903(0x275)]+'.'+_0x7d70b[_0x52d903(0x240)]));const _0x32c61d=_0x7d70b['joinKey']===_0x7d70b[_0x52d903(0x244)]?a22_0x46c484[_0x52d903(0x27c)]('Join\x20on:')+'\x20'+_0x7d70b[_0x52d903(0x257)]:a22_0x46c484['dim'](_0x52d903(0x194))+'\x20'+_0x7d70b['joinKey']+'\x20=\x20'+_0x7d70b[_0x52d903(0x244)];console[_0x52d903(0x1fc)]('\x20\x20'+_0x32c61d),console[_0x52d903(0x1fc)]('\x20\x20'+a22_0x46c484[_0x52d903(0x27c)](_0x52d903(0x22f))),this[_0x52d903(0x25d)](_0x7d70b[_0x52d903(0x267)]),!_0x7d70b[_0x52d903(0x20b)]&&console[_0x52d903(0x1fc)]('\x20\x20'+a22_0x46c484[_0x52d903(0x151)](_0x52d903(0x255))+'\x20'+_0x7d70b[_0x52d903(0x173)]);}}[a22_0x31c158(0x25d)](_0x4f9682){const _0x13b24a=a22_0x31c158;for(const _0x5f8222 of _0x4f9682){_0x5f8222[_0x13b24a(0x159)]===_0x5f8222[_0x13b24a(0x163)]||_0x5f8222['column']==='*'?console[_0x13b24a(0x1fc)](_0x13b24a(0x280)+_0x5f8222[_0x13b24a(0x159)]):console['error'](_0x13b24a(0x280)+_0x5f8222[_0x13b24a(0x159)]+'\x20'+a22_0x46c484[_0x13b24a(0x27c)]('('+_0x5f8222[_0x13b24a(0x163)]+')'));}}[a22_0x31c158(0x200)](_0x1893c7){const _0x5933c8=a22_0x31c158;console[_0x5933c8(0x1fc)]('─'[_0x5933c8(0x213)](0x3c));if(_0x1893c7[_0x5933c8(0x1d6)]['length']>0x0){console['error']('\x0a'+a22_0x46c484['red']('Errors:'));for(const _0x33d0c6 of _0x1893c7[_0x5933c8(0x1d6)]){console['error']('\x20\x20'+a22_0x46c484['red']('•')+'\x20'+_0x33d0c6);}}_0x1893c7[_0x5933c8(0x241)]&&console[_0x5933c8(0x1fc)]('\x0a'+a22_0x46c484[_0x5933c8(0x16a)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x18b);[a22_0x31c158(0x219)]=a22_0x31c158(0x1e4);async[a22_0x31c158(0x246)](_0xa01374){const _0xdab0ea=a22_0x31c158,{options:_0xc11da5,args:_0x41d45f,tdx:_0x425a42}=_0xa01374,_0x2d39bc=_0xc11da5,_0x320fb7=_0x41d45f[0x0]||_0xc11da5[_0xdab0ea(0x222)];if(!_0x320fb7)return showParentSegmentNotSetError(_0xdab0ea(0x1fb)+_0xdab0ea(0x21f)+_0xdab0ea(0x150)+_0xdab0ea(0x192)+_0xdab0ea(0x1ce)+_0xdab0ea(0x1c9)+_0xdab0ea(0x1db)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x2d39bc['master']&&!_0x2d39bc[_0xdab0ea(0x188)]&&!_0x2d39bc[_0xdab0ea(0x227)]&&!_0x2d39bc['enriched'])return console['error'](a22_0x46c484[_0xdab0ea(0x151)](_0xdab0ea(0x193))),console['error'](_0xdab0ea(0x1ab)),console[_0xdab0ea(0x1fc)](_0xdab0ea(0x260)),console['error'](_0xdab0ea(0x238)),console['error'](_0xdab0ea(0x157)),console[_0xdab0ea(0x1fc)](_0xdab0ea(0x183)),console[_0xdab0ea(0x1fc)](_0xdab0ea(0x15a)),0x1;const _0x40d5cb=resolveYamlFile(_0x320fb7);if(!existsSync(_0x40d5cb))return showFileNotFoundError(_0x40d5cb,_0x320fb7),0x1;_0x2d39bc[_0xdab0ea(0x18c)]&&(console[_0xdab0ea(0x1fc)](_0xdab0ea(0x233)+_0x2d39bc[_0xdab0ea(0x153)]),console[_0xdab0ea(0x1fc)](_0xdab0ea(0x1a5)+_0x40d5cb));let _0x4018e6;try{_0x4018e6=readFileSync(_0x40d5cb,_0xdab0ea(0x1e2));}catch(_0x1579c5){const _0x2e3319=_0x1579c5 instanceof Error?_0x1579c5[_0xdab0ea(0x20c)]:String(_0x1579c5);return console[_0xdab0ea(0x1fc)](_0xdab0ea(0x155)+_0x2e3319),0x1;}let _0x301839;try{_0x301839=parseDef(_0x4018e6);}catch(_0x163c01){const _0x5340b8=_0x163c01 instanceof Error?_0x163c01[_0xdab0ea(0x20c)]:String(_0x163c01);return console['error'](a22_0x46c484[_0xdab0ea(0x151)](_0xdab0ea(0x237)+_0x5340b8)),0x1;}if(_0x2d39bc[_0xdab0ea(0x188)]===!![]||_0x2d39bc['attribute']===''){const _0x5d82ac=_0x301839['attributes']?.[_0xdab0ea(0x174)](_0x64fb00=>_0x64fb00[_0xdab0ea(0x226)])||[];if(_0x5d82ac['length']===0x0)console[_0xdab0ea(0x1fc)](a22_0x46c484[_0xdab0ea(0x151)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0xdab0ea(0x1fc)](a22_0x46c484[_0xdab0ea(0x151)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error'](_0xdab0ea(0x176));for(const _0x5748f7 of _0x5d82ac){console[_0xdab0ea(0x1fc)]('\x20\x20'+a22_0x46c484[_0xdab0ea(0x231)](_0x5748f7));}console[_0xdab0ea(0x1fc)](_0xdab0ea(0x1b7)+_0x320fb7+_0xdab0ea(0x1f0)+_0x5d82ac[0x0]+'\x22');}return 0x1;}if(_0x2d39bc['behavior']===!![]||_0x2d39bc['behavior']===''){const _0x5c8dc1=_0x301839['behaviors']?.[_0xdab0ea(0x174)](_0x487bc1=>_0x487bc1['name'])||[];if(_0x5c8dc1[_0xdab0ea(0x1f5)]===0x0)console[_0xdab0ea(0x1fc)](a22_0x46c484[_0xdab0ea(0x151)](_0xdab0ea(0x266)));else{console[_0xdab0ea(0x1fc)](a22_0x46c484[_0xdab0ea(0x151)](_0xdab0ea(0x1e7))),console[_0xdab0ea(0x1fc)](_0xdab0ea(0x156));for(const _0x1b7cf2 of _0x5c8dc1){console[_0xdab0ea(0x1fc)]('\x20\x20'+a22_0x46c484[_0xdab0ea(0x231)](_0x1b7cf2));}console[_0xdab0ea(0x1fc)](_0xdab0ea(0x1b7)+_0x320fb7+_0xdab0ea(0x24d)+_0x5c8dc1[0x0]+'\x22');}return 0x1;}const _0x4657fe=createCommandSpinner(a22_0x46c484[_0xdab0ea(0x27c)](_0xdab0ea(0x158)),{'verbose':_0x2d39bc['verbose']});_0x4657fe[_0xdab0ea(0x19f)]();const _0x360a64={'onProgress':_0x2e4fdb=>{const _0x4ba956=_0xdab0ea;_0x4657fe[_0x4ba956(0x1bc)]=formatProgressMessage(_0x2e4fdb);}};if(_0x2d39bc[_0xdab0ea(0x20d)])_0x360a64[_0xdab0ea(0x20d)]=!![];if(_0x2d39bc[_0xdab0ea(0x188)]&&typeof _0x2d39bc['attribute']===_0xdab0ea(0x19a))_0x360a64['attribute']=_0x2d39bc['attribute'];if(_0x2d39bc[_0xdab0ea(0x227)]&&typeof _0x2d39bc['behavior']===_0xdab0ea(0x19a))_0x360a64[_0xdab0ea(0x227)]=_0x2d39bc[_0xdab0ea(0x227)];if(_0x2d39bc[_0xdab0ea(0x251)])_0x360a64[_0xdab0ea(0x251)]=!![];if(_0x2d39bc[_0xdab0ea(0x242)])_0x360a64[_0xdab0ea(0x242)]=_0x2d39bc[_0xdab0ea(0x242)];let _0x4c1102;try{_0x4c1102=await _0x425a42[_0xdab0ea(0x1d3)][_0xdab0ea(0x264)](_0x4018e6,_0x360a64),_0x4657fe['stop']();}catch(_0x5d1852){_0x4657fe[_0xdab0ea(0x27e)]();throw _0x5d1852;}return await this[_0xdab0ea(0x186)](_0x4c1102,{'master':_0x2d39bc[_0xdab0ea(0x20d)],'attribute':typeof _0x2d39bc[_0xdab0ea(0x188)]===_0xdab0ea(0x19a)?_0x2d39bc[_0xdab0ea(0x188)]:undefined,'behavior':typeof _0x2d39bc['behavior']===_0xdab0ea(0x19a)?_0x2d39bc['behavior']:undefined,'enriched':_0x2d39bc['enriched']}),_0x4c1102[_0xdab0ea(0x241)]?0x0:0x1;}async[a22_0x31c158(0x186)](_0x5da626,_0x52831d){const _0x4d9b73=a22_0x31c158;console['error']('\x0a'+a22_0x46c484['bold'](_0x4d9b73(0x1dc))+'\x20'+_0x5da626[_0x4d9b73(0x226)]),console[_0x4d9b73(0x1fc)]('═'['repeat'](0x3c));if(_0x52831d[_0x4d9b73(0x20d)]&&_0x5da626[_0x4d9b73(0x234)]){const _0x46d374=a22_0x46c484['dim'](_0x4d9b73(0x1df))+'\x20'+a22_0x46c484[_0x4d9b73(0x27b)](_0x5da626[_0x4d9b73(0x20d)][_0x4d9b73(0x275)]+'.'+_0x5da626['master'][_0x4d9b73(0x240)]);await this[_0x4d9b73(0x262)](_0x46d374,_0x5da626[_0x4d9b73(0x234)]);}else{if(_0x52831d[_0x4d9b73(0x188)]&&_0x5da626['sampleData']){const _0x4247c8=a22_0x46c484['dim'](_0x4d9b73(0x19b))+'\x20'+a22_0x46c484['bold'](_0x52831d[_0x4d9b73(0x188)]);await this[_0x4d9b73(0x262)](_0x4247c8,_0x5da626['sampleData']);}else{if(_0x52831d[_0x4d9b73(0x227)]&&_0x5da626[_0x4d9b73(0x234)]){const _0x24bdc0=a22_0x46c484[_0x4d9b73(0x27c)]('Behavior:')+'\x20'+a22_0x46c484[_0x4d9b73(0x27b)](_0x52831d[_0x4d9b73(0x227)]);await this[_0x4d9b73(0x262)](_0x24bdc0,_0x5da626['sampleData']);}else{if(_0x52831d[_0x4d9b73(0x251)]&&_0x5da626['sampleData']){const _0x43ab59=a22_0x46c484['dim'](_0x4d9b73(0x248))+'\x20'+a22_0x46c484[_0x4d9b73(0x27b)]('Master\x20+\x20Attributes');await this[_0x4d9b73(0x262)](_0x43ab59,_0x5da626[_0x4d9b73(0x234)]);}else!_0x5da626[_0x4d9b73(0x234)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x5da626['errors']['length']>0x0){console[_0x4d9b73(0x1fc)]('─'[_0x4d9b73(0x213)](0x3c)),console[_0x4d9b73(0x1fc)]('\x0a'+a22_0x46c484[_0x4d9b73(0x151)](_0x4d9b73(0x1a3)));for(const _0x1e52e3 of _0x5da626[_0x4d9b73(0x1d6)]){console[_0x4d9b73(0x1fc)]('\x20\x20'+a22_0x46c484[_0x4d9b73(0x151)]('•')+'\x20'+_0x1e52e3);}}}async['displaySampleData'](_0x552f5c,_0xb68f77){const _0x15272b=a22_0x31c158;if(_0xb68f77['length']===0x0){console[_0x15272b(0x1fc)]('\x0a'+_0x552f5c),console[_0x15272b(0x1fc)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x15272b(0x1fc)]('\x0a'+_0x552f5c);const _0x3ac481=Object[_0x15272b(0x18d)](_0xb68f77[0x0])[_0x15272b(0x174)](_0xca204f=>({'name':_0xca204f,'type':typeof _0xb68f77[0x0][_0xca204f]===_0x15272b(0x197)?_0x15272b(0x21c):_0x15272b(0x169)})),_0x189d98={'queryId':'preview','columns':_0x3ac481,'data':_0xb68f77,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xb68f77['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3a2915=formatAsTable(_0x189d98,_0xb68f77[_0x15272b(0x1f5)],!![]);await writeOutput(_0x3a2915,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x279);[a22_0x31c158(0x219)]=a22_0x31c158(0x26d);async[a22_0x31c158(0x246)](_0x2f0075){const _0x4b4461=a22_0x31c158,{options:_0x5abdc0,args:_0x14adc3,tdx:_0x175b76}=_0x2f0075,_0x49aed1=_0x5abdc0,_0x472035=_0x14adc3[0x0]||_0x5abdc0['parentSegment'];if(!_0x472035)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'+_0x4b4461(0x239)),0x1;const _0x2a73d5=resolveYamlFile(_0x472035);if(existsSync(_0x2a73d5)){_0x49aed1[_0x4b4461(0x18c)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x2a73d5);let _0x36b528;try{_0x36b528=readFileSync(_0x2a73d5,'utf-8');}catch(_0x37b853){const _0x4b5dca=_0x37b853 instanceof Error?_0x37b853['message']:String(_0x37b853);return console[_0x4b4461(0x1fc)]('Error\x20reading\x20file:\x20'+_0x4b5dca),0x1;}const _0x2da5b8=await withSpinner(_0x4b4461(0x254),()=>_0x175b76[_0x4b4461(0x1d3)][_0x4b4461(0x1f2)](_0x36b528),{'verbose':_0x49aed1['verbose']}),_0x4ea0e3=_0x2da5b8[_0x4b4461(0x17c)],{isNew:_0x510c1b,name:_0x9f985b,hasChanges:_0x39395a,diffFormatted:_0x15ad69}=_0x4ea0e3;if(_0x39395a){_0x510c1b?console[_0x4b4461(0x1fc)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x9f985b+'\x27:'):console['error'](_0x4b4461(0x199)+_0x9f985b+'\x27:');console[_0x4b4461(0x1fc)]('─'[_0x4b4461(0x213)](0x3c)),console[_0x4b4461(0x1fc)](_0x15ad69),console[_0x4b4461(0x1fc)]('─'[_0x4b4461(0x213)](0x3c));const _0x4b20c9=_0x510c1b?'Create\x20parent\x20segment\x20\x27'+_0x9f985b+_0x4b4461(0x236):_0x4b4461(0x1cf)+_0x9f985b+_0x4b4461(0x236);if(!_0x49aed1[_0x4b4461(0x256)]){const _0x1727d6=await confirmKey(_0x4b20c9);if(!_0x1727d6)return console[_0x4b4461(0x1fc)]('Aborted.'),0x1;}const _0x4303e8=_0x510c1b?_0x4b4461(0x1eb):_0x4b4461(0x1f3);await withSpinner(_0x4303e8+_0x4b4461(0x20e)+_0x9f985b+_0x4b4461(0x249),()=>_0x4ea0e3[_0x4b4461(0x1be)](),{'verbose':_0x49aed1[_0x4b4461(0x18c)]});const _0x1afe4c=_0x510c1b?_0x4b4461(0x206):_0x4b4461(0x276);console[_0x4b4461(0x1fc)]('✔\x20'+_0x1afe4c+_0x4b4461(0x20e)+_0x9f985b+'\x27');}else console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x9f985b+_0x4b4461(0x175));}const _0x574b2b=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x472035+_0x4b4461(0x249),()=>_0x175b76['segment'][_0x4b4461(0x214)](_0x472035),{'verbose':_0x49aed1['verbose']}),_0xa2d819=_0x574b2b[_0x4b4461(0x17c)],_0x1900ab=getConsoleUrl(_0x49aed1[_0x4b4461(0x153)],_0x4b4461(0x1f8)+_0xa2d819['workflowId']+_0x4b4461(0x19c)+_0xa2d819[_0x4b4461(0x21a)]+_0x4b4461(0x1f6)+_0xa2d819['workflowAttemptId']);return console['error'](_0x4b4461(0x1aa)),console['error']('\x20\x20'+a22_0x46c484[_0x4b4461(0x27c)](_0x4b4461(0x19d))+'\x20'+_0xa2d819[_0x4b4461(0x15d)]),console[_0x4b4461(0x1fc)]('\x20\x20'+a22_0x46c484['dim'](_0x4b4461(0x204))+'\x20'+_0xa2d819[_0x4b4461(0x160)]),console[_0x4b4461(0x1fc)]('\x20\x20'+a22_0x46c484[_0x4b4461(0x27c)](_0x4b4461(0x25c))+'\x20'+_0xa2d819[_0x4b4461(0x21a)]),console[_0x4b4461(0x1fc)]('\x20\x20'+a22_0x46c484['dim'](_0x4b4461(0x195))+'\x20'+_0xa2d819[_0x4b4461(0x1dd)]),console['error']('\x20\x20'+_0x1900ab),console['error']('\x0a'+a22_0x46c484['dim'](_0x4b4461(0x1ac))+_0x4b4461(0x229)+_0xa2d819['workflowAttemptId']+_0x4b4461(0x18f)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x1fd);[a22_0x31c158(0x219)]=a22_0x31c158(0x167);async[a22_0x31c158(0x246)](_0x1bbd13){const _0x7e7917=a22_0x31c158,{options:_0x1f62fd,args:_0x294301,tdx:_0x1c0250}=_0x1bbd13,_0x556e8c=_0x294301[0x0]||_0x1f62fd[_0x7e7917(0x222)];if(!_0x556e8c)return showParentSegmentNotSetError(_0x7e7917(0x23b)+'\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;_0x1f62fd['verbose']&&(console[_0x7e7917(0x1fc)](_0x7e7917(0x233)+_0x1f62fd[_0x7e7917(0x153)]),console[_0x7e7917(0x1fc)]('Parent\x20segment:\x20'+_0x556e8c));const _0x5ddac3=await withSpinner(_0x7e7917(0x1e9)+_0x556e8c+_0x7e7917(0x249),()=>_0x1c0250[_0x7e7917(0x1d3)]['listFields'](_0x556e8c),{'verbose':_0x1f62fd[_0x7e7917(0x18c)]}),_0x437ad0=_0x5ddac3['data'];console[_0x7e7917(0x1fc)](_0x7e7917(0x1a0)+_0x437ad0[_0x7e7917(0x1f5)]+'\x20field'+(_0x437ad0[_0x7e7917(0x1f5)]!==0x1?'s':''));if(_0x1f62fd[_0x7e7917(0x22c)]||_0x1f62fd[_0x7e7917(0x24a)])return await handleSDKOutput(_0x437ad0,_0x1f62fd),0x0;return displayFieldsHumanReadable(_0x437ad0,_0x556e8c),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x31c158(0x226)]='segment:parent:view';[a22_0x31c158(0x219)]=a22_0x31c158(0x1b9);async[a22_0x31c158(0x246)](_0x4e2b2f){const _0x1a767b=a22_0x31c158,{options:_0x4f3ac7,args:_0x2c59a9,tdx:_0x3505f7}=_0x4e2b2f,_0x39e2c5=_0x4f3ac7,_0x421fa8=_0x2c59a9[0x0]||_0x4f3ac7['parentSegment'];if(!_0x421fa8)return showParentSegmentNotSetError(_0x1a767b(0x17e)+_0x1a767b(0x1e1)+'Options:\x0a'+_0x1a767b(0x1a4)),0x1;_0x4f3ac7[_0x1a767b(0x18c)]&&(console[_0x1a767b(0x1fc)](_0x1a767b(0x233)+_0x4f3ac7[_0x1a767b(0x153)]),console['error'](_0x1a767b(0x1a1)+_0x421fa8));const _0x122b29=await withSpinner(_0x1a767b(0x274)+_0x421fa8+_0x1a767b(0x249),()=>_0x3505f7[_0x1a767b(0x1d3)][_0x1a767b(0x1ad)](_0x421fa8),{'verbose':_0x4f3ac7[_0x1a767b(0x18c)]}),_0x15ce3f=_0x122b29[_0x1a767b(0x17c)];if(_0x39e2c5['web']){const _0x390d52=getConsoleNextUrl(_0x39e2c5['site'],'/app/dw/parentSegments/'+_0x15ce3f['id']);return console[_0x1a767b(0x1fc)](a22_0x46c484['green']('✔')+_0x1a767b(0x245)+a22_0x46c484[_0x1a767b(0x231)](_0x390d52)),openBrowser(_0x390d52),0x0;}return await handleSingleObjectOutput(_0x15ce3f,_0x4f3ac7),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a22_0x31c158(0x1fa);['description']=a22_0x31c158(0x268);async['execute'](_0x1395b8){const _0x1492aa=a22_0x31c158,{options:_0x1993e6,args:_0x126be2,tdx:_0x3c65eb}=_0x1395b8,_0x31afb9=_0x126be2[0x0]||_0x1993e6[_0x1492aa(0x222)];if(!_0x31afb9)return showParentSegmentNotSetError(_0x1492aa(0x1d0)+_0x1492aa(0x210)),0x1;_0x1993e6[_0x1492aa(0x18c)]&&(console[_0x1492aa(0x1fc)](_0x1492aa(0x233)+_0x1993e6['site']),console[_0x1492aa(0x1fc)]('Parent\x20segment:\x20'+_0x31afb9));const _0x1c97c8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31afb9+'\x27...',()=>_0x3c65eb[_0x1492aa(0x1d3)][_0x1492aa(0x1c3)](_0x31afb9),{'verbose':_0x1993e6[_0x1492aa(0x18c)]}),_0x5db12c=_0x1c97c8['data'],_0x59d222=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x31afb9+_0x1492aa(0x249),()=>_0x3c65eb['segment'][_0x1492aa(0x1e6)](_0x5db12c),{'verbose':_0x1993e6[_0x1492aa(0x18c)]}),_0x429de9=await executeSchemaQuery(_0x59d222[_0x1492aa(0x17c)],_0x3c65eb,_0x1993e6);return await handleQueryOutput(_0x429de9,_0x1993e6),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x16d);[a22_0x31c158(0x219)]=a22_0x31c158(0x1c7);async[a22_0x31c158(0x246)](_0xd3257a){const _0x32bce2=a22_0x31c158,{options:_0x99ef4,args:_0x5e051b,tdx:_0x3dfbc6}=_0xd3257a,_0x765fa6=_0x5e051b[0x0]||_0x99ef4[_0x32bce2(0x222)];if(!_0x765fa6)return showParentSegmentNotSetError(_0x32bce2(0x171)+_0x32bce2(0x27a)),0x1;_0x99ef4[_0x32bce2(0x18c)]&&(console[_0x32bce2(0x1fc)](_0x32bce2(0x233)+_0x99ef4[_0x32bce2(0x153)]),console['error']('Parent\x20segment:\x20'+_0x765fa6));const _0x161470=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x765fa6+_0x32bce2(0x249),()=>_0x3dfbc6['segment'][_0x32bce2(0x1c3)](_0x765fa6),{'verbose':_0x99ef4[_0x32bce2(0x18c)]}),_0x579a08=_0x161470['data'],_0x5aa0a0=await withSpinner(_0x32bce2(0x1bf)+_0x765fa6+_0x32bce2(0x249),()=>_0x3dfbc6['segment'][_0x32bce2(0x1e6)](_0x579a08),{'verbose':_0x99ef4['verbose']}),_0x4c8240=_0x5aa0a0['data'];return _0x99ef4[_0x32bce2(0x15c)]===_0x32bce2(0x22c)||_0x99ef4['format']===_0x32bce2(0x24a)?await handleSDKOutput([{'sql':_0x4c8240}],_0x99ef4):console['log'](_0x4c8240),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x31c158(0x226)]=a22_0x31c158(0x1f9);[a22_0x31c158(0x219)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a22_0x31c158(0x246)](_0x2abbcb){const _0x26328b=a22_0x31c158,{options:_0x24248e,args:_0x59afdc,tdx:_0x81e593}=_0x2abbcb,_0x10b4ab=_0x59afdc[0x0]||_0x24248e[_0x26328b(0x222)];if(!_0x10b4ab)return showParentSegmentNotSetError(_0x26328b(0x1b4)+_0x26328b(0x1d1)),0x1;_0x24248e['verbose']&&(console[_0x26328b(0x1fc)]('Site:\x20'+_0x24248e[_0x26328b(0x153)]),console['error']('Parent\x20segment:\x20'+_0x10b4ab));const _0x5a8152=await withSpinner(_0x26328b(0x1d5)+_0x10b4ab+_0x26328b(0x249),()=>_0x81e593['segment'][_0x26328b(0x1c3)](_0x10b4ab),{'verbose':_0x24248e[_0x26328b(0x18c)]}),_0x465f77=_0x5a8152[_0x26328b(0x17c)],_0x3b46b2=await withSpinner(_0x26328b(0x1bf)+_0x10b4ab+_0x26328b(0x249),()=>_0x81e593[_0x26328b(0x1d3)]['getParentSQL'](_0x465f77),{'verbose':_0x24248e['verbose']});let _0x1b6a09=_0x3b46b2[_0x26328b(0x17c)];const _0x397059=resolveLimit(_0x24248e[_0x26328b(0x261)],DEFAULT_DISPLAY_LIMIT),_0xfbdaba=/\bLIMIT\s+\d+/i[_0x26328b(0x228)](_0x1b6a09);!_0xfbdaba&&(_0x1b6a09=_0x1b6a09[_0x26328b(0x277)]()['replace'](/;+$/,''),_0x1b6a09='SELECT\x20*\x20FROM\x20(\x0a'+_0x1b6a09+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x397059);_0x24248e['verbose']&&console[_0x26328b(0x1fc)](_0x26328b(0x1a9)+_0x1b6a09);const _0x2b68b7=await withProgressSpinner(_0x26328b(0x1c8),async _0x2394a2=>{const _0x5e77a3=_0x26328b,_0x334a55=await _0x81e593[_0x5e77a3(0x181)][_0x5e77a3(0x246)](_0x1b6a09,{'catalog':'td','schema':'information_schema','onJobId':_0x3b7165=>{const _0xe2a535=_0x5e77a3;_0x2394a2[_0xe2a535(0x16c)](_0x3b7165);}});return _0x334a55;},{'verbose':_0x24248e[_0x26328b(0x18c)]}),_0x391bed=_0x2b68b7['data'],_0x4c59c9=_0x391bed[_0x26328b(0x187)]?_0x26328b(0x208)+_0x391bed[_0x26328b(0x187)]+']':'';return console[_0x26328b(0x1fc)](_0x26328b(0x22b)+_0x391bed['stats'][_0x26328b(0x179)][_0x26328b(0x1ef)]()+'\x20rows\x20'+(_0x26328b(0x189)+formatElapsed(_0x391bed[_0x26328b(0x26a)][_0x26328b(0x24f)])+_0x4c59c9)),await handleQueryOutput(_0x391bed,_0x24248e),0x0;}}
|
|
1
|
+
const a22_0x22549a=a22_0x4ac6;(function(_0x1ccf30,_0x2fb6ad){const _0x31df45=a22_0x4ac6,_0x5a1209=_0x1ccf30();while(!![]){try{const _0x4c91e2=parseInt(_0x31df45(0x260))/0x1*(-parseInt(_0x31df45(0x216))/0x2)+parseInt(_0x31df45(0x286))/0x3+parseInt(_0x31df45(0x177))/0x4+parseInt(_0x31df45(0x28d))/0x5*(parseInt(_0x31df45(0x17f))/0x6)+parseInt(_0x31df45(0x19c))/0x7*(-parseInt(_0x31df45(0x22a))/0x8)+-parseInt(_0x31df45(0x244))/0x9+-parseInt(_0x31df45(0x1d5))/0xa*(-parseInt(_0x31df45(0x1b9))/0xb);if(_0x4c91e2===_0x2fb6ad)break;else _0x5a1209['push'](_0x5a1209['shift']());}catch(_0x66fc84){_0x5a1209['push'](_0x5a1209['shift']());}}}(a22_0x1a89,0x49c7b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x39ae17 from'path';function a22_0x4ac6(_0x2d6db6,_0x5c412c){_0x2d6db6=_0x2d6db6-0x16d;const _0x1a89f1=a22_0x1a89();let _0x4ac6a0=_0x1a89f1[_0x2d6db6];return _0x4ac6a0;}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a22_0x1a89(){const _0x1452f=['Fetching\x20parent\x20segment\x20\x27','coveragePercent','Options\x20(one\x20required):\x0a','\x5c$&','\x20\x20No\x20sample\x20data\x20available','allValid','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','label','Updating','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20parent\x20segment\x20\x27','Master\x20+\x20Attributes','rowCount','cyan','\x20Opening\x20','Events:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','apply','Validating\x20configuration...','schemaError','segment:parent:run','red','.yml','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','13332tjEVgn','unref','customerPercent','information_schema','table','\x20parent\x20segment','\x0a⚠️\x20\x20Both\x20','name','Created','\x20--enriched','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Output\x20file:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','parent_segment','Fetching\x20current\x20configuration\x20for\x20\x27','filter','\x20Configuration\x20is\x20valid','start','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Available\x20attributes:','interval','length','Apply\x20changes\x20to\x20\x27','\x20--behavior\x20\x22<name>\x22','780njoUet','customerGroup','SELECT\x20*\x20FROM\x20(\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Fetching\x20SQL\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','log','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','message','Create\x20parent\x20segment\x20\x27','ignore','preview','Join:','attributesFile','output','enriched','segment:parent:push','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','timezone','description','Error\x20reading\x20file:\x20','/\x20and\x20','Preview:','Enriched:','workflowId','green','Master\x20Table','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','test','verbose','string','bold','behaviorsFile','scheduleType','match','errors','\x20rows\x20','attribute','getParentFull','stop','/\x20directories\x20exist.','\x20--behavior\x20\x22','totalEvents','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Renamed\x20directory\x20to\x20','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','✔\x20Updated\x20parent\x20segment\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','database','Listing\x20parent\x20segments...','Analyzing\x20changes...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerGroupFile','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','addBehaviors','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:validate','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SQL\x20query:\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','keys','parentSegment','displaySampleData','236AGouDd','status','trim','Creating','Rows:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','segment:parent:view','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:','No\x20parent\x20segments\x20match\x20pattern:\x20','Resolving\x20parent\x20segment\x20\x27','scheduleOption','json','Found\x20YAML\x20file:\x20','Show\x20parent\x20segment\x20details','Attributes','\x0a⚠️\x20\x20Migrating:\x20','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','format','customersWithEvents','32QDUbfl','error','\x20is\x20already\x20up\x20to\x20date','schemaValid','master','win32','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','createParent','\x0a✔\x20Workflow\x20started','site','localeCompare','displayPreviewHints','query','To\x20cancel:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','👥\x20','Executing\x20parent\x20segment\x20query...','/sessions/','Updated','getParentSQL','replace','toFixed','\x0aNo\x20sample\x20data\x20available','run','setJobId','YAML\x20file:\x20','4781853Vglxaq','pushParentYaml','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','.yaml','runParent','platform','join','Source:','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Columns:','Master:','using\x20the\x20default\x20path:\x20','Parent\x20segment:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Options:\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','workflowAttemptId','\x20=\x20','Fetching\x20sample\x20data...','Table:\x20','\x27...','Site:\x20','matchedCount','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','1986QUJPnk','utf-8','joinKey','endsWith','\x20--attribute\x20\x22<name>\x22','workflowSessionId','Error:\x20File\x20not\x20found:\x20','Creating\x20parent\x20segment\x20\x27','pullParentYaml','segment','Options:','tdx\x20segment\x20parent\x20preview\x20','yes','List\x20parent\x20segments','execute','-1d','columns','elapsedTimeMillis','displayBehaviorsStats','✘\x20Failed\x20to\x20rename\x20directory:\x20','displayPreviewResults','Errors:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','use','Error:\x20--database\x20and\x20--table\x20are\x20required','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','text','\x20[Job\x20ID:\x20','repeat','addAttributesFile','segment:parent:pull','\x20\x20\x20\x20-\x20','✔\x20Created\x20parent\x20segment\x20\x27','Audience\x20ID:','number','open','No\x20parent\x20segments\x20found','640557nfSNdk','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Overwrite\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','population','validateParentYaml','stats','5KJKegc','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','segment:parent:preview','segment:parent:fields','displayColumns','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','displayValidateResults','displaySummary','all','\x20--attribute\x20\x22','segment:parent:sql','jobId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Join\x20on:','foreignKey','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','2026116tvZkbu','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','updateParent','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','behaviors','attributes','addBehaviorsFile','3098688Tifydk','map','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','jsonl','parent_segments','Aborted.','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:show','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','column','\x0aNew\x20parent\x20segment\x20\x27','in\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','data','Attempt:','resolveParentId','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Attribute:','yellow','FINISHED','behavior','displayAttributesStats','Error\x20parsing\x20YAML:\x20','isDirectory','addAttributes','✔\x20Found\x20','Updating\x20parent\x20segment\x20\x27','460537CbVVHh','/app/dw/parentSegments/','processedRows'];a22_0x1a89=function(){return _0x1452f;};return a22_0x1a89();}import a22_0x36549d from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x22549a(0x183),LEGACY_PARENT_SEGMENT_DIR=a22_0x22549a(0x1c9);function openBrowser(_0x5e351e){const _0x2284d7=a22_0x22549a,_0x57b985=process[_0x2284d7(0x249)],_0x33d1b9=_0x57b985==='darwin'?_0x2284d7(0x284):_0x57b985===_0x2284d7(0x22f)?_0x2284d7(0x1cd):'xdg-open';spawn(_0x33d1b9,[_0x5e351e],{'detached':!![],'stdio':_0x2284d7(0x1df)})[_0x2284d7(0x1ba)]();}function migrateLegacyDirectory(){const _0x5b7820=a22_0x22549a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2f0b07=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2f0b07[_0x5b7820(0x198)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5b7820(0x22b)](a22_0x36549d['yellow'](_0x5b7820(0x1bf)+LEGACY_PARENT_SEGMENT_DIR+_0x5b7820(0x1ea)+PARENT_SEGMENT_DIR+_0x5b7820(0x1fe))),console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x1a8)](_0x5b7820(0x1b8)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x193)](_0x5b7820(0x226)+LEGACY_PARENT_SEGMENT_DIR+_0x5b7820(0x204)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5b7820(0x22b)](a22_0x36549d['green'](_0x5b7820(0x202)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1ad60e){const _0x152ff0=_0x1ad60e instanceof Error?_0x1ad60e['message']:String(_0x1ad60e);return console[_0x5b7820(0x22b)](a22_0x36549d[_0x5b7820(0x1b5)](_0x5b7820(0x273)+_0x152ff0+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x22549a(0x241)](_0xf77b9b){const _0x1f71be=a22_0x22549a;return migrateLegacyDirectory(),super[_0x1f71be(0x241)](_0xf77b9b);}}function resolveYamlFile(_0x12d1a7){const _0x51f48a=a22_0x22549a;if(_0x12d1a7[_0x51f48a(0x263)]('.yml')||_0x12d1a7['endsWith'](_0x51f48a(0x247)))return _0x12d1a7;return a22_0x39ae17['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x12d1a7)+'.yml');}function formatProgressMessage(_0x2e73b2){const _0x1fafb=a22_0x22549a,_0x3a9f37=_0x2e73b2[_0x1fafb(0x1f8)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3a9f37){const [,_0x541a48,_0x5efb52,_0x2caeb2='']=_0x3a9f37;return a22_0x36549d[_0x1fafb(0x1a8)](_0x541a48+':')+'\x20'+_0x5efb52+a22_0x36549d[_0x1fafb(0x1a8)](_0x2caeb2);}return a22_0x36549d['dim'](_0x2e73b2);}function showFileNotFoundError(_0x10ae29,_0x408bcf){const _0x5574f7=a22_0x22549a;console[_0x5574f7(0x22b)](a22_0x36549d[_0x5574f7(0x1b5)](_0x5574f7(0x266)+_0x10ae29+'\x0a')),console[_0x5574f7(0x22b)](a22_0x36549d[_0x5574f7(0x1ad)](_0x5574f7(0x191)+_0x408bcf+_0x5574f7(0x206)));}function showParentSegmentNotSetError(_0x32ef1a){const _0x4008b2=a22_0x22549a;console[_0x4008b2(0x22b)](a22_0x36549d[_0x4008b2(0x193)](_0x4008b2(0x212))),console[_0x4008b2(0x22b)](_0x32ef1a);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:list';[a22_0x22549a(0x1e8)]=a22_0x22549a(0x26d);async[a22_0x22549a(0x26e)](_0x42dbc6){const _0x3cefaf=a22_0x22549a,{options:_0x509e27,args:_0x17e5db,tdx:_0x5525e9}=_0x42dbc6,_0x484d2e=_0x17e5db[0x0];_0x509e27[_0x3cefaf(0x1f3)]&&(console[_0x3cefaf(0x22b)](_0x3cefaf(0x25d)+_0x509e27['site']),_0x484d2e&&console[_0x3cefaf(0x22b)]('Pattern:\x20'+_0x484d2e));const _0x38481e=await withSpinner(_0x484d2e?_0x3cefaf(0x1c6)+_0x484d2e+_0x3cefaf(0x25c):_0x3cefaf(0x208),()=>_0x5525e9['segment']['listParents'](),{'verbose':_0x509e27[_0x3cefaf(0x1f3)]});let _0x57213e=_0x38481e[_0x3cefaf(0x18e)];if(_0x484d2e){const _0x4cb69f=_0x484d2e[_0x3cefaf(0x23e)](/[.+^${}()|[\]\\]/g,_0x3cefaf(0x1a2))[_0x3cefaf(0x23e)](/\*/g,'.*')[_0x3cefaf(0x23e)](/\?/g,'.'),_0x16e08a=new RegExp('^'+_0x4cb69f+'$','i');_0x57213e=_0x57213e[_0x3cefaf(0x1cb)](_0x9afcb5=>_0x16e08a[_0x3cefaf(0x1f2)](_0x9afcb5[_0x3cefaf(0x17d)]['name']));}_0x57213e['sort']((_0x5be93e,_0x1870f7)=>_0x5be93e[_0x3cefaf(0x17d)]['name'][_0x3cefaf(0x234)](_0x1870f7[_0x3cefaf(0x17d)][_0x3cefaf(0x1c0)])),console[_0x3cefaf(0x22b)]('✔\x20Found\x20'+_0x57213e['length']+_0x3cefaf(0x1be)+(_0x57213e['length']!==0x1?'s':''));if(_0x509e27[_0x3cefaf(0x228)]===_0x3cefaf(0x222)||_0x509e27['format']===_0x3cefaf(0x182))await handleSDKOutput(_0x57213e,_0x509e27);else{if(_0x57213e[_0x3cefaf(0x1d2)]===0x0)_0x484d2e?console[_0x3cefaf(0x1db)](_0x3cefaf(0x21f)+_0x484d2e):console[_0x3cefaf(0x1db)](_0x3cefaf(0x285));else for(const _0x4a5af8 of _0x57213e){const _0x441eb2=_0x4a5af8['attributes'][_0x3cefaf(0x28a)]?a22_0x36549d[_0x3cefaf(0x1a8)]('\x20('+formatRows(_0x4a5af8[_0x3cefaf(0x17d)]['population'])+')'):'';console[_0x3cefaf(0x1db)](_0x3cefaf(0x239)+_0x4a5af8[_0x3cefaf(0x17d)][_0x3cefaf(0x1c0)]+_0x441eb2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:create';[a22_0x22549a(0x1e8)]=a22_0x22549a(0x246);async[a22_0x22549a(0x26e)](_0xa51246){const _0x1eaaf1=a22_0x22549a,{options:_0x1aa350,args:_0x3d3e8b,tdx:_0x2a7d17}=_0xa51246;console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x1c3)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x1eaaf1(0x188));const _0xbb1c15=_0x1aa350;if(_0x3d3e8b[_0x1eaaf1(0x1d2)]===0x0)return console[_0x1eaaf1(0x22b)](a22_0x36549d[_0x1eaaf1(0x1b5)](_0x1eaaf1(0x21d))),console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x289)),0x1;const _0x317063=_0x3d3e8b[0x0];if(!_0xbb1c15['database']||!_0xbb1c15['table'])return console['error'](_0x1eaaf1(0x278)),console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x289)),0x1;_0xbb1c15[_0x1eaaf1(0x1f3)]&&(console[_0x1eaaf1(0x22b)](_0x1eaaf1(0x25d)+_0xbb1c15['site']),console[_0x1eaaf1(0x22b)]('Name:\x20'+_0x317063),console[_0x1eaaf1(0x22b)]('Database:\x20'+_0xbb1c15[_0x1eaaf1(0x207)]),console['error'](_0x1eaaf1(0x25b)+_0xbb1c15['table']));const _0x7d1a2=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x17d)],_0xbb1c15[_0x1eaaf1(0x1e2)]),_0x2c5447=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x17c)],_0xbb1c15[_0x1eaaf1(0x1f6)]),_0x2ad375=await loadJSONFromOptions(_0xbb1c15[_0x1eaaf1(0x1d6)],_0xbb1c15[_0x1eaaf1(0x20b)]),_0x33b0e4={'name':_0x317063,'description':_0xbb1c15['description'],'scheduleType':_0xbb1c15[_0x1eaaf1(0x1f7)],'scheduleOption':_0xbb1c15[_0x1eaaf1(0x221)],'timezone':_0xbb1c15[_0x1eaaf1(0x1e7)],'master':{'parentDatabaseName':_0xbb1c15[_0x1eaaf1(0x207)],'parentTableName':_0xbb1c15[_0x1eaaf1(0x1bd)]},'attributes':_0x7d1a2,'behaviors':_0x2c5447,'customerGroup':_0x2ad375},_0x325a8b=await withSpinner(_0x1eaaf1(0x267)+_0x317063+_0x1eaaf1(0x25c),()=>_0x2a7d17[_0x1eaaf1(0x269)][_0x1eaaf1(0x231)](_0x33b0e4),{'verbose':_0x1aa350[_0x1eaaf1(0x1f3)]}),_0x5003eb=_0x325a8b[_0x1eaaf1(0x18e)];return console['error'](_0x1eaaf1(0x281)+_0x5003eb[_0x1eaaf1(0x1c0)]+'\x27\x20with\x20ID:\x20'+_0x5003eb['id']),await handleSDKOutput([_0x5003eb],_0x1aa350),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x22549a(0x26e)](_0x19bc40){const _0x56620e=a22_0x22549a,{options:_0x157914,args:_0xd8eaa2,tdx:_0x1ebfeb}=_0x19bc40;console['error'](_0x56620e(0x173)+_0x56620e(0x18d)+_0x56620e(0x188));const _0x3d141c=_0x157914;if(_0xd8eaa2[_0x56620e(0x1d2)]===0x0)return console[_0x56620e(0x22b)](a22_0x36549d[_0x56620e(0x1b5)](_0x56620e(0x21d))),console[_0x56620e(0x22b)](_0x56620e(0x20e)),0x1;const _0x185e26=_0xd8eaa2[0x0];_0x3d141c[_0x56620e(0x1f3)]&&(console['error'](_0x56620e(0x25d)+_0x3d141c[_0x56620e(0x233)]),console[_0x56620e(0x22b)]('Parent\x20segment:\x20'+_0x185e26));const _0x27e14b=await withSpinner(_0x56620e(0x1ca)+_0x185e26+_0x56620e(0x25c),()=>_0x1ebfeb[_0x56620e(0x269)][_0x56620e(0x1fc)](_0x185e26),{'verbose':_0x3d141c[_0x56620e(0x1f3)]}),_0x35302=_0x27e14b['data'],_0xf2eda6=await loadJSONFromOptions(_0x3d141c[_0x56620e(0x199)],_0x3d141c[_0x56620e(0x27e)]),_0x3a5981=await loadJSONFromOptions(_0x3d141c[_0x56620e(0x20d)],_0x3d141c[_0x56620e(0x17e)]),_0xc42f2c={'name':_0x35302[_0x56620e(0x1c0)],'description':_0x3d141c[_0x56620e(0x1e8)]!==undefined?_0x3d141c['description']:_0x35302[_0x56620e(0x1e8)],'scheduleType':_0x3d141c[_0x56620e(0x1f7)]!==undefined?_0x3d141c['scheduleType']:_0x35302['scheduleType'],'scheduleOption':_0x3d141c[_0x56620e(0x221)]!==undefined?_0x3d141c[_0x56620e(0x221)]:_0x35302['scheduleOption'],'timezone':_0x3d141c['timezone']!==undefined?_0x3d141c[_0x56620e(0x1e7)]:_0x35302[_0x56620e(0x1e7)],'master':_0x35302[_0x56620e(0x22e)],'attributes':_0xf2eda6?[..._0x35302[_0x56620e(0x17d)]||[],..._0xf2eda6]:_0x35302['attributes'],'behaviors':_0x3a5981?[..._0x35302['behaviors']||[],..._0x3a5981]:_0x35302[_0x56620e(0x17c)],'customerGroup':_0x35302[_0x56620e(0x1d6)]},_0xcf0157=await withSpinner(_0x56620e(0x19b)+_0x185e26+_0x56620e(0x25c),()=>_0x1ebfeb[_0x56620e(0x269)][_0x56620e(0x179)](_0x185e26,_0xc42f2c),{'verbose':_0x3d141c[_0x56620e(0x1f3)]}),_0x559faf=_0xcf0157[_0x56620e(0x18e)];return console[_0x56620e(0x22b)](_0x56620e(0x205)+_0x559faf[_0x56620e(0x1c0)]+'\x27'),await handleSDKOutput([_0x559faf],_0x3d141c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x27f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x20c);async[a22_0x22549a(0x26e)](_0x2a99ce){const _0x1dbc1d=a22_0x22549a,{options:_0x427a04,args:_0x216d88,tdx:_0xea5192}=_0x2a99ce,_0x370fbf=_0x427a04,_0x8100d5=_0x216d88[0x0]||_0x427a04[_0x1dbc1d(0x214)];if(!_0x8100d5)return showParentSegmentNotSetError(_0x1dbc1d(0x17b)+_0x1dbc1d(0x257)),0x1;if(_0x370fbf[_0x1dbc1d(0x277)]&&_0x370fbf[_0x1dbc1d(0x1e3)])return console['error'](a22_0x36549d[_0x1dbc1d(0x1b5)](_0x1dbc1d(0x185))),console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x1b0))),console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x24f)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x1dbc1d(0x22b)](a22_0x36549d['cyan'](_0x1dbc1d(0x18c))),0x1;const _0x27a676=_0x370fbf[_0x1dbc1d(0x1e3)]||a22_0x39ae17[_0x1dbc1d(0x24a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x8100d5)+_0x1dbc1d(0x1b6));_0x370fbf[_0x1dbc1d(0x1f3)]&&(console[_0x1dbc1d(0x22b)](_0x1dbc1d(0x25d)+_0x370fbf[_0x1dbc1d(0x233)]),console[_0x1dbc1d(0x22b)]('Parent\x20segment:\x20'+_0x8100d5),console['error'](_0x1dbc1d(0x1c4)+_0x27a676));const _0x5e7e28=await withSpinner(_0x1dbc1d(0x19f)+_0x8100d5+_0x1dbc1d(0x25c),()=>_0xea5192[_0x1dbc1d(0x269)][_0x1dbc1d(0x268)](_0x8100d5),{'verbose':_0x370fbf['verbose']}),_0x10743e=_0x5e7e28[_0x1dbc1d(0x18e)];if(existsSync(_0x27a676)){const _0x172a2a=readFileSync(_0x27a676,_0x1dbc1d(0x261)),_0x4e4a74=generateDiff(_0x172a2a,_0x10743e);if(!hasChanges(_0x4e4a74))console[_0x1dbc1d(0x22b)](a22_0x36549d[_0x1dbc1d(0x1ee)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676)+_0x1dbc1d(0x22c));else{console[_0x1dbc1d(0x22b)]('\x0aChanges\x20to\x20\x27'+_0x27a676+'\x27:'),console[_0x1dbc1d(0x22b)]('─'[_0x1dbc1d(0x27d)](0x3c)),console['error'](formatDiffWithColors(_0x4e4a74)),console[_0x1dbc1d(0x22b)]('─'[_0x1dbc1d(0x27d)](0x3c));if(!_0x370fbf[_0x1dbc1d(0x26c)]){const _0x410cfb=await confirmKey(_0x1dbc1d(0x288)+_0x27a676+'\x27?');if(!_0x410cfb)return console[_0x1dbc1d(0x22b)]('Aborted.'),0x1;}writeFileSync(_0x27a676,_0x10743e,_0x1dbc1d(0x261)),console[_0x1dbc1d(0x22b)](a22_0x36549d['green']('✔')+_0x1dbc1d(0x276)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676));}}else{const _0x568d70=a22_0x39ae17['dirname'](_0x27a676);!existsSync(_0x568d70)&&mkdirSync(_0x568d70,{'recursive':!![]}),writeFileSync(_0x27a676,_0x10743e,_0x1dbc1d(0x261)),console['error'](a22_0x36549d[_0x1dbc1d(0x1ee)]('✔')+_0x1dbc1d(0x276)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x27a676));}return saveSessionContext({'parent_segment':_0x8100d5},_0x370fbf['session']),console[_0x1dbc1d(0x22b)](a22_0x36549d['green']('✔')+'\x20Context\x20set:\x20'+a22_0x36549d[_0x1dbc1d(0x1a8)](_0x1dbc1d(0x1c9))+_0x1dbc1d(0x259)+a22_0x36549d[_0x1dbc1d(0x1ad)](_0x8100d5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x1e5);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x21b);async[a22_0x22549a(0x26e)](_0x21d620){const _0x4b0244=a22_0x22549a,{options:_0xc32da2,args:_0x19505f,tdx:_0x5c220b}=_0x21d620,_0x304754=_0xc32da2,_0x323c6f=_0x19505f[0x0]||_0xc32da2[_0x4b0244(0x214)];if(!_0x323c6f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0xaff11b=resolveYamlFile(_0x323c6f);if(!existsSync(_0xaff11b))return showFileNotFoundError(_0xaff11b,_0x323c6f),0x1;_0x304754[_0x4b0244(0x1f3)]&&(console[_0x4b0244(0x22b)](_0x4b0244(0x25d)+_0x304754[_0x4b0244(0x233)]),console[_0x4b0244(0x22b)](_0x4b0244(0x243)+_0xaff11b));let _0x125a97;try{_0x125a97=readFileSync(_0xaff11b,_0x4b0244(0x261));}catch(_0x51b0ff){const _0x5b5da7=_0x51b0ff instanceof Error?_0x51b0ff['message']:String(_0x51b0ff);return console[_0x4b0244(0x22b)](_0x4b0244(0x1e9)+_0x5b5da7),0x1;}const _0xae7ab1=await withSpinner(_0x4b0244(0x209),()=>_0x5c220b['segment']['pushParentYaml'](_0x125a97),{'verbose':_0x304754['verbose']}),_0x5bd03d=_0xae7ab1[_0x4b0244(0x18e)],{isNew:_0x121833,name:_0x362f8e,hasChanges:_0x5bf0d0,diffFormatted:_0x2673a1}=_0x5bd03d;if(!_0x5bf0d0)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x362f8e+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x121833?console[_0x4b0244(0x22b)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x362f8e+'\x27:'):console['error'](_0x4b0244(0x1f1)+_0x362f8e+'\x27:');console[_0x4b0244(0x22b)]('─'[_0x4b0244(0x27d)](0x3c)),console['error'](_0x2673a1),console[_0x4b0244(0x22b)]('─'['repeat'](0x3c));const _0x37a2cf=_0x121833?_0x4b0244(0x1de)+_0x362f8e+'\x27?':_0x4b0244(0x1d3)+_0x362f8e+'\x27?';if(!_0x304754[_0x4b0244(0x26c)]){const _0x1ae600=await confirmKey(_0x37a2cf);if(!_0x1ae600)return console['error'](_0x4b0244(0x184)),0x1;}const _0x1c6056=_0x121833?_0x4b0244(0x219):_0x4b0244(0x1a7),_0x3880b2=await withSpinner(_0x1c6056+_0x4b0244(0x1aa)+_0x362f8e+_0x4b0244(0x25c),()=>_0x5bd03d[_0x4b0244(0x1b1)](),{'verbose':_0x304754[_0x4b0244(0x1f3)]}),_0x3f3721=_0x3880b2[_0x4b0244(0x18e)],_0x3f0840=getConsoleNextUrl(_0x304754[_0x4b0244(0x233)],_0x4b0244(0x19d)+_0x3f3721['id']),_0x5e6717=_0x121833?_0x4b0244(0x1c1):_0x4b0244(0x23c);return console[_0x4b0244(0x22b)]('✔\x20'+_0x5e6717+_0x4b0244(0x1aa)+_0x3f3721[_0x4b0244(0x1c0)]+'\x27'),console['error']('\x20\x20'+_0x3f0840),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x20f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x178);async['execute'](_0x38a5ec){const _0x33079a=a22_0x22549a,{options:_0xff182f,args:_0x13c778,tdx:_0x336610}=_0x38a5ec,_0x3bde6c=_0xff182f,_0x37d794=_0x13c778[0x0]||_0xff182f[_0x33079a(0x214)];if(!_0x37d794)return showParentSegmentNotSetError(_0x33079a(0x255)+_0x33079a(0x1a9)+'Options:\x0a'+_0x33079a(0x287)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x33079a(0x17a)),0x1;const _0x1bedc1=resolveYamlFile(_0x37d794);if(!existsSync(_0x1bedc1))return showFileNotFoundError(_0x1bedc1,_0x37d794),0x1;_0x3bde6c['verbose']&&(console[_0x33079a(0x22b)](_0x33079a(0x25d)+_0x3bde6c[_0x33079a(0x233)]),console[_0x33079a(0x22b)](_0x33079a(0x243)+_0x1bedc1));let _0x5f56cc;try{_0x5f56cc=readFileSync(_0x1bedc1,_0x33079a(0x261));}catch(_0x228200){const _0x54d769=_0x228200 instanceof Error?_0x228200[_0x33079a(0x1dd)]:String(_0x228200);return console[_0x33079a(0x22b)](_0x33079a(0x1e9)+_0x54d769),0x1;}const _0x4a3eaa=createCommandSpinner(a22_0x36549d[_0x33079a(0x1a8)](_0x33079a(0x1b2)),{'verbose':_0x3bde6c[_0x33079a(0x1f3)]});_0x4a3eaa[_0x33079a(0x1cd)]();const _0x40cbe0={'onProgress':_0x35e6d1=>{const _0x359ed8=_0x33079a;_0x4a3eaa[_0x359ed8(0x27b)]=formatProgressMessage(_0x35e6d1);}};if(_0x3bde6c[_0x33079a(0x22e)])_0x40cbe0[_0x33079a(0x22e)]=!![];if(_0x3bde6c[_0x33079a(0x1e4)])_0x40cbe0[_0x33079a(0x1e4)]=!![];_0x3bde6c[_0x33079a(0x1fb)]&&(_0x40cbe0[_0x33079a(0x1fb)]=_0x3bde6c[_0x33079a(0x1fb)]);_0x3bde6c[_0x33079a(0x195)]&&(_0x40cbe0['behavior']=_0x3bde6c[_0x33079a(0x195)]);if(_0x3bde6c[_0x33079a(0x1d1)])_0x40cbe0[_0x33079a(0x1d1)]=_0x3bde6c['interval'];let _0x86e829;try{_0x86e829=await _0x336610[_0x33079a(0x269)][_0x33079a(0x28b)](_0x5f56cc,_0x40cbe0),_0x4a3eaa[_0x33079a(0x1fd)]();}catch(_0x46d833){_0x4a3eaa[_0x33079a(0x1fd)]();throw _0x46d833;}const _0x2eba83=_0x3bde6c[_0x33079a(0x1d1)]||_0x33079a(0x26f);return this['displayValidateResults'](_0x86e829,_0x40cbe0,_0x1bedc1,_0x2eba83),_0x86e829[_0x33079a(0x1a4)]?0x0:0x1;}[a22_0x22549a(0x16d)](_0x1ab728,_0x2abda4,_0xae0bae,_0x2a04cf){const _0x44853c=a22_0x22549a;console['error']('\x0a'+a22_0x36549d[_0x44853c(0x1f5)]('Validate:')+'\x20'+_0x1ab728['name']),console[_0x44853c(0x22b)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x1ab728);if(typeof _0x2abda4[_0x44853c(0x1fb)]===_0x44853c(0x1f4)){this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x1fb),_0x2abda4[_0x44853c(0x1fb)]);return;}if(_0x2abda4['attribute']===!![]){this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,'attributes');return;}if(typeof _0x2abda4['behavior']===_0x44853c(0x1f4)){this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this['displaySummary'](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,'behavior',_0x2abda4[_0x44853c(0x195)]);return;}if(_0x2abda4['behavior']===!![]){this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x17c));return;}this[_0x44853c(0x196)](_0x1ab728),this[_0x44853c(0x272)](_0x1ab728,_0x2a04cf),this[_0x44853c(0x16e)](_0x1ab728),this[_0x44853c(0x235)](_0xae0bae,_0x2a04cf,_0x44853c(0x16f));}[a22_0x22549a(0x235)](_0x329a78,_0x43a725,_0x512bba,_0x5037a2){const _0x43fcbd=a22_0x22549a;console[_0x43fcbd(0x22b)]('\x0a'+a22_0x36549d[_0x43fcbd(0x1a8)]('To\x20view\x20sample\x20data:'));const _0x1d1b6a=_0x43a725!=='-1d'?'\x20--interval\x20'+_0x43a725:'';if(_0x512bba==='attribute'&&_0x5037a2)console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d['dim'](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x170)+_0x5037a2+'\x22'+_0x1d1b6a));else{if(_0x512bba==='behavior'&&_0x5037a2)console['error']('\x20\x20'+a22_0x36549d['dim'](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x1ff)+_0x5037a2+'\x22'+_0x1d1b6a));else(_0x512bba===_0x43fcbd(0x17d)||_0x512bba===_0x43fcbd(0x16f))&&console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)](_0x43fcbd(0x26b)+_0x329a78+_0x43fcbd(0x264)+_0x1d1b6a));}(_0x512bba===_0x43fcbd(0x17c)||_0x512bba===_0x43fcbd(0x16f))&&console[_0x43fcbd(0x22b)]('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)]('tdx\x20segment\x20parent\x20preview\x20'+_0x329a78+_0x43fcbd(0x1d4)+_0x1d1b6a)),_0x512bba===_0x43fcbd(0x16f)&&console['error']('\x20\x20'+a22_0x36549d[_0x43fcbd(0x1a8)]('tdx\x20segment\x20parent\x20preview\x20'+_0x329a78+_0x43fcbd(0x1c2)+_0x1d1b6a));}['displayMasterInfo'](_0x755bb2){const _0xda9fe6=a22_0x22549a,{master:_0x51c4ce}=_0x755bb2,_0x199bfe=_0x51c4ce[_0xda9fe6(0x22d)]?a22_0x36549d[_0xda9fe6(0x1ee)]('✔'):a22_0x36549d[_0xda9fe6(0x1b5)]('✘');console['error']('\x0a'+a22_0x36549d[_0xda9fe6(0x1a8)](_0xda9fe6(0x1ef))),console[_0xda9fe6(0x22b)](_0x199bfe+'\x20'+a22_0x36549d[_0xda9fe6(0x1f5)](_0x51c4ce[_0xda9fe6(0x207)]+'.'+_0x51c4ce['table'])),_0x51c4ce['schemaValid']?_0x51c4ce[_0xda9fe6(0x1ac)]!==undefined&&console[_0xda9fe6(0x22b)]('\x20\x20'+a22_0x36549d[_0xda9fe6(0x1a8)](_0xda9fe6(0x21a))+'\x20'+a22_0x36549d[_0xda9fe6(0x1ad)](formatRows(_0x51c4ce[_0xda9fe6(0x1ac)]))):console[_0xda9fe6(0x22b)]('\x20\x20'+a22_0x36549d[_0xda9fe6(0x1b5)](_0xda9fe6(0x21e))+'\x20'+_0x51c4ce[_0xda9fe6(0x1b3)]);}[a22_0x22549a(0x196)](_0x152dcc){const _0x5372e1=a22_0x22549a;if(_0x152dcc['attributes'][_0x5372e1(0x1d2)]===0x0)return;console['error']('\x0a'+a22_0x36549d['dim'](_0x5372e1(0x225)));for(const _0x29586f of _0x152dcc[_0x5372e1(0x17d)]){const _0x5e3892=_0x29586f['schemaValid']?a22_0x36549d['green']('✔'):a22_0x36549d['red']('✘');let _0x5853ef='';if(_0x29586f['schemaValid']&&_0x29586f['matchedCount']!==undefined&&_0x29586f[_0x5372e1(0x1a0)]!==undefined){const _0x19eaf3=_0x29586f[_0x5372e1(0x1a0)][_0x5372e1(0x23f)](0x1),_0x23fe4c=_0x29586f[_0x5372e1(0x1a0)]>=0x50?a22_0x36549d['green']:_0x29586f[_0x5372e1(0x1a0)]>=0x32?a22_0x36549d[_0x5372e1(0x193)]:a22_0x36549d['red'];_0x5853ef='\x20'+a22_0x36549d[_0x5372e1(0x1a8)]('Coverage:')+'\x20'+_0x23fe4c(_0x19eaf3+'%')+'\x20('+formatRows(_0x29586f[_0x5372e1(0x25e)])+'\x20rows)';}console['error'](_0x5e3892+'\x20'+a22_0x36549d[_0x5372e1(0x1f5)](_0x29586f[_0x5372e1(0x1c0)])+_0x5853ef),console[_0x5372e1(0x22b)]('\x20\x20'+a22_0x36549d[_0x5372e1(0x1a8)]('Source:')+'\x20'+a22_0x36549d[_0x5372e1(0x1f5)](_0x29586f[_0x5372e1(0x207)]+'.'+_0x29586f['table']));const _0x45f4f6=_0x29586f['joinKey']===_0x29586f[_0x5372e1(0x175)]?a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x174))+'\x20'+_0x29586f[_0x5372e1(0x262)]:a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x1e1))+'\x20'+_0x29586f['joinKey']+_0x5372e1(0x259)+_0x29586f[_0x5372e1(0x175)];console['error']('\x20\x20'+_0x45f4f6),console[_0x5372e1(0x22b)]('\x20\x20'+a22_0x36549d[_0x5372e1(0x1a8)](_0x5372e1(0x24d))),this['displayColumns'](_0x29586f[_0x5372e1(0x270)]),!_0x29586f[_0x5372e1(0x22d)]&&console['error']('\x20\x20'+a22_0x36549d[_0x5372e1(0x1b5)](_0x5372e1(0x21e))+'\x20'+_0x29586f['schemaError']);}}[a22_0x22549a(0x272)](_0x4b9ebc,_0x2a3f21){const _0x5cd7f0=a22_0x22549a;if(_0x4b9ebc['behaviors'][_0x5cd7f0(0x1d2)]===0x0)return;console[_0x5cd7f0(0x22b)]('\x0a'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x256))+'\x20'+a22_0x36549d['dim']('('+_0x2a3f21+')'));for(const _0x3c0938 of _0x4b9ebc[_0x5cd7f0(0x17c)]){const _0x4ef817=_0x3c0938[_0x5cd7f0(0x22d)]?a22_0x36549d['green']('✔'):a22_0x36549d[_0x5cd7f0(0x1b5)]('✘');let _0x27ee7b='';if(_0x3c0938['schemaValid']&&_0x3c0938[_0x5cd7f0(0x229)]!==undefined&&_0x3c0938[_0x5cd7f0(0x200)]!==undefined){const _0x42ceaa=_0x3c0938[_0x5cd7f0(0x1bb)]?.[_0x5cd7f0(0x23f)](0x1)||'?',_0x593fe3=(_0x3c0938[_0x5cd7f0(0x1bb)]??0x0)>=0x32?a22_0x36549d['green']:(_0x3c0938['customerPercent']??0x0)>=0x14?a22_0x36549d[_0x5cd7f0(0x193)]:a22_0x36549d['red'];_0x27ee7b='\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)]('Customers:')+'\x20'+_0x593fe3(formatRows(_0x3c0938[_0x5cd7f0(0x229)]))+'\x20('+_0x42ceaa+'%)\x20'+a22_0x36549d['dim'](_0x5cd7f0(0x1af))+'\x20'+a22_0x36549d['cyan'](formatRows(_0x3c0938[_0x5cd7f0(0x200)]));}console[_0x5cd7f0(0x22b)](_0x4ef817+'\x20'+a22_0x36549d[_0x5cd7f0(0x1f5)](_0x3c0938[_0x5cd7f0(0x1c0)])+_0x27ee7b),console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x24b))+'\x20'+a22_0x36549d[_0x5cd7f0(0x1f5)](_0x3c0938['database']+'.'+_0x3c0938[_0x5cd7f0(0x1bd)]));const _0x5765d7=_0x3c0938[_0x5cd7f0(0x262)]===_0x3c0938[_0x5cd7f0(0x175)]?a22_0x36549d['dim']('Join\x20on:')+'\x20'+_0x3c0938[_0x5cd7f0(0x262)]:a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x1e1))+'\x20'+_0x3c0938['joinKey']+_0x5cd7f0(0x259)+_0x3c0938['foreignKey'];console[_0x5cd7f0(0x22b)]('\x20\x20'+_0x5765d7),console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d[_0x5cd7f0(0x1a8)](_0x5cd7f0(0x24d))),this[_0x5cd7f0(0x291)](_0x3c0938[_0x5cd7f0(0x270)]),!_0x3c0938[_0x5cd7f0(0x22d)]&&console[_0x5cd7f0(0x22b)]('\x20\x20'+a22_0x36549d['red'](_0x5cd7f0(0x21e))+'\x20'+_0x3c0938[_0x5cd7f0(0x1b3)]);}}['displayColumns'](_0x3270f4){const _0x7e99d0=a22_0x22549a;for(const _0x4f24eb of _0x3270f4){_0x4f24eb[_0x7e99d0(0x1a6)]===_0x4f24eb[_0x7e99d0(0x189)]||_0x4f24eb[_0x7e99d0(0x189)]==='*'?console[_0x7e99d0(0x22b)](_0x7e99d0(0x280)+_0x4f24eb['label']):console['error'](_0x7e99d0(0x280)+_0x4f24eb[_0x7e99d0(0x1a6)]+'\x20'+a22_0x36549d['dim']('('+_0x4f24eb['column']+')'));}}[a22_0x22549a(0x16e)](_0x5e71bc){const _0x437301=a22_0x22549a;console['error']('─'[_0x437301(0x27d)](0x3c));if(_0x5e71bc[_0x437301(0x1f9)][_0x437301(0x1d2)]>0x0){console['error']('\x0a'+a22_0x36549d[_0x437301(0x1b5)](_0x437301(0x275)));for(const _0x369bcf of _0x5e71bc[_0x437301(0x1f9)]){console[_0x437301(0x22b)]('\x20\x20'+a22_0x36549d[_0x437301(0x1b5)]('•')+'\x20'+_0x369bcf);}}_0x5e71bc[_0x437301(0x1a4)]&&console[_0x437301(0x22b)]('\x0a'+a22_0x36549d[_0x437301(0x1ee)]('✔')+_0x437301(0x1cc));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x28f);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x201);async['execute'](_0x418709){const _0x2beb3f=a22_0x22549a,{options:_0x24ee03,args:_0x3196cc,tdx:_0x275b71}=_0x418709,_0x303e12=_0x24ee03,_0xed1d=_0x3196cc[0x0]||_0x24ee03['parentSegment'];if(!_0xed1d)return showParentSegmentNotSetError(_0x2beb3f(0x254)+_0x2beb3f(0x1cf)+_0x2beb3f(0x1a1)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x2beb3f(0x252)+_0x2beb3f(0x1da)+_0x2beb3f(0x251)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x303e12['master']&&!_0x303e12[_0x2beb3f(0x1fb)]&&!_0x303e12[_0x2beb3f(0x195)]&&!_0x303e12[_0x2beb3f(0x1e4)])return console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x210))),console[_0x2beb3f(0x22b)](_0x2beb3f(0x24c)),console['error'](_0x2beb3f(0x26a)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x1a5)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x176)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x20a)),console[_0x2beb3f(0x22b)](_0x2beb3f(0x181)),0x1;const _0x5345db=resolveYamlFile(_0xed1d);if(!existsSync(_0x5345db))return showFileNotFoundError(_0x5345db,_0xed1d),0x1;_0x303e12['verbose']&&(console[_0x2beb3f(0x22b)](_0x2beb3f(0x25d)+_0x303e12[_0x2beb3f(0x233)]),console[_0x2beb3f(0x22b)](_0x2beb3f(0x243)+_0x5345db));let _0x53c47c;try{_0x53c47c=readFileSync(_0x5345db,_0x2beb3f(0x261));}catch(_0x4e6824){const _0x4956fc=_0x4e6824 instanceof Error?_0x4e6824[_0x2beb3f(0x1dd)]:String(_0x4e6824);return console[_0x2beb3f(0x22b)](_0x2beb3f(0x1e9)+_0x4956fc),0x1;}let _0x34b01f;try{_0x34b01f=parseDef(_0x53c47c);}catch(_0x2ca39d){const _0x3ccbc7=_0x2ca39d instanceof Error?_0x2ca39d[_0x2beb3f(0x1dd)]:String(_0x2ca39d);return console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x197)+_0x3ccbc7)),0x1;}if(_0x303e12[_0x2beb3f(0x1fb)]===!![]||_0x303e12[_0x2beb3f(0x1fb)]===''){const _0x358418=_0x34b01f['attributes']?.[_0x2beb3f(0x180)](_0x573b79=>_0x573b79[_0x2beb3f(0x1c0)])||[];if(_0x358418[_0x2beb3f(0x1d2)]===0x0)console[_0x2beb3f(0x22b)](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x1c8)));else{console[_0x2beb3f(0x22b)](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x238))),console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d0));for(const _0x10055e of _0x358418){console['error']('\x20\x20'+a22_0x36549d[_0x2beb3f(0x1ad)](_0x10055e));}console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d8)+_0xed1d+_0x2beb3f(0x170)+_0x358418[0x0]+'\x22');}return 0x1;}if(_0x303e12[_0x2beb3f(0x195)]===!![]||_0x303e12[_0x2beb3f(0x195)]===''){const _0x238726=_0x34b01f[_0x2beb3f(0x17c)]?.[_0x2beb3f(0x180)](_0x2fa245=>_0x2fa245[_0x2beb3f(0x1c0)])||[];if(_0x238726[_0x2beb3f(0x1d2)]===0x0)console['error'](a22_0x36549d[_0x2beb3f(0x1b5)](_0x2beb3f(0x186)));else{console[_0x2beb3f(0x22b)](a22_0x36549d['red']('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x2beb3f(0x22b)]('Available\x20behaviors:');for(const _0x41b6fe of _0x238726){console[_0x2beb3f(0x22b)]('\x20\x20'+a22_0x36549d[_0x2beb3f(0x1ad)](_0x41b6fe));}console[_0x2beb3f(0x22b)](_0x2beb3f(0x1d8)+_0xed1d+_0x2beb3f(0x1ff)+_0x238726[0x0]+'\x22');}return 0x1;}const _0x265664=createCommandSpinner(a22_0x36549d[_0x2beb3f(0x1a8)](_0x2beb3f(0x25a)),{'verbose':_0x303e12[_0x2beb3f(0x1f3)]});_0x265664[_0x2beb3f(0x1cd)]();const _0x459c80={'onProgress':_0x44f70b=>{const _0x4e93d2=_0x2beb3f;_0x265664[_0x4e93d2(0x27b)]=formatProgressMessage(_0x44f70b);}};if(_0x303e12[_0x2beb3f(0x22e)])_0x459c80[_0x2beb3f(0x22e)]=!![];if(_0x303e12['attribute']&&typeof _0x303e12[_0x2beb3f(0x1fb)]===_0x2beb3f(0x1f4))_0x459c80[_0x2beb3f(0x1fb)]=_0x303e12['attribute'];if(_0x303e12[_0x2beb3f(0x195)]&&typeof _0x303e12[_0x2beb3f(0x195)]===_0x2beb3f(0x1f4))_0x459c80[_0x2beb3f(0x195)]=_0x303e12[_0x2beb3f(0x195)];if(_0x303e12['enriched'])_0x459c80[_0x2beb3f(0x1e4)]=!![];if(_0x303e12['interval'])_0x459c80[_0x2beb3f(0x1d1)]=_0x303e12[_0x2beb3f(0x1d1)];let _0x1129f8;try{_0x1129f8=await _0x275b71[_0x2beb3f(0x269)]['previewParentYaml'](_0x53c47c,_0x459c80),_0x265664['stop']();}catch(_0x117b2a){_0x265664[_0x2beb3f(0x1fd)]();throw _0x117b2a;}return await this[_0x2beb3f(0x274)](_0x1129f8,{'master':_0x303e12[_0x2beb3f(0x22e)],'attribute':typeof _0x303e12['attribute']===_0x2beb3f(0x1f4)?_0x303e12[_0x2beb3f(0x1fb)]:undefined,'behavior':typeof _0x303e12[_0x2beb3f(0x195)]===_0x2beb3f(0x1f4)?_0x303e12['behavior']:undefined,'enriched':_0x303e12[_0x2beb3f(0x1e4)]}),_0x1129f8[_0x2beb3f(0x1a4)]?0x0:0x1;}async[a22_0x22549a(0x274)](_0x20ecab,_0x25c951){const _0x33d778=a22_0x22549a;console[_0x33d778(0x22b)]('\x0a'+a22_0x36549d[_0x33d778(0x1f5)](_0x33d778(0x1eb))+'\x20'+_0x20ecab[_0x33d778(0x1c0)]),console['error']('═'['repeat'](0x3c));if(_0x25c951[_0x33d778(0x22e)]&&_0x20ecab['sampleData']){const _0xbb4265=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x24e))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x20ecab['master'][_0x33d778(0x207)]+'.'+_0x20ecab[_0x33d778(0x22e)]['table']);await this[_0x33d778(0x215)](_0xbb4265,_0x20ecab[_0x33d778(0x1ce)]);}else{if(_0x25c951['attribute']&&_0x20ecab[_0x33d778(0x1ce)]){const _0x592f13=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x192))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x25c951['attribute']);await this['displaySampleData'](_0x592f13,_0x20ecab[_0x33d778(0x1ce)]);}else{if(_0x25c951['behavior']&&_0x20ecab[_0x33d778(0x1ce)]){const _0x4eff90=a22_0x36549d[_0x33d778(0x1a8)]('Behavior:')+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x25c951[_0x33d778(0x195)]);await this['displaySampleData'](_0x4eff90,_0x20ecab['sampleData']);}else{if(_0x25c951[_0x33d778(0x1e4)]&&_0x20ecab[_0x33d778(0x1ce)]){const _0x230572=a22_0x36549d[_0x33d778(0x1a8)](_0x33d778(0x1ec))+'\x20'+a22_0x36549d[_0x33d778(0x1f5)](_0x33d778(0x1ab));await this[_0x33d778(0x215)](_0x230572,_0x20ecab['sampleData']);}else!_0x20ecab[_0x33d778(0x1ce)]&&console[_0x33d778(0x22b)](_0x33d778(0x240));}}}if(_0x20ecab[_0x33d778(0x1f9)][_0x33d778(0x1d2)]>0x0){console['error']('─'[_0x33d778(0x27d)](0x3c)),console[_0x33d778(0x22b)]('\x0a'+a22_0x36549d[_0x33d778(0x1b5)](_0x33d778(0x275)));for(const _0x3c52ef of _0x20ecab[_0x33d778(0x1f9)]){console[_0x33d778(0x22b)]('\x20\x20'+a22_0x36549d['red']('•')+'\x20'+_0x3c52ef);}}}async[a22_0x22549a(0x215)](_0x48ed8e,_0x326604){const _0x243639=a22_0x22549a;if(_0x326604[_0x243639(0x1d2)]===0x0){console['error']('\x0a'+_0x48ed8e),console[_0x243639(0x22b)](_0x243639(0x1a3));return;}console[_0x243639(0x22b)]('\x0a'+_0x48ed8e);const _0x397fb4=Object[_0x243639(0x213)](_0x326604[0x0])[_0x243639(0x180)](_0x1f0134=>({'name':_0x1f0134,'type':typeof _0x326604[0x0][_0x1f0134]===_0x243639(0x283)?'double':'varchar'})),_0xf385ea={'queryId':_0x243639(0x1e0),'columns':_0x397fb4,'data':_0x326604,'stats':{'state':_0x243639(0x194),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x326604[_0x243639(0x1d2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xffaa09=formatAsTable(_0xf385ea,_0x326604[_0x243639(0x1d2)],!![]);await writeOutput(_0xffaa09,undefined,_0x243639(0x1bd));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a22_0x22549a(0x1b4);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x230);async[a22_0x22549a(0x26e)](_0x2afa5f){const _0x187b7d=a22_0x22549a,{options:_0x5d77c0,args:_0x198a1e,tdx:_0x679a8b}=_0x2afa5f,_0x3b65f2=_0x5d77c0,_0x2014e6=_0x198a1e[0x0]||_0x5d77c0['parentSegment'];if(!_0x2014e6)return showParentSegmentNotSetError(_0x187b7d(0x28e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1f0f86=resolveYamlFile(_0x2014e6);if(existsSync(_0x1f0f86)){_0x3b65f2['verbose']&&console[_0x187b7d(0x22b)](_0x187b7d(0x223)+_0x1f0f86);let _0x26c2df;try{_0x26c2df=readFileSync(_0x1f0f86,_0x187b7d(0x261));}catch(_0x207217){const _0x11ec70=_0x207217 instanceof Error?_0x207217[_0x187b7d(0x1dd)]:String(_0x207217);return console[_0x187b7d(0x22b)](_0x187b7d(0x1e9)+_0x11ec70),0x1;}const _0x5f3271=await withSpinner(_0x187b7d(0x209),()=>_0x679a8b[_0x187b7d(0x269)][_0x187b7d(0x245)](_0x26c2df),{'verbose':_0x3b65f2[_0x187b7d(0x1f3)]}),_0x5cd73d=_0x5f3271[_0x187b7d(0x18e)],{isNew:_0x400115,name:_0x1cf6bf,hasChanges:_0x35158b,diffFormatted:_0x835fe9}=_0x5cd73d;if(_0x35158b){_0x400115?console[_0x187b7d(0x22b)](_0x187b7d(0x18a)+_0x1cf6bf+'\x27:'):console[_0x187b7d(0x22b)](_0x187b7d(0x1f1)+_0x1cf6bf+'\x27:');console[_0x187b7d(0x22b)]('─'[_0x187b7d(0x27d)](0x3c)),console[_0x187b7d(0x22b)](_0x835fe9),console[_0x187b7d(0x22b)]('─'[_0x187b7d(0x27d)](0x3c));const _0x572b5c=_0x400115?_0x187b7d(0x1de)+_0x1cf6bf+_0x187b7d(0x279):_0x187b7d(0x1d3)+_0x1cf6bf+'\x27\x20and\x20run\x20workflow?';if(!_0x3b65f2['yes']){const _0xb3efb4=await confirmKey(_0x572b5c);if(!_0xb3efb4)return console[_0x187b7d(0x22b)](_0x187b7d(0x184)),0x1;}const _0x22161b=_0x400115?_0x187b7d(0x219):_0x187b7d(0x1a7);await withSpinner(_0x22161b+'\x20parent\x20segment\x20\x27'+_0x1cf6bf+_0x187b7d(0x25c),()=>_0x5cd73d[_0x187b7d(0x1b1)](),{'verbose':_0x3b65f2['verbose']});const _0x2c2c28=_0x400115?_0x187b7d(0x1c1):'Updated';console[_0x187b7d(0x22b)]('✔\x20'+_0x2c2c28+_0x187b7d(0x1aa)+_0x1cf6bf+'\x27');}else console[_0x187b7d(0x22b)]('✔\x20No\x20changes\x20-\x20\x27'+_0x1cf6bf+_0x187b7d(0x203));}const _0x3388dd=await withSpinner(_0x187b7d(0x1e6)+_0x2014e6+_0x187b7d(0x25c),()=>_0x679a8b[_0x187b7d(0x269)][_0x187b7d(0x248)](_0x2014e6),{'verbose':_0x3b65f2[_0x187b7d(0x1f3)]}),_0x5bf543=_0x3388dd[_0x187b7d(0x18e)],_0x3142a8=getConsoleUrl(_0x3b65f2['site'],'/app/workflows/'+_0x5bf543[_0x187b7d(0x1ed)]+_0x187b7d(0x23b)+_0x5bf543[_0x187b7d(0x265)]+'/attempt/'+_0x5bf543[_0x187b7d(0x258)]);return console[_0x187b7d(0x22b)](_0x187b7d(0x232)),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x282))+'\x20'+_0x5bf543['audienceId']),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)]('Status:')+'\x20'+_0x5bf543[_0x187b7d(0x217)]),console['error']('\x20\x20'+a22_0x36549d['dim']('Session:')+'\x20'+_0x5bf543['workflowSessionId']),console['error']('\x20\x20'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x18f))+'\x20'+_0x5bf543[_0x187b7d(0x258)]),console[_0x187b7d(0x22b)]('\x20\x20'+_0x3142a8),console['error']('\x0a'+a22_0x36549d[_0x187b7d(0x1a8)](_0x187b7d(0x237))+'\x20tdx\x20wf\x20attempt\x20'+_0x5bf543[_0x187b7d(0x258)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a22_0x22549a(0x290);[a22_0x22549a(0x1e8)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3153b1){const _0x1aa66c=a22_0x22549a,{options:_0x595b71,args:_0x21bc30,tdx:_0x54a2c7}=_0x3153b1,_0x238696=_0x21bc30[0x0]||_0x595b71[_0x1aa66c(0x214)];if(!_0x238696)return showParentSegmentNotSetError(_0x1aa66c(0x1dc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x595b71[_0x1aa66c(0x1f3)]&&(console[_0x1aa66c(0x22b)](_0x1aa66c(0x25d)+_0x595b71[_0x1aa66c(0x233)]),console[_0x1aa66c(0x22b)](_0x1aa66c(0x250)+_0x238696));const _0x5ad826=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x238696+_0x1aa66c(0x25c),()=>_0x54a2c7['segment']['listFields'](_0x238696),{'verbose':_0x595b71[_0x1aa66c(0x1f3)]}),_0x44329d=_0x5ad826[_0x1aa66c(0x18e)];console['error'](_0x1aa66c(0x19a)+_0x44329d['length']+'\x20field'+(_0x44329d[_0x1aa66c(0x1d2)]!==0x1?'s':''));if(_0x595b71['json']||_0x595b71[_0x1aa66c(0x182)])return await handleSDKOutput(_0x44329d,_0x595b71),0x0;return displayFieldsHumanReadable(_0x44329d,_0x238696),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x21c);['description']=a22_0x22549a(0x224);async['execute'](_0xb88716){const _0x54b143=a22_0x22549a,{options:_0x55ca45,args:_0x7c16c2,tdx:_0x319255}=_0xb88716,_0x2badc6=_0x55ca45,_0x2833ab=_0x7c16c2[0x0]||_0x55ca45['parentSegment'];if(!_0x2833ab)return showParentSegmentNotSetError(_0x54b143(0x1b7)+_0x54b143(0x292)+_0x54b143(0x253)+_0x54b143(0x1c7)),0x1;_0x55ca45['verbose']&&(console[_0x54b143(0x22b)](_0x54b143(0x25d)+_0x55ca45[_0x54b143(0x233)]),console[_0x54b143(0x22b)]('Parent\x20segment:\x20'+_0x2833ab));const _0x5063df=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2833ab+'\x27...',()=>_0x319255[_0x54b143(0x269)][_0x54b143(0x1fc)](_0x2833ab),{'verbose':_0x55ca45[_0x54b143(0x1f3)]}),_0x4135d0=_0x5063df['data'];if(_0x2badc6['web']){const _0xb167d8=getConsoleNextUrl(_0x2badc6[_0x54b143(0x233)],_0x54b143(0x19d)+_0x4135d0['id']);return console[_0x54b143(0x22b)](a22_0x36549d[_0x54b143(0x1ee)]('✔')+_0x54b143(0x1ae)+a22_0x36549d[_0x54b143(0x1ad)](_0xb167d8)),openBrowser(_0xb167d8),0x0;}return await handleSingleObjectOutput(_0x4135d0,_0x55ca45),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x22549a(0x1c0)]='segment:parent:desc';['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a22_0x22549a(0x26e)](_0x13a383){const _0x24f498=a22_0x22549a,{options:_0x2eee80,args:_0x1aeef9,tdx:_0x4d63f4}=_0x13a383,_0x918e7f=_0x1aeef9[0x0]||_0x2eee80[_0x24f498(0x214)];if(!_0x918e7f)return showParentSegmentNotSetError(_0x24f498(0x227)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x2eee80[_0x24f498(0x1f3)]&&(console[_0x24f498(0x22b)]('Site:\x20'+_0x2eee80[_0x24f498(0x233)]),console[_0x24f498(0x22b)]('Parent\x20segment:\x20'+_0x918e7f));const _0x3062ba=await withSpinner(_0x24f498(0x220)+_0x918e7f+_0x24f498(0x25c),()=>_0x4d63f4[_0x24f498(0x269)][_0x24f498(0x190)](_0x918e7f),{'verbose':_0x2eee80[_0x24f498(0x1f3)]}),_0x39df5e=_0x3062ba[_0x24f498(0x18e)],_0x536983=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x918e7f+'\x27...',()=>_0x4d63f4[_0x24f498(0x269)][_0x24f498(0x23d)](_0x39df5e),{'verbose':_0x2eee80[_0x24f498(0x1f3)]}),_0x43793b=await executeSchemaQuery(_0x536983[_0x24f498(0x18e)],_0x4d63f4,_0x2eee80);return await handleQueryOutput(_0x43793b,_0x2eee80),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a22_0x22549a(0x171);[a22_0x22549a(0x1e8)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a22_0x22549a(0x26e)](_0x3e45a3){const _0xe40650=a22_0x22549a,{options:_0x5056ab,args:_0x26f8d4,tdx:_0x9f3e2d}=_0x3e45a3,_0x6a5fa1=_0x26f8d4[0x0]||_0x5056ab['parentSegment'];if(!_0x6a5fa1)return showParentSegmentNotSetError(_0xe40650(0x1f0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x5056ab[_0xe40650(0x1f3)]&&(console[_0xe40650(0x22b)](_0xe40650(0x25d)+_0x5056ab[_0xe40650(0x233)]),console[_0xe40650(0x22b)](_0xe40650(0x250)+_0x6a5fa1));const _0x35f904=await withSpinner(_0xe40650(0x220)+_0x6a5fa1+'\x27...',()=>_0x9f3e2d[_0xe40650(0x269)][_0xe40650(0x190)](_0x6a5fa1),{'verbose':_0x5056ab[_0xe40650(0x1f3)]}),_0x4c8b8d=_0x35f904[_0xe40650(0x18e)],_0x1b4042=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x6a5fa1+_0xe40650(0x25c),()=>_0x9f3e2d[_0xe40650(0x269)][_0xe40650(0x23d)](_0x4c8b8d),{'verbose':_0x5056ab[_0xe40650(0x1f3)]}),_0x458808=_0x1b4042[_0xe40650(0x18e)];return _0x5056ab[_0xe40650(0x228)]===_0xe40650(0x222)||_0x5056ab['format']==='jsonl'?await handleSDKOutput([{'sql':_0x458808}],_0x5056ab):console[_0xe40650(0x1db)](_0x458808),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x22549a(0x1c0)]=a22_0x22549a(0x187);[a22_0x22549a(0x1e8)]=a22_0x22549a(0x25f);async[a22_0x22549a(0x26e)](_0x5a6b8c){const _0x418de3=a22_0x22549a,{options:_0x3459d1,args:_0x1eab48,tdx:_0x1dfa97}=_0x5a6b8c,_0x51da89=_0x1eab48[0x0]||_0x3459d1[_0x418de3(0x214)];if(!_0x51da89)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x418de3(0x27a)),0x1;_0x3459d1['verbose']&&(console[_0x418de3(0x22b)](_0x418de3(0x25d)+_0x3459d1[_0x418de3(0x233)]),console[_0x418de3(0x22b)](_0x418de3(0x250)+_0x51da89));const _0x83b2c7=await withSpinner(_0x418de3(0x220)+_0x51da89+_0x418de3(0x25c),()=>_0x1dfa97['segment'][_0x418de3(0x190)](_0x51da89),{'verbose':_0x3459d1[_0x418de3(0x1f3)]}),_0x54e999=_0x83b2c7[_0x418de3(0x18e)],_0x32a167=await withSpinner(_0x418de3(0x1d9)+_0x51da89+'\x27...',()=>_0x1dfa97[_0x418de3(0x269)][_0x418de3(0x23d)](_0x54e999),{'verbose':_0x3459d1[_0x418de3(0x1f3)]});let _0x3e4b57=_0x32a167[_0x418de3(0x18e)];const _0x37ef81=resolveLimit(_0x3459d1['limit'],DEFAULT_DISPLAY_LIMIT),_0x246b80=/\bLIMIT\s+\d+/i[_0x418de3(0x1f2)](_0x3e4b57);!_0x246b80&&(_0x3e4b57=_0x3e4b57[_0x418de3(0x218)]()[_0x418de3(0x23e)](/;+$/,''),_0x3e4b57=_0x418de3(0x1d7)+_0x3e4b57+_0x418de3(0x1c5)+_0x37ef81);_0x3459d1[_0x418de3(0x1f3)]&&console[_0x418de3(0x22b)](_0x418de3(0x211)+_0x3e4b57);const _0x5a4225=await withProgressSpinner(_0x418de3(0x23a),async _0x10e377=>{const _0x4c3ac4=_0x418de3,_0x4f9d5c=await _0x1dfa97[_0x4c3ac4(0x236)]['execute'](_0x3e4b57,{'catalog':'td','schema':_0x4c3ac4(0x1bc),'onJobId':_0xff6b33=>{const _0x3f5e48=_0x4c3ac4;_0x10e377[_0x3f5e48(0x242)](_0xff6b33);}});return _0x4f9d5c;},{'verbose':_0x3459d1[_0x418de3(0x1f3)]}),_0x3c3f9d=_0x5a4225[_0x418de3(0x18e)],_0x875054=_0x3c3f9d[_0x418de3(0x172)]?_0x418de3(0x27c)+_0x3c3f9d[_0x418de3(0x172)]+']':'';return console[_0x418de3(0x22b)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x3c3f9d[_0x418de3(0x28c)][_0x418de3(0x19e)]['toLocaleString']()+_0x418de3(0x1fa)+(_0x418de3(0x18b)+formatElapsed(_0x3c3f9d[_0x418de3(0x28c)][_0x418de3(0x271)])+_0x875054)),await handleQueryOutput(_0x3c3f9d,_0x3459d1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a23_0x507c66=a23_0x2616;function a23_0x2616(_0x53332f,_0x4b565e){_0x53332f=_0x53332f-0x1ac;const _0x2f450a=a23_0x2f45();let _0x261624=_0x2f450a[_0x53332f];return _0x261624;}(function(_0x432276,_0x67227){const _0x43a9df=a23_0x2616,_0x5a0cb4=_0x432276();while(!![]){try{const _0xcdf947=parseInt(_0x43a9df(0x1b0))/0x1+-parseInt(_0x43a9df(0x1bb))/0x2*(parseInt(_0x43a9df(0x1b3))/0x3)+-parseInt(_0x43a9df(0x1b5))/0x4+-parseInt(_0x43a9df(0x1b4))/0x5*(-parseInt(_0x43a9df(0x1ba))/0x6)+-parseInt(_0x43a9df(0x1af))/0x7+parseInt(_0x43a9df(0x1c0))/0x8+parseInt(_0x43a9df(0x1c1))/0x9*(parseInt(_0x43a9df(0x1bc))/0xa);if(_0xcdf947===_0x67227)break;else _0x5a0cb4['push'](_0x5a0cb4['shift']());}catch(_0x3a7c5d){_0x5a0cb4['push'](_0x5a0cb4['shift']());}}}(a23_0x2f45,0xcad87));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a23_0x2f45(){const _0xeac447=['334770eeSMkG','description','length','log','2659488UOLBOp','279KoRTgW','Error:\x20','config','profiles','map','scope','184156LTdUdo','638890OpLGCV','name','execute','1668XSlYbe','5MaqFYi','2281948ueHnzn','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message','\x20\x20Global:\x20~/.config/tdx/tdx.json','List\x20all\x20available\x20profiles','681222tublYD','2500MXsKDX'];a23_0x2f45=function(){return _0xeac447;};return a23_0x2f45();}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x507c66(0x1b1)]=a23_0x507c66(0x1ac);[a23_0x507c66(0x1bd)]=a23_0x507c66(0x1b9);async[a23_0x507c66(0x1b2)](_0x5271ed){const _0x5c1bd5=a23_0x507c66,{options:_0x3d156a}=_0x5271ed;try{const _0x100c5e=listProfiles(),_0x2a3ad5=getActiveProfile();if(_0x100c5e[_0x5c1bd5(0x1be)]===0x0)return console[_0x5c1bd5(0x1bf)](_0x5c1bd5(0x1b6)),console[_0x5c1bd5(0x1bf)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5c1bd5(0x1bf)](_0x5c1bd5(0x1b8)),0x0;const _0x4ba941=_0x100c5e[_0x5c1bd5(0x1ad)](_0x3e2220=>{const _0x3b708c=_0x5c1bd5,_0x270c5c=_0x3e2220[_0x3b708c(0x1b1)]===_0x2a3ad5,_0x129a18=getProfileParams(_0x3e2220[_0x3b708c(0x1c3)]);return{'name':_0x3e2220['name'],'active':_0x270c5c,'scope':_0x3e2220[_0x3b708c(0x1ae)],'description':_0x3e2220['config'][_0x3b708c(0x1bd)]||'','params':_0x129a18};});return await handleSDKOutput(_0x4ba941,_0x3d156a),0x0;}catch(_0x3906c9){return _0x3906c9 instanceof Error&&console['error'](_0x5c1bd5(0x1c2)+_0x3906c9[_0x5c1bd5(0x1b7)]),0x1;}}}
|